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.
Analyze a time series with missing months
Make absent periods visible before calculating evolution and moving average.
Level : AdvancedCompare plansDeduplicate with a deterministic rule
Choose a canonical email line despite identical dates and multiple sources.
Level : AdvancedCompare plansAnalyze the margin and real contribution
Link sales and costs to spot a reference that destroys margin.
Level : AdvancedCompare plansAudit a KPI before publication
Detect why a join with tags inflates revenue, then rebuild the KPI.
Level : AdvancedCompare plansClean an imperfect dataset before analysis
Profile anomalies, define validity rules and calculate a trackable KPI.
Level : AdvancedCompare plansConduct an autonomous seller analysis
Choose your own method to compare net income and reimbursements.
Level : AdvancedCompare plansGuarantee integrity with real constraints
Create and test PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL and DEFAULT.
Level : AdvancedCompare plansEdit data without losing control
Practice writes, their edge cases and an idempotent operation.
Level : AdvancedCompare plansSecure an operation with transactions
Check the status before and after validation, cancellation and partial return.
Level : AdvancedCompare plansCreate and maintain reliable views
Check the nature and definition of the objects, not just a few rows returned.
Level : AdvancedCompare plansChoose an index and read EXPLAIN
Compare a sequential scan and a scan indexed on 5,000 rows.
Level : AdvancedCompare plansWrite testable PostgreSQL functions
Create a multi-parameter function and test for normal values, NULL, and errors.
Level : AdvancedCompare plansAutomate an audit with triggers
Test refusal, multi-line audit and trigger condition.
Level : AdvancedCompare plansTest roles and permissions positively and negatively
Grant read, deny write, and check actual privileges.
Level : AdvancedCompare 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.