SQL
Free Section Starter Challenge
20 min
3. Sorting Results with ORDER BY & Limiting with LIMIT
Overview: Sort rows in ascending or descending order and paginate using `LIMIT`.
Concept & Syntax Guide
Use `ORDER BY price_inr DESC` to sort highest to lowest. Adding `LIMIT 5` returns only the top 5 records.
Hands-On Practice Exercise
Get Top 3 Highest Priced Items
Select `name` and `price_inr` from `templates` ordered by `price_inr DESC` limited to `3` rows.
Target Output:
LIMIT 3
Need a hint? Click here to reveal
Hint: Check syntax carefully and make sure your code contains:
LIMIT 3
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10