Chapter 6. SELECT Statements, Table Expressions, and Subqueries

6.1 Introduction

Earlier we introduced the SELECT statement and the table expression. You use both of these language constructs for querying data. Within SQL, a few other related constructs exist, such as the subquery and select block. All these constructs have a strong mutual relationship, which makes it difficult to keep them apart. However, the person who is programming SQL must know the differences. That is why we have devoted this entire chapter to this subject. For each construct, we describe what is meant exactly and what the mutual relationships are.

We begin with the SELECT statement. In the previous chapters, you have already seen several examples of this statement.

Get SQL for MySQL Developers: A Comprehensive Tutorial and Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.