=== Data Definition Language (DDL)

Data definition language includes commands for defining data structures. DDL commands are commonly used to define a database's schema. The schema refers to the overall structure or organization of the database and. in SQL databases, includes objects such as tables, indexes, views, relationships, triggers, and more.

If an attacker successfully "injects" DDL type SQL commands into a database, he can violate the integrity (using ALTER and DROP statements) and availability (using DROP statements) of a system.


* DDL commands are used for creating, modifying, and dropping the structure of database objects.
* CREATE - create database objects such as tables and views
* ALTER - alters the structure of the existing database
* DROP - delete objects from the database
* Example:
** CREATE TABLE employees( +
   &nbsp;&nbsp;&nbsp;&nbsp;userid varchar(6) not null primary key, +
   &nbsp;&nbsp;&nbsp;&nbsp;first_name varchar(20), +
   &nbsp;&nbsp;&nbsp;&nbsp;last_name varchar(20), +
   &nbsp;&nbsp;&nbsp;&nbsp;department varchar(20), +
   &nbsp;&nbsp;&nbsp;&nbsp;salary varchar(10), +
   &nbsp;&nbsp;&nbsp;&nbsp;auth_tan varchar(6) +
);
** This statement creates the employees example table given on page 2.

Now try to modify the schema by adding the column "phone" (varchar(20)) to the table "employees". :

