
Learn to install MySQL locally on Windows or Mac by downloading the MSI, installing the server and MySQL Workbench, and setting and remembering a root password.
Navigate this course by exploring 100+ SQL challenges across sections, focusing on filtering and aggregation, with scripts, hints, and solutions accessible for practice in MySQL.
Tags: WHERE, Boolean Filter, COUNT
Query the users table to list active administrators, filtering by role = 'admin' and status = 'active', and select user ID and name using MySQL Workbench.
Tags: GROUP BY, SUM, Aggregation
Tags: GROUP BY, COUNT, ORDER BY
Tags: JOIN, INNER JOIN, SELECT
Walk through building a viewer plan mapping with an inner join between users and subscriptions, retrieving subscription id, full name, and subscribed on date.
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
Learn to compute the average days between order and ship dates per region in MySQL. Join orders and shipments, calculate date differences, and group results by region to identify bottlenecks.
Tags: JOIN, DATEDIFF, AVG, GROUP BY, WHERE IS NOT NULL
Tags: GROUP BY, SUM(CASE WHEN), COUNT, ROUND
Compute the conversion rate for each campaign from a campaign interactions table by counting purchases and total users reached, then calculate campaign effectiveness with optional rounding.
Tags: JOIN, GROUP BY, CASE WHEN
Demonstrate a daily breakdown of new versus returning users by joining users and user logins, comparing sign up date to login date, and counting per login date in MySQL.
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
Identify top active users by counting transactions in the last full calendar month. Group by user_id and sort by the transaction count to highlight top activity.
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
Learn to identify unbooked room types by joining listings with bookings using a left join, then group by room type to count listings and show a sample listing.
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
Follow a solution walkthrough to compute the salary difference using a lag window function over the salary history, partitioned by employee and ordered by update date, to reveal previous salary.
Tags: LEAD, PARTITION BY, ORDER BY, DATEDIFF
Tags: COUNT(DISTINCT), SELF JOIN, GROUP BY, AVG
Learn to compute daily unique visits and a seven-day rolling average with window functions, using range between to handle date gaps and contrasting with self-join approaches.
Tags: ROW_NUMBER(), DATE_SUB, Gaps & Islands, Streak Grouping, PARTITION BY, ORDER BY
Identify each user's longest posting streak of at least three consecutive days, returning the start and end dates, using row_number and streak keys to group consecutive days in SQL.
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()
Identify user IDs registered in the current month from the users table using year and month comparisons with the given date 2020-03-20.
Tags: GROUP BY, COUNT, DATE_FORMAT(), ORDER BY
Create a monthly enrollment report from the admissions table by using date_format to year and month, then group by that value and count records in chronological order.
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
Identify deal hunter customers by joining users, orders, and products to find users with at least one order where every product is discounted, using group by and case when.
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
Compute each influencer's total follower purchases by joining influencers, followers, and purchases, sum the amounts, and return the influencer id with total earnings for totals of 1000 or more.
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
Join the movie orders and ship DVD shipments tables to identify mismatches between ordered and shipped movie IDs, then compute per-center total orders, mismatches, and mismatch rate.
Tags: CTE, AVG, JOIN, Filter
Identify underperforming trips by computing each vehicle's average fuel efficiency and flagging trips below 70% of that average using sql queries.
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
Generate a tag summary for each product by aggregating all associated tags into a comma separated string using group_concat, with group by and order by to prepare display and analytics.
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
Learn to roll up salaries in an organization chart by aggregating direct and indirect reports with a recursive query, union all, and a top-down approach.
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
Walks through identifying users who bought two or more distinct companies but have missing stop-loss alerts, by joining buy orders with alert settings to count missing alerts.
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.