吉大15春学期《数据库应用技术》在线作业一一、单选题(共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 USER1B. REVOKE ALL ON TAB FROM USER1C. REVOKE CONTROL ON TAB TO USER1D. REVOKE CONTROL ON TAB FROM USER1满分:4 分4. 关系模式中各级模式之间的关系为()A. 3NF包含2NF包含1NFB. 3NF包含1NF包含2NFC. 1NF 包含2NF包含3NFD. 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. 1B. 6C. 8D. 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 ( SELECTb.id,,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 tablesB. server memoryC. user table spaceD. 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 containingtable : CREATE ALIAS FOR CREATE TABLE org.sample ( c CHAR(1)) CREATE ALIAS FOR CREATE ALIAS user2.sample FOR Given the user SAMPLE issues the following statement: SELECT * FROM sample For which of the following database objects will access be attempted?A. B. org.sampleC. 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 1B. Statement 2C. Statement 3D. Statement 4满分:4 分18. Given the table T1, created using the following statement: CREATETABLE 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 idA. 1, 2, 2B. 1, 2, 3C. 2, 3, 4D. 0, 1, 2满分:4 分19. Given the code: EXEC SQL WITH most_cities AS ( SELECT b.id,, 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 statementB. Statements from any applicationC. All statements within this applicationD. 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. AB. BC. CD. D满分:4 分21. Which of the following database resources can be freed when a unitof work is committed?A. row locksB. cursor namesC. buffer poolsD. 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 cursorB. A select statementC. A declared temporary tableD. A table user-defined function满分:4 分24. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?A. UNIQUEB. ALLC. EXCEPTD. DISTINCT满分:4 分25. 在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。