117 views
0 0 votes

Consider the relation $\mathrm{Sailors}(\mathrm{sid},\mathrm{sname},\mathrm{rating},\mathrm{age})$ and the following TRC expression: $$\{S\mid \neg(S\in \mathrm{Sailors})\}$$ Which of the following correctly describes this query and its relationship with relational algebra?

  1. The query is unsafe, and there is no equivalent ordinary relational-algebra expression.
     
  2. The query is safe because $\mathrm{Sailors}$ is a finite relation, and its RA equivalent is $\mathrm{Sailors}-\mathrm{Sailors}$.
     
  3. The query is unsafe, but its RA equivalent is $\pi_S(\mathrm{Sailors})$.
     
  4. The query is safe because every tuple variable must range over $\mathrm{Sailors}$.

1 Answer

0 0 votes

The expression $\{S\mid \neg(S\in \mathrm{Sailors})\}$ asks for every possible tuple $S$ that is not present in the $\mathrm{Sailors}$ relation.

The problem is that $S$ is not restricted to tuples that come from any relation in the database. 

It can therefore range over tuples outside the active domain of the database.

This can produce an unbounded result, so the TRC expression is unsafe.

Ordinary relational algebra works only with tuples obtained from the relations in the database. 

It does not have an operation for taking the complement of a relation with respect to the set of all possible tuples.

Therefore, there is no equivalent ordinary relational-algebra expression.

Answer : A

Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
79
79 views
GO Classes asked Sep 29
79 views
Consider $\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ}),\mathrm{Enrollment}(\mathrm{sid},\mathrm{cid}).$Using the above schema, which condition correctly cha...
0 0 votes
1 1 answer
83
83 views
GO Classes asked Sep 29
83 views
Consider$\mathrm{Course}(\mathrm{cid},\mathrm{name},\mathrm{year},\mathrm{duration})$$\mathrm{Student}(\mathrm{sid},\mathrm{name},\mathrm{univ})$$\mathrm{Instructor}(\mat...
1 1 vote
1 1 answer
82
82 views
GO Classes asked Sep 29
82 views
Using the same $\mathrm{Manager}$, $\mathrm{Stores}$, $\mathrm{Sales}$, and $\mathrm{Products}$ schema from the exam, define:$\mathrm{NailSale}(S)$ = store $S$ sold more ...
1 1 vote
1 1 answer
88
88 views
GO Classes asked Sep 29
88 views
Consider $\mathrm{Manager}(\mathrm{NAME})$ and $\mathrm{Stores}(\mathrm{STORE\_ID},\mathrm{ADDRESS},\mathrm{REGION},\mathrm{MANAGER})$.Which TRC expression correctly retu...