CST204 D
CST204 D
PART A
(Answer all questions; each question carries 3 marks) Marks
Find 𝑅𝜃𝐵<𝐷 𝑆.
4 Define primary key, candidate key and super key. 3
5 What is the difference between the WHERE and HAVING clause? Illustrate with an 3
example.
6 Explain the difference between Hash indexes and B+-tree indexes. 3
7 Define the term functional dependency. Why are some functional dependencies called
trivial?
8 List Armstrong Axiom rules 3
9 List the ACID properties of transactions. 3
10 What is a key-value database? List its major properties. 3
PART B
(Answer one full question from each module, each question carries 14 marks)
Module -1
11 Draw an ER diagram to model the application with the following assumptions. Specify 14
key attributes of each entity type and (min, max) constraints on each relationship type.
Page 1 of 5
02000CST204052104
• Each home uniquely defined by home identifier, street address, city, state, a number
of bedrooms and a number of bathrooms and an associated owner.
• Each owner has a Social Security Number, first name, last name, phone, and
profession.
• An owner can spouse one or more homes.
• Agents represent owners in the sale of a home. An agent can list many homes, but
only one agent can list a home.
• An agent has a unique agent number, name, phone number and an associated office.
• When an owner agrees to list a home with an agent, a commission and a selling price
are determined.
• An office has office identifier, phone number, the manager name, address and an
optional agent number.
• Many agents can work at one office.
• A buyer entity type has a Social Security Number, first name, last name, phone,
preferences for the number of bedrooms and bathrooms, and a price range.
• An agent can work with many buyers, but a buyer works with only one agent.
12 a) What is the difference between logical data independence and physical data 6
independence? Which one is harder to achieve? Why?
b) 8
Consider the bank database given above and answer the following questions
i. List the strong (nonweak) entity types in the ER diagram.
ii. Is there a weak entity type? If so, give its name, partial key, and identifying
relationship.
iii. What constraints do the partial key and the identifying relationship of the weak entity
type specify in this diagram?
iv. List the names of all relationship types, and specify the (min, max) constraint on each
participation of an entity type in a relationship type.
Page 2 of 5
02000CST204052104
v. Suppose that every customer must have at least one account but is restricted to at most
two loans at a time, and that a bank branch cannot have more than 1,000 loans. How
does this show up on the (min, max) constraints?
Module -2
13 a) Consider the UNIVERSITY database with the following relations: 10
STUDENT (rollNo, name, degree, year, sex, deptNo, advisor)
DEPARTMENT (deptId, name, hod, phone)
PROFESSOR (empId, name, sex, startYear, deptNo, phone)
COURSE (courseId, cname, credits, deptNo)
ENROLLMENT (rollNo, courseId, sem, year, grade)
TEACHING (empId, courseId, sem, year, classRoom)
PREREQUISITE(preReqCourse, courseID)
Write relational algebra expressions for the following queries:
i. For each department, find its name and the name, sex and phone number of the head
of the department.
ii. Find courses offered by each department.
iii. Find those students who have registered for all courses offered in the department of
Computer Science.
iv. Obtain the department Ids for departments with no lady professor.
v. Obtain the rollNo of girl students who have obtained at least one S grade.
b) What is a foreign key constraint? Why are such constraints important? 4
What is referential integrity?
14 a) Convert the following ER diagram into a relational schema 4
Page 3 of 5
02000CST204052104
Page 4 of 5
02000CST204052104
ii. Suppose that the file is ordered by the key field Ssn and we want to construct a
primary index on Ssn. Calculate The number of first-level index entries and the
number of first-level index blocks
iii. Calculate the number of levels needed if we make it into a multilevel index.
b) What is a grid file? What are its advantages and disadvantages? 5
Module -4
17 a) Consider a relation R with five attributes (A,B,C,D,E) . You are given the following 6
dependencies: A → B, BC → E, and ED → A.
i. List all keys for R.
ii. Is R in 3NF?
iii. Is R in BCNF?
b) Define minimal cover. Let the given set of functional dependencies be: 𝐸: {𝐵 → 𝐴, 𝐷 → 8
𝐴, 𝐴𝐵 → 𝐷} . Find the minimal cover of E
18 a) Explain with example 2NF, 3NF and BCNF. 8
b) Consider a relation schema R(X Y Z W P ) (above table R) is decomposed into R1( X Y 6
Z ) and R2( Z W P). Determine whether the above R1 and R2 are Lossless or Lossy?
Module -5
19 a) What is a schedule? Define the concepts of recoverable, cascade less and strict schedules, 8
and compare them in terms of their recoverability.
b) Which of the following schedule is conflict serializable? For each serializable schedule 6
determine the equivalent serial schedule.
(a) r1 (X); r3 (X); w1(X); r2(X); w3(X)
(b) r1 (X); r3 (X); w3(X); w1(X); r2(X)
(c) r3 (X); r2 (X); w3(X); r1(X); w1(X)
20 a) What is the two-phase locking (2PL) protocol? How does it guarantee serializability? 7
How strict 2PL differs from basic 2PL?
b) Explain the need for multimodal database. List the important characteristics of 7
ArangoDB.
***
Page 5 of 5