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 III

Q 1 - Suppose we added a new column by using ALTER statement, where the column will be added?

A - Starting of the table

B - End of the table

C - Middle of the table

D - None of these

Answer : B

Explanation

When we use ALTER statement for adding a new column then it will be added at the end of the table.

Q 2 - How you will count the number of rows from a table TAB?

A - SELECT COUNT FROM TAB

B - SELECT MAX(*) FROM TAB

C - SELECT COUNT(*) FROM TAB

D - None of these

Answer : C

Explanation

This is self explanatory.

Q 3 - What is the input to the bind process?

A - DBRM

B - SQL

C - Table Name

D - None of these

Answer : A

Explanation

DBRM is the input to the bind process which is produced in the pre-compile step.

Q 4 - If a transaction has an exclusive lock on some data, then what are the other types of lock which can be applied on it?

A - Shared Lock

B - Update Lock

C - No other locks can be applied

D - None of these

Answer : C

Explanation

A transaction gets an Exclusive lock when it is about to write at that time no other lock can be applied on it.

Q 5 - Which isolation level ensures highest data integrity?

A - Repeatable Read

B - Read Stability

C - Cursor Stability

D - Uncommitted Read

Answer : A

Explanation

Repeatable Read ensures highest data integrity as it holds page and lock the rows until a COMMIT point.

Q 6 - In which isolation level phantom rows can occur?

A - Repeatable Read

B - Read Stability

C - Both A & B

D - None of these

Answer : B

Explanation

In this isolation level other programs can INSERT new data so we can get phantom rows.

Q 7 - Which isolation level provides maximum concurrency?

A - Repeatable Read

B - Read Stability

C - Cursor Stability

D - Uncommitted Read

Answer : D

Explanation

Uncommitted read provides maximum concurrency.

Q 8 - Which command is used to commit a transaction in CICS program?

A - AUTO COMMIT

B - SYNCPOINT

C - ROLLBACK

D - COMMIT

Answer : B

Explanation

SYNCPOINT is used to commit a transaction in CICS program.

Q 9 - Which utility provides statistical information such as the number of pages and rows and stores them in Catalog tables?

A - RUNSTATS

B - REORG

C - RECOVER

D - COPY

Answer : A

Explanation

Runstats utility updated the catalog tables with the statistical information.

Q 10 - Which utility reclaims space from pages when some rows were deleted?

A - RUNSTATS

B - REORG

C - RECOVER

D - COPY

Answer : B

Explanation

Reorg utility is used for reorganization of data on physical storage.

Q 11 - Which utility is used to restore the table space?

A - RUNSTATS

B - REORG

C - RECOVER

D - COPY

Answer : C

Explanation

Recover utility is used to restore the table space.

Q 12 - Which utility is take the backup of table spaces and index spaces?

A - RUNSTATS

B - REORG

C - RECOVER

D - COPY

Answer : D

Explanation

Copy utility is used to take the back up of table spaces and index spaces.

Q 13 - Which utility is used to load data into a table from a sequential file?

A - RUNSTATS

B - REORG

C - RECOVER

D - LOAD

Answer : D

Explanation

Load utility is used to load data into tables.

Q 14 - How the locks can be classified?

A - Size

B - Duration

C - Mode

D - All of these

Answer : D

Explanation

Locks can be classified based on size, duration and mode.

Q 15 - If a transaction takes a Shared lock on some data, then other transactions can get what type of lock?

A - Shared

B - Update

C - Exclusive

D - Both A & B

Answer : D

Explanation

If a transaction takes a Shared lock on some data, then other transactions can get either a Shared or Update lock on it.

Q 16 - If a transaction takes a Update lock on some data, then other transactions can get what type of lock?

A - Shared

B - Update

C - Exclusive

D - Both A & B

Answer : A

Explanation

If a transaction takes an Update lock on some data, then other transactions can only get only Shared lock on it.

Q 17 - What action DB2 takes when a program abends?

A - Auto Rollback

B - Auto Commit

C - Acquire

D - Release

Answer : A

Explanation

When a program abends in middle of some transaction then DB2 performs a auto rollback.

Q 18 - What action DB2 takes when a program executes successfully?

A - Auto Rollback

B - Auto Commit

C - Acquire

D - Release

Answer : B

Explanation

When a program executes successfully it does an auto commit.

Q 19 - Which command is use to drop an existing plan?

A - DROP

B - FREE

C - DELETE

D - None of these

Answer : B

Explanation

FREE command is used to drop an existing plan.

Q 20 - When a table is dropped all the synonyms get dropped automatically. State whether true or false?

A - False

B - True

Answer : B

Explanation

Synonyms get dropped automatically when we drop the table but alias of the table remains there.

Q 21 - When a table is dropped all the alias get dropped automatically. State whether true or false?

A - False

B - True

Answer : A

Explanation

This statement is incorrect. Synonyms get dropped automatically when we drop the table but alias of the table remains there. We need to manually drop the alias.

Q 22 - Log files consist of error logs, which are used to recover from application errors. The logs keep the record of changes in the database. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 23 - One tablespace is associated with one bufferpool. The size of bufferpool and tablespace must be same. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Q 24 - Can we add columns to add table after defining it?

A - No

B - Yes

Answer : B

Explanation

Yes we can add columns after table declaration by using ALTER statement.

Q 25 - Static SQL is compiled and optimized prior to its execution where as dynamic SQL is compiled and optimized during execution. State whether true or false?

A - False

B - True

Answer : B

Explanation

This is self explanatory.

Answer Sheet

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