Chapter 4
Chapter 4
• Normalization
• Functional Dependency (FD)
• Steps of Normalization
➢ First Normal Form (1NF)
• These steps reduce data redundancy and the risk of data becoming
inconsistent.
1. Insertion Anomalies
2. Deletion Anomalies
3. Modification Anomalies
• The update anomalies are; The type of problems that could occur in insufficiently
normalized table is called update anomalies which includes;
Insertion anomalies
Data Dependency
• The logical associations between data items that point the database
designer in the direction of a good database design are referred to as
determinant or dependent relationships.
• If the data item A is the determinant data item and B the dependent
data item then the direction of the association is from A to B and not
vice versa.
• In relational databases, we can have a determinant that governs one or several other
attributes.
• Since the type of Wine served depends on the
type of Dinner, we say Wine is functionally
dependent on Dinner.
Dinner →Wine
• Since both Wine type and Fork type are determined by the Dinner type, we say Wine is
functionally dependent on Dinner and Fork is functionally dependent on Dinner.
✓ Dinner→Wine
✓ Dinner→Fork
• Let {A,B} be the Primary Key and C is a non- key attribute Then if
{A,B}→C and B→C and A→C does not hold Then C Fully functionally
dependent on {A,B}
7/21/2023 Fundamental Of Database System 16
Cont. …
Transitive Dependency
Example:
• A normal form below represents a stronger condition than the previous one
Normalization towards a logical design consists of the following steps:
If:
• This will result in a set of relations with a level of Second Normal Form.
• Any table that is in 1NF and has a single-attribute (i.e., a non-composite) key is
automatically also in 2NF.
• Definition: a table (relation) is in 2NF
If:
• It is in 1NF and
• If all non-key attributes are dependent on the entire primary key. i.e. no partial
dependency.
• This schema is in its 1NF since we don’t have any repeating groups or
attributes with multi-valued property. To convert it to a 2NF we need to
remove all partial dependencies of non key attributes on part of the primary
key.
• FD1: {EmpID}→EmpName
If:
• It is in 2NF and
• There are no transitive dependencies between a primary key and Non-primary key
attributes.
• This schema is in its 2NF since the primary key is a single attribute
and there are no repeating groups (multi valued attributes).
• Let’s take StudID, Year and Dormitary and see the dependencies.
2. The Fields Depend Upon the Key: the table should solely depend on
the key.