CSET3300 Lab 3 Sub Query and aggregation
Print the query and the resulting table
1. For ProductId 14, find the total quantity ordered for such product. Display the title of this
number as “Sum of Quantity”. You should use SQL aggregation on OrderDetails.
2. Find the maximum and minimum price across all Categories in Products shown as below( Note
this is partial of the resulting table) :
3. Find the ProductName and price whose category name is Seafood using subquery as shown
below ( Note this is partial of the resulting table) :
4. Find ProductID from OrderDetails when theses order are via ShipperID 3. Use subquery.
ProductID should not have duplicates. Order your result in increasing order.
The resulting table could be long. When copy to submission file, only copy the tuples where
ProductID is less than 11.
5. Use an inner join to find OrderID. ShipperID and Shipper name for orders whose ID is less than
10255. Order the result by OrderID. Part of the result id shown below:
6. Display the total quantity ordered for each product along with the IDs of the products. Display
the title of this number as “Sum of Quantity”. Don’t bother about the name of the product. Hint:
use SQL aggregation and grouping.