I know this is snarky as hell and I apologize for being offensive. But I am not an MIT CS graduate. I am completely self taught. SQL has been a necessary skill in every job I've had in the last 20 years. So when users were complaining were complaining that a data download to csv files was limited to 200 records (due to a dozen joined tables, lazy loading, table locking, using velocity to generate csv files, etc), I threw out Hibernate and velocity and used SQL, JDBC, and direct HTTP output to generate 50 times the output in one tenth the time.
The system I mentioned was well designed with hundreds of tables, multiple replicated database servers, dozens of web servers, caching and all that. The problem was a specific case where knowledge of SQL was able to produce a 50x performance improvement.
I think SQL essential to learn because it bends your mind. You have to think in terms of sets instead of sequential processes. Just like functional programming and BNF are mind stretching.
We migrating billing system with Hibernated business logic into pure SQL.
I can paraphrase it as:
ORMs aren't the problem here, relational databases are problem.
I don't think that letter R is to blame. Letter O is culprit.
Why? Because OOP is not suited to work with data.
And what's wrong with SQL? It's a good enough abstraction from actual data.
I wonder: who needs another (letter O) layer over already abstracted layer?
"2) supports explicitly specifying a plan, not providing hints or clues, but using operations that look map, filter, reduce, hash-join, etc."
You have it already: SELECT type, SUM( -- reduce object_id * 2 -- map )
FROM sys.objects WHERE -- filter type = 'U' GROUP BY type
Hash-joins - yes, only hints, and not in all DBs
That's what the disagreement boils down to, I suppose: if we agree that there's an object-relational mismatch (http://en.wikipedia.org/wiki/Object-relational_impedance_mis...), then is the solution to drop the 'O', to drop the 'R', or to find a way to bridge them?
Why?
Because on one side we have Relational Algebra - simple clear theory (I can explain it to 8 year children).
And on other side we have something amorphous, defined in nonexplicit terms. I mean OOP.
Objects are bad for data. So, just drop "O" completely.
Every time I bring this up, someone misunderstands me. I'll explain it again: I want a real RDBMS, I want ACID, I want transactions, constraints, triggers, foreign keys, etc, I just don't want the brain-dead SQL the language to interface with it. Preferably something with lispy syntax and a manual override on the planner (not hints, but full-blown "I'm in control now")
Here's what I wrote about it a few years ago: http://arohner.blogspot.com/2009/04/db-rant.html
ORMs exist because straight SQL isn't a good interface for programmers, and ORMs are bad/a leaky abstraction because the problem is really messy.
Instead, let's just build a relational database that 1) has an API that is useful to programmers i.e. not SQL 2) supports explicitly specifying a plan, not providing hints or clues, but using operations that look map, filter, reduce, hash-join, etc.