text: /*
  SQLyog Ultimate v12.5.1 (64 bit)
  MySQL - 10.4.11-MariaDB : Database - survey
  *********************************************************************
  */
  
  /*!40101 SET NAMES utf8 */;
  
  /*!40101 SET SQL_MODE=''*/;
  
  /*!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 */;
  CREATE DATABASE /*!32312 IF NOT EXISTS*/`survey` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
  
  USE `survey`;
  
  /*Table structure for table `users` */
  
  DROP TABLE IF EXISTS `users`;
  
  CREATE TABLE `users` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;
  
  /*Table structure for table `quest` */
  
  DROP TABLE IF EXISTS `quest`;
  
  CREATE TABLE `quest` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `content` varchar(255) NOT NULL,
    `footnote` varchar(255) NOT NULL,
    `name` varchar(255) DEFAULT NULL,
    `user_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_Quest_userid` (`user_id`),
    CONSTRAINT `FK_Quest_userid` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4;
  
  /*Table structure for table `answer` */
  
  DROP TABLE IF EXISTS `answer`;
  
  CREATE TABLE `answer` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `content` varchar(255) NOT NULL,
    `footnote` varchar(255) NOT NULL,
    `answer` varchar(255) NOT NULL,
    `name` varchar(255) NOT NULL,
    `user_id` int(11) DEFAULT NULL,
    `quest_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `FK_Answer_questid` (`quest_id`),
    KEY `FK_Answer_userod` (`user_id`),
    CONSTRAINT `FK_Answer_questid` FOREIGN KEY (`quest_id`) REFERENCES `quest` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `FK_Answer_userod` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4;
  
  /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  