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
DROP TABLE IF EXISTS clients; CREATE TABLE clients ( id number(10), name varchar2(1000), place_of_birth varchar2(1000), date_of_birth date, address varchar2(1000), passport varchar2(100), CONSTRAINT clients_pk primary key (id) ); DROP TABLE IF EXISTS products; CREATE TABLE products ( id number(10), product_type_id number(10), name varchar2(100), client_ref number(10), open_date date, close_date date, CONSTRAINT products_pk primary key (id) ); DROP TABLE IF EXISTS product_type; CREATE TABLE product_type ( id number(10), name varchar2(100) begin_date date, end_date date, tarif_ref number(10), CONSTRAINT product_type_pk primary key (id) ); DROP TABLE IF EXISTS accounts; CREATE TABLE accounts ( id number(10), name varchar2(100), saldo number(10,2), client_ref number(10), open_date date, close_date date, product_ref number(10), acc_num varchar2(25), CONSTRAINT accounts_pk primary key (id) ); DROP TABLE IF EXISTS records; CREATE TABLE records ( id number(10), dt number(1), sum number(10,2), acc_ref number(10), oper_date date, CONSTRAINT records_pk primary key (id) ); DROP TABLE IF EXISTS tarifs; CREATE TABLE tarifs ( id number(10), name varchar2(100), cost number (10,2), CONSTRAINT tarifs_pk primary key (id) ); ALTER TABLE products ADD CONSTRAINT prod_cl_fk FOREIGN KEY (client_ref) REFERENCES clients(id), ADD CONSTRAINT prod_prodtype_fk FOREIGN KEY (product_type_id) REFERENCES product_type(id); ALTER TABLE product_type ADD CONSTRAINT product_type_fk FOREIGN KEY (tarif_ref) REFERENCES tarifs(id); ALTER TABLE records CONSTRAINT rec_acc_fk FOREIGN KEY (acc_ref) REFERENCES accounts(id); ALTER TABLE accounts ADD CONSTRAINT acc_cl_fk FOREIGN KEY (client_ref) REFERENCES clients(id), ADD CONSTRAINT acc_prod_fk FOREIGN KEY (product_ref) REFERENCES products(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