DB2 Online Quiz


Advertisements


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 - How many databases can a DB2 system manage?

A - 1 database

B - 65279 databases

C - 10 databases

D - Unlimited

Answer : B

Explanation

This is self explanatory.

Answer : D

Explanation

The purpose of index is to retrieve the data faster. So we choose those columns which are unique or less frequently updated.

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 : A

Explanation

When no rows are found or you reach the end of cursor, then you will get SQLCODE = 100

Q 5 - Which operation is not associated with cursor?

A - Declare

B - Open

C - Read

D - Close

Answer : C

Explanation

We do not use read statement with cursor instead we use fetch statement.

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


db2_questions_answers.htm

Advertisements