This Question Is Answered:
 What is a key? Describe different types of keys used in database?
 23 May 2007 05:39
 Flag
 Key
A key is a single or combination of multiple fields. Its purpose is to access or retrieve data rows from table according to the requirement. The keys are defined in tables to access or sequence the stored data quickly and smoothly. They are also used to create links between different tables.

Types of Keys
The following tables or relations will be used to define different types of keys.

Primary Key
The attribute or combination of attributes that uniquely identifies a row or record in a relation is known as primary key.

Secondary key
A field or combination of fields that is basis for retrieval is known as secondary key. Secondary key is a non-unique field. One secondary key value may refer to many records.

Candidate Key or Alternate key
A relation can have only one primary key. It may contain many fields or combination of fields that can be used as primary key. One field or combination of fields is used as primary key. The fields or combination of fields that are not used as primary key are known as candidate key or alternate key.
Composite key or concatenate key
A primary key that consists of two or more attributes is known as composite key.

Sort Or control key
A field or combination of fields that is used to physically sequence the stored data called sort key. It is also known s control key.

Foreign Key
A foreign key is an attribute or combination of attribute in a relation whose value match a primary key in another relation. The table in which foreign key is created is called as dependent table. The table to which foreign key is refers is known as parent table.
Unrated

1 ratings
  23 May 2007 06:01
 Flag

1000 words left

    


 The term key used in database has vital importance. It is the one of the unique record in Database with the help of which we can identify the other records, let have an example to understand.

Suppose we are making database for school in which every class should have record. Now to identify one student from another student they are assign the roll number or unique number and every student has different roll number from another student, here roll number is acting like a key, if we transform this information into the database than roll number would be primary key (a type of key) in student table.

Basically there are six type of keys in database, but mostly frequently that are used Primary key and foreign key, I hope the concept of primary key would be clear to you, let understand foreign key, a primary key of a table which is used in another table is known as foreign key, for example let us take again the example of school, in school if want to keep the record of courses with students than in course table we will use roll number as foreign key in course table, keep in mind roll number is primary key in student table, in this way we make a relation between student table and course table, that is why it is known as Relational Database.
Unrated

0 ratings
  23 May 2007 07:38
 Flag

1000 words left

    


Blurtit Tools:  Email to a Friend    Bookmark this page
What Is Reserved Word?
What Is Data Flow
Diagram?
What Is A Table? Can You
Describe Different Types
Of Tables Used In
Database?
What Are The Importance
Of Database Management
System?
How Do I Write A Program
In C/C++ To Check A
Number Is Armstrong No Or
Not?
Hi What's The Main
Difference Between Oracle
9i & 10g ?
How do I reprogram my
remote since I lost the
book?
I Don't Have Any Idea
About SQl Database?Are
There Any Sites (videos)
Available So...
What is 'Internet Movie
Database'?
I Know That A 3-way
Switch Will Control A
Lite From 2 Switches, Can
I Add Another Lite...
My Blurtit
My Profile
My Questions
My Answers
Blurtit Features
Ask a Question
Answer a Question
Search an Answer
Categories
Tools
Link to Blurtit
Add Blurtit to Firefox
Search Engine
See Your Site Here
Link to Blurtit
RSS
Blurtit.com
About Us
Terms & Conditions
Privacy Policy
Contact Us
Advertise With Us
Help
International
 Chinese Site
 Japanese Site
To continue you need to be registered with us first.

I am already a Blurter, and need to login
I am not a Blurter yet, but would like to register