数据库系统概念第六版课后习题-第二章答案.pdfVIP

  • 8
  • 0
  • 约1.99千字
  • 约 2页
  • 2022-11-09 发布于安徽
  • 举报

数据库系统概念第六版课后习题-第二章答案.pdf

数据库系统概念第六版课后习题-第⼆章答案 //2.1 person_name ,company_name 吧,严格意义上来说,名字也会有重复的可能,最好还是⽤Id, //2.2 假如向instructor 中插⼊(990514 ,Math,eving,90000 ),在department 中不存在math对应 假如删除instructor 中的(22222 ,einsten,physics,95000 ),则在department 中⾄少会有⼀个physics找不到对应。 这两种操作都会造成外码约束, //2.3 个⼈觉得,作者的意思是为什么day+time 中的⼀个可以作为主码,然⽽单独⼀个start_time 或者end_time //2.4 可以。在没有重名的情况下,名字就是能够唯⼀确定的⼀个属性。 但是如果是全部的教务⼈员,⽽⾮实例,为了保证⼀定成功,现实⽣活中⼀般不会⽤教务⼈员名字作为确定instrucor 的主码 //2.5 执⾏笛卡尔积后,执⾏s_id=ID的选择运算 显⽰出所有符合条件s_id=ID的元组,重复出现的显⽰次数 //2.6 a.在takes 中选择出year=2009 的元组,在跟stuent表连接 b.先将stuent表和takes表连接,在进⾏选择 c.将stuent和takes表连接后的表,把ID,name ,course——id 投影 //2.7 ∏name (σ city=Mimami(empylee) ) ∏name (σ salary=10000(empylee) ) ∏name (σcity=“Mimami” ∧salary=10000 (empylee)) //2.8 ∏branch_name( σbranch_name=Chicago(branch)) ∏ customer_name( σ branch_name=“Download” (customer ⋈loan)) //2.9 branch(branch_name, branch_city, assets) customer(customer_name, customer_street, customer_city) loan(loan_number, *branch_name, amount) borrower(customer_name, *loan_number) account(account_number, *branch_name, balance) depositor(customer_name, *account_number) 带*的为外码,第⼀个属性为主码 //2.10 不能。在⼀位学⽣只有⼀个advisor 的时候s_id可以作为主码,在⼀对多时,只有a_id也就是advisor 的id可以作为主码 //2.11 关系的概念对应于程序设计语⾔中变量的概念,⽽关系模式的概念对应于程序设计语⾔中类型定义的概念 //2.12 a. ∏person_name( σcompany_name=First Bank Corporation(employee ⋈works)) b. ∏person_name,city( σcompany_name=First Bank Corporation(employee ⋈works)) c. ∏person_name,street,city( σcompany_name=First Bank Corporation(employee ⋈works) ∪σsalary=10000(employee ⋈works)) //2.13 a. ∏loan_number( σamount10000(loan)) b. ∏customer_name( σbalance6000(account ⋈depositor)) c. ∏customer_name( σbalance6000(account ⋈depositor) ∪σbranch_name=Uptown(account ⋈depositor)) //2.14 a. 数据库中某个属性不存在(⽐如说存在学⽣没有⼿机号码的情况); b. 数据库中某个属性未提供或未知(⽐如说有些⼈填写了性别⽽有些⼈出于隐私考虑不填) ; 在过程化语⾔中,⽤户指导系统对数据库进⾏⼀系列操作以计算出所需结果。在⾮过程化语⾔中,⽤户只需描述所需信息,⽽不⽤给出获取该信息的具体过程。

文档评论(0)

1亿VIP精品文档

相关文档