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
Protect an HR change 4 · training scenario
Commit a correct change and undo only the incorrect step. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansProtect an audit change 5 training scenario
Commit a correct change and undo only the incorrect step. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansCreate a reusable billing view 2 training scenario
Centralize a definition of active data without copying the query. You must produce the result, check it on the source data and explain what it allows you to decide in this billing system.
Level : AdvancedCompare plansCreate a reusable logistics view 3 training scenario
Centralize a definition of active data without copying the query. 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 plansCreate a reusable HR 4 view · training scenario
Centralize a definition of active data without copying the query. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansCreate a reusable view audit 5 training scenario
Centralize a definition of active data without copying the query. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansIndexing a billing search 2 · training scenario
Create a targeted index and then verify its presence before interpreting a plan. You must produce the result, check it on the source data and explain what it allows you to decide in this billing system.
Level : AdvancedCompare plansIndexing a logistics search 3 · training scenario
Create a targeted index and then verify its presence before interpreting a plan. 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 plansIndex an HR search 4 · training scenario
Create a targeted index and then verify its presence before interpreting a plan. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansIndexing a search audit 5 · training scenario
Create a targeted index and then verify its presence before interpreting a plan. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansCreate a billing business function 2 training scenario
Encapsulate pure, typed, reusable computation. You must produce the result, check it on the source data and explain what it allows you to decide in this billing system.
Level : AdvancedCompare plansCreate a logistics business function 3 · training scenario
Encapsulate pure, typed, reusable computation. 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 plansCreate an HR business function 4 · training scenario
Encapsulate pure, typed, reusable computation. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansCreate an audit business function 5 training scenario
Encapsulate pure, typed, reusable computation. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansLogging an invoicing modification 2 · training scenario
Retain the value before and after a change is actually executed. You must produce the result, check it on the source data and explain what it allows you to decide in this billing system.
Level : AdvancedCompare plansHistoricize a logistics modification 3 · training scenario
Retain the value before and after a change is actually executed. 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 plansLogging an HR modification 4 · training scenario
Retain the value before and after a change is actually executed. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansLogging an audit modification 5 · training scenario
Retain the value before and after a change is actually executed. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansGrant billing read access 2 training scenario
Apply the principle of least privilege to a laboratory table. You must produce the result, check it on the source data and explain what it allows you to decide in this billing system.
Level : AdvancedCompare plansGrant Logistics Playback Access 3 · Training Scenario
Apply the principle of least privilege to a laboratory table. 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 plansGrant read access hr 4 · training scenario
Apply the principle of least privilege to a laboratory table. You must produce the result, control it on the source data and explain what it allows you to decide in this human resources management.
Level : AdvancedCompare plansGrant read access to audit 5 training scenario
Apply the principle of least privilege to a laboratory table. You must produce the result, check it on the source data and explain what it allows you to decide in this audit log.
Level : AdvancedCompare plansTwo focused paths reuse these experiences.