A join combines records from two or more tables in a relational database. In the Structured Query Language (SQL), there are several types of joins, including "inner" and "outer". They all work by linking records on a key field.
The simplest type of join doesn't even use the JOIN keyword. For example, given employee and department tables as follows:
LastName DepartmentID ---- ------- Smith 34 Jones 33 Robinson 34 Jasper 34 Steinberg 33 Rafferty 31
DepartmentName DepartmentID ---- -- Sales 31 Engineering 33 Clerical 34
Use this SQL statement to join the tables:
SELECT LastName, DepartmentName FROM employee, department WHERE employee.DepartmentID = department.DepartmentID
Your result set will be:
LastName DepartmentName ---- --- Smith Clerical Jones Engineering Robinson Clerical Jasper Clerical Steinberg Engineering Rafferty Sales