Selection (relational algebra)

Selection (relational algebra)

In relational algebra, a selection (sometimes called a restriction to avoid confusion with SQL's use of SELECT) is a unary operation written assigma_{a heta b}( R ) or sigma_{a heta v}( R ) where:
* a and b are attribute names
* heta is a binary operation in the set {;<, le, =, ;>, ge}
* v is a value constant
* R is a relation

The selection sigma_{a heta b}( R ) selects all those tuples in R for which heta holds between the a and the b attribute.

The selection sigma_{a heta v}( R ) selects all those tuples in R for which heta holds between the a attribute and the value v.

For an example, consider the following tables where the first table gives the relation Person, the second table gives the result of sigma_{Age ge 34}( Person ) and the third table gives the result of sigma_{Age = Weight}( Person ).

|

More formally the semantics of the selection is defined asfollows:

: sigma_{a heta b}( R ) = { t : t in R, t(a) heta t(b) }

: sigma_{a heta v}( R ) = { t : t in R, t(a) heta v }

The result of the selection is only defined if the attribute names that it mentions are in the heading of the relation that it operates upon.

In computer languages it is expected that any truth-valued expression be permitted as the selection condition rather than restricting it to be a simple comparison.

In SQL, selections are performed by using WHERE definitions in SELECT, UPDATE, and DELETE statements, but note that the selection condition can result in any of three truth values ("true", "false" and "unknown") instead of the usual two.

ee also

* Generalized selection


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Relational algebra — Not to be confused with Relation algebra. Relational algebra, an offshoot of first order logic (and of algebra of sets), deals with a set of finitary relations (see also relation (database)) that is closed under certain operators. These operators …   Wikipedia

  • Selection (disambiguation) — Selection may refer to:* Selection, in the context of biological evolution * in computer science ** Selection algorithm, an algorithm that finds the k th smallest number in a list ** Selection (genetic algorithm) ** Selection (relational algebra) …   Wikipedia

  • Relational database — A visual diagram showing the relationship between the two tables, as indicated by the arrow A relational database matches data by using common characteristics found within the data set. The resulting groups of data uses the relational model (a… …   Wikipedia

  • Relational Database Management System — Eine relationale Datenbank dient zur elektronischen Datenverwaltung in Computersystemen und beruht auf dem relationalen Datenbankmodell. Dieses wurde 1970 von Edgar F. Codd erstmals vorgeschlagen und ist bis heute, trotz einiger Kritikpunkte, ein …   Deutsch Wikipedia

  • Relational Database Management Systems — Eine relationale Datenbank dient zur elektronischen Datenverwaltung in Computersystemen und beruht auf dem relationalen Datenbankmodell. Dieses wurde 1970 von Edgar F. Codd erstmals vorgeschlagen und ist bis heute, trotz einiger Kritikpunkte, ein …   Deutsch Wikipedia

  • Generalized selection — In relational algebra, a generalized selection is a unary operation written as sigma varphi(R) where varphi is a propositional formula that consists of atoms as allowed in the normal selection and the logical operators and (and), or (or) and lnot …   Wikipedia

  • Object-relational impedance mismatch — The object relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system (RDBMS) is being used by a program written in an object oriented programming… …   Wikipedia

  • Rete — эффективный алгоритм сопоставления с образцом для продукционных систем, экспертных систем и баз знаний , созданный Чарльзом Форги из Университета Карнеги Меллона. Впервые был описан в рабочем документе 1974 года, затем в докторской диссертации… …   Википедия

  • Алгоритм Rete — Rete[1]  эффективный алгоритм сопоставления с образцом для продукционных систем, экспертных систем и баз знаний, созданный Чарльзом Форги из Университета Карнеги Меллона. Впервые был описан в рабочем документе 1974 года, затем в докторской… …   Википедия

  • Charles Sanders Peirce —  B …   Wikipedia

Share the article and excerpts

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