Hello Guy's,

I came to this forum looking for help on creating a schema for a new app I'm building.

In this app I have 3 tables

Database schema
Users, Classes and Students

Now I need to provide the following functionality in my application

  • A User can be the Teacher of many Classes
  • A class can have many teachers
  • A User can also have Access to many Classes
  • A Class can have many users that have access to it

However when a user is the teacher of a class, he automaticly has access to this class. BUT
if you have access to A class this doesn't mean that you are the teacher of this class.

Why am I asking this?

Well a teacher can add grades or scores to the diffrent students that belong to the classes he has access to. He can also view the file about this students.

If you just have access to a certain class you can only VIEW grades and VIEW the files.

What's the solution?
That's the part where you come in? I was thinking of maybe two assosiation tables


  1. user_id
  2. class_id


  1. user_id
  2. class_id

But this just feels wrong....


  1. MYSQL 5
  2. PHP 5
  3. Framework can't generate ORM for assn tables with more than 2 columns

All help is appreciated.

Sorry for my bad english

9 Years
Discussion Span
Last Post by unixmonkey

you may want to have a table like this:

1. user_id
2. session_id
3. access (either S or T)

And this one will let you have multiple instances of the same class (for example, one of the fall and one for the summer)
1. class_id
2. datestart
3. dateend
4. timestart
5. timeend
6. maxstudents

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.