Structured query language (SQL) is a programming language with special purposes. Like other popular relational databases, OceanBase Database allows all programs and users to access data in the database by using SQL statements. Platforms or tools that allow users to access a database by using an interface or a web page actually support database access by using SQL statements.
History
In June 1970, Dr. E. F. Codd of California laboratory, San Jose of IBM, published a paper "A Relational Model of Data for Large Shared Data Banks" in the Association for Computing Machinery (ACM) Journal and proposed the concept of relational model for the first time.
In 1974, D.D.Chamberlin and R.F. Boyce developed a set of Structured English QUEry Language (SEQUEL) in the relational database system SystemR developed by IBM, and then published SEQUEL/2 on IBM Journal of R&D in November 1976, which was renamed SQL in 1980.
In 1979, Oracle first provided commercial SQL and IBM also implemented SQL in DB2 and SQL/DS database systems at the same time.
Today, SQL has become the standard language for Relational Database Management System (RDBMS).
SQL standards
In October 1986, American National Standards Institute (ANSI) adopted SQL as the standard language of relational database management systems and named it ANSI x3.135-1986. Later, the International Organization for Standardization (ISO) also adopted SQL as an international standard.
In 1989, ANSI adopted and used SQL defined in the ANSI X3.135-1989 report and named it ANSI SQL 89. This standard replaced the previous ANSI X3.135-1986.
The following is the brief development history of SQL:
In 1986, ANSI X3.135-1986, ISO/IEC 9075:1986, SQL-86.
In 1989, ANSI X3.135-1989, ISO/IEC 9075:1989, SQL-89.
In 1992, ANSI X3.135-1992, ISO/IEC 9075:1992, SQL-92 (SQL2).
In 1999, ISO/IEC 9075:1999, SQL:1999 (SQL3).
In 2003, ISO/IEC 9075:2003, SQL:2003.
In 2008, ISO/IEC 9075:2008, SQL:2008.
In 2011, ISO/IEC 9075:2011, SQL:2011.
Now, most of the SQL standards are the most basic and core parts of SQL-92. OceanBase Database complies with SQL-92 and partial important features of subsequent SQL standards.
SQL statement execution
SQL acts as an interface to access relational databases such as OceanBase, Oracle, and MySQL databases. All SQL statements are commands used on databases.
SQL is composed of five parts:
The data query language (DQL), which is also referred to as a data retrieval language to retrieve data from a table and describe how to return the data to a program. DQL does not change the data content stored in the database.
The data manipulation language (DML), which is used to change the data content in the database, including creating, updating, and deleting data.
The transaction control language (TCL), which ensures the integrity and consistency of the database, TCL also ensures that all DML statements in a transaction are all successful or all failed.
The data control language (DCL), which serves as commands to control data access. You can use DCL statements to control access of specific accounts to resources in a database.
The data definition language (DDL), which defines, modifies, and deletes resources in the database. For example, you can create or drop a table by executing a DDL statement.
Portability
SQL is a standard language to access databases and all popular relational databases support SQL. Therefore, SQL applications are portable across all conforming software products. Generally, only slight modifications are required to migrate from one relational database to another.
Conventions
Bold indicates GUI elements related to operations or GUI elements related to terminologies defined using text or vocabulary.
Reserved words, keywords, identifiers, and parameters are case-insensitive. However, they are written in uppercase to facilitate reading.
SQL statement termination mode varies in different programming environments. A semicolon (;) is used to mark the end of an SQL statement.
In-line codeindicates code referenced in a document.Notes, precautions, and important content are marked in bold to highlight important information.
Optional parameter text is enclosed in brackets ([ ]). For example, [-n, -quiet] provides two optional parameters, -n and -quiet.