SQL Guide

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
Cc: <pgsql-docs(at)postgresql(dot)org>
Subject: SQL Guide
Date: 2001-01-21 01:00:17
Message-ID: Pine.LNX.4.30.0101210139260.1033-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-patches

Robert B. Easter writes:

> We seem to be in agreement about the SQL documentation. That's cool. :)

I thought about this some more and came to the conclusion that the outline
used in the SQL standard is not appropriate to use for such an SQL guide.
The SQL standard is organized "bottom-up", it explains the meaning of each
syntactic clause and then assembles more complex clauses as it goes along.
The result is that the plain-old SELECT statement is not discussed until
chapter 17 of part 5, which is in essence just about the last thing
overall. This is okay for what that document is: it's a plain language
version of a grammar specification.

For our purposes we need to organize the thing top-down. We start with
the big four commands SELECT, INSERT, UPDATE, DELETE with simple cases,
then move on to more complicated things such as joins and subqueries. Of
course the lexical rules still go first, and the basics of the scalar
expression syntax as well, but we don't want to define ordering or joining
rules before introducing the SELECT command. I came up with an outline
like this:

1. Lexical structure [done]
2. Simple selects and Inserts
3. Expression syntax, complicated selects
4. Delete and Update
5. Joins, Subqueries, Naming scope, Unions
6. Aggregates
7. Ordering
8. Creating tables in all its glory, maybe more than one chapter

This would be the generic part (applicable to any SQL RDBMS). Following
this would be the existing chapters about data types, functions, type
conversion, concurrency control.

> I'd really like to see the "SQL Guide" when we can do it. As for the User's
> Guide, you say it might be nice to rename it SQL Guide. That could be done
> or have both. Maybe having both an SQL guide and a User's guide is best.

We don't have a lot of material to have both, but we can divide them into
<part>s. Really, the current split between books is primarily so you can
print them individually without having to buy a ton of paper. It is not
necessarily a mandate to make a library out of it. ;-)

> The Admin guide covers those commands and programs (initdb/postmaster) that
> affect the whole database management system, its tuning, backup and other
> things. All the other guides could reference the SQL Guide when needing to
> explain the full details of an sql command.

Correct. The Admin Guide is basically defined as comprising all activity
that needs to be done on the server system.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2001-01-21 22:14:41 Re: docs: syntax.sgml patch
Previous Message Kovacs Zoltan Sandor 2001-01-20 12:19:24 Re: pl/pgSQL & transaction

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-01-21 03:51:23 Re: Re: [PATCHES] Patch to support transactions with BLOBs for current CVS
Previous Message Tom Lane 2001-01-20 18:31:49 Re: [PATCHES] binary operators on integers