What is the difference between the Primary and Foreign key?
Answer Posted / slokh
Primary key does not contain NULL or duplicate values.
whereas Foreign key accepts duplicate values but not null
values.
Primary key states the Entity integrity constraint, which
says that every row in a table is unique.
Foreign key states the referential integrity constraint,
that says that you can only insert values that is present
in the primary of the parent table.
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What are the types of sql commands?
Is it possible to sort a column using a column alias?
differentiate between float and double. : Sql dba
Can you select everything, but 1 or 2 fields, without writer's cramp?
What is date functions?
Does user triggers have entry for trigger with compilation errors?
Explain mutating table error.
what is a stored procedure? : Sql dba
what are the different type of sql's statements ? : Sql dba
What is a natural join sql?
What is sql and its types?
How do we accept inputs from user during runtime?
What are the two types of exceptions.
Explain the difference between sql and mysql.
what is the difference between cluster and non cluster index? : Sql dba