SQL Boy
TutorialsPlayground

Format & Validate

SQL FormatterSQL MinifierSyntax Validator

Convert

JSON to SQLCSV to SQLSQL to JSONRegex to SQLExcel to SQLSQL Dialect Convertersoon

Visualize

ER Diagram GeneratorSQL Schema Diff

Generate

SQL Mock Data Generator

Analyze

SQL Query ExplainerSQL Query Analyzer

Workflow hubs

FormattingConversionSchemaAnalysis
View all tools
Daily ChallengeInterviewsCheat SheetBlog

© 2026 SQL Boy. Built for developers.

ContactPrivacyTermsAI Usage PolicyEditorial StandardsAboutRSS Feed

New conversation

What can I help with?

Ask about this page, get a hint on a challenge, or explore SQL concepts.

I know what's on this page and can give answers grounded in SQL Boy content.

Current page

Challenges

/challenges

Usage status will load after login
SQL Boy
TutorialsPlayground

Format & Validate

SQL FormatterSQL MinifierSyntax Validator

Convert

JSON to SQLCSV to SQLSQL to JSONRegex to SQLExcel to SQLSQL Dialect Convertersoon

Visualize

ER Diagram GeneratorSQL Schema Diff

Generate

SQL Mock Data Generator

Analyze

SQL Query ExplainerSQL Query Analyzer

Workflow hubs

FormattingConversionSchemaAnalysis
View all tools
Daily ChallengeInterviewsCheat SheetBlog

Challenge Hub

SQL Challenges

This hub collects the standalone SQL challenge pages that have already been expanded into durable learning assets. Use them when you want a focused practice rep with solution approaches, pitfalls, and related guides.

Open Daily PracticeBrowse Interviews

Indexable

19

Challenge pages currently eligible for sitemap inclusion and search indexing.

In Expansion

0

Candidate challenge pages still being expanded before they become indexable.

Use This Hub

When you want a deeper challenge detail page than `/daily`, but a lighter unit of practice than a full interview prompt.

Available Challenge Pages

These challenge pages already have a minimum content standard: explanation, schema summary, solution approaches, pitfalls, and related guides.

Products Never Ordered

Medium

Find products that never appear in the order table without being fooled by missing or duplicate order rows.

Second Highest Salary

Medium

Find the second distinct highest salary without accidentally returning the same maximum twice.

Consecutive Numbers

Hard

Find values that appear in at least three consecutive rows instead of merely appearing three times anywhere in the table.

Rising Temperature

Medium

Compare each weather row with the previous day and return only the IDs where temperature increased day over day.

Patients With Condition

Easy

Match patients whose condition list contains a Type I diabetes code without being fooled by partial code overlaps.

Rank Scores

Medium

Assign tied scores the same rank while keeping the next rank consecutive with no gaps.

Exchange Seats

Medium

Swap every pair of adjacent seat IDs while leaving the final row untouched if the seat count is odd.

Trips and Users

Hard

Compute daily cancellation rate after excluding any trip where either the client or driver is banned.

Percentage of Users Attended

Medium

Calculate contest participation rate by dividing each contest’s registrations by the total user base, not by contest-local counts.

Monthly Transactions I

Medium

Roll monthly transaction reporting into one query while splitting total volume from approved volume by country.

Immediate Food Delivery II

Medium

Measure what share of customers got an immediate delivery on their first-ever order instead of across all orders.

Game Play Analysis IV

Medium

Compute next-day retention by checking whether each player returned on the day after their first login.

Investments in 2016

Medium

Sum 2016 investment value only for policyholders who meet one duplicate condition and one uniqueness condition at the same time.

Last Person to Fit in the Bus

Medium

Use a running total to find the last passenger whose cumulative weight still stays under the bus limit.

Product Price at a Given Date

Medium

Reconstruct each product’s price as of a snapshot date, including products that had not changed yet and still use the default price.

Capital Gain/Loss

Medium

Calculate per-stock capital gain or loss by treating buys as cash outflows and sells as cash inflows before summing them.

Friend Requests I: Overall Acceptance Rate

Medium

Calculate overall friend request acceptance rate while separating request volume from accepted pairs cleanly.

Tree Node

Medium

Classify each tree node as root, inner, or leaf based on whether it has a parent and whether it is referenced by children.

Customers Who Bought All Products

Medium

Return only the customers whose distinct purchased product set covers every product listed in the catalog.

How To Use This SQL Challenge Hub

This page is designed as the evergreen practice library for SQL Boy. The daily page is still the rotating entry point when you want a single practice rep chosen by date, but the challenge hub serves a different job: it helps readers discover durable, topic-driven SQL problems that deserve to rank on their own and stay useful over time. If someone searches for a specific SQL interview question, a classic anti-join problem, a ranking exercise, or a point-in-time reporting pattern, the standalone challenge page is the destination that should satisfy that intent.

Each challenge detail page is built to do more than show a prompt and a final answer. The goal is to preserve the original hands-on practice experience while also adding the explanation layer that many challenge sites leave too thin. That is why the indexable pages include a schema summary, multiple solution approaches when the pattern matters, common mistakes, related blog guides, and internal links to nearby challenge reps. In practical terms, this means you can use the hub in several ways: as a self-study library, as an interview drill catalog, or as a concept map when you know the SQL pattern you need to practice but do not want to dig through random archives.

The simplest way to use this page is to choose a challenge that matches the skill you want to sharpen, solve it in the editor, and then read the explanation only after you have committed to a query shape of your own. If you are weak on time-series logic, window functions, conditional aggregation, or subquery design, use the challenge detail page as the narrow drill and the related guide links as the deeper follow-up reading. That workflow is deliberate. The hub is supposed to help you move from isolated SQL reps into repeatable understanding instead of collecting disconnected solutions that are hard to reuse later.

What These SQL Challenges Cover

The current challenge set is intentionally weighted toward the SQL patterns that matter most in interviews and real reporting work. Instead of publishing hundreds of thin pages with no explanation, the library prioritizes problems that teach durable mental models: anti-joins, relational division, running totals, dense ranking, conditional aggregation, row-sequence analysis, first-event cohorts, next-day retention, and point-in-time state reconstruction. These are the kinds of queries that appear repeatedly in analytics teams, product dashboards, finance reporting, and technical interviews because they force you to get row grain, filtering order, and business definition correct at the same time.

Difficulty Mix

Easy: 1 challenges. Medium: 16 challenges. Hard: 2 challenges.

Most Common Concepts

aggregation · 12subqueries · 9join · 8window-functions · 8date-logic · 6case-when · 5

That mix matters for SEO and for user value. A challenge hub should not just look large; it should cover the search intents that serious learners actually have. Some people arrive by exact problem name, others by pattern searches like “SQL cancellation rate” or “second highest salary SQL”, and others by concept gaps such as window functions, date logic, or ranking semantics. The standalone challenge format allows one page to answer the immediate query while the rest of the internal links lead the user into a broader learning path. That is why this library now sits between the rotating `/daily` workflow and the larger blog/tutorial system. It is the bridge between practice and explanation.

If you are using this hub strategically, start by choosing one repeated weakness and working through several related challenge pages back to back instead of hopping randomly. For example, if ranking queries are the weak point, practice the ranking pages and then follow the related window-function guides. If denominator choice and rate calculations are the problem, use the conversion, cancellation, and participation challenges as a mini cluster. The library is more useful when treated as a set of learning paths, not just a flat list of prompts.

© 2026 SQL Boy. Built for developers.

ContactPrivacyTermsAI Usage PolicyEditorial StandardsAboutRSS Feed