UNION, INTERSECT & EXCEPT · Question 1 · Easy
Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina Divya Aman Which names does this query return?
SELECT student FROM Cricket
UNION
SELECT student FROM Football
ORDER BY student;
- Aman; Aman; Bina; Bina; Bina; Chetan; Divya
- Aman; Bina
- Aman; Bina; Bina; Chetan; Divya
- Aman; Bina; Chetan; Divya
Answer and explanation
Answer: D. Aman; Bina; Chetan; Divya
Explanation: UNION puts the rows of both queries together and then removes all duplicates, including the repeated Bina inside Cricket itself. Four different names remain.
Next: Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina…
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
- Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina…
- Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina…
- Table Cricket: student Aman Bina Chetan Bina Table Football: student Bina…
- Which condition must two SELECT statements satisfy before they can be combined…
- Two queries are known to have no rows in common, and neither has duplicates…
- A query is written as SELECT emp_name FROM Staff UNION SELECT trainee_name…
- Table MondaySale: item Tea Samosa Tea Vada Table TuesdaySale: item Samosa Poha…
- Table Employee: id | name 1 | Kavya 2 | Lokesh Table Intern: id | name |…
- Table SectionA: name | marks Gita | 70 Hari | 90 Table SectionB: name | marks…
- Table Store: city | product Pune | Pen Pune | Ink Table Depot: city | product…
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