UGC-NET | UGC NET CS 2018 July – II | Question 62
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
(A) Titles of the six most expensive books.
(B) Title of the sixth most expensive books.
(C) Titles of the seven most expensive books.
(D) Title of the seventh most expensive books.
Answer: (C)
Explanation:
Select title from book as B where (select count ( * ) from book as T where T.price > B.price) < 7
It will return titles of the seven most expensive books.
So, option (C) is correct.
Quiz of this Question
Please Login to comment...