Here’s a hypothetical weight change dataset for 12 people over a month, formatted as MySQL tables. This includes sample data for the first few days and instructions to expand it for the full month.
1. Database Schema
First, create two tables:
users (stores user details).
weight_entries (tracks daily weight measurements).
CREATE TABLE users (
user_id INT PRIMARY KEY,
name VARCHAR(50),
gender ENUM('M', 'F'),
age INT
);
CREATE TABLE weight_entries (
entry_id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT,
date DATE,
weight DECIMAL(5,1),
notes TEXT,
FOREIGN KEY (user_id) REFERENCES users(user_id)
);
2. Sample Data Insertion (First 3 Days)
Here’s data for 3 days for 12 users. You can expand this to 30 days by following the pattern.
Users Table
INSERT INTO users (user_id, name, gender, age) VALUES
(1, 'Alice', 'F', 28),
(2, 'Bob', 'M', 35),
(3, 'Charlie', 'M', 42),
(4, 'Diana', 'F', 24),
(5, 'Eve', 'F', 31),
(6, 'Frank', 'M', 29),
(7, 'Grace', 'F', 45),
(8, 'Henry', 'M', 37),
(9, 'Ivy', 'F', 22),
(10, 'Jack', 'M', 50),
(11, 'Kelly', 'F', 33),
(12, 'Luke', 'M', 27);
Weight Entries (Day 1 to Day 3)
-- Day 1 (2023-10-01)
INSERT INTO weight_entries (user_id, date, weight, notes) VALUES
(1, '2023-10-01', 68.5, 'Baseline'),
(2, '2023-10-01', 82.1, 'Baseline'),
(3, '2023-10-01', 91.0, 'Baseline'),
(4, '2023-10-01', 57.3, 'Baseline'),
(5, '2023-10-01', 72.8, 'Baseline'),
(6, '2023-10-01', 78.9, 'Baseline'),
(7, '2023-10-01', 69.2, 'Baseline'),
(8, '2023-10-01', 85.4, 'Baseline'),
(9, '2023-10-01', 54.6, 'Baseline'),
(10, '2023-10-01', 93.7, 'Baseline'),
(11, '2023-10-01', 65.1, 'Baseline'),
(12, '2023-10-01', 76.8, 'Baseline');
-- Day 2 (2023-10-02)
INSERT INTO weight_entries (user_id, date, weight, notes) VALUES
(1, '2023-10-02', 68.3, 'Post-workout'),
(2, '2023-10-02', 82.5, 'High-carb meal'),
(3, '2023-10-02', 90.7, 'Normal'),
(4, '2023-10-02', 57.6, 'Stressful day'),
(5, '2023-10-02', 73.0, 'No exercise'),
(6, '2023-10-02', 79.1, 'Dehydration'),
(7, '2023-10-02', 69.0, 'Consistent routine'),
(8, '2023-10-02', 85.6, 'Normal'),
(9, '2023-10-02', 54.4, 'Sleepless night'),
(10, '2023-10-02', 93.5, 'Normal'),
(11, '2023-10-02', 65.3, 'Light exercise'),
(12, '2023-10-02', 76.6, 'Normal');
-- Day 3 (2023-10-03)
INSERT INTO weight_entries (user_id, date, weight, notes) VALUES
(1, '2023-10-03', 68.0, 'Weight loss diet'),
(2, '2023-10-03', 82.3, 'Reduced sodium intake'),
(3, '2023-10-03', 90.9, 'Normal'),
(4, '2023-10-03', 57.4, 'Normal'),
(5, '2023-10-03', 72.6, 'Post-workout'),
(6, '2023-10-03', 78.7, 'Normal'),
(7, '2023-10-03', 68.8, 'Flu symptoms'),
(8, '2023-10-03', 85.2, 'Normal'),
(9, '2023-10-03', 54.8, 'Normal'),
(10, '2023-10-03', 93.9, 'Normal'),
(11, '2023-10-03', 65.0, 'Normal'),
(12, '2023-10-03', 76.9, 'Normal');