I know how tough job hunting is—I applied to over 3,000 jobs before landing my internship and full-time role. That’s why I share all my resources for free, hoping even 1% helps your career. I work on this alone with no budget, so if you find this article helpful, please consider supporting me.
By making a donation through buymeacoffee
or subscribing to my Youtube page.
Connect with me on LinkedIn
Interview Prep + Coaching with me : Link
Also, you can use Final Round AI to enhance your job search by having AI build your resume, apply on your behalf and help with mock interviews. Link
MASTER SQL IN JUST 15 DAYS
I had worked really hard to master SQL solving 300+ questions for over a month. This definitely helped me become really good at SQL. However, when I started giving interviews which included final rounds at Google, Apple and Amazon, I noticed 95% of questions always came from these 10 types of questions. Secondly, even for the theory questions , I noticed majority of the times that there were these 13 theory questions and that majority of SQL theoretical questions also came from these questions. So, I did 3 things :
Created a list of these 10 SQL Patterns and the problems to solve for these patterns.
Created answers for 13 SQL Theory Questions with Examples to ensure you can ace these questions too.
15 Day Roadmap to master these SQL Interviews
Pattern 1 : Find duplicate records
LeetCode — Duplicate Emails. Classic GROUP BY/HAVING duplicate detector. LeetCode
DataLemur — Duplicate Job Listings (LinkedIn). Count companies posting duplicated jobs (same title/description). DataLemur
Pattern 2 : Top-N per group (window functions)
LeetCode — Department Top Three Salaries (top-3 per department via DENSE_RANK). LeetCode
DataLemur — Top Fans Rank (Spotify) (rank artists by top-10 appearances). DataLemur
DataLemur — Highest Grossing Products (Amazon) (tutorial variant showing RANK for top spend per category). (closest match) staging.datalemur.com
Pattern 3 : Detect missing data / gaps (in IDs/dates)
(SQL platforms rarely ask pure “find gaps” with generated calendars; these are close practical matches that require detecting absence or coverage.)
LeetCode — Sales Analysis III (identify products sold only within a fixed window—tests range coverage logic). (closest match) LeetCode
DataLemur — IBM Db2 Product Analytics (build a histogram including employees with no queries during a period). (closest match) DataLemur
Pattern 4 : Second highest value
LeetCode — Second Highest Salary. The archetype. LeetCode
LeetCode — Nth Highest Salary (generalizes the same ranking trick). LeetCode
Pattern 5 : Pivot-style aggregations (wide columns)
(Most interview platforms use CASE…SUM to “pivot”.)
DataLemur — Laptop vs. Mobile Viewership (NYTimes) (two columns: laptop_views & mobile_views). GitHub
DataLemur — Time Spent on Snaps (Snapchat) (percent split columns via CASE/SUM). DataLemur
Pattern 6 : Running totals / cumulative metrics
LeetCode — Game Play Analysis III (cumulative
games_played
per user by date). LeetCodeDataLemur — Long Calls Growth (UnitedHealth) (uses LAG & monthly counts; pairs well with running totals thinking). DataLemur
Pattern 7 : Employee hierarchy / recursive CTEs
DataLemur — Senior Managers (Google) (derive managers with their direct report counts; great CTE practice). DataLemur
Pattern 8 : Complex joins (inner/left/anti, multi-table)
LeetCode — Trips and Users (join + filter out banned riders/drivers; daily cancel rate). LeetCode
LeetCode — Customers Who Never Order (anti-join pattern). LeetCode
LeetCode — Average Selling Price (date-range join across price intervals). LeetCode
Pattern 9 : Percentage contribution / share of total
DataLemur — Time Spent on Snaps (Snapchat) (percent sending vs opening by age group). DataLemur
DataLemur — Laptop vs. Mobile Viewership (NYTimes) (separate category totals—often extended to % of total). GitHub
Pattern 10 : Overlapping ranges (interval joins)
LeetCode — Average Selling Price (join
UnitsSold.purchase_date
to[start_date, end_date]
price windows). LeetCodeLeetcodeDataLemur — Total Utilization Time (AWS) (aggregate overlapping server up-time intervals—classic interval logic). DataLemur
300+ SQL Interview Questions I SOLVED:
Here is the complete excel sheet of over 300+ questions for SQL which will help you ace any interview : Link.
Even practice 3 questions a day will help you master your skills.
20 MOST ASKED SQL THEORY QUESTIONS : Link
15 DAY BY DAY ROADMAP
Day 1–3: Core SQL Foundations (Theory from PDF)
(No coding yet — just theory practice)
Day 1
SQL Command Types: DDL, DML, DCL, DQL.
SQL Data Types and their usage.
SELECT statement basics.
Joins overview (Inner, Outer, Self, Cross).
Day 2
Inner vs Outer Join (differences).
Primary Key vs Foreign Key.
Subquery vs Join.
ACID Properties.
Day 3
GROUP BY vs HAVING.
SQL Order of Execution.
UNION vs UNION ALL.
Query Optimization techniques.
Day 4–6: Advanced SQL Theory
Day 4
CASE statement usage.
Self Join (employee–manager).
LIMIT clause.
Day 5
Window Functions overview.
RANK vs DENSE_RANK vs ROW_NUMBER.
COUNT alternatives.
Day 6
Second/Nth Highest Value.
BETWEEN operator.
Normalization.
DELETE vs TRUNCATE vs DROP.
Handling NULLs.
Aggregate Functions.
Day 7–11: SQL Patterns & Problem Practice
Day 7 — Pattern 1: Find Duplicates & Pattern 2: Top-N per Group
LeetCode: Duplicate Emails
DataLemur: Duplicate Job Listings (LinkedIn)
LeetCode: Department Top Three Salaries
DataLemur: Top Fans Rank (Spotify)
Day 8 — Pattern 3: Detect Missing Data & Pattern 4: Second Highest Value
LeetCode: Sales Analysis III (closest match for missing data)
LeetCode: Second Highest Salary
LeetCode: Nth Highest Salary
Day 9 — Pattern 5: Pivot Data & Pattern 6: Running Totals
DataLemur: Laptop vs. Mobile Viewership (NYTimes)
DataLemur: Time Spent on Snaps (Snapchat)
LeetCode: Game Play Analysis III
DataLemur: Long Calls Growth (UnitedHealth)
Day 10 — Pattern 7: Employee Hierarchy & Pattern 8: Complex Joins
DataLemur: Senior Managers (Google)
LeetCode: Trips and Users
LeetCode: Customers Who Never Order
LeetCode: Average Selling Price
Day 11 — Pattern 9: Percentage Contribution & Pattern 10: Overlapping Ranges
DataLemur: Time Spent on Snaps (Snapchat) (percent contributions)
LeetCode: Average Selling Price (interval join)
DataLemur: Total Utilization Time (AWS)
Day 12–14: Revision & Mock Drills
Day 12 — Revise Theory (Q1–12).
Day 13 — Revise Theory (Q13–25).
Day 14 — Pattern Revision: mix practice across duplicates, top-N, joins, running totals.
Day 15: Mock Interview Simulation
30 mins of theory Q&A (explain concepts aloud without SQL).
60 mins of problem solving: pick 2 LeetCode + 1 DataLemur problem.
Reflect and revisit weak areas.