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 ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql server and ase?

526


what is top in tsql? : Transact sql

529


What is dialect in sql?

517


Which is better cte or subquery?

529


What is the difference between delete, truncate and drop command?

538






What are triggers in sql?

572


What are the disadvantages of not performing database normalization?

581


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

555


What is trigger types in sql?

521


what are dynamic queries in t-sql? : Transact sql

547


What is materialized view in sql?

453


What are synonyms in sql?

523


explain the options of myisamchk to improve the performance of a table. : Sql dba

533


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

530


What is sql profiling in oracle?

527