Loading a new database
Posted on 2011-02-13
I want to create a new MySQL database that will be loaded from about 50,000 current PayPal records. The PayPal records have the customer's information plus the product information. I want to split this into a Customer table and an Order table.
My current thinking is to get a CSV from PayPal and input it into a Raw table in MySQL, using phpMyAdmin. Then I could do a SELECT on the Raw table to build a table that just has the customer information fields, and If I add a DISTINCT I should have a table, or "view" of just the unique customers with their information. I would then like to feed that data to the Customer table, which will have an auto incrementing Primary key of Customer_ID and then all the fields for the customer info. I guess I could output that "view" as a CSV and thne input the CSV file to the new Customer table, but it seems like there should be a better way.
I'm just starting with MySQL and phpMyAdmin so perhaps someone could suggest the "proper" way to build this Customer table from the raw PayPal data.
Then I need to build an Order table, that contains just a single Customer_ID column, in place of all the customer information fields in the Raw data, with the details of each order in the rest of the columns.
Any suggestions on the proper road to down to get this all done would be most welcome.