Difference between a Foreign key and Primary key

Foreign Key

Primary Key

1. A foreign key can refer to

its own relation .

2. One or more Foreign key

can be treated in Parent

table .

3. Foreign key constraints

can be defined at the

column or table constraint

level .

1. The Primary key clause speci-

-fies one or more attributes that

make up primary key of a

relation .

2. One Primary key can be treated

for each table .

3. Primary key constraint is a

column or set of columns that

uniquely identifies each row in

in a table .

Be the first to comment on "Difference between a Foreign key and Primary key"

Leave a comment

Your email address will not be published.


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