SQL
SQL stands for Structured Query Language. It is a programming language used for storing and managing
data in relational database management system (RDMS).
It is a standard language for Relational Database System. It enables a user to create, read, update and delete
relational databases and tables.
All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL as their standard
database language.
SQL allows users to query the database in a number of ways, using English-like statements.
Characteristics of SQL
SQL is easy to learn.
SQL is used to access data from relational database management systems.
SQL can execute queries against the database.
SQL is used to describe the data.
SQL is used to define the data in the database and manipulate it when needed.
SQL is used to create and drop the database and table.
SQL is used to create a view, stored procedure, function in a database.
SQL allows users to set permissions on tables, procedures, and views.
SQL Commands
SQL commands are instructions. It is used to communicate with the database. It is also used to perform
specific tasks, functions, and queries of data.
SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set
permission for users.
Types of SQL Commands
There are three types of SQL commands
1. Data Definition Language (DDL)
DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.
All the command of DDL are auto-committed that means it permanently save all the changes in the
database. Here are some commands that come under DDL:
CREATE
ALTER
DROP
2. Data Manipulation Language
DML commands are used to modify the database. It is responsible for all form of changes in the database.
The command of DML is not auto-committed that means it can't permanently save all the changes in the
database. They can be rollback. Here are some commands that come under DML:
INSERT
UPDATE
DELETE
3. Data Query Language
DQL is used to fetch the data from the database. It uses only one command:
SELECT