What are the advantages and disadvantages of primary key and foreign key in SQL?

Showing Answers 1 - 3 of 3 Answers


  • Jul 6th, 2006

Primary key


  1) It is a unique key on which all the other candidate keys are functionally dependent


1) There can be more than one keys on which all the other attributes are dependent on.

Foreign Key


1)It allows refrencing another table using the primary key for the other table

  Was this answer useful?  Yes


On primary key index will be created so during updation of table index need to be adjusted accordingly. this process makes the updation slower.

  Was this answer useful?  Yes


  • Sep 9th, 2016

Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables. It is also known as referential integrity.
Foreign Key is a field in database table that is Primary key in another table. It can accept multiple null, duplicate values. We can have more than one foreign key in a table.
Foreign key do not automatically create an index, clustered or non-clustered. You can manually create an index on foreign key.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions