I'm developing a simple application where users can keep track of their weight history.
I have the following tables:
For the purposes of this demonstation, I will be using user id of 5.
When I want to save a users weight history I do this:
INSERT INTO userWeight (userID, weight) VALUES (5, 76)
This saves the weight into the database.
When I want to retrieve weight history for a specific user I do this:
SELECT weight, timee FROM userWeight WHERE userID = 5
My question is, this seems like a funny way of doing things. Is there a better database design I could use?
With this design, the weights for all users gets stored in a single table, is this the correct approach?
Thank you.