TCS DB2 Interview Questions and Answers

11/22/2009 No Comment

TCS DB2 Interview Questions and Answers.

Define SPUFI and QMF in DB2?
Answer : SPUFI - Sql Processing Using File Input
QMF - Query Management Facility
Both of them are DB2 interactive menu-driven tools used by developers to create & modify database objects.

Name some of the few utilities available in DB2 ?

Explain in brief what are the different COLUMN functions ?

Answer : The different column function are cited below.
  • SUM-Returns the total value.
  • MIN-Returns the minimum value.
  • AVG-Returns the average value.
  • MAX-Returns the maximum value.
  • COUNT-Returns the number of selected rows.
  • STDDEV-Returns the standard deviation of the column values.
  • VARIANCE- Returns the variance of the column values.
What do you mean by a scalar function in DB2?
Answer : A scalar function also produces a single value, but unlike the argument of a column function, an argument of a scalar function is a single value.

What do you mean by a COLUMN function ?
Answer : A column function produces a single value for a group of rows. You can use the SQL column functions to calculate values based on entire columns of data. The calculated values are from selected rows only (all rows that satisfy the WHERE clause).

Name the different types of Table spaces in DB2?

Answer : The different types of tablespaces are cited below.
  • Simple Table Space
  • Segmented Table Space
  • Partitioned Table Space
Explain in detail what do you mean by Cursor Stability(CS) ?
Answer : A page lock is held only while the cursor is positioned on that page. When the cursor moves to another page, the lock is released. When a page is locked concurrent application programs cannot update or delete a row of the locked page. The current lock is not released until a new lock is acquired. If an application program updates or deletes data, the lock is held until the data is committed. CS applies only to data that is read. All changed data remains locked until COMMIT or ROLLBACK.

Explain in detail what is the significance of a null indicator variable and what are the possible values in the variable?

Answer : A Null Indicator is used to indicate whether the host variable has been assigned a null. It used to indicate whether a retrieved character value has been truncated. It is used to set a column to null. The indicator value of –1 means the associated host variable contains null. 0 means the associated host variable does not contain null, nor the returned value is truncated. –2 means the associated host variable contains null due to a numeric or arithmetic conversion error. >0 means the value assigned to the host variable is truncated. The value represented by the indicator variable is the actual length of the character value before truncation.

Describe commit and rollback in DB2?

Answer : A commit occurs automatically at the end of the program, or by request one or more times during the execution of the program. Releases all locks acquired by the program since the last commit, so that other programs and users may obtain access to the data. Any open cursors are automatically closed. All database changes are made permanent.If any changes made to the tables are not appropriate, then all the changes must by rolled back resulting in the same state of data as they were prior to making changes. Release all locks acquired by the program.

How to retrieve a employee-id of an employee who works in more than one department in a single table?

Answer : The SQL query for it is cited below.
Related Posts

No comments :


Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer