How to Learn SQL in 30 Days for Data Analyst Interviews — Day-by-Day Plan
SQL is the #1 required skill for data analyst interviews in India — tested in 95% of roles at every company from TCS to Google. The good news: SQL is also one of the fastest technical skills to go from zero to interview-ready. With 1–2 hours of daily focused practice, 30 days is genuinely enough.
This guide gives you a complete day-by-day plan — not vague topics, but exact things to do each day — plus free resources to practice in a live SQL compiler starting from day one.
SELECT product, SUM(revenue) FROM sales GROUP BY product gives total revenue per product.The 30-Day SQL Learning Plan
| Days | Topic | What to Master | Practice Goal |
|---|---|---|---|
| Days 1–3 | SELECT Basics | SELECT, WHERE, ORDER BY, LIMIT, DISTINCT, aliases | Write 10 basic SELECT queries without help |
| Days 4–6 | Aggregations | COUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVING | Solve 10 GROUP BY questions, explain WHERE vs HAVING |
| Days 7–10 | SQL JOINs | INNER, LEFT, RIGHT, FULL OUTER, anti-join pattern | Write all 4 JOIN types + find records with no match |
| Days 11–14 | Subqueries & CTEs | Subquery in WHERE/FROM, WITH clause, CTE chaining | Rewrite 3 nested subqueries as CTEs |
| Days 15–20 | Window Functions | RANK, DENSE_RANK, ROW_NUMBER, LAG, LEAD, SUM OVER | Solve top-N-per-group, month-over-month growth |
| Days 21–24 | Date & String Functions | DATEDIFF, EXTRACT, SUBSTR, CONCAT, COALESCE | Write 5 date-based queries from real interview banks |
| Days 25–28 | Real Interview Questions | 50+ company-specific questions from Google, Amazon, Flipkart | Timed practice: 30 min per question, no hints |
| Days 29–30 | Mock + Review | Full mock SQL interview session + gap review | Complete 1 full mock interview, identify weak areas |
Days 1–10: SQL Foundations
The foundation block covers everything needed to answer “easy” SQL interview questions. These topics are asked in 100% of data analyst interviews — getting them solid is non-negotiable.
Days 1–3: SELECT and Filtering
Days 4–6: GROUP BY and Aggregations
GROUP BY is the most commonly tested SQL concept in entry-level interviews. The single most important thing to understand: every column in SELECT must either be in GROUP BY or be an aggregate function.
Days 7–10: All JOIN Types
JOINs are tested in 89% of analyst interviews. The most important pattern to master is the anti-join — finding records in one table that have no match in another. This is asked constantly: “customers who never ordered”, “products never purchased”, “users with no logins last 30 days”.
Days 11–20: Advanced SQL
Days 11–14: CTEs — Write Cleaner SQL
CTEs (Common Table Expressions) use the WITH keyword to name a subquery. They make complex SQL dramatically more readable and are strongly preferred over nested subqueries in interviews.
Days 15–20: Window Functions — The Game Changer
Window functions are tested in 92% of senior data analyst interviews. If you can write window function queries fluently, you immediately stand out from 80% of candidates. Dedicate 6 full days here — it’s worth it.
| Function | What it does | Classic Interview Question |
|---|---|---|
RANK() | Rank with gaps on ties | Top-N employees per department |
ROW_NUMBER() | Always unique rank | Exactly 1 record per group |
DENSE_RANK() | Rank without gaps | 2nd highest salary (no gaps) |
LAG(col, n) | Value from N rows before | Month-over-month growth % |
LEAD(col, n) | Value from N rows ahead | Days until next purchase |
SUM() OVER() | Running/cumulative total | Cumulative revenue by date |
Days 21–30: Interview Practice
The final 10 days are about performance, not learning. You should no longer be learning new concepts — you should be practising speed, accuracy and thinking out loud.
Days 21–24: Timed question practice
Pick 2–3 questions daily from the 50+ question bank at dataanalystinterview.com/sql-top-question/. Set a 25-minute timer per question. If you get stuck after 10 minutes, look at the hint — not the full answer.
Days 25–26: Company-specific prep
Research your target company. If it’s Flipkart, focus on window functions and business case queries. If it’s TCS or Infosys, easy-to-medium GROUP BY questions are the focus. Tailor your practice.
Days 27–28: Weak area drilling
From your 20+ days of practice, you know what trips you up. Spend 2 full days on only your weak spots. Most people need extra time on CTEs or consecutive-day window function tricks.
Days 29–30: Full mock interview
Book a mock SQL interview session. Write queries live, explain your reasoning out loud, handle feedback. The difference between practising alone and performing in an interview is massive.
⭐ Key Takeaways
- 30 days is enough with 1–2 hours daily — basics in week 1, advanced in weeks 2–3, practice in week 4
- Days 1–10 cover 100% of easy interview questions — GROUP BY, JOINs and basic aggregations
- Days 15–20 on window functions is your biggest differentiator — 92% of senior interviews test these
- The anti-join pattern (LEFT JOIN + WHERE IS NULL) is asked at almost every company — memorise it
- Days 29–30: do a live mock interview — writing SQL under observation reveals habits reading cannot
- All resources needed are free: SQL Hub with live compiler at dataanalystinterview.com/sql-interview/
Start Day 1 right now — free
Our SQL Hub has all 8 topics, worked examples and a live SQL compiler with pre-loaded tables. No account, no download.
Start SQL Learning Free →