SQL: Structured Query Language

SQL stands for "Structured Query Language". In some circles it stands for "Standard Query Language". Both well-define this programming language which is used to access databases. It is a language that is used across many platforms making it a "standard", and it is efficiently "structured" to return data to a server.

The development of SQL began in the 1970s. It became widely popular so that by 1986 it became an ANSI standard for dealing with data. Since then the language has only undergone minor modifications. It has proven to be so useful that many other languages use it as a means of accessing databases. Probably the most commonly used is PHP which uses MySQL.

Just as a sentence can be diagrammed in English, SQL can be diagrammed and has specific parts. A "statement" is like a sentence. It is the overall command that does something, acting on the database to manipulate, extract, or add information. The statement is made up of clauses which in essence perform certain parameters, telling the process what to do in small maneagable segments. For example "UPDATE thisdatabase" - "SET thiscolumn = 7" - "WHERE weekday = Saturday". A "predicate" sets up a comparison and the specific information is called an "expression".

Though interesting and helpful, like English, one can still be conversant without knowing the parts of speech. The most basic thing to understand when writing SQL is that precision in syntax makes all the difference between a successful program and a program that fails. It is also wise to make code readable, so that when changes are made any programmer can look at a body of work and identify what it does. For this reason code should be well-documented. It should also generally conform to certain standards. Finally, like any other language, SQL should be well-structured so that it efficiently performs the tasks assigned to it.

In this folio we will review the various statements available to the SQL programmer. We have a separate folio on SQL functions that can be included in the statements. We have also separated out the special SQL JOIN phrases, including INNER and OUTER JOINs.

Next Page: SQL Table Structure and Syntax


Send notes in disappearing ink!

Interesting Pages