SQL Union MCQs

This section focuses on the "Union" of the SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. To combine multiple retrievals, we write several SELECT statements and put the keyword between them. What is the keyword?

A. COMBINE
B. CONCAT
C. JOIN
D. UNION

View Answer


2.  What is ‘xyz’ in the following SQL statement? SELECT xyz FROM table1 UNION xyz FROM table2;

A. row name
B. column name
C. table name
D. database name

View Answer


3. Which keyword used with UNION does not retain duplicate rows?

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

View Answer


4. Which clause is used to sort a UNION result as a whole?

A. LIMIT
B. ORDER BY
C. GROUP BY
D. SORT

View Answer


5. SELECT on a MERGE table is like _____________

A. UNION ALL
B. UNION
C. UNION DISTINCT
D. JOIN

View Answer


6. Which one is correct syntax for applying UNION operator?

A. SELECT column_name(s) FROM table_name1 UNION table_name2
B. SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2
C. UNION SELECT column_name(s) FROM table_name1 SELECT column_name(s) FROM table_name2
D. SELECT FROM table_name1 AND table_name2

View Answer


7. Which of the following command displays distinct rows?

A. UNION
B. UNION ALL
C. None of the above
D. Both A and B

View Answer


8. Is UNION or UNION ALL operator valid for LONG data type column?

A. True True
B. True False
C. False True
D. False False

View Answer


9.  If we know the records returned by our query are unique then which operator will be preferred out of UNION or UNION ALL?

A. UNION
B. UNION ALL
C. Both A and B
D. None of the above

View Answer


10. Which of the following statement(s) is/are True about UNION?

A. Data Types in all queries in a UNION must match position wise
B. Column Names in all queries in a UNION must match position wise
C. UNION can be used with UPDATE statement
D. None of the above

View Answer






Also check :


Discussion


* You must be logged in to add comment.