Apply the selection indicated by the WHERE clause Apply the extended projection

Apply the selection indicated by the where clause

This preview shows page 15 - 31 out of 147 pages.

Apply the selection indicated by the WHERE clause. Apply the (extended) projection indicated by the SELECT clause.
Image of page 15
16 Operational Semantics To implement this algorithm think of a tuple variable ranging over each tuple of the relation mentioned in FROM. Check if the “current” tuple satisfies the WHERE clause. If so, compute the attributes or expressions of the SELECT clause using the components of this tuple.
Image of page 16
17 * In SELECT clauses When there is one relation in the FROM clause, * in the SELECT clause stands for “all attributes of this relation.” Example using Beers(name, manf): SELECT * FROM Beers WHERE manf = 'Anheuser-Busch';
Image of page 17
18 Result of Query: name manf 'Bud' 'Anheuser-Busch' 'Bud Lite' 'Anheuser-Busch' 'Michelob' 'Anheuser-Busch' Now, the result has each of the attributes of Beers.
Image of page 18