Skip to main content

SQL Statements

Introduction : 
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.
(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 :
In DML, there are three types of statements.
(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

4. Data Query Language : In DQL, there is following statements.
(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
(iii) SAVEPOINT - creates points within groups of transactions in which to ROLLBACK 
(iv) SET TRANSACTION - places a name on transaction

Comments

Popular posts from this blog

SQL Introduction

Introduction : Hello readers, here we will learn about SQL and it's uses. What is SQL? SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language) SQL is a programming language like c, c++, c#, java etc. The full form of SQL is Structured Query Language SQL is used to access and manipulate the RDBMS SQL is an ANSI standard What can SQL do? SQL can insert row(s)/record(s) in a database SQL can select row(s)/data from a database SQL can update row(s) in a database SQL can delete row(s) from a database SQL can create database(s) and table(s) SQL can create function(s), stored procedure(s), view(s), trigger(s), cursor(s) etc and many more