CST204 C
CST204 C
PART A
(Answer all questions; each question carries 3 marks) Marks
1 Classify the following cases into logical data independence and physical data independence. 3
(a) Creating an index for a data file
(b) Changing the integrity constraint
(c) Reorganizing the file
2 What is meant by a recursive relationship type? Give an example of recursive relationship type. 3
3 Consider the relational model constraints: domain constraint, key constraint, entity integrity 3
and referential integrity. Specify which of these constraints may be violated during the
following modification operations: insert, update and delete.
4 What is meant by complete set of relational algebra? Show how join operation in relational 3
algebra can be represented using this set.
5 What is meant by a correlated nested query? Give a suitable example. 3
6 Explain the advantage of a multilevel index. 3
7 Why Armstrong’s axioms are said to sound and complete? 3
8 What is meant by lossless join property? 3
9 List and explain the desirable properties of a transaction. 3
10 Illustrate the states for transaction execution. 3
PART B
(Answer one full question from each module, each question carries 14 marks)
Module -1
11 Consider the following information about a university database: Professors have a ssn, a name, 14
an age, a rank, and a research specialty. Projects have a project number, a sponsor name, a
starting date, an ending date, and a budget. Graduate students have ssn, a name, an age, and a
degree program (e.g., M.S. or Ph.D.). Each project is managed by one professor (known as the
project’s principal investigator). Each project is worked on by one or more professors (known
as the project’s co-investigators). Professors can manage and/or work on multiple projects.
Each project is worked on by one or more graduate students (known as the project’s research
assistants). When graduate students work on a project, a professor must supervise their work
on the project. Departments have a department number, a department name, and a location.
Departments have a professor (known as the chairman) who manages the department.
Professors work in one or more departments, and for each department that they work in, a time
Page 1 of 4
02000CST204052103
percentage is associated with their job. Graduate students have one major department in which
they are working on their degree. Each graduate student has another, more senior graduate
student (known as a student advisor) who advises him or her on what courses to take. Design
and draw an ER diagram that captures the information about the university.
12 a) Explain the difference between database schema and database state with suitable example. 7
Specify the role of schema in a DBMS.
b) With a neat diagram explain the Three Schema Architecture of a DBMS 7
Module -2
13 a) Consider the two relations T1 and T2 shown below. Show the results of the following 8
operations.
Relation T1 Relation T2
P Q R
A B C
30 Ac 25
30 Bc 26
35 Bc 28
45 Cc 23
45 Ac 26
30 Bc 25
i) T1 ⋈T1.Q=T2.BT2
ii) T1 ⟕ T1. P=T2.AT2
iii) T1 U T2
iv) T1 ⋈(T1.P =T2.A AND T1.R = T2.C)T2
b) An Employee relation has attributes: Employee-Id (numeric type), Name (character type), 6
Salary (numeric type) and Dep-No (numeric type).
A Department relation has attributes: Department-Number (numeric type), Department-
Name(character type), Dep-Manager-Id (numeric type).
Employee-Id is the primary key of Employee relation. Department-Number is the primary key
of the Department relation. Dep-No attribute of Employee relation refers to the Department-
Number attribute of Department relation and Dep-Manager-Id attribute of Department relation
refers to the Employee-Id attribute of Employee relation.
(i) Write create table statements by specifying necessary integrity constraints for
creating these two relations in SQL.
(ii) Write SQL statement to insert the details of an employee John with id 101 with
salary 5000 and working in department number 5.
(iii) Insert the details of a Research Department with Department Number 1 and it has
not been assigned any manager.
(iv) Assume that a department with employees working in it is to be deleted. Specify
the two options to manage this scenario.
14 Convert the ER schema for Bank database given below into a relational schema. Specify all 14
primary keys and foreign keys.
Page 2 of 4
02000CST204052103
Module -3
15 a) Consider the following relations: 7
Employee (Employee-Id, Employee-Name, Salary, Department-No)
Department (Department-No, Department-Name)
Write SQL queries for the following:
(i) Retrieve the employee names and their department names
(ii) Retrieve department names and the average salary given by them
(iii) Retrieve the ids of employees getting salary greater than the average salary of their
department
(iv) For each department that has more than 4 employees, retrieve the department-No
and the number of employees getting salary more than Rs. 50000
b) What is meant by a heap file? Explain how insert, update, delete and search operations can be 7
performed in a heap file.
16 a) What are the advantages of Views? Explain two view implementation techniques. 7
b) Consider a disk with block size 512 bytes. A block pointer is 6 bytes long, and a record pointer 7
is 7 bytes long. A file has 30,000 EMPLOYEE records of fixed-length. Each record has the
following fields: NAME (30 bytes), SSN (9bytes), DEPARTMENTCODE (9 bytes),
ADDRESS (40 bytes), PHONE (9 bytes),BIRTHDATE (8 bytes), SEX (1 byte), JOBCODE (4
bytes), SALARY (4 bytes, real number). An additional byte is used as a deletion marker.
Assume that file is not ordered by the key field SSN and we need to create a secondary index
on SSN.
(i) Find the number of levels needed, if we make it into a multilevel index.
(ii) Find the number of block accesses needed to retrieve a record from this file if we
use the multilevel index.
Page 3 of 4
02000CST204052103
Module -4
17 a) Given relation R(A,B,C,D,E) and functional dependencies F={AB → C, CE → D, A → E}. 6
Determine whether each functional dependency below is in F+ or not:
i) AB → D
ii) A→C
b) Consider the following relation: 8
CAR_SALE(Car#, Date_sold, Salesperson#, Commission%, Discount_amt)
Assume that a car may be sold by multiple salespeople, and hence {Car#,Salesperson#} is the
primary key. Additional dependencies are :
Date_sold → Discount_amt and Salesperson# → Commission%
(i) Based on the given primary key and functional dependencies, is this relation in 1NF,
2NF, or 3NF? Why or why not?
(ii) How would you successively normalize it completely?
18 a) Consider the following decompositions for the relation schema R into R1, R2 and R3. 7
Determine whether the decomposition has the lossless join property with respect to the given
F.
R={P, Q, R, S, T, U}
R1={P, Q}, R2= {R, S, T}, R3={P,R,U}
F = { P → Q, R → {S, T}, {P,R} → U}
b) Explain insert, update and delete anomalies with suitable examples. 7
Module -5
19 a) Consider the schedule S of three transactions T1,T2 and T3 given below. State whether the 7
schedule is serializable or not.
S: r3(Y), r3(Z), r1(X),w1(X), w3(Y), w3(Z),r2(Z), r1(Y), w1(Y), r2(Y), w2(Y), r2(X), w2(X)
(Hint: Interpret the notation r3(Y) as the operation read database item Y of transaction T3.)
b) Explain the lost update problem and temporary update problem that occur when concurrent 7
execution is uncontrolled.
20 a) Explain conservative and strict two-phase locking techniques. Why strict 2PL is deadlock free? 7
b) Differentiate among recoverable, cascading rollback and strict schedules with suitable 7
examples.
***
Page 4 of 4