Key

Why Trust Techopedia

What Does Key Mean?

A key is a field, or combination of fields, in a database table used to retrieve and sort rows in the table based on certain requirements. Keys are defined to speed up access to data and, in many cases, to create links between different tables.

Advertisements

Techopedia Explains Key

Relational databases mostly involve primary and foreign keys. While primary keys enforce entity integrity and hold unique values, foreign keys maintain referential integrity, creating an association between two tables.

A primary key is an attribute (or group of attributes) that is unique for each row in a database table. To qualify as a primary key, a field should not have null values and should be unique for each row. These values must not change or become null during the entire life of the database table. Primary keys with two or more attributes are referred to as composite keys. A surrogate primary key has no descriptive values, while a substitute primary key has descriptive values. A foreign key is a column or a group of columns in a database table that enforces links between data in two tables. It acts as a cross-reference between two tables because it references the primary key of another table, and thus establishing a link between the two.

Advertisements

Related Terms

Margaret Rouse
Technology Expert
Margaret Rouse
Technology Expert

Margaret é uma premiada redatora e professora conhecida por sua habilidade de explicar assuntos técnicos complexos para um público empresarial não técnico. Nos últimos vinte anos, suas definições de TI foram publicadas pela Que em uma enciclopédia de termos tecnológicos e citadas em artigos do New York Times, Time Magazine, USA Today, ZDNet, PC Magazine e Discovery Magazine. Ela ingressou na Techopedia em 2011. A ideia de Margaret de um dia divertido é ajudar os profissionais de TI e de negócios a aprenderem a falar os idiomas altamente especializados uns dos outros.