无法显示该图片。 Chapter 7: Relational Database Design
Chapter 7: Relational Database Design
Chapter 7: Relational Database Design First normal form Pitfalls in Relational Database Design Functional Dependencies Decomposition Boyce-Codd Normal Form Third normal form Multivalued Dependencies and Fourth Normal Form Overall Database Design Process 标 Database System Concepts 7.2 OSilberschatz. Korth and Sudarshan
Database System Concepts 7.2 ©Silberschatz, Korth and Sudarshan Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design Functional Dependencies Decomposition Boyce-Codd Normal Form Third Normal Form Multivalued Dependencies and Fourth Normal Form Overall Database Design Process
First Normal Form Domain is atomic if its elements are considered to be indivisible units Examples of non-atomic domains Set of names, composite attributes Suppose that students are given roll numbers which are strings of the form CS0012 or EE1127 A relational schema is in first normal form(第一范式, 1NF) if the domains of all attributes of r are atomic 标 Database System Concepts 7.3 OSilberschatz. Korth and Sudarshan
Database System Concepts 7.3 ©Silberschatz, Korth and Sudarshan First Normal Form Domain is atomic if its elements are considered to be indivisible units Examples of non-atomic domains: Set of names, composite attributes Suppose that students are given roll numbers which are strings of the form CS0012 or EE1127 A relational schema R is in first normal form(第一范式, 1NF) if the domains of all attributes of R are atomic
Pitfalls in Relational Database Design Relational database design requires that we find a good" collection of relation schemas. a bad design may lead to Repetition of Information Inability to represent certain information Consider the relation schema Lending-schema=(branch-name, branch-city, assets, customer-name, loan-number, amount customer- loan branch-name branch-cit assets name number amount Downtown Brooklyn 9000000 Jones L171000 Redwood Palo Alto 2100000 Smith L-23 2000 Perryridge Horseneck 1700000 Hayes L-15 1500 Downtown Brooklyn 9000000 Jackson L-14 1500 Database System Concepts 7.4 OSilberschatz. Korth and Sudarshan
Database System Concepts 7.4 ©Silberschatz, Korth and Sudarshan Pitfalls in Relational Database Design Relational database design requires that we find a “good” collection of relation schemas. A bad design may lead to Repetition of Information. Inability to represent certain information. Consider the relation schema: Lending-schema = (branch-name, branch-city, assets, customer-name, loan-number, amount)
Example Redundancy(元余): Data for branch-name, branch-city, assets are repeated for each loan that a branch makes Wastes space Complicates updating, introducing possibility of inconsistency of assets value Null values Cannot store information about a branch if no loans exist Can use null values, but they are difficult to handle 标 Database System Concepts 7.5 OSilberschatz. Korth and Sudarshan
Database System Concepts 7.5 ©Silberschatz, Korth and Sudarshan Example Redundancy(冗余): Data for branch-name, branch-city, assets are repeated for each loan that a branch makes Wastes space Complicates updating, introducing possibility of inconsistency of assets value Null values Cannot store information about a branch if no loans exist Can use null values, but they are difficult to handle