Chapter 12
SQL Syntax
Goals

Now that we understand how a relational database is built, we are ready to learn how to operate it. The interface to a relational database is SQL. We will quickly become adept at building tables, populating them, and retrieving information from them.

Further, we will also become adept at designing tables. We will learn a few rules to live by. We will also be exposed to the various types of variables we can use to make them.

Varieties of SQL

Syntax is -to some degree- standard among all of the SQL DBMS’s. There are many available, with the most popular being those published by Microsoft and Oracle (Microsoft actually publishes two popular SQL DBMS offerings).

Flash techies seem to prefer open source systems. For one thing, Microsoft and Oracle products cost money, while open source is free! For another, there is freedom to extend and debug the product - and a community of sharing that benefits all. As in choosing PHP, we hope to benefit from and contribute to this community.

In the open-source world, the currently favorite DBMS is MySQL, and that is what we will use in this book. MySQL has begun to cost money, which may later effect its popularity. Cost issues are not dominant ones. Syntax is more important. Most of the syntax in this chapter could be universally applied to any SQL program. But where the syntax varies from application to application, MySQL syntax will be used.