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.....

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.