- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
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.
- Composite Key in RDBMS
- Secondary Key in RDBMS
- Super Key in RDBMS
- Surrogate Key in RDBMS
- Candidate Key in RDBMS
- Alternate Key in RDBMS
- Unique Key in RDBMS
- Difference between Primary key and Foreign key in Database
- Difference Between Primary key and Foreign key in DBMS
- MySQL Syntax to create Foreign Key?
- Difference between Primary key and Foreign key in SQL Database
- Foreign key referencing of two DB2 tables
- How to identify foreign key in MySQL DB?
- Get a list of Foreign Key constraints in MySQL
- How can we assign FOREIGN KEY constraint on multiple columns?