Tag: databases

Questions Related to databases

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;which of the following choice indentifies the result oracle will return

  1. <14

  2. >14

  3. 14

  4. 0


Correct Option: A

You can declare this only by using table contraint syntax

  1. Not NULL

  2. Primary key

  3. Foreign key

  4. Composite primary keys


Correct Option: D
  1. Primary key access

  2. Access via unique index

  3. Table access by ROWID

  4. Full table scan


Correct Option: C

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Undefined


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. 3

  3. 2

  4. 4


Correct Option: B

Which of the following is not true for Stored Procedures?

  1. Simplifies code reuse, code standardization and code maintenance

  2. Controlled access to other database objects

  3. Improving application performance

  4. DB2 Stored Procedures can be written only in SQL.


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) Simplifies code reuse, code standardization, and code maintenance - This option is true for Stored Procedures. Stored Procedures provide a way to encapsulate a set of SQL statements into a single unit, making it easier to reuse the code, maintain a standard structure, and update the code in one place.

Option B) Controlled access to other database objects - This option is true for Stored Procedures. Stored Procedures can control access to other database objects by specifying the necessary permissions and privileges required to execute the procedure. This helps in enforcing security and preventing unauthorized access to the database.

Option C) Improving application performance - This option is true for Stored Procedures. Stored Procedures can improve application performance by reducing network traffic. Instead of sending multiple SQL statements from the application to the database, the application can call a single Stored Procedure that performs the necessary operations on the database server, reducing the overhead of multiple round trips.

Option D) DB2 Stored Procedures can be written only in SQL - This option is not true for Stored Procedures. DB2 Stored Procedures can be written in other programming languages such as COBOL, C, Java, etc., in addition to SQL. This allows developers to leverage the power of different programming languages to implement complex business logic within the Stored Procedures.

The correct answer is D. This option is not true because DB2 Stored Procedures can be written in languages other than SQL.