Just in the context of this question, I want to post the 2 'APPLY' operators as well:
JOINSJOINs:
INNER JOIN = JOIN
INNER JOIN
=JOIN
OUTER JOIN
OUTER JOIN
LEFT OUTER JOIN
=LEFT JOIN
RIGHT OUTER JOIN
=RIGHT JOIN
FULL OUTER JOIN
=FULL JOIN
CROSS JOIN
LEFT OUTER JOIN = LEFT JOIN
RIGHT OUTER JOIN = RIGHT JOIN
FULL OUTER JOIN = FULL JOIN
- CROSS JOIN
SELF-JOIN Self-JOIN
: This is not exactly a separate type of join. This is basically joining a table to itself using one of the above joins. But I felt it is worth mentioning in the context JOIN discussions as youYou will hear this term from many in the SQL Developer community.
APPLY There are two APPLY operators:
- CROSS APPLY --
CROSS APPLY
: Similar to INNER JOININNER JOIN
(But has the added advantage of being able to compute something in the Rightright table for each row of the Leftleft table and would returnreturns only the matching rows.) - OUTER APPLY --
OUTER APPLY
: Similar to LEFT OUTER JOINLEFT OUTER JOIN
(But has the added advantage of being able to compute something in the Rightright table for each row of the Leftleft table and would returnreturns all the rows from the Leftleft table irrespective of a match on the Rightright table.)
https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-and-outer-apply/
https://sqlhints.com/2016/10/23/outer-apply-in-sql-server/
Real life example, when to use OUTER / CROSS APPLY in SQL
I findThe APPLY operatoroperators are very beneficial as they give better performance than having to dodoing the same computation in a subquery. They are also a replacement of many Analyticalanalytical functions in older versions of SQL Server. That is why I believe thatSo after being comfortable with JOINS, one a SQL developer should try to learn the APPLY operators next.