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 do I run a script in sql developer?
What is inner join in sql?
What are the different types of a subquery?
How delete a row in sql?
Define select, insert, create, delete, update, drop keywords
How many aggregate functions are available there in sql?
how to rename an existing table in mysql? : Sql dba
What are triggers in sql?
What is $$ in sql?
how do you login to mysql using unix shell? : Sql dba
What is set serveroutput on?
what is sql in mysql? : Sql dba
What is the difference between delete, truncate and drop command?
How to write html code in pl sql?
Is inner join same as self join?