0% found this document useful (0 votes)
59 views

BICTE Dbms Sol

The document discusses database concepts including concurrency control, database recovery methods, ER diagrams, functional dependencies, the EER model, indexing, and relational database structure. Concurrency control manages simultaneous processes without conflicts. Recovery techniques include deferred update, immediate update, and shadow paging. An ER diagram for a library system is described. Functional dependencies specify constraints between attribute sets. The EER model extends ER diagrams to include specialization and generalization.

Uploaded by

Samjhana Lama
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

BICTE Dbms Sol

The document discusses database concepts including concurrency control, database recovery methods, ER diagrams, functional dependencies, the EER model, indexing, and relational database structure. Concurrency control manages simultaneous processes without conflicts. Recovery techniques include deferred update, immediate update, and shadow paging. An ER diagram for a library system is described. Functional dependencies specify constraints between attribute sets. The EER model extends ER diagrams to include specialization and generalization.

Uploaded by

Samjhana Lama
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

BICTE:DBMS

1. What is concurrency control in database? Describe 2-phase lock-based protocol.


Concurrency control concept comes under the Transaction in database management system
(DBMS). It is a procedure in DBMS which helps us for the management of two simultaneous
processes to execute without conflicts between each other, these conflicts occur in multi user
systems.
The advantages of concurrency control are as follows −
• Waiting time will be decreased.
• Response time will decrease.
• Resource utilization will increase.
• System performance & Efficiency is increased.
Two-phase lock-based protocol(2PL):
In this type of protocol, as the transaction begins to execute, it starts requesting for the
locks that it needs. It goes on requesting for the locks as and when it is needed. Hence it
has a growing phase of locks. At one stage it will have all the locks. Once the transaction
is complete it goes on releasing the locks. Hence it will have descending phase of locks.
Thus this protocol has two phases – growing phase of locks and shrinking phase of locks.

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.

Relationship: A relationship is defined as bond or attachment between 2 or more


entities. Diamond or rhombus is used to represent the relationship

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

Features of EER Model


• EER creates a design more accurate to database schemas.
• It reflects the data properties and constraints more precisely.
• It includes all modeling concepts of the ER model.
• Diagrammatic technique helps for displaying the EER schema.
• It includes the concept of specialization and generalization.
• It is used to represent a collection of objects that is union of objects of different of different
entity types.
▪ Generalization:
It is a bottom-up design process in which two or more entities of lower level or combined to
form a higher level entity if they have some common attributes or properties. In
generalization, an entity of a higher level can also combine with the entities of the lower level
to form a further higher level entity.

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy