HNHacker News
TopNewBestAskShowJobs

iiioooppp

1 karma · joined January 12, 2019

submissionscomments
iiioooppp··on Say no to Venn diagrams when explaining SQL joins (2016)
Ah... that makes sense. I have experimented a bit since my original comment and so far have not been able to come up with a syntactically elegant way of implementing LEFT JOIN in an imaginary MySQL that had inner JOIN as the only JOIN. This actually makes me wonder... if SQL only had inner JOIN, what would be the syntactically most elegant way of implementing the other JOINs? The various replies in this comment tree make me suppose that the answer would depend on the precise flavor of SQL being used.
iiioooppp··on Say no to Venn diagrams when explaining SQL joins (2016)
Why does SQL have both WHERE and ON, plus various kinds of JOINs? It seems to me that it would be simpler to have just have one JOIN which represents the Cartesian product, plus WHERE for filtering - and then the DB engine could apply optimizations so that queries would actually run as fast as in existing SQL. Am I missing something?