CS FundamentalsModerateCapgemini · Cognizant GenC

T(v) holds 40, 10, 30, 20, 50. What does SELECT v FROM T ORDER BY v DESC LIMIT 2 OFFSET 1 return, in order?

  1. A. 50, 40
  2. B. 30, 20
  3. C. 40, 30
  4. D. 40, 10

Correct answer: C. 40, 30

Sorted descending: 50, 40, 30, 20, 10. OFFSET 1 skips 50, and LIMIT 2 takes 40 and 30.

More DBMS and SQL questions

Exams that ask this topic