If the using keyword is used and the select result list item contains the keyword specified by the using keyword, do not
If the using keyword is used and the select result list item contains the keyword specified by the using keyword, do not
Natural connection
Select *
From r1 natural [inner] join r2 natural [inner] join r3
Where P;
Select A1, A2
From r1
Natural [inner] join
R2, r3 where r2.A = r3. B;
In the natural connection, all columns with the same attribute name in the matching relationship (relation, table) only keep the tuples with the same attribute name (tuple, the order of the attributes: first, list the same attributes in the two relationships, and then list those attributes that only exist in the first relationship, the final output only contains attributes in the second link.
In order to develop the advantages of natural connections and avoid the danger of unnecessary equal attributes, SQL allows users to specify the columns to be equal:
Select *
From r1 [inner] join r2 using (attri_name );
Note:
1. If the using keyword is used and the select result list item contains the keyword specified by the using keyword, do not specify the table to which the keyword belongs in the select result list.
2. Only one column name can be used in using.
3. The natural join keyword and using keyword are mutually exclusive, that is, they cannot appear at the same time.