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

Quiz: SQL for Data Analysis: questions with answers

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

Take the timed quiz + get a certificate →
  1. Q1. What does SUM(CASE WHEN status = 'returned' THEN 1 ELSE 0 END) compute?
  2. Q2. Why is COUNT(CASE WHEN x 5 THEN 1 ELSE 0 END) a bug?
  3. Q3. In the CASE-based pivot, how many CASE expressions do you need?
  4. Q4. Which operation turns columns back into rows?
  5. Q5. What does SUM(SUM(amount)) OVER () give in a query grouped by city?
  6. Q6. Revenue was 2000 in January and 2500 in February. What is the month-on-month growth?
  7. Q7. Why should a funnel use COUNT(DISTINCT userid)?
  8. Q8. The first month in a LAG-based growth query shows NULL. What does that mean?
  9. Q9. Which is a portable way to add a grand total row in any database?