Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Creating a database

Creating a database

Scheduled Pinned Locked Moved Database
databasehelptutorialquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christer Claesson
    wrote on last edited by
    #1

    Hello there, I'm currently creating an application that will work as a workout journal. One part of this will be reporting your exercices. I will have a list of avaliable exercices which the user can choose one from and fill in the necessary information. Now, at first I thought it was easy with just two tables. One for each filled in exercice connected to a user and one for all avaliable exercices. However the problem is that while all exercices have a name they differ in other variables. Pushups for example are just repetitions, benchpress is repetition and weight, running is distance and length. Etc etc. How would I solve this in the best way? Having one table with all avaliable exercices and variables and just having NULL when the field is supposed to be empty? Splitting them up to different tables might be difficult as I would like to add new exercices without having to remake the database if I happened to miss one combination. Thank you in advance and hope you understood my rambling.

    C 1 Reply Last reply
    0
    • C Christer Claesson

      Hello there, I'm currently creating an application that will work as a workout journal. One part of this will be reporting your exercices. I will have a list of avaliable exercices which the user can choose one from and fill in the necessary information. Now, at first I thought it was easy with just two tables. One for each filled in exercice connected to a user and one for all avaliable exercices. However the problem is that while all exercices have a name they differ in other variables. Pushups for example are just repetitions, benchpress is repetition and weight, running is distance and length. Etc etc. How would I solve this in the best way? Having one table with all avaliable exercices and variables and just having NULL when the field is supposed to be empty? Splitting them up to different tables might be difficult as I would like to add new exercices without having to remake the database if I happened to miss one combination. Thank you in advance and hope you understood my rambling.

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      Christer Claesson wrote:

      Having one table with all avaliable exercices and variables and just having NULL when the field is supposed to be empty? Splitting them up to different tables might be difficult as I would like to add new exercices without having to remake the database if I happened to miss one combination.

      Splitting the information into tables is probably the best way - one table detailing all the variables, one table containg the excercises and another table with the link between the two (one to many relationship). Hope this helps Chandra Ram

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups