Become a data analyst in 90 days✦27 portfolio projects✦100+ interview Q&As✦1:1 mentor for a year✦See the 90-Day System →✦Become a data analyst in 90 days✦27 portfolio projects✦100+ interview Q&As✦1:1 mentor for a year✦See the 90-Day System →✦
New here? Want every day planned for you? See the 90-Day System →

Free PDF · SQL

When a JD says strong SQL, it means these 8 things

Not just SELECT *. This is what the SQL round checks.

DGSQLJD decoder: strong SQL8@thedataguy16

"Strong SQL" sounds vague. In the interview it means 8 specific patterns.

Group and filter, find what's missing, bucket and report by month, rank inside groups, and write it cleanly.

Practise all eight.

1-4: group, join, buckets, dates

  1. 01

    GROUP BY with HAVING

    WHERE filters rows. HAVING filters groups.

    SELECT city, SUM(amount) AS total
    FROM orders
    GROUP BY city
    HAVING SUM(amount) > 50000;
  2. 02

    LEFT JOIN to find what's missing

    Customers who never ordered.

    SELECT c.name
    FROM customers c
    LEFT JOIN orders o
      ON c.customer_id = o.customer_id
    WHERE o.order_id IS NULL;
  3. 03

    CASE WHEN buckets

    Turn amounts into bands a manager can read.

    SELECT order_id,
      CASE WHEN amount >= 5000 THEN 'High'
           WHEN amount >= 1000 THEN 'Mid'
           ELSE 'Low' END AS band
    FROM orders;
  4. 04

    Month-wise numbers (MySQL)

    Monthly totals for a report.

    SELECT DATE_FORMAT(order_date, '%Y-%m') AS month,
           SUM(amount) AS total
    FROM orders
    GROUP BY month;

5-8: window functions, clean and readable

  1. 05

    Top 3 per group with ROW_NUMBER

    Number rows inside each city, keep the first 3.

    SELECT * FROM (
      SELECT *, ROW_NUMBER() OVER (
        PARTITION BY city
        ORDER BY amount DESC) AS rn
      FROM orders) t
    WHERE rn <= 3;
  2. 06

    Running total

    Cumulative sum by date.

    SELECT order_date, amount,
      SUM(amount) OVER (
        ORDER BY order_date) AS running
    FROM orders;
  3. 07

    CTEs instead of nested mess

    Name the step, then use it.

    WITH city_total AS (
      SELECT city, SUM(amount) AS t
      FROM orders GROUP BY city)
    SELECT * FROM city_total
    WHERE t > 50000;
  4. 08

    Duplicates and NULLs

    Find repeats, and stop NULLs breaking totals.

    SELECT email, COUNT(*) AS n
    FROM customers
    GROUP BY email
    HAVING COUNT(*) > 1;
    
    -- COALESCE(amount, 0) for NULLs

JD line, decoded

JD saysThey test
Strong SQLGROUP BY, HAVING, joins
Data extractionJoins across 3-4 tables
ReportingMonth-wise numbers, CASE buckets
Advanced SQLROW_NUMBER, RANK, LAG
Data qualityDuplicates, NULLs
Optimised queriesCTEs, filter early

Practise these on real tables in the free SQL playground, then check your answers against the 8 things interviewers check.

Free PDF

SQL JD decoder

Download the PDF

Opens in Google Drive. No sign-up.

Keep going

More free PDFs

90-Day System · become a data analyst→