Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Normalization of Databases: FO002L1 Ms. Elsa V. Isip

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

NORMALIZATION OF

DATABASES

FO002L1
Ms. ELSA V. ISIP
DEPENDENCIES
Dependency is established when the
value of one attribute is dependent on
the value of another attribute.

YX
DEPENDENCY
CUS_NUM CUS_LNAME CUS_FNAME CUS_INITIAL CUS_ZIPCODE
28914 Robinson Anne K 37215
30213 Orlando Carlos H 38219

CUS_NUM  CUS_LNAME, CUS_FNAME, CUS_INI, CUS_ZIP


DEPENDENCY
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM UNITS
1057 1 CD-AVM-MB41 F16 at Farnborough 30213 1
1057 2 BK-AVC-T455 Boeing 777 Journey 30213 1
1057 3 BK-SC-CO213 Carribbean Cruise Ships 30213 3
1058 1 BK-AVC-T455 Boeing 777 Journey 28914 1
1058 2 BK-SC-CO213 Carribbean Cruise Ships 28914 2
1059 1 CD-CT-DR905 Turbine Cars II 30213 1
1060 1 BK-SC-CO213 Carribbean Cruise Ships 19896 1
1060 2 BK-AVC-T455 Boeing 777 Journey 19896 1
1060 3 CD-AVM-MB41 F16 at Farnborough 19896 2
1060 4 BK-AVM-B2001 F18 On Station at Zebra 19896 1

Composite PK : INV_NUM, LINE_NUM


INV_NUM, LINE_NUM  PROD_CODE, PROD_TITLE, CUS_NUM, UNITS
Types of Dependencies
Partial Dependency
Transitive Dependency
PARTIAL DEPENDENCY
A dependency based on only part of
the PK.
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM UNITS
1057 1 CD-AVM-MB41 F16 at Farnborough 30213 1
1057 2 BK-AVC-T455 Boeing 777 Journey 30213 1
1057 3 BK-SC-CO213 Carribbean Cruise Ships 30213 3
1058 1 BK-AVC-T455 Boeing 777 Journey 28914 1
1058 2 BK-SC-CO213 Carribbean Cruise Ships 28914 2
1059 1 CD-CT-DR905 Turbine Cars II 30213 1
1060 1 BK-SC-CO213 Carribbean Cruise Ships 19896 1
1060 2 BK-AVC-T455 Boeing 777 Journey 19896 1
1060 3 CD-AVM-MB41 F16 at Farnborough 19896 2
1060 4 BK-AVM-B2001 F18 On Station at Zebra 19896 1

Composite PK : INV_NUM, LINE_NUM


INV_NUM  CUS_NUM PARTIAL DEPENDENCY
TRANSITIVE DEPENDENCY
A dependency based on an attribute
that is not part of the PK.
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM UNITS
1057 1 CD-AVM-MB41 F16 at Farnborough 30213 1
1057 2 BK-AVC-T455 Boeing 777 Journey 30213 1
1057 3 BK-SC-CO213 Carribbean Cruise Ships 30213 3
1058 1 BK-AVC-T455 Boeing 777 Journey 28914 1
1058 2 BK-SC-CO213 Carribbean Cruise Ships 28914 2
1059 1 CD-CT-DR905 Turbine Cars II 30213 1
1060 1 BK-SC-CO213 Carribbean Cruise Ships 19896 1
1060 2 BK-AVC-T455 Boeing 777 Journey 19896 1
1060 3 CD-AVM-MB41 F16 at Farnborough 19896 2
1060 4 BK-AVM-B2001 F18 On Station at Zebra 19896 1

Not part of the PK : PROD_CODE, PROD_TITLE, CUS_NUM, UNITS

PROD_CODE  PROD_TITLE TRANSITIVE DEPENDENCY


DATA REDUNDANCY
Partial and transitive dependencies
should generally be avoided because
their existence indicates the presence of
data redundancies
DATA REDUNDANCY
A data redundancy exists when two
conditions are met:
Multiple values of an attribute exist
within a table.
The multiple values are not required to
establish the relationship between
tables.
Values that are required cannot be redundant.
NORMAL FORMS
A table’s normal form is determined by
the type(s) of dependencies it may
exhibit.

1NF (1st Normal Form)


2NF (2nd Normal Form)
3NF (3rd Normal Form)
1NF (1ST Normal Form)
CONDITIONS :
The PK entity integrity requirements
are met.
Each row/column intersection can
contain one and only one value.
All of the table’s attributes are
dependent on the PK.

1NF does not preclude the existence of partial and transitive


dependencies.
2NF (2nd Normal Form)
All 1NF conditions are met.

The partial dependencies have been


removed.

2NF still contains transitive dependencies.


3NF (3rd Normal Form)
Meets all the 2NF conditions.
Contains no transitive dependencies.

Changing table structures to increase their normal form rating


from
1NF to 2NF to 3NF requires a process called NORMALIZATION
NORMALIZATION
Is a process for assigning attributes to
entities.

Reduces data redundancies and by


extension, helps eliminate the data
anomalies that result from those
redundancies.
DEPENDENCY DIAGRAM
Are structures that display all
dependencies and their sources.
DEPENDENCY DIAGRAMS
INV_NUM, LINE_NUM  PROD_CODE, PROD_TITLE, CUS_NUM, UNITS

INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM LINE_UNITS


Transitive Dependency

Partial Dependency
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM LINE_UNITS

Transitive Dependency

Partial Dependency

Question :
What attributes are involved in the dependencies?

All attributes are listed by name, and each appears in a


rectangle to match its header. PK components are in
boldface type and underlined.
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM LINE_UNITS

Transitive Dependency

Partial Dependency

Question :
What dependency types exist?

The desirable PK based dependencies are shown above


the attribute list. The undesirable partial and transitive
dependencies are shown below the attribute list.
INV_NUM LINE_NUM PROD_CODE PROD_TITLE CUS_NUM LINE_UNITS

Transitive Dependency

Partial Dependency
Question :
Which attributes are the determinants, and which attributes
are dependent?

The arrows emerge from the determinant, and the arrow


heads point to the dependent attributes.
DECOMPOSITION
1. Identify the PK in the initial dependency diagram.

INV_NUM
2. Write each PK attribute
on a separate line.
LINE_NUM
3. Write the original PK
on the final line.
INV_NUM LINE_NUM
2. Using the basic template developed in step 1, write
the dependent attribute(s) next to each PK you
identified. Then show the dependencies in each
structure.
Table is in 3NF; no partial
or transitive dependencies.

INV_NUM CUS_NUM

No dependencies; no table.

LINE_NUM

INV_NUM LINE_NUM PROD_CODE PROD_TITLE LINE_UNITS

Transitive Dependency
2. Break out all transitive dependencies to become new table
structure. Each t.d is based on a determinant, and this
determinant will become the PK in the new table structure. But
leave a copy of the determinant in the original table structure to
become the FK to the new table structure.

Table name: INVOICE


3NF; no partial or transitive dep.

INV_NUM CUS_NUM

Table name: PRODUCT


3NF; no partial or transitive dep.
PROD_CODE PROD_TITLE

INV_NUM LINE_NUM PROD_CODE LINE_UNITS


Table name: LINE
3NF; no partial or transitive dep.
A B C D E F G H I J

1. Using the figure, label all the transitive and partial


dependencies.
2. Using the dependency diagram, complete the
normalization process through step 3.
Take home Quiz (Short Bond Paper)
1. Draw the dependency diagram and indicate all
dependencies for the table structure below.
2. Normalize the STUDENT table structure to produce a set
of tables in 3NF.
STU_NUM STU_LNAME STU_FNAME COLL_NAME DEPT_NUM DEPT_NAME STU_CREDITS STU_CLASS STU_GPA
21458 Travis Anne Business 12 Info. Systems 84 Junior 2.5
21479 Dionne Randolph Business 15 Accounting 57 Sophomore 1.25
21480 Becker Paul Arts & Science 32 History 81 Junior 1.5
21493 Williamson Hortense Business 12 Info. Systems 48 Sophomore 2.25
21495 Chavez Maria Business 15 Accounting 54 Sophomore 2.75
21496 Smith John Arts & Science 35 English 120 Senior 3
21502 Brandeis Aaron Education 52 Secondary Ed. 108 Senior 2.5
21511 Smith Juliette Arts & Science 41 Mathematics 93 Junior 1.25
21512 Jamaya Jamal App. Science 22 Engineering 55 Sophomore 1.75
21533 Kruger Herman Arts & Science 23 Psychology 72 Junior 1.75
21534 Smith Robert Business 15 Accounting 112 Senior 1.5
21537 Jones Marsha Arts & Science 40 Physics 54 Sophomore 2
21538 Ramsey Thomas App. Science 22 Engineering 78 Junior 3
21546 O'Toole Elizabeth Business 19 Economics 69 Junior 2.53
21548 Roberts Melanie Arts & Science 32 History 51 Sophomore 2.25

You might also like