Which clause is used to sort a UNION result as a whole?
A. LIMIT
B. ORDER BY
C. GROUP BY
D. SORT
Answer: Option B
Solution (By Examveda Team)
This question asks about how to arrange the results of a UNION operation in MySQL.UNION combines the results of multiple SELECT queries into a single result set. However, the combined result might not be in the desired order.
Let's look at the options:
A: LIMIT - This clause is used to limit the number of rows returned, not for sorting.
B: ORDER BY - This is the correct answer. The ORDER BY clause is used to sort the results of a query, including the results of a UNION.
C: GROUP BY - This clause is used to group rows based on specific columns, and it doesn't directly affect sorting.
D: SORT - This clause is not a valid clause in MySQL.
In summary, to sort the combined results of a UNION, you would use the ORDER BY clause.
Related Questions on MySQL Miscellaneous
How is communication established with MySQL?
A. SQL
B. Network calls
C. A programming language like C++
D. APIs
Which type of database management system is MySQL?
A. Object-oriented
B. Hierarchical
C. Relational
D. Network

Join The Discussion