Introduction :
Guys, here we will learn about SQL statements, types and role.
Types of SQL Statements :
SQL statements mainly categorized into following kinds.
Guys, here we will learn about SQL statements, types and role.
Types of SQL Statements :
SQL statements mainly categorized into following kinds.
- DDL (Data Definition Language)
- DML (Data Manipulation Language)
- DQL (Data Query Language)
- DCL (Data Control Language)
- TCC (Transaction Control Commands)
1. Data Definition Language :
In DDL, there are three types of statements.
(i) CREATE - is used to create database, table, index , view etc.
In DDL, there are three types of statements.
(i) CREATE - is used to create database, table, index , view etc.
(ii) ALTER - is used to modify database, table, index , view etc.
(iii) DROP - is used to delete the schema of database, table, index , view etc.
2. Data Manipulation Language :
2. Data Manipulation Language :
In DML, there are three types of statements.
(i) INSERT - is used to insert row(s) in a database, table
(i) INSERT - is used to insert row(s) in a database, table
(ii) UPDATE - is used to change(update) row(s) in a database.
(iii) DELETE - is used to delete row(s) from a database.
3. Data Control Language :
In DCL, there is only one statement.
(i) SELECT - is used to select/retrieve row(s) from a database
(i) SELECT - is used to select/retrieve row(s) from a database
4. Data Query Language : In DQL, there is following statements.
(i) GRANT - is used to give/set the privileges to the user
(i) GRANT - is used to give/set the privileges to the user
(ii) INVOKE - is used to withdraw the privileges given by GRANT
5. Transaction Control Language/Commands : In TCL, there are four types of statements.
(i) COMMIT - permanently saves database transactions (will not be ROLLBACK)
(ii) ROLLBACK - undoes database transactions
5. Transaction Control Language/Commands : In TCL, there are four types of statements.
(i) COMMIT - permanently saves database transactions (will not be ROLLBACK)
(ii) ROLLBACK - undoes database transactions
(iii) SAVEPOINT - creates points within groups of transactions in which to ROLLBACK
(iv) SET TRANSACTION - places a name on transaction
Comments
Post a Comment