Db2cert5v8 Sample

download Db2cert5v8 Sample

of 4

Transcript of Db2cert5v8 Sample

  • 8/14/2019 Db2cert5v8 Sample

    1/4

    DB2 UDB V8.1 Family Fundamentals

    Working with DB2 UDB Objects: Sample Questions

    1) If table1 is defined as follows:CREATE TABLE table1 ( id integer NOT NULL,

    name varchar(20) WITH DEFAULT )

    Which INSERT statement will fail?a.INSERT INTO table1 (id) VALUES (1)b.INSERT INTO table1 (name) VALUES (tom)c.INSERT INTO table1 (id, name) VALUES (2, julia)d.INSERT INTO table1 VALUES (3, ann)

    2) If the following statement is executed:CREATE TABLE newtable LIKE table1

    Which of the following is copied from table1?a. indexesb. data types definitionsc. triggersd. data

    3) What is the difference between a primary key and a unique index?a. There is no differenceb. Primary keys are defined on child tablesc. The column(s) used for a unique index can contain NULL valuesd. Primary keys can only be defined using one column

    4) When defining a referential constraint, what type of key is defined on the childtable?

    a. foreignb. compositec. uniqued. primary

    5) When defining a referential constraint, which delete rule will allow rows in theparent table to be deleted when rows in the child table exist?a. restrict

    b. no actionc. set nulld. keep

    Working with DB2 UDB Objects: Sample Questions 1

  • 8/14/2019 Db2cert5v8 Sample

    2/4

    DB2 UDB V8.1 Family Fundamentals

    6) What is one good reason for storing column data with the index key?a. It is requiredb. To make the index more uniquec. There is extra spaced.

    Improve the performance of some queries

    7) For the following statements:CREATE TABLE phonebook ( nameid int,

    name varchar(50),

    address varchar(200),

    phone char(10))

    CREATE UNIQUE INDEX nameindex ON phonebook (nameid) INCLUDE

    (phone)

    What will be stored with the index key?

    a. nameb. nameidc. addressd. phone

    8) Given the following statements:CREATE TABLE students ( studentid integer NOT NULL,

    course char(4),

    CONSTRAINT courses

    CHECK ( course IN (MATH, CHEM, ENG1, HIST))

    NOT ENFORCED ENABLE QUERY OPTIMIZATION )

    Which INSERT statement will NOT fail?a.INSERT INTO students VALUES (11111, MATH)b.INSERT INTO students VALUES (22222, MATH)c.INSERT INTO students VALUES (22222, CHEM)d.INSERT INTO students VALUES (11111, GEOG)

    9) When defining a referential constraint, which delete rule will delete related rowsin dependent tables when a row in the parent table is deleted?

    a. restrictb. set nullc. cascaded. no action

    Working with DB2 UDB Objects: Sample Questions 2

  • 8/14/2019 Db2cert5v8 Sample

    3/4

    DB2 UDB V8.1 Family Fundamentals

    10)Which of the following command is not valid?a. CREATE INDEXb. ALTER TABLEc. DROP INDEXd.

    ALTER VIEW

    Working with DB2 UDB Objects: Sample Questions 3

  • 8/14/2019 Db2cert5v8 Sample

    4/4

    DB2 UDB V8.1 Family Fundamentals

    Answers:

    1. b2. b3. c4. a5.

    c6. d

    7. d8. a9. c10.d

    Working with DB2 UDB Objects: Sample Questions 4