-
-
What keyword does an SQL SELECT statement use for a string search?
The LIKE keyword allows for string searches. The % sign is used as a wildcard.
-
How is the SUBSTR keyword used in sql?
SUBSTR is used for string manipulation with column name, first position and string length used as arguments. Eg. SUBSTR (NAME, 1 3) refers to the first three characters in the column NAME.
-
-
In terms of DB2 indexing, what is the root page?
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.
-
What are some characteristics of columns that benefit from indexes?
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.
-
What is meant by index cardinality?
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.
-
What are delete-connected tables?
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.
-
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.
-
What is a LIKE table and how is it created?
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.
-
Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
Never. Such processing could produce duplicate values violating entity integrity. Primary keys must be updated one at a time.
-
What is a subselect? Is it different from a nested select?
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.
-
What is the database descriptor?
The database descriptor, DBD is the DB2 component that limits access to the database whenever objects are created, altered or dropped.
-
What is the significance of DB2 free space and what parameters control it?
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.
-
DB2 Interview Questions
Ans