![]() The identifiers (such as database names, table names and column names) are case sensitive in some platforms but case insensitive in others (e.g., In general, identifiers are case sensitive in Unixes but case-insensitive in Windows). For clarity, I often show the keywords in uppercase (e.g., CREATE TABLE, SELECT). It is a good practice to back-quote all the identifiers in a script to distinguish the names from the reserved words (possibly in future MySQL versions). Identifiers (such as database names, table names and column names) must be back-quoted if they contain blanks and special characters or are reserved word, e.g., `date`, `order`, `desc` (reserved words), `Customer Name` (containing space). *!40101 SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */ ĬREATE DATABASE /*!32312 IF NOT EXISTS*/ `eastwind` /*!40100 DEFAULT CHARACTER SET latin1 */ MySQL specific codes (with version number) are often generated when you export a database via mysqldump utility. You can find the MySQL server version via show version() command. The statements will be processed by MySQL if the server's version is at least at the specified version, e.g., version 4.00.14. You could include an optional MySQL version number, e.g., /*!40014. In other words, they will be processed by MySQL but treated as comments by other databases. They are recognized by the MySQL engine, but ignored by other database engines. I strongly encourage you to use comments liberally. An end-of-line comment begins with '- ' (two dashes and a space) or #, which lasts till the end of the current line.Ĭomments are ignored by the processing engine but are important to provide explanation and documentation for the script. Hence, there is no need for the terminating ' ' (to send the command to the server for processing).Ī multi-line comment begins with /* and ends with */ (just like the C/C++/Java language).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |