Database Management System Theory Assignments ETCS208
Database Management System Theory Assignments ETCS208
Q.1 List five responsibilities of a database-management system. For each responsibility, explain the
problems that would arise if the responsibility were not discharged.
Q.2 Explain the difference between two-tier and three-tier architectures. Which is better suited for Web
applications? Why?
1. Find the names of all the students whose total credits are greater than 100
2. Find the course id and grades of all courses taken by any student named 'Tanaka'
3. Find the ID and name of instructors who have taught a course in the Comp. Sci.
department, even if they are themselves not from the Comp. Sci. department. To
test this query, make sure you add appropriate data, and include the corresponding
insert statements along with your query.
4. Find the courses which are offered in both 'Fall' and 'Spring' semester (not
necessarily in the same year
1. Find the id and title of all courses which do not require any prerequisites.
2. Find the names of students who have not taken any biology dept courses
3. Write SQL update queries to perform the following :
1. Give a 10% hike to all instructors
2. Increase the tot_creds of all students who have taken the course titled
"Genetics" by the number of credits associated with that course.
3. For all instructors who are advisors of at least 2 students, increase their
salary by 50000.
Q.2 Design an ER diagram for keeping track of the scoring statistics of your favourite sports
team. You should score the matches played, the scores in each match, the players in each match
and individual player scoring statistics for each match. Summary statistics should be modelled as
derived attributes with an explanation as to how they are computed.
Q.3 Consider the following schema: Suppliers (sid: integer, sname : string, address : string) Parts
(pid : integer, pname : string, colour : string) Catalouge (sid : integer, pid : integer, cost : real).
You can use either SQL or Relational Algebra
Q.4 An ER diagram can be viewed as a graph. What do the following mean in terms of the
structure of an Enterprise schema?
This assignment has several parts. In the first part we work on basic manipulation of functional
dependencies. Next, we use functional dependencies to normalize some toy relations into
BCNF/3NF. And finally, we take a real life example and figure out the functional dependencies
involved, and develop a normalized database design.
Q.1 Suppose a well-balanced range-partitioning vector had been chosen for a relation, but the relation is
subsequently updated, making the partitioning unbalanced. Even if virtual-processor partitioning is
used, a particular virtual processor may end up with a very large number of tuples after the update, and
repartitioning would then be required
A. Suppose a virtual processor has a significant excess of tuples (say, twice the average). Explain how
repartitioning can be done by splitting the partition, thereby increasing the number of virtual
processors.
B. If, instead of round-robin allocation of virtual processors, virtual partitions can be allocated to
processors in an arbitrary fashion, with a mapping table tracking the allocation. If a particular node has
excess load (compared to the others), explain how load can be balanced.
C. Assuming there are no updates, does query processing have to be stopped while repartitioning, or
reallocation of virtual processors, is carried out? Explain your answer.
Q.2.
Consider the following extension to the tree-locking protocol, which allows both shared and exclusive
locks:
A transaction can be either a read-only transaction, in which case it can request only shared locks, or an
update transaction, in which case it can request only exclusive locks.
Each transaction must follow the rules of the tree protocol. Read-only transactions may lock any data
item first, whereas update transactions must lock the root first.
Q.3. In timestamp ordering, W-timestamp(Q) denotes the largest timestamp of any transaction that
executed write(Q) successfully. Suppose that, instead, we defined it to be the timestamp of the most
recent transaction to execute write(Q) successfully. Would this change in wording make any difference?
Explain your answer.
Q.4 Devise a timestamp-based protocol that avoids the phantom phenomenon.
Q.5 Consider a variant of the tree protocol called the forest protocol. The database is organized as a
forest of rooted trees. Each transaction Ti must follow the following rules:
The second, and all subsequent, locks in a tree may be requested only if the parent of the requested
node is currently locked.
Q.6
Suppose that a B+-tree index on (dept name, building) is available on relation department. What would
be the best way to handle the following selection?
(building < “Watson”) ∧ (budget < 55000) ∧ (dept name = “Music”)(depar tment)