First normal form
- SQL course
- Intermediate
- Lesson 89/115
- 4 min
Learn first normal form (1NF).
1NF
1NF requires each cell to hold a single value. Comma-separated lists are forbidden.
-- YANLIŞ: 'Kalem, Defter, Silgi'
-- DOĞRU: her ürün ayrı satırda1NF wants single values.
1NF — details
1NF requires atomic values. A single cell cannot hold a list or set.
For example, instead of storing "555-1, 555-2" in a phones column, you create a customer_phones table with one row per phone.
Practice 1NF
Bring an orders table to 1NF: each product on its own row.
Starter code
-- normalize to 1NF
CREATE TABLESample solution
CREATE TABLE order_items (
order_id INT,
product VARCHAR(50),
qty INT
)Expected output
Tablo oluşturuldu
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 1NF value
1NF: each cell holds an ____ value
1NF: each cell holds an atomic value
Explanation: An atomic value cannot be split into smaller parts; 1NF requires it.
2 Which value does 1NF forbid?
- Text
- Numbers
- Dates
- Lists Correct answer
Explanation: 1NF forbids lists in a cell.
3 First normal form: match the terms
| Term | Meaning |
|---|---|
1NF |
atomic |
cell |
single value |
list |
forbidden |
single |
required |