Practice SQL on a CSV File Without Installing a Database

Installing MySQL or Postgres can take an hour and often goes wrong. You can start practising SQL right now with a CSV file.

Open the SQL on Your Files

SQL on Your Files runs a real SQL engine inside your browser. You drop a CSV, Excel or Parquet file, it becomes a table, and you write queries against it. There is nothing to install and no account to create.

Start simple. After loading the file, run SELECT * FROM data LIMIT 10 to see the first rows. Then try SELECT city, COUNT(*) FROM data GROUP BY city to count rows by group, and WHERE to filter. Change one thing at a time and watch the result.

When you are comfortable, load a second file and practise JOIN. A customers file and an orders file are the classic example. You can also practise ORDER BY, HAVING and window functions.

You can download any query result as CSV, JSON, Parquet or Excel, which is handy for assignments. Because the file never leaves your device, you can use real data from your course without worrying about uploads.

This is for practice and small to medium files. Real jobs use a database server, so learn the basics here and then try a full database when you are ready.

Open the SQL on Your Files

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

  1. Open SQL on Your Files.
  2. Drop a CSV or Excel file or load the sample.
  3. Type a query and click Run query.
  4. Download the result if you need it.

When to use the SQL on Your Files

  • Learn SELECT, WHERE, GROUP BY and JOIN
  • Prepare for a SQL exam or interview
  • Answer a question about a CSV without Excel formulas
  • Test a query before running it on a database

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: No data yet? Make a practice file with the Data Generator, then query it.