adplus-dvertising
frame-decoration

Question

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).Titles of the seven most expensive books.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. 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...

Similar Questions

Discover Related MCQs

Q. In a Hierachical database, a hashing function is used to locate the .................

Q. Relations produced from E - R Model will always be in ..............

Q. Consider the following schedules involving two transactions.

S1 : r1(X) ; r1(Y) ; r2(X) ; r2(Y) ; w2(Y) ; w1(X)
S2 : r1(X) ; r2(X) ; r2(Y) ; w2(Y) ; r1(Y) ; w1(X)

Which one of the following statements is correct with respect to above?

Q. 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 dependencies and those that can be inferred from them hold:

a → c
b → d

The relation is in ...............

Q. A many-to-one relationship exists between entity sets r1 and r2. How will it be represented using functional depedencies if Pk(r) denotes the primary key attribute of relation r?

Q. Database systems that store each relation in a separate operating system file may use the operating system’s authorization scheme, instead of defining a special scheme themselves. In this case, which of the following is false?

Q. Let R1(a, b, c) and R2(x, y, z) be two relations in which a is the foreign key of R1 that refers to the primary key of R2. Consider following four options.

(a) Insert into R1 (b) Insert into R2
(c) Delete from R1 (d) Delete from R2

Which of the following is correct about the referential integrity constraint with respect to above?

Q. Consider a hash table of size seven, with starting index zero, and a hash function (7x+3) mod 4. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Here “__” denotes an empty location in the table.

Q. Which of the following is/are true with reference to 'view' in DBMS?

(a) A 'view' is a special stored procedure executed when certain event occurs.
(b) A 'view' is a virtual table, which occurs after executing a pre-compiled query.

Q. In SQL, .................. is an Aggregate function.

Q. Match the following with respect to RDBMS:

List - I
(a) Entity integrity
(b) Domain integrity
(c) Referential integrity
(d) Userdefined integrity

List - II
(i) enforces some specific business rule that do not fall into entity or domain
(ii) Rows can't be deleted which are used by other records
(iii) enforces valid entries for a column
(iv) No duplicate rows in a table

Code:
(a) (b) (c) (d)

Q. In RDBMS, different classes of relations are created using ................... technique to prevent modification anomalies.

Q. .................. SQL command changes one or more fields in a record.

Q. If every non-key attribute is functionally dependent on the primary key, then the relation is in ....................

Q. Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is atomic, and following functional dependencies exist.

CH → G
A → BC
B → CFH
E → A
F → EG

The relation R is ....................

Q. Given two relations R1(A, B) and R2(C, D), the result of following query
Select distinct A, B from R1, R2
is guaranteed to be same as R1 provided one of the following condition is satisfied.

Q. Consider a schema R(A, B, C, D) and following functional dependencies.

A → B
B → C
C → D
D → B

Then decomposition of R into R1(A, B), R2(B, C) and R3(B, D) is ..................