ImageVerifierCode 换一换
格式:DOCX , 页数:38 ,大小:411KB ,
资源ID:15846212      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/15846212.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数据库大题的答案Word文件下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

数据库大题的答案Word文件下载.docx

1、Each project is worked on by one or more graduate students (known as the projects research assistants).When graduate students work on a project, a professor must supervise their work on the project. Graduate students can work on multiple projects, in which case they will have a (potentially differen

2、t) supervisor for each one.Departments have a department number, a department name, and a main office.Departments have a professor (known as the chairman) who runs the department.Professors work in one or more departments, and for each department that they work in, a time percentage is associated wi

3、th their job.Graduate students have one major department in which they are working on their degree.Each graduate student has another, more senior graduate student (known as a student advisor) who advises him or her on what courses to take.Design and draw an ER diagram that captures the information a

4、bout the university.Use only the basic ER model here; that is, entities, relationships, and attributes. Be sure to indicate any key and participation constraints.9. Consider the university database from Exercise 8 and the ER diagram you designed. Write SQL statements to create the corresponding rela

5、tions and capture as many of the constraints as possible. If you cannot capture some constraints, explain why.Answer:1. create table professors ( prof_ssn char(10),name char(64),age integer,rank integer,speciality char(64),primary key (prof ssn) )2. create table depts ( dno integer,dname char(64),of

6、fice char(10),primary key (dno) )3. create table runs ( dno integer,prof_ssn char(10),primary key ( dno, prof ssn),foreign key (prof ssn) references professors,foreign key (dno) references depts )4. create table work dept ( dno integer,pc_ time integer,primary key (dno, prof_ssn),foreign key (prof_s

7、sn) references professors ,foreign key (dno) references depts )observe that we would need check constraints or assertions in sql to enforce the rule that professors work in at least one department.5. create table project ( pid integer,sponsor char(32),start date char(20),end date char(20),budget flo

8、at,primary key (pid) )6. create table graduates ( grad ssn char(10),deg prog char(32),major integer,primary key (grad ssn),foreign key (major) references depts )note that the major table is not necessary since each graduate has only one majorand so this can be an attribute in the graduates table.7.

9、create table advisor ( senior ssn char(10),grad ssn char(10),primary key (senior ssn, grad ssn),foreign key (senior ssn) references graduates ,foreign key (grad ssn) references graduates )8. create table manages ( pid integer,prof ssn char(10),primary key (pid, prof ssn),foreign key (pid) references

10、 projects )9. create table work in ( pid integer,foreign key (prof ssn) references professors ,foreign key (pid) references projects )observe that we cannot enforce the participation constraint for projects in thework in table without check constraints or assertions in sql.10. create table supervise

11、s ( prof ssn char(10),pid integer,primary key (prof ssn, grad ssn, pid),foreign key (prof ssn) references professors(prof ssn),foreign key (grad ssn) references graduates(grad ssn),foreign key (pid) references projects(pid) )Note that we do not need an explicit(明确的) table for the Work Proj relation

12、since everytime a Graduate works on a Project, he or she must have a Supervisor.10. Consider the following relations:Student(snum: integer, sname: string, major: string, level: string, age: integer)Class(name: string, meets at: string, room: string, d:Enrolled(snum: integer, cname: string)Faculty(d:

13、 integer, fname: string, deptid:The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class.Write the following queries in SQL. No duplicates should be printed in any of the answers.1. Find the names of all Juniors (level = JR) who are enrolled in a class taught by I. Teach.2. Find the age of the oldest student who is either a History major or enrolled in

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1