作业辅导网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

作业辅导、毕业论文、学业辅导,请加qq2762169544(微信:2762169544)
查看: 1662|回复: 0
打印 上一主题 下一主题

吉大15春学期《数据库应用技术》在线作业1-2

[复制链接]

4万

主题

4万

帖子

4万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
48442
跳转到指定楼层
楼主
发表于 2015-6-3 19:24:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
需要购买此门答案请加qq2762169544(微信:2762169544)
吉大15春学期《数据库应用技术》在线作业一
试卷总分:100       测试时间:--
单选题  


一、单选题(共 25 道试题,共 100 分。)V 1.  数据操纵语言的基本功能中不包括()
A. 向数据库中插入数据
B. 描述数据库的访问控制
C. 修改数据库中的数据
D. 删除数据库中的数据
      满分:4  分
2.  事务的原子性是指()
A. 事务中包含的所有操作要么都做,要么都不做
B. 事务一旦提交,对数据库的改变是永久性的
C. 一个事务内部的操作及使用的数据对并发的其他事务是隔离的
D. 事务必须是使数据库从一个一致性状态变到另一个一致性状态
      满分:4  分
3.  如果一个用户USER1被授予了表TAB上的CONTROL特权,如果需要限制该用户对表的存取,应使用以下哪条命令?
A. REVOKE ALL ON TAB TO USER1
B. REVOKE ALL ON TAB FROM USER1
C. REVOKE CONTROL ON TAB TO USER1
D. REVOKE CONTROL ON TAB FROM USER1
      满分:4  分
4.  关系模式中各级模式之间的关系为()
A. 3NF包含 2NF包含 1NF
B. 3NF包含 1NF包含 2NF
C. 1NF 包含2NF包含 3NF
D. 2NF包含 1NF 包含3NF
      满分:4  分
5.  给出下面信息: CREATE TABLE tab1 (c1 char(3) WITH DEFAULT NULL, c2 INTEGER); INSERT INTO tab1(c2) VALUES (‘345’); 如果在命令行处理器(CLP)中执行以下语句,以下哪个结果是正确的? SELECT * FROM tab1;
A. C1 C2 --- ----------- 0 record(s) selected.
B. C1 C2 --- ----------- 123 345 1 record(s) selected.
C. C1 C2 --- ----------- 345 1 record(s) selected.
D. C1 C2 --- ----------- - 345 1 record(s) selected.
      满分:4  分
6.  在语句CREATE VIEW EMP_VIEW2 (EMPNO, EMPNAME, DEPTNO, JOBTITLE, HIREDATE) AS SELECT ID, NAME, DEPT, JOB, HIREDATE FROM EMPLOYEE WHERE DEPT=10 WITH CHECK OPTION; 所定义的视图中,当使用INSERT语句时,若新增的行中DEPTNO数值不为10,则该行将被拒绝插入。
A. 正确
B. 错误
      满分:4  分
7.  Given the tables T1 and T2, each containing an integer column COL1: T1 COL1 ----------- 1- 1- 22 T2 COL1 ----------- 1- 2- 22 and the following query that executes successfully: SELECT COUNT(*) FROM t1 RIGHT OUTER JOIN t2 ON t1.col1=t2.col1 How many rows are returned?
A. 1
B. 6
C. 8
D. 36
      满分:4  分
8.  并发控制的主要方法是采用以下哪种机制?
A. 口令
B. 锁
C. 副本
D. 检查点
      满分:4  分
9.  Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?
A. SQLDelete()
B. SQLExecDirect()
C. SQLBulkDelete()
D. SQLExecuteUpdate()
      满分:4  分
10.  游标稳定性(CS,或称光标稳定性)隔离级锁定工作单元期间光标所在的任何行。对该行的锁定将()
A. . 不保持
B. . 保持到取出下一行记录或整个工作单元终止。
C. . 保持到整个工作单元终止。
      满分:4  分
11.  Given the expression: WITH most_cities AS ( SELECT b.id,b.name,a.cities FROM country a, staff b WHERE a.person = b.id AND cities > :threshold ) SELECT * FROM most_cities In which of the following does MOST_CITIES exist?
A. user tables
B. server memory
C. user table space
D. system catalog tables
      满分:4  分
12.  Which of the following privileges is required to successfully execute a Java stored procedure that uses JDBC to update several different tables?
A. The user must have UPDATE privilege on the referenced tables.
B. The developer must have EXECUTE privilege on the stored procedure.
C. The user must have UPDATE privilege on the referenced tables and EXECUTE privilege on the stored procedure.
D. The developer must have UPDATE privilege on the referenced tables and EXECUTE privilege on the stored procedure.
      满分:4  分
13.  The following commands are issued against a data source containing table user2.org: CREATE ALIAS user1.org FOR sample.org CREATE TABLE org.sample ( c CHAR(1)) CREATE ALIAS sample.org FOR user2.org CREATE ALIAS user2.sample FOR sample.org Given the user SAMPLE issues the following statement: SELECT * FROM sample For which of the following database objects will access be attempted?
A. user2.org
B. org.sample
C. sample.org
D. sample.sample
      满分:4  分
14.  下述关于数据库系统的正确叙述是()
A. 数据库中只存在数据项之间的联系
B. 数据库的数据项之间和记录之间都存在联系
C. 数据库的数据项之间无联系,记录之间存在联系
D. 数据库的数据项之间和记录之间都不存在联系
      满分:4  分
15.  An ODBC/CLI application has the following pseudocode: SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc ) SQLConnect( hDbc, "CERTDB", SQL_NTS, "user1", SQL_NTS, "passwd", SQL_NTS ) SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) SQLExecDirect( hStmt, "SET CURRENT SQLID db2cert", SQL_NTS ) Assuming all of the above calls execute successfully, which of the following fully qualified SQL statements is equivalent to: SQLExecDirect( hStmt, "SELECT * FROM user1.table1 t1, table2 t2 WHERE t1.col1=t2.col2", SQL_NTS )
A. SQLExecDirect( hStmt, "SELECT * FROM user1.table1 t1, table2 t2 WHERE t1.col1=t2.col2", SQL_NTS )
B. . SQLExecDirect( hStmt, "SELECT * FROM user1.table1 t1, user1.table2 t2 WHERE t1.col1=t2.col2", SQL_NTS )
C. . SQLExecDirect( hStmt, "SELECT * FROM user1.table1 t1, db2cert.table2 t2 WHERE t1.col1=t2.col2", SQL_NTS )
D. . SQLExecDirect( hStmt, "SELECT * FROM db2cert.table1 t1, db2cert.table2 t2 WHERE t1.col1=t2.col2", SQL_NTS )
      满分:4  分
16.  设有两个事务T1,T2,其并发操作如下所示: T1: T2: 1) 读A=10,B=5 2) 读A=10 3) 读A=20,B=5 求和25 验证错正确的评价是哪个?
A. 该操作不存在问题
B. 该操作丢失修改
C. 该操作不能重复读
D. 该操作读“脏”数据
      满分:4  分
17.  Given the application code: EXEC SQL DECLARE cur CURSOR WITH HOLD FOR SELECT c1 FROM t1 EXEC SQL OPEN cur EXEC SQL FETCH cur INTO :hv /* Statement 1 */ EXEC SQL COMMIT /* Statement 2 */ EXEC SQL FETCH cur INTO :hv /* Statement 3 */ EXEC SQL ROLLBACK /* Statement 4 */ EXEC SQL CLOSE cur /* Statement 5 */ If the table T1 has no rows in it, which statement will cause the cursor "cur" to be closed first?
A. Statement 1
B. Statement 2
C. Statement 3
D. Statement 4
      满分:4  分
18.  Given the table T1, created using the following statement: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (2, 'def') INSERT INTO t1 VALUES (DEFAULT, 'abc') INSERT INTO t1 VALUES (DEFAULT, 'ghi') Which of the following represents the order in which the values are returned from the following SELECT statement? SELECT id FROM t1 ORDER BY id
A. 1, 2, 2
B. 1, 2, 3
C. 2, 3, 4
D. 0, 1, 2
      满分:4  分
19.  Given the code: EXEC SQL WITH most_cities AS ( SELECT b.id, b.name, a.cities FROM country a, staff b WHERE a.person = b.id AND cities > :threshold ) SELECT id, name, cities FROM most_cities INTO :id, :name, :cities WHERE cities IN (SELECT MAX(cities) FROM most_cities) Which of the following can reference MOST_CITIES?
A. The current statement
B. Statements from any application
C. All statements within this application
D. All statements within the current unit of work
      满分:4  分
20.  Given the table T1 with the following data: C1 --- ABC DE and the application code: EXEC SQL DECLARE cur1 CURSOR WITH HOLD FOR SELECT c1 FROM t1 ORDER BY c1 EXEC SQL DECLARE cur2 CURSOR WITH HOLD FOR SELECT c1 FROM t1 ORDER by c1 EXEC SQL OPEN cur1 EXEC SQL OPEN cur2 EXEC SQL FETCH cur1 INTO :hv EXEC SQL FETCH cur1 INTO :hv EXEC SQL FETCH cur2 INTO :hv EXEC SQL COMMIT EXEC SQL FETCH cur2 INTO :hv EXEC SQL FETCH cur2 INTO :hv EXEC SQL FETCH cur1 INTO :hv EXEC SQL CLOSE cur2 EXEC SQL CLOSE cur1 What is the final content of the host variable "hv"?
A. A
B. B
C. C
D. D
      满分:4  分
21.  Which of the following database resources can be freed when a unit of work is committed?
A. row locks
B. cursor names
C. buffer pools
D. cursors WITH HOLD
      满分:4  分
22.  关系规范化中的删除操作异常是指()
A. 不该删除的数据被删除
B. 不该插入的数据被插入
C. 应该删除的数据未被删除
D. 应该插入的数据未被插入
      满分:4  分
23.  If a stored procedure returns multiple rows, which of the following must the calling application use to access the result set?
A. A cursor
B. A select statement
C. A declared temporary table
D. A table user-defined function
      满分:4  分
24.  使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?
A. UNIQUE
B. ALL
C. EXCEPT
D. DISTINCT
      满分:4  分
25.  在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。
A. SERVER_ENCRYPT
B. DCE
C. DCE_SERVER_ENCRYPT
D. KERBEROS
      满分:4  分
吉大15春学期《数据库应用技术》在线作业二
试卷总分:100       测试时间:--
单选题  


一、单选题(共 25 道试题,共 100 分。)V 1.  Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?
A. SQLDelete()
B. SQLExecDirect()
C. SQLBulkDelete()
D. SQLExecuteUpdate()
      满分:4  分
2.  如果想在数据导入的过程中创建表,应该
A. 使用IXF文件格式进行LOAD
B. 使用WSF文件格式进行LOAD
C. 使用IXF文件格式进行IMPORT
D. 使用WSF文件格式进行IMPORT
      满分:4  分
3.  Given the tables T1 and T2, each containing an integer column COL1: T1 COL1 ----------- 1- 1- 22 T2 COL1 ----------- 1- 2- 22 and the following query that executes successfully: SELECT COUNT(*) FROM t1 RIGHT OUTER JOIN t2 ON t1.col1=t2.col1 How many rows are returned?
A. 1
B. 6
C. 8
D. 36
      满分:4  分
4.  执行下面两条SQL语句后: CREATE TABLE t1 ( c1 char(10) NOT NULL PRIMARY KEY, c2 int, c3 char(10), c4 char(10) NOT NULL, CONSTRAINT c4 UNIQUE (c1,c4) ) //自动创建索引 CREATE INDEX Index1 ON t1 (c2 ASC) 表t1上有几个索引?
A. 0
B. 1
C. 2
D. 3
E. 4
      满分:4  分
5.  并发控制的主要方法是采用以下哪种机制?
A. 口令
B. 锁
C. 副本
D. 检查点
      满分:4  分
6.  给定三个表:学生表S,课程表C和学生选课表SC,它们的结构分别如下: S(S#,SN,SEX,AGE,DEPT) C(C#,CN) SC(S#,C#,GRADE)其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号,CN为课程名,GRADE为成绩。检索选修课程“C2”的学生中成绩最高的学生的学号,正确的SELECT语句是哪个?
A. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)
B. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”)
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)
D. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”)
      满分:4  分
7.  游标稳定性(CS,或称光标稳定性)隔离级锁定工作单元期间光标所在的任何行。对该行的锁定将()
A. . 不保持
B. . 保持到取出下一行记录或整个工作单元终止。
C. . 保持到整个工作单元终止。
      满分:4  分
8.  Given the tables: COUNTRY id name 1 Argentina 3 Cuba 4 - NATION id name 2 Belgium 4 USA and the code: EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM country WHERE name IS NOT NULL UNION SELECT * FROM nation EXEC SQL OPEN C1 How many rows are in the result set?
A. 1
B. 2
C. 3
D. 4
      满分:4  分
9.  定义基本表时,若要求某一列的值不能为空,则应在定义时使用什么保留字?但如果该列是主键,则可省写。
A. NULL
B. NOT NULL
C. DISTINCT
D. UNIQUE
      满分:4  分
10.  Given the code: EXEC SQL WITH most_cities AS ( SELECT b.id, b.name, a.cities FROM country a, staff b WHERE a.person = b.id AND cities > :threshold ) SELECT id, name, cities FROM most_cities INTO :id, :name, :cities WHERE cities IN (SELECT MAX(cities) FROM most_cities) Which of the following can reference MOST_CITIES?
A. The current statement
B. Statements from any application
C. All statements within this application
D. All statements within the current unit of work
      满分:4  分
11.  如果一个用户USER1被授予了表TAB上的CONTROL特权,如果需要限制该用户对表的存取,应使用以下哪条命令?
A. REVOKE ALL ON TAB TO USER1
B. REVOKE ALL ON TAB FROM USER1
C. REVOKE CONTROL ON TAB TO USER1
D. REVOKE CONTROL ON TAB FROM USER1
      满分:4  分
12.  下述关于数据库系统的正确叙述是()
A. 数据库中只存在数据项之间的联系
B. 数据库的数据项之间和记录之间都存在联系
C. 数据库的数据项之间无联系,记录之间存在联系
D. 数据库的数据项之间和记录之间都不存在联系
      满分:4  分
13.  给定三个表:学生表S,课程表C和学生选课表SC,它们的结构分别如下: S(S#,SN,SEX,AGE,DEPT) C(C#,CN) SC(S#,C#,GRADE)其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程 号,CN为课程名,GRADE为成绩。 对表SC建立如下视图: CREATE VIEW S_GRADE(S#,C_NUM,AVG_GRADE) AS SELECT S#,COUNT(C#),AVG(GRADE) FROM SC GROUP BY S#; 判断下面查询是否允许执行,如允许,写出转换到基本表SC上的操作。 SELECT S#,C_NUM FROM S_GRADE WHERE AVG_GRADE>80
A. 不允许查询。因为视图中使用了分组和聚合函数。
B. 允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC WHERE AVG(GRADE)>80
C. 允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC GROUP BY S# HAVING AVG(GRADE)>80
D. 允许。对应的操作为: SELECT S#, COUNT(C#) FROM SC HAVING AVG(GRADE)>80
      满分:4  分
14.  Given the table COUNTRY with the following data: ID NAME PERSON CITIES -- ---- ------ ------ 1 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 FETCH c1 INTO :id,:name; Which of the following SQLCODE/SQLSTATEs will be contained in the SQLCA after the last fetch?
A. SQLCODE 0, SQLSTATE 00000
B. SQLCODE 100, SQLSTATE 02000
C. SQLCODE -100, SQLSTATE 00100
D. SQLCODE -501, SQLSTATE 24501
      满分:4  分
15.  据库系统和文件系统的主要区别是:
A. 数据库系统复杂,而文件系统简单。
B. 文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决。
C. 文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件。
D. 文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量。
      满分:4  分
16.  An application uses embedded dynamic SQL to connect to a remote DB2 server and inserts data into the CUST.ORDERS table on that remote DB2 server. To enable access of the remote DB2 server, Administrator FOO needs to create a package with default options such that BAR is the only non-administrative user that can use this package on the remote DB2 server. Which statement describes the privileges that must be granted and/or revoked by FOO to accomplish this?
A. BAR requires EXECUTE privilege on the package and UPDATE privilege on CUST.ORDERS, and the EXECUTE privilege for the package must be revoked from PUBLIC.
B. BAR requires EXECUTE privilege on the package and INSERT privilege on CUST.ORDERS, and the EXECUTE privilege for the package must be revoked from PUBLIC.
C. BAR requires EXECUTE privilege on the package and INSERT privilege on CUST.ORDERS, and the REFERENCES privilege for the package must be revoked from PUBLIC.
D. BAR requires EXECUTE privilege on the package and UPDATE privilege on CUST.ORDERS, and the REFERENCES privilege for the package must be revoked from PUBLIC.
      满分:4  分
17.  当数据库遭到破坏时,为了能迅速恢复,在进行事务处理过程中将对数据库更新的全部内容写入以下哪项?
A. 副本文件
B. 日志文件
C. 检查点文件
D. 死锁文件
      满分:4  分
18.  Given the code: EXEC SQL DECLARE cursor1 CURSOR FOR SELECT name,age,b_date FROM person; EXEC SQL OPEN cursor1; Under which of the following situations will the above cursor be implicitly closed?
A. When a CLOSE statement is issued
B. When a COMMIT statement is issued
C. When there are no rows in the result set
D. When all rows are FETCHed from the result set
      满分:4  分
19.  Given the table T1 with the following data: COL1 IDX ---- ---- A single-threaded CLI application executes the following pseudocode in sequence: SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv ) SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc ) SQLConnect( hDbc, "SAMPLE", SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS ) SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON ) SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=10 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=20 WHERE idx=2", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_COMMIT ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=30 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=40 WHERE idx=1", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_ROLLBACK ) 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. 10
B. 20
C. 30
D. 40
      满分:4  分
20.  Which of the following is a benefit of user-defined functions?
A. Improves application concurrency
B. Improves blocking of result sets
C. Simplifies application maintenance
D. Reduces memory requirements on the server
      满分:4  分
21.  If a stored procedure returns multiple rows, which of the following must the calling application use to access the result set?
A. A cursor
B. A select statement
C. A declared temporary table
D. A table user-defined function
      满分:4  分
22.  Given an ODBC/CLI program with a single connection, two threads and the following actions which complete successfully: Thread 1: INSERT INTO mytab VALUES (1) Thread 2: INSERT INTO mytab VALUES (2) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (3) Thread 1: ROLLBACK Thread 2: COMMIT How many records will be inserted and retained in the table MYTAB?
A. 0
B. 1
C. 2
D. 3
      满分:4  分
23.  在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?
A. ORDER BY子句
B. WHERE子句
C. GROUP BY子句
D. 均不需要
      满分:4  分
24.  Under which of the following situations must dynamic SQL be used?
A. When temporary table references exist at compile time
B. When the host variables' values are unknown at compile time
C. When the columns in the SELECT clause are unknown at compile time
D. When the number of rows being returned are unknown at compile time
      满分:4  分
25.  对于那些需要偶尔连接到公司数据上进行数据交换的用户可选择哪种版本的DB2?对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A. 企业版
B. 工作组版
C. 企业扩展版
D. 个人版
E. 卫星版
      满分:4  分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
需要购买此门答案请加qq2762169544(微信:2762169544)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作业辅导、毕业论文、学业辅导,考试辅导资料,请加qq2762169544(微信:2762169544)

Archiver|手机版|小黑屋|作业辅导网  

GMT+8, 2024-11-28 11:58 , Processed in 0.051650 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表