and
, and the natural
join
.
in
that does not join with any tuple
in
.
in
such that
.
in the deposit relation with the value
``Lunartown'', but no matching tuple in the branch
relation for the Lunartown branch.
This is undesirable, as
should refer to a branch that exists.
Now suppose there is a tuple
in the branch relation with
``Mokan'', but no matching tuple in the deposit
relation for the Mokan branch.
This means that a branch exists for which no accounts exist. This is possible, for example, when a branch is being opened. We want to allow this situation.
In deposit, bname is a foreign key, being the primary key of another relation.
and
be two relations with
primary keys
and
respectively.
of
is a foreign key
referencing
in relation
if it is required that for every
tuple
in
there must be a tuple
in
such that
