Query CSV files with SQL

Import a CSV file and query it with SQL, without setting up a database, writing a script, or fixing column names first. The results show up in a grid you can scroll, filter, and sort, even with millions of rows.
Download for Mac Free and open source (MIT) · Also available for Windows

By Tanin Na Nakorn · Updated

Spreadsheets are fine until the question needs a GROUP BY, a join, or a file with more than a million rows. At that point most people reach for one of three things: a Python script, the SQLite or DuckDB command line, or a database server they load the file into. All three work. All three also make you clean up the file first, and then show you the answer in a terminal, 100 rows at a time.

Superintendent is a desktop app that skips those steps. Here's how it works.

1. Import the CSV

Click Import CSV in the sidebar, or drop the file onto the window. Pick the delimiter (comma, tab, semicolon, pipe…) and whether the first row holds the column names.

Superintendent then cleans up what usually breaks a script:

  • Column names. Spaces and symbols become underscores, so Customer ID becomes Customer_ID and you don't need quotes around every column.
  • Duplicate column names get a suffix, so two email columns become email and email_1.
  • Data types are detected: numbers, dates and times, and booleans, so SUM and date comparisons work without casting.

The file becomes a table named after it. orders_2025.csv becomes the table orders_2025.

The Import CSV dialog in Superintendent, with the delimiter and header options

2. Write SQL

Open a query tab and write SQL against the table. The editor has syntax highlighting and autocompletes table and column names. Say you exported a year of orders and want revenue by month for each country:

monthly_revenue
select
  country,
  date_trunc('month', ordered_at) as month,
  count(*) as orders,
  sum(amount) as revenue
from orders_2025
where status = 'paid'
group by 1, 2
order by month, revenue desc
country month orders revenue
1 US 2025-01-01 18,402 1,204,388.50
2 DE 2025-01-01 6,117 389,021.10
3 GB 2025-01-01 5,893 371,446.75
4 US 2025-02-01 17,960 1,188,902.00

The workspace runs on DuckDB, so you get window functions, CTEs, QUALIFY, regular expressions, and date functions. If you know PostgreSQL, you already know most of it.

3. Look at every row

Every result opens in a grid. Scroll through all of it, not just the first 100 rows. Click a column header to sort it, or add a filter (equals, greater than, is null…) without editing the query. When a value looks wrong, you can fix it right in the grid. Edits change the table in your workspace, never the original file.

A query result in Superintendent with a filter and a sort applied to its columns

4. Save or export the result

Click Export CSV to write any result to a new file. Or save the workspace as a .super file. It keeps your tables and queries, so you can rerun the same analysis on next month's export.

Going further

Questions

Which SQL dialect does Superintendent use for CSV files?

CSV files are imported into a local workspace that runs on DuckDB, so you write DuckDB SQL. It's close to PostgreSQL, with window functions, CTEs, regular expressions, and date functions.

How large a CSV file can I query?

Superintendent handles CSV files up to 40GB, and you can scroll through every row of the result, even with tens of millions of rows.

Do I need to install a database?

No. The workspace is built in. Install the app, import the CSV, and write SQL.

Can I query several CSV files together?

Yes. Each CSV becomes its own table, and you can join, union, or compare them in one query.

Can I save the results?

Yes. Export any query result to a CSV file with the delimiter you want. You can also save the whole workspace, with its tables and queries, as a .super file and reopen it later.

Try it on your own data

Free and open source. No account, no credit card. Your data stays on your computer.

Also available for Windows