text: -- MySQL dump 10.13  Distrib 5.7.12, for Win64 (x86_64)
  --
  -- Host: localhost    Database: db_esms
  -- ------------------------------------------------------
  -- Server version	5.7.17-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 `department`
  --
  
  DROP TABLE IF EXISTS `department`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `department` (
    `did` int(11) NOT NULL AUTO_INCREMENT,
    `dname` varchar(45) NOT NULL,
    PRIMARY KEY (`did`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `department`
  --
  
  LOCK TABLES `department` WRITE;
  /*!40000 ALTER TABLE `department` DISABLE KEYS */;
  /*!40000 ALTER TABLE `department` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `goods`
  --
  
  DROP TABLE IF EXISTS `goods`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `goods` (
    `gid` int(11) NOT NULL AUTO_INCREMENT,
    `gname` varchar(45) NOT NULL,
    `gnum` varchar(45) NOT NULL,
    `gprice` double NOT NULL,
    `gquantity` int(11) NOT NULL,
    `gspec` varchar(45) DEFAULT NULL,
    `gnote` varchar(45) DEFAULT NULL,
    `gplace` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`gid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `goods`
  --
  
  LOCK TABLES `goods` WRITE;
  /*!40000 ALTER TABLE `goods` DISABLE KEYS */;
  /*!40000 ALTER TABLE `goods` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `input_record`
  --
  
  DROP TABLE IF EXISTS `input_record`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `input_record` (
    `irid` int(11) NOT NULL AUTO_INCREMENT,
    `indate` date NOT NULL,
    `gid` int(11) NOT NULL,
    `sid` int(11) NOT NULL,
    `hid` int(11) NOT NULL,
    `rid` int(11) NOT NULL,
    PRIMARY KEY (`irid`),
    KEY `gid_idx` (`gid`),
    KEY `sid_idx` (`sid`),
    KEY `hid_idx` (`hid`),
    KEY `rid_idx` (`rid`),
    CONSTRAINT `gid` FOREIGN KEY (`gid`) REFERENCES `goods` (`gid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `hid` FOREIGN KEY (`hid`) REFERENCES `storehouse` (`hid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `rid` FOREIGN KEY (`rid`) REFERENCES `rack` (`rid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    CONSTRAINT `sid` FOREIGN KEY (`sid`) REFERENCES `staff` (`sid`) 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 `input_record`
  --
  
  LOCK TABLES `input_record` WRITE;
  /*!40000 ALTER TABLE `input_record` DISABLE KEYS */;
  /*!40000 ALTER TABLE `input_record` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `rack`
  --
  
  DROP TABLE IF EXISTS `rack`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `rack` (
    `rid` int(11) NOT NULL,
    `rnum` varchar(45) NOT NULL,
    `rposition` varchar(45) DEFAULT NULL,
    `rtype` varchar(45) DEFAULT NULL,
    `rnote` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`rid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `rack`
  --
  
  LOCK TABLES `rack` WRITE;
  /*!40000 ALTER TABLE `rack` DISABLE KEYS */;
  /*!40000 ALTER TABLE `rack` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `staff`
  --
  
  DROP TABLE IF EXISTS `staff`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `staff` (
    `sid` int(11) NOT NULL AUTO_INCREMENT,
    `snum` varchar(45) NOT NULL,
    `sname` varchar(20) NOT NULL,
    `spassword` varchar(45) NOT NULL,
    `did` int(11) NOT NULL,
    PRIMARY KEY (`sid`),
    KEY `did_idx` (`did`),
    CONSTRAINT `did` FOREIGN KEY (`did`) REFERENCES `department` (`did`) 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 `staff`
  --
  
  LOCK TABLES `staff` WRITE;
  /*!40000 ALTER TABLE `staff` DISABLE KEYS */;
  /*!40000 ALTER TABLE `staff` ENABLE KEYS */;
  UNLOCK TABLES;
  
  --
  -- Table structure for table `storehouse`
  --
  
  DROP TABLE IF EXISTS `storehouse`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `storehouse` (
    `hid` int(11) NOT NULL,
    `hnum` varchar(45) NOT NULL,
    `hcapa` double DEFAULT NULL,
    `hplace` varchar(45) DEFAULT NULL,
    PRIMARY KEY (`hid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `storehouse`
  --
  
  LOCK TABLES `storehouse` WRITE;
  /*!40000 ALTER TABLE `storehouse` DISABLE KEYS */;
  /*!40000 ALTER TABLE `storehouse` 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-07-16 15:31:14
  