Hacker News new | ask | show | jobs
by tomjen3 5390 days ago
I think the reason you got so bad responses on the first question wasn't that they couldn't write the join statement but that they had heard the distinction between the different joins once in college and then never considered them again.

I bet that if you had asked for an example of a sql code which would list all the employees born before 1980 along with the department they worked for and the name of the head of that department, you would have gotten a much more useful result out of that.

That query is, incidentally, much more difficult to write.

1 comments

But with a normalised database you couldn't the above without two inner joins (and it's still a trivial query that any competent dev for that sort of position should be able to dictate while driving, it's that easy).

Really, if you can't remember the difference between inner, outer, full and cross joins then you shouldn't be working with databases. Which was rather what the test showed us, frankly.