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
- In a Hierachical database, a hashing function is used to locate the ________.
- Relations produced from E - R Model will always be in ________.
- Consider the following schedules involving two transactions: S₁: r₁(X); r₁(Y); r₂(X); r₂(Y); w₂(Y); w₁(X) S₂: r₁(X); r₂(X); r₂(Y); w₂(Y); r…
- For a database relation R(a, b, c, d) where the domains of a, b, c and d include only atomic values, and only the following functional depe…
- A many-to-one relationship exists from entity set r₁ to entity set r₂. If Pk(r) denotes the primary key of relation r, how is it represente…
- Database systems that store each relation in a separate operating system file may use the operating system's authorization scheme, instead…