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
i have a question here... As of my knowledge, when we apply an index (b-tree)on a column, internally it arranges the data in b-tree format and do the fetching process correspondingly... and my quetion is... How a bit-map index arranges the data internally when applied on a column?IS it in b-tree format or whatelse?
What is concurrency in oracle?
What is a table index?
What is a directory object?
How to insert a new row into a table in oracle?
can anyody please send me the dump for Oracle 10g certifications for DBA path?
What is meant by raw datatype?
What are the common oracle dba tasks?
What is the use of oracle?
How to create a temporary table in oracle?
How to create a server parameter file?
What is an oracle user account?
How to find the duplicate rows count from employees table in oracle?
What is a data lock in oracle?
What is sharded cluster?