DB2 Job Interview Questions, Learnings and Answers

10/12/2009 No Comment

Mainframe DB2 Interview Frequently Asked Questions.

IBM DB2 interview questions asked by different organizations.

1.What is a subselect? Is it different from a nested select?
Answer : A subselect is a select which works in conjunction with another select. A nested select is a kind of subselect where the inner select passes to the where criteria for the outer select.

2.What is the difference between group by and order by?
Answer : Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement.

3.Explain the EXPLAIN statement.
Answer : The explain statement provides information about the optimizer's choice of access path of the sql.

4.What is tablespace?

Answer : Tables are stored in tablespaces (hence the name)! There are three types of tablespaces: simple, segmented and partitioned.

5.What is referential integrity?

Answer : Referential integrity refers to the consistency that must be maintained between primary and foreign keys, ie every foreign key value must have a corresponding primary key value.

6.Usually, which is more important for DB2 system performance - CPU processing or I/O access?
Answer : I/O operations are usually most critical for DB2 performance (or any other database for that matter).

7.Is there any advantage to denormalizing DB2 tables?

Answer : Denormalizing DB2 tables reduces the need for processing intensive relational joins and reduces the number of foreign keys.

8.What is the database descriptor?

Answer : The database descriptor, DBD is the DB2 component that limits access to the Database whenever objects are created, altered or dropped.

9.What is lock contention?
Answer : To maintain the integrity of DB2 objects the DBD permits access to only on object at a time. Lock contention happens if several objects are required by contending application processes simultaneously.

10.What is SPUFI?

Answer : SPUFI stands for SQL processing using file input. It is the DB2 interactive menu-driven tool used by developers to create database objects.

11.What is the significance of DB2 free space and what parameters control it?

Answer : The two parameters used in the CREATE statement are the PCTFREE which specifies the percentage of free space for each page and FREEPAGE which indicates the number of pages to be loaded with data between each free page.Free space allows room for the insertion of new rows.

12.What is a NULL value?What are the pros and cons of using NULLS?

Answer : A NULL value takes up one byte of storage and indicates that a value is not present as opposed to a space or zero value. It's the DB2 equivalent of TBD on an organizational chart and often correctly portrays a business situation. Unfortunately, it requires extra coding for an application program to handle this situation.

13.What is a synonym? How is it used?

Answer : A synonym is used to reference a table or view by another name. The other name can then be written in the application code pointing to test tables in the development stage and to production entities when the code is migrated. The synonym is linked to the AUTHID that created it.

14.What is an alias and how does it differ from a synonym?

Answer : An alias is an alternative to a synonym, designed for a distributed environment to avoid having to use the location qualifier of a table or view. The alias is not dropped when the table is dropped.


15.What is a LIKE table and how is it created?
Answer : A LIKE table is created by using the LIKE parameter in a CREATE table statement. LIKE tables are typically created for a test environment from the production environment.

16.If the base table underlying a view is restructured, eg. attributes are added, does the application code accessing the view need to be redone?

Answer : No. The table and its view are created anew, but the programs accessing the view do not need to be changed if the view and attributes accessed remain the same.

17.Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
Answer : Never. Such processing could produce duplicate values violating entity integrity. Primary keys must be updated one at a time.

18.What is the cascade rule and how does it relate to deletions made with a subselect.

Answer : The cascade rule will not allow deletions based on a subselect that references the same table from which the deletions are being made.

19.What is a view?Why use it?
Answer : A view is a virtual table made up of data from base tables and other views, but not stored separately.

20.Explain an outer join.
Answer : An outer join includes rows from tables when there are no matching values in the tables.
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