Why joins between tables and tables : because the information in a single table is incomplete and requires more complete information in other tables, there is a connection between tables and tables
INner join (inner join) , can be abbreviated as: Join
Explanation: INNER join (equivalent join) returns only rows with the same join field in two tables
left OUTER join (Zuo Connection), abbreviated as: Ieft join
Explanation: The LEFT join returns records that include all the records in the left table and the equivalent of the junction fields in the right table
right outer join, abbreviated to join
Explanation: Right join returns records that include all records in the right table and the junction fields in the left table
INNER Join Connection Database usage
INNER join joins two data table usage:
SELECT * FROM table 1 INNER JOIN table 2 on table 1. Field number = Table 2. Field number
INNER join joins three data table usage:
SELECT * FROM (table 1 INNER join table 2 on table 1. Field number = Table 2. Field number) INNER JOIN table 3 on table 1. Field number = Table 3. Field number
Multiple tables can be connected, in the same format as the three tables connected, extrapolate
Things to consider when entering commands
1, in the process of entering letters, we must use the English half-width punctuation marks, the words left half the space between the corners;
2. When creating a data table, if a table joins multiple tables, the field in this table must be a number data type, and the same field in multiple tables must be the primary key, and the AutoNumber data type. Otherwise, it is difficult to join successfully.
3, code nesting Quick Method: For example, if you want to connect five tables, as long as the code to connect four tables with a front and back brackets (the front parenthesis added to the end of the code), and then continue to add after the parentheses after the "INNER JOIN table name x on table 1." Field number = table X. Field number "Code, so you can join the data table indefinitely:)
Connections between tables and tables