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 departament (id integer, name varchar(30), address varchar(30)); insert into departament values (1, 'IT', 'г. Минск, ул. Гоголя'); insert into departament values (2, 'HR', 'г. Москва, ул. Большая'); insert into departament values (3, 'СБ', 'г. Москва, ул. Большая'); insert into departament values (4, 'Аналитики', 'г. Москва, ул. Большая'); insert into departament values (5, 'Юристы', 'г. Казань, ул. Мира'); insert into departament values (6, 'Финансы', 'г. Москва, ул. Пушкина'); insert into departament values (7, 'Разработка', 'г. Новосибирск, ул. Ленина'); insert into departament values (8, 'Тестирование', 'г. Новосибирск, ул. Ленина'); insert into departament values (9, 'Управление проектами', 'г. Москва, ул. Тверская'); insert into departament values (10, 'Маркетинг', 'г. СБП, ул. Невский пр.'); insert into departament values (11, 'Продажи', 'г. Казань, ул. Сибгата Хакима'); insert into departament values (12, 'Поддержка', 'г. Москва, ул. Арбат'); create table employee (id integer, name varchar(30), salary integer, department_id integer); insert into employee values (1, 'Вася Петров', 110000, 1); insert into employee values (2, 'Олег Иванов', 120000, 1); insert into employee values (3, 'Варя Олегова', 60000, 2); insert into employee values (4, 'Ольга Смирнова', 55000, 2); insert into employee values (5, 'Лера Никитина', 49000, 2); insert into employee values (6, 'Альберт Ким', 105000, 1); insert into employee values (7, 'Дима Кушин', 130000, 4); insert into employee values (8, 'Саша Ляпина', 140000, 4); insert into employee values (9, 'Катя Лыгина', 150000, 4); insert into employee values (10, 'Инна Смеркова', 150000, 4); insert into employee values (11, 'Лена Лапочкина', 80000, 5); insert into employee values (12, 'Олег Пупков', 90000, 6); insert into employee values (13, 'Антон Жуков', 95000, 6); insert into employee values (14, 'Ирина Шевцова', 85000, 7); insert into employee values (15, 'Николай Безруков', 75000, 8); insert into employee values (16, 'Елена Никитина', 125000, 9); insert into employee values (17, 'Сергей Пак', 65000, 10); insert into employee values (18, 'Ольга Воронцова', 55000, 11); insert into employee values (19, 'Алексей Михеев', 95000, 12); insert into employee values (20, 'Марина Гусева', 85000, 7); select name, 'Высокая' from employee where salary > 100000 union all select name, 'Cредняя' from employee where salary between 60000 and 100000 union all select name, 'Низкая' from employee where salary < 60000

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

Copy Clear