Why convert SQL to CSV?
A .sql file is a plain-text script containing schema definitions and INSERT statements, not a flat table. CSV is a plain-text tabular format for spreadsheets and data pipelines. The SQL instructions must be run against a database engine before the resulting rows can be exported as flat .csv.
How to convert SQL to CSV
DBeaver FREE
Connect to the appropriate engine, run the .sql via Script > Execute SQL Script, then right-click any table and choose Export Data as CSV.
MySQL Workbench FREE
Use Server > Data Import to run the .sql into a schema, select a table, run a query, then click the Export button in the result grid to save as CSV.
About these formats
A SQL file is a plain-text file containing SQL commands - schema definitions, INSERT statements, or queries. Open it in any text editor to read it; to use it, execute it against a database…
Open .SQL details →A CSV file stores tabular data as plain text - one row per line, values separated by commas (or semicolons in European locales). Any spreadsheet opens it: Excel, Google Sheets, LibreOffice…
Open .CSV details →Quality & what to watch
- Use the same engine the dump came from: a MySQL dump will fail in PostgreSQL due to dialect differences like backtick quoting and
AUTO_INCREMENT. - A multi-table dump produces multiple CSV files - you must export each table separately.
- Schema-only dumps (no
INSERTstatements) will produce empty CSV files with only column headers.