SQL Fundamentals
Query, filter, join and summarize relational data.
Work with a real SQLite database in your browser. You will read rows out of an online store, filter them precisely (including the NULL rules that catch everyone out), summarize them with GROUP BY and HAVING, join customers to their orders and find the ones with none, change data safely inside transactions, design normalized schemas with junction tables, read query plans and add the indexes they ask for, and finish with subqueries, set operations, CTEs and window functions on real reporting tasks.
What you will learn
- SELECT and ORDER BY
- Filtering with WHERE
- NULL and three-valued logic
- Aggregation and GROUP BY
- Joins
- INSERT, UPDATE, DELETE and transactions
- Schema design and normalization
- Indexes and query plans
- Subqueries, set operations, CTEs and window functions
Lessons
- 1
Tables and SELECT
Read rows out of a real database: pick columns, name them, sort them and take the top few.
11 exercises
- 2
Filtering Rows
Keep only the rows you want with WHERE, and learn the NULL rules that quietly break queries.
11 exercises
- 3
Grouping and Aggregates
Turn thousands of rows into the handful of numbers a report actually needs.
9 exercises
- 4
Joining Tables
Put the store back together: match orders to customers, find the rows that are missing, and avoid the joins that quietly double your numbers.
11 exercises
- 5
Changing Data and Schemas
Write to the database without wrecking it: INSERT, UPDATE and DELETE with a WHERE, plus the transactions and constraints that keep bad data out.
14 exercises
- 6
Designing a Schema: Keys, Relationships and Normal Forms
Model one to many and many to many relationships, choose what a delete does to the rows that point at it, and normalize a flat table without losing a fact.
10 exercises
- 7
Indexes and Query Plans
Read what the database plans to do with a query, add the index that turns a full scan into a direct search, and know what every index costs.
9 exercises
- 8
Subqueries, Set Operations, CTEs and Windows
Build queries out of queries, combine result sets, then write the five reports a backend developer is actually asked for.
13 exercises
How you practice
You practice in the browser and every exercise gives you feedback right away. This course uses these formats:
- Code exercise: 42
- Predict the output: 12
- Fix the bug: 11
- Fill in the blank: 7
- Multiple choice: 5
- Select all that apply: 4
- Match the pairs: 3
- Type the answer: 2
- Spot the bug: 2
Aligned to
- Data Management
- DM-CoreCore Database System Concepts
- DM-ModelingData Modeling
- DM-RelationalRelational Databases
- DM-QueryingQuery Construction
- DM-ProcessingQuery Processing
Proto Node Labs is not affiliated with or endorsed by ACM / IEEE-CS / AAAI. Exam names are trademarks of their owners.