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
Is data lake a database?
What is ole db ado?
can i use the commands "modify" and Change in DB2 to alter my column datatype and its name in a table?
What are the disadvantages of views in a database?
What is relational database with example?
What is a sequence? Explain it with one example?
what is transaction state, buffer management, shadow paging
What does currency type mean in database?
What is the difference between specialization and generalization?
what are wrappers and build ups and what it's use?
Display the employees whose salary is less than average salary.
What is lagging in DBMS ?
Explain database partitioning. What is its importance?
What is database client?
What is difference between clustered, non-clustered and unique index?