12.9. SQL: Scalar Operators and Bag Functions

A scalar is a data value (e.g., a number, string, or date). This section provides a brief discussion of the scalar operators and bag functions available in SQL-89, as well as some of the further operators and functions included in later versions.

In SQL-89, the scalar operators are the four arithmetic operators +, -, *, and /. As unary operators, + and - provide the sign of the number (e.g., +3 or -3). If omitted, + is assumed (e.g., 3 = +3). As binary operators, + and - perform addition and subtraction. The binary operators * and / perform multiplication and division; they have no unary version. Each is a number-forming operator on numbers. Their operands may appear as column names, constants, function ...

Get Information Modeling and Relational Databases, 2nd 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.