• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Is the syntax the same across database systems?

pr0pensity

[H]ard|Gawd
Joined
Sep 2, 2003
Messages
1,738
Is the basic syntax pretty much the same for Oracle and Microsoft as it is for MySQL with insert, delete, and update queries? Can I do <b>select * from x where y</b> and so on?
 
I can't speak for MS, but Oracle and MySQL are similar with few exceptions. Insert, Update, Select are pretty much the same.

Someone correct me if I'm wrong. I haven't used Oracle in a long time.
 
There's an ANSI standard (SQL92, dunno about the newer ones) that most support that covers all the basic stuff (insert, delete, update, select, that kinda thing), but all the various databases have their own extensions of that for various functionality.

Perfect example is getting the top X rows of a query back. SQL Server uses this syntax:

SELECT TOP 10 * FROM MyTable;

While Oracle uses this:

SELECT * FROM MyTable WHERE rownum <=10;


They both claim to be SQL92-compliant though (as of Oracle 9 i believe).
 
Pretty much. There's a few quirks to Oracle's SQL, such as using (+) in your where clause instead of OUTER JOIN. Older versions of MySQL wouldn't let you do certain types of subqueries, too.

The biggest difference you're going to notice, until you start getting into triggers/stored procedures, is that some of the built-in functions might differ a little between DBMSes or you might find some minor differences in semantics (personally, I find Oracle's handling of empty strings as nulls to be a little bothersome).
 
Simple queries, like the one you quote, should work across database systems without much trouble.

There are lots of keywords which are not supported; the more advanced you get, the more you have to worry. Unfortunately, "advanced" isn't necessarily complicated -- simple things like outer joins or built-in functions are often different.

MySQL is the worst of the bunch, as they don't support many important constructs. They'll also claim that functionality is supported, but it turns out to only be syntactically supported but not semantically supported.

Oracle and SQL Server implement the language differently, particularly when they're implementing things that are not in the standard (or weren't in the standard at the time they were added to the product). The ANSI SQL Standard is remarkably small; many things you might take for granted turn out not to be specified.
 
Back
Top