Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relations between similar tables?

Status
Not open for further replies.

John4211

Technical User
Dec 5, 2006
1
US
The title may not be accurate... but here goes:

I have a workout DB that allows me to enter workouts (workouts contain exercises), meals (meals contain foods), and schedule the workouts and meals in a schedule table (links a meal or a workout to a schedule record with a date and time).
workout.png


Here's where I'm having trouble:
I want to track my progress as far as weights and reps. This means a seperate "Instance" table for the workout items. When I add a workout to the schedule, the workout items instance portal should populate with the exercises in that workout simply by entering a workout ID. However, I don't see that as possible via my design. I have to create new "instance" records, and copy the workout IDs into them. This is not ideal, and I feel like I'm missing something here (there has to be a better way). I know a but about DB design, relationships, etc, but can obviously use some guidance.

Any help is greatly appreciated.
 
Not knowing your whole structure, I would say that you have to add an exercise in the exercise table, and link that to a workoutID.
If the exercise doesn't fall into a workoutmodel
you have to create a new workout and an exercise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top