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
Building a monthly total — national expeditions · training scenario
Construct a monthly total from a national shipments dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : IntermediateCompare plansSmoothing a two-month trend — domestic shipments · training scenario
Smooth a two-month trend from a national shipments dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : AdvancedCompare plansProduce conditional KPIs by region — national shipments · training scenario
Produce conditional KPIs by region from a national shipment dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : IntermediateCompare plansMeasuring the contribution of each line — national expeditions · training scenario
Measure the contribution of each line using a national shipments dataset designed to control the level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : AdvancedCompare plansKeep the top two lines per region — national expeditions · training scenario
Maintain the top two rows per region from a national shipment dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : AdvancedCompare plansDivide results into quartiles — national expeditions training scenario
Divide results into quartiles from a national shipments dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : AdvancedCompare plansCompare each value to its regional average — national expeditions · training scenario
Compare each value to its regional average using a national shipment dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : IntermediateCompare plansDetect duplicate business references — national shipments training scenario
Detect duplicate business references from a national shipping dataset designed to control level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this national expeditions.
Level : IntermediateCompare plansClassify the results in each region — customer collections · training scenario
Classify results in each region based on a customer collections dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansCompare each month to the previous one — customer collections · training scenario
Compare each month to the previous one using a customer collection data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansConstruct a monthly total — customer collections · training scenario
Construct a monthly total from a customer collection data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansSmoothing a trend over two months — customer collections · training scenario
Smooth a two-month trend from a customer collections data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : AdvancedCompare plansProduce conditional KPIs by region — customer collections · training scenario
Produce conditional KPIs by region from a customer collections dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansMeasure the contribution of each line — customer collections · training scenario
Measure the contribution of each line using a customer collections data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : AdvancedCompare plansKeep the two best lines per region — customer collections · training scenario
Keep the two best lines per region from a customer collections dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : AdvancedCompare plansDistribute the results into quartiles — customer collections · training scenario
Distribute the results into quartiles from a customer collections data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : AdvancedCompare plansCompare each value to its regional average — customer collections · training scenario
Compare each value to its regional average using a customer collections dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansDetect duplicate business references — customer collections · training scenario
Detect duplicate business references from a customer collections data set designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this customer collections.
Level : IntermediateCompare plansRank the results in each region — acquisition campaigns · training scenario
Rank results in each region based on an acquisition campaign dataset designed to control level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : IntermediateCompare plansCompare each month to the previous one — acquisition campaigns · training scenario
Compare each month to the previous one using an acquisition campaign dataset designed to control the level of detail and differences. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : IntermediateCompare plansBuild a monthly total — acquisition campaigns · training scenario
Build a monthly total from an acquisition campaign dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : IntermediateCompare plansSmooth a trend over two months — acquisition campaigns · training scenario
Smooth out a two-month trend from an acquisition campaign dataset designed to control the level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : AdvancedCompare plansProduce conditional KPIs by region — acquisition campaigns · training scenario
Produce conditional KPIs by region from an acquisition campaign dataset designed to control the level of detail and variances. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : IntermediateCompare plansMeasure the contribution of each line — acquisition campaigns · training scenario
Measure the contribution of each line from an acquisition campaign dataset designed to control the level of detail and discrepancies. You must produce the result, check it on the source data and explain what it allows you to decide in this acquisition campaign.
Level : AdvancedCompare plansTwo focused paths reuse these experiences.