Skip to main content

Generate SQL statements for a CSV file or execute those statements directly on a database. Included in csvkit.

# To generate a 'CREATE TABLE' SQL statement for a CSV file:
csvsql <path/to/data.csv>

# To import a CSV file into an SQL database:
csvsql --insert --db "<mysql://user:password@host/database>" <data.csv>

# To run an SQL query on a CSV file:
csvsql --query "<select * from 'data'>" <data.csv>