Which query displays 'CustName' and 'Email' from the 'CUSTOMER' table, sorted alphabetically by 'CustName'?
Which query displays 'CustName' and 'Email' from the 'CUSTOMER' table, sorted alphabetically by 'CustName'?
Solution
✅ Correct Option: 2
In SQL, the ORDER BY clause sorts the result, and ASC (the default) sorts in ascending, i.e. alphabetical, order. Option 2 selects both columns in the asked order and sorts by CustName.
Option 1: SQL has no SORT BY clause in standard syntax, so the query gives an error.
Options 3 and 4: they sort by Email, not CustName.
ASC is optional because ascending is the default; use DESC for reverse order.
Related questions:
2026: 13 May Shift 2
2025: 30 May Shift 2