If, in designing a database using the relational model, the key attribute of one relation is included as a nonkey attribute in some other relation then it is said to be a foreign key in that relation and similarly if the key is compound. See also referential integrity.