Multiple choice technology mainframe

Given the table: COUNTRY NAME CITIES PERSON Argentina 30 1 Cuba 20 2 Canada 10 2 Germany 40 1 Given the statement: SELECT name,cities FROM country Which of the following clauses must be added to the statement for it to return rows sorted by NAME ascending and then sorted by CITIES ascending?

  1. ORDER BY 2,1

  2. ORDER BY 2 ASC, 1 ASC

  3. ORDER BY 1,2

  4. ORDER BY 1 ASC, 2 ASC

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

ORDER BY 1,2 sorts first by the first selected column (name) then by the second (cities) in ascending order by default; specifying ASC explicitly (1 ASC,2 ASC) does the same. Using column numbers 2,1 or 2 ASC,1 ASC would reverse the intended order.