New answers tagged relational-theory
1
First of all, mysql (and other sql databases) are RDMS meaning that they are based in the relational model. This means that the design should be about entities and their relations. In your case:
Entities: locations, types.
Relation: one location can be of one type (if I have understand you correctly). This is a one-to-one relation.
The best way to store ...
1
To model the classical student - class - prof situation, you need to reverse your model. class can implement the n:m relationship between student and prof. To be precise:
[student] m -- n [class] n -- 1 [prof]
The n:m relationship between student and class would be implemented by another table. Like [participant]:
[student] 1 -- n [participant] n -- 1 ...
Top 50 recent answers are included