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

What is difference between server and database?

570


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

1639


Explain file manager?

617


What is the difference between data source and database?

548


What is the Difference Primary key and Unique Key

577






issues involved in modeling and building data werahouses

1559


What is the concept of Virtual field?

1622


What does currency type mean in database?

720


What is sharded database?

509


Write a query to retrieve for many to many relationships?

576


How do I manually create a database?

567


Differentiate between delete and truncate table?

633


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

2375


What is the importance of database partitioning?

612


Explain the record term used in database.

666