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

Answer Posted / kiran chandra sarkar

PRIMARY KEY: A table can contain 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. It’s allowing 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 ?    92 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain alternate key?

636


Is it good to store images in database?

541


Explain entity set?

575


What is the importance of database partitioning?

599


What does specialization in DBMS mean?

634






Two tables emp(empid,name,deptid,sal) and dept(deptid,deptname) are there.write a query which displays empname,corresponding deptname also display those employee names who donot belong to any dept.

1372


What is database bounce?

579


Can you tell any two advantages of stored procedures?

584


What is a sequence? Explain it with one example?

638


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

592


What is ole db used for?

574


HOW PASS PARAMETERS FOLLOWING ORDER RPG-CL-RPG?

1969


What is a Transformation?

555


Explain entity type?

623


Given a table of Player which contains Sno and player name, write a query which finds all possible Table Tennis doubles pairings.

917