Practice · Agriculture · Easy
Return each distinct crop name, alphabetically.
Runs in your browser. No signup needed.
crops(crop, year, million_tonnes). Use SELECT DISTINCT and ORDER BY.
SELECT DISTINCT crop
FROM crops
ORDER BY crop;
The reference solution is checked automatically when you run your query on the practice page — results are compared row by row, and order matters for this one.
DISTINCT collapses duplicates — essential when a table stores many rows per thing (here, several years per crop). (SQLite docs)