Natural Join

From rbachwiki
Jump to navigation Jump to search

A natural join is based on all columns in two tables that have the same name and selects rows from the two tables that have equal values in all matched columns

SELECT  first_name, last_name, job_id
FROM employees NATURAL JOIN jobs
WHERE department_id > 80
SELECT sales_date, order_id, product_id
FROM sales NATURAL JOIN product;

This join will return columns from the employees table and their job_title from the jobs table based on the common column job_id

Back To Top- Home - Category