Query CSV with SQL
Run SQL on a CSV file right in your browser: filter, group, sort and summarize, then download the result.
How to use the CSV SQL Query
- Load your CSVOpen or paste a CSV. It becomes a table called data, and column names are cleaned up (spaces become underscores).
- Write a queryType standard SQL such as SELECT, WHERE, GROUP BY, ORDER BY and LIMIT, or click an example.
- Run and downloadPress Run query (or Ctrl + Enter), check the result table, and download it as a CSV.
Example
The sample query groups orders by city: Dhaka has 4 orders and 2,001.47 revenue, ahead of Sylhet and Chattogram.
SELECT DISTINCT category FROM data lists the 4 categories: Electronics, Clothing, Home, Books.
Frequently asked questions
Which SQL features work?
Most everyday SQL: SELECT, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, DISTINCT, JOIN, sub-queries, CASE and functions like COUNT, SUM, AVG, MIN, MAX, ROUND, UPPER and LENGTH. It is powered by the open-source AlaSQL engine.
How are my column names used?
Spaces and symbols become underscores, so “Unit Price” becomes unit_price. The full list is shown under the query box. Numeric columns are stored as numbers so SUM and comparisons work.
Is my file uploaded to a database?
No. The SQL engine runs inside your browser, and your data never leaves your device.