Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Do you capitalize when write SQL?, despite of MS SQL is case insensitive

views
     
TSk town shit
post Jun 4 2019, 05:41 PM, updated 5y ago

Enthusiast
*****
Junior Member
757 posts

Joined: Jan 2009
Hi Sifu, i noticed most of the learning site use capital letter in SQL statement, do you all also write in capital letter everytime when it comes to the SQL keyword?
what does it matter since MS SQL is case insensitive?

For example:
CODE
alter table dbo.items add itemSold1999 int

ALTER TABLE dbo.items ADD itemSold1999 INT



This post has been edited by k town shit: Jun 4 2019, 05:42 PM


Attached thumbnail(s)
Attached Image
ketnave
post Jun 4 2019, 06:01 PM

Enthusiast
*****
Senior Member
850 posts

Joined: Sep 2009
From: douchistan, pekopon


QUOTE(k town shit @ Jun 4 2019, 05:41 PM)
Hi Sifu, i noticed most of the learning site use capital letter in SQL statement, do you all also write in capital letter everytime when it comes to the SQL keyword?
what does it matter since MS SQL is case insensitive?

For example:
CODE
alter table dbo.items add itemSold1999 int

ALTER TABLE dbo.items ADD itemSold1999 INT

*
Yes.

Just because you can, does not mean you should.
TSk town shit
post Jun 4 2019, 06:20 PM

Enthusiast
*****
Junior Member
757 posts

Joined: Jan 2009
QUOTE(ketnave @ Jun 4 2019, 05:01 PM)
Yes.

Just because you can, does not mean you should.
*
pardon me, I dont understand, you mean I should capitalize them? thanks
ketnave
post Jun 4 2019, 07:42 PM

Enthusiast
*****
Senior Member
850 posts

Joined: Sep 2009
From: douchistan, pekopon


QUOTE(k town shit @ Jun 4 2019, 06:20 PM)
pardon me, I dont understand, you mean I should capitalize them? thanks
*
Sorry, I wasn't clear enough, I do capitalize SQL reserved words.

PATAR
post Jun 4 2019, 10:19 PM

Getting Started
**
Junior Member
191 posts

Joined: Jan 2018
From: Sweden/Kedah
No, I don't . And i 'm lazy with ";" too. Then whenever I have to do something on an Oracle system once in a while I wonder why my code don't work.
malleus
post Jun 4 2019, 10:37 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
it does make your SQL statements easier to read, which is a good plus point.
ragk
post Jun 7 2019, 03:32 PM

BooBoo~
*******
Senior Member
2,265 posts

Joined: Apr 2009


i do, for the sake of readability
lolzcalvin
post Jun 9 2019, 01:00 PM

shibe in predicament
******
Senior Member
1,519 posts

Joined: Mar 2014
From: 75°26'11.6"S, 136°16'16.0"E


no lmao, guilty pleasure
bumpo
post Jun 10 2019, 10:24 AM

On my way
****
Junior Member
632 posts

Joined: Mar 2013


rather than case, i find breaking the query to separate lines + indentation to be far more effective at increasing readability and supportability

 

Change to:
| Lo-Fi Version
0.0118sec    0.36    6 queries    GZIP Disabled
Time is now: 29th March 2024 - 09:21 AM