- DB2 Tutorial
- Home
- DB2 - Introduction
- DB2 - Server Installation
- DB2 - Instance
- DB2 - Databases
- DB2 - Bufferpools
- DB2 - Tablespaces
- DB2 - Storagegroups
- DB2 - Schemas
- DB2 - Data Types
- DB2 - Tables
- DB2 - Alias
- DB2 - Constraints
- DB2 - Indexes
- DB2 - Triggers
- DB2 - Sequences
- DB2 - Views
- DB2 with XML
- DB2 - Backup and Recovery
- DB2 - Database Security
- DB2 - Roles
- DB2 - LDAP
- DB2 Useful Resources
- DB2 - Questions and Answers
- DB2 - Quick Guide
- DB2 - Useful Resources
- DB2 - Discussion
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.
DB2 Mock Test II
Q 1 - What is the maximum size of a CHAR data type in DB2?
Answer : C
Explanation
Char data type maximum size is of 254 bytes.
Q 2 - Write the query to delete all the rows from a table TAB.
Answer : B
Explanation
DELETE * FROM table-name is the syntax to delete all the rows from a table.
Q 3 - Write a query to delete a table TAB from database.
Answer : D
Explanation
DROP TABLE table-name is the syntax to delete a table from database.
Answer : B
Explanation
A table can have only one primary key.
Q 5 - In which statement you can define primary key?
Answer : D
Explanation
Primary keys are optional and we can define them in CRETAE TABLE & ALTER TABLE statements.
Q 6 - Which statement is used to authorize access on database tables?
Answer : D
Explanation
GRANT keyword is used to grant privileges on DB2 tables.
Q 7 - Which statement is used to revoke the access from a database?
Answer : C
Explanation
REVOKE statement is used to take away the permissions from a Database.
Q 8 - What does DCLGEN stands for?
Answer : B
Explanation
DCLGEN stands for Declaration Generator.
Q 9 - What does a negative SQL code indicates?
Answer : B
Explanation
A negative SQL code indicates a failure while a positive one indicates an exception.
Q 10 - What does a positive SQL code indicates?
Answer : A
Explanation
A negative SQL code indicates a failure while a positive one indicates an exception.
Q 11 - What does DBRM stands for?
Answer : B
Explanation
DBRM stands for Database Request Module which contains SQL statements.
Q 12 - What happens in BIND step in a DB2 program?
A - Bind step checks for data type matches
B - Bind contains SQL statements
Answer : C
Explanation
Bind step converts all the SQL statements into executable form in COBOL-DB2 program.
Q 13 - Suppose a Plan contains 4 Packages & we modified one of the DBRM which is present in one of the Package. Then for normal functionality of application what should we do?
Answer : C
Explanation
We will bind only that package which contains the modified DBRM. No need to bind all the packages.
Answer : C
Explanation
Application plan consists of one or more DBRM & application package which is kept in buffer pool during program execution.
Q 15 - When you will face SQLCODE 100?
A - No Rows found satisfying the SQL statement or End of Cursor
Answer : A
Explanation
When no rows are found or you reach the end of cursor, then you will get SQLCODE = 100
Q 16 - When you will face SQLCODE -204?
A - No Rows found satisfying the SQL statement or End of Cursor
Answer : B
Explanation
When object is not defined and you are using it then you will see SQLCODE = -204
Q 17 - When you will face SQLCODE -805?
A - No Rows found satisfying the SQL statement or End of Cursor
Answer : C
Explanation
You will face SQLCODE = -805 when program has not been binded to the plan.
Q 18 - When you will face SQLCODE -803?
A - No Rows found satisfying the SQL statement or End of Cursor
Answer : D
Explanation
When you will try to insert or update a record with duplicate key then you will face SQLCODE = -803
Q 19 - When you will face SQLCODE -811?
Answer : A
Explanation
You will face -811 SQLCODE when the SELECT query returns more than one number of rows.
Q 20 - When you will face SQLCODE -911?
Answer : B
Explanation
At the time of deadlock or timeout you will face SQLCODE -911.
Answer : C
Explanation
If a user is not authorized to access DB2 objects, he will face SQLCODE -922.
Q 22 - When you will face SQLCODE -818?
Answer : D
Explanation
SQLCODE -818 is a timestamp mismatch of load module and bind timestamp built from DBRM.
Answer : C
Explanation
We do not use read statement with cursor instead we use fetch statement.
Q 24 - Which command is used to start an instance on DB2?
Answer : B
Explanation
DB2START command is used to start an instance on DB2.
Q 25 - In a COBOL-DB2 program where can we declare a cursor?
Answer : D
Explanation
We can declare a cursor either i Working Storage Section or in Procedure Division also.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | B |
3 | D |
4 | B |
5 | D |
6 | D |
7 | C |
8 | B |
9 | B |
10 | A |
11 | B |
12 | C |
13 | C |
14 | C |
15 | A |
16 | B |
17 | C |
18 | D |
19 | A |
20 | B |
21 | C |
22 | D |
23 | C |
24 | B |
25 | D |