DBMS MCQ Questions for Placement. Study important DBMS multiple choice questions with answers for job placement tests. Includes SQL, Normalisation, ACID properties, and other key topics.
DBMS MCQ Questions for Placement – Mock Online Test
Question 1: What is the primary purpose of a Database Management System (DBMS)?
Show Explanation
Correct Answer: A. To store and retrieve data in an organized way. A DBMS is designed to efficiently store, retrieve, and manage data within a database.
Question 2: Which of the following is NOT an advantage of using a DBMS?
Show Explanation
Correct Answer: A. Data redundancy. DBMS helps to reduce data redundancy, not increase it. Redundancy can lead to inconsistencies and inefficiencies.
Question 3: Which type of DBMS is specifically designed to handle large volumes of unstructured data, like social media posts and sensor data?
Show Explanation
Correct Answer: B. NoSQL DBMS. NoSQL databases are better suited for handling unstructured data due to their flexible schema design.
Question 4: What does data abstraction in a DBMS allow us to do?
Show Explanation
Correct Answer: A. Hide complex storage details from users. Data abstraction simplifies interaction with the database by hiding the physical storage details.
Question 5: Who is responsible for managing the overall database system, including security and access control?
Show Explanation
Correct Answer: B. Database administrator. The database administrator (DBA) has the highest level of authority in managing the database system.
Question 6: Which data model organizes data in a tree-like structure with parent-child relationships?
Show Explanation
Correct Answer: B. Hierarchical. Hierarchical models represent data as a hierarchy with a single root and branches of child nodes.
Question 7: Which component of a DBMS is responsible for executing queries written in a language like SQL?
Show Explanation
Correct Answer: B. Query processor. The query processor analyzes and executes queries to retrieve data from the database.
Question 8: What is the highest level of data abstraction in a DBMS?
Show Explanation
Correct Answer: C. View level. The view level presents a customized view of the data to specific users, hiding unnecessary details.
Question 9: Which component of a DBMS is responsible for ensuring data integrity and consistency during concurrent transactions?
Show Explanation
Correct Answer: C. Transaction manager. The transaction manager ensures that transactions are executed reliably and maintain database consistency.
Question 10: What is a schema in the context of a database?
Show Explanation
Correct Answer: B. A description of the database structure. A schema defines the tables, attributes, and relationships within a database.
Question 11: What is a tuple in a relational database?
Show Explanation
Correct Answer: B. A row in a table. A tuple represents a single record or entry in a table.
Question 12: What is the purpose of a primary key in a relational database?
Show Explanation
Correct Answer: A. To uniquely identify each tuple in a table. The primary key ensures that each row in a table can be uniquely identified.
Question 13: Which relational algebra operation selects tuples that satisfy a specific condition?
Show Explanation
Correct Answer: B. Selection. The selection operation filters rows based on a given condition.
Question 14: What is a foreign key in a relational database?
Show Explanation
Correct Answer: C. An attribute that references the primary key of another table. A foreign key establishes a link between tables by referencing the primary key of another table.
Question 15: Which relational algebra operation combines columns from two or more tables based on a common attribute?
Show Explanation
Correct Answer: C. Join. The join operation combines data from related tables.
Question 16: What is a candidate key?
Show Explanation
Correct Answer: A. A minimal set of attributes that can uniquely identify a tuple. A candidate key is a potential primary key, and a table can have multiple candidate keys.
Question 17: What is the purpose of the projection operation in relational algebra?
Show Explanation
Correct Answer: B. To select specific columns from a table. Projection retrieves only the specified attributes from a relation.
Question 18: What is a domain in the context of relational databases?
Show Explanation
Correct Answer: A. A set of possible values for an attribute. A domain defines the valid data type and range of values for an attribute.
Question 19: Which SQL statement is used to create a new table in a database?
Show Explanation
Correct Answer: A. CREATE TABLE. CREATE TABLE
defines the structure of a new table, including its columns and data types.
Question 20: Which SQL statement is used to add a new column to an existing table?
Show Explanation
Correct Answer: B. ALTER TABLE. ALTER TABLE
allows modifications to an existing table’s structure, such as adding or deleting columns.
Question 21: Which SQL statement is used to delete an entire table from a database?
Show Explanation
Correct Answer: C. DROP TABLE. DROP TABLE
permanently removes the table and all its data.
Question 22: Which SQL clause is used to filter data in a SELECT query?
Show Explanation
Correct Answer: A. WHERE. The WHERE
clause specifies conditions that rows must meet to be included in the result.
Question 23: Which SQL statement is used to add new data into a table?
Show Explanation
Correct Answer: A. INSERT INTO. INSERT INTO
inserts new rows into a table.
Question 24: Which SQL statement is used to modify existing data in a table?
Show Explanation
Correct Answer: B. UPDATE. UPDATE
changes the values of existing rows in a table.
Question 25: Which SQL statement is used to delete specific rows from a table?
Show Explanation
Correct Answer: A. DELETE. DELETE
removes rows that match a specified condition.
Question 26: Which SQL keyword is used to retrieve all columns from a table?
Show Explanation
Correct Answer: A. SELECT *. SELECT *
retrieves all columns from the specified table.
Question 27: Which SQL statement is used to grant privileges to a user?
Show Explanation
Correct Answer: A. GRANT. GRANT
gives specific permissions to a user or role.
Question 28: Which SQL statement is used to remove privileges from a user?
Show Explanation
Correct Answer: B. REVOKE. REVOKE
takes away previously granted permissions.
Question 29: Which SQL constraint ensures that all values in a column are unique?
Show Explanation
Correct Answer: C. UNIQUE. The UNIQUE
constraint prevents duplicate values in a column.
Question 30: Which SQL constraint prevents null values from being inserted into a column?
Show Explanation
Correct Answer: D. NOT NULL. NOT NULL
enforces that a column must have a value.
Question 31: Which SQL clause is used to combine the results of two SELECT queries, removing duplicate rows?
Show Explanation
Correct Answer: A. UNION. UNION
combines the result sets of two or more SELECT
queries and removes any duplicate rows.
Question 32: Which SQL clause is used to combine the results of two SELECT queries, returning only the rows that appear in both result sets?
Show Explanation
Correct Answer: B. INTERSECT. INTERSECT
finds the common rows present in both SELECT
queries.
Question 33: Which SQL clause is used to combine the results of two SELECT queries, returning only the rows that appear in the first result set but not in the second?
Show Explanation
Correct Answer: C. EXCEPT. EXCEPT
(or MINUS
in some databases) returns rows that are unique to the first query.
Question 34: Which SQL clause is used to group rows with the same value in one or more columns?
Show Explanation
Correct Answer: C. GROUP BY. GROUP BY
groups rows based on shared values in specified columns, often used with aggregate functions.
Question 35: Which SQL clause is used to filter groups based on aggregate values?
Show Explanation
Correct Answer: D. HAVING. HAVING
filters groups that result from a GROUP BY
clause based on conditions involving aggregate functions.
Question 36: What does an entity represent in an ER model?
Show Explanation
Correct Answer: D. A real-world object or concept. Entities are the “things” about which we want to store data, like people, places, or objects.
Question 37: What is an attribute in an ER model?
Show Explanation
Correct Answer: A. A characteristic or property of an entity. Attributes describe the properties of an entity, such as name, age, or address.
Question 38: What does a relationship represent in an ER model?
Show Explanation
Correct Answer: B. A connection or association between two or more entities. Relationships define how entities are related to each other, such as “student enrolls in course.”
Question 39: What does cardinality indicate in an ER model?
Show Explanation
Correct Answer: C. The minimum and maximum number of instances of one entity that can be associated with instances of another entity. Cardinality specifies how many instances of each entity participate in a relationship (e.g., one-to-many).
Question 40: What is participation constraint in an ER model?
Show Explanation
Correct Answer: B. Whether the existence of an entity depends on its relationship with another entity. Participation constraints determine if an entity must participate in a relationship (total participation) or not (partial participation).
Question 41: What is the purpose of an ER diagram?
Show Explanation
Correct Answer: A. To visually represent the entities, attributes, and relationships of a database. ER diagrams provide a graphical representation of the database design.
Question 42: How are relationships represented in a relational database?
Show Explanation
Correct Answer: C. As foreign keys. Relationships are implemented using foreign keys that link tables together.
Question 43: What are functional dependencies in a relational database?
Show Explanation
Correct Answer: C. Relationships between attributes where the value of one attribute determines the value of another attribute. Functional dependencies define how one attribute determines the value of another within a table.
Question 44: What is the goal of normalization?
Show Explanation
Correct Answer: B. To reduce data redundancy and improve data integrity. Normalization minimizes redundancy and ensures data consistency.
Question 45: Which normal form eliminates repeating groups of data within a table?
Show Explanation
Correct Answer: A. 1NF. First Normal Form (1NF) requires that all attributes contain atomic values (no repeating groups).
Question 46: Which normal form eliminates redundant data that is dependent on only part of the primary key?
Show Explanation
Correct Answer: B. 2NF. Second Normal Form (2NF) addresses redundancy issues in tables with composite primary keys.
Question 47: Which normal form eliminates transitive dependencies, where a non-key attribute is dependent on another non-key attribute?
Show Explanation
Correct Answer: C. 3NF. Third Normal Form (3NF) removes transitive dependencies to further reduce redundancy.
Question 48: What is the Boyce-Codd Normal Form (BCNF)?
Show Explanation
Correct Answer: B. A higher normal form than 3NF that addresses certain redundancy issues not covered by 3NF. BCNF is a stricter form of 3NF that deals with specific redundancy cases.
Question 49: What is decomposition in the context of normalization?
Show Explanation
Correct Answer: B. Breaking down a table into smaller tables to reduce redundancy. Decomposition splits a table into multiple tables to adhere to normal forms.
Question 50: What is the lossless join property in database normalization?
Show Explanation
Correct Answer: A. A property that ensures that data is not lost when tables are joined back together after decomposition. Lossless join guarantees that joining the decomposed tables will reconstruct the original table without data loss.
Question 51: What is the primary purpose of an index in a database?
Show Explanation
Correct Answer: B. To speed up data retrieval. Indexes are like lookups that allow the database to find data more quickly.
Question 52: Which type of index is based on a tree-like structure and is commonly used for range queries?
Show Explanation
Correct Answer: A. B-tree index. B-tree indexes are efficient for searching ranges of values and are widely used in relational databases.
Question 53: Which type of index uses a hash function to map values to locations on disk?
Show Explanation
Correct Answer: B. Hash index. Hash indexes are good for equality searches but not ideal for range queries.
Question 54: What is a clustered index?
Show Explanation
Correct Answer: A. An index that stores the actual data rows in the leaf nodes of the index. A clustered index determines the physical order of data rows on disk, and there can be only one clustered index per table.
Question 55: What is a disadvantage of using indexes?
Show Explanation
Correct Answer: B. They can increase storage space requirements. Indexes require additional storage space and can slow down data modification operations (insert, update, delete).
Question 56: What is a query execution plan?
Show Explanation
Correct Answer: B. A step-by-step plan that the database uses to execute a query. The query execution plan outlines how the database will access and process the data to answer the query.
Question 57: What is the goal of query optimization?
Show Explanation
Correct Answer: B. To find the most efficient way to execute a query. Query optimization aims to minimize the time and resources needed to retrieve the requested data.
Question 58: How can indexes improve query performance?
Show Explanation
Correct Answer: A. By reducing the amount of data that needs to be scanned. Indexes help the database quickly locate relevant data, avoiding full table scans.
Question 59: What is cost-based optimization?
Show Explanation
Correct Answer: B. A query optimization technique that estimates the cost of different execution plans and chooses the least expensive one. Cost-based optimization analyzes various execution strategies and selects the one with the lowest estimated cost.
Question 60: Which of the following factors can influence the cost of a query execution plan?
Show Explanation
Correct Answer: D. All of the above. All these factors, and more, contribute to the overall cost of executing a query.
Question 61: What does the “A” in ACID properties stand for?
Show Explanation
Correct Answer: A. Atomicity. Atomicity ensures that a transaction is treated as a single, indivisible unit of work.
Question 62: What does the “C” in ACID properties stand for?
Show Explanation
Correct Answer: B. Consistency. Consistency guarantees that a transaction brings the database from one valid state to another.
Question 63: What does the “I” in ACID properties stand for?
Show Explanation
Correct Answer: B. Isolation. Isolation ensures that concurrent transactions do not interfere with each other.
Question 64: What does the “D” in ACID properties stand for?
Show Explanation
Correct Answer: A. Durability. Durability ensures that once a transaction is committed, its changes are permanent, even in case of system failures.
Question 65: Why are ACID properties important in database systems?
Show Explanation
Correct Answer: B. To ensure data reliability and consistency. ACID properties are crucial for maintaining data integrity and consistency, especially in concurrent environments.
Question 66: What is a transaction in a database?
Show Explanation
Correct Answer: B. A logical unit of work that consists of one or more database operations. A transaction is a sequence of operations that are executed as a single unit.
Question 67: What are the possible states of a transaction?
Show Explanation
Correct Answer: A. Active, committed, aborted. A transaction can be active (in progress), committed (successfully completed), or aborted (rolled back due to an error).
Question 68: What is concurrency control in a database?
Show Explanation
Correct Answer: A. Managing multiple users accessing the database simultaneously. Concurrency control mechanisms ensure that simultaneous transactions do not interfere with each other and maintain data consistency.
Question 69: What is a deadlock in a database?
Show Explanation
Correct Answer: A. A situation where two or more transactions are blocked indefinitely, waiting for each other to release resources. Deadlocks occur when transactions are stuck in a circular wait for resources.
Question 70: Which concurrency control technique uses locks to prevent conflicts between transactions?
Show Explanation
Correct Answer: A. Locking. Locking mechanisms (shared locks, exclusive locks) control access to data items to prevent conflicts.
Question 71: What is the purpose of log-based recovery in a database?
Show Explanation
Correct Answer: B. To restore the database to a consistent state after a failure. Log-based recovery uses a transaction log to undo or redo operations and recover from crashes.
Question 72: What is a transaction log in a database?
Show Explanation
Correct Answer: A. A record of all database operations. The transaction log keeps track of all changes made to the database.
Question 73: What is checkpointing in a database?
Show Explanation
Correct Answer: C. A technique to reduce the amount of data that needs to be processed during recovery. Checkpointing periodically writes modified data blocks to disk, reducing the work needed for recovery.
Question 74: Which of the following is a recovery technique used in databases?
Show Explanation
Correct Answer: A. Write-ahead logging (WAL). WAL ensures that changes are written to the log before they are applied to the database.
Question 75: What is the purpose of the REDO operation in database recovery?
Show Explanation
Correct Answer: B. To redo the changes made by a committed transaction that were not written to disk before a failure. REDO reapplies changes from the log to ensure that committed transactions are reflected in the database after recovery.
Question 76: Which of the following is NOT a type of NoSQL database?
Show Explanation
Correct Answer: D. Relational database. Relational databases are a traditional type of database, not a NoSQL database.
Question 77: Which type of NoSQL database stores data in key-value pairs, similar to a dictionary?
Show Explanation
Correct Answer: A. Key-value store. Key-value stores are simple and efficient for storing and retrieving data using a unique key.
Question 78: Which type of NoSQL database stores data in flexible, semi-structured documents, often in JSON or XML format?
Show Explanation
Correct Answer: B. Document database. Document databases are suitable for storing data with varying structures, like product catalogs or user profiles.
Question 79: Which type of NoSQL database is best suited for representing relationships between entities, such as social networks or knowledge graphs?
Show Explanation
Correct Answer: C. Graph database. Graph databases excel at storing and querying relationships between data points.
Question 80: What does the CAP theorem state in the context of distributed databases?
Show Explanation
Correct Answer: A. A distributed database can only guarantee two out of three properties: Consistency, Availability, and Partition tolerance. The CAP theorem highlights the trade-offs between consistency, availability, and partition tolerance in distributed systems.
Question 81: What is data replication in a distributed database?
Show Explanation
Correct Answer: A. Storing the same data on multiple servers. Data replication creates copies of data across multiple nodes for redundancy and fault tolerance.
Question 82: What is data partitioning in a distributed database?
Show Explanation
Correct Answer: B. Dividing data into smaller chunks and storing them on different servers. Data partitioning (sharding) distributes data across multiple servers to improve scalability and performance.
Question 83: What is the purpose of distributed transaction management?
Show Explanation
Correct Answer: A. To ensure that transactions involving data on multiple servers are executed consistently. Distributed transaction management coordinates transactions across multiple nodes to maintain data integrity.
Question 84: Which of the following is a challenge in distributed databases?
Show Explanation
Correct Answer: D. All of the above. Distributed databases introduce complexities in maintaining consistency, handling failures, and ensuring availability.
Question 85: What is a distributed database system?
Show Explanation
Correct Answer: B. A database that is spread across multiple servers. Distributed databases store data across multiple interconnected nodes.
Question 86: What is a data warehouse?
Show Explanation
Correct Answer: B. A large, centralized repository of historical data from various sources. Data warehouses store integrated data from operational systems for analysis and decision-making.
Question 87: What is OLAP (Online Analytical Processing)?
Show Explanation
Correct Answer: A. A technique for querying and analyzing data in data warehouses. OLAP enables multi-dimensional analysis of data to identify trends and patterns.
Question 88: What is data mining?
Show Explanation
Correct Answer: A. The process of extracting knowledge and patterns from large datasets. Data mining uses algorithms to discover hidden insights and relationships in data.
Question 89: Which of the following is a data mining technique?
Show Explanation
Correct Answer: D. All of the above. These are all common data mining techniques used for various purposes like grouping similar data points, predicting categories, and finding relationships between variables.
Question 90: What is the purpose of data warehousing and data mining?
Show Explanation
Correct Answer: A. To support decision-making and gain insights from data. Data warehousing and data mining help organizations extract valuable information from their data to make informed decisions.
Question 91: What is the difference between DELETE and TRUNCATE statements in SQL?
Show Explanation
Correct Answer: D. All of the above. All the options highlight the key differences between DELETE and TRUNCATE.
Question 92: What is the difference between a primary key and a unique key?
Show Explanation
Correct Answer: C. Both A and B. Both A and B accurately describe the differences between primary and unique keys.
Question 93: What is a view in a database?
Show Explanation
Correct Answer: A. A virtual table based on the result-set of an SQL statement. A view is a logical representation of data derived from one or more base tables.
Question 94: What is denormalization?
Show Explanation
Correct Answer: B. The process of intentionally introducing redundancy into a database to improve performance. Denormalization is sometimes used to optimize read operations by adding redundant data.
Question 95: What is a stored procedure?
Show Explanation
Correct Answer: A. A pre-compiled SQL code that can be reused. Stored procedures are pre-written SQL code blocks that can be executed with a single call.
Question 96: What are the advantages of using stored procedures?
Show Explanation
Correct Answer: D. All of the above. Stored procedures offer benefits in terms of performance, security, and reduced network load.
Question 97: What is a trigger in a database?
Show Explanation
Correct Answer: A. A stored procedure that automatically executes in response to certain events. Triggers are special stored procedures that are invoked when specific actions (insert, update, delete) occur on a table.
Question 98: What are the different types of joins in SQL?
Show Explanation
Correct Answer: A. INNER JOIN, OUTER JOIN (LEFT, RIGHT, FULL), SELF JOIN. These are the main types of joins used to combine data from multiple tables.
Question 99: What is the difference between INNER JOIN and LEFT JOIN?
Show Explanation
Correct Answer: A. INNER JOIN returns only the matching rows from both tables, while LEFT JOIN returns all rows from the left table and matching rows from the right table. This accurately describes the difference between INNER JOIN and LEFT JOIN.
Question 100: What is the difference between WHERE and HAVING clause in SQL?
Show Explanation
Correct Answer: A. WHERE clause is used to filter rows before grouping, while HAVING clause is used to filter groups after grouping. This correctly explains the distinction between the WHERE and HAVING clauses.