Database 版 (精华区)

发信人: superman (☆风雨无阻☆), 信区: Database
标  题: DB2 Application Development Sample Test (2)
发信站: 紫 丁 香 (Sat Sep 19 15:48:57 1998), 转信

1. Given the statement
 
   CREATE TABLE userid.test (
     date_taken   DATE NOT NULL,
     number       SMALLINT NOT NULL,
     PRIMARY KEY (number))
 
   Which will be the schema name for the table:
        a) date_taken
        b) number
        c) test
        d) userid
  
2. The following tables exist in the database:
 
        db2.staff
     userid.staff

    An application issues the dynamic SQL call "select * from staff".
    What determines the table which will be accessed?

        a) the userid of the binder of the package
        b) the userid connected to the database
        c) the userid of the precompiler of the package
        d) the userid specified in the db2cli.ini file
        e) the userid of the creator of the staff table
  
3. Assume the following tasks completed successfully: 
        User1 issues PREP connect.sqx PACKAGE
        User2 issues PREP connect.sqx BINDFILE
        User2 issues PREP connect.sqx PACKAGE USING connect
 
    How many packages would exist in the database?

        a) 0
        b) 1
        c) 2
        d) 3
 
4. What is the purpose of the COLLECTION parameter of precompile/bind
   parameter?
 
        a) define the name of the package
        b) provide an alias for the package
        c) define the schema of the package
        d) define the database of the package
  
5. An application consists of five program modules:
 
     2 modules contain embedded dynamic SQL Statements
     1 module contains embedded static  SQL Statements
     2 modules contain embedded dynamic SQL Statements
 
   How many application packages will be created in the database?

        a) 1
        b) 2
        c) 3
        d) 4
        e) 5
 
6. Which system catalog view can be used to determine when a bind   
   operation was performed on a given package?
  
        a) SYSCAT.PRECOMPILE
        b) SYSCAT.PACKAGES
        c) SYSCAT.BIND
        d) SYSCAT.TIMESTAMP
        e) SYSCAT.ACCESSPLAN
  
7. Which of the following programming methods will store an access plan within
   the database?
 
        a) Embedded Dynamic SQL
        b) Embedded Static SQL
        c) Call Level Interface (CLI)
  
8. What authority or privilege can bind an application to the database for 
   the first time?
 
        a) EXECUTE privilege on the package
        b) SYSADM authority for the DB2 instance
        c) BIND privilege on the package
        d) BINDADD authority for the database
 
9. Which of the system catalogs would contain locking information for an
   embedded static SQL statement?
 
        a) SYSCAT.TABLES
        b) SYSCAT.PACKAGES
        c) SYSCAT.ISOLATION
        d) SYSCAT.LOCKS
  
10. Which of the following programming method would you use if you want to
    restrict access to specific columns in your data?
 
        a) Embedded Dynamic SQL
        b) Embedded Static SQL
        c) Call Level Interface (CLI)
  
11. What is the easiest method using DB2 to ensure that a columns values
    remain within a predetermined range?
 
        a) define a primary key on the column
        b) define a foreign key on the column
        c) define a table check constraint
        d) define an insert constraint
  
12. Given the following data from the SYSCAT.PACKAGES catalog table:
 
            pkgschema  pkgname   isolation     blocking
                USER1  CONNECT   RR            N
 
    Which of the following commands was executed by user1 to create this entry
    in the catalog tables?

        a) BIND user1.bnd BLOCKING UNAMBIG
        b) BIND connect.bnd COLLECTION RR
        c) BIND connect.bnd COLLECTION user1 ISOLATION RR
        d) BIND connect.bnd ISOLATION RR BLOCKING NO
  
13. Given the table:
 
    table1
      id     description   price
     101     Bolts          0.25
     102     Nuts           0.11
     103     Lock Washer    NULL
 
    and the statement
 EXEC SQL INSERT INTO table1 VALUES (:hvid, :hvdesc, :hvpr  :hvprind);
 
  To insert a new item with no price using the statement above, what 
  should the host variable hvprind be set to?
  
        a) -1
        b) 0
        c) NULL
 
14)  Given the table:
 
    table1
      id     description   price
     101     Bolts          0.25
     102     Nuts           0.11
     103     Lock Washer    NULL
 
    and the statement
 EXEC SQL INSERT INTO table1 VALUES (:hvid, :hvdesc, :hvpr  :hvprind);

  To insert a new item with no price, when should the host variable hvprind 
  be set by the application?
  
        a) before the statement is executed
        b) after the statement is executed
        c) does not matter
 
15. How many rows can be retrieved using a SELECT INTO statement in an
    application?
 
        a) none
        b) 1
        c) 2
        d) unlimited
  
16. Which of the following statements uses embedded dynamic SQL?
 
        a) SELECT col1 INTO :hv from table1
        b) DECLARE c1 CURSOR FOR s1
        c) DECLARE c1 CURSOR for SELECT col1 INTO :hv FROM table1
        d) IMMEDIATE SELECT col1 INTO :hv FROM table1
 
17. Which type of cursor should be used so that its position will be
    maintained between transactions?
 
        a) FOR HOLD
        b) FOR UPDATE
        c) FOR FETCH
        d) WITH HOLD
 
18. When can cursors be used to begin accessing data from the database?
 
        a) after the cursor has been declared
        b) after the cursor's host variable has been initialized
        c) after the cursor has been opened
        d) after the first fetch has occurred
  
19. Why would you declare a cursor FOR READ ONLY or FOR FETCH ONLY?
 
        a) change the locking semantics
        b) ensure the bufferpool is used
        c) make the cursor unambiguous to enable record blocking
        d) ensure the optimizer knows the statement is a select statement
  
20. What occurs when you close a cursor?
 
        a) the transaction is rolled back
        b) the transaction is committed
        c) the cursor is available to be used in a subsequent fetch
        d) the cursor must be reopened to be used in a subsequent fetch
 
21. How would you determine you are at the end of the result set?
 
        a) check the NULL indicator host variable after each fetch
        b) check the SQLCA after closing the cursor
        c) check the SQLCA after each fetch
        d) check the SQLDA after each fetch
 
22. How should a host variable be defined to be used as a NULL indicator?
 
        a) boolean
        b) integer
        c) character
        d) binary large object
  
Answer Key - DB2 Application Development
 
1.   D
 
2.   B
 
3.   C
 
4.   C
 
5.   E
 
6.   B
 
7.   B
 
8.   B,D
 
9.   B
 
10.  B
 
11.  C
 
12.  D
 
13.  A
 
14.  A
 
15.  B
 
16.  B
 
17.  D
 
18.  C
 
19.  C
 
20.  D
 
21.  C
  
22.  B 


--
     朋友一生一起走  那些日子不再有
     一句话  一辈子  一生情  一杯酒
     朋友不曾孤单过  一声朋友你会懂
     还有伤  还有痛  还要走  还有我

※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: aceraltos.hit.ed]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:214.355毫秒