75 views
1 1 vote

Using the same $\mathrm{Manager}$, $\mathrm{Stores}$, $\mathrm{Sales}$, and $\mathrm{Products}$ schema from the exam, define:

$\mathrm{NailSale}(S)$ = store $S$ sold more than $1000$ units of some nail product on some day.

$\mathrm{PowerSale}(S)$ = store $S$ sold a power tool costing over $100$.

Which logical structure correctly describes the managers requested in the original exam?

  1. $\{M\mid M\in \mathrm{Manager}\land\forall S((S\in \mathrm{Stores}\land S.\mathrm{MANAGER}=M.\mathrm{NAME})\Rightarrow(\mathrm{NailSale}(S)\lor \mathrm{PowerSale}(S)))\}$
     
  2. $\{M\mid M\in \mathrm{Manager}\land\exists S(S\in \mathrm{Stores}\land S.\mathrm{MANAGER}=M.\mathrm{NAME}\land(\mathrm{NailSale}(S)\lor \mathrm{PowerSale}(S)))\}$
     
  3. $\{M\mid M\in \mathrm{Manager}\land\forall S((S\in \mathrm{Stores}\land S.\mathrm{MANAGER}=M.\mathrm{NAME})\Rightarrow(\mathrm{NailSale}(S)\land \mathrm{PowerSale}(S)))\}$
     
  4. $\{M\mid M\in \mathrm{Manager}\land\forall S(S\in \mathrm{Stores}\Rightarrow \mathrm{NailSale}(S)\lor \mathrm{PowerSale}(S))\}$

1 Answer

0 0 votes

The key word is all.

Every store managed by $M$ must satisfy at least one of the two allowed conditions.

Therefore, the outer structure must be:

$\forall S$ and the condition applies only when

$S.\mathrm{MANAGER}=M.\mathrm{NAME}$.

This gives,

$(S\in \mathrm{Stores}\land S.\mathrm{MANAGER}=M.\mathrm{NAME})\Rightarrow(\mathrm{NailSale}(S)\lor \mathrm{PowerSale}(S))$

Inside $\mathrm{NailSale}$ and $\mathrm{PowerSale}$, existential tuple variables are used because the query requires the existence of an appropriate sale/product tuple.

So the quantifier pattern is conceptually:

$\forall \mathrm{Store}$

followed by

$\exists \mathrm{Sale},\exists \mathrm{Product}$

inside each permitted alternative.

B requires only one qualifying store.

C incorrectly requires every managed store to satisfy both conditions.

D imposes the sales condition on every store in the database, including stores not managed by $M$.

Therefore,

Answer : $\boxed{\mathrm{A}}$

Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
95
95 views
GO Classes asked Sep 29
95 views
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})...
0 0 votes
1 1 answer
71
71 views
GO Classes asked Sep 29
71 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
74
74 views
GO Classes asked Sep 29
74 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
79
79 views
GO Classes asked Sep 29
79 views
Consider $\mathrm{Manager}(\mathrm{NAME})$ and $\mathrm{Stores}(\mathrm{STORE\_ID},\mathrm{ADDRESS},\mathrm{REGION},\mathrm{MANAGER})$.Which TRC expression correctly retu...