DB2 Database Fundamentals and SQL
Test your knowledge of DB2 database concepts including sequences, data types, constraints, authentication, schemas, packages, and SQL performance optimization.
Questions
What was a problem with navigational data access languages?
- The user had to have knowledge of the table and index structures
- Navigational data access was far slower than declarative access
- Navigational access languages required the coder to embed their queries inside a procedural language shell
- Navigational languages were far slower then SQL
Which is a major problem with SQL
- SQL cannot support object-orientation
- The same query can be written in many ways, each with vastly different execution plans
- SQL syntax is too difficult for non-computer professionals to use
- SQL creates excessive locks within the database
Which of the following is an important feature of relational databases and SQL
- Independence of table relationships
- High speed of SQL
- Powerful GUI front-end
- Easy to install and use
Which of the following is an important consideration when tuning an SQL statement
- The number of CPUs on the server
- The degree of parallelism on the tables
- The use of bitmap indexes
- The quality of the SQL optimization
Which of the following database design features is most important to SQL performance?
- Removal of data redundancy
- The introduction of data redundancy
- The introduction of non-first normal form relations
- The introduction of SQL*Plus
Which of the following is a characteristic of a sequence?
- A sequence will never generate duplicate values. b.The MAXVALUE of a sequence can be equal to the MINVALUE. c.It is not possible to create a sequence that generates a constant since the INCREMENT value must be greater than zero.
- The MAXVALUE of a sequence can be equal to the MINVALUE
- It is not possible to create a sequence that generates a constant since the INCREMENT value must be greater than zero.
- When a sequence cycles back to either the MAXVALUE or MINVALUE, it will always be equal to the specified value of either of these two boundaries.
Which of the following DB2 data types should NOT be used to store double-byte character data?
- DBCLOB
- GRAPHIC
- VARCHAR
- VARGRAPHIC
Which of the following deletion rules on CREATE TABLE will allow parent table rows to be deleted if a dependent row exists?
- ON DELETE RESTRICT
- ON DELETE NO ACTION
- ON DELETE SET NO VALUE
- ON DELETE CASCADE
Which of the following CANNOT be used to restrict specific values from being inserted into a column in a particular table?
- Index
- Check constraint
- Referential constraint
- Default constraint
While attempting to connect to a database stored on an iSeries server from a Windows client, the following message was displayed: SQL1013N The database alias name or database name "TEST_DB" could not be found. Which of the following actions can be used to help determine why this message was displayed?
- Execute the LIST REMOTE DATABASES command on the server; look for an entry for the TEST_DB database
- . Execute the LIST DCS DIRECTORY command on the server; look for an entry for the TEST_DB database
- Execute the LIST REMOTE DATABASES command on the client; look for an entry for the TEST_DB database
- Execute the LIST DCS DIRECTORY command on the client; look for an entry for the TEST_DB database
When a client using the SERVER_ENCRYPT authentication type connects to a server using the SERVER authentication type, what happens?
- An error will occur
- Data passed between the client and the server is encrypted.
- User IDs and passwords are passed to the server unencrypted
- User IDs and passwords are encrypted before they are passed to the server.
The following SQL statements were executed in sequence: CREATE DISTINCT TYPE salary AS decimal(7,2) WITH COMPARISONS; CREATE TABLE staffsalary(empid INT, empsalary salary); INSERT INTO staffsalary VALUES (10, 50000), (20, 50000.00); UPDATE staffsalary SET empsalary = 60000 WHERE salary(50000) = empsalary; What is the current content of the staffsalary table?
- ID | EMPSALARY 10 | 60000 20 | 50000.00
- ID | EMPSALARY 10 | 50000.00 20 | 50000.00
- ID | EMPSALARY 10 | 60000.00 20 | 60000.00
- .ID | EMPSALARY 10 | 60000.00 20 | 50000.00
Which of the following provides a logical grouping of database objects?
- View
- Table
- Schema
- Buffer pool
Which of the following objects contains control structures that are considered the bound form of SQL statements
- UDT
- Trigger
- Package
- Access plan
Which of the following commands is used to retrieve database names from the local catalog for DRDA host databases on System i and System z?
- LIST DB DIRECTORY
- LIST DCS DIRECTORY
- LIST NODE DIRECTORY
- LIST ACTIVE DATABASES
Which of the following are types of routine objects?
- Package and function
- Function and userexit
- Procedure and package
- Function and procedure
What is the maximum size that can be specified when creating an XML column in a DB2 table?
- No size is specified
- The buffer pool size
- The page size for the table space
- The extent size for the table space
Given the following ALTER SEQUENCE statement: ALTER SEQUENCE myseq RESTART WITH 0 INCREMENT BY 1 NO MAXVALUE CACHE 5 ORDER Assuming that the sequence had reached a value of 100 prior to the RESTART, which of the following is true?
- The next value will be 0 and the sequence will never use the values 101 to 105.
- The next value will be 101 to ensure uniqueness between existing and newly generated sequence values.
- Previously cached values are retained by DB2, and after the restart, will be used for values 101 to 105.
- The next value will be 0 and DB2 will not ensure uniqueness between existing and newly generated values.
Within the application MY_APP the following PREVIOUS VALUE expression references the sequence MY_SEQ: PREVIOUS VALUE FOR my_seq After which of the following events will the most recently generated value of MY_SEQ persist so that it can be returned to the active MY_APP application?
- After a ROLLBACK is issued
- .After the sequence is altered
- After the sequence is dropped
- After the current session ends
Which of the following describes the objects of a DB2 database and their relationships?
- Instance
- Table space
- System catalog
- Schema repository