what is the difference between primary key & foreign key?
Answer Posted / raffi.shaik
Primary key is unique
primary key is not NULL and
foreign key is NULL
foreign key reference as Primary key in another table
Primary key is unique key but foreign key always refers to
primary key
primary key is used to identify a row and it does not allow
null values. It avoids duplication of rows.
whereas foreign key refers to a column or combination of
columns included in the definition of referential integrity.
In the context of relational databases, a foreign key is a
referential constraint between two tables.[1] The foreign
key identifies a column or a set of columns in one
(referencing) table that refers to a column or set of
columns in another (referenced) table. The columns in the
referencing table must form a primary key or unique key.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of file param in imp command?
How to define an anonymous procedure with variables?
How to load a large xml file?
how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?
what is IDE,DMV in sql server?
What are the ways tablespaces can be managed and how do they differ?
What is difference between sid and service name in oracle?
What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.
How to view the data files in the current database?
How to turn on or off recycle bin for the instance?
What are the benefits of ordbms?
What is a read only transaction in oracle?
What is an Oracle Instance?
How do I connect to oracle?
how to join query for one source type is oracle another source type is sql server ?