SQL - Database Management
This is the most used language for building and using relational databases.
The original name was SEQUEL that is a short for "Structured English
QUEry Language", but was condensed to SQL and the full name "Structured
Query Language", come then. Must be pronounced S-Q-L.
The authors are Donald D. Chamberlin and Raymond F. Boyce at IBM. The System/38
implemention was sold by IBM in 1979, and Oracle by Relational Software
in the same year. In 1982 IBM implemented SQL in DB2.
SQL becomes ANSI standard in 1986, ISO standard in 1987 but actual implementations
are far to be standardized.
SQL 2003 added XML features to the language.
What is a relational database management system?
In the relational model, queries are expressed declaratively as relations between categories of data (and, or, mainly).
Variants and procedural extensions
- PL/SQL for Oracle (now a company).
- PS/PgSQL for PostgreSQL.
- SQL Procedural Language by IBM. This is a complete programming language.
- Transact SQL for MS SQL Server.
- Access by Microsoft and VBA (Visual Basic for Applications).
Main free software
- MySQL used on web servers.
- SQLite, standalone or on servers, for one database.
- PostgreSQL. Allows to program in C and other languages.
SQL 2003 features
- Intended mainly for query.
- Extended with procedural programming languages.
- Retrieval of data with functional queries.
- Uses tables and rows.
- Data manipulation functions:
- Delete entries, rows.
- Insert rows.
- Merge tables.
- Select articles.
- Update the content of a table.
- Data definition functions:
- Create a table, a row, ...
- Drop table, row, ...
- Control functions:
- Grant an user to perform an operation.
- Revoke a permission to an user.
- A comment has the form: -- some comment.
Why to use SQL?
SQL is convenient for managing large collections of data with a predefined list of components. The classical activity of an enterprise, transactions and resources are perfectly managed by a such tool while intelligent information processing requires another format as XML.
Sites and tools
- Comparison
Difference between various implementations. - Open
source
List of open source SQL engines and comparison. - MysSQL
/ Postgre
More precise comparison. - SQL
92
The standard. - SQL
2003
The standard. - Short
tutorial
Introduction to SQL. An another one. - SQL tutorial
with PHP and MySQL
Learn with example to use SQL on a website. - Tutorial
Manual. - SQL
and XML
Article about SQL 2003.
Sample code
| Hello world |
CREATE TABLE message (text char(15));
INSERT INTO message (text)
VALUES ('Hello, World!');
SELECT text
FROM message;
DROP TABLE message;
|
| Choose articles that cost less than 50 $ |
SELECT * FROM article WHERE price < 50 |
