How to efficiently extract data from a csv file and save it in mysql
If there are several rows with a consistent number of columns in the CSV, then


CREATE TABLE with lots of columns
LOAD DATE into it.
Do "unpivot" code to rearrange it into the 'real' tables you want.


If there is only one row in your CSV, then write code in your favorite programming language to break it apart.

Not sure what to do if you have an inconsistent number of columns.

You can use INSERT IGNORE and/or IODKU` to deal with duplicates.