0

databases Online Quiz - 237

Description: databases Online Quiz - 237
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  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
  1. System tablespace

  2. Users tablespace

  3. Default tablespace for the user

  4. Undefined


Correct Option: C

To use Global temporary tables in a compound statement you require which type of tablespace to be present

  1. User temporary

  2. Large

  3. System

  4. Regular


Correct Option: A

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.

GET DIAGNOSTICS

  1. Is used to obtain info about the previous executed sql statement

  2. Analyze the db2diag error messages

  3. Returns the user ID calling the stored proc

  4. Gives the access plan of the packages


Correct Option: A

What is the Output ?

  1. 1

  2. 0

  3. 10

  4. 11


Correct Option: A
  1. Will executes successfully

  2. Fails as limit is 3 but only 2 opened

  3. Executes with warning

  4. Would not allow compiling the SP at the first place


Correct Option: A

What one is valid special register?

  1. CURRENT_CLIENT_ACCT

  2. CURRENT_SCHEMA

  3. CURRENT_DATETIME

  4. CURRENT_PARTITION


Correct Option: B

What will be the initial value of V_MAX in the declaration statement shown below? DECLARE v_max DECIMAL(9,2);

  1. 0.0

  2. 2

  3. 9

  4. Null


Correct Option: D

Which is not a valid data type in DB2 LUW?

  1. BIGINT

  2. DECFLOAT

  3. XML

  4. DATETIME


Correct Option: D

CREATE PROCEDURE p1() BEGIN CREATE TABLE T1 (C1 CHAR); INSERT INTO T1 VALUES ('A'); SAVEPOINT SAVEPOINT1 ON ROLLBACK RETAIN CURSORS; INSERT INTO T1 VALUES ('B'); SAVEPOINT SAVEPOINT2 ON ROLLBACK RETAIN CURSORS; INSERT INTO T1 VALUES ('C'); SAVEPOINT SAVEPOINT3 ON ROLLBACK RETAIN CURSORS; INSERT INTO T1 VALUES ('D'); ROLLBACK TO SAVEPOINT SAVEPOINT3; ROLLBACK TO SAVEPOINT SAVEPOINT1; COMMIT WORK; INSERT INTO T1 VALUES ('E'); END@ Call p1() @ How many rows will be present in Table T1

  1. 0

  2. 1 (A)

  3. 5 (A,B,C,D,E)

  4. 2 (A,E)


Correct Option: D
  1. Control centre

  2. IBM Data studio

  3. Visual Explain

  4. Command editor


Correct Option: B
- Hide questions