SQL practice: UNION: Stacking Results
Chapter 15 · 7 questions · included in full access
Question 1 · easy
Solve it in your browserMake one list of all cities in customers and branches, without duplicates.
Question 2 · easy
Solve it in your browserFind cities that appear in both customers and branches.
Question 3 · medium
Solve it in your browserFind cities that have a customer but no branch.
Question 4 · medium
Solve it in your browserFind cities that have a branch but no customer.
Question 5 · medium
Solve it in your browserMake a combined list of all names — every customer_name and every employee_name — with a second column saying which kind each one is.
Question 6 · hard
Solve it in your browserExplain why 15-1 with UNION ALL gives more rows than with UNION.
Question 7 · hard
Solve it in your browserBuild one list of every city that has a customer or a branch, each city once. The query errors. Fix it.
These questions are part of full access.
The first chapters of every track are free. Full access is a one-time payment.
See pricing