A column, or combination of columns, whose values must match those of a primary key in the same or different table A given foreign key value represents a reference from the row(s) containing it to the row containing the matching primary key value The problem of ensuring that every foreign key value does in fact match a value of the corresponding primary key is known as the referential integrity problem
When a key in one table is referenced in another table, the key in the second table is called a foreign key (In the Students_Courses table in the diagram, the fields Soc_Sec_No and Course_ID are, respectively, foreign keys into the Students and Courses tables )
An item (or items) in one object that reference information in a primary key of another object; for example, the Region item in the DEALERS object is a foreign key because it references information in the Region_Code item (a primary key) in the STATES object See also Primary Key
The primary key of another (or the same) table which is repeated in a table to represent the correlation of both tables (e g Department number in an employees table)
The primary key of one file or table which is implanted in another file or table to implement the relationships between them Foreign keys are used to implement some types of relationships Foreign keys do not exist in information models
In the context of ER diagrams, this is the field that helps an entity uniquely identify a "foreign" entity From the point of view of a corporation, the foreign key of a customer might be the customer number
An attribute in one table that is used to relate that tuple to a tuple in another table Example: a student table may contain an attribute called major code In the student table the major code is a foreign key because it allows us to relate that table to the major table where the major code is the primary key and contains the major name We could then print a list of students and their major names as a result of this foreign key/primary key relationship
A key used in one table to represent the value of a primary key in a related table While primary keys must contain unique values, foreign keys may have duplicates For instance, if we use student ID as the primary key in a Students table (each student has a unique ID), we could use student ID as a foreign key in a Courses table: as each student may do more than one course, the student ID field in the Courses table (often shortened to Courses student ID) will hold duplicate values
One or more table attributes that can uniquely identify a record in another table A foreign key is the primary key of another table Foreign key-primary key relationships define a relational join See also relate
A field in a table which links it to another related table (Customer ID might link a customer with the customer's invoice) More accurately, if field X is the primary key of table A and also appears in table B, it is a foreign key in table B
An attribute in an entity that gives it access to rows in another entity This attribute must be the primary key of the related entity For example, an Employee entity can contain the foreign key deptID, which matches the primary key in the entity Department You can then use deptID as the source attribute in Employee and as the destination attribute in Department to form a relationship between the entities See also primary key; relationship