Loading…
Congratulations on reaching the capstone! Let's apply everything you've learned.
The store manager wants to know which category has the highest average price.
Write a query that shows:
Order the results by average price (highest first) and limit to 1 result.
You'll need to combine three concepts:
GROUP BY to get averages per categoryORDER BY ... DESC to sort highest firstLIMIT 1 to get only the top resultSELECT column, AGG(column)
FROM table
GROUP BY column
ORDER BY AGG(column) DESC
LIMIT 1;
Downloading SQL engine… (one-time)
This runs entirely in your browser and is cached for next time.