Multiple many-to-many relationships within a school system

Hi there. I’m really a newbie when it comes do database design so I don’t know how to solve this problem of mine. Let me try and describe it.

  • A school employs many teachers (Mr. Blue, Mr. Black, Mr. Red etc)
  • A teacher can work at many schools (West High, East High, North High etc)
  • Each school has many classes with similar names (10A, 10B, 10C etc)
  • A teacher can teach many classes in each of the schools he works at (Mr. Black teaches 10A, 10B in West High and 10A,10C in East High, etc.)
  • Each student attends only one school and belongs to only one class.
  • A teacher can assign a different piece of homework to each student within each class within each school the teacher works at.

I don’t have a clue where to begin :frowning:

Start by drawing a diagram with a rectangle for each of the different ‘things’ in the list. Each rectangle will be a database table. Then use arrows to connect the ones that have a relationship. Label each arrow with 1-to-1, 1-to-many or many-to-many depending on what the relationship is. All relationships that are many-to-many will need a junction table connecting the two entities.

1 Like

i think you did really well – great description

the only thing you forgot to mention was the actual problem you’re having

I need to create a web app that meets all of these requirements, and in order to do that I need a database which I have no idea how to create. PHP I can handle, but with databases I’m rubbish :frowning:

subcontract it

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.