How to Find SQL Language Specification

Where can I find SQL language specification

There is an official SQL standard from the ISO/ANSI committee.

Some information can be found here: http://en.wikipedia.org/wiki/Sql

However the specification itself is not freely available. You might find some drafts of older specs in the internet if you search for it.

A nice explanation of the (yet a bit old) ANSI 99 standard is here: https://mariadb.com/kb/en/sql-99-complete-really/

Here is a compilation of at least the BNF syntax for various versions of the standard

Where can I find a complete reference for Microsoft Access SQL?

Open MS Access, go to a module and open it, bringing up the Code Editor.
In the code editor, choose Help > Microsoft Visual Basic Help.
Now choose 'Microsoft Jet SQL Reference'.

I will soon be releasing a library that includes a JET SQL parser.
It enhances JET SQL to provide all of the DDL functions not currently available in SQL, and offers automated back end update using a version number and version update scripts.

EDIT: Of course, I forgot that they've probably screwed all this up in later versions of Office.

I checked and the above works in Access 2003 (the last usable version of Access, which I still use for development) and Access 2007. Noting you MUST be in the code window, not the main Access database window!

In Access 2013, this has all moved to the web. However it looks like there is still a 'Developer Reference' link on the web page, and this takes you to a page substantially like the offline one. After clicking some links I'm ending up at: msdn.microsoft.com/en-us/library/dn142571.aspx

Hopefully since this is Access 2013, the link won't die too soon.

Is there a defined and accepted standard SQL language?

Yes, there are SQL ANSI standards, see e.g. a draft of the SQL-92 one. However, every database vendor implements "an extended subset" of standard SQL -- and if you think about it, anything is an "extended subset" of anything else, in a sense;-). No doubt there are commercial reasons behind this, but even non-commercial implementations such as PostgreSQL behave much the same...

JDBC SQL:Where is the detailed specification?

There is no "JDBC SQL", just ISO SQL and the vendor implementations of it. JDBC defines the interface for talking to SQL databases, it's a different layer to the query language its self.

The reference for JDBC its self is the JSR documentation:

  • JDBC 4.0
  • JDBC 4.1

Unfortunately the official SQL standards are expensive and must be purchased from the ISO.

You can find late-stage drafts that're perfectly good for reference when you're not trying to develop a conforming implementation here among other places.

The SQL spec isn't the most friendly and readable of things, so in practice it's a good idea to use vendor documentation that's actually intended to be read by human beings. You can compare a couple of vendor docs or fall back on the standard doc when uncertainty arises.

Standard compliance with the spec isn't exactly ideal across DBs; writing code strictly to the spec doesn't necessarily mean it'll actually work. For example, MySQL doesn't impliment window functions or common table expressions, PostgreSQL doesn't implement SQL/PSM (instead offering PL/PgSQL) or the CALL statement; most vendors use different ways of specifying auto-increment columns or sequence generators; etc etc etc.

Please don't use the w3schools SQL guides, they're severely outdated, wrong, fail to differentiate between vendor extensions and the standard, and should generally be avoided. I mention them because w3schools tends to come up quite high in search rankings - back in the day they used to actually be useful.

Where in the relevant specification is it documented that some comments in a SQL script are, in fact, to be executed as valid SQL (by MySQL)?

It's in the manual, under "Comment Syntax."

http://dev.mysql.com/doc/refman/5.6/en/comments.html

/*! MySQL-specific code */ 

In this case, MySQL Server parses and executes the code within the comment as it would any other SQL statement, but other SQL servers will ignore the extensions. 

...

If you add a version number after the “!” character, the syntax within the comment is executed only if the MySQL version is greater than or equal to the specified version number.

In the case of stored procedures, the entire declaration wrapped, so that if you tried to restore the dump file on a version of MySQL server that's so old it didn't support stored procedures at all, the procedure definitions would be ignored by the server instead of causing the entire restore operation to fail.

ANSI SQL Manual

Here's the ‘Second Informal Review Draft’ of SQL:1992, which seems to have been accurate enough for everything I've looked up. 1992 covers most of the stuff routinely used across DBMSs.

Language specification for Juttle?

Jut publishes the Juttle documentation here:

http://juttle.github.io/juttle/

Where can I read C99 official language standard manual/reference/specification online?

The official standard should not be available online — ISO and its national standards bodies would be unhappy about that. You can obtain an official electronic copy from the ANSI store (http://webstore.ansi.org/) for $18 $30 (or thereabouts — it was $18 when I obtained the C99 standard, but that was quite a while ago now; it was $30 for the C11 standard). Or you can go to the web site linked in other answers (and via Wikipedia) — namely http://www.open-std.org/jtc1/sc22/wg14/ - and obtain almost official copies of the standards documents.



Related Topics



Leave a reply



Submit