Courses
SQL for Beginners: Ask Your Data Straight Questions
Check Yourself: Building and Changing Data
Five scenario questions on column types, constraint errors, identity gaps and safe changes. 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.
You need a column for product prices that must add up exactly, with two decimals. Which type is the right choice?
2.
An INSERT fails with duplicate key value violates unique constraint coupons_code_key. What happened?
3.
A table uses an identity column for its id. Three INSERTs fail on constraints, and the next good INSERT gets id 5 instead of 2. Is something broken?
4.
You run UPDATE products SET price = 0 with no WHERE, outside a transaction. What is the state of the data?
5.
DELETE FROM orders WHERE order_id = 4 fails with a foreign key error. What does it mean?
About
Five scenario questions on column types, constraint errors, identity gaps and safe changes. If you miss more than one, reread the lessons in this section.
- Duration
- 5 min
- Last update
- 09/29/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.