I have a table in mysql:
user_item_text
username, item, text
I want to normalize the data into three tables:
users
user_id, username
items
item_id, item_name
text
text_id, text_name
How can I use the existing user_item_text table to create the three tables as described? There are around 800000 records.
Here is the example how to handle one table “user”:
maybe you will be need to add the following steps before runing the last
update:user_item_text.usernamefield to make update run fasterusers.usernameinstead of ordinary indexuser_item_index.user_idshould have FKHope it helps.
ps. i didn’t test query. They just showing you general approach.