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 / sandeep beniwal (master)

Primary key:- Primary key means main key. A primary key is
one which uniquely identifies of a table. Prrimay key does
not allow null values and duplicate values.
e.g:
empno empname status
10 dipender active
20 nisha inactive
30 vikas active
40 naveen active
Pimary key not like this:
10 dipender active
20 nisha inactive
30 vikas active
naveen active ........ (duplicate value)

Unique key:-A unique is one which uniquely identifies a row
of a table, but there is a difference like it will allow
only one duplicate values (In sql).

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 and helps making link

e.g
employee_table user_table
empID empname status userID userID empname
10 dipender active 1 1 dipender
20 nisha inactive 2 2 nisha
30 vikas active 3 3 vikas
40 naveen active 4 4 naveen

In the above relation, userID is there in employee_table
which
is a primary key of user_table. that means, userID is
refering the user_table.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best database software for small businesses?

882


What is ole db source in ssis?

964


hai if any one having any project sample table structure please froward to my mail id tauseefwst@yahoo.com

2347


What is database schema name?

1005


Which Statement would you use to remove the EMPLOYEE_Id_PK PRIMARY KEY constraint and all depending constraints from the EMPLOYEE table?

1083


How to shrink a database?

945


What is a driver in database?

1091


what is tkprof tool and how it is used???

2797


can we delete autodiff back up that we have set through sql server agent.

2167


List the properties of a transaction.

1022


What the various ways to tune a teradata query

3238


i have windows-xp processor with P4 system. whenever I tried to download foxpro for windows 2.6 on windows XP, my operating system failed to install foxpro for windows 2.6.please. how could i download , install & run foxpro for windows 2.6 easily on windows XP ?

2001


You are creating a Index on EMPNO column in the EMPLOYEE table. Which statement will you use?

1191


What is table scan and index scan?

1088


give a simple example of physical and logical data independence

2507