I have been asked to return some specific recordsets using sub-queries however I find myself having difficulty understanding how to use sub-queries to get specific results.
E.x. Using a sub-query, list the productName(s) from the products table for orderNumber 10121 from the orderdetails table.
WHERE (SELECT orderNumber FROM orderdetails WHERE orderNumber = 10121);
You are very close. It always helps me to view the subquery as returning an array of objects you will check. So for this example, you probably have a productNumber in both of these tables to make them relational. Therefore, your SQL would be something like:
SELECT productName FROM products WHERE productNumber IN (SELECT productNumber FROM orderdetails WHERE orderNumber = 10121);
This subquery will get all of the productNumbers for this order, and then your query will grab the product names for all of these products!