Computer Knowledge

Database Management Systems

5,543 Questions

Database Management Systems (DBMS) form the core framework for data storage, retrieval, and security in modern software applications. Concepts such as the E-R model, backup planning, SQL integration, and big data architecture are essential for computer knowledge sections. This hub offers a comprehensive set of practice questions to master DBMS fundamentals and advanced database operations.

E-R Model ConceptsBackup and RecoverySQL Server UpgradesJDBC and ODBCBig Data CharacteristicsData VirtualizationOracle Database

Database Management Systems Questions

Multiple choice database
  1. confusion in selection of optimal query execution method

  2. disk space consumption

  3. performance overhead

  4. security

  5. Either AB&C

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

To solve this question, the user needs to understand the purpose of secondary indexes and their impact on the database system.

Secondary indexes are additional indexes created on a table to improve the performance of database queries. They allow queries to search for data using columns other than the primary key, which can speed up query execution times. However, secondary indexes can also have a negative impact on the database in terms of disk space consumption and performance overhead.

Option A is incorrect because the selection of an optimal query execution method is not affected by the creation of secondary indexes. Query execution methods are determined by the database management system's query optimizer, which decides the best way to execute a query based on factors such as table statistics, query complexity, and available resources.

Option B is correct because secondary indexes require additional disk space to store the index data. This can be a significant issue for large databases with many indexes, as it can lead to increased storage costs and slower query performance due to disk I/O.

Option C is correct because secondary indexes can also lead to performance overhead when performing database operations such as insert, update, and delete. When these operations are performed, the database must update the primary index as well as any secondary indexes that reference the affected columns. This can lead to slower query execution times and increased system resource usage.

Option D is incorrect because the creation of secondary indexes does not have a direct impact on database security. However, it is important to ensure that only authorized users have access to create, modify, or delete indexes to maintain the security of the database.

Therefore, the correct answer is:

The Answer is: E

Multiple choice database
  1. hardware requirements

  2. data compression support

  3. encryption support

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

To select a DBMS based on the criteria of physical capabilities, CIW recommends considering the following factors:

A. hardware requirements: This factor refers to the specific hardware specifications and resources that the DBMS requires to run efficiently. It includes considerations such as processing power, memory, storage capacity, and network requirements. Considering hardware requirements is important to ensure that the chosen DBMS can be effectively deployed on the available infrastructure.

B. data compression support: This factor relates to the ability of the DBMS to compress data, which can help in reducing storage space and improving overall performance. Data compression can be especially beneficial when dealing with large datasets or limited storage resources. Considering data compression support is crucial for optimizing storage efficiency and minimizing costs.

C. encryption support: This factor pertains to the DBMS's capability to encrypt data, ensuring its confidentiality and integrity. Encryption is essential for protecting sensitive information from unauthorized access or tampering. Considering encryption support is vital for ensuring data security and compliance with privacy regulations.

D. All of the above: This option is the correct answer as CIW recommends considering all of the factors mentioned above when selecting a DBMS based on physical capabilities. Considering all these factors ensures that the chosen DBMS aligns with the organization's hardware capabilities, storage efficiency requirements, and data security needs.

Therefore, the correct answer is: D. All of the above.

Multiple choice database
  1. Pure Java

  2. JDBC-ODBC Bridge

  3. Native-API

  4. JDBC-net

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The JDBC-ODBC Bridge driver (Type 1) allows Java programs to communicate with ODBC drivers. It acts as a bridge between JDBC and ODBC, translating JDBC calls into ODBC calls. Pure Java drivers are Type 4, Native-API are Type 2, and JDBC-net are Type 3 - none of these directly interface with ODBC.

Multiple choice database
  1. Class.callName("sun.jdbc.odbc.JdbcOdbcDriver");

  2. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

  3. Class.callfunc("JdbcOdbcDriver");

  4. Class.Name.init("sun.jdbc.odbc.JdbcOdbcDriver");

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To use the JDBC-ODBC Bridge driver in a program, you would use the following code:

The Answer is: B

Explanation:

The correct code to use when you want to make use of the JDBC-ODBC Bridge driver is:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Option A is incorrect because there is no method callName() that can be used to call the driver.

Option C is incorrect because there is no method callfunc() that can be used to call the driver.

Option D is incorrect because there is no method init() available in the Class.Name package.

Multiple choice database
  1. User issues request -> DBMS retrieves relevant mappings and executes the request DBMS intercepts the request DBMS presents the request to the user.

  2. User issues request -> DBMS intercepts the request DBMS retrieves relevant mappings and executes the request DBMS presents the request to the user.

  3. User issues request -> DBMS retrieves relevant mappings and executes the request DBMS presents the request to the user DBMS intercepts the request.

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In a DBMS operational process, the correct sequence is typically as follows:

User issues request -> DBMS intercepts the request -> DBMS retrieves relevant mappings and executes the request -> DBMS presents the request to the user.

Let's go through each option and determine if it matches the correct sequence:

A. User issues request -> DBMS retrieves relevant mappings and executes the request -> DBMS intercepts the request -> DBMS presents the request to the user.

This option does not match the correct sequence. The DBMS intercepts the request before retrieving relevant mappings and executing the request.

B. User issues request -> DBMS intercepts the request -> DBMS retrieves relevant mappings and executes the request -> DBMS presents the request to the user.

This option matches the correct sequence. The DBMS intercepts the request first, followed by retrieving relevant mappings, executing the request, and presenting the request to the user.

C. User issues request -> DBMS retrieves relevant mappings and executes the request -> DBMS presents the request to the user -> DBMS intercepts the request.

This option does not match the correct sequence. The DBMS intercepts the request after retrieving relevant mappings and executing the request.

Therefore, the correct answer is:

B. User issues request -> DBMS intercepts the request -> DBMS retrieves relevant mappings and executes the request -> DBMS presents the request to the user.

None of the above options match the correct sequence.

Multiple choice database
  1. repetition of data

  2. separation of data

  3. incompatibility of files

  4. data dependence

  5. All of the above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

To answer this question, the user needs to know the basics of file-based databases and their disadvantages.

File-based databases are systems that store data in individual files. Each file contains a unique set of data, and related files are linked together to create a database. Although file-based databases were once popular, they have several disadvantages that make them less desirable than modern database management systems (DBMSs).

Now, let's go through each option and explain why it is right or wrong:

A. Repetition of data: This option is correct. In file-based databases, each file contains its unique data, which means that the same data can appear in multiple files. This redundancy can lead to inconsistencies and data synchronization issues, which can be difficult to resolve.

B. Separation of data: This option is correct. Since file-based databases store data in individual files, related data can be spread over multiple files. This separation of data makes it challenging to retrieve data from multiple sources and can lead to issues with data integrity.

C. Incompatibility of files: This option is correct. Different file-based databases may use different file formats, making it difficult to share data between systems. This incompatibility can lead to issues with data migration and system interoperability.

D. Data dependence: This option is correct. The data in file-based databases are typically tightly coupled with the applications that use them. This dependence can make it challenging to modify or update the database without affecting the application, leading to issues with maintainability and scalability.

E. All of the above: This option is correct. All of the above options describe the disadvantages of file-based databases.

Therefore, the correct answer is: E. All of the above.

Multiple choice database
  1. A read lock prevents other transactions from reading the locked data

  2. A write lock prevents other transactions from reading or writing to the locked data

  3. Multiple transactions can have write locks on the same data item.

  4. Multiple transactions can have read locks on the same data item.

  5. Either B&D

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

In RDBMS locking, write locks (exclusive locks) prevent other transactions from both reading and writing the same data, ensuring data integrity during modifications. Read locks (shared locks) allow multiple transactions to concurrently read the same data since reading doesn't change it. Option A is wrong because read locks are shared. Option C is wrong because write locks are exclusive - only one transaction can hold a write lock.

Multiple choice database
  1. a thread

  2. an opened connection

  3. a closed connection

  4. a pipe

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In JDBC, a Connection object represents a single session with a specific database. An opened connection is required to execute SQL statements and transactions. A thread is a Java execution thread, not a database session concept. A closed connection cannot execute operations. A pipe is not a JDBC concept.

Multiple choice database
  1. Process Manager

  2. Cache Manager

  3. Transaction Manager

  4. Lock Manager

  5. C&D

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Concurrency control in DBMS involves both the Transaction Manager (coordinates transactions, ensures ACID properties) and Lock Manager (manages lock acquisition/release for concurrent access). The Process Manager handles process scheduling, and Cache Manager handles buffer management - neither directly handles concurrency control.

Multiple choice database
  1. two phase commit

  2. prefetch transaction

  3. one phase commit

  4. backup and restore

  5. All of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A two-phase commit (2PC) is a distributed algorithm that ensures all participating nodes in a database transaction either commit or roll back. This atomicity allows the system to return to a consistent pre-transaction state if an error occurs during any part of the process.

Multiple choice database
  1. PreparedStatement

  2. CallableStatement

  3. Statement

  4. SQLStatement

  5. AB&C

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

The Connection object in JDBC can create Statement (simple SQL), PreparedStatement (parameterized SQL for reuse), and CallableStatement (for stored procedures). SQLStatement is not a standard JDBC interface. The methods are createStatement(), prepareStatement(), and prepareCall() respectively.

Multiple choice html
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To solve this question, the user needs to have knowledge of data structures and their characteristics.

The given statement is:

"You can combine structures e.g, linear and hierarchical."

Now, let's analyze each option to determine if it is right or wrong:

A. True: This option is correct. It is possible to combine different data structures, such as linear and hierarchical structures, to create more complex and efficient data organization systems. For example, a tree data structure can be used to represent a hierarchical relationship within a linear structure like an array or a linked list.

B. False: This option is incorrect. The statement clearly states that you can combine different data structures, so the option "False" is not the correct answer.

The Answer is: A

Multiple choice iis-server
  1. Trap exceptions instead of using them to direct program flow.

  2. Disable session state, unless you actively plan to use it.

  3. Use storied procedures instead of ad hoc queries when accessing back-end SQL data.

  4. Never leave caching turned on.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

NEVER leaving caching enabled is obviously detrimental to performance - caching is a key optimization. The distractors have typos but identify bad practices: using exceptions for control flow (trap exceptions) is inefficient; disabling unused session state is ACTUALLY good practice; and 'storied procedures' is a garbled 'stored procedures' which ARE better than ad-hoc queries. The claimed answer D is correct as the 'NOT good' option.

Multiple choice mcse
  1. Restart the DHCP Server service

  2. Use the DHCP console to reconcile the scope

  3. Restore the latest system state backup to the server

  4. From each client, renew the DHCP lease

  5. Use the DHCP console to refresh the statistics for the scope

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When a DHCP database is restored, it may not immediately reflect the current state of active leases in the registry. Reconciling the scope compares the DHCP database with the information stored in the registry and fixes inconsistencies, allowing the Active Leases to display correctly.

Multiple choice php
  1. mysql_open("localhost");

  2. connect_mysql("localhost");

  3. dbopen("localhost");

  4. mysql_connect("localhost");

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

mysql_connect() was the standard function to connect to MySQL databases in PHP 4 and early PHP 5 (before PDO or mysqli were introduced). Options A, B, and C use non-existent function names. Note that mysql_* functions are deprecated in PHP 5.5+ and removed in PHP 7.0.