← Quiz: Subqueries and Views: all 10 questions
Quiz: Subqueries and Views · Question 9 of 10
SELECT city FROM employees UNION ALL SELECT city FROM employees WHERE deptid = 10 returns how many rows?
SELECT city FROM employees UNION ALL SELECT city FROM employees WHERE dept_id = 10 returns how many rows?
- A.10
- B.4
- C.7
- D.3
Answer & explanation
Correct answer: 10
UNION ALL keeps duplicates: 7 rows + 3 rows. With UNION it would be 4 distinct cities.
Can you get the rest right without peeking?
Take the timed Quiz: Subqueries and Views quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →