--
-- Host: localhost    Database: telegram_tamasbabot
-- ------------------------------------------------------


--
-- Temporary table structure for view `activity_by_month`
--

/*!50001 DROP VIEW IF EXISTS `activity_by_month`*/;
/*!50001 CREATE VIEW `activity_by_month` AS SELECT 
 1 AS `MONTH(trdate)`,
 1 AS `COUNT(*)`*/;

--
-- Temporary table structure for view `activity_till_now`
--

/*!50001 DROP VIEW IF EXISTS `activity_till_now`*/;
/*!50001 CREATE VIEW `activity_till_now` AS SELECT 
 1 AS `userid`,
 1 AS `COUNT( userid )`*/;

--
-- Table structure for table `bayadic_dictionary_contribution_de_fa`
--

CREATE TABLE `bayadic_dictionary_contribution_de_fa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(10) DEFAULT NULL,
  `word` varchar(600) CHARACTER SET utf8 DEFAULT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT NULL,
  `plural` text CHARACTER SET utf8,
  `hasProposition` tinyint(1) NOT NULL DEFAULT '0',
  `reflexive` tinyint(1) DEFAULT NULL,
  `translation` varchar(750) CHARACTER SET utf8 DEFAULT NULL,
  `wordType` enum('noun','verb','adjective','adverb','proposition','conjunction','other') DEFAULT NULL,
  `minusRate` int(11) NOT NULL DEFAULT '0',
  `plusRate` int(11) NOT NULL DEFAULT '0',
  `related` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('open','trusted','approved','rejected','closed','needToEdit','wrong','requested','review') DEFAULT NULL,
  `wordID` varchar(50) NOT NULL,
  `userID` varchar(50) NOT NULL,
  `insertedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `word` (`word`),
  KEY `translation` (`translation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bayadic_dictionary_contribution_de_fa`
--


--
-- Table structure for table `bayadic_dictionary_de_fa`
--

CREATE TABLE `bayadic_dictionary_de_fa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(10) NOT NULL,
  `word` varchar(250) CHARACTER SET utf8 NOT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `plural` text CHARACTER SET utf8 NOT NULL,
  `hasProposition` tinyint(1) NOT NULL DEFAULT '0',
  `reflexive` tinyint(1) DEFAULT NULL,
  `translation` varchar(650) CHARACTER SET utf8 NOT NULL,
  `wordType` enum('noun','verb','adjective','adverb','proposition','conjunction','other') NOT NULL,
  `minusRate` int(11) NOT NULL DEFAULT '0',
  `plusRate` int(11) NOT NULL DEFAULT '0',
  `related` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('open','trusted','approved','rejected','closed','needToEdit','wrong','requested','review') NOT NULL,
  `wordID` varchar(50) NOT NULL,
  `userID` varchar(50) NOT NULL,
  `insertedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `word` (`word`),
  KEY `translation` (`translation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bayadic_dictionary_de_fa`
--


--
-- Table structure for table `bayadic_rated_words_de_fa`
--

CREATE TABLE `bayadic_rated_words_de_fa` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `wordID` varchar(50) NOT NULL,
  `userID` varchar(50) NOT NULL,
  `plusRate` tinyint(1) NOT NULL,
  `minusRate` tinyint(1) NOT NULL,
  `insertedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bayadic_rated_words_de_fa`
--


--
-- Table structure for table `bayadic_related_words_de_fa`
--

CREATE TABLE `bayadic_related_words_de_fa` (
  `id` int(11) NOT NULL DEFAULT '0',
  `word` varchar(700) NOT NULL,
  KEY `word` (`word`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bayadic_related_words_de_fa`
--


--
-- Table structure for table `bots`
--

CREATE TABLE `bots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` text NOT NULL,
  `token` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bots`
--


--
-- Table structure for table `currency_price`
--

CREATE TABLE `currency_price` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `primary_currency` varchar(10) DEFAULT NULL,
  `exchange_currency` varchar(10) DEFAULT NULL,
  `price` float DEFAULT NULL,
  `number_of_requests` int(11) NOT NULL DEFAULT '0',
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `currency_price`
--


--
-- Temporary table structure for view `currency_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_used_per_day`*/;
/*!50001 CREATE VIEW `currency_used_per_day` AS SELECT 
 1 AS `day`,
 1 AS `usedTimes`*/;

--
-- Temporary table structure for view `currency_users`
--

/*!50001 DROP VIEW IF EXISTS `currency_users`*/;
/*!50001 CREATE VIEW `currency_users` AS SELECT 
 1 AS `userid`,
 1 AS `number_of_used`*/;

--
-- Temporary table structure for view `currency_users_and_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_and_day`*/;
/*!50001 CREATE VIEW `currency_users_and_day` AS SELECT 
 1 AS `day`,
 1 AS `userid`,
 1 AS `usedTimes`*/;

--
-- Temporary table structure for view `currency_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_per_day`*/;
/*!50001 CREATE VIEW `currency_users_per_day` AS SELECT 
 1 AS `day`,
 1 AS `users_quantity`*/;

--
-- Temporary table structure for view `currency_users_today`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_today`*/;
/*!50001 CREATE VIEW `currency_users_today` AS SELECT 
 1 AS `userid`,
 1 AS `count(userid)`*/;

--
-- Table structure for table `dic_ads`
--

CREATE TABLE `dic_ads` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(50) NOT NULL,
  `adsid` varchar(50) NOT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  KEY `userid_2` (`userid`),
  KEY `adsid` (`adsid`),
  KEY `timeStamp` (`timeStamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `dic_ads`
--


--
-- Table structure for table `dic_ads_pool`
--

CREATE TABLE `dic_ads_pool` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `adsID` varchar(25) NOT NULL,
  `msgID` varchar(15) NOT NULL,
  `chatID` varchar(15) NOT NULL,
  `botID` enum('@TranslateGerman_bot','@TranslateGerman2_bot','@TranslateGerman3_bot','@Test_TranslateGerman_bot') NOT NULL,
  `adsSent` int(11) NOT NULL DEFAULT '0',
  `adsLimit` int(11) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '0',
  `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `dic_ads_pool`
--


--
-- Table structure for table `dic_conjunction`
--

CREATE TABLE `dic_conjunction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `verb` char(200) COLLATE utf8_bin NOT NULL,
  `form` char(100) CHARACTER SET utf8 NOT NULL,
  `person` char(10) COLLATE utf8_bin NOT NULL,
  `infinitive` varchar(300) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  KEY `verb` (`verb`),
  KEY `infinitive` (`infinitive`)
) ENGINE=MyISAM AUTO_INCREMENT=287559 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Dumping data for table `dic_conjunction`
--


--
-- Table structure for table `dic_phrases`
--

CREATE TABLE `dic_phrases` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `word` varchar(40) NOT NULL,
  `sentence` text NOT NULL,
  `translation` text NOT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `dic_phrases`
--


--
-- Table structure for table `dic_suggested_users`
--

CREATE TABLE `dic_suggested_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) NOT NULL,
  `suggestedid` varchar(200) NOT NULL,
  `Datum` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13156 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dic_suggested_users`
--


--
-- Table structure for table `dic_suggested_users_english`
--

CREATE TABLE `dic_suggested_users_english` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) NOT NULL,
  `suggestedid` varchar(200) NOT NULL,
  `Datum` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dic_suggested_users_english`
--


--
-- Table structure for table `dic_word_suggestion`
--

CREATE TABLE `dic_word_suggestion` (
  `id` int(11) NOT NULL DEFAULT '0',
  `searchedWord` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `dic_word_suggestion`
--


--
-- Table structure for table `dictionary`
--

CREATE TABLE `dictionary` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(10) NOT NULL,
  `type` varchar(10) NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `plural` text CHARACTER SET utf8 NOT NULL,
  `reflexive` tinyint(1) NOT NULL,
  `translation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `example` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `exampletranslation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `status` text CHARACTER SET utf8 NOT NULL,
  `soundFile` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `translationrate` int(11) NOT NULL,
  `searchedWord` varchar(300) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `searchedWord` (`searchedWord`),
  KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dictionary`
--


--
-- Table structure for table `dictionary_english`
--

CREATE TABLE `dictionary_english` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(10) NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `translation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `example` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `exampletranslation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `category` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `wordType` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `status` text CHARACTER SET utf8 NOT NULL,
  `translationrate` int(11) NOT NULL,
  `searchedWord` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dictionary_english`
--


--
-- Table structure for table `dictionary_merged`
--

CREATE TABLE `dictionary_merged` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(10) NOT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `type` varchar(20) NOT NULL,
  `perfect` varchar(100) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `plural` text CHARACTER SET utf8 NOT NULL,
  `reflexive` tinyint(1) NOT NULL,
  `translation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `example` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `exampletranslation` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `status` text CHARACTER SET utf8 NOT NULL,
  `soundFile` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `translationrate` int(11) NOT NULL,
  `searchedWord` varchar(90) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `searchedWord` (`searchedWord`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dictionary_merged`
--


--
-- Table structure for table `dicusers`
--

CREATE TABLE `dicusers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) CHARACTER SET latin1 NOT NULL,
  `username` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastname` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `invitesent` int(11) DEFAULT '0',
  `latitude` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `longitude` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `step` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT 'userIsTranslating',
  `adminApproveStatus` varchar(300) CHARACTER SET latin1 DEFAULT NULL,
  `role` enum('USER','TRANSLATOR','EDITOR','ADMIN') CHARACTER SET latin1 NOT NULL,
  `keyboard` enum('DEACTIVATED','ACTIVATED','DISABLE','') CHARACTER SET latin1 NOT NULL,
  `trust` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=146953 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `dicusers`
--


--
-- Table structure for table `dicusers_bots`
--

CREATE TABLE `dicusers_bots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `botID` enum('@TranslateGerman_bot','@TranslateGerman2_bot','@TranslateGerman3_bot','') COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `userID` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `botID` (`botID`),
  KEY `userID` (`userID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `dicusers_bots`
--


--
-- Table structure for table `dicusers_contribution`
--

CREATE TABLE `dicusers_contribution` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `artikel` varchar(3) COLLATE utf8_persian_ci DEFAULT NULL,
  `word` text CHARACTER SET utf8 NOT NULL,
  `type` varchar(20) COLLATE utf8_persian_ci DEFAULT NULL,
  `plural` varchar(40) COLLATE utf8_persian_ci DEFAULT NULL,
  `problemType` varchar(100) COLLATE utf8_persian_ci NOT NULL DEFAULT 'AddNewWord',
  `translation` text COLLATE utf8_persian_ci,
  `soundFile` varchar(50) COLLATE utf8_persian_ci DEFAULT NULL,
  `relatedWord` text COLLATE utf8_persian_ci,
  `rate` int(11) NOT NULL DEFAULT '0',
  `wordLanguage` varchar(100) COLLATE utf8_persian_ci DEFAULT NULL,
  `userid` varchar(500) COLLATE utf8_persian_ci DEFAULT NULL,
  `status` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `message_id` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `adminOpinion` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `askedByUser` varchar(200) COLLATE utf8_persian_ci DEFAULT NULL,
  `insertedTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=72219 DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Dumping data for table `dicusers_contribution`
--


--
-- Table structure for table `dicusers_english`
--

CREATE TABLE `dicusers_english` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) NOT NULL,
  `username` varchar(200) NOT NULL,
  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `lastname` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=256 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dicusers_english`
--


--
-- Table structure for table `dicusers_old`
--

CREATE TABLE `dicusers_old` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) NOT NULL,
  `username` varchar(200) NOT NULL,
  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `lastname` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `invitesent` int(11) NOT NULL DEFAULT '0',
  `step` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT 'userIsTranslating',
  `adminApproveStatus` varchar(30) NOT NULL DEFAULT 'none',
  `role` enum('USER','TRANSLATOR','EDITOR','ADMIN') NOT NULL,
  `keyboard` enum('DEACTIVATED','ACTIVATED','DISABLE','') NOT NULL,
  `trust` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `username` (`username`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=68682 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dicusers_old`
--


--
-- Table structure for table `hints`
--

CREATE TABLE `hints` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pattern` varchar(50) NOT NULL,
  `intent` varchar(20) NOT NULL,
  `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `hints`
--


--
-- Table structure for table `intents`
--

CREATE TABLE `intents` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(15) NOT NULL,
  `intent_id` int(11) NOT NULL DEFAULT '100',
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `intents`
--


--
-- Temporary table structure for view `ocr_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `ocr_used_per_day`*/;
/*!50001 CREATE VIEW `ocr_used_per_day` AS SELECT 
 1 AS `day`,
 1 AS `usedTimes`*/;

--
-- Temporary table structure for view `ocr_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `ocr_users_per_day`*/;
/*!50001 CREATE VIEW `ocr_users_per_day` AS SELECT 
 1 AS `day`,
 1 AS `users`*/;

--
-- Table structure for table `quiz`
--

CREATE TABLE `quiz` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(300) NOT NULL,
  `userid` varchar(300) NOT NULL,
  `channelName` varchar(300) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=227 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz`
--


--
-- Table structure for table `quiz_answers`
--

CREATE TABLE `quiz_answers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `questionID` int(11) NOT NULL,
  `answer` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `isRight` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3442 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz_answers`
--


--
-- Table structure for table `quiz_questions`
--

CREATE TABLE `quiz_questions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question` text CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `quizID` int(11) NOT NULL,
  `imageUrl` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1161 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz_questions`
--


--
-- Table structure for table `quiz_scores`
--

CREATE TABLE `quiz_scores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quizID` int(11) NOT NULL,
  `usercallbackID` varchar(300) NOT NULL,
  `score` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=35867 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz_scores`
--


--
-- Table structure for table `quiz_users`
--

CREATE TABLE `quiz_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) NOT NULL,
  `username` varchar(200) NOT NULL,
  `name` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `lastname` varchar(200) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL,
  `invitesent` int(11) NOT NULL,
  `step` varchar(100) CHARACTER SET utf8 NOT NULL,
  `adminApproveStatus` varchar(300) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3720 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz_users`
--


--
-- Table structure for table `quiz_users_asnwers`
--

CREATE TABLE `quiz_users_asnwers` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `userid` varchar(300) NOT NULL,
  `answerID` int(11) NOT NULL,
  `questionID` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=181301 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `quiz_users_asnwers`
--


--
-- Temporary table structure for view `speech2text_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `speech2text_used_per_day`*/;
/*!50001 CREATE VIEW `speech2text_used_per_day` AS SELECT 
 1 AS `day`,
 1 AS `usedTimes`*/;

--
-- Temporary table structure for view `speech2text_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `speech2text_users_per_day`*/;
/*!50001 CREATE VIEW `speech2text_users_per_day` AS SELECT 
 1 AS `day`,
 1 AS `users`*/;

--
-- Table structure for table `user_activities`
--

CREATE TABLE `user_activities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `searchedWord` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `intent_id` int(11) NOT NULL DEFAULT '0',
  `translated` tinyint(1) NOT NULL,
  `trdate` datetime NOT NULL,
  `todayAsked` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  KEY `searchedWord` (`searchedWord`)
) ENGINE=MyISAM AUTO_INCREMENT=2146356 DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Dumping data for table `user_activities`
--


--
-- Table structure for table `user_activities_01_10_2020`
--

CREATE TABLE `user_activities_01_10_2020` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `searchedWord` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `translated` tinyint(1) NOT NULL,
  `trdate` datetime NOT NULL,
  `todayAsked` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  KEY `searchedWord` (`searchedWord`)
) ENGINE=MyISAM AUTO_INCREMENT=12149238 DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Dumping data for table `user_activities_01_10_2020`
--


--
-- Table structure for table `user_activities_06_01`
--

CREATE TABLE `user_activities_06_01` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `searchedWord` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `translated` tinyint(1) NOT NULL,
  `trdate` datetime NOT NULL,
  `todayAsked` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  KEY `searchedWord` (`searchedWord`)
) ENGINE=MyISAM AUTO_INCREMENT=1106178 DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Dumping data for table `user_activities_06_01`
--


--
-- Table structure for table `user_activities_25_11_2020`
--

CREATE TABLE `user_activities_25_11_2020` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `searchedWord` varchar(200) COLLATE utf8_persian_ci NOT NULL,
  `intent_id` int(11) NOT NULL DEFAULT '0',
  `translated` tinyint(1) NOT NULL,
  `trdate` datetime NOT NULL,
  `todayAsked` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `userid` (`userid`),
  KEY `searchedWord` (`searchedWord`)
) ENGINE=MyISAM AUTO_INCREMENT=17529571 DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci;

--
-- Dumping data for table `user_activities_25_11_2020`
--


--
-- Temporary table structure for view `users_today`
--

/*!50001 DROP VIEW IF EXISTS `users_today`*/;
/*!50001 CREATE VIEW `users_today` AS SELECT 
 1 AS `userid`,
 1 AS `count(userid)`*/;

--
-- Final view structure for view `activity_by_month`
--

/*!50001 DROP VIEW IF EXISTS `activity_by_month`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `activity_by_month` AS select month(`user_activities`.`trdate`) AS `MONTH(trdate)`,count(0) AS `COUNT(*)` from `user_activities` group by month(`user_activities`.`trdate`) */;

--
-- Final view structure for view `activity_till_now`
--

/*!50001 DROP VIEW IF EXISTS `activity_till_now`*/;
/*!50001 CREATE ALGORITHM=TEMPTABLE */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `activity_till_now` AS select `user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `COUNT( userid )` from `user_activities` group by `user_activities`.`userid` order by count(`user_activities`.`userid`) desc */;

--
-- Final view structure for view `currency_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_used_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `currency_used_per_day` AS select `currency_users_and_day`.`day` AS `day`,sum(`currency_users_and_day`.`usedTimes`) AS `usedTimes` from `currency_users_and_day` group by `currency_users_and_day`.`day` */;

--
-- Final view structure for view `currency_users`
--

/*!50001 DROP VIEW IF EXISTS `currency_users`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `currency_users` AS select `user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `number_of_used` from `user_activities` where (`user_activities`.`intent_id` = 1) group by `user_activities`.`userid` order by count(`user_activities`.`userid`) desc */;

--
-- Final view structure for view `currency_users_and_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_and_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `currency_users_and_day` AS select cast(`user_activities`.`trdate` as date) AS `day`,`user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `usedTimes` from `user_activities` where (`user_activities`.`intent_id` = 1) group by `user_activities`.`userid`,cast(`user_activities`.`trdate` as date) */;

--
-- Final view structure for view `currency_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `currency_users_per_day` AS select `currency_users_and_day`.`day` AS `day`,count(`currency_users_and_day`.`userid`) AS `users_quantity` from `currency_users_and_day` group by `currency_users_and_day`.`day` */;

--
-- Final view structure for view `currency_users_today`
--

/*!50001 DROP VIEW IF EXISTS `currency_users_today`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `currency_users_today` AS select `user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `count(userid)` from `user_activities` where ((`user_activities`.`intent_id` = 1) and (cast(`user_activities`.`trdate` as date) = curdate())) group by `user_activities`.`userid` */;

--
-- Final view structure for view `ocr_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `ocr_used_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ocr_used_per_day` AS select `table2`.`day` AS `day`,count(`table2`.`userid`) AS `usedTimes` from (select cast(`telegram_tamasbabot`.`user_activities`.`trdate` as date) AS `day`,`telegram_tamasbabot`.`user_activities`.`userid` AS `userid`,count(`telegram_tamasbabot`.`user_activities`.`userid`) AS `usedTimes` from `telegram_tamasbabot`.`user_activities` where (`telegram_tamasbabot`.`user_activities`.`intent_id` = 4) group by `telegram_tamasbabot`.`user_activities`.`userid`,`telegram_tamasbabot`.`user_activities`.`trdate`) `table2` group by `table2`.`day` order by `table2`.`day` desc */;

--
-- Final view structure for view `ocr_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `ocr_users_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `ocr_users_per_day` AS select cast(`user_activities`.`trdate` as date) AS `day`,count(`user_activities`.`userid`) AS `users` from `user_activities` where (`user_activities`.`intent_id` = 4) group by cast(`user_activities`.`trdate` as date) order by `day` desc */;

--
-- Final view structure for view `speech2text_used_per_day`
--

/*!50001 DROP VIEW IF EXISTS `speech2text_used_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `speech2text_used_per_day` AS select `table2`.`day` AS `day`,count(`table2`.`userid`) AS `usedTimes` from (select cast(`telegram_tamasbabot`.`user_activities`.`trdate` as date) AS `day`,`telegram_tamasbabot`.`user_activities`.`userid` AS `userid`,count(`telegram_tamasbabot`.`user_activities`.`userid`) AS `usedTimes` from `telegram_tamasbabot`.`user_activities` where (`telegram_tamasbabot`.`user_activities`.`intent_id` = 5) group by `telegram_tamasbabot`.`user_activities`.`userid`,`telegram_tamasbabot`.`user_activities`.`trdate`) `table2` group by `table2`.`day` order by `table2`.`day` desc */;

--
-- Final view structure for view `speech2text_users_per_day`
--

/*!50001 DROP VIEW IF EXISTS `speech2text_users_per_day`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `speech2text_users_per_day` AS select cast(`user_activities`.`trdate` as date) AS `day`,count(`user_activities`.`userid`) AS `users` from `user_activities` where (`user_activities`.`intent_id` = 5) group by cast(`user_activities`.`trdate` as date) order by `day` desc */;

--
-- Final view structure for view `users_today`
--

/*!50001 DROP VIEW IF EXISTS `users_today`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `users_today` AS select `user_activities`.`userid` AS `userid`,count(`user_activities`.`userid`) AS `count(userid)` from `user_activities` where (cast(`user_activities`.`trdate` as date) = curdate()) group by `user_activities`.`userid` order by count(`user_activities`.`userid`) desc */;


