The following SQL statement is invalid.
SELECT abc, xyz FROM table1 UNION abc, def FROM table2;
SELECT abc, xyz FROM table1 UNION abc, def FROM table2;A. True
B. False
Answer: Option B
Solution (By Examveda Team)
This question is about understanding how the UNION operator works in MySQL.UNION is used to combine the results of two or more SELECT statements. The combined result will only include distinct rows, meaning duplicate rows are eliminated.
The provided SQL statement is invalid because UNION requires a complete SELECT statement on both sides. The statement is trying to combine a SELECT statement ( `SELECT abc, xyz FROM table1`) with a simple list of columns (`abc, def FROM table2`) which is incorrect syntax.
Therefore, the correct answer is Option A: True.

Join The Discussion