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
How do I setup a database connection?
Difference between sql and mysql?
What is database collection?
How does database replication work?
How is image stored in database?
What is difference between clustered, non-clustered and unique index?
What is the role of tester in discovery(in Checklist)?
How heap is implemented in database?
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
Is redis in memory database?
What are different types of resources?
Why merge statement is used inside the database?
Which is the best graph database?
What is a Database?
There are three servers are run by Oracle, MS Access and .Net. What are the procedure fetching the values of two variables from two servers among these?