|
吉大11春学期《数据库应用技术》在线作业二资料 X$ l9 ?: C/ P, d- U
在线作业, 数据库, 单选题, 资料
- W* ~9 s8 o+ R7 }一、单选题(共 25 道试题,共 100 分。)V 1. 在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?1 A. S: t$ a8 c4 [2 D0 t
A. ORDER BY子句
# l2 H; k+ T8 X9 I. ~B. WHERE子句
5 k1 C7 X" H2 J/ S& r, yC. GROUP BY子句9 h7 m! u6 r9 T0 B: E' g N
D. 均不需要
6 A6 @4 k* Y4 t+ K0 b 满分:4 分/ E: l( }: y0 o, a% {9 u6 U7 d
2. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?4 {2 O S& V# Z$ ]. L$ d9 d
A. The cursors are unambiguous.9 i" E: @# c0 R1 U& }
B. Only the first row is returned.3 ^/ p' q* c, |# v9 F
C. Cursor stays open after a commit.5 U% \2 Z. l% e7 J3 r2 P
D. A temporary table is created on the server.& h: g" o$ d6 V3 U4 P
满分:4 分9 ^$ Y; _5 o0 c2 o% a5 r
3. 对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?' U9 v( n* I- z. ~8 ?7 |! X
A. 企业版$ B; k* ?/ J1 w; _7 A6 w
B. 工作组版
~0 o {! q0 }7 w1 P6 ?' S" ?C. 企业扩展版
# V3 y5 Z$ L# k& Q8 Q) AD. 个人版0 f) K8 q9 Z* c- H8 _3 H4 `% z
E. 卫星版6 }% J8 c5 i0 C( {( I
F. 微型版" k$ \4 z" n4 S: O& \0 k1 |* U
满分:4 分
$ g" z5 c$ m" }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?9 |6 {7 V" s' a* _
A. user2.org
- m9 G. E/ c. r) ]! t) P3 WB. org.sample
; e- b+ u7 H+ b/ j3 |% ]C. sample.org8 T) Q( ^9 A3 Q' b# |% D. r
D. sample.sample
1 _; g/ B% c$ I 满分:4 分
, m4 }/ A/ ]! d! G8 A! y+ e5. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
" J+ q5 r+ }0 [9 \A. The cursor will remain open after a COMMIT.
+ ?! }+ y( o* YB. All rows retrieved are locked until a COMMIT.! N `' R7 n: u* U/ q7 a' w9 J
C. A COMMIT will not be allowed until the cursor is closed.
8 Z; Y* E1 i. I* E" E# GD. Locks obtained by the cursor will be kept after a COMMIT." G+ `& ^! o- M. c/ f8 A9 b0 n
满分:4 分
2 M; j5 A% r5 \: G' p9 y6. 使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT子句中使用什么保留字?# T1 H$ H& L" K7 h
A. NIQUE! O! L5 x# h& `' }
B. ALL
3 z P) [6 _( a" g/ _C. EXCEPT
! }4 {9 k3 c. pD. DISTINCT
# x- F) y4 @/ y; `, m 满分:4 分
+ m- u. A" u+ u/ z7. 如果用户在SQL语句中没有指定数据库对象的SCHEMA,则其缺省的SCHEMA是:
; o+ t- \8 L* m' Z; IA. SYSIBM% [ u. Q d# G. w( x' m
B. SYSCAT
) O( D% j, i4 R1 [! f9 x' t9 {C. SYSSTAT( s* n4 T* L, q7 F
D. 该用户连接到数据库时所使用的用户名
1 ~( i. h+ e2 y2 M u# VE. 以上都不对
! e5 K; d2 `" S 满分:4 分
% n( e" t/ k4 Z- u8. 数据库系统的并发控制的主要方法是采用()制。: c3 Q% k3 U& D9 g
A. 拒绝
Y9 f3 L0 s9 \) EB. 改为串行
# z& R1 F s% |$ _* QC. 锁
' j9 @$ y5 F( T) p. ~8 I2 c3 J$ |D. 不加任何控制# y0 W' c2 w. m- v {
满分:4 分
4 T, A* N0 F7 a; }2 ~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?' h9 K' l% `9 H# [
A. user tables& K" N g. i& x1 \2 d# U
B. server memory
& t! r5 J' H& B# SC. user table space
, ^" L: Q& I& K9 h) kD. system catalog tables
2 C- O7 |( |! M* ~3 H 满分:4 分
( K9 k- T4 k$ H* L, q10. 关系模式中各级模式之间的关系为()/ U X, O" {; G/ O, i2 t T
A. 3NF 2NF 1NF* E+ C: q, L1 X5 I
B. 3NF 1NF 2NF9 l* v& B! B9 p {6 k) h
C. 1NF 2NF 3NF# T+ H V8 x' R: Z$ V N8 y
D. 2NF 1NF 3NF1 x2 J, N/ {% B, A& {
满分:4 分3 v4 J% E l7 U% L2 N3 }+ T. I$ G
11. 创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?
# F. G/ K5 q7 f: C% Q# S2 GA. 目录
P i4 ]1 h" h, YB. 文件
' o2 D. o3 u2 G6 E# d* l& U+ dC. DEVICE- X+ g. I) j7 u# G" w( {3 O$ V
满分:4 分$ v7 t, c2 o Q, J
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上有几个索引?- r* G7 z& v& N& c
A. 01 B& U K4 O6 _& L. S. [2 `6 r% `
B. 1
) l3 {, H2 o1 A& V. EC. 2. c) \$ p, }; o9 _8 h1 T, G& @
D. 37 I& e K% M2 g! i
E. 4
7 c* N8 V$ H2 x7 `# x0 {9 n/ X 满分:4 分4 R( _8 O: j @: _' H& q% L4 W( {
13. 缺省的数据库日志文件的类型是:
" F& N# v2 O; N' [: l- V" q iA. Circular Log7 Q! P. l+ g4 ~# A) h( |& E
B. Archival Log
- D2 i" m# g$ b; a% x- ~C. Primary Log2 m6 H; A6 ?5 v5 P) h9 M2 ?! X
D. Secondary log# s) O1 _- f" Q
满分:4 分
: @' Y0 z: T/ J, G" n2 D$ N14. 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?
; M* J/ i- C0 `* GA. 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.
) y- s* Z9 d, ^8 v* K* \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. X. i. C+ t) r# i" [ c
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./ }: r3 s& k/ p5 ^7 n1 S+ l
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.
' b) E/ b$ {- Q& P! P. d: f 满分:4 分
, w! k' n; W/ Z5 R15. 给定三个表:学生表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语句是哪个?
4 ?1 z* G8 [, P- K$ B5 D0 l% q5 } kA. SELECT S# FROM SC WHERE C#=“C2” AND GRADE >= (SELECT GRADE FROM SC WHERE C#=” C2”)
1 r% D8 U$ q& hB. SELECT S# FROM SC WHERE C#=”C2” AND GRADE IN (SELECT GRADE FROM SC WHERE C#=”C2”) S% T7 a1 y5 h$ j
C. SELECT S# FROM SC WHERE C#=”C2” AND GRADE NOT IN (SELECT GRADE FROM SC WHERE C#=”C2”)
2 u( B* z b0 M2 dD. SELECT S# FROM SC WHERE C#=”C2” AND GRADE>=ALL (SELECT GRADE FROM SC WHERE C#=”C2”)
* e+ k2 k1 c/ ^& x7 l% u 满分:4 分5 _3 u/ b8 q* L7 R! X$ ?; g: A0 L0 Y
16. 数据库系统的独立性是指():) t" d6 w* N' }3 {, ~. z. y4 B6 h
A. 不会因为数据的变化而影响应用程序5 F8 D* s# M- V" N+ @
B. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序" ?- U2 h, z5 S+ x+ J. y
C. 不会因为存储策略的变化而影响存储结构, x+ f* E4 }* C' {3 p4 L* j
D. 不会因为某些存储结构的变化而影响其它的存储结构
& f" W0 o2 Q/ x3 ^" R1 A, p 满分:4 分
; `' y. V p4 ~17. 若用如下的SQL语句创建一个student表: CREATE TABLE student(NO CHAR(4) NOT NULL, NAME CHAR(8) NOT NULL, SEX CHAR(2), AGE NUMBERIC(2))可以插入到student表中的是哪一项?4 [- T( @( q( b. E( U' V
A. (‘1031’,‘曾华’,男,23)
# ?8 l: g, w7 P5 ~B. (‘1031’,‘曾华’,NULL,NULL)
9 H9 S" E& F4 c( {% }4 K% Q# @C. (NULL,‘曾华’,‘男’,‘23’)
8 {/ g0 l9 y2 e& a* sD. (‘1031’,NULL,‘男’,23)
. U6 _. D1 t# ` ? 满分:4 分7 |% Q9 N3 e* k# W( L
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?
9 v: p+ M6 E$ C. _& gA. SQLCODE 0, SQLSTATE 000009 x( L c% {2 o8 p+ V
B. SQLCODE 100, SQLSTATE 02000
& k* K+ v! A+ i5 bC. SQLCODE -100, SQLSTATE 00100
& h% o& d/ w* R5 _- Y' AD. SQLCODE -501, SQLSTATE 245015 u) r4 G e8 u1 h( y/ J
满分:4 分/ D8 ]1 ~0 t2 ?, _
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?4 R- k- A* X5 M$ u5 x8 Y
A. One row is inserted in EMPLOYEE* Q; U' m. \2 Y' u+ y( K# \4 G
B. No rows are inserted in EMPLOYEE
" W7 O! I5 g' R0 l- l. w3 l: wC. Two rows are inserted in EMPLOYEE
7 V) \2 b& X' o; c4 GD. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE
! [1 r! G! L1 H 满分:4 分1 e! q( A6 x/ L) J5 D6 @
20. 下列那种隔离级对于只读操作不在数据行上加锁?
' z8 s1 u& z- Y6 b8 xA. RR$ U; W& s5 Q2 Z/ i4 d2 x
B. RS
, |0 e4 m* `9 S- YC. CS5 ~ \) v) P. _6 {7 V/ S
D. UR
$ M: Q l: i- U9 {: C: B5 C' u8 } 满分:4 分5 y5 E Y: d) {5 j1 c
21. 如果想在数据导入的过程中创建表,应该! G- k6 e& C# x, v z
A. 使用IXF文件格式进行LOAD
; T/ c5 Z+ a6 H6 a- d: h7 i# iB. 使用WSF文件格式进行LOAD
' f' j- j, k7 R3 \& v. M& o% M9 vC. 使用IXF文件格式进行IMPORT! Q+ n/ ]/ t4 [2 ?. }, ~
D. 使用WSF文件格式进行IMPORT
1 ]& ~9 G- x z4 R% W$ L4 W( V 满分:4 分
. k) E5 ]2 Q# }$ E4 K4 p22. 下面哪一工具允许用户开发存储过程?
1 ?/ {& s* O; h) dA. 控制中心- X3 u3 }9 P& n* p# X6 b/ ^; _
B. 命令中心" @& k6 C1 A) L' l# F
C. 任务中心
; A/ R- c) h5 s, U" q9 _% d" L$ K3 Q2 bD. 开发中心
0 @% {* k2 w, tE. 健康中心, z& W( b2 K& z3 O
满分:4 分! R9 s' q- H8 M6 c3 E
23. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?
) }5 Y0 m; n1 R* z. bA. SQLDelete()
3 z* j F. v% D: |+ QB. SQLExecDirect()
6 F w3 _" R" d/ F/ \9 F, F1 XC. SQLBulkDelete()" k" C5 @+ K$ h. c
D. SQLExecuteUpdate()
5 f" C/ H$ g1 H/ h 满分:4 分
. g" k4 i# v9 ^; K K+ q24. 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?* R7 {% q2 U/ S7 H% o
A. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);5 _- m T) ?* \7 M' m. ^
B. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);& B/ T7 H! ]8 |- e: u+ `
C. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);3 h7 ?% S6 ^( G! W( I: w9 K
D. String sql = "UPDATE employee SET salary=salary*?WHERE workdept=?"; statement stmt=con.createStatement(sql);
4 e2 Z6 u. N5 ]" V8 f 满分:4 分
6 B- d7 }: u7 c% V) L4 d6 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 c25 A6 n! t& N5 Y
A. 10 1 20 29 `5 `) b7 j( j6 [/ a
B. 30 1 50 31 i; {# g9 l2 }! l8 D
C. 30 1 40 3
$ y1 h0 w, ]! q5 U5 ^" BD. 10 1 50 3- d/ m: Q2 c- \& Z9 m+ M0 w6 M
满分:4 分 |
|