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 physical objects?

A - Table space

B - Database

C - Views

D - Both A & B

Answer : D

Explanation

Database and Table space are physical objects.

Answer : D

Explanation

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

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

Answer : D

Explanation

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

Q 6 - 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 7 - 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 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 - 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 - 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.

db2_questions_answers.htm
Advertisements