Expressions and Strings
Illustrates use of arithmetic expressions and string pattern matching: Find triples (of ages of sailors and two fields defined by expressions) for sailors whose names begin and end with B and contain at least three characters.
AS and = are two ways to name fields in result.
LIKE is used for string matching. `_’ stands for any one character and `%’ stands for 0 or more arbitrary characters.
SELECT S.age, age1=S.age-5, 2*S.age AS age2
WHERE S.sname LIKE ‘B_%B’