SQL SYNTAX

A database system typically contains multiple databases.

Each database usually contains multiple tables.

Tables store data organized in rows.

Each row contains several fields.

Each field has a number of properties, such as the field name, length, data type that will store, etc..

SQL statements are not sensitive to case-sensitive, ie 'SELECT' and 'select' are two words the same for SQL.

Some databases systems need a semicolon after each SQL statement to run properly

CREATE DATATABASE mydatabase;

The semicolon can also be used to separate a SQL statement in another SQL statement on the same line.

CREATE DATATABASE mydatabase; CREATE TABLE mytable1;

SQL statements can be grouped by functionality:

A. - Data Definition Language (DDL).

DDL statements consists of the creation (CREATE), modification (ALTER) and clear (DROP) of the main components of a database:

2. - Data Manipulation Language (DML).

DML is composed of sentences that are used to:

3. - Data Control Language (DCL).

DCL consists of SQL statements to control the functions of management: