# Code No: RR420207

Set No. 1

IV B.Tech II Semester Supplimentary Examinations, May 2008 DATA BASE MANAGEMENT SYSTEMS (Electrical & Electronic Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆ 1. (a) What is join ? Explain the several variants of join. (b) Deﬁne the division operation in relational algebra. Show that it can be derived from the primitive operations deﬁned in the relational algebra. [10+6] 2. (a) Give the various methods of managing data security. (b) Describe the “dynamic SQL”. 3. (a) What are the diﬀerences between static and dynamic ﬁles. (b) Discuss the techniques for allocating ﬁle blocks on disk. 4. (a) Discuss in detail the steps involved in processing a query. (b) Explain any one of the algorithms for computing the join of relations. [8+8] 5. (a) Discuss the reasons for converting SQL queries into relational algebra queries before optimization is done. (b) What is meant by query execution plan? Explain its signiﬁcance. [10+6] [8+8] [8+8]

6. (a) Let R=(A,B,C,D,E) and let M be the following set of multivalued dependencies A− >> BC B− >> CD E− >> AD List the nontrivial dependencies in M+ (b) Describe the properties of normalized and unnormalized relations. [10+6]

7. (a) Consider two transactions as follows: Transaction 1: Fac salary:=Fac salary+1025.00 Transaction 2: Fac salary:= Fac salary *1.1 What precaution, if any, would you suggest if these were to run concurrently? Write a pseudo code program for these transactions using an appropriate scheme to avoid undesirable results. (b) Explain Wait-die and Wound-wait in Deadlock prevention? [8+8]

8. Describe the shadow paging recovery technique. Under what circumstances does it not require a log. [16] ⋆⋆⋆⋆⋆

1 of 1

Code No: RR420207

Set No. 2

IV B.Tech II Semester Supplimentary Examinations, May 2008 DATA BASE MANAGEMENT SYSTEMS (Electrical & Electronic Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆ 1. (a) Explain Foreign key constraints with examples. (b) Give Properties of Relations with examples. (c) Explain General constraints with example. 2. (a) Consider the following schema: Suppliers (sid: integer, sname: string, address: string) Parts (Pid: integer, pname; string, color: string) Catalog ( Sid: integer, pid: integer, cost: real) Write the following queries in SQL. i. ii. iii. iv. Find the names of suppliers who supply red part. Find the sids of suppliers who supply all parts. Find the pids of parts that are supplied by at least two diﬀerent suppliers. Find the pids of the most expensive parts supplied by the suppliers named TATA. [3+3+3+3] [4] [5+5+6]

(b) Why are null values not preferable in a relation. 3. (a) Write a note on dense and sparse indexing. (b) Write a note on ﬁxed and variable length records. 4. Give a detailed account of the following: (a) Query evaluation plans. (b) Pipelined evaluation. 5. Write short notes on the following. (a) SQL query translation process. (b) Equivalences of relational algebra. 6. (a) What do you understand by the mapping cardinalities?

[8+8]

[8+8]

[6+10]

(b) For the following relation scheme, tell whether it is in 3 NF or not. Employee (E code,E name,Dname,salary,projectno,Termination dataof project) Where each project no has unique termination dateof project. Justify your answer, if it in not 3NF bring it into 3NF through normalization. [6+10]

1 of 2

Code No: RR420207

Set No. 2

7. (a) Consider two transactions as follows: Transaction 1: Fac salary:=Fac salary+1025.00 Transaction 2: Fac salary:= Fac salary *1.1 What precaution, if any, would you suggest if these were to run concurrently? Write a pseudo code program for these transactions using an appropriate scheme to avoid undesirable results. (b) Explain Wait-die and Wound-wait in Deadlock prevention? 8. Explain in detail the ARIES recovery method. ⋆⋆⋆⋆⋆ [8+8] [16]

2 of 2

Code No: RR420207

Set No. 3

IV B.Tech II Semester Supplimentary Examinations, May 2008 DATA BASE MANAGEMENT SYSTEMS (Electrical & Electronic Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆ 1. (a) Deﬁne with examples, the relation and relation schema. (b) Explain the general syntax of SELECT command. 2. (a) Give the various methods of managing data security. (b) Describe the “dynamic SQL”. [8+8] [6+10]

3. (a) Which of the three basic ﬁle organizations would you choose for a ﬁle where the most frequent operations are as follows, i. Search for records based on a range of ﬁeld values. ii. Perform insert and scans where the order of records does not matter. iii. Search for a record based on a particular ﬁeld value. (b) Deﬁne dense index. (c) How does multi level indexing improve the performance of searching an index ﬁle. [6+4+6] 4. State and explain any six heuristic rules used in optimizing relational queries. [16] 5. (a) At what point during query processing does optimization occur. (b) Consider the following SQL queries for a bank DB select T.branch name from branch T,branch S where T.assets> S.assets and S.branch city = ”Chennai” Write an eﬃcient relational-algebra expression that is equivalent to this query. Justify (c) What is multiple equivalence. How is multiple transformation done by the following query? Πcustomer name ( σbranch city = ”Chennai”(branch X (account X depositor))) [4+6+6] 6. (a) Construct an E-R diagram for university registrar’s oﬃce. The oﬃce maintains data about each class, including the instructor, the enrollment and the time and place of the class meetings. For each student class pair, a grade is recorded. Determine the entities and relationships that exist between the entities. Also construct the tabular representation of the entities and relationships. (b) What is an entity type? What is an entityset? Explain the diﬀerence between the entity, entity type and entityset? [10+6] 1 of 2

Code No: RR420207

Set No. 3
[6+10]

7. (a) What information does the dirty page table and transaction table contain? (b) Give a short notes on recovery from deadlock.

8. (a) Discuss the un-do and re-do operations and the recovery techniques that use each. (b) Compare the shadow(D)paging recovery scheme with the log-based recovery schemes in terms of case of implementation and overhead cost. [8+8] ⋆⋆⋆⋆⋆

2 of 2

Code No: RR420207

Set No. 4

IV B.Tech II Semester Supplimentary Examinations, May 2008 DATA BASE MANAGEMENT SYSTEMS (Electrical & Electronic Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ⋆⋆⋆⋆⋆ 1. (a) Consider the following schema Suppliers(sid, sname, saddress) Parts(pid, pname, color) Catalog(sid, pid, cost) The key ﬁelds are underlined. Write the following queries in relational algebra i. ii. iii. iv. v. Find the names of suppliers who supply blue part Find the sids of suppliers who supply every red part Find the pids of parts that are supplied by at least two diﬀerent suppliers Find all the pids of parts supplied by supplier with sid=200 Find the pids of parts supplied by every supplier at less than Rs 500. [2+2+2+2+2]

(b) Given two relations R1 and R2 , where R1 contains N1 tuples, R2 contains N2 tuples, and N2 > N1 > 0 , give the minimum and maximum possible sizes (in tuples) for the result relation produced by each of the following relational algebra expressions. In each case, state any assumptions about the schemas for R1 and R2 that are needed to make the expression meaningful. i. Selecting all the tuples from R1 where a=5 ii. Projecting the attribute b from R2 iii. R1 X R2

[2+2+2]

2. (a) Consider the following schema given. The primary keys are underlined. Sailors(sailor-id, sailor-name, sailor-rating, sailor-age) Boats(boat-id, boat-name, boat-color) Reserves(sailor-id, boat-id, day) Write the Nested queries in SQL. i. ii. iii. iv. Find Find Find Find the the the the names names names names of of of of sailors sailors sailors sailors who have reserved boat number 120 who have reserved a green boat who have not reserved a green boat with the highest rating [2+2+3+3] [6]

(b) Explain the GROUP BY and HAVING clauses. 3. (a) Write a note on dense and sparse indexing. (b) Write a note on ﬁxed and variable length records. 1 of 2

[8+8]

Code No: RR420207 4. (a) Explain about projection based on sorting. (b) Explain about projection based on hashing.

Set No. 4
[8+8]

5. (a) Discuss the reasons for converting SQL queries into relational algebra queries before optimization is done. (b) What is meant by query execution plan? Explain its signiﬁcance. [10+6]

6. (a) Construct an E-R diagram for university registrar’s oﬃce. The oﬃce maintains data about each class, including the instructor, the enrollment and the time and place of the class meetings. For each student class pair, a grade is recorded. Determine the entities and relationships that exist between the entities. Also construct the tabular representation of the entities and relationships. (b) What is an entity type? What is an entityset? Explain the diﬀerence between the entity, entity type and entityset? [10+6] 7. Write short notes on (a) dead lock. (b) exclusive lock. (c) binary lock. (d) live lock. [4+4+4+4]

8. (a) Explain the database Recovery Technique based on Deferred Update (b) What are the roles of Analysis, Redo and Undo phases in ARIES? ⋆⋆⋆⋆⋆ [7+9]

2 of 2