0

So I am planning to create a dynamic organizational chart, can anyone give me a hint on how can I design my database? Org chart is something like image on the link below. Sorry for my bad drawing skills.

https://i.stack.imgur.com/9pGPr.jpg

MarkP.
  • 11
  • 9
  • https://www.google.com.sg/search?q=php+mysql+organization+chart see also http://stackoverflow.com/questions/5406983/how-can-i-generate-dynamic-charts-with-mysql-data when you get your d/b defined. – Mawg says reinstate Monica May 16 '14 at 03:04

1 Answers1

0

Not a lot to go on, but this is how I would start

Seeing as it's possible to build a tree structure from a flat array containing parent-child relationships (see here), I would create a table holding [department][parent department] and whatever else you wish to store on departments themselves. If it's in only 1 language you can stick the description in there, etc. Department is key, Parent department a foreign key on the same table.

If you want it to have positions and people too, I would create separate tables for all of those. One mapping positions to departments, and one mapping people to positions.

Community
  • 1
  • 1
Jorg
  • 7,219
  • 3
  • 44
  • 65