LogicAndPhysicalDeisgn: polnenje.sql

File polnenje.sql, 2.2 KB (added by 201136, 9 months ago)
Line 
1delete from UserHasProgram;
2delete from UserHasDay;
3delete from DayHasMeal;
4delete from MealHasIngredient;
5delete from DayHasWorkout;
6delete from WorkoutHasExercise;
7delete from WorkoutProgramHasWorkout;
8
9delete from _User;
10delete from _Day;
11delete from Meal;
12delete from Ingredient;
13delete from PersonalizedIngredient;
14delete from Workout;
15delete from Exercise;
16delete from PersonalizedExercise;
17delete from WorkoutProgram;
18
19
20
21INSERT INTO _User (uID, name, password, age, height, weight, role)
22VALUES
23 (1, 'JohnDoe', 'password123', 25, 180, 75, 'user'),
24 (2, 'JaneDoe', 'securepass', 30, 165, 60, 'admin');
25
26
27
28
29INSERT INTO _Day (dID, date)
30VALUES
31 (1, '2024-02-08'),
32 (2, '2024-02-09');
33
34
35
36INSERT INTO Workout (wID, duration, name, uID)
37VALUES
38 (1, 60, 'Morning Workout', 1),
39 (2, 45, 'Evening Workout', 2);
40
41
42
43INSERT INTO Meal (mID, name, type, uID)
44VALUES
45 (1, 'Breakfast', 'Healthy', 1),
46 (2, 'Lunch', 'Balanced', 2);
47
48
49 INSERT INTO Ingredient (iID, name, calories, protein, carbs, fats)
50VALUES
51 (1, 'Eggs', 70, 6, 1, 5),
52 (2, 'Chicken Breast', 165, 31, 0, 3);
53
54
55
56INSERT INTO PersonalizedIngredient (piID, quantity, iID)
57VALUES
58 (1, 2, 1),
59 (2, 150, 2);
60
61
62
63INSERT INTO Exercise (eID, name, type)
64VALUES
65 (1, 'Running', 'Cardio'),
66 (2, 'Bench Press', 'Bodybuilding');
67
68
69
70INSERT INTO PersonalizedExercise (pID, reps, sets, weight, time, eID)
71VALUES
72 (1, 10, 3, 50, NULL, 1),
73 (2, 12, 4, 80, NULL, 2);
74
75
76
77INSERT INTO WorkoutProgram (wpID, name)
78VALUES
79 (1, 'Weight Loss Program'),
80 (2, 'Muscle Building Program');
81
82
83
84INSERT INTO UserHasDay (uID, dID)
85VALUES
86 (1, 1),
87 (2, 2);
88
89
90
91INSERT INTO UserHasProgram (uID, wpID)
92VALUES
93 (1, 1),
94 (2, 2);
95
96
97
98INSERT INTO DayHasWorkout (wID, dID)
99VALUES
100 (1, 1),
101 (2, 2);
102
103
104
105INSERT INTO WorkoutProgramHasWorkout (wID, wpID)
106VALUES
107 (1, 1),
108 (2, 2);
109
110
111INSERT INTO DayHasMeal (mID, dID)
112VALUES
113 (1, 1),
114 (2, 2);
115
116
117INSERT INTO MealHasIngredient (mID, iID)
118VALUES
119 (1, 1),
120 (2, 2);
121
122
123INSERT INTO WorkoutHasExercise (eID, wID)
124VALUES
125 (1, 1),
126 (2, 2);
127
128
129
130