It's a relational query language, but it tries hard to hide its nature. For example, in a _true_ relational language such mistake should be immediately noticeable: "select a.id, b.id from table_a a, table_b b where a.some=123 and b.some>1435". It should be immediately obvious that a Cartesian product is being created (probably accidentally).
Also, SQL is way too verbose (especially treatment of NULLs), incomplete (nested grouping), real queries depend on vendor-specific features, CTEs are a poorly-designed bolt-on for tree-structured queries, etc. In short, SQL is horrible.
Posted Jul 30, 2011 23:56 UTC (Sat) by euske (subscriber, #9300)
[Link]
My point is that, to many programmers, anything that gets their job done without much effort (i.e. learning new stuff) is considered sensible. Many people probably understand that SQL is horrible, but that does not change their behavior until there's an easier solution. It's hard for many people to "unlearn" the way of doing things once they've accustomed themselves to it.
Not sure if that's a good idea
Posted Jul 31, 2011 13:28 UTC (Sun) by endecotp (guest, #36428)
[Link]
I would still rather have something that is more like raw relational algebra though. I always find it surprising that such a thing doesn't already exist in the mainstream. I guess the problem is that SQL is "good enough".
Not sure if that's a good idea
Posted Aug 1, 2011 5:38 UTC (Mon) by Cyberax (✭ supporter ✭, #52523)
[Link]
There are more subtle ways for it, you can join sub-trees using XQuery expressions and then use built-in function to create Cartesian products.
Not sure if that's a good idea
Posted Aug 2, 2011 0:54 UTC (Tue) by knobunc (subscriber, #4678)
[Link]
More recent SQL makes that problem more apparent.
SELECT a.id, b.id
FROM table_a a
JOIN table_b b XXXX
WHERE a.some = 123
AND b.some > 1435
The syntax error from the missing text at XXXX would catch the problem.