Compare Proposal

Nothing to compare.

General Purpose Denormalized Database Normalization Tool 2

  • Posted at : 2 months ago
  • Post Similar Project
10

Budget
4
Proposals
66
Views
Awarded
Status
Skills Required

Posted By -

KL

4.7
Projects Posted : 36
Projects Paid : 6
Services Purchased : 2
Total Spent :
116
Feedbacks : 75 %

Project Details show (+) hide (-)

https://www.kaggle.com/openfoodfacts/world-food-facts has a retarded sparse matrix structure with the nutrients as columns, lots of columns, like Vitamin B12, Vitaimin C, Zinc, Saturated Fat, etc.  This is a sparse matrix because not every product has data for every nutrient...this violates the normalization rules - is actually a spreadsheet, not a database.

I need this normalized properly.  The columns should probably be something like ProductID, NutrientID, value, units.

Basically, take the root field values like ID, etc., and put the NutrientID, value, and units next to it, where the value is not null...so a Not Null query for every column.

It would be ideal to have a general purpose scrpt, preferably PHP, but maybe SQL, to do this.  If PHP it has to make the database connection, and take the table name, as around 5 configuration variables, along with a way to assign the column names, values, units to database fields in the new table.  I can do a lot of this in PHPMyAdmin, I don't need a lot of magic.

In both cases, the column list can pretty easily be gleaned from Information_Schema.

Sample data file is at https://drive.google.com/open?id=1ICCT8IW6KufCo7qvnu8I5ZlcjD6k8396

Your Job Feed