SQLize
Online
/
PHPize Online
/
SQLtest Online
A
A
A
Share
Donate
Blog
Popular
Donate
A
A
A
Share
Blog
Popular
SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code.
You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.
SQL code:
Upload
Copy
Format
Clear
CREATE TABLE `improvement_suggestion_comments` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `suggestion_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `improvement_suggestion_comments_suggestion_id_foreign` (`suggestion_id`), KEY `improvement_suggestion_comments_user_id_foreign` (`user_id`) ) ENGINE=InnoDB; INSERT INTO `improvement_suggestion_comments` VALUES (3,22,103,'2024-04-09 08:38:47','2024-04-09 08:38:47'),(4,22,189,'2024-04-09 08:51:43','2024-04-09 08:51:43'),(6,26,189,'2024-04-25 12:14:28','2024-04-25 12:14:28'),(11,40,722,'2024-05-31 12:57:15','2024-05-31 12:57:15'),(14,62,1090,'2024-06-17 05:45:20','2024-06-17 05:45:20'),(21,86,928,'2024-06-19 09:14:24','2024-06-19 09:14:24'),(22,86,928,'2024-06-19 09:15:11','2024-06-19 09:15:11'),(37,62,635,'2024-07-18 08:40:58','2024-07-18 08:40:58'),(41,87,635,'2024-07-19 05:12:18','2024-07-19 05:12:18'),(42,87,635,'2024-07-19 05:12:21','2024-07-19 05:12:21'),(43,305,1158,'2024-07-31 02:25:59','2024-07-31 02:25:59'),(44,305,1165,'2024-08-01 06:28:36','2024-08-01 06:28:36'),(45,305,1165,'2024-08-06 02:17:26','2024-08-06 02:17:26'),(46,108,1166,'2024-08-14 08:02:33','2024-08-14 08:02:33'),(47,111,635,'2024-08-23 05:00:31','2024-08-23 05:00:31'),(48,111,635,'2024-09-03 03:51:39','2024-09-03 03:51:39'); CREATE TABLE `improvement_suggestions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `author_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `improvement_suggestions_author_id_foreign` (`author_id`) ) ENGINE=InnoDB; INSERT INTO `improvement_suggestions` VALUES (22,778,'2024-04-09 06:06:59','2024-04-09 08:55:34'),(24,262,'2024-04-22 11:46:46','2024-04-23 12:14:06'),(25,190,'2024-04-22 11:47:25','2024-07-25 08:24:37'),(26,828,'2024-04-23 10:15:00','2024-04-27 07:43:43'),(33,450,'2024-05-24 12:15:48','2024-05-31 13:05:23'),(34,450,'2024-05-24 12:27:20','2024-05-31 13:06:05'),(35,450,'2024-05-24 12:32:13','2024-06-11 06:37:04'),(36,450,'2024-05-24 12:39:26','2024-05-31 13:04:54'),(37,577,'2024-05-24 12:41:23','2024-05-24 12:43:22'),(38,507,'2024-05-25 12:38:01','2024-09-02 11:51:56'),(39,NULL,'2024-05-25 12:55:09','2024-05-25 12:55:09'),(40,507,'2024-05-25 13:03:44','2024-09-02 11:50:46'),(41,792,'2024-05-25 13:08:26','2024-05-31 12:53:52'),(42,NULL,'2024-05-25 13:12:21','2024-05-31 12:52:54'),(43,983,'2024-05-25 13:16:58','2024-05-31 12:51:03'),(44,983,'2024-05-25 13:19:30','2024-05-30 09:13:52'),(45,553,'2024-05-25 21:57:54','2024-05-31 12:50:14'),(46,801,'2024-05-25 22:09:37','2024-05-30 08:55:45'),(62,1090,'2024-06-13 03:57:09','2024-07-18 08:40:58'),(66,1090,'2024-06-17 08:07:02','2024-06-20 03:39:59'),(67,1104,'2024-06-17 08:21:32','2024-08-20 08:26:39'),(82,1099,'2024-06-18 12:45:14','2024-06-18 12:51:10'),(83,1099,'2024-06-18 12:54:46','2024-06-18 13:28:47'),(84,1054,'2024-06-19 05:26:28','2024-06-19 08:04:52'),(85,1158,'2024-06-19 07:05:30','2024-06-19 07:05:30'),(86,1159,'2024-06-19 09:00:36','2024-07-03 11:25:18'),(87,1090,'2024-06-20 04:07:20','2024-07-19 05:12:21'),(95,828,'2024-06-24 08:09:43','2024-06-25 11:26:22'),(102,1104,'2024-06-30 04:13:56','2024-08-20 08:26:57'),(106,1201,'2024-07-01 10:14:01','2024-07-25 08:37:11'),(107,1165,'2024-07-01 10:34:08','2024-07-18 08:11:06'),(108,1158,'2024-07-01 10:55:51','2024-08-14 08:03:37'),(110,1054,'2024-07-09 14:18:33','2024-07-26 14:01:43'),(111,1091,'2024-07-11 08:35:03','2024-09-03 03:51:39'),(112,1032,'2024-07-18 05:55:21','2024-07-31 08:19:22'),(113,1032,'2024-07-18 05:55:27','2024-07-18 08:35:25'),(114,1032,'2024-07-18 06:06:46','2024-07-31 08:21:22'),(120,1280,'2024-07-23 06:13:53','2024-08-21 06:51:46'),(121,1281,'2024-07-23 08:40:39','2024-07-26 09:56:18'),(122,828,'2024-07-24 12:51:18','2024-07-25 08:42:52'),(123,828,'2024-07-24 13:13:34','2024-07-25 08:41:50'),(303,106,'2024-07-30 07:26:51','2024-07-31 08:16:09'),(304,106,'2024-07-30 07:50:33','2024-07-31 08:15:00'),(305,1158,'2024-07-30 08:13:40','2024-09-10 02:13:45'),(306,106,'2024-07-30 08:26:21','2024-07-31 08:15:25'),(307,1304,'2024-07-30 12:48:42','2024-07-31 09:35:03'),(308,106,'2024-07-30 12:59:04','2024-07-31 08:14:12'),(309,1307,'2024-07-31 06:43:37','2024-08-14 04:44:19'),(310,1304,'2024-08-01 13:13:54','2024-08-02 11:36:33'),(311,1158,'2024-08-16 11:46:52','2024-09-10 02:15:17'),(312,1330,'2024-08-20 03:52:45','2024-08-20 10:50:39'),(313,1090,'2024-08-23 06:29:28','2024-08-23 06:29:28'),(314,1104,'2024-08-25 05:33:16','2024-09-11 04:17:59'),(315,1375,'2024-08-26 05:41:26','2024-09-09 11:19:35'),(316,1181,'2024-08-26 08:17:00','2024-09-02 03:37:11'),(317,107,'2024-08-30 05:44:53','2024-09-02 08:02:11'),(318,107,'2024-08-30 05:54:55','2024-09-02 08:01:59'),(319,107,'2024-08-30 06:04:36','2024-09-02 08:01:40'),(320,107,'2024-08-30 07:43:57','2024-09-02 08:01:26'),(321,107,'2024-08-30 07:51:26','2024-09-02 07:54:50'),(322,107,'2024-08-30 07:55:28','2024-09-02 07:53:04'),(323,1099,'2024-09-03 06:35:31','2024-09-03 07:06:39'),(324,1099,'2024-09-03 12:02:18','2024-09-03 12:05:32'),(325,1158,'2024-09-09 03:04:47','2024-09-10 02:20:54'),(326,1409,'2024-09-10 05:02:13','2024-09-10 05:02:13'),(327,369,'2024-09-11 12:18:36','2024-09-11 12:18:36'),(328,369,'2024-09-11 12:27:07','2024-09-11 12:27:07'),(329,369,'2024-09-11 12:43:44','2024-09-11 12:43:44'); CREATE TABLE `improvement_suggestions_divisions_to_users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `division_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `improvement_suggestions_divisions_to_users_d_id` (`division_id`), KEY `improvement_suggestions_divisions_to_users_u_id` (`user_id`) ) ENGINE=InnoDB; INSERT INTO `improvement_suggestions_divisions_to_users` VALUES (1,17,189,NULL,NULL),(2,17,103,NULL,NULL),(5,17,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(6,15,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(7,16,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(8,12,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(9,10,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(10,13,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(11,14,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(12,1,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(13,7,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(14,11,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(15,8,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(16,9,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(17,5,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(18,6,1,'2023-12-25 10:32:18','2023-12-25 10:32:18'),(19,1,551,'2024-01-11 05:39:32','2024-01-11 05:39:32'),(20,6,731,'2024-01-20 15:39:40','2024-01-20 15:39:40'),(22,1,757,'2024-02-07 08:22:43','2024-02-07 08:22:43'),(23,1,407,'2024-02-07 08:33:07','2024-02-07 08:33:07'),(24,1,774,'2024-02-12 09:29:36','2024-02-12 09:29:36'),(28,6,827,'2024-03-06 01:39:46','2024-03-06 01:39:46'),(29,6,833,'2024-03-14 07:20:15','2024-03-14 07:20:15'),(30,6,875,'2024-03-19 00:00:50','2024-03-19 00:00:50'),(32,6,934,'2024-03-26 15:49:43','2024-03-26 15:49:43'),(33,1,945,'2024-03-30 03:23:36','2024-03-30 03:23:36'),(34,1,946,'2024-03-30 03:26:43','2024-03-30 03:26:43'),(35,14,828,'2024-04-04 09:38:13','2024-04-04 09:38:13'),(36,6,1008,'2024-04-12 04:33:34','2024-04-12 04:33:34'),(37,20,587,'2024-04-16 06:26:00','2024-04-16 06:26:00'),(38,15,190,'2024-04-22 10:52:12','2024-04-22 10:52:12'),(39,17,190,'2024-04-22 10:52:12','2024-04-22 10:52:12'),(40,17,262,'2024-04-22 10:58:37','2024-04-22 10:58:37'),(41,5,1021,'2024-04-26 05:27:21','2024-04-26 05:27:21'),(42,5,1023,'2024-04-28 09:25:19','2024-04-28 09:25:19'),(43,1,1036,'2024-05-03 11:17:46','2024-05-03 11:17:46'),(44,1,1046,'2024-05-05 22:19:49','2024-05-05 22:19:49'),(45,1,1047,'2024-05-05 22:32:39','2024-05-05 22:32:39'),(46,1,1048,'2024-05-05 22:34:42','2024-05-05 22:34:42'),(47,1,1049,'2024-05-05 22:36:33','2024-05-05 22:36:33'),(48,1,1051,'2024-05-07 04:00:26','2024-05-07 04:00:26'),(49,1,1052,'2024-05-07 04:02:52','2024-05-07 04:02:52'),(50,1,152,'2024-05-07 04:15:42','2024-05-07 04:15:42'),(51,1,155,'2024-05-07 04:19:05','2024-05-07 04:19:05'),(52,1,1053,'2024-05-07 04:21:17','2024-05-07 04:21:17'),(53,5,1058,'2024-05-14 05:35:50','2024-05-14 05:35:50'),(54,17,1060,'2024-05-20 05:40:25','2024-05-20 05:40:25'),(55,22,1054,'2024-05-20 11:55:07','2024-05-20 11:55:07'),(56,21,1054,'2024-05-20 11:55:07','2024-05-20 11:55:07'),(57,23,1054,'2024-05-20 11:55:07','2024-05-20 11:55:07'),(58,6,1063,'2024-05-23 06:26:27','2024-05-23 06:26:27'),(59,13,1064,'2024-05-23 06:34:39','2024-05-23 06:34:39'),(60,20,937,'2024-05-23 09:40:16','2024-05-23 09:40:16'),(61,20,577,'2024-05-23 09:54:30','2024-05-23 09:54:30'),(63,5,1067,'2024-05-23 17:36:31','2024-05-23 17:36:31'),(64,5,1068,'2024-05-23 17:40:41','2024-05-23 17:40:41'),(65,5,1069,'2024-05-23 17:44:43','2024-05-23 17:44:43'),(66,24,1,'2024-05-24 09:10:33','2024-05-24 09:10:33'),(67,24,722,'2024-05-24 09:13:58','2024-05-24 09:13:58'),(68,25,662,'2024-05-24 09:26:49','2024-05-24 09:26:49'),(69,25,957,'2024-05-24 09:27:12','2024-05-24 09:27:12'),(70,24,704,'2024-05-27 10:45:48','2024-05-27 10:45:48'),(71,36,1,'2024-05-27 11:25:38','2024-05-27 11:25:38'),(72,24,577,'2024-05-27 11:53:21','2024-05-27 11:53:21'),(73,22,1,'2024-05-27 11:56:54','2024-05-27 11:56:54'),(74,32,1,'2024-05-27 11:56:54','2024-05-27 11:56:54'),(75,22,1081,'2024-05-28 06:41:42','2024-05-28 06:41:42'),(76,20,1083,'2024-05-28 11:26:46','2024-05-28 11:26:46'),(81,36,1083,'2024-05-28 11:34:09','2024-05-28 11:34:09'),(82,17,1083,'2024-05-28 11:34:09','2024-05-28 11:34:09'),(83,22,1083,'2024-05-28 11:34:09','2024-05-28 11:34:09'),(84,24,1083,'2024-05-28 11:34:09','2024-05-28 11:34:09'),(86,63,902,'2024-05-29 05:54:25','2024-05-29 05:54:25'),(87,63,1087,'2024-05-29 05:55:06','2024-05-29 05:55:06'),(89,63,577,'2024-05-29 05:59:18','2024-05-29 05:59:18'),(90,36,1089,'2024-05-29 06:36:57','2024-05-29 06:36:57'),(91,36,635,'2024-05-29 06:38:15','2024-05-29 06:38:15'),(92,44,1090,'2024-05-29 06:40:55','2024-05-29 06:40:55'),(93,45,1091,'2024-05-29 06:42:07','2024-05-29 06:42:07'),(94,47,1092,'2024-05-29 06:43:26','2024-05-29 06:43:26'),(95,36,577,'2024-05-29 06:47:28','2024-05-29 06:47:28'),(97,28,1096,'2024-05-30 03:19:43','2024-05-30 03:19:43'),(99,90,1099,'2024-05-30 07:38:29','2024-05-30 07:38:29'),(100,89,1100,'2024-05-30 07:46:46','2024-05-30 07:46:46'),(102,75,577,'2024-05-30 07:55:54','2024-05-30 07:55:54'),(103,90,577,'2024-05-30 07:55:54','2024-05-30 07:55:54'),(104,22,577,'2024-05-30 07:55:54','2024-05-30 07:55:54'),(105,89,577,'2024-05-30 07:55:54','2024-05-30 07:55:54'),(106,26,638,'2024-05-30 08:53:53','2024-05-30 08:53:53'),(107,24,804,'2024-05-30 09:12:21','2024-05-30 09:12:21'),(109,89,1103,'2024-05-30 11:34:31','2024-05-30 11:34:31'),(110,63,1104,'2024-05-30 12:17:53','2024-05-30 12:17:53'),(111,75,929,'2024-05-30 12:18:32','2024-05-30 12:18:32'),(112,89,1107,'2024-05-31 11:18:28','2024-05-31 11:18:28'),(113,1,1108,'2024-05-31 12:07:12','2024-05-31 12:07:12'),(114,1,1109,'2024-05-31 12:10:38','2024-05-31 12:10:38'),(115,5,1111,'2024-06-02 06:30:35','2024-06-02 06:30:35'),(116,5,1112,'2024-06-02 06:33:33','2024-06-02 06:33:33'),(117,5,1113,'2024-06-02 06:43:38','2024-06-02 06:43:38'),(118,5,1114,'2024-06-02 06:47:58','2024-06-02 06:47:58'),(119,5,1115,'2024-06-02 07:18:56','2024-06-02 07:18:56'),(120,5,1116,'2024-06-02 17:30:17','2024-06-02 17:30:17'),(121,5,1117,'2024-06-03 03:57:34','2024-06-03 03:57:34'),(123,46,1119,'2024-06-03 06:13:09','2024-06-03 06:13:09'),(124,78,1121,'2024-06-05 07:01:42','2024-06-05 07:01:42'),(125,5,1123,'2024-06-06 11:05:59','2024-06-06 11:05:59'),(126,5,1124,'2024-06-06 11:08:19','2024-06-06 11:08:19'),(128,5,1126,'2024-06-06 11:15:30','2024-06-06 11:15:30'),(129,5,1129,'2024-06-07 03:37:37','2024-06-07 03:37:37'),(130,5,1130,'2024-06-07 03:42:49','2024-06-07 03:42:49'),(133,63,1,'2024-06-08 08:02:53','2024-06-08 08:02:53'),(136,89,1137,'2024-06-11 04:57:40','2024-06-11 04:57:40'),(137,68,1138,'2024-06-11 06:19:46','2024-06-11 06:19:46'),(138,38,1143,'2024-06-13 10:36:02','2024-06-13 10:36:02'),(139,38,1144,'2024-06-13 10:37:44','2024-06-13 10:37:44'),(140,71,1146,'2024-06-14 08:37:12','2024-06-14 08:37:12'),(143,84,1097,'2024-06-17 07:06:21','2024-06-17 07:06:21'),(144,46,1152,'2024-06-17 08:20:59','2024-06-17 08:20:59'),(145,36,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(146,75,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(147,17,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(148,22,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(149,63,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(150,89,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(151,90,937,'2024-06-17 09:41:24','2024-06-17 09:41:24'),(154,75,1083,'2024-06-18 12:12:10','2024-06-18 12:12:10'),(155,63,1083,'2024-06-18 12:12:10','2024-06-18 12:12:10'),(156,89,1083,'2024-06-18 12:12:10','2024-06-18 12:12:10'),(157,90,1083,'2024-06-18 12:12:10','2024-06-18 12:12:10'),(158,20,1156,'2024-06-18 13:00:18','2024-06-18 13:00:18'),(159,20,1157,'2024-06-19 06:47:41','2024-06-19 06:47:41'),(161,81,1159,'2024-06-19 08:48:19','2024-06-19 08:48:19'),(162,92,1165,'2024-06-20 06:38:37','2024-06-20 06:38:37'),(163,92,1158,'2024-06-20 06:38:58','2024-06-20 06:38:58'),(164,92,1166,'2024-06-20 06:46:31','2024-06-20 06:46:31'),(165,92,1167,'2024-06-20 06:50:14','2024-06-20 06:50:14'),(166,92,1,'2024-06-20 06:55:35','2024-06-20 06:55:35'),(167,54,1065,'2024-06-20 08:16:45','2024-06-20 08:16:45'),(169,92,577,'2024-06-25 06:32:08','2024-06-25 06:32:08'),(170,91,1177,'2024-06-25 08:36:26','2024-06-25 08:36:26'),(171,67,1179,'2024-06-26 10:25:31','2024-06-26 10:25:31'),(172,72,1180,'2024-06-26 10:27:14','2024-06-26 10:27:14'),(173,56,1181,'2024-06-26 10:34:03','2024-06-26 10:34:03'),(174,54,1182,'2024-06-26 10:35:03','2024-06-26 10:35:03'),(175,58,1183,'2024-06-26 10:36:33','2024-06-26 10:36:33'),(176,22,1184,'2024-06-26 10:38:38','2024-06-26 10:38:38'),(177,28,1187,'2024-06-26 21:06:11','2024-06-26 21:06:11'),(178,28,553,'2024-06-26 21:08:52','2024-06-26 21:08:52'),(179,26,1000,'2024-06-27 04:39:04','2024-06-27 04:39:04'),(180,29,1188,'2024-06-28 02:43:37','2024-06-28 02:43:37'),(183,92,937,'2024-07-01 10:05:00','2024-07-01 10:05:00'),(184,28,1202,'2024-07-01 12:45:30','2024-07-01 12:45:30'),(185,29,1203,'2024-07-02 05:54:54','2024-07-02 05:54:54'),(186,5,1210,'2024-07-04 05:26:57','2024-07-04 05:26:57'),(187,5,1211,'2024-07-04 05:30:55','2024-07-04 05:30:55'),(188,28,1218,'2024-07-06 03:15:33','2024-07-06 03:15:33'),(191,5,1224,'2024-07-07 06:28:28','2024-07-07 06:28:28'),(192,5,1225,'2024-07-07 06:30:11','2024-07-07 06:30:11'),(193,5,1226,'2024-07-07 06:31:33','2024-07-07 06:31:33'),(194,5,1227,'2024-07-07 06:33:14','2024-07-07 06:33:14'),(195,5,1228,'2024-07-07 06:34:56','2024-07-07 06:34:56'),(196,5,1229,'2024-07-07 06:36:32','2024-07-07 06:36:32'),(197,5,1230,'2024-07-07 06:39:49','2024-07-07 06:39:49'),(199,28,1015,'2024-07-09 03:45:25','2024-07-09 03:45:25'),(201,5,1237,'2024-07-10 10:34:24','2024-07-10 10:34:24'),(202,5,1238,'2024-07-10 10:43:58','2024-07-10 10:43:58'),(206,5,1242,'2024-07-10 11:07:45','2024-07-10 11:07:45'),(207,5,1243,'2024-07-10 11:09:51','2024-07-10 11:09:51'),(208,5,1244,'2024-07-10 11:11:45','2024-07-10 11:11:45'),(209,5,1245,'2024-07-10 11:13:31','2024-07-10 11:13:31'),(210,5,1246,'2024-07-10 11:16:12','2024-07-10 11:16:12'),(211,5,1247,'2024-07-10 11:19:00','2024-07-10 11:19:00'),(213,5,1249,'2024-07-11 04:08:41','2024-07-11 04:08:41'),(214,5,1250,'2024-07-11 05:54:56','2024-07-11 05:54:56'),(216,5,1255,'2024-07-12 02:54:36','2024-07-12 02:54:36'),(217,28,1256,'2024-07-12 05:16:29','2024-07-12 05:16:29'),(218,28,1258,'2024-07-13 15:04:43','2024-07-13 15:04:43'),(219,28,1259,'2024-07-13 16:15:50','2024-07-13 16:15:50'),(220,28,1261,'2024-07-16 03:01:28','2024-07-16 03:01:28'),(222,30,1267,'2024-07-18 07:48:19','2024-07-18 07:48:19'),(223,44,1268,'2024-07-18 08:57:51','2024-07-18 08:57:51'),(224,5,1269,'2024-07-18 11:39:46','2024-07-18 11:39:46'),(225,5,219,'2024-07-19 06:30:21','2024-07-19 06:30:21'),(226,28,1273,'2024-07-19 15:55:07','2024-07-19 15:55:07'),(229,28,1275,'2024-07-21 03:02:21','2024-07-21 03:02:21'),(230,28,1278,'2024-07-21 21:56:36','2024-07-21 21:56:36'),(231,5,1279,'2024-07-22 09:02:41','2024-07-22 09:02:41'),(232,84,1280,'2024-07-23 05:59:12','2024-07-23 05:59:12'),(233,84,1281,'2024-07-23 08:04:18','2024-07-23 08:04:18'),(237,1,1287,'2024-07-24 08:33:06','2024-07-24 08:33:06'),(238,1,1288,'2024-07-24 08:34:53','2024-07-24 08:34:53'),(239,1,1289,'2024-07-24 08:36:40','2024-07-24 08:36:40'),(240,28,1292,'2024-07-26 03:03:22','2024-07-26 03:03:22'),(241,5,1293,'2024-07-26 04:04:47','2024-07-26 04:04:47'),(242,5,565,'2024-07-26 05:15:35','2024-07-26 05:15:35'),(243,5,1301,'2024-07-30 07:36:50','2024-07-30 07:36:50'),(244,20,1302,'2024-07-30 09:20:35','2024-07-30 09:20:35'),(245,6,1303,'2024-07-30 09:29:22','2024-07-30 09:29:22'),(246,51,1304,'2024-07-30 10:45:08','2024-07-30 10:45:08'),(247,28,1306,'2024-07-31 03:01:39','2024-07-31 03:01:39'),(248,105,1307,'2024-07-31 06:35:15','2024-07-31 06:35:15'),(249,14,106,'2024-07-31 08:38:24','2024-07-31 08:38:24'),(250,92,1309,'2024-08-01 06:34:41','2024-08-01 06:34:41'),(251,92,1310,'2024-08-01 06:43:31','2024-08-01 06:43:31'),(253,5,616,'2024-08-03 04:13:23','2024-08-03 04:13:23'),(254,1,1315,'2024-08-03 06:12:06','2024-08-03 06:12:06'),(255,1,1317,'2024-08-03 06:13:05','2024-08-03 06:13:05'),(256,1,1318,'2024-08-03 06:13:56','2024-08-03 06:13:56'),(257,1,1316,'2024-08-03 06:14:29','2024-08-03 06:14:29'),(258,28,1320,'2024-08-03 22:16:51','2024-08-03 22:16:51'),(259,92,1322,'2024-08-06 02:23:10','2024-08-06 02:23:10'),(260,24,937,'2024-08-07 04:00:45','2024-08-07 04:00:45'),(261,28,1327,'2024-08-09 03:01:27','2024-08-09 03:01:27'),(262,30,1323,'2024-08-09 03:16:17','2024-08-09 03:16:17'),(263,81,1330,'2024-08-09 11:02:17','2024-08-09 11:02:17'),(264,6,1333,'2024-08-10 03:46:35','2024-08-10 03:46:35'),(267,28,1338,'2024-08-11 05:30:07','2024-08-11 05:30:07'),(268,28,1339,'2024-08-11 17:05:43','2024-08-11 17:05:43'),(270,63,1312,'2024-08-12 04:40:16','2024-08-12 04:40:16'),(271,104,1341,'2024-08-14 04:18:36','2024-08-14 04:18:36'),(272,30,1342,'2024-08-14 20:04:20','2024-08-14 20:04:20'),(273,28,1343,'2024-08-15 03:57:12','2024-08-15 03:57:12'),(275,30,1350,'2024-08-16 16:07:00','2024-08-16 16:07:00'),(276,30,1352,'2024-08-17 03:30:04','2024-08-17 03:30:04'),(277,30,1353,'2024-08-17 13:32:22','2024-08-17 13:32:22'),(278,5,1355,'2024-08-18 06:08:52','2024-08-18 06:08:52'),(279,38,1357,'2024-08-19 11:58:00','2024-08-19 11:58:00'),(280,6,1358,'2024-08-20 00:23:40','2024-08-20 00:23:40'),(281,28,1361,'2024-08-20 15:19:28','2024-08-20 15:19:28'),(282,38,1362,'2024-08-21 03:30:07','2024-08-21 03:30:07'),(283,30,1364,'2024-08-21 22:10:29','2024-08-21 22:10:29'),(284,30,1365,'2024-08-22 15:49:35','2024-08-22 15:49:35'),(285,6,1366,'2024-08-23 06:05:00','2024-08-23 06:05:00'),(286,6,1367,'2024-08-23 06:07:29','2024-08-23 06:07:29'),(287,30,1368,'2024-08-24 15:55:02','2024-08-24 15:55:02'),(288,30,1369,'2024-08-24 16:01:14','2024-08-24 16:01:14'),(289,30,1370,'2024-08-24 16:56:34','2024-08-24 16:56:34'),(290,30,1371,'2024-08-25 11:45:00','2024-08-25 11:45:00'),(291,80,1375,'2024-08-26 05:31:40','2024-08-26 05:31:40'),(293,30,1377,'2024-08-28 04:35:39','2024-08-28 04:35:39'),(294,30,1378,'2024-08-29 03:07:34','2024-08-29 03:07:34'),(295,30,1379,'2024-08-29 03:09:00','2024-08-29 03:09:00'),(296,30,1380,'2024-08-29 07:57:17','2024-08-29 07:57:17'),(297,30,1381,'2024-08-29 09:11:12','2024-08-29 09:11:12'),(298,30,1382,'2024-08-29 10:44:58','2024-08-29 10:44:58'),(299,30,1383,'2024-08-30 07:28:15','2024-08-30 07:28:15'),(300,30,1384,'2024-08-31 03:49:24','2024-08-31 03:49:24'),(301,30,1389,'2024-09-02 08:06:48','2024-09-02 08:06:48'),(302,90,1391,'2024-09-03 06:58:44','2024-09-03 06:58:44'),(303,28,1392,'2024-09-03 10:34:11','2024-09-03 10:34:11'),(304,30,1394,'2024-09-04 03:22:14','2024-09-04 03:22:14'),(305,1,1395,'2024-09-04 10:14:51','2024-09-04 10:14:51'),(306,1,1396,'2024-09-04 10:37:58','2024-09-04 10:37:58'),(307,5,1397,'2024-09-04 11:19:49','2024-09-04 11:19:49'),(308,30,1398,'2024-09-04 11:21:23','2024-09-04 11:21:23'),(309,20,1401,'2024-09-05 09:11:04','2024-09-05 09:11:04'),(310,30,1404,'2024-09-06 08:48:47','2024-09-06 08:48:47'),(311,35,1405,'2024-09-06 08:56:06','2024-09-06 08:56:06'),(312,30,1406,'2024-09-06 09:00:05','2024-09-06 09:00:05'),(313,5,1407,'2024-09-06 09:10:04','2024-09-06 09:10:04'),(314,80,1409,'2024-09-09 11:17:08','2024-09-09 11:17:08'),(315,30,1410,'2024-09-10 03:31:11','2024-09-10 03:31:11'),(316,1,1413,'2024-09-10 05:18:09','2024-09-10 05:18:09'),(317,28,1414,'2024-09-10 06:23:57','2024-09-10 06:23:57'),(318,30,1415,'2024-09-12 05:58:29','2024-09-12 05:58:29'),(319,38,455,'2024-09-13 03:51:42','2024-09-13 03:51:42'),(320,17,778,'2024-10-30 20:08:03','2024-10-30 20:08:03'),(321,15,778,'2024-10-30 20:08:03','2024-10-30 20:08:03'),(322,93,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(323,41,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(324,36,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(325,45,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(326,40,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(327,48,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(328,43,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(329,46,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(330,44,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(331,47,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(332,39,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(333,42,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(334,38,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(335,37,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(336,94,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(337,75,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(338,85,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(339,86,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(340,79,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(341,76,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(342,77,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(343,83,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(344,82,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(345,78,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(346,80,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(347,81,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(348,84,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(349,95,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(350,17,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(351,15,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(352,16,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(353,12,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(354,19,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(355,13,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(356,10,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(357,14,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(358,5,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(359,8,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(360,6,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(361,1,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(362,9,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(363,7,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(364,11,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(365,96,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(366,22,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(367,58,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(368,54,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(369,57,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(370,21,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(371,59,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(372,50,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(373,55,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(374,56,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(375,52,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(376,51,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(377,60,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(378,61,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(379,62,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(380,53,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(381,23,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(382,97,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(383,63,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(384,74,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(385,65,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(386,67,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(387,66,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(388,71,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(389,69,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(390,70,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(391,73,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(392,72,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(393,68,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(394,98,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(395,89,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(396,103,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(397,104,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(398,105,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(399,91,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(400,99,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(401,24,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(402,26,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(403,34,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(404,33,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(405,35,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(406,27,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(407,25,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(408,31,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(409,29,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(410,30,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(411,32,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(412,28,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(413,100,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(414,90,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(415,101,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(416,102,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(417,92,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(418,107,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(419,106,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'),(420,108,42,'2024-11-05 07:38:42','2024-11-05 07:38:42'); SELECT `improvement_suggestions_divisions_to_users`.`user_id` FROM `improvement_suggestions_divisions_to_users` WHERE `improvement_suggestions_divisions_to_users`.`user_id` = 1158 GROUP BY `improvement_suggestions_divisions_to_users`.`user_id`; SELECT `improvement_suggestions`.`id`, `improvement_suggestions`.`author_id`, `author_divisions`.`user_id` AS `user_id`, `last_comments`.`last_comment_id`, IF( `improvement_suggestions`.`author_id` = 1158 AND `author_divisions`.`user_id` IS NULL, 'В user_id ДОЛЖНО БЫТЬ 1158', '' ) AS error FROM `improvement_suggestions` LEFT JOIN ( SELECT `improvement_suggestion_comments`.`id` AS `last_comment_id`, `improvement_suggestion_comments`.`suggestion_id` AS `last_comment_suggestion_id` FROM `improvement_suggestion_comments` INNER JOIN ( SELECT `improvement_suggestion_comments`.`suggestion_id`, MAX(improvement_suggestion_comments.created_at) AS created_at FROM `improvement_suggestion_comments` GROUP BY `improvement_suggestion_comments`.`suggestion_id` ) AS `max` ON `improvement_suggestion_comments`.`suggestion_id` = `max`.`suggestion_id` AND `improvement_suggestion_comments`.`created_at` = `max`.`created_at` ) AS `last_comments` ON `last_comments`.`last_comment_suggestion_id` = `improvement_suggestions`.`id` LEFT JOIN ( SELECT `improvement_suggestions_divisions_to_users`.`user_id` FROM `improvement_suggestions_divisions_to_users` GROUP BY `improvement_suggestions_divisions_to_users`.`user_id` ) AS `author_divisions` ON `author_divisions`.`user_id` = `improvement_suggestions`.`author_id` ORDER BY `improvement_suggestions`.`id` DESC;
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 11
PostgreSQL 12
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
MS SQL Server 2017
MS SQL Server 2019
MS SQL Server 2022
MS SQL Server 2022 AdventureWorks (ReadOnly)
Firebird 4.0
Firebird 4.0 (Employee)
Oracle Database 19c (HR)
Oracle Database 21c
Oracle Database 23c Free
SOQOL
Version
ER Diagram
Preserve result
Stuck with a problem?
Got Error?
Ask ChatGPT!
Result:
Copy
Clear