?
Suppose it is desired that UNION operation should return not more than 3 rows. Which keyword is used for this?
Answer & Solution
Correct Answer:
Option
A
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.
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.
Join the Discussion
Login to post a comment or share your explanation.
Login