Seputar Structured Query Language (SQL)

SQL terdiri dari :
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Control Language (DCL)
DDL fungsinya utk mendefinisikan, mengubah, serta menghapus basis data dan objek-objek yang diperlukan dalam basis data dan biasa dipakai oleh administrator basis data dalam membuat suatu aplikasi basis data.
Contoh perintah dalam DDL :
CREATE - to create objects in the database
ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
COMMENT - add comments to the data dictionary
RENAME - rename an object
Data Manipulation Language (DML)
DML biasa digunakan tuk memanipulasi data yang ada dalam suatu tabel. Beberapa perintah yang umum dilakukan adalah:
SELECT - retrieve data from the a database
INSERT - insert data into a table
UPDATE - updates existing data within a table
DELETE - deletes all records from a table, the space for the records remain
MERGE - UPSERT operation (insert or update)
CALL - call a PL/SQL or Java subprogram
EXPLAIN PLAN - explain access path to data
LOCK TABLE - control concurrency
Data Control Language (DML)
Biasa digunakan untuk mengendalikan data, seperti siapa saja yang bisa melihat isi data, bagaimana data bisa digunakan oleh banyak user, dsb
GRANT - gives user's access privileges to database
REVOKE - withdraw access privileges given with the GRANT command
(bahan diklat)
No comments: