Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8182407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:51:11+00:00 2026-06-07T00:51:11+00:00

I am trying to develop an application for my localhost on which I can

  • 0

I am trying to develop an application for my localhost on which I can track physical attributes (ht, weight, body water, body fat, etc) over time to compare to caloric intake for the purposes of meal planning, etc. Here’s what I have right now:

DB surname
 TBL home
  memberID (tiny int, 1, auto increment, primary key)
  name (varchar, 30)
  gender (char, 1) ->value should be m or f, but this isn't defined anywhere
  birthdate (datetime)

for storing the physical data over time I have considered having a table with a three-column primary key (date, person, type of measurement) with regular single column indexes on each column so that I can look up all entries for a date OR for a person OR for a measurement type. Like this:

DB surname
 TBL stats (or something to that effect)
  date (datetime, PK1, index)
  memberFK (tiny int, 1, PK2, index)
  type (varchar, 3, PK3, index) -> possible values should be ht | wt | fat | wat maybe others will also become necessary
  value (decimal, 4/1) -> store all values in nnn.n format in a particular system (ie metric) and do any conversions, add units, etc when the data is called

This still seems to create a lot of excess redundancy, so I thought of maybe storing each users measurements in a table in their own database, like so:

DB user1
 TBL stats
  date (datetime, PK1, index)
  type (varchar, 3, PK2, index)
  value (decimal, 4/1)

This seems to clean it slightly by removing a column from the foreign key (and the table altogether), but also prevents me from utilizing foreign keys between this table and other nutrition-related tables that are not user-specific. On the other hand, I plan on developing applications for other household topics in which there is general data and user-specific data, so maybe this is the best way if there are good ways of using data between databases like that.

So neither of these seems quite right to me, but I am at a loss as to how to make them better. I am tending towards the second example, provided I can figure out ways to retain the integrity of my data. Please make any comments of suggestions you think will help. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:51:12+00:00Added an answer on June 7, 2026 at 12:51 am

    Here’s how I would do it

    DB healthstats
        TABLE user
            memberID (int*, auto increment, unsigned zerofill, primary key)
            name (varchar, 50)
            gender (char, 1) ->value should be m or f, but this isn't defined anywhere
            birthdate (datetime)
    
        TABLE reading
            readingID (int*, auto increment, unsigned zerofill, primary key)
            memberID (int*, FK: TABLE user)
            date (datetime)
    
        TABLE stat
            statID (int*, auto increment, unsigned zerofill, primary key)
            readingID (int*, FK: TABLE reading)
            type (varchar, 3)*
            value (decimal 4.1)*
    

    * These datatypes are up to you based on what makes sense, just make sure primary and foreign keys match up.

    A stat is a measurement (e.g. height, weight, bodyfat, etc.) A reading is defined as one or more stat measurements taken at the same time.

    Note this all is within the same database and it contains three tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop a mobile application which can interact with a MOSS
I am trying to develop a web application for which I need to capture
I am trying to develop an application which shows WPF InkCanvas drawings on remote
I am trying to develop an application which downloads online music data (music files)
I am new to programming. I am trying to develop an application in which
I am trying to develop an application which has a button, which on clicking
I'm trying to develop an application using Google's maps and I can't get this
I'm trying to develop an application where simultaneous users can interact and i need
I'm trying to develop an application which records the video using default application and
I am trying to develop a application by using Cocos2d. I can't getting value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.