Mainframe IBM DB2 Interview Questions and Answers

10/19/2009 No Comment

IBM DB2 Interview Questions and Answers asked in a Mainframe DB2 Interview.

What are foreign keys?
Answer : These are attributes of one table that have matching values in a primary key in another table, allowing for relationships between tables.

Describe the elements of the SELECT query syntax
Answer : SELECT element FROM table WHERE conditional statement .

Explain the use of the WHERE clause
Answer : WHERE is used with a relational statement to isolate the object element or row.

What techniques are used to retrieve data from more than one table in a single SQL Statements?

Answer : Joins, unions and nested selects are used to retrieve data

What do the initials DDL and DML stand for and what is their meaning?

Answer : DDL is data definition language and DML is data manipulation language DDL statements are CREATE, ALTER, TRUNCATE DML statements are SELECT, INSERT, DELETE and UPDATE .

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.

Explain an outer join

Answer : An outer join includes rows from tables when there are no matching values in the Tables.

What is a sub select? Is it different from a nested select?

Answer : Sub select is a select which works in conjunction with another select A nested select is a kind of Sub Select where the inner select passes to the where criteria for the outer select.

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 .

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

What is Table Space?

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

What is a cursor and what is its function?

Answer : An embedded Sql statement may return a number of rows while the programming language can only access one row at a time The programming device called a cursor controls the position of the row .

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.

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)

Is there any advantage to De normalizing DB2 tables?

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

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.

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.

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

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

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.

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

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
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