Arrange the following SQL clause in the correct order of writing a query:
A. DISTINCT
B. ORDER BY
C. WHERE
D. SELECT
Arrange the following SQL clause in the correct order of writing a query:
A. DISTINCT
B. ORDER BY
C. WHERE
D. SELECT
Solution
✅ Correct Option: 1
SELECT is always the first clause of a query.
DISTINCT comes next, because it is written right after SELECT: .
WHERE follows (after FROM, which is not in the list), to filter rows.
ORDER BY comes last, to sort the final result.
Option 4: places ORDER BY before WHERE, but ORDER BY always ends the query.
Option 2 and Option 3: DISTINCT is a modifier of SELECT, so it cannot come before it.
Related questions:
2025: 14 May Shift 1
2026: 23 May Shift 2
2025: 15 May Shift 2
2025: 13 May Shift 2