Foreign Key SQL : Everything You Need To Know About Foreign Key Operations
What is Foreign Key constraint? A foreign key is a type of key used to link two tables in a database. So, a foreign key is an attribute or a collection of attributes in one table that refers to the primary key in another table. For Example, if Table A and Table B are related to each other, then if Table A consists of the primary key, this table would be called the referenced table or parent table. Similarly, if Table B consists of a foreign key, then that table is known as the referencing table or child table. Now that you know what is foreign key, next in this article on Foreign key SQL, let us understand the rules of the foreign key.Read More SQL Server Developer Online Training Rules for Foreign key The Rules of Foreign Key are as follows: The table with the foreign key is called the child table and the table being referenced by the foreign key is called the parent table. Null values are allowed in a foreign key Foreign keys can be duplicated There can be more than a single fo...