您当前的位置:首页 > 资料

《数据库原理与应用》练习题答案 一、填空题 1、实体完整新 参照完整新 用户自定义完整性 2、原子性 一致性 隔离性 3、主属性 4、触发器 5、3NF 或 第三范式 6、REVOKE

济宁企业员工技能提升补助发放中15315377317

 《数据库原理与应用》练习题答案SnW★济宁成人高考报名0537-2229526

一、填空题SnW★济宁成人高考报名0537-2229526

1、实体完整新 参照完整新 用户自定义完整性SnW★济宁成人高考报名0537-2229526

2、原子性 一致性 隔离性SnW★济宁成人高考报名0537-2229526

3、主属性SnW★济宁成人高考报名0537-2229526

4、触发器SnW★济宁成人高考报名0537-2229526

5、3NF 或  第三范式SnW★济宁成人高考报名0537-2229526

6、REVOKESnW★济宁成人高考报名0537-2229526

7、实体完整新 用户自定义完整性 参照完整新SnW★济宁成人高考报名0537-2229526

8、一致性 隔离性 持久性SnW★济宁成人高考报名0537-2229526

9、逻辑独立性 物理独立性SnW★济宁成人高考报名0537-2229526

10、自反律 增广律SnW★济宁成人高考报名0537-2229526

二、操作题SnW★济宁成人高考报名0537-2229526

1.  1、SELECT CNAME FROM CUSTOMERSnW★济宁成人高考报名0537-2229526

2、SELECT CNAME FROM CUSTOMER, COUNTINFO WHERE COUNTINFO.CNO=CUSTOMER.CNO AND COUNTINFO.BALANCE>20000SnW★济宁成人高考报名0537-2229526

3、SELECT CNAME FROM CUSTOMER WHERE CNO IN(SELECT CNO FROM COUNTINFO WHERE BALANCE=(SELECT MAX(BALANCE) FROM COUNTINFO))SnW★济宁成人高考报名0537-2229526

4、SELECT COUNTID, BALANCE FROM COUNTINFO, TRANINFO WHERE COUNTINFO.COUNTID=TRANINFO.COUNTID AND GETDATE()-TRANINFO.TDATE<=10SnW★济宁成人高考报名0537-2229526

5、SELECT COUNTED, BALANCE FROM COUNTINFO, CUSTOMER WHERE COUNTINFO.CNO=CUSTOMER.CNO AND CUSTOMER.CNAME=’张三’SnW★济宁成人高考报名0537-2229526

6、SELECT COUNT(DISTINCE CNO) FROM COUNTINFOSnW★济宁成人高考报名0537-2229526

7、UPDATE COUNTINFO SET BALANCE=BALNCE+1000 WHERE CNO=(SELECT CNO FROM CUSTOMER CNAME=’李四’)SnW★济宁成人高考报名0537-2229526

8、DELETE FROM COUNTINFO WHERE COUNTED=1SnW★济宁成人高考报名0537-2229526

2.   1、SELECT DEPTNO, POST FROM EMP WHERE NAME=’王小毛’SnW★济宁成人高考报名0537-2229526

2、SELECT PROJECT.NAME, EMP.NAME FROM EMP, PROJECT, CONSTRUCT WHERE EMP.EMPNO=CONSTRUCT.EMPNO AND PROJECT.PRONO=CONSTRUCT.PRONO AND CONSTRUCT.LAST>100SnW★济宁成人高考报名0537-2229526

3、SELECT NAME FROM EMP ORDER BY POST DESCSnW★济宁成人高考报名0537-2229526

4、SELECT EMPNO, SUM(LAST) FROM CONTRUCT GROUP BY EMPNO HAVING SUM(LAST)>=480SnW★济宁成人高考报名0537-2229526

5、UPDATE CONSTRUCT SET LAST=LAST+50 WHERE PRONO=(SELECT PRONO FROM PROJECT WHERE NAME=’高教新区项目’SnW★济宁成人高考报名0537-2229526

6、SELECT DEPTNO, COUNT(EMPNO) FROM EMP GROUP BY DEPTNOSnW★济宁成人高考报名0537-2229526

7、SELECT EMP.NAME FROM EMP, PROJECT, CONSTRUCT WHERE EMP.EMPNO=CONSTRUCT.EMPNO AND PROJECT.PRONO=CONSTRUCT.EMPNO AND PROJECT.BUDGET>1000000SnW★济宁成人高考报名0537-2229526

8、DELETE FROM CONSTRUCT WHERE PRONO=1SnW★济宁成人高考报名0537-2229526

3.  1、SELECT SNAME, CITY FROM SSnW★济宁成人高考报名0537-2229526

2、SELECT JNO FROM SPJ WHERE SNO=’S1’SnW★济宁成人高考报名0537-2229526

3、SELECT P.PNAME, SPJ.QTY FROM P, SPJ WHERE P.PNO=SPJ.PNO AND SPJ.JNO=’J2’SnW★济宁成人高考报名0537-2229526

三、设计题SnW★济宁成人高考报名0537-2229526

1、1.本题E-R图如下:(10分)SnW★济宁成人高考报名0537-2229526

 SnW★济宁成人高考报名0537-2229526

2、转化后的关系模式如下:(10分)SnW★济宁成人高考报名0537-2229526

职工(职工编号,姓名,性别,仓库编号) SnW★济宁成人高考报名0537-2229526

仓库(仓库编号,仓库名,地址,公司编号) SnW★济宁成人高考报名0537-2229526

公司(公司编号,公司名,地址)SnW★济宁成人高考报名0537-2229526

3、每个关系模式的主码、外码如下:(10分)SnW★济宁成人高考报名0537-2229526

职工:主码是职工编号;外码是仓库编号SnW★济宁成人高考报名0537-2229526

公司:主码是公司编号SnW★济宁成人高考报名0537-2229526

仓库:主码是仓库编号;外码是公司编号SnW★济宁成人高考报名0537-2229526

21.本题E-R图如下:(10分)SnW★济宁成人高考报名0537-2229526

 SnW★济宁成人高考报名0537-2229526

2转化后的关系模式如下:(10分)SnW★济宁成人高考报名0537-2229526

出版社(电报编号,电话,邮编,地址) SnW★济宁成人高考报名0537-2229526

书籍(书号,品种,存放位置,数量,电报编号) SnW★济宁成人高考报名0537-2229526

借书人(借书证号,姓名,单位)SnW★济宁成人高考报名0537-2229526

借阅(书号,借书证号,借书日期,还书日期)SnW★济宁成人高考报名0537-2229526

3.每个关系模式的主码、外码如下:(10分)SnW★济宁成人高考报名0537-2229526

出版社:主码是电报编号SnW★济宁成人高考报名0537-2229526

书籍:主码是书号;外码是电报编号SnW★济宁成人高考报名0537-2229526

借书人:主码是借书证号SnW★济宁成人高考报名0537-2229526

借阅:主码是借书证号+书号,外码是借书证号号、书号;SnW★济宁成人高考报名0537-2229526

四、综合题SnW★济宁成人高考报名0537-2229526

1. CREATE TRIGGER TR_SAVE ON BORROWSnW★济宁成人高考报名0537-2229526

FOR INSERT,UPDATESnW★济宁成人高考报名0537-2229526

ASSnW★济宁成人高考报名0537-2229526

IF @@ROWCOUNT>0SnW★济宁成人高考报名0537-2229526

INSERT BORROW_SAVE SELECT i.*SnW★济宁成人高考报名0537-2229526

FROM INSERTED i,BOOKS bSnW★济宁成人高考报名0537-2229526

WHERE i.BNO=b.BNOSnW★济宁成人高考报名0537-2229526

    AND b.BNAME='数据库技术及应用'SnW★济宁成人高考报名0537-2229526

 SnW★济宁成人高考报名0537-2229526

2.CREATE PROCEDURE PROC_BORROWSnW★济宁成人高考报名0537-2229526

@SNAME VARCHAR(10)SnW★济宁成人高考报名0537-2229526

ASSnW★济宁成人高考报名0537-2229526

SELECT CARD.NAME, BOOKS.BNAME, BOOKS.AUTHOR, BORROW.RDATE SnW★济宁成人高考报名0537-2229526

FROM CARD, BOOKS, BORROWSnW★济宁成人高考报名0537-2229526

WHERE CARD.CNO=BORROW.CNO AND BOOKS.BNO=BORROW.BNO AND CARD.NAME=@SNAMESnW★济宁成人高考报名0537-2229526

 SnW★济宁成人高考报名0537-2229526

推荐资讯
相关文章
    无相关信息
栏目更新
栏目热门

本站主要提供教育信息咨询服务,合作洽谈电话0537-2229526王经理

网站备案号:鲁ICP备18055555号​

2 1