ANSI SQL Manual

SqlReferenceManualAnsi Sql

Sql Problem Overview


Can anyone recommend a good ANSI SQL reference manual?

I don't necessary mean a tutorial but a proper reference document to lookup when you need either a basic or more in-depth explanation or example.

Currently I am using W3Schools SQL Tutorial and SQL Tutorial which are ok, but I don't find them "deep" enough.

Of course, each major RDBMS producer will have some sort of reference manuals targeting their own product, but they tend to be biased and sometime will use proprietary extensions.

EDITED: The aim of the question was to focus on the things database engines have in common i.e. the SQL roots. But understanding the differences can also be a positive thing - this is quite interesting.

Sql Solutions


Solution 1 - Sql

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.

Solution 2 - Sql

SQL isn't like C or Java, where there is a standard for the language, and then a number of companies and organizations are implementing the language as best they can, following the standard.

Instead, the major databases came before the SQL standard, and the standard is a sort of compromise where every database vendor wanted to get their particular dialect and features in the standard.

Therefore, there is much more variety between databases than between typical programming language compilers, and to use a database, you really need to know that particular SQL dialect.

Having said that, I've got Gultzan and Peltzer's SQL-99 Complete, Really here in my bookshelf. It is a good book if you need to know what the standard really contains. (And yes, there is a newer version since SQL-99, but noone seems to care.)

EDIT: Actually, there is not just one newer version since SQL-99, but three: SQL:2003, SQL:2006, and SQL:2008. And still noone seems to care. Actually, many don't even care about SQL-99, so SQL-92 is still, in a way, "the standard".

Solution 3 - Sql

ANSI documents can all be purchased from -- you guessed it -- ANSI.

http://webstore.ansi.org/

Solution 4 - Sql

The main problem with an ANSI SQL reference manual is that you can't find a DB which implements it. And when it does, then you'll find that ANSI SQL can't solve some of the daily problems. Which is why all professional databases define extensions.

So at work, you'll need a reference manual for the specific version of the database which you use.

Solution 5 - Sql

This reminds me of my 2nd year university course where we learn relational theory instead of SQL.

Read a good book on Relational Theory. Database theory and practice have evolved since Edgar Codd originally defined the relational model back in 1969. Independent of any SQL products, SQL and Relational Theory draws on decades of research to present the most up-to-date treatment of the material available anywhere. Anyone with a modest to advanced background in SQL will benefit from the many insights in this book.

alt text

Oreilly January 2009

Solution 6 - Sql

I found the best way to learn SQL was to actually get to writing queries and understanding the nature of joins/conditionals etc. I found this link with a lot of DIY examples to be the best : http://sqlzoo.net/

Solution 7 - Sql

I really like just about anything Joe Celko has written [Celko's Books][1]

[1]: http://www.celko.com/books.htm "Celko's books"

Solution 8 - Sql

It's a littel outdated, but this book is really helpful is looking at how the differnt vendors implement things, I belive it includes ANSII standard.

http://www.amazon.com/SQL-Nutshell-2nd-Kevin-Kline/dp/0596004818/ref=sr_1_1?ie=UTF8&s=books&qid=1257963172&sr=8-1

Solution 9 - Sql

The DevGuru resources always worked well for me: http://www.devguru.com/technologies/t-sql/home.asp

Although I must admit it's not strictly an 'ANSI' focused resource. I've always been MS SQL centric, and it was helpful to me when I was starting out. IMHO Your best bet will be to use several resources - specifically including at least one of for each DB platform you want to use.

To Quote the DevGuru intro for their T-SQL resource:

> Although there are standards for SQL, > such as ANSI SQL92 and SQL99, most > databases use their own dialect and/or > extentions. Microsoft's flavor of SQL > used in SQL Server 7 and SQL Server > 2000 is called T-SQL. While many of > the examples in this quick reference > may work on other databases, it is > assumed that SQL Server 2000 is used, > especially for advanced topics such as > stored procedures.

Solution 10 - Sql

I think this may be helpful to you.

Understanding the ANSI SQL standard By: Kevin Kline

http://www.amazon.com/gp/product/1565927443/102-0105946-4028970?v=glance&n=283155

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAdrianView Question on Stackoverflow
Solution 1 - SqlbobinceView Answer on Stackoverflow
Solution 2 - SqlThomas Padron-McCarthyView Answer on Stackoverflow
Solution 3 - SqlS.LottView Answer on Stackoverflow
Solution 4 - SqlAaron DigullaView Answer on Stackoverflow
Solution 5 - SqlYadaView Answer on Stackoverflow
Solution 6 - SqlRitesh M NayakView Answer on Stackoverflow
Solution 7 - SqlMichael Riley - AKA GunnyView Answer on Stackoverflow
Solution 8 - SqlHLGEMView Answer on Stackoverflow
Solution 9 - SqlAdrian KView Answer on Stackoverflow
Solution 10 - Sqlsrikanth rongaliView Answer on Stackoverflow