Components of SQL

Following is the four components of SQL


  1. DDL
    • DDL - Data Definition Language
    • This is a set of command, which is used to create, modify and delete database structures data is not included.
    • Examples:
      • CREATE : used to create object in the database
      • ALTER : alter/modify the structure of the database
      • DROP : delete object from the database
      • TRUNCATE : delete all records from a table and remove all spaces allocated for the records.
      • COMMENT : Add comments
      • GRANT : Give users access privileges to database
      • REVOKE : Remove access privileges given with the GRANT command.
  2. DML
    • DML - Data Manipulation Language
    • It is used to change data within the database
    • Examples:
      • INSERT : insert data into a table
      • UPDATE : update existing data within a table
      • DELETE : deletes all records from a table, space for the records remain as itis.
      • CALL : call a PL/SQL or java program
      • EXPLAIN PLAN : explain access path to data
      • LOCK : table control concurrency.
  3. DCL
    • DCL - Data Control Language
    • DCL is component of SQL statement which is control access to data and to the database
    • DCL statements are grouped with DML statements.
    • Example:
      • COMMIT : save work done
      • SAVEPOINT : identify a point in a transaction to which you can later roll back.
      • ROLLBACK : restore database to original since the last COMMIT
      • SET TRANSACTION : change transaction option like what rollback segment to use
      • GRANT / REVOKE : grant or take back permissions to or from the oracle users.
  4. DQL
    • DQL - Data Query Language
    • DQL used to getting data from database.
    • Example:
      • SELECT : retrieve data from the database.
March 18, 2020 / by / 0 Comments

No comments:

Post a Comment

Thanks for your comments

Post Top Ad