SQL and Database Fundamentals
Talk to the place where data lives: from querying to database design and management.
- 41 lessons
- 16 topics
- 276 coding exercises
- 410 questions
What you'll learn
- Pick the rows and columns you want from a table
- Filter, sort, and summarize data
- Join several tables and write subqueries and CTEs
- Design tables with keys and constraints
- Insert, update, and delete data safely
- Read a query and predict what it will return
Topics and lessons
1.Getting started
- Introduction to databases
2.Answering questions from one table
- SELECT and filtering
- Sorting and NULL
- CASE and the order a query runs
3.Summarizing
4.Combining tables
- Joins
5.Nested and step-by-step queries
- Subqueries
- Set operations and CTEs
6.Cleaning and transforming data
- Type, text, and date conversions
7.Database design
- Creating tables and constraints
- Data modeling
8.Data management
- Changing data
- Transactions and views
- Indexes and permissions
9.Advanced queries and capstone
Case study
Northbridge University student affairs
You work in a database that looks like a real system: 7 tables, 120 students, 781 course enrollments. First you query the ready-made data, then you design your own tables, change data safely, and in the last two lessons you build a library database from scratch.
Tools: PostgreSQL · runs in your browser, no install
How a lesson works
Explanation
A short explanation with examples. You change the code on the page and run it right away.
Coding exercises
Fill in the blanks, write it yourself, fix the bug. You get separate feedback for each requirement.
Lesson quiz
10 questions. Get at least 7 right to unlock the next lesson; every option has an explanation.
Review
Your mistakes go into the review queue and come back just as you start to forget them.
Sample question
SQL, grouping
What does this query return?
SELECT department_id, COUNT(*)
FROM student
WHERE gpa > 3
GROUP BY department_id;Every question in the lessons works like this
- After you answer, you read why each option is right or wrong.
- No memorization: you read the code or the data and work out the result yourself.
- Questions you miss go into your review queue and come back just as you start to forget them.
Projects you can build with this course
Apply what you learned on a real case from start to finish. Projects go step by step, and your code is saved.
SQL · project
Earbud: the first eight questions
Answer eight questions from a music app's product team, each from a single table; filter, sort, handle NULL correctly, add labels, and fix a broken query.
Beginner · 8 stepsSQL · project
Campus Stationery order analysis
Use joins to find order totals, top customers, category revenue and loyal customers in a four-table online store.
Intermediate · 7 stepsSQL · project
Campus event ticketing system
Build the hall, event and ticket tables with their constraints, load the data, write an occupancy view, sell and cancel safely, and give the box office only the permissions it needs.
Advanced · 8 steps
- Prerequisites
- None.
- Who it's for
- Students and new graduates who want to learn how data is stored and queried, whatever your major.
About this course
Do I need any background?
No. Finishing Python Programming Fundamentals first is a good idea, but it is not required.
Where do I start?
You begin with what a database is and the relational model, then learn querying, then table design and data management. All 41 lessons are open.
Is it free?
Yes. All lessons, coding exercises, quizzes, and projects are free. You only need a free account.
Do I need to install anything?
No. The code runs in your browser and never leaves your computer. The first time you run code, the engine takes a few seconds to download.
How does a lesson work?
A short explanation, coding exercises, and a 10-question quiz. Get at least 7 right to unlock the next lesson. Questions you miss go into a review queue and come back when it is time.
Can I study on my phone?
You can read lessons and do quizzes and reviews comfortably on a phone. A computer is easier for writing code.
Study this course
Read the first lesson without an account. Sign up free to solve the exercises and the quiz and to save your progress.