UNION, INTERSECT & EXCEPT · Question 13 · Medium

UNION, INTERSECT & EXCEPT question 13

Table Cricket:
student
Aman
Bina
Chetan
Bina

Table Football:
student
Bina
Divya
Aman

The INTERSECT of the two tables on student returns 2 rows (Aman and Bina). What does this join version return?

SELECT COUNT(*)
FROM Cricket c
JOIN Football f ON c.student = f.student;
  1. 2
  2. 4
  3. 3
  4. 12
Answer and explanation

Answer: C. 3

Explanation: A join pairs every matching combination and does not remove duplicates. Aman matches once, and each of the two Bina rows in Cricket matches the one Bina row in Football, giving 1 + 2 = 3. A join equals INTERSECT only if DISTINCT is added.

Previous: Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina… · Next: Table SectionA: name | marks Gita | 70 Hari | 90 Table SectionB: name | marks…

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