Skip to content
Related Articles
Open in App
Not now

Related Articles

UGC-NET | UGC NET CS 2018 July – II | Question 62

Improve Article
Save Article
  • Last Updated : 14 Sep, 2018
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!