Expressions and Strings
    SELECT S.age,  2*S.age AS age2    
    FROM   Sailors S
    WHERE  S.sname LIKE ‘B*B’
 
  • Illustrates use of arithmetic expressions and string pattern matching:  Find tuples (of ages of sailors and a new field defined by an expression) for sailors whose names begin and end with B and contain at least two characters.
  • AS is a way to name a field in result.
  • LIKE is used for string matching. `_’ stands for any one character, '*' and `%’ stands for 0 or more arbitrary characters.