DB2 MCQ Questions And Answers - Mainframe Development
DB2 MCQs : This section focuses on "basics" of DB2. These Multiple Choice Questions (MCQ) should be practiced to improve the DB2 skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which command used to find the number of rows in a DB2 table?
A. SUM (*)
B. ADD (*)
C. COUNT (*)
D. CALCULATE (*)
View Answer
Ans : C
Explanation: To find the number of rows in a DB2 table, the user has to use SELECT COUNT (*) on the DB2 query.
2. Which command used to find the duplicate values be eliminated from DB2 SELECT?
A. duplicate
B. distinct
C. dvalue
D. None of the above
View Answer
Ans : B
Explanation: To eliminate the duplicate values from DB2 SELECT, the user has to use SELECT DISTINCT in the DB2 query.
3. ______________ functions are built-in mathematical tools that are used in the DB2 SELECT clause.
A. Sum Up
B. Add Up
C. Calculate
D. Aggregate
View Answer
Ans : D
Explanation: Aggregate functions are built-in mathematical tools that are used in the DB2 SELECT clause.
4. Is it possible using MAX on a CHAR column?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes! It is possible using MAX on a CHAR column.
5. ____________ is the function that eliminates duplicates in the table.
A. Union All
B. Union
C. Both A and B
D. None of the above
View Answer
Ans : B
Explanation: UNION is the function that eliminates duplicates in the table while UNION ALL retains the duplicates.
6. The physical storage length of DATE is ________ bytes.
A. 1
B. 2
C. 4
D. 8
View Answer
Ans : C
Explanation: The physical storage length of DATE is 4 bytes, TIME is 3 bytes, and TIMESTAMP is 10 bytes.
7. DCLGEN refers to?
A. Data Generator
B. Defined Generator
C. Declaration Getting
D. Declaration Generator
View Answer
Ans : D
Explanation: DCLGEN refers to Declaration Generator that is used to create the host language copy books for the table definitions. It also creates the DECLARE table.
8. Major fields in SQLCA are?
A. SQLCODE
B. SQLERRM
C. SQLERRD
D. All of the above
View Answer
Ans : D
Explanation: Major fields in SQLCA are SQLCODE, SQLERRM, and SQLERRD.
9. Can there be more than one cursor open for any program?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, The user can have more than one cursor open for any program.
10. Is there any restriction on the use of UNION in Embedded SQL?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: While using UNION in Embedded SQL, it has to be in a CURSOR.
Discussion