Table Structure: 2 Related Entities Share the Same Entity I was hoping I could get some advice on my table structure. Im writing a simple workout tracker for me and my buddies. These are the requirements:


Multiple users
A user can have multiple workouts
A workout has multiple sets
A set can have multiple users


I have a way to accomplish what I need to but I feel like theres a much simpler way that Im missing.

tbl_user

| UserId |   Name |
-------------------
|      1 |  John  |
|      2 |  Greg  |


tbl_workout

| WorkoutId |
-------------
|     1     |
|     2     |


tbl_user_workout

| WorkoutId | UserId |
----------------------
|     1     |    1   |
|     2     |    1   |


tbl_set

| SetId | WorkoutId |
---------------------
|   1   |      1    |
|   2   |      1    |


tbl_user_set

| UserSetId | SetId | UserId | Reps | Weight |
----------------------------------------------
|     1     |    1  |    1   |  20  |   50   |
|     2     |    1  |    2   |  15  |   60   |


I figure this way I could get:


A users sets with user->userset
A users workouts with user->userworkout
A workouts sets with workout->set


Is this structure logical?
Try it like this:
general table:
general_id/user_id/set_id/workout_id/Reps/Weight
In your select query you can then do something like this:
SELECT concat(u.name, ' , u.last_name) as user,
       s.set,
       w.workout,
       g.reps,
       g.weight
FROM general_tbl g JOIN user u ON u.id_user = g.id_user 
                   JOIN set s ON s.id_set = g.id_set
                   JOIN workout w ON w.id_workout = g.id_workout