0

databases Online Quiz - 227

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

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

  1. Primary key access

  2. Access via unique index

  3. Table access by ROWID

  4. Full table scan


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) Primary key access - This option is a fast way for Oracle to retrieve a single row. When a table has a primary key defined, Oracle can use the primary key index to directly access the specific row based on its primary key value.

Option B) Access via unique index - This option is also a fast way for Oracle to retrieve a single row. When a table has a unique index defined on a column, Oracle can use the unique index to directly access the specific row based on its unique index value.

Option C) Table access by ROWID - This option is the fastest way for Oracle to retrieve a single row. The ROWID is a unique identifier for each row in a table, and Oracle can use the ROWID to directly access the specific row without needing to use an index.

Option D) Full table scan - This option is not the fastest way for Oracle to retrieve a single row. A full table scan involves reading every row in the table, which can be time-consuming and resource-intensive. It is generally used when retrieving multiple rows or when there is no appropriate index available.

The correct answer is C) Table access by ROWID. This option is the fastest way for Oracle to retrieve a single row because it directly accesses the specific row using its unique ROWID identifier.

Tables, views , incexes are all part of database objects

  1. True

  2. False


Correct Option: A
  1. DROP

  2. DELETE

  3. CASCADE

  4. TRUNCATE


Correct Option: D
Explanation:

To solve this question, the user needs to know the basic SQL commands for deleting data from a table.

Option A: DROP is used to delete an entire table, not just its data. This option is incorrect.

Option B: DELETE is used to delete data from a table. However, it writes the deleted data to the rollback segment in case it needs to be recovered later. This option is incorrect.

Option C: CASCADE is an option used with the DROP command to delete all objects that depend on the specified object before dropping that object. This option is incorrect.

Option D: TRUNCATE is used to delete all data from a table without logging the individual row deletions. It does not write the deleted data to the rollback segment, making it a faster operation compared to DELETE. This option is correct.

Therefore, the answer is: D. TRUNCATE.

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

  1. INSTR

  2. SUBSTRING

  3. SUBSTR

  4. POS


Correct Option: C
  1. Programming technique

  2. Automatically used in all prpgramme

  3. PL/SQL compiler directive

  4. All of the above


Correct Option: C

PACK_MESSAGE is used in

  1. queeing

  2. piping

  3. Autonomus transaction

  4. Host I/O


Correct Option: B

What is the command used to encrypt a PL/SQL application

  1. ENCRYPT

  2. DECRYPT

  3. WRAP

  4. UNWRAP


Correct Option: C

Which is true for ROWID% data type

  1. Binary data upto 4GB

  2. Character data upto 4 GB

  3. A hexadecimal string representing the unique address of a row in its table

  4. Binary data stored in an external file


Correct Option: C
Explanation:

To solve this question, the user needs to know about the ROWID data type in databases.

The ROWID is a pseudo column added by Oracle to all tables, which stores the row's unique identifier. The ROWID is represented in hexadecimal format, and it uniquely identifies each row in a table.

Now, let's go through each option and explain why it is right or wrong:

A. Binary data upto 4GB: This option is incorrect because ROWID is not a data type that stores binary data.

B. Character data upto 4 GB: This option is incorrect because ROWID is not a data type that stores character data.

C. A hexadecimal string representing the unique address of a row in its table: This option is correct. The ROWID data type stores a hexadecimal string that represents the unique address of a row in its table.

D. Binary data stored in an external file: This option is incorrect because ROWID is not a data type that stores binary data in an external file.

The Answer is: C

What can you create to restrict user access to a table?

  1. Index

  2. synonym

  3. view

  4. trigger


Correct Option: C

What database object is used to increase performance for accessing data within a database?

  1. Roles

  2. Sequences

  3. Synonyms

  4. Index


Correct Option: D

Which clause of the CREATE SEQUENCE statement will cause the sequence to continue to generate numbers even after the maximum limit is reached?

  1. MAXVALUE

  2. MINVALUE

  3. CYCLE

  4. INCREMENT BY


Correct Option: C

Which datatypes are alphanumeric?

  1. Number

  2. Blob

  3. Char

  4. Raw


Correct Option: C

How do you execute an anonymous block within SQL*Plus?

  1. exec command

  2. / command

  3. execute command

  4. None of these


Correct Option: B

Where can NOT a subquery be used within a SQL statement that is in a PL/SQL block?

  1. WHERE

  2. FROM

  3. INSERT

  4. UPDATE


Correct Option: B

What data dictionary view will display information about the columns in the database that have constraints?

  1. USER_CONSTRAINTS

  2. USER_CONS_COLUMNS

  3. DBA_CONSTRAINTS

  4. DBA_TABLE


Correct Option: B

What PL/SQL control structure is known as an IF-THEN statement?

  1. Conditional

  2. Sequential

  3. Iterative

  4. Loop


Correct Option: A
- Hide questions