0
MySQL 5.5 on Ubuntu 12.04.1

I know that the databases, users, tables, etc. are case-sensitive (at least on Linux). But what about the commands themselves?

For example, compare:

SELECT *  FROM `PINs` WHERE `pin` > 1000

and:

select * from `PINs` where `pin` > 1000

I know both "work," but are there any down-sides to using lower-case commands?

3
  • No, you don't "know" that databases and tables are case sensitive just because the OS is Linux, as that is configurable. Never make assumptions when dealing with MySQL. Better yet, never make assumptions about anything. Sep 17, 2012 at 20:35
  • Nothing is wrong with assuming the worst case scenario. Assuming something is case-sensitive, and then being wrong wouldn't cause problems... Vice versa would...
    – Soviero
    Sep 17, 2012 at 21:13
  • assuming something is case sensitive and being wrong most certainly can cause problems. I've seen plenty of code where devs have relied on case sensitivity, only to see the entire mess come crashing down when case sensitivity is disabled. Sep 17, 2012 at 21:45

1 Answer 1

4

MySQL commands are not case sensitive. However, many people capitalize them anyway to make them visually distinct from other parts of the query.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .