0

databases Online Quiz - 8

Description: databases Online Quiz - 8
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  1. User Defined Exception

  2. Predefined Internal Exception --- NO_DATA_FOUND

  3. Predefined Internal Exception --- VALUE_ERROR

  4. OTHERS Exception


Correct Option: D

As per the business requirement of a Shipping firm, Inventory Manager should be notified when the Inventory Count for a category "CONTAINER" in the INVENTORY table drops down below 100. However, the user transaction should NOT be aborted, in case the inventory count for a "CONTAINERS" category drops down below 100. The columns of the INVENTORY table, which stores the category name and count are CAT_NAME and TOTAL_COUNT respectively. Specify, which type of TRIGGER an application developer needs to write to address this issue?

  1. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - BEFORE ROW, Trigger Restriction - NULL

  2. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - BEFORE ROW, Trigger Restriction - WHERE CAT_NAME='CONTAINER' AND NEW.TOTAL_COUNT<100

  3. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - BEFORE STATEMENT, Trigger Restriction - NULL

  4. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - BEFORE STATEMENT, Trigger Restriction - WHERE CAT_NAME='CONTAINER' AND NEW.TOTAL_COUNT<100

  5. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - AFTER ROW, Trigger Restriction - NULL

  6. Trigger Event - UPDATE of TOTAL_COUNT, Trigger Type - AFTER ROW, Trigger Restriction - WHERE CAT_NAME='CONTAINER' AND NEW.TOTAL_COUNT<100


Correct Option: F
  1. The current block is always searched first for a handler

  2. If the exception handler is NOT found in the current block, enclosing block if any is searched for the exception handler.

  3. If the exception handler is found, then it's executed. Control is passed to the enclosing block if one exists OR to the calling environment if there is no enclosing block.

  4. If the exception handler is NOT found, then exception is returned back to the calling environment

  5. All of above


Correct Option: E
  1. UPDATING

  2. CREATING

  3. DELETING

  4. SELECTING

  5. INSERTING

  6. ALTERING


Correct Option: A,C,E

SQLCODE and SQLERRM cannot be used within a SQL statement directly. Instead, you must assign their values to local variables, then use the variables in the SQL statement

  1. True

  2. False


Correct Option: A
  1. Stored function returns a value and a stored procedure does not.

  2. Stored procedure returns a value and a stored function does not.

  3. Stored function returns a value and a stored procedure may OR may not.

  4. Stored procedure returns a value and a stored function may OR may not.


Correct Option: A
  1. When a trigger fires, a SQL statement within its trigger action potentially can fire other triggers

  2. When a trigger fires, a SQL statement within its trigger action potentially can update other tables

  3. When a trigger fires, a SQL statement within its trigger action potentially can fire other stored procedures

  4. When a trigger fires, a SQL statement within its trigger action potentially can drop other tables


Correct Option: A

A stored procedure must have at least one argument

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, we need to understand what a stored procedure is and its characteristics.

A stored procedure is a set of SQL statements that are stored in the database and can be executed repeatedly. It is typically used to perform a specific task or a series of tasks.

A stored procedure can have zero or more arguments. Arguments are parameters that are passed to the stored procedure when it is called. These arguments can be used within the stored procedure to perform various operations.

Based on this understanding, we can determine that the statement "A stored procedure must have at least one argument" is incorrect.

Option A) True - This option is incorrect because a stored procedure can have zero or more arguments.

Option B) False - This option is correct because a stored procedure can have zero or more arguments.

The correct answer is B) False.

  1. Execute the command FIX ERROR

  2. Execute the command SHOW ERROR

  3. Execute the command TROUBLESHOOT ERROR

  4. Execute the command INVESTIGATE ERROR

  5. Execute the command ANALYZE ERROR


Correct Option: B
  1. TRIGGER SPECIFICATION

  2. TRIGGER EVENT

  3. TRIGGER TYPE

  4. TRIGGER BODY

  5. TRIGGER RESTRICTION

  6. TRIGGER ACTION


Correct Option: B,C,E,F
  1. Database Trigger will NOT fire at all as number of records updated are ZERO. However, batch job will run through successfully.

  2. Database Trigger will fire only ONCE and will save details viz. "ERIC", "SYSDATE" and "0" to the AUDIT table. The batch job will run through successfully.

  3. Database Trigger will return an ERROR and abort the batch job

  4. Database Trigger will return an ERROR. However, batch job will run through successfully


Correct Option: B
  1. RANGE

  2. INTERVAL

  3. LIST

  4. HASH

  5. VIRTUAL

  6. REFERENCE


Correct Option: A,C,D

Which of the following is not a string function?

  1. concat

  2. initcap

  3. round

  4. length


Correct Option: C
- Hide questions