0 like 0 dislike
29 views
in Computer Science by (1.0m points)
What is a key? Describe different types of keys used in database?

1 Answer

0 like 0 dislike
by (1.0m points)
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.

Related questions

0 like 0 dislike
1 answer 26 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
0 answers 25 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 118 views
0 like 0 dislike
1 answer 24 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 41 views
0 like 0 dislike
1 answer 184 views
0 like 0 dislike
1 answer 180 views
0 like 0 dislike
1 answer 39 views
0 like 0 dislike
1 answer 43 views
0 like 0 dislike
0 answers 21 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...