what is primary key,unique key, foreign key? can u teach me
in simple language?

Answer Posted / anbarasu

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How heap is implemented in database?

644


Is data lake a database?

570


What is database server and how it works?

557


Explain the various types of normalization.

650


What is the Difference Primary key and Unique Key

581






How default key is different from primary key?

622


What is redis good for?

557


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

1935


Differentiate between unique key and foreign key?

587


What is lagging in DBMS ?

822


How do you connect to a database?

613


Which database is best to store images?

534


Write a query to get maximum and second maximum in oracle?

606


Given a table Employee which has columns name and salary, write an SQL query to find the employee with the second highest salary.

594


Display the employees whose salary is less than average salary.

647