SQL exercises
Filter by difficulty, topic, or the business database behind the question. Progress stays on this device until you create an account.
Loading exercises…
Filter by difficulty, topic, or the business database behind the question. Progress stays on this device until you create an account.
Loading exercises…
Show each employee and the manager they report to.
HR · 15 min
JOINs
Start challengeSum succeeded payments by calendar month.
E-commerce · 14 min
Date functions · GROUP BY
Start challengeReturn one current salary row per employee.
HR · 16 min
Window Functions · JOINs
Start challengeRank products by recognized revenue.
E-commerce · 18 min
Window Functions · GROUP BY · JOINs
Start challengeCalculate spend per customer on paid and shipped orders.
E-commerce · 16 min
CTEs · JOINs · GROUP BY
Start challengeFor each workspace creation month, count workspaces and how many are currently active.
SaaS · 20 min
CTEs · Subqueries · Case statements · GROUP BY
Start challengeMeasure how long each closed job-history role lasted, in calendar months.
HR · 16 min
Date functions · JOINs
Start challengeFind the customer with the highest recognized spend in each country.
E-commerce · 20 min
Window Functions · CTEs · JOINs · GROUP BY
Start challengeFind email addresses that were captured more than once.
Marketing · 12 min
GROUP BY · HAVING
Start challenge