-- MySQL dump 10.13  Distrib 8.0.36, for Win64 (x86_64)
--
-- Host: git.pgk.alspio.com    Database: ISP41_Neshina_dem2
-- ------------------------------------------------------
-- Server version	5.7.44

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `Materials`
--

DROP TABLE IF EXISTS `Materials`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `Materials` (
  `idMaterials` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Type` int(11) DEFAULT NULL,
  `Price` decimal(10,2) DEFAULT NULL,
  `Quantity` int(11) DEFAULT NULL,
  `MinQuantity` int(11) DEFAULT NULL,
  `QuantityPack` int(11) DEFAULT NULL,
  `Unit` int(11) DEFAULT NULL,
  PRIMARY KEY (`idMaterials`),
  KEY `fk_type_idx` (`Type`),
  KEY `fk_unit_idx` (`Unit`),
  CONSTRAINT `fk_type` FOREIGN KEY (`Type`) REFERENCES `TypeMaterial` (`idTypeMaterial`) ON DELETE NO ACTION ON UPDATE CASCADE,
  CONSTRAINT `fk_unit` FOREIGN KEY (`Unit`) REFERENCES `Unit` (`idUnit`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Materials`
--

LOCK TABLES `Materials` WRITE;
/*!40000 ALTER TABLE `Materials` DISABLE KEYS */;
INSERT INTO `Materials` VALUES (1,'Глина',1,15.29,1570,5500,30,1),(2,'Каолин',1,18.20,1030,3500,25,1),(3,'Гидрослюда',3,9999.00,2147,3500,25,1),(4,'Монтмориллонит',1,17.67,3000,3000,30,1),(5,'Перлит',2,13.99,150,1000,50,2),(6,'Стекло',2,2.40,3000,1500,500,1),(7,'Дегидратированная глина',2,21.95,3000,2500,20,1),(9,'Техническая сода',3,54.55,1200,1500,25,1),(10,'Жидкое стекло',3,76.59,500,1500,15,1),(11,'Кварц',4,18.20,1500,2500,10,1),(12,'Полевой шпат',4,15.99,750,1500,100,1),(13,'Краска-раствор',5,200.90,1496,2500,5,2),(16,'Жильный кварц',3,18.60,2556,1600,25,1),(17,'Барий углекислый',4,303.64,340,1500,25,1),(18,'Бура техническая',4,125.99,165,1300,25,1),(19,'Углещелочной реагент',3,3.45,450,1100,25,1),(20,'Пирофосфат натрия',3,700.99,356,1200,25,1);
/*!40000 ALTER TABLE `Materials` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `NameSupplier`
--

DROP TABLE IF EXISTS `NameSupplier`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `NameSupplier` (
  `idNameSupplier` int(11) NOT NULL AUTO_INCREMENT,
  `Material` int(11) DEFAULT NULL,
  `Supplier` int(11) DEFAULT NULL,
  PRIMARY KEY (`idNameSupplier`),
  KEY `fk_material_idx` (`Material`),
  KEY `fk_pol_idx` (`Supplier`),
  CONSTRAINT `fk_material` FOREIGN KEY (`Material`) REFERENCES `Materials` (`idMaterials`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_pol` FOREIGN KEY (`Supplier`) REFERENCES `Supplier` (`idSupplier`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `NameSupplier`
--

LOCK TABLES `NameSupplier` WRITE;
/*!40000 ALTER TABLE `NameSupplier` DISABLE KEYS */;
INSERT INTO `NameSupplier` VALUES (1,13,19),(2,2,3),(3,2,9),(4,6,19),(6,5,6),(7,1,4),(9,7,9),(10,12,4),(11,1,1),(13,16,17),(14,12,1),(15,3,9),(16,6,20),(17,12,12),(18,4,9),(19,11,11),(20,17,17),(21,10,12),(23,1,6),(24,11,15),(25,3,3),(26,5,9),(28,17,20),(29,18,20),(30,9,18),(31,20,20),(32,3,4),(33,16,15),(34,5,10),(36,4,4),(37,13,12),(38,6,7),(40,2,1),(41,10,18),(42,18,7),(43,7,11),(44,18,13),(45,4,3),(46,10,16),(47,10,7),(50,19,16),(51,11,14),(52,16,13),(53,13,16),(54,11,13),(55,7,2),(57,17,7),(59,7,7),(60,3,5),(61,20,7),(62,5,5),(63,9,7),(64,1,10),(65,9,16),(66,4,10),(67,19,12),(68,9,8),(69,18,2),(70,20,5),(71,16,10),(72,6,2),(73,19,8),(74,17,5),(75,20,8),(76,2,5),(78,19,5),(79,13,8),(80,12,10);
/*!40000 ALTER TABLE `NameSupplier` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Supplier`
--

DROP TABLE IF EXISTS `Supplier`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `Supplier` (
  `idSupplier` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Type` int(11) DEFAULT NULL,
  `INN` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Rating` int(11) DEFAULT NULL,
  `Date` date DEFAULT NULL,
  PRIMARY KEY (`idSupplier`),
  KEY `fk_types_idx` (`Type`),
  CONSTRAINT `fk_types` FOREIGN KEY (`Type`) REFERENCES `TypeSupplier` (`idTypeSupplier`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Supplier`
--

LOCK TABLES `Supplier` WRITE;
/*!40000 ALTER TABLE `Supplier` DISABLE KEYS */;
INSERT INTO `Supplier` VALUES (1,'БрянскСтройресурс',1,'9432455179',8,'2015-12-20'),(2,'Стройкомплект',1,'7803888520',7,'2017-09-13'),(3,'Железногорская руда',2,'8430391035',7,'2016-12-23'),(4,'Белая гора',2,'4318170454',8,'2019-05-27'),(5,'Тульский обрабатывающий завод',2,'7687851800',7,'2015-06-16'),(6,'ГорТехРазработка',3,'6119144874',9,'2021-12-27'),(7,'Сапфир',4,'1122170258',3,'2022-04-10'),(8,'ХимБытСервис',3,'8355114917',5,'2022-03-13'),(9,'ВоронежРудоКомбинат',4,'3532367439',8,'2023-11-11'),(10,'Смоленский добывающий комбинат',4,'2362431140',3,'2018-11-23'),(11,'МосКарьер',3,'4159215346',2,'2012-07-07'),(12,'КурскРесурс',1,'9032455179',4,'2021-07-23'),(13,'Нижегородская разработка',4,'3776671267',9,'2016-05-23'),(14,'Речная долина',4,'7447864518',8,'2015-06-25'),(15,'Карелия добыча',3,'9037040523',6,'2017-03-09'),(16,'Московский ХимЗавод',3,'6221520857',4,'2015-05-07'),(17,'Горная компания',1,'2262431140',3,'2020-12-22'),(18,'Минерал Ресурс',2,'4155215346',7,'2015-05-22'),(19,'Арсенал',1,'3961234561',5,'2010-11-25'),(20,'КамчаткаСтройМинералы',1,'9600275878',7,'2016-12-20');
/*!40000 ALTER TABLE `Supplier` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `TypeMaterial`
--

DROP TABLE IF EXISTS `TypeMaterial`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `TypeMaterial` (
  `idTypeMaterial` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idTypeMaterial`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `TypeMaterial`
--

LOCK TABLES `TypeMaterial` WRITE;
/*!40000 ALTER TABLE `TypeMaterial` DISABLE KEYS */;
INSERT INTO `TypeMaterial` VALUES (1,'Пластичные материалы'),(2,'Добавка'),(3,'Электролит'),(4,'Глазурь'),(5,'Пигмент');
/*!40000 ALTER TABLE `TypeMaterial` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `TypeProduction`
--

DROP TABLE IF EXISTS `TypeProduction`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `TypeProduction` (
  `idTypeProduction` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `Coefficient` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`idTypeProduction`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `TypeProduction`
--

LOCK TABLES `TypeProduction` WRITE;
/*!40000 ALTER TABLE `TypeProduction` DISABLE KEYS */;
INSERT INTO `TypeProduction` VALUES (1,'Тип продукции 1',1.20),(2,'Тип продукции 2',90.00),(3,'Тип продукции 3',3.45);
/*!40000 ALTER TABLE `TypeProduction` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `TypeSupplier`
--

DROP TABLE IF EXISTS `TypeSupplier`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `TypeSupplier` (
  `idTypeSupplier` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idTypeSupplier`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `TypeSupplier`
--

LOCK TABLES `TypeSupplier` WRITE;
/*!40000 ALTER TABLE `TypeSupplier` DISABLE KEYS */;
INSERT INTO `TypeSupplier` VALUES (1,'ЗАО'),(2,'ООО'),(3,'ПАО'),(4,'ОАО');
/*!40000 ALTER TABLE `TypeSupplier` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `TypeWithProcent`
--

DROP TABLE IF EXISTS `TypeWithProcent`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `TypeWithProcent` (
  `idTypeWithProcent` int(11) NOT NULL AUTO_INCREMENT,
  `Name` int(11) DEFAULT NULL,
  `Procent` decimal(10,4) DEFAULT NULL,
  PRIMARY KEY (`idTypeWithProcent`),
  KEY `fk_oioi_idx` (`Name`),
  CONSTRAINT `fk_oioi` FOREIGN KEY (`Name`) REFERENCES `TypeMaterial` (`idTypeMaterial`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `TypeWithProcent`
--

LOCK TABLES `TypeWithProcent` WRITE;
/*!40000 ALTER TABLE `TypeWithProcent` DISABLE KEYS */;
INSERT INTO `TypeWithProcent` VALUES (1,1,0.0012),(2,2,0.0020),(3,3,0.0015),(4,4,0.0030),(5,5,0.0025);
/*!40000 ALTER TABLE `TypeWithProcent` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `Unit`
--

DROP TABLE IF EXISTS `Unit`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `Unit` (
  `idUnit` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idUnit`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `Unit`
--

LOCK TABLES `Unit` WRITE;
/*!40000 ALTER TABLE `Unit` DISABLE KEYS */;
INSERT INTO `Unit` VALUES (1,'кг'),(2,'л');
/*!40000 ALTER TABLE `Unit` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-11-19 15:59:52
