Learn / SQL / Sort and limit

SQL, lesson 3 of 6

Sort and limit

ORDER BY sorts the rows. Add DESC for high-to-low. LIMIT keeps only the first few rows:

SELECT name, openings FROM languages ORDER BY openings DESC LIMIT 3;

That gives the three languages with the most job openings, most first. Without DESC, sorting goes low-to-high.

Your turn

Show the name and year of the three oldest languages, oldest first.

Tables you can use

languages (name, year, paradigm, openings): one row per language. openings is the number of job openings, in thousands.

creators (language, creator): who created each language.

Press Run to see your results.