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
What if we write return in procedure?
What is output spooling in sql*plus?
When do we use triggers?
Which is faster subquery or join?
Why is there a need for sqlcode and sqlerrm variables?
what is data integrity? : Sql dba
What is offset and limit in sql?
What is rollback?
What is meant by truncate in sql?
What is primary key secondary key alternate key candidate key?
how to use 'mysql' to run sql statements? : Sql dba
How can you fetch common records from two tables?
What is a scalar value in sql?
What is execution plan in sql?
what is sql profiler? : Sql dba