Presentation is loading. Please wait.

Presentation is loading. Please wait.

Texas State Technical College DISCOVER! Third Normal Form - 3NF It’s all about the key, the whole key, and nothing but the key.

Similar presentations


Presentation on theme: "Texas State Technical College DISCOVER! Third Normal Form - 3NF It’s all about the key, the whole key, and nothing but the key."— Presentation transcript:

1 Texas State Technical College DISCOVER! Third Normal Form - 3NF It’s all about the key, the whole key, and nothing but the key.

2 Texas State Technical College DISCOVER! Third Normal Form (3NF) 3NF is a sufficient level of normalization for most databases. At this point, the data is sufficiently organized to be useful as information to most organizations or entities. The focus of 3NF is to eliminate dependencies among non-key fields. Overview

3 Texas State Technical College DISCOVER! In order for a table to be considered 3NF, it must be 2NF and, consequentially, 1NF. In order for a table to be considered 3NF, all fields in the table must have NO Functional dependence upon non-key fieldsFunctional dependence upon non-key fields Transitive relationships to the primary keyTransitive relationships to the primary key Essentially, all fields must be directly related to or dependent upon the primary key. The Technical Definition Third Normal Form (3NF)

4 Texas State Technical College DISCOVER! Functional dependence Field Order_Total is dependent upon fieldsField Order_Total is dependent upon fields Order_QuantityOrder_Quantity Order_Item_PriceOrder_Item_Price The functional dependence is defined asThe functional dependence is defined as Order_Total = Order_Quantity X Order_Item_PriceOrder_Total = Order_Quantity X Order_Item_Price Transitive dependence Field Ship_Company is directly dependent uponField Ship_Company is directly dependent upon Shipment_ID (primary key)Shipment_ID (primary key) Field Ship_Company_Address is dependent uponField Ship_Company_Address is dependent upon Ship_Company to link or relate toShip_Company to link or relate to Shipment_IDShipment_ID The Layman’s Definition Third Normal Form (3NF)

5 Texas State Technical College DISCOVER! Functional dependence Increases data redundancy and reduces independenceIncreases data redundancy and reduces independence An update to one field requires update to othersAn update to one field requires update to others Transitive dependence Indicates a field is not describing the object represented by the record or tableIndicates a field is not describing the object represented by the record or table Field describes another object and should be in that object’s tableField describes another object and should be in that object’s table Why Eliminate … Third Normal Form (3NF)

6 Texas State Technical College DISCOVER! For Example… Order Order_ID pk QuantityPriceTotal TextNumberCurrency 1956844.0016.00 85466132.0026.00 777881030.00300.00 Shipment ID pk ProviderWeight$perLBCost Text NumberCurrency 65664FedEx4.0016.0048.00 55555USPS2.00 4.00 87954USPS30.002.0060.00 Two examples of functional dependence. Third Normal Form (3NF)

7 Texas State Technical College DISCOVER! For Example… Item ID pk MfgAddressWeight Text Number 19568Bins812 Bins Rd.16.00 85466B&D113 Sears St.26.00 77788Shallot888 9 th St.300.00 Vehicle ID pk Engine fk MaxHPMakeModel Text NumberText 65664SVT-V8340FordCobra 55555COT-82115MercuryCougar 87954CMN-99220DodgeRam Two examples of transitive dependence. Third Normal Form (3NF)

8 Texas State Technical College DISCOVER! 1.For each field, identify its dependencies and their type. 2.If it is a functional dependency on a non-key field, simply delete the dependent field. If there is a functional dependence, the value can be computed when the information is retrieved from the table. 3.If it is transitive dependence, treat it as a partial dependence in 2NF. Handle like in 2NF. Either move to the parent table or create a new table. 4.Repeat the process until database is 3NF. The database is 3NF when all tables in the database are 3NF. Converting to 3NF Third Normal Form (3NF)

9 Texas State Technical College DISCOVER! Corrected Example… Order Order_ID pk QuantityPrice TextNumberCurrency 1956844.00 85466132.00 777881030.00 Shipment ID pk ProviderWeight$perLB Text NumberCurrency 65664FedEx4.0016.00 55555USPS2.00 87954USPS30.002.00 Functional dependence: The dependent field has been discarded. FIXED: The tables are now 3NF! Third Normal Form (3NF)

10 Texas State Technical College DISCOVER! Corrected Example… Item ID pk Mfg fk Weight Text Number 19568Bins16.00 85466B&D26.00 Vehicle ID pk Engine fk MakeModel Text 65664SVT-V8FordCobra 55555COT-82MercuryCougar 87954CMN-99DodgeRam Engine ID pk MaxHP TextNumber SVT-V8340 COT-82115 CMN-99220 Manufacturer ID pk Address Text Bins812 Bins Rd. B&D113 Sears St. Transitive dependence: The dependent field moved to own table. FIXED: The tables are now 3NF! Third Normal Form (3NF)

11 Texas State Technical College DISCOVER! In Summary… Third normal form (3NF) is defined asThird normal form (3NF) is defined as 1NF and 2NF1NF and 2NF Having no functional dependenciesHaving no functional dependencies Having no transitive dependenciesHaving no transitive dependencies 3NF is a sufficient normalization for most databases.3NF is a sufficient normalization for most databases. 3NF guarantees independence and eliminates data redundancy.3NF guarantees independence and eliminates data redundancy. Third Normal Form (3NF)


Download ppt "Texas State Technical College DISCOVER! Third Normal Form - 3NF It’s all about the key, the whole key, and nothing but the key."

Similar presentations


Ads by Google