Lecture 13Relational Decomposition and Relational Algebra.ppt

Lecture 13Relational Decomposition and Relational Algebra.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Lecture 13Relational Decomposition and Relational Algebra.ppt

Lecture 13: Relational Decomposition and Relational Algebra February 5th, 2003 Summary of Previous Discussion FD’s are given as part of the schema. You derived keys from them. You can also specify keys directly (they’re just another FD) First, compute the keys and the FD’s that hold on the relation you’re considering. Then, look for violations of BCNF. There may be a few. Choose one. Summary (continued) You may need to decompose the decomposed relations: To decide that, you need to project the FD’s on the decomposed relations. The end result may differ, depending on which violation you chose to decompose by. They’re all correct. Relations with 2 attributes are in BCNF. Summary (continued –2) If you have only a single FD representing a key, then the relation is in BCNF. But, you can still have another FD that forces you to decompose. This is all really pretty simple if you think about it long enough. Boyce-Codd Normal Form Example Decomposition Other Example R(A,B,C,D) A B, B C Keys: Violations of BCNF: Correct Decompositions A decomposition is lossless if we can recover: R(A,B,C) R1(A,B) R2(A,C) R’(A,B,C) should be the same as R(A,B,C) Correct Decompositions Given R(A,B,C) s.t. A?B, the decomposition into R1(A,B), R2(A,C) is lossless 3NF: A Problem with BCNF So What’s the Problem? Solution: 3rd Normal Form (3NF) Relational Algebra Formalism for creating new relations from existing ones Its place in the big picture: Relational Algebra Five operators: Union: ? Difference: - Selection: s Projection: P Cartesian Product: ? Derived or auxiliary operators: Intersection, complement Joins (natural,equi-join, theta join, semi-join) Renaming: r 1. Union and 2. Difference R1 ? R2 Example: ActiveEmployees ? RetiredEmployees R1 – R2 Example: AllEmployees -- RetiredEmployees What about Intersection ? It is a derived operator R1 ? R2 = R1 – (R1 – R2) Also e

文档评论(0)

gshshxx + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档