|
吉大11春学期《数据库应用技术》在线作业二资料
% A' K* U0 o& Y! R! j" n在线作业, 数据库, 单选题, 资料
% D- D/ u0 A# A! K3 ~" o4 ^9 F一、单选题(共 25 道试题,共 100 分。)V 1. 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?9 m) e* N0 k6 W& Q9 U; w; x! S3 Z
A. ORDER BY子句
7 ^4 c8 O( Y6 o9 t K. f2 uB. WHERE子句
8 h3 N' N9 d: jC. GROUP BY子句! c5 a9 u& Z! Z# O* e
D. 均不需要( {) _/ i% R0 O' c9 g
满分:4 分
+ \$ M* I- A7 S2. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?
# E, z* W0 X! x4 tA. The cursors are unambiguous.0 l( M s. {; Y. X5 L" p2 u* P
B. Only the first row is returned.
% Q9 t" e' \* ZC. Cursor stays open after a commit.
: G* ]: C4 c9 o# x( zD. A temporary table is created on the server.
0 Q' F5 y& X& R3 v. F 满分:4 分3 n8 P3 G; g' }# n% v
3. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
/ t6 ?' _- ?# F7 N) vA. 企业版
+ o: l( H) S9 O t1 S- S' bB. 工作组版
+ Z7 k: T' `: v# y9 I: EC. 企业扩展版' G( T: |+ l, H% S" {
D. 个人版( E" ~* y. O J/ ]* \- g+ h
E. 卫星版
* Y" D ^" k, X9 N! `F. 微型版- a$ i, b R) s3 |) _( c) G
满分:4 分
- S( m k; r0 d# d- i: T4. 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?
) ?+ f! w2 d# t7 w8 d9 UA. user2.org6 u+ Z8 A7 T0 L( ]1 M0 @2 k/ u
B. org.sample; x3 y, b% ^+ d9 ]
C. sample.org7 x6 D S! r' I1 t! e
D. sample.sample1 K% f5 I( V% I& k3 M
满分:4 分
( y% M, A7 q2 v! M, p: a% a5. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
4 }6 n; O! G2 _, H) u }$ jA. The cursor will remain open after a COMMIT.
1 u4 X" o1 k* }6 CB. All rows retrieved are locked until a COMMIT.5 w) F: _/ }; e6 c; {! d" ~5 X a; b- M( x
C. A COMMIT will not be allowed until the cursor is closed.
+ }9 F. B7 `6 s- l. mD. Locks obtained by the cursor will be kept after a COMMIT.8 G; D. k) u& _! _5 L8 R
满分:4 分+ i% i7 M2 g$ w4 x0 o/ ~
6. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?) T1 p3 H: @+ ^' r
A. NIQUE. Y8 C3 H, N3 b9 X, x0 r+ W7 j
B. ALL% _( P- n1 {7 o/ m5 F
C. EXCEPT2 O Y% b0 ?% [( I$ v; \' |
D. DISTINCT0 u( C: O5 v6 x9 K
满分:4 分
# ] V! ~0 N& \: G5 i9 `7. 如果用户在SQL语句中没有指定数据库对象的SCHEMA,则其缺省的SCHEMA是:9 P% c. Z9 [( O! }& p$ F* [
A. SYSIBM9 }# C' X* {* y8 n2 o9 _2 D+ w& ~
B. SYSCAT
* E- ~7 g1 j! E7 j2 R& c' g, XC. SYSSTAT
1 G C" G" j6 [: hD. 该用户连接到数据库时所使用的用户名& A/ ]) \$ d; v& l q
E. 以上都不对
, p$ P7 ~! @2 ~5 O* g: n8 X 满分:4 分
4 Q" G* U$ n, G$ o8 h% K+ F8 M1 d8. 数据库系统的并发控制的主要方法是采用()制。) l& g9 c! d! _2 M4 ]
A. 拒绝
s# E/ u m) v% W F1 k6 CB. 改为串行
0 o/ x( |% I1 L$ C$ NC. 锁0 J# r; C* W) D, `: H6 G9 C
D. 不加任何控制
% g4 e) `& K& Q# T- @ 满分:4 分
. k W; k i7 i) _ _9 s/ c/ C. O9. 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?# |' z& ^% X* ?% z5 O
A. user tables
# U1 ?4 w! s# I7 VB. server memory
3 Z* s4 G9 I) h" MC. user table space! x& A; k s K2 F. r
D. system catalog tables
: `5 K; D+ e- K8 l 满分:4 分
( {* T! @0 O- M5 s# Q$ w10. 关系模式中各级模式之间的关系为()
. O. m( `; L0 X* _/ xA. 3NF 2NF 1NF W, b$ U9 P7 v$ P2 k' z
B. 3NF 1NF 2NF
. _; r0 w' T* d' eC. 1NF 2NF 3NF
* c5 I& o5 K1 g: S& N2 O9 O$ |D. 2NF 1NF 3NF
- n2 i7 `7 U& N# K* m7 n) J 满分:4 分
$ ]" G, [6 {0 N# A, k' u$ P11. 创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?
4 i" K; [5 S& i# ^% T( l9 AA. 目录2 K; }% [- K' j, s$ _) }3 {6 T
B. 文件/ e# [( X2 B5 S A& `+ S
C. DEVICE
4 @% q8 P" x% G7 H6 W- ^ 满分:4 分5 G8 P4 v! f% I
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上有几个索引?# h( q3 p( U4 x P0 K x# r
A. 0- w+ \9 O. v2 T9 W
B. 1
' H# z7 B* g. V9 J% u9 c2 qC. 2! _' h4 {) A7 G3 o A
D. 30 [2 U. `% F+ h; h! X
E. 4
( j3 g, g& `. e8 |) p3 n 满分:4 分
- M* z, {3 q6 V13. 缺省的数据库日志文件的类型是:
R1 d7 v* E+ NA. Circular Log
, ^$ d |1 |: D2 ]B. Archival Log
9 A$ T2 b) b" ~' ]C. Primary Log; O+ |# {+ |- }( A$ a7 C; G" P
D. Secondary log5 l! B. Q; @, ~/ p \ `
满分:4 分1 n# q7 ]; S, F7 M- L( g. I% a
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?
9 ?' O; m2 S( w5 ]8 n" E7 IA. 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.
5 ]8 A" q% [3 K- f$ ~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.0 n- @4 V& {- f' K z
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.% _/ x- v& L7 h" @8 ^
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.
" X0 |% d- G; b- h: K$ a* a* k' a 满分:4 分2 H R3 U8 L$ `2 G
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语句是哪个?
7 t6 C* N$ Z3 _( O% L% a/ LA. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)
6 V5 w' |2 f" F; z) F5 k: [9 AB. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”)- m7 l, x9 h. f; x4 @: f% I1 `' d
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)" ~. Z' B: c( J
D. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”). G- g& q: C7 o& \% }% }" W
满分:4 分
9 h5 N2 `$ G, a! X16. 数据库系统的独立性是指():2 B+ y! T2 B8 x2 |- ~& b
A. 不会因为数据的变化而影响应用程序
1 u `1 I0 I% q7 y8 h) HB. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序) ?9 Z% s8 P; N4 w4 W
C. 不会因为存储策略的变化而影响存储结构; Q9 ?! t: ?' O3 M6 U; o, ]! W
D. 不会因为某些存储结构的变化而影响其它的存储结构
& X: o9 T, N1 B% r1 V5 B 满分:4 分# j2 X# N. L% T5 Y$ Q* c- c2 K& r, A
17. 若用如下的SQL语句创建一个student表: CREATE TABLE student(NO CHAR(4) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2), AGE NUMBERIC(2))可以插入到student表中的是哪一项?! d" I! ?6 P6 O) S. E- \1 t. @
A. (‘1031’,‘曾华’,男,23)4 @" S& @4 w+ ?- X3 Z. G2 |. i
B. (‘1031’,‘曾华’,NULL,NULL)$ J: ^9 v, @" v; l }
C. (NULL,‘曾华’,‘男’,‘23’)6 {" }- w/ L8 s4 D1 l$ O$ F2 G" n
D. (‘1031’,NULL,‘男’,23)9 G+ ?) ]6 _$ F* |/ F
满分:4 分
* p, D* ?4 q5 f18. 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?3 Y3 N1 M1 H. s- j% I
A. SQLCODE 0, SQLSTATE 000006 X- B2 h+ |5 T: H# A" A6 T5 G
B. SQLCODE 100, SQLSTATE 02000
+ [( U: [+ [! C0 D" qC. SQLCODE -100, SQLSTATE 001004 B1 I' E0 a9 b
D. SQLCODE -501, SQLSTATE 245018 o4 I/ D8 W+ ~' m4 s. y/ I7 f' J3 S4 W
满分:4 分
3 w3 g. H& @+ N. r$ ]5 c19. 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?8 j) U P. ~0 @, R Q
A. One row is inserted in EMPLOYEE) i2 t) f& T. _
B. No rows are inserted in EMPLOYEE2 T$ ^7 R) A( E# f4 j' U
C. Two rows are inserted in EMPLOYEE
2 ^1 ~/ Q7 e$ L8 ?5 a$ ^D. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE" Z! m* \, j! }4 X3 h# y* b4 j
满分:4 分6 E) a" ]7 _" o1 o! d4 U3 I6 m3 [# e `
20. 下列那种隔离级对于只读操作不在数据行上加锁?* H9 Z2 t: J) ^8 ?6 c
A. RR- w5 n/ {- t) e9 p0 B+ q
B. RS
& b8 C! ?- G* m) l; Y% VC. CS
4 E5 o4 \; I! JD. UR6 Y# w- R) q. ]# d) g. [, k0 ?
满分:4 分
# O/ ^, F) R$ L8 Q) Z& n21. 如果想在数据导入的过程中创建表,应该; L" M0 R o I( _* A2 j% W( ?
A. 使用IXF文件格式进行LOAD
7 u9 N) d- Z, [6 h6 sB. 使用WSF文件格式进行LOAD
1 U9 C) ?5 n. @8 k zC. 使用IXF文件格式进行IMPORT
6 B# ^, |$ s5 [0 @; |D. 使用WSF文件格式进行IMPORT X' \' V* c! U' _4 h" K
满分:4 分 @( v8 h/ T4 T
22. 下面哪一工具允许用户开发存储过程?
S* ?! O& K$ @2 V- OA. 控制中心
w$ B' x. G8 E: F0 UB. 命令中心
/ o( b1 H" Q" M( SC. 任务中心6 Z3 g3 y: O4 G- I; a5 g
D. 开发中心
1 C: G8 Z) m" v' A- L7 A% xE. 健康中心. Y0 f" B' t+ Y
满分:4 分
+ ^9 m" ?* M# G$ }- P23. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?8 I6 \" `* H* Q0 Q# W, V1 b3 Y- k
A. SQLDelete()* [* A1 N" N- g, H
B. SQLExecDirect()* m* e) U% k$ V/ m" S
C. SQLBulkDelete()+ Y# x( z1 `" x7 r6 H1 i2 \, i3 E
D. SQLExecuteUpdate()
+ ?5 N% w1 K2 v2 K/ q. Y 满分:4 分; U1 U: j7 a% ~; O$ {( 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?
$ L% x' D- [% G9 R. fA. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);( D* U: i! z0 O$ ~/ p- J
B. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);; V1 v V7 o9 O
C. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
7 h* `4 A( m2 ED. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);4 J& {2 @" ?1 W' @8 W2 \6 B% a# |; Q
满分:4 分
* A* `$ j) _0 n8 p" d25. 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
" U7 n( `, E+ `1 t) m' DA. 10 1 20 2
1 A8 B9 X; b5 \9 G+ @B. 30 1 50 3, g/ r5 M9 B3 x6 |5 e0 o8 L, q) B
C. 30 1 40 3
, m b B- O4 { l$ GD. 10 1 50 3 {8 m* Y% V7 a( U3 T
满分:4 分 |
|