home support FAQ resources services partners contact us contact us
 MySQL Tutorial Previous  Next  
 

MySQL Naming Rules

Almost every SQL statement refers in some way to a database or its constituent elements. This section describes the syntax rules for referring to databases, tables, columns, indexes, and aliases. Names are subject to case sensitivity considerations, which are described as well.

Referring to Elements of Databases

When you use names to refer to elements of databases, you are constrained by the characters you can use and the length that names can be. The form of names also depends on the context in which you use them. Another factor that affects naming rules is that the server can be started in different naming modes.

Legal characters in names. Unquoted names can consist of any alphanumeric characters in the server's default character set, plus the characters '_' and '$'. Names can start with any character that is legal in a name, including a digit. However, a name cannot consist entirely of digits because that would make it indistinguishable from a number. MySQL's support for names that begin with a number is somewhat unusual among database systems. If you use such a name, be particularly careful of names containing an 'E' or 'e' because those characters can lead to ambiguous expressions. For example, the expression 23e + 14 (with spaces surrounding the '+' sign) means column 23e plus the number 14, but what about 23e+14? Does it mean the same thing, or is it a number in scientific notation?
Previous  Next  
Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist