TheShiraverseSELECT * TheShiraverse

SQL practice, session by session

Every live class gets 400 questions on real RetailMart data: 100 Easy, 100 Medium, 100 Hard and 100 Crazy hard, in small sets. Write the query, run it on the page, press Check. Your ticks stay in this browser.

Live class scheduleNotes for every classSQL Playground
Module 1 · Foundations
Session 1
What is SQL?
100 questions · 0 solved
Session 2
How SQL is Organised
100 questions · 0 solved
Session 3
Writing Your First Queries
400 questions · 0 solved
Session 4
Data Types
400 questions · 0 solved
Session 5
Constraints
400 questions · 0 solved
Session 6
Keys: PRIMARY KEY, FOREIGN KEY & ON DELETE
400 questions · 0 solved
Session 7
DISTINCT & Filtering
400 questions · 0 solved
Session 8
Sorting & Pagination: ORDER BY, LIMIT & OFFSET
400 questions · 0 solved
Module 2 · Querying & Aggregation
Session 9
String Functions
Practice coming soon
Session 10
Date & Time Basics
Practice coming soon
Session 11
Conditional Logic & Casting: CASE WHEN & CAST
Practice coming soon
Session 12
NULL Handling: COALESCE, NULLIF & Three-Valued Logic
Practice coming soon
Session 13
Aggregate Functions: COUNT, SUM, AVG, MIN, MAX & STRING_AGG
Practice coming soon
Session 14
GROUP BY & HAVING
Practice coming soon
Session 15
Subtotals: ROLLUP & GROUPING()
Practice coming soon
Session 16
CUBE & GROUPING SETS
Practice coming soon
Session 17
Joins: The Idea & INNER JOIN + LEFT & RIGHT JOIN
Practice coming soon
Session 18
Anti-Joins: Finding What Never Happened
Practice coming soon
Session 19
FULL OUTER JOIN & Data Reconciliation
Practice coming soon
Session 20
CROSS JOIN: All Combinations
Practice coming soon
Session 21
Joining 3–5 Tables
Practice coming soon
Session 22
Self-Joins: Hierarchies & Pair Comparisons
Practice coming soon
Session 23
Set Operations: UNION, INTERSECT & EXCEPT
Practice coming soon
Module 3 · Subqueries, CTEs & Database Concepts
Session 24
Subqueries I: Scalar & Multi-Row (IN, ANY, ALL)
Practice coming soon
Session 25
Subqueries II: Derived Tables in FROM
Practice coming soon
Session 26
Correlated Subqueries & EXISTS
Practice coming soon
Session 27
LATERAL Joins
Practice coming soon
Session 28
Common Table Expressions (WITH)
Practice coming soon
Session 29
Recursive CTEs: Hierarchies & Trees
Practice coming soon
Session 30
Normalization: 1NF, 2NF, 3NF
Practice coming soon
Session 31
Transactions, ACID & Access Control
Practice coming soon
Module 4 · Window Functions & Performance
Session 32
Window Functions I: Ranking
Practice coming soon
Session 33
Window Functions II: Buckets & Distribution
Practice coming soon
Session 34
Window Functions III: Running Totals & Moving Averages
Practice coming soon
Session 35
Window Functions IV: Window Frames
Practice coming soon
Session 36
Window Functions V: LAG & LEAD
Practice coming soon
Session 37
Window Functions VI: FIRST_VALUE, LAST_VALUE & NTH_VALUE
Practice coming soon
Session 38
Query Plans I: Reading EXPLAIN
Practice coming soon
Session 39
Query Plans II: EXPLAIN ANALYZE
Practice coming soon
Session 40
Indexing I: B-Tree Indexes
Practice coming soon
Session 41
Indexing II: Composite, Partial & Covering Indexes
Practice coming soon
Module 5 · Analytics Power Tools & Programmable SQL
Session 42
Conditional Aggregation & FILTER
Practice coming soon
Session 43
Unpivoting Data
Practice coming soon
Session 44
Percentiles & Medians
Practice coming soon
Session 45
DISTINCT ON & Latest-Per-Group
Practice coming soon
Session 46
Time Series: generate_series & Gap-Filling
Practice coming soon
Session 47
Time Zones & Fiscal Calendars
Practice coming soon
Session 48
JSON I: JSON vs JSONB, -> and ->>
Practice coming soon
Session 49
JSON II: Containment & GIN Indexes
Practice coming soon
Session 50
Views
Practice coming soon
Session 51
Materialized Views
Practice coming soon
Session 52
Functions & Stored Procedures
Practice coming soon
Session 53
Triggers
Practice coming soon
Module 6 · Analyst Patterns
Session 54
Deduplication
Practice coming soon
Session 55
Cleaning Messy Data
Practice coming soon
Session 56
Cohort Analysis & RFM
Practice coming soon
Session 57
Funnels & Stickiness
Practice coming soon
Session 58
SQL from Python
Practice coming soon
Session 59
SQL for BI Tools & Dashboards
Practice coming soon

Want more questions?

The first question bank, by topic, as one download: a Markdown file per topic and a README on running them against RetailMart.

📦Older question bank, topic-wise28 topics · 11,200 questions · Easy to Crazy hard · questions only, no answers or checkerZIP · 280 KB ↓