Python · SQL · Web Dev · Java · AI/ML tracks launching soon — your one platform for all of IT

SQL — Zero to Advanced

From your first SELECT to window functions and query optimisation — 62 modules, no prerequisites

Self-paced April 2026
🎓Complete beginners — zero SQL knowledge needed
📊Analysts who want to go beyond basic queries
💼Anyone preparing for SQL interview questions
🔄Developers switching into data roles
62
Modules
13
Sections
268+
Topics covered
15h
Total content
100%
Free forever
What makes this different
Live SQL Playground
Run real queries in your browser — no install, no account. Uses DuckDB-WASM with the FreshMart database preloaded.
Open →
Try It Challenges
Every module ends with a practice question. Reveal the answer and explanation when you're ready.
Open →
Visual JOIN Diagrams
Row-matching visualizations that make joins click — switch between INNER, LEFT, RIGHT, and FULL OUTER live.
Open →
SQL Cheat Sheet
All 62 modules' syntax on one printable page. Bookmark it for interviews.
Open →
Your learning dataset

The FreshMart Database

Every module, every query, every example uses FreshMart — a fictional Indian grocery chain with 10 stores across Bangalore, Hyderabad, Mumbai, Delhi, Chennai, and Ahmedabad.

customers20 rows
customer_idINTEGER
first_nameVARCHAR
last_nameVARCHAR
emailVARCHAR
phoneVARCHAR
+5 more columns
orders30 rows
order_idINTEGER
customer_idINTEGER
store_idVARCHAR
order_dateDATE
delivery_dateDATE
+3 more columns
order_items118 rows
item_idINTEGER
order_idINTEGER
product_idINTEGER
quantityINTEGER
unit_priceDECIMAL
+2 more columns
products25 rows
product_idINTEGER
product_nameVARCHAR
categoryVARCHAR
sub_categoryVARCHAR
brandVARCHAR
+4 more columns
stores10 rows
store_idVARCHAR
store_nameVARCHAR
cityVARCHAR
stateVARCHAR
manager_nameVARCHAR
+2 more columns
employees15 rows
employee_idINTEGER
first_nameVARCHAR
last_nameVARCHAR
roleVARCHAR
departmentVARCHAR
+4 more columns
// Curriculum

62 Modules. Zero to Advanced.

Follow in order. Each module builds on the last. Module 01 assumes you know nothing — Module 62 ends with real projects and 50 interview questions.

1
Section 1Databases & Setup
MODULE 01✓ LIVE

What is a Database?

Why Excel fails at scale — and what databases do instead

Excel vs databaseWhy databases existReal-world scaleFreshMart intro
8 min
read time
Start →
MODULE 02✓ LIVE

How Databases Work

Tables, rows, columns, keys — the building blocks explained simply

Tables & rowsColumnsPrimary keysForeign keys
10 min
read time
Start →
MODULE 03✓ LIVE

Types of Databases

Relational vs NoSQL — which one to use and when

RelationalNoSQLDocument storesWhen to use each
8 min
read time
Start →
MODULE 04✓ LIVE

Setting Up Your Environment

Install MySQL or PostgreSQL, or use the browser playground

MySQL setupPostgreSQLBrowser playgroundFirst connection
12 min
read time
Start →
2
Section 2Reading Data — SELECT
MODULE 05✓ LIVE

Your First Query — SELECT & FROM

The two most important words in SQL

SELECTFROMReading columnsBasic syntax
10 min
read time
Start →
MODULE 06✓ LIVE

Filtering Rows — WHERE Clause

Get only the rows you actually need

WHEREEquality filterComparison operatorsFiltering rows
12 min
read time
Start →
MODULE 07✓ LIVE

Multiple Conditions — AND, OR, NOT

Combine filters to answer complex questions

ANDORNOTCombining conditions
10 min
read time
Start →
MODULE 08✓ LIVE

Sorting Results — ORDER BY

Control the order your rows come back in

ORDER BYASCDESCMulti-column sort
8 min
read time
Start →
MODULE 09✓ LIVE

Limiting Results — LIMIT / TOP / FETCH

Only get the rows you need — critical for performance

LIMITTOPFETCH NEXTPagination basics
8 min
read time
Start →
MODULE 10✓ LIVE

Removing Duplicates — DISTINCT

See only unique values in your results

DISTINCTUnique valuesDeduplicationCOUNT DISTINCT
7 min
read time
Start →
MODULE 11✓ LIVE

Working with NULL Values

NULL is not zero, not empty — it is the absence of data

NULLIS NULLIS NOT NULLCOALESCENULLIF
12 min
read time
Start →
MODULE 12✓ LIVE

Column Calculations — Arithmetic

Do math directly inside your SQL query

ArithmeticExpressionsPrice calculationsDerived columns
8 min
read time
Start →
MODULE 13✓ LIVE

Renaming Columns — AS (Aliases)

Give columns and tables readable names

ASColumn aliasTable aliasReadability
7 min
read time
Start →
MODULE 14✓ LIVE

Pattern Matching — LIKE & Wildcards

Find rows that match a pattern, not an exact value

LIKE% wildcard_ wildcardPattern search
10 min
read time
Start →
3
Section 3Filtering & Logic
MODULE 15✓ LIVE

IN and BETWEEN Operators

Shorthand for multiple OR conditions and range checks

INNOT INBETWEENRange filters
8 min
read time
Start →
MODULE 16✓ LIVE

CASE WHEN — Conditional Logic

The SQL equivalent of an if-else statement

CASE WHENTHENELSEConditional columns
12 min
read time
Start →
MODULE 17✓ LIVE

Complex WHERE — Combining Conditions

Mastering brackets, precedence, and complex filters

BracketsPrecedenceAND vs ORComplex logic
10 min
read time
Start →
4
Section 4Writing & Changing Data
MODULE 18✓ LIVE

Data Types in SQL

INT, VARCHAR, DATE, BOOLEAN, DECIMAL — choosing the right type

INTVARCHARDATEBOOLEANDECIMALChoosing types
12 min
read time
Start →
MODULE 19✓ LIVE

Creating Tables — CREATE TABLE

Design and build your first database table

CREATE TABLEColumn definitionsData typesTable structure
14 min
read time
Start →
MODULE 20✓ LIVE

Adding Data — INSERT INTO

Put data into your tables, one row or many at once

INSERT INTOVALUESBulk insertMulti-row insert
10 min
read time
Start →
MODULE 21✓ LIVE

Updating Data — UPDATE

Change existing rows safely — the WHERE matters more than ever

UPDATESETWHERE on UPDATESafe updates
10 min
read time
Start →
MODULE 22✓ LIVE

Deleting Data — DELETE

Remove rows — and why you should always double-check first

DELETEWHERE on DELETESoft deleteDangerous without WHERE
10 min
read time
Start →
5
Section 5Database Design
MODULE 23✓ LIVE

Constraints — Rules for Your Data

PRIMARY KEY, FOREIGN KEY, NOT NULL, UNIQUE, DEFAULT, CHECK

PRIMARY KEYFOREIGN KEYNOT NULLUNIQUEDEFAULTCHECK
16 min
read time
Start →
MODULE 24✓ LIVE

Changing Structure — ALTER TABLE

Add, remove, or rename columns in an existing table

ALTER TABLEADD COLUMNDROP COLUMNRENAME
10 min
read time
Start →
MODULE 25✓ LIVE

DROP & TRUNCATE — Removing Tables

The difference between deleting data and deleting structure

DROP TABLETRUNCATEDELETE vs TRUNCATEIrreversible ops
8 min
read time
Start →
MODULE 26✓ LIVE

Normalization & ER Diagrams

1NF, 2NF, 3NF — designing tables that make sense

1NF2NF3NFER diagramsGood table design
20 min
read time
Start →
6
Section 6Aggregation
MODULE 27✓ LIVE

Aggregate Functions

COUNT, SUM, AVG, MIN, MAX — summarize your data

COUNTSUMAVGMINMAXSummarizing data
12 min
read time
Start →
MODULE 28✓ LIVE

Grouping Data — GROUP BY

The most powerful tool for data analysis in SQL

GROUP BYGrouping rowsAggregate per groupAnalysis patterns
14 min
read time
Start →
MODULE 29✓ LIVE

Filtering Groups — HAVING

Filter after grouping — not the same as WHERE

HAVINGFilter groupsHAVING vs WHEREPost-aggregation filter
10 min
read time
Start →
7
Section 7Joins
MODULE 30✓ LIVE

Introduction to Joins

Why data lives in multiple tables and how to combine it

Why joins existRelational modelJoin conceptON clause
12 min
read time
Start →
MODULE 31✓ LIVE

INNER JOIN — Only Matching Rows

The most common join — rows that exist in both tables

INNER JOINMatching rowsON conditionMost used join
14 min
read time
Start →
MODULE 32✓ LIVE

LEFT JOIN & RIGHT JOIN

Keep all rows from one side, even without a match

LEFT JOINRIGHT JOINNULL in joinsUnmatched rows
14 min
read time
Start →
MODULE 33✓ LIVE

FULL OUTER JOIN

All rows from both tables — matched or not

FULL OUTER JOINAll rowsBoth sidesNULL filling
10 min
read time
Start →
MODULE 34✓ LIVE

SELF JOIN — A Table Joining Itself

The trick behind org charts and manager hierarchies

SELF JOINHierarchyManager-employeeRecursive relation
12 min
read time
Start →
MODULE 35✓ LIVE

CROSS JOIN — Every Combination

Every row paired with every other row — use with care

CROSS JOINCartesian productAll combinationsUse cases
8 min
read time
Start →
8
Section 8Subqueries & Set Operations
MODULE 36✓ LIVE

Subqueries — Queries Inside Queries

Use the result of one query inside another

SubqueryNested querySubquery in WHERESubquery in SELECT
14 min
read time
Start →
MODULE 37✓ LIVE

Correlated Subqueries

Subqueries that reference the outer query — row by row

CorrelatedOuter query referenceRow-by-rowPerformance impact
14 min
read time
Start →
MODULE 38✓ LIVE

EXISTS & NOT EXISTS

Check if any matching rows exist — faster than IN for large sets

EXISTSNOT EXISTSExistence checkvs IN operator
12 min
read time
Start →
MODULE 39✓ LIVE

UNION, INTERSECT, EXCEPT

Combine or compare results from multiple queries

UNIONUNION ALLINTERSECTEXCEPTSet operations
12 min
read time
Start →
MODULE 40✓ LIVE

Derived Tables — Subquery in FROM

Treat a query result as a temporary table

Derived tableSubquery in FROMInline viewTemporary result
10 min
read time
Start →
9
Section 9SQL Functions
MODULE 41✓ LIVE

String Functions

UPPER, LOWER, CONCAT, LENGTH, TRIM, REPLACE, SUBSTRING

UPPERLOWERCONCATTRIMSUBSTRINGREPLACE
14 min
read time
Start →
MODULE 42✓ LIVE

Date & Time Functions

NOW, DATEDIFF, DATE_FORMAT — work with dates like a pro

NOWDATEDIFFDATE_FORMATDATEPARTDate arithmetic
14 min
read time
Start →
MODULE 43✓ LIVE

Math Functions

ROUND, FLOOR, CEIL, ABS, MOD — math inside SQL

ROUNDFLOORCEILINGABSMODMath in queries
10 min
read time
Start →
MODULE 44✓ LIVE

Type Conversion — CAST & CONVERT

Change a column's data type on the fly

CASTCONVERTType conversionImplicit vs explicit
10 min
read time
Start →
10
Section 10Advanced SQL Objects
MODULE 45✓ LIVE

Views — Virtual Tables

Save a query as a named view — query it like a table

CREATE VIEWVirtual tableUpdatable viewsView use cases
12 min
read time
Start →
MODULE 46✓ LIVE

Indexes — Making Queries Fast

The single most impactful performance tool in SQL

CREATE INDEXB-tree indexComposite indexWhen to index
14 min
read time
Start →
MODULE 47✓ LIVE

Transactions — COMMIT & ROLLBACK

Group queries into all-or-nothing operations

BEGINCOMMITROLLBACKSAVEPOINTAtomicity
12 min
read time
Start →
MODULE 48✓ LIVE

ACID Properties

The 4 rules every reliable database follows

AtomicityConsistencyIsolationDurabilityWhy ACID matters
14 min
read time
Start →
MODULE 49✓ LIVE

Stored Procedures

Save and reuse complex SQL logic on the server

CREATE PROCEDUREParametersCALLReusable logic
14 min
read time
Start →
MODULE 50✓ LIVE

User-Defined Functions

Build your own SQL functions for repeated logic

CREATE FUNCTIONScalar UDFTable-valued UDFRETURNS
12 min
read time
Start →
MODULE 51✓ LIVE

Triggers — Auto-Run on Events

SQL that runs automatically when data changes

CREATE TRIGGERBEFORE / AFTERINSERT / UPDATE / DELETEAudit logs
14 min
read time
Start →
11
Section 11Window Functions & CTEs
MODULE 52✓ LIVE

Window Functions — OVER & PARTITION BY

Aggregate without collapsing rows — the most powerful SQL feature

OVERPARTITION BYWindow frameNo GROUP BY collapse
16 min
read time
Start →
MODULE 53✓ LIVE

Ranking — ROW_NUMBER, RANK, DENSE_RANK

Rank rows within groups — critical for interview questions

ROW_NUMBERRANKDENSE_RANKNTILERanking patterns
14 min
read time
Start →
MODULE 54✓ LIVE

LAG, LEAD, FIRST_VALUE, LAST_VALUE

Access other rows' values from the current row

LAGLEADFIRST_VALUELAST_VALUERow comparison
14 min
read time
Start →
MODULE 55✓ LIVE

CTEs — WITH Clause

Write readable, layered queries with Common Table Expressions

WITHCTENamed subqueryMultiple CTEsReadability
14 min
read time
Start →
MODULE 56✓ LIVE

Recursive CTEs — Hierarchies & Trees

Query parent-child relationships with recursive queries

RECURSIVEHierarchyTree traversalUNION ALL in CTE
16 min
read time
Start →
12
Section 12Performance & Optimization
MODULE 57✓ LIVE

EXPLAIN & EXPLAIN ANALYZE

Read the query execution plan — know why a query is slow

EXPLAINQuery planSeq scan vs index scanExecution cost
14 min
read time
Start →
MODULE 58✓ LIVE

Index Strategies

Composite indexes, covering indexes, when NOT to index

Composite indexCovering indexIndex selectivityWhen to avoid
14 min
read time
Start →
MODULE 59✓ LIVE

Query Best Practices

Write clean, fast, readable SQL your team will thank you for

SELECT * avoidSARGabilityAvoid functions on indexed colsClean SQL
14 min
read time
Start →
13
Section 13Real-World & Interview
MODULE 60✓ LIVE

SQL for Data Analysis

Real case studies using Swiggy, Zepto, HDFC, and FreshMart data

Swiggy case studyZepto dataHDFC analysisFreshMart full query
30 min
read time
Start →
MODULE 61✓ LIVE

Top 50 SQL Interview Questions

Every question with full explanation, query, and common traps

Window fn questionsJoin questionsCTE questionsTricky NULLs50 answers
60 min
read time
Start →
MODULE 62✓ LIVE

3 Real SQL Projects

Build a full database, write analysis queries, present results

FreshMart projectE-commerce DBAnalytics dashboardEnd to end
90 min
read time
Start →
// Ready to start?

Start with Module 01. No setup required.

Every module runs entirely in your browser. Write real SQL against the FreshMart database from your very first lesson.

Share

Discussion

0

Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.

Continue with GitHub
Loading...