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

describe mysql connection using mysql binary. : Sql dba

563


What are the 3 types of behavioral triggers?

686


what is denormalization. : Sql dba

555


Can we use view in stored procedure?

521


Is postgresql a server?

581






Why stored procedure is better than query?

518


What is rollback?

595


What are the benefits of stored procedures?

541


What is sqlservr exe?

484


How do you update a value in sql?

555


which command using query analyzer will give you the version of sql server and operating system? : Sql dba

533


How can you load multi line records? : aql loader

667


What are reports usually used for?

572


How can I tell if sql is running?

600


Does group by remove duplicates?

557