Re: Neep some comments on my schema...

From: Julian M <julian_at_dotnetsolutions.ltd.uk>
Date: 21 Nov 2005 19:12:15 -0800
Message-ID: <1132629135.313809.135200_at_f14g2000cwb.googlegroups.com>


tconley79 wrote:
> Ok I have this form data that needs to be stored in a database
> structure. It's basically a form that logs several people's workout
> session on a regular basis...so every form is one workout log for one
> person.
>
> It's got hairy once I learn that a workout session can be broken down
> into so many little parts. i.e....
>
> -A session is comprised of phases (warm up, core, cool down)
> -A phase is comprised of exercises(bar bell press, lunge,
> whatever..and these exercises are innummerable)
> -An exercise works one or more muscles and is comprised of sets(one or
> more)
> -And a set is comprised of two values, intensity and repetitions.
>
> *whew*
>
> Now here's my prelim structure:
>
> SESSION
> =========
> ID
> client_ID
> date
>
> PHASE
> =======
> ID
> name
>
> EXERCISE
> ========
> ID
> name
> description
>
> MUSCLE_GROUP
> ============
> ID
> name
>
> EXERCISE_WORKS
> ==============
> exercise_ID
> muscle_group_ID
>
> WORKSET
> =======
> ID
> intensity
> reps
>
> SESSION_INFO
> ============
> session_ID
> phase_ID
> exercise_ID
> exercise_order_in_phase
> worsket_ID
> workset_order_in_exercise
> notes
>
>
> So with this structure each row of the session_info table would
> describe one set of one exercise of one phase of a session. Is there
> a better way??

Hi,

Looks like a good start

A couple of general suggestions
- Personally I think PascalCaseType names look better (MuscleGroup) just my taste
- I think it is a good idea to stick to all singular or all plural table name, this helps to clarify thoughts when modelling - EXERCISE_WORKS bettter as MusclesWorked?

On to suggestions about the model
- SESSION_INFO is not needed, as each Session is distinct you can put the note field on Session, Exercise, Phase and Set (oops workset) and then navigate down the "session tree" for each session - You need to add ordering for Phase, Exercise, and Set. Couple of options

  • add an Order field on these three tables
  • you could do things a little differently with Phase and use a lookup/reference table with the three Phases warm up, core, cool down as values and use a drop down to select

PhaseType



PhaseTypeId (I prefer to concatenate Id onto the table name) Name

Three rows of data
PhaseTypeId Name

1                  warm up
2                  core
3                  cool down

BIG QUESTION
This structure only stores Sessions I have several different workouts I do at the gym do you not need to store these as well? If this is needed you can use roughly the same structure to store the SessionPlan (you will not need Set, as you can just store the number of sets on Exercise). then You would need to record individual Sessions against the plans.

Hope this helps
Julian 8^) Received on Tue Nov 22 2005 - 04:12:15 CET

Original text of this message