Database Design: Time: 03 Hours Maximum Marks: 100 Instructions To Candidates
Database Design: Time: 03 Hours Maximum Marks: 100 Instructions To Candidates
USN
RV COLLEGE OF ENGINEERING®
(An Autonomous Institution affiliated to VTU)
V Semester B. E. Examinations Nov/Dec-19
Computer Science and Engineering
DATABASE DESIGN
Time: 03 Hours Maximum Marks: 100
Instructions to candidates:
1. Answer all questions from Part A. Part A questions should be answered
in first three pages of the answer book only.
2. Answer FIVE full questions from Part B. In Part B question number 2, 7
and 8 are compulsory. Answer any one full question from 3 and 4 & one
full question from 5 and 6
PART-A
1 1.1 Find the minimal cover for following set of functional dependencies.
𝑃𝑃 → 𝐿𝐿, 𝑃𝑃 → 𝐶𝐶𝐶𝐶, 𝐿𝐿𝐿𝐿 → 𝐴𝐴𝐴𝐴, 𝐴𝐴 → 𝐿𝐿𝐿𝐿 02
1.2 For the following 𝐸𝐸𝐸𝐸𝐸𝐸 relation 𝐸𝐸𝐸𝐸𝐸𝐸(𝐸𝐸_𝐼𝐼𝐼𝐼, 𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸𝐸, 𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷𝐷), display the
names of all employees whose names include either of the substring
“𝑇𝑇𝑇𝑇” or “𝐿𝐿𝐿𝐿”. 02
1.3 Differentiate the working of the following aggregate functions:
𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶(∗) and 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶(𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶_𝑁𝑁𝑁𝑁𝑁𝑁𝑁𝑁). 02
1.4 Determine the key for the following relation 𝑅𝑅 = { 𝐴𝐴, 𝐵𝐵, 𝐶𝐶, 𝐷𝐷, 𝐸𝐸, 𝐹𝐹, 𝐺𝐺, 𝐻𝐻, 𝐼𝐼}
with respective to following set of functional dependencies:
𝐴𝐴 → 𝐵𝐵𝐵𝐵, 𝐵𝐵𝐵𝐵 → 𝐸𝐸, 𝐸𝐸𝐸𝐸 → 𝐴𝐴𝐴𝐴, 𝐺𝐺 → 𝐼𝐼𝐼𝐼, 𝐹𝐹𝐻𝐻 → 𝐶𝐶𝐶𝐶 02
1.5 A relation is in __________ normal form if an attribute of a composite
key is dependent on an attribute of other composite key. 02
1.6 List the two conditions that decides that given 𝑀𝑀𝑀𝑀𝑀𝑀 𝑋𝑋 ↠ 𝑌𝑌 is a trivial
𝑀𝑀𝑀𝑀𝑀𝑀. 02
1.7 List different types of attributes in 𝐸𝐸𝐸𝐸 diagram and specify their 𝐸𝐸𝐸𝐸
notations. 02
1.8 The following table has two attributes 𝐴𝐴 and 𝐶𝐶 where 𝐴𝐴 is the primary
key and 𝐶𝐶 is the foregin key referencing A with on-delete cascade.
𝐴𝐴𝐴𝐴
-----
24
34
45
53
73
95
64
17
The set of all tuples that must be additionally deleted to preserve
referential integrity when the tuple (3,4) is deleted is : 02
1.9 Represent Aggregation function and GroupBy clause in relational
algebra. 01
1.10 An attribute of relational schema 𝑅𝑅 is called a __________ if it is a
member of some candidate key 𝑅𝑅. 01
1.11 The main problem associated with the recoverable schedule is
__________. 01
1.12 __________ is a transaction property ensured by the concurrency
control subsystem. 01
PART-B
04
c Discuss the division operation in relational algebra with an example. 04
OR
4 a For the following Database schema, write the Relational Algebra
Queries.
𝑎𝑎𝑎𝑎𝑎𝑎ℎ𝑜𝑜𝑜𝑜(author_id; 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓_𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛; 𝑙𝑙𝑙𝑙𝑙𝑙𝑙𝑙_𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛)
𝑎𝑎𝑎𝑎𝑎𝑎ℎ𝑜𝑜𝑜𝑜_𝑝𝑝𝑝𝑝𝑝𝑝(author_id; 𝑝𝑝𝑝𝑝𝑝𝑝_𝑖𝑖𝑖𝑖; 𝑎𝑎𝑎𝑎𝑎𝑎ℎ𝑜𝑜𝑜𝑜_𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝)
𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏(book_id; 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏_𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡; 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚ℎ; 𝑦𝑦𝑦𝑦𝑦𝑦𝑦𝑦; 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒)
𝑝𝑝𝑝𝑝𝑝𝑝(pub_id; 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡; 𝑏𝑏𝑏𝑏𝑏𝑏𝑏𝑏_𝑖𝑖𝑖𝑖)
Assume editor in book is a foreign key referencing author (author_id)
i) List the names of all authors who are not book editors
ii) List the names of all authors who are book editors
iii) List the names of all authors who have at least one
publication in the database.
iv) List the author_id authored a pub that was published in
July 08
b Consider the following requirements of ‘𝑈𝑈𝑈𝑈𝑈𝑈 Pride’ company which
keeps up-to-date information on the processing and current location
of each Shipped item. Shipped items are the heart of the 𝑈𝑈𝑈𝑈𝑈𝑈 product
tracking information system. Shipped items are be characterized by
item number (unique), weight, dimensions, insurance amount,
destination, and final delivery date. Shipped items are received into
the 𝑈𝑈𝑈𝑈𝑈𝑈 system at a single retail center. Retail centers are
characterized by their type, uniqueID and address. Shipped items
make their way to their destination via one or more standard 𝑈𝑈𝑈𝑈𝑈𝑈
transportation events (i.e, flights, truck deliveries). These
transportation events are characterized by a unique scheduleNumber,
a type (e.g, flight, truck) and a driveryRoute. Construct a clean and
concise 𝐸𝐸𝐸𝐸 diagram for the given database. List your assumptions
and clearly indicate the cardinality mappings as well as any role
indicators in your 𝐸𝐸𝐸𝐸 diagram. 08
OR
8 a Consider the three transactions 𝑇𝑇1, 𝑇𝑇2 and 𝑇𝑇3 and two schedules 𝑆𝑆1
and 𝑆𝑆2. Verify whether the schedules are serializable or not. Write
down the equivalent serial schedule for the serializable schedule.
𝑇𝑇1: 𝑟𝑟1(𝑥𝑥), 𝑟𝑟1(𝑧𝑧), 𝑤𝑤1(𝑥𝑥)
𝑇𝑇2: 𝑟𝑟2(𝑧𝑧), 𝑟𝑟2(𝑦𝑦), 𝑤𝑤2(𝑧𝑧), 𝑤𝑤2(𝑦𝑦)
𝑇𝑇3: 𝑟𝑟3(𝑥𝑥), 𝑟𝑟3(𝑦𝑦), 𝑤𝑤3(𝑦𝑦)
𝑆𝑆1: 𝑟𝑟1(𝑥𝑥), 𝑟𝑟2(𝑧𝑧), 𝑟𝑟1(𝑧𝑧), 𝑟𝑟3(𝑥𝑥), 𝑟𝑟3(𝑦𝑦), 𝑤𝑤1(𝑥𝑥), 𝑤𝑤3(𝑦𝑦), 𝑟𝑟2(𝑦𝑦), 𝑤𝑤2(𝑧𝑧), 𝑤𝑤2(𝑦𝑦)
𝑆𝑆2: 𝑟𝑟1(𝑥𝑥), 𝑟𝑟2(𝑧𝑧), 𝑟𝑟3(𝑥𝑥), 𝑟𝑟1(𝑧𝑧), 𝑟𝑟2(𝑦𝑦), 𝑟𝑟3(𝑦𝑦), 𝑤𝑤1(𝑥𝑥), 𝑤𝑤2(𝑧𝑧), 𝑤𝑤3(𝑦𝑦), 𝑤𝑤2(𝑦𝑦) 08
b Define Lock. Describe the types of lock used in concurrency control. 04
c Is deadlock possible in 2-phase locking protocol? Justify your answer
with an example. 04