0% found this document useful (0 votes)
10 views9 pages

Database Management System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

Database Management System

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Personalized nutrition and exercise

program.
PROJECT

YASEEN MOHAMMED AHMED 2K21/CO/538


ABU ALHASSAN BABEKIR 2K21/CO/539
Database management system

Project –I

Personalized nutrition and exercise program

In this project, the goal is to develop a DBMS that efficiently manages and tracks personalized
nutrition and exercise programs for individual clients. The DBMS will store and retrieve client
information, nutritional data, exercise routines, and health records.

Theory:

The client attribute represents the individuals participating in the program. It includes information
such as the client's name, age, gender, contact details, and any specific health conditions or dietary
restrictions they may have. This information allows the DBMS to create a comprehensive profile for
each client.

The nutrition attribute contains data related to the personalized diet plans. It includes information
such as daily calorie intake, macronutrient distribution (carbohydrates, proteins, and fats), meal
timings, and specific food recommendations. This data is customized based on the client's goals,
preferences, and any health conditions. The DBMS stores and updates this information to provide
clients with accurate and up-to-date nutritional guidance.

The exercise attribute stores information about the personalized exercise routines for each client. It
includes details such as workout types (cardiovascular exercises, strength training, etc.), duration,
intensity levels, frequency, and any modifications or progressions over time. The DBMS maintains
exercise logs and tracks progress to help clients stay consistent and reach their fitness goals
effectively.

The health record attribute is crucial for monitoring and assessing the client's overall health and
progress. It includes information such as body measurements (weight, height, body mass index), vital
signs (blood pressure, heart rate), body composition analysis, and any relevant medical test results.
The DBMS securely stores this data, allowing clients and professionals to review historical health
records and track changes over time.

With this DBMS, nutritionists, trainers, and clients can collaborate effectively. Nutritionists can access
the client's health records, analyze nutritional data, and make adjustments to the diet plans
accordingly. Trainers can review exercise routines, track client progress, and provide feedback or
modifications to ensure optimal fitness outcomes. Clients can access their personalized information,
record their meals and workouts, and track their health and fitness journey.
The ER-diagram :

Explanation of the client attribute:


 client_id: This attribute is an integer and serves as the primary key of the table, uniquely
identifying each client.

 gender: This attribute represents the gender of the client and is stored as a string. It can have
values such as "Male," "Female," or "Non-binary."
 height: This attribute represents the height of the client and is stored as a floating-point
number. The unit of measurement can be specified, such as centimeters or meters.

 weight: This attribute represents the weight of the client and is stored as a floating-point
number. The unit of measurement can be specified, such as kilograms or pounds.

 client_name: This attribute stores the name of the client as a string. The maximum length is
set to 50 characters, but you can adjust it according to your requirements.

 goal_weight: This attribute represents the target weight that the client aims to achieve and is
stored as a floating-point number. The unit of measurement can be the same as the weight
attribute.

 goal_deadline: This attribute represents the deadline or target date by which the client aims
to achieve their goal weight. It is stored as a DATE data type.

Explanation of the program attribute:


 program_id: This attribute is an integer and serves as the primary key of the table, uniquely
identifying each program entry.

 client_id: This attribute is a foreign key referencing the client_id from the "Client" table. It
establishes a relationship between the program entry and the corresponding client.

 start_date: This attribute represents the start date of the program and is stored as a DATE
data type.

 end_date: This attribute represents the end date or target completion date of the program
and is stored as a DATE data type.

 nutrition_goal: This attribute stores the nutrition-related goal or objective for the program as
text. It can provide details about the desired outcomes or specific targets to be achieved.

 exercise_goal: This attribute stores the exercise-related goal or objective for the program as
text. It can specify the desired fitness outcomes or specific targets to be achieved.

 nutrition_plan: This attribute stores the detailed nutrition plan for the program as text. It can
include information about recommended dietary guidelines, meal plans, and food choices.

 program_status: This attribute represents the current status of the program (e.g., ongoing,
completed, paused) and is stored as a string. The maximum length is set to 20 characters.

 notes: This attribute allows for any additional notes or comments related to the program and
is stored as text.

The foreign key constraint (FOREIGN KEY) ensures that the client_id references an existing client in the
"Client" table.

Explanation of the nutrition attribute:


 nutrition_id: This attribute is an integer and serves as the primary key of the table, uniquely
identifying each nutrition entry.

 client_id: This attribute is a foreign key referencing the client_id from the "Client" table. It
establishes a relationship between the nutrition entry and the corresponding client.

 program_id: This attribute is a foreign key referencing the program_id from the "Program"
table (assuming a separate table for program information). It establishes a relationship
between the nutrition entry and the specific program it belongs to.

 date: This attribute represents the date of the nutrition entry and is stored as a DATE data
type.

 meal_type: This attribute represents the type of meal (e.g., breakfast, lunch, dinner, snack)
and is stored as a string. The maximum length is set to 20 characters.

 calories: This attribute represents the number of calories consumed in the specific meal and is
stored as a floating-point number.

 protein: This attribute represents the amount of protein consumed in the specific meal and is
stored as a floating-point number.

 carbs: This attribute represents the amount of carbohydrates consumed in the specific meal
and is stored as a floating-point number.

 fat: This attribute represents the amount of fat consumed in the specific meal and is stored as
a floating-point number.

 sugar: This attribute represents the amount of sugar consumed in the specific meal and is
stored as a floating-point number.

The foreign key constraints (FOREIGN KEY) ensure that the client_id references an existing client in the
"Client" table and the program_id references an existing program in the "Program" table.

Explanation of the exercise attribute:


 exercise_id: This attribute is an integer and serves as the primary key of the table, uniquely
identifying each exercise entry.

 client_id: This attribute is a foreign key referencing the client_id from the "Client" table. It
establishes a relationship between the exercise entry and the corresponding client.

 program_id: This attribute is a foreign key referencing the program_id from the "Program"
table (assuming a separate table for program information). It establishes a relationship
between the exercise entry and the specific program it belongs to.

 exercise_name: This attribute represents the name or description of the exercise and is stored
as a string. The maximum length is set to 50 characters.

 duration: This attribute represents the duration of the exercise session in minutes and is stored
as an integer.
 calories_burned: This attribute represents the number of calories burned during the exercise
session and is stored as a floating-point number.

 intensity_level: This attribute represents the intensity level of the exercise (e.g., low,
moderate, high) and is stored as a string. The maximum length is set to 20 characters.

The foreign key constraints (FOREIGN KEY) ensure that the client_id references an existing client in the
"Client" table and the program_id references an existing program in the "Program" table

Explanation of the health record attribute:


 health_record_id: This attribute is an integer and serves as the primary key of the table,
uniquely identifying each health record entry.

 client_id: This attribute is a foreign key referencing the client_id from the "Client" table. It
establishes a relationship between the health record entry and the corresponding client.

 date: This attribute represents the date of the health record entry and is stored as a DATE data
type.

 blood_pressure: This attribute represents the blood pressure reading and is stored as a string.
The maximum length is set to 20 characters to accommodate systolic and diastolic values.

 heart_rate: This attribute represents the heart rate (beats per minute) and is stored as an
integer.

 blood_sugar: This attribute represents the blood sugar level and is stored as a floating-point
number.

 cholesterol: This attribute represents the cholesterol level and is stored as a floating-point
number.

 medications: This attribute stores the medications the client is taking as text. It can
accommodate multiple medications and is stored as a TEXT data type.

 medical_conditions: This attribute stores information about the client's medical conditions as
text. It can accommodate multiple conditions and is stored as a TEXT data type.

The foreign key constraint (FOREIGN KEY) ensures that the client_id references an existing client in the
"Client" table.
Sql Code:

CREATE TABLE Client (

client_id INT PRIMARY KEY,

gender VARCHAR(10),

height FLOAT,

weight FLOAT,

client_name VARCHAR(50),

goal_weight FLOAT,

goal_deadline DATE

);

CREATE TABLE Program (

program_id INT PRIMARY KEY,

client_id INT,

start_date DATE,

end_date DATE,

nutrition_goal TEXT,

exercise_goal TEXT,

nutrition_plan TEXT,

program_status VARCHAR(20),

notes TEXT,

FOREIGN KEY (client_id) REFERENCES Client(client_id)

);

CREATE TABLE Exercise (

exercise_id INT PRIMARY KEY,

client_id INT,

program_id INT,
exercise_name VARCHAR(50),

duration INT,

calories_burned FLOAT,

intensity_level VARCHAR(20),

FOREIGN KEY (client_id) REFERENCES Client(client_id),

FOREIGN KEY (program_id) REFERENCES Program(program_id)

);

CREATE TABLE Nutrition (

nutrition_id INT PRIMARY KEY,

client_id INT,

program_id INT,

date DATE,

meal_type VARCHAR(20),

calories FLOAT,

protein FLOAT,

carbs FLOAT,

fat FLOAT,

sugar FLOAT,

FOREIGN KEY (client_id) REFERENCES Client(client_id),

FOREIGN KEY (program_id) REFERENCES Program(program_id)

);

CREATE TABLE HealthRecord (

health_record_id INT PRIMARY KEY,

client_id INT,

date DATE,

blood_pressure VARCHAR(20),
heart_rate INT,

blood_sugar FLOAT,

cholesterol FLOAT,

medications TEXT,

medical_conditions TEXT,

FOREIGN KEY (client_id) REFERENCES Client(client_id)

);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy