Live data from Hacker News

It's not you, it's SQL

stack.convex.dev

11–20 of 84 posts

Re: It's not you, it's SQL

#12

The article presents the move from the old, doddering SQL to the newer, better NoSQL - but the hierarchical database model actually _predate_ SQL. The first databases like IBM's IMS were hierarchical a lot like Mongo is: Codd was actually trying to address the problems with that model when he created the relational model.

Comparing any modern database (i.e. developed after 1980) with IMS is like comparing a flint knife with a Barrett .50 calibre.

Re: It's not you, it's SQL

#13
"It can be done. But can doesn't mean should." I'm getting worn out on this turn of phrase. Yes, can doesn't mean should. But also, couldn't doesn't mean shouldn't. You have to justify "shouldn't". TFA does go on to justify it, which is appreciated.

Re: It's not you, it's SQL

#14

The article presents the move from the old, doddering SQL to the newer, better NoSQL - but the hierarchical database model actually _predate_ SQL. The first databases like IBM's IMS were hierarchical a lot like Mongo is: Codd was actually trying to address the problems with that model when he created the relational model.

Article author, here. Good point -- but the article actually proposes document relational, not hierarchical. Relational is definitely good!

Re: It's not you, it's SQL

#16
post #8

Man what a well written ad.

My reaction exactly. Specifically when they said what developers want is document DBs. That's not true. We (or a lot of us) want the equivalent of Typescript for SQL. Which people have tried to build but their efforts have ended up like CoffeeScript. Better but ultimately not worth using because they don't have the staying power.

Re: It's not you, it's SQL

#17
post #6

>> Unlike SELECT, these operations don't feature JOINs or subqueries or any other magic that brings together tables. This is a false statement. Both INSERT and UPDATE support JOINs and subqueries / CTEs. At least according to the standard - not every engine implementing them is another story.

I'm forgiving on the authors point here. If you have JOINs and subqueries, you're just doing a SELECT to get data that can only be UPDATEd/INSERTed on a single table. You can't do an INSERT across 5 tables in one statement.

Re: It's not you, it's SQL

#18
post #6

>> Unlike SELECT, these operations don't feature JOINs or subqueries or any other magic that brings together tables. This is a false statement. Both INSERT and UPDATE support JOINs and subqueries / CTEs. At least according to the standard - not every engine implementing them is another story.

I'm forgiving on the authors point here. If you have JOINs and subqueries, you're just doing a SELECT to get data that can only be UPDATEd/INSERTed on a single table. You can't do an INSERT across 5 tables in one statement.

Article author here, yep, that was the intended point. Agree the wording was unclear, and there's a footnote now clarifying that. Thanks!

Re: It's not you, it's SQL

#20
post #6

>> Unlike SELECT, these operations don't feature JOINs or subqueries or any other magic that brings together tables. This is a false statement. Both INSERT and UPDATE support JOINs and subqueries / CTEs. At least according to the standard - not every engine implementing them is another story.

> not every engine implementing them is another story Which don't? I'd have assumed anything inside of `SELECT`'s `FROM` would be allowed inside of `INSERT` and `UPDATE`. Or maybe you're not saying you know there are implementations that have these restrictions just that any random implementation might not be there (yet).

> Which don't?

Redshift (a PostgreSQL derivative, more or less) can run an INSERT with a join, but cannot do an UPDATE with a join.

Post reply on HN