You are on page 1of 10

Answer ________________________________________________________________________________________________ Ans of Gr.

A 1) A trigger is d) a statement that is executed automatically by the system of a modification

2)

One of the following four expressions of the relation algebra is not equivalent to the other three. They are all based on the relations R(A,B) and S(B,C). Indicate which is not equivalent to the others. c) R((A)(R) x B ( S))

3)

Boyce-Code Normal Form(BCNF) is in d) Every determinant is a candidate key

4) 5) 6)

F covers E Implies a) Every F in E also in F+ For a B-tree of order N with n nodes is a) log2 n Serilizability of concurrent transactions are ensured by c) Both of these(Locking + Time stamping)

7)

In a pre-commit state a transaction may be c) Either(a) or (b)

8)

Check-pointing is associated with a) log based recovery

9)

Conversion of locking mode from sharable to exclusive is called a) upgradation

10) PJ/NF is also called c) 5NF

Ans of Gr. B Ans of QNo-1 How records in a file are placed on disk storage.

The Database is stored as a collection of files. Each file is a sequence of records. A record is a sequence of fields. One type of approach: Assume record size is fixed. Each file has records of one particular type only. Different files are used for different relations. After implement this we will consider the variable length records.
Optical Disks (DVD-ROM, CD-ROM) Tape Drives Flash Memory

Cach e Main Memory

Ternary

Secondary
Flash Memory

Magnetic Disk

Primary

Optical Disk

Magnetic Tapes

Primary Storage : Fastest media but volatile. Secondary Storage: Next level in hierarchy, non-volatile, moderately fast access time. Also called on-line storage. Ternary Storage: Lowest level in hierarchy, non-volatile, slow access time. Also called off-line storage.

Hard Disk Drive Register Cache Main Memory

Ans of QNo-2

What do you mean by recoverable schedule.

Schedule: In the fields of databases and transaction processing (transaction management), a schedule (also called history) of a system is an abstract model to describe execution of transactions running in the system. Often it is a list of operations (actions) ordered by time, performed by a set of transactions that are executed together in the system. Recoverable Schedule: Transactions commit only after all transactions whose changes they read, commit.

These schedules are recoverable. F is recoverable because T1 commits before T2, that makes the value read by T2 correct. Then T2 can commit itself. In F2, if T1 aborted, T2 has to abort because the value of A it read is incorrect. In both cases, the database is left in a consistent state. Unrecoverable Schedule: A schedule S is recoverable if no transaction T in S commits until all transactions T have committed. If a transaction T1 aborts, and a transaction T2 commits, but T2 relied on T1, we have an unrecoverable schedule.

In this example, G is unrecoverable, because T2 read the value of A written by T1, and committed. T1 later aborted, therefore the value read by T2 is wrong, but since T2 committed, this schedule is unrecoverable.

Ans of QNo-3

What do you mean by Wait for graph.

A Wait-For Graph in computer science is a directed graph used for deadlock detection in operating systems and relational database systems. One such deadlock detection algorithm makes use of a Wait-For Graph to track which other processes a process is currently blocking on. In a Wait-for Graph, processes are represented as nodes, and an edge from process Pi to Pj implies Pj is holding a resource that Pi needs and thus Pi is waiting for Pj to release its lock on that resource. A deadlock exists if the graph contains any cycles. The wait for graph scheme is applicable to a resource allocation system with multiple instances of each resource type.
P
i

A cycle in the wait-for graph indicates that a deadlock has occurred, and one transaction in the cycle is chosen as the victim, which is aborted and restarted. To optimize the cost of restarting, the victim selection is usually based on the number of data items used by each transaction in the cycle. To detect a deadlock situation in the distributed system, it is necessary to construct a GWFG(Global Wait-For Graph) from these different LWFGs(Local Wait-For Graph) and to search it for cycles.
T
1

T
2

T
1

Site 1

Site 2 Local Wait-For Graph at Different Sites

Site 3

Ans of QNo-4

Distinguish b/w conflict and view serializibility [You must be write in tabular format.]

Conflict-serializable: (i) A schedule is said to be conflict-serializable when the schedule is conflictequivalent to one or more serial schedules. A schedule is conflict-serializable if and only if its precedence graph/serializability graph, when only committed transactions are considered, is acyclic (if the graph is defined to include also uncommitted transactions, then cycles involving uncommitted transactions may occur without conflict serializability violation). Example-

(ii)

(iii)

(iv) (v)

The above example is conflict-equivalent to the serial schedule <T1,T2>, but not <T2,T1>. So it is not a cyclic order. A schedule is conflict-serializable is not NP-complete, view-serializability has more theoretical purpose.

View-serializable: (i) (ii) (iii) A schedule is said to be view-serializable if it is view-equivalent to some serial schedule. Note that by definition, all conflict-serializable schedules are view-serializable. Example-

(iv) (v)

The above example is view-serializable since it has a view-equivalent serial schedule <T1, T2, T3>. A schedule is view-serializable is NP-complete, view-serializability has little practical interest.

Ans of QNo-5

Ans of QNo-6

Ans of Gr. C Ans of QNo-1 a) What is a view? What is the usefulness of a view? Write an SQL query to create view name Std_Info_View with the following attributes of Student table: (Std_Id, Std_Name, Std_Dept, Std_RollNo).

b) In log-based recovery schemes all updates are recorded in a log, which must be kept in stable storage. -- Justify it. Explain the concept of specialization and generalization with an example.

c) Discuss in brief the ACID properties of transaction in DBMS. 1+2+1+3+3+5 Ans of QNo-2 a) Consider the following database scema:SUPPLIER(Sid,Sname,Saddress) CUSTOMER(Cid,Cname,Cadd,Cbalance) ITEM(Ino,Iname,Icolor,Iprice) ORDER(Sid,Cid,Ino,Qty,Qno) Using above database schema answer the following queries in SQL i)Show the names of all suppliers who have supplied at least one red item and the price must be <500. ii)List the supplied id ,name ,customer name ,customer address from the above relation,where customer name must be as RAM. b) Answer the following Queries in Relational Algebra using the given database EMP(Eno,Ename,Eadd,Bdate,Super_no) DEPT(Dno,Dname,Mgno) PROJECT(Pno,Pname,Dno,Plocation) WORKS_ON(Eno,Dno,Hours) i) List the employee number,name,project name of all employee working on Development Dept. ii) Show the project number,location,dept name where project location is either Kolkata or Hooghly.

c) T1=R1(A) W1(A) R1(B) W1(B) T2= R2(A) W2(A) R2(C) W2(C) Schedules S Locks Availability[Y-immediate call, N-waiting]

----------------------------------------------------------------------------------------------------------------------R1(A) S(A) Y W1(A) W(A) Y R2(A) S(A) N W2(A) W(A) N R1(B) S(B) Y W1(B) W(B) Y R2(C) S(C) Y W2(C) W(C) Y T1 S(A) W(A) T2 W1(A)W2(A) S(A) W(A) S(B) W(B) S(C) W(C) Waiting Waiting
T
1 T2

R1(A)R2(A)

So, S(A) and W(A) of Transaction T2 are waiting for T1, but it is in one way, not a cyclic order. That mean Conflicting serializable does not exist.

2.

a) Define the following terms(Given expression)in the light of Relational Algebra. i)Projection ii)Selection iii)Intersection iv)Union

b)Write short note of any two. (i) (ii) (iii) (iv) Shadow paging and B-Tree organization. Decomposition and Renormalization Database recovery and 5NF. Clustering and Cascading Rollback

c)Consider the following Schedule

T1

T2 READ(Z) READ(Y) WRITE(Y)

T3

READ(Y) READ(Y) READ(X) READ(X) WRITE(Y) WRITE(Z) READ(X) READ(Y) WRITE(Y) READ(Y) WRITE(Y) READ(X) WRITE(X)

You might also like