DB2 Questions - answers required.

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
manas_ks2003
Member
Posts: 3
Joined: Wed Aug 23, 2006 2:47 am
Location: NJ

DB2 Questions - answers required.

Post by manas_ks2003 » Tue Sep 05, 2006 9:20 am

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.

8) 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)
Knowledge is power.

User avatar
Kalicharan
Moderator
Posts: 31
Joined: Wed Feb 08, 2006 1:51 pm

Post by Kalicharan » Tue Sep 05, 2006 8:22 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.
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.
Ans:b
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.
Ans: d
What does the DB2 precompiler do?
a. Accesses the DB2.
b. Invoked through DB2I.
c. Expands the SQL.
d. Creates load modules.
Ans:c
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.
Ans: b
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.
Ans:d
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
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

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Wed May 27, 2009 2:31 pm

For more interview questions and answers visit.

http://www.mainframegurukul.com/interview-questions/DB2

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu May 28, 2009 3:20 pm

i did not bother to go thru all of them, I stopped at the second because this:
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
is not true
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.

computersciencepdf
Member
Posts: 1
Joined: Tue Jul 24, 2018 12:20 pm
Contact:

c programming questions pdf

Post by computersciencepdf » Tue Jul 24, 2018 12:21 pm

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/

Post Reply

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



Other References
Mainframe Tools and others