Hi! Could we please enable some services and cookies to improve your experience and our website?
No, thanks.
Okay!
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
-- Создаем таблицу employees (сотрудники) CREATE TABLE employees ( employee_id SERIAL PRIMARY KEY, first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50) NOT NULL, department VARCHAR(50), salary NUMERIC(10, 2), hire_date DATE, manager_id INTEGER REFERENCES employees(employee_id) ); -- Создаем таблицу sales (продажи) CREATE TABLE sales ( sale_id SERIAL PRIMARY KEY, employee_id INTEGER REFERENCES employees(employee_id), sale_date DATE NOT NULL, amount NUMERIC(10, 2) NOT NULL, product_category VARCHAR(50) ); -- Добавляем данные в таблицу employees INSERT INTO employees (first_name, last_name, department, salary, hire_date, manager_id) VALUES ('Иван', 'Петров', 'Продажи', 75000.00, '2020-05-15', NULL), ('Мария', 'Сидорова', 'Продажи', 82000.00, '2019-11-20', 1), ('Алексей', 'Иванов', 'IT', 95000.00, '2018-03-10', NULL), ('Елена', 'Кузнецова', 'IT', 88000.00, '2021-01-25', 3), ('Дмитрий', 'Смирнов', 'Маркетинг', 68000.00, '2022-06-05', NULL); -- Добавляем данные в таблицу sales INSERT INTO sales (employee_id, sale_date, amount, product_category) VALUES (1, '2023-01-10', 15000.00, 'Электроника'), (1, '2023-01-15', 22000.00, 'Мебель'), (2, '2023-01-12', 18000.00, 'Электроника'), (2, '2023-01-18', 12000.00, 'Одежда'), (3, '2023-01-05', 5000.00, 'Программное обеспечение'), (4, '2023-01-20', 30000.00, 'Программное обеспечение'), (5, '2023-01-25', 8000.00, 'Канцтовары');
SQL
Server:
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
MySQL 9.3.0
MariaDB 11.4
MariaDB 11.8
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
PostgreSQL 16
PostgreSQL 17
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