Sunteți pe pagina 1din 2

SQL (Listeni/'?s kju? '?l/,[4] or Listeni/'si?kw?

l/;[5] Structured Query Languag


e[6][7][8][9]) is a special-purpose programming language designed for managing d
ata held in a relational database management system (RDBMS), or for stream proce
ssing in a relational data stream management system (RDSMS).
Originally based upon relational algebra and tuple relational calculus, SQL cons
ists of a data definition language, data manipulation language, and a data contr
ol language. The scope of SQL includes data insert, query, update and delete, sc
hema creation and modification, and data access control. Although SQL is often d
escribed as, and to a great extent is, a declarative language (4GL), it also inc
ludes procedural elements.
SQL was one of the first commercial languages for Edgar F. Codd's relational mod
el, as described in his influential 1970 paper, "A Relational Model of Data for
Large Shared Data Banks."[10] Despite not entirely adhering to the relational mo
del as described by Codd, it became the most widely used database language.[11][
12]
SQL became a standard of the American National Standards Institute (ANSI) in 198
6, and of the International Organization for Standardization (ISO) in 1987.[13]
Since then, the standard has been revised to include a larger set of features. D
espite the existence of such standards, though, most SQL code is not completely
portable among different database systems without adjustments.
Contents [hide]
1
History
2
Design
3
Syntax
3.1
Language elements
3.2
Operators
3.3
Queries
3.3.1 Subqueries
3.3.2 Inline view
3.3.3 Null or three-valued logic (3VL)
3.4
Data manipulation
3.5
Transaction controls
3.6
Data definition
3.7
Data types
3.8
Data control
4
Procedural extensions
5
Interoperability and standardization
6
Alternatives
7
Distributed SQL processing
8
See also
9
Notes
10
References
11
External links
History[edit]
SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce
in the early 1970s.[14] This version, initially called SEQUEL (Structured Englis
h QUEry Language), was designed to manipulate and retrieve data stored in IBM's
original quasi-relational database management system, System R, which a group at
IBM San Jose Research Laboratory had developed during the 1970s.[14] The acrony
m SEQUEL was later changed to SQL because "SEQUEL" was a trademark of the UK-bas
ed Hawker Siddeley aircraft company.[15]
In the late 1970s, Relational Software, Inc. (now Oracle Corporation) saw the po
tential of the concepts described by Codd, Chamberlin, and Boyce, and developed
their own SQL-based RDBMS with aspirations of selling it to the U.S. Navy, Centr
al Intelligence Agency, and other U.S. government agencies. In June 1979, Relati

onal Software, Inc. introduced the first commercially available implementation o


f SQL, Oracle V2 (Version2) for VAX computers.
After testing SQL at customer test sites to determine the usefulness and practic
ality of the system, IBM began developing commercial products based on their Sys
tem R prototype including System/38, SQL/DS, and DB2, which were commercially av
ailable in 1979, 1981, and 1983, respectively.[16]
Design[edit]
SQL deviates in several ways from its theoretical foundation, the relational mod
el and its tuple calculus. In that model, a table is a set of tuples, while in S
QL, tables and query results are lists of rows: the same row may occur multiple
times, and the order of rows can be employed in queries (e.g. in the LIMIT claus
e).
Critics argue that SQL should be replaced with a language that strictly returns
to the original foundation: for example, see The Third Manifesto.
Syntax[edit]
It has been suggested that this section be split into a article titled SQL synta
x. (Discuss) (June 2015)
Language elements[edit]
A chart showing several of the SQL language elements that compose a single state
ment
The SQL language is subdivided into several language elements, including:
Clauses, which are constituent components of statements and queries. (In some ca
ses, these are optional.)[17]
Expressions, which can produce either scalar values, or tables consisting of col
umns and rows of data
Predicates, which specify conditions that can be evaluated to SQL three-valued l
ogic (3VL) (true/false/unknown) or Boolean truth values and are used to limit th
e effects of statements and queries, or to change program flow.
Queries, which retrieve the data based on specific criteria. This is an importan
t element of SQL.
Statements, which may have a persistent effect on schemata and data, or may cont
rol 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
.
Insignificant whitespace is generally ignored in SQL statements and queries, mak
ing it easier to format SQL code for readability.
Operators[edit]
Operator
Description
Example
=
Equal to
Author = 'Alcott'
<>
Not equal to (many DBMSs accept != in addition to <>) Dept <> 'Sales'
>
Greater than
Hire_Date > '2012-01-31'
<
Less than
Bonus < 50000.00
>=

S-ar putea să vă placă și