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!

Q31

Q31 What is the correct SQL syntax to return only distinct (different) values from the "Name" column in the "Employees" table?

A

SELECT DISTINCT Name FROM Employees

B

SELECT UNIQUE Name FROM Employees

C

SELECT DIFFERENT Name FROM Employees

D

SELECT Name FROM Employees DISTINCT

Q32

Q32 Which SQL clause is used to filter groups of rows that have been aggregated?

A

WHERE

B

HAVING

C

GROUP BY

D

ORDER BY

Q33

Q33 To update the "Salary" column in the "Employees" table by increasing all salaries by 10%, which SQL statement is correct?

A

UPDATE Employees SET Salary = Salary * 1.1

B

UPDATE Employees INCREASE Salary BY 10%

C

ALTER TABLE Employees MODIFY Salary = Salary * 1.1

D

CHANGE Employees SET Salary = Salary + (Salary * 0.1)

Q34

Q34 Given the following SQL statement:
SELECT Name FROM Employees WHERE DepartmentID IN (SELECT DepartmentID FROM Departments WHERE Budget > 100000); What does this query do?

A

Retrieves the names of all employees who work in departments with a budget greater than 100000

B

Deletes names of employees in departments with high budgets

C

Updates the names of employees in well-funded departments

D

Inserts names into Employees for departments with large budgets

Q35

Q35 What is the purpose of the SQL command EXPLAIN?

A

To document the structure of the database

B

To describe the syntax of SQL commands

C

To provide a detailed execution plan of a query

D

To correct errors in SQL queries

Q36

Q36 A developer runs a query to select all records from a table, but it returns no results despite the table not being empty.
What is the likely cause?

A

A syntax error in the SELECT statement

B

The WHERE clause is filtering out all records

C

The table is locked

D

The database connection is lost

Q37

Q37 After adding a new index to a table, a previously fast query has become significantly slower.
What is the most likely reason?

A

The index has increased the data retrieval time

B

The new index is not used by the query

C

The index has caused additional overhead for data modifications

D

The database requires reorganization

Q38

Q38 A complex query involving multiple JOIN operations is performing poorly.
What is a common method to improve its performance?

A

Reducing the number of columns in the SELECT clause

B

Using subqueries instead of JOINs

C

Optimizing the join order

D

Increasing the database server's memory

Q39

Q39 During the execution of a transaction, a deadlock occurs.
What is a typical solution to resolve this issue?

A

Increasing the transaction timeout period

B

Rolling back one of the transactions involved in the deadlock

C

Eliminating all indexes on the tables involved

D

Splitting the transaction into smaller transactions

Q40

Q40 What is the goal of normalization in database design?

A

To reduce data redundancy and ensure data integrity

B

To increase database size

C

To make database security more complex

D

To speed up query processing

Q41

Q41 Which of the following is NOT a normal form?

A

First Normal Form (1NF)

B

Zero Normal Form (0NF)

C

Second Normal Form (2NF)

D

Third Normal Form (3NF)

Q42

Q42 The process of minimizing redundancy and dependency by organizing fields and table relationships is known as:

A

Denormalization

B

Normalization

C

Indexing

D

Partitioning

Q43

Q43 Which normal form is concerned with removing partial dependency between columns of a database table?

A

1NF

B

2NF

C

3NF

D

BCNF

Q44

Q44 A relation R is in which normal form if every non-prime attribute of R is non-transitively dependent on every key of R?

A

First Normal Form (1NF)

B

Second Normal Form (2NF)

C

Third Normal Form (3NF)

D

Boyce-Codd Normal Form (BCNF)

Q45

Q45 Lossless join property ensures that:

A

The join operation increases data redundancy

B

Data can be reconstructed exactly after decomposition

C

Data is lost during normalization

D

The join operation reduces query performance

Q46

Q46 Dependency preservation in database normalization ensures that:

A

All functional dependencies are represented in one table

B

Functional dependencies are preserved across table decompositions

C

Only primary keys have dependencies

D

All tables are dependent on a single table

Q47

Q47 In the context of database normalization, what is denormalization used for?

A

Increasing the complexity of the database

B

Undoing the normalization process to improve query performance

C

Secure data storage

D

Create redundancy for backup purposes

Q48

Q48 Which SQL keyword is used to create a unique constraint on a column to enforce uniqueness?

A

UNIQUE

B

PRIMARY KEY

C

CHECK

D

FOREIGN KEY

Q49

Q49 In SQL, how can you modify an existing table to add a foreign key constraint referencing another table?

A

ALTER TABLE table_name ADD CONSTRAINT fk_name FOREIGN KEY (column1) REFERENCES other_table(column2)

B

ALTER TABLE table_name MODIFY COLUMN column_name FOREIGN KEY REFERENCES other_table(column_name)

C

ALTER TABLE table_name ADD FOREIGN KEY (column_name) REFERENCES other_table

D

USE table_name ADD FOREIGN KEY REFERENCES other_table

Q50

Q50 Which SQL statement is used to delete a constraint from a table?

A

DELETE CONSTRAINT constraint_name FROM table_name

B

REMOVE CONSTRAINT constraint_name FROM table_name

C

ALTER TABLE table_name DROP CONSTRAINT constraint_name

D

DROP CONSTRAINT constraint_name FROM table_name

Q51

Q51 What is the correct way to change the data type of a column in an existing table in SQL?

A

MODIFY TABLE table_name CHANGE column_name column_name NEW_DATA_TYPE

B

ALTER TABLE table_name ALTER COLUMN column_name SET DATA TYPE NEW_DATA_TYPE

C

ALTER TABLE table_name MODIFY COLUMN column_name NEW_DATA_TYPE

D

ALTER TABLE table_name CHANGE column_name column_name NEW_DATA_TYPE

Q52

Q52 A database table is noticed to have duplicate rows.
Which normalization form is most likely being violated?

A

First Normal Form (1NF)

B

Second Normal Form (2NF)

C

Third Normal Form (3NF)

D

Boyce-Codd Normal Form (BCNF)

Q53

Q53 A table contains a non-primary key column that depends on only part of a composite primary key.
What normalization issue does this indicate?

A

Partial dependency, indicating a violation of 2NF

B

Transitive dependency, indicating a violation of 3NF

C

Non-atomic values, indicating a violation of 1NF

D

None, this is an acceptable design

Q54

Q54 During schema refinement, a designer notices that certain attributes depend on other non-primary attributes.
Which normal form is not being adhered to?

A

First Normal Form (1NF)

B

Second Normal Form (2NF)

C

Third Normal Form (3NF)

D

Boyce-Codd Normal Form (BCNF)

Q55

Q55 Which property of a transaction ensures that all operations within the transaction are completed successfully, or none of them are?

A

Atomicity

B

Consistency

C

Isolation

D

Durability

Q56

Q56 The durability property of a transaction ensures that:

A

Changes made by a transaction are not permanent

B

Changes are visible even before the transaction is committed

C

Once a transaction commits, its changes are lost on system failure

D

Once a transaction commits, its changes are permanent, surviving system failures

Q57

Q57 Which of the following is NOT a property of transactions (ACID properties)?

A

Authenticity

B

Atomicity

C

Consistency

D

Isolation

Q58

Q58 In the context of transactions, what does the consistency property ensure?

A

The database remains in a consistent state before and after the transaction

B

The transaction only shows committed data to external users

C

Transactions are isolated from each other

D

The results of the transaction are permanently stored in the database

Q59

Q59 Isolation in database transactions ensures that:

A

Transactions are processed in a linear fashion

B

The operations of one transaction are visible to another transaction

C

Multiple transactions can be made to appear as if they are running in parallel

D

Each transaction is aware of all other transactions in the system

Q60

Q60 What is a deadlock in the context of transaction management?

A

A situation where transaction operations are waiting indefinitely for each other to release locks

B

A failed transaction that cannot be rolled back

C

A transaction that does not comply with ACID properties

D

An isolation level that has been incorrectly set

ad verticalad vertical
ad