Search code examples
phpmysqlnormalize

What is the procedure to normalize a database with PHP?


I just took over a pretty terrible database design job, which heavily use comma separated value to store data. I know I know, it is hell.

The db is mysql, currently accessing it using MySql Workbench.

I already had idea in mind what to remove, and what new relations table needed.

So, my question is, how shall I proceed by migrating comma separated data to the new table? Any tools specialize for normalizing database?

Edit: The server code is in PHP.


Solution

  • Define you new tables and attributes first.

    Then, use PHP or Python or your favorite language with MySQL calls and write a 1 time converter which loops and reads the old table(s) and records and inserts the proper records into the new tables.