DML, DDL

SELECT is DML → if it is used as SELECT … INTO
SELECT is DML → if it is used as SELECT … INTO

Types

  1. DDL – Data Definition Language
  2. DQL – Data Query Language
  3. DML – Data Manipulation Language
  4. DCL – Data Control Language
  5. TCL – Transaction Control Language

DDL

  1. CREATE — create database, create table, create view, create index
  2. DROP - deletes database, table
  3. ALTER - change table
  4. TRUNCATE - removes only the data from table, but not table itself
  5. RENAME - rename table name

DQL

  1. SELECT — used to retrieve data from the database.

DML

List of DML commands:

  1. INSERT : It is used to insert data into a table.
  2. UPDATE: It is used to update existing data within a table.
  3. DELETE : It is used to delete records from a database table.
  4. LOCK: Table control concurrency.

TCL

A transaction is a single unit of work. If a transaction is successful, all of the data modifications made during the transaction are committed and become a permanent part of the database. If a transaction encounters errors and must be canceled or rolled back, then all of the data modifications are erased.  

  • COMMITCommits a Transaction.
  • ROLLBACKRollbacks a transaction in case of any error occurs.
  • SAVEPOINT: Sets a savepoint within a transaction.
  • SET TRANSACTION: Specify characteristics for the transaction.

Resources

SuperMade with Super