Learn Sql Free — Tutorials & Practice for Students
Free Sql tutorials, examples and coding practice for Indian students. Beginner to advanced, with an in-browser editor and AI feedback — no cost.
TL;DR: Free Sql tutorials, examples and coding practice for Indian students. Beginner to advanced, with an in-browser editor and AI feedback — no cost.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Free Sql course: 49 lessons, from the basics through to the advanced topics interviewers actually ask about. Every lesson is free, needs no sign-up, and runs in your browser with an editor and instant AI feedback.
Sql Course Syllabus — 49 Lessons
Work through them in order, or jump to the topic you need. 49 lessons include worked explanations and runnable examples.
Getting Started
- Introduction to SQL — SQL (Structured Query Language) is the standard language for managing relational databases and querying data.
Querying Data
- WHERE, AND, OR, NOT — The WHERE clause filters rows that match a condition.
- ORDER BY, LIMIT & OFFSET — ORDER BY sorts the result set by one or more columns.
- Aggregate Functions & GROUP BY — Aggregate functions perform calculations on a set of rows and return a single value.
- LIKE Operator — Text Pattern Matching — LIKE matches text patterns. % matches any sequence (0 or more chars), _ matches exactly one char.
- BETWEEN, IN, NOT IN Operators — BETWEEN x AND y is shorthand for >= x AND <= y (inclusive on both ends).
- NULL Handling & COALESCE Function — NULL represents missing or unknown data — it's not zero, not empty string, not false.
- DISTINCT & LIMIT — Unique Records & Result Limiting — DISTINCT removes duplicate rows from results — shows each unique combination once.
Multi-Table Queries
- JOINs — JOINs combine data from two or more tables based on a related column.
- Self-Join — Joining a Table to Itself — A self-join joins a table to a copy of itself, useful for finding relationships within the same table: employee-manager hierarchy, product comparisons, duplicate detection.
- Set Operations — UNION, INTERSECT, EXCEPT — UNION combines results from two or more queries into a single result, removing duplicates.
Modifying Data
- INSERT, UPDATE & DELETE — INSERT INTO adds new rows to a table. You can insert a single row or multiple rows at once.
- INSERT Multiple Rows — INSERT INTO ... VALUES can insert a single row or multiple rows at once.
- UPDATE & DELETE with WHERE Clauses — UPDATE modifies existing rows. WHERE specifies which rows.
Aggregation
- GROUP BY — Grouping Data for Analysis — GROUP BY groups rows that have the same value in one or more columns, then applies aggregate functions (COUNT, SUM, AVG, MAX, MIN) to each group separately.
- HAVING — Filtering Grouped Results — HAVING filters the results of GROUP BY. The key difference: WHERE filters individual rows BEFORE grouping, HAVING filters GROUPS AFTER aggregation.
SQL Advanced
- Subqueries — Queries Inside Queries — A subquery (also called a nested query or inner query) is a SQL query written inside another query.
- Window Functions — Advanced Ranking & Running Totals — Window functions perform calculations across a set of rows related to the current row, without collapsing rows like GROUP BY does.
- CTEs — Common Table Expressions (WITH Clause) — A CTE (Common Table Expression) is a named temporary result set defined with the WITH clause.
- Subqueries — Queries Inside Queries — A subquery (also called a nested query or inner query) is a SQL query written inside another query.
- Advanced Aggregation — ROLLUP, CUBE & Conditional Aggregates — Beyond basic GROUP BY, SQL offers ROLLUP and CUBE for multi-dimensional aggregation — generating subtotals and grand totals automatically.
- Correlated Subqueries — Advanced Filtering — A correlated subquery references outer query columns — it runs once per outer row, making it slower than JOINs but more readable for some problems.
- Window Functions — Advanced Ranking & Running Totals — Window functions perform calculations across a set of rows related to the current row, without collapsing rows like GROUP BY does.
Database Design
- CREATE TABLE, Primary Key & Constraints — DDL (Data Definition Language) is the SQL commands that define the structure of a database: CREATE TABLE, ALTER TABLE, DROP TABLE.
- Views — A VIEW is a saved SQL query that behaves like a virtual table.
- Indexes & Performance — An index is a data structure that speeds up SELECT queries at the cost of slightly slower INSERT/UPDATE/DELETE and extra storage.
- Transactions & ACID — A transaction is a sequence of SQL operations that must ALL succeed or ALL fail together.
- Normalisation (1NF, 2NF, 3NF) — Normalisation is the process of organising a database to reduce data redundancy and improve data integrity.
- CREATE TABLE & DROP TABLE — CREATE TABLE defines a new table with columns and constraints.
- ALTER TABLE — Modifying Table Structure — ALTER TABLE modifies an existing table: add columns, drop columns, rename columns, change data types, add/drop constraints.
- Constraints — PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK — Constraints enforce rules at the database level.
- Stored Procedures — A stored procedure is a set of SQL statements stored in the database that can be executed repeatedly.
- Triggers — Automatic Actions — A trigger is a special stored procedure that automatically executes (triggers) in response to specific events: INSERT, UPDATE, DELETE on a table.
Advanced SQL
- CASE Expression — Conditional Logic in SQL — The CASE expression adds if/else logic to SQL queries.
SQL Functions
- String Functions — SQL provides built-in functions to manipulate text: UPPER(), LOWER(), LENGTH(), TRIM(), SUBSTRING(), REPLACE(), CONCAT(), LIKE with wildcards.
- Date & Time Functions — SQL has rich date/time functions: NOW() returns current timestamp, CURDATE() returns today's date, YEAR/MONTH/DAY() extract parts, DATEDIFF() computes difference in days.
SQL Fundamentals
- CASE WHEN Expression — Conditional Transformation — CASE WHEN is SQL's if-then-else. It allows conditional logic directly inside SELECT queries to categorise data, create computed columns, and transform values.
- SQL Data Types — SQL data types define what kind of data a column can store: numbers, text, dates, booleans.
- CASE WHEN Expression — Conditional Transformation — CASE WHEN is SQL's if-then-else. It allows conditional logic directly inside SELECT queries to categorise data, create computed columns, and transform values.
Projects
- Project: Complete School Management System — A real-world school database: students, classes, teachers, subjects, marks, attendance.
- Project: E-Commerce Database System — Real e-commerce system: customers, products, categories, cart, orders, payments, reviews.
Intermediate
- JSON Functions in SQL — SQL databases now support JSON data types and functions for semi-structured data.
- Date Functions and Arithmetic — DATE_ADD() and DATE_SUB() add or subtract intervals from dates.
- String Functions (CONCAT, SUBSTR, REPLACE) — CONCAT() joins multiple strings together with no separator.
- SQL Performance Tips — Index foreign key columns for faster JOINs and lookups.
- Database Normalization (1NF to 3NF) — 1NF (First Normal Form): Each column contains atomic (indivisible) values; no repeating groups.
Advanced
- Recursive CTEs — Recursive CTEs use a WITH clause that references itself to traverse hierarchical data.
- UPSERT (INSERT ... ON CONFLICT/DUPLICATE) — UPSERT combines INSERT and UPDATE in a single operation.
Beginner
- Entity-Relationship (ER) Diagrams — ER diagrams visually represent database structure using entities, attributes, and relationships.
Who this Sql course is for
School and college students in India starting from zero, and anyone revising Sql for placements, board practicals or a project. There is no prerequisite beyond being able to type — the first lessons assume no programming background at all.
How to study this course
- Read the lesson, then run the example in the built-in editor before moving on — reading code is not the same as writing it.
- Try the practice task at the end of each lesson. Getting it wrong and fixing it is where the learning happens.
- When you are stuck, ask the free AI Tutor to explain that specific line rather than skipping ahead.
🤖 Stuck on any of these? Ask Syllab's free AI Tutor to explain step by step →