Interesting examples of database-building tables-keyword repetition

Source: Internet
Author: User
Tags repetition

Today, we use CMD to connect MySQL for simple database table-building operations. The following code is written in full confidence:

And then it blew up a big mistake. It's a bit of a little baffling feeling, I was in accordance with the steps of yesterday's study to write code, why error?

Initially began to suspect:

First, your own SQL statement was written incorrectly. Find the comparison of the statements on the tutorial. No difference.

Second, is not the case of the problem, I replaced the capitalization still failed.

When I didn't know what to do, I began to wonder if the order was a database keyword, because there was an "order by" in the data sort, so I looked up the information on the Internet:

The big English words were placed there.  Oh, my God! It really is a conflict with the key words. I then added a "s" after the table name, the same statement, the result is completely different.

So we must avoid the conflict between the table name and the database keyword when we are building the table.

In addition, I think, even if the key words conflict, whether there is a solution, in the online search, sure enough, the method still exists:

Add two points to the table name, these two points are not single quotes or double quotes, as follows:

If you want to see the table structure, you still need to add a double point to not error: that is, as long as the current table operation must be added two points and keyword distinction.

Conclusion: The name of the table should not conflict with the keyword. But in the face of problems, to think, to seek solutions. A lot of Baidu.

Interesting examples of database-building tables-keyword repetition

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.