0

databases Online Quiz - 81

Description: databases Online Quiz - 81
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

Which statment about trigger is TRUE ?

  1. we can use Application Trigger to fire when a DELETE statement occurs

  2. we can use database Trigger to fire when a INSERT statement occurs

  3. we can use System event Trigger to fire when a DELETE statement occurs

  4. we can use INSTEAD OF trigger to fire when a INSERT statement occurs


Correct Option: B

AI Explanation

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

Option A) We can use Application Trigger to fire when a DELETE statement occurs - This option is incorrect. Application triggers are specific to certain applications and are not directly related to database operations such as DELETE statements.

Option B) We can use database Trigger to fire when an INSERT statement occurs - This option is correct. Database triggers can be defined to fire before or after various database operations, including INSERT statements.

Option C) We can use System event Trigger to fire when a DELETE statement occurs - This option is incorrect. System event triggers are used to respond to system-level events, such as system startup or shutdown, rather than specific database operations like DELETE statements.

Option D) We can use INSTEAD OF trigger to fire when an INSERT statement occurs - This option is incorrect. INSTEAD OF triggers are typically used with views and allow the trigger to take the place of the actual DML operation (e.g., INSERT, UPDATE, DELETE). However, they are not specific to INSERT statements only.

The correct answer is option B. We can use a database trigger to fire when an INSERT statement occurs. Database triggers are commonly used to define actions that are automatically executed in response to specific database events.

  1. DURING

  2. INSTEAD

  3. ON SHUTDOWN

  4. BEFORE


Correct Option: D
  1. Package

  2. Stored function

  3. Stored procedure

  4. Another DB trigger


Correct Option: C

which command do u used to remove trigger(business_hour) in iSQL environment ?

  1. DELETE TRIGGER business_hour

  2. DROP TRIGGER business_hour

  3. REMOVE TRIGGER business_hour

  4. ALTER TRIGGER business_hour remove


Correct Option: B

The OLD and NEW Qualifier is used in which type of trigger?

  1. Row level DML trigger

  2. Statement level DML trigger

  3. System trigger

  4. Application Trigger


Correct Option: A

The command to disable all the triggers on the EMP table

  1. ALTER TRIGGERS ON TABLE EMP DISABLE

  2. ALTER EMP DISABLE ALL TRIGGERS

  3. NOT POSSIBLE TO DISABLE TRIGGERS

  4. ALTER TABLE EMP DISABLE ALL TRIGGERS


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) ALTER TRIGGERS ON TABLE EMP DISABLE - This option is incorrect because the correct syntax to disable triggers is "ALTER TABLE DISABLE TRIGGERS". The keyword "ON" is not used in this context.

Option B) ALTER EMP DISABLE ALL TRIGGERS - This option is incorrect because the correct syntax to disable triggers is "ALTER TABLE DISABLE TRIGGERS". The keyword "EMP" is not used in this context.

Option C) NOT POSSIBLE TO DISABLE TRIGGERS - This option is incorrect. It is possible to disable triggers using the correct syntax.

Option D) ALTER TABLE EMP DISABLE ALL TRIGGERS - This option is correct because it uses the correct syntax to disable all triggers on the "EMP" table. The "ALTER TABLE" command is used to modify a table, and the "DISABLE ALL TRIGGERS" clause is used to disable all triggers on that table.

The correct answer is D. This option is correct because it uses the correct syntax to disable all triggers on the "EMP" table.

How many columns are presented after executing this query: SELECT address1||','||address2||','||address2 "Adress" FROM employee;

  1. 1

  2. 2

  3. 3

  4. 4


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of concatenation in SQL and the number of aliases used in the query.

The given query is:

SELECT address1||','||address2||','||address2 "Address" FROM employee;

In this query, we are concatenating three columns: address1, ',', and address2. We are using the pipe symbol (||) to concatenate these values.

We are also giving an alias "Address" to the concatenated result.

Now let's go through each option to determine the correct answer:

Option A) 1 - This option is incorrect because we are concatenating three columns, so there should be three columns in the result.

Option B) 2 - This option is incorrect because we are concatenating three columns, so there should be three columns in the result.

Option C) 3 - This option is correct because we are concatenating three columns, so there should be three columns in the result.

Option D) 4 - This option is incorrect because we are concatenating three columns, so there should be three columns in the result.

Therefore, the correct answer is C) 3. This option is correct because the query concatenates three columns, resulting in three columns in the output.

Which Oracle access method is the fastest way for Oracle to retrieve a single row?

  1. Full table scan

  2. Table access by ROWID

  3. Access via unique index

  4. Primary key access


Correct Option: B
  1. Column

  2. 1966_Invoices

  3. Catch_#22

  4. #Invoices


Correct Option: C

Which character function can be used to return a specified portion of a character string?

  1. instr

  2. substr

  3. substring

  4. pos


Correct Option: B

The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO?

  1. select * from EMP where nvl(EMPNO, '00000') = '59384';

  2. select 1 from EMP where EMPNO = '59834';

  3. select EMPNO, LASTNAME from EMP where EMPNO = '59384'

  4. select * from EMP where EMPNO = '59384';


Correct Option: A
Explanation:

To answer this question, the user needs to understand what a primary key and an index are, and how they are related.

A primary key is a column or set of columns that uniquely identifies each row in a table. An index is a data structure that stores a copy of selected columns of a table to improve the speed of data retrieval operations on that table.

Now, let's go through each option and determine whether or not it will use the associated index on EMPNO:

A. select * from EMP where nvl(EMPNO, '00000') = '59384'; This statement will not use the associated index on EMPNO because the NVL function applied to EMPNO will turn an indexed column into an unindexed one. Using functions on indexed columns can result in the optimizer not choosing to use the index.

B. select 1 from EMP where EMPNO = '59834'; This statement will use the associated index on EMPNO because it is directly comparing the EMPNO to a value, and that is what the index is built on.

C. select EMPNO, LASTNAME from EMP where EMPNO = '59384' This statement will use the associated index on EMPNO because it is directly comparing the EMPNO to a value, and that is what the index is built on.

D. select * from EMP where EMPNO = '59384'; This statement will use the associated index on EMPNO because it is directly comparing the EMPNO to a value, and that is what the index is built on.

Therefore, the statement that will not use the associated index on EMPNO is option A.

The Answer is: A

  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Oracle will give an error


Correct Option: C

Assuming today is Monday, 10 July 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;

  1. 03-JUL-00

  2. 10-JUL-00

  3. 11-JUL-00

  4. 17-JUL-00


Correct Option: C

To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a four-table join?

  1. 8

  2. 2

  3. 3

  4. 4


Correct Option: C

Which of the following is the lowest cost DB2 product that can be legally installed on a Windows server that has 2 CPUs?

  1. DB2 Everyplace

  2. DB2 Express Edition

  3. DB2 Workgroup Server Edition

  4. DB2Enterprise Server Edition


Correct Option: B

Which of the following products is allowed to access other DB2 servers, but cannot accept requests from other remote clients?

  1. DB2 Personal Edition

  2. DB2 Workgroup Server Edition

  3. DB2Enterprise Server Edition

  4. DB2 Data Warehouse Edition


Correct Option: A

AI Explanation

To answer this question, we need to understand the different editions of DB2 and their capabilities.

Option A) DB2 Personal Edition - This option is correct because DB2 Personal Edition is designed for individual users and allows them to access other DB2 servers. However, it cannot accept requests from other remote clients.

Option B) DB2 Workgroup Server Edition - This option is incorrect because DB2 Workgroup Server Edition allows multiple users to access the database and can accept requests from remote clients.

Option C) DB2 Enterprise Server Edition - This option is incorrect because DB2 Enterprise Server Edition is the most comprehensive edition and supports multiple users and remote clients.

Option D) DB2 Data Warehouse Edition - This option is incorrect because DB2 Data Warehouse Edition is specifically designed for data warehousing purposes and supports multiple users and remote clients.

The correct answer is A) DB2 Personal Edition. This edition allows users to access other DB2 servers but cannot accept requests from other remote clients.

A client application on z/OS must access a DB2 database on a Solaris Server. At a Minimum, which of the following products must be installed on the Solaris Workstation?

  1. DB2 Connect Enterprise Edition

  2. DB2 Workgroup Server Edition

  3. DB2 Workgroup Server Edition and DB2 Connect Enterprise Edition

  4. DB2Enterprise Server Edition and DB2 Connect Enterprise Edition


Correct Option: D
  1. DB2 Express-C

  2. DB2 Express

  3. DB2 Personal Edition

  4. DB2Enterprise Server Edition


Correct Option: D
- Hide questions