Hi, im practicing using my mac terminal for SQL queries, I am trying to import a .csv file in to sqlite using mac terminal for the first time but every time I try it no matter how I rename the csv file or the table it still returns this error TABLE table_1(…) failed: duplicate column name:(in this example I named the table "table_1)

any help is much appreciated.


Welcome to the forums!

Try the following code:

sqlite> .mode csv
sqlite> .import Your/Path/Here/name.csv table_1 

Also, double check that your csv doesn’t have duplicate column names before you try to import it (since that’s what the error says is the problem). You can open up a csv file in Excel or LibreOffice Calc for easy editing.