IT 547 Database Design · Walsh College · Summer 2025
A normalized eight-table relational database for workouts, meals and body progress, loaded into a real SQLite engine running in your browser so you can run her queries or write your own.
A real SQLite database is running in this page. Pick one of her queries or edit the SQL and press Run (Ctrl+Enter).
Eight entities: six core tables plus two associative tables (WorkoutExercise, MealItem) that resolve the many-to-many links. Click a table to query it.
Read live from sqlite_master and PRAGMA table_info.
Both charts are SQL queries against the live database, so they update if you insert, update or delete rows above.
CREATE TABLE scripts with auto-increment keys, typed columns, a unique email and ON DELETE CASCADE foreign keys.ROW_NUMBER() window for each user's biggest meal and a muscle-group filter. This page adds weekly volume, a calorie consistency check, daily macros and an index plan check.Porting note: her scripts target MySQL. To run them in SQLite the page makes two mechanical edits before executing: INT AUTO_INCREMENT PRIMARY KEY becomes INTEGER PRIMARY KEY AUTOINCREMENT, and ENGINE=InnoDB is removed. Foreign keys are switched on with PRAGMA foreign_keys = ON. Her data and query scripts run unchanged.
Sample (synthetic) records she wrote for the population script: two example users with @example.com emails, covering 1 to 4 August 2025. They are not real people or measurements.
Source files: D2_component_1.sql (schema), D2_component_2.sql (indexes), D3_component_1.sql (data), D3_component_2.sql (queries). D3_combined.sql is the data and query scripts concatenated.