edited by
294 views
0 votes
0 votes

What does the following relational algebra expression represent ?

Consider the relations given below with keys in Bold :
Branch (branch no, street,  city)
Staff (staff No, name, salary, branch No, position, DOB)
propertyForRent (property No, staff No, rent)

Answer this  query in relational algebra :

List the Staff Numbers of  Staffs who have not rent any property

  1. ΠstaffNo (Staff) - Π propertyNo (propertyForRent)
  2. Π staffNo (Staff) U Π staffNo (propertyForRent)
  3. Π staffNo (Staff) -  Π staffNo (propertyForRent)
  4. Π staffNo (Staff) * ΠstaffNo(rent)
edited by

1 Answer

0 votes
0 votes

Staffs who have a rented property will have their staff no in propertyForRent relation.

So, $\Pi _{staffNo} (propertyForRent)$ will give staff numbers of those who have a rented property. 

Subtracting this from all the staff number in the staff table will give the required result. i.e.

$\Pi _{staffNo} (Staff) - \Pi _{staffNo} (propertyForRent)$

Option (C)

Answer:

Related questions

1 votes
1 votes
1 answer
1
Bikram asked Nov 26, 2016
319 views
Consider the join of relation R with a relation S. If R has $m$ tuples and S has $n$ tuples, then the maximum and minimum sizes of the join, respectively, are __________....
0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
228 views
A functional dependency of the form x → y is trivial ify ⊆ xy ⊂ xx ⊆ yx ⊂ y
0 votes
0 votes
1 answer
3
Bikram asked Nov 26, 2016
293 views
What does the following Tuple Relational Calculus query produce?The expression σθ1 (E1 ⋈θ2 E2) is the same as: E1 ⋈θ1^ θ2 E2 (σθ1 E1) ∧ (σθ2 E2 ) E1 ⋈ θ...