SQL Practice

Real-life business problems on real tables. Read the scenario, write the query, and get it checked instantly.

Leaderboard
Intermediate25 pts

Podium finish: top 3 products per category

Window Functions

Solve challenge
Intermediate25 pts

Month-over-month revenue rollercoaster

Window Functions

Solve challenge
Intermediate25 pts

Rebuild the balance of account 15

Window Functions

Solve challenge
Intermediate25 pts

The top scorer of every club (ties included)

Window Functions

Solve challenge
Intermediate25 pts

The longest silence between two flights

Window Functions

Solve challenge
Intermediate25 pts

Peak-hour demand ranking in every city

Window Functions

Solve challenge
Intermediate25 pts

Top 3 genres in every country

Window Functions

Solve challenge
Expert50 pts

Best-selling product in each category

Window Functions

Solve challenge
Expert50 pts

Running total of revenue by month

Window Functions

Solve challenge
Expert50 pts

The second order that beat the first

Window Functions

Solve challenge
Expert50 pts

The typical basket: median order value by country

Window Functions

Solve challenge
Expert50 pts

Three swipes in ten minutes

Window Functions

Solve challenge
Expert50 pts

The deepest balance drawdown

Window Functions

Solve challenge
Expert50 pts

Most active card holder in every country

Window Functions

Solve challenge
Expert50 pts

The 30-day readmission rate per department

Window Functions

Solve challenge
Expert50 pts

The second-highest salary in every country

Window Functions

Solve challenge
Expert50 pts

Gaps and islands: every driver's longest working streak

Window Functions

Solve challenge
Expert50 pts

Drivers whose rating slid three weeks in a row

Window Functions

Solve challenge
Expert50 pts

Sessionization: the ten longest listening sessions

Window Functions

Solve challenge
Expert50 pts

VIP outreach: the top 10 percent of listeners

Window Functions

Solve challenge