Questions tagged [sql-standard]

For questions concerning the SQL Standard itself (also known as the ANSI or ISO SQL Standard) including writing queries that conform to that standard. This tag is NOT to be used for questions about SQL Server Standard Edition.

SQL, or Structured Query Language, is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS), or for stream processing in a relational data stream management system (RDSMS).

Originally based upon relational algebra and tuple relational calculus, SQL consists of a data definition language and a data manipulation language. The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control. Although SQL is often described as, and to a great extent is, a declarative language (4GL), it also includes procedural elements.

SQL was one of the first commercial languages for Edgar F. Codd's relational model, as described in his influential 1970 paper, "A Relational Model of Data for Large Shared Data Banks." Despite not entirely adhering to the relational model as described by Codd, it became the most widely used database language.

SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987. Since then, the standard has been revised to include a larger set of features. Despite the existence of such standards, though, most SQL code is not completely portable among different database systems without adjustments.

118 questions
30
votes
4 answers

Where can I find the first standardization of SQL, SQL-86?

This question is different but similar to this request looking for SQL-89. The first draft of SQL is labeled SQL-86. Numerous references are made to it. Is this available to download? Wikipedia doesn't even have a page for it. I'm interested in it…
Evan Carroll
  • 63,051
  • 46
  • 242
  • 479
17
votes
2 answers

Where can I find the SQL standard document?

Where can I find a legal copy of the ISO SQL 2008 standard?
Philᵀᴹ
  • 31,762
  • 10
  • 83
  • 107
11
votes
3 answers

What actually is a SQL clause?

This may sound like an overly simple question but I'm not finding it easy to locate a proper answer. To the question "What are sql clauses?" most of the resources on internet simply provide a list of clauses and explain what they do. But I'm…
Kshitiz Sharma
  • 3,237
  • 9
  • 31
  • 35
9
votes
4 answers

Which SQL standard is most broadly and completely supported?

I want to concentrate on one of the SQL language specs for learning and reference purposes. Which version of the SQL standard is most broadly supported across DBMS'es so that I can focus my time and energy on it ?
mumtaz
  • 767
  • 1
  • 7
  • 10
9
votes
3 answers

Where can I find the SQL-89 standard?

This question is different but similar to this request looking for SQL-86. SQL 1989 is almost 30 years old. Is this spec freely available anywhere. The standard does not have a Wikipage or the like? The spec goes by ANSI X3.135-1989 Database…
Evan Carroll
  • 63,051
  • 46
  • 242
  • 479
7
votes
1 answer

the 's

I just know a little sql basics and need to write a plain sql syntax highlighter/checker So I'm fighting through the standard... I stumbled over somthing I'm not sure I understand it right, as I never have seen someone using a SET in that way. Its…
Zaibis
  • 171
  • 1
  • 3
7
votes
1 answer

Which DBMS are more standard compliant?

I find it frustrating that the same queries don't work in different DBMS. Example, some DBMS (such as Microsoft SQL Server and MySQL) seems to support the information_schema table, while others (such as SQLite) don't. Some databases such as MySQL…
Fred
  • 173
  • 7
5
votes
1 answer

Are view references in a query properly called "derived tables" as such?

While answering a question on stackoverflow, I presented a definition of derived tables: A derived table is a complete query, inside of parentheses, that is used as if it were a real table. But a commenter objected: Though there are other kinds…
ErikE
  • 4,305
  • 4
  • 28
  • 39
4
votes
3 answers

Obtaining gratis copy of the SQL specification?

There used to be a public link to the JTC 1/SC 32 working drafts of 9075:2003, but the link I had has not worked since they started on the post-2003 revisions. Given that there are publicly available copies of many of their other specifications…
TML
  • 1,364
  • 12
  • 20
3
votes
1 answer

query that does functionality of listagg without use of it

I want to write a query so that it does functionality of listagg in oracle but I don't want to use it. Actually I don't want any function like lag and lead also. My table is- Emp_id Emp_name …
2
votes
1 answer

Does SQL/MED (ISO/IEC 9075-9) defines a writable foreign data wrapper interface

I just can't find anything about it. I don't have the paper or draft of the SQL:2011, and have almost only drafts from SQL:2008, 2006, 2003. Does anyone know if "SQL/MED (ISO/IEC 9075-9)" defines a writable foreign data wrapper interface?
2
votes
1 answer

Why pad instead of trim when comparing strings?

The ANSI/SQL-92 standard states that strings have to be padded to the same length when compared: 3) The comparison of two character strings is determined as fol- lows: a) If the length in characters of X is not equal to the…
Vedran
  • 123
  • 5
2
votes
4 answers

What computations can NOT be performed in standard SQL?

I know loops cannot be expressed in standard SQL. What other forms of processing can it not perform?
jl6
  • 805
  • 7
  • 15
1
vote
1 answer

What are the SQL standards

Some job descriptions mention required knowledge of SQL standards. What do they mean by that? I found something on wiki http://en.wikipedia.org/wiki/SQL#Standardization but I don't really know what to think of it.
meridius
  • 165
  • 1
  • 7
1
vote
0 answers

Why can you specify CASCADE after DROP but not after DELETE?

What is the reasoning behind the design that you can specify CASCADE after a DROP query (DML) like DROP users CASCADE; but not in a DELETE query (DDL) like DELETE FROM users WHERE user_id = 2 CASCADE;? Example: CREATE TABLE users ( user_id integer…
user323094
  • 119
  • 2
1
2