views:

78

answers:

4

Does Postgresql and Mysql use different SQL:s?

I have a book, Head First SQL. If they are different, how do I know which database SQL it is?

+4  A: 

Each database vendor will use a good amount of ANSI SQL with their own proprietary extensions on top of it. So while something like ISNULL is proprietary, MySQL and SQL Server use it, you could use COALESCE which is supported by Postgresql , MySQL, SQL Server and others. Unfortunately you will have to go through the documentation and see what each vendor supports.....it will take time

SQLMenace
So every vendor decides what they wanna use from standard SQL? Or do they use 100% of it and then build some extra features? I need to know this so I know how to relate the Head First SQL to Postgresql (wether I could use everything I've learned or not).
never_had_a_name
The problem is that there is SQL 99, sql 2003, sql 2008 and no vendor supports 100% of it as far as I know.
SQLMenace
It's like programming for the web each browser implements as much of the html/css/etc specs as they want... and you see how much pain that causes...
xenoterracide
btw... postgres seems to be one of the more standards compliant sql's.
xenoterracide
Postgres implements 90%+ of ANSI but has ALOT of extensions.
rfusca
rfusca which ANSI? I'm pretty sure they're missing quite a bit of 2008, and I really wish they'd implement SQL/PSM and some of the other things (and yes I know I could add PSM on)
xenoterracide
The SQL standard (starting from sql99 IIRC) define a "core" and then a bunch of optional features. There's a lot of those optional features that PostgreSQL does not implement.
alvherre
+1  A: 

Here's how MySQL implements standard SQL http://dev.mysql.com/doc/refman/5.1/en/compatibility.html

Mchl
+2  A: 

This link will definitely cleared all your doubts

MySQL Vs PostgreSQL

Ashay
A: 

These two comparisons are also very good:

http://troels.arvin.dk/db/rdbms/

http://en.wikibooks.org/wiki/SQL_dialects_reference

a_horse_with_no_name