SQLize
Online
/
PHPize Online
/
SQLtest Online
A
A
A
Share
Donate
Blog
Popular
Donate
A
A
A
Share
Blog
Popular
SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code.
You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.
SQL code:
Upload
Copy
Format
Clear
CREATE TABLE customers( id INT (10) NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR (50) NOT NULL, city VARCHAR (50) NOT NULL ); CREATE TABLE orders( cus_id INT (10) NOT NULL, order_date DATETIME NOT NULL ); CREATE TABLE products( id INT (5) NOT NULL PRIMARY KEY, product_name VARCHAR(50) NOT NULL, product_price INT(10) NOT NULL ); CREATE TABLE ordered_items( id INT (10) NOT NULL PRIMARY KEY AUTO_INCREMENT, cus_id INT (10) NOT NULL, product_id INT(5) NOT NULL ); ALTER TABLE orders ADD CONSTRAINT customers_id_fr FOREIGN KEY ( cus_id ) REFERENCES customers ( id ); ALTER TABLE ordered_items ADD CONSTRAINT ordered_items_fr FOREIGN KEY ( cus_id ) REFERENCES customers ( id ); INSERT INTO customers (name, city) VALUES ("My Name", "New York"); INSERT INTO orders (cus_id, order_date) VALUES ("1", NOW()); INSERT INTO products (id, product_name, product_price) VALUES ("99", "My test product nr. 1", "20"); INSERT INTO products (id, product_name, product_price) VALUES ("98", "My test product nr. 2", "10"); INSERT INTO ordered_items (id, cus_id, product_id) VALUES ("1", "1", "99"); INSERT INTO ordered_items (id, cus_id, product_id) VALUES ("2", "1", "98"); SELECT name FROM customers INNER JOIN orders ON orders.cus_id = customers.id INNER JOIN ordered_items ON ordered_items.cus_id = orders.cus_id INNER JOIN products ON products.id = ordered_items.product_id; SELECT DISTINCT name FROM customers INNER JOIN orders ON orders.cus_id = customers.id INNER JOIN ordered_items ON ordered_items.cus_id = orders.cus_id INNER JOIN products ON products.id = ordered_items.product_id; SELECT name FROM customers WHERE EXISTS (SELECT 1 FROM ordered_items WHERE ordered_items.cus_id = customers.id )
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 11
PostgreSQL 12
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
MS SQL Server 2017
MS SQL Server 2019
MS SQL Server 2022
MS SQL Server 2022 AdventureWorks (ReadOnly)
Firebird 4.0
Firebird 4.0 (Employee)
Oracle Database 19c (HR)
Oracle Database 21c
Oracle Database 23c Free
SOQOL
Version
ER Diagram
Preserve result
Stuck with a problem?
Got Error?
Ask ChatGPT!
Result:
Copy
Clear