数据库系统答案

上传人:人*** 文档编号:486372612 上传时间:2022-12-28 格式:DOC 页数:18 大小:200KB
返回 下载 相关 举报
数据库系统答案_第1页
第1页 / 共18页
数据库系统答案_第2页
第2页 / 共18页
数据库系统答案_第3页
第3页 / 共18页
数据库系统答案_第4页
第4页 / 共18页
数据库系统答案_第5页
第5页 / 共18页
点击查看更多>>
资源描述

《数据库系统答案》由会员分享,可在线阅读,更多相关《数据库系统答案(18页珍藏版)》请在金锄头文库上搜索。

1、数据库系统概论习题参考答案作业 1第一章一、 选择题:1. A 2.C 3.B 4.A二、 综合题:1、 (1) 学号为键码,整型或字符串,所在系为字符串,年龄为整型,性别为字符。(2) StudentNo StudentName StudentAgeStudentSexDepartment99001李明18M计算机系99002王云19F计算机系99002刘平20M计算机系2、1)数据的结构化。2)数据共享性好。3)数据独立性好。4)数据存取粒度小。5)数据库管理系统对数据进行统一的管理和控制。6)为用户提供了友好的接口。第二章一、选择题:1.C二、综合题:1 、 interface Prod

2、ucer(key name ) attribute string name ; attribute string address; attribute string tel; relationship Set produces inverse Produc: t: producedBy ; ; interfae Product(key (brand ,model) ) attribute string brand ; attribute string model; attribute integer price ; relationship Producer producedBy invers

3、e Produce: r: produces ; Producermodel3、用ODL描述:in terface Customer(key name ,IDcard )(假设顾客无重名) attribute stri ng n ame ;attribute string addr;attribute in teger tel ; attribute string IDcard ;relatio nship Set purchases in verse Product: purchasedBy Product类增加如下联系:relati on ship Customer purchasedBy

4、 in verse Customer: purchases;4、in terface Stude nt(key SNo) attribute integer SNq attribute string SN; attribute integer Score ;relatio nship Set courses1 in verse Course : stude nts1;relati on ship Depart depart1in verse Depart: stude nts2;;in terface Teacher(key TNo)attribute in teger TNo;attribu

5、te string TN;relati on ship Set courses2in verse Course : teachers;in terface Depart(key DNo,DN)attribute in teger DNo;attribute stri ng DN;relati on ship Set stude nts2in verse Student depart1;relatia nship Set courses3in verse Course : deprt2;in terface Course(key CNO )attribute in teger CNo;attri

6、bute stri ng CN;reletio nship Set stude nts 1in verse student courses1;relatio nship Set teachersin verse Teachet courses2;relati on ship Depart depart2in verse Depart : courses3;;作业2第三章一、选择题:1A 2B 3B 4D 5C 6A 7D二、综合题:1、(1) 3! *3! =36(2) 4! *5! =24*120=2880(3) m个属性可有m!种不同的排列顺序,n个元组可有n!种不同的排列顺序,因此共有

7、m! *n!种不同的排列顺序。2、Producer(nam e,address,tel)Produces(produ name,bra nd,model)Pro duct(bra nd,model,price)3、Customer(No, Name ,Address )Flight (Number.Date ,Kind)Book ing (No, Number ,Date,Seat )4、假设学生选课数据库关系模式如下:Stude nt (SNo, SName, SAge ,SDept )Course (CNo, CName) SC (SNo,CNo, Score)(1) n SDept,Sa

8、g(e b SNO=990011(IStudent )(2) n Cname( score60 (SC) Course )(3) n SName( b score60(SC)b SDept=计算机系(Student)(4) n Score (SName张三(Student ):. SC : .: ( CName=数据库原理(Course )5、(1)元组关系演算(1) (s)(Studen(s) t1s41 t2ls31 s 9900111) /(2) 初)c( 2)( u(3) )(Course(c) SC(u) t1lc21 u2c11 u 61: 60)(3)t(s)(u)(Studen

9、t(s) SC(u) t1s21 u1s1u3】:60 s4计算机系) t(2s)(三u)(mc2)(Student(s) SC(u) /Course(c)/t1=(4)u3s1 =u1u2=c1s2=张林c2=数据库原理)(2)域关系演算(1)t1t2 |( s1s2)(Student(s1s2t2t1) s1 =9900111)t1| ( c1)( u1u3)(Course(c1t1) SC(u1c1u3) u3 : 60)t11 ( s1s3s4)( u2u3)(Studen(s1t1s3s4) SC(s1u2u3)s4 =计算机系u3 : 60)t1|( (s1s2s3s4)( u2u

10、3)( c2)(Studen(s1s2s3s4) SC(s1u2t1)Course(u2c2) s2 =张林c2 =数据库原理)6、(1) S(D,A) Student (SNO,SN,A,D) AND SNO=9900111(2) C(CN) Coures (CNo,CN).AND SC(SNo,CNo,S) AND S60(3) S(SN) Student (SNo,SN,A,D) AND SC(SNo,CNo,S) AND D=计算机系AND S60(4) U(S) Student (SNo,SN,A,D) AND SC(SNo,CNo,S)AND Coures (CNo,CN) AND

11、 SN=张林AND CN=数据库原理(T SNamd张三Stude nt% Score第4章一、选择题:1 C 2 B 3 A 4D C二、综合题:1.CREATE TABLE Movie(Title CHAR(30),Year INT,Len gth INT);CREATE TABLE Actor(Name CHAR(20),Address ARCHAR(30),Sex CHAR(1),Birthdate DATE);CREATE Acts(MovieTitle CHAR(30),MovieYear INT,ActorName CHAR(20);2.1)SELECT A/G(Le ngth)

12、,MIN(Le ngth)FROM MovieWHERE Year=2002;SELECT ActorNameFROM ActsWHERE MovieYear=2002;3)SELECT M1.Title,M1.Year,M2.YearFROM Movie AS M1,Movie AS M2WHERE M1.Title=M2.Title AND M1.YearM2.Year;4)INSERT INTO Actor(Name,Address,Sex,BirthdateA VUES (李秀兰,weiyuan:,19/02/80);5)UPDATE Movie SET Length=109 WHER

13、E Title=我的世界6)DELETE FROM MovieWHERE Year1940;DELETE FROM ActsWHERE MovieYear1940;3ALTER TABLE MovieADD MovieDirector CHAR(20);41)SELECT Cno,CnameFROM CourseWHERE Teacher LIKE 陈%;2)SELECT Sno,SnameFROM StudentWHERE Sage9Q5)SELECt SnameFROM StudentWHERE NOT EXISTS( SELECT *FROM SC,CoursesetWHERE SC.Sno=Student.Sno AND CnameC=+);6)SELECT X.SnoFROM Course,SC AS X,SC AS YWHERE SC.Cno=Course.Cno AND X.CnameB=ASICAND Y.Cname=

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 活动策划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号