Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
karang
Starting Member
2 Posts |
Posted - 2007-05-07 : 02:54:20
|
HiI have a scenario in which I am I have to store the value of students and the teachers and other management persons in the table.What do you think is the best design to store the information in different table like student,teachers,Management etc or create a single table person to store all the information in one table.RegardsKaran |
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2007-05-07 : 22:49:19
|
It depends on how much overlap there is between the type of people but I'd probably start with the table that holds common data & then add a new table for the additional special data for students/teachers/management etc.If you need to have collections or groups of different people it also makes sense to do it this way. If a manager manages a group of students & teachers, or has sub-managers etc it's a lot easier to model if you have a central person table.It also makes adding features across people very easy. For example, if you add an annotation function you can add it, or relate it, to the people table and you get it against students, teachers & managers for free. |
 |
|
karang
Starting Member
2 Posts |
Posted - 2007-05-08 : 04:23:56
|
HiI am writing what I understood after reading your thread.You mean that if there are a group of people like student, manager, teachers then it is better to have single table for all of the entities(Manager , student and students).Please correct me if I am wrong.RegardsKaran |
 |
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2007-05-08 : 04:46:54
|
I agree. I find it's usually helpful to think in terms of entities (in this case Person) playing roles (i.e. teacher, student, manager). This type of model also gracefully handles scenarios such as: - a grad student who attends classes, but also teaches them.- a senior faculty member who manages staff, but also teaches classes.Mark |
 |
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2007-05-08 : 21:31:19
|
Correct. You should have a single table for the common stuff. Depending on what other information each type has you might need either some additional columns or another table for each type of person. |
 |
|
|
|
|
|
|