Computer Knowledge

Database Management Systems

5,344 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 CachedRowSet class

  2. A JavaSource class

  3. A WebRowSet class

  4. A JDBCRowSet class

  5. Either AC&D

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

In the Java JDBC API, CachedRowSet, WebRowSet, and JDBCRowSet are all valid implementations of the RowSet interface. Since options A, C, and D are valid rowset classes, the choice 'Either AC&D' (likely a typo for A, C, and D) is the intended answer.

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

  2. Consistency

  3. Isolation

  4. Durability

  5. All of the above

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

ACID is an acronym representing the four key properties of a reliable database transaction: Atomicity (all or nothing), Consistency (valid state transitions), Isolation (independent execution), and Durability (permanent storage). Since all listed options are parts of ACID, 'All of the above' is correct.

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

  2. syscolumns

  3. syscomments

  4. sysviews

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

In SQL Server, the syscomments system table stores the actual text of views, stored procedures, triggers, and rules. The sysobjects table contains the names and types of objects, but not their underlying source code.

Multiple choice sql
  1. The public role captures all default permissions for users in a database.

  2. The public role cannot be dropped.

  3. The public role is contained in every database, including msdb, tempdb, model, and all user databases except in the master database for security purposes.

  4. The public role cannot have users, groups, or roles assigned to it.

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

The public role exists in EVERY database, INCLUDING master. Options A, B, and D are all true statements about the public role: it captures default permissions, cannot be dropped, and cannot have members assigned. Option C is false (and thus the correct answer) because it incorrectly claims the public role is NOT in master.