Wednesday, 15 July 2015

Simple commands of Oracle- DDL,DML,DCL and TCL

DDL- Data Definition Language
DML- Data Manipulation Language
DCL- Data Control Language
TCL- Transaction Control Language


DDL- The DDL commands are used to define the structure of the database or schemas.

Examples are:
CREATE -> Helps to create the Database Objects.
ALTER---> Alters the structure of the database.
DROP--->Used to delete the database objects from the DB.
TRUNCATE - > remove all records from a table, including all spaces allocated for the records are removed.
RENAME--->Rename an object

 Note: All the DDL commands are auto-commit

DML- Statements are used for managing data within schema objects.
Examples are:
SELECT,  INSERT , UPDATE, DELETE, EXPLAIN PLAN,CALL,MERGE.

Note: DML commands can't be rollback when a DDL command is executed immediately after a DML. DDL after DML means "auto commit".

TCL:
 
For revoking the transactions and to make the data commit to the database we use TCL. Some of the TCL commands are:
1. ROLLBACK
2. COMMIT


DCL:
Data Control Language is used for the control of data. That is a user can access any data based on the priveleges given to him. This is done through DATA CONTROL LANGUAGE. Some of the DCL Commands are:
1. GRANT
2. REVOKE.


 

No comments:

Post a Comment