0

hai friend's

i am beginner in MS sql db .

so can any one explain me detail about Foreign key and primary key ,

please give example also ,

thank;s in advance.....

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by ProfessorPC
0

Primary key is the unique identifier of a row of data. like:
table Dogs:
dogid=1(pk)unique
dogname=spot
dogbreadid=5(fk)
age=3

dogid is the dog spots unique identifier in the db. dogbreadid is the foreign key. this links the dog to the bread table.
table bread
breadid=5(PK)unique identifier
breadname=Chihuahua

this lets you know that spot is a Chihuahua.
does this help you any?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.