《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 7 Normalization

Outline Features of Good Relational Design Functional Dependencies Decomposition Using Functional Dependencies ■Normal Forms Functional Dependency Theory Algorithms for Decomposition using Functional Dependencies Decomposition Using Multivalued Dependencies ■More Normal Form Atomic Domains and First Normal Form Database-Design Process Modeling Temporal Data Database System Concepts-7th Edition 7.2 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.2 ©Silberschatz, Korth and Sudarshan th Edition Outline ▪ Features of Good Relational Design ▪ Functional Dependencies ▪ Decomposition Using Functional Dependencies ▪ Normal Forms ▪ Functional Dependency Theory ▪ Algorithms for Decomposition using Functional Dependencies ▪ Decomposition Using Multivalued Dependencies ▪ More Normal Form ▪ Atomic Domains and First Normal Form ▪ Database-Design Process ▪ Modeling Temporal Data

Features of Good Relational Designs Suppose we combine instructorand department into in_dep,which represents the natural join on the relations instructor and department ID name salary dept name building budget 22222 Einstein 95000 Physics Watson 70000 12121 Wu 90000 Finance Painter 120000 32343 El Said 60000 History Painter 50000 45565 Katz 75000 Comp.Sci. Taylor 100000 98345 Kim 80000 Elec.Eng. Taylor 85000 76766 Crick 72000 Biology Watson 90000 10101 Srinivasan 65000 Comp.Sci. Taylor 100000 58583 Califieri 62000 History Painter 50000 83821 Brandt 92000 Comp.Sci. Taylor 100000 15151 Mozart 40000 Music Packard 80000 33456 Gold 87000 Physics Watson 70000 76543 Singh 80000 Finance Painter 120000 There is repetition of information Need to use null values(if we add a new department with no instructors) Database System Concepts-7th Edition 7.4 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 7.4 ©Silberschatz, Korth and Sudarshan th Edition Features of Good Relational Designs ▪ Suppose we combine instructor and department into in_dep, which represents the natural join on the relations instructor and department ▪ There is repetition of information ▪ Need to use null values (if we add a new department with no instructors)

Decomposition The only way to avoid the repetition-of-information problem in the in_dep schema is to decompose it into two schemas-instructor and department schemas. Not all decompositions are good.Suppose we decompose employee(ID,name,street,city,salary) into employee1 (ID,name) employee2(name,street,city,salary) The problem arises when we have two employees with the same name The next slide shows how we lose information--we cannot reconstruct the original employee relation--and so,this is a lossy decomposition. Database System Concepts-7th Edition 7.6 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.6 ©Silberschatz, Korth and Sudarshan th Edition Decomposition ▪ The only way to avoid the repetition-of-information problem in the in_dep schema is to decompose it into two schemas – instructor and department schemas. ▪ Not all decompositions are good. Suppose we decompose employee(ID, name, street, city, salary) into employee1 (ID, name) employee2 (name, street, city, salary) The problem arises when we have two employees with the same name ▪ The next slide shows how we lose information -- we cannot reconstruct the original employee relation -- and so, this is a lossy decomposition

A Lossy Decomposition ID 1a11e street city salary 57766 Kim Main Perryridge 75000 98776 Kim North Hampton 67000 employee ID 1a11e name street city salary 57766 Kim Kim Main Perryridge 75000 98776 Kim Kim North Hampton 67000 natural join ID name street city salary 57766 Kim Main Perryridge 75000 57766 Kim North Hampton 67000 98776 Kim Main Perryridge 75000 98776 Kim North Hampton 67000 Database System Concepts-7th Edition 7.7 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 7.7 ©Silberschatz, Korth and Sudarshan th Edition A Lossy Decomposition

Lossless Decomposition Let R be a relation schema and let R;and R2form a decomposition of R. That is R=R,UR2 ■ We say that the decomposition is a lossless decomposition if there is no loss of information by replacing R with the two relation schemas R, UR2 ■Formally, ΠR1(r)凶ΠR2(C)=r And,conversely a decomposition is lossy if rCΠR1(C)凶ΠR2()=r Database System Concepts-7th Edition 7.8 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.8 ©Silberschatz, Korth and Sudarshan th Edition Lossless Decomposition ▪ Let R be a relation schema and let R1 and R2 form a decomposition of R . That is R = R1 U R2 ▪ We say that the decomposition is a lossless decomposition if there is no loss of information by replacing R with the two relation schemas R1 U R2 ▪ Formally, R1 (r) R2 (r) = r ▪ And, conversely a decomposition is lossy if r R1 (r) R2 (r) = r

Example of Lossless Decomposition Decomposition of R=(A,B,C) R1=(A,B) R2=(B,C) AB AB B C a 1 A 1 1 A 2 B B 2 2 B r Πa.B(r) Π8.c) AB C ΠA()凶ΠB(r) 1 2 B Database System Concepts-7th Edition 7.9 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 7.9 ©Silberschatz, Korth and Sudarshan th Edition Example of Lossless Decomposition ▪ Decomposition of R = (A, B, C) R1 = (A, B) R2 = (B, C)

Normalization Theory Decide whether a particular relation R is in "good"form. In the case that a relation R is not in "good"form,decompose it into set of relations {R1,R2,...R}such that Each relation is in good form The decomposition is a lossless decomposition Our theory is based on: Functional dependencies Multivalued dependencies Database System Concepts-7th Edition 7.10 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.10 ©Silberschatz, Korth and Sudarshan th Edition Normalization Theory ▪ Decide whether a particular relation R is in “good” form. ▪ In the case that a relation R is not in “good” form, decompose it into set of relations {R1 , R2 , ..., Rn } such that • Each relation is in good form • The decomposition is a lossless decomposition ▪ Our theory is based on: • Functional dependencies • Multivalued dependencies

Functional Dependencies There are usually a variety of constraints(rules)on the data in the real world. For example,some of the constraints that are expected to hold in a university database are: Students and instructors are uniquely identified by their ID. Each student and instructor has only one name. Each instructor and student is(primarily)associated with only one department. Each department has only one value for its budget,and only one associated building. Database System Concepts-7th Edition 7.11 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.11 ©Silberschatz, Korth and Sudarshan th Edition Functional Dependencies ▪ There are usually a variety of constraints (rules) on the data in the real world. ▪ For example, some of the constraints that are expected to hold in a university database are: • Students and instructors are uniquely identified by their ID. • Each student and instructor has only one name. • Each instructor and student is (primarily) associated with only one department. • Each department has only one value for its budget, and only one associated building

Functional Dependencies (Cont.) An instance of a relation that satisfies all such real-world constraints is called a legal instance of the relation; A legal instance of a database is one where all the relation instances are legal instances Constraints on the set of legal relations. Require that the value for a certain set of attributes determines uniquely the value for another set of attributes. A functional dependency is a generalization of the notion of a key. Database System Concepts-7th Edition 7.12 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.12 ©Silberschatz, Korth and Sudarshan th Edition Functional Dependencies (Cont.) ▪ An instance of a relation that satisfies all such real-world constraints is called a legal instance of the relation; ▪ A legal instance of a database is one where all the relation instances are legal instances ▪ Constraints on the set of legal relations. ▪ Require that the value for a certain set of attributes determines uniquely the value for another set of attributes. ▪ A functional dependency is a generalization of the notion of a key

Functional Dependencies Definition Let R be a relation schema aR and BCR The functional dependency 0→B holds on R if and only if for any legal relations r(R),whenever any two tuples f and t,of ragree on the attributes a,they also agree on the attributes B.That is, tila]=t2 [a]tlB]=t2[B] Example:Consider r(A,B)with the following instance of r. 4 1 5 37 ■On this instance,B>A hold;A→B does NOT hold, Database System Concepts-7th Edition 7.13 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 7.13 ©Silberschatz, Korth and Sudarshan th Edition Functional Dependencies Definition ▪ Let R be a relation schema R and R ▪ The functional dependency → holds on R if and only if for any legal relations r(R), whenever any two tuples t1 and t2 of r agree on the attributes , they also agree on the attributes . That is, t1 [] = t2 [] t1 [ ] = t2 [ ] ▪ Example: Consider r(A,B ) with the following instance of r. ▪ On this instance, B → A hold; A → B does NOT hold, 1 4 1 5 3 7
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 6 Database Design Using the E-R Model.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 5 Advanced SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 4 Intermediate SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 31 Information Retrieval.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 30 XML.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 3 Introduction to SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 29 Object-Based Databases.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 28 Advanced Relational Database Design.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 27 Formal-Relational Query Languages.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 26 Blockchain Databases.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 25 Advanced Application Development.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 24 Advanced Indexing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 23 Parallel and Distributed Transaction Processing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 22 Parallel and Distributed Query Processing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 21 Parallel and Distributed Storage.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 20 Database System Architectures.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 2 Intro to Relational Model.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 19 Recovery System.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 18 Concurrency Control.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 17 Transactions.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 8 Complex Data Types.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 9 Application Development.pptx
- 计算机科学与技术教学资源(参考文献)The generalized Cholesky factorization method for saddle point problems.pdf
- 计算机科学与技术教学资源(参考文献)Inverse updating and downdating for weighted linear least squares using M-invariant reflections.pdf
- 计算机科学与技术教学资源(参考文献)Analysis of peaks and plateaus in a Galerkin/minimal residual pair of methods.pdf
- 计算机科学与技术教学资源(参考文献)Perturbation analysis for the generalized Cholesky factorization.pdf
- 计算机科学与技术教学资源(参考文献)STABILITY OF THE MATRIX FACTORIZATION FOR SOLVING BLOCK TRIDIAGONAL SYMMETRIC INDEFINITE LINEAR SYSTEMS.pdf
- 计算机科学与技术教学资源(参考文献)A Convergent Restarted GMRES Method For Large Linear Systems.pdf
- 计算机科学与技术教学资源(参考文献)Properties and Computations of Matrix Pseudospectra.pdf
- 计算机科学与技术(参考文献)A Novel Constrained Texture Mapping Method Based on Harmonic Map.pdf
- 计算机科学与技术(参考文献)A Robust and Fast Non-local Algorithm for Image Denoising.pdf
- 计算机科学与技术(参考文献)Efficient View Manipulation for Cuboid-Structured Images.pdf
- 计算机科学与技术(参考文献)Ensemble of trusted firmware services based on TPM.pdf
- 计算机科学与技术(参考文献)Fuzzy Quantization Based Bit Transform for Low Bit-Resolution Motion Estimation.pdf
- 计算机科学与技术(参考文献)Image Completion based on Views of Large Displacement.pdf
- 计算机科学与技术(参考文献)Image and Video Retexturing.pdf
- 计算机科学与技术(参考文献)Learning-Based 3D Face Detection Using Geometric Context.pdf
- 计算机科学与技术(参考文献)Multi-view Video Summarization.pdf
- 计算机科学与技术(参考文献)Mesh-Guided Optimized Retexturing for Image and Video.pdf
- 计算机科学与技术(参考文献)Object Tracking Using Learned Feature Manifolds.pdf