12 Relvar versus attribute predicates
In the Relational Model (RM), each relvar has an associated predicate. For the supplier-and-parts database, there is a relvar recording suppliers:
VAR S BASE RELATION
{
S# CHAR,
SNAME CHAR,
STATUS INTEGER,
CITY CHAR
}
KEY { S# };
and its predicate is:
S(S#,SNAME,STATUS,CITY)⇔
There exists a supplier identified by supplier number
S# with name SNAME having
status STATUS and located in city CITY
In Predica this relvar is represented by entity Supplier together with a reference from entity ShipmentsSystem:
entity Supplier
{
String id;
String name;
Integer status;
String city;
key {id};
}
entity ShipmentsSystem
{
Supplier supplier*;
...
}
The Supplier attributes are predicates, simpler and more atomic than the relvar predicate of the RM:
id(I)⇔
The supplier has id
Iname(N)⇔
The supplier has name
Nstatus(S)⇔
The supplier has status
Scity(C)⇔
The supplier is located in city
C
and in the ShipmentsSystem there is a predicate for existence of a supplier:
supplier(S)⇔
The shipments system has a supplier
S