Chapter 5 Database Management
Chapter 5 Database Management
DESIGN
Presented by
Prof. Pooja Mhatre
42 abc CO A4
43 pqr IT A3
44 xyz CO A4
45 xyz IT A3
46 mno EC B2
47 jkl ME B2
• From the above table we can conclude some valid
functional dependencies:
44 xyz 18
42 abc 17
43 pqr 18
44 xyz 18
42 abc CO 4
43 pqr EC 2
44 xyz IT 1
45 abc EC 2
Full Functional Dependency
• Explanation:
Candidate Key: {Student_ID, Course_ID}
Non-Prime Attribute: Course_Name
Partial Dependency: Course_Name → Student_ID
(since Course_Name depends on part of the
primary key, which is Student_ID)
Types of Normal Forms
• First Normal Form (1NF)
• Second Normal Form (2NF)
• Third Normal Form (3NF)
• Boyce-Codd Normal Form (BCNF)
First Normal Form (1NF)
• For a table to be in the first normal form, it must
meet the following criteria:
A single cell must not hold more than one value
(atomicity)
There must be a primary key for identification
No duplicated rows or columns
Each column must have only one value for each row
in the table
1NF EXAMPLE
• EMPLOYEE
EMP_ID EMP_NAME SALARY CONTACT
3 4568
Second Normal Form (2NF)
• The 1NF only eliminates repeating groups, not
redundancy. That’s why there is 2NF.
• Second Normal Form (2NF) is based on the concept of
fully functional dependency. It is a way to organize a
database table so that it reduces redundancy and ensures
data consistency.
• A table is said to be in 2NF if it meets the following
criteria:
It’s already in 1NF has no partial dependency. That is, all
non-key attributes are fully functionally dependent on a
primary key.
• Functional Dependency
• ( A 🡪 B) - Means B is fully functionally dependent on A.
2NF EXAMPLE
• EMPLOYEE
EMP_ID EMP_NAME SALARY CONTACT JOB_ID JOB LOCATION
• JOB_INFO - TABLE 2
JOB_ID JOB LOCATION
L_001 OFFICER MUMBAI
L_002 MANAGER PUNE
L_003 CLEARK MUMBAI
Third Normal Form (3NF)
• When a table is in 2NF, it eliminates repeating groups and
redundancy, but it does not eliminate transitive partial dependency.
• This means a non-prime attribute (an attribute that is not part of the
candidate’s key) is dependent on another non-prime attribute. This is
what the third normal form (3NF) eliminates.
• A relation is in 3NF if at least one of the following conditions holds in
every non-trivial function dependency X –> Y.
• X is a super key.
• Y is a prime attribute (each element of Y is part of some candidate
key).
• be in 2NF
• have no transitive partial dependency.
• Transitive Dependency
• ( A 🡪 B ) - Means B is fully functionally dependent on A.
• ( B 🡪 C ) - Means C is fully functionally dependent on B.
• INDIRECTLY (A 🡪 C) - Means C is Transitive Dependent on A.
3NF EXAMPLE
• EMPLOYEE
EMP_ID EMP_NAME SALARY CONTACT JOB LOCATION
• JOB_INFO - TABLE 2
EMP_ID JOB LOCATION
1 OFFICER MUMBAI
2 MANAGER PUNE
3 CLEARK MUMBAI
Boyce-Codd Normal Form
(BCNF)
• 3NF is an adequate normal form for relational databases,
still, this (3NF) normal form may not remove 100%
redundancy because of X−>Y functional dependency if
X is not a candidate key of the given relation. This can
be solved by Boyce-Codd Normal Form (BCNF).
• Boyce–Codd Normal Form (BCNF) is based
on functional dependencies that take into account all
candidate keys in a relation however, BCNF also has
additional constraints compared with the general
definition of 3NF.
• Rules for BCNF
Rule 1: The table should be in the 3rd Normal Form.
Rule 2: X should be a superkey for every functional
dependency (FD) X−>Y in a given relation.
BCNF EXAMPLE
• LOAN_SCHEMA
LOAN_NO LOAN_TYPE APPLICANT_NAME AMOUNT
L001 HOME MR. VAIBHAV PATIL 10,00,000
L002 CAR MR. AMIT TADVI 10,00,000
L003 EDUCATION MRS. AKANSHA PAL 10,00,000
L004 GOLD MS. SUMITRA SAWANT 10,00,000
• POSSIBLITY
LOAN_NO LOAN_TYPE APPLICANT_NAME AMOUNT
• APPLICANT_INFO ----TABLE 2
LOAN_NO APPLICANT_NAME
L001 MR. VAIBHAV PATIL
L001 MR. SUREKHA VAIBHAV PATIL
L002 MR. AMIT TADVI
L003 MRS. AKANSHA PAL
L004 MS. SUMITRA SAWANT
End of Chapter - 4