UNION, INTERSECT & EXCEPT · Question 4 · Easy

Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina Divya Aman Which names does this EXCEPT query return?

SELECT student FROM Cricket
EXCEPT
SELECT student FROM Football;
  1. Chetan
  2. Divya
  3. Chetan; Divya
  4. Aman; Bina
Answer and explanation

Answer: A. Chetan

Explanation: EXCEPT returns the rows of the first query that are not in the second. Of the cricket players, Aman and Bina also play football, so only Chetan is left. Divya is not in the first table at all.

Previous: Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina… · Next: Which condition must two SELECT statements satisfy before they can be combined…

Practise union, intersect & except

Try a fresh set of union, intersect & except questions with an explanation after every answer, free and without signing up: UNION, INTERSECT & EXCEPT practice. Or sit a full placement mock test.

More union, intersect & except questions

More sql practice

Tables, Keys & Constraints · DML & Transactions · SELECT, WHERE & ORDER BY · SQL Joins · Aggregates & GROUP BY · Subqueries & CTEs · Window Functions · NULL Handling

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge