SQL Playground: Practise SQLite Queries With Ready-Made Tables

What is it?

The SQL Playground is a real SQLite database running in your browser, with ready-made customers and orders tables. Try SELECT, JOIN, GROUP BY, INSERT, subqueries, CTEs and window functions and see the results as tables. You can also open your own .sqlite or .db file, change it, and download it again.

Who is it for?

Students in SQL and DBMS courses, job seekers practising interview questions, analysts testing a query, and developers who want to look inside an app’s SQLite file.

How to use it

  1. Tap an example such as Top customers, Best products or Add a row, or type your own SQL in SQL (SQLite). Separate several statements with ;.
  2. Press ▶ Run or Ctrl + Enter. The first run shows “Loading SQLite (about 1 MB, only the first time)…”. Each result appears as a table, and the status line shows the time, the rows and how many rows changed.
  3. To use your own data, tap Open a .sqlite or .db file.
  4. Download database saves your changes as database.sqlite; Reset sample data brings the sample tables back.

Worked example

SELECT city, COUNT(*) AS customers
FROM customers
GROUP BY city
ORDER BY customers DESC;

This counts customers per city. Changes stay only while the page is open, so download the database to keep them. Files you open stay on your device.

Errors and how to fix them

  • SQLite error: …: the message names the problem, for example “no such table” (check the spelling; the Tables list shows what exists) or “near "SELEC": syntax error”.
  • This file is not a SQLite database (…): the file is a different format, such as a CSV or a .sql text dump; open a real .sqlite or .db file.
  • “Run a query first”: shown when you press Download database before anything is loaded.
  • “The database is empty: CREATE TABLE to start”: your opened file or reset has no tables yet.
  • “Showing the first 1,000 of … rows”: add LIMIT or WHERE to see the rows you need.

Open the tool: SQL Playground

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.