how to structure data that will be fed into dropdown boxes?
I have denormalized data:
+----+----------+------+--------+
| pk | name | type | animal |
+----+----------+------+--------+
| 1 | alex | car | cat |
| 2 | alex | bike | cat |
| 3 | liza | car | dog |
| 4 | danielle | bike | dog |
| 5 | danielle | bus | dog |
+----+----------+------+--------+
I would like to have 3 dropdown boxes.
name
type
animal
after the user chooses the option for the first, there should be a cascade
effect for the other dropdowns.
example: if the user chooses danielle for the name, the only two options
for type would be bike and bus and the only option for animal would be dog
How should I structure the SQL tables? Should I denormalize?
No comments:
Post a Comment