44
Bordoloi Bordoloi Database Design: Database Design: Normalization Normalization Dr. Bijoy Bordoloi Dr. Bijoy Bordoloi

Database Design: Normalization Dr. Bijoy Bordoloi

  • Upload
    irina

  • View
    45

  • Download
    1

Embed Size (px)

DESCRIPTION

Database Design: Normalization Dr. Bijoy Bordoloi. Data Normalization. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of data - PowerPoint PPT Presentation

Citation preview

Page 1: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Database Design: NormalizationDatabase Design: NormalizationDr. Bijoy BordoloiDr. Bijoy Bordoloi

Page 2: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Data NormalizationData Normalization

• Primarily a tool to validate and improve a Primarily a tool to validate and improve a logical design so that it satisfies certain logical design so that it satisfies certain constraints that constraints that avoid unnecessary avoid unnecessary duplication of dataduplication of data

• The process of decomposing relations with The process of decomposing relations with anomalies to produce smaller, anomalies to produce smaller, well-well-structuredstructured relations relations

Page 3: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Results of NormalizationResults of Normalization

• Removes the following modification Removes the following modification anomalies anomalies (integrity errors) with the (integrity errors) with the databasedatabase

– InsertionInsertion–DeletionDeletion–UpdateUpdate

Page 4: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIESANOMALIES

• InsertionInsertion– inserting one fact in the database requires inserting one fact in the database requires

knowledge of other facts unrelated to the fact knowledge of other facts unrelated to the fact being insertedbeing inserted

• DeletionDeletion– Deleting one fact from the database causes loss of Deleting one fact from the database causes loss of

other unrelated data from the databaseother unrelated data from the database• UpdateUpdate

– Updating the values of one fact requires multiple Updating the values of one fact requires multiple changes to the databasechanges to the database

Page 5: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIES EXAMPLESANOMALIES EXAMPLES

TABLE: COURSETABLE: COURSE

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Page 6: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIES EXAMPLESANOMALIES EXAMPLES

IInsertion:nsertion:Suppose our university has approved a new Suppose our university has approved a new

course called CIS563: SQL & PL/SQL.course called CIS563: SQL & PL/SQL.

Can this information about the new course be entered Can this information about the new course be entered (inserted) into the table COURSE in its present form?(inserted) into the table COURSE in its present form?

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Page 7: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIES EXAMPLESANOMALIES EXAMPLES

Deletion:Deletion:Suppose not enough students enrolled for the Suppose not enough students enrolled for the

course CIS570 which had only one section 072. So, course CIS570 which had only one section 072. So, the school decided to drop this section and delete the the school decided to drop this section and delete the section# 072 for CIS570 from the table COURSE. section# 072 for CIS570 from the table COURSE. But then, what other relevant info also got deleted in But then, what other relevant info also got deleted in the process?the process?

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Page 8: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIES EXAMPLESANOMALIES EXAMPLES

Update:Update:Suppose the course name (C_Name) for CIS Suppose the course name (C_Name) for CIS

564 got changed to Database Management. How 564 got changed to Database Management. How many times do you have to make this change in the many times do you have to make this change in the COURSE table in its current form? COURSE table in its current form?

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Page 9: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

ANOMALIESANOMALIES

• So, a table (relation) is a stable (‘good’) So, a table (relation) is a stable (‘good’) table only if it is free from any of these table only if it is free from any of these anomalies at any point in time.anomalies at any point in time.

• You have to ensure that each and every You have to ensure that each and every table in a database is always free from these table in a database is always free from these modification anomalies. And, how do you modification anomalies. And, how do you ensure that?ensure that?

• ‘‘Normalization’ theory helps.Normalization’ theory helps.

Page 10: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

NORMAL FORMSNORMAL FORMS

1 NF1 NF2NF 2NF 3NF 3NF

• BCNF (Boyce-Codd Normal Form)BCNF (Boyce-Codd Normal Form)

• 4NF4NF

• 5NF5NF

• DK (Domain-Key) NF DK (Domain-Key) NF

Page 11: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

*

First Normal Form(1NF)First Normal Form(1NF)Second Normal Form(2NF)Second Normal Form(2NF)

Third Normal Form(3NF)Third Normal Form(3NF)

Fourth Normal Form(4NF)Fourth Normal Form(4NF)Fifth Normal Form(5NF)Fifth Normal Form(5NF)

Boyce-Codd Normal Form(BCNF)Boyce-Codd Normal Form(BCNF)

Domain/Key Normal Form (DK/NF)Domain/Key Normal Form (DK/NF)

Relationships of Normal FormsRelationships of Normal Forms

Page 12: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Functional DependencyFunctional Dependency

• Relationship between columns X and Y Relationship between columns X and Y such that, given the value of X, one can such that, given the value of X, one can determinedetermine the value of Y. Written as X Y the value of Y. Written as X Y

i.e., for a given value of X we can obtain (or i.e., for a given value of X we can obtain (or look up) a specific value of Xlook up) a specific value of X

• X is called the X is called the determinantdeterminant of Y of Y• Y is said to be Y is said to be functionally dependentfunctionally dependent on Y on Y

Page 13: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Functional DependencyFunctional Dependency• ExampleExample

– SOC_SEC_NBR EMP_NMESOC_SEC_NBR EMP_NME

SOC_SEC_NBRSOC_SEC_NBR EMP_NMEEMP_NME

-One and only one EMP_NME for a specific SOC_SEC_NBROne and only one EMP_NME for a specific SOC_SEC_NBR- SOC_SEC_NBR is theSOC_SEC_NBR is the determinantdeterminant of EMP_NME of EMP_NME - EMP_NME is functionally EMP_NME is functionally dependentdependent on SOC_SEC_NBR on SOC_SEC_NBR

Page 14: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

1NF

A table is in 1NF if there are no repeating groups in the table. In other words, a table is in 1NF if all non-key fields are functionally dependent on the primary key (PK). That is, for each given value of PK, we always get only one value of the non-key field(s). Is the following table COURSE in 1NF?

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Course

Page 15: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

1NF

But, didn’t we just conclude that COURSE is a ‘bad’ table (the way it is structured) as it suffers from all the three anomalies we talked about?

So, what’s the problem?

COURSE#COURSE# SECTION#SECTION# C_NAMEC_NAME

CIS564CIS564 072072 Database DesignDatabase Design

CIS564CIS564 073073 Database DesignDatabase Design

CIS570CIS570 072072 Oracle FormsOracle Forms

CIS564CIS564 074074 Database DesignDatabase Design

Page 16: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Partial DependencyPartial Dependency

• Occurs when a column in a table only Occurs when a column in a table only depends on part of a concatenated keydepends on part of a concatenated key

COURSE COURSE ((COURSE# + SECTION#COURSE# + SECTION#, C-NAME, C-NAME

ExampleExample

Page 17: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

2NF2NF

• C_Name only depends upon the C_Name only depends upon the Course# not the Section#. It is partially Course# not the Section#. It is partially dependent upon the primary key.dependent upon the primary key.

• A table is in 2NF if it is in 1NF and A table is in 2NF if it is in 1NF and has no partial dependencies.has no partial dependencies.

Page 18: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

2NF2NF• How do you resolve partial dependency?How do you resolve partial dependency?

• Decompose the problematic table into Decompose the problematic table into smaller tables. smaller tables. • Must be a ‘loss-less’ decomposition. Must be a ‘loss-less’ decomposition. That is, you must be able to put the That is, you must be able to put the decomposed tables back together again to decomposed tables back together again to arrive at the original information. arrive at the original information. • Remember Remember Foreign KeysForeign Keys!!

Page 19: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

2NF2NF

COURSE#COURSE# C_NAMEC_NAME

CIS564CIS564 Database DesignDatabase Design

CIS570CIS570 Oracle FormsOracle Forms

COURSE#COURSE# SECTION#SECTION#

CIS564CIS564 072072

CIS564CIS564 073073

CIS564CIS564 074074

CIS570CIS570 072072

COURSECOURSE

OFFERED_COURSEOFFERED_COURSE

Page 20: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

2NF2NF

• Are the two (decomposed) tables COURSE and Are the two (decomposed) tables COURSE and OFFEERED_COURSE are 2NF?OFFEERED_COURSE are 2NF?

• Do these two tables have any modification Do these two tables have any modification anomalies?anomalies?– Can you now readily enter the info that a new approved Can you now readily enter the info that a new approved

course CIS563? course CIS563? – Can you now delete the section# 072 for CIS570 Can you now delete the section# 072 for CIS570

without losing the info tat CIS570 exists?without losing the info tat CIS570 exists?– How many times do you have to change the name of a How many times do you have to change the name of a

given course? given course?

Page 21: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Transitive DependencyTransitive DependencyTable: Student-Dorm-FeeTable: Student-Dorm-Fee

SIDSID DORMDORM FEEFEE

101101 OracleOracle 10001000

102102 OracleOracle 10001000

103103 DB2DB2 800800

104104 DB2DB2 800800

105105 SybaseSybase 500500

Page 22: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Transitive DependencyTransitive Dependency

• Is the table Student-Dorm-Fee in 2NF?Is the table Student-Dorm-Fee in 2NF?• Does this table have any modification anomalies?Does this table have any modification anomalies?

– Insertion? Insertion?

– Deletion?Deletion?

– Update? Update?

Page 23: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Transitive DependencyTransitive Dependency

•Occurs when a non-key attribute is functionally dependent on Occurs when a non-key attribute is functionally dependent on one or more non-key attributes.one or more non-key attributes.

Example: Example: HOUSING (HOUSING (SIDSID, DORM, FEE), DORM, FEE)PRIMARY KEY: SIDPRIMARY KEY: SIDFUNCTIONAL DEPENDENCIES:FUNCTIONAL DEPENDENCIES:

SIDSID BUILDINGBUILDINGSIDSID FEEFEEDORMDORM FEEFEE

• A table is in 3NF if it is in 2NF and has no transitive A table is in 3NF if it is in 2NF and has no transitive dependenciesdependencies

Page 24: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

3NF3NF

• Besides SID, FEE is also Besides SID, FEE is also functionally dependent on DORM functionally dependent on DORM which is a non-key attribute. which is a non-key attribute.

• A table is in 3NF if it is in 2NF and A table is in 3NF if it is in 2NF and has no transitive Dependencies.has no transitive Dependencies.

Page 25: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

3NF3NF• How do you resolve transitive dependency?How do you resolve transitive dependency?

• Decompose the problematic table into Decompose the problematic table into smaller tables. smaller tables. • Must be a ‘loss-less’ decomposition. Must be a ‘loss-less’ decomposition. That is, you must be able to put the That is, you must be able to put the decomposed tables back together again to decomposed tables back together again to arrive at the original information. arrive at the original information. • Remember Remember Foreign KeysForeign Keys!!

Page 26: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

3NF3NF

DORMDORM FEEFEE

OracleOracle 10001000

DB2DB2 800800

SybaseSybase 500500

SIDSID DORMDORM

101101 OracleOracle

102102 OracleOracle

103103 DB2DB2

104104 DB2DB2

105105 SybaseSybase

DOM_FEEDOM_FEE

STUDENT_DORMSTUDENT_DORM

Page 27: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

3NF3NF

• Are the two (decomposed) tables Are the two (decomposed) tables STUDENT_DORM and DORM_FEE in STUDENT_DORM and DORM_FEE in 2NF?2NF?

• Are they in 3NF?Are they in 3NF?

• Do these two tables have any modification Do these two tables have any modification anomalies?anomalies?

Page 28: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Data Analyst’s OathData Analyst’s Oath

EVERY NON-KEY COLUMN IN A EVERY NON-KEY COLUMN IN A TABLE MUST BE TABLE MUST BE FUNCTIONALLY FUNCTIONALLY DEPENDENTDEPENDENT UPON THE UPON THE ENTIREENTIRE KEY AND KEY AND NOTHINGNOTHING BUT THE KEY! BUT THE KEY!

Page 29: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Other Normal FormsOther Normal Forms• There are additional normal forms which do not often occur There are additional normal forms which do not often occur

in actual practice. However, these situations in actual practice. However, these situations can can occur in occur in practice so it is necessary to understand them. These are:practice so it is necessary to understand them. These are:– Boyce-Codd Normal FormBoyce-Codd Normal Form– Fourth Normal FormFourth Normal Form– Fifth Normal FormFifth Normal Form

• We will deal with these normal forms if time allows. You We will deal with these normal forms if time allows. You must, however, fully understand 1must, however, fully understand 1STST through 3 through 3RDRD NF. NF.

• Domain/Key normal form is a different approach and we Domain/Key normal form is a different approach and we will not deal with it in this course.will not deal with it in this course.

Page 30: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

*

First Normal Form(1NF)First Normal Form(1NF)Second Normal Form(2NF)Second Normal Form(2NF)

Third Normal Form(3NF)Third Normal Form(3NF)

Fourth Normal Form(4NF)Fourth Normal Form(4NF)Fifth Normal Form(5NF)Fifth Normal Form(5NF)

Boyce-Codd Normal Form(BCNF)Boyce-Codd Normal Form(BCNF)

Domain/Key Normal Form (DK/NF)Domain/Key Normal Form (DK/NF)

Relationships of Normal FormsRelationships of Normal Forms

Page 31: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Normal FormsNormal Forms

– First Normal FormFirst Normal Form• No repeating groups in tablesNo repeating groups in tables

– Second Normal FormSecond Normal Form• Table is 1Table is 1stst normal form and no partial key normal form and no partial key

dependenciesdependencies– Third Normal FormThird Normal Form

• Table is in 2Table is in 2ndnd normal form and has no normal form and has no transitive dependenciestransitive dependencies

Page 32: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Normal FormsNormal Forms

– Boyce-Codd Normal FormBoyce-Codd Normal Form• Every determinant of a non-key attribute is a candidate Every determinant of a non-key attribute is a candidate

keykey– Fourth Normal FormFourth Normal Form

• A table has no multi-valued dependenciesA table has no multi-valued dependencies– Fifth Normal FormFifth Normal Form

• There are no lossey joins between two or more tablesThere are no lossey joins between two or more tables

Page 33: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Sample User ViewSample User View

ILLINOIS COMPUTERS CUSTOMER ORDER FORM Mail Orders to: Order No. Order Date Cust No. Illinois Computers, Inc. 2734 Maple Street Edwardsville, IL 62025 For Office Use Only Name: ___________________________________________ Address: _________________________________________ City: _____________________ State: ______ Zip: ______ Phone: ____________________ Item No. Description Quantity Price Amount Sub-total Freight Amount Tax Total Amount

Page 34: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

First Normal FormFirst Normal Form•Remove the repeating groups and concatenate keysRemove the repeating groups and concatenate keysso that the original table can be recovered by joiningso that the original table can be recovered by joiningtablestables

ORD_NBRORD_NBR ORD_DTEORD_DTE ZIP_ADRZIP_ADRCUS_NBRCUS_NBR CUS_NMECUS_NME STR_ADRSTR_ADR CTY_ADRCTY_ADR STT_ADRSTT_ADR

SUB_TOTSUB_TOT FRT_AMTFRT_AMT TAXTAX TOT_AMTTOT_AMT

ORDORD

AMOUNTAMOUNTORD_QTYORD_QTYORD_ITM_PRICEORD_ITM_PRICEITM_DSCITM_DSCITM_NBRITM_NBRORD_NBRORD_NBR

ORD_ITMORD_ITM

..

..

..

•What problems occur if the database is stored using first normal form?What problems occur if the database is stored using first normal form?

Page 35: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Second Normal FormSecond Normal Form• Are these tables in 2Are these tables in 2ndnd NF? NF? • In other words, are there any partial dependencies? In other words, are there any partial dependencies?

ORD_NBRORD_NBR ORD_DTEORD_DTE ZIP_ADRZIP_ADRCUS_NBRCUS_NBR CUS_NMECUS_NME STR_ADRSTR_ADR CTY_ADRCTY_ADR STT_ADRSTT_ADR

SUB_TOTSUB_TOT FRT_AMTFRT_AMT TAXTAX TOT_AMTTOT_AMT

ORDORD

AMOUNTAMOUNTORD_QTYORD_QTYORD_ITM_PRICEORD_ITM_PRICEITM_DSCITM_DSCITM_NBRITM_NBRORD_NBRORD_NBR

ORD_ITMORD_ITM

..

..

..

Page 36: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Second Normal FormSecond Normal Form• Remove any partial dependenciesRemove any partial dependencies

• Are there any Are there any transitive dependenciestransitive dependencies? ?

ORD_NBRORD_NBR ORD_DTEORD_DTE ZIP_ADRZIP_ADRCUS_NBRCUS_NBR CUS_NMECUS_NME STR_ADRSTR_ADR CTY_ADRCTY_ADR STT_ADRSTT_ADR

SUB_TOTSUB_TOT FRT_AMTFRT_AMT TAXTAX TOT_AMTTOT_AMT

AMOUNTAMOUNTORD_QTYORD_QTY

ORD_ITM_PRICEORD_ITM_PRICEITM_DSCITM_DSC

ITM_NBRITM_NBRORD_NBRORD_NBR

ORD_ITMORD_ITM

ORDORD

ITM_NBRITM_NBR

ITMITM

Page 37: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Third Normal FormThird Normal Form• Remove transitive dependenciesRemove transitive dependencies

ORD_NBR ORD_DTE

ZIP_ADR

CUS_NBR

CUS_NME STR_ADR CTY_ADR STT_ADR

SUB_TOT FRT_AMT TAX TOT_AMT

AMOUNTORD_QTY

ORD_ITM_PRICEITM_DSC

ITM_NBRORD_NBR

ORD_ITM

ORD

ITM_NBR

ITM

CUS_NBR

CUS

Page 38: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Third Normal FormThird Normal Form• Remove transitive dependenciesRemove transitive dependencies

ORD_NBR ORD_DTE

ZIP_ADR

CUS_NBR

CUS_NME STR_ADR

SUB_TOT FRT_AMT TAX TOT_AMT

AMOUNTORD_QTY

ORD_ITM_PRICEITM_DSC

ITM_NBRORD_NBR

ORD_ITM

ORD

ITM_NBR

ITM

CUS_NBR

CUS

CITY STATEZIP

ZIP

Page 39: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

DISCUSSIONDISCUSSION

• Is the table Ord_Itm in 3NF? Is the table Ord_Itm in 3NF?

• How about the table ORD? How about the table ORD?

Page 40: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

DISCUSSIONDISCUSSION

• Is the table Ord_Itm in 3NF? Yes.Is the table Ord_Itm in 3NF? Yes.– There is There is mathematical dependence mathematical dependence

betweenbetween Ord_Qty and Amount, NOTOrd_Qty and Amount, NOT functional dependence!functional dependence!

• How about the table ORD? NO.How about the table ORD? NO.– In this table, however, there is In this table, however, there is functional functional

dependence dependence between the non-key between the non-key attribultes Tot_Amt and (Sub_Tot + attribultes Tot_Amt and (Sub_Tot + Frt_Amt + Tax) Frt_Amt + Tax)

Page 41: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

DERIVABLE DATADERIVABLE DATA

• Rule of thumb: Do NOT include derivable Rule of thumb: Do NOT include derivable (computable) data in the baseline (computable) data in the baseline LogicalLogical database database design schemadesign schema

• You may, selectively include some derivable data You may, selectively include some derivable data in your design, mainly to enhance the performance in your design, mainly to enhance the performance of your application – which, however, is a of your application – which, however, is a physicalphysical database design issue (which we will be database design issue (which we will be discussing soon) discussing soon)

Page 42: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

Third Normal FormThird Normal Form• Remove transitive dependenciesRemove transitive dependencies

ORD_NBR ORD_DTE

ZIP_ADR

CUS_NBR

CUS_NME STR_ADR

SUB_TOT FRT_AMT TAX TOT_AMT

AMOUNTORD_QTY

ORD_ITM_PRICEITM_DSC

ITM_NBRORD_NBR

ORD_ITM

ORD

ITM_NBR

ITM

CUS_NBR

CUS

CITY STATEZIP

ZIP

DerivableFields

=

Page 43: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

QUESTIONQUESTION

• Should an ERD be Should an ERD be normalizednormalized for for RelationalRelational database design purposes? database design purposes?

Page 44: Database Design: Normalization Dr. Bijoy Bordoloi

BordoloiBordoloi

DISCUSSIONDISCUSSION

• Non-normalized ERDNon-normalized ERD– User-orientedUser-oriented

– Good for capturing/communicating the Good for capturing/communicating the semantics of the database applicationsemantics of the database application

• Normalized ERDNormalized ERD– Implementation-orientedImplementation-oriented

– Can be used to directly define the Can be used to directly define the database structuredatabase structure