DB2 is the database management system that delivers a flexible and cost-effective database platform to build robust on demand business applications. DB2 further leverages your resources with broad support for open standards and popular development platforms like J2EE and Microsoft .NET. The DB2 family also includes solutions tailored for specific needs like business intelligence and advanced tooling. Whether your business is large or small, DB2 has a solution built and priced to meet your unique needs.
DB2 Interviews are getting tough these days as the technology grows faster. To get through the DB2 interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed DB2 questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on DB2 and various other technologies interview preparation.
11. Can you have more than one cursor open at any one time in a program ? ?
Yes.
12. Can you use MAX on a CHAR column?
YES.
13. Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned to any project?
SELECT EMPNO FROM EMP WHERE PROJECT IS NULL;
14. Describe the elements of the SELECT query syntax. SELECT element FROM table WHERE conditional statement.
SELECT statement is used for selecting a particular items or all items from a table...it is as desired by the user. FROM statement is used to to tell the table name. WHERE statement is used to specify a particular condition while choosing the values When u will use curser with hold option? On executing a COMMIT statement in the Program all the open cursors are closed. In order to avoid this we use the WITH HOLD option. If i have a cursor in program and there is a commit statement it will close the cursor, so in order to avoid that u use a cursor with hold option to retain the cursor position We use cursor only when we updating existing records or Inserting Some Records to the Table. When you Using commit, in DB2 every single row will be commited after the process. If abend occurs only the cursor will be closed, we can start from last position(Where it abended) of cursor , using Restart
15. Does your query involve column functions?
If your query involves column functions, make sure that they are coded as simply as possible; this increases the chances that they will be evaluated when the data is retrieved, rather than afterward. In general, a column function performs best when evaluated during data access and next best when evaluated during DB2 sort.
Least preferable is to have a column function evaluated after the data has been retrieved. For column functions to be evaluated during data retrieval, the following conditions must be met for all column functions in the query:
There must be no sort needed for GROUP BY. Check this in the EXPLAIN output.
There must be no stage 2 (residual) predicates. Check this in your application. There must be no distinct set functions such as COUNT(DISTINCT C1).
If the query is a join, all set functions must be on the last table joined. Check this by looking at the EXPLAIN output.
All column functions must be on single columns with no arithmetic expressions. Difference between Embedded SQL and Dynamic SQL.
The difference is the time at which the BIND occurs. In static mode, the bind is done prior to the execution and is stored in a PLAN. In dynamic mode, the BIND occurs at execution time. This results in additional overhead which degrades performance. This form of dynamic SQL will NOT be used in our environment The difference is the time at which the BIND occurs.
16. EXPLAIN has output with MATCHCOLS = 0. What does it mean?
a nonmatching index scan if ACCESSTYPE = I.
17. EXPLAIN has output with MATCHCOLS = 0. What does it mean? ?
a nonmatching index scan if ACCESSTYPE = I.
18. Explain the use of the WHERE clause. WHERE is used with a relational statement to isolate the object element or row. where clause is use to extrct only one record.it is used with GROUP BY CLAUSE.
EG:-SELECT DNO FROM EMP WHERE SAL=4200 GROUP BY DNO; DISCRIPTION:- where dno is (dept. no) emp is (employi table), here we are retriving dept.no whose salary is 4200 & these dept no's are arrenged in acending order.
19. Give some example of statistics collected during RUNSTATS?
# of rows in the table Percent of rows in clustering sequence # of distinct values of indexed column # of rows moved to a nearby/farway page due to row length increase
20. Give the COBOL definition of a VARCHAR field.
A VARCHAR column REMARKS would be defined as follows: ...
10 REMARKS. 49 REMARKS-LEN PIC S9(4) USAGE COMP. 49 REMARKS-TEXT PIC X(1920).