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 does varchar include?

514


What is rank dense_rank and partition in sql?

531


How sql query is executed?

547


What is a natural join sql?

507


What is t sql in sql server?

563






What are the types of triggers in sql?

489


How do I audit the sql sent to the server?

517


Is microsoft sql free?

591


Explain normalization and what are the advantages of it?

514


What is AUTH_ID and AUTH_USER in pl/sql ?

1681


How can you create an empty table from an existing table?

588


How can we solve sql error: ora-00904: invalid identifier?

691


What is a trigger in sql?

632


what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

552


Is natural join and inner join same?

485