MySQL Common SQL tips and FAQs

Source: Internet
Author: User

The skillful use of regular expressions

Second, skillfully use RAND () to extract random rows

Using the random number function of rand (), combined with the ORDER BY clause, the function of randomly extracting some rows is done.

Third, using GROUP BY's with ROLLUP clause to do statistics

NOTE: The ROLLUP clause is mutually exclusive to the ORDER BY clause.

Four, database name, table name capitalization problem

The case sensitivity of the operating system determines the case sensitivity of the database name and table name. Windows is not case sensitive.

columns, indexes, stored word programs, and triggers are not case sensitive on any platform.

How to save and use the table name and database name on the hard disk in MySQL is determined by the LOWER_CASE_TABLES_NAME system variable, which can be set at startup.

The foreign key is valid only for the data table of the InnoDB engine.

MySQL Common SQL tips and FAQs

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.