Académique Documents
Professionnel Documents
Culture Documents
Sec. C1802
PART-A
Ques 1: Consider the relational scheme of the relation SCHEDULE as shown below.What is the
highest normal form of this relation? What type of data anomalies does this relation have ? Give
an example of the type of data anomalies that this relation may experience.
SCHEDULE (stu_id,class_no,stu_name,stu_major,class_time,building_room,instructor).
Stu_id->stu_name
Stu_id->stu_major
Class_no->class_time
Class_no->building_room
Class_no->instructor
Insert
Update
Delete
Ans. 2
Ques 3 While normalizing the relation schema , : Decomposing a relation schema can create
more problems than it solves. Justify your answer.
Ans:In normalization , NO decomposes the table into smaller tables then relation schema can
create more problems than it sloves. For example:
Stu_name->game
Stu_name->fees
And it’s in 1NF but it create the problem’s because if ahtesham does not want to play game.we
have to delete the entire row and it also another problem that is the boxing never exist if he back
out from the game.
1: insert anomalies
2: delete anomalies
3:update anomalies
Stu_table
Stu_name Game
Amit Cricket
Suresh Tennis
Kamal Tennis
Ahtesham Boxing
Salman cricket
Game_tables
Game Fees
Cricket 300
Tennis 100
Boxing 10000
Stu_name->game
Game->fees .
PART-B
In the shadow-copy scheme, a transaction that wants to update the database first creates a
complete copy of the database. All updates are done on the new database copy, leaving the
original copy. If at any point the transaction has to be aborted, the system merely deletes the new
copy. The old copy of the database has not been affected. If the transaction completes, it is
committed as follows. First, the operating system is asked to make sure that all pages of the new
copy of the database have been written out to disk. After the operating system has written all the
pages to disk, the database system updates the pointer db-pointer to point to the new copy of the
database; the new copy then becomes the current copy of the database. The old copy of the
database is then deleted.
Ans5-: Serializibility is the concept which helps in understanding the non serial schedule which
is causing problems and which has same results as that of the transactions which are part of the
schedule.
S1 S2 S3
T1 T2 T1 T2 T1 T2
S1 S2 S3
T1 T2 T1 T2 T1 T2
Schedule S1 and S3 are view Equivalent because the values of data item A and B read by
transaction T2 was produced by T1 in both the schedules. This shows the concept of view
serializibility.
Schedule – a sequences of instructions that specify the chronological order in which instructions
of concurrent transactions are executed.
A schedule for a set of transactions must consist of all instructions of those transactions. It must
preserve the order in which the instructions appear in each individual transaction
In seralizable schedule
Question 6: Are the ACID properties of a transaction essential to ensure the integrity of data?
Give an example of each property.
Ans6-:Yes , the ACID properties of transactions are essential to ensure the integrity of data.
Following are the properties-:
1) Atomicity-: It means that the whether all the changes are made to transaction and no
change is made. For example we have two accounts A and B we want to transfer money from
account A to B. This means money is to be subtracted from account A and added to account B.
According to this property both these operations made simultaneously or none is made.
2) Consistency-: It means that database should remain consistent at the end of transaction
i.e if we consider the above example the sum of amount in the database before or after
transaction should be remains same i.e A+B will be same before or after transaction.
3) Isolation-: This means that when the two users are using same database the changes will
be made both of them concurrently i.e the data used during the execution of one transaction
cannot be used by the other transaction until the first one is completed.
4) Durability-: It means that the once the transaction is commited it make changes to the
database instead of any errors or failures. The system must be durable.
All these four properties ensure the integrity of data. Any of these properties can bring the
difference in the database.