RelationalDBDesign RelationalDBDesign





DB2 Questions   «Prev  Next»

DB2 Interview Questions 4

  1. What is the self-referencing constraint?
    Answer: 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.
  2. What are delete-connected tables?
    Answer: Tables related with a foreign key are called delete-connected because a deletion in the primary key table can affect the contents of the foreign key table.
  3. When can an insert of a new primary key value threaten referential integrity?
    Answer: 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.
  4. In terms of DB2 indexing, what is the root page?
    Answer:The simplest DB2 index is the B-tree and the B-tree's top page is called the root page. The root page entries represent the upper range limits of the index and are referenced first in a search.
  5. How does DB2 use multiple table indexes ?
    Answer: DB2 use the multiple indexes to satisfy multiple predicates in a SELECT statement that are joined by an AND or OR.


  6. What are some characteristics of columns that benefit from indexes?
    Answer: Primary key and foreign key columns; columns that have unique values; columns that have aggregates computed frequently and columns used to test the existence of a value.
  7. What is a composite index and how does it differ from a multiple index?
    Answer: A multiple index is not one index but two indexes for two different columns of a table.
    A composite index is one index made up of combined values from two columns in a table. If two columns in a table will often be accessed together a composite index will be efficient.
  8. What is meant by index cardinality?
    Answer: The number of distinct values for a column is called index cardinality.
    DB2's RUNSTATS utility analyzes column value redundancy to determine whether to use a tablespace or index scan to search for data.
  9. What is a clustered index?
    Answer: For a clustered index DB2 maintains rows in the same sequence as the columns in the index for as long as there is free space. DB2 can then process that table in that order efficiently.
  10. What keyword does an SQL SELECT statement use for a string search?
    Answer: The LIKE keyword allows for string searches. The % sign is used as a wildcard.