日期:2014-05-16  浏览次数:20503 次

DB2笔试题
9. 下面哪个语句通配符可以和DB2的LIKE子句一起使用在SELECT语句中?
A. *
B. _
C. @
D. ?
10. 两个数据库表:
       TAB1                              TAB2
  C1       C2                       CX       CY
  ---      ----                     -----    ----
  A        11                       A        21
  B        12                       C        22
  C        13                       D        23      
期望生成下面查询结果:
  C1       C2      CX       CY
  ----     ----    ----     ----
   A       11      A        21
   C       13      C        22
   -       -       D        23
下面哪条语句能产生期望的结果?
A. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
B. SELECT * FROM tab2 FULL OUTER JOIN tab1 ON c1=cx
C. SELECT * FROM tab2 RIGHT OUTER JOIN tab1 ON c1=cx
D. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx
11. 数据库表tbl_log数据量很大,现需要删除其中的所有记录,下面语句哪个是最合适的?
A. delete from tbl_log
B. delete * from tbl_log
C. import from /dev/null of del replace into tbl_log
D. import from /dev/null of del insert_update into tbl_log
12. 给定以下表和视图的定义:
CREATE TABLE T1
(C1 INT, C2 INT, C3 INT,C4 INT, C5 INT);
CREATE VIEW V1 AS
SELECT * FROM T1 WHERE C1=1;
CREATE VIEW V2 AS
SELECT * FROM V1 WHERE C2=1 WITH LOCAL CHECK OPTION;
CREATE VIEW V3 AS
SELECT * FROM V2 WHERE C3=1;
CREATE VIEW V4 AS
SELECT * FROM V3 WHERE C4=1 WITH CASCADED CHECK OPTION;
CREATE VIEW V5 AS
SELECT * FROM V4 WHERE C5=1;
以下哪条语句可以正确执行?
A. INSERT INTO V2 VALUES(2,1,1,1,1)
B. INSERT INTO V2 VALUES(1,2,1,1,1)
C. INSERT INTO V3 VALUES(2,2,1,1,1)
D. INSERT INTO V4(VALUES(1,1,1,2,1)

13. 给出下面信息:
CREATE TABLE tab1 (c1 char(3) WITH DEFAULT NULL, c2 INTEGER);
INSERT INTO tab1(c2) VALUES (345);
如果在命令行处理器(CLP)中执行以下语句,以下哪个结果是正确的?
  SELECT * FROM tab1;
A.                C1  C2
        --- -----------
        0 record(s) selected. 
B.                C1  C2
        --- -----------
        123     &n