1/47
Looks like no tags are added yet.
Normalization
A process for evaluating and correcting table structures to minimize data redundancies, which reduces the likelihood of data anomalies. It assigns attributes to tables based on determination.
Main goal of normalization
To eliminate data anomalies by eliminating unnecessary or unwanted data redundancies.
Normal forms
The series of stages that normalization works through: 1NF, 2NF, 3NF, then the higher forms BCNF, 4NF and 5NF.
Data anomalies
Insertion, update and deletion problems caused by unnecessary data redundancy. A well-normalized table has none of them.
Functional dependency
The concept normalization uses to identify which attribute determines other attributes (A → B means the value of A determines the value of B).
Determinant
An attribute (or set of attributes) whose value determines the values of other attributes in a functional dependency.
Prime attribute vs. nonprime attribute
A prime (key) attribute is part of a candidate key. A nonprime (nonkey) attribute is not part of any key. In a well-formed table, all nonprime attributes depend on the primary key.
Two situations where designers use normalization
1) When designing a new database structure. 2) When analyzing the relationships among attributes within each entity to see whether the structure can be improved.
Characteristics of a well-formed relation
Each table represents a single subject. Each row/column intersection holds only one value. No data item is unnecessarily stored in more than one table. All nonprime attributes depend on the primary key. The table has no insertion, update or deletion anomalies.
How far to normalize for business databases
For most business database design, 3NF is as high as you need to go. Higher forms such as 5NF and DKNF are unlikely in a business environment.
Normalization works how many relations at a time?
One relation (table) at a time, identifying the dependencies of that relation.
First normal form (1NF)
Table format with no repeating groups and the primary key identified. All key attributes are defined and all attributes depend on the primary key.
Second normal form (2NF)
The table is in 1NF and has no partial dependencies.
Third normal form (3NF)
The table is in 2NF and has no transitive dependencies.
Boyce-Codd normal form (BCNF)
The table is in 3NF and every determinant in the table is a candidate key. BCNF is a special case of 3NF.
Fourth normal form (4NF)
The table is in 3NF (BCNF in the textbook table) and has no independent multivalued dependencies.
Fifth normal form (5NF)
Also called project-join normal form (PJNF). The table is in 4NF and cannot be decomposed into smaller tables any further without losing data or creating incorrect information (no further lossless decomposition).
Project-join normal form (PJNF)
Another name for fifth normal form (5NF).
Partial dependency
A functional dependency in which the determinant is only part of the primary key. It assumes there is only one candidate key. Partial dependencies are fairly easy to identify.
Transitive dependency
A dependency in which an attribute depends on another attribute that is not part of the primary key. Transitive dependencies are harder to identify, and they occur only when a functional dependency exists among nonprime attributes.
Repeating group
A group of multiple entries of the same type that can exist for any single key attribute occurrence.
Three steps of conversion to 1NF
1) Eliminate the repeating groups. 2) Identify the primary key. 3) Identify all dependencies.
Dependency diagram
A diagram that shows all the dependencies within a given table structure. It gives an overview of how the table's attributes relate, so an important dependency is less likely to be overlooked.
Do all relational tables satisfy 1NF?
Yes. All relational tables satisfy 1NF, but some still contain partial dependencies.
When is a 1NF table automatically in 2NF?
When it has a single-attribute primary key. Conversion to 2NF is needed only when the 1NF table has a composite primary key.
Steps to convert 1NF → 2NF
1) Make new tables to eliminate partial dependencies. 2) Reassign the corresponding dependent attributes.
Steps to convert 2NF → 3NF
1) Make new tables to eliminate transitive dependencies. 2) Reassign the corresponding dependent attributes.
Atomic attribute
An attribute that cannot be subdivided any further.
Atomicity (of an attribute)
The characteristic of an attribute that cannot be divided into smaller units. Don't confuse this with transaction atomicity (ACID) from Module 11.
Granularity
The level of detail represented by the values stored in a table's row.
Ways to improve a normalized design
Minimize data entry errors. Evaluate naming conventions. Refine attribute atomicity. Identify new attributes and relationships. Refine primary keys for data granularity. Maintain historical accuracy. Evaluate the use of derived attributes.
Surrogate key
A system-defined attribute, usually created and managed by the DBMS. It is typically a numeric value that increments automatically for each new row. Designers use one when the natural primary key is unsuitable.
Candidate key
A key with the same characteristics as a primary key that was not chosen to be the primary key. It is a minimal superkey.
When are 3NF and BCNF equivalent?
When the table contains only one candidate key. BCNF can be violated only when a table has more than one candidate key.
Multivalued dependency
A row contains two or more independent multivalued facts about an entity. Removing these takes a table from 3NF to 4NF.
Two rules that make 4NF 'academic'
1) All attributes must depend on the primary key but be independent of each other. 2) No row may contain two or more multivalued facts about an entity.
Lossless decomposition
When the decomposed tables are joined back together, the original table is recreated exactly.
Limit on the value of higher normal forms
Their value is limited by the extra processing needed to work with the data. The lower normal forms are generally very desirable and should always be considered in design.
Normalization and database design principles
Normalization should be part of the design process. Proposed entities must meet the required normal form before table structures are created. The ERD is built through an iterative process, and normalization focuses on the characteristics of specific entities.
Denormalization
Produces a lower normal form. The result is better performance but greater data redundancy.
Why normalization can slow a system
As tables are decomposed, the number of tables grows. Joining more tables takes extra input/output (I/O) operations and processing logic, which reduces system speed.
Defects of unnormalized tables
Data updates are less efficient because tables are larger. Indexing is more cumbersome. There are no simple strategies for creating views. They often lead to data redundancy disasters in production databases.
Data-modeling checklist: business rules
Document and verify all business rules with end users. Write them precisely, clearly and simply. They must help identify entities, attributes, relationships and constraints. Identify each rule's source, and make sure it is justified, dated and signed off by an approving authority.
Data-modeling checklist: entity names
Nouns familiar to the business, short and meaningful. Document abbreviations, synonyms and aliases. Unique within the model. Composite entities may combine abbreviated names of the entities they link. All names are limited in length.
Data-modeling checklist: entities
Each entity represents a single subject and a set of distinguishable instances. All entities should be in 3NF or higher, and any below 3NF must be justified. Granularity is clearly defined, and the PK supports that granularity.
Data-modeling checklist: attributes
Simple and single-valued (atomic). Document default values, constraints, synonyms and aliases. Clearly identify derived attributes and their sources. No redundancy unless needed for transaction accuracy, performance or history. Nonkey attributes fully depend on the PK.
Data-modeling checklist: relationships
Clearly identify relationship participants. Clearly define participation and connectivity, and document cardinality.
Data-modeling checklist: ER model
Validate against expected inserts, updates and deletions. Evaluate where, when and how to keep history. No redundant relationships except where required. Minimize data redundancy so updates happen in a single place.