Practice · Economy · Medium
Return a single de-duplicated, sorted list of every year that appears in either the inflation table or the crops table, in a column named year.
Runs in your browser. No signup needed.
SELECT year FROM inflation UNION SELECT year FROM crops.
SELECT year FROM inflation
UNION
SELECT year FROM crops
ORDER BY year;
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.
UNION lets you pool a dimension (here, years) from tables that don’t otherwise join — handy for building a complete axis. (SQLite docs)