0

databases Online Quiz - 74

Description: databases Online Quiz - 74
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0
  1. The user had to have knowledge of the table and index structures

  2. Navigational data access was far slower than declarative access

  3. Navigational access languages required the coder to embed their queries inside a procedural language shell

  4. Navigational languages were far slower then SQL


Correct Option: A

Which is a major problem with SQL

  1. SQL cannot support object-orientation

  2. The same query can be written in many ways, each with vastly different execution plans

  3. SQL syntax is too difficult for non-computer professionals to use

  4. SQL creates excessive locks within the database


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) SQL cannot support object-orientation - This option is incorrect. SQL is a language specifically designed for managing and manipulating relational databases. While it may not have built-in support for object-oriented features, it can still interact with object-oriented programming languages through various mechanisms.

Option B) The same query can be written in many ways, each with vastly different execution plans - This option is correct. One of the major problems with SQL is that it allows for different ways to write the same query, and each variation can result in a different execution plan. This can lead to performance issues if the query is not optimized properly.

Option C) SQL syntax is too difficult for non-computer professionals to use - This option is incorrect. While SQL may have a learning curve, it is designed to be a declarative language that is relatively easy to understand and use. There are also graphical tools and user-friendly interfaces available that make it more accessible to non-computer professionals.

Option D) SQL creates excessive locks within the database - This option is incorrect. SQL does use locks to manage concurrent access to the database, but it does not inherently create excessive locks. The management of locks and concurrency control is the responsibility of the database management system (DBMS) implementing SQL.

Therefore, the correct answer is B) The same query can be written in many ways, each with vastly different execution plans. This option is correct because the flexibility of SQL can lead to different query variations, and if not optimized properly, it can result in vastly different execution plans with potential performance implications.

Which of the following is an important feature of relational databases and SQL

  1. Independence of table relationships

  2. High speed of SQL

  3. Powerful GUI front-end

  4. Easy to install and use


Correct Option: A

AI Explanation

To answer this question, you need to understand the features of relational databases and SQL. Let's go through each option to understand why it is correct or incorrect:

Option A) Independence of table relationships - This option is correct because one of the key features of relational databases is the ability to establish relationships between tables. This allows data to be stored in multiple tables and linked together using keys, providing flexibility and efficient data retrieval.

Option B) High speed of SQL - This option is incorrect because the speed of SQL queries can vary depending on factors such as the complexity of the query, the size of the database, and the efficiency of the database management system. While SQL can be optimized for performance, high speed is not an inherent feature of SQL itself.

Option C) Powerful GUI front-end - This option is incorrect because a GUI front-end is not an inherent feature of relational databases and SQL. While some database management systems may provide GUI tools for easier interaction with the database, the core functionality of SQL can be accessed through command-line interfaces or programming interfaces.

Option D) Easy to install and use - This option is incorrect because the ease of installation and use can vary depending on the specific database management system and the user's familiarity with SQL. While some database management systems may provide user-friendly installation processes and user interfaces, the ease of use is not an inherent feature of relational databases and SQL.

The correct answer is A) Independence of table relationships. This option is correct because the ability to establish relationships between tables is a fundamental feature of relational databases and SQL.

  1. The number of CPUs on the server

  2. The degree of parallelism on the tables

  3. The use of bitmap indexes

  4. The quality of the SQL optimization


Correct Option: D

Which of the following database design features is most important to SQL performance?

  1. Removal of data redundancy

  2. The introduction of data redundancy

  3. The introduction of non-first normal form relations

  4. The introduction of SQL*Plus


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of database design features and their impact on SQL performance.

Option A) Removal of data redundancy - This option is incorrect because removing data redundancy is a good practice in database design to improve data integrity and reduce storage space. However, it does not directly impact SQL performance.

Option B) The introduction of data redundancy - This option is correct because introducing data redundancy can improve SQL performance in certain scenarios. By duplicating data across multiple tables, it can eliminate the need for complex join operations and improve query performance. However, it is important to note that data redundancy should be used judiciously and carefully managed to ensure data consistency and integrity.

Option C) The introduction of non-first normal form relations - This option is incorrect. Normalization is a process in database design that helps eliminate data redundancy and improve data integrity. However, introducing non-first normal form relations can lead to more complex queries and potentially slower SQL performance.

Option D) The introduction of SQL*Plus - This option is incorrect. SQL*Plus is a command-line interface tool for SQL, but it does not directly impact database design features or SQL performance.

Therefore, the correct answer is B) The introduction of data redundancy. This option is correct because introducing data redundancy can improve SQL performance in certain scenarios by reducing the need for complex join operations.

Which of the following is a characteristic of a sequence?

  1. 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.

  2. The MAXVALUE of a sequence can be equal to the MINVALUE

  3. It is not possible to create a sequence that generates a constant since the INCREMENT value must be greater than zero.

  4. 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.


Correct Option: B

Which of the following deletion rules on CREATE TABLE will allow parent table rows to be deleted if a dependent row exists?

  1. ON DELETE RESTRICT

  2. ON DELETE NO ACTION

  3. ON DELETE SET NO VALUE

  4. ON DELETE CASCADE


Correct Option: D

Which of the following CANNOT be used to restrict specific values from being inserted into a column in a particular table?

  1. Index

  2. Check constraint

  3. Referential constraint

  4. Default constraint


Correct Option: D

AI Explanation

To answer this question, you need to understand the different ways to restrict specific values from being inserted into a column in a table.

Option A) Index - This option is incorrect. An index is used to improve the performance of queries by creating a data structure that allows for faster data retrieval. It does not restrict specific values from being inserted into a column.

Option B) Check constraint - This option is incorrect. A check constraint is used to specify a condition that must be met for a column or set of columns in a table. It restricts the values that can be inserted into the column based on the specified condition.

Option C) Referential constraint - This option is incorrect. A referential constraint is used to enforce referential integrity between two tables. It ensures that values inserted into a foreign key column in one table exist in the referenced primary key column of another table.

Option D) Default constraint - This option is correct. A default constraint is used to specify a default value for a column in a table. It does not restrict specific values from being inserted into the column.

The correct answer is D) Default constraint. This option cannot be used to restrict specific values from being inserted into a column in a particular table.

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?

  1. Execute the LIST REMOTE DATABASES command on the server; look for an entry for the TEST_DB database

  2. . Execute the LIST DCS DIRECTORY command on the server; look for an entry for the TEST_DB database

  3. Execute the LIST REMOTE DATABASES command on the client; look for an entry for the TEST_DB database

  4. Execute the LIST DCS DIRECTORY command on the client; look for an entry for the TEST_DB database


Correct Option: D

When a client using the SERVER_ENCRYPT authentication type connects to a server using the SERVER authentication type, what happens?

  1. An error will occur

  2. Data passed between the client and the server is encrypted.

  3. User IDs and passwords are passed to the server unencrypted

  4. User IDs and passwords are encrypted before they are passed to the server.


Correct Option: A

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?

  1. ID | EMPSALARY 10 | 60000 20 | 50000.00

  2. ID | EMPSALARY 10 | 50000.00 20 | 50000.00

  3. ID | EMPSALARY 10 | 60000.00 20 | 60000.00

  4. .ID | EMPSALARY 10 | 60000.00 20 | 50000.00


Correct Option: C

Which of the following provides a logical grouping of database objects?

  1. View

  2. Table

  3. Schema

  4. Buffer pool


Correct Option: C

Which of the following objects contains control structures that are considered the bound form of SQL statements

  1. UDT

  2. Trigger

  3. Package

  4. Access plan


Correct Option: C

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?

  1. LIST DB DIRECTORY

  2. LIST DCS DIRECTORY

  3. LIST NODE DIRECTORY

  4. LIST ACTIVE DATABASES


Correct Option: B

Which of the following are types of routine objects?

  1. Package and function

  2. Function and userexit

  3. Procedure and package

  4. Function and procedure


Correct Option: D

What is the maximum size that can be specified when creating an XML column in a DB2 table?

  1. No size is specified

  2. The buffer pool size

  3. The page size for the table space

  4. The extent size for the table space


Correct Option: A

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?

  1. The next value will be 0 and the sequence will never use the values 101 to 105.

  2. The next value will be 101 to ensure uniqueness between existing and newly generated sequence values.

  3. Previously cached values are retained by DB2, and after the restart, will be used for values 101 to 105.

  4. The next value will be 0 and DB2 will not ensure uniqueness between existing and newly generated values.


Correct Option: D

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?

  1. After a ROLLBACK is issued

  2. .After the sequence is altered

  3. After the sequence is dropped

  4. After the current session ends


Correct Option: A

Which of the following describes the objects of a DB2 database and their relationships?

  1. Instance

  2. Table space

  3. System catalog

  4. Schema repository


Correct Option: C
Explanation:

To solve this question, the user needs to know about the components of a DB2 database and their functions.

A. Instance: This refers to the environment in which DB2 runs. An instance includes system memory, a set of processes, and a set of configuration files. It is responsible for managing the overall operation of the database.

B. Table space: This is where the actual data is stored in a DB2 database. A table space consists of one or more containers that hold the actual data. Each container can be a file or a set of files.

C. System catalog: This is a set of tables that hold metadata about the database objects, such as tables, indexes, views, etc. It is used by DB2 to manage the database and its objects.

D. Schema repository: This is a collection of schemas, which are logical containers for database objects such as tables, views, indexes, etc.

Among the given options, C is the correct answer as the system catalog is responsible for storing metadata about the database objects and their relationships. It provides information about tables, indexes, views, permissions, etc. and is used by the DB2 system to manage the database and its objects. Therefore, the correct answer is:

The Answer is: C

- Hide questions