This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*TODO: 1. Написать функцию GetNextLearningDay, которая определяет в какой день недели будет следующее занятие у группы; | |
| 2. Написать функцию GetNextLearningDate, которая определяет дату следующего занятия у группы; | |
| 3. При выставлении расписания нужно предусмотреть каникулы и праздничные дни; | |
| 4. Посчитать зарплату преподавателям;*/ | |
| USE PV_521_Import | |
| GO | |
| --1 | |
| CREATE OR ALTER FUNCTION GetNextLearningDay(@group AS INT) RETURNS DATE | |
| AS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Разница в правиле исчисления високосного года. В отличие от Юлианского, где каждый 4й год считается високосным, | |
| Григорианский считает високосным год, кратный 4, кроме кратных 100, но включая годы, кратные 400. | |
| В результате Григорианский календарь точнее Юлианского, в котором год отстает от тропического примерно на 11 минут каждый год. | |
| 2.Разницы в часах между UTC и GMT нет — они совпадают. Технически разница между GMT и UTC не превышает 0,9 секунды благодаря | |
| високосным секундам. В быту разницы нет, а например в навигации, где ктитически важна точность, используют UTC | |
| 3 15 в час. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| insert into Statuses(status) | |
| values (N'Новый'), | |
| (N'Ожидает оплаты'), | |
| (N'Оплачен'), | |
| (N'Сборка заказа'), | |
| (N'Доставка'), | |
| (N'Получен'), | |
| (N'Отменен') | |
| INSERT INTO Goods (name, description, price, stock_qty, add_date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create database Inet_shop | |
| use Inet_shop | |
| --Пользователи | |
| create table Users | |
| ( | |
| id INT IDENTITY, | |
| login NVARCHAR(50) not null, | |
| password nvarchar(100) not null, | |
| name nvarchar(100) not null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1, 'Ноутбук', 'Электроника', 75000.00, 2, '2024-01-15' | |
| 2, 'Смартфон', 'Электроника', 45000.00, 5, '2024-01-16' | |
| 3, 'Кофемашина', 'Бытовая техника', 32000.00, 1, '2024-01-17' | |
| 4, 'Наушники', 'Электроника', 8000.00, 10, '2024-01-18' | |
| 5, 'Микроволновка', 'Бытовая техника', 15000.00, 3, '2024-01-19' | |
| 6, 'Футболка', 'Одежда', 2000.00, 15, '2024-01-20' | |
| 7, 'Кроссовки', 'Одежда', 5000.00, 8, '2024-01-21' | |
| 8, 'Чайник', 'Бытовая техника', 4000.00, 7, '2024-01-22' | |
| 9, 'Монитор', 'Электроника', 25000.00, 4, '2024-01-23' | |
| 10, 'Джинсы', 'Одежда', 3500.00, 12, '2024-01-24' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE sales ( | |
| id INT PRIMARY KEY, | |
| product_name VARCHAR(50), | |
| category VARCHAR(30), | |
| price DECIMAL(10, 2), | |
| quantity INT, | |
| sale_date DATE | |
| ); | |
| INSERT INTO sales (id, product_name, category, price, quantity, sale_date) VALUES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Выведите поступления денег от пользователя с email 'vasya@mail.com'. | |
| select * from billing | |
| where payer_email = 'vasya@mail.com' | |
| --Добавьте в таблицу одну запись о платеже | |
| insert into billing (payer_email, recipient_email, sum, currency, billing_date, comment) | |
| values | |
| ('pasha@mail.com', 'katya@mail.com', 300.00, 'EUR', 20160214, 'Valentines day present)'); | |
| --Измените адрес плательщика на 'igor@mail.com' для всех записей таблицы, где адрес плательщика 'alex@mail.com'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'Финансы'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'Финансы'), |