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 the role of tester in discovery(in Checklist)?

1673


What is difference between server and database?

773


Can you tell any two advantages of stored procedures?

809


What are the advantages of normalizing a database.

816


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

1137


What is sharded database?

716


First input columns brand, mt, re values are ov, 1,re vg, 2,re wu ,3,re. Second input columns are brand, mt, cx their records are ov,4,vg ,5,cx Wu, 6,cx and third input columns brand, mt, rt values are ov,7,rt vg, 8,rt wu, 9,rt but my output is brand, re, cx,rt values are ov, 1,4,7 vg, 2,5,8 wu, 3,6,9

1509


List various types of log-based recovery in DBMS.

759


what is the role of auditor in auditing data oriented applications?

2158


Explain entity set?

774


5. Explain about relational algebra.

1928


What are the tools used for backup and ticketing?

767


What are different types of resources?

747


WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?

2025


What is lagging in DBMS ?

1038