Professional Documents
Culture Documents
COM222 Test2 Deferred
COM222 Test2 Deferred
2. Specify relation algebra query to retrieve the average salary of all female employees on the
COMPANY relational database schema shown in Figure 1 below. Also show the result of
each query as it would apply to the database state in Figure 1 below. (3)
Normalise the table into 3rd Normal form. Show all the intermediate normal forms and the
functional dependencies defining the forms or otherwise. (11)
4. Consider the following relational algebra expressions:
i. πw((A ⋈x=y B) ⋈z=v C)
ii. πw((πv(C) ⋈v=z πwyz(B)) ⋈y=x A)
a. Translate the relational algebra expression into their equivalent SQL statements. (4)
b. Assuming that (ii) is transformed from (i), list the attributes that each of the schemas A, B,
and C must have and the attributes that each (or some) of these schemas must not have in
order for the above transformation to be correct. (6)