1.
In which mode of Command Line Processor (CLP) must each command and SQL statements be prefixed by "db2"?
Correct Answer
C. Command mode
Explanation
In Command mode of Command Line Processor (CLP), each command and SQL statement must be prefixed by "db2". This mode allows the user to directly interact with the CLP and execute commands and SQL statements. By prefixing the commands and SQL statements with "db2", the CLP recognizes them as valid inputs and processes them accordingly. This mode is commonly used when executing individual commands or SQL statements in a sequential manner.
2.
For DB2 Database Server, the default instance is:
Correct Answer
D. DB2
Explanation
The default instance for the DB2 Database Server is DB2.
3.
Which of these expressions means no rows found?
Correct Answer
C. +100
Explanation
The expression "+100" means no rows found. In SQL, a positive number is often used to represent the number of rows affected or returned by a query. In this case, the "+100" expression implies that there are no rows affected or returned, indicating that no rows were found.
4.
The SQL return code "0" means:
Correct Answer
A. Successful execution
Explanation
The SQL return code "0" indicates that the execution of the SQL statement was successful. This means that the query was executed without any errors or issues, and it returned the expected results.
5.
The following are constraints types except
Correct Answer
A. NOT NULL
Explanation
The given answer is "NOT NULL" because it is not a type of constraint. The other options listed - Unique, Conditional, and Information - are all types of constraints that can be used in a database. NOT NULL is not a constraint type, but rather a property that can be applied to a column in a table to specify that the column must have a value and cannot be left empty.
6.
A set of columns in a table which are required to match at least one primary key of a row in another table is
Correct Answer
B. Foreign key
Explanation
A foreign key is a set of columns in a table that are required to match at least one primary key of a row in another table. It establishes a relationship between two tables by referencing the primary key of one table in another table. This ensures data integrity and allows for the creation of meaningful relationships between tables in a database.
7.
The syntax for creating a sequence is
Correct Answer
D. Db2 create sequence
Explanation
The correct answer is "db2 create sequence" because it follows the syntax for creating a sequence. The "db2" keyword indicates that the sequence is being created in a DB2 database, and the "create sequence" command is used to create a new sequence in the database. The other options, "Ibm sequence" and "Ibm create sequence," do not follow the correct syntax and are therefore incorrect.
8.
What is the physical storage length of DATE data type?
Correct Answer
C. 4 bytes
Explanation
The physical storage length of the DATE data type is 4 bytes. This means that when a date is stored in a database, it will take up 4 bytes of storage space. This is a relatively small amount of storage compared to other data types, such as strings or integers, which can take up more space. The 4 bytes are used to store the date in a specific format that allows for efficient storage and retrieval of date values.
9.
What does a positive SQL code indicates?
Correct Answer
A. Exception
Explanation
A positive SQL code typically indicates an exception. In SQL, codes are used to indicate the success or failure of a statement or operation. A positive code usually signifies that an exception or error has occurred during the execution of the SQL statement. This could be due to various reasons such as invalid syntax, constraint violations, or data manipulation issues. Therefore, a positive SQL code generally suggests that there was an exception or error encountered while processing the SQL statement.
10.
Which table space houses only one table?
Correct Answer
A. Partitioned Table space
Explanation
A partitioned table space is a type of table space that is divided into multiple partitions, each of which can hold a subset of the data in the table. Each partition can be stored on a different storage device or in a different location. This allows for better performance and manageability of large tables. In contrast, segmented table spaces and simple table spaces do not have the concept of partitions and can house multiple tables. Therefore, the correct answer is partitioned table space.