0

databases Online Quiz - 199

Description: databases Online Quiz - 199
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  1. The application must release the row-level Share lock it holds and acquire an Update lock on the row

  2. The application must release the row-level Share lock it holds and acquire an Update lock on the table

  3. The row-level Share lock will automatically be converted to a row-level Up-date lock

  4. The row-level Share lock will automatically be escalated to a table-level Up-date lock


Correct Option: C

Which of the following is used to indicate a column will not accept NULL values and can be referenced in another table's foreign key specification?

  1. Check constraint

  2. Default constraint

  3. Unique constraint

  4. Informational constraint


Correct Option: C

What authority is required to create a table?

  1. ADMIN Privileges

  2. CREATETAB Privileges

  3. No Privileges

  4. USERTAB Privileges


Correct Option: B

Given the following scenario: Table TABLE1 needs to hold specific numeric values up to 9999999.999 in column COL1. Once TABLE1 is populated, arithmetic operations will be performed on data stored in col-umn COL1. Which of the following would be the most appropriate DB2 data type to use for column COL1?

  1. INTEGER

  2. REAL

  3. NUMERIC (7,3)

  4. DECIMAL(10,3)


Correct Option: D
  1. Control Center

  2. Command Center

  3. Command Line Processor

  4. Task Center


Correct Option: D

How do you find the total number of rows in a table ?

  1. SELECT COUNT *

  2. SELECT COUNT(*)

  3. SELECT COUNT[*]

  4. SELECT COUNT(ALL)


Correct Option: B

Given the following statement: CREATE TABLE t1 col1  SMALLINT NOT NULL PRIMARY KEY, col2  VARCHAR(200) NOT NULL WITH DEFAULT NONE, col3  DECIMAL(5,2) CHECK (col3 >= 100.00), col4  DATE NOT NULL WITH DEFAULT) Which of the following definitions will cause the CREATE TABLE statement to fail?

  1. COL1

  2. COL2

  3. COL3

  4. COL4


Correct Option: B

Which authority or privilege is granted by the DB2 Database Manager configuration file?

  1. CONNECT

  2. CONTROL

  3. SYSMAINT

  4. EXECUTE


Correct Option: C

Which of the following isolation levels will lock all rows scanned to build a result data set?

  1. Uncommitted Read

  2. Cursor Stability

  3. Read Stability

  4. Repeatable Read


Correct Option: D

What is the picture clause of the null indicator variable

  1. S9 (4) COMP-3

  2. S9 (4)

  3. 9 (4)

  4. S9 (4) COMP


Correct Option: D

_____ is dropped when the table or tablespace is dropped

  1. SYNONYM

  2. ALIAS

  3. All of the above

  4. None of the above


Correct Option: A

A collection of named objects is called ______

  1. Schema

  2. Table

  3. Alias

  4. Both a & b


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of databases and data management.

Option A) Schema - This option is correct because a schema is a collection of named objects, such as tables, views, indexes, and relationships, that are organized into a logical structure within a database.

Option B) Table - This option is incorrect because a table is just one type of named object that can be included in a schema. While tables are commonly used to store and organize data, a schema can contain other objects as well.

Option C) Alias - This option is incorrect because an alias is not a collection of named objects. Instead, it is a temporary alternative name given to a table or column in a database query for convenience or to resolve naming conflicts.

Option D) Both a & b - This option is incorrect because the correct answer is A) Schema. While a schema can contain tables, the term "schema" encompasses a broader concept of a collection of named objects within a database.

Therefore, the correct answer is A) Schema. This option is correct because a schema is a collection of named objects within a database.

The maximum number of tables that can be joined is _____________

  1. 20

  2. 10

  3. 15

  4. No Limit.


Correct Option: C

Given the following table: TEMP_DATA TEMP DATE _____________ 45    12/25/2006 51    12/26/2006 67    12/27/2006 72    12/28/2006 34    12/29/2006 42    12/30/2006 And the following SQL statement: TE FUNCTION degf_to_c (temp INTEGER) RETURNS INTEGER LANGUAGE SQL CONTAINS SQL NO EXTERNAL ACTION DETERMINISTIC BEGIN ATOMIC DECLARE newtemp INTEGER; SET newtemp = temp - 32; SET newtemp = newtemp * 5; RETURN newtemp / 9; END Which two of the following SQL statements illustrate the proper way to invoke the calar function DEGF_TO_C?

  1. VALUES degf_to_c(32)

  2. SELECT date, degf_to_c(temp) AS temp_c FROM temp_data

  3. CALL degf_to_c(32)

  4. Both a and b


Correct Option: D

Which wildcard character is used for a single character replacement

  1. %

  2. &

  3. _

  4. None of the above


Correct Option: C

To retrieve data from more than one table we could use

  1. Joins

  2. Unions

  3. Nested SELECT

  4. All of the above


Correct Option: D

What is the restriction on using UNION in embedded SQL ?

  1. It has to be in a CURSOR

  2. cannot be used in Embedded SQL

  3. No restrictions

  4. None of the above


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of embedded SQL and the usage of the UNION operator in embedded SQL.

Embedded SQL is a method of including SQL statements within a high-level programming language such as C or Java. It allows the programmer to combine the power and flexibility of SQL with the procedural capabilities of the programming language.

The UNION operator in SQL is used to combine the result sets of two or more SELECT statements into a single result set. It eliminates duplicate rows from the result set.

Now, let's go through each option to understand why it is correct or incorrect:

Option A) It has to be in a CURSOR - This option is the correct answer. When using the UNION operator in embedded SQL, it must be used within a CURSOR declaration. A CURSOR is a database object used to retrieve and manipulate data rows returned by a SQL query. It allows you to process the result set row by row. Therefore, the correct answer is A.

Option B) cannot be used in Embedded SQL - This option is incorrect. The UNION operator can be used in embedded SQL, but it must be used within a CURSOR declaration.

Option C) No restrictions - This option is incorrect. There are restrictions on using the UNION operator in embedded SQL, as mentioned in option A.

Option D) None of the above - This option is incorrect. The correct answer is A, as explained above.

Therefore, the correct answer is A) It has to be in a CURSOR. This option is correct because the UNION operator in embedded SQL must be used within a CURSOR declaration.

Which of the following is a NOT a valid reason for defining a view on a table?

  1. Restrict users' access to a subset of table data

  2. Ensure that rows inserted remain within the scope of a definition

  3. Produce an action as a result of a change to a table

  4. Provide users with an alternate view of table data


Correct Option: C

Which of the following isolation levels will lock all rows scanned to build a result data set?

  1. Uncommitted Read

  2. Cursor Stability

  3. Read Stability

  4. Repeatable Read


Correct Option: D
- Hide questions