🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Subqueries and Views: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. A subquery that refers to a column of the outer query is called:
  2. Q2. What is the difference between UNION and UNION ALL?
  3. Q3. Why can NOT IN (subquery) return no rows unexpectedly?
  4. Q4. What does a (non-materialized) view store?
  5. Q5. Which keyword starts a Common Table Expression?
  6. Q6. SELECT name FROM employees WHERE deptid = (SELECT deptid FROM departments) fails or misbehaves. Why?
  7. Q7. Using the company table, how many employees earn more than the average salary of department 20 (58000)?
  8. Q8. Why can EXISTS be efficient?
  9. Q9. SELECT city FROM employees UNION ALL SELECT city FROM employees WHERE deptid = 10 returns how many rows?
  10. Q10. What is a materialized view?