SELECT operation in SQL is equivalent to
View worked solution
Answer: D
To understand the equivalence between SQL and Relational Algebra (RA), let us compare their core operations:
- Projection () in Relational Algebra: This operation selects specific columns (attributes) from a relation. Since relational algebra is based on set theory, the projection operator automatically eliminates duplicate tuples.
- SELECT clause in SQL: The
SELECTclause in an SQL query (e.g.,SELECT column_name FROM table_name) is used to choose specific columns, which is conceptually identical to the projection operation (). However, SQL is based on multisets (bags) rather than pure sets, meaning it retains duplicate rows by default unless theDISTINCTkeyword is specified. - Selection () in Relational Algebra: This operation filters rows (tuples) based on a given condition. In SQL, this filtering is performed by the
WHEREclause, not theSELECTclause.
Thus, the SELECT operation in SQL is equivalent to the projection operation in relational algebra, with the difference that SQL retains duplicates.
Free practice · Your answers on this page are not saved.
