Normalization
Normalization
Normalization
14 John 7272826385, UP
9064738238
14 John 7272826385 UP
14 John 9064738238 UP
20 Harry 8574783832 Bihar
12 Sam 7390372389 Punjab
12 Sam 8589830302 Punjab
Second Normal Form
• To be in second normal form, a relation must be in
first normal form and relation must not contain
any partial dependency.
• A relation is in 2NF if it has No Partial
Dependency, i.e., no non-prime attribute
(attributes which are not part of any candidate
key) is dependent on any proper subset of any
candidate key of the table.
• Partial Dependency – If the proper subset of
candidate key determines non-prime attribute, it
is called partial dependency.
2 NF
• In the 2NF, relational must be in 1NF.
• In the second normal form, all non-key
attributes are fully functional dependent on
the primary key
• Example: Let's assume, a school can store the
data of teachers and the subjects they teach.
In a school, a teacher can teach more than
one subject.
Example: Let's assume, a school can store the
data of teachers and the subjects they teach. In
a school, a teacher can teach more than one
subject. TEACHER table
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.
• To convert the given table into 2NF, we
decompose it into two tables:
• TEACHER_DETAIL table:
TEACHER_ID TEACHER_AGE
25 30
47 35
83 38
25 Chemistry
25 Biology
47 English
83 Math
83 Computer
Third Normal Form (3NF)
201010 UP Noida
02228 US Boston
60007 US Chicago
06389 UK Norwich
462007 MP Bhopal
Advantages of Normal Form
• Reduced data redundancy: Normalization helps to eliminate duplicate data in
tables, reducing the amount of storage space needed and improving database
efficiency.
• Improved data consistency: Normalization ensures that data is stored in a
consistent and organized manner, reducing the risk of data inconsistencies and
errors.
• Simplified database design: Normalization provides guidelines for organizing
tables and data relationships, making it easier to design and maintain a database.
• Improved query performance: Normalized tables are typically easier to search and
retrieve data from, resulting in faster query performance.
• Easier database maintenance: Normalization reduces the complexity of a database
by breaking it down into smaller, more manageable tables, making it easier to add,
modify, and delete data.
• Overall, using normal forms in DBMS helps to improve data quality, increase
database efficiency, and simplify database design and maintenance.