Tag: databases

Questions Related to databases

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 that joins 'N' tables?

  1. 4

  2. 3

  3. N - 1

  4. N + 1


Correct Option: C
Explanation:

To solve this question, the user needs to have a basic understanding of SQL joins and how to prevent cartesian products.

When joining N tables, the minimum number of conditions that should appear in the WHERE clause to produce a meaningful result set without any cartesian products is N - 1. This is because each join condition connects two tables, and N tables can be connected by N - 1 join conditions.

Option A (4) and Option B (3) are not correct because they provide specific numbers of conditions that do not apply to all cases. The number of conditions needed depends on the number of tables being joined, which is not specified in the question.

Option C (N - 1) is correct, as explained above.

Option D (N + 1) is incorrect because adding an additional condition would result in a more restrictive query, potentially excluding valid results.

Therefore, the answer is: C. N - 1.

  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Oracle will give an error


Correct Option: C
  1. Primary key access

  2. Access via unique index

  3. Table access by ROWID

  4. Full table scan


Correct Option: C
  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.

  1. Programming technique

  2. Automatically used in all prpgramme

  3. PL/SQL compiler directive

  4. All of the above


Correct Option: C
  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