SQL Foreign Key: What is Foreign Key in SQL?

SQL Tutorial

SQL Foreign Key: What is Foreign Key in SQL?

SQL foreign key is one table which can be related to the primary key of another table. Relationship needs to be created between two tables by referencing foreign key with the primary key of another table.

Let’s say When a one table’s primary key field is added to related tables in order to create the common field which relates the two tables, it called a foreign key in other tables.Foreign Key constraints enforce referential integrity.

Nahidur Rahman Rifath

Passionate Software Engineer, Content Writer, Reader

Leave a Reply

Your email address will not be published. Required fields are marked *