Visual JOIN Understand how joins work by interacting and see it visually

INNER JOIN

(or JOIN)
Created with Snap

LEFT JOIN

 
Created with Snap

RIGHT JOIN

 
Created with Snap

OUTER JOIN

(with UNION)
Created with Snap
SELECT users.name, likes.like FROM users JOIN likes ON users.id = likes.user_id; Description » Hide description » INNER JOIN or just JOIN retrieves all users and likes that match each other ( where the id field in users matches a user_id in the likes table and vice versa )

Users

ID Name
1 Patrik
2 Albert
3 Maria
4 Darwin
5 Elizabeth

JOIN

Name
Maria Stars
Patrik Climbing
Patrik Code
Darwin Apples

Likes

User ID
3 Stars
1 Climbing
1 Code
6 Rugby
4 Apples