SQLStructured Query Language (SQL) is the most popular computer language used to create, modify and query databases. Technically, SQL is a declarative computer language for use with "quasi-relational databases". Theorists note that many of the original SQL features were inspired by, but in violation of, tuple calculus. Recent extensions to SQL achieved relational completeness, but have worsened the violations, as documented in The Third Manifesto.
Origins"A Relational Model of Data for Large Shared Data Banks," by Dr. Edgar F. Codd, was published in June,1970 by in the Association for Computing Machinery (ACM) journal, Communications of the ACM. Codd's model became widely accepted as the definitive model for relational database management systems RDBMS. A language, Structured English Query Language ("SEQUEL") was developed by IBM to apply Codd's model. SEQUEL later became SQL, presumably because trademark conflicts caused IBM to switch from the original name. In 1979, Relational Software, Inc. (now Oracle Corporation) introduced the first commercially available implementation of SQL and, soon, many vendors developed dialects of it. SQL was adopted as a standard by the American National Standards Institute (ANSI) in 1986 and ISO in 1987. In their SQL standard, the ANSI declared that the official pronunciation for SQL is "es queue el". However, many (if not most) english-speaking database professionals still pronounce the name of the language as sequel. The SQL standard has gone through a number of revisions:
Although SQL is defined by both ANSI and ISO, there are many extensions to and variations on the version of the language defined by these standards bodies. Many of these extensions are of a proprietary nature, such as Oracle Corporation's PL/SQL or Sybase and Microsoft's Transact-SQL. It is also not uncommon for commercial implementations to omit support for basic features of the standard, such as the
As the name implies, SQL is designed for a specific, limited purpose -- querying data contained in a relational database. As such, it is a set-based, declarative computer language rather than an imperative language such as C or BASIC which, being programming languages, are designed to solve a much broader set of problems. Language extensions such as PL/SQL are designed to address this by turning SQL into a full-fledged programming language while maintaining SQL's current advantages. Another approach is to allow programming language code to be embedded in and interact with the database. For example, Oracle and others include Java in the database, while PostgreSQL allows functions to be written in Perl, Tcl, or C, among other languages. One joke about SQL is that "SQL is neither Structured, nor a Language." This is founded on the notion that pure SQL is not a programming language since it is not Turing complete. Description of SQLLike some database-oriented fourth-generation programming languages such as Focus or SAS, SQL assumes a default file structure (data layout), and automates the process of identifying files to the operating system, opening the input file, reading the next record, opening the output file, writing the next record, and closing the files. This allows the user/programmer to concentrate on the details of working with the data within each record, in effect working almost entirely within an implicit program loop that runs for each record. Compared to general-purpose programming languages, this structure allows the user/programmer to be less familiar with the technical details of the data and how it is stored, and relatively more familiar with the information contained in the data. This blurs the line between user and programmer, appealing to individuals who fall more into the 'business' or 'research' area and less in the 'information technology' area. This in turn has the double edged result of allowing rapid answers to business or research questions, even ones requring several iterations to get from the initial results to a final answer; but also contributing to the construction of a large body of badly written and impossible to maintain source code. SQL contrasts with the more powerful database-oriented fourth-generation programming languages such as Focus or SAS, however, in its relative functional simplicity and simpler command set. This greatly reduces the degree of difficulty involved in maintaining the worst SQL source code, but it also makes programming such questions as 'Who had the top ten scores?' more difficult, leading to the development of procedural extensions, discussed above. However, it also make it possible for SQL source code to be produced (and optimized) by software, leading to the development of a number of natural language database query languages, as well as 'drag and drop' database programming packages with 'object oriented' interfaces. Often these allow the resultant SQL source code to be examined, for educational purposes, further enhancement, or to be used in a different environment. SQL keywordsSQL keywords fall into several groups. First there are the standard Data Manipulation Language (DML) elements. DML is the subset of the language used to query a database and add, update and delete data.
Three other keywords could be said to fall into DML:
The second group of keywords is the Data Definition Language (DDL). DDL allows the user to define new tables and associated elements. Most commercial SQL databases have proprietary extensions in their DDL, which allow control over proprietary and nonstandard, but usually operationally vital, elements of the specific system. The most basic items of DDL are the
Some database systems also have an The third group of SQL keywords is the Data Control Language (DCL). DCL handles the authorisation aspects of data and permits the user to control who has access to see or manipulate data within the database. Its two main keywords are
Database systems using SQL
Possible Criticisms of SQL
Alternatives to SQL
External links
de:SQL es:SQL eo:SQL fr:Structured query language ku:SQL hu:SQL programozási nyelv nl:SQL ja:SQL pl:SQL pt:SQL ru:SQL fi:SQL sv:SQL uk:Мова програмування SQL zh:SQL
Categories: Database management systems | Query languages |
|
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information. |