SQL Union MCQs

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 keyword used with UNION retains duplicate rows?

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

View Answer


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

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

View Answer


6. Which table is used to run a UNION-type query on MyISAM tables?

A. TRADITIONAL
B. MERGE
C. SERVELET
D. UNITE

View Answer


7. SELECT on a MERGE table is like _____________

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

View Answer


8. What does UNION operator do in a SQL Server statement?

A. Bring common data from the listed tables.
B. Bring data which is not common from the listed tables.
C. Bring all data from the listed tables.
D. Bring all distinct from the listed tables.

View Answer


9. 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


10. What is true about order by with Union operator?

A. Order By can be issued in each result set.
B. It can be issued for the overall result set.
C. Both A & B.
D. None of the above

View Answer


11. 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


12. Which of the following statement is TRUE about UNION?

A. Each query in a UNION can be sorted independently in different sort orders
B. All the queries in a UNION must be against the same table
C. UNION clause is used to subtract rows of second query from the first query
D. UNION and UNION ALL give same result if the participating queries are mutually exclusive

View Answer


13. 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


14.  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


15. 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


16. Which of the following is not Constraint in SQL?

A. Primary Key
B. Not Null
C. Check
D. Union

View Answer


17. Which of the following is one of the basic approaches for joining tables?

A. Subqueries
B. Union Join
C. Natural join
D. All of the above

View Answer





Also check :


Discussion


* You must be logged in to add comment.