userfood table
auto_id | userId | date | foodname | perserving | satfat | monofat | polyfat | protein | carb
1 ------ 1234567S --2010/02/01 -- chicken rice- --- 382g ----- 8.7 ----- 9.1 ---- 3.7 ------ 25 ----- 75
2 ------ 1234567S --2010/02/02 -- mee siam----- --- 683g ----- 8.6 ----- 9.1 ---- 4.9 ------ 28 ----- 92
calorieprofile table
auto_id | userId | date | protein | carb | fat
1 ------ 1234567S --2010/02/01 ---- 25 ---- 75 --- 42
2 ------ 1234567S --2010/02/02 ---- 28 ---- 92 --- 37
display out in this form
date | foodname | fat consume | daily fat | protein consmue | daily protein | carb consume | daily carb
2010/02/01 -- chicken rice -- --- 21.5 ---------- 42 ---------- 25 -------------- 25 ----------- 75 ---------- 75 ----
2010/02/01 ----- mee siam --- --- 22.6 ---------- 37 ---------- 28 -------------- 28 ----------- 92 ---------- 92 ----
I'm trying to sum the value satfat, monofat and polyfat from userfood table together and output as what it show in the display as the coulmns fat consume. But this 3 data is DOUBLE data type and i do not know how to go about adding and displaying. I also planning to join the userfood and calorie profile together to compare the fat, protein and carb that the user has consumed. But the problem is i'm not sure how to go about writing the sql statement. anyone can help,thanks.