Initial commit

This commit is contained in:
user
2026-07-12 13:56:05 +04:00
commit 04bf3a4b58
850 changed files with 9057 additions and 0 deletions
@@ -0,0 +1,12 @@
USE [Database]
-- Ñòàíäàðòíûå àòðèáóòû òîâàðîâ, êîòîðûå áóäóò èñïîëüçîâàòüñÿ
-- â òåñòèðîâàíèè íà îñíîâå èññëåäîâàíèé ïðåäìåòíîé îáëàñòè
SET IDENTITY_INSERT [Tables].[attributes] ON;
INSERT INTO [Tables].[attributes]([id], [name])
VALUES
(1, 'Article number'),
(2, 'Barcode'),
(3, 'Date of manufacture'),
(4, 'Expiration date');
SET IDENTITY_INSERT [Tables].[attributes] OFF;
@@ -0,0 +1,65 @@
USE [Database]
DECLARE
@article_number_attribute_id AS INT,
@barcode_attribute_id AS INT,
@date_of_manufacture_attribute_id AS INT,
@expiration_date_attribute_id AS INT;
SET @article_number_attribute_id =
(SELECT [id]
FROM [Tables].[attributes]
WHERE [name] = N'Article number');
SET @barcode_attribute_id =
(SELECT [id]
FROM [Tables].[attributes]
WHERE [name] = N'Barcode');
SET @date_of_manufacture_attribute_id =
(SELECT [id]
FROM [Tables].[attributes]
WHERE [name] = N'Date of manufacture');
SET @expiration_date_attribute_id =
(SELECT [id]
FROM [Tables].[attributes]
WHERE [name] = N'Expiration date');
DECLARE
@product_id_1 AS INT,
@product_id_2 AS INT,
@product_id_3 AS INT,
@product_id_4 AS INT;
EXECUTE [Procedures].[insert_product]
@name = N'Hobby World Êàðòî÷íàÿ èãðà Óæàñ Àðêõýìà',
@product_type_id = 9, -- Íàñòîëüíûå èãðû
@barcode_attribute_id = @barcode_attribute_id,
@inserted_product_id = @product_id_1 OUTPUT;
EXECUTE [Procedures].[insert_product]
@name = N'Æåâàòåëüíàÿ ðåçèíêà Orbit Mega Êëóáíèêà, áåç ñàõàðà, 16,4 ã',
@product_type_id = 23, -- Æåâàòåëüíàÿ ðåçèíêà
@barcode_attribute_id = @barcode_attribute_id,
@inserted_product_id = @product_id_2 OUTPUT;
EXECUTE [Procedures].[insert_product]
@name = N'Æåâàòåëüíàÿ ðåçèíêà Mentos Pure White âêóñ Êëóáíèêà, 15,5 ã',
@product_type_id = 23, -- Æåâàòåëüíàÿ ðåçèíêà
@barcode_attribute_id = @barcode_attribute_id,
@inserted_product_id = @product_id_3 OUTPUT;
EXECUTE [Procedures].[insert_product]
@name = N'Ïå÷åíüå Oreo, ñ êàêàî è íà÷èíêîé ñî âêóñîì êëóáíèêè, 228 ã',
@product_type_id = 22, -- Ïå÷åíüå
@barcode_attribute_id = @barcode_attribute_id,
@inserted_product_id = @product_id_4 OUTPUT;
INSERT INTO [Tables].[product_attributes]([product_id], [attribute_id])
VALUES
(@product_id_2, 3),
(@product_id_2, 4),
(@product_id_3, 3),
(@product_id_3, 4);
INSERT INTO [Tables].[product_values]([product_id], [attribute_id], [value])
VALUES
(2, 3, N'1900-01-01'), -- Äàòà èçãîòîâëåíèÿ
(2, 4, N'3650'), -- Ñðîê ãîäíîñòè
(3, 3, N'1900-01-01'),
(3, 4, N'30');