Examveda
Examveda

The keyword used with UNION that does not retain duplicate rows is . . . . . . . .

A. ALL

B. NARROW

C. STRICT

D. DISTINCT

Answer: Option D

Solution(By Examveda Team)

DISTINCT: When used with UNION, the DISTINCT keyword ensures that duplicate rows are eliminated from the combined result set. It retains only unique rows across all the result sets being combined using UNION. Therefore, if there are any duplicate rows in the result sets, they will be removed, and only distinct rows will be included in the final result set.
ALL: The ALL keyword, when used with UNION, retains all rows from the combined result sets, including duplicates. It is the default behavior of UNION if no keyword is specified. This option is incorrect because it retains duplicate rows, contrary to the requirement.
NARROW: This option is incorrect. There is no keyword named NARROW associated with UNION in MySQL.
STRICT: This option is incorrect. The STRICT keyword is not used with UNION in MySQL.

Therefore, the keyword used with UNION that eliminates duplicate rows is Option D: DISTINCT.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous