Database

Mysql Playground

MySQL is a widely-used open-source relational database management system (RDBMS) known for its reliability and ease of use..

Get access to the Mysql playground with one click

Welcome to the MySQL Playground!

MySQL 8.4 LTS on Debian 12 — the world’s most popular open-source RDBMS. mysqld initialises automatically; connect within ~15 seconds.

What’s Pre-installed

  • MySQL 8.4 LTS server + client
  • Auto-provisioned database: codeground
  • Credentials: user codeground, password codeground

Quick Start

mysql -u codeground -pcodeground codeground
SHOW TABLES;
SELECT VERSION();

Common Workflows

-- Create table
CREATE TABLE orders (
  id INT AUTO_INCREMENT PRIMARY KEY,
  product VARCHAR(100),
  qty INT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Insert & Query
INSERT INTO orders (product, qty) VALUES ('Widget A', 5), ('Widget B', 12);
SELECT * FROM orders;
SELECT product, SUM(qty) FROM orders GROUP BY product;

-- Update & Delete
UPDATE orders SET qty = 10 WHERE product = 'Widget A';
DELETE FROM orders WHERE qty < 5;

Advanced Tips

-- JSON columns (MySQL 8)
CREATE TABLE events (id INT AUTO_INCREMENT PRIMARY KEY, data JSON);
INSERT INTO events (data) VALUES ('{"type":"click","user":42}');
SELECT data->>'$.type' AS event_type FROM events;

-- Full-text search
ALTER TABLE orders ADD FULLTEXT idx_product (product);
SELECT * FROM orders WHERE MATCH(product) AGAINST('Widget');

-- EXPLAIN a query
EXPLAIN SELECT * FROM orders WHERE qty > 5;

Session Notes

  • Session lasts 1 hour.
  • mysqld initialises on first start (~15 seconds). Wait for the ready message.