0
0
DBMS Theoryknowledge~10 mins

Second Normal Form (2NF) in DBMS Theory - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Second Normal Form (2NF)
Start with 1NF table
Check for composite primary key?
NoAlready in 2NF
Yes
Check for partial dependencies
Yes
Remove partial [Table is in 2NF
Create new tables
Result: Tables in 2NF
Start with a table in 1NF, check if it has a composite key. If yes, find and remove partial dependencies by splitting tables, resulting in 2NF.
Execution Sample
DBMS Theory
Table: Orders
PK: (OrderID, ProductID)
Attributes: OrderDate, ProductName, Quantity

Check partial dependencies
This table has a composite key and attributes; we check if any attribute depends only on part of the key.
Analysis Table
StepActionCheckResultNext Step
1Start with Orders tableIs table in 1NF?YesCheck composite key
2Check primary keyIs key composite?Yes (OrderID, ProductID)Check partial dependencies
3Check OrderDate dependencyDepends on full key?Depends only on OrderID (partial)Partial dependency found
4Check ProductName dependencyDepends on full key?Depends only on ProductID (partial)Partial dependency found
5Remove partial dependenciesSplit table into Orders and ProductsOrders(OrderID, OrderDate), Products(ProductID, ProductName)Tables now in 2NF
6Final checkAre there partial dependencies?NoStop
💡 No partial dependencies remain; tables are in Second Normal Form.
State Tracker
VariableStartAfter Step 3After Step 4After Step 5Final
TableOrders(OrderID, ProductID, OrderDate, ProductName, Quantity)Partial dependency on OrderID foundPartial dependency on ProductID foundSplit into Orders and Products tablesOrders and Products tables in 2NF
Key Insights - 3 Insights
Why do we check if the primary key is composite?
Because Second Normal Form only applies when the primary key has more than one column, as partial dependencies can only exist then (see execution_table step 2).
What is a partial dependency?
A partial dependency is when a non-key attribute depends on only part of a composite primary key, not the whole key (see execution_table steps 3 and 4).
Why do we split the table to remove partial dependencies?
Splitting removes attributes that depend on part of the key into separate tables, ensuring all attributes depend on the full key, achieving 2NF (see execution_table step 5).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step do we find the first partial dependency?
AStep 3
BStep 4
CStep 2
DStep 5
💡 Hint
Check the 'Result' column for 'Partial dependency found' in the execution_table.
According to the variable tracker, what is the state of the table after step 5?
AStill one table with partial dependencies
BTable removed all attributes
CSplit into Orders and Products tables
DTable has no primary key
💡 Hint
Look at the 'After Step 5' column in variable_tracker.
If the primary key was not composite, what would the execution table say at step 2?
AIs key composite? Yes
BIs key composite? No
CPartial dependencies found
DSplit tables
💡 Hint
Refer to execution_table step 2 about checking if the key is composite.
Concept Snapshot
Second Normal Form (2NF):
- Applies to tables with composite primary keys.
- Removes partial dependencies (attributes depending on part of the key).
- Achieved by splitting tables to ensure all attributes depend on the full key.
- Ensures better data organization and reduces redundancy.
Full Transcript
Second Normal Form (2NF) is a database design rule that builds on First Normal Form (1NF). It applies only when a table has a composite primary key, meaning the key is made of more than one column. The main goal is to remove partial dependencies, which happen when some columns depend on only part of the key, not the whole key. To fix this, we split the table into smaller tables so that each non-key attribute depends on the entire primary key. This process reduces data duplication and improves organization. The execution steps start by checking if the table is in 1NF, then if the key is composite. If yes, we look for partial dependencies and remove them by creating new tables. When no partial dependencies remain, the tables are in 2NF.