Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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?

1946


What is concurrency in oracle?

1005


What is a table index?

1093


What is a directory object?

1095


How to insert a new row into a table in oracle?

1157


can anyody please send me the dump for Oracle 10g certifications for DBA path?

2119


What is meant by raw datatype?

1056


What are the common oracle dba tasks?

1141


What is the use of oracle?

1027


How to create a temporary table in oracle?

1267


How to create a server parameter file?

1133


What is an oracle user account?

986


How to find the duplicate rows count from employees table in oracle?

1084


What is a data lock in oracle?

1111


What is sharded cluster?

1008