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
-- Создание таблицы CLIENTS CREATE TABLE CLIENTS ( ID INT PRIMARY KEY, NAME VARCHAR(255) NOT NULL, PLACE_OF_BIRTH VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE NOT NULL, ADDRESS VARCHAR(255), PASSPORT VARCHAR(255) UNIQUE NOT NULL ); -- Создание таблицы TARIFS CREATE TABLE TARIFS ( ID INT PRIMARY KEY, NAME VARCHAR(255) NOT NULL, COST DECIMAL(10, 2) NOT NULL ); -- Создание таблицы PRODUCT_TYPE CREATE TABLE PRODUCT_TYPE ( ID INT PRIMARY KEY, NAME VARCHAR(255) NOT NULL, BEGIN_DATE DATE NOT NULL, END_DATE DATE, TARIF_REF INT, FOREIGN KEY (TARIF_REF) REFERENCES TARIFS(ID) ); -- Создание таблицы PRODUCTS CREATE TABLE PRODUCTS ( ID INT PRIMARY KEY, PRODUCT_TYPE_ID INT NOT NULL, NAME VARCHAR(255) NOT NULL, CLIENT_REF INT NOT NULL, OPEN_DATE DATE NOT NULL, CLOSE_DATE DATE, FOREIGN KEY (PRODUCT_TYPE_ID) REFERENCES PRODUCT_TYPE(ID), FOREIGN KEY (CLIENT_REF) REFERENCES CLIENTS(ID) ); -- Создание таблицы ACCOUNTS CREATE TABLE ACCOUNTS ( ID INT PRIMARY KEY, NAME VARCHAR(255) NOT NULL, SALDO DECIMAL(10, 2) DEFAULT 0.00, CLIENT_REF INT NOT NULL, OPEN_DATE DATE NOT NULL, CLOSE_DATE DATE, PRODUCT_REF INT, ACC_NUM VARCHAR(50) UNIQUE NOT NULL, FOREIGN KEY (CLIENT_REF) REFERENCES CLIENTS(ID), FOREIGN KEY (PRODUCT_REF) REFERENCES PRODUCTS(ID) ); -- Создание таблицы RECORDS CREATE TABLE RECORDS ( ID INT PRIMARY KEY, DT BOOLEAN NOT NULL, ACC_REF INT NOT NULL, OPER_DATE DATE NOT NULL, SUM DECIMAL(10, 2) NOT NULL, FOREIGN KEY (ACC_REF) REFERENCES ACCOUNTS(ID) ); -- Создание таблицы TARIFS CREATE TABLE TARIFS ( ID INT PRIMARY KEY, NAME VARCHAR(255) NOT NULL, COST DECIMAL(10, 2) NOT NULL );
SQL
Server:
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
MariaDB 11.5
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