

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Table Relationships
incomplete
2: One to Many
incomplete
3: Many to Many
incomplete
4: Database Normalization
incomplete
5: Normal Forms
incomplete
6: Primary Keys
incomplete
7: Functional Dependencies
incomplete
8: First Normal Form (1NF)
incomplete
9: Second Normal Form (2NF)
incomplete
10: Third Normal Form (3NF)
incomplete
11: Boyce-Codd Normal Form (BCNF)
incomplete
12: Normalization Review
incomplete
13: Query Practice – Users & Banks
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
To be compliant with first normal form (1NF for short), a database table simply needs to follow two rules:
It must have a unique primary key.
A cell can't have a nested table as its value (depending on the database system you're using, this may not even be possible).
| name | age | |
|---|---|---|
| Lane | 27 | [email protected] |
| Lane | 27 | [email protected] |
| Allan | 27 | [email protected] |
This table does not adhere to 1NF. It has two identical rows, so there isn't a unique primary key for each row.
The simplest way (but not the only way) to get into first normal form is to add a unique id column.
| id | name | age | |
|---|---|---|---|
| 1 | Lane | 27 | [email protected] |
| 2 | Lane | 27 | [email protected] |
| 3 | Allan | 27 | [email protected] |
It's worth noting that creating a composite primary key is also an option.
First normal form is simply a good idea.
I've never built a database schema where each table isn't at least in first normal form.
We hired an intern at CashPal and her first task was to design a new "companies" table. This table will store our business clients' data. Unfortunately, the intern has committed the unforgivable sin – there's no primary key on the table! We could have entire duplicate rows!
Add an id field as the first column. It should be an integer and have the PRIMARY KEY constraint. When you're done, the companies table will be in first normal form.