SQL | SQL Statements

There are four types of SQL statements. They are -

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

1. DML(5 Types)

  • Select(Used to view any record)
  • Insert(Used to insert any record)
  • Update(Used to modify existing record data)
  • Delete(Used to remove any record)
  • Merge(Used to conditional insert update on any record)

2. DDL(6 Types)

  • Create(Used to create any object in DB)
  • Alter(Used to modify any object)
  • Drop(Used to delete any object)
  • Rename(Used rename any object, column name)
  • Truncate(Used to remove all data from a table)
  • Comment(Used to store a comment on a table or column level)

3. DCL(2 Types)

  • Grant(Used to assign privileges)
  • Revoke(Used to remove privileges)

TCL(3 Types)

  • Commit(Permanently save the changes)
  • Rollback(Used to undo changes)
  • Savepoint(Used to identifies an point in a transaction to which we can later rollback)