SQL Commands and Operations

SQL Tutorials
SQL Commands and Operations

SQL is a command based language, used for storing and managing data in RDBMS. SQL doesn't have Control Flow (Conditional, Loop, and Branching Statements), but SQL has Comments, Data Types, Operators, Functions etc...programming features.

RDBMS(MySQL, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language. SQL is used to perform all type of data operations in RDBMS.

SQL Commands can be divided into the following categories,

1) Data Definition Language (DDL)
2) Data Manipulation Language (DML)
3) Transaction Control Language (TCL)
4) Data Control Language (DCL)
1) Data Definition Language (DDL)

Data Definition Language Commands are used to Create, Modify, and Drop the 
Structure of Database Objects like Table, View, and Index etc...

Important DDL Commands

i) Create
ii) Alter
iii) Drop
iv) Truncate
v) Rename

Important DDL Operations

i) Create a Database
ii) Use Database
iii) Rename a Database
iv) Drop Database
v) Create a Table
vi) Rename Table
vii) Add a Column to exiting Table
viii) Add multiple columns to existing Table
ix) Modify an existing column
x) Rename a Column
xi) Drop a Column
xii) Truncate a Table
xiii) Drop a Table

2) Data Manipulation Language (DML)

Data Manipulation Language commands are used to store, modify, retrieve, and 
delete data from database tables.

Important Data manipulation language Commands are,

i) SELECT – Retrieves data from a table
ii) INSERT –  Inserts data into a table
iii) UPDATE – Updates existing data into a table
iv) DELETE – Deletes all records from a table

3) Transaction Control Language (TCL)

These commands can annul changes made by other commands by rolling back to 
original state and also make changes permanent.

Important Transaction Control Language are,

i) Commit - To permanently save
ii) Rollback To undo change
iii) Savepoint To save temporarily

4) Data Control Language (DCL)

These SQL Commands (DCL) are used to implement security on Database objects like
Table, View, Stored Procedure etc...

Important Data Control Language are,

i) Grant - grant permission of right 
ii) Revoke - Take back permission.
iii) Deny - Deny Permissions to a User


Post a Comment