Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Created April 4, 2013 19:04
Show Gist options
  • Save telagraphic/5313193 to your computer and use it in GitHub Desktop.
Save telagraphic/5313193 to your computer and use it in GitHub Desktop.
two tables
workouts
________
id
date
reps
desc
exercise_id
exercise
________
id
type
when inserting into workouts table, how would i reference the corresponding exercise id without typing the id into my insert?
instead of putting 1 or 3 in the workouts foreign key column(exercise_id), i would put the type of exercise that would match in the exercise table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment