Compound key

Compound key

In database design, a compound key is a key that consists of 2 or more attributes that uniquely identify an entity occurrence. Each attribute that makes up the compound key is a simple key in its own right.

This is often confused with a composite key whereby even though this is also a key that consists of 2 or more attributes that uniquely identify an entity occurrence, at least one attribute that makes up the composite key is not a simple key in its own right.

An example might be an entity that represents the modules each student is attending at University. The entity has a studentId and a moduleCode as its primary key. Each of the attributes that make up the primary key are simple keys because each represents a unique reference when identifying a student in one instance and a module in the other.

In contrast, using the same example, imagine we identified a student by their firstName + lastName. In our table representing students on modules our primary key would now be firstName + lastName + moduleCode. Because firstName + lastName represent a unique reference to a student, it is not a simple key, it is a combination of attributes used to uniquely identify a student. Therefore the primary key for this entity is a composite key.

No restriction is applied to the attributes regarding their (initial) ownership within the data model. This means that any one, none, or all, of the multiple attributes within the compound key can be foreign keys. Indeed, a foreign key may itself be a compound key.

Compound keys almost always originate from attributive or associative entities (tables) within the model, but this is not an absolute.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Compound term processing — is the name that is used for a category of techniques in Information retrieval applications that performs matching on the basis of compound terms. Compound terms are built by combining two (or more) simple terms, for example triple is a single… …   Wikipedia

  • Compound TCP — (CTCP) is a Microsoft algorithm that was introduced as part of the Windows Vista and Window Server 2008 TCP stack. It is designed to aggressively adjust the sender s congestion window to optimise TCP for connections with large bandwidth delay… …   Wikipedia

  • Compound lever — Nail clippers are a simple form of compound lever The compound lever is a simple machine operating on the premise that the resistance from one lever in a system of levers will act as power for the next, and thus the applied force will be… …   Wikipedia

  • Key Biscayne, Florida — Infobox Settlement official name = Village of Key Biscayne other name = native name = nickname = settlement type = Village motto = imagesize = image caption = flag size = image seal size = image shield = shield size = image blank emblem = blank… …   Wikipedia

  • Compound screw — Screw Screw (skr[udd]), n. [OE. scrue, OF. escroue, escroe, female screw, F. [ e]crou, L. scrobis a ditch, trench, in LL., the hole made by swine in rooting; cf. D. schroef a screw, G. schraube, Icel. skr[=u]fa.] 1. A cylinder, or a cylindrical… …   The Collaborative International Dictionary of English

  • Compound (migrant labour) — A migrant worker compound is a key institution in a system such as that which regulated labour on mines in South Africa from the later nineteenth century. The tightly controlled closed compound which came to typify the phenomenon in that country… …   Wikipedia

  • compound bitted key —   n.    a key with at least one compound cut …   Locksmith dictionary

  • compound stop — noun : an organ stop having more than one pipe or reed to each key …   Useful english dictionary

  • Surrogate key — A surrogate key in a database is a unique identifier for either an entity in the modeled world or an object in the database. The surrogate key is not derived from application data. Definition Two definitions of a surrogate appear in the… …   Wikipedia

  • Foreign key — In the context of relational databases, a foreign key is a referential constraint between two tables. [ [http://www.visualcase.com/kbase/database basics foreign keys.htm For a simpler visualization, see VisualCase.com] ] The foreign key… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”