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 disadvantages of not performing database normalization?
How do I view stored procedures?
What does 0 mean in sql?
How do you bind variables in pl sql?
How do you define a foreign key?
Explain the insert into statements in sql?
Which is better varchar or nvarchar?
What is a variable in sql?
Is it possible to include an insert statement on the same table to which the trigger is assigned?
How can a function retun more than one value in oracle with proper example?
What is data control language?
how to fetch alternate records from a table? : Sql dba
What is the difference between joins?
Why we use join in sql?
What is nosql example?