TOUGH TONGUE AI
  • Home
    LogoTOUGH TONGUE AI

    RESOURCES

    Loading...

    HomeLibraryDS Coach · SQL Aggregations

    DS Coach · SQL Aggregations

    DS Coach · SQL Aggregations

    Overview

    Turn rows into metrics in about twenty minutes. Coach Maya puts a small orders table on her live board with one example per concept; you write the next query in the board's editor, tap Run, and watch your rows line up with the right ones. You will count, sum and average around NULLs, group and filter groups, bucket with CASE WHEN, build several metrics in one pass, compute rates that never divide by zero, and roll orders up by month, plus five quick checks on the traps interviewers love.

    Your Instructions

    Your goal: compute the right metric at the right grain, and keep it honest when NULLs and empty groups show up.

    How it works (about 20 minutes)

    • Maya's live board shows the orders table and an example query for each step.
    • You type your own query in the board's editor, then tap Run.
    • Maya checks it; the board marks your rows right, missing or extra, and plays how the groups form once it is right.
    • A few quick checks cover the classic traps: tap your answer.

    What you will practice

    1. COUNT, COUNT(DISTINCT), SUM, AVG, MIN, MAX and NULLs
    2. GROUP BY
    3. HAVING vs WHERE
    4. CASE WHEN
    5. Conditional aggregation
    6. NULL-safe rates
    7. DATE_TRUNC and days between dates

    Tips

    • SQL is Postgres-style. MySQL or SQL Server habits are fine; Maya will mention the difference.
    • Style does not matter. Returning the right numbers does.
    • Say "hint", "repeat", "skip" or "next" any time.
    • Read the SQL Aggregations notes first if you have not.

    More in Data Science Interview Prep: AI Coach Edition

    • DS Mock · Python Data Manipulation
    • Tech Interview: Lowest Earning Employees
    • DS Coach · Python for Probability & Simulation
    • DS Mock · Python for Probability & Statistics
    • DS Coach · SQL Basics
    • Interactive SQL Tutor
    • DS Coach · SQL Joins
    • Interactive SQL Tutor - Medium Level
    • DS Coach · SQL Window Functions
    • Interactive SQL Tutor - Advanced Level
    • DS Mock · SQL Easy
    • DS Mock · SQL Interview (Medium)
    View the full course (49 sessions) →