> SQL is very hard to learn properly, with all of its gotchas and inconsistencies.
I don't understand why though? I've been using SQL (Postgres for the most part but with a smattering of MySQL thrown in) for around 8(?) years, which isn't much in the grand scheme of things but I have not had anything that couldn't be resolved. I've written small straightforward queries to over 200 loc and never had a problem understanding it if you read it slowly/broke it down into smaller queries.
In fact, ORMs have been a massive headache because I can think in SQL but not in whatever the creator of the ORM was thinking in. Those giant queries that I was talking about - there's no way to represent them in ORM form.
SQL works in a language agnostic way, you can explain analyze your SQL queries and run it through whatever medium you prefer. Typical experience with an ORM goes like so:
1. Lets use an ORM because it'll be easier
2. It's not actually easier and it's a complex mess now, but let's stick with it anyway
3. Figure out a way to log the queries that the ORM made up for you/printf it
4. Run that through EXPLAIN ANALYZE
5. Can't make the ORM do that, file a bug report that'll be buried
6. Use native query while you wait
7. Tech debt etc;