L3 Q3
Advanced Level
Practice Question
Level 3 - Question 3: UNION and INTERSECT Operations
Scenario
A university maintains separate tables for current students and alumni. They want to find students who are in both lists (perhaps due to data duplication).
Task
Write a query using INTERSECT to find student IDs that appear in both the current_students and alumni tables.
Sample Schema: current_students
| student_id | name |
|---|---|
| 1001 | Alice Brown |
| 1002 | Bob Green |
| 1003 | Carol White |
Sample Schema: alumni
| student_id | name |
|---|---|
| 1002 | Bob Green |
| 1004 | David Black |
| 1005 | Emma Davis |