I am trying to create a simple schema that would satisfy the following and have been struglling to get it right it would look something like this:
A User that has a role, that belongs to a department, however many roles can have many departments but many users can belong to only a single role e.g a user cannot be in accounting and hr. I have been trying to build this sort of relationship for a while but cant quite get my head round it, any assistance would be awesome :)
Also would this be possible to write in a DB seeder ?
the description seem confusing not other people but yourself also I believe as there seem conflict each other.
perhaps you have make it more clear what you try to do and what the definition of role, department and perhaps title/position, it may make it more clear...
Hey sorry the description is a little confusing, essentially trying to create a DB schema in which you have employees , each of which has a role. Then departments of which have employees and a department head. Each dept will also have a set of employees which will need roles.
Dept heads can add new employees with a single role but departments will have multiple roles.
Thanks this is really helpful. I find thinking about DB stuff quite hard to visualise/break down. Is there any sought of helpers you could suggest when building them or is it something that just comes with time?