
Tags: WHERE, Boolean Filter, COUNT
Tags: GROUP BY, SUM, Aggregation
Tags: GROUP BY, COUNT, ORDER BY
Tags: JOIN, INNER JOIN, SELECT
Tags: LEFT JOIN, IS NULL, Anti-join
Tags: ROW_NUMBER(), PARTITION BY, ORDER BY, COUNT
Walk through returning each user's top three most viewed articles with sql. Learn to use a cte, window functions, and row_number with partition by user and order by views.
Tags: JOIN, MIN, DATE, CASE WHEN, WEEK()
Tags: UNION, SELECT, String Literal
Walk through unifying creators and moderators into a single result set with joins and union options, selecting name and role in MySQL.
Tags: GROUP BY, CASE WHEN, COUNT, Pivot via CASE
Pivot daily ticket status data by day to count open, resolved, and escalated tickets, using case when labels and group by status_date in a practical SQL walkthrough.
Tags: WHERE, AND/OR, IN, Parentheses, Boolean Filter
Tags: GROUP BY, COUNT, HAVING
Tags: JOIN, GROUP BY, COUNT(DISTINCT), DATE, HAVING
Tags: JOIN, DATEDIFF, AVG, GROUP BY
Tags: JOIN, DATEDIFF, AVG, GROUP BY, WHERE IS NOT NULL
Tags: GROUP BY, SUM(CASE WHEN), COUNT, ROUND
Tags: JOIN, GROUP BY, CASE WHEN
Tags: JOIN, GROUP BY, COUNT, HAVING
Tags: GROUP BY, HOUR(), EXTRACT(HOUR), RANK(), PARTITION BY
Analyze the App Sessions data to identify each app's most active hour using MySQL, counting sessions and ranking peak hours with window functions (partition by app name, order by sessions).
Tags: DATE_FORMAT, DATE_SUB, Range Filter, GROUP BY, COUNT
DATE(), COUNT(DISTINCT), GROUP BY, HAVING
Identify users who logged in from two or more cities on the same day by aggregating by user and date, counting distinct cities, and applying a having clause to flag.
CASE WHEN, WEEKDAY(), DATEDIFF, AVG, GROUP BY
GROUP BY, HAVING, NOT EXISTS, Anti-join, Date Filter
Identify high-intent shoppers who added more than two items in a day but never placed an order, using cart items and orders tables, via an anti-join approach.
GROUP BY, SUM, HAVING, ORDER BY
Tags: JOIN, INNER JOIN, SELECT
Tags: JOIN, ROW_NUMBER(), WINDOW FUNCTION, Effective Dating
Tags: LEFT JOIN, GROUP BY, COUNT
Tags: LEFT JOIN, GROUP BY, HAVING, COUNT, MAX/MIN, IS NULL
Tags: JOIN, LEFT JOIN, ROW_NUMBER(), WINDOW FUNCTION
Identify the latest valid sale for each active team (completed, at least 500, by an active employee) and show all active teams with nulls when no sale exists.
Tags: CROSS JOIN, WHERE, ROUND, MIN, GROUP BY
Learn to compute the lowest movie price by applying eligible discounts via a cross join of movies and offers, filtering by the offers' minimum required price, and selecting best price.
Tags: SELF JOIN, Date Range Overlap, GREATEST, ROW_NUMBER(), WINDOW FUNCTION
Follow a solution walkthrough for detecting the first overlapping subscription per user in sql, using a self-join and window functions to select the later start date.
Tags: ROW_NUMBER(), PARTITION BY, ORDER BY
Tags: ROW_NUMBER(), PARTITION BY, ORDER BY
Tags: RANK(), PARTITION BY, ORDER BY, GROUP BY
Identify the top three products per section by units sold, including ties for third place, using a window function rank with partition by section in MySQL Workbench via a subquery.
Tags: RANK(), PARTITION BY, ORDER BY, GROUP BY, JOIN
Tags: NTILE, PARTITION BY, ORDER BY
Tags: SUM, PARTITION BY, ORDER BY
Tags: LAG, PARTITION BY, ORDER BY
Tags: LEAD, PARTITION BY, ORDER BY, DATEDIFF
Tags: COUNT(DISTINCT), SELF JOIN, GROUP BY, AVG
Tags: ROW_NUMBER(), DATE_SUB, Gaps & Islands, Streak Grouping, PARTITION BY, ORDER BY
Tags: LAG, ROW_NUMBER(), DATEDIFF, PARTITION BY, ORDER BY, CASE
Tags: LAG, LEAD, DATEDIFF, PARTITION BY, ORDER BY, CASE
Identify binge versus sporadic viewing by calculating days since each user's last watch using lag and date diff in SQL, and label sessions accordingly.
Tags: WHERE, DATE functions, MONTH(), YEAR()
Tags: GROUP BY, COUNT, DATE_FORMAT(), ORDER BY
Tags: WEEKDAY(), CASE, GROUP BY, COUNT, SUM
Analyze weekend vs weekday signups and revenue using a weekday function in MySQL, labeling days as weekday or weekend and aggregating total signups and subscription fees.
Tags: ROW_NUMBER(), PARTITION BY, ORDER BY, CASE, MIN(), DATEDIFF
Discover how to compute the days between a user's first and second book orders, for users with at least two purchases, using partition by user ID and date difference.
Tags: LEFT JOIN, MIN(), GROUP BY, DATEDIFF
Tags: COUNT(DISTINCT), DATE(), SELF JOIN, DATE_ADD, ROUND, % change
Tags: LAG(), PARTITION BY, ORDER BY, DATEDIFF, WHERE
Identify gaps between patient visits using SQL; highlight cases exceeding 180 days and return patient ID, previous visit, current visit, and the gap in days via lag.
Tags: TIMESTAMPDIFF, WHERE, SELECT
Demonstrate how to identify tickets with delays over 24 hours using timestamp diff in MySQL, returning ticket id, user id, created timestamp, response timestamp, and delay in hours.
Tags: GROUP BY, SUM, ORDER BY, LIMIT 1
Tags: ROW_NUMBER(), PARTITION BY, ORDER BY
Learn how to return the latest appointment per patient by using a window function in MySQL Workbench, partitioned by patient id and ordered by appointment date, with rank = 1.
Tags: NOT EXISTS, EXISTS, JOIN, Anti-join
Tags: JOIN, COUNT, LEFT JOIN, ROUND, HAVING
Identify customers with a return rate over 50% by aggregating total orders and total returns from orders and order returns tables, then compute the return percentage in MySQL.
Tags: JOIN, GROUP BY, SUM, HAVING
Tags: JOIN, DATE_ADD, BETWEEN, DISTINCT, Filter
Identify users with a failed auto-renewal who manually renewed within 1 to 7 days by joining the subscription_failures and manual_renewals tables.
Tags: CTE, MIN, JOIN, DATEDIFF, Filter
Identify leads that move from new lead to qualified candidate within seven days and report lead id, the new lead date, the qualified date, and days to convert.
Tags: CTE, AVG, JOIN, ROUND, Filter
Tags: LEFT JOIN, COUNT, CASE, NULLIF, ROUND
Tags: GROUP BY, SUM(CASE), HAVING, JOIN
Tags: CTE, MAX, COUNT, SUM, DATEDIFF, DATE_SUB, CASE
Learn to compute recency, frequency, and monetary values from an orders table over 90 days, and segment customers into champions, loyal, and at risk using a case-based labeling approach.
Tags: CASE, LOWER, TRIM, GROUP BY, COUNT
learn sql by doing with a solution walkthrough that counts gender groups, handles nulls as unspecified, and standardizes values using case when and group by.
Tags: CASE, SUBSTRING_INDEX, COALESCE, GROUP BY, ROUND, HAVING
Tags: JOIN, SUM(CASE), GROUP BY, ROUND, HAVING
Tags: SUM(CASE), GROUP BY, ROUND, ORDER BY
Tags: JOIN, GROUP BY, COUNT, SUM, CASE WHEN, ROUND
Tags: CTE, AVG, JOIN, Filter
Tags: SUM(CASE), GROUP BY, ROUND
Tags: SUM(CASE WHEN), ROUND, NULLIF
Tags: GROUP BY, COUNT, MAX, Top-tie filter
Tags: SELF JOIN, LEAST/GREATEST, GROUP BY, COUNT, ORDER BY, LIMIT
Tags: JOIN, DISTINCT, MIN, LEFT JOIN, COALESCE, GROUP BY
Tags: NTILE, WINDOW FUNCTION, ORDER BY, AVG, ROUND
Tags: GROUP_CONCAT, GROUP BY, ORDER BY
Tags: JOIN, Date Filter, GROUP_CONCAT, HAVING COUNT(DISTINCT), ORDER BY
Tags: SUM OVER, COUNT OVER, LEAD, ROWS frame, ROUND, CASE
RECURSIVE CTE, Hierarchy, Self-join logic, ORDER BY
Tags: RECURSIVE CTE, Transitive closure, Hierarchy, JOIN
Tags: LEFT JOIN … IS NULL, NOT EXISTS, Anti-join
Tags: RECURSIVE CTE, Hierarchy, LEVEL/Depth
Learn to compute an employee hierarchy depth with a top-down recursive sql query, starting at top-level managers (depth zero) and propagating depths to all reports.
Tags: RECURSIVE CTE, Hierarchy, GROUP BY, SUM
Tags: UNION, DISTINCT, DATE_RANGE, Filter, ORDER BY
Tags: UNION ALL, GROUP BY, CASE, Aggregation
Discover a solution walkthrough that combines clients and freelancers with union all, then labels each user as client, freelancer, or both, outputting a unified name and role list.
Tags: LEFT JOIN, Anti-join (IS NULL), COUNT(DISTINCT), GROUP BY, Filter
Tags: Date Range Filter, JOIN, MAX, COUNT, GROUP BY
Identify users active on both website and app in the last 60 days, listing their user IDs, latest website login, latest app login, and total platform logins.
Tags: CTE, COUNT(DISTINCT), INNER JOIN, NOT IN, Set Containment, GROUP BY
Tags: SET_DIFF (NOT IN), UNION ALL, CTE, Filter, ORDER BY
Identify users who completed only one of two actions—view or apply—by joining view and apply tables in sql, returning user IDs with action dates using anti joins or left joins.
Learn SQL by doing. If you know the syntax but freeze on messy, real scenarios, this course is for you. With 100+ practical SQL challenges, you’ll solve problems that mirror the real work of data analysts and engineers , so you build skills you can use both on the job and in interviews.
Why this course is different
Most SQL courses stop at theory or simple queries. This one is practice-first. Every challenge puts you in the shoes of an analyst solving real business problems. You’ll get step-by-step reasoning, crystal-clear solutions, and reusable patterns that prepare you for day-to-day SQL work as well as interview success.
Real datasets & scenarios you’ll tackle
E-commerce & funnels - drop-offs, repeat buyers, cart abandonment.
Banking & finance → risky trades, customer tenure, percentiles.
Healthcare & fitness → retention, patient gaps, appointment delays.
Media & OTT apps → session streaks, genre trends, cross-platform usage.
Operations & logistics → shipping delays, courier performance, returns.
How you’ll learn
100+ challenges with hints and clean, formatted solutions.
Video walkthroughs showing the thought process step by step.
A structure that grows from simple SQL queries to multi-step case studies.
Who this is for
Beginners who want to learn SQL by doing.
Analysts and engineers who need more real-world practice.
Anyone preparing for SQL interviews with practical scenarios.
No filler. No copy-paste. Just structured practice with real SQL problems , so you write confident queries in work and interviews.