next up previous contents
Next: Can an employee Up: Examples of Modal Previous: Can Edna earn

Can Sally work in food?


An example where the update would break a constraint on a table's attribute value that is not mentioned in the query.

ENG: can sally work in food
SYN: (s(aux(can))(np(propn(sally)))
 PT: $m `in:`food:`work:`sally
FOL: $M in(`sally,`work,`food)
MOD: Entering modal query mode
URC: [`sally,*,*,`food]:emp
DRC: [`sally,*,*,`food]:emp
OP1: [`sally,*,*,`food]:emp

PAR: is there a consistent database state in which sally works in food

TRC: exists(tuple1:emp,tuple1!name=sally&tuple1!dept=food)
OP2: exists(tuple1:emp,tuple1!name=sally&tuple1!dept=food)
OP3: exists(sk1:emp,sk1!name=sally&sk1!dept=food)
The following update(s) will bring about the required database state...
<1> Modify emp : change {name=sally age=42 sal=850 dept=toy} 
                         to {name=sally age=42 sal=850 dept=food}
Do you wish to consider this update (y/n) ?
> y.
Considering update 1 ...
ERR: Employee Sally can't work in the Food Dept
ERR: All employees in Food must be aged under 41
ANS: This is an illegal database state

Chris Fox, September 1995