LogicAndPhysicalDeisgn: polnenjeFinal2.sql

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