Structured Query Language/About the Book
It's a Translation and a Guide
This Wikibook introduces the programming language SQL as defined by ISO/IEC. The standard — similar to most standard publications — is quite technical and neither easy to read nor understand. There is therefore a demand for a text document explaining the key features of the language. That is what this wikibook strives to do: present a readable, understandable introduction for everyone interested in the topic.
Manuals and white papers by database vendors are mainly focused on technical aspects of their product. As they want to set themselves apart from each other, they tend to emphasize those aspects which go beyond the SQL standard and the products from other vendors. This is contrary to the wikibooks approach: we want to emphasize the common aspects.
The main audience of this wikibook is, therefore, people who want to learn the language, either as a beginner or for someone with existing knowledge and some degree of experience looking for a recapitulation.
What this Wikibook is not
First of all, this wikibook is not a reference manual for the syntax of standard SQL or any of its implementations. Reference manuals usually consist of definitions and explanations for those definitions. By contrast, this wikibook tries to present concepts and basic commands through textual descriptions and examples. Of course some syntax will be demonstrated. On some pages there are additonal hints about slight differences between the standard and special implementations.
This wikibook is also not a complete tutorial. First, its focus is the standard and not any concrete implementation. When learning a computer language it is necessary to work with it and experience it personally. Hence, a concrete implementation is needed. And most of them differ more or less from the standard. Second, this wikibook is far away from reflecting the complete standard, e.g. the central part of the standard consists of about 18 MB text in more than 1,400 pages. But this wikibook can be used as a companion for learning about SQL.
How to proceed
For everyone new to SQL, it will be necessary to study the chapters and pages from beginning to end. For persons who have some experience with SQL or who are interested in a specific aspect, it is possible to navigate directly to any page.
Knowledge about any other computer language is not necessary, but it will be helpful.
This wikibook consists of descriptions, definitions, and examples. It should be read with care. Furthermore, it is absolutely necessary to personally do some experiments with data and data structures. Hence, access to a concrete database system where read-only and read-write tests can be done is necessary. For those tests, our example database or individually defined tables and data can be used.
The elements of the language SQL are case-insensitive, e.g.: it makes no difference whether you write SELECT ..., Select ..., select ... or any combination of upper and lower case characters like SeLecT .... For readability reasons, this wikibook uses the convention that all language keywords are written in upper case letters and all names of user objects e.g. table and column names, are written in lower case letters.
We will write short SQL commands within one row.
SELECT street FROM address WHERE city = 'Duckburg';
For longer commands spawning multiple lines we use a tabular format.
SELECT street FROM address WHERE city IN ('Duckburg', 'Gotham City', 'Hobbs Lane');