Examveda

Suppose it is desired that UNION operation should return not more than 3 rows. Which keyword is used for this?

A. LIMIT

B. RESTRICT

C. COUNT

D. SORT

Answer: Option A

Solution (By Examveda Team)

This question asks about a way to limit the number of rows returned from a UNION operation in MySQL. UNION combines the results of multiple SELECT statements into a single result set.

Let's look at the options:

Option A: LIMIT
The LIMIT keyword is used to limit the number of rows returned by a query. This is the correct answer.

Option B: RESTRICT
RESTRICT is not a valid keyword in MySQL for limiting results.

Option C: COUNT
COUNT is used to count the number of rows in a result set, but it doesn't limit the number of rows returned.

Option D: SORT
SORT is used to order the rows in a result set, but it doesn't limit the number of rows returned.

In conclusion:
To limit the number of rows returned by a UNION operation to 3, you would use the LIMIT keyword.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous