- 1、本文档共14页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
ch6 exercise new
R = (A, B, C, G, H, I)F = ( A ? B A ? C CG ? H CG ? I B ? H} What is the key of R given F? (AG+)1. Result= AG2. Result= ABCG (A ? C; A ? B and A ? AG)3. Result= ABCGH (CG ? H and CG ? AGBC)4. Result=ABCGHI (CG ? I and CG ? AGBCH) Is AG a candidate key?1. AG ? R2. Does A+ ? R? 3. Does G+ ? R? Exercise Let R = (A, B, C, D, E), F = {A?BC, CD?E, B?D, E?A} and the decomposition R1= (A, B, C) R2= (A, D, E) Is the decomposition lossless? Yes because the common attribute A is a key for R1 Is the decomposition dependency preserving? No: we loose CD?E, B?D Exercise Let R(A, B, C, D) and F={AB?CD, B ?C}. Is R 2NF? Key: AB B ?C violates 2NF, since B is subset of key and C is not prime attribute. Let R(A, B, C, D) and F={AB?CD, C ?D}. Is R 2NF? Key: AB C ?D, C is not a subset of key, so R is in 2NF Exercise Let R(A, B, C, D, E) and F={A?B, BC?E, and ED ?A} List the candidate key(s) of R ACD BCD CDE Decompose R in 3NF. R is already in 3NF. All the attributes of R are prime. Exercise Let a relation: Sale (Customer, Store, Product, Price) and the constraints: A Customer buys from 1 store There is a unique price for each product in a store Which are the FD implied by the above descriptions: {Customer} ? {Store} {Store, Product} ? {Price} Candidate key: {Customer, Product} Is Sale in 3NF? No – both FDs violate 3NF. Decompose Sale into 3NF R1(Customer,Store), R2(Store,Product,Price) Is the decomposition dependency preserving? Yes each dependency is preserved in a table BUT (see next page) Exercise Our decomposition (Customer,Store), (Store,Product,Price) is lossy because the common attribute Store is not a key of any table KEY: Customer, Product Exercise Let R(A, B, C, D, E, F, G), F={AB ?CD, C ?EF, G ?A, G?F, CE ?F} Decompose R into 3NF relations Candidate keys GB First, we need the canonical cover FC={AB ?C, AB ? D, C ?E, C ? F, G ?A, G ? F,} 3NF Decomposition R1={ABC}, R2={ABD} R3={CE}, R4={CF} R5={GA}, R6={GF} R4={GB} Exerc
您可能关注的文档
- Biofunctionalized magnetic-vortex microdiscs for targeted cancer-cell destruction.pdf
- Bioline International.pdf.pdf
- Biomechanical Properties of the Lower Uterine Segment Above and Below the Reflection of the.pdf
- BIOMEDICAL ENGINEERING- APPLICATIONS, BASIS & COMMUNICATIONS EXTRACTION OF CORONARY ARTERIA.pdf
- biogas_China.pdf
- Biosensors and Bioelectronics-Efficient one-pot synthesis of molecularly imprinted silica.pdf
- Bistable Spin Currents from Quantum Dots Embedded in a Microcavity.pdf
- BISS Introduction update.pdf
- BIS_C-600调试.pdf
- Bispecific antibodies and their applications.pdf
文档评论(0)