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 difference between foreign key and reference key

Answer Posted / suresh kumar

Hi, i give the definitions with easy understand exapmles

A primary key is used to uniquely identify each row in a
table. It can either be part of the actual record itself,
or it can be an artificial field (one that has nothing to
do with the actual record).
A primary key can consist of one or more fields on a table.
When multiple fields are used as a primary key, they are
called a composite key.

EX:If we take EMP table, Empno is the primary key and in
DEPT table, Deptno is the primary keys

A foreign key is a field (or fields) that points to the
primary key of another table.
The purpose of the foreign key is to ensure referential
integrity of the data.
In other words, only values that are supposed to appear in
the database are permitted

EX:In EMP table Deptno field is the foreign key because it
pointing to the Deptno in DEPT table

A Reference key is a field (or fields) that points to the
primary key of the same table

EX:In EMP table Mgr field is the Reference key because it
pointing to the Empno field in the same table

Is This Answer Correct ?    64 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to commit the current transaction in oracle?

1104


What are the numeric comparison operations?

1104


20. Using a set operator, display the client number of all clients who have never placed an order.

2178


Please explain oracle data types with examples?

1057


How to view all columns in an existing table?

930


Describe varray?

1052


What is the difference between 10g OEM and 11g OEM?

962


how can db_files > maxdatafiles since db_files is for instance and the later is for database

2614


Is the After report trigger fired if the report execution fails ?

2906


How to retrieve the count of updated rows?

1119


What is difference between cartesian join and cross join?

1080


What is instant client oracle?

1017


What happens if the update subquery returns multiple rows?

1108


What are the advantages of oracle?

1022


In Oracle Clinical 4.5.0, can the VIEW_TEMPLATE_ID column in DATA_EXTRACT_VIEWS table contain NULL value?

2330