Natural Join

From rbachwiki
Revision as of 00:46, 25 October 2017 by Bacchas (talk | contribs) (Created page with "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_...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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