Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Foreign Key in RDBMS
A Foreign Key creates a link between tables. It references the primary key in another table and links it.
For example, the DeptID in the Employee table is a foreign key −
| EmpID |
EmpName |
EmpAge |
DeptID |
| DeptID |
DeptName |
DeptZone |
The DeptID in the Department table is a Primary Key in the Department Table.
The DeptID in the Employee table is a Foreign Key in the Employee Table.
The below figure represents the same −

Above, you can see our two tables. The Foreign Key of the Employee table is the Primary Key of the Department table.
Advertisements
