SQL stands for Structured Query Language. Basically, SQL is used to communicate with and manipulate a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.
SQL consists of three sub-languages — a data definition language, data manipulation language, and a data control language. Read more about DDL, DMl and DCL here.
The SQL language is subdivided into several language elements, including:
- Clauses, which are constituent components of statements and queries. In some cases, these are optional.
- Expressions, which can produce either scalar values, or tables consisting of columns and rows of data
- Predicates, which specify conditions that can be evaluated to SQL three-valued logic (3VL) (true/false/unknown) or Boolean truth values and are used to limit the effects of statements and queries, or to change program flow.
- Queries, which retrieve the data based on specific criteria. This is an important element of SQL.
- Statements, which may have a persistent effect on schemata and data, or may control transactions, program flow, connections, sessions, or diagnostics.
- SQL statements also include the semicolon (";") statement terminator. Though not required on every platform, it is defined as a standard part of the SQL grammar.
Example of SQL query
Here is simple SQL query which select names of employees whose age is more than 25 years:
SELECT Name FROM dbo.Employee WHERE Age > 25
- SQL stands for Structured Query Language and is used to communicate with and manipulate a database.
- The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.