Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
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


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

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

share|improve this question
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. – John Gardeniers Sep 17 '12 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 '12 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. – John Gardeniers Sep 17 '12 at 21:45
up vote 4 down vote accepted

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.