what is primary key,unique key, foreign key? can u teach me
in simple language?
Answer Posted / nitin bisht
PRIMARY KEY: A tabLe can aontain 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. Its aloow 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 ? | 123 Yes | 43 No |
Post New Answer View All Answers
Two tables emp(empid,name,deptid,sal) and dept(deptid,deptname) are there.write a query which displays empname,corresponding deptname also display those employee names who donot belong to any dept.
Why do we need distributed database?
Explain artificial key?
What is odm database?
what is rcp,if rcp disabled what happen?
How does non-cluster index functions?
Differentiate between unique key and foreign key?
Write a query to get maximum and second maximum in oracle?
How does database replication work?
What is the difference between primary key, foreign key and candidate key?
What is replicaset?
What is relational database with example?
how to configure oracle 10g in java1.5 and tell me know how to set class path in system?
how can you perform lookup range in lookup stage expalin in detail?
Given a table Employee which has columns name and salary, write an SQL query to find the employee with the second highest salary.