吉大17春学期数据库应用技术在线作业一满分答案材料

上传人:cn****1 文档编号:511094153 上传时间:2023-09-22 格式:DOCX 页数:5 大小:11.94KB
返回 下载 相关 举报
吉大17春学期数据库应用技术在线作业一满分答案材料_第1页
第1页 / 共5页
吉大17春学期数据库应用技术在线作业一满分答案材料_第2页
第2页 / 共5页
吉大17春学期数据库应用技术在线作业一满分答案材料_第3页
第3页 / 共5页
吉大17春学期数据库应用技术在线作业一满分答案材料_第4页
第4页 / 共5页
吉大17春学期数据库应用技术在线作业一满分答案材料_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《吉大17春学期数据库应用技术在线作业一满分答案材料》由会员分享,可在线阅读,更多相关《吉大17春学期数据库应用技术在线作业一满分答案材料(5页珍藏版)》请在金锄头文库上搜索。

1、吉大17春学期数据库应用技术在线作业一一、单选题(共25道试题,共100分。)1. Given the tables: EMPLOYEDEPTemp_numemp_namedept dept_id dept_name 1 Adams 1 1 Planning 2 Jones 1 2 Support 3 Smith 2 4 Williams 1 and the statement: ALTERTABLE employee ADDFOREIGNKEY(dept) REFERENCESept (dept_id) ONDELETECASCADEiowmany rows will be deleted

2、when the following statement is executed? DELETEFROMemployee WHERE dept=1A. 0B. 1C. 3D. 4正确答案:C2. Given the following code: BEGIN ATOMIC UPDATE country SET cities=:count WHERE CURRENT OF C1; INSERT INTO country VALUES(:co11,:co12,:co13); INSERT INTO country VALUES(:co14,:co15,:co16); INSERT INTO cou

3、ntry VALUES(:co17,:co18,:co19); INSERT INTO country VALUES(:co110,:co111,:co112); COMMIT; END Given that all statements succeed except the following: INSERT INTO country VALUES(:co17,:co18,:co19); How many rows will be affected in table COUNTRY?A. 0B. 3C. 4D. 5正确答案:A3. How many rows can be retrieved

4、 using a single SELECT INTO statement?A. Only one rowB. As many as are in the resultC. As many as are host variables used in the callD. As many as host variable array structures can hold 正确答案:A4 .实体是信息世界中的术语,与之对应的数据库术语为:()A.文件B.数据库C.字段D.记录正确答案:D5 .如果开发人员在AIX操作系统上开发访问后台AS400上的DB2数据库,则需要在 AIX开发环境中安装:(

5、)A. DB2个人开发版(PDEB. DB2通用开发版(UDE正确答案:B6 .关系模型中的关系模式至少是()A. 1NFB. 2NFC. 3NFD. BCNF正确答案:A7 .若用如下的 SQM句创建一个 student 表:CREATETABLEstudent(NO CHAR4) NOT NULL NAMECHAR(8) NOT NULL SEX CHAR(2), AGE NUMBERIC2)可以插入到 student 表中 的是哪一项?A. (1031 ,曾华,男,23)B. (1031 ,曾华,NULL NULLC. (NULL 曾华,男,23)D. (1031 , NULL 男,23

6、)正确答案:B8. 执行下面两条 SQL语句后: CREATETABLE t1 ( c1 char(10) NOTNULL PRIMARYCEY, c2 int, c3 char(10), c4 char(10) NOT NULL, CONSTRAINT c4 UNIQUE (c1,c4) ) /自动创建索引 CREATE INDEX Index1 ON t1 (c2 ASC) 表 t1 上有几个索引?A. 0B. 1C. 2D. 3E. 4正确答案:D9. Given the code: EXECSQLWITHmost_citiesAS ( SELECTb.id, b.name, a.cit

7、ies FROMcountry a, staff b WHERE a.person = b.id AND cities :threshold ) SELECT id, name, cities FROMmost_cities INTO :id, :name, :cities WHEREities IN (SELECT MAX(cities) FROM most_cities) Which of the following can reference MOST_CITIES?A. The current statementB. Statements from any applicationC.

8、All statements within this applicationD. All statements within the current unit of work正确答案:A10. An application uses static SQL to connect to a remote DB2 server and insertsdata into the CUST.ORDERS table on that remote DB2 server. To enable access to theremote DB2 server, FOO needs to create a pack

9、age with default options so that BARis the only non-administrative user that can use this package on the remote DB2server. Which statement describes the privileges that FOO requires to accomplish this?A. FOO requires EXECUTE privilege on the package.B. FOO requires the privilege to create the packag

10、e on the remote DB2 server.C. FOOrequires EXECUTEprivilegeon the package and INSERTprivilege on CUST.ORDERS.D. FOOrequires the privilege to create the package on the remote DB2server and INSERT privilege on CUST.ORDERS.正确答案:D11. Given the table T1 with the following data: COL1IDX - - A single-thread

11、ed CLI application executes the following pseudocode in sequence: SQLAllocHandle( SQL_HANDLE_ENV,ULL, &hEnv ) SQLAllocHandle( SQL_HANDLE_DB(hEnv, &hDbc ) SQLConnect( hDbc, SAMPLE, SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS ) SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON ) SQLAllocHandle

12、( SQL_HANDLE_STMhTD, bc, &hStmt ) SQLExecDirect( hStmt, UPDATEtable1 SET col1=10 WHERidx=1, SQL_NT SQLExecDirect( hStmt, UPDATEtable1 SET col1=20 WHERE idx=2, SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_COMMIT ) SQLExecDirect(hStmt,UPDATE table1SET col1=30WHERE idx=1,SQL_NTS )SQLExecDirect(hStmt

13、,UPDATE table1SET col1=40WHERE idx=1,SQL_NTS )SQLEndTran( SQL_HANDLE_DBCh,Dbc, SQL_ROLLBAC)K SQLExecDirect( hStmt, SELECT col1 FROM table1 WHERE idx=1, SQL_NTS ) Which of the following values for COL1 will be fetched when the sequence for the pseudocode listed above is successfully executed? A. 10B.

14、 20C. 30D. 40 正确答案:D 12.下面哪个工具可以保存终端用户需要存取的元数据? A. Query Management FacilityB. DB2 Query PatrollerC. DB2存储过程构建器 D.信息目录 正确答案:D13. 设有两个事务 T1, T2,其并发操作如下所示:T1 : T2: 1)读A=10, B=5 2)读A=10 3) 读A=20, B=5求和25验证错正确的评价是哪个?A.该操作不存在问题B.该操作丢失修改C.该操作不能重复读D.该操作读“脏”数据 正确答案:C14. 关系规范化中的删除操作异常是指()A.不该删除的数据被删除 B.不该插入的

15、数据被插入 C.应该删除的数据未被删除 D.应该插入的数据未被插入 正确答案:A15. Given the table COUNTRwith the following data: ID NAME PERSON CITIES1 Argentina 1 - and the code: EXEC SQL DECLARE c1 CURSOR FOR SELECT id,name FROM country; EXEC SQL OPEN c1; EXEC SQL FETCH c1 INTO :id,:name; EXEC SQL FETCHc1 INTO :id,:name;Which of the following SQLCODE/SQLSTATEsll be containedin the SQLCA after the last fetch?A. SQLCODE 0, SQLSTATE 00000B. SQLCODE 100, SQLSTATE 02000C. SQLCODE -100, SQLSTATE 00100D. SQLCODE -501, SQLSTATE 24501 正确答案:B16. Given the following code: EXEC SQL EXECUTE IMMEDIATE

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

当前位置:首页 > 办公文档 > 演讲稿/致辞

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