SQL is a language to operate databases; it includes database creation, deletion, fetching rows, modifying rows, etc.

SQL is an ANSI (American National Standards Institute) standard language.

Introduction To SQL

SQL is stands for (Structured Query Language)

computer language for storing, manipulating and retrieving data stored in a relational database.

SQL is the standard language for Relational Database System. All the Relational Database Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their standard database language.

Syntax and Parameters

The basic syntax for writing SQL EXPLAIN queries is as follows :

EXPLAIN SELECT  column_names(s) FROM table_name;

EXPLAIN keyword on its own won’t run the SQL statement. If you want to check how the statistics given in the EXPLAIN information comes to reality, you may use the ANALYZE keyword along with the EXPLAIN. The syntax for the same looks something like this.

EXPLAIN ANALYZE SELECT  column_names(s) FROM table_name;

Parameters

The parameters used in the above syntax are :

Feel free to add other keywords and clauses like WHERE, HAVING, GROUP BY, ORDER BY, etc. in your select query. Going ahead, we will try to understand the EXPLAIN keyword in greater detail.

Uses Of SQL

SQL Process

You need to find the best method to carry out your request. SQL engine determines how to interpret that specific task.

These components are −

SQL Architecture

SQL Commands

1. Data Definition Language (DDL)

Here are some commands that come under DDL:

2. Data Manipulation Language

Here are some commands that come under DML:

3. Data Control Language

DCL commands are used to grant and take back authority from any database user.

Here are some commands that come under DCL:

4. Transaction Control Language

TCL commands can only use with DML commands like INSERT, DELETE and UPDATE only.

Here are some commands that come under TCL:

5. Data Query Language

DQL is used to fetch the data from the database.

It uses only one command: