edited by
295 views
1 votes
1 votes

Consider the following relations
Employee (E#, Ename, salary, Bdate, D#)
Department (D#, Dname, mgremp#, Location)
Dependent (E#, DependentName)

Which among these tuple calculus queries represent the following condition:

List the names of mangers who have at least one dependent.

  1. {m[Ename] | m ∈ EMPLOYEE ∧ ∃u, t (t ∈ DEPENDENT ∧ u ∈ DEPARTMENT ∧ t[E#] = u[mgremp#] ∧ m[E#] = u[mgremp#])}
  2. {e[Ename] | e ∈ EMPLOYEE ∧ ∃d (d ∈ DEPARTMENT ∧ d[Ename] = ‘manager’ ∧ e[D#] = d[D#])}
  3. {m[Ename] | m ∈ EMPLOYEE ∧ ∃u, t (t ∈ DEPENDENT ∧ u ∈ DEPARTMENT ∧ e[E#] = u[mgremp#] ∧ m[D#] = u[mgremp#])}
  4. {e[Ename] | m ∈ EMPLOYEE ∧ ∃u, t (t ∈ DEPENDENT ∧ u ∈ DEPARTMENT ∧ t[E#] = u[D#] ∧ m[E#] = u[D#])}
edited by

1 Answer

0 votes
0 votes

After some observation, it seems easier to just eliminate wrong answers rather than trying to find the right one.

B is wrong because obviously it doesn’t seem correct to have “manager” as the name of some employee ;)

C, D are wrong because these expressions are using the tuple variable “e” without ever defining it(associating it with some table/relation).

So A is the only choice left.

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
229 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
295 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 ⋈ θ...