|
谋学网: www.mouxue.com 主要提供奥鹏作业资料,奥鹏在线作业资料,奥鹏离线作业资料以及奥鹏毕业论文,致力打造中国最专业远程教育辅导社区。
3 o$ @; _. p, k& `! u, R
; u% m5 R, ~' y
, P9 ^# w, ?) I5 F) W- s# D5 D, m/ @, N一、单选题(共 25 道试题,共 100 分。)V 1. 下列那种隔离级对于只读操作不在数据行上加锁?# _/ V) Y9 y7 l
A. RR
1 c; W& b5 y8 q4 }( u$ L# ~/ DB. RS1 b* B3 S: T0 Q( `. C1 ^! t
C. CS* f8 l2 C' F! x2 Q
D. UR
# e% X4 I# O/ I& r4 J' g 满分:4 分
& ], y) `, c1 V5 x2. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
. ? V% h' X' eA. 企业版
( M' n9 G0 l/ C$ rB. 工作组版
! y7 ^) U* L3 a( h, v( ?7 h' t; AC. 企业扩展版 r V2 }* R3 x B+ w5 x6 P
D. 个人版0 K6 ?, L- {3 H* w5 n, [& j
E. 卫星版 U( R" s, u/ T9 S6 W+ [
F. 微型版
! R2 G! I' c' X2 G; b6 `. m 满分:4 分- \- M3 T$ @7 h3 t
3. Which of the following is a benefit of user-defined functions?- X. v' {; x7 i$ d& ~' A5 w/ j# c
A. Improves application concurrency5 Z) U4 \7 m' G6 h4 d
B. Improves blocking of result sets
/ M- w! A7 }& r# Y3 S# Y9 JC. Simplifies application maintenance
: V* g6 k2 ]$ j3 k8 d6 SD. Reduces memory requirements on the server
9 V. L8 V+ u' D( y$ F, @ 满分:4 分1 O$ J7 g; P* h. e. K3 _, k
4. 使用DROP语句撤消基本表时,使用以下哪个子句,可以将下属的视图和约束引用全部撤消?
4 |0 r; z9 W+ s4 l5 w4 DA. NULL( C0 Y+ i9 h! c2 i) p
B. RESTRICT$ h. [4 k7 r5 V- W
C. CASCADE! m/ B/ I# r1 x4 T( R6 N3 [
D. DISTINCT
. h+ L7 f( p0 u3 a' ?; Q 满分:4 分
# r0 q4 M/ |; h# U$ S9 \% z5. Given the table T1 containing an INTEGER column: C1 --- 1 A multithreaded ODBC/CLI application successfully executes the following pseudocode in sequence: Thread 1:SQLConnect(hDbc1,"CERTDB",SQL_NTS,"",NULL,"",NULL); Thread 2:SQLConnect(hDbc2,"CERTDB",SQL_NTS,"",NULL,"",NULL); Thread 1: SQLSetConnectAttr( hDbc1, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON); Thread 2: SQLSetConnectAttr( hDbc2, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON); Thread1:SQLA11ocHandle(SQL_HANDLE_STMT,hDbc1,&hStmt1); Thread2:SQLA11ocHandle(SQL_HANDLE_STMT,hDbc2,&hStmt2); Thread 1: SQLExecDirect( hStmt1, "SAVEPOINT sp1 ON ROLLBACK RETAIN CURSORS",SQL_NTS); Thread 1:SQLExecDirect(hStmt,"INSERT INTO T1 VALUES(2)",SQL_NTS); Thread 2: SQLExecDirect( hStmt2, "SAVEPOINT sp1 ON ROLLBACK RETAIN CURSORS",SQL_NTS); Thread2:SQLExecDirect(hStmt2,"INSERT INTO T1 VALUES(3)",SQL_NTS); Thread1:SQLExecDirect(hStmt1,"INSERT INTO T1 VALUES(4)",SQL_NTS); Thread2:SQLExecDirect(hStmt2,"ROLLARBACK TO SAVEPOINT spl",SQL_NTS); Thread2:SQLExecDirect(hStmt2,"INSERT INTO T1 VALUES(4)",SQL_NTS); Which result set would be returned by: Thread 2: SQLExecDirect( hStmt2, "SELECT c1 FROM t1 ORDER BY C1", SQL_NTS );
0 @* s ^5 Z3 \A. 1,54 |4 b. k$ P) j! n( m, s% S
B. 1,2,5
7 s' S1 U9 T s, x8 x( kC. 1,2,4,5
4 d M2 [. m4 D3 t' R! ?D. 1,2,3,41 a# d) {' |$ I
满分:4 分8 H& a5 \3 ]7 w
6. 如果开发人员在AIX操作系统上开发访问后台AS400上的DB2数据库,则需要在AIX开发环境中安装:()5 }: S) q& p! @! B, n, `
A. DB2个人开发版(PDE) o0 W5 ], w( q/ o! ?; @
B. DB2通用开发版(UDE)
- C& l* p9 S! ?, h 满分:4 分, H+ \" t( x" n( }/ m( @
7. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
8 {! ~4 e6 W& N5 \A. The cursor will remain open after a COMMIT.
% ~3 o; }7 V j/ s' j2 K5 UB. All rows retrieved are locked until a COMMIT.6 w7 O6 @1 s v0 o% o
C. A COMMIT will not be allowed until the cursor is closed." ~2 j2 s5 L: S( W" c9 U! j) `
D. Locks obtained by the cursor will be kept after a COMMIT.
0 a7 i+ }* Y: k3 L! P5 C 满分:4 分; g# g9 ?4 x2 u+ E
8. Given the following table: CREATE TABLE employee (name CHAR(10), salary DEC NOT NULL WITH DEFAULT) INSERT INTO employee (name, salary) VALUES ('SMITH', 30000) INSERT INTO employee (name) VALUES ('JONES') INSERT INTO employee (name, salary) VALUES ('ALI', 35000) Which of the following statements will retrieve more than one row?
& }5 N) a6 i+ C. O+ W+ p6 fA. SELECT salary FROM employee WHERE salary IN (SELECT (salary/(SELECT SUM(salary) FROM employee)) FROM employee)
. K) v" g4 L vB. SELECT COALESCE(AVG(salary)) FROM employee
) h- m! O; s- N: R; m" [* V& a4 LC. SELECT SUM(salary)/COUNT(*) FROM employee
2 O: A% G0 T+ g" U( k& KD. SELECT salary/(SELECT SUM(salary) FROM employee) FROM employee
! m1 Q2 N0 e( }, A$ Q3 c/ F: b8 }+ S 满分:4 分
) O1 N+ A" P- Y; S- B9. To prepare an embedded SQL program for use with a host-language compiler, which of the following database components is required?
$ Q* v6 z) c* @% J5 N4 hA. Binder
3 k6 F2 B' K$ _1 A9 [B. Precompiler$ A# @; o5 u% D
C. Stored Procedure Builder$ O5 ^2 m% R0 J a9 _/ E
D. Application Development Center, U9 X3 c' m& H: C3 z& c4 x
满分:4 分( }) j4 X: q) g
10. 实体是信息世界中的术语,与之对应的数据库术语为:()& ?( A; Y- Q' R, c }
A. 文件
6 Q: C7 W/ Z6 |% U2 Y. m/ b& _" bB. 数据库
( s5 Y |$ G- B* T2 ?C. 字段, m; [+ E3 ~( Z4 `8 ?/ B5 X0 d7 b
D. 记录" R+ R$ K7 g/ J5 `! h
满分:4 分( S; B x5 J7 Z) _
11. E-R图中的联系可以与()实体有关- z+ e# u/ y6 x( _" _
A. 0个
3 j0 G1 H2 P1 H v( XB. 1个! T/ \0 G+ d; u/ Y7 t2 N; o, b8 i0 n' }
C. 1个或多个
# O4 Q) C9 b m% C9 L. N3 |8 B! W; RD. 多个- u: ~0 C- G. T$ j" Q* @
满分:4 分
0 H5 U, Z/ D) f& e+ o4 h12. 设有两个事务T1,T2,其并发操作如下所示: T1: T2: 1) 读A=10,B=5 2) 读A=10 3) 读A=20,B=5 求和25 验证错正确的评价是哪个?
7 `$ S* `2 J& S- t% T% V0 ~9 OA. 该操作不存在问题
! j* A: a8 x5 i+ a; O) F$ l0 TB. 该操作丢失0009 O( c, f' N. N& h4 {
C. 该操作不能重复读
: q. u# m, Z! r3 E: g+ U. pD. 该操作读“脏”数据$ z7 M0 s/ ?, J( {
满分:4 分1 o. o- [5 ^4 {# J, v! d) {, n
13. An ODBC/CLI application performs an array insert into a table containing a primary key. If one of the values inserted generates a duplicate row error, which of the following APIs can be called to determine the failing row?
& z6 h2 W( \! x8 IA. SQLError()
0 l' s2 n$ M' n( _2 [" ZB. SQLNumRows()
8 L, ?! L5 O# ?. W8 b/ r% OC. SQLRowCount()
$ h7 D2 O1 z& U- G8 i7 V/ a5 \D. SQLGetDiagField()
T+ ^! ?4 D I# Y; {4 A$ N6 s 满分:4 分
4 u$ t5 A) ?! ]; ^* G/ X6 {14. Which of the following produces a sequentially increasing number, suitable for use as a primary key?
% b& d3 N- f& @/ h$ yA. ROWID data type
4 ^4 L; G: ~6 W4 v' a4 N9 K3 tB. Generated IDENTITY column
+ F' H! K4 b" s7 E4 zC. GENERATE_UNIQUE built-in function. V: {8 I6 V3 H
D. CURRENT SEQUENCE special register( \- v. U. ?/ M# ?
满分:4 分- y2 w& u @, c7 B
15. 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
% c' Q7 a L+ w5 q; i8 }A. 10 1 20 2
$ [7 Z9 G! G D2 {4 }3 IB. 30 1 50 3$ d4 ?) c/ f G
C. 30 1 40 3% D6 ]! u4 }7 E# y4 S" [
D. 10 1 50 3- I( L* [, K, }5 P+ l
满分:4 分
+ u0 @! m" c, ~8 X16. 两个子查询的结果(),可以执行并、交、差操作' Z2 W2 d# S, S1 s% l9 s3 m Y: L
A. 结构完全一致, v; A+ @: l3 s: C! F
B. 结构完全不一致
8 Z3 _/ `2 P, i* k* V! ?7 [3 eC. 结构部分一致+ r8 a+ o$ V* Q% U) |
D. 主键一致
8 Q' F4 t7 Z* D. w 满分:4 分
' I: e+ E3 y/ G. h% o( n. T17. Given the table T1 with the following data: COL1 IDX ---- ---- A single-threaded CLI application executes the following pseudocode in sequence: SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv ) SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc ) SQLConnect( hDbc, "SAMPLE", SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS ) SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON ) SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=10 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=20 WHERE idx=2", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_COMMIT ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=30 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=40 WHERE idx=1", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_ROLLBACK ) SQLExecDirect( hStmt, "SELECT col1 FROM table1 WHERE idx=1", SQL_NTS ) Which of the following values for COL1 will be fetched when the sequence for the pseudocode listed above is successfully executed?8 W& v8 p8 ^- i+ f, `5 L
A. 106 I; v8 ]% c+ Q0 ~( K }
B. 20" _# \" u# M! F+ T
C. 30
4 b! t% L3 Y. e; ND. 407 o7 O1 z k. [9 o/ r6 \7 j
满分:4 分* v- l4 c' D, R
18. Given the following statements: EXEC SQL INSERT INTO employee VALUES(:new_emp, :new_name) EXEC SQL UPDATE company SET num_employees=num_employees+1 WHERE company_id=1 EXEC SQL COMMIT Which of the following can be added to the database so that the company table will still be updated without the need for the explicit UPDATE SQL statement?8 y0 s' i1 }2 x! W8 _
A. An INSERT trigger on COMPANY [( u i- \: c, p) \# x
B. An UPDATE trigger on COMPANY
7 R9 B4 x- Y; m& o- PC. An INSERT trigger on EMPLOYEE
7 P: @0 I1 c2 G- O, u4 \D. An UPDATE trigger on EMPLOYEE
+ y; O! P& S- w+ Q* G 满分:4 分
2 Y" h5 Y+ u( J* M* u+ K+ |' a19. 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?
L/ i3 ^; |7 B( P# v2 y ]' `1 WA. 05 _5 T7 R T9 x( ~/ z
B. 1& b, P8 g' D) [2 s% A6 {& n" w
C. 2' c7 d5 C7 C+ p% X$ t% p( N
D. 3
/ F3 L5 ^1 W/ u( Y& I& T9 e 满分:4 分
5 Y, J8 Z) a* o% a20. 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?3 I/ `2 D- D9 H7 ]& H* q! A4 M
A. user tables" I) z6 Z2 e, ?% y8 Y5 @4 a# g
B. server memory9 |& S. I" ^1 C. a3 w+ z
C. user table space
: W4 |2 ^- P" t) eD. system catalog tables
* B$ s1 j: Z5 `8 @( W* ?% v6 L 满分:4 分
$ b1 \1 S6 ` m% @21. Given the table T1, created using the following statement: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (2, 'def') INSERT INTO t1 VALUES (DEFAULT, 'abc') INSERT INTO t1 VALUES (DEFAULT, 'ghi') Which of the following represents the order in which the values are returned from the following SELECT statement? SELECT id FROM t1 ORDER BY id" D' d- j2 u7 X m/ `7 ^" E" D
A. 1, 2, 2
- o( K( O6 @! c! h% u6 n0 MB. 1, 2, 3
2 G+ A' y5 b% v9 l8 IC. 2, 3, 4
_5 e( r+ v. w0 g5 zD. 0, 1, 2
" k+ A, S- j+ y 满分:4 分
" s( o; ]9 @# U8 ~( Y22. 在客户端直接连接到DB2 UDB服务器的环境中,服务器端的认证类型为以下哪个时,在编目时指定的认证类型不一定要与服务器端认证参数的值相匹配。/ @7 }# q4 e- D: x; L. l
A. SERVER_ENCRYPT a5 I5 @3 H9 d& P8 \
B. DCE
) W. J" ]4 n! Z Z+ xC. DCE_SERVER_ENCRYPT
* _: m) {# ? @8 p9 ^' M- Y, PD. KERBEROS
" M$ u3 Z+ b2 ]7 _+ g 满分:4 分& Q/ U, g: X1 w/ J
23. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?9 P3 I% [# G c
A. The cursors are unambiguous." j) M, I- q9 p5 A; Z
B. Only the first row is returned.+ n- s7 l/ P9 Q, W. v
C. Cursor stays open after a commit.2 x1 m( B( n* e7 F6 B+ Y* c1 c9 x; W. m
D. A temporary table is created on the server.
; Y0 J- M8 O6 A. |) A1 ? 满分:4 分
" z I2 Q. o6 }! M' J5 K2 m9 g24. 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?5 F2 Z9 `& ?' |% r n. [/ W8 s4 a
A. user2.org" j$ _6 u0 ~8 s" N1 o
B. org.sample/ g5 e, t' ?$ @1 Z1 ^( p
C. sample.org" q! _' v' b! K7 K2 c
D. sample.sample
- `& C. H# ]$ b" I' }( z 满分:4 分
" K$ w" o2 c. r/ u, N, A8 p! o/ Y25. Given the code: EXEC SQL 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 id, name, cities FROM most_cities INTO :id, :name, :cities WHERE cities IN (SELECT MAX(cities) FROM most_cities) Which of the following can reference MOST_CITIES?; {( @* ^( h+ a+ ^2 B
A. The current statement
* Y# a8 e& Z, X" F* i3 X: UB. Statements from any application
5 q1 j R# k% V" c: lC. All statements within this application
J) x4 d/ |- Y K% G6 _! D1 PD. All statements within the current unit of work
$ j9 w# L) O+ L0 b 满分:4 分
6 \+ k0 c B/ Y7 H/ N. g/ g D- k2 ^/ I2 d( I: ^! _' r
谋学网: www.mouxue.com 主要提供奥鹏作业资料,奥鹏在线作业资料,奥鹏离线作业资料以及奥鹏毕业论文,致力打造中国最专业远程教育辅导社区。
( Z, O# j5 V# |0 ]$ c0 [2 L |
|