How do you write a query for data filtering using the parch and posey DB for the following –
i) Retrieve the order id and the quantity ordered of only standard paper.
ii) Identify the top 10 total orders by paper quantity ordered
iii) Identify large total orders that are greater than 2000 pieces
I tried the following and i got errors.
-
SELECT order_id, quantity_ordered
FROM orders
WHERE paper_type = ‘standard paper’ -
SELECT order_id, SUM(quantity_ordered) as total_quantity
FROM orders
GROUP BY order_id
ORDER BY total_quantity DESC
LIMIT 10 -
SELECT order_id, SUM(quantity_ordered) as total_quantity
FROM orders
GROUP BY order_id
HAVING total_quantity > 2000
campus connections is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.