Data Definition Language ( DDL ) :
Data Definition Language are used to define the structure of a database or schema.
Some of the example includes statements like CREATE , ALTER , DROP etc.
Oracle Database implicitly commits the current transaction before and after every DDL statement.
Examples :
- CREATE - can be used to create a database , table , stored procedure.
- ALTER - can be used to alter the structure of databse table like add a new column.
- DROP - can be used to drop objects from database like drop a table.
- TRUNCATE - remove all records from a table . also remove all spaces allocated for the recods.
- COMMENT - can be used to add comments to data dictionary.
- RENAME - renames an object
Data Manipulation Language ( DML ) :
Data Manipulation Language can be used to modify / alter the data of existing schema objects.
DML statements do not implicitly commit the current transactions.
Example :
- SELECT - used to retrive data from a database table.
- INSERT - used to insert new record in a table.
- UPDATE - can be used to update column values of a table.
- DELETE - can be used to delete records from a table.
- MERGE - insert or update operation.
- EXPLAIN PLAN - explain access path to data.
- CALL - can be used to call PL/SQL.
- LOCK TABLE - controls the concurrency.
Transaction Control Statements ( TCL ) :
Transaction Control Statements are used to control the manipulations made by Data Manipulation Language ( DML ) statements .
Example :
- COMMIT - used to commit the transaction so that any changes made by the query are reflected by the database table.
- ROLLBACK - revert the changes that were made in the last commit.
- SAVEPOINT - creates / identifies a point in the transaction to which you can rollback later.
SET TRANSACTION - change transaction options like isolation level.
Session Control Statements :
Session control statements dynamically manage the properties of a user session. These statements do not implicitly commit the current transaction.
Example :