You are on page 1of 2

1/24/24, 7:51 AM Sheet 2

Database Systems - 1
Sheet 2
Academic year (2022-2023)

1. Create an ER model for each of the following descriptions:


(a) Each company operates four departments, and each department belongs to
one company.
(b) Each department in part (a) employs one or more employees, and each
employee works for one department.
(c) Each of the employees in part (b) may or may not have one or more
dependents, and each dependent belongs to one employee.
(d) Each employee in part (c) may or may not have an employment history.
(e) Represent all the ER models described in (a) to (d) as a single ER model.
2. Assume you have been contracted by a university to develop a database system to
keep track of student registration and accommodation records. The university courses
are offered by faculties. Depending on the student's IQ, there are no limitations to how
many courses a student can enroll in. The faculties are not responsible for student
accommodation. The university owns a number of hostels and each student is given a
shared room key after enrollment. Each room has furniture attached to it.
(a) Identify the main entity types for the project.
(b) Identify the main relationship types and specify the multiplicity for each
relationship. State any assumptions that you make.
(c) Using your answers for (a) and (b), draw a single ER diagram to represent the
data requirements for the project.

3. List the ACID properties. Explain the usefulness of each.


4. During its execution, a transaction passes through several states, until it finally
commits or aborts. List all possible sequences of states through which a transaction
may pass. Explain why each state transition may occur.
5. Explain the distinction between the terms serial schedule and serializable schedule.
Give an example of a serializable schedule with two transactions such that the
order in which the transactions commit is different from the serialization order.

about:blank 1/2
1/24/24, 7:51 AM Sheet 2

6. What is a recoverable schedule? Why is recoverability of schedules desirable? Are


there any circumstances under which it would be desirable to allow non-
recoverable schedules? Explain your answer.
7. For each of the following schedules, draw the precedence graph and state whether it
is conflict serializable, recoverable, and whether it avoids cascading aborts:
(a) R1(x), R2(x),W1(x),W2(x), commit(T1), commit(T2)
(b) R1(x), R2(y),W3(x), R2(x), R1(y) commit(T1), commit(T2), commit(T3)
8. Produce the normalized database schema for the following document (Up to 3NF).

9. Consider the following database relations:


User Occupation
ID Name Age Gender OccupationID CityID OccupationID OccupationName
1 John 25 Male 1 3 1 Software Engineer
2 Sara 20 Female 3 4 2 Accountant
3 Victor 31 Male 2 5 3 Pharmacist
4 Jane 27 Female 1 3 4 Library Assistant

For each of the following queries in relational algebra, City


Show the output table: CityID CityName
1 Halifax
a) Name( Age>25(User)) 2 Calgary
b)  Id>2 OR Age!=31(User) 3 Boston
c) User.OccupationID=Occupation.OccupationID(User X Occupation) 4 New York
d) User ⋈ Occupation ⋈ City 5 Toronto
e) Name,Gender(CityName=”Boston”(User ⋈ City))

Best Wishes … Dr. Nader Mahmoud

about:blank 2/2

You might also like