Tuesday, 27 August 2013

A Brief History and Overview of SQL

SQL began life as SEQUEL, the Structured English Query Language, a component of an IBM research project called System/R. System/R was a prototype of the first relational database system; it was created at IBM’s San Jose laboratories in 1974, and SEQUEL was the first query language to support multiple tables and multiple users.
As a language, SQL was designed to be “human-friendly”; most of its commands resemble spoken English, making it easy to read, understand, and learn. Commands are formulated as statements, and every statement begins with an “action word.” The following examples demonstrate this:

CREATE DATABASE toys;
USE toys;
SELECT id FROM toys WHERE targetAge > 3;
DELETE FROM catalog WHERE productionStatus = "Revoked";

As you can see, it’s pretty easy to understand what each statement does. This simplicity is one of the reasons SQL is so popular, and also so easy to learn.

SQL statements can be divided into three broad categories, each concerned with a different aspect of database management:
  • Statements used to define the structure of the Database : These statements define the relationships among different pieces of data, definitions for database, table and column types, and database indices. In the SQL specification, this component is referred to as Data Definition Language (DDL).
  • Statements used to manipulate Data :  These statements control adding and removing records, querying and joining tables, and verifying data integrity. In the SQL specification, this component is referred to as Data Manipulation Language (DML).
  • Statements used to control the permissions and access level to different pieces of Data : These statements define the access levels and security privileges for databases, tables and fields, which may be specified on a per-user and/or per-host basis. In the SQL specification, this component is referred to as Data Control Language (DCL).
Typically, every SQL statement ends in a semicolon, and white space, tabs, and carriage returns are ignored by the SQL processor. The following two statements are equivalent, even though the first is on a single line and the second is split over
multiple lines.

DELETE FROM catalog WHERE production Status = "Revoked";

DELETE FROM
catalog
WHERE productionStatus =
"Revoked";

0 comments:

Post a Comment