all(a, attr)
all(a)
Returns true if all of the specified attr for tuples in relation a are true.
If the relation has only one attribute then it is used and no attr need be specified.
∀ can be used instead of all.
Examples
$P{*, heavy:=WEIGHT>12}
| heavy | PNO | PNAME | COLOR | WEIGHT | CITY |
|---|---|---|---|---|---|
| false | P1 | Nut | Red | 12 | London |
| false | P5 | Cam | Blue | 12 | Paris |
| true | P2 | Bolt | Green | 17 | Paris |
| true | P3 | Screw | Blue | 17 | Rome |
| true | P4 | Screw | Red | 14 | London |
| true | P6 | Cog | Red | 19 | London |
None
all($P{*, heavy:=WEIGHT>12}[PNO="P0"], heavy)
true
Some
all($P{*, heavy:=WEIGHT>12}, heavy)
false