johnding1996 / HKUST-COMP3111H-Group

Group Project of COMP 3111H in Fall 2017 at HKUST
Apache License 2.0
0 stars 0 forks source link

Database food nutrition table and JSON format design and reviewment #29

Closed wenshuoguo closed 6 years ago

wenshuoguo commented 6 years ago

Currently the database foodnutrition table is designed with the following structure

                               Table "public.foodnutrition"
   Column    |          Type          | Modifiers | Storage  | Stats target | Description
-------------+------------------------+-----------+----------+--------------+-------------
 ndb_no      | integer                | not null  | plain    |              |
 shrt_desc   | character varying(60)  |           | extended |              |
 water       | numeric(10,2)          |           | main     |              |
 energ_kcal  | numeric(10,0)          |           | main     |              |
 protein     | numeric(10,2)          |           | main     |              |
 lipid_tot   | numeric(10,2)          |           | main     |              |
 ash         | numeric(10,2)          |           | main     |              |
 carbohydrt  | numeric(10,2)          |           | main     |              |
 fiber_td    | numeric(10,1)          |           | main     |              |
 sugar_tot   | numeric(10,2)          |           | main     |              |
 calcium     | numeric(10,0)          |           | main     |              |
 iron        | numeric(10,2)          |           | main     |              |
 magnesium   | numeric(10,0)          |           | main     |              |
 phosphorus  | numeric(10,0)          |           | main     |              |
 potassium   | numeric(10,0)          |           | main     |              |
 sodium      | numeric(10,0)          |           | main     |              |
 zinc        | numeric(10,2)          |           | main     |              |
 copper      | numeric(10,3)          |           | main     |              |
 manganese   | numeric(10,3)          |           | main     |              |
 selenium    | numeric(10,1)          |           | main     |              |
 vit_c       | numeric(10,1)          |           | main     |              |
 thiamin     | numeric(10,3)          |           | main     |              |
 riboflavin  | numeric(10,3)          |           | main     |              |
 niacin      | numeric(10,3)          |           | main     |              |
 panto_acid  | numeric(10,3)          |           | main     |              |
 vit_b6      | numeric(10,3)          |           | main     |              |
 folate_tot  | numeric(10,0)          |           | main     |              |
 folic_acid  | numeric(10,0)          |           | main     |              |
 food_folate | numeric(10,0)          |           | main     |              |
 folate_dfe  | numeric(10,0)          |           | main     |              |
 choline_tot | numeric(10,0)          |           | main     |              |
 vit_b12     | numeric(10,2)          |           | main     |              |
 vit_a_iu    | numeric(10,0)          |           | main     |              |
 vit_a_rae   | numeric(10,0)          |           | main     |              |
 retinol     | numeric(10,0)          |           | main     |              |
 alpha_carot | numeric(10,0)          |           | main     |              |
 beta_carot  | numeric(10,0)          |           | main     |              |
 beta_crypt  | numeric(10,0)          |           | main     |              |
 lycopene    | numeric(10,0)          |           | main     |              |
 lut_zea     | numeric(10,0)          |           | main     |              |
 vit_e       | numeric(10,2)          |           | main     |              |
 vit_d_mcg   | numeric(10,1)          |           | main     |              |
 vit_d_iu    | numeric(10,0)          |           | main     |              |
 vit_k       | numeric(10,1)          |           | main     |              |
 fa_sat      | numeric(10,3)          |           | main     |              |
 fa_mono     | numeric(10,3)          |           | main     |              |
 fa_poly     | numeric(10,3)          |           | main     |              |
 cholestrl   | numeric(10,3)          |           | main     |              |
 gmwt_1      | numeric(9,2)           |           | main     |              |
 gmwt_desc1  | character varying(120) |           | extended |              |
 gmwt_2      | numeric(9,2)           |           | main     |              |
 gmwt_desc2  | character varying(120) |           | extended |              |
 refuse_pct  | numeric(2,0)           |           | main     |              |

The corresponding JSONObject (FoodJSON) is a flat wrapping of a row in the table. This issue is opened to review this design and propose changes to these formats.

johnding1996 commented 6 years ago

Please refer to TABLE16 at page 46-48 in SR28_DOCS for the meaning of the column names

johnding1996 commented 6 years ago

Closed since out-of-dated.