Structured Query Language -SQL

Although, there are a number of query languages that are in use both commercially and in research. The most popular and widely accepted query language is Structured Query Language-SQL. Structured Query Language-SQL is not a general-purpose language. It is domain-specific. We use it in the design and management of data held in RDBMS.

The basis of SQL is relational algebra. SQL parser translates its abstract syntax tree into a tree of relational operators, which describes the relational algebra operations.

Why SQL is a Structured Query language?

Originally SQL was named as SEQUEL which stands for Structured English Query Language. However, later it was renamed as SQL. The motive was to design a programming language just like English with formal syntax i.e. structured English.

Types of SQL commands

SQL uses certain commands to carry out the required task. SQL categorize them into 5 categories.

  1. DDL- Data Definition Language
  2. DQL- Data Query Language
  3. DML- Data Manipulation Language
  4. DCL- Data Control Language
  5. TCL- Transaction Control Language
SQL commands
Data Definition Language

We use Data Definition Language to define, delete and modify relational schema or structure. We also use DDL for defining view and integrity constraints on the data stored in the database. DDL commands are:

Create, Alter, Drop, Truncate and Rename

Data Query Language

The command used to retrieve data from the database. DQL command is Select

Data Manipulation Language

We use DML commands to manipulate the data present in the database. We apply DML commands on the data of the database table. Most commonly used DML commands are:

Insert, Update and Delete.

Data Control Language

Data Control Language includes commands which mainly deals with permissions and rights and other controls of the database. DCL commands are:

Grant and Revoke

Transaction Control Language

TCL includes commands for specifying the beginning and end of the transactions in the database. TCL commands are:

Commit, Rollback and Savepoint

2 thoughts on “Structured Query Language -SQL

Leave a Reply

Your email address will not be published. Required fields are marked *