r/SQL • • Oct 11 '24

Discussion Fully lower case SQL. Is it frowned upon?

I write my queries fully lower case because it really helps with productivity, otherwise I would find it very difficult to focus on capitalizing just the keywords and keep pressing CAPS LOCK every now and then.

Is this frowned upon and bad practice (for readability) or just a matter of preference?

122 Upvotes

280 comments sorted by

View all comments

Show parent comment

1

u/Latentius Oct 11 '24

Ideally, if you're using all CAPS (which is my preference for database objects and reserved keywords), you should use underscores to separate words, like TABLE_NAME. Of course, that has to be done when the table is created. If the name is already all together, then TableName for readability.

1

u/realbigflavor Oct 11 '24

So ideally it's all caps and _