Database Reference
In-Depth Information
page
Request
Script
Language
SQL
Web
Browser
Web
Server
Script
Processor
DBMS
HTML Page
HTML
Tex t
Figure 1.4
Client-server requests.
Structured Query Language
As databases became more prominent, some standard method of obtaining information
from them was required. It does not really matter how the DBMS stores data or controls
access to it, as long as you get the information that you want from it back in an acceptable
way. So a standard way of communicating with database servers was needed.
The standard that most modern databases were built to support was ANSI SQL92. ANSI
is the American National Standards Institute which sets the standards for the computer
industry. Unsurprisingly, based on the name, the standard was agreed in 1992. It is tribute
to the work of this organization that the standard has remained current for such a long
time. Only relatively recently have new standards been agreed. SQL-99 or SQL:1999 came
along next and is sometimes known as SQL-3. There is also a new standard called SQL:2003
or SQL:200n which is under development.
Most manuals on SQL servers compare their products with the SQL92 standard. I will
not attempt to do this with MySQL, as this comparison can be found in the MySQL online
manual. However, some of the MySQL commands are in addition to the basic SQL92 com-
mands, and may not be available on other products. Also, because MySQL is an ongoing
project, some SQL92 features are not implemented. A lot of the SQL92 commands are still
present, but the code to make them work has yet to be developed.
You need not worry about this too much though, and you can still use this topic to learn
about SQL in general as most of the commands are standard across all SQL platforms. Once
you have worked through this topic, you should be able to transfer your knowledge of SQL
to other DBMS quickly.
Queries
The basic way of communicating with the SQL interpreter is with a query. A query is a piece
of text that gets sent to the DBMS which contains instructions that the server can process.
The query can contain commands to ask the server for data, to delete data, to create new
data and new meta-data. Almost all communication with the DBMS is done through an SQL
query. The only real exception to this is when the database server is in such difficulty that it
will not function correctly, in which case other tools may be needed to repair the database.
The following is a basic query:
SELECT *
FROM log;
Search WWH ::




Custom Search