text: -- MySQL dump 10.13  Distrib 5.7.12, for Win64 (x86_64)
  --
  -- Host: localhost    Database: library
  -- ------------------------------------------------------
  -- Server version	5.7.14-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 `books`
  --
  
  DROP TABLE IF EXISTS `books`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `books` (
    `book_id` int(10) NOT NULL AUTO_INCREMENT,
    `title` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `author` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `year` int(4) NOT NULL,
    `cover` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `pages` int(4) NOT NULL,
    `ISBN` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `status` tinyint(1) NOT NULL,
    `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `event` int(10) DEFAULT NULL,
    PRIMARY KEY (`book_id`),
    KEY `FK_books` (`event`),
    CONSTRAINT `FK_books` FOREIGN KEY (`event`) REFERENCES `events` (`event_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `books`
  --
  
  LOCK TABLES `books` WRITE;
  /*!40000 ALTER TABLE `books` DISABLE KEYS */;
  INSERT INTO `books` VALUES
  (22,'СИ++ И КОМПЬЮТЕРНАЯ ГРАФИКА','Андрей Богуславский','Лекции и практикум по программированию на Си++',2003,'',351,'',0,'2014-08-27 14:25:46',NULL),
  (23,'Программирование на языке Go','Марк Саммерфильд','Разработка приложений XXI века',2013,'',580,'',0,'2015-08-27 14:25:46',5),
  (24,'Flash CS5','Cтив Джонсон','Руководство разработчика',2012,'',560,'',0,'2016-08-27 14:25:46',NULL),
  (25,'Толковый словарь сетевых терминов и аббревиатур','','Официальное издание CISCO Systems',2001,'',366,'',0,'2016-08-27 14:25:48',NULL);
  /*!40000 ALTER TABLE `books` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `comments`
  --
  
  DROP TABLE IF EXISTS `comments`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `comments` (
    `book_id` int(10) NOT NULL,
    `reader_id` int(10) NOT NULL,
    `comment` text COLLATE utf8mb4_unicode_ci NOT NULL,
    KEY `book_id` (`book_id`),
    KEY `reader_id` (`reader_id`),
    CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`book_id`) REFERENCES `books` (`book_id`),
    CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`reader_id`) REFERENCES `readers` (`reader_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `comments`
  --
  
  LOCK TABLES `comments` WRITE;
  /*!40000 ALTER TABLE `comments` DISABLE KEYS */;
  /*!40000 ALTER TABLE `comments` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `events`
  --
  
  DROP TABLE IF EXISTS `events`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `events` (
    `event_id` int(10) NOT NULL AUTO_INCREMENT,
    `book_id` int(10) NOT NULL,
    `reader_id` int(10) NOT NULL,
    `date` date NOT NULL,
    `term` int(2) NOT NULL,
    `pawn` int(10) NOT NULL,
    PRIMARY KEY (`event_id`),
    KEY `book_id` (`book_id`),
    KEY `reader_id` (`reader_id`),
    CONSTRAINT `events_ibfk_1` FOREIGN KEY (`book_id`) REFERENCES `books` (`book_id`),
    CONSTRAINT `events_ibfk_2` FOREIGN KEY (`reader_id`) REFERENCES `readers` (`reader_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `events`
  --
  
  LOCK TABLES `events` WRITE;
  /*!40000 ALTER TABLE `events` DISABLE KEYS */;
  INSERT INTO `events` VALUES (5,23,4,'2016-08-25',2,127);
  /*!40000 ALTER TABLE `events` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `queue`
  --
  
  DROP TABLE IF EXISTS `queue`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `queue` (
    `book_id` int(10) NOT NULL,
    `email` text COLLATE utf8mb4_unicode_ci NOT NULL,
    KEY `FK_queue` (`book_id`),
    CONSTRAINT `FK_queue` FOREIGN KEY (`book_id`) REFERENCES `books` (`book_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `queue`
  --
  
  LOCK TABLES `queue` WRITE;
  /*!40000 ALTER TABLE `queue` DISABLE KEYS */;
  /*!40000 ALTER TABLE `queue` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `readers`
  --
  
  DROP TABLE IF EXISTS `readers`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `readers` (
    `reader_id` int(10) NOT NULL AUTO_INCREMENT,
    `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `email` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `phone` int(10) NOT NULL,
    PRIMARY KEY (`reader_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `readers`
  --
  
  LOCK TABLES `readers` WRITE;
  /*!40000 ALTER TABLE `readers` DISABLE KEYS */;
  INSERT INTO `readers` VALUES (4,'Dmitriy Malyarenko','dmitriy.malyarenko@gmail.com',993554752);
  /*!40000 ALTER TABLE `readers` 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 2016-08-27 18:56:47
  