Following is the four components of SQL
- 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.
- 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.
- 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.
- DQL
- DQL - Data Query Language
- DQL used to getting data from database.
- Example:
- SELECT : retrieve data from the database.

No comments:
Post a Comment
Thanks for your comments