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
What is the use of default key?
Differentiate between delete and truncate table?
How does database replication work?
i applied prompt on country when i run report it shows list of all countries but want it to show only four countries name
Data structure used to implements a menu:
How to do performance tunning a database in DB2 V8.2 UDB in linux
What is global database name?
What is a database connection string?
What is the purpose of firebase?
WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?
Explain the field term used in database.
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
After normalization, what are the conditions which have to keep in mind to de-normalize it?
How to do Stored procedure testing? Who does this testing (Developer or tester)?
What are the advantages of views in a database?