Chapter 15 Outline ▪ Informal Design Guidelines for Relation Schemas ▪ Functional Dependencies ▪ Normal Forms Based on Primary Keys ▪ General Definitions of Second and Third Normal Forms ▪ Boyce-Codd Normal Form
Informal Design Guidelines for Relation Schemas ▪ Measures of quality 1. Making sure attribute semantics are clear 2. Reducing redundant information in tuples 3. Reducing NULL values in tuples 4. Disallowing possibility of generating fake tuples
Normalization ▪ Normalization of data can be considered a process of analyzing the given relation schemas based on their FDs (Functional Dependencies) and primary keys to achieve the desirable properties of 1. minimizing redundancy and 2. minimizing the insertion, deletion, and update anomalies discussed. ▪ It can be considered as a “filtering” or “purification” process to make the design have successively better quality.
Functional Dependencies ▪ Formal tool for analysis of relational schemas ▪ Enables us to detect and describe some of the above-mentioned problems in precise terms ▪ Theory of functional dependency
Normalization of Relations ▪ Takes a relation schema through a series of tests ▪ Certify whether it satisfies a certain normal form ▪ Proceeds in a top-down fashion
Normalization of Relations ▪ There are various levels of normalizations. ▪ First Normal Form (1NF) ▪ Second Normal Form (2NF) ▪ Third Normal Form (3NF) ▪ Boyce–Codd Normal Form (BCNF) ▪ Fourth normal form (4NF) ▪ Fifth normal form (5NF)
Practical Use of Normal Forms ▪ Normalization carried out in practice ▪ Resulting designs are of high quality and meet the desirable properties stated previously ▪ Pays particular attention to normalization only up to 3NF, BCNF, or at most 4NF ▪ Do not need to normalize to the highest possible normal form
Definitions of Keys and Attributes Participating in Keys ▪ Definition of superkey and key ▪ Candidate key ▪ If more than one key in a relation schema • One is primary key • Others are secondary keys
First Normal Form ▪ Part of the formal definition of a relation in the basic (flat) relational model ▪ Only attribute values permitted are single atomic (or indivisible) values ▪ Techniques to achieve first normal form ▪ Remove attribute and place in separate relation ▪ Expand the key ▪ Use several atomic attributes
First Normal Form (cont’d.) ▪ Does not allow nested relations ▪ Each tuple can have a relation within it ▪ To change to 1NF: ▪ Remove nested relation attributes into a new relation ▪ Propagate the primary key into it ▪ Unnest relation into a set of 1NF relations
Instant ebooks textbook Fundamentals of research methodology for healthcare professionals Fourth Edition. Edition Gisela Hildegard Van Rensburg download all chapters