Friday, April 29, 2011

should teacher and student stay together???

Hi all,

A very basic question, I naively believe that there's no dumb
question...

I'm creating a database, and the users are categorized into teachers
and students, obviously, one student has and belongs to many teachers
and vice versa, so there is a HABTM relationship between students and
teachers.

So in cake, which is the better approach?

1) Put them in the "users" table and use a field to distinguish
students and teachers, but <b>how do I describe the HABTM relationship
between them? Do I need to create a "students_teachers" table?</b>

2) Create three tables, "students", "teachers", and a
"students_teachers" table.

Any help really appreciated!!!

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: