text: CREATE DATABASE  IF NOT EXISTS `school` /*!40100 DEFAULT CHARACTER SET utf8 */;
  USE `school`;
  -- MySQL dump 10.13  Distrib 5.7.17, for Win64 (x86_64)
  --
  -- Host: localhost    Database: school
  -- ------------------------------------------------------
  -- Server version	5.7.15-log
  
  /*!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 */;
  /*!40101 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 `addresses`
  --
  
  DROP TABLE IF EXISTS `addresses`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `addresses` (
    `id` int(11) NOT NULL,
    `country` varchar(45) NOT NULL,
    `city` varchar(45) NOT NULL,
    `street` varchar(45) NOT NULL,
    `number` varchar(45) NOT NULL,
    `floor` int(11) NOT NULL,
    `apartment_no` int(11) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `addresses`
  --
  
  LOCK TABLES `addresses` WRITE;
  /*!40000 ALTER TABLE `addresses` DISABLE KEYS */;
  /*!40000 ALTER TABLE `addresses` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `disciplines`
  --
  
  DROP TABLE IF EXISTS `disciplines`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `disciplines` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `disciplines`
  --
  
  LOCK TABLES `disciplines` WRITE;
  /*!40000 ALTER TABLE `disciplines` DISABLE KEYS */;
  INSERT INTO `disciplines` VALUES (1,'Mathematics'),(2,'Geography'),(3,'Physics'),(4,'Informatics');
  /*!40000 ALTER TABLE `disciplines` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `disciplines_studied`
  --
  
  DROP TABLE IF EXISTS `disciplines_studied`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `disciplines_studied` (
    `discipline_id` int(11) NOT NULL,
    `student_id` int(11) NOT NULL,
    KEY `fk_discipline_studied_idx` (`student_id`),
    KEY `fk_disciplines_study_idx` (`discipline_id`),
    CONSTRAINT `fk_disciplines` FOREIGN KEY (`discipline_id`) REFERENCES `disciplines` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `fk_student` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `disciplines_studied`
  --
  
  LOCK TABLES `disciplines_studied` WRITE;
  /*!40000 ALTER TABLE `disciplines_studied` DISABLE KEYS */;
  /*!40000 ALTER TABLE `disciplines_studied` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `disciplines_taught`
  --
  
  DROP TABLE IF EXISTS `disciplines_taught`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `disciplines_taught` (
    `id_teachers` int(11) NOT NULL,
    `id_discipline` int(11) NOT NULL,
    KEY `key_discipl_idx` (`id_discipline`),
    KEY `id_teachers_idx` (`id_teachers`),
    CONSTRAINT `id_disciplines` FOREIGN KEY (`id_discipline`) REFERENCES `disciplines` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `id_teachers` FOREIGN KEY (`id_teachers`) REFERENCES `teachers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `disciplines_taught`
  --
  
  LOCK TABLES `disciplines_taught` WRITE;
  /*!40000 ALTER TABLE `disciplines_taught` DISABLE KEYS */;
  INSERT INTO `disciplines_taught` VALUES (2,2);
  /*!40000 ALTER TABLE `disciplines_taught` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `students`
  --
  
  DROP TABLE IF EXISTS `students`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `students` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `enrollment_date` varchar(45) NOT NULL,
    `address_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `students_fk_idx` (`address_id`),
    CONSTRAINT `address_id` FOREIGN KEY (`address_id`) REFERENCES `addresses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `students`
  --
  
  LOCK TABLES `students` WRITE;
  /*!40000 ALTER TABLE `students` DISABLE KEYS */;
  INSERT INTO `students` VALUES (1,'Georgi Georgiev','22-10-2000',NULL),(2,'Stoyan Ivanov','18-11-2010',NULL),(3,'Mariya Grozdanova','27-05-2008',NULL),(4,'Stefaniya Petkova','12-01-2007',NULL);
  /*!40000 ALTER TABLE `students` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `teachers`
  --
  
  DROP TABLE IF EXISTS `teachers`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `teachers` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `email` varchar(45) DEFAULT NULL,
    `salary` decimal(10,0) NOT NULL,
    `address_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_addreses_idx` (`address_id`),
    CONSTRAINT `address_ids` FOREIGN KEY (`address_id`) REFERENCES `addresses` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `teachers`
  --
  
  LOCK TABLES `teachers` WRITE;
  /*!40000 ALTER TABLE `teachers` DISABLE KEYS */;
  INSERT INTO `teachers` VALUES (1,'Peter Ivanov','pivanov@gmail.com',1922,NULL),(2,'Georgi Stoimenov','stoimenov@gmail.com',1787,NULL),(3,'Nataliya Yordanova','nyyoo@abv.bg',1888,NULL),(4,'Simeon Prodanov','sprod@yahoo.com',1342,NULL);
  /*!40000 ALTER TABLE `teachers` 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 2017-05-31 13:52:15
  