Skip to content

Foreign key

A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables.

Core Idea

Foreign key is treated here as the recurring relational databases identity summarized by this source-grounded definition: A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables. A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables. In the context of relational databases, a foreign key is subject to an inclusion dependency constraint that the tuples consisting of the foreign key attributes in one relation, R, must also.

Scope of Application

  • RESTRICT. The referential action CASCADE modifies the "behavior" of the (child) table itself where the word CASCADE is used.

  • Summary. Since the purpose of the foreign key is to identify a particular row of referenced table, it is generally required that the foreign key is equal to the candidate key in.

  • Summary. The table containing the foreign key is called the child table, and the table containing the candidate key is called the referenced or parent table.

  • Summary. In database relational modeling and implementation, a candidate key is a set of zero or more attributes, the values of which are guaranteed to be unique for each tuple (row) in.

  • Summary. The value or combination of values of candidate key attributes for any tuple cannot be duplicated for any other tuple in that relation.

Clarity

A clear use of Foreign key names the carrier, the operative relation, and the conditions under which the source treats the identity as present. The minimal definition is A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables.

Manages Complexity

Foreign key compresses multiple relational databases details into a stable diagnostic relation. The source shows both the central mechanism—many real world databases work around this problem by 'inactivating' rather than physically deleting master table foreign keys, or by complex update programs that modify all references to a foreign key when a change is needed.—and the practical consequence—another important limitation appears with transaction isolation: your changes to a.

Abstract Reasoning

  1. Type the carrier. Identify the relational databases entities to which the claim applies.
  2. State the relation. Use the source-grounded identity: A foreign key is a set of attributes in a table that refers to the primary key of another table, linking these two tables.
  3. Check operation and conditions. One important part of database design is making sure that relationships between real-world entities are reflected in the database by references, using foreign keys to refer from one table to another.
  4. Demand recognition evidence.

Knowledge Transfer

Within the home domain. Knowledge about Foreign key transfers literally when a new case preserves the same carrier type, relation, and recognition test. The referential action CASCADE modifies the "behavior" of the (child) table itself where the word CASCADE is used. Since the purpose of the foreign key is to identify a particular row of referenced table, it is generally required that the foreign key is equal to the candidate key in some row of the primary table, or else have no value (the NULL value. ). Beyond.

Neighborhood in Abstraction Space

Foreign key sits in a crowded region of the domain-specific corpus (38th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Unclustered & Miscellaneous (2551 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-08