|
一、单选题(共 25 道试题,共 100 分。)V 1. 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?
: g& x. ]% v% q4 b, i3 k/ `; J6 fA. ORDER BY子句
( J4 m7 r; j6 o6 d3 }1 \B. WHERE子句! y% C& z# h6 q+ f' f: k; M2 S
C. GROUP BY子句
9 x! z, _2 m" c. ~4 d" iD. 均不需要# d% r z7 b4 k6 F* d% P
满分:4 分 I2 t7 T' I7 T. `7 k' h. W
2. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?9 F8 B! u% R: y* |: r. w
A. The cursors are unambiguous.
, j# g0 ~+ B7 O D& q3 ?3 w3 a) MB. Only the first row is returned.
; J( K7 W$ v* X* ?, DC. Cursor stays open after a commit.+ z& C1 y( h) u
D. A temporary table is created on the server.
p& |+ P7 o5 _9 f4 b 满分:4 分
6 y7 h$ ]7 s7 B/ T) E& l6 p9 E$ N3 m3. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
* d+ u9 n$ r6 _ T6 p Q5 I( M) F4 JA. 企业版# N( I7 ~- ]3 E3 Q8 A! w6 S; A
B. 工作组版
% s! R1 e4 M& n+ g/ g0 CC. 企业扩展版
8 T( F% s5 } E4 tD. 个人版
0 ~* i+ O |) r9 I7 fE. 卫星版- D# Q# j$ R6 e1 `( H
F. 微型版. R+ C/ P k0 M, h. p4 c
满分:4 分; C% H7 R* F+ n/ ~ I2 t" y/ 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?# i4 ~2 U- O2 n* z
A. user2.org
+ B% t$ b2 G2 e% ]. V. HB. org.sample
" t. E7 A8 m b0 r1 I1 KC. sample.org
# o4 z1 [# [: V- z$ n! Z$ ]D. sample.sample
$ e4 k4 i* F) p. ^( l7 W' ]& G$ a 满分:4 分
" `) {- g8 {" U& o; g5. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
# w, G# u: _3 \5 ~# WA. The cursor will remain open after a COMMIT.
2 K$ p9 _7 w) OB. All rows retrieved are locked until a COMMIT.9 d( q- G4 d. u
C. A COMMIT will not be allowed until the cursor is closed.( E0 u% k/ t# n7 W* b
D. Locks obtained by the cursor will be kept after a COMMIT.
. c4 ^$ x" x3 a' M5 b2 B 满分:4 分8 r) J3 F, U9 \+ Z) {
6. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?( Q- f8 t6 W: ?0 m! o, G
A. NIQUE
' h% Q: U [7 r7 V# YB. ALL
3 s0 S9 t. Y8 n- D. t( a. y4 UC. EXCEPT
5 K& }4 j4 M- r# GD. DISTINCT
@/ U% V: x. x G3 L/ i 满分:4 分6 T0 j m6 A( B
7. 如果用户在SQL语句中没有指定数据库对象的SCHEMA,则其缺省的SCHEMA是: D- @& n4 y* k+ S' M2 M
A. SYSIBM4 V' a% q# e4 K4 s; A
B. SYSCAT
- j9 n. G" Z3 yC. SYSSTAT+ ?6 }0 P1 R8 m k# u( [4 }
D. 该用户连接到数据库时所使用的用户名! k6 O$ J+ B! T) Z4 [
E. 以上都不对$ b4 H, ~0 u9 t+ @
满分:4 分
7 G2 E1 d3 S' k( ^3 g8. 数据库系统的并发控制的主要方法是采用()制。5 l( f m: e# N6 K. u
A. 拒绝
+ J8 t- N9 [8 `; F% Q. }1 Z1 ^B. 改为串行
8 [3 ~# |/ K, ^C. 锁
4 K3 ?1 Q; O' @. t g3 `D. 不加任何控制
! k/ k. F5 N! T" \; \) W7 H1 F& E# ` 满分:4 分
7 i! F* B. a3 y9. 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?
# H* O, P( G9 \$ q! M' BA. user tables# _( c1 n3 F% k# n5 t' B/ e+ h
B. server memory
9 u1 }5 D+ u$ F& N# d2 G/ g! mC. user table space( ~! V) _ I6 |" ]
D. system catalog tables! `9 x# _2 e: H5 `
满分:4 分" x; D4 n y% J
10. 关系模式中各级模式之间的关系为()6 J0 i8 ?, E4 y. P$ B' b) w
A. 3NF 2NF 1NF2 [) x1 d1 L! b4 d5 E
B. 3NF 1NF 2NF% w/ i) @5 v @& a# `7 q! j
C. 1NF 2NF 3NF
' U: G$ S5 L/ s4 q# K8 zD. 2NF 1NF 3NF
3 @7 \# q- ?) c& b# F% p 满分:4 分
% l2 a7 i# s# O5 V( _7 ]: p11. 创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?
* h0 N$ a5 z/ X: n$ ?3 J) UA. 目录
6 ?! q4 r: g. v, |B. 文件
6 N) n$ l8 t6 R; @, Q$ KC. DEVICE. G7 t/ i" W; a: w8 F9 S, m
满分:4 分2 Z" ]9 d- G: P
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上有几个索引?
Z' H' p- L7 j9 uA. 00 H% F- s" x2 J3 g, b- L
B. 1+ h; t- s0 e% \2 z6 n
C. 24 z3 B/ X$ \ h- }+ I1 D
D. 3
: a) E6 R9 G7 }) sE. 4
& Y+ [) p- H* f% h( { 满分:4 分. u+ [7 ?* y3 E
13. 缺省的数据库日志文件的类型是:
, s4 |, ^- q4 `2 m4 L- }1 |5 A9 O7 LA. Circular Log
+ R- s/ v- n. J* z \B. Archival Log
6 O; S# N, B. W# p6 q) a/ uC. Primary Log
- O1 S2 D# a4 CD. Secondary log
- W( p6 e/ l' F5 P: \2 v8 W. D 满分:4 分! o& E' p. e- ]6 j
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?
, f' ^! V& k/ x' uA. 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.
, O# x5 U/ r' @+ N" C9 U" }. P4 \# bB. 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.0 s5 O4 m- d: ^3 [4 k) k# U
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.
) Y, j% O1 G) z$ X' I& mD. 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.! j0 v3 T, [( z; \. ^5 L
满分:4 分, k5 t& K% H" @7 W
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 Z% u: `' S) G$ n) ?) B1 j( x2 H
A. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)# O. I6 S+ P4 A. }. h
B. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”)( F$ ~$ p/ |4 `6 S' P% e
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)
5 Q m3 o5 N0 K; c* ND. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”)3 G- C K6 J3 a5 d5 e9 k
满分:4 分! V' m4 Z: g1 l# ^. P9 b$ E. @
16. 数据库系统的独立性是指():: h1 @6 E+ p" [3 @. b. h5 O7 w
A. 不会因为数据的变化而影响应用程序
+ ?0 S$ S6 Y8 T: NB. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序
3 |) ]7 k V! L4 A) Z2 JC. 不会因为存储策略的变化而影响存储结构
8 ^0 @" _0 X5 x% OD. 不会因为某些存储结构的变化而影响其它的存储结构9 I9 q) ]% k7 i, f
满分:4 分
2 |5 R+ O% O6 i8 B$ T# H17. 若用如下的SQL语句创建一个student表: CREATE TABLE student(NO CHAR(4) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2), AGE NUMBERIC(2))可以插入到student表中的是哪一项?5 p3 {, h3 L$ ]8 o' F" j- V
A. (‘1031’,‘曾华’,男,23)1 M9 S+ _8 M @7 L
B. (‘1031’,‘曾华’,NULL,NULL)
/ l* f* H. s: \, B, Z; `C. (NULL,‘曾华’,‘男’,‘23’)$ B) J' L( h( v( x$ A% ~
D. (‘1031’,NULL,‘男’,23)# @2 y' H+ h8 i: i `+ o
满分:4 分
% {. F% T/ o0 P/ M* j3 B18. 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?6 i6 R" W' d" {5 ~) I: V7 P
A. SQLCODE 0, SQLSTATE 00000' L$ U% t0 i1 I9 t; f
B. SQLCODE 100, SQLSTATE 02000( M U6 }* R$ h, {
C. SQLCODE -100, SQLSTATE 00100
0 Y* d" V- K. ~8 T% w: ID. SQLCODE -501, SQLSTATE 24501; T; B; W1 O i1 y* o1 \
满分:4 分
7 Y! Y! [ H Y19. 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?
& j! A, \0 x5 m5 P8 u1 p5 bA. One row is inserted in EMPLOYEE$ V) x- k' g9 `
B. No rows are inserted in EMPLOYEE- A* W8 s/ {( v& @4 E
C. Two rows are inserted in EMPLOYEE
# g) J( z5 G5 f2 T' A' I9 HD. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE) Y) K* T: l! b7 u! \
满分:4 分- \0 L* l. L" t& \5 h" V5 M( ]4 U
20. 下列那种隔离级对于只读操作不在数据行上加锁?
3 k- z$ o# L0 c2 qA. RR
- N( W n1 [# g" Z( oB. RS
# f) z" K2 o- a, K( }$ eC. CS
9 Z0 K1 n7 ?9 R6 {, ID. UR/ n0 y2 w' G) S5 Y6 }' | Z
满分:4 分
# }6 U- n: ~( {3 j4 Z21. 如果想在数据导入的过程中创建表,应该1 X3 @; \" R+ F9 p5 J0 b
A. 使用IXF文件格式进行LOAD
* c4 i7 p; S, H R& iB. 使用WSF文件格式进行LOAD/ n7 t# S0 z& { f
C. 使用IXF文件格式进行IMPORT( {# @* W* b3 }- p# q! ~
D. 使用WSF文件格式进行IMPORT" c/ ] S# m7 }1 [0 d0 H1 N& ~
满分:4 分
7 z' Y$ M; a5 k4 D7 G8 D22. 下面哪一工具允许用户开发存储过程?0 y3 y5 m, X7 e* Z" g, A& d$ I% z
A. 控制中心5 d7 R6 Q! i) _
B. 命令中心
. b* r1 a4 ^; F" d. ^- TC. 任务中心+ q) I7 u0 E7 I$ X
D. 开发中心. c$ n2 X& ]; H* j! B& k
E. 健康中心+ J9 v% o# Z; e' B6 h( i2 ]
满分:4 分; U- U" Q! `( h5 s7 L
23. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?
1 ` Y/ q6 H, M3 a2 k- H/ |& pA. SQLDelete()7 _! k: I6 b. o* |& K% C
B. SQLExecDirect()0 A8 }3 X8 O+ A" G, T/ p3 s
C. SQLBulkDelete()3 k/ n: @0 m( ^) Z9 W* E4 v. i8 E! }
D. SQLExecuteUpdate()
) Z U& J2 ?3 I+ \. U% L" \' Y& z/ _ 满分:4 分
! T8 O4 {5 Z E24. 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?
. [/ h; f# I8 F* PA. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);+ j9 c. H# n: A' f) k# d, A" g0 x
B. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);3 u: b' l$ s3 p9 l3 w$ \1 C
C. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);4 ~& e/ F$ I" Z! T8 m; K. [8 D
D. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
( B1 g, [% L$ D2 q0 a0 t& J2 r 满分:4 分9 x/ p5 _4 m$ H; F1 P+ @
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
& s4 h g8 f( z. HA. 10 1 20 25 k8 U$ q! b7 `
B. 30 1 50 3
2 w; K( b. ]4 g0 s9 P! R, @! Z1 dC. 30 1 40 3+ L1 u, R/ T% R( {4 R
D. 10 1 50 32 S4 G; \7 Q6 k- T
满分:4 分 |
|