What is the difference between Primary key and Foreign key?

Primary key:

  • It Identifies each and every record uniquely
  • We can create only one Primary key on a table
  • Primary keys do not accept NULL values
  • It creates a clustered index in the table by default

Foreign key:

  • It makes the relation between two tables by pointing a foreign key of one table to the primary key of another table
  • We can create more than one Foreign keys on a table
  • Foreign keys accept NULL values
  • It does not create any Index by default

Happy Reading :)

Latest Comments
  1. nike air max 90

    Hurrah, that’s what I was seeking for, what a data!
    present here at this blog, thanks admin of this web page.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.