Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE statuses ( id int primary key auto_increment, title varchar(64) ); CREATE TABLE orders ( id int primary key auto_increment, created_at datetime default now(), status_id int references statuses(id) ); INSERT INTO statuses (title) VALUES ('New'), ('Cancelled'), ('Closed'); INSERT INTO orders (status_id) VALUES (1), (2), (3); SELECT * FROM orders o LEFT JOIN statuses s ON o.status_id = s.id;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear