MySQL must know to learn

Source: Internet
Author: User

MySQL must know

First, there's a table.

Customer table: Product table:

Order Element table: Product record table:

Order Form:

Seller Table:

16th. Creating an advanced junction
Select concat (rtrim(vend_name),'(',RTrim(vend_country), ' )'as fromorder by Vend_name;

There are two benefits of using aliases:

1. Shorten the SQL statement

2. Allow the same table to be used multiple times in a single SELECT statement

Use different types of junctions

1. Self-coupling

Connect yourself to the table

Select  from  as  as where =  and = ' dtntr '

As you can see from the code above: Use table aliases to correlate tables with each other

2. Natural coupling

Joins between tables based on the fields between each table

Select c.*from as aswhere= and =  and = ' FB '

3. External coupling

MySQL must know to learn

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.