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

Answer Posted / subin

PRIMARY KEY - is a constraint(restriction) placed on one or a group of more than one columns of a table by the database admin (who does so while creating the table) that the value(s) of this column(s) will never be duplicate ensuring that every record(row) of the table is a unique one.
# There can only be a single primary key for a table. Hence the name primary key.
# This is the key used by foreign keys of other tables
to identify a unique record of this table.
# null value cannot be given to columns of primary key as
it will not ensure uniqueness of the record.


UNIQUE KEY - is a constraint on one or group of columns that
disallows duplication of records. It differs from primary key in that
# no restrictions to number of unique keys for a table.
# depending on different database software being used
one or many records can have null values.


FOREIGN KEY - constraint placed on certain column(s) of a table ensuring that the set of value(s) in theese column(s) will uniquely identify a record in a mentioned foreign table (mentioned while defining foreign key)that should be aptly associated with this record of this table.This is achieved with the help of primary key of the foreign table.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is ole db used for?

580


Write a query to retrieve for many to many relationships?

565


What is the relationship that exists inside in E-R diagram?

633


What are the disadvantages of views in a database?

538


how to configure oracle 10g in java1.5 and tell me know how to set class path in system?

1582






Which is the most reliable programming language for RDBMS Relational Database Management System for Multi user applicaton. For PC application or web application ?

2028


what is ad-hoc access? what is the diff b/w managed query and ad-hoc access?

1883


Explain buffer manager?

553


How to implement database security?

535


What is the Lock Based Protocol used for?

638


How concurrency problems effect the database?

631


how to reject duplicates in source sequential file and if by filter option then where is that filter option in the sequential file.

1105


What is a database string?

521


Explain database partitioning.

634


please tell me the informatica telecom projects interview question? like if they ask about project explanation and the difficulties and the solutions taken to solve the issues for telecom projects,e.g i am workin for a vodafone project handlin postpaid section,pls tell me wat wud be the process if i work in this ? thanks

8018