We can conceptualize the execution of this typical select using the operations of relational algebra as follows: 1. The execution begins by performing the product of the tables listed after the reserved word from. In our case, this involves computing the product
STUDENTS × GRADES × INSTRUCTORS
2. The selection specified after the reserved word where is executed next, if the where part is present (we shall see that this may or may not be present in a select.) In our case, this amounts to retaining that part of the table product that satisfies the condition:
STUDENTS.stno = GRADES.stno and GRADES.empno = INSTRUCTORS.empno and STUDENTS.city = ’Brookline’
3. Finally, the result of the second phase is projected on the attributes listed between select and from, that is, in our case, on the attribute INSTRUCTORS.name. We use a string constant (also known as a literal) in the above select, namely ’Brookline’. String constant must begin and end with a single quote. SQL is not case-sensitive. This means that you may or may not use capital letters in any place in an SQL construction (except for string comparisons) without any effect on the value returned by the query. As we mentioned above, the where part of a select (also known as the where clause) is optional. This allows us to compute table projections in SQL as we show next.
5.5 SELECT Phrases 79