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
Explain the difference between a procedure and a function? What do you understand by those terms?
How to create an oracle testing table?
What is raw datatype?
What is materialized view in Oracle?
What types of joins are used in writing subqueries?
Explain mutating triggers.
Whats the benefit of dbms_stats over analyze?
How to Truncate Table in Oracle
How to execute a stored program unit?
How to delete an existing row from a table in oracle?
How to estimate disk space needed for an export job?
How to delete multiple rows from a table in oracle?
How to assign a tablespace to a users in oracle?
What is the usage of merge statement?
1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE