Online SQL compiler

Run SQL online free, no sign-up: create tables, insert rows and run MySQL-style SELECT, JOIN, GROUP BY and window-function queries, with results as tables.

How do I run SQL code online?

This is an online SQL compiler for MySQL-style queries: create your tables and rows in the Tables box, write your queries in the editor and press Run. Every SELECT prints its result as a table, and an error says which statement failed and why — free, with no sign-up, nothing stored.

How it works

  1. Create your tables. Put the CREATE TABLE and INSERT statements in the Tables box. They run first, on a fresh database every time, so nothing from an earlier run is left over.
  2. Write your queries. In the editor, one or more statements each ending with a semicolon — SELECT with JOIN, GROUP BY, subqueries and window functions, or an UPDATE followed by the SELECT that shows it.
  3. Run it. Press Run or Ctrl+Enter. Each result comes back as a table with its column names; an error names the statement that failed. The first run without an account asks a quick check that you are a person.

Who it is for

Anyone writing SQL who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying SQL before setting it up.

Frequently asked questions

Is it real MySQL?
You write MySQL, and it runs on SQLite with a MySQL compatibility layer — the engine CodeKairo's SQL problems are judged on. IF, IFNULL, DATE_ADD, DATEDIFF, DATE_FORMAT, GROUP_CONCAT, CONCAT, AUTO_INCREMENT and window functions all work. The gaps: text comparison is case-sensitive, ON DUPLICATE KEY UPDATE is not supported, and foreign keys are not enforced.
Why does my table not exist on the next run?
Every run starts from an empty database and builds it from the Tables box, so nothing a script creates or inserts is kept. Put the CREATE TABLE and INSERT statements you want every time in the Tables box, and the queries you are trying in the editor.
Can I use SHOW TABLES or DESCRIBE?
No: those are MySQL client commands, not queries, and the run says so. The Tables box already shows every table's columns; query them directly.
Is this online compiler free, and do I need an account?
It is free and needs no account. Without one, a network gets up to 60 runs an hour, and the first run asks a quick check that you are a person. A free account removes the check and gives you an allowance of your own, which matters in a college lab where everyone shares one connection.
Can my program ask for input while it runs?
No. The program runs once on the server, start to finish, so everything it reads from standard input must be in the Input box before you press Run — one line there is one line the program can read. A program that waits for input the box does not have either fails at the end of input or runs until it is stopped.
Is my code saved or shared?
Your code is kept in this browser as you type, per language, so it is still there when you come back. When you press Run it is sent to be compiled and run — SQL on CodeKairo's own server, the other languages on a code-execution service — and only the output comes back. CodeKairo does not store it or show it to anyone.
What are the limits?
A program can be up to 64 KB and its input up to 16 KB. A run that takes too long is stopped and reported as Time limit exceeded — usually an endless loop, or a program waiting for input that is not in the box. There is no file system to keep files in and no way to install packages: each language has its standard library.