1. Joins
a. INNER JOIN
Returns records with matching values in both tables.
SELECT employees.name,
departments.department_name FROM employees
INNER JOIN departement ON
employees.department_id = departments.id ;
, b. LEFT JOIN
Returns all records from the left table and matched
records from the right.
SELECT employees.name,
departments.department_name
FROM employees
LEFT JOIN departments ON
employees.department_id = departments.id;
c. RIGHT JOIN
Returns all records from the right table and matched
records from the left.
SELECT employees.name,
departments.department_name
FROM employees
RIGHT JOIN departments ON
employees.department_id = departments.id;