Download presentation
Presentation is loading. Please wait.
1
Logical Data Modeling – Normalization
BCHB697
2
Outline Logical Data Modeling – Normalization First Normal Form
Second Normal Form Third Normal Form BCHB697 - Edwards
3
Normalization Rules/Conditions that every entity and its attributes must satisfy: …plus manipulations to “fix” violations Violation fixes can be applied iteratively, until no violations remain. Fixes usually involve creating new entities “Algorithmic” strategy to achieve a good data-model: Complete, non-redundant, “business” logic, etc… Elimination of update anomalies BCHB697 - Edwards
4
Normalization Usually normalization is applied as a series of checks after an initial data model is proposed Often, primary entities of a data model are clear Provides “good-practice patterns” for data-model manipulation and representation challenges Usually do not start with a “universal” table for the entire data-model …but one or more entities in a logical data model may need to be fixed. BCHB697 - Edwards
5
Extended Example Data Modeling Essentials, Ch2 BCHB697 - Edwards
6
Initial Drug Expenditure Model
… plus lots of business logic, that I’ll explain as we go… BCHB697 - Edwards
7
Normalization 1st Normal Form (1NF): 2nd Normal Form (2NF):
One fact per attribute Entity instances are unique No repeated attributes 2nd Normal Form (2NF): 1st Normal Form, plus No partial (primary-key) determinants 3rd Normal Form (3NF): 2nd Normal Form, plus No non-primary-key determinants BCHB697 - Edwards
8
1st Normal Form (1NF) One fact, one attribute
Compound attributes are exploded to new columns Clean-up representations, hidden attributes, dependent attributes Entity instances are unique Every instance is uniquely defined by its primary-key No repeated attributes Repeated attributes become instances of new entity BCHB697 - Edwards
9
One fact per attribute BCHB697 - Edwards
10
One fact per attribute BCHB697 - Edwards
11
Identify Primary-Key Hospital Number and Operation Number uniquely identify the operation “event” Operation Number is managed by each Hospital independently. Hospital Number and Operation Number are underlined. BCHB697 - Edwards
12
No repeated attributes
Identify and remove groups of repeated attributes: Make new entity with repeated groups as instances Include the primary-key of the original table in the new entity’s attributes Identify the new entity’s primary-key Original primary-key plus…? BCHB697 - Edwards
13
No repeated attributes
BCHB697 - Edwards
14
1st Normal Form (1NF) Entity instances are unique (PK)
One fact per attribute No repeated attributes BCHB697 - Edwards
15
2nd Normal Form (2NF) No partial primary-key determinants
What attributes are completely determined by part of a primary-key? BCHB697 - Edwards
16
Determinants A determinant is any identifier attribute (or set of identifier attributes) of an entity that determines other attributes’ values. This should be true conceptually, not just for the current set of instances BCHB697 - Edwards
17
2nd Normal Form (2NF) No partial primary-key determinants
Create new table for determinant and determined attributes, determinant as PK BCHB697 - Edwards
18
2nd Normal Form (2NF) No partial primary-key determinants
What other attributes are completely determined by part of a primary-key? BCHB697 - Edwards
19
2nd Normal Form (2NF) No partial primary-key determinants
What other attributes are completely determined by part of a primary-key? BCHB697 - Edwards
20
2nd Normal Form (2NF) BCHB697 - Edwards
21
3rd Normal Form (3NF) No non-primary-key determinants
What attributes are determined by something other than the primary key of an entity? BCHB697 - Edwards
22
3rd Normal Form (3NF) No non-primary-key determinants
What attributes are determined by something other than the primary key of an entity? BCHB697 - Edwards
23
3rd Normal Form (3NF) No non-primary-key determinants
BCHB697 - Edwards
24
3rd Normal Form (3NF) BCHB697 - Edwards
25
Exercise From the course data-folder:
Drug_Expenditure_UniversalTable.xlsx Small instantiation of the data for the example Step-by-step, normalize this universal table to 3rd normal form. Use a separate sheet for each entity BCHB697 - Edwards
26
Homework Manipulate a new universal table to 3NF Submit:
Class_Registration_UniversalTable.xlsx Submit: an explicit list of the “business” logic used to determine determinants a compact description (see slide 21) of the entities and their attributes an entity relationship diagram (see slide 22), and an excel file with each entity represented as a table in a worksheet, populated from original universal table. Due Feb 1st, 10am BCHB697 - Edwards
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.