-
Notifications
You must be signed in to change notification settings - Fork 0
/
utilities.sql
54 lines (34 loc) · 2.25 KB
/
utilities.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
create table bearfood.users (id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), email varchar(50));
create table bearfood.ingredients (id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), kcal int);
create table bearfood.meals (id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), ingredient_id int, gram int);
create table bearfood.tour_meals (id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), meal_id int, meal_day_no int, meal_no int, tour_id int);
create table bearfood.tour (id int PRIMARY KEY AUTO_INCREMENT, name varchar(50), user_id int);
# connect
mariadb --host 192.168.4.23 -P 33306 --user root -p;
# Insert
r = requests.post('http://127.0.0.1:5000/api/add_user/', json={"email": "[email protected]", "name": "Katy"})
r = requests.post('http://127.0.0.1:5000/api/add_user/', json={"name": "YY", "kcal": 20})
# add ingredients
insert into ingredients (name, kcal) values ('Snabb nudlar',359);
insert into ingredients (name, kcal) values ('kikärtor',360);
insert into ingredients (name, kcal) values ('Quinoa',360);
insert into ingredients (name, kcal) values ('Havre',370);
insert into ingredients (name, kcal) values ('Quinoa',380);
insert into ingredients (name, kcal) values ('Hårdost',398);
insert into ingredients (name, kcal) values ('sojabönor',400);
insert into ingredients (name, kcal) values ('Ölkorv',450);
insert into ingredients (name, kcal) values ('Golden curry',462);
insert into ingredients (name, kcal) values ('Edamame bönor',544);
insert into ingredients (name, kcal) values ('mandel',550);
insert into ingredients (name, kcal) values ('Choklad',566);
insert into ingredients (name, kcal) values ('mörk choklad',566);
insert into ingredients (name, kcal) values ('Kakaonibs',572);
insert into ingredients (name, kcal) values ('Rostad lök',580);
insert into ingredients (name, kcal) values ('Cashew',580);
insert into ingredients (name, kcal) values ('Jordnötter',620);
insert into ingredients (name, kcal) values ('Jordnötter',620);
insert into ingredients (name, kcal) values ('Kokos',621);
insert into ingredients (name, kcal) values ('solrosfrön',638);
insert into ingredients (name, kcal) values ('Valnötter',654);
insert into ingredients (name, kcal) values ('Olivolja',884);
inser into ingrients (name, kcal) values (XX, YY);