SQL
Write real queries against a real database. Every answer is run and checked.
About SQL
SQL (Structured Query Language) is how you ask a relational database for data and change it. The same core language works across MySQL, PostgreSQL, SQL Server and SQLite.
Every practice question here runs your query against a real database and compares the result with the expected answer, so you learn by writing queries, not by reading them.
Why it matters for placements
SQL questions appear in online assessments, in technical rounds and in almost every data or backend role. Joins, GROUP BY and "second highest salary" style questions are asked constantly.
What you'll learn
10 topics · 39 lessons, each with practice
- Filter, sort and paginate data with SELECT, WHERE, ORDER BY and LIMIT
- Combine tables with inner, left and self joins
- Summarise data with GROUP BY, HAVING and aggregate functions
- Write subqueries, CTEs and window functions like RANK and ROW_NUMBER
- Create tables and change data with INSERT, UPDATE and DELETE
Foundation Foundation
Take Foundation testRequired. Enough to clear online assessments and service-company interviews.
SELECT Basics
Not startedAlmost every app keeps its data in tables, and SQL is how you read it back. These basics let you pull the exact columns and rows you need without writing a program. Every later topic, and nearly every SQL interview question, starts with a plain SELECT.
Filtering & Sorting
Not startedReal questions are never about the whole table: they ask for employees in Pune, salaries above 50000, or names starting with A. Filtering picks the rows that matter and sorting puts them in a useful order. Handling NULL correctly here is one of the most tested ideas in SQL interviews.
Aggregation
Not startedManagers ask for totals, averages and counts, not raw rows. Aggregation turns many rows into one summary number, either for the whole table or for each group like each department. Questions such as "average salary per department" or "departments with more than 5 employees" appear in nearly every SQL round.
Joins
Not startedGood databases split data across tables, so an employee row holds a department id, not the department name. Joins put related rows back together so you can answer questions that span tables. They are the single most tested SQL skill after SELECT, and almost every interview has at least one join question.
DDL & DML
Not startedReading data is only half the job; someone has to create the tables and keep the rows up to date. DDL defines the structure of tables and DML adds, changes and removes rows. Interviews ask about the difference between DELETE, TRUNCATE and DROP, and about constraints that keep data correct.
Interview Ready Interview Ready
Take Interview Ready testRecommended. Enough for technical rounds at good product companies.
Subqueries
Not startedSome questions need one answer before you can ask the next, like "who earns more than the average". A subquery is a query inside another query that supplies that first answer. Subqueries, correlated subqueries and EXISTS show up often in interviews, especially in questions about rows with or without a match.
Set Operations & Functions
Not startedReal reports combine lists, label values, clean text, work with dates and fill in missing data. Set operations merge results from several queries, and built-in functions transform values inside a query. These are the everyday tools for turning raw rows into a readable answer, and dialect differences between MySQL and SQLite are common MCQs.
Window Functions
Not startedGROUP BY collapses rows, but many questions need a calculation while keeping every row, like a rank or a running total. Window functions compute over a set of related rows without merging them. They solve ranking, top N per group and row-to-row comparisons cleanly, and they are now expected in most SQL interviews.
Interview Classics
Not startedA small set of SQL questions comes up again and again in fresher interviews. Each one tests whether you can combine the basics, like subqueries, joins and window functions, under pressure. Knowing these patterns and their traps lets you answer quickly and explain more than one approach.
Advanced Advanced
Take Advanced testOptional. For top product companies. Never counted against your readiness.
Views, Indexes & Optimization
Not startedQueries that are fine on a hundred rows can crawl on millions. Views keep complex queries reusable, indexes make lookups fast, and EXPLAIN shows what the database is actually doing. Interviewers ask freshers how indexes work and when they help, and real jobs need you to fix slow queries.