Please enable Javascript to correctly display the contents on Dot Net Tricks!

Basics of SQL Commands

 Print 
  Author : Shailendra Chauhan
Posted On : 21 Jan 2011
Total Views : 127,656   
Updated On : 25 Sep 2012
 

SQL commands are a set of instructions that are used to interact with the database like Sql Server, MySql, Oracle etc. SQL commands are responsible to create and to do all the manipulation on the database. These are also responsible to give/take out access rights on a particular database

Sql Commands Category

We have different sql commands for different-different purpose. We can grouped Sql Commands into five major categories depending on their functionality.

  1. Data Definition Language (DDL)

    These SQL commands are used to create, modify, and drop the structure of database objects like table, view, procedure, indexes etc. In this category we have CREATE, ALTER, DROP and TRUNCATE commands.

    Note

    1. Only with DDL commands we need to write keyword (like table, procedure, view, index, function) with the syntax of command.

    2. These commands are used to create/modify the structure of the database object.

    Example

     CREATE TABLE TABLE_NAME
    (
    COL1 VARCHAR(10),
    COL2 VARCHAR(20),
    );
    --Here "TABLE" is a keyword that is used to create table "TABLE_NAME"
    CREATE VIEW VIEW_NAME
    AS
    BEGIN
     SELECT * FROM EMP_TABLE
    END
    --Here "VIEW" is a keyword that is used to create VIEW "VIEW_NAME" 
  2. Data Manipulation Language (DML)

    These SQL commands are used to store, modify, and delete data from database tables. In this category we have INSERT, UPDATE, and DELETE commands.

  3. Data Query Language (DQL)

    These SQL commands are used to fetch/retrieve data from database tables. In this category we have only SEELCT command.

  4. Transaction Control Language (TCL)

    These SQL commands are used to handle changes which affect the data in database. Basically we use these commands with in the transaction or to make a stable point during changes in database at which we can rollback the database state if required. In this category we have SAVEPOINT, ROLLBACK and COMMIT commands.

  5. Data Control Language (DCL)

    These SQL commands are used to implement security on database objects like table,view,stored procedure etc. In this category we have GRANT and REVOKE commands.

    Note

    1. Grant Command : This command is used to give permission to specific users on specific database objects like table, view etc.

    2. Revoke Command : This command is used to take out permission from specific users on specific database objects like table, view etc.



Free Interview Books
 
COMMENTS
24 SEP
Angular2 and Angular4 (Classroom)
08:30 AM-11:30 AM IST
23 SEP
MEAN Stack (Classroom)
8:30 Am To 11:30 Am
23 SEP
Microsoft Azure Infrastructure Solutions (Online)
08:00 PM-11:00 PM IST / 9:30 AM-12:30 PM CST
20 SEP
MEAN Stack (Online)
07:00 AM-09:00 AM IST
20 SEP
ASP.NET MVC with Angular4 (Online)
9:00PM- 11:00PM IST(+5:30GMT)
16 SEP
Angular2 and Angular4 (Online)
08:00 AM-10:00 AM IST(+5.30 GMT)
7 SEP
ASP.NET MVC with Angular4 (Online)
09:00 PM to 11:00 PM IST (+5:30 GMT)
22 AUG
ASP.NET Core with Angular4 (Online)
07:00 AM - 9:00 AM IST(+5:30 GMT)
19 AUG
MEAN Stack 2 (Online)
5:30 Pm - 7:00 PM IST (+5:30 GMT)
19 AUG
ASP.NET MVC with Angular4 (Online)
10:30 Am to 12:30 PM IST (+ 5:30 GMT)
19 AUG
NodeJS with Angular4 (Classroom)
04:00 PM to 07:00 PM IST (+5:30 GMT)
12 AUG
ASP.NET MVC with Angular4 (Classroom)
11:30 AM - 1:30 PM IST (+5:30GMT)
15 JUL
ASP.NET MVC with Angular4 (Online)
03:30 PM - 05:30 PM IST(+5.30 GMT)
LIKE US ON FACEBOOK
 
+