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

What is the use of file param in imp command?

1117


How to define an anonymous procedure with variables?

1065


How to load a large xml file?

1005


how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?

2291


what is IDE,DMV in sql server?

2754


What are the ways tablespaces can be managed and how do they differ?

2274


What is difference between sid and service name in oracle?

906


What is the difference difference between $ORACLE_HOME and $ORACLE_BASE.

1058


How to view the data files in the current database?

1045


How to turn on or off recycle bin for the instance?

1012


What are the benefits of ordbms?

1024


What is a read only transaction in oracle?

973


What is an Oracle Instance?

1073


How do I connect to oracle?

977


how to join query for one source type is oracle another source type is sql server ?

2379