sqlstyle.guide icon indicating copy to clipboard operation
sqlstyle.guide copied to clipboard

Possible indent typo on sqlstyle.guide website

Open amalcgcg opened this issue 4 years ago • 1 comments

Thank you for maintaining this! We're adopting this style guide for our software engineering team, and I noticed what looks to be a slight indentation error in the "Aliasing or correlations" at https://www.sqlstyle.guide/#aliasing-or-correlations. I think the JOIN and ON keywords should be on the right side of the river. I mention this because it's the first example of formatting a JOIN, so junior people may skim to that and incorrectly use it.

Could you please update (or show me how to update) https://www.sqlstyle.guide/#aliasing-or-correlations from:

SELECT first_name AS fn
  FROM staff AS s1
  JOIN students AS s2
    ON s2.mentor_id = s1.staff_num;

to:

SELECT first_name AS fn
  FROM staff AS s1
       INNER JOIN students AS s2
       ON s2.mentor_id = s1.staff_num;

(I also made the type of join explicit as a best practice)

amalcgcg avatar Oct 29 '21 16:10 amalcgcg

This is a dup of https://github.com/treffynnon/sqlstyle.guide/issues/80. I'm leaving this open in the hopes that I'm able to persuade you to please change the "JOIN" to an "INNER JOIN" in the "Aliasing or correlations" section; not because it's wrong, but just to reduce confusion for teams which require explicit join types and want to use this formatting guide. (Also, that this is causing confusion is hopefully evidenced by the two independent issues (this one and https://github.com/treffynnon/sqlstyle.guide/issues/80 created for that section).

I understand now from https://github.com/treffynnon/sqlstyle.guide/issues/22 that both versions are correct, but since this is the first time many readers will see the recommended formatting for a join, I'd just ask that the first example use the more explicit INNER JOIN to reduce the chance of confusion. Either way, feel free to close this issue after reading, and thanks.

amalcgcg avatar Oct 29 '21 16:10 amalcgcg