Second Normal Form (2NF)
Second Normal Form (2NF)
25 Chemistry 30
25 Biology 30
47 English 35
83 Math 38
83 Computer 38
• In the given table, non-prime attribute
TEACHER_AGE is dependent on TEACHER_ID
which is a proper subset of a candidate key.
That's why it violates the rule for 2NF.
TEACHER_ID TEACHER_AGE
25 30
47 35
83 38
TEACHER_SUBJECT table:
TEACHER_ID SUBJECT
25 Chemistry
25 Biology
47 English
83 Math
83 Computer
• Second Normal Form (2NF) is a step in the database
normalization process used to organize data and eliminate
redundancy in relational databases. A table is in 2NF if it
satisfies the following two conditions:
• It is already in First Normal Form (1NF):
– The table must not contain repeating groups or arrays.
– Data is stored in a tabular format with atomic values in each cell.
• It eliminates partial dependency:
– In 2NF, all non-key attributes must be fully functionally
dependent on the entire primary key, not just a part of it.
– This condition is especially important for tables that have
composite primary keys (where the primary key consists of more
than one column). No non-key attribute should depend on only
one part of a composite key.
Third Normal Form (3NF)
• A relation will be in 3NF if it is in 2NF and not contain any
transitive partial dependency.
• 3NF is used to reduce the data duplication. It is also used to
achieve the data integrity.
• If there is no transitive dependency for non-prime
attributes, then the relation must be in third normal form.
• A relation is in third normal form if it holds atleast one of
the following conditions for every non-trivial function
dependency X → Y.
• X is a super key.
• Y is a prime attribute, i.e., each element of Y is part of some
candidate key.
EMP_ID EMP_NAME EMP_ZIP EMP_STATE EMP_CITY
201010 UP Noida
02228 US Boston
60007 US Chicago
06389 UK Norwich
462007 MP Bhopal
SQL Commands
264 India
264 India
EMP_DEPT table:
EMP_DEPT DEPT_TYPE EMP_DEPT_NO
EMP_ID EMP_DEPT
D394 283
D394 300
D283 232
D283 549
Functional dependencies:
• EMP_ID → EMP_COUNTRY
• EMP_DEPT → {DEPT_TYPE, EMP_DEPT_NO}
• Candidate keys:
• For the first table: EMP_ID
For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}
• Now, this is in BCNF because left side part of both the
functional dependencies is a key.