You have full access to this open access chapter, Download reference work entry PDF
Synonyms
Definition
Given a relation instance R over set of attributes U and a condition F, the selection σ F (R) returns a new relation over U consisting of the set of tuples of R which satisfy F. The condition F is an atom of the form A = B or A = c, where A and B are attributes in U and c is a constant value.
The generalized selection allows more complex conditions: F can be an arbitrary Boolean combination of atoms of the form A = B or A ≠ B or A = c or A ≠ c. Moreover, if a total order is defined on the domain of attributes, more general comparison atoms of the form A α B or A α c are allowed, where α ranges over {=, ≠, <, >, ≤, ≥}.
Key Points
The selection is one of the basic operators of the relational algebra. It operates by “selecting” rows of the input relation. A tuple t over U satisfies the condition A = B if the values of attributes A and B in t are equal. Similarly t satisfies the condition A = c if the value of attribute A in t is c. Satisfaction of generalized selection atoms is defined analogously.
As an example, consider a relation Exams over attributes (course-number, student-number, grade), containing tuples {(EH1, 1001, A), (EH1, 1002, A), (GH5, 1001, C)}. Then σ grade=A∧course−number = EH1(Exams) is a relation over attributes (course-number, student-number, grade) with tuples {(EH1, 1001, A), (EH1, 1002, A)}.
In the case that a relation schema is only specified by a relation name and arity, the result of the selection is a new relation having the same arity as the input one, containing the tuples which satisfy the selection condition. In this case the selection atoms are expressions of the form j = k or j = c (or j α k and j α c in the generalized selection). Here j and k are positive integers bounded by the arity of the input relation, identifying its j-th and k-th attributes, respectively.
Cross-References
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Section Editor information
Rights and permissions
Copyright information
© 2017 Springer Science+Business Media LLC
About this entry
Cite this entry
Sirangelo, C. (2017). Selection. In: Liu, L., Özsu, M. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4899-7993-3_1257-2
Download citation
DOI: https://doi.org/10.1007/978-1-4899-7993-3_1257-2
Received:
Accepted:
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4899-7993-3
Online ISBN: 978-1-4899-7993-3
eBook Packages: Springer Reference Computer SciencesReference Module Computer Science and Engineering