Database Chapter_4 Lecture Note
Database Chapter_4 Lecture Note
RIGHT JOIN
The SQL RIGHT JOIN returns all rows from the right table, even if there are no matches
in the left table. This means that if the ON clause matches 0 (zero) records in left table,
the join will still return a row in the result, but with NULL in each column from left table.
This means that a right join returns all the values from the right table, plus matched
values from the left table or NULL in case of no matching join predicate.
FULL JOIN:
The SQL FULL JOIN combines the results of both left and right outer joins.
The joined table will contain all records from both tables, and fill in NULLs for missing
matches on either side.
returns rows when there is a match in one of the tables.
SELF JOIN:
is used to join a table to itself as if the table were two tables, temporarily renaming at
least one table in the SQL statement.