Database Management Systems # MCQs Practice set

Q.1 Which of the following is a type of database model?

Hierarchical
Relational
Network
All of the above
Explanation - Databases can be organized in different models including Hierarchical, Relational, and Network models.
Correct answer is: All of the above

Q.2 In a relational database, a table is also known as a:

Relation
Entity
Tuple
Attribute
Explanation - In relational databases, tables are called relations. Each row represents a tuple, and each column represents an attribute.
Correct answer is: Relation

Q.3 Which SQL command is used to remove a table from the database?

DELETE TABLE
DROP TABLE
REMOVE TABLE
TRUNCATE TABLE
Explanation - The DROP TABLE command deletes a table along with all its data and structure from the database.
Correct answer is: DROP TABLE

Q.4 Which key uniquely identifies a record in a table?

Foreign Key
Primary Key
Candidate Key
Composite Key
Explanation - A Primary Key uniquely identifies each record in a table. No two rows can have the same primary key value.
Correct answer is: Primary Key

Q.5 What does SQL stand for?

Structured Query Language
Simple Query Language
Sequential Query Language
System Query Language
Explanation - SQL is Structured Query Language, used to manage and manipulate relational databases.
Correct answer is: Structured Query Language

Q.6 Which SQL command is used to add new data to a table?

INSERT INTO
UPDATE
ADD DATA
CREATE
Explanation - INSERT INTO command is used to insert new records into a table.
Correct answer is: INSERT INTO

Q.7 Which constraint ensures that a column cannot have a NULL value?

PRIMARY KEY
FOREIGN KEY
NOT NULL
UNIQUE
Explanation - The NOT NULL constraint ensures that a column must always contain a value.
Correct answer is: NOT NULL

Q.8 Which command is used to modify existing records in a table?

UPDATE
MODIFY
CHANGE
ALTER
Explanation - The UPDATE statement is used to modify existing records in a table.
Correct answer is: UPDATE

Q.9 Which key is used to link two tables together?

Primary Key
Foreign Key
Candidate Key
Unique Key
Explanation - A Foreign Key in one table points to the Primary Key in another table to create a relationship.
Correct answer is: Foreign Key

Q.10 Which type of database is designed to handle large amounts of unstructured data?

Relational Database
NoSQL Database
Hierarchical Database
Network Database
Explanation - NoSQL databases are designed for unstructured or semi-structured data and can scale horizontally.
Correct answer is: NoSQL Database

Q.11 Which SQL command is used to remove all rows from a table without deleting the table?

DELETE
TRUNCATE
DROP
REMOVE
Explanation - TRUNCATE removes all rows from a table quickly but keeps the table structure intact.
Correct answer is: TRUNCATE

Q.12 A candidate key in a table is:

Always the primary key
A key that can be chosen as primary key
A foreign key
A key that allows NULLs
Explanation - Candidate keys are potential keys that can uniquely identify rows in a table. One is selected as primary key.
Correct answer is: A key that can be chosen as primary key

Q.13 Which SQL clause is used to filter records based on a condition?

WHERE
HAVING
FROM
SELECT
Explanation - The WHERE clause is used to filter records that satisfy a given condition.
Correct answer is: WHERE

Q.14 What is normalization in DBMS?

Process of storing data redundantly
Process of organizing data to reduce redundancy
A method of backup
A query optimization technique
Explanation - Normalization is the process of organizing data in a database to reduce redundancy and improve integrity.
Correct answer is: Process of organizing data to reduce redundancy

Q.15 Which normal form eliminates transitive dependency?

1NF
2NF
3NF
BCNF
Explanation - Third Normal Form (3NF) eliminates transitive dependencies, where a non-prime attribute depends on another non-prime attribute.
Correct answer is: 3NF

Q.16 Which SQL function is used to count the number of rows in a table?

SUM()
COUNT()
TOTAL()
NUMBER()
Explanation - The COUNT() function returns the number of rows in a table that satisfy a given condition.
Correct answer is: COUNT()

Q.17 Which command is used to change the structure of an existing table?

UPDATE
ALTER TABLE
MODIFY TABLE
CHANGE TABLE
Explanation - ALTER TABLE is used to add, delete, or modify columns and constraints in an existing table.
Correct answer is: ALTER TABLE

Q.18 In a relational database, a row is also called a:

Attribute
Field
Tuple
Column
Explanation - In relational databases, each row of a table is called a tuple, and each column is an attribute.
Correct answer is: Tuple

Q.19 ACID properties of a database ensure:

Data security
Data integrity and reliability
Faster queries
Ease of backup
Explanation - ACID (Atomicity, Consistency, Isolation, Durability) ensures reliable transactions and data integrity in databases.
Correct answer is: Data integrity and reliability

Q.20 Which of the following is not a type of JOIN in SQL?

INNER JOIN
OUTER JOIN
SIDE JOIN
CROSS JOIN
Explanation - INNER JOIN, OUTER JOIN, and CROSS JOIN are valid SQL joins. SIDE JOIN does not exist.
Correct answer is: SIDE JOIN

Q.21 Which command is used to retrieve data from a database?

SELECT
GET
FETCH
RETRIEVE
Explanation - SELECT is used in SQL to query and retrieve data from one or more tables.
Correct answer is: SELECT

Q.22 Which of the following is an example of a NoSQL database?

MySQL
MongoDB
Oracle
SQL Server
Explanation - MongoDB is a NoSQL database, which stores data in JSON-like documents instead of tables.
Correct answer is: MongoDB

Q.23 In a table, which of the following ensures uniqueness of values in a column but allows NULL?

PRIMARY KEY
FOREIGN KEY
UNIQUE
NOT NULL
Explanation - The UNIQUE constraint ensures that all values in a column are distinct, but allows NULLs.
Correct answer is: UNIQUE

Q.24 What is a schema in a database?

A set of queries
The physical storage of data
The structure that defines the organization of data
A database backup
Explanation - A schema defines the logical structure of the database, including tables, columns, and relationships.
Correct answer is: The structure that defines the organization of data

Q.25 Which of the following SQL clauses is used to group rows that have the same values?

WHERE
GROUP BY
ORDER BY
HAVING
Explanation - GROUP BY clause groups rows that have the same values into summary rows, often used with aggregate functions.
Correct answer is: GROUP BY