Section 7.19. Review Questions


7.19. Review Questions

1:

Consider the following instructions/commands/statements:

 Login to your Linux server as user JDOE su db2inst1 (switch user to db2inst1) CONNECT TO sample USER foo USING bar SELECT * FROM t1 

Which table will you select data from?

  1. JDOE.t1

  2. db2inst1.t1

  3. foo.t1

  4. bar.t1

2:

Which of the following is not created when you create a database?

  1. IBMDEFAULTBP

  2. IBMDEFAULTSPACE

  3. IBMDEFAULTGROUP

  4. SYSCATSPACE

  5. IBMTEMPGROUP

3:

Which of the following objects will ensure rows are assigned a unique value across multiple tables?

  1. Identity column

  2. Unique index

  3. Sequence

  4. Row ID

4:

Which of the following commands will delete all rows from the table t1 without logging?

  1. Truncate table

  2. Delete * from t1 no log

  3. Alter table t1 activate not logged initially with truncate

  4. Alter table t1 activate not logged initially with empty table

5:

To ensure that a column can contain only the values T or F, which option should you choose?

  1. Create a unique index on the column.

  2. Create a check constraint on the column.

  3. Specify the column as NOT NULL.

  4. Create a view on the table.

6:

When deleting a row from a table that has a primary key defined, which of the following options on a foreign key clause will delete all rows with the same value in the foreign key table?

  1. Restrict

  2. Cascade

  3. Drop

  4. Set NULL

7:

Which two of the following can be referenced by a foreign key constraint?

  1. Unique index

  2. Unique constraint

  3. Check constraint

  4. Primary key

  5. Identity column

8:

Given the table created as follows:

 CREATE TABLE product (        productno   INTEGER GENERATED ALWAYS AS                            IDENTITY (START WITH 0 INCREMENT BY 5),        description VARCHAR(50) ) 

And these statements:

 INSERT INTO product VALUES (DEFAULT,'banana') INSERT INTO product (description) VALUES ('apple') INSERT INTO product VALUES (300,'pear'); 

How many rows will be in the table?

  1. 0

  2. 1

  3. 2

  4. 3

9:

Consider the following statement.

 CREATE TABLE wqwq (c1 DECIMAL) 

What will the precision and scale be for column c1?

  1. Precision = 15, scale = 0

  2. Precision = 15, scale =15

  3. Precision = 5, scale = 0

  4. Precision = 5, scale = 10

10:

Which of the following is not a supported type of trigger?

  1. INBETWEEN

  2. AFTER

  3. INSTEAD OF

  4. BEFORE

11:

Which of the following does not belong to a database?

  1. Schema

  2. Logs

  3. Registry variables

  4. System catalogs

12:

Consider the following statement.

 CREATE TABLE foo (c1 INT NOT NULL PRIMARY KEY, c2 INT) 

How many database objects are created?

  1. 1

  2. 2

  3. 3

  4. 4

13:

Consider the following db2nodes.cfg file.

 0 mysrv1 0 1 mysrv1 1 2 mysrv2 0 3 mysrv2 1 

How many servers are the partitions running on?

  1. 1

  2. 2

  3. 3

  4. 4

14:

Which of the following objects cannot be created in a large table space?

A. Data

A. Index

A. LONG VARCHAR

A. LOB

15:

To create the table space ts1 successfully in the database sample, place the following steps in the correct order.

 1. CREATE TABLESPACE ts1 PAGESIZE 16K BUFFERPOOL bp1 2. CONNECT TO sample 3. CREATE BUFFERPOOL bp1 SIZE 100000 PAGESIZE 16K 

  1. 1, 2, 3

  2. 3, 2, 1

  3. 2, 1, 3

  4. 2, 3, 1

16:

Which of the following objects' definitions can be altered by using the ALTER statement?

  1. Table

  2. View

  3. Index

  4. Schema

17:

A package contains which of the following? (Choose all that apply.)

  1. Executable SQL statements

  2. The access path that the DB2 optimizer chooses to retrieve the data

  3. A collection of stored procedures and functions

  4. A list of bind files

18:

Tables with the same name can be created within the same database by creating them in which of the following?

  1. Different partitions

  2. Different partition groups

  3. Different table spaces

  4. Different schemas

19:

Which of the following can be used to obtain the next value of the sequence seq1? (Choose all that apply.)

  1. seq1.nextValue

  2. NEXTVAL FOR seq1

  3. NEXT VALUE FOR seq1

  4. seq1.next

20:

Which of the following statements is true?

  1. A user temporary table space is created with the create temporary table statement.

  2. The creation of a user temporary table space will fail if no system temporary table space is available.

  3. A user temporary table is created in TEMPSPACE1.

  4. A user temporary table space is needed so that declared global temporary tables can be declared.



Understanding DB2(R. Learning Visually with Examples)
Understanding DB2: Learning Visually with Examples (2nd Edition)
ISBN: 0131580183
EAN: 2147483647
Year: 2004
Pages: 313

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net