SQL Fundamentals
Interview Questions
- What is the difference between WHERE and HAVING?
- Explain INNER JOIN vs LEFT JOIN vs RIGHT JOIN.
- What is the difference between GROUP BY and DISTINCT?
- What is a subquery? When would you use one?
- What is a CTE and why would you use it?
- What are window functions? Explain ROW_NUMBER(), RANK(), and DENSE_RANK().
- What is the difference between UNION and UNION ALL?
- How would you find duplicate records?
- How would you find the second-highest salary?
- How would you optimize a query containing multiple JOINs?
Next TopicQuery Lifecycle