foreign key

(redirected from Foreign key constraint)

foreign key

A column in a database table containing values that are also found in some primary key column (of a different table). By extension, any reference to entities of a different type.

Some RDBMSs allow a column to be explicitly labelled as a foreign key and only allow values to be inserted if they already exist in the relevant primary key column.

This article is provided by FOLDOC - Free Online Dictionary of Computing (

foreign key

In relational databases, it is a field in one table that is indexed in another. Foreign keys provide the building blocks for relating tables. For example, in a customer order table, the salesperson field might contain an employee number. That field would be a foreign key in the table, because the employee table would be indexed on employee number. See entity relationship model.

Foreign Keys
Note the "FK" indications in this Erwin entity relationship modeling program. Every foreign key is a field in one table that is indexed in another. (Example courtesy of Logic Works, Inc.)
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
References in periodicals archive ?
The foreign key constraint indicates that, in a collection, the name and the author of a top recipe must already exist as the name and the author of a recipe (in the same collection, but disregarding the order).
Key and foreign key constraints are represented by attribute grammars, adding semantic rules to schema grammars, to carry key and foreign key values (to verify their properties).
In Section 3 we consider the validation wrt schema constraints while in Section 4 we present our validation method wrt key and foreign key constraints. In section 5 we conclude and discuss some perspectives.
The execution of our key and foreign key constraints validator over a tree T' gives a tuple <<[l.sub.1], ..., [l.sub.n]>, <[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII] [T', [epsilon], ..., [MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN [T', [epsilon]>> where:
Let n be the number of key and foreign key constraints and let [] be the maximum number of target nodes (i.e., key tuples).

Full browser ?