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…
Find workspaces that were invoiced in one month and again in the next calendar month.
SaaS · 16 min
CTEs · Date functions · JOINs
Start challengeShow how many days each in-transit shipment has been open as of 15 March 2025.
Logistics · 12 min
Date functions · WHERE
Start challengeFind the vendor with the highest non-void bill total in each vendor category.
Finance · 18 min
Window Functions · CTEs · JOINs · GROUP BY
Start challengeFind patients whose earliest encounter was an inpatient stay.
Healthcare · 16 min
CTEs · JOINs · WHERE
Start challengeSubtract posted expenses from posted sales revenue for each month that has both.
Finance · 18 min
CTEs · JOINs · GROUP BY · Data cleaning
Start challengeReturn the product or products tied for the second-highest list price.
E-commerce · 12 min
Subqueries · WHERE
Start challengeCalculate the percent of claims denied in each department.
Healthcare · 14 min
JOINs · GROUP BY · Case statements
Start challengeFor each signup month, count users and how many of them ever triggered an event.
SaaS · 16 min
CTEs · Case statements · GROUP BY · Date functions
Start challenge