DBMS QB
DBMS QB
10. Explain the purpose of the checkpoint mechanism. How often should
checkpoints be performed?
The checkpoint mechanism in a database is vital for ensuring data consistency
and efficient recovery after a system failure. It involves periodically writing
modified data from volatile memory to non-volatile storage. Checkpoints
minimize recovery time by reducing the amount of data that needs restoration
and maintain data consistency by durably storing committed transactions.
Additionally, they optimize system performance by preventing the transaction
log from growing excessively. The frequency of checkpoints depends on factors
like recovery requirements, transaction volume, and system performance
goals. Striking a balance between data consistency, recovery time, and system
performance, checkpoints are typically performed at regular intervals based on
time or transaction activity.
1. Active State – When the instructions of the transaction are running then the transaction is in
active state. If all the ‘read and write’ operations are performed without any error then it goes to the
“partially committed state”; if any instruction fails, it goes to the “failed state”.
2. Partially Committed – After completion of all the read and write operation the changes are made
in main memory or local buffer. If the changes are made permanent on the DataBase then the state
will change to “committed state” and in case of failure it will go to the “failed state”.
3. Failed State – When any instruction of the transaction fails, it goes to the “failed state” or if failure
occurs in making a permanent change of data on Data Base.
4. Aborted State – After having any type of failure the transaction goes from “failed state” to
“aborted state” and since in previous states, the changes are only made to local buffer or main
memory and hence these changes are deleted or rolled-back.
5. Committed State – It is the state when the changes are made permanent on the Data Base and the
transaction is complete and therefore terminated in the “terminated state”.
6. Terminated State – If there isn’t any roll-back or the transaction comes from the “committed
state”, then the system is consistent and ready for new transaction and the old transaction is
terminated.
UNIT 1
1. Draw a neat and labelled diagram of DBMS structure
2. What is mapping cardinality? Explain with suitable example. Mapping cardinality/cardinality ratio :
Mapping cardinality is the maximum number of relationship instances in which an entity can
participate.
This relationship is one to many because “There are some employees who manage more than one
team while there is only one manager to manage a team”.
3. What are the basic building blocks of data model? Explain with example.
A data model is a structure of the data that contains all the required details of the data like the name
of the data, size of the data, relationship with other data and constraints that are applied on the
data. It is a communication tool.
1. Entities
2. Attributes
3. Relationships
4. Constraints
Entities:- Entities are real time objects that exist.It can be a person, place, object, event, concept.
Entities are represented by a rectangle box containing the entity name in it.
Example: A student has attributes like name, roll number, age and much more.
Relationship: It describes the association between two entities.It is represented using diamond
symbol containing relationship name with it.The data model generally uses three kinds of
relationships:one to many, many to many, one to one.
Example: The relationship between two entities Student and Class has many to many relationship.
Constraints: Constraints are conditions applied on the data.It provides the data integrity.
Example: A student can take a maximum of 2 books from the library is applied as a constraint on the
student database.
Referential Integrity:
Rule: Foreign keys in a table must match primary keys in another table, or be
null.
Purpose: Maintains consistency between related tables. Ensures that
relationships between tables are valid, preventing the creation of "orphaned"
records with no corresponding parent records.
Domain Integrity:
Rule: Data values must fall within defined domains.
Purpose: Defines and enforces the acceptable range of values for each
attribute. This prevents the insertion of invalid or inconsistent data, ensuring
that data adheres to predefined rules.
Business Constraints:
Rule: Enforces specific business rules or logic that are not covered by the above
integrity constraints.
Purpose: Captures and enforces additional business-specific rules that might
not be covered by entity integrity, referential integrity, or domain integrity.
This ensures that the data meets specific business requirements.
These business rules are crucial for maintaining data quality, consistency, and
integrity within a database. They help to prevent errors, ensure accurate data
representation, and provide a foundation for reliable and meaningful
information in support of organizational processes.