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