Keys are the crucial part of DBMS they are used to identify and establish a relation between the tables in a schema. Now, today we are going to discuss two very important keys of DBMS i.e. Primary key and Foreign key, and we will also discuss the difference between primary key and foreign key. On the way let me tell you the basic difference between primary and foreign key which is primary key is one of the chosen candidate keys by database designer whereas, a foreign key is a key that refers to the primary key of another relation.
There many other differences between these two, let us identify those differences with the help of comparison chart shown below.