Chapter 5. SELECT Statement: Common Elements

5.1 Introduction

This first chapter dealing with the SELECT statement describes a number of common elements that are important to many SQL statements and certainly crucial to the SELECT statement. Those who are familiar with programming languages and other database languages will find most of these concepts familiar.

Among others, this chapter covers the following common elements:

• Literal

• Expression

• Column specification

• User variable

• System variable

• Case expression

• Scalar function

• Null value

• Cast expression

• Compound expression

• Row expression

• Table expression

• Aggregation function

5.2 Literals and Their Data Types

The previous chapter used literals in many examples of SQL statements. ...

Get SQL for MySQL Developers: A Comprehensive Tutorial and Reference 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.