SQL

What is SQL?

 Structured Query language (SQL) pronounced as "S-Q-L" or sometimes as "See-Quel"is actually the standard language for dealing with Relational Databases.

SQL programming can be effectively used to insert, search, update, delete database records.

That doesn't mean SQL cannot do things beyond that.

In fact, it can do lot of things including, but not limited to, optimizing and maintenance of databases.

Relational databases like MySQL Database, Oracle, Ms SQL server, Sybase, etc uses SQL! How to use sql syntaxes?

SQL syntaxes used in these databases are almost similar, except the fact that some are using few different syntaxes and even proprietary SQL syntaxes.

 

Data Query or Retrieval Language [DQL or DRL]: This language supports to retrieve the data in different ways. It includes a cmd. called

SELECT

 

Data Manipulation Language [DML]: Insertion of new rows, modifying the existing rows, removing unwanted rows collectively known as DML.

It includes the following commands:

INSERT

UPDATE

DELETE

MERGE (Merge introduced in oracle 9i.)

 

Transaction Control Language [TCL]: This Language is used to make the transactions permanently or support to cancel the transactions.

It includes the following commands:

COMMIT

ROLLBACK

SAVEPOINT

 

Data Definition Language [DDL]: This lang. is supports to create the structure of diff objects, supports to modify those structures, delete those structures etc

It includes the following commands:

CREATE          

ALTER

TRUNCATE

RENAME

DROP

 

Data Control Language [DCL]: This Language is used to give the rights to objects of one user to get it access by other users.  It also supports to cancel those granted rights.

It includes the following commands:

GRANT

REVOKE

 

Session Control Language [SCL] or Session Protein Language [SPL]: This Language will support to retrieve the data based on three concepts.

It includes the following commands:

Selection

Projection

Joins

 

This language includes SELECT cmd.

Selection: is a process of retrieving the data of all the cols.  Selection of data is done thru * [operator].

Projection: is a process of retrieving the data of required cols.

Joins:  is a process of extracting the data from 2 or more tables producing a new table.

 

SQL Example  :-  SELECT * FROM Members WHERE Age > 30



SQL Tutorial                       SQL Queries

 

Comments