3.3. 2nd Normal Form

  • All data must depend on the Primary Key

  • All attributes (non-key columns) dependent on the key (PK)

3.3.1. Problem

Table 3.10. assignments

id (PK)

firstname

lastname

year

mission

1

Melissa

Lewis

2035

Ares3

2

Mark

Watney

2035

Ares3

3

Rick

Martinez

2035

Ares3

3.3.2. Solution

Table 3.11. astronauts

id (PK)

firstname

lastname

1

Melissa

Lewis

2

Mark

Watney

3

Rick

Martinez

Table 3.12. missions

id (PK)

year

mission

1

2031

Ares1

2

2033

Ares2

3

2035

Ares3

Table 3.13. assignments

id (PK)

astronaut_id (FK)

mission_id (FK)

1

1

3

1

2

3

1

3

3

../../_images/normalform-2nd-primarykey.png

Figure 3.11. All data must depend on the Primary Key. Image credit: 1

3.3.3. Recap

../../_images/normalform-2nd-summary.png

Figure 3.12. If all data depend on the Primary Key the database achieved 2nd Normal Form.

3.3.4. References

1

Lowgren, Jesper. Database Normalization 1NF 2NF 3NF. Year: 2021. Retrieved: 2022-02-05. URL: https://www.youtube.com/watch?v=SK4H5tTT6-M