Introduction to SQL
What is SQL?
SQL stands for Structured Query Language. SQL is an ANSI standard language used to communicate with database. It is used to create and manipulate databases.
Evolution of SQL
Dr. E. F. Codd, a researcher for IBM, first defined the model for the basis of SQL in 1970. After that, in 1974 IBM started the System/R project which eventually created the SEQUEL(Structured English Query Language). This was later modified and renamed as SQL in 1978.
Types of SQL Commands
The standard SQL commands can be categorized as:
DDL: Data Definition Language
It is used to define and manipulate databases and tables. It allows to add, modify and delete the logical structure which contain the data.
CREATE, ALTER, DROP, RENAME, TRUNCATE are DDL commands.
DML: Data Manipulation Language
It is used to add, manipulate and delete the data inside the table.
INSERT, UPDATE, DELETE are DML commands.
DQL: Data Query Language
It is used to extract data from a database.
SELECT, SHOW and HELP statements belongs to DQL.
DCL: Data Control Language
It is used to define permissions on databases and their content.
GRANT and REVOKE commands are DCL.
DTL: Data Transaction Language
It is used to manage transactions.
START TRANSACTION, SAVEPOINT, COMMIT, ROLLBACK, [TO SAVEPOINT] come under DTL.