24

The Simple SELECT Statement

The good news about SQL is that the programmer only needs to learn the SELECT statement to do almost all his work! The bad news is that the statement can have so many nested clauses that it looks like a Victorian novel! The SELECT statement is used to query the database. It combines one or more tables, can do some calculations, and finally puts the results into a result table that can be passed on to the host language.

I have not spent much time on simple one-table SELECT statements you see in introductory books. I am assuming that you are experienced SQL programmers and got enough of those queries when you were learning SQL.

But it is worth going back to those basics and thinking about the conceptual model used ...

Get Joe Celko's SQL for Smarties, 4th 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.