topic5 normalizationpart1 aug14

17
Database and Web Database Systems CT014-3-2 Normalization I

Upload: aiyas-aboobakar

Post on 19-Dec-2015

239 views

Category:

Documents


2 download

DESCRIPTION

APU CT014!3!2 DWDS

TRANSCRIPT

Page 1: Topic5 NormalizationPART1 Aug14

Database and Web Database SystemsCT014-3-2

Normalization I

Page 2: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Topic & Structure of the Lesson

• Purpose of normalization.

• Problems associated with redundant data.

• Identification of various types of update anomalies.

• Identifying functional dependencies.

• How functional dependencies can be used to group attributes into relations that are in a known normal form

Slide 2 (of 17)

Page 3: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Learning Outcomes

By the end of this lesson YOU should be able to:

•Explain the purpose of normalization.•Discuss problems associated with redundant data.•Identify the various types of update anomalies.•Identify functional dependencies.•Demonstrate how functional dependencies can be used to group attributes into relations that are in a known normal form.

Slide 3 (of 17)

Page 4: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Keywords

• If you have mastered this topic, you should be able to use the following terms correctly in your assignments and exams:

• Normalization – A technique for producing a set of relations with desirable properties, given the data requirements of an enterprise.

• Determinant – determines the value of other attributes in the tuples.

Slide 4 (of 17)

Page 5: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Normalization

• Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data, its relationships, and constraints.

• To achieve this objective, must identify a suitable set of relations.

Slide 5 (of 17)

Page 6: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Normalization

• Three most commonly used normal forms are first (1NF), second (2NF) and third (3NF) normal forms.

• Based on functional dependencies among the attributes of a relation.

• A relation can be normalized to a specific form to prevent possible occurrence of update anomalies.

Slide 6 (of 17)

Page 7: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Data Redundancy

• Major aim of relational database design is to group attributes into relations to minimize data redundancy and reduce file storage space required by base relations.

• Problems associated with data redundancy are illustrated by comparing the following Staff and Branch relations with the StaffBranch relation.

Slide 7 (of 17)

Page 8: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Data Redundancy - Example

Slide 8 (of 17)

Page 9: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Update Anomalies

• Relations that contain redundant information may potentially suffer from update anomalies.

• Types of update anomalies include:– Insertion,– Deletion,– Modification.

Slide 9 (of 17)

Page 10: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Quick Review Question

• Based on the StaffBranch relation,give one example for each of the following update anomalies:– Insertion – Update– Deletion

Slide 10 (of 17)

Page 11: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Functional Dependency

• Main concept associated with normalization.

• Functional Dependency– Describes relationship between attributes in a

relation. – If A and B are attributes of relation R, B is

functionally dependent on A (denoted A B), if each value of A in R is associated with exactly one value of B in R.

Slide 11 (of 17)

Page 12: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Functional Dependency

• Property of the meaning (or semantics) of the attributes in a relation.

• Diagrammatic representation:

Slide 12 (of 17)

• Determinant of a functional dependency refers to attribute or group of attributes on left-hand side of the arrow.

Page 13: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Quick Review Question

•State the functional dependencies in the

Brach and Staff relations.

Slide 13 (of 17)

Page 14: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Exercise

Slide 14 (of 17)

Consider the following relation (capitalized letters are attribute names, lowercase letters and numbers are values): 

 Circle the functional dependencies that seem to apply to Z.

 I i) E D ii) D E iii) C A

iv) E Bvv) E A vi) B C vii) B D

viii) B A

A B C D E

a1 b2 c2 d3 e2

a1 b2 c2 d1 e4

a2 b3 c2 d1 e5

a2 b4 c5 d1 e5

Page 15: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Summary

So far we discussed about the:• Problems associated with redundant data.• Identification of various types of update

anomalies.• Identifying functional dependencies.• How functional dependencies can be used to

group attributes into relations that are in a known normal form

Slide 15 (of 17)

Page 16: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Question and Answer Session

Slide 16 (of 17)

Q & A

Page 17: Topic5 NormalizationPART1 Aug14

CT014-3-2 Database and Web Database Systems Normalization I

Next Session

• Normalisation PART 2

Slide 17 (of 17)