0% found this document useful (0 votes)
6 views2 pages

SQL Basics: DDL and DML Commands

Belajar Basic sql

Uploaded by

Gemboy Windroy99
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

SQL Basics: DDL and DML Commands

Belajar Basic sql

Uploaded by

Gemboy Windroy99
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

SQL Basic

DDL : Data Definition Language

CREATE : buat tabel


ALTER : tambah table / colom
DROP : hapus table / colom
GRANT : Beri Access

Syntax :

 To add a table.

CREATE TABLE {table} ( {column} [CHAR [( {size} )] | CHARACTER


[( {size} )] | LONGCHAR | SHORT | INT | INTEGER | LONG | OBJECT ]
[NOT NULL] [TEMPORARY][LOCALIZABLE] [, column...][, ...]
PRIMARY KEY column [, column][, ...] )[HOLD]

 To remove a table.

DROP TABLE {table}

 To add a column.

ALTER TABLE {table} ADD {column} [CHAR [( {size} )] | CHARACTER


[( {size} )] | LONGCHAR | SHORT | INT | INTEGER | LONG | OBJECT ]
[NOT NULL] [TEMPORARY][LOCALIZABLE][HOLD]

 To hold and free temporary tables.

ALTER TABLE {table name} HOLD

ALTER TABLE {table name} FREE

DML Data manipulation language


 To select a group of records.

SELECT [DISTINCT]{column-list} FROM {table-list} [WHERE {operation-


list}] [ORDER BY {column-list}]

 To delete records from a table.

DELETE FROM {table} [WHERE {operation-list}]

 To modify existing records in a table.

UPDATE {table-list} SET {column}= {constant} [, {column}= {constant}][, ...]


[WHERE {operation-list}]

 To add records to a table.

INSERT INTO {table} ({column-list}) VALUES ({constant-list})


[TEMPORARY]

You might also like