Documente Academic
Documente Profesional
Documente Cultură
ASSIGNMENT
NO1 OF
MANAGING
DATABASE
SUBMITTED TO
SUBMITTED BY
MISS.GARGI SHARMA
VARUN KATOCH
E3801B53
BCA-MCA
Q1. Properties satisfied by a transaction for a transfer of funds
from one bank account to another. Evaluate?
Ans.1
Atomicity
Atomicity requires that database modifications must follow an
"all or nothing" rule. Each transaction is said to be atomic if
when one part of the transaction fails, the entire transaction
fails and database state is left unchanged. It is critical that the
database management system maintains the atomic nature of
transactions in spite of any application, DBMS, operating
system or hardware failure.
Transactions can fail for several kinds of reasons:
1. Hardware failure:
2. System failure
3. Database failure
4. Application failure
Consistency
The consistency property ensures that the database remains in
a consistent state; more precisely, it says that any transaction
will take the database from one consistent state to another
consistent state. The consistency property does not say how the
DBMS should handle an inconsistency other than ensure the
database is clean at the end of the transaction. If, for some
reason, a transaction is executed that violates the database’s
consistency rules, the entire transaction could be rolled back to
the pre-transactional state - or it would be equally valid for the
DBMS to take some patch-up action to get the database in a
consistent state.
Isolation
Isolation refers to the requirement that other operations cannot
access data that has been modified during a transaction that
has not yet completed. The question of isolation occurs in case
of concurrent transactions, (i.e. multiple transactions occurring
at the same time) and within the same database. Each
transaction must remain unaware of other concurrently
executing transactions, except that one transaction may be
forced to wait for the completion of another transaction that
has modified data that the waiting transaction requires. If the
isolation system does not exist, then the data could be put into
an inconsistent state. This could happen if one transaction is in
the process of modifying data but has not yet completed, and
then a second transaction reads and modifies that uncommitted
data from the first transaction. If the first transaction fails and
the second one succeeds, that violation of transactional
isolation will cause data inconsistency.
Durability
Durability is the ability of the DBMS to recover the committed
transaction updates against any kind of system failure
(hardware or software). Durability is the DBMS's guarantee
that once the user has been notified of a transaction's success
the transaction will not be lost, the transaction's data changes
will survive system failure, and that all integrity constraints
have been satisfied, so the DBMS won't need to reverse the
transaction. Many DBMSs implement durability by writing
transactions into a transaction log that can be reprocessed to
recreate the system state right before any later failure. A
transaction is deemed committed only after it is entered in the
log.
Durability does not imply a permanent state of the database. A
subsequent transaction may modify data changed by a prior
transaction without violating the durability principle.
Q2. Design a small application on student management
system for the purpose of enquiry; we will use any
database system to store persistent data.
Ans2.
create table Student_Information_Register
( Roll_Num varchar(50),App_Num varchar(50) ,First_Name
varchar(50),Last_Name varchar(50),Prog_Code
char(10),Sch_Code varchar(50),Address varchar(50),City
char(20),State char(20),Country varchar(50),Zip_Code
char(10),Phone_Num varchar(30),Email varchar(50),Gender
char(1));
insert into
Student_Information_Register(‘1’,’1024’,’Varun’,’Katoch’,’140’,’
169’,’Nehru
Nagar’,’Pathankot’,’Punjab’,’India’,’145001’,’9988474941’,’katoc
h.varun@gmail.com’,’Male’);
insert into
Student_Information_Register(‘2’,’1025’,’Manpreet’,’Singh’,’14
0’,’169’,’Deep
Nagar’,’Barnala’,’Punjab’,’India’,’146201’,’9453636378’,’msraib
arnala@gmail.com’,’Male’);
insert into
Student_Information_Register(‘3’,’1026’,’Manpreet’,’Sandhu’,’1
40’,’169’,’Madhuvan
Nagar’,’Ludhiana’,’Punjab’,’India’,’144401’,’9878628187’,’mitra
ndichatri16@gmail.com’,’Male’);
insert into
Student_Information_Register(‘4’,’1027’,’Vishavpreet’,’Singh’,’
140’,’169’,’Gandhi
Nagar’,’Ludhiana’,’Punjab’,’India’,’144401’,’9464765663’,’visha
v778@gmail.com’,’Male’);
Q3. We have a problem that would arise if the responsibilities
were not discharged. For this problem list five
responsibilities of a database management system.
Ans 3.
Atomicity
Consistency
Isolation
Durability
2:-Global accessibility
Ans 5.
(a) Create table Customer(cust_cid PK
varchar(50),cust_cname varchar(50),cust_city
varchar(50),cust_rating varchar(50));
b)
The result using SUM and COUNT would be smaller than
the result using AVERAGE if there are tuples with rating
= NULL. This is because all the aggregate operators,
except for COUNT, ignore NULL values. So the first
approach would compute the average over all tuples
while the second approach would compute the average
over all tuples with non-NULL rating values. However, if
the aggregation is done on the age field, the answers
using both approaches would be the same since the
age field does not take NULL values.