SQL is a Standard Programming Language for retrieving and manipulating the relational database. It stands for Structured Query Language and sometimes pronounced as “See-Quel.” It used for managing data held in the Microsoft SQL Server, IBM DB2, Oracle, MySQL, Relational Database Management System (RDBMS) and Microsoft Access.
SQL has two advantages over the old APIs like ISAM or VSAM. First, you can easily access many records by a single command, and second, it has dropped the need to stipulate how to reach a file with or without an index.
In 1986 and 1987, SQL became a standard of the American National Standards Institute (ANSI), and of the International Organization for Standardization (ISO).
Although SQL became standard of ANSI/ISO, yet different versions of the SQL language are available. For example, a set of extensions offered by Microsoft called Transact-SQL (T-SQL), while PL/SQL is Oracle’s extended version. Though, they all support at least the main commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in the same way.
What can SQL Do?
- SQL can execute queries against a database.
- SQL can insert, change or update records in a database.
- SQL can remove or retrieve records from a database.
- SQL can create new databases or can add a new table in an existing database.
- SQL can create stored procedures and opinions in a database.
- SQL can set permissions on tables, procedures, and views.
SQL uses specific commands to carry out the required tasks those guidelines are mainly characterized into four classes as explained under:
DDL (Data Definition Language):
DDL or Data Definition Language consists of the Agile Scrum that deal with descriptions of the database schema and is used to create and change the structure of the database.
- CREATE is used to create the database or its objects.
- DROP is used to remove objects from the database.
- ALTER is used to change the structure of the database.
- TRUNCAT is used to remove all records from a table.
- COMMENT is used to add comments in the data dictionary.
- RENAME is used to rename objects in the database.
TCL (Transaction Control Language):
TCL instructions deal with any transaction within the database.
- COMMIT commits a Transaction.
- ROLLBACK rollbacks a transaction in case of an error occurs.
- SAVEPOINT sets a savepoint within a transaction.
- SET TRANSACTION specifies characteristics for the transaction.
DML (Data Manipulation Language):
These commands deal with the manipulation of data present in the database.
- SELECT is used to retrieve data from the database.
- INSERT is used to enter data into a table.
- UPDATE is used to update existing data within a table.
- DELETE is used to remove records from a database table.
DCL (Data Control Language):
DCL includes commands deals with Azure DevOps, permissions and other controls of the database system.
- GRANT gives user access privileges to the database.
- REVOKE withdraw user access privileges.