1. Dangling tuples.
- Consider a pair of relations r(R) and s(S), and the natural join r ∞ s.
- There may be a tuple tr in r that does not join with any tuple in s.
- That is, there is no tuple ts in s such that tr[R∩S] = ts[R∩S].
- We call this a dangling tuple.
- Dangling tuples may or may not be acceptable.
2. Suppose there is a tuple t1 in the account relation with the value t1[bname] ="Lunartown", but no matching tuple in the branch relation for the Lunartown branch.
This is undesirable, as t1 should refer to a branch that exists.
Now suppose there is a tuple t2 in the branch relation with t2[bname] ="Mokan", but no matching tuple in the account 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.
3. Note the distinction between these two situations: bname is the primary key of branch, while it is not foraccount.
In account, bname is a foreign key, being the primary key of another relation.
- Let r1(R1) and r2(R2) be two relations with primary keys K1 and K2 respectively.
- We say that a subset of R2 is a foreign key referencing K1 in relation r1 if it is required that for every
tuple t2 in r2 there must be a tuple t1 in r1 such that t1[K1] = t2[α] - We call these requirements referential integrity constraints.
- Also known as subset dependencies, as we require
â…¡ (r2) ∈K1 (r1)
