Mysql LOAD command lets import data from csv files
LOAD DATA INFILE 'data.csv' INTO TABLE table_main
FIELDS TERMINATED BY ',';
What if there are multiple relation tables
table_main
id
firstname
lastname
table_type
id
table_main_id
table_type_id
table_type
id
typename
Is it possible to load a csv file with content like below with LOAD command
firstname, lastname, typename
john,doe,mytypename
No, it it not possible with
LOAD DATAsyntax to insert into multiple tables. A possible workaround is loading it into a temporary table & take it from there.