What is the difference between the Primary and Foreign key?

Answer Posted / nitin

Primary key uniquely identified a record in a table and dont have null values. Also when we create primary key an index is automatically created for primary key.
On the other hand foreign key is used for referential integrity, foreign key can points to primary key in other table and moreover index is not created for foreign key.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is flag in sql?

539


Explain select statements in sql?

584


What are the qualities of 2nf?

541


Why we use stored procedure instead of query?

533


What is a ddl command?

532






Are views faster than queries?

539


What is data definition language?

619


What is the use of procedures?

539


What are system versioned tables?

549


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

502


Which version of sql do I have?

558


How do you bind variables in pl sql?

578


Which sorts rows in sql?

585


how would you enter characters as hex numbers? : Sql dba

516


what are numeric data types? : Sql dba

574