' The role of this symbol in MySQL

Source: Internet
Author: User

' Is the escape character of MySQL and avoids the conflict with MySQL's own keyword, so long as you don't use MySQL's reserved word or Chinese in Column name, table name, you don't need to escape.

All databases have similar settings, but MySQL uses ' just '. This is typically used to indicate that the content is database name, table name, field name, and not a keyword. For example:

Select from from table;
The first from is the field name and the last table table name, but it is also the MySQL keyword, so the error occurs when executing, so you should use
Select ' From ' from ' table ';
Of course, for readability, it is not recommended to use the keyword as the field name, the table name, and the database name, table name, field name should be included in a pair of anti-quotes.

CREATE TABLE ' jy ' (  ' library card number ' char (8) NOT null COMMENT ' library card number ',  ' ISBN ' char (+) ' NOT null COMMENT ' ISBN ',  ' Call ISBN ' Cha R (+) NOT null COMMENT ' call number ',  ' borrowing time ' datetime not NULL COMMENT ' borrowing time ',  PRIMARY KEY (' Library card ', ' ISBN ') engine=innodb DEFAULT Charset=utf8;

' The role of this symbol in MySQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.