MySQL Development Tips (i)

Source: Internet
Author: User

I. Classification of SQL statements

    • DDL Data Definition Language
    • TPL Transaction Processing Language
    • DCL Data Control Language
    • DML Data Manipulation language
    1. SELECT
    2. INSERT
    3. UPDATE
    4. DELETE

Second, the importance of correct use of SQL

    • Increase the efficiency of database processing and reduce the corresponding time of application
    • Reduce database service load and increase server stability
    • Reduce network traffic for inter-server communication

Third, development skills

    • How to use the JOIN clause correctly

  1.join Clauses---inside connections

SQL statement code:

2.join clause---left outer connection

    SQL Statement Code:

    

3.join clause---right outer connection

    

   SQL Statement Code:

    

4.join clauses---full connection

    

    Note: Full join is not supported in MySQL and you can use UNION all to query a SQL statement if you want to use the all connection

    SQL Statement Code:

    

5.join clauses---cross-linking

  

SQL Statement Code:

    

6. Updating tables with join

    

7. Using join to refine subqueries

    

optimized SQL statements:

    

8. Using join to refine the aggregate subquery

       

The SQL statement is the most common date to find out about each person's blame:

    The SQL statement is an optimized SQL statement:

    

9. Group Selection

  Group Query--row_number

    NOTE: The following SQL statements are not supported in MySQL

    

Group Query--group by

    

    

MySQL Development Tips (i)

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.