Courses
SQL for Beginners: Ask Your Data Straight Questions
Check Yourself: Combining Tables
Five scenario questions on keys, foreign keys, LEFT JOIN and fan-out. If you miss more than one, reread the lessons in this section.
Course content
Join this Course
Sign in to save your progress.
-
Before You Write a Query
-
What a Relational Database Is and Why SQL Exists
-
Set Up PostgreSQL and Run Your First Query
-
-
-
Asking for Rows
-
SELECT, WHERE, ORDER BY and LIMIT
-
NULL Is Not a Value
-
-
-
Building and Changing Data
-
CREATE TABLE: Types and Constraints That Matter
-
INSERT, UPDATE and DELETE Without Regret
-
-
-
Summaries
-
COUNT, SUM and AVG
-
GROUP BY and HAVING
-
-
-
Combining Tables
-
Primary Keys, Foreign Keys and Why Tables Are Split
-
INNER JOIN and LEFT JOIN
-
When a Join Gives Too Many Rows or Too Few
-
-
- Final Check: SQL for Beginners
1.
Why does the order_items table have a primary key made of two columns, order_id and product_id?
2.
INSERT INTO orders with customer_id 99 is refused. Which feature stopped it?
3.
You need the names of customers who have no orders. Which query shape gives them?
4.
You write customers LEFT JOIN orders and then WHERE o.status = 'paid'. Customers with no paid orders disappear. Why?
5.
There are 12 orders. After joining orders to order_items, count(*) returns 20. Is the data wrong?
About
Five scenario questions on keys, foreign keys, LEFT JOIN and fan-out. If you miss more than one, reread the lessons in this section.
- Duration
- 5 min
- Last update
- 09/24/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.