dbms banner

DBMS Multiple Choice Questions (MCQs) and Answers

Master Database Management Systems (DBMS) with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of DBMS. Begin your placement preparation journey now!

Q61

Q61 What mechanism is commonly used to ensure the durability of transactions in database systems?

A

Log-based recovery

B

Two-phase locking

C

Timestamp ordering

D

Savepoints

Q62

Q62 Which SQL statement is used to start a transaction in most RDBMS?

A

BEGIN TRANSACTION

B

START

C

BEGIN

D

INITIATE TRANSACTION

Q63

Q63 In SQL, how can you force a transaction to roll back?

A

ROLLBACK TRANSACTION

B

UNDO TRANSACTION

C

RESET TRANSACTION

D

CANCEL TRANSACTION

Q64

Q64 How can the isolation level of a transaction be set in SQL Server to prevent dirty reads?

A

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

B

SET TRANSACTION ISOLATION LEVEL READ COMMITTED

C

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ

D

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

Q65

Q65 Which SQL command is used to save a point within a transaction that can be rolled back to, without affecting the preceding statements of the transaction?

A

SAVEPOINT

B

CHECKPOINT

C

COMMIT TO POINT

D

ROLLBACK TO SAVEPOINT

Q66

Q66 A transaction fails to commit and is rolled back.
What is a common reason for this behavior?

A

The transaction was manually rolled back by the user

B

A deadlock was detected

C

A data validation rule was violated

D

The database system crashed

Q67

Q67 When attempting to execute multiple transactions concurrently, you notice that some transactions are waiting indefinitely. What is the likely cause?

A

Network latency

B

Deadlocks

C

Inefficient query execution

D

Insufficient database indexing

Q68

Q68 After changing the isolation level of transactions, a significant decrease in performance is observed.
What could be the reason?

A

Increased lock contention due to a higher isolation level

B

Decreased cache utilization

C

Hardware malfunctions

D

Network issues

Q69

Q69 A transaction is experiencing repeated failures due to lock timeouts.
What strategy can help resolve this issue?

A

Decreasing the isolation level of the transaction

B

Increasing the lock timeout value

C

Splitting the transaction into smaller transactions

D

All of the above

Q70

Q70 Which concurrency control technique involves locking resources to prevent concurrent transactions from accessing them simultaneously?

A

Timestamp ordering

B

Lock-based protocols

C

Validation-based protocols

D

Snapshot isolation

Q71

Q71 In the context of concurrency control, what does the term "deadlock" refer to?

A

A lock that cannot be released

B

A transaction that cannot be rolled back

C

A situation where transactions wait indefinitely for each other

D

A failed concurrency control mechanism

Q72

Q72 What is the primary goal of the two-phase locking (2PL) protocol?

A

To ensure all transactions are executed in parallel

B

To allow transactions to access any data at any time

C

To prevent deadlocks

D

To ensure serializability of transactions

Q73

Q73 Which of the following scenarios is a potential drawback of using optimistic concurrency control?

A

Transactions are serialized automatically

B

Deadlocks are more frequent

C

Increased overhead due to rollback of transactions

D

Reduced throughput due to excessive locking

Q74

Q74 The isolation level that allows dirty reads, non-repeatable reads, and phantom reads is:

A

Read Uncommitted

B

Read Committed

C

Repeatable Read

D

Serializable

Q75

Q75 In database systems, the phenomenon where a transaction re-reads data it has previously read and finds that another transaction has modified it is called:

A

Dirty read

B

Non-repeatable read

C

Phantom read

D

Serialization anomaly

Q76

Q76 To set the transaction isolation level to Serializable in SQL Server, which command should be used?

A

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

B

SET ISOLATION LEVEL SERIALIZABLE

C

TRANSACTION SET ISOLATION LEVEL SERIALIZABLE

D

SET TRANSACTION LEVEL AS SERIALIZABLE

Q77

Q77 In PostgreSQL, how can you acquire an exclusive lock on a table to prevent other transactions from reading or writing to it?

A

LOCK TABLE table_name IN EXCLUSIVE MODE

B

EXCLUSIVE LOCK ON table_name

C

SET LOCK table_name EXCLUSIVE

D

LOCK table_name EXCLUSIVE

Q78

Q78 Which command is used in MySQL to start a transaction with a consistent snapshot, providing repeatable reads for the duration of the transaction?

A

START TRANSACTION WITH CONSISTENT SNAPSHOT

B

BEGIN WORK WITH CONSISTENT SNAPSHOT

C

CREATE TRANSACTION WITH SNAPSHOT

D

BEGIN TRANSACTION CONSISTENT SNAPSHOT

Q79

Q79 How do you enable automatic detection and resolution of update conflicts in Oracle when using optimistic concurrency control?

A

ENABLE AUTOMATIC CONFLICT RESOLUTION

B

SET TRANSACTION RESOLVE CONFLICTS AUTOMATICALLY

C

DBMS_LOCK.RESOLVE

D

DBMS_CONFLICT.RESOLVE_AUTOMATICALLY

Q80

Q80 A transaction frequently fails due to lock timeouts.
What is a simple strategy to reduce the likelihood of this happening?

A

Decrease the transaction isolation level

B

Increase the lock timeout duration

C

Split the transaction into smaller parts

D

All of the above

Q81

Q81 After implementing row-level locking, the system experiences deadlocks.
Which approach can help minimize this issue?

A

Using table-level locks instead

B

Applying a consistent locking order

C

Reducing the transaction isolation level

D

Implementing lock escalation

Q82

Q82 You notice that a particular query within a transaction is causing lock contention.
What is a first step in addressing this issue?

A

Re-writing the query to access fewer rows

B

Increasing the database's hardware resources

C

Switching to table-level locks

D

Disabling locks for the transaction

Q83

Q83 What is the primary purpose of indexing in a database?

A

To increase transaction speeds

B

To decrease database storage requirements

C

To speed up the retrieval of records based on attribute values

D

To secure the database

Q84

Q84 Which type of database index is optimized for equality searches?

A

Clustered index

B

Non-clustered index

C

Full-text index

D

Bitmap index

Q85

Q85 What is a full-text search primarily used for?

A

Searching for numeric data

B

Searching for exact matches in textual data columns

C

Performing complex searches within textual data columns

D

Indexing foreign keys

Q86

Q86 In a relational database, what does a composite index refer to?

A

An index that combines multiple tables

B

An index built on a single column

C

An index that includes multiple columns from a single table

D

An index used exclusively for joins

Q87

Q87 Which of the following best describes the difference between a clustered and a non-clustered index?

A

A clustered index speeds up data insertion, whereas a non-clustered index speeds up data deletion

B

A clustered index affects the physical order of rows, whereas a non-clustered index does not

C

A clustered index can only be created on primary keys, whereas a non-clustered index can be created on any column

D

A clustered index is automatically created when a table is created, whereas a non-clustered index must be created manually

Q88

Q88 What is a B-tree index suitable for?

A

Only equality searches

B

Only range searches

C

Both equality and range searches

D

Neither equality nor range searches

Q89

Q89 How can you create a non-clustered index on the "email" column of the "Users" table in SQL?

A

CREATE NONCLUSTERED INDEX idx_email ON Users(email)

B

CREATE INDEX idx_email ON Users(email) NONCLUSTERED

C

INDEX CREATE ON Users(email) NONCLUSTERED

D

CREATE INDEX idx_email ON Users USING NONCLUSTERED(email)

Q90

Q90 Which SQL statement is used to create a full-text index in MySQL?

A

CREATE FULLTEXT INDEX ft_index ON Articles(content)

B

FULLTEXT INDEX CREATE ON Articles(content)

C

INDEX FULLTEXT CREATE Articles(content)

D

CREATE INDEX FULLTEXT ON Articles(content)

ad verticalad vertical
ad