|
一、单选题(共 25 道试题,共 100 分。)V 1. 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?0 i3 N g. D+ I9 p7 q' s! F6 ]
A. ORDER BY子句
& J! m" I# P8 Q/ LB. WHERE子句! {# Q; D6 y) O, s, {8 U% x
C. GROUP BY子句& \6 ~" |- z7 r* ^/ @* ?9 j/ }
D. 均不需要: G9 S0 y: k% t7 |# I; {2 y
满分:4 分
~+ @' F9 e% r( L4 w3 G2. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?% v8 K4 r# `4 k4 y# o
A. The cursors are unambiguous.
$ V& I) A" s( m/ d! l0 cB. Only the first row is returned./ b7 K: K, b: v s# w$ e0 B" @9 U
C. Cursor stays open after a commit.
7 c/ v9 M r0 d" f! B" d8 |" C" ID. A temporary table is created on the server.( c* l3 L$ f1 R( G; ^0 v
满分:4 分
( P9 W+ E7 z% n2 W, f3. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?5 |! E2 ~$ b5 \
A. 企业版) M; U6 e) x) n1 N% P: N2 |
B. 工作组版
% ]4 \4 L( i) ]& LC. 企业扩展版
' L9 {) P/ W9 a0 @6 s+ J5 t2 AD. 个人版5 E. A( l( J' g0 _8 B$ |
E. 卫星版
; L5 Q6 s/ q) ?; P& F, ZF. 微型版$ y) L1 v7 z7 m5 z0 E
满分:4 分5 }* s2 f. K4 p$ l
4. 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?
& \1 w: r4 ^: EA. user2.org
2 i! B9 l" W0 g: rB. org.sample
) S* c4 `# Z9 o4 m& U1 oC. sample.org
/ w D5 `) |9 B# g+ Y6 JD. sample.sample$ T. C$ h# Z6 q9 }! x
满分:4 分, E! Q- C% ]' C* ]+ d& o, M
5. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
) d, [3 \* ~, `! Q4 H7 s$ d! X! b) bA. The cursor will remain open after a COMMIT.; @2 O, \& \3 |- R4 q
B. All rows retrieved are locked until a COMMIT.
4 ]/ X$ T/ t# r% B# |) b9 AC. A COMMIT will not be allowed until the cursor is closed.- T ^9 X7 ^2 _3 w
D. Locks obtained by the cursor will be kept after a COMMIT.
& Y) k5 m- M) S0 e. X3 T3 ^3 [! O 满分:4 分+ N- N2 ~; q( n; w. m
6. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?
% n: b; D/ ?7 e& R0 } ^* rA. NIQUE
- W/ V6 a) {* jB. ALL7 l1 ^* }: P- V* { E9 c
C. EXCEPT
' Q+ a" i+ |( C6 C6 rD. DISTINCT
, \3 j# ?5 C+ D% J0 k+ m G 满分:4 分7 t. d1 }+ @: V! r! J; k# t2 U+ n" O
7. 如果用户在SQL语句中没有指定数据库对象的SCHEMA,则其缺省的SCHEMA是:
/ p7 ?; f3 z3 u G8 i, fA. SYSIBM$ y$ w+ G" s8 a; L
B. SYSCAT' c* D% n' r9 ?2 s
C. SYSSTAT6 E: N# } s0 N
D. 该用户连接到数据库时所使用的用户名" I; J1 J- r7 I7 v- ^3 b
E. 以上都不对
- G% p; m) V# Z" o* D0 q2 f 满分:4 分
( `* m5 R; [) i4 H7 ]( ^8. 数据库系统的并发控制的主要方法是采用()制。! C* R% P2 S! a
A. 拒绝
% i( ^3 N2 h4 l7 f1 {' m6 _4 QB. 改为串行
2 a2 y- }/ f8 Q m; BC. 锁" U, V6 f5 w3 i, g# U
D. 不加任何控制
0 x2 G4 f! d( y) K, V! f 满分:4 分$ P" t5 C) J% E" l
9. 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?' D6 D% X/ ~+ U! c
A. user tables
9 \. C) h9 e0 {, e8 U( yB. server memory
, I: Y9 g! x1 b; p( J( Q" FC. user table space5 ~6 V( v& ?$ B8 A# b5 b
D. system catalog tables! u+ h" w7 I2 K% w
满分:4 分1 r1 A. g/ G( Q& R5 X0 U
10. 关系模式中各级模式之间的关系为()
. Q1 Y# {& n7 a& r: qA. 3NF 2NF 1NF3 ?8 ^, L' ~; t, z9 y6 r' p
B. 3NF 1NF 2NF
. f8 P) z9 L0 F3 x( [( _$ q* tC. 1NF 2NF 3NF
. ]: Z$ x0 O! T/ B/ {D. 2NF 1NF 3NF1 [$ J8 `# D4 F
满分:4 分 ]; e1 P$ \ S( g2 |( o# d- a
11. 创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?- D- y/ d( d* t- c
A. 目录
' V+ F9 p# R+ d% SB. 文件
; D0 J3 T+ o' l0 z+ D. P- UC. DEVICE' n; Z* b3 B; t5 i3 x6 G
满分:4 分
8 X3 {/ x7 u5 }+ f) ^2 {& W, J12. 执行下面两条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上有几个索引?
) D! H' H s% n# N4 ?A. 0
+ @, c/ C! y# O& H( i2 s! q8 cB. 1
% t/ R' t7 E: F4 LC. 2
2 x. r3 y+ y/ U! A9 e& yD. 3
1 h- ?1 f0 ]/ lE. 4! ?( s u. ^ q# e" B7 m
满分:4 分
6 G5 P G) h% F13. 缺省的数据库日志文件的类型是:5 ~( i; f8 C5 @" i, S! i
A. Circular Log7 Z0 c6 ?6 H8 H
B. Archival Log' {- W1 @! o" ?! i
C. Primary Log1 Y4 F1 i, U2 l! } g
D. Secondary log: H/ O. m: f. g1 D% I9 _5 `+ K, ^
满分:4 分
" ?1 A$ |5 d2 m+ c" `14. 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?
$ n# I4 r7 E4 s4 J* V( F* `7 E xA. 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.
3 g/ b% a4 N6 @) O2 o9 C( [+ {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.6 Z' |: Z! N I4 E
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.
2 y& L- {) w5 a# M1 _+ Y# J% VD. 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.
5 [5 b( d" X; E4 N7 p( a2 d 满分:4 分/ I5 H. H" e5 T% e
15. 给定三个表:学生表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语句是哪个?2 i: S3 p9 u! o% @) v2 I" n
A. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)! _3 {. c f; `$ O$ z
B. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”)+ X `' q. X: I) C' ?4 g$ t# F ^; X
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)" M5 E1 d4 }) v' _9 H$ X3 G# e# ]9 }7 V
D. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”)4 n1 T1 H" {( W) G2 Z
满分:4 分
+ m' a8 Y6 j I+ t7 j( u16. 数据库系统的独立性是指():
' Y$ }- j- P7 q7 |. u$ ~+ JA. 不会因为数据的变化而影响应用程序
$ e/ \/ z! S. G; `$ h5 P& H! xB. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序$ }) E5 r5 Z$ J8 Q+ f: s
C. 不会因为存储策略的变化而影响存储结构' O- Y) A) b( b6 p: G+ T% T5 ^4 G# M7 m
D. 不会因为某些存储结构的变化而影响其它的存储结构# Q9 y) B( C/ ?5 I1 Y
满分:4 分& F1 m6 c. D, Z5 C, U) b
17. 若用如下的SQL语句创建一个student表: CREATE TABLE student(NO CHAR(4) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2), AGE NUMBERIC(2))可以插入到student表中的是哪一项?; X6 y2 M' r2 j, h0 e' B7 ?$ f1 I
A. (‘1031’,‘曾华’,男,23); j9 w( p+ e- l, }/ f, h
B. (‘1031’,‘曾华’,NULL,NULL). c) @! b# G$ u, u. R P0 L0 ^' W5 _
C. (NULL,‘曾华’,‘男’,‘23’)4 u# J# Z6 z3 R/ A+ z) n
D. (‘1031’,NULL,‘男’,23)" {1 N& Q2 @$ u( z' C
满分:4 分
) n$ K7 h! N6 L e! f- Z9 h& W18. 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?
% d: j$ _1 ^$ N% s! Y, M; q- p: ?A. SQLCODE 0, SQLSTATE 00000& Z: W+ q# ?! Z3 |
B. SQLCODE 100, SQLSTATE 02000/ ~% T( A2 U, [- N1 R
C. SQLCODE -100, SQLSTATE 00100
& w+ H% d9 b& h: e+ I# x3 |3 }D. SQLCODE -501, SQLSTATE 24501/ }' P/ L; x- R) [6 \# q3 k
满分:4 分/ ^- P G" A0 o" W. `3 i
19. Given the tables, the relationships and the statements: EMPLOYEE DEPT emp_num emp_name dept dept_id dept_name 1 Adams 1 1 Planning 2 Jones 1 2 Support 3 Smith 2 4 Williams 1 Relationship: employee.dept is a foreign key on dept.dept_id. stmt="INSERT INTO employee VALUES (5,'jones',3)"; EXEC SQL EXECUTE IMMEDIATE :stmt; stmt="INSERT INTO employee VALUES (6,'jhonson',2)'; EXEC SQL EXECUTE IMMEDIATE :stmt; How many rows are successfully inserted? G& A+ |* u# d. j! P' C5 L+ [8 q
A. One row is inserted in EMPLOYEE
- k/ P. J. h2 e; i V) b& o5 nB. No rows are inserted in EMPLOYEE
7 T ~/ t) c% P# TC. Two rows are inserted in EMPLOYEE. X( `, Y: _9 F& `1 H7 R
D. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE
8 Y" v5 K4 _" n& X& {# j 满分:4 分: @% l# F! ^! h0 r1 M8 J5 N4 i
20. 下列那种隔离级对于只读操作不在数据行上加锁?$ _7 l$ I0 K% j
A. RR. c" v0 p- Y8 @: {8 a) k
B. RS
. S5 D8 T K# vC. CS/ Y0 V9 v2 H2 ]3 V/ H* k2 O% S1 @
D. UR
( w8 ^ {; b4 @5 y9 q 满分:4 分
8 w+ e- T: u) q( {- |* C/ }21. 如果想在数据导入的过程中创建表,应该* w! j+ J9 n, R! ^
A. 使用IXF文件格式进行LOAD$ D5 M* h# v; x! U3 n' I
B. 使用WSF文件格式进行LOAD6 ~+ k, \) ?6 l9 n2 L
C. 使用IXF文件格式进行IMPORT, A6 H& R$ k% c4 V
D. 使用WSF文件格式进行IMPORT: C; b8 Y# p9 J" X' q. D) C
满分:4 分
3 z4 d, K3 q3 @9 Z7 N22. 下面哪一工具允许用户开发存储过程?8 g7 C3 s1 a) _. u) D w6 j
A. 控制中心& x3 l% e8 L Q9 G& D9 c
B. 命令中心
# k/ ~! U" @0 X" ~C. 任务中心6 V$ z1 k5 Z/ e: }
D. 开发中心5 {! l/ k( L$ G/ L1 _
E. 健康中心
0 n% O1 u* O1 w/ g5 Q' r 满分:4 分
6 L/ q& y! m" W1 B/ n+ u; {7 T23. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?6 Y \: Y8 V- }/ |. Z
A. SQLDelete()
/ F; r! d1 \6 X1 ?, [B. SQLExecDirect()
$ a& v, h* ^/ d, A GC. SQLBulkDelete()
0 R2 y, W# c+ V* ]& jD. SQLExecuteUpdate()
* T- Z0 ^- s' o: f ~( w2 Y/ M8 l( d 满分:4 分2 o+ u2 l& T% R' M, E( {' Y
24. 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?# q: M6 n# P4 b" g" D# h, w
A. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
* B- ]* R. a+ q ?9 v K' gB. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql); ^" a1 _2 T4 o# i' v$ b1 W
C. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
! |) K2 b! ?* A3 F& ZD. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);) K6 d' O& |& P( s# y
满分:4 分7 E3 x! X" g* d4 [' |
25. Given the table T1 with the following data: C1 C2 -- -- 1 1 2 2 An application issues the following SQL statements with AUTOCOMMIT disabled: UPDATE t1 SET c1 = 10 WHERE c2 = 1 UPDATE t1 SET c1 = 20 WHERE c2 = 2 SAVEPOINT sp1 UPDATE t1 SET c1 = 30 WHERE c2 = 1 UPDATE t1 SET c1 = 40, c2 = 3 WHERE c2 = 2 SAVEPOINT sp1 UPDATE t1 SET c1 = 50 WHERE c2 = 1 UPDATE t1 SET c1 = 60 WHERE c2 = 2 ROLLBACK TO SAVEPOINT sp1 UPDATE t1 SET c1 = 50 WHERE c2 = 3 COMMIT What is the result of the following query? SELECT c1, c2 FROM t1 ORDER BY c2
+ A! V: c/ B% t* D: d0 pA. 10 1 20 2
2 Q: D. ?" m# Q! {9 d1 [B. 30 1 50 3
, M! ` S. ^5 K5 I& x2 X, SC. 30 1 40 36 c' | d2 F# _+ [
D. 10 1 50 3/ ~) X! @+ Y" y2 t$ z
满分:4 分 |
|