DB2 Mock Test



This section presents you various set of Mock Tests related to DB2. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

DB2 Mock Test IV

Q 1 - Locking is a process that is used to ensure data integrity and prevents concurrent users from accessing inconsistent data. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 2 - A buffer pool is the main storage that is reserved to satisfy the buffering requirements for one or more tablespaces or indexes. State whether true or false?

A - False

B - True

Answer : B

Explanation

This statement is correct.

Q 3 - Exclusive locks are taken for INSERT, UPDATE and DELETE purposes. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 4 - Deadlock resolution is done by rolling back one of the transactions which has the least log entries. State whether true or false?

A - False

B - True

Answer : B

Explanation

This statement is correct.

Q 5 - Stored procedures require no message traffic over the network while they are running and they provide high performance. State whether true or false?

A - False

B - True

Answer : B

Explanation

Stored procedures are mainly useful in distributed environment and provide an easy way to call a remote program.

Q 6 - Embedded SQL statements are used in COBOL programs to perform standard SQL operations. Embedded SQL statements are preprocessed by SQL processor before application program is compiled. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 7 - Embedded SQL statements works like normal SQL statements with some minor changes like output of query is directed to pre-defined set of variables which are referred as Host Variables. State whether true or false?

A - False

B - True

Answer : B

Explanation

This statement is correct.

Q 8 - In a COBOL-DB2 program, all the SQL statements must be delimited between EXEC SQL and END-EXEC. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 9 - All SQL statements other than INCLUDE and DECLARE TABLE must appear in Procedure Division. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 10 - Host Variables are used for receiving data from the table or inserting data to the table. Host variables must be declared for all values that are to be passed between program and DB2. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 11 - Host variables cannot be group items but they may be grouped together in host structure. They can be Renamed or Redefined. State whether true or false?

A - False

B - True

Answer : A

Explanation

This statement is incorrect as host variables cannot be renamed & redefined.

Q 12 - SQLCA is a SQL communication area through which DB2 passes feedback of SQL execution to the program. It tells the program whether execution was successful or not. State whether true or false?

A - False

B - True

Answer : B

Explanation

This statement is correct.

Q 13 - Cursors are used to handle single row selections at a time. They are data structure which hold all the results of a query. State whether true or false?

A - False

B - True

Answer : A

Explanation

This statement is incorrect as cursors are used to handle multiple row selections at a time.

Q 14 - Fetch statement identifies the cursor and puts the value in INTO clause. A Fetch statement is coded in loop as we get one row at a time. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 15 - In a COBOL-DB2 program all SQL statements must be coded in Area A. State whether true or false?

A - False

B - True

Answer : A

Explanation

This statement is incorrect as SQL statements must be coded in Area B.

Q 16 - Which component is used to processes SQL statements and selects the access paths?

A - Buffer Manager

B - Data Manager

C - DB2 Optimizer

D - None of these

Answer : C

Explanation

DB2 optimizer is used to select the access paths & to process the SQL queries.

Q 17 - What is the physical storage length of TIME data type?

A - 4 bytes

B - 3 bytes

C - 10 bytes

D - 20 bytes

Answer : B

Explanation

TIME data type takes 3 bytes and default is 'HH:MM:SS'

Q 18 - What is the physical storage length of DATE data type?

A - 4 bytes

B - 3 bytes

C - 10 bytes

D - 20 bytes

Answer : A

Explanation

DATE data types take 4 bytes and default is 'YYYY-MM-DD'

Q 19 - What is the physical storage length of TIMESTAMP data type?

A - 4 bytes

B - 3 bytes

C - 10 bytes

D - 20 bytes

Answer : C

Explanation

TIMESTAMP data type takes 10 bytes and default is YYYY-MM-DD:HH:MM:SS-NNNNNN

Q 20 - Which utility is used to execute a COBOL-DB2 program?

A - IGYCTCRL

B - IKJEFT01

C - RUN

D - None of these

Answer : B

Explanation

IKJEFT is used to execute a COBOL-DB2 program. Program name is mentioned with PLAN name & Library where program resides.

Q 21 - Which field in SQLCA shows the number of updated rows after update statement?

A - SQLCODE

B - SQLERRM

C - SQLERRD

D - None of these

Answer : C

Explanation

Check the value of SQLERRD to know how many rows got updated after an update statement.

Q 22 - In which step we specify the isolation level?

A - Pre-compilation Step

B - Bind Step

C - Compilation Step

D - None of these

Answer : B

Explanation

In Bind step we specify the isolation level.

Q 23 - On which level we can apply the locks?

A - Page

B - Table

C - Table space

D - All of these

Answer : D

Explanation

Locking can be applied on either of these - Page, table and table space.

Q 24 - What SQLCODE you will get for a successful execution of query?

A - 100

B - 0

C - -100

D - Blank

Answer : B

Explanation

You will get SQLCODE = 0 if the execution is successful.

Q 25 - What is the picture clause of Null Indicator variable?

A - S9(8) COMP

B - S9(4)

C - S9(4) COMP

D - S9(8)

Answer : C

Explanation

S9(4) COMP is the picture clause of a null indicator.

Answer Sheet

Question Number Answer Key
1 B
2 B
3 B
4 B
5 B
6 B
7 B
8 B
9 B
10 B
11 A
12 B
13 A
14 B
15 A
16 C
17 B
18 A
19 C
20 B
21 C
22 B
23 D
24 B
25 C
db2_questions_answers.htm
Advertisements