Thanks Andres! As a SQL Developer, I have implemented all of these techniques. At a previous company we defined SQL standards for our team of 3 SQL developers. There was some grumbling at first, but we quickly came to love it! It made reading each others' code so much easier, and leading commas were a game-changer! Also, leading with ANDs and ORs in the WHERE clause. Another standard we used was to put SQL keywords in upper case.
Tamas, thanks for your question. We chose to do that to make the SQL keywords stand out from the rest of the query. Also, I use Notepad++ and it automatically capitalizes keywords. After doing some Googling, this seems to be a matter of preference and not an agreed upon formatting standard.
Thanks Andres! As a SQL Developer, I have implemented all of these techniques. At a previous company we defined SQL standards for our team of 3 SQL developers. There was some grumbling at first, but we quickly came to love it! It made reading each others' code so much easier, and leading commas were a game-changer! Also, leading with ANDs and ORs in the WHERE clause. Another standard we used was to put SQL keywords in upper case.
upper case? what was the reasoning behind that? I'm curious. 🙂
Tamas, thanks for your question. We chose to do that to make the SQL keywords stand out from the rest of the query. Also, I use Notepad++ and it automatically capitalizes keywords. After doing some Googling, this seems to be a matter of preference and not an agreed upon formatting standard.
I write them in lower case, but that's totally a personal preference. I think this way queries are easier to read. 🙂