------------------------------------------------------------------------------------------------------------------------------ (单选题) 1: How many rows can be retrieved using a single SELECT INTO statement? A: Only one row
B: As many as are in the result
C: As many as are host variables used in the call
D: As many as host variable array structures can hold
正确答案:
(单选题) 2: 在数据库中存储的是:()
A: 数据
B: 数据模型
C: 数据以及数据之间的联系
D: 信息
正确答案:
(单选题) 3: 在语句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: 下面哪个工具可以帮助用户对语句性能进行分析?
A: 可视化解释工具
B: 性能监视器
C: 命令行处理器
D: 控制中心
正确答案:
(单选题) 5: 定义基本表时,若要求某一列的值不能为空,则应在定义时使用什么保留字?但如果该列是主键,则可省写。
A: NULL
B: NOT NULL
C: DISTINCT
D: UNIQUE
正确答案:
(单选题) 6: 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
正确答案:
(单选题) 7: 向基本表增加一个新列后,原有元组在该列上的值为什么?
------------------------------------------------------------------------------------------------------------------------------ A: TRUE
B: FALSE
C: 空值
D: 不确定
正确答案:
(单选题) 8: 据库系统和文件系统的主要区别是:
A: 数据库系统复杂,而文件系统简单。
B: 文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决。
C: 文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件。
D: 文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量。
正确答案:
(单选题) 9: 事务的原子性是指()
A: 事务中包含的所有操作要么都做,要么都不做
B: 事务一旦提交,对数据库的改变是永久性的
C: 一个事务内部的操作及使用的数据对并发的其他事务是隔离的
D: 事务必须是使数据库从一个一致性状态变到另一个一致性状态
正确答案:
(单选题) 10: The following commands are issued against a data source containing table https://www.doczj.com/doc/045603227.html,: CREATE ALIAS https://www.doczj.com/doc/045603227.html, FOR https://www.doczj.com/doc/045603227.html, CREATE TABLE org.sample ( c CHAR(1)) CREATE ALIAS https://www.doczj.com/doc/045603227.html, FOR https://www.doczj.com/doc/045603227.html, CREATE ALIAS user2.sample FOR https://www.doczj.com/doc/045603227.html, Given the user SAMPLE issues the following statement: SELECT * FROM sample For which of the following database objects will access be attempted?
A: https://www.doczj.com/doc/045603227.html,
B: org.sample
C: https://www.doczj.com/doc/045603227.html,
D: sample.sample
正确答案:
(单选题) 11: 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?A: ORDER BY子句
B: WHERE子句
C: GROUP BY子句
D: 均不需要
正确答案:
(单选题) 12: 如果选用循环日志方式,辅助日志文件何时分配?
A: 数据库建立的时候
B: 数据库服务器启动的时候
C: 需要的时候
D: 以上都不对
正确答案:
(单选题) 13: A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
A: The cursor will remain open after a COMMIT.
B: All rows retrieved are locked until a COMMIT.
------------------------------------------------------------------------------------------------------------------------------ C: A COMMIT will not be allowed until the cursor is closed.
D: Locks obtained by the cursor will be kept after a COMMIT.
正确答案:
(单选题) 14: 在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。
A: SERVER_ENCRYPT
B: DCE
C: DCE_SERVER_ENCRYPT
D: KERBEROS
正确答案:
(单选题) 15: 发人员开发访问后台AIX上的DB2的windows程序,需要在windows开发平台上安装:
A: DB2运行时间客户端
B: DB2管理客户端
C: DB2应用程序开发客户端
D: DB2瘦客户端
正确答案:
(单选题) 16: 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A: 企业版
B: 工作组版
C: 企业扩展版
D: 个人版
E: 卫星版
F: 微型版
正确答案:
(单选题) 17: 给定三个表:学生表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
正确答案:
(单选题) 18: Given the tables: COUNTRY STAFF id name person cities id name 1 Argentina 1 10 1 Aaron 2 Canada 2 20 2 Adams 3 Cuba 2 10 3 Jones 4 Germany 1 0 5 France 3 5 6 Italy 1 5 the report: id name number_of_countries ---------- ---------- ------------------- 1 Aaron 3 and the SQL statement: SELECT B.id,https://www.doczj.com/doc/045603227.html,,COUNT(DISTINCT https://www.doczj.com/doc/045603227.html,) AS number_of_countries FROM country A, staff B WHERE B.id=A.person GROUP BY B.id,https://www.doczj.com/doc/045603227.html, HAVING COUNT(DISTINCT https://www.doczj.com/doc/045603227.html,)>:count_var
------------------------------------------------------------------------------------------------------------------------------ Which of the following values does :count_var require to print out the above report? A: 1
B: 2
C: 3
D: 4
正确答案:
(单选题) 19: 如果想在数据导入的过程中创建表,应该
A: 使用IXF文件格式进行LOAD
B: 使用WSF文件格式进行LOAD
C: 使用IXF文件格式进行IMPORT
D: 使用WSF文件格式进行IMPORT
正确答案:
(单选题) 20: 给出下面信息: 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.
正确答案:
(单选题) 21: 嵌入式SQL语句中引用共享变量时,必须在变量名前加什么标志?
A: 号
B: 分号
C: 句号
D: 冒号
正确答案:
(单选题) 22: To prepare an embedded SQL program for use with a host-language compiler, which of the following database components is required?
A: Binder
B: Precompiler
C: Stored Procedure Builder
D: Application Development Center
正确答案:
(单选题) 23: Given the EMPLOYEE table definition: CREATE TABLE employee ( workdept CHAR(30), salary INTEGER ) Which of the following is a correct usage of parameter markers in a JDBC program?
A: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
B: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
C: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
D: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement
------------------------------------------------------------------------------------------------------------------------------ stmt=con.createStatement(sql);
正确答案:
(单选题) 24: 当FROM子句中出现多个基本表或视图时,系统将执行什么操作?
A: 并
B: 等值联接
C: 自然联接
D: 笛卡儿积
正确答案:
(单选题) 25: Given the expression: WITH most_cities AS ( SELECT b.id,https://www.doczj.com/doc/045603227.html,,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
正确答案:
(单选题) 1: How many rows can be retrieved using a single SELECT INTO statement? A: Only one row
B: As many as are in the result
C: As many as are host variables used in the call
D: As many as host variable array structures can hold
正确答案:
(单选题) 2: 在数据库中存储的是:()
A: 数据
B: 数据模型
C: 数据以及数据之间的联系
D: 信息
正确答案:
(单选题) 3: 在语句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: 下面哪个工具可以帮助用户对语句性能进行分析?
A: 可视化解释工具
B: 性能监视器
C: 命令行处理器
D: 控制中心
正确答案:
(单选题) 5: 定义基本表时,若要求某一列的值不能为空,则应在定义时使用什么保留字?但如果该列是主键,则可省写。
------------------------------------------------------------------------------------------------------------------------------ A: NULL
B: NOT NULL
C: DISTINCT
D: UNIQUE
正确答案:
(单选题) 6: 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
正确答案:
(单选题) 7: 向基本表增加一个新列后,原有元组在该列上的值为什么?
A: TRUE
B: FALSE
C: 空值
D: 不确定
正确答案:
(单选题) 8: 据库系统和文件系统的主要区别是:
A: 数据库系统复杂,而文件系统简单。
B: 文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决。
C: 文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件。
D: 文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量。
正确答案:
(单选题) 9: 事务的原子性是指()
A: 事务中包含的所有操作要么都做,要么都不做
B: 事务一旦提交,对数据库的改变是永久性的
C: 一个事务内部的操作及使用的数据对并发的其他事务是隔离的
D: 事务必须是使数据库从一个一致性状态变到另一个一致性状态
正确答案:
(单选题) 10: The following commands are issued against a data source containing table https://www.doczj.com/doc/045603227.html,: CREATE ALIAS https://www.doczj.com/doc/045603227.html, FOR https://www.doczj.com/doc/045603227.html, CREATE TABLE org.sample ( c CHAR(1)) CREATE ALIAS https://www.doczj.com/doc/045603227.html, FOR https://www.doczj.com/doc/045603227.html, CREATE ALIAS user2.sample FOR https://www.doczj.com/doc/045603227.html, Given the user SAMPLE issues the following statement: SELECT * FROM sample For which of the following database objects will access be attempted?
A: https://www.doczj.com/doc/045603227.html,
B: org.sample
C: https://www.doczj.com/doc/045603227.html,
D: sample.sample
正确答案:
------------------------------------------------------------------------------------------------------------------------------ (单选题) 11: 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?A: ORDER BY子句
B: WHERE子句
C: GROUP BY子句
D: 均不需要
正确答案:
(单选题) 12: 如果选用循环日志方式,辅助日志文件何时分配?
A: 数据库建立的时候
B: 数据库服务器启动的时候
C: 需要的时候
D: 以上都不对
正确答案:
(单选题) 13: A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
A: The cursor will remain open after a COMMIT.
B: All rows retrieved are locked until a COMMIT.
C: A COMMIT will not be allowed until the cursor is closed.
D: Locks obtained by the cursor will be kept after a COMMIT.
正确答案:
(单选题) 14: 在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。
A: SERVER_ENCRYPT
B: DCE
C: DCE_SERVER_ENCRYPT
D: KERBEROS
正确答案:
(单选题) 15: 发人员开发访问后台AIX上的DB2的windows程序,需要在windows开发平台上安装:
A: DB2运行时间客户端
B: DB2管理客户端
C: DB2应用程序开发客户端
D: DB2瘦客户端
正确答案:
(单选题) 16: 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A: 企业版
B: 工作组版
C: 企业扩展版
D: 个人版
E: 卫星版
F: 微型版
正确答案:
(单选题) 17: 给定三个表:学生表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
正确答案:
(单选题) 18: Given the tables: COUNTRY STAFF id name person cities id name 1 Argentina 1 10 1 Aaron 2 Canada 2 20 2 Adams 3 Cuba 2 10 3 Jones 4 Germany 1 0 5 France 3 5 6 Italy 1 5 the report: id name number_of_countries ---------- ---------- ------------------- 1 Aaron 3 and the SQL statement: SELECT B.id,https://www.doczj.com/doc/045603227.html,,COUNT(DISTINCT https://www.doczj.com/doc/045603227.html,) AS number_of_countries FROM country A, staff B WHERE B.id=A.person GROUP BY B.id,https://www.doczj.com/doc/045603227.html, HAVING COUNT(DISTINCT https://www.doczj.com/doc/045603227.html,)>:count_var Which of the following values does :count_var require to print out the above report? A: 1
B: 2
C: 3
D: 4
正确答案:
(单选题) 19: 如果想在数据导入的过程中创建表,应该
A: 使用IXF文件格式进行LOAD
B: 使用WSF文件格式进行LOAD
C: 使用IXF文件格式进行IMPORT
D: 使用WSF文件格式进行IMPORT
正确答案:
(单选题) 20: 给出下面信息: 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.
正确答案:
(单选题) 21: 嵌入式SQL语句中引用共享变量时,必须在变量名前加什么标志?
A: 号
B: 分号
C: 句号
D: 冒号
正确答案:
(单选题) 22: To prepare an embedded SQL program for use with a host-language compiler,
------------------------------------------------------------------------------------------------------------------------------ which of the following database components is required?
A: Binder
B: Precompiler
C: Stored Procedure Builder
D: Application Development Center
正确答案:
(单选题) 23: Given the EMPLOYEE table definition: CREATE TABLE employee ( workdept CHAR(30), salary INTEGER ) Which of the following is a correct usage of parameter markers in a JDBC program?
A: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
B: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
C: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
D: String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
正确答案:
(单选题) 24: 当FROM子句中出现多个基本表或视图时,系统将执行什么操作?
A: 并
B: 等值联接
C: 自然联接
D: 笛卡儿积
正确答案:
(单选题) 25: Given the expression: WITH most_cities AS ( SELECT b.id,https://www.doczj.com/doc/045603227.html,,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
正确答案: