0

databases Online Quiz - 208

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

Sub query cannot have which clause defined for it

  1. where

  2. having

  3. order by

  4. none of the above


Correct Option: C

Select length(-1) from dual What is the output of the above sql stmt

  1. 2

  2. 1

  3. 0

  4. error


Correct Option: A

The standard EMP table contains 14 records corresponding to the employess of the corporation.One of those records has a NULL value stored in the MGR column.If Issue the following command on the table: select count(mgr) from emp; What is the count?

  1. 14

  2. >14

  3. error

  4. <14


Correct Option: D
  1. Composite primarykey

  2. Not null

  3. unique

  4. check


Correct Option: A

An interval literal specifies

  1. a period of time

  2. a numerical difference

  3. a descriptive number

  4. a floating point number


Correct Option: A

You use comments in a SQL statement to pass hints to the Oracle optimizer.

  1. False

  2. This is hard to determine

  3. True

  4. None of the choices


Correct Option: C

For each DATE value in an Oracle database, which of the following information is stored (choose all that apply):

  1. second

  2. century

  3. hour

  4. year

  5. date

  6. month


Correct Option: A,B,C,D,E,F

Sub query cannot have which clause defined for it

  1. where

  2. having

  3. order by

  4. none of the above


Correct Option: C

Select length(-1) from dual What is the output of the above sql stmt

  1. 2

  2. 1

  3. 0

  4. error


Correct Option: A

The standard EMP table contains 14 records corresponding to the employess of the corporation.One of those records has a NULL value stored in the MGR column.If Issue the following command on the table: select count(mgr) from emp; What is the count?

  1. 14

  2. >14

  3. error

  4. <14


Correct Option: D
  1. Composite primarykey

  2. Not null

  3. unique

  4. check


Correct Option: A

An interval literal specifies

  1. a period of time

  2. a numerical difference

  3. a descriptive number

  4. a floating point number


Correct Option: A

You use comments in a SQL statement to pass hints to the Oracle optimizer.

  1. False

  2. This is hard to determine

  3. True

  4. None of the choices


Correct Option: C

For each DATE value in an Oracle database, which of the following information is stored (choose all that apply):

  1. second

  2. century

  3. hour

  4. year

  5. date

  6. month


Correct Option: A,B,C,D,E,F

Which of the following are the correct value for the column whose data type is declared as number(3,4)

  1. 123.21

  2. 0.001

  3. 0.01

  4. 123.01


Correct Option: C

Which of the following describes the difference between varchar and varchar2 data types

  1. varchar is used to store fixed length character data, varchar2 is for variable length character data

  2. varchar data type is not supported in oracle

  3. varchar data type is applicable only to PL/SQL

  4. maximum length for varchar is 2000 bytes and for varchar2 is 4000 bytes


Correct Option: D

What is true in case of deferred constraints in Oracle?

  1. The Constraint condition is never checked

  2. The Constraint condition is checked only at the time of commiting the transaction

  3. The Constraint condition is checked only for newly inserted rows and will not be checked for already existing rows in the table

  4. The constraint condition is checked after a predefined time interval


Correct Option: B

Which of the following clause enables to drop the foreign key constraints of the child table while dropping the parent table?

  1. drop foreign keys

  2. cascade constraints

  3. this is not possible in oracle

  4. clear references


Correct Option: B

AI Explanation

To answer this question, you need to understand how foreign key constraints work in a database.

Foreign key constraints are used to enforce referential integrity between tables in a database. When a foreign key constraint is defined between a parent table and a child table, it ensures that any value in the child table's foreign key column must exist in the parent table's primary key column.

When you want to drop a parent table that has foreign key constraints with a child table, you need to first drop the foreign key constraints in the child table. This is because the child table's foreign key constraints reference the parent table's primary key, and you cannot drop the parent table if the child table still has references to it.

The clause that enables you to drop the foreign key constraints of the child table while dropping the parent table is "cascade constraints."

Option A) drop foreign keys - This option is incorrect because there is no such clause in Oracle to drop foreign keys directly. You need to use "cascade constraints" to drop the foreign key constraints.

Option B) cascade constraints - This option is correct. It allows you to drop the foreign key constraints of the child table while dropping the parent table.

Option C) this is not possible in Oracle - This option is incorrect. In Oracle, you can drop the foreign key constraints of the child table using "cascade constraints" clause.

Option D) clear references - This option is incorrect. "Clear references" is not a valid clause in Oracle for dropping foreign key constraints.

The correct answer is option B. The "cascade constraints" clause enables you to drop the foreign key constraints of the child table while dropping the parent table.

The table employee contains 20 records. What is the output of the query " Select 8 from Employee"?

  1. No Rows retrieved

  2. 8 is displayed 20 times

  3. 8 is displayed 1 time

  4. error message


Correct Option: B

The columns with unique constraint allows more than one null values to be inserted.

  1. True

  2. False


Correct Option: B
- Hide questions