NTS NAT-ICS (Computer Science Track) computer science Databases — Set 2

Databases MCQs set 2 for NTS NAT-ICS (Computer Science Track) computer science — 20 solved questions.

NTS NAT-ICS (Computer Science Track) computer science Databases — Set 2

  1. Question 1

    Q1. Which data model is based on the concept of tables?

    • A) Hierarchical
    • B) Network
    • C) Relational
    • D) Object-Oriented

    Answer: Relational

    Explanation: The relational data model organizes data into tables, also known as relations, making it the correct answer.

  2. Question 2

    Q2. What is normalization in databases?

    • A) Process of removing redundant data
    • B) Process of adding redundant data
    • C) Process of creating indexes
    • D) Process of creating views

    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.

  3. Question 3

    Q3. What is the purpose of a primary key in a database table?

    • A) To uniquely identify each record
    • B) To provide data security
    • C) To improve query performance
    • D) To enforce data consistency

    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.

  4. Question 4

    Q4. What is a foreign key in a database?

    • A) A key that uniquely identifies a record
    • B) A key that references the primary key of another table
    • C) A key used for data encryption
    • D) A key used for indexing

    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.

  5. Question 5

    Q5. What is denormalization?

    • A) The process of removing redundant data
    • B) The process of adding redundant data for performance
    • C) The process of creating indexes
    • D) The process of creating views

    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.

  6. Question 6

    Q6. What is a transaction in a database?

    • A) A single SQL statement
    • B) A sequence of SQL statements executed as a single unit
    • C) A database backup
    • D) A database restore

    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.

  7. Question 7

    Q7. Which locking mechanism is used to prevent deadlocks?

    • A) Two-phase locking
    • B) One-phase locking
    • C) Optimistic concurrency control
    • D) Pessimistic concurrency control

    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.

  8. Question 8

    Q8. What is a database view?

    • A) A virtual table based on the result of a query
    • B) A physical table stored in the database
    • C) A stored procedure
    • D) A trigger

    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.

  9. Question 9

    Q9. What is a stored procedure?

    • A) A precompiled SQL statement
    • B) A trigger
    • C) A view
    • D) A database backup

    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.

  10. Question 10

    Q10. What is a trigger in a database?

    • A) A stored procedure executed automatically in response to certain events
    • B) A view
    • C) A stored procedure executed manually
    • D) A database backup

    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.

  11. Question 11

    Q11. Which database recovery technique involves restoring the database to a previous state?

    • A) Backward recovery
    • B) Forward recovery
    • C) Checkpointing
    • D) Logging

    Answer: Backward recovery

    Explanation: Backward recovery involves restoring the database to a previous consistent state by undoing changes made by uncommitted transactions.

  12. Question 12

    Q12. What is data fragmentation?

    • A) The process of dividing data into smaller fragments
    • B) The process of combining data into a single unit
    • C) The process of encrypting data
    • D) The process of compressing data

    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.

  13. Question 13

    Q13. What is a distributed database?

    • A) A database that is stored in a single location
    • B) A database that is divided into fragments stored in different locations
    • C) A database that is replicated across multiple locations
    • D) Both B and C

    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.

  14. Question 14

    Q14. What is data replication?

    • A) The process of creating multiple copies of data
    • B) The process of dividing data into smaller fragments
    • C) The process of encrypting data
    • D) The process of compressing data

    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.

  15. Question 15

    Q15. What is a data warehouse?

    • A) A database designed for transactional processing
    • B) A database designed for analytical processing
    • C) A database designed for data storage
    • D) A database designed for data security

    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.

  16. Question 16

    Q16. What is OLAP?

    • A) Online Transactional Processing
    • B) Online Analytical Processing
    • C) Offline Analytical Processing
    • D) Offline Transactional Processing

    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.

  17. Question 17

    Q17. Which database concept ensures that data is not duplicated?

    • A) Data normalization
    • B) Data denormalization
    • C) Data redundancy
    • D) Data fragmentation

    Answer: Data normalization

    Explanation: Data normalization ensures that data is not duplicated by organizing data into tables with minimal redundancy.

  18. Question 18

    Q18. What is the term for a database transaction that is partially executed?

    • A) Committed
    • B) Aborted
    • C) Rolled back
    • D) Partially committed

    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.

  19. Question 19

    Q19. Which database recovery technique involves maintaining a log of all transactions?

    • A) Checkpointing
    • B) Logging
    • C) Backup
    • D) Recovery

    Answer: Logging

    Explanation: Logging involves maintaining a log of all transactions, which can be used to recover the database in case of a failure.

  20. Question 20

    Q20. What is the term for a database that is designed for querying and analyzing large datasets?

    • A) OLTP
    • B) OLAP
    • C) Data warehouse
    • D) Data mart

    Answer: OLAP

    Explanation: OLAP (Online Analytical Processing) is a database designed for querying and analyzing large datasets, often used in business intelligence.