DB2 Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to DB2. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following are logical objects?

A - Table space

B - Tables

C - Views

D - Both B & C

Answer : D

Explanation

Tables, Views, Synonyms and Alias are logical objects which are used by users and developers.

Q 2 - Which of the following can refer to both local as well as remote tables?

A - Synonyms

B - Alias

C - Both A & B

D - None of these

Answer : B

Explanation

Alias can refer to both local as well as remote tables whereas synonyms refers only to local tables.

Q 3 - Write a query to delete a table TAB from database.

A - DELETE TABLE TAB

B - DELETE TAB

C - DROP TAB

D - DROP TABLE TAB;

Answer : D

Explanation

DROP TABLE table-name is the syntax to delete a table from database.

Answer : C

Explanation

Bind step converts all the SQL statements into executable form in COBOL-DB2 program.

Answer : D

Explanation

When you will try to insert or update a record with duplicate key then you will face SQLCODE = -803

Q 6 - 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 7 - 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 8 - 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 9 - 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 10 - 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.

db2_questions_answers.htm
Advertisements