views:

825

answers:

13

If I were designing a oil refinery, I wouldn't expect that materials from different vendors would not comply with published standards in subtle yet important ways. Pipework, valves and other components from one supplier would come with flanges and wall thicknesses to ANSI standards, as would the same parts from any other supplier. Interoperability and system safety is therefore assured.

Why then are the common databases so choosy about which parts of the standards they adhere to, and why have no 100% standards-compliant systems come to the fore? Are the standards 'broken', lacking in scope or too difficult to design for?

Taking this to conclusion; what is the point of ANSI (or ISO) defining standards for SQL?

Edit: List of implementation differences between common databases

+9  A: 

Probably because standards conformance is of a low priority to database system purchasers. They are more interested in:

  • compatibility with what they've already got
  • performance
  • price
  • OS support

to name but a few factors.

The same is true of programming languages - very few (if any) compilers support every single feature of the current ANSI C and C++ standards.

As to why bother with standard, well most vendors do eventually bring standard support on board. For example, most vendors support more or less all of SQL89. This allows the vendor to tick a (relatively unimportant) check-box on their spec sheet and also allow people like me who are interested in writing portable code to do so, albeit having to forgo lots of bells and whistles.

anon
Indeed. You have a choice of using only the ANSI standard features and being able to switch databases more easily, or use all the features of your chosen database and be a lot more productive. For many people who have no intention of switching database providers the sensible choice is productivity. At which point, it doesn't matter whether it's standards compliant or not because you're already committed to non-standard features.
Greg Beech
I don't think it's quite the same situation as for C/C++. You're right that few compilers actually support the entire C++ language, but it's at least recognized as the right direction to go, and customers generally kick up a fuss if their compiler doesn't support the language features they need. In databases, users just accept nonconformance to a much greater extent. That's just how the world works, and no one really seems to mind.
jalf
@jalf yes, I think this is probably becuase procedural language programmers tend to have a much more "language lawyer" kind of outlook than do database guys - if a C++ programmer sees something in the standard, he wants it - now, whereas I've met lots of database guys (particularly DBAs) who probably aren't even aware there are ANSI SQL standards.
anon
+4  A: 

I don't know the history of ANSI SQL specifically. But it seems that many times in software development, standards are written after the major players have already implemented their own proprietary versions of things. Once a company is invested in its own way of doing things, it's really hard to justify changing or removing features people have come to rely on just to adhere to a standard. Web standards are a primary example of this phenomenon.

Ryan
Agreed. But this is also true in many other spheres, engineering included. Often a novel approach or market clout is enough to define a de-facto standard that in time becomes ratified by a standards body and then becomes *the* standard, observed universally. "IT" seems very bad at not fully closing the loop on the last part.
Lunatik
A: 

This is a classic - and here's the answer.

Nobody will die if your SQL implementation doesn't match the ANSI standard, whereas people could die at the oil refinery if the standards weren't followed.

Sohnee
It is not about subtle, unnoticable differences, it is about things that don't do what others have defined. Noone would die at the oil refinery either, because the engineers would find other ways or parts to build it anyhow. The same goes with databases: Noone dies at airports because of plane collisions, because the software developers for the tower had to work with non-fitting parts. They just found other ways to implement it (even without ANSI).
soulmerge
Plenty of people have died from software bugs. If you expected your database to follow the standard, and got an error instead, could conceivably be fatal too. In any case, the answer is much simpler. Database vendors don't sit around counting lives. They just do what their customers want, and their customers aren't all that interested in SQL compliance.
jalf
Oh, I forgot to mention that people were building bridges before ANSI was established.
soulmerge
It does get a bit semantic at this point, but if the standard at the oil refinery was that a pipe or casing should be 10mm thick and withstand 1000 degrees centigrade and someone manufactured a panel that didn't fit this standard and it was fitted instead of something that did, someone would die. In terms of software bugs, that's a little different from not implementing a standard.
Sohnee
+1  A: 

IMHO, the DB vendors push forward the ANSI SQL standards to include new features & constructs within their field much more than ANSI telling the DB vendors the "one true way".

The DB market is driven by features, scalability and cost. It is not a commercial priority to forego and delay a technical advantage (i.e. partitioning, pivot, UPSERT, replication) by waiting for ANSI to ratify the syntax. By the time that has been done, there is already a significant installation of the proprietary syntax.

That being said, most DB vendors have improved their core "ANSI SQL" support greatly in the last few years. (SQL Server with the SELECT FROM INFORMATION_SCHEMA and Oracle's ANSI joins actually working as well as native joins under the CBO)

Guy
+2  A: 

A few years ago, one of the worst industries as far as pipes and connectors being mutually compatible was firefighting equipment. There were literally dozens of mutually incompatible hose to pump connections. When mutual aid became commonplace among fire fighters, they had to bring along dozens of adaptors to be able to interoperate their equipment.

On September 11, both police and firefighters had private wireless networks for intercommunicating among their people. But, guess what? The two systems were not mutually compatible. So there were needless delays in communicating information from one kind of public safety servant to another.

If you go back far enough, you can find a time in New York City where about half the electric grid was DC, favored by Edison, and the other half was AC, favored by Westinghouse.

Standards sometimes come about by themselves, and are called de facto standards. More commonly, standards have to be set forth by a body specifically empowered to make it happen. As to the SQL standards, some of the largest vendors pre date the standard. In order to comply with the standard, they would have to put in engineering expense that doesn't benefit their existing client base. Worse yet, they might end up being incompatible with their own prior product.

Full compliance with the SQL standard might yet happen, but it's unlikely. Even if it does, there's a delay time between the evolution of a new SQL standard and compliance with it.

Walter Mitty
A: 

Most of them are pretty compliant. But here's the bad news, IMO - standards breed mediocrity. Vendors want you to get locked into their extensions, and there's often good reason to do to nonstandard things. Realistically, how likely are you to dump Oracle for SQL Server, or vice-versa? Unless you build a product that your cusotmers may use against other databases, you as an enterprise are unlikely to swap out DB's. Too painful.

n8wrl
+3  A: 

In the software industry you have some standards that are really standards, i.e., products that don't comply with them just don't work. File specifications fall into that category. But then you also have "standards" that are more like guidelines: they may defined as standards with point-by-point definitions, but routinely implemented only partially or with significant differences. Web development is full of such "standards", like HTML, CSS and "ECMAScript" where different vendors (i.e. web browsers) implement the standards differently.

The variation causes headaches, but the standardization still provides benefits. Imagine if there were no HTML standard at all and each browser used its own markup language. Likewise, imagine if there were no SQL standard and each database vendor used its own completely proprietary querying language. There would be much more vendor lock-in, and developers would have a much harder time working with more than one product.

So, no, ANSI SQL doesn't serve the same purpose as ANSI standards do in other industries. But it does serve a useful purpose nonetheless.

John M Gant
+1  A: 

The real reason: most "developers" are client-centric coders, and therefore neither understand nor care about Dr. Codd's 12 rules. This is also why MySql, which isn't a relational database in any significant manner, is frequently seen in webKiddie development. Such developers only want rudimentary SELECT, UPDATE, DELETE parsing. They eschew constraints of any kind, preferring to "do it in the application". Reactionary 1960's applications are what you get.

+3  A: 

Indeed, the ANSI SQL standard is not often followed. Just read SO: most SQL threads never refer to the standard while, for instance, discussions on network protocols often include the actual quote, chapter and verse of the relevant RFC.

I always suspected that one of the reasons is the fact that the SQL standard is not freely distributable. Simply getting it is not trivial. Various unofficial copies float around.)

Another reason is that it is a very complicated text and poorly organized. It uses a strange vocabulary (such as "authID" instead "user"). You need books just to understand the standard ("A guide to the SQL standard", C.J. Date, Hugh Darwen - Addison-Wesley).

bortzmeyer
Good point - I always wonder how you can call something a standard if people cannot simply look up the specification. You only need to look at the story about ISO's specification of Microsoft's OpenDocument format to see that the whole ISO standardization process is a joke.
Jakob
A: 

Here is a similar question about Reasons for SQL differences.

rics
+1  A: 

Mimer SQL has great standards support, yet it is pretty unknown. It is in production in several large sites, mostly in Sweden. But I think a lot of sites are migrating to others.

Detailed support statments:

  • SQL-99
  • SQL-2003
  • PSM
  • Database triggers and functions according to SQL:1999
  • Binary and Character Large OBjects (BLOB/CLOB/NCLOB) support according to SQL:1999
  • Multi-database transactions (two-phase commit) conforming to Open Group's XA-standard
  • Support for Java ME CDC Foundation Profile and Java ME CLDC/MIDP
oluies
+3  A: 

See the article "IS SQL A REAL STANDARD ANYMORE?" for a discussion about the current (2005) issues of the SQL standard.

oluies
Great document, thanks.
Lunatik
A: 

usually companies tend to adhere to one vendor to avoid having a jungle of different and incompatible systems to support.

why?

because it is a lot cheaper to train your developers/system engineers in just one database vendor's tools than in 3 different sets of tools.

well, once they achieve this and get operational efficiency, usually the company grows larger by acquiring the competition.

and then this means another entirely different set of tools that you have to manage, integrate, etc.

that's a lot of work.

imagine that instead of that, you have a portability layer so that you really don't care what's beneath...

Bill Catfish