Presentation is loading. Please wait.

Presentation is loading. Please wait.

In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.

Similar presentations


Presentation on theme: "In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate."— Presentation transcript:

1 In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate the need for denormalization Objectives

2 Redundancy means repetition of data. Redundancy increases the time involved in updating, adding, and deleting data. It also increases the utilization of disk space and hence, disk I/O increases. Redundancy can lead to the following problems: Inserting, modifying, and deleting data may cause inconsistencies Errors are more likely to occur when facts are repeated Unnecessary utilization of extra disk space Understanding Data Redundancy

3 Normalization is a scientific method of breaking down complex table structures into simple table structures by using certain rules. It allows you to reduce redundancy in a table and eliminate the problems of inconsistency and disk space usage. Normalization results in the formation of tables that satisfy certain specified rules and represent certain normal forms. The most important and widely used normal forms are: First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF) Definition of Normalization

4 A table is said to be in the 1NF when each cell of the table contains precisely one value. Functional Dependency: The normalization theory is based on the fundamental notion of functional dependency. Given a relation R, attribute A is functionally dependent on attribute B if each value of A in R is associated with precisely one value of B. First Normal Form (1 NF)

5 A table is said to be in 2NF when it is in 1NF and every attribute in the row is functionally dependent upon the whole key, and not just part of the key. To ensure that a table is in 2NF, you should: Find and remove attributes that are functionally dependent on only a part of the key and not on the whole key and place them in a different table. Group the remaining attributes. Second Normal Form (2 NF)

6 A relation is said to be in 3NF when it is in 2NF and every non-key attribute is functionally dependent only on the primary key. To ensure that a table is in 3NF, you should: Find and remove non-key attributes that are functionally dependent on attributes that are not the primary key and place them in a different table. Group the remaining attributes. Third Normal Form (3 NF)

7 The original definition of 3NF was inadequate in some situations. It was not satisfactory for the tables: that had multiple candidate keys where the multiple candidate keys were composite where the multiple candidate keys overlapped Therefore, a new normal form-the BCNF was introduced: A relation is in the BCNF if and only if every determinant is a candidate key. Boyce-Codd Normal Form (BCNF)

8 In order to ensure that a table is in BCNF, you should: Find and remove the overlapping candidate keys. Place the part of the candidate key and the attribute it is functionally dependent on, in a different table. Group the remaining items into a table. Boyce-Codd Normal Form (BCNF) (Contd.)

9 Just a minute Which of the following help in achieving a good database design? 1.A table should store data for all the related entities together. 2.Each table should have an identifier. 3.Columns that contain NULL values should be created. Answer: 2.Each table should have an identifier.

10 Just a minute For which normal form you need to remove non-key attributes that are functionally dependent on attributes that are not primary key? Solution: Third normal form

11 Understanding Denormalization The end product of normalization is a set of related tables that comprise the database. However, in the interests of speed of response to critical queries, which demand information from more than one table, it is sometimes wiser to introduce a degree of redundancy in tables. The intentional introduction of redundancy in a table to improve performance is called denormalization.

12 Just a minute In the reporting system, the total amount paid to a contract recruiter is often required. The required result can be calculated using the two tables, ContractRecruiter and Payment. Since the size of the Payment table is large, the join between the two tables takes time to generate the required output. It is, therefore, necessary to improve the performance of this query. ContractRecruiter cContractRecruiterCode cName vAddress cCity siPercentageCharge Payment cSourceCode mAmount cChequeNo dDate

13 Just a minute Answer: Denormalize the tables. Add a column called mTotalPaid to the ContractRecruiter table. ContractRecruiter cContractRecruiterCode cName vAddress cCity siPercentageCharge mTotalPaid

14 In this session, you learned that: Normalization is used to simplify table structures. Normalization results in the formation of tables that satisfy certain specified constraints, and represent certain normal forms. The normal forms are used to ensure that various types of anomalies and inconsistencies are not introduced in the database. A table structure is always in a certain normal form. Several normal forms have been identified. The most important and widely used of these are: First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce Codd Normal Form (BCNF) Summary

15 The intentional introduction of redundancy in a table in order to improve performance is called denormalization. The decision to denormalize results in a trade-off between performance and data integrity. Denormalization increases disk space utilization. Summary (Contd.)


Download ppt "In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate."

Similar presentations


Ads by Google