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

Explain the uses of a database trigger?

569


How do I view an execution plan in sql?

529


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

551


Why is normalization important?

539


how can we repair a mysql table? : Sql dba

540






What is an index in sql with example?

517


What is clustered and nonclustered index in sql?

500


What are the two virtual tables available at the time of database trigger execution?

640


How long does it take to learn pl sql?

606


What is a left join?

511


What are the types of triggers in sql?

498


What is the maximum size of sqlite database?

548


What are reports usually used for?

566


how to include comments in sql statements? : Sql dba

546


What is the use of sql trace?

479