|
一、单选题(共 25 道试题,共 100 分。)V 1. 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?
$ E+ S: i- h5 D5 ^' kA. ORDER BY子句
+ F& i8 J2 [( {/ f7 ~7 fB. WHERE子句
7 a s% n! J' T1 a; e9 tC. GROUP BY子句
2 `! L2 p. M, M/ h) WD. 均不需要
0 N* ]# x9 Y( ]# z6 ^- [/ e. x. U 满分:4 分
& y L* U8 V M" ^* r2. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY? I3 i: G; p$ f+ f
A. The cursors are unambiguous.
6 |2 Z& P. M( \$ i# S: p, F* R1 AB. Only the first row is returned./ `$ T' N+ U3 ]! R
C. Cursor stays open after a commit.2 ?4 v# V3 n/ f, a5 h" k
D. A temporary table is created on the server.0 e- h# L I4 p4 I/ E
满分:4 分0 y& e$ |, g5 t4 M6 S
3. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
) y4 B2 g, M5 _* |A. 企业版6 q- s0 }4 u0 C
B. 工作组版! G" y) e4 W- I7 K
C. 企业扩展版
% W8 t: j& {$ G% X; [. aD. 个人版
$ V) }6 `8 R# A; K4 HE. 卫星版. B: }, H* x) m# p% K& w. Y! M
F. 微型版" ~) N) z; z' s( S
满分:4 分
) y6 V0 l5 i2 k3 e4. 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?
; t8 a% M; a/ g& F r' RA. user2.org
3 m3 Y& [- c7 }6 y5 _B. org.sample4 d8 f! L, \5 r
C. sample.org: k# C. Z% n* x) }$ i
D. sample.sample" C. ~) i% u0 P+ i9 p" c
满分:4 分7 c% X+ B# z4 A+ [- e1 \+ @2 R! t3 _
5. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
+ N5 z0 f5 }' _A. The cursor will remain open after a COMMIT.
; s2 c4 A2 X0 M" \/ |' j8 TB. All rows retrieved are locked until a COMMIT.
/ Q `% h* Z" E3 { A9 QC. A COMMIT will not be allowed until the cursor is closed.% L" F* m G) d+ D/ ]! ^! L
D. Locks obtained by the cursor will be kept after a COMMIT.
l; ^: ^* Y" C) ?" S 满分:4 分0 r7 J3 s7 E9 P& V0 w4 ^1 K$ p
6. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?
; s, O# x0 a. I [+ r" iA. NIQUE
% w( A/ d* r* R9 @B. ALL3 J5 @% v0 {! Y$ o6 r8 k
C. EXCEPT
1 R" w S3 A/ q5 ~0 E2 w3 J$ WD. DISTINCT
/ p6 k$ t6 J4 ], {* ` Y$ q2 Y2 T 满分:4 分
: @5 x% B1 y9 z; K0 {; }7. 如果用户在SQL语句中没有指定数据库对象的SCHEMA,则其缺省的SCHEMA是:
/ X) e$ x5 g# d3 z, l$ j+ uA. SYSIBM
2 o3 ^) h0 P! yB. SYSCAT/ @2 S5 A) @1 }( H- ~
C. SYSSTAT
5 U9 @$ M' y9 Q" e7 v# \1 mD. 该用户连接到数据库时所使用的用户名
6 s! b% C1 G6 m. [E. 以上都不对. R$ m) T9 U( d$ w: U. M0 k2 G
满分:4 分6 w/ q, T" o$ g0 a4 \
8. 数据库系统的并发控制的主要方法是采用()制。4 x5 I6 j6 ^1 l7 G1 F4 S$ F% M0 b3 f
A. 拒绝
$ A* O7 w% ]5 p/ @B. 改为串行
9 ~% Z- M( T! y, a& T' ]C. 锁! T& M1 [2 I0 f [- h1 w
D. 不加任何控制, y# i# F4 X8 a" ]+ i3 t3 ]
满分:4 分1 ~9 r5 O3 y( X8 R* g6 ?& A) P7 O
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?
6 C0 v9 C3 z+ k; ?; R+ Q& H& v. O# eA. user tables: f. `9 `1 {+ i! D3 ]
B. server memory# o& {3 @- j( R( w
C. user table space: F- k) h: c% y. Q; D! u- Q! I
D. system catalog tables# m: t7 Q( Z6 R9 k, c
满分:4 分
; O- j& p. ~: `! B8 [2 \10. 关系模式中各级模式之间的关系为()
. e+ s! a2 t d# G, H: U" k. RA. 3NF 2NF 1NF' S' D* d' m; a' ~- t
B. 3NF 1NF 2NF/ _1 _# I; U) i4 R# S5 x5 }
C. 1NF 2NF 3NF
" ^- T8 q! k( hD. 2NF 1NF 3NF, Q' [# h2 m; c) W: @) b( R8 N
满分:4 分6 o* U: N/ m Q# D
11. 创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?/ y+ ^' H1 F$ Q# [8 A8 k6 Q
A. 目录) h% n8 {- H- s R: H9 A' L
B. 文件
" c$ n c$ `, a8 X( V2 m4 |4 [6 CC. DEVICE! F8 Q4 C0 n: B8 a
满分:4 分; S! a( ^: t6 N- j/ S4 t
12. 执行下面两条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上有几个索引?5 t/ v# C4 ]" `) ^ E+ r! \5 _
A. 0! d/ o, M0 V: x1 v; K2 l! a
B. 1
3 S( u' G; L1 c" K! C( H7 JC. 28 o# a, s6 x- l0 s3 S5 q# o0 \
D. 3
1 w9 ~4 o w2 s& w* U$ C" x9 | B/ aE. 45 }: \0 v$ B2 s
满分:4 分# N* h' Z* u5 T6 x9 H) c9 }. D0 c0 _
13. 缺省的数据库日志文件的类型是:
1 a( l! s0 e9 H6 b- TA. Circular Log' X7 G9 R# D+ Y! _7 F$ a$ {! l: o
B. Archival Log e/ P+ x4 }# S; V# P& h* H
C. Primary Log
7 U' E W2 D0 GD. Secondary log
( u/ m! @* I4 T/ X 满分:4 分" D8 t/ U* y7 i5 i+ R0 D
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?
; Z* E4 u8 Y A' a( S6 {) 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.7 ]% z) m: i: O% Y9 w
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./ L- T9 e; ^+ ^ [6 y
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. ]) j$ k8 K9 y" w! O
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.3 Q8 E! @: R; b6 ]) {5 c8 [
满分:4 分' Y3 Q" 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语句是哪个?
0 V; C9 o/ J- cA. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)- {9 @5 a" A# z1 i4 c+ m3 ?# n& Z
B. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”)' Y6 @9 Z8 O% Z) c& a3 M" ^2 Z
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)
9 J% P1 G3 V" j( z; m) ~D. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”)4 t6 B% X6 i, a1 c6 w
满分:4 分
/ F, b( {, ~* N16. 数据库系统的独立性是指():/ ]" b( b2 d+ Z8 c5 K0 @: b: e
A. 不会因为数据的变化而影响应用程序1 h! m0 ~& {; L. t8 W! f
B. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序7 A7 U( X# y" O$ R6 `) ~- v
C. 不会因为存储策略的变化而影响存储结构
8 A, r9 e$ V' iD. 不会因为某些存储结构的变化而影响其它的存储结构# R5 g, N9 s/ `
满分:4 分
7 X! x& {+ |% N: B- L17. 若用如下的SQL语句创建一个student表: CREATE TABLE student(NO CHAR(4) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2), AGE NUMBERIC(2))可以插入到student表中的是哪一项?- {+ [, G3 w1 @' V4 B% V
A. (‘1031’,‘曾华’,男,23)
2 }, s$ I9 Z$ o0 g7 EB. (‘1031’,‘曾华’,NULL,NULL)' R; Z( i$ V" R _# b
C. (NULL,‘曾华’,‘男’,‘23’)
0 {. f8 T% y; T) ?. @0 j5 HD. (‘1031’,NULL,‘男’,23)& L" T. }- S: H' }0 F+ A
满分:4 分1 Y0 R" R. F0 z+ o% U" u% S
18. 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?$ t* l3 `" k5 [
A. SQLCODE 0, SQLSTATE 00000
, T/ F8 S; y4 {1 B; N$ |B. SQLCODE 100, SQLSTATE 02000
: e5 |/ R! a% I( |) g4 r! P, [C. SQLCODE -100, SQLSTATE 00100$ Q; F5 u3 ^# G6 o1 @$ g
D. SQLCODE -501, SQLSTATE 24501: K9 Y3 K/ g7 y* j6 p, r p) N
满分:4 分
# q% e5 r0 U, I19. 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?
* C0 N. A- y0 z1 C+ B. e uA. One row is inserted in EMPLOYEE9 }; X2 m/ j8 O2 G' ]
B. No rows are inserted in EMPLOYEE
& _% b0 i8 @) }8 Y& GC. Two rows are inserted in EMPLOYEE
/ `0 I6 m; `0 XD. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE
' q: K. I* S; H 满分:4 分
5 U6 Z: v1 H- ?8 b7 }0 Q' O, m& w20. 下列那种隔离级对于只读操作不在数据行上加锁?9 @& G6 t8 ?/ J9 t
A. RR
0 X4 j/ |3 i( V% p, e8 Q- D9 D% v3 IB. RS: C' `( M/ Y9 E& f, G$ {/ ^' P) {
C. CS. u2 ~5 g2 }6 | T
D. UR/ l0 m2 h: ~# J' }! T* j
满分:4 分 p) ]& j% @* d" b6 |
21. 如果想在数据导入的过程中创建表,应该
) ?2 r- p) Q2 ?% G `/ c: OA. 使用IXF文件格式进行LOAD
- X" I# S5 L. h; R b! MB. 使用WSF文件格式进行LOAD
( E- p7 V6 G5 X- }. X, Q2 [" RC. 使用IXF文件格式进行IMPORT" e% j9 o" H, g- f8 R- o2 L: ?( f
D. 使用WSF文件格式进行IMPORT/ f1 r* p% H( `, i: D. c# S
满分:4 分. d( D7 I2 i7 i7 _# E
22. 下面哪一工具允许用户开发存储过程?8 T- R( b# k3 b9 j: ]
A. 控制中心
m6 U1 R" F# x9 o* J: XB. 命令中心1 A/ F4 V: y9 ?4 X1 H& V# I
C. 任务中心, n$ V) c R% ^0 G) d0 D. R
D. 开发中心4 p6 |$ _& u# N2 f6 R+ B3 ^6 o
E. 健康中心
3 B7 q( M6 R3 e0 S 满分:4 分
( | p2 U2 O* `/ F! Z% w23. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?8 h8 Z6 |' R9 E% T
A. SQLDelete()5 X7 F" v) |& \
B. SQLExecDirect()
1 M' i% g# H! }7 u( a7 xC. SQLBulkDelete()" S$ E! ~" M4 E/ q; e
D. SQLExecuteUpdate() y& V$ }% h0 z, S% _
满分:4 分
$ T& _0 Q: I# w24. 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?
7 a' y' ~/ u, a+ i5 x. k& ^4 S( x4 _A. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);; ^& K# [7 [7 P! w0 R8 ~6 y
B. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
1 ^2 v7 C! m5 n, c& LC. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);0 l9 L; h: v" U8 O4 ^2 B
D. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);3 J e% D1 L, w
满分:4 分. A4 X- j# j( I! Y
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
2 D- O& ]3 x* L4 C* qA. 10 1 20 2
: Y8 M0 w8 W9 v& L1 q; t6 `B. 30 1 50 3
8 M( }) w4 r+ E SC. 30 1 40 3- a A9 x0 i8 Q% ^2 ^
D. 10 1 50 3$ e [% f4 P& H; _
满分:4 分 |
|