← All topics
Quiz: SQL Interview Queries: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which query finds duplicate emails in a users table?
- Q2. After departments LEFT JOIN employees, which gives 0 (not 1) for a department with no employees?
- Q3. Salaries are 90, 80, 80, 70. What is the second highest DISTINCT salary?
- Q4. Why write 100.0 SUM(x) / total instead of 100 SUM(x) / total?
- Q5. "Highest salary in each department with the employee name" — what must you mention?
- Q6. Which query gives the 3rd highest distinct salary using LIMIT and OFFSET?
- Q7. To delete duplicate emails but keep the first sign-up of each, which rows are kept?
- Q8. In the company table, how many people report directly to Asha?
- Q9. Which query lists employees who have no manager?
- Q10. Why is joined = '2022-01-01' AND joined < '2024-01-01' preferred over YEAR(joined) IN (2022, 2023)?