What is the difference between the Primary and Foreign key?

Answer Posted / dhirendra

Primary Key: This is a constraint which is always unique &
not null.

Foreign Key: This is a constraint which is just opposite to
Primary key. It can be not Null & can accept duplicate value
as well. Foreign key points to same table's primary key or
another table's primary key to make a relationship.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between truncate and drop statements?

564


How do I enable sql encryption?

507


How do you write a subquery?

507


explain normalization concept? : Sql dba

571


what is a unique key ? : Sql dba

531






what is data manipulation language? : Sql dba

517


what are local and global variables and their differences? : Sql dba

521


What is the source code of a program?

495


what are all different types of collation sensitivity? : Sql dba

512


What is a variable in sql?

503


Does execute immediate commit?

679


what are the different tables present in mysql? : Sql dba

491


explain what is mysql? : Sql dba

580


What is sql architecture?

550


What are the properties of a transaction?

543