SQL is asked in almost every developer, tester and data analyst interview. This roadmap takes you from your first SELECT query to joins, window functions and query optimisation using MySQL – in about 6–8 weeks.
By Deepak Panwar, Founder – Smart Programming | Updated: October 2026
Follow the stages in order. Finish the practice task before moving to the next stop.
Understand what a database is and get MySQL running on your system.
Practice: Create a database called college with a students table.
Create tables and add, change or remove data.
Practice: Create 4 related tables (students, courses, enrollments, teachers) with keys.
Read exactly the data you need.
Practice: Write 25 SELECT queries on your college database.
Summarise data – a favourite of interviewers.
Practice: Find the number of students per course and courses with more than 10 students.
Combine data from multiple tables – the most important SQL topic.
Practice: List every student with their courses and teachers using joins.
Break complex questions into smaller queries.
Practice: Solve “second highest salary” in 3 different ways.
Design tables that avoid duplicate and inconsistent data.
Practice: Normalise a messy single-table design into 3NF.
Make queries fast on large tables.
Practice: Use EXPLAIN to compare a query before and after adding an index.
Database features used in real applications.
Practice: Write a stored procedure that transfers money between two accounts inside a transaction.
Advanced queries that impress interviewers.
Practice: Practise 50 common SQL interview queries (Nth salary, duplicates, top N per group).
Students, courses and enrollments with reports using joins and GROUP BY.
Books, members and issue records with views and stored procedures.
Monthly revenue, top products and running totals using window functions.
Basic SQL can be learned in 2–3 weeks. Following this complete roadmap, including joins, subqueries and window functions, takes about 6–8 weeks.
MySQL is a great first choice – it is free, widely used in Indian companies and works perfectly with Java and PHP projects.
Yes. Almost every Java application uses a database, and SQL questions are common in Java developer interviews.
SQL alone is enough for some data and support roles, but combined with Java, Python or testing skills it greatly improves your chances.
Use SQL in real projects with JDBC and Spring Data JPA in our Java courses, and test your knowledge with free MCQs.