MySQL database and JDBC programming three

Source: Internet
Author: User

Multi-table Connection query (two specifications SQL92 and SQL99)

SQL92 Specification:

Equivalent connection, non-equivalent connection, outer connection, generalized Cartesian product connection

Multiple tables are placed after the from, after the join condition is placed in where, the condition requires two columns of equal value, then the equivalent connection, otherwise a non-equivalent connection, without conditions for the generalized Cartesian product connection

The Multi-table query process can be understood as a nested loop that determines whether two columns of two tables meet the Join condition

If a record needs to be filtered, the filter and join conditions are connected with and

An outer join is the addition of a universal row in the same table as the outer connector, where all data is null, and the row can match a record in another table that does not meet the criteria

SQL99 Specification:

Cross-linking: The effect is the Cartesian product connection,,, t_table t;

Natural connection: Natural join t_table T; As a connection with the same name as the column name, if there is no same name, the effect is cross-connected

Using sentence connection: Join Table using (column name) display specifies which of the same names to use as the connection

On statement to specify join conditions

Left and right full outer joins: Right/left/full join

Subquery: Nesting another query in a query statement

Where it can appear: from behind, as a data table

Where the value of the filter condition is followed

Use subqueries to NOTE: subqueries are enclosed in parentheses.

When a subquery is used as a data table, you can alias the subquery, especially as a prefix to qualify

Set operation,,,,,

  

    

  

MySQL database and JDBC programming three

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.