Inner joins, also known as natural joins, only two tables match the rows to appear in the result set. The returned result set selects all matching data from two tables, discarding unmatched data. Because an inner join removes all rows from the result table that do not match the other connection tables, the internal connection may cause information loss. The inner JOIN syntax is as follows:
Select FieldList from table1 [inner] join table2 on table1.column = Table2.column
An inner connection is a guarantee that all rows in two tables meet the conditions of the connection, but not the outer connection.
Outer joins contain not only rows that meet the join criteria, but also all data rows in the left table (when left connected), the right table (when connected right), or two edge tables (full outer joins). There are three types of out-of-SQL connections: Left OUTER join (the keyword is a OUTER join), a right outer join (the keyword is a OUTER join), and a full outer join (the keyword is an OUTER join). The use of outer joins is the same as an inner join, except that the INNER JOIN keyword is replaced with the corresponding outer join keyword.
An inner join displays only records that meet the join criteria, and the outer join displays records in the table, in addition to the records that match the criteria, for example, if you use a left outer join, the records in the left table are also displayed.
Example: Below is student table A and student table B:
The results of the inner and left outer joins of table A and table B are as follows: