0
0
SQLquery~5 mins

EXCEPT (MINUS) for differences in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the SQL EXCEPT operator do?
The EXCEPT operator returns rows from the first query that are not present in the second query. It shows the difference between two result sets.
Click to reveal answer
beginner
How is EXCEPT different from UNION in SQL?
UNION combines rows from two queries, removing duplicates, while EXCEPT returns only rows from the first query that do not appear in the second.
Click to reveal answer
intermediate
Which SQL keyword is equivalent to EXCEPT in some databases like Oracle?
MINUS is equivalent to EXCEPT in Oracle and some other databases. Both return the difference between two queries.
Click to reveal answer
intermediate
Can EXCEPT be used with queries that return different columns?
No, both queries must return the same number of columns with compatible data types for EXCEPT to work.
Click to reveal answer
beginner
What happens if you use EXCEPT and the second query returns rows not in the first query?
Those rows are ignored because EXCEPT only returns rows from the first query that are missing in the second.
Click to reveal answer
What does the EXCEPT operator return in SQL?
ARows in the first query but not in the second
BRows common to both queries
CAll rows from both queries combined
DRows in the second query but not in the first
Which SQL keyword is similar to EXCEPT in Oracle?
AMINUS
BUNION
CINTERSECT
DJOIN
What must be true about the columns in queries used with EXCEPT?
AColumns must be named the same
BThey can have different numbers of columns
CThey must have the same number and compatible data types
DOnly the first column must match
If the second query returns rows not in the first, what does EXCEPT return?
AThose rows only
BAll rows from both queries
CNo rows
DRows from the first query missing in the second
Which of these is NOT a set operation in SQL?
AMINUS
BSELECT
CUNION
DEXCEPT
Explain how the EXCEPT operator works in SQL and when you might use it.
Think about comparing two lists and finding what is unique to the first.
You got /3 concepts.
    Describe the difference between EXCEPT and UNION in SQL.
    One combines, the other subtracts.
    You got /3 concepts.