MySQL One to Many Example Company Tables

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Consider a company where every employee who is a manager, manages 1 or more employees, and every employee has only 1 manager.

This results in two tables:

EMPLOYEES

EMP_IDFIRST_NAMELAST_NAMEMGR_ID
E01JohnnyAppleseedM02
E02ErinMacklemoreM01
E03ColbyPaperworkM03
E04RonSonswanM01

MANAGERS

MGR_IDFIRST_NAMELAST_NAME
M01LoudMcQueen
M02BossyPants
M03BarrelJones


Got any MySQL Question?