UNION, INTERSECT & EXCEPT · Question 14 · Medium

Table SectionA: name | marks Gita | 70 Hari | 90 Table SectionB: name | marks Isha | 80 Jay | 60 Which names does this query return?

SELECT name FROM SectionA WHERE marks > 75
UNION
SELECT name FROM SectionB WHERE marks > 75
ORDER BY name;
  1. Hari; Isha
  2. Gita; Hari; Isha
  3. Hari
  4. Gita; Hari; Isha; Jay
Answer and explanation

Answer: A. Hari; Isha

Explanation: Each WHERE belongs to its own SELECT and filters that table before the UNION. SectionA contributes Hari (90) and SectionB contributes Isha (80); Gita (70) and Jay (60) fail the filter.

Previous: Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina… · Next: Table Customer(cust_id, name) has 5 rows and table Supplier(supp_id, name) has…

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