db2 interview questions with answers

db2 interview questions with answers

Recently the job market for mainframe programmers is improving and keeping in mind the DB2 job opportunities, I thought of coming up with a compilation of db2 interview questions with answers.

  • What do you mean by foreign keys?

Ans:-  Foreign keys are column or combination of columns in a table that have matching value in primary key of another table, thus maintaining relationships between tables.

Ans:-  Normalization is a procedure for reducing redundancy of data and representing data in tabular format.   

Ans:-A data page is a unit of data which can be retrieved. It could be either 4K or 32K (depending on the way table is defined).

  • What is meant by DB2 bind?

ANS:-  A DB2 bind is a process that builds an access path of the application to the relational database i.e. DB2 tables.  DB2 bind process does the following

Validates :Sql statements are validated for valid tables, view and column names. Syntax errors are checked so that these can be corrected.

Verifies :- Bind process verifies that the user or the process is authorized to bind the plan.

Selects :-Selects the access path from the application program to the DB2 objects.

Ans:-  An access path is the method used to access relational data specified in DB2 SQL statements.

; ; ; ;

Ans:-A DB2 plan is an executable code containing the access path logic produced by the DB2 bind process

This could  consist of

One or more DBRM or

One or more packages or

Combination of DBRM and packages

  • What is tablespace and these are of how many types?

Ans:-  Tablespaces are like containers for storing the tables. Tables are not physical objects while tablespaces are physical objects. There are three types of tablespaces: simple, segmented and partitioned.

  • What is cursor stability?

Ans:-Cursor stability is a type of isolation level which makes sure that the data read by an application program is locked only while its used, as soon as the cursor moves away to another page of data the lock on the previous page is released  so that other programs can access the data for updation. This form of isolation level is high on concurrency but low on integrity of data.

  • How to fetch data from more than one table in a single SQL statement?

                Ans:-For this we can use Joins,  unions or nested selects.

  • Define view and Why it is used?

Ans:- A view is a virtual table containing data from one or more tables, but this data is not stored in a separate spaces.

Keep tuned in for more such compilations of db2 interview questions with answers