Vidyalelo
MySQL · Q1133

MySQL

Programming · MySQL · question 1133

Q1133

The keyword used with UNION that retains duplicate rows is . . . . . . . .

A.
ALL
Answer
B.
NARROW
C.
STRICT
D.
DISTINCT

Answer: Option A

Solution

Answer: Option A
Solution:
This question is about how to combine results from multiple queries in MySQL. The UNION keyword is used to merge the results of two or more SELECT statements.

The UNION operator by default removes duplicate rows.

The question asks for the keyword that keeps duplicate rows. The answer is:

Option A: ALL

The UNION ALL operator combines the result sets of the multiple queries, including any duplicate rows.

Here's how to remember it:

* UNION removes duplicates.
* UNION ALL keeps all rows, including duplicates.