SQL & Databases
Master SQL from scratch to advanced. Tables, joins, aggregation, window functions, database design, performance tuning, and real-world analytics projects.
Why learn SQL & Databases?
Nearly every application you have ever used sits on top of a relational database, and SQL is how humans talk to them. It is also one of the highest-leverage skills in tech: analysts, backend developers, data scientists, and product managers all get more effective the moment they can query data themselves.
This track takes you from your first SELECT to genuinely advanced territory: joins, aggregation, window functions, database design, indexing and performance tuning, transactions, and how databases behave in production. The 72 lessons are all interactive, and the queries you practice follow the PostgreSQL dialect used by a huge share of modern applications.
The final module puts it together with realistic analytics scenarios, ending in a capstone that takes an empty database all the way to a working dashboard.
Who this course is for
- Beginners who want a data skill that is useful in almost any tech job
- Backend developers who can code but still fear the database layer
- Analysts and PMs tired of waiting for someone else to pull the numbers
- Anyone preparing for interviews where SQL questions are standard
What you'll build and practice
- Queries that filter, sort, and shape real datasets with confidence
- Multi-table joins and aggregations that answer actual business questions
- Window-function analyses like running totals and rankings
- A sensible schema designed from scratch, with keys and constraints
- A capstone that goes from empty database to an analytics dashboard
What you'll learn
SQL & Databases is organized into 12 focused modules. By the end you'll be comfortable with:
- Database Fundamentals
- Reading Data
- Filtering Like a Pro
- Functions & Calculations
- Aggregation
- Joins
- Creating & Changing Data
- Database Design
- Advanced SQL
- Performance
- Databases in Production
- Real World SQL
Course curriculum
72 lessons across 12 modules. Lessons marked Free preview are readable without an account.
Module 1. Database Fundamentals
What databases are, how tables organize data, and how keys connect everything — no experience required
- 7mWhat Are Databases?Free preview
Why every app needs a database, and why a spreadsheet isn't enough.
- 8mTables, Rows & ColumnsFree preview
The three building blocks of every database — and how to read a table like a pro.
- 8mMeet SQL: Your First QueryFree preview
Write your first SQL query and learn the four things SQL can do.
- 9mColumn Data Types
Every column has a type — numbers, text, true/false, dates. Choosing well prevents bugs forever.
- 7mNULL: The Missing Value
What it means when a cell has no value at all — and why NULL is not zero or empty text.
- 8mPrimary Keys
Every row needs a unique, permanent ID. That's the primary key — the anchor of every table.
- 10mForeign Keys: Connecting Tables
How a column in one table points at rows in another — the 'relational' in relational databases.
- 8mPractice: Database Fundamentals
No new concepts — realistic reps over tables, types, NULL, and keys.
Module 2. Reading Data
SELECT, WHERE, sorting, and limiting — the queries you'll write every single day
- 8mSELECT & FROM
Choosing exactly which columns you want — the foundation of every query.
- 8mAliases & Calculated Columns
Doing math in SELECT and renaming output columns with AS.
- 9mWHERE: Filtering Rows
Keep only the rows that match a condition — the single most important clause in SQL.
- 7mIS NULL & IS NOT NULL
Why WHERE phone = NULL finds nothing, and the right way to filter missing values.
- 8mORDER BY: Sorting Results
Rows come back in arbitrary order unless you say otherwise. ORDER BY is how you say otherwise.
- 8mLIMIT, OFFSET & DISTINCT
Top-N lists, pagination, and collapsing duplicate values.
- 9mPractice: Reading Data
No new concepts — realistic query-reading reps over everything in Module 2.
Module 3. Filtering Like a Pro
Combining conditions with AND/OR, text search with LIKE, ranges, and lists
- 8mAND, OR & NOT
Combining multiple conditions in one WHERE clause.
- 8mParentheses & Precedence
What happens when AND and OR mix — and the one rule that prevents the classic filtering bug.
- 9mLIKE & Pattern Matching
Searching text with wildcards — the SQL behind every search box.
- 8mBETWEEN: Ranges
Range filters for numbers and dates — and the date-range pattern professionals actually use.
- 8mIN & NOT IN
Matching against a list of values — and the NOT IN + NULL trap every developer hits once.
- 9mPractice: Filtering
No new concepts — combined filtering reps: logic, patterns, ranges, lists, and the NULL traps.
Module 4. Functions & Calculations
Transforming text, numbers, and dates — plus taming NULL with COALESCE
- 8mText Functions
LOWER, UPPER, LENGTH, TRIM, and friends — cleaning and shaping text inside queries.
- 8mNumber Functions & Casting
ROUND and friends, the integer division surprise, and converting between types with ::
- 9mDates & Times
NOW, INTERVAL arithmetic, EXTRACT, and DATE_TRUNC — the four tools behind every time-based report.
- 8mCOALESCE: Taming NULL
Finally, the tools that FIX NULLs: fallback values with COALESCE, and NULLIF for divide-by-zero armor.
- 9mPractice: Functions
No new concepts — text, numbers, dates, and NULL-taming combined into realistic report expressions.
Module 5. Aggregation
COUNT, SUM, AVG, and GROUP BY — turning rows into answers
- 9mCOUNT, SUM, AVG, MIN, MAX
Collapsing many rows into one answer: totals, averages, and extremes.
- 8mCOUNT Variants & NULL in Aggregates
COUNT(*) vs COUNT(column) vs COUNT(DISTINCT …) — and how every aggregate quietly skips NULLs.
- 10mGROUP BY
One aggregate per category instead of one for the whole table — the most important reporting tool in SQL.
- 8mGrouping by Multiple Columns
One bucket per combination — the pattern behind pivot-style business reports.
- 9mHAVING: Filtering Groups
WHERE filters rows before grouping; HAVING filters the groups after — and the full execution order.
- 9mPractice: Aggregation
No new concepts — realistic report-building reps with COUNT, SUM, AVG, GROUP BY, and HAVING.
Module 6. Joins
Combining tables — the most valuable skill in SQL
- 8mWhy Joins? The Two-Table Problem
Your data is split across tables on purpose — joins are how you put it back together.
- 10mINNER JOIN
The default join: only rows with a match on both sides survive — plus chaining three or more tables.
- 9mLEFT JOIN
Keep every row from the left table, matched or not — the join for 'ALL customers, with orders if any'.
- 8mFinding What's Missing (Anti-Join)
LEFT JOIN + IS NULL = find rows with NO match: customers who never bought, products that never sold.
- 10mFULL JOIN & Self Joins
Keeping unmatched rows from BOTH sides, and joining a table to itself for hierarchies.
- 9mJoins + GROUP BY
Order counts per customer, revenue per product — Modules 5 and 6 combined, plus the COUNT(*) vs COUNT(col) payoff.
- 10mPractice: Joins
No new concepts — join-type choices, anti-joins, and join+group pipelines on a realistic schema.
Module 7. Creating & Changing Data
CREATE TABLE, INSERT, UPDATE, DELETE, UPSERT, and transactions
- 10mCREATE TABLE & Constraints
Building your own tables at last — columns, types, and the rules that guard your data.
- 9mINSERT
Adding rows — one, many, or straight from a query — and getting the new id back.
- 10mUPDATE & DELETE — Safely
Changing and removing rows, the missing-WHERE catastrophe, and the SELECT-first safety ritual.
- 9mUPSERT: ON CONFLICT
Insert-or-update in one atomic statement — no race conditions, no check-then-write dance.
- 10mTransactions & ACID
All-or-nothing groups of statements — the guarantee that makes databases trustworthy with money.
- 9mPractice: Changing Data
No new concepts — DDL reading, safe writes, upserts, and transaction judgment calls.
Module 8. Database Design
Relationships, junction tables, delete rules, normalization, and real schemas
- 9mOne-to-One & One-to-Many
Every schema is built from three relationship shapes — here are the first two, and where the FK goes.
- 10mMany-to-Many & Junction Tables
When both sides are 'many', no FK fits either table — the junction table solves it.
- 9mON DELETE: Cascade or Protect?
When a parent row dies, what happens to its children? You decide — per foreign key.
- 10mNormalization
Every fact in exactly one place — the principle behind 'store the id, not a copy', formalized.
- 12mDesigning a Real Database
The full method, start to finish: requirements → entities → relationships → constraints, on a real blog schema.
- 10mPractice: Database Design
No new concepts — you design a food-delivery schema decision by decision.
Module 9. Advanced SQL
Subqueries, CTEs, CASE, set operations, EXISTS, and window functions
- 10mSubqueries
A query inside a query — when the filter itself needs computing first.
- 9mCTEs: WITH Clauses
Name your subqueries and read complex SQL top-to-bottom like a recipe.
- 9mCASE: If/Else in SQL
Conditional logic in queries — labels, buckets, and the mighty conditional-aggregation pattern.
- 8mUNION, INTERSECT & EXCEPT
Stacking and comparing whole result sets — SQL's Venn-diagram operators.
- 9mEXISTS & NOT EXISTS
The 'is there at least one?' test — correlated subqueries, and the NULL-proof answer to NOT IN.
- 10mWindow Functions: OVER & PARTITION BY
Aggregates that DON'T collapse rows — every row keeps its identity and gains a group statistic.
- 9mROW_NUMBER, RANK & DENSE_RANK
Numbering and ranking rows — and the top-N-per-group pattern, SQL interview question #1.
- 10mLAG, LEAD & Running Totals
Peeking at neighboring rows and accumulating as you go — growth rates and cumulative charts.
- 10mPractice: Advanced SQL
No new concepts — subqueries, CTEs, CASE, EXISTS, and windows, combined like production analytics.
Module 10. Performance
Indexes, EXPLAIN, and making slow queries fast
- 10mIndexes
Why a 10-million-row lookup takes milliseconds — and why you can't just index everything.
- 9mComposite, Partial & Expression Indexes
Multi-column indexes and the leftmost-prefix rule, plus indexing expressions and subsets.
- 10mEXPLAIN & Query Optimization
Read the database's own execution plan, then fix the classic slow-query patterns.
- 9mPractice: Performance
No new concepts — you're on call, and four slow queries just paged you.
Module 11. Databases in Production
Views, security & SQL injection, backups & recovery, and how apps talk to databases
- 9mViews: Saved Queries
Name a query once, use it like a table forever — plus materialized views for expensive reports.
- 10mSQL Injection & Least Privilege
The most famous attack in software — how it works, the one true defense, and locking down access.
- 9mBackups & Recovery
pg_dump, point-in-time recovery, and the rule that an untested backup doesn't exist.
- 10mHow Apps Talk to Databases
Connection strings, pooling, ORMs vs raw SQL, and migrations — the bridge to backend development.
Module 12. Real World SQL
E-commerce analytics, social graphs, dashboards, and the final capstone
- 12mE-Commerce Analytics
Revenue reports, customer lifetime value, and growth rates — the queries every analytics job runs daily.
- 12mSocial Network Queries
Followers, mutuals, and activity feeds — graph problems in relational clothing.
- 12mAnalytics Dashboard Patterns
Rolling averages, running totals, and cohort retention — the three patterns behind every BI dashboard.
- 15mCapstone: From Empty Database to Dashboard
One final build — schema, integrity, queries, performance, and analytics for a whole product. Then: what's next.
Frequently asked questions
- Which SQL dialect does this course teach?
- The course follows PostgreSQL, the most popular open-source dialect and the one you are most likely to meet in modern stacks. Almost everything transfers directly to MySQL, SQLite, and SQL Server, and the lessons flag the few places where dialects differ.
- Is SQL still worth learning when AI can write queries?
- More than ever. AI can draft a query, but you need SQL to know whether that query is correct, why it is slow, and what it silently got wrong. The skills in the later modules, like reading execution plans and designing schemas, are exactly what AI assistance does not replace.
- Do I need programming experience before starting SQL & Databases?
- No. SQL is its own language and this track starts from zero. If you can work with a spreadsheet, you have enough background for the first modules. The later performance and production modules get meaty, but the path there is gradual.
- Does the course cover database design or just writing queries?
- Both. There are dedicated modules on database design, normalization, keys and constraints, plus performance topics like indexes, and a production module covering transactions and how real systems use databases safely.
- How much of this course can I try before subscribing?
- The first lessons are free to read without an account, and a free account lets you explore the platform. Full access to this Pro track is included with a Kodion Pro subscription.
Ready to start SQL & Databases?
Create a free account to track progress, earn XP, and get instant help from the AI tutor as you code.
Create your free account