I have a few questions for which I am looking for the correct answer.
1) Which one best describes why cursor is used?
a. Cursors are used to access set-level data one row at a time.
b. Scroll and update are done together.
c. Multiple rows are updated at one time.
2) Which one is true for COMMIT?
a. COMMIT always closes cursor.
b. Close cursor does an implicit COMMIT.
c. COMMIT Doesn?t close the cursor defined as WITH HOLD.
d. Both B and C are correct.
3) What must be used to retrieve parts of the rows of a table?
a. Column
b. View
c. Cursor
d. *
4) Which is the most efficient way for specifying the table?s owner name in a cobol program?
a. Use a variable to store the owner name and use it in the SQL
b. Define it in the Plan and not in the program.
c. Hardcode the name in the SQL.
5) Which is the most efficient way to handle large no. of rows in CICS through cursor?
a. Use the cursor and store in indexed seq. file
b. Use TSQ.
c. Make query once and use the result in conversational program.
d. Use the array inside the program.
6) Which term is used to mean hardcoding of SQL in Cobol?
a. Dynamic SQL
b. Embedded SQL
c. Structured Programming.
d. None of the above.
7) Which is the correct SQL?
a. Select Sales-id, salary+commission as ?Compensation?order by Compensation
b. Select Sales-id, salary+commission as Compensation order by Compensation
c. Select Sales-id, salary+commission as ?Compensation?order by 2
d. Select Sales-id, salary+commission as Compensation order by 2
e. All of the above.
What does the DB2 precompiler do?
a. Accesses the DB2.
b. Invoked through DB2I.
c. Expands the SQL.
d. Creates load modules.
9) Home phone is a varchar and contains Null. What will happen when home phone is selected?
a. Home-phone contains zeros and null-ind <0
b. Home phone contains garbage and null-ind <0.
c. Home-phone value is unchanged and null-ind <0.
d. None of the above.
10) Home phone is a varchar and contains Null. What will happen when home phone is selected?
a. Home-phone contains zeros and null-ind <0
b. Home phone contains garbage and null-ind <0.
c. Home-phone value is unchanged and null-ind <0.
d. None of the above.
11) What is true for group by,order by clause?
a. Selected columns must be in the group by.
b. Columns in group by must be selected.
c. Selected columns must be column functions.
d. Selected columns must be column functions or in the group by clause.
12) What is the way of using a Variable table name in the program?
a. Use dynamic SQL.
b. Put the variable name in EXEC SQL include statement.
c. Define the variable as a host variable as type varchar.
d. Replace the table name with ???
e. Use SPUFI
13) Best way to enforce referential integrity?
a. Programmatically.
b. Referential constraints on the create table declaration.
c. No null clauses on the insert or update.
d. Views in stead of the table.
e. Using the distinct clause on all the select statements.
14)
DB2 Questions - answers required.
Moderators: Kalicharan, Moderator Group
-
- Member
- Posts: 3
- Joined: Wed Aug 23, 2006 2:47 am
- Location: NJ
DB2 Questions - answers required.
Knowledge is power.
- Kalicharan
- Moderator
- Posts: 31
- Joined: Wed Feb 08, 2006 1:51 pm
1) Which one best describes why cursor is used?
a. Cursors are used to access set-level data one row at a time.
b. Scroll and update are done together.
c. Multiple rows are updated at one time.
2) Which one is true for COMMIT?
a. COMMIT always closes cursor.
b. Close cursor does an implicit COMMIT.
c. COMMIT Doesn?t close the cursor defined as WITH HOLD.
d. Both B and C are correct.
3) What must be used to retrieve parts of the rows of a table?
a. Column
b. View
c. Cursor
d. *
4) Which is the most efficient way for specifying the table?s owner name in a cobol program?
a. Use a variable to store the owner name and use it in the SQL
b. Define it in the Plan and not in the program.
c. Hardcode the name in the SQL.
5) Which is the most efficient way to handle large no. of rows in CICS through cursor?
a. Use the cursor and store in indexed seq. file
b. Use TSQ.
c. Make query once and use the result in conversational program.
d. Use the array inside the program.
6) Which term is used to mean hardcoding of SQL in Cobol?
a. Dynamic SQL
b. Embedded SQL
c. Structured Programming.
d. None of the above.
a. Select Sales-id, salary+commission as ?Compensation?order by Compensation
b. Select Sales-id, salary+commission as Compensation order by Compensation
c. Select Sales-id, salary+commission as ?Compensation?order by 2
d. Select Sales-id, salary+commission as Compensation order by 2
e. All of the above.
a. Accesses the DB2.
b. Invoked through DB2I.
c. Expands the SQL.
d. Creates load modules.
a. Home-phone contains zeros and null-ind <0
b. Home phone contains garbage and null-ind <0.
c. Home-phone value is unchanged and null-ind <0.
d. None of the above.
a. Selected columns must be in the group by.
b. Columns in group by must be selected.
c. Selected columns must be column functions.
d. Selected columns must be column functions or in the group by clause.
a. Use dynamic SQL.
b. Put the variable name in EXEC SQL include statement.
c. Define the variable as a host variable as type varchar.
d. Replace the table name with ???
e. Use SPUFI
13) Best way to enforce referential integrity?
a. Programmatically.
b. Referential constraints on the create table declaration.
c. No null clauses on the insert or update.
d. Views in stead of the table.
e. Using the distinct clause on all the select statements.
a. Cursors are used to access set-level data one row at a time.
b. Scroll and update are done together.
c. Multiple rows are updated at one time.
Ans:a
2) Which one is true for COMMIT?
a. COMMIT always closes cursor.
b. Close cursor does an implicit COMMIT.
c. COMMIT Doesn?t close the cursor defined as WITH HOLD.
d. Both B and C are correct.
Ans:d
3) What must be used to retrieve parts of the rows of a table?
a. Column
b. View
c. Cursor
d. *
Ans: (a - columns), we can achieve thru views also
4) Which is the most efficient way for specifying the table?s owner name in a cobol program?
a. Use a variable to store the owner name and use it in the SQL
b. Define it in the Plan and not in the program.
c. Hardcode the name in the SQL.
Ans : b
5) Which is the most efficient way to handle large no. of rows in CICS through cursor?
a. Use the cursor and store in indexed seq. file
b. Use TSQ.
c. Make query once and use the result in conversational program.
d. Use the array inside the program.
Ans: If number of rows are too large, b and c may not be the right option.
6) Which term is used to mean hardcoding of SQL in Cobol?
a. Dynamic SQL
b. Embedded SQL
c. Structured Programming.
d. None of the above.
7) Which is the correct SQL?Ans:b
a. Select Sales-id, salary+commission as ?Compensation?order by Compensation
b. Select Sales-id, salary+commission as Compensation order by Compensation
c. Select Sales-id, salary+commission as ?Compensation?order by 2
d. Select Sales-id, salary+commission as Compensation order by 2
e. All of the above.
What does the DB2 precompiler do?Ans: d
a. Accesses the DB2.
b. Invoked through DB2I.
c. Expands the SQL.
d. Creates load modules.
9) Home phone is a varchar and contains Null. What will happen when home phone is selected?Ans:c
a. Home-phone contains zeros and null-ind <0
b. Home phone contains garbage and null-ind <0.
c. Home-phone value is unchanged and null-ind <0.
d. None of the above.
11) What is true for group by,order by clause?Ans: b
a. Selected columns must be in the group by.
b. Columns in group by must be selected.
c. Selected columns must be column functions.
d. Selected columns must be column functions or in the group by clause.
12) What is the way of using a Variable table name in the program?Ans:d
a. Use dynamic SQL.
b. Put the variable name in EXEC SQL include statement.
c. Define the variable as a host variable as type varchar.
d. Replace the table name with ???
e. Use SPUFI
Ans: a
13) Best way to enforce referential integrity?
a. Programmatically.
b. Referential constraints on the create table declaration.
c. No null clauses on the insert or update.
d. Views in stead of the table.
e. Using the distinct clause on all the select statements.
Ans: b
For more interview questions and answers visit.
http://www.mainframegurukul.com/interview-questions/DB2
http://www.mainframegurukul.com/interview-questions/DB2
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
i did not bother to go thru all of them, I stopped at the second because this:
C is the answer.
as far as I know, the only IMPLICIT COMMIT is issued by the OP-SYS at task termination.
is not true2) Which one is true for COMMIT?
a. COMMIT always closes cursor.
b. Close cursor does an implicit COMMIT.
c. COMMIT Doesn?t close the cursor defined as WITH HOLD.
d. Both B and C are correct.
Ans:d
C is the answer.
as far as I know, the only IMPLICIT COMMIT is issued by the OP-SYS at task termination.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 1
- Joined: Tue Jul 24, 2018 12:20 pm
- Contact:
c programming questions pdf
c programming questions pdf is a book learned for compilation errors, using the debugger, integers, data types demonstration, and using header files and define statements.
http://computersciencepdf.com/c-program ... tions-pdf/
http://computersciencepdf.com/c-program ... tions-pdf/
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page