Source: Wikipedia: Superkey


From Wikipedia, the free encyclopedia
Jump to:navigation, search
This article is about the programming term. For the keyboard button, see Super key (keyboard button).
It has been suggested that this article or section be merged into unique key. (Discuss)

A superkey is defined in the relational model of database organization as a set of attributes of a relation variable (relvar) for which it holds that in all relations assigned to that variable there are no two distinct tuples (rows) that have the same values for the attributes in this set. Equivalently a superkey can also be defined as a set of attributes of a relvar upon which all attributes of the relvar are functionally dependent.

Note that if attribute set K is a superkey of relvar R, then at all times it is the case that the projection of R over K has the same cardinality as R itself.

Informally, a superkey is a set of columns within a table whose values can be used to uniquely identify a row. A candidate key is a minimal set of columns necessary to identify a row, this is also called a minimal superkey. For example, given an employee table, consisting of the columns employeeID, name, job, and departmentID, we could use the employeeID in combination with any or all other columns of this table to uniquely identify a row in the table. Examples of superkeys in this table would be {employeeID, Name}, {employeeID, Name, job}, and {employeeID, Name, job, departmentID}.

In a real database we don't need values for all of those columns to identify a row. We only need, per our example, the set {employeeID}. This is a minimal superkey – that is, a minimal set of columns that can be used to identify a single row. So, employeeID is a candidate key.
[edit] Example
English Monarchs Monarch Name Monarch Number Royal House
Edward II Plantagenet
Edward III Plantagenet
Richard II Plantagenet
Henry IV Lancaster

In this example, the possible superkeys are:

* {Monarch Name, Monarch Number} (Candidate Key)
* {Monarch Name, Monarch Number, Royal House}

[edit] External links

* Relation Database terms of reference, Keys: An overview of the different types of keys in an RDBMS

[edit] See also

* Alternate key
* Compound key
* Foreign key
* Primary key

v • d • e
Database management systems
Database models · Database normalization · Database storage · Distributed DBMS · Federated database system · Referential integrity · Relational algebra · Relational calculus · Relational database · Relational DBMS · Relational model · Object-relational database · Transaction processing
Database · ACID · CRUD · Null · Candidate key · Foreign key · Primary key · Superkey · Surrogate key · Armstrong's axioms
Relation (Table) · View · Transaction · Log · Trigger · Index · Stored procedure · Cursor · Partition
Concurrency control · Data dictionary · JDBC · ODBC · Query language · Query optimizer · Query plan
Database products: Object-oriented (comparison) · Relational (comparison) · Document-oriented

Stub icon This database-related article is a stub. You can help Wikipedia by expanding it.
v • d • e
Retrieved from ""
Categories: Database management systems | Data modeling | Database stubs
Hidden categories: Articles lacking sources from December 2009 | All articles lacking sources | Articles to be merged from August 2009 | All articles to be merged
Personal tools

* New features
* Log in / create account


* Article
* Discussion



* Read
* Edit
* View history




* Main page
* Contents
* Featured content
* Current events
* Random article


* About Wikipedia
* Community portal
* Recent changes
* Contact Wikipedia
* Donate to Wikipedia
* Help


* What links here
* Related changes
* Upload file
* Special pages
* Permanent link
* Cite this page


* Create a book
* Download as PDF
* Printable version


* 日本語
* Русский
* 中文

* This page was last modified on 25 April 2010 at 16:47.
* Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details.
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License