Selection (computer science)

from Wikipedia, the free encyclopedia

When selection is known in the computer science , the selection of data objects from a data set. The data contained in a database can only be used after selection. In relational algebra , selection is one of the five operators that are used in relational databases .

task

Data objects are selected according to their properties in order to display, export , change ( update ) or use them as reference for a comparison. A distinction can be made here between unique queries that only return a single tuple as a result and those that return a list of tuples.

implementation

The respective implementation depends heavily on the database used. Since such systems are designed to find data sets, no linear search is used. Such a search over large amounts of data is inefficient and often technically not feasible. Instead, indices are used here, which allow data to be found quickly in a data set with a key . Such indexes use so-called index structures . The main focus of the implementation is on scalability and parallelization across different computers as well as the minimization of hard disk access.

Examples

Today, SQL has established itself on the market as the standard query language for relational database systems . A selection is made here via the so-called "WHERE" clause, in which the selection criteria are specified. The introductory keyword "SELECT" of an SQL query, on the other hand, implements the projection , i. H. the restriction of the result tuple to individual attributes:

  • " SELECT * FROM Tabelle": Returns all rows (= tuples) of the table.
  • " SELECT * FROM Tabelle WHERE a=25": Returns those tuples whose attribute 'a' has the value 25.
  • " SELECT Name FROM Tabelle WHERE a=25": Returns the attribute 'Name' of those tuples whose attribute 'a' has the value 25.

See also