DBMS Model Question Paper 2019-20
DBMS Model Question Paper 2019-20
The three-schema architecture enhances database system design by providing a structured framework that separates the physical storage of data from its logical and external views, thereby allowing for data abstraction and independence. Mapping between schema levels is necessary to translate data from one schema to another, ensuring that users interact with a consistent logical view of data regardless of changes at the physical level .
Database recovery techniques include transaction logs, checkpointing, and shadow paging. Each method has strengths and weaknesses. Transaction logs record each transaction's actions, allowing for detailed recovery but may require long recovery times. Checkpointing reduces recovery time by periodically saving the data's state but may not capture very recent transactions. Shadow paging uses a copy-on-write technique to maintain consistency but is less space-efficient. These techniques' effectiveness depends on system limitations and the balance between performance and recovery speed .
Two-Phase Locking (2PL) prevents deadlocks by enforcing a protocol where transactions acquire all required locks before releasing any. This guarantees serializability by dividing the execution into growing and shrinking phases. However, this approach may lead to reduced concurrency and increased waiting times as transactions may hold locks unnecessarily long, potentially leading to reduced system throughput .
Aggregation in database modeling refers to a higher-level abstraction where relationships are treated as single entities, useful when dealing with 'has-a' relationships. Generalization is a process of extracting shared characteristics from two or more classes into a generalized superclass, representing an 'is-a' relationship. For example, aggregation can link a department and project as a single entity representing a 'works on' relation, while generalization can define a 'Vehicle' superclass for 'Car' and 'Bike' subclasses .
Normalization in database design is the process of organizing data to reduce redundancy and improve data integrity. Second Normal Form (2NF) requires that all attributes be dependent only on the primary key, with no partial dependencies on any part of the composite key. Boyce-Codd Normal Form (BCNF) goes further by ensuring that every determinant is a candidate key. For example, if a table with attributes (A, B, C) has a dependency B→C, it may be in 2NF if B is not part of a composite key, but not BCNF if B is not a candidate key. BCNF eliminates this by removing such dependencies .
Inner join operations return rows when there is a match in both tables, thus excluding unmatched rows. Outer join operations, on the other hand, return all rows from one table and the matched rows from the other table, including unmatched rows as NULL. The essential difference lies in their treatment of unmatched rows: inner joins exclude them while outer joins include them .
The disadvantages of a file system compared to a DBMS include data redundancy and inconsistency, difficulty in accessing data, lack of data sharing and atomicity, and weak security systems. These issues affect data management by making it error-prone, time-consuming, and inefficient to maintain accurate and consistent data. DBMSs resolve these issues by providing a more structured and secure environment for data handling .
Entity integrity ensures that each table has a primary key that uniquely identifies each row, thus preventing duplicate or null entries for the primary key field. Referential integrity guarantees that a foreign key value in one table corresponds to a primary key value in another, ensuring valid and consistent relationships between tables. These constraints maintain data accuracy, consistency, and reliability across the database .
Impedance mismatch refers to the conflict that arises due to differences between the database model and the programming language model, such as type systems or data manipulation capabilities. Object-relational mapping (ORM) frameworks can minimize this problem by providing a bridge between these models, allowing developers to work with database data in terms of their programming language objects .
A key is a minimal set of attributes that uniquely identifies a tuple in a relation, while a super key can be any set of attributes that uniquely identifies a tuple, potentially including non-essential attributes. The minimal nature of keys is crucial for efficient database design, as it avoids redundancy by ensuring only necessary attributes are used for unique identification, thus optimizing storage and retrieval processes .