All mock tests are FREE till 31 December — register to save your progress
Unit 4 · Database Management Systems Paper 2 CS · July 2018

Consider a relation book (title, price) which contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list ? Select title from book as B where (select count (*) from book as T where T.price > B.price) < 7

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. Titles of the seven most expensive books.

Explanation

A book is listed if fewer than 7 books cost more, so ranks 1 to 7: the seven most expensive titles.

More Database Management Systems questions