0

databases Online Quiz - 109

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

A Database Procedure is stored in the Database

  1. In compiled form

  2. As source code

  3. Both A & B

  4. Not stored


Correct Option: A

If an UNIQUE KEY constraint on DATE column is created, will it accept the rows that are inserted with SYSDATE?

  1. will

  2. won't

  3. sometimes possible

  4. None of the above


Correct Option: B

AI Explanation

To answer this question, let's understand the concept of UNIQUE KEY constraint and the behavior of SYSDATE.

A UNIQUE KEY constraint ensures that the values in a column or a group of columns are unique. It prevents duplicate values from being inserted into the column(s) that the constraint is defined on.

SYSDATE is a function in SQL that returns the current date and time. When you use SYSDATE in an INSERT statement, it will insert the current date and time into the specified column.

Based on this information, if a UNIQUE KEY constraint is created on a DATE column and you try to insert rows with SYSDATE, the constraint will not accept the rows. This is because each new row will have a different date and time value, which violates the uniqueness constraint.

Therefore, the correct answer is:

Option B) won't - This option is correct because when a UNIQUE KEY constraint is created on a DATE column, it will not accept rows that are inserted with SYSDATE.

What is the Result of the following 'AXA'||NULL||'US' ?

  1. Error

  2. NULL

  3. AXA US

  4. AXAUS


Correct Option: D

Use these data for the following Questions EMPNO ENAME SAL A822 RAMASWAMY 3500 A812 NARAYAN 5000 A973 UMESH 2850 A500 BALAJI 5750 Select SAL from EMP E1 where 3 > ( Select count(*) from Emp E2 where E1.SAL > E2.SAL ) will retrieve

  1. 3500,5000,2850

  2. 5000,2850

  3. 2850,5750

  4. 5000,5750


Correct Option: A

What is a trigger?

  1. A piece of logic written in PL/SQL

  2. Executed at the arrival of a SQL event

  3. Both A & B

  4. None of the above


Correct Option: C
  1. Only when it is Committed

  2. Only when it is Rolled back

  3. When it is Committed or Rolled back

  4. None of the above


Correct Option: C

What are the different events in Triggers?

  1. Define, Create

  2. Insert, Update, Delete

  3. Drop, Comment

  4. All of the above


Correct Option: B

Use these data for the following Questions EMPNO ENAME SAL E100 John 3250 E200 Praveen 2000 E300 Mahesh E400 Prasanth 5500 E500 Vikram 6650 Select count (sal) from Emp will retrieve

  1. 1

  2. 0

  3. 3

  4. 4

  5. None of the above


Correct Option: D

The Data Manipulation Language statements are

  1. INSERT

  2. UPDATE

  3. SELECT

  4. All of the above


Correct Option: D

Declare a number := 5; b number := null; c number := 10; Begin if a > b AND a < c then a := c * a; end if; End; What will be the value of 'a' after execution?

  1. 50

  2. NULL

  3. 5

  4. None of the above


Correct Option: C

AI Explanation

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

Option A) 50 - This option is incorrect because the value of 'a' will not be multiplied by 'c' since the condition in the if statement is not satisfied.

Option B) NULL - This option is incorrect because the value of 'a' is initially 5 and it will not be set to NULL in the given code.

Option C) 5 - This option is correct because the condition in the if statement is satisfied (a > b and a < c), so the value of 'a' will be updated to the product of 'c' and 'a', which is 10 * 5 = 50. Therefore, the value of 'a' will be 5 after execution.

Option D) None of the above - This option is incorrect because the correct answer is option C, as explained above.

The correct answer is C. The value of 'a' will be 5 after execution.

Find the ODD Datatype out

  1. VARCHAR2

  2. RECORD

  3. BOOLEAN

  4. RAW


Correct Option: B

A Database Procedure is stored in the Database

  1. In compiled form

  2. As source code

  3. Both A & B

  4. Not stored


Correct Option: A

What is the Result of the following 'AXA'||NULL||'US' ?

  1. Error

  2. NULL

  3. AXA US

  4. AXAUS


Correct Option: D

Use these data for the following Questions EMPNO ENAME SAL A822 RAMASWAMY 3500 A812 NARAYAN 5000 A973 UMESH 2850 A500 BALAJI 5750 Select SAL from EMP E1 where 3 > ( Select count(*) from Emp E2 where E1.SAL > E2.SAL ) will retrieve

  1. 3500,5000,2850

  2. 5000,2850

  3. 2850,5750

  4. 5000,5750


Correct Option: A

What is a trigger?

  1. A piece of logic written in PL/SQL

  2. Executed at the arrival of a SQL event

  3. Both A & B

  4. None of the above


Correct Option: C

A Transaction ends

  1. Only when it is Committed

  2. Only when it is Rolled back

  3. When it is Committed or Rolled back

  4. None of the above


Correct Option: C
  1. scott

  2. john

  3. sys

  4. system


Correct Option: C
Explanation:

To solve this question, the user needs to know about the DUAL table in Oracle databases.

The DUAL table is a one-row, one-column table that is automatically created by Oracle. It is owned by the SYS user and is accessible to all users.

Therefore, the correct answer is:

The Answer is: C. sys

Dropping a table causes its synonym to drop.

  1. True

  2. False


Correct Option: B

can we rename a Synonym?

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, we need to understand the concept of synonyms.

Synonyms are words that have similar meanings. In databases, synonyms are used to provide alternative names for database objects, such as tables, views, or procedures.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) True - This option is correct because we can rename a synonym. In databases, you can use the ALTER SYNONYM statement to rename a synonym. This allows you to change the name of the synonym without affecting the underlying object it refers to.

Option B) False - This option is incorrect. As mentioned above, we can rename a synonym in databases.

The correct answer is A) True. This option is correct because we can indeed rename a synonym using the ALTER SYNONYM statement.

- Hide questions