Ok so i have a website in progress that will allow users to build routines using a set list of exercises provided. They can add a number of exercises to a routine which they will create and title themselves.
So i’m thinking i should have a user table.
Each user will have a number of routines.
Each routine will have a number of exercises.
Therefore I will have 3 tables: user, routines, and exercises
BUT
How can i link the ‘routines’ and ‘exercises’, because ‘routines’ is going to have to be more than one table, because if you imagine a user creates “biceps” routine and fills it with exercises. Then he creates “triceps” and fills it with exercises. He will then have to have two routine tables called ‘biceps’ and ‘triceps’.
So how can I structure my database to accommodate this?
bearing in mind each user has a unique ID
Every exercise has a unique ID
and Every Routine has a unique ID.
1 Answer