Join syntax of SQL allows you to connect two database tables which share a column value. On most occasions, the shared columns constitute foreign key relation between two tables but having such relationship is not mandatory. As long as the columns hold the value referring to the same record, you can run a meaningful join query. For instance, in our domain, the
Id column and the
Employee_Id column hold the Id of particular employee record. We can join the two tables using value in those two columns.
There are mainly two types of joins. An inner join and an outer join. The best way to understand the difference between the two is to use Venn diagram from set theory. If you think of employee ...