INNER JOIN

INNER JOIN combines each row in a table with each row of another table, select those rows that satisfy a certain condition.

SELECT * FROM table1 INNER JOIN table2 WHERE table1.column1 = table2.column1

INNER JOIN SQL Example

people table with primary key "per"

pernamesurnamenicknamedep
1HARRYCLARKWHITE1
2HARRYSMITHJOHNSON2
3JOHNBROWNANDERSON2

table "departments" with primary key "dep"

depdepartment
1ADMINISTRATION
2COMPUTER
3BUSINESS

SELECT name, surname, department FROM people INNER JOIN departments WHERE people.dep = departments.dep
namesurnamedepartment
HARRYCLARKADMINISTRATION
HARRYSMITHCOMPUTER
JOHNBROWNCOMPUTER