✅ SQL Interview Roadmap: Learn Step-by-Step
📘 Stage 1: SQL Basics
🔸 Goal: Understand how SQL interacts with databases
Topic Focus Practice
Use, structure, types (DDL, DML, DCL,
✅ What is SQL? Read SQL theory
TCL)
✅ Data Types INT, VARCHAR, DATE, BOOLEAN, etc. Create sample tables
Write queries from dummy
✅ Basic SQL Commands SELECT, FROM, WHERE, ORDER BY
data
✅ Filtering Data AND, OR, IN, BETWEEN, LIKE Query specific conditions
✅ Sorting & Limiting ORDER BY, LIMIT, TOP Get top-N records
🧠 Interview Questions:
What is the difference between WHERE and HAVING?
How do you retrieve top 5 highest paid employees?
📘 Stage 2: Intermediate SQL
🔸 Goal: Perform data manipulations and multi-table queries
Topic Focus Practice
✅ Aggregate Functions COUNT(), SUM(), AVG(), MIN(), MAX() Use on different columns
Group employees by
✅ GROUP BY Group data and use aggregates
department
✅ HAVING Clause Conditions on groups Total sales > 5000
INNER, LEFT, RIGHT, FULL OUTER, SELF Combine employee & dept
✅ JOINS
JOIN tables
✅ Subqueries In SELECT, WHERE, FROM Nested queries
✅ Aliases Rename tables & columns Improve readability
🧠 Interview Questions:
Difference between INNER JOIN and LEFT JOIN?
Write a query to get departments with more than 5 employees.
📘 Stage 3: Database Design & Table Operations
🔸 Goal: Work with database structures
Topic Focus Practice
✅ CREATE, ALTER, DROP Create student &
Design schemas
TABLE course tables
✅ INSERT, UPDATE,
Modify data Simulate transactions
DELETE
PRIMARY KEY, FOREIGN KEY, UNIQUE,
✅ CONSTRAINTS Create valid schemas
NOT NULL, CHECK, DEFAULT
Normalize student-
✅ NORMALIZATION 1NF, 2NF, 3NF
course data
🧠 Interview Questions:
What is normalization? Benefits?
What is the difference between PRIMARY KEY and UNIQUE?
📘 Stage 4: Advanced SQL Concepts
🔸 Goal: Optimize and handle complex queries
Topic Focus Practice
View high-performing
✅ Views Create & use virtual tables
students
✅ Indexes Improve query speed Index on customer name
ACID properties, BEGIN, COMMIT, Simulate bank
✅ Transactions
ROLLBACK transactions
ROW_NUMBER(), RANK(), LEAD(),
✅ Window Functions Rank students by score
LAG()
Assign grade based on
✅ CASE Statement Conditional logic
marks
✅ CTE (Common Table
Temporary result sets Recursive queries
Expression)
🧠 Interview Questions:
What is the difference between RANK() and ROW_NUMBER()?
When do you use transactions?
📘 Stage 5: Real-World Scenarios & Optimization
🔸 Goal: Work like a data analyst or backend developer
Topic Focus Practice
✅ Query Optimization EXPLAIN plan, reduce joins Improve query time
✅ Stored Procedures & Create calculate_salary()
Reusable logic
Functions function
Auto-actions on table
✅ Triggers Trigger after insert
changes
✅ Data Export & Import CSV, JSON Load data into table
🧠 Interview Questions:
How do indexes affect performance?
What are triggers used for?