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 are the validations performed on the source data? If there are junk data available in the source data, how to eliminate it?
How to produce such kind of file?
Explain database partitioning.
How to shrink a database?
After normalization, what are the conditions which have to keep in mind to de-normalize it?
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
What is the difference between specialization and generalization?
A design problem was given in which I was supposed to make a design for the data base for a given problem.
What is the use of default key?
How default key is different from primary key?
Which is the best graph database?
How does database replication work?
Write a query to retrieve for many to many relationships?
sparse lookup and where its options we find in OCI and db2?
What is global database name?