0% found this document useful (0 votes)
37 views9 pages

Normalization: Functional Dependency

- Normalization is a technique to reduce redundancy in database tables by organizing data into tables and relationships between those tables. - Functional dependencies define relationships between attributes - if one attribute determines another, the second attribute is functionally dependent on the first. - Anomalies like insertion, deletion, and update anomalies can occur in non-normalized tables and be resolved through normalization forms. - First normal form eliminates repeating groups by creating a separate table for each set of repeating data. Second normal form removes partial dependencies, and third normal form removes transitive dependencies.

Uploaded by

Manel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views9 pages

Normalization: Functional Dependency

- Normalization is a technique to reduce redundancy in database tables by organizing data into tables and relationships between those tables. - Functional dependencies define relationships between attributes - if one attribute determines another, the second attribute is functionally dependent on the first. - Anomalies like insertion, deletion, and update anomalies can occur in non-normalized tables and be resolved through normalization forms. - First normal form eliminates repeating groups by creating a separate table for each set of repeating data. Second normal form removes partial dependencies, and third normal form removes transitive dependencies.

Uploaded by

Manel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 9

NORMALIZATION

A TECHNIQUE THAT ALLOWS A DESIGNER TO


DETECT REDUNDANCIES IN A GIVEN TABLE

FUNCTIONAL DEPENDENCY

Let X and Y be two attributes of a relation. Given the value


of X, if there is a value of Y corresponding to it, then Y is
said to be functionally dependent on X.
X Y

Item code  item name


Functional dependency may also be based on a composite
attribute.
X, Z  Y
Example

Student (Roll no., Name, Address, Dept., Year of study)


ANOMALIES IN A DATABASE:

•Insertion Anomalies:

•Deletion Anomalies:

•Update Anomalies:
Dno Dname Eno First Mi Last Job Proj PrNo Mgr
F01 Acct 020 Davis A Blake 52 Payroll P1 087
F01 Acct 020 Davis A Blake 52 Persis P2 088
F01 Acct 020 Davis A Blake 55 Bill B1 087
F02 Sales 358 Mallet F Mike 99 Bill B1 358
B11 Admn 200 Smith G Betty 40 Anl A1 177
B11 Admn 200 Smith G Betty 40 Persis P2 187

1. If Davis quits the company Project Name P1 is lost


2. If an employee’s name changes. Multiple rows may have to be updated with
the new name
3. New employees cannot be inserted until involved in a project

4. Deleting Mike Mallet means losing department F02 information

5. A new department cannot be added unless we have at least one employee and proje
6. Changing the Mgr for Department B11 requires the updating of several rows
FIRST NORMAL FORM

• Eliminate the repeating fields


Create a row for each occurrence of a repeating field
Allows exploitation of column functions

projno exp month


projno exp1 exp2 exp3 A1 100 Apr
A1 70 May
A1 100 70 50 A1 50 June
B2 50 Apr
B2 50 80 60
B2 80 May
B2 60 June
Dno Dname Eno First Mi Last Job Proj PrNo Mgr
F01 Acct 020 Davis A Blake 52 Payroll P1 087
Acct 020 Davis A Blake 52 Persis P2 088
Acct 020 Davis A Blake 55 Bill B1 087
F02 Sales 358 Mallet F Mike 99 Bill B1 358
B11 Admn 200 Smith G Betty 40 Anl A1 177
B11 Admn 200 Smith G Betty 40 Persis P2 187

Dno Dname Eno First Mi Last Job Proj PrNo Mgr

F01 Acct 020 Davis A Blake 52 Payroll P1 087


F01 Acct 020 Davis A Blake 52 Persis P2 088
F01 Acct 020 Davis A Blake 55 Bill B1 087
F02 Sales 358 Mallet F Mike 99 Bill B1 358
B11 Admn 200 Smith G Betty 40 Anl A1 177
B11 Admn 200 Smith G Betty 40 Persis P2 187
SECOND NORMAL FORM
First Normal Form + All the attributes must fully depend on the Primary key

A relation is said to be in 2NF if it is in 1NF and non-key


attributes are functionally dependent on the key attribute(s).
Dependencies Diagram For Second Normal Form:
Dname
PK Dno
Mgr
First
Empno
Mi

Last
Projno
Job
Project
THIRD NORMAL FORM

Second normal form + Eliminate indirect dependencies

A relation is said to be in the 3NF if it in 2NF and non-


key attributes are not dependent on each o other.
Emp Project Employee
Empno Prno Dept Empno Last Mi First Job
020 P1 F01 020 Davis A Charles 52
020 A1 F01 087 East G Moris 55
087 A1 F02 177 Parker V Kamilla 45
090 B1 F02 090 Wilson F Mary 52
177 P1 B11 333 Stone S Alyssa 81
333 B1
Project
Department
Dept Dname Mgr Prno Name

F01 Accounts 087 A1 Accounts


F02 Admins.. 177 B1 Bill
B11 Sales 358 P1 Payslip

You might also like