98
Institute of Southern Punjab, Multan Mr. Muhammad Nouman Farooq BSC-H (Computer Science) MS (Telecomm. and Networks) Honors: Magna Cumm Laude Honors Degree Gold Medalist! Blog Url: noumanfarooqatisp.wordpress.com E-Mail: [email protected]

Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Institute of Southern Punjab, Multan

Mr. Muhammad Nouman Farooq

BSC-H (Computer Science)

MS (Telecomm. and Networks)

Honors:

Magna Cumm Laude Honors Degree

Gold Medalist!

Blog Url: noumanfarooqatisp.wordpress.com

E-Mail: [email protected]

Page 2: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Advance Database Systems

Lecture# 6

Advanced Normalization

Page 3: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Lecture 6: Advanced Normalization

Normalization (Brief Overview)

Functional Dependencies and Keys

1st Normal Form

2nd Normal Form

3rd Normal Form

3.5 Normal Form (Boyce Codd Normal Form-BCNF)

4th Normal Form

5th Normal Form (Project-Join Normal Form-PJNF)

Domain Key Normal Form (DKNF)

6th Normal Form

Class Activity

3

Page 4: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

4

Normalization (Brief Overview)

Page 5: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Normalization (Brief Overview)

The main goal of Database Normalization is to restructure the

logical data model of a database to:

1. Eliminate Redundancy.

2. Organize Data Efficiently.

3. Reduce the possibility of Data Anomalies/Irregularities.

5

Page 6: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued…

Data anomalies are inconsistencies in the data stored in a database as a result of an operation such as update, insertion, and deletion.

Such inconsistencies may arise when have a particular record stored in multiple locations and not all of the copies are updated.

We can prevent such anomalies by implementing 7 different level of normalization called Normal Forms (NF)

We’ll only look at the first Three.

6

Page 7: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued…

Database Normalization was first proposed by Edgar F. Codd.

Codd defined the first three Normal Forms, which we’ll look into,of the 7 known Normal Forms.

In order to do normalization we must know what the requirementsare for each of the three Normal Forms that we’ll go over.

One of the key requirements to remember is that Normal Formsare progressive. That is, in order to achieve 3rd NF we must have2nd NF and in order to have 2nd NF we must have 1st NF.

7

Page 8: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Levels of Normalization

8

Levels of normalization based on the amount of redundancy

in the database.

Various levels of normalization are:

First Normal Form (1NF)

Second Normal Form (2NF)

Third Normal Form (3NF)

Boyce-Codd Normal Form (BCNF) or 3.5 NF

Fourth Normal Form (4NF)

Fifth Normal Form (Project-Join Normal Form-PJNF)

Domain Key Normal Form (DKNF)

Sixth Normal Form (6NF)

Redundancy

Decre

ase

s

Num

ber o

f Table

s Incre

ase

s

Page 9: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 10: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Data Anomalies

1. Insertion Anomaly:

Cannot make a record of Jone’s address because he is not taking any classes.

10

Page 11: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued…

2. Update Anomaly:

Clearly, Name and Address are redundant (larger relation and we have to update 3 rows to update the Address)

11

Page 12: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued…

3. Delete Anomaly:

Cannot delete Jones’ enrolment without loosing his address as well

12

Page 13: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Functional Dependencies and Keys

13

Page 14: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Functional Dependencies and Keys

14

. Example is shown on next slide

Page 15: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

15

Page 16: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

16

Page 17: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Prime and Non-Prime Attributes

17

In Normalization Terminology, Any attribute that is completely or at least

part is a member of a Primary Key is known as a Prime Attribute instead of

the more common term Key Attribute.

So, a Non-Prime attribute or Non-Key attribute, is not part of any

Candidate Key.

Page 18: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Closure Set of Attributes

18

Trivial means D and E contains only its own value

Page 19: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Finding Candidate Keys using Closure Set of Attributes

19

So:

There are 15 possible Keys;

We have to find Candidate

key from these possible keys

Page 20: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued..

20

There are 15 possible Keys;

We have to find Candidate

key from these possible keys

Page 21: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued..

21

Page 22: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Finding Candidate Keys using Closure Set of Attributes

22

Page 23: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

23

Continued..

Page 24: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

1st Normal Form

24

Page 25: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

1st Normal Form

The requirements to satisfy the 1st NF are:

1) Each table has a Primary Key: minimal set of attributes which

can uniquely identify a record

2) The values in each column of a table are Atomic (No multi-

value attributes allowed eg. stdCellNo; stdEmailAddress)

3) There are no repeating groups: two columns do not store

similar information in the same table.

25

Page 26: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 27: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 28: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

2nd Normal Form

28

Page 29: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

2nd Normal Form

The requirements to satisfy the 2nd NF:

All requirements for 1st NF must be met

Any partial functional dependencies have been removed (i.e., non-keys are identified by the Whole Primary Key).

bookISBN --> bookTitle, bookFirstAuthorName, bookPublisher.

In the given above example; The title of a book, the name of the firstauthor, and the publisher are functionally dependent on the book'sInternational Standard Book Number (ISBN). In other words all listedattributes are identified uniquely by the whole Primary Key which is“bookISBN” and this relation/file/table/ENTITY is in 2nd Normal Form.

29

Page 30: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

30

Page 31: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

31

Page 32: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 33: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

33

Page 34: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

34

Page 35: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

3rd Normal Form

35

Page 36: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 37: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 38: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 39: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Continued…

We have seen how Database Normalization can decrease redundancy,

increase efficiency and reduce anomalies by implementing three of

seven different levels of normalization called Normal Forms.

The first Three Normal Forms (3-NF) are usually sufficient for small to

medium size applications.

39

Page 40: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

3.5 Normal Form (Boyce Codd Normal

Form-BCNF)

40

Page 41: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 42: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

42

Page 43: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 44: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

44

Page 45: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

45

Page 46: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

46

Page 47: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 48: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 49: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 50: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

4th Normal Form

50

Page 51: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Conditions that Satisfies a Relation R is in 4-NF

A relation R is in 4-NF if and only if the following Conditions satisfied:

1) R must be in 3.5 NF (BCNF).

2) It must not contain Multi Valued Dependencies (MVD’s).

Note: Multi Valued Attributes and Multi Valued Dependencies are different concepts.

Page 52: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Multi-Valued Dependency (MVD)

It is the dependency where one attribute value

is potentially a ‘Multi Valued fact’ about

another:

Important Points:

1) There must be three or more attributes exists

in a Relation (In example three Attributes

exists which are: Person, Mobile and

Food_Like)

2) Attributes or Subset of Attributes must be

independent of each other (In example Mobile

and Food_Like attributes are Independent of

each other).

Page 53: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Overview of Definitions of 4-NF and Multivalued Dependencies (MVD)

Page 54: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Example:

Page 55: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Anomalies in a Relation that is not in 4NF

Page 56: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 57: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Class Activity:

a) If not in 4NF than Decompose the given Relation into 4NF and Design an ERD

in Information Engineering Standard.

b) Write a complete Code of an ERD of part a) in MySQL using XAMPP as

Simulator and Show Relational Schema Diagram having Database Name: 4NF

Page 58: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

5th Normal Form (Project-Join Normal

Form-PJNF)

58

Page 59: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 60: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Why we Required Decomposition of a Relation

Redundancy can be reduced

Data Independence can be maintained

Anomalies can be reduced

Page 61: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 62: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

In Natural Join Operation; After Joining tables; Repeated Records inrows are Eliminated

In Additive Lossy Join; spurious RECORD/TUPPLE/INSTANCE createdafter Natural Joining on two or more than two tables (It can be called asInformation/record retrieve that was missing in original table)

In Non-Additive Lossless Join; We are not losing any Information andnot creating any SPURIOUS/FALSE RECORDS/INSTANCES/DATA/TUPPLES ina Relation/Table/File but repetition in Records must be removed

Page 63: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Additive Lossy Join means EXTRA

RECORD/TUPPLE/INSTANCE created

after Natural Joining on two or more

than two tables

In Natural Join; After Joining

multiple tables; Repeated values

Eliminated as shown in figures

Page 64: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Projection of R1 Natural Join Projection of R2 Natural Join Projection of R3 ….. Natural Join Projection of Rn = R

R = R1 (R) ⋈ R2 (R) ⋈ …… ⋈ Rn(R)

Page 65: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 66: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Conditions that Satisfies a Relation R is in 5-NF A relation R is in 5-NF if and only if:

1) R must be in 4-NF.

2) If Join Dependency (JD) not exists.

a) If Non-Additive Lossless Join exists under one condition that is;decomposition of main table/relation into smaller relations that musteliminate redundant records with out losing original information and without creating false/spurious records.

b) If Additive Lossy Join exists than it will also be in 5-NF under onecondition that is; gaining meaningful information that was missing inoriginal relation (not called as spurious record in certain situation)

Page 67: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

67

Lossy and Lossless Join Examples under Two Conditions

Condition 1: When Data is given in a Relation

Condition 2: When Data is Not given in a Relation

Page 68: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

The following given Relation is Lossy Join or Lossless Join?Condition 1: When Data is Given in a Relation

Page 69: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 70: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 71: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 72: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

R1 is a Super Set of R2:Condition 1: Example 2

Page 73: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

R1 ⋈ R2 ⋈ R3

Continued..

Page 74: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

R1 ⋈ R2 ⋈ R3

Continued..

R1 (R) ⋈ R2 (R) ⋈ R3 (R)

Page 75: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Condition 1: Example 3

Page 76: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Condition 2: When Data is not given in a Relation

Page 77: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Solution: -

Step 1: Write data in Tabular Form: -

Page 78: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Step 2:

1. Apply Functional Dependencies as provided in question:

2. We will select column of these determinants containing minimum of

two stars.

Page 79: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Step 2 (Continued..)

Now, We will apply functional dependency where b c and c d

Page 80: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Step 3:

Check number of Stars in each Rows. If a Row contains stars in all

Columns than Lossless Join otherwise Lossy Join.

Page 81: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

81

Page 82: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Domain Key Normal Form (DKNF)

82

Page 83: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 84: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 85: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 86: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

6th Normal Form

86

Page 87: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 88: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 89: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 90: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy
Page 91: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Class Activity

91

Page 92: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Class Activity 1: Answer the following Questions

92

Page 93: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Class Activity 2: Answer the following Questions

93

a) Indicate the Level of Normal Form for the given below Relation.

b) If the Relation is not in 4-NF, Than decompose it into 4-NF Relations.

c) Design an ERD of 4-NF Relations in Information Engineering Standard.

Page 94: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Recommended Readings

Chapter 5 from:

Modern Database Management-8th Edition by Jeffrey

A. Hoffer, Mary B. Presscott & Fred R. McFadden

(Page No. 211-219)

Advanced Normal Forms from:

Modern Database Management-8th Edition by Jeffrey

A. Hoffer, Mary B. Presscott & Fred R. McFadden

(Page No. 605-610)

Page 95: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Recommended Readings

Chapter 14 from:

Database Systems-A Practical Approach to Design,

Implementation and Management by Thomas Connolly

and Carolyn Begg, 4th Edition (Page No. 481-485)

Chapter 4 from:

Database Systems-A Pragmatic Approach by Elvis C.

Foster, Shirpad V. Godbole (Page 72-79)

Page 96: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Recommended Readings

Chapter 6 from:

Database Systems - Design, Implementation and

Management by Carlos Coronel, Steven Morris and Peter

Rob, 9th Edition(Page No. 204-246)

Page 97: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

Summary of Lecture

97

Lecture 6➦

Normalization (Brief Overview)

Functional Dependencies and Keys

1st Normal Form

2nd Normal Form

3rd Normal Form

3.5 Normal Form (Boyce Codd Normal Form-BCNF)

4th Normal Form

5th Normal Form (Project-Join Normal Form-PJNF)

Domain Key Normal Form (DKNF)

6th Normal Form

Class Activity

Page 98: Institute of Southern Punjab, MultanNormalization (Brief Overview) The main goal of Database Normalization is to restructure the logical data model of a database to: 1. Eliminate Redundancy

END OF LECTURE 6

98