By Mahesh Vyas 11 January, 2020
Structured Query Language (SQL) is a standard Database language which is used to create, maintain and retrieve the data from relational database like MySQL, Oracle, SQL server, etc. It was developed by Donald Chamberlin and Raymond Boyce in the year 1974.
SQL is a standard language for Relational Database System. SQL was one of the first commercial language and becomes the most widely used database language. SQL is a programming language for rational databases. The program of SQL to control the database is called as database management system.
SQL using in a websites to use as a server-side scripting language, to get the data you want, to retrieve data from the database and to make data request.
The functions of SQL are as given below:
1. Creation of database.
2. Modification of database.
3. Deletion of database.
4. Retrieving the information into the database.
5. Displaying the information into the database.
6. Modification of information from the database.
SQL contains various types of statements for different purposes. SQL statements are divided into the four categories are as follows:
1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
3. Data Query Language (DQL)
4. Data Control Language (DCL)
Data definition language is used to design of the database is called database schema. It is used to create, alter and delete database objects. The data definition statements are CREATE, ALTER, DELETE.
Data manipulation language statements are used most frequently in SQL statements. It is used to insert, modify and delete the data in the database. The data manipulation statements are INSERT, UPDATE, and DELETE, SELECT.
Data query language is one of the most commonly used in the SQL statements. It is used to enable user to query one or more table to get the information they want. The data query has only one statement is SELECT.
Data control language consists of control that user access to the database objects. The data control statements consists of SAVE POINT, COMMIT, REVOKE, ROLLBACK.
When any of the user want to store a constant value into a column of a table, then a column must be declare a particular keyword called as data type. Following are the various domain (data) types are available in SQL are as given below:
CHAR: It is a fixed length character string with user specified length. It can store an alphanumerical value.
VARCHAR: It is a variable length character string with user specified maximum length. It is also store an alphanumerical value.
INTEGER: It is a data type which is used to store a numerical value.
NUMBER: It is a data type which is used to store a numerical data either integer or real numbers.
DATE: It is used to store a date containing year, month and day of a month.
TIME: It is used to store a time of day in seconds, minutes and hours.
FLOAT: It is used to store a floating point number, with precision of least digits.
NULL: It is a data type which is used to declaring a column in table.
The main applications of Structural Query Language (SQL) are as given below:
1. It is use to allow users to access data in the relational database management system.
2. It is use to allow users to define data in database and manipulate that data.
3. It is use to allow users to create and drop database and tables.
4. It is use to allow users to describe the data.
5. It is used for modification of the index structures and database table.
6. It is used for web pages which can extract data from SQL databases.