I. External connections
1.left Join
Example: SQL statement: SELECT * FROM student left join course on Student.id=course.id
The left OUTER join contains all the rows from the left table in a left join, and if there is no match on the right table in the table, the portion of the right table in the corresponding row in the result is all empty (null).
2. Right-connect to the join on either or outer join
SQL statement: SELECT * FROM student right join course on student.id=course.id
The right outer join contains all the rows in the right table, and if a row in the left table does not match on the right table, the portion of the corresponding left table in the result is all empty (null).
3. Fully external connection full join or outer join
SQL statement: SELECT * FROM student full join course on student.id=course.id
A full outer join contains all of the rows in both the left and right tables of the complete join, and if there is no match in the left table for a row in the table, the portion of the right table in the corresponding row in the result is all empty (null), and if a row in the left table does not match in the right table, the portion of the left table
Two. Internal connection
INNER JOIN join or INNER JOIN
SQL statement: SELECT * FROM student inner JOIN course on student.id=course.id
This is equivalent to: SELECT * from Student,course where student.id=course.id
Three. Cross-connect
1. Concept: A cross join without a WHERE clause will produce a Cartesian product of the table involved in the connection. The number of rows in the first table multiplied by the number of rows in the second table equals the size of the Cartesian product result set.
SQL statement: SELECT * FROM student Cross Join course
If we add a WHERE clause to this SQL at this time such as Sql:select * from Student Cross join course where student.id=course.id
The result set that matches the condition is returned, and the result is the same as the inner join shows.
About out-of-database connections and internal and cross-joins