Set Operations

📝 Set Operations

Total Questions: 5
Click an answer to select it, then click "Check Answers" to see your results.
Question 1

What must be true for set operations like **UNION** to work between two queries?

A.

A) Identical table names

B.

B) Compatible data types and column structures

C.

C) Same number of rows

D.

D) Matching column names exactly

Question 2

Which is NOT a requirement for set operations like **UNION ALL**?

A.

A. Matching data types

B.

B. Same column order

C.

C. Identical number of columns

D.

D. Elimination of duplicates

Question 3

Why might you rewrite a query with a complex WHERE clause using **UNION** instead?

A.

A. To increase query execution time.

B.

B. To break it into simpler, more readable parts by filtering separately.

C.

C. To add unrelated columns from other tables.

D.

D. To force duplicate removal across all data.

Question 4

What does the **INTERSECT** operation return from two compatible SELECT queries?

A.

A. All rows from the first query

B.

B. All rows from both queries combined

C.

C. Only rows that appear in both queries

D.

D. Rows from the first query not in the second

Question 5

What does the **EXCEPT** operation return in SQL?

A.

A. Rows common to both queries

B.

B. All rows from the second query

C.

C. Rows from the first query not in the second query

D.

D. Union of both queries

Quiz Complete!

Score: 0 / 5