If I have a column names called category_id
and Category_Id
, are they different?
And if I have table called category
and Category
, are they different?
Column, index, stored routine, and event names are not case-sensitive on any platform, nor are column aliases. However, names of logfile groups are case-sensitive.
At the time of table creation, all columns are created with all lowercase names regardless of quoting. The column names in a select statement are not case sensitive even if quoted.
The SQL Keywords are case-insensitive ( SELECT , FROM , WHERE , etc), but are often written in all caps. However in some setups table and column names are case-sensitive.
SQL standard requires names stored in uppercase The SQL standard requires identifiers be stored in all-uppercase.
On Unix, table names are case sensitive. On Windows, they are not. Fun, isn't it? Kinda like their respective file systems. Do you think it's a coincidence?
In other words, if you are developing on Windows but planning on deploying to a Linux machine, better test your SQL against a Linux-based MySQL too, or be prepared for mysterious "table not found" errors at prod time. VMs are cheap these days.
Field (column) names are case-insensitive regardless.
EDIT: we're talking about the operating system on the MySQL server machine, not client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With