SQL statements and categories

SQL statements are divided into these categories
  1. Data Definition Language (DDL) Statements.
  2. Data Manipulation Language (DML) Statements.
  3. Transaction Control Statements.
  4. Session Control Statements.
  5. System Control Statement.
  6. Embedded SQL Statements.



Data definition language (DDL) :
                these statements  are perform these tasks:
  • Create, alter, and drop schema objects
  • Grant and revoke privileges and roles
  • Analyze information on a table, index, or cluster
  • Establish auditing options
  • Add comments to the data dictionary

The DDL statements are:
  • ALTER ... (All statements beginning with ALTER)
  • ANALYZE
  • ASSOCIATE STATISTICS
  • AUDIT
  • COMMENT
  • CREATE ... (All statements beginning with CREATE)
  • DISASSOCIATE STATISTICS
  • DROP ... (All statements beginning with DROP)
  • FLASHBACK ... (All statements beginning with FLASHBACK)
  • GRANT
  • NOAUDIT
  • PURGE
  • RENAME
  • REVOKE
  • TRUNCATE
  • UNDROP


Data manipulation language (DML):
          statements access and manipulate data in existing schema objects. These statements do not   implicitly commit the current transaction. The data manipulation language statements are:
  • CALL
  • DELETE
  • EXPLAIN PLAN
  • INSERT
  • LOCK TABLE
  • MERGE
  • SELECT
  • UPDATE



Transaction control statements:

these statements manage changes made by DML statements. The transaction control statements are:
  • COMMIT
  • ROLLBACK
  • SAVEPOINT
  • SET TRANSACTION


session control statements:
PL/SQL does not support session control statements. The session control statements are:
  • ALTER SESSION
  • SET ROLE


Comments

Popular posts from this blog

Difference between DROP,TRUNCATE and DELETE