吉大20年3月《数据库应用技术》作业考核试题题目
试卷总分:100 得分:100
一、单选题 (共 25 道试题,共 100 分)
1.How many rows can be retrieved using a single SELECT INTO statement?
A.Only one row
B.As many as host variable array structures can hold
C.As many as are in the result
D.As many as are host variables used in the call
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.UNIQUE
B.NULL
C.NOT NULL
D.DISTINCT
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.3
B.2
C.1
D.0
7.向基本表增加一个新列后,原有元组在该列上的值为什么?
A.空值
B.不确定
C.TRUE
D.FALSE
8.据库系统和文件系统的主要区别是:
A.文件系统管理的数据量较少,而数据库系统可以管理庞大的数据量。
B.文件系统只能管理程序文件,而数据库系统能够管理各种类型的文件。
C.文件系统不能解决数据冗余和数据独立性问题,而数据库系统可以解决。
D.数据库系统复杂,而文件系统简单。
9.事务的原子性是指()
A.事务必须是使数据库从一个一致性状态变到另一个一致性状态
B.事务中包含的所有操作要么都做,要么都不做
C.事务一旦提交,对数据库的改变是永久性的
D.一个事务内部的操作及使用的数据对并发的其他事务是隔离的
10.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.sample.sample
C.sample.org
D.org.sample
11.在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?
A.均不需要
B.WHERE子句
C.ORDER BY子句
D.GROUP BY子句
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.Locks obtained by the cursor will be kept after a COMMIT.
C.All rows retrieved are locked until a COMMIT.
D.A COMMIT will not be allowed until the cursor is closed.
14.在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。
A.SERVER_ENCRYPT
B.KERBEROS
C.DCE_SERVER_ENCRYPT
D.DCE
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.允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC WHERE AVG(GRADE)>80
B.允许。对应的操作为: SELECT S#, COUNT(C#) FROM SC HAVING AVG(GRADE)>80
C.允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC GROUP BY S# HAVING AVG(GRADE)>80
D.不允许查询。因为视图中使用了分组和聚合函数。
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,B.name,COUNT(DISTINCT A.name) AS number_of_countries FROM country A, staff B WHERE B.id=A.person GROUP BY B.id,B.name HAVING COUNT(DISTINCT A.name)>:count_var Which of the following values does :count_var require to print out the above report?
A.4
B.3
C.2
D.1
19.如果想在数据导入的过程中创建表,应该
A.使用WSF文件格式进行LOAD
B.使用WSF文件格式进行IMPORT
C.使用IXF文件格式进行LOAD
D.使用IXF文件格式进行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 — ———– 345 1 record(s) selected.
B.C1 C2 — ———– 123 345 1 record(s) selected.
C.C1 C2 — ———– 0 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.Stored Procedure Builder
B.Precompiler
C.Binder
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,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 table space
B.user tables
C.system catalog tables
D.server memory