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 primary key,unique key, foreign key? can u teach me
in simple language?

Answer Posted / rajesh

Primary key - Primary key means main key
def:- A primary key is one which uniquely identifies a row
of a table. this key does not allow null values and also
does not allow duplicate values. for ex,
empno empname salary
1 firoz 35000
2 basha 34000
3 chintoo 40000

it will not the values as follows:
1 firoz 35000
1 basha 34000
chintoo 35000

Unique key - single and main key
A unique is one which uniquely identifies a row
of a table, but there is a difference like it will not
allow duplicate values and it will any number of allow
null values(In oracle).
it allows only a single null value(In sql server 2000)

Both will function in a similar way but a slight difference
will be there. So, decalaring it as a primary key is the
best one.

foreign key - a foreign key is one which will refer to a
primary key of another table

for ex,
emp_table dept_table
empno empname salary deptno deptno deptname

In the above relation, deptno is there in emp_table which
is a primary key of dept_table. that means, deptno is
refering the dept_table.

Is This Answer Correct ?    19 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the concept of Virtual field?

2099


Explain the various types of normalization.

1128


Is redis in memory database?

1055


query to Compare data of two tables between two different Databases(Oracle and SQL Server) Eg., Source Database: Oracle Table: Employee Target Database : SQL Server Table : emp

2127


What is database collection?

1053


What is Object Oriented model?

1075


What are the most common databases?

1018


Explain the table term used in database.

1084


Difference between sql and mysql?

2140


Give the syntax of exception handling used in DBMS?

1240


HOW PASS PARAMETERS FOLLOWING ORDER RPG-CL-RPG?

2507


Write a query to get maximum and second maximum in oracle?

1099


What is a database connection string?

1172


Explain database partitioning. What is its importance?

1255


what are wrappers and build ups and what it's use?

2213