上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter3 Design Theory for Relational Databases

Chapter 3 Design Theory for Relational Databases 1
1 Chapter 3 Design Theory for Relational Databases

Contents Functional Dependencies ●Decompositions Normal Forms(BCNF,3NF) Multivalued Dependencies (and 4NF) Reasoning About FD's MVD's 2
2 Contents z Functional Dependencies z Decompositions z Normal Forms (BCNF, 3NF) z Multivalued Dependencies (and 4NF) z Reasoning About FD’s + MVD’s

Our example of chapter 2 Beers(name,manf) Some questions: Bars(name,addr,license)1.Why do we design Drinkers(name,addr,phone) relations like the example? Likes(drinker,beer) 2.What makes a good Sells(bar,beer,price) relational database Frequents(drinker,bar) schema? 3.what we can do if it has A theory:“dependencies”will be flaws? talked first 3
3 Our example of chapter 2 Beers(name, manf) Bars(name, addr, license) Drinkers(name, addr, phone) Likes(drinker, beer) Sells(bar, beer, price) Frequents(drinker, bar) Some questions: 1. Why do we design relations like the example? 2. What makes a good relational database schema? 3. what we can do if it has flaws? A theory : “dependencies” will be talked first

Functional Dependencies .X->Y is an assertion about a relation R that whenever two tuples of R agree on all the attributes of X,then they must also agree on all attributes in set Y. Say "X->Y holds in R." Convention:...X,Y,Z represent sets of attributes;A,B, C,...represent single attributes. Convention:no set formers in sets of attributes,just ABC. rather than [A,B,C 4
4 Functional Dependencies z X ->Y is an assertion about a relation R that whenever two tuples of R agree on all the attributes of X, then they must also agree on all attributes in set Y. – Say “X ->Y holds in R.” – Convention: …, X, Y, Z represent sets of attributes; A, B, C,… represent single attributes. – Convention: no set formers in sets of attributes, just ABC, rather than {A,B,C }

Functional Dependency (cont.) Exist in a relational schema as a constraint. Agree for all instances of the schema (t and u are any two tuples) AsBs+ We have functional L dependency like this A1A2.今B1B2… u Ift and!Then they u agree Why we call "functional" 5 must agree here here dependency?
5 Functional Dependency (cont.) z Exist in a relational schema as a constraint. z Agree for all instances of the schema (t and u are any two tuples) A’s B’s If t and u agree here Then they must agree here t u We have functional dependency like this A1A2…ÆB1B2… Why we call “functional” dependency?

Functional Dependency (cont.) ● Some examples Beers(name,manf) name→manf manf→name? Sells(bar,beer,price) Bar,beer→price 6
6 Functional Dependency (cont.) z Some examples Beers(name, manf) nameÆmanf manfÆname ? Sells(bar, beer, price) Bar,beer Æ price

Splitting Right Sides of FD's X->A,A2...A holds for R exactly when each of X->A1,X->A2,...,X->A hold for R. Example:A->BC is equivalent to A->B and A->C. ● There is no splitting rule for left sides. We'll generally express FD's with singleton right sides 7
7 Splitting Right Sides of FD’s z X->A1A2…An holds for R exactly when each of X->A1, X->A2,…, X->An hold for R. z Example: A->BC is equivalent to A->B and A->C. z There is no splitting rule for left sides. z We’ll generally express FD’s with singleton right sides

Example:FD's Drinkers(name,addr,beersLiked,manf, favBeer) Reasonable FD's to assert: 1. name->addr favBeer (combining rule) Note this FD is the same as name->addr and name -favBeer.(splitting rule) 2.beersLiked -manf 8
8 Example: FD’s Drinkers(name, addr, beersLiked, manf, favBeer) z Reasonable FD’s to assert: 1. name -> addr favBeer (combining rule) Note this FD is the same as name -> addr and name -> favBeer. (splitting rule) 2. beersLiked -> manf

Example:Possible Data name addr beersLiked manf favBeer Janeway Voyager Bud A.B. WickedAle Janeway Voyager WickedAle Pete's WickedAle Spock Enterprise Bud A.B. Bud Because name -addr Because name -favBeer Because beersLiked -manf 9
9 Example: Possible Data name addr beersLiked manf favBeer Janeway Voyager Bud A.B. WickedAle Janeway Voyager WickedAle Pete’s WickedAle Spock Enterprise Bud A.B. Bud Because name -> addr Because name -> favBeer Because beersLiked -> manf

Keys of Relations K is a superkey for relation R if K functionally determines all of R. ● K is a key for R if K is a superkey,but no proper subset of K is a superkey. (minimality) 10
10 Keys of Relations z K is a superkey for relation R if K functionally determines all of R. z K is a key for R if K is a superkey, but no proper subset of K is a superkey. (minimality)
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter11 The semi-structured data model Structured data.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)Chapter1 Introduction.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_intro.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第二章 8086系统结构.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第一章 绪论(毛义梅).pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第四章 汇编语言程序设计_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第四章 汇编语言程序设计.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第十章 串行通信和可编程接口芯片8251A_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第十一章 A/D和D/A转换_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第八章 可编程计数器_定时器8253_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第八章 可编程计数器/定时器8253及其应用.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第五章 存储器_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第五章 存储器.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第二章 8086系统结构_习题及答案.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第二章 8086系统结构.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第九章 可编程外围接口芯片8255A_习题及解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第九章 可编程外围接口芯片 可编程外围接口芯片8255A及其应用.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第三章 8086/8088寻址方式和指令系统.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第七章 微型计算机中断系统_习题与解答.pdf
- 上海交通大学:《微机原理与接口技术》课程教学资源(课件讲稿)第七章 微型计算机中断系统.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter4 High-level Database Models.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)Chapter5 Algebraic and Logic Query languages.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)Chapter6 The database Language SQL –as a tutorial.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)Chapter7 Constraints and Triggers.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》课程教学资源(课件讲稿)chapter8 Views, Indexes.pdf
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_第三章习题与答案(第三版).doc
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_第二章习题与答案(第三版).doc
- 上海交通大学:《数据库系统原理 The principle of Database System》教学资源_Chapter 1 Introduction.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_15 Introduction to matlab.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_16 MATLAB environment short.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_19 Recursion 1.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_20 Looking Ahead.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Array and its Applications.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_examples on class design.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Expressions and Statements.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_files_DataBase Design.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Function.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Introduction to Computer and Programming.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_Introduction to Vg101.pdf
- 上海交通大学:《程序设计基础》课程教学讲义(密西根学院)Lecture Notes_objects and classes.pdf