DDL / DML / DCL / TCL / DQL Commands in Oracle - Useless Computer

DDL / DML / DCL / TCL / DQL Commands in Oracle

Share This

What is SQL?

SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational database. SQL is the standard language for Relational Database System.


Types of SQL Statements

DML – Data Manipulation Language

The SQL commands that deals with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SQL statements.

Examples of DML:
  • INSERTInsert data into table
  • UPDATEModify existing records
  • DELETEDelete records from table

DDL – Data Definition Language

DDL actually consists of the SQL commands that can be used to define the database schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database.

Examples of DDL commands:
  • CREATE – Create new Database, Table or Schema
  • ALTER – Modify existing table by adding, deleting, renaming or modifying column definition
  • DROP – Delete existing Database, Table or Schema

DCL – Data Control Language

These statements are used to control access to database by creating roles, granting them permissions or withdrawing users access privileges.
  • GRANT – Giving permission to users for certain database objects
  • REVOKE – Removing / withdrawing permissions from users which are previously granted

TCL – Transaction Control Language

These are the statements which are used to control/manage the Transactions in a database.
  • SET TRANSACTION – set the behavior or characteristics of a transaction
  • COMMIT – Ensure that the statements from start till this point is
  • ROLLBACK – Undo all changes if any error occurs in a Transaction
  • SAVEPOINT – Helps when only a part of transaction needs to be roll backed.

DQL – Data Query Language

These statements are used to Query data from database.
  • SELECT – Retrieve data from database.

These are the SQL commands that we use in our Database. Hope you got the outline from this. Do share this blog with your friends to spread the knowledge.

1 comment:

Pages