1. What is sqlcode -811?

SELECT statement has resulted in retrieval of more than one row.

2. What is sqlcode -922 ?

Authorization failure

3. What is the difference between primary key & unique index ?

Primary : a relational database constraint. Primary key consists of one or more columns that uniquely identify a row in the table. For a normalized relation, there is one designated primary key.

Unique index: a physical object that stores only unique values. There can be one or more unique indexes on a table

4. What is a clustering index ?

Causes the data rows to be stored in the order specified in the index. A mandatory index defined on a partitioned table space.

6. What is the self-referencing constraint?

A31. The self-referencing constraint limits in a single table the changes to a primary key that the related foreign key defines. The foreign key in a self referencing table must specify the DELETE CASCADE rule.

8. What are foreign keys in DB2?

These are attributes of one table that have matching values in a primary key in another table, allowing for relationships between tables.

Keys (columns) that exist on one table and that are primary keys on another table.

9. When can an insert of a new primary key value threaten referential integrity?

Never. New primary key values are not a problem. However, the values of foreign key inserts must have corresponding primary key values in their related tables. And updates of primary key values may require changes in foreign key values to maintain referential integrity

10. Give the COBOL definition of a VARCHAR field.

A VARCHAR column REMARKS would be defined as follows:

Download Interview PDF