• Apply the selection indicated by the WHERE clause. • Apply the (extended) projection indicated by the SELECT clause.
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.
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';
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.