Recall & Review
beginner
What are set operations in SQL?
Set operations combine results from two or more queries into a single result. Common set operations include UNION, INTERSECT, and EXCEPT.
Click to reveal answer
beginner
Why are set operations important in databases?
They help combine or compare data from multiple tables or queries easily, making data analysis and reporting simpler and more efficient.
Click to reveal answer
beginner
What does UNION do in SQL?
UNION merges results from two queries and removes duplicate rows, showing all unique rows from both queries.
Click to reveal answer
intermediate
How does INTERSECT differ from UNION?
INTERSECT returns only the rows that appear in both query results, showing common data between them.
Click to reveal answer
intermediate
What is the role of EXCEPT in SQL set operations?
EXCEPT returns rows from the first query that are not present in the second query, helping find differences between datasets.
Click to reveal answer
Which SQL set operation removes duplicate rows when combining results?
✗ Incorrect
UNION combines results and removes duplicates, unlike JOIN which combines rows based on related columns.
What does INTERSECT return?
✗ Incorrect
INTERSECT returns only the rows that appear in both query results.
Which set operation helps find rows in the first query but not in the second?
✗ Incorrect
EXCEPT returns rows from the first query that are not present in the second query.
Why are set operations useful in SQL?
✗ Incorrect
Set operations help combine or compare data from multiple queries efficiently.
Which of these is NOT a set operation in SQL?
✗ Incorrect
GROUP BY is used for aggregation, not a set operation.
Explain in your own words why set operations matter when working with databases.
Think about how you might want to see data from two lists together or find common or different items.
You got /4 concepts.
Describe the difference between UNION, INTERSECT, and EXCEPT in SQL.
Focus on what each operation returns when combining two sets of data.
You got /3 concepts.