Databases MCQs set 2 for HEC USAT-CS (Computer Science) computer science — 20 solved questions.
Q1. Which data model is based on the concept of tables?
Answer: Relational
Explanation: The relational data model organizes data into tables, also known as relations, making it the correct answer.
Q2. What is normalization in databases?
Answer: Process of removing redundant data
Explanation: Normalization is the process of organizing data to minimize redundancy and dependency, making 'Process of removing redundant data' correct.
Q3. What is the purpose of a primary key in a database table?
Answer: To uniquely identify each record
Explanation: A primary key is used to uniquely identify each record in a table, ensuring data integrity and preventing duplication.
Q4. What is a foreign key in a database?
Answer: A key that references the primary key of another table
Explanation: A foreign key is a field in a table that references the primary key of another table, establishing a link between them.
Q5. What is denormalization?
Answer: The process of adding redundant data for performance
Explanation: Denormalization involves intentionally adding redundant data to improve query performance, making 'The process of adding redundant data for performance' correct.
Q6. What is a transaction in a database?
Answer: A sequence of SQL statements executed as a single unit
Explanation: A transaction is a sequence of operations performed as a single, all-or-nothing unit of work, ensuring data consistency and integrity.
Q7. Which locking mechanism is used to prevent deadlocks?
Answer: Two-phase locking
Explanation: Two-phase locking is a concurrency control mechanism that prevents deadlocks by acquiring all locks before releasing any, ensuring transaction consistency.
Q8. What is a database view?
Answer: A virtual table based on the result of a query
Explanation: A database view is a virtual table derived from the result of a SELECT statement, providing a simplified way to access complex data.
Q9. What is a stored procedure?
Answer: A precompiled SQL statement
Explanation: A stored procedure is a precompiled SQL code that performs a specific task, improving performance and reducing the risk of SQL injection.
Q10. What is a trigger in a database?
Answer: A stored procedure executed automatically in response to certain events
Explanation: A trigger is a set of actions that are automatically executed in response to certain events, such as insert, update, or delete operations.
Q11. Which database recovery technique involves restoring the database to a previous state?
Answer: Backward recovery
Explanation: Backward recovery involves restoring the database to a previous consistent state by undoing changes made by uncommitted transactions.
Q12. What is data fragmentation?
Answer: The process of dividing data into smaller fragments
Explanation: Data fragmentation refers to the division of data into smaller fragments, which can be stored in different locations, improving data distribution and access.
Q13. What is a distributed database?
Answer: Both B and C
Explanation: A distributed database is a database that is either fragmented or replicated, or both, across multiple locations, improving data availability and access.
Q14. What is data replication?
Answer: The process of creating multiple copies of data
Explanation: Data replication involves creating multiple copies of data, improving data availability and reducing the risk of data loss.
Q15. What is a data warehouse?
Answer: A database designed for analytical processing
Explanation: A data warehouse is a database designed to support business intelligence activities, such as data analysis and reporting, making 'analytical processing' the correct answer.
Q16. What is OLAP?
Answer: Online Analytical Processing
Explanation: OLAP stands for Online Analytical Processing, a technology that enables fast and efficient analysis of data, supporting business intelligence activities.
Q17. Which database concept ensures that data is not duplicated?
Answer: Data normalization
Explanation: Data normalization ensures that data is not duplicated by organizing data into tables with minimal redundancy.
Q18. What is the term for a database transaction that is partially executed?
Answer: Partially committed
Explanation: Partially committed transaction is one that has executed some but not all of its operations, and is waiting for a commit or rollback.
Q19. Which database recovery technique involves maintaining a log of all transactions?
Answer: Logging
Explanation: Logging involves maintaining a log of all transactions, which can be used to recover the database in case of a failure.
Q20. What is the term for a database that is designed for querying and analyzing large datasets?
Answer: OLAP
Explanation: OLAP (Online Analytical Processing) is a database designed for querying and analyzing large datasets, often used in business intelligence.