0 like 0 dislike
asked in Computer Science by (474k points)
Differentiate between primary and secondary key.

1 Answer

0 like 0 dislike
answered by (474k points)
A primary key is a unique identifier for a discrete object on a table, and a secondary key provides a second reference point for objects whose primary keys do not adequately distinguish them for reference purposes. The two are vital to the functions of databases, list tables and other archival tools.

There are several examples of primary keys, including:

Unique last name

Social Security number

Online username

These keys allow for the unique treatment of objects on a table by search algorithms and other programs as well as by human reference searches. Without strong primary keys, objects could be mislabeled as identical or databases rendered impossible to search effectively. Strings of unique numbers generated inside a predetermined numerical set are the most common primary keys, and they are used by everyone from insurance providers to reference librarians.

Examples of secondary keys include:

Street address number

Phone number

Middle name

In the event that a primary key is not enough to distinguish an object, a secondary key can be used to render that object unique. It is processed and sorted in relation to a primary key, clarifying search terms so that only desired results appear when a table is consulted. This creates clearer, cleaner databases.

Some keys, called foreign keys, are objects on a given table that function as keys to entire additional tables. These keys are used in concert with primary keys to streamline database size and store relevant information without redundancy. A strong understanding of keys is the first step to creating a usable table.
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:

10.2k questions

9.2k answers


3.2k users


Free Hit Counters