what is the difference between primary key and foreign key?

Answer Posted / gaytriom

A primary key is a column which uniquely identifies the
records in a table. In a broad sense, a primary key is the
mixture of a unique key and an index: A collumn with a primary
key is indexed to deliver a faster query, and doesn't allow
duplicate values to ensure specific data.

A foreign key is a column (the child collumn) in a table which
has a corresponding relationship and a dependency on another
collumn (the parent collumn) that is usually in a different
table. Parent collumns can have multiple child collumns, but a
child collumn can only have one parent collumn.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is global asax is used for?

522


What is round trip in asp.net?

515


What is application in asp net?

498


What is difference cookie and session?

532


What is server side routing?

511






What is the size of Get method and how much data it can store?

577


Explain how can we inherit a static member?

534


What is the difference between trace and debug in asp.net?

628


What is ipostback?

605


Explain the advantages of asp.net.

546


Where the cookie value is stored?

513


What are client activated objects and server activated objects?

523


What is connection pooling and how to enable and disable connection pooling?

488


How long do session variables last?

535


What is the difference between CC and BCC?

620