Your question is Summarize with Group By and Having. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
H-E-B wants a quick summary of sales by merchandise department. Write a PostgreSQL query using GROUP BY and HAVING to identify departments that generated at least $500 in sales.
500.00, ordered from highest to lowest total sales.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| department | VARCHAR(50) | H-E-B merchandise department |
| sale_amount | NUMERIC(10,2) | Sale amount, which may be NULL |