I’ve read that although SQL is meant to be standardised, it is implemented different etc with different databases. I have only ever used MySQL for databases.
What I would like to know is what other databases share the same syntax? I am using PDO now, and I would like to set a flag to allow the user to specify which database they would like to use.
I would be interested in knowing which are the ‘safe’ databases that will handle most (if not all) my general MySQL queries. Mainly SELECT, INSERT, UPDATE, DROP, DELETE.
Thanks
There are several revisions of a such called
ANSI SQL.All major database engines (that is
Oracle,MS SQL,PostgreSQLandMySQL) should (should) in theory supportSQL-92.This includes everything you’ve mentioned:
SELECT,INSERT,UPDATE,DROP,DELETE, as long as you don’t use complex clauses with them.In practice:
Not all databases support the full set of
SQL-92.Writing cross-platform
SQLeven inSQL-92requires lots of testing.Platform independency in
SQLends when you insert your1001strow and need to optimize you queries.If you browse a little over
StackOverflowquestions taggedSQL, you will see that most of them say ‘help me to optimize this query‘, and most answers say ‘use this platform dependent hack‘