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 various levels of constraints?
what is acid property in database? : Sql dba
What are system versioned tables?
What is date functions?
What are the benefits of triggers?
What is memory optimized table?
What is sql architecture?
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
How many joins can you have in sql?
What is pl sql block structure?
What is rename in sql?
Can you upgrade sql express to full sql?
Can you have more than one key in a database?
Why cannot I use bind variables in ddl/scl statements in dynamic sql?
What are sql triggers used for?