2009-06-30

Basic SQL (Part 1)

There are 3 types of SQL statement:

  1. Data Manipulation Language (DML), used to manipulate data in a table. 4 types of DML:
    1. Select, used to query data.
    2. Insert, used to add new data.
    3. Update, used to modify existing data.
    4. Delete, used to remove data.
  2. Data Definition Language (DDL), used to manipulate structure of the database objects, which include table, view and others. 3 types of DDL:
    1. Create, used to add new database object.
    2. Alter, used to modify existing database object structure, for example add column to a table.
    3. Drop, used to remove database object.
  3. Transaction Control Language (TCL), used to control the transaction. When user issues the first SQL statement, a transaction will be started and user can decide to end the transaction with either Commit or Rollback.
    1. Commit, used to save changes made by user.
    2. Rollback, used to undo all the changes made by user.
    3. Savepoint, used to make checkpoint for commit or rollback operation.

0 comments: