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.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Question about the table design

Author  Topic 

karang
Starting Member

2 Posts

Posted - 2007-05-07 : 02:54:20
Hi

I 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.

Regards
Karan

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.
Go to Top of Page

karang
Starting Member

2 Posts

Posted - 2007-05-08 : 04:23:56
Hi

I 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.

Regards
Karan

Go to Top of Page

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
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -