Skip to content

Instantly share code, notes, and snippets.

@Kegnar
Created June 29, 2025 05:38
Show Gist options
  • Select an option

  • Save Kegnar/f823dcb533b611e6947dac29b9e9a998 to your computer and use it in GitHub Desktop.

Select an option

Save Kegnar/f823dcb533b611e6947dac29b9e9a998 to your computer and use it in GitHub Desktop.
INSERT INTO employees (name, salary, department) VALUES
(N'Иван Петров', 75000.00, 'IT'),
(N'Алексей Смирнов', 60000.00, N'Маркетинг'),
(N'Мария Иванова', 55000.00, 'HR'),
(N'Дмитрий Кузнецов', 80000.00, 'IT'),
(N'Анна Соколова', 48000.00, N'Финансы'),
(N'Сергей Васильев', 65000.00, 'IT'),
(N'Ольга Морозова', 52000.00, 'HR'),
(N'Александр Белов', 90000.00, N'Маркетинг'),
(N'Екатерина Козлова', 43000.00, N'Финансы'),
(N'Павел Новиков', 70000.00, 'IT');
--берем всех
select * from employees
--только имя и ЗП
select name, salary from TOP_BV425.dbo.employees
--все, у кого ЗП выше 50К
select * from employees
where salary >50000
--сортируем по убыванию ЗП
select * from employees
order by salary desc
--топ-3 по ЗП
select top (3) name,salary from TOP_BV425.dbo.employees
order by salary desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment