Multiple choice technology databases

With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

  1. SELECT * FROM Persons SORT BY 'FirstName' DESC

  2. SELECT * FROM Persons SORT 'FirstName' DESC

  3. SELECT * FROM Persons ORDER BY FirstName DESC

  4. SELECT * FROM Persons ORDER FirstName DESC

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

SQL uses ORDER BY for sorting, with DESC for descending order. Option C has correct syntax: SELECT * FROM Persons ORDER BY FirstName DESC. Options A and B use SORT which is not valid SQL, and Option D uses ORDER without BY which is incomplete.