Chapter 5. Operators and Functions

Operators and functions let you calculate results derived from column values, system-determined values, constants, and other data. You can perform:

  • Arithmetic operations—Cut everyone's salary by 10 percent.

  • String operations—Concatenate personal information into a mailing address.

  • Datetime operations—Compute the time interval between two dates.

  • System operations—Find out what time your DBMS thinks it is.

An operator is a symbol or keyword indicating an operation that acts on one or more elements. The elements, called operands, are SQL expressions. Recall from the “SQL Syntax” Tips in Chapter 3 that an expression is any legal combination of symbols and tokens that evaluates to a single value (or null). In price * 2 ...

Get SQL: Visual Quickstart Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.