DDL
DDL digunakan untuk 
mendefinisikan, mengubah, serta menghapus basis data dan objek-objek 
yang diperlukan dalam basis data, misalnya tabel, view, user, dan 
sebagainya. Secara umum, DDL yang digunakan adalah CREATE untuk membuat 
objek baru, USE untuk menggunakan objek, ALTER untuk mengubah objek yang
 sudah ada, dan DROP untuk menghapus objek. DDL biasanya digunakan oleh 
administrator basis data dalam pembuatan sebuah aplikasi basis data.
jadi gampangnya DDL digunakan ketika kita
 ingin membuat, mengubah, dan menghapus object pada database. oleh 
karena itu DDL lebih berhubungan pada object bukan pada isi atau data. 
kata-kata yang akan sering kita jumpai dalam DDL antara lain : Create, 
Use, Alter, dan Drop.
CREATE statements
Create – To make a new database, table, index, or stored query. A 
CREATE
 statement in SQL creates an object inside of a relational database 
management system (RDBMS). The types of objects that can be created 
depends on which RDBMS is being used, but most support the creation of 
tables, indexes, users, synonyms and databases. Some systems (such as 
PostgreSQL) allow CREATE, and other DDL commands, inside of a transaction and thus they may be rolled back.CREATE TABLE
CREATE [TEMPORARY] TABLE [table name] ( [column definitions] ) [table parameters].For example, the command to create a table named employees with a few sample columns would be:
CREATE TABLE employees ( id INTEGER PRIMARY KEY, first_name CHAR(50) NULL, last_name CHAR(75) NOT NULL, dateofbirth DATE NULL );
CREATE TABLE
Drop – To destroy an existing database, table, index, or view.For example, the command to drop a table named employees would be:
DROP TABLE employees;
ALTER statements
Alter – To modify an existing database object.The typical usage is
ALTER objecttype objectname parameters. For example, the command to add (then remove) a column named bubbles for an existing table named sink would be:ALTER TABLE sink ADD bubbles INTEGER; ALTER TABLE sink DROP COLUMN bubbles;
Referential integrity statements
Finally, other kind of DDL sentence in 
SQL are the statements to define referential integrity relationships, 
usually implemented as primary key and foreign key tags in some columns 
of the tables.
These two statements can be included inside a CREATE TABLE or an ALTER TABLE sentence.
These two statements can be included inside a CREATE TABLE or an ALTER TABLE sentence.
Untuk membuat banyak tabel beserta 
relasinya dalam suatu system kita dapat menggunakan modeling tools yaitu
 PowerDesigner. Setelah kita membuat modelnya(CDM) kita dapat 
men-generate-nya menjadi PDM dan kemudian kita generate lagi untuk 
mengdapatkan SQL statementnya. SQL statement tersebut kita 
implemetasikan pada data base melalui sql tools. Seperti sqlplus, 
raptor, Toad, dll.



