BICTE Dbms Sol
BICTE Dbms Sol
This protocol ensures that the transactions are executed in a sequence. That is the
transactions are executed in the order of locks achieved, and hence the transaction are
serialized.
2. Describe different types of database recovery methods.
The different types of database recovery methods are:
✓ Recovery techniques based on Deferred Update
✓ Recovery techniques based on Immediate Update
✓ Shadow paging
✓ Recovery in multi-database transactions
✓ Log based recovery
Recovery techniques based on Deferred Update:
It is a technique for the maintenance of the transaction log files of the DBMS. It is also called NO-
UNDO/REDO technique. It is used for the recovery of the transaction failures which occur due to
power, memory or OS failures. Whenever any transaction is executed, the updates are not
made immediately to the database. They are first recorded on the log file and then those changes
are applied once commit is done. This is called “Re-doing” process. Once the rollback is done
none of the changes are applied to the database and the changes in the log file are also discarded.
If commit is done before crashing of the system, then after restarting of the system the changes
that have been recorded in the log file are thus applied to the database.
Recovery techniques based on Immediate Update:
It is a technique for the maintenance of the transaction log files of the DBMS. It is also called
UNDO/REDO technique. It is used for the recovery of the transaction failures which occur due to
power, memory or OS failures. Whenever any transaction is executed, the updates are made
directly to the database and the log file is also maintained which contains both old and new
values. Once commit is done, all the changes get stored permanently into the database and records
in log file are thus discarded. Once rollback is done the old values get restored in the database and
all the changes made to the database are also discarded. This is called “Un-doing” process. If
commit is done before crashing of the system, then after restarting of the system the changes are
stored permanently in the database.
Shadow paging:
Shadow Paging is a recovery technique that provides atomicity and durability in database system.
Shadow Paging recovery technique is also known as On-Write Technique. Shadow Paging
maintains 2 page table. A current page table and shadow page table. When a transaction begins,
all the entries of the current page table are copied to the shadow page table and the current table is
updated for each write operation. The shadow page is never changed during the life of the
transaction. When the current transaction is committed, the shadow page entry becomes a copy of
the current page table entry and the disk block with the old data is released. The shadow page table
is stored in non-volatile memory. If the system crash occurs, then the shadow page table is copied
to the current page table.
3. What are the components of ER-Diagram? Draw an ER-Diagram for Library Management
System. Describe with cardinalities.
ER Model
As shown in the above diagram,
an ER diagram
has
three main components:
1. Entity
2. Attribute
3. Relationship
Entity : An entity is an object in real world with an independent existence
• Object with physical existence(Person, Employee)
• Object with conceptual existence(company , department )
Attribute: Every entity has some kind of information ,which is called attributes of that entity. So,
attributes are the properties of an entity. Or
A real-world property of an entity type is called an attribute. It is represented by an oval or
ellipse in E-R diagram.
1
▪ Cardinalities: Cardinality expresses the minimum and maximum number of entity
occurrences associated with one occurrence of the related entity. In the ERD, cardinality is
indicated by placing the appropriate numbers beside the entities, using the format (min ,
max).
4. What is functional dependency?
Let’s think of the whole database as being described by a single Universal relation schema
R={A1,A2,A3,…………An}.
Let’s X and Y are the subsets of R
A functional dependency, denoted X → Y , on a relation R, specifies a constraint of the
form “if two tuples of R agree on all of the attributes of X then they also agree on all of the
attributes of Y”.
If X → Y , then we say that Y is functionally dependent on X, or X functionally determine
Y.(i.e. there is a functional dependency from X to Y)
5. What is EER Model? Describe specialization and generalization in database design
process.
EER is a high-level data model that incorporates/includes the extensions to the original ER model.
It is a diagrammatic technique for displaying the following concepts
• Sub Class and Super Class
• Specialization and Generalization
• Union or Category
• Aggregation
For example, Faculty and Student entities can be generalized and create a
higher level entity Person.
▪ Specialization
It is opposite to Generalization. It is a top-down approach in which one higher level entity can
be broken down into two lower level entity. In specialization, a higher level entity may not
have any lower-level entity sets, it's possible
6. What are the importance of index in database?
A database index is a data structure that improves the speed of operations on a database
table.
The main importance of index in database are:
• It helps you to reduce the total number of I/O operations needed to retrieve that
data, so you don’t need to access a row in the database from an index structure.
• Offers Faster search and retrieval of data to users.
• Indexing also helps you to reduce tablespace as you don’t need to link to a row in
a table, as there is no need to store the ROWID in the Index. Thus you will able to
reduce the tablespace.
• You can’t sort data in the lead nodes as the value of the primary key classifies it.
7. Describe the structure of relational databases with schema diagram.
In a relational database, each row in the table is a record with a unique ID called the key. The
columns of the table hold attributes of the data, and each record usually has a value for each
attribute, making it easy to establish the relationships among data points.
Compiled by :
LB Gurung