MySQL Online Compiler

About the MySQL compiler

The world's most popular open-source database. Run MySQL code in your browser with no install and no signup — the editor, the input and the output share one screen. MySQL compiles and runs on your own device through WebAssembly, so once the page has loaded it keeps working without a network connection.

Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.

A MySQL example

This is the program the MySQL editor opens with — run it as it is, then change it.

-- MySQL: Create table, insert data, and query
CREATE TABLE products (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    price DECIMAL(10,2),
    category VARCHAR(50)
);
INSERT INTO products (name, price, category) VALUES
    ('Laptop', 999.99, 'Electronics'),
    ('Headphones', 79.99, 'Electronics'),
    ('Book', 14.99, 'Education'),
    ('Desk', 249.99, 'Furniture'),
    ('Mouse', 29.99, 'Electronics');
SELECT category, COUNT(*) as items, AVG(price) as avg_price
FROM products
GROUP BY category
ORDER BY avg_price DESC;

More Databases compilers

Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.