Tag: databases

Questions Related to databases

  1. QUIESCE

  2. EXPLAIN

  3. REORG

  4. RUNSTATS


Correct Option: B
Explanation:

To answer this question, the user needs to have a basic understanding of database management systems and utilities used to manage databases.

QUIESCE is a utility used to temporarily halt the activity on the database, allowing for maintenance operations to take place. It is not used to obtain access path details.

EXPLAIN is a utility used to display the access path details for a particular SQL statement. This option is correct.

REORG is a utility used to reorganize the physical storage of a database table, and is not used to obtain access path details.

RUNSTATS is a utility used to collect statistical information about the data contained in a database table, and is not used to obtain access path details.

Therefore, the correct answer is:

The Answer is: B. EXPLAIN

To create a trigger you need the following option

  1. Triggering Table

  2. Triggering Event

  3. Triggered Action

  4. All the above


Correct Option: D

AI Explanation

To create a trigger, you need all of the following options:

A. Triggering Table - This is the table on which the trigger will be created. The trigger will be executed whenever a certain event occurs on this table.

B. Triggering Event - This is the event that will trigger the execution of the trigger. Examples of triggering events include INSERT, UPDATE, or DELETE operations on the triggering table.

C. Triggered Action - This is the action that will be performed when the trigger is executed. The triggered action can be a set of SQL statements or a call to a stored procedure.

Therefore, the correct answer is D) All the above, as all of these options are necessary components for creating a trigger.

Triggers can not be used for

  1. Validate input data

  2. Automatically generate values for newly inserted rows

  3. support alerts

  4. To Implement Referential Integrity


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Validate input data - This option is incorrect. Triggers can be used to validate input data. Triggers can be set to execute before or after an insert, update, or delete operation and can be used to enforce data validation rules.

Option B) Automatically generate values for newly inserted rows - This option is incorrect. Triggers can be used to automatically generate values for newly inserted rows. For example, a trigger can be set to insert a default value into a specific column when a new row is inserted.

Option C) Support alerts - This option is incorrect. Triggers can be used to support alerts. For example, a trigger can be set to send an alert or notification when a specific condition is met.

Option D) To implement Referential Integrity - This option is correct. Triggers cannot be used to implement referential integrity. Referential integrity is typically enforced through foreign key constraints and not through triggers.

The correct answer is D) To implement Referential Integrity. This option is correct because triggers are not used to implement referential integrity. Referential integrity is enforced through foreign key constraints.

  1. If transaction A holds X lock on row R, If transaction B requests for S lock, then B would go into wait state until A releases the lock

  2. If transaction A holds S lock on row R, If transaction B requests for S lock, then B would be granted the lock

  3. If transaction A holds X lock on row R, If transaction B requests for X lock,then B would be granted the lock.

  4. If transaction A holds S lock on row R, If transaction B requests for X lock, then B would be granted the lock


Correct Option: A,B
  1. Database

  2. Tablespace

  3. Table

  4. View


Correct Option: B,C
  1. Designates the values that columns of a table can contain

  2. The limiting of a set of foreign key values to a set of primary key values

  3. The limiting of a set of Primary key values to a set of foreign key values

  4. None of the above


Correct Option: B
  1. True

  2. False


Correct Option: A
Explanation:

A tablespace lock is the most restrictive type of lock in DB2. It prevents any other process from accessing any data in the tablespace. A page lock only prevents other processes from accessing the specific page that is locked.

Therefore, the statement "When acquiring Tablespace lock more data is restricted than page level Lock" is True.

A tablespace lock restricts access to all of the data in a tablespace, while a page lock only restricts access to a single page. This means that a tablespace lock is more restrictive than a page lock.

For example, if a tablespace contains 100 pages and a process acquires a tablespace lock on the tablespace, then no other process can access any of the data in the tablespace, even if the data is not on the page that is locked. However, if a process acquires a page lock on a single page in the tablespace, then other processes can still access the data on the other 99 pages in the tablespace.

In general, tablespace locks should only be used when it is absolutely necessary to prevent other processes from accessing any data in the tablespace. Page locks should be used whenever possible, as they provide a more granular level of locking and allow other processes to access more data.