Grokking SQL for Tech Interviews
Master SQL, Ace Your Interview.

Course Overview
This course is designed for software engineers, database engineers, data engineers, and ML engineers who are preparing for SQL interviews. Whether you are a beginner or looking to brush up on your SQL skills, this course is for you. We will start with an introduction to SQL, covering all the basics, and then, dive into 75 carefully selected SQL interview questions. Each question comes with a detailed explanation to help you understand the concepts thoroughly. Our goal is to make sure you feel confident and well-prepared for your SQL interviews. The questions are picked to reflect what you might face in real-world interviews. Join us to master SQL and ace your next coding interview!
What you'll learn in Grokking SQL for Tech Interviews
- SQL in the order interviews ask about it: a fast review of the basics, then functions, nested queries, joins, and set operations.
- The joins worked through example by example, including the self join, which is the one candidates most often fumble under pressure.
- A live database in the browser, so you run your own query against real tables and see the rows come back instead of reading SQL you never execute.
- Nested queries and subqueries, including when a subquery is the right tool and when it is quietly the slow one.
- Database backup and restore, which comes up in data and analytics interviews far more often than candidates prepare for.
- The order a query actually executes in, which is not the order you write it and explains most of the results that look wrong.
- 69 interview problems graded easy, medium, and hard, each with an example, a solution query, and a step by step account of how that query was built.
- Set operations, and when a union or an intersect is the cleaner answer than yet another join.
- The DDL and DML you are expected to know on sight: creating and altering tables, constraints, inserts, updates, and deletes.
- 14 Test Your Knowledge problems at the end, where nothing tells you which technique the question is fishing for.
Course Content
Order of Execution
SQL Functions
Nested Queries
SET Operations
Database Backup & Restore
Interview Problems - Easy
1. Major Cities
2. Not boring movies
3. Triangle Judgement
4. Biggest Single Number
5. Product Sales Analysis I
6. Product Sales Analysis II
7. Game Play Analysis I
8. Game Play Analysis II
9. Queries Quality and Percentage
10. Average Selling Price
11. Weather Type in Each Country
12. Students and Examinations
13. Ads Performance
14. Group Sold Products By The Date
15. Employee Email Verification
16. Sellers With No Sales
17. Average Time of Process
18. Find Followers Count
19. Ad-Free Sessions
20. Bikes Last Time Used
21. Daily User Engagement Levels
22. Employee Attendance Record
23. Library Book Loans
24. Customer Purchase Summary
25. Long Comments (Easy)
26. Unused Accounts
27. Patient Appointment No-Shows
28. Books and Authors
29. High School Attendance
30. Employee Absences
31. Green Product Identification (Easy)
32. Employee Department Exclusion (Easy)
33. Sales Person (Easy)
34. Employee Task Tracking (Easy)
Interview Problems - Medium
1. Winning Candidate
2. Second Degree Follower
3. 2nd Highest Salary
4. Game Play Analysis III
5. Game Play Analysis IV
6. Active Businesses
7. Product Price on a Specific Date
8. Monthly Transactions II
9. Team Scores in Football Tournament
10. Page Recommendations
11. Running Total for Different Genders
12. Evaluate Boolean Expression
13. Active Users
14. Find Interview Candidates
15. Suspicious Bank Accounts
16. Order Fulfillment Rate (Medium)
17. Last Person to Fit in the Elevator (Medium)
18. Retail Expansion Analysis (Medium)
19. Employee Collaboration Networks (Medium)
20. Second Fastest Time in Races (Medium)
Interview Problems - Hard
1. Trips and Users
2. Human Traffic of Stadium
3. Students Report By Geography
4. Game Play Analysis V
5. Number of Transactions per Visit
6. Find the Quiet Students in All Exams
7. First and Last Call On the Same Day
8. Build the Equation
9. Longest Winning Streak
10. Dynamic Pivoting of a Table
11. Dynamic Unpivoting of a Table
12. Generate the Invoice
13. Popularity Percentage
14. Viewers Turned Streamers
15. Status of Flight Tickets
Test Your Knowledge
1. High Performing Employees (Easy)
2. Student Course Averages (Easy)
3. Library Book Checkout Percentage (Easy)
4. Employee Performance and Improvement Rate (Easy)
5. Find Popular Posts (Easy)
6. Main Office Assignment for Each Employee (Easy)
7. Rectangle Validation (Easy)
8. Library Book Checkouts by Date (Easy)
9. Same-Day Appointment Fulfillment (Medium)
10. Departments with High Earning Employees (Medium)
11. Students Who Attended All Courses (Medium)
12. Library Book Checkouts First Year (Medium)
13. Repeated Values in Sequence (Medium)
14. School Top Achievers by Subject (Hard)
What people say about our courses






About the Author

Arslan Ahmad
Industry Expertise & Leadership
Arslan Ahmad is the lead author of Grokking SQL for Tech Interviews. As the founder of Design Gurus and a former FAANG hiring manager, he has worked at industry giants like Facebook (now Meta) and Microsoft.
He has conducted hundreds of system design interviews, giving him unique insight into what top tech companies look for in candidates.
The course also incorporates expertise from senior engineers at Google, Meta, Amazon, Microsoft, and Uber, ensuring you learn system design best practices from professionals who have built and scaled real-world systems.
500+
Interviews Conducted
10k+
Students Taught
Related Courses
$118
$98
FAQs
What is Grokking SQL for Tech Interviews?
It is a SQL course built around interview questions rather than around a database syllabus. It reviews the language quickly, spends its time on the parts interviews actually probe such as joins, subqueries, set operations, and execution order, and then gives you 69 graded interview problems plus a 14 problem final check, all runnable in the browser.
Who is this course for?
Anyone facing a SQL round: backend and full stack engineers, data analysts, data engineers, business intelligence and analytics candidates, and product analysts. It also suits engineers who write SQL occasionally through an ORM and have never had to produce a correct query from scratch while somebody watches.
Which SQL dialect do the solutions use?
MySQL. The concepts and the vast majority of the syntax carry over directly to PostgreSQL, SQL Server, Oracle, and the cloud warehouses, since interview questions almost never hinge on a vendor-specific feature. Where a dialect would differ, it is usually a function name rather than an idea.
Can I actually run the queries?
Yes. Problem lessons embed a live database, so you write your query, run it against real tables, and see the rows it returns before you look at the solution. That matters more in SQL than in most subjects, because a query that looks right and returns the wrong rows is the single most common way candidates fail this round.
Do I need to know SQL already?
No, but this is a fast review rather than a first tutorial. The early chapters cover the language from the ground up in about 10 lessons, then the pace picks up sharply. If you have never written a SELECT statement you will need to read those chapters slowly. If you have written SQL before and simply need to get sharp, you can start at the joins chapter.
What kinds of interview problems are included?
The kind companies actually set, many of them recognisable from real interview loops: second highest salary, second degree followers, running totals, longest winning streak, human traffic of a stadium, trips and users, dynamic pivoting and unpivoting of a table, top achievers per subject, and a long run of product, game play, and employee reporting questions. They are graded easy, medium, and hard, and each one comes with a step by step account of how the query was assembled rather than just the finished answer.
Is this useful for data analyst and data engineer interviews as well as engineering ones?
Yes, and arguably more so. Analyst and data engineering loops often make SQL the main technical screen rather than one round among several, and the problem set here is aimed squarely at that style of question.
How is the course structured?
Roughly a third of it is a fast tour of the language: a quick review of SQL, execution order, functions, nested queries, joins, set operations, DDL, DML, and backup and restore. The rest is problems, split into easy, medium, and hard chapters, finishing with a Test Your Knowledge chapter that mixes them together without labels.
Is the course text-based or video-based?
Text-based, with diagrams for the join behaviour and a runnable database on the problem lessons. Reading a query, changing it, and re-running it is the whole point, and that is a page interaction rather than a video one.
Do I get a certificate of completion?
Yes. Design Gurus issues a certificate once you have completed the course, and you can share the link directly or add it to your LinkedIn profile.
