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
How many types of indexes are there in sql?
Are stored procedures faster than queries?
Can we join more than 2 tables in sql?
Is sql considered coding?
Write the alter statement to enable all the triggers on the t.students table.
What is the use of sql trace?
what is self-join? : Sql dba
What is primary key and unique key?
which types of join is used in sql widely? : Sql dba
What are the operators used in select statements?
how many values can the set function of mysql take? : Sql dba
What is sql exception?
What are the sql commands?
how to show all tables with 'mysql'? : Sql dba
Does execute immediate commit?