Structured Query Language/Data Manipulation Language

Data Manipulation Language is used to modify the records in the database. It never modifies the schema of the database (table features, relationships, ...). It describes three statements: INSERT, UPDATE and DELETE.

INSERT statement
The exhaustive syntax of the INSERT statement is as follows:

The INSERT statement is used to add new records (rows) in a table. For instance, we want to add a new reunion:
 * Its primary key is 7,
 * Its name is "Job interview",
 * Its description is "Meeting with Mr. SPENCER",
 * Its priority is B,
 * Its planned,
 * Its date is on October 28, 2009,
 * Its hour is 18:30:00,
 * Its duration is 30,
 * Its office technical id is 23,
 * There is no pdf report.


 * The table before the statement:
 * Query:


 * The table after the statement:

The INTO clause contains the name of the table where the record needs to be inserted. It can be followed by a list of columns in brackets. The VALUES clause contains the values to insert in brackets. If the column names are omitted, the VALUES clause must contains as many values as the number of columns of the table. The values are inserted in the table columns in the same order that the order in which the columns have been declared in the table. If the column names are mentioned, there must be as many column names as values. The values are respectively inserted into the named columns. If a column in the table is omitted, a NULL value is inserted instead.

The VALUES clause can be replaced by an inner SELECT statement. In this case, the INSERT statement can insert several rows in the table. For example, we want to plan twice all the reunion with a B priority level, one year later:


 * The table before the statement:


 * Query:


 * The table after the statement:

UPDATE statement
The exhaustive syntax of the UPDATE statement is as follows:

UPDATE


 * The table after the statement:

DELETE statement
The exhaustive syntax of the DELETE statement is as follows:

DELETE FROM


 * The table after the statement:

Now you can use an already existing database schema to handle your own data.