what is primary key,unique key, foreign key? can u teach me
in simple language?

Answer Posted / nitin bisht

PRIMARY KEY: A tabLe can aontain only one PRIMARY KEY. It
Doesn't allow null values, it is used as Foreign Key In
Another Table(like Reference Key).

UNIQUE KEY: A Table may Contain one or more UNIQUE
constraints. Its aloow only one null value . Use this key We
maintain unique vales in the table.

FOREIGN KEY: A key used in one table to represent the value
of a primary key in a related table. While primary keys must
contain unique values, foreign keys may have duplicates. For
instance, if we use student ID as the primary key in a
Students table (each student has a unique ID), we could use
student ID as a foreign key in a Courses table: as each
student may do more than one course, the student ID field in
the Courses table (often shortened to Courses.student ID)
will hold duplicate values.

Is This Answer Correct ?    123 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many indexes can be created on a table?

792


Explain natural key?

797


What are the concurrency problems a database faces?

739


where can i free download sqlserver2008..i can install sqlserver2008 without visual studio 2008 and work on it

1824


What is the relationship that exists inside in E-R diagram?

799






How to fetch/retrieve the data from hieranchical database and put it into the relational database? for e.g I want to extract the data from IMS DB2 database which is a hierarchical db and load that data into the relational database which is a SQL server.Are there any tools available for directing extracting data from hierarchical db and loading into the relational database (SQL server)?

1648


What are the disadvantages of views in a database?

705


What is ole db in ssis?

788


wHat Is THE difference between MOVEL and MOVEL(P)……….. CAN ANYONE EXPLAIN ME..

2717


Hi, I want do a course in DWH Informatica Administrator and Abinito Administrator please tell me some institute in chennai and i am searching for a job,so please help me and my mail id : satty_rh@yahoo.co.in Thanks, Kumar

1742


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

794


What will happen non-clustered index will be created on clustered index?

789


How to do Data integrity testing? Who does this testing (Developer or tester)?

1780


Design an ETL process( batch job/script)from source to starting that u will not be dependent on the source in the near future?please elobarate details on what are things to consider.if you'd like to do a diagram that will be great.please answer it

2019


What are the types of joins?

795