Download presentation
Presentation is loading. Please wait.
Published byEdwina Ford Modified over 9 years ago
1
Copyright Ó Oracle Corporation, 1998. All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use the student note section below for further explanation of the slide content. Use your mouse to resize the content pane and read all of the student note section.Use your mouse to resize the content pane and read all of the student note section.
2
Copyright Ó Oracle Corporation, 1998. All rights reserved. - EMPLOYEE name number phone address department name department number salary gender project name project code marital status hire date birth date start date Data Normalization First Normal Form - a data structure that contains no repeating groups or multiple fields. First Normal Form - a data structure that contains no repeating groups or multiple fields. - Second Normal Form - a data structure in which each non-UID attribute is dependent upon all of its UID, and not just part of it. - Second Normal Form - a data structure in which each non-UID attribute is dependent upon all of its UID, and not just part of it. - Third Normal Form - a data structure in which each non-UID attribute is dependent upon only the UID, and not something else. - Third Normal Form - a data structure in which each non-UID attribute is dependent upon only the UID, and not something else.
3
Copyright Ó Oracle Corporation, 1998. All rights reserved. EMPLOYEE name number phone address department name department number salary gender project name project code marital status hire date birth date start date 444444 number project name project code start date # #### EMPLOYEE Optionality of relationship depends on optionality of removed attributes Always mandatory First Normal Form Pull out each repeating group, bring the UID with it, and Pull out each repeating group, bring the UID with it, and add at least one attribute to the UID of the new data set. add at least one attribute to the UID of the new data set. PROJECT
4
Copyright Ó Oracle Corporation, 1998. All rights reserved. EMPLOYEE name number phone address department name department number salary gender marital status hire date birth date 4 number project name project code start date # #### project name project code # EMPLOYEE Optionality of relationship should be verified after relationship names are added Always mandatory Second Normal Form Pull out each attribute that is not dependent on the entire UID, bringing with it that part of the UID upon which it is dependent. This form of Normal only operates against data sets (entities) that have multiple attribute UIDs. Pull out each attribute that is not dependent on the entire UID, bringing with it that part of the UID upon which it is dependent. This form of Normal only operates against data sets (entities) that have multiple attribute UIDs. PROJECT ASSIGNMENT
5
Copyright Ó Oracle Corporation, 1998. All rights reserved. EMPLOYEE name number phone address department name department number salary gender marital status hire date birth date 4444 number project code start date # #### project name project code # EMPLOYEE Optionality of relationship should be verified after relationship names are added department name department number # Optionality of relationship depends on optionality of removed attributes, degree to be verified DEPARTMENT Third Normal Form PROJECT ASSIGNMENT
6
Copyright Ó Oracle Corporation, 1998. All rights reserved. Normalize During Data Modeling CLIENT #* identifier CONTACT #* date contacted o location o location o result o result for the subject of CLIENT #* identifier * date contacted * date contacted Ensure a 3NF tale design by following the rules of data modeling. First Normal Form Rule A table must contain no repeating groups. Corresponding Data Modelling Rule All attributes must be single-valued. The attribute date contacted has multiple values, therefore the entity CLIENT is not in 1NF. Create an additional entity CONTACT with a M:1 relationship to CLIENT. Create an additional entity and 1:M relationship to ensure 1NF.
7
Copyright Ó Oracle Corporation, 1998. All rights reserved. Normalize During Data Modeling (cont) ACCOUNTBANK #* number * name * name #* number * balance * balance * date opened * date opened * bank location * bank location managed by the manager of ACCOUNTBANK #* number * name * name * bank location * bank location #* number * balance * balance * date opened * date opened managed by the manager of Validate each attribute's dependence upon its entity ’ s entire UID. Second Normal Form Rule Every non-key column must be dependent upon all the parts of the primary key. Corresponding Data Modeling Rule An attribute must be dependent upon its entity ’ s entire unique identifier. The attribute bank location is not dependent upon the UID of ACCOUNT. It is dependent upon the UID of BANK. Move the attribute and place it where it depends upon the the UID of its entity.
8
Copyright Ó Oracle Corporation, 1998. All rights reserved. Normalize During Data Modeling (cont) ORDER #* id * date of order * date of order * customer id * customer id * customer name * customer name * state * state for the submitter of CUSTOMER #* id * name * name * state * stateORDER #* id * date of order * date of order Verify attribute placement to ensure a normalized table design. Third Normal Form Rule No non-key column can be functionally dependent upon another non-key column. Corresponding Data Modeling Rule No non-UID attribute can be dependent upon another non-UID attribute. The attributes customer name and state are dependent upon the customer id. Create another entity called CUSTOMER with a UID of customer id, and place the attributes accordingly.
9
Copyright Ó Oracle Corporation, 1998. All rights reserved. Normalize the Data Model First Normal Form (1NF) First Normal Form (1NF) – All Attributes must be single-valued Second Normal Form (2NF) Second Normal Form (2NF) – An attribute must be dependent upon its entity ’ s entire unique identifier Third Normal Form (3NF) Third Normal Form (3NF) – No non-UID attribute can be dependent on another non-UID attribute A normalized entity-relationship data model automatically translates into a normalized relational database design! Normalization is a relational database concept, but its principles apply to Conceptual Data Modelling. 4-4
10
Copyright Ó Oracle Corporation, 1998. All rights reserved. First Normal Form Single-valued attributes Validate that each attribute has a single value for each occurrence of the entity. No attribute should have repeating values. CLIENT #* identifier * date contacted * date contacted Does the entity CLIENT comply with 1NF? The attribute date contacted has multiple values, therefore the entity CLIENT is not in 1NF. First Normal Form Rule: All attributes must be singled-valued. 4-5
11
Copyright Ó Oracle Corporation, 1998. All rights reserved. First Normal Form (cont) If an attribute has multiple values, create an additional entity and relate it to the original entity with a M:1 relationship. If an attribute has multiple values, create an additional entity and relate it to the original entity with a M:1 relationship.CLIENT #* identifier CONTACT #* date contacted o location o location o result o result for the subject of 4-5
12
Copyright Ó Oracle Corporation, 1998. All rights reserved. Second Normal Form Dependency on entire UID Validate that each attribute is dependent on its entity ’ s entire unique identifier. Each specific instance of the UID must determine a single instance of each attribute. Validate that each attribute is dependent on its entity ’ s entire unique identifier. Each specific instance of the UID must determine a single instance of each attribute. Validate that an attribute is not dependent upon only part of its entity ’ s UID. Validate that an attribute is not dependent upon only part of its entity ’ s UID.COURSE #* code * name * name * duration * duration * fee * fee Validate placement of the COURSE entity ’ s attributes In this example, each instance of a course code determines a specific value for name, duration, and fee. The attributes are properly placed. Second Normal Form Rule: An attribute must be dependent upon its entity ’ s entire unique identifier. 4-6
13
Copyright Ó Oracle Corporation, 1998. All rights reserved. Second Normal Form (cont) Validate the placement of the attributes for the ACCOUNT and BANK entities Validate the placement of the attributes for the ACCOUNT and BANK entities ACCOUNTBANK #* number * name * name #* number * balance * balance * date opened * date opened * bank location * bank location managed by the manager of Are there any attributes which can be determined from a portion of its entity ’ s UID? 4-6
14
Copyright Ó Oracle Corporation, 1998. All rights reserved. Second Normal Form (cont) Validate the placement of the attributes for the ACCOUNT and BANK entities Validate the placement of the attributes for the ACCOUNT and BANK entities ACCOUNTBANK #* number * name * name * bank location * bank location #* number * balance * balance * date opened * date opened managed by the manager of Each instance of a BANK and account number determine specific values of balance and date opened for each account. The attribute bank location is misplaced. It is dependent on BANK but not on account number and so should be an attribute of BANK. 4-6
15
Copyright Ó Oracle Corporation, 1998. All rights reserved. Third Normal Form No non-UID interdependencies Validate that each non-UID attribute is not dependent upon another non-UID attribute Validate that each non-UID attribute is not dependent upon another non-UID attribute Move any non-UID attribute that is dependent upon another non-UID attribute Move any non-UID attribute that is dependent upon another non-UID attribute ORDER #* id * date of order * date of order * customer id * customer id * customer name * customer name * state * state Are any of the non-UID attributes for this entity dependent upon another non-UID attribute? Third Normal Form Rule: No non-UID attribute can be dependent upon another non-UID attribute. 4-7
16
Copyright Ó Oracle Corporation, 1998. All rights reserved. Third Normal Form (cont) ORDER #* id * date of order * date of order * customer id * customer id * customer name * customer name * state * state for the submitter of CUSTOMER #* id * name * name * state * state ORDER #* id * date of order * date of order The attributes customer name and state are dependent on the customer id. Create another entity called CUSTOMER with a UID of customer id and place the attributes accordingly. 4-7
17
Copyright Ó Oracle Corporation, 1998. All rights reserved. Exercise 4-1 For the following E-R Model, evaluate each entity against the rules of normalization, identify the misplaced attribute, and explain what rule of normalization each misplaced attribute violates. Optionally, re-draw the E-R diagram in third normal form. for completed with COURSE #* course number course name course name teacher number teacher number department code department code department name department name teacher name teacher name ENROLLMENT grade code teacher number grade description course name STUDENT #* student id last name last name first name first name for assigned 4-9
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.