What is foreign key?
In relational databases, a foreign key is a field in a relational table that matches the primary key column of another table. The foreign key can be used to cross-reference tables. The columns in the referencing table must be the primary key or other candidate keys in the referenced table. The values in one row of the referencing columns must occur in a single row in the referenced table. Thus, a row in the referencing table cannot contain values that don't exist in the referenced table (except potentially NULL). This way references can be made to link information together and it is an essential part of database normalization. Multiple rows in the referencing table may refer to the same row in the referenced table. Most of the time, it reflects the master table, or referenced table to child table, or referencing table relationship.
A table can be used multiple foreign keys, and each foreign key can have a different referenced table. Each foreign key is enforced independently by the database system. Therefore, cascading relationships between tables can be established using foreign keys. Improper foreign key/primary key relationships or not enforcing those relationships are often the sources of many database and data modeling problems.
Defining Foreign Keys:

Tags: foreign key relational database rows table
Readers also visit these:
What is data, database (DB), DBMS and DBS?Which license is best for me?
What is data backup and data recovery?
What is view (database)?
How can I get technical support?
Related Questions:
What is Database Integrity?What is primary key and unique key?
What is data, database (DB), DBMS and DBS?
What is role?
Technical Support
Latest News
- How to connect to SQ...
- How to install Datab...
- How to remove SQL Se...
- How to compare and s...
- How many database ob...
- How to compare and s...
Awards
Customer Service |
| If you have any question or suggestion,please contact us. |
| Get Help>> |
:
: 

