A generic question.

Posts   
 
    
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 21-Aug-2004 17:21:34   

If i have entities student and instructor, is it better to have 2 tables like:

Table 1: Person PK: ID Cols: PersonType, Name

Table 2: PersonType PK: ID Cols: Type desc

Or is it better to have 2 tables like:

Table 1: Student PK: ID Cols: Name

Table 2: Instructor PK: ID Cols: Name

Any suggestions how i should go about this please.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 21-Aug-2004 18:27:59   

If student can be instructor as well, you can only use the first option. If that's never the case, you can use both, with the second option easier to query, but less flexible when the situation will have students to become instructors as well.

Frans Bouma | Lead developer LLBLGen Pro
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 21-Aug-2004 18:59:12   

Thanks Frans.