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
Difference between sql and mysql?
Explain the various types of normalization.
Explain normalization in one line?
What is Object Oriented model?
WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?
Explain artificial key?
if i want to display the name of students such that to which city they belong must have count greaer than two
What is the difference between a stored procedure and a query?
issues involved in modeling and building data werahouses
How to shrink a database?
How many indexes can be created on a table?
what is rcp,if rcp disabled what happen?
What are the types of joins?
What is a super key?
What is difference between data and database?