Interactive SQL exercises
Solved SQL exercises: practise from beginner to advanced
Practise SQL online through progressive business cases. Each exercise provides fictional data, hints, result validation and an explained solution.
Select the correct columns
Show only the name and price of each product.
Level : BeginnerOpen exerciseFilter and sort orders
Find orders over €50, from highest to lowest.
Level : BeginnerOpen exerciseConnect customers and orders
Associate each order with the name of the customer who placed it.
Level : IntermediateCompare plansList unique categories
Display the first three unique categories in alphabetical order.
Level : BeginnerCreate a free accountReplace a NULL value with COALESCE
Display clear labeling when a customer’s phone is absent.
Level : BeginnerCreate a free accountCalculate paid order indicators
Calculate the volume, total and average over a specific area.
Level : BeginnerCompare plansGroup revenue by category
Calculate totals by category and keep only the most important ones.
Level : BeginnerCompare plansKeep customers without orders
Count the orders of each customer without excluding new registrants.
Level : BeginnerCompare plansSegment customers with a CTE
Calculate the total per customer, then transform this result into a business segment.
Level : IntermediateCompare plansFilter a price range
Select an inclusive interval and check its limits.
Level : BeginnerCreate a free accountFilter multiple statuses
Replace multiple OR with a readable business list.
Level : BeginnerCreate a free accountSearch for a prefix with LIKE
Use a simple text pattern without confusing prefix and content.
Level : BeginnerCreate a free accountIdentify missing deliveries
Distinguish a missing date from an empty string or status.
Level : BeginnerCreate a free accountCalculate a price including tax
Transform a source price with a precise formula and alias.
Level : BeginnerCreate a free accountAssemble a product label
Create a readable label from two columns.
Level : BeginnerCreate a free accountNormalize a list of cities
Create a clean dimension before counting customers.
Level : BeginnerCreate a free accountExtract the year of registration
Derive a calendar component without transforming the scope.
Level : BeginnerCompare plansCalculate monthly revenue
Group together several channels over the same monthly period.
Level : IntermediateCompare plansAnalyze a quarter with limits
Filter a complete period with an exclusive upper bound.
Level : IntermediateCompare plansFind customers without orders
Keep the starting population and isolate the absence of activity.
Level : IntermediateCompare plansTest for the existence of a large order
Filter a population without duplicating it by its history.
Level : IntermediateCompare plansCalculate the average basket per customer
Only aggregate orders that are actually paid.
Level : IntermediateCompare plansCompare to average price
Use an aggregated value as a dynamic threshold.
Level : IntermediateCompare plansMerge customers and prospects
Create a single list from two compatible sources.
Level : IntermediateCompare plansTraining scenariosThese contextual repetitions reinforce an existing method. They preserve every historical link without pretending to be new canonical problems.Browse 118 scenarios
Isolate actually paid transactions — a regional bookstore · training scenario
Isolate the actually paid operations in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansCompare value by city — a regional bookstore · training scenario
Compare the value by city in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansPrioritize amounts — a regional bookstore · training scenario
Prioritize amounts in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansCount volume by status — a regional bookstore · training scenario
Count volume by status in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansList active categories — a regional bookstore · training scenario
List active categories in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansFollow monthly progress — a regional bookstore · training scenario
Monitor monthly developments in the context of a regional bookstore, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of bookstores.
Level : BeginnerCompare plansIsolating actually paid operations — a network of clinics · training scenario
Isolate actually paid operations in the context of a network of clinics, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansCompare value by city — a network of clinics · training scenario
Compare the value by city in the context of a network of clinics, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansPrioritize amounts — a network of clinics · training scenario
Prioritize amounts in the context of a network of clinics, with a controllable outcome. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansCount volume by status — a network of clinics · training scenario
Count volume by status in the context of a network of clinics, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansList active categories — a network of clinics · training scenario
List active categories in the context of a network of clinics, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansMonitor monthly progress — a network of clinics · training scenario
Monitor monthly developments in the context of a network of clinics, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this network of clinics.
Level : BeginnerCompare plansIsolating actually paid transactions — a training organization · training scenario
Isolate the operations actually paid in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansCompare value by city — a training organization · training scenario
Compare the value per city in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansPrioritize amounts — a training organization · training scenario
Prioritize amounts in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansCount volume by status — a training organization · training scenario
Count the volume by status in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansList active categories — a training organization · training scenario
List active categories in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansMonitor monthly progress — a training organization · training scenario
Monitor monthly progress in the context of a training organization, with a controllable result. You must produce the result, check it on the source data and explain what it allows to decide in this training organization.
Level : BeginnerCompare plansIsolate actual paid transactions — a delivery company · training scenario
Isolate actual paid operations in the context of a delivery business, with a controllable outcome. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansCompare value by city — a delivery company · training scenario
Compare the value by city in the context of a delivery company, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansPrioritize amounts — a delivery company · training scenario
Prioritize amounts in the context of a delivery business, with a controllable outcome. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansCount volume by status — a delivery company · training scenario
Count volume by status in the context of a delivery business, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansList active categories — a delivery company · training scenario
List active categories in the context of a delivery business, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansMonitor monthly progress — a delivery company · training scenario
Monitor monthly progress in the context of a delivery company, with a controllable result. You must produce the result, check it on the source data and explain what it allows you to decide in this delivery company.
Level : BeginnerCompare plansTwo focused paths reuse these experiences.