- 74
- 0
- 约4.12千字
- 约 4页
- 2017-06-07 发布于重庆
- 举报
数据库第二章课后部分习题答案
**************************************************
2.1 a.
Πperson name employee ? manages ? manager_name employee2.person name∧employee.street employee2.street∧employee.city employee2.city ??employee2 employee b.
The following solutions assume that all people work for exactly one company.
If one allows people to appear in the database e.g. in employee but
not appear in works, the problem is more complicated.We give solutions for
this more realistic case later.
Πperson name σcompany_name “First Bank Corporation” works
If people may not work for any company:
Πperson name employee ? Πperson name σ company name “First Bank Corporation” works
c.
Πperson_name works ? Πworks.person_name works? works.salary≤works2.salary∧pany name “Small Bank corporation” ??works2 works **************************************************
2.2 a.
r ?θ s ∪ r ? ΠR r ?θ s × null,null, . . ., null
The tuple of nulls is of size equal to the number of attributes in S.
b.
r ?θ s ∪ null,null, . . ., null × s ? ΠS r ?θ s The tuple of nulls is of size equal to the number of attributes in R.
c.
r ?θ s ∪ null,null, . . ., null × s ? ΠS r ?θ s ∪ r ? ΠR r ?θ s × null,null, . . ., null
The first tuple of nulls is of size equal to the number of attributes in R, and the second one is of size equal to the number of attributes in S.
**************************************************
2.3
a. employee ← Πperson name, street, ”Newtown”
σperson name “Jones” employee ∪ employee ? σperson name “Jones” employee
b. The update syntax allows reference to a single relation only. Since this update
requires access to both the relation to be updated works and the manages
relation, we must use several steps. First we identify the tuples of works
to be updated and store them in a temporary relation t1 . Then we create
a temporary relation containing the new tuples t2 . Finally, we delete the
tuples in t1, fromworks and insert the tuples of t2.
t1 ← Πworks.pe
您可能关注的文档
最近下载
- 民法总论课件.ppt VIP
- 低空经济与低空旅游建设方案.pdf VIP
- 《DLT 2934—2025垃圾发电厂飞灰低温处理技术规范》专题研究报告.pptx VIP
- 大气TSP、PM10监测.ppt VIP
- 公用工程车间调试车总结110116.doc VIP
- 畜牧微生物学教学课件电子教案全套课件.pptx VIP
- 2025年移动图书馆第三届知识竞答挑战赛题库及答案(第五关).docx VIP
- 2026年党支部班子在对照加强理论武装、做好群众工作、执行上级组织决定、严格组织生活等“6个对照方面”检查材料2份稿.docx VIP
- 降低患者胃肠减压管非计划拔管率品管圈.pdf
- 业绩完成情况专项审计报告.docx VIP
原创力文档

文档评论(0)