> Hi all
>
[quoted text clipped - 10 lines]
> updated in the food log because the info was never stored, just a reference
> to it.
that's the way to go, definitely. Your food values database is the
"dictionary".
You might want to, one day, expand the dictionary by entering more
data about foods. This way, your food logs will all be instantly
enhanced.
Plus, a reference to the row in the food values table would be only
4-8 bytes, much less thana copy of the information.
> - copy all the information i need from the foods database into the food log
> database, thereby having an independant copy. If the details for the
[quoted text clipped - 6 lines]
> for as long as you want it to appear in your foods logs.. deleteing the food
> deletes it from the logs too.
Well, why would you delete data from your dictionary table? I see no
reason for it.
> I'm more inclined to use the first method, simply because I don't see the
> harm in having a food stored in the food database indefinitly. Each food
> takes up only a tiny amount of space.
That's one of the principles of database normalization.
> I'm looking more for usability rather than technical opinions. If you use
> diet or nutrition software, how does it handle deleteing foods.. are the
> foods also purged from your food logs? What seems to be the more
> intuitive/natural behaviour?
>
> any thoughts and input would be much appreciated
I would expect to not delete food descriptions. I think that the USDA
database already comes with unique keys generated for the entries, so
that the next release of their database would make it possible to
update dictionary entries rather than recreate the dictionary.
i
> I'm writing some diet/nutrition tracking software
What code?