Stats

Contributors: 1
2017-04-01
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Example Company Tables

Download mysql eBook

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