Structured Query Language (SQL)
What is SQL?
SQL is a standardised programming language. It allows users to manage relational databases and perform all kinds of operations in these relational databases. Besides these operations, SQL can also be used to perform analytical queries by data analysts or to write data integration scripts by developers. SQL is important to the technology stack and is therefore used by many governments, businesses and scientific applications. Moreover, it is used by many different professions such as Data Scientists, Database Developers, Data Analysts, Business Intelligence Analysts and Data Engineers.
SQL: History
SQL was created in the 1970s by Donald D. Chamberlin and Raymond F. Boyce who were working at IBM at the time. The first version, called SEQUEL (Structured English Query Language), was created to retrieve and manipulate data stored in IBM's original database system.
After SQL was tested at various test sites to determine how usable and practical SQL was, commercial products based on IBM's System R prototype were developed. System/38, SQL/DS and IBM Db2 were released and made available to customers in 1979, 1981 and 1983, respectively.
Database language SQL was later adopted by ISO and ANSI, which later released all the new versions mentioned in the next section.
SQL: versions
Since the development of SQL, many new versions have been released:
- SQL-86
- SQL-89
- SQL-92
- SQL 1999
- SQL 2003
- SQL 2006
- SQL 2008
- SQL 2011
- SQL 2016
- SQL 2019
- SQL 2022
What is SQL used for?
There are many options when using SQL. However, these are the tasks most commonly used:
- Using SELECT statements to retrieve data from a given database.
- Inserting, deleting and updating data in a database.
- Managing permissions and security of a database.
- Restoring and backing up databases.
- Create, delete and modify tables and records.
- Monitor and optimise database performance.
- Merge and group data.
SQL: syntax
Within the SQL language, there are several language elements:
- Expressions: expressions can produce tables consisting of rows and columns for certain data or scalar values.
- Predicates: Predicates select conditions to be evaluated in SQL logic with three values. They are used to constrain statement effects and queries.
- Queries: queries retrieve specific criteria within databases.
- Clauses: clauses are components of queries and statements.
- Statements: statements return data as a result of queries, change the structure of tables or data, and can delete data and entire tables.