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 - Can a DB2 system have more than one databases?

A - No

B - Yes

Answer : B

Explanation

Yes, a DB2 system can have more than one database.

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 the query to delete all the rows from a table TAB.

A - DELETE TAB;

B - DELETE * FROM TAB;

C - DELETE * FROM TABLE TAB;

D - DROP * FROM TAB;

Answer : B

Explanation

DELETE * FROM table-name is the syntax to delete all the rows from a table.

Q 4 - What does a negative SQL code indicates?

A - Exception

B - Failure

C - Success

D - None of these

Answer : B

Explanation

A negative SQL code indicates a failure while a positive one indicates an exception.

Answer : C

Explanation

If a user is not authorized to access DB2 objects, he will face SQLCODE -922.

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 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 8 - 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.

Q 9 - 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 10 - 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'

db2_questions_answers.htm
Advertisements