Chapter 5. Operators and Functions

Operators and functions permit you to calculate results derived from column data, system-determined values, and constant expressions. 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 ...

Get SQL: Visual QuickStart Guide 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.