Page 1 of 1

DB2 Questions - answers required.

Posted: Tue Sep 05, 2006 9:20 am
by manas_ks2003
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)

Posted: Tue Sep 05, 2006 8:22 pm
by Kalicharan
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

Posted: Wed May 27, 2009 2:31 pm
by Krishna
For more interview questions and answers visit.

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

Posted: Thu May 28, 2009 3:20 pm
by dbzTHEdinosauer
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.

c programming questions pdf

Posted: Tue Jul 24, 2018 12:21 pm
by computersciencepdf
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/