DataDesk
All topics
ORDER BY, LIMIT & DISTINCT — practice · DataDesk
DataDesk
How it works
Scenarios
Practice
For trainers
Pricing
Log in
Start free
SQL
ORDER BY, LIMIT & DISTINCT
Sort, take the top rows and remove duplicates.
0
/ 20 solved
All levels
Basic (6)
Intermediate (7)
Advanced (7)
All
To do
Solved
1
Sort ascending
Basic
2
Sort descending
Basic
3
Top 5
Basic
4
Unique cities
Basic
5
Sort by text
Basic
6
Newest hires
Basic
7
Sort by two columns
Intermediate
8
Distinct pairs
Intermediate
9
Skip and take
Intermediate
10
Sort by a calculation
Intermediate
11
NULLs at the end
Intermediate
12
Cheapest per category list
Intermediate
13
How many distinct?
Intermediate
14
Custom sort order
Advanced
15
Second highest salary
Interview
Advanced
16
Youngest and oldest hire
Advanced
17
Top 3 with ties
Interview
Advanced
18
Distinct cities, sorted by length
Advanced
19
Most recent order per status
Advanced
20
Page 3 of the catalogue
Advanced