I have a MySQL database and I want to normalize it in an efficient way. I have a table in my database in which i am getting data into column in the form of array. Actually I have three tables (details, country, material). In table "country" I have two column that are (id,country_name). In table "material" I have two column (id, material) and in table "details" i have four column (id, vendor, countries, materials). In this scenario, each vendor has multiple countries and materials and I am inserting ids of country and material in details table. Here is the screenshot:

so how I accurately normalize my database? Thanks in advance
Remove countries and materials columns from Details table.
You can create a fourth table which will depict the relationship between vendor,country and material:
vendor_id country_id material_id
1 3 5
1 6 9
1 7 24
Here all the columns will be foreign key and together they will form composite primary key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With