Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: Can't give tables a name in Upper Camel Case (Pascal Case)

I read that it is best practise to have table names in Pascal Case (ThisIsMyTableName). Therefor I would like to change my tables in MySQL. But neither phpmyadmin, nore SQL Manager 2005 for MySQL will let me. The names stay to appear in lowercase, as if I didn't to a change at all.

Any suggestions to solve this problem?

like image 512
Pascal Klein Avatar asked Dec 05 '10 19:12

Pascal Klein


People also ask

Can we use camelCase in MySQL?

SQL Table Letter-casing Conventions. For table names, you may use PascalCasing ( camelCasing with the first letter also capitalized) or lowercasing conventions, as long as you are consistent. In either case, table names should only contain alphabetic characters (no "_" or "-").

How do you write names in a camel case?

CamelCase is a way to separate the words in a phrase by making the first letter of each word capitalized and not using spaces. It is commonly used in web URLs, programming and computer naming conventions. It is named after camels because the capital letters resemble the humps on a camel's back.

Are MySQL table names case-sensitive?

Table names are stored in lowercase on disk and name comparisons are not case-sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases.

Can you use camelCase in SQL?

SQL also supports delimited identifiers; so, mixed case in an option, like camelCase (Java, where fields == columns) or PascalCase (C#, where tables == classes and columns == fields).


1 Answers

The easiest way to take care of this is to add the following to your .ini file

lower_case_table_names=2

2 is the significance here for Windows. You can read more about it here Identifier Case Sensitivity

like image 138
swisscheese Avatar answered Oct 12 '22 22:10

swisscheese