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 can you perform lookup range in lookup stage expalin in detail?

1731


WHAT IS CARDINALITIES OF JOIN?

2160


What is relational database with example?

741


how do you do sql tuning?

1876


Is redis in memory database?

764


Display the employees whose salary is less than average salary.

859


what is transaction state, buffer management, shadow paging

3170


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

2170


What is a reference table in database?

790


What is a driver in database?

842


What are different types of blocks used in stored procedure?

879


can any one tell me how i can start database testing mean what should be initial point and how i can write a query for listing page of any item thanks in advance

2335


Which database does facebook use?

761


What is the difference between specialization and generalization?

815


Why merge statement is used inside the database?

881