1.
ENTITY INTEGRITY is a state where column that is part of a primary key can have null values.
Correct Answer
B. False
Explanation
Entity integrity refers to the rule that states that the primary key of a table must have a unique value and cannot be null. Therefore, a column that is part of a primary key cannot have null values. Since the statement in the question contradicts this rule, the correct answer is False.
2.
. SQLCODE -922 is for authorization failure
Correct Answer
A. True
Explanation
SQLCODE -922 is indeed for authorization failure. In SQL, authorization failure occurs when a user attempts to perform an operation for which they do not have the necessary privileges or permissions. When this happens, the SQLCODE -922 is returned, indicating that the authorization has failed. This error code helps in identifying and troubleshooting authorization-related issues in SQL queries or database operations.
3.
We Can use MAX on a CHAR column
Correct Answer
A. True
Explanation
The statement is true because in some databases, such as MySQL, we can use the MAX function on a CHAR column. The MAX function is used to find the maximum value in a column, and it can be applied to different data types, including CHAR. When applied to a CHAR column, the MAX function will return the maximum value based on the character's ASCII value.
4.
Every SQL statement is executable.
Correct Answer
B. False
Explanation
The statement "Every SQL statement is executable" is false. While most SQL statements are executable, there are some statements that are not meant to be executed directly, such as comments or statements that define database objects. These non-executable statements are used for documentation or as part of the database schema, but they are not intended to be executed as part of a query or transaction. Therefore, not every SQL statement is executable.
5.
SUBSTR(CUSTNAME,1,3) will extract 1st 3 character from CUSTNAME string
Correct Answer
A. True
Explanation
The statement is true because the SUBSTR function is used to extract a substring from a given string. In this case, the function will extract the first 3 characters from the CUSTNAME string.
6.
Which of the following DB2 objects allows multiple users to access data in a table with each only being able to access certain portions of the data?
Correct Answer
A. Views
Explanation
Views in DB2 allow multiple users to access data in a table with each user only being able to access certain portions of the data. Views are virtual tables that are based on the underlying tables and can be used to restrict or filter the data that is visible to different users. By defining specific criteria or conditions in the view, different users can be granted access to only the data that meets those criteria, providing a level of security and control over the data.
7.
Which one of the following is NOT a DB2 object?
Correct Answer
C. Column
Explanation
A column is not considered a DB2 object because it is not an independent entity within the database. It is a component of a table, which is a DB2 object. A column represents a specific attribute or field within a table and cannot exist on its own. Therefore, it is not classified as a separate DB2 object.
8.
What does a positive value of SQL code mean?
Correct Answer
B. Successful execution
Explanation
A positive value of SQL code typically indicates successful execution. When a SQL statement is executed successfully, it returns a positive value to indicate that the operation was completed without any errors. This means that the query or command was processed correctly and the desired operation was successfully performed on the database.
9.
AUTOMATIC RECOMPILATION occurs when
Correct Answer
C. Both (A) and (B).
Explanation
Automatic recompilation occurs when either an existing index is dropped or a new index is created. In both cases, the database management system automatically recompiles the affected objects to ensure the integrity and consistency of the data. This process is necessary to update the execution plans and optimize the performance of queries that depend on the dropped or newly created index.
10.
The final result of a DB2 BIND is
Correct Answer
B. DB2 (application) Plan
Explanation
The final result of a DB2 BIND is a DB2 (application) Plan. During the BIND process, the application program is linked with the DB2 system, and a plan is created. The plan contains information about the access path and optimization for executing the SQL statements in the application program. The plan is then stored in the DB2 catalog, which is a system database that contains metadata about the DB2 system and its objects. The plan is used by the DB2 system to execute the SQL statements efficiently when the application program is run.