SQL Day 12: Joins

LO1: Inner Join LO2: Outer Join LO3: Cross Join Prerequisite: Creating Tables & Enforcing Primary and Foreign Key Joins are used to retrieve data from 2 or more tables based on given conditions. In SQL Server, there are different types of joins. Inner Join or Join Inner Join is used to retrieve the matching rows of two tables. When we use the inner join then it fetches the rows that are common in both the table and ignore the non-matching rows if any. Let’s say we have a tblEmployee tables which contain the DepartmentID column and tblDepartment table which contain different types of the department including locations. select * from tblEmployee select * from tblDepartment The tblEmployee table contains the department id’s for the employee and tblDepartment table contain the name of the department including the id of the department. Let’s say we need to find the department name of the employees, to do that we need to join the tblEmployee an...