M
mae
I've started a gardening database. The main table is tblPlants, which has
fields such as GenusName, SpeciesName (those will make up the primary key),
CommonName, Lifecycle, Hardiness, Shape, BloomColor, MoisturePreference,
SoilPreference, LightPreference, etc.
Some plants have varieties that are different than the "plain" species.
Most lilacs are purple, for instance, but some varieties are white. Maybe a
particular variety of a species likes it wetter than all the others, or maybe
one is fragrant whereas the rest are odorless.
I had thought about making each variety it's own record in tblPlants, but
that means there would be a lot of repeated data (and I'd need a different
PK) because usually it's only one or two things that are different. I could
have 20 records for roses, all identical but for a few factors.
That didn't seem right, so I thought maybe have tblPlants and tblVarieties,
to link each variety to it's "main" species plant. But since there are so
many factors that could vary, tblVarieties would have almost all the same
fields as tblPlants: Hardiness, Shape, BloomColor, MoisturePreference, etc,
with most of the fields being empty. I KNOW this isn't right.
My spreadsheet-geared mind is having a hard time thinking up alternatives.
Any thoughts or suggestions to share?
Thank you.
fields such as GenusName, SpeciesName (those will make up the primary key),
CommonName, Lifecycle, Hardiness, Shape, BloomColor, MoisturePreference,
SoilPreference, LightPreference, etc.
Some plants have varieties that are different than the "plain" species.
Most lilacs are purple, for instance, but some varieties are white. Maybe a
particular variety of a species likes it wetter than all the others, or maybe
one is fragrant whereas the rest are odorless.
I had thought about making each variety it's own record in tblPlants, but
that means there would be a lot of repeated data (and I'd need a different
PK) because usually it's only one or two things that are different. I could
have 20 records for roses, all identical but for a few factors.
That didn't seem right, so I thought maybe have tblPlants and tblVarieties,
to link each variety to it's "main" species plant. But since there are so
many factors that could vary, tblVarieties would have almost all the same
fields as tblPlants: Hardiness, Shape, BloomColor, MoisturePreference, etc,
with most of the fields being empty. I KNOW this isn't right.
My spreadsheet-geared mind is having a hard time thinking up alternatives.
Any thoughts or suggestions to share?
Thank you.