The document discusses the normalization of database tables, which is a process aimed at reducing data redundancies and eliminating anomalies through various stages (1NF, 2NF, 3NF, and 4NF). It highlights the importance of defining primary keys, eliminating repeating groups, and creating separate tables to manage dependencies effectively. Additionally, it addresses the challenges of maintaining normalization in database design and its impact on performance.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
17 views22 pages
Lect. 5 - Normalization
The document discusses the normalization of database tables, which is a process aimed at reducing data redundancies and eliminating anomalies through various stages (1NF, 2NF, 3NF, and 4NF). It highlights the importance of defining primary keys, eliminating repeating groups, and creating separate tables to manage dependencies effectively. Additionally, it addresses the challenges of maintaining normalization in database design and its impact on performance.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22
Data base management
System
Normalization of Database Tables
Database Tables and Normalization Table is basic building block in database design Normalization is process for assigning attributes to entities – Reduces data redundancies – Helps eliminate data anomalies – Produces controlled redundancies to link tables Normalization stages – 1NF - First normal form – 2NF - Second normal form – 3NF - Third normal form – 4NF - Fourth normal form Need for Normalization Observations on Figure in Slide 4 PRO_NUM intended to be primary key Table entries invite data inconsistencies Table displays data anomalies – Update • Modifying JOB_CLASS – Insertion • New employee must be assigned project – Deletion • If employee deleted, other vital data lost Conversion to 1NF Repeating groups must be eliminated – Proper primary key developed • Uniquely identifies attribute values (rows) • Combination of PROJ_NUM and EMP_NUM – Dependencies can be identified • Desirable dependencies based on primary key • Less desirable dependencies – Partial » based on part of composite primary key – Transitive » one nonprime attribute depends on another nonprime attribute Dependency Diagram (1NF) Data Organization: 1NF 1NF Summarized All key attributes defined No repeating groups in table All attributes dependent on primary key Conversion to 2NF Start with 1NF format: Write each key component on separate line Write original key on last line Each component is new table Write dependent attributes after each key PROJECT (PROJ_NUM, PROJ_NAME) EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS, CHG_HOUR) ASSIGN (PROJ_NUM, EMP_NUM, HOURS) 2NF Conversion Results 2NF Summarized In 1NF Includes no partial dependencies – No attribute dependent on a portion of primary key Still possible to exhibit transitive dependency – Attributes may be functionally dependent on nonkey attributes Conversion to 3NF Create separate table(s) to eliminate transitive functional dependencies
PROJECT (PROJ_NUM, PROJ_NAME)
ASSIGN (PROJ_NUM, EMP_NUM, HOURS) EMPLOYEE (EMP_NUM, EMP_NAME, JOB_CLASS) JOB (JOB_CLASS, CHG_HOUR) 3NF Summarized In 2NF Contains no transitive dependencies Additional DB Enhancements Normalization and Database Design Normalization should be part of the design process E-R Diagram provides macro view Normalization provides micro view of entities – Focuses on characteristics of specific entities – May yield additional entities Difficult to separate normalization from E-R diagramming Business rules must be determined Initial ERD for Contracting Company Modified ERD for Contracting Company Final ERD for Contracting Company Higher-Level Normal Forms Fourth Normal Form (4NF) – Table is in 3NF – Has no multiple sets of multivalued dependencies Conversion to 4NF
Multivalued Dependencies Set of Tables in 4NF
Denormalization Normalization is one of many database design goals Normalized table requirements – Additional processing – Loss of system speed Normalization purity is difficult to sustain due to conflict in: – Design efficiency – Information requirements – Processing Unnormalized Table Defects Data updates less efficient Indexing more cumbersome No simple strategies for creating views