🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.10
  2. B.4
  3. C.7
  4. 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 →