Learn and Practise SQL on CSV Files, Free
You can practise SQL without installing a database. Drop a file in the browser and query it.
SQL is easiest to learn on data you understand. A CSV of your own expenses or a generated sales file is better than a toy table. The hard part used to be setting up a database and importing the file.
SQL on Your Files uses DuckDB in the browser. Add a CSV, Excel, JSON or Parquet file, and it appears as a table named after the file. Write a query such as SELECT city, COUNT(*) FROM customers GROUP BY city and click Run. You can join two files, filter, sort and group, and download the result.
A practice plan. Start with SELECT and WHERE, then ORDER BY and LIMIT, then GROUP BY with COUNT and SUM, then JOIN across two files. Use the Mock Data Generator to make a customers file and an orders file and join them. Check each result against what you expect.
The files stay on your device. The tool is meant for practice and analysis, so use a real database for long-running or multi-user work. SQL dialects differ a little between databases, so check the syntax of the one you will use at work.
Related tool pages
- Query a Large CSV with SQL: Run SQL on a CSV of 500 MB or more without a database. Filter, group and export the result. Runs in your browser.
- Query a CSV File with SQL: Query a CSV file with SQL online. Filter, group, sort and join with DuckDB in your browser. No database, no install and no upload.
- Run SQL on an Excel File: Run SQL queries on an Excel file without importing it into a database. Join sheets from different files and download the result.
- Query Parquet Files Online: Open and query Parquet files with SQL in your browser. Preview, filter, aggregate and export to CSV without installing anything.
- Join CSV Files with SQL: Join two or more CSV files with SQL JOIN: inner, left, right or full. Runs in your browser with DuckDB and nothing is uploaded.
- DuckDB in Your Browser: Use DuckDB in your browser with no setup. Drop in CSV, Excel, JSON or Parquet files and run analytical SQL on your own computer.
How to use the SQL on Your Files: step by step
- Open SQL on Your Files and add a CSV.
- Write a SELECT query.
- Click Run and check the result.
- Add a second file and try a JOIN.
When to use the SQL on Your Files
- Practise SELECT, JOIN and GROUP BY
- Query a CSV without importing it
- Join two files
- Check a result before a report
Example
Input: sales.csv + customers.xlsx
Output: SQL query result
Frequently asked questions
Can I run SQL on a CSV file?
Yes. Add the file, write a query such as SELECT * FROM sales WHERE amount > 100 and click Run. It runs in your browser with DuckDB.
Is this an alternative to DBeaver or TablePlus?
For querying files, yes. You do not need to install anything or create a database. For connecting to a live database server, use a database client.
Which SQL does it use?
DuckDB SQL, which is close to PostgreSQL. Joins, aggregates, window functions, CTEs and date functions all work.
Does it work offline?
Not the first time, because the SQL engine is downloaded when you first run a query.
Tip: Make a customers file and an orders file with the Mock Data Generator, then practise joining them.