text
stringlengths
6
9.38M
LOCK TABLES `accounts` WRITE; /*!40000 ALTER TABLE `accounts` DISABLE KEYS */; INSERT INTO `accounts` VALUES (92,104,'Main Revenue','cftix','hour',1399.98,-1,'2015-01-05 19:53:31','2015-11-18 04:39:17',NULL,0) ,(93,104,'Main Expense','cftix','hour',1221.82,1,'2015-01-05 19:53:31','2015-11-18 05:12:08',NULL,0) ,(94,104,'Personal Expense','ti','hour',187.53,1,'2015-01-05 19:53:32',NULL,NULL,0) ,(95,105,'Main Revenue','cftix','hour',1000.00,-1,'2015-01-05 19:53:33',NULL,NULL,0) ,(96,105,'Main Expense','cftix','hour',990.63,1,'2015-01-05 19:53:33',NULL,NULL,0) ,(97,104,'Test Expense','ftix','hour',0.00,1,'2015-01-05 19:53:33',NULL,NULL,0) ,(98,106,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:38:54',NULL,NULL,0) ,(99,106,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:38:54',NULL,NULL,0) ,(100,107,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:39:44',NULL,NULL,0) ,(101,107,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:39:44',NULL,NULL,0) ,(102,108,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:40:26',NULL,NULL,0) ,(103,108,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:40:26',NULL,NULL,0) ,(104,109,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:42:51',NULL,NULL,0) ,(105,109,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:42:51',NULL,NULL,0) ,(106,110,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:45:35',NULL,NULL,0) ,(107,110,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:45:35',NULL,NULL,0) ,(108,111,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:46:25',NULL,NULL,0) ,(109,111,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:46:25',NULL,NULL,0) ,(110,112,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:47:43',NULL,NULL,0) ,(111,112,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:47:43',NULL,NULL,0) ,(112,113,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:49:43',NULL,NULL,0) ,(113,113,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:49:43',NULL,NULL,0) ,(114,114,'Main Revenue','cftix','hour',0.00,-1,'2015-08-09 01:53:23',NULL,NULL,0) ,(115,114,'Main Expense','cftix','hour',0.00,1,'2015-08-09 01:53:23',NULL,NULL,0) ,(116,115,'Main Revenue','cftix','hour',0.00,-1,'2015-11-18 18:50:05',NULL,NULL,0) ,(117,115,'Main Expense','cftix','hour',0.00,1,'2015-11-18 18:50:05',NULL,NULL,0) ,(118,116,'Main Revenue','cftix','hour',0.00,-1,'2015-11-19 04:21:32',NULL,NULL,0) ,(119,116,'Main Expense','cftix','hour',0.00,1,'2015-11-19 04:21:32',NULL,NULL,0); /*!40000 ALTER TABLE `accounts` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `brands` WRITE; /*!40000 ALTER TABLE `brands` DISABLE KEYS */; INSERT INTO `brands` VALUES (104,'abc','to be the first brand','for testing',0,'0','2015-01-05 19:53:31',NULL,NULL,NULL,0,'USA','206','for-profit',9,NULL,NULL) ,(105,'def','to be the second brand','for testing',0,'0','2015-01-05 19:53:33',NULL,NULL,NULL,0,'USA','206','for-profit',9,NULL,NULL) ,(106,'~Amazon.com, Boren Avenue North, Seattle, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:38:54',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(107,'~The Boeing Company, West Casino Road, Everett, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:39:44',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(108,'~Starbucks, Aurora Avenue North, Shoreline, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:40:26',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(109,'~First Peoples Worldwide, Leeland Road, Fredericksburg, VA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:42:51',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(110,'~slumaid.org','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:45:35',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(111,'~National Rifle Association, Waples Mill Road, Fairfax, VA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:46:25',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(112,'~Koch Industries, East 37th Street North, Wichita, KS, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:47:43',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(113,'~McDonald\'s Corporation, West Wade Hampton Boulevard, Greer, SC, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:49:43',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(114,'~P-Patch, Lynn Street, Seattle, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-08-09 01:53:23',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(115,'~Echo Lake Elementary School, Seattle, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-11-18 18:50:05',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL) ,(116,'~Pizza Hut, Washington 99, Edmonds, WA, United States','simulate a well-known brand for whitelisting or blacklisting','This is a simulated brand to be used for testing the tatag system.',NULL,NULL,'2015-11-19 04:21:32',NULL,NULL,NULL,NULL,'USA','206','sim',10,NULL,NULL); /*!40000 ALTER TABLE `brands` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `consumers` WRITE; /*!40000 ALTER TABLE `consumers` DISABLE KEYS */; INSERT INTO `consumers` VALUES (1,'login','login','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.',NULL,'2015-11-16 22:59:28',NULL,NULL,21) ,(2,'tatag-ui','ui','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.',NULL,'2015-11-16 22:59:28',NULL,NULL,21) ,(3,'flora','sim','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.',NULL,'2015-11-16 22:59:28',NULL,NULL,21) ,(4,'advisorX','advisor','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.',NULL,NOW(),NULL,NULL,21); /*!40000 ALTER TABLE `consumers` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `holders` WRITE; /*!40000 ALTER TABLE `holders` DISABLE KEYS */; INSERT INTO `holders` VALUES (41,21,92,'cftix','2015-01-05 19:53:31',NULL,NULL,'abc',NULL) ,(42,21,93,'cftix','2015-01-05 19:53:31','2015-12-08 02:48:17',NULL,'abc','Main Expense') ,(43,21,94,'ftix','2015-01-05 19:53:32','2015-12-11 05:29:32',NULL,'abc','personal expense') ,(44,22,95,'cftix','2015-01-05 19:53:33',NULL,NULL,'abc',NULL) ,(45,22,96,'cftix','2015-01-05 19:53:33',NULL,NULL,'abc',NULL); /*!40000 ALTER TABLE `holders` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `members` WRITE; /*!40000 ALTER TABLE `members` DISABLE KEYS */; INSERT INTO `members` VALUES (53,104,21,'admin','0','2015-01-05 19:53:31','2015-11-18 00:15:14',NULL,'2015-11-17 12:15:14',NULL) ,(54,105,22,'admin','0','2015-01-05 19:53:33',NULL,NULL,NULL,NULL) ,(55,104,23,'staff','0','2015-01-05 19:53:31',NULL,NULL,NULL,NULL) ,(56,115,21,'admin','0','2015-11-18 18:50:05',NULL,'2015-11-18 18:50:05',NULL,NULL) ,(57,116,21,'admin','0','2015-11-19 04:21:32',NULL,'2015-11-19 04:21:32',NULL,NULL); /*!40000 ALTER TABLE `members` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `promos` WRITE; /*!40000 ALTER TABLE `promos` DISABLE KEYS */; INSERT INTO `promos` VALUES (1,104,'Test promo','A brand #104 promo',NULL,NULL,25.00,NULL,'2015-01-01 00:00:00',NULL,NULL,NULL,1,'software') ,(2,105,'Test promo','A brand #105 promo',NULL,NULL,25.00,NULL,'2015-01-01 00:00:00',NULL,NULL,NULL,4,'food') ,(3,104,'product promo 1f8','a brand 104 promo 1f8',NULL,NULL,57.57,NULL,'2015-11-18 00:15:57',NULL,NULL,'2016-12-31 08:00:00',5,'grocery') ,(4,104,'product promo 67','a brand 104 promo 67',NULL,NULL,57.69,NULL,'2015-11-18 00:16:09',NULL,NULL,'2016-12-31 08:00:00',6,'ride') ,(5,104,'product promo 3cc','a brand 104 promo 3cc',NULL,NULL,57.71,NULL,'2015-11-18 00:16:12',NULL,NULL,'2016-12-31 08:00:00',7,'drink') ,(6,104,'product promo 3cc','a brand 104 promo 3cc',NULL,NULL,57.71,NULL,'2015-11-18 00:16:12',NULL,NULL,'2016-12-31 08:00:00',8,'book') ,(7,104,'test','test','',NULL,7.77,NULL,'2015-11-18 18:05:36',NULL,NULL,'2016-12-31 08:00:00',9,'grocery') ,(8,104,'help me','test','',NULL,44.44,NULL,'2015-11-18 18:11:48',NULL,NULL,'2016-12-31 08:00:00',10,'ad') ,(9,104,'raisins','test','',NULL,3.33,NULL,'2015-11-18 18:14:48',NULL,NULL,'2016-12-31 08:00:00',11,'ad') ,(10,104,'mmm','nnn','',NULL,2.22,NULL,'2015-11-18 18:15:31',NULL,NULL,'2016-12-31 08:00:00',12,'ad') ,(11,104,'finallyu','yes','',NULL,1.11,NULL,'2015-11-18 18:36:58',NULL,NULL,'2016-12-31 08:00:00',13,'ad'); /*!40000 ALTER TABLE `promos` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `ratings` WRITE; /*!40000 ALTER TABLE `ratings` DISABLE KEYS */; INSERT INTO `ratings` VALUES (1,106,21,95,'++customer service; --community involvement;','2015-08-09 01:38:54',NULL,NULL) ,(2,107,21,95,'++technical excellence; ','2015-08-09 01:39:44',NULL,NULL) ,(3,108,21,95,'++community involvement; -fair trade;','2015-08-09 01:40:26',NULL,NULL) ,(4,109,21,95,'++social cause','2015-08-09 01:42:51',NULL,NULL),(5,110,21,100,'++social cause;','2015-08-09 01:45:35',NULL,NULL) ,(6,111,21,0,'---social responsibility;','2015-08-09 01:46:25',NULL,NULL) ,(7,112,21,10,'--social responsibility; --climate responsibility;','2015-08-09 01:47:43',NULL,NULL) ,(8,113,21,40,'--dietary health; --environmental impact;','2015-08-09 01:49:43',NULL,NULL) ,(9,114,21,100,'++environmental impact; ++community health','2015-08-09 01:53:23',NULL,NULL) ,(10,115,21,100,'++good school;','2015-11-18 18:50:05',NULL,NULL),(11,116,21,64,'--social responsibility','2015-11-19 04:21:32',NULL,NULL); /*!40000 ALTER TABLE `ratings` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `records` WRITE; /*!40000 ALTER TABLE `records` DISABLE KEYS */; INSERT INTO `records` VALUES (30,'np',92,21,93,21,1000.00,'first budget','2015-01-05 19:53:32',NULL,0,7,0,0,0,'0',0) ,(31,'pp',93,21,94,21,35.87,'wages','2015-01-05 19:53:32',NULL,0,7,0,0,0,'0',0) ,(32,'pn',94,21,92,21,2.05,'disounted employee purchase','2015-01-05 19:53:32','2015-11-19 07:15:05',0,7,0,0,0,'0',0) ,(33,'np',95,22,96,22,1000.00,'first budget','2015-01-05 19:53:33',NULL,0,7,0,0,0,'0',0) ,(34,'pn',96,22,92,21,9.37,'first external budget use','2015-01-05 19:53:33','2015-11-19 07:15:41',0,7,0,0,0,'0',0) ,(35,'pn',94,21,92,21,2.05,'disounted employee purchase','2015-01-06 03:13:00','2015-11-19 07:14:04',0,7,0,0,0,'0',0) ,(36,'pn',94,21,92,21,2.05,'disounted employee purchase','2015-01-06 03:29:57','2015-11-18 06:07:35',0,7,0,0,0,'0',0) ,(37,'pp',93,21,94,21,55.55,'test','2015-11-18 06:21:49','2015-11-18 06:21:49',NULL,7,0,0,0,'0',0) ,(38,'np',92,21,93,21,100.11,'test','2015-11-18 06:24:12','2015-11-18 06:24:12',NULL,7,0,0,0,'0',0) ,(39,'pn',93,21,92,21,9.99,'test','2015-11-18 06:28:26','2015-11-18 06:28:39',NULL,7,0,0,0,'0',0) ,(40,'pn',93,21,92,21,25.00,'for ad-1','2015-11-18 15:21:15','2015-11-19 07:10:25',NULL,7,0,1,1,'0',0) ,(41,'np',92,21,93,21,400.00,'test','2015-11-18 19:00:51','2015-11-18 19:00:51',NULL,7,0,0,0,'0',0) ,(42,'pp',93,21,94,21,100.00,'test','2015-11-19 04:21:56','2015-11-19 04:21:56',NULL,7,0,0,0,'0',0) ,(43,'pp',93,21,94,21,10.11,'test','2015-11-19 04:28:08','2015-11-19 04:28:08',NULL,7,0,0,0,'0',0) ,(44,'pp',93,21,94,21,3.33,'test','2015-11-19 04:29:32','2015-11-19 04:29:32',NULL,7,0,0,0,'0',0) ,(45,'pp',93,21,94,21,1.11,'test','2015-11-19 04:36:54','2015-11-19 04:36:54',NULL,7,0,0,0,'0',0) ,(46,'pp',93,21,94,21,2.22,'test','2015-11-19 04:38:24','2015-11-19 04:38:24',NULL,7,0,0,0,'0',0) ,(47,'pp',93,21,94,21,4.32,'test','2015-11-19 04:43:12','2015-11-19 04:43:12',NULL,7,0,0,0,'0',0) ,(48,'pn',94,21,92,21,12.00,'test','2015-11-19 04:43:58','2015-11-19 04:44:13',NULL,7,0,0,0,'0',0) ,(49,'pn',93,21,92,21,2.92,'test','2015-11-19 06:55:26','2015-11-19 06:56:06',NULL,7,0,0,0,'0',0) ,(50,'pn',94,21,92,21,2.22,'','2015-11-19 07:58:48','2015-11-19 07:59:12',NULL,7,0,0,0,'0',0) ,(51,'pn',93,21,92,21,2.34,'test','2015-11-19 08:00:56','2015-11-19 08:01:38',NULL,7,0,0,0,'0',0) ,(52,'pn',94,21,92,21,8.88,'test','2015-11-19 08:07:35','2015-11-19 08:07:52',NULL,7,0,0,0,'0',0) ,(53,'pp',93,21,94,21,5.55,'test','2015-11-21 06:16:55','2015-11-21 06:16:55',NULL,7,0,0,0,'0',0) ,(54,'pn',94,21,92,21,1.11,'test','2015-11-21 06:17:30','2015-11-21 06:36:01',NULL,7,0,0,0,'0',0) ,(55,'pn',94,21,92,21,1.11,'test','2015-11-21 06:20:57','2015-11-21 06:23:24',NULL,7,0,0,0,'0',0) ,(56,'pn',94,21,92,21,3.33,'test','2015-11-21 06:37:23','2015-11-21 06:37:35',NULL,7,0,0,0,'0',0) ,(57,'pn',94,21,92,21,2.22,'','2015-11-21 06:44:29','2015-11-21 15:08:59',NULL,7,0,0,0,'0',0) ,(58,'pn',93,21,92,21,7.77,'','2015-11-21 14:58:30','2015-11-21 15:23:13',NULL,7,0,0,0,'0',0) ,(59,'pn',93,21,92,21,6.66,'','2015-11-21 15:26:06','2015-11-21 15:26:21',NULL,7,0,0,0,'0',0) ,(60,'pn',93,21,92,21,4.56,'','2015-11-21 15:27:59','2015-11-21 15:30:40',NULL,7,0,0,0,'0',0) ,(61,'pn',93,21,92,21,0.99,'','2015-11-21 17:26:29','2015-11-21 17:27:23',NULL,7,0,0,0,'0',0) ,(62,'pn',94,21,92,21,-3.33,'','2015-11-21 17:48:37','2015-11-21 17:49:01',NULL,7,0,0,0,'0',0) ,(63,'pn',94,21,92,21,-2.05,'','2015-11-21 17:57:47','2015-11-21 17:58:16',NULL,7,0,0,0,'0',0) ,(64,'pn',94,21,92,21,-1.11,'','2015-11-21 22:10:38','2015-11-21 22:21:47',NULL,7,0,0,0,'0',0); /*!40000 ALTER TABLE `records` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `relays` WRITE; /*!40000 ALTER TABLE `relays` DISABLE KEYS */; INSERT INTO `relays` VALUES (1,41,NULL,0.01,100.00,NULL,'test','2015-01-01 00:00:00',NULL,NULL,'pn',25,5,25,24) ,(2,41,NULL,5.00,10.00,NULL,'test','2015-01-01 00:00:00',NULL,NULL,'pn',25,5,25,0) ,(3,44,'xyz',0.01,50.00,NULL,'test-brand-105','2015-01-01 00:00:00',NULL,NULL,'pn',25,5,25,0) ,(4,44,'qrs',0.01,100.00,NULL,'test','2015-01-01 00:00:00',NULL,NULL,'pn',25,5,0,24) ,(5,41,'7d02',57.57,57.57,NULL,NULL,'2015-11-18 00:15:57',NULL,NULL,'pn',25,5,2,24) ,(6,41,'eb7b',57.69,57.69,NULL,NULL,'2015-11-18 00:16:09',NULL,NULL,'pn',25,5,2,24) ,(7,41,'d85b',57.71,57.71,NULL,NULL,'2015-11-18 00:16:12',NULL,NULL,'pn',25,5,2,24) ,(8,41,'77aa',57.71,57.71,NULL,NULL,'2015-11-18 00:16:12',NULL,NULL,'pn',25,5,2,24) ,(9,41,'3675',7.77,7.77,NULL,NULL,'2015-11-18 18:05:36',NULL,NULL,'pn',25,5,2,24) ,(10,41,'16085',44.44,44.44,NULL,NULL,'2015-11-18 18:11:48',NULL,NULL,'pn',25,5,2,24) ,(11,41,'b537',3.33,3.33,NULL,NULL,'2015-11-18 18:14:48',NULL,NULL,'pn',25,5,2,24) ,(12,41,'10023',2.22,2.22,NULL,NULL,'2015-11-18 18:15:31',NULL,NULL,'pn',25,5,2,24) ,(13,41,'7936',1.11,1.11,NULL,NULL,'2015-11-18 18:36:58',NULL,NULL,'pn',25,5,2,24); /*!40000 ALTER TABLE `relays` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `reversals` WRITE; /*!40000 ALTER TABLE `reversals` DISABLE KEYS */; INSERT INTO `reversals` VALUES (56,62,0.00,NULL,'pn','2015-11-21 17:48:37',NULL) ,(32,63,0.00,NULL,'pn','2015-11-21 17:57:47',NULL) ,(55,64,0.00,NULL,'pn','2015-11-21 22:10:38',NULL); /*!40000 ALTER TABLE `reversals` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `tallies` WRITE; /*!40000 ALTER TABLE `tallies` DISABLE KEYS */; /*!40000 ALTER TABLE `tallies` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `throttles` WRITE; /*!40000 ALTER TABLE `throttles` DISABLE KEYS */; INSERT INTO `throttles` VALUES (1,104,172800,100,20,2,'2015-02-24 10:48:00',NULL,NULL,NULL) ,(2,104,3600,10,2,1,'2015-02-24 10:48:00',NULL,NULL,NULL) ,(3,104,9999999,100,20,2,'2015-02-24 10:48:00',NULL,NULL,NULL) ,(4,104,360000,11,5,1,'2015-11-18 05:16:54',NULL,NULL,NULL); /*!40000 ALTER TABLE `throttles` ENABLE KEYS */; UNLOCK TABLES; LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES (21,'user21@email.org','User One','$2y$10$6AtN5uH28i6jwugnPLf3DOv1H9HzSruikFEfssr2ls0kESJLtZ1zS','2015-01-05 19:53:31',NULL,NULL,'gp',NULL,'105726759246117896959',NULL,2,NULL,NULL,NULL,NULL,NULL) ,(22,'user22@email.org','User Two','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.','2015-01-05 19:53:33',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL) ,(23,'user23@email.org','User Three','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.','2015-01-05 19:53:33',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL) ,(24,'user24@email.org','User Four','$2y$10$fsqU/JRVmc3fXxVA3pclsO9/jyXur2RDIIlIq/5KXy1PVbsc39cc.','2015-01-05 19:53:33',NULL,NULL,NULL,NULL,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES;
CREATE DEFINER=`administrator`@`localhost` PROCEDURE `selectBusinessHours`(IN BID int) BEGIN SELECT bh.weekday, bh.open_time, bh.closing_time FROM business_hours bh WHERE business_id = BID; END
CREATE TABLE `sensors` ( `id` varchar(36) NOT NULL, `shipment_id` varchar(36) NOT NULL, `sensor_type` varchar(50) NOT NULL, `sensor_limit_option_id` varchar(36) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
alter table user auto_increment=1; alter table product auto_increment=1; alter table location auto_increment=1;
SELECT --identifier --identifier - id ENTIDAD.NIT_ENTI AS id, --identifier - legalName ENTIDAD.NOMB_ENTI AS legalName, --name ENTIDAD.NOMB_ENTI AS name, --address - streetAddress ENTIDAD.DIRE_ENTI AS streetAddress, --address - locality GEO.DESCRIPCION AS locality, --address - region GEO_TWO.DESCRIPCION AS region, --address - countryName 'Colombia' AS countryName FROM TPOR_ENTI ENTIDAD LEFT JOIN T_PTC_UBICACIONES_GEO GEO ON ENTIDAD.UBICACION_GEO = GEO.IDENTIFICADOR LEFT JOIN T_PTC_UBICACIONES_GEO GEO_TWO ON GEO.IDENTIFICADOR_PADRE = GEO_TWO.IDENTIFICADOR ;
---------------------------------------------------------------------------------------- -- -- File name: tsh.sql | cs_sqlstat_hist_top_report.sql -- -- Purpose: SQL Statistics History (AWR) - Top SQL Report -- -- Author: Carlos Sierra -- -- Version: 2020/12/16 -- -- Usage: Execute connected to CDB or PDB. -- -- Enter optional parameters when requested. -- -- Example: $ sqlplus / as sysdba -- SQL> @cs_sqlstat_hist_top_report.sql -- -- Notes: *** Requires Oracle Diagnostics Pack License *** -- -- Developed and tested on 12.1.0.2. -- --------------------------------------------------------------------------------------- -- @@cs_internal/cs_primary.sql @@cs_internal/cs_cdb_warn.sql @@cs_internal/cs_set.sql @@cs_internal/cs_def.sql @@cs_internal/cs_file_prefix.sql -- DEF cs_script_name = 'cs_sqlstat_hist_top_report'; DEF cs_script_acronym = 'tsh.sql | '; -- DEF def_top = '10'; DEF skip_module = ''; DEF skip_parsing_schema_name = ''; -- SELECT '&&cs_file_prefix._&&cs_script_name.' cs_file_name FROM DUAL; -- DEF cs_hours_range_default = '24'; @@cs_internal/cs_sample_time_from_and_to.sql @@cs_internal/cs_snap_id_from_and_to.sql -- @@cs_internal/&&cs_script_name._param.sql -- --ALTER SESSION SET container = CDB$ROOT; -- @@cs_internal/cs_spool_head.sql PRO SQL> @&&cs_script_name..sql "&&cs_sample_time_from." "&&cs_sample_time_to." "&&top_n." "&&kiev_tx." "&&sql_text_piece." "&&sql_id." "&&cs2_parsing_schema_name." @@cs_internal/cs_spool_id.sql -- @@cs_internal/cs_spool_id_sample_time.sql -- PRO TOP_N : "&&top_n." [{&&def_top.}|1-100] PRO SQL_TYPE : "&&kiev_tx." [{*}|TP|RO|BG|IG|UN|TP,RO|TP,RO,BG] PRO SQL_TEXT_LIKE: "%&&sql_text_piece.%" PRO SQL_ID : "&&sql_id." PRO PARSE_SCHEMA : "%&&cs2_parsing_schema_name.%" [{*}|&&def_parsing_schema_name.] -- @@cs_internal/cs_sqlstat_top_report_col.sql @@cs_internal/cs_sqlstat_top_report_db_latency.sql @@cs_internal/cs_sqlstat_top_report_cpu_latency.sql @@cs_internal/cs_sqlstat_top_report_db_load.sql @@cs_internal/cs_sqlstat_top_report_cpu_load.sql @@cs_internal/cs_sqlstat_top_report_gets.sql @@cs_internal/cs_sqlstat_top_report_reads.sql @@cs_internal/cs_sqlstat_top_report_executions.sql @@cs_internal/cs_sqlstat_top_report_parses.sql @@cs_internal/cs_sqlstat_top_report_sharable_memory.sql @@cs_internal/cs_sqlstat_top_report_version_count.sql -- PRO PRO SQL> @&&cs_script_name..sql "&&cs_sample_time_from." "&&cs_sample_time_to." "&&top_n." "&&kiev_tx." "&&sql_text_piece." "&&sql_id." "&&cs2_parsing_schema_name." -- @@cs_internal/cs_spool_tail.sql -- --ALTER SESSION SET CONTAINER = &&cs_con_name.; -- @@cs_internal/cs_undef.sql @@cs_internal/cs_reset.sql --
--1A use sakila: Select first_name, last_name FROM actor; --1B use sakila; Select UPPER(CONCAT(first_name, ' ',last_name)) AS 'Actor Name' from actor; --2A use sakila; Select actor_id, first_name, last_name from actor where first_name = 'JOE'; --2B use sakila; Select first_name, last_name from actor where last_name like '%GEN%'; --2C use sakila; select last_name, first_name from actor where last_name like '%LI%' order by last_name, first_name; --2D use sakila; select country_id, country from country where country in ('Afghanistan', 'Bangladesh', 'China'); --3A ALTER TABLE actor ADD description BLOB; --3B ALTER TABLE actor DROP COLUMN description; --4A SELECT last_name, COUNT(*) FROM actor --4B SELECT last_name, COUNT(*) FROM actor GROUP BY last_name HAVING COUNT(*) > 1; --4C UPDATE actor SET first_name = 'HARPO' WHERE first_name = 'GROUCHO' AND last_name = 'WILLIAMS'; --4D UPDATE actor SET first_name = 'GROUCHO' WHERE first_name = 'HARPO'; --5A SHOW CREATE TABLE address; --6A SELECT staff.last_name, staff.first_name, address.address FROM staff INNER JOIN address ON staff.address_id = address.address_id; --6B SELECT staff.last_name, staff.first_name, sum(payment.amount) FROM staff INNER JOIN payment on staff.staff_id = payment.staff_id GROUP BY staff.last_name, staff.first_name; --6C SELECT f.title, count(a.actor_id) as 'actor count' FROM film f INNER JOIN film_actor a ON f.film_id = a.film_id GROUP BY f.title; --6D SELECT f.title, count(i.inventory_id) as 'inventory count' FROM film f INNER JOIN inventory i ON f.film_id = i.film_id GROUP BY f.title; --6E SELECT c.first_name, c.last_name, sum(p.amount) as 'Total Amount Paid' FROM customer c INNER JOIN payment p ON c.customer_id = p.customer_id GROUP BY c.last_name, c.first_name; --7A SELECT title FROM film WHERE film_id in (select film_id from language where language_id = 1) and title like 'K%' OR title like 'Q%'; --7B SELECT first_name, last_name FROM actor WHERE actor_id IN (Select actor_id from film_actor where film_id in (Select film_id from film where title = 'Alone Trip')); --7C SELECT cu.first_name, cu.last_name, cu.email FROM customer cu INNER JOIN address a on a.address_id = cu.address_id INNER JOIN city ci on ci.city_id = a.city_id INNER JOIN country co on co.country_id = ci.country_id WHERE co.country = 'Canada'; --7D Select title FROM ((film f INNER JOIN film_category fc ON fc.film_id = f.film_id) INNER JOIN category cat ON cat.category_id = fc.category_id) WHERE cat.name = 'Family'; --7E Select f.title, count(r.inventory_id) as 'Rental count' from film f INNER JOIN inventory i ON f.film_id = i.film_id INNER JOIN rental r ON i.inventory_id = r.inventory_id GROUP BY f.title ORDER BY count(r.inventory_id) DESC limit 5; --7F select store_id, sum(p.amount) AS 'Total Revenue' from inventory i INNER JOIN rental r on r.inventory_id = i.inventory_id INNER JOIN payment p on p.rental_id = r.rental_id GROUP BY store_id; --7G Select s.store_id, ci.city, co.country from store s INNER JOIN address a on s.address_id = a.address_id INNER JOIN city ci on ci.city_id = a.city_id INNER JOIN country co on co.country_id = ci.country_id; --7H Select ca.name, sum(p.amount) AS 'Total Genre Revenue' from category ca INNER JOIN film_category fc on fc.category_id = ca.category_id INNER JOIN inventory i on i.film_id = fc.film_id INNER JOIN rental r on r.inventory_id = i.inventory_id INNER JOIN payment p on p.rental_id = r.rental_id GROUP BY ca.name ORDER BY sum(p.amount) DESC LIMIT 5; --8A CREATE VIEW top5genre AS Select ca.name, sum(p.amount) AS 'Total Genre Revenue' from category ca INNER JOIN film_category fc on fc.category_id = ca.category_id INNER JOIN inventory i on i.film_id = fc.film_id INNER JOIN rental r on r.inventory_id = i.inventory_id INNER JOIN payment p on p.rental_id = r.rental_id GROUP BY ca.name ORDER BY sum(p.amount) DESC LIMIT 5; --8B select * from top5genre; --8C DROP VIEW top5genre; --Part 2 CREATE DEFINER=`root`@`localhost` PROCEDURE `enroll_student`( StudentID_in varchar(45), CourseCode_in varchar(45), Section_in varchar(45), EndDate_in date ) BEGIN UPDATE classparticipant cp INNER JOIN class c on c.ID_Class = cp.ID_Class INNER JOIN course co on c.ID_Course = co.ID_Course SET cp.EndDate = EndDate_in WHERE cp.ID_Student = tudentID_in AND co.CourseCode = CourseCode_in AND c.Section = Section_in END
CREATE TABLE transactions ( guid character varying(36) NOT NULL, date bigint, value real, kind character varying(256), deleted boolean DEFAULT false, user_id serial NOT NULL, CONSTRAINT transactions_guid_primary_key PRIMARY KEY (guid), CONSTRAINT "transactions-to-user_foreign-key" FOREIGN KEY (user_id) REFERENCES users (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE RESTRICT ); -- Default data INSERT INTO transactions VALUES ('3F2504E0-4F89-41D3-9A0C-0305E82C3301', 1439291119937, 16004, 'incoming payment', false, 1); INSERT INTO transactions VALUES ('3F2504E0-4F89-41D3-9A0B-0305E82C3301', 1439291119937, -500, 'transaction fee', false, 1); INSERT INTO transactions VALUES ('3F2504E0-4F89-41D3-9A0D-0305E82C3301', 1439291119937, 1500, 'incoming payment', false, 1); INSERT INTO transactions VALUES ('3F2504E0-4F89-41D3-9A0A-0305E82C3301', 1439291119937, 12300, 'incoming payment', false, 1);
-- MySQL dump 10.16 Distrib 10.1.40-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: login -- ------------------------------------------------------ -- Server version 10.1.40-MariaDB /*!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 `persons` -- DROP TABLE IF EXISTS `persons`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `persons` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user_name', `pwd` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'password', `email` varchar(200) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'email', `gender` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'OHO', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `persons` -- LOCK TABLES `persons` WRITE; /*!40000 ALTER TABLE `persons` DISABLE KEYS */; INSERT INTO `persons` VALUES (1,'Vasya','21341234qwefsdf','mmm@mmail.com','m'),(2,'Alex','21341234','mmm@mail.com','m'),(3,'Alexey','qq21341234Q','alexey@gmail.com','m'),(4,'Helen','MarryMeeee','hell@gmail.com','f'),(5,'Jenny','SmakeMyB','eachup@gmail.com','f'),(6,'Lora','burn23','tpiks@gmail.com','f'); /*!40000 ALTER TABLE `persons` 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 2019-07-22 19:50:34
create procedure sp_get_comversion as select componentname,version from comversion order by componentname
with last_date as ( select dup_repo_id as repo_id, max(updated_at) as dt from gha_forkees where updated_at < '{{to}}' and updated_at >= '{{to}}'::timestamp - '6 months'::interval and dup_repo_name like '%_/_%' and dup_repo_name not like '%/%/%' and watchers > 0 and forks > 0 and open_issues > 0 group by repo_id ), last_event as ( select ld.repo_id, ld.dt, max(f.event_id) as event_id from gha_forkees f, last_date ld where ld.repo_id = f.dup_repo_id and ld.dt = f.updated_at and watchers > 0 and forks > 0 and open_issues > 0 group by ld.dt, ld.repo_id ) select 'watch;' || r.alias || ';watch,forks,opiss' as name, sum(f.watchers) as watchers, sum(f.forks) as forks, sum(f.open_issues) as open_issues from gha_forkees f, gha_repos r, last_event le where r.alias is not null and r.id = le.repo_id and r.id = f.dup_repo_id and r.name = f.dup_repo_name and le.repo_id = f.dup_repo_id and le.event_id = f.event_id and le.dt = f.updated_at group by r.alias union select 'allwatch;all;watch,forks,opiss' as name, sum(f.watchers) as watchers, sum(f.forks) as forks, sum(f.open_issues) as open_issues from gha_forkees f, gha_repos r, last_event le where r.id = le.repo_id and r.alias is not null and r.id = f.dup_repo_id and r.name = f.dup_repo_name and le.repo_id = f.dup_repo_id and le.event_id = f.event_id and le.dt = f.updated_at order by watchers desc, forks desc, open_issues desc, name asc ;
ALTER TABLE `{$prefix}badge` CHANGE app appId varbinary(31) NOT NULL FIRST, ADD COLUMN communityId varbinary(31) NULL DEFAULT NULL AFTER appId, CHANGE title title varchar(255) NOT NULL, ADD COLUMN description TEXT AFTER title, DROP COLUMN pic_big, DROP COLUMN pic_small, ADD COLUMN icon varbinary(255) NULL DEFAULT NULL AFTER name; ALTER TABLE `{$prefix}earned` CHANGE app appId varbinary(31) NOT NULL FIRST, CHANGE userId userId varchar(31) NOT NULL , CHANGE badge_name badgeName varchar(255) NOT NULL, ADD COLUMN communityId varbinary(31) NULL DEFAULT NULL AFTER appId, CHANGE insertedTime earnedTime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER communityId, DROP COLUMN associated_id, ADD COLUMN publisherId varbinary(31) NULL DEFAULT NULL AFTER badgeName, ADD COLUMN streamName varbinary(255) NULL DEFAULT NULL AFTER publisherId, DROP INDEX userId, ADD INDEX byTime (appId, communityId, earnedTime), ADD INDEX byUser (appId, communityId, userId);
drop view if exists r_mkordtmpfs cascade ; create or replace view r_mkordtmpfs as select itm.itm_name itm_name , itm.itm_code itm_code , itm.unit_name unit_name , itm.unit_code unit_code , loca.loca_code loca_code , loca.loca_name loca_name , itm.itm_unit_id itm_unit_id , mkordtmpf.id id, prjno.prjno_name prjno_name , person_upd.person_code person_code_upd , person_upd.person_name person_name_upd , itm_pare.itm_code itm_code_pare , itm_pare.itm_name itm_name_pare , itm_pare.unit_code unit_code_pare , itm_pare.unit_name unit_name_pare , mkord.mkord_message_code mkord_message_code , prjno.prjno_code prjno_code , mkord.mkord_itm_code_trn mkord_itm_code_trn , itm.classlist_code classlist_code , itm.classlist_name classlist_name , mkord.mkord_itm_code_org mkord_itm_code_org , mkord.mkord_itm_name_org mkord_itm_name_org , mkord.mkord_itm_name_trn mkord_itm_name_trn , mkord.mkord_person_code_chrg_trn mkord_person_code_chrg_trn , mkord.mkord_person_name_chrg_trn mkord_person_name_chrg_trn , mkord.mkord_loca_code_pare mkord_loca_code_pare , mkord.mkord_loca_code_trn mkord_loca_code_trn , mkord.mkord_loca_name_trn mkord_loca_name_trn , mkord.mkord_loca_name_pare mkord_loca_name_pare , mkord.mkord_itm_code_pare mkord_itm_code_pare , mkord.mkord_itm_name_pare mkord_itm_name_pare , prjno.prjno_code_chil prjno_code_chil , mkord.mkord_loca_name_org mkord_loca_name_org , mkord.mkord_loca_name_to_trn mkord_loca_name_to_trn , itm.itm_classlist_id itm_classlist_id , itm_pare.itm_classlist_id itm_classlist_id_pare , itm_pare.classlist_name classlist_name_pare , itm_pare.classlist_code classlist_code_pare , shelfno_to.shelfno_code shelfno_code_to , shelfno_to.shelfno_name shelfno_name_to , shelfno_to.loca_code_shelfno loca_code_shelfno_to , shelfno_to.loca_name_shelfno loca_name_shelfno_to , shelfno_to.shelfno_loca_id_shelfno shelfno_loca_id_shelfno_to , prjno.prjno_name_chil prjno_name_chil , mkord.mkord_person_code_chrg_org mkord_person_code_chrg_org , mkord.mkord_person_code_chrg_pare mkord_person_code_chrg_pare , mkord.mkord_person_name_chrg_org mkord_person_name_chrg_org , mkord.mkord_person_name_chrg_pare mkord_person_name_chrg_pare , mkordtmpf.qty_sch mkordtmpf_qty_sch, mkordtmpf.mkords_id mkordtmpf_mkord_id, mkordtmpf.qty_require mkordtmpf_qty_require, mkordtmpf.remark mkordtmpf_remark, mkordtmpf.expiredate mkordtmpf_expiredate, mkordtmpf.update_ip mkordtmpf_update_ip, mkordtmpf.created_at mkordtmpf_created_at, mkordtmpf.updated_at mkordtmpf_updated_at, mkordtmpf.persons_id_upd mkordtmpf_person_id_upd, mkordtmpf.itms_id mkordtmpf_itm_id, mkordtmpf.qty mkordtmpf_qty, mkordtmpf.duedate mkordtmpf_duedate, mkordtmpf.toduedate mkordtmpf_toduedate, mkordtmpf.packqty mkordtmpf_packqty, mkordtmpf.contents mkordtmpf_contents, mkordtmpf.locas_id mkordtmpf_loca_id, mkordtmpf.processseq mkordtmpf_processseq, mkordtmpf.prjnos_id mkordtmpf_prjno_id, mkordtmpf.parenum mkordtmpf_parenum, mkordtmpf.chilnum mkordtmpf_chilnum, mkordtmpf.itms_id_pare mkordtmpf_itm_id_pare, mkordtmpf.processseq_pare mkordtmpf_processseq_pare, mkordtmpf.mlevel mkordtmpf_mlevel, mkordtmpf.qty_stk mkordtmpf_qty_stk, mkordtmpf.qty_handover mkordtmpf_qty_handover, mkordtmpf.shelfnos_id_to mkordtmpf_shelfno_id_to, mkordtmpf.tblname mkordtmpf_tblname, mkordtmpf.tblid mkordtmpf_tblid, mkordtmpf.incnt mkordtmpf_incnt, mkordtmpf.consumminqty mkordtmpf_consumminqty, mkordtmpf.consumchgoverqty mkordtmpf_consumchgoverqty, mkordtmpf.consumunitqty mkordtmpf_consumunitqty from mkordtmpfs mkordtmpf, r_mkords mkord , r_persons person_upd , r_itms itm , r_locas loca , r_prjnos prjno , r_itms itm_pare , r_shelfnos shelfno_to where mkordtmpf.mkords_id = mkord.id and mkordtmpf.persons_id_upd = person_upd.id and mkordtmpf.itms_id = itm.id and mkordtmpf.locas_id = loca.id and mkordtmpf.prjnos_id = prjno.id and mkordtmpf.itms_id_pare = itm_pare.id and mkordtmpf.shelfnos_id_to = shelfno_to.id ; DROP TABLE IF EXISTS sio.sio_r_mkordtmpfs; CREATE TABLE sio.sio_r_mkordtmpfs ( sio_id numeric(22,0) CONSTRAINT SIO_r_mkordtmpfs_id_pk PRIMARY KEY ,sio_user_code numeric(22,0) ,sio_Term_id varchar(30) ,sio_session_id numeric(22,0) ,sio_Command_Response char(1) ,sio_session_counter numeric(22,0) ,sio_classname varchar(50) ,sio_viewname varchar(30) ,sio_code varchar(30) ,sio_strsql varchar(4000) ,sio_totalcount numeric(22,0) ,sio_recordcount numeric(22,0) ,sio_start_record numeric(22,0) ,sio_end_record numeric(22,0) ,sio_sord varchar(256) ,sio_search varchar(10) ,sio_sidx varchar(256) ,prjno_code varchar (50) ,loca_code varchar (50) ,classlist_code varchar (50) ,classlist_name varchar (100) ,itm_name varchar (100) ,unit_name varchar (100) ,unit_code varchar (50) ,itm_code_pare varchar (50) ,classlist_name_pare varchar (100) ,mkord_message_code varchar (256) ,itm_name_pare varchar (100) ,itm_code varchar (50) ,prjno_name varchar (100) ,loca_name varchar (100) ,mkord_loca_code_trn varchar (50) ,mkord_person_code_chrg_pare varchar (50) ,mkord_itm_code_pare varchar (50) ,prjno_code_chil varchar (50) ,mkord_person_code_chrg_org varchar (50) ,classlist_code_pare varchar (50) ,loca_code_shelfno_to varchar (50) ,shelfno_code_to varchar (50) ,unit_code_pare varchar (50) ,mkord_itm_code_trn varchar (50) ,mkord_itm_code_org varchar (50) ,mkord_person_code_chrg_trn varchar (50) ,mkord_loca_code_pare varchar (50) ,mkord_itm_name_pare varchar (100) ,unit_name_pare varchar (100) ,mkord_itm_name_org varchar (100) ,mkord_itm_name_trn varchar (100) ,mkord_person_name_chrg_trn varchar (100) ,mkord_loca_name_trn varchar (100) ,mkord_loca_name_pare varchar (100) ,mkord_loca_name_org varchar (100) ,mkord_loca_name_to_trn varchar (100) ,shelfno_name_to varchar (100) ,loca_name_shelfno_to varchar (100) ,prjno_name_chil varchar (100) ,mkord_person_name_chrg_org varchar (100) ,mkord_person_name_chrg_pare varchar (100) ,mkordtmpf_incnt numeric (38,0) ,mkordtmpf_itm_id_pare numeric (38,0) ,mkordtmpf_processseq_pare numeric (38,0) ,mkordtmpf_mlevel numeric (3,0) ,mkordtmpf_qty_stk numeric (22,6) ,mkordtmpf_qty_handover numeric (22,6) ,mkordtmpf_shelfno_id_to numeric (38,0) ,mkordtmpf_tblname varchar (30) ,mkordtmpf_tblid numeric (38,0) ,mkordtmpf_consumminqty numeric (22,6) ,mkordtmpf_consumchgoverqty numeric (22,6) ,mkordtmpf_consumunitqty numeric (22,6) ,mkordtmpf_qty_sch numeric (22,6) ,mkordtmpf_mkord_id numeric (22,0) ,mkordtmpf_qty_require numeric (22,6) ,mkordtmpf_remark varchar (4000) ,mkordtmpf_expiredate date ,mkordtmpf_update_ip varchar (40) ,mkordtmpf_created_at timestamp(6) ,mkordtmpf_updated_at timestamp(6) ,mkordtmpf_itm_id numeric (38,0) ,mkordtmpf_qty numeric (22,6) ,mkordtmpf_duedate timestamp(6) ,mkordtmpf_toduedate timestamp(6) ,mkordtmpf_packqty numeric (18,2) ,mkordtmpf_contents varchar (4000) ,mkordtmpf_loca_id numeric (38,0) ,mkordtmpf_processseq numeric (38,0) ,mkordtmpf_prjno_id numeric (38,0) ,mkordtmpf_parenum numeric (22,6) ,mkordtmpf_chilnum numeric (22,6) ,person_name_upd varchar (100) ,person_code_upd varchar (50) ,mkordtmpf_person_id_upd numeric (22,0) ,itm_classlist_id_pare numeric (38,0) ,id numeric (38,0) ,shelfno_loca_id_shelfno_to numeric (38,0) ,itm_classlist_id numeric (38,0) ,itm_unit_id numeric (22,0) ,sio_errline varchar(4000) ,sio_org_tblname varchar(30) ,sio_org_tblid numeric(22,0) ,sio_add_time date ,sio_replay_time date ,sio_result_f char(1) ,sio_message_code char(10) ,sio_message_contents varchar(4000) ,sio_chk_done char(1) ); CREATE INDEX sio_r_mkordtmpfs_uk1 ON sio.sio_r_mkordtmpfs(sio_user_code,sio_session_counter,sio_session_id,sio_Command_Response); drop sequence if exists sio.sio_r_mkordtmpfs_seq ; create sequence sio.sio_r_mkordtmpfs_seq ;
CREATE OR REPLACE TRIGGER MAX_PRESUPUESTO_EQUIPO BEFORE INSERT OR UPDATE ON EQUIPO FOR EACH ROW DECLARE v_max_presupuesto NUMBER(6) := 200000; BEGIN IF(:new.presupuesto >= v_max_presupuesto) THEN raise_application_error(-20002, 'El presupuesto del equipo no puede ser superior a 200k'); END IF; END MAX_PRESUPUESTO_EQUIPO;
-- phpMyAdmin SQL Dump -- version 3.5.7 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Apr 02, 2015 at 09:40 PM -- Server version: 5.1.73 -- PHP Version: 5.3.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 */; -- -- Database: `pos` -- -- -------------------------------------------------------- -- -- Table structure for table `coupon` -- CREATE TABLE IF NOT EXISTS `coupon` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `amount` decimal(9,2) NOT NULL, `taxable` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `deposit` -- CREATE TABLE IF NOT EXISTS `deposit` ( `id` int(11) NOT NULL AUTO_INCREMENT, `payment` int(11) NOT NULL, `datetime` datetime NOT NULL, `amount` decimal(9,2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `payment` -- CREATE TABLE IF NOT EXISTS `payment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `receipt` -- CREATE TABLE IF NOT EXISTS `receipt` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` datetime NOT NULL, `tax` decimal(9,2) NOT NULL, `total` decimal(9,2) NOT NULL, `void` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `receipt_item` -- CREATE TABLE IF NOT EXISTS `receipt_item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `receipt` int(11) NOT NULL, `line` int(11) NOT NULL, `service` int(11) NOT NULL, `inventory` int(11) NOT NULL, `coupon` int(11) NOT NULL, `description` varchar(255) NOT NULL, `taxable` tinyint(1) NOT NULL, `quantity` decimal(9,2) NOT NULL, `total` decimal(9,2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `receipt_payment` -- CREATE TABLE IF NOT EXISTS `receipt_payment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `receipt` int(11) NOT NULL, `payment` int(11) NOT NULL, `amount` decimal(9,2) NOT NULL, `data` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `service` -- CREATE TABLE IF NOT EXISTS `service` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group` int(11) NOT NULL, `name` varchar(255) NOT NULL, `retail` decimal(9,2) NOT NULL, `edit` tinyint(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `service_group` -- CREATE TABLE IF NOT EXISTS `service_group` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!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 */;
CREATE OR REPLACE FUNCTION call_populate_tid_queue RETURN NUMBER AS PRAGMA AUTONOMOUS_TRANSACTION; BEGIN populate_tid_queue(); COMMIT; RETURN 0; END; / SHOW ERRORS
DROP DATABASE IF EXISTS fec_reviews; CREATE DATABASE IF NOT EXISTS fec_reviews; USE fec_reviews; CREATE TABLE IF NOT EXISTS products ( product_id int unsigned NOT NULL, PRIMARY KEY (product_id) ); CREATE TABLE IF NOT EXISTS reviews ( review_id INT unsigned NOT NULL AUTO_INCREMENT, product_id INT unsigned NOT NULL, username VARCHAR(150) NOT NULL, fecha DATE NOT NULL, city_state text NOT NULL, rating INT(5) NOT NULL, title varchar(150) NOT NULL, review_body text NOT NULL, PRIMARY KEY (review_id), FOREIGN KEY (product_id) REFERENCES products(product_id) ); -- CREATE TABLE IF NOT EXISTS images ( -- image_id INT unsigned NOT NULL AUTO_INCREMENT, -- image_url VARCHAR(500) NOT NULL, -- review_id INT unsigned NOT NULL, -- PRIMARY KEY (image_id), -- FOREIGN KEY (review_id) REFERENCES reviews(review_id) -- ); /* Execute this file from the command line by typing: * mysql -u root < database/schema.sql -p * to create the database and the tables.*/
CREATE DATABASE pmf_platform; GRANT ALL PRIVILEGES ON pmf_platform.* TO 'pmf_platform'@'localhost' IDENTIFIED BY 'pmf_platform';
/*Ex3 ./ used for natural join T1: v | w | x | y | z ---+---+---+----+--- 1 | a | x | 15 | e 2 | a | x | 10 | f 2 | b | x | 15 | g 2 | b | y | 15 | h T2: c | d | x | w ---+---+---+--- 4 | p | x | b 5 | t | x | b 6 | p | y | a 7 | a | y | a σ = where Π = select 1. σ Y >12∧V !=2 (T 1 ) v | w | x | y | z ---+---+---+----+--- 1 | a | x | 15 | e */ SELECT * FROM T1 WHERE Y > 12 AND V != 2; /*2. Π X,Y (σ W != b (T 1 )) x | y ---+---- x | 15 x | 10 */ SELECT X, Y FROM T1 WHERE W != 'b'; /*3. σ D=p (Π X,Y (T 1 ) ./ Π X,D (T 2 )) x | y | d ---+----+--- x | 10 | p y | 15 | p x | 15 | p */ SELECT DISTINCT * FROM (SELECT DISTINCT X, Y FROM T1) AS ONE NATURAL JOIN (SELECT DISTINCT X, D FROM T2) AS TWO WHERE D = 'p'; /*4. Π D (σ V =1∧c65 (T 1 × T 2 )) d --- p t */ SELECT D FROM T1 , T2 WHERE V = 1 AND C <= 5; /*5 SEE ABOVE */ /*6 Returns the title of the David Bowie albums which cost less than 7*/ SELECT title FROM Album WHERE artist = 'David Bowie' AND price <= 7; /*7. Returns the customer ID of cutomers that bought an album which cost over 8*/ SELECT Customer.custid FROM Customer NATURAL JOIN Album NATURAL JOIN Sale15 WHERE Album.price >= 8; /*8. See above */ /*9. SELECT rating, customer.custid FROM customer, review WHERE customer.custid = review.custid AND rating = 5; Π rating, customer.custid (σ customer.custid = review.custid ∧ rating = 5 (customer x review)) 10. SELECT album.title FROM album NATURAL JOIN sale15 NATURAL JOIN customer WHERE customer.lname = ’Matlock’; Π album.title (σ customer.lname = ’Matlock’ (album ./ sale15 ./ customer)) 11. SELECT albumid FROM ((SELECT albumid, artist FROM album WHERE artist = ’The Cure’) AS temp1 NATURAL JOIN (SELECT albumid FROM review WHERE rating = 1) AS temp2); Π albumid ( p temp1 (Π albumid, artist(σ artist = ’The Cure’(album))) ./ p temp2 (Π albumid (σ rating = 1 (review))) )
conn *login*/*password*@gas as sysdba; startup; exit;
--INSERTANDO CIUDADES BEGIN PRO_CIUDAD('Patzite','Quiché','Guatemala'); END; SELECT *FROM CIUDAD; COMMIT;
update feature set dataset_id = ( select dataset_id from dataset where feature.feature_uri like dataset.dataset_uri || '%' ) where dataset_id is null
DELETE FROM foo; -- error 42P01: no such table: FOO CREATE TABLE foo (baz CHARACTER VARYING(10)); INSERT INTO foo (baz) VALUES ('hi'); INSERT INTO foo (baz) VALUES ('there'); DELETE FROM foo; DELETE FROM foo; SELECT * FROM foo; -- msg: CREATE TABLE 1 -- msg: INSERT 1 -- msg: INSERT 1 -- msg: DELETE 2 -- msg: DELETE 0 CREATE TABLE foo (baz FLOAT); INSERT INTO foo (baz) VALUES (35); INSERT INTO foo (baz) VALUES (78); DELETE FROM foo WHERE baz = 35; DELETE FROM foo WHERE baz = 35; SELECT * FROM foo; -- msg: CREATE TABLE 1 -- msg: INSERT 1 -- msg: INSERT 1 -- msg: DELETE 1 -- msg: DELETE 0 -- BAZ: 78
/* Navicat MySQL Data Transfer Source Server : 88 Source Server Version : 50045 Source Host : 192.168.1.3:3306 Source Database : web Target Server Type : MYSQL Target Server Version : 50045 File Encoding : 65001 Date: 2012-09-19 16:25:04 */ create database `web` default character set utf8 collate utf8_general_ci; use web; SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `account` -- ---------------------------- DROP TABLE IF EXISTS `account`; CREATE TABLE `account` ( `id` int(11) NOT NULL auto_increment, `name` varchar(32) NOT NULL, `password` char(32) NOT NULL, `question` varchar(64) default NULL, `answer` varchar(64) default NULL, `email` varchar(64) default NULL, `qq` varchar(16) default NULL, `tel` varchar(16) default NULL, `id_type` enum('IdCard') default 'IdCard', `id_card` varchar(32) default NULL, `is_online` tinyint(1) NOT NULL DEFAULT 0, `point` int(11) NOT NULL default '0', PRIMARY KEY (`id`,`name`), UNIQUE KEY `id` USING BTREE (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `pay` -- ---------------------------- DROP TABLE IF EXISTS `pay`; CREATE TABLE `pay` ( `trade_no` varchar(20) NOT NULL, `channel` varchar(10) default NULL, `server_id` int(11) NOT NULL, `account_id` int(11) NOT NULL, `fee` int(11) NOT NULL, `status` tinyint(4) NOT NULL, `create_time` datetime NOT NULL, `pay_time` datetime default NULL, PRIMARY KEY (`trade_no`), KEY `trade_no` (`trade_no`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for `server` -- ---------------------------- DROP TABLE IF EXISTS `server`; CREATE TABLE `server` ( `id` int(11) NOT NULL auto_increment, `name` varchar(32) NOT NULL, `host` char(60) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
DROP DATABASE IF EXISTS players_db; CREATE DATABASE players_db; USE players_db; CREATE TABLE players ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(20), pass CHAR(32), numFlags INT DEFAULT 0, commandId INT );
{% snapshot fct_lineitems_snapshot %} {{ config( target_schema='rpt', strategy='check', unique_key='l_lineitemkey', check_cols=[ 'l_returnflag', 'l_linestatus', 'l_shipdate', 'l_commitdate', 'l_receiptdate', 'l_shipinstruct', 'l_shipmode' ] ) }} select * from {{ ref('fct_lineitems') }} {% endsnapshot %}
SELECT @@SERVERNAME,(SELECT ars.role_desc FROM sys.dm_hadr_availability_replica_states AS ars INNER JOIN sys.availability_groups AS ag ON ars.group_id = ag.group_id WHERE ag.name = '' and ars.is_local = 1) SELECT Total,name FROM ( SELECT COUNT(h.job_ID) as Total,j.name FROM msdb..sysjobhistory h INNER JOIN msdb..sysjobs j ON h.job_id = j.job_id GROUP BY j.name ) x ORDER BY Total DESC
-- Script lists all records of the table -- Score is ordered by highest first -- Script also lists name SELECT score, name FROM second_table ORDER BY score DESC;
SELECT Country, Max(TotalSales) as MaxSales FROM ( SELECT i.BillingCountry as Country, Sum(i.total) as TotalSales FROM Invoice i GROUP BY Country ) -- cool syntax: WITH TotalSales AS ( SELECT SUM(Total) Total, BillingCountry Country FROM Invoice GROUP BY BillingCountry ) SELECT '$' || MAX(Total) "Grand Total", Country FROM TotalSales
# 总结 # 1、distinct 对null有效 # 2、是否为null用is null,而不是=null # 3、这一节开始有null 的出现 # 4、not in 判断是否在集合内,这个集合必须没有null。否者不行。in好像没毛病 # 答案原话-- the query below would FAIL due to the NULL value returned by the subquery # 请看本页4.7例子 # 链接查询比子查询性能好。局说是因为临时表的原因。 # 5、where movies 相当于 where movies is not null;发现新大陆。 use sql_exercise; select * from MovieTheaters; -- 4.1 Select the title of all movies. select Title from Movies; -- 4.2 Show all the distinct ratings in the database. select distinct Rating from Movies;#null也会进行distinct,即只选一个null -- 4.3 Show all unrated movies. select * from Movies where Rating is null;# null 是不能用等号的。用 is null -- 4.4 Select all movie theaters that are not currently showing a movie. select * from MovieTheaters where Movie is null; -- 4.5 Select all data from all movie theaters -- and, additionally, the data from the movie that is being shown in the theater (if one is being shown). #左链接的例子 #答案已经校对,右链接一样的道理 select a.*,b.* from MovieTheaters a left join Movies b on a.Movie = b.Code; -- 4.6 Select all data from all movies and, if that movie is being shown in a theater, show the data from the theater. #答案已经校对,右链接一样的道理 select a.*,b.* from Movies a left join MovieTheaters b on a.Code = b.Movie; -- 4.7 *****Show the titles of movies not currently being shown in any theaters. #答案已经比对。正确。 #子查询 select * from Movies where Code not in (select Movie from MovieTheaters where Movie);#where Movie == where Movie is not null; #子查询要剔除null,否者不行。注意咯******* #join select * from Movies a left join MovieTheaters b on a.Code = b.Movie where b.Movie is null; select * from MovieTheaters a ; -- 4.8 Add the unrated movie "One, Two, Three". insert Movies(Code,Title, rating) values (9,'One,Two,Three',null);#答案做得不对。 -- 4.9 Set the rating of all unrated movies to "G". update Movies set Rating = 'G' where Rating is null; -- 4.10 Remove movie theaters projecting movies rated "NC-17". #子查询 delete from MovieTheaters where Movie in (select Code from Movies where Rating='NC-17'); #表链接 # 这用表链接,还真不咋地,答案没用表链接。
INSERT INTO public.entity_catalog (id, route_id, name) VALUES (1, 12, null);
/* Name: After redirect Data source: 4 Created By: Admin Last Update At: 2016-02-05T13:09:31.992564+00:00 */ SELECT post_prop10, page_url, post_prop72,count(*) as clicks FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME_UTC_USEC("{{enddate}}", "%Y-%m-31")')) WHERE DATE(date_time) >= DATE('{{startdate}}') AND DATE('{{startdate}}') >= DATE('2015-02-01') AND DATE(date_time) <= DATE('{{enddate}}') AND page_url LIKE '%mod=berkshire_hathaway_widget%' AND post_prop10 = 'berkshire_hathaway_widget' AND post_prop72 = '' group by post_prop10, page_url, post_prop72, order by clicks desc
CREATE TABLE IF NOT EXISTS task ( id BIGINT NOT NULL CONSTRAINT henvendelse_pkey PRIMARY KEY, payload TEXT NOT NULL, status VARCHAR DEFAULT 'UBEHANDLET':: CHARACTER VARYING NOT NULL, versjon BIGINT DEFAULT 0, opprettet_tid TIMESTAMP(3) DEFAULT LOCALTIMESTAMP, type VARCHAR NOT NULL, metadata VARCHAR, trigger_tid TIMESTAMP DEFAULT LOCALTIMESTAMP, avvikstype VARCHAR ); CREATE INDEX IF NOT EXISTS henvendelse_status_idx ON task (status); CREATE TABLE IF NOT EXISTS task_logg ( id BIGINT NOT NULL CONSTRAINT henvendelse_logg_pkey PRIMARY KEY, task_id BIGINT NOT NULL CONSTRAINT henvendelse_logg_henvendelse_id_fkey REFERENCES task, type VARCHAR NOT NULL, node VARCHAR NOT NULL, opprettet_tid TIMESTAMP(3) DEFAULT LOCALTIMESTAMP, melding TEXT, endret_av VARCHAR DEFAULT 'VL':: CHARACTER VARYING ); CREATE INDEX IF NOT EXISTS henvendelse_logg_henvendelse_id_idx ON task_logg (task_id); CREATE SEQUENCE IF NOT EXISTS task_seq INCREMENT BY 50; CREATE SEQUENCE IF NOT EXISTS task_logg_seq INCREMENT BY 50;
REM ------------------------------------------------------------------------ REM REQUIREMENTS: REM SELECT on dba_ tables REM ------------------------------------------------------------------------ REM PURPOSE: REM Create script for changing user passwords to default passwords REM ------------------------------------------------------------------------ set verify off set feedback off set echo off set pagesize 0 set termout off spool &2\.sql prompt spool &2\.log prompt SELECT 'alter user ' || username || ' identified by ' || username || ';' FROM dba_users WHERE username &1 ; prompt spool off prompt exit spool off exit
CREATE TABLE pesagens( codigo BIGINT NOT NULL AUTO_INCREMENT, data DATE NOT NULL, peso DECIMAL NOT NULL, observacao VARCHAR(255) NULL, PRIMARY KEY (codigo)) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8
ALTER TABLE PO_PERSON ADD COLUMN MAALFORM VARCHAR(2) DEFAULT 'NB' NOT NULL;
WITH CTE_List_FKEy_Relations AS ( SELECT SP.Name ForeignKeyBaseTableSchema, TP.Name ForeignKeyBaseTable, CP.name ForeignKeyBaseColumn, SC.Name PrimaryBaseTableSchema, TC.Name PrimaryBaseTable, CC.name PrimaryBaseColumn, FK.Name AS ForeignKeyName, FK.[Object_ID] As ForeignKeyObjectID FROM sys.foreign_keys FK INNER JOIN sys.foreign_key_columns FKC on FK.[object_id] = FKC.constraint_object_id INNER JOIN sys.tables TP on FK.parent_object_id = TP.[object_id] INNER JOIN sys.tables TC on FK.referenced_object_id = TC.[object_id] INNER JOIN sys.schemas SP on TP.[schema_id] = SP.[schema_id] INNER JOIN sys.schemas SC on TC.[schema_id] = SC.[schema_id] INNER JOIN sys.columns CP on TP.[object_id] = CP.[object_id] AND CP.[column_id] = FKC.parent_column_id INNER JOIN sys.columns CC on TC.[object_id] = CC.[object_id] AND CC.[column_id] = FKC.referenced_column_id ), CTE_List_PKeys AS ( SELECT i.name AS IndexName, OBJECT_NAME(ic.OBJECT_ID) AS TableName, COL_NAME(ic.OBJECT_ID,ic.column_id) AS ColumnName FROM sys.indexes AS i INNER JOIN sys.index_columns AS ic ON i.OBJECT_ID = ic.OBJECT_ID AND i.index_id = ic.index_id WHERE i.is_primary_key = 1 ) SELECT CLFR.ForeignKeyBaseTableSchema, CLFR.ForeignKeyBaseTable, CLFR.ForeignKeyBaseColumn, CLP.ColumnName ForeignBasePrimaryKey, CLFR.PrimaryBaseTableSchema, CLFR.PrimaryBaseTable, CLFR.PrimaryBaseColumn, CLP2.ColumnName PrimaryBasePrimaryKey, CLFR.ForeignKeyName FROM CTE_List_FKEy_Relations CLFR LEFT OUTER JOIN CTE_List_PKeys CLP on CLFR.ForeignKeyBaseTable = CLP.TableName LEFT OUTER JOIN CTE_List_PKeys CLP2 on CLFR.PrimaryBaseTable = CLP2.TableName ORDER BY ForeignKeyBaseTable ASC
SELECT * from billboard_data; CREATE TABLE song AS ( SELECT DISTINCT song, artist FROM billboard_data); ALTER TABLE song ADD song_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT; CREATE TABLE album AS ( SELECT Album_1 AS album_name, album_id FROM billboard_data WHERE album_id IS NOT NULL) ; ALTER TABLE album ADD PRIMARY KEY (album_id); ALTER TABLE billboard_data DROP COLUMN album_id; ALTER TABLE billboard_data DROP COLUMN Album_1; CREATE TABLE song_album AS ( SELECT x.song_id, a.album_id FROM ( SELECT b.*, s.song_id FROM billboard_data AS b join song AS s ON b.song=s.song AND b.artist=s.artist) x JOIN album AS a ON x.Album = a.album_name); drop table new_song; CREATE TABLE new_song AS ( SELECT s.song_id, b.rank, b.song, b.artist, b.`year`, b.lyrics FROM billboard_data AS b INNER JOIN song AS s ON b.song=s.song AND b.artist=s.artist); SELECT * FROM song AS s INNER JOIN new_song as n ON s.song_id = n.song_id; ALTER TABLE song RENAME old_song; ALTER TABLE new_song RENAME song; SELECT * FROM album AS a INNER JOIN reviews AS r ON a.album_name = r.titlebillboard_data; # Make new SQL statements to fix old table. CREATE TABLE test_new_album AS (SELECT DISTINCT album, artist FROM billboard_data); ALTER TABLE test_new_album add column album_id INT PRIMARY KEY AUTO_INCREMENT; CREATE TABLE test_album_review AS (SELECT t.album_id, r.reviewid FROM test_new_album AS t INNER JOIN reviews AS r ON t.album = r.title AND t.artist = r.artist); SELECT DISTINCT a.reviewid, a.album_id FROM test_album_review AS a INNER JOIN test_album_review AS b on a.album_id = b.album_id WHERE a.reviewid <> b.reviewid; CREATE TABLE test_song_album AS ( SELECT DISTINCT x.song_id, a.album_id FROM ( SELECT b.*, s.song_id FROM billboard_data AS b INNER JOIN song AS s ON b.song=s.song AND b.artist=s.artist) x INNER JOIN test_new_album AS a ON x.Album = a.album AND x.artist = a.artist; ); SELECT x. genre, avg(x.rank) as average FROM ( SELECT DISTINCT r.reviewid, g.genre, s.rank FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id INNER JOIN genres AS g ON g.reviewid = r.reviewid) ) as x GROUP BY x.genre ORDER BY average asc; SELECT (n.num1 / z.num2) FROM ( (SELECT x.label, x.genre, count(*) as num1 FROM ( SELECT DISTINCT r.reviewid, l.label, s.rank, g.genre FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id INNER JOIN labels as l ON l.reviewid = a.reviewid INNER JOIN genres as g ON g.reviewid = r.reviewid ) AS x GROUP BY x.label, x.genre) AS n, (SELECT DISTINCT l.label, count(*) as num2 FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id INNER JOIN labels as l ON l.reviewid = a.reviewid INNER JOIN genres as g ON g.reviewid = r.reviewid) ) AS z GROUP BY label WHERE n.label = z.label SELECT x.label, x.genre, (x.num1/y.num2) as percent FROM ( SELECT l.label, g.genre, count(*) as num1 FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id INNER JOIN labels as l ON l.reviewid = a.reviewid INNER JOIN genres as g ON g.reviewid = r.reviewid) GROUP BY l.label, g.genre) AS x, (SELECT l.label, count(*) as num2 FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id INNER JOIN labels as l ON l.reviewid = a.reviewid INNER JOIN genres as g ON g.reviewid = r.reviewid) GROUP BY l.label) AS y WHERE x.label = y.label; SELECT s.song_id, s.song, avg(rank) as average FROM (album_review AS a INNER JOIN reviews AS R ON a.reviewid = r.reviewid INNER JOIN song_album AS y ON a.album_id = y.album_id INNER JOIN song AS s ON y.song_id = s.song_id) WHERE r.best_new_music = 1 GROUP BY song_id, song
SELECT USER FROM DUAL; --==>> SCOTT SELECT * FROM TBL_MEMBERLIST; --○ 실습 테이블 생성 CREATE TABLE TBL_MEMBERLIST ( ID VARCHAR2(40) NOT NULL , PW VARCHAR2(100) NOT NULL , NAME VARCHAR2(100) NOT NULL , TEL VARCHAR2(100) , EMAIL VARCHAR2(200) , CONSTRAINT MEMBERLIST_ID_PK PRIMARY KEY(ID) ); --==>> Table TBL_MEMBERLIST이(가) 생성되었습니다. --○ 암호화 복호화 패키지의 암호화 함수를 활용한 데이터 입력 INSERT INTO TBL_MEMBERLIST(ID, PW, NAME, TEL, EMAIL) VALUES('SUPERMAN', CRYPTPACK.ENCRYPT('java006$', 'SUPERMAN'), '김승범', '010-1111-1111', 'ksb@test.com'); --==>> 1 행 이(가) 삽입되었습니다. --○ 확인 SELECT * FROM TBL_MEMBERLIST; --==>> SUPERMAN ?E?,? 김승범 010-1111-1111 ksb@test.com --○ 리스트 전체 조회 쿼리문 구성 SELECT ID, NAME, TEL, EMAIL FROM TBL_MEMBERLIST ORDER BY ID; --> 한 줄 구성 SELECT ID, NAME, TEL, EMAIL FROM TBL_MEMBERLIST ORDER BY ID ; --==>> SUPERMAN 김승범 010-1111-1111 ksb@test.com --○ 커밋 COMMIT; --==>> 커밋 완료. --○ 자신의 멤버 데이터 추가 INSERT INTO TBL_MEMBERLIST(ID, PW, NAME, TEL, EMAIL) VALUES('BATMAN', CRYPTPACK.ENCRYPT('1234', 'BATMAN'), '갓승범', '010-2222-2222', 'GSB@test.com'); --==>> 1 행 이(가) 삽입되었습니다. --○ 커밋 COMMIT; --==>> 커밋 완료. --○ 리스트 전체 조회 쿼리문 구성 SELECT ID, CRYPTPACK.DECRYPT(PW, ID), NAME, TEL, EMAIL FROM TBL_MEMBERLIST ORDER BY ID; --> 한 줄 구성 SELECT ID, CRYPTPACK.DECRYPT(PW, ID), NAME, TEL, EMAIL FROM TBL_MEMBERLIST ORDER BY ID ; --==>> SUPERMAN 김승범 010-1111-1111 ksb@test.com
-- 5.4 Creating Views use default; create view vw_sales_all_years as select RowID, ClientID, OrderID, OrderDate, OrderMonthYear, Quantity, Quote, DiscountPct, Rate, SaleAmount, CustomerName, CompanyName, Sector, Industry, City, ZipCode, State, Region, ProjectCompleteDate, DaysToComplete, ProductKey, ProductCategory, ProductSubCategory, Consultant, Manager, HourlyWage, RowCount, WageMargin, datediff(projectcompletedate, orderdate) as ProjectDuration, (saleamount * wagemargin) as ProfitAmount from sales_all_years; -- now check how your view looks with the added calculated columns select * from vw_sales_all_years; -- 5.3.2 denormalize client dimension onto sales fact create view vw_sales_flattened as select RowID, s.ClientID, OrderID, OrderDate, OrderMonthYear, Quantity, Quote, DiscountPct, Rate, SaleAmount, CustomerName, CompanyName, s.Sector, s.Industry, City, ZipCode, State, Region, ProjectCompleteDate, DaysToComplete, ProductKey, ProductCategory, ProductSubCategory, Consultant, Manager, HourlyWage, RowCount, WageMargin, datediff(projectcompletedate, orderdate) as ProjectDuration, (saleamount * wagemargin) as ProfitAmount, c.symbol, c.lastsale, c.marketcaplabel, c.marketcapamount, c.ipoyear, c.summaryquote from sales_all_years s left join clients c on s.clientid = c.clientid; -- now check your view select * from vw_sales_flattened; -- 5.3.3 created aggregated table for monthly metrics create view vw_sales_monthly as select OrderMonth , OrderYear , FirstOfTheMonth ,count(*) as OrderCount ,sum(SaleAmount) as SalesTotal ,avg(Quantity) as AvgOrderSize from ( select month(orderdate) as OrderMonth ,year(orderdate) as OrderYear ,date_add(orderdate,-(day(orderdate)-1)) as FirstOfTheMonth ,SaleAmount ,Quantity from sales_all_years ) a group by OrderMonth , OrderYear , FirstOfTheMonth -- now check your view select * from vw_sales_monthly;
drop database if exists digimon_db; create database digimon_db; use digimon_db; create table digimon ( id int unsigned auto_increment not null primary key, name varchar(60) not null, img varchar(200) not null, level varchar(30) not null );
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 13 Des 2019 pada 12.26 -- Versi server: 10.1.38-MariaDB -- Versi PHP: 7.3.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `uap-java-web` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `autoid` -- CREATE TABLE `autoid` ( `nomor` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `kategori` -- CREATE TABLE `kategori` ( `suka` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kategori` -- INSERT INTO `kategori` (`suka`) VALUES ('TEKNOLOGI'), ('BISNIS'), ('POLITIK'), ('PENDIDIKAN'), ('OLAHRAGA'), ('MILENIAL'), ('HITS'), ('ERA 90 AN'), ('ERA 80 AN'); -- -------------------------------------------------------- -- -- Struktur dari tabel `login` -- CREATE TABLE `login` ( `id` varchar(50) NOT NULL, `user` varchar(50) NOT NULL, `pass` varchar(50) NOT NULL, `status` varchar(50) NOT NULL DEFAULT '', `last_login` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `login` -- INSERT INTO `login` (`id`, `user`, `pass`, `status`, `last_login`) VALUES ('F0001', 'fajriyan@gmail.com', '123456', 'STATUS', '2019-12-13 14:02:24'); -- -------------------------------------------------------- -- -- Struktur dari tabel `user` -- CREATE TABLE `user` ( `id` varchar(50) NOT NULL, `nama` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `jk` varchar(50) NOT NULL, `suka` varchar(50) DEFAULT NULL, `bio` varchar(50) DEFAULT NULL, `daftar_pada` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `user` -- INSERT INTO `user` (`id`, `nama`, `email`, `password`, `jk`, `suka`, `bio`, `daftar_pada`) VALUES ('F0001', 'Fajriyan', 'fajriyan@gmail.com', '123456', 'LAKI-LAKI', 'TEKNOLOGI', 'Ini Saja', '2019-12-12 21:53:47'); -- -- Indexes for dumped tables -- -- -- Indeks untuk tabel `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`id`); -- -- Indeks untuk tabel `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); COMMIT; /*!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 */;
ALTER TABLE `synapse`.`person_ebi_metadata` ADD INDEX `JC_8ABD58A3217BBB47` (`person_id` ASC, `ebi_metadata_id` ASC); ALTER TABLE `synapse`.`person_org_metadata` ADD INDEX `JC_D0B544BA217BBB47` (`person_id` ASC, `org_metadata_id` ASC); ALTER TABLE `synapse`.`org_calc_flags_risk` DROP INDEX `person_idx` , ADD INDEX `person_idx` (`person_id` ASC, `calculated_at` ASC), DROP INDEX `id_idx` ; ALTER TABLE `synapse`.`risk_variable` ADD INDEX `RV_agg` (`calc_type` ASC, `calculation_start_date` ASC, `calculation_end_date` ASC); ALTER TABLE `synapse`.`ebi_metadata` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`org_metadata` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`org_question_response` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`survey_response` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`factor_questions` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`person_factor_calculated` ADD INDEX `modified` (`modified_at` ASC, `created_at` ASC); ALTER TABLE `synapse`.`person_ebi_metadata` DROP INDEX `IDX_8ABD58A3217BBB47` , ADD INDEX `IDX_8ABD58A3217BBB47` (`person_id` ASC, `ebi_metadata_id` ASC); ALTER TABLE `synapse`.`person_org_metadata` DROP INDEX `IDX_D0B544BA217BBB47` , ADD INDEX `IDX_D0B544BA217BBB47` (`person_id` ASC, `org_metadata_id` ASC); ALTER TABLE `synapse`.`survey_response` DROP INDEX `fk_survey_response_organization1` , ADD INDEX `fk_survey_response_organization1` (`org_id` ASC, `person_id` ASC, `survey_questions_id` ASC, `created_at` ASC); ALTER TABLE `synapse`.`org_question_response` DROP INDEX `fk_org_question_response_organization1_idx` , ADD INDEX `fk_org_question_response_organization1_idx` (`org_id` ASC, `person_id` ASC, `org_question_id` ASC); ALTER TABLE `synapse`.`risk_variable_range` DROP INDEX `fk_risk_model_bucket_range_risk_variable1_idx` , ADD INDEX `fk_risk_model_bucket_range_risk_variable1_idx` (`risk_variable_id` ASC, `min` ASC, `max` ASC); ALTER TABLE `synapse`.`org_calc_flags_risk` DROP INDEX `calculated_at_idx` , ADD INDEX `calculated_at_idx` (`calculated_at` ASC, `modified_at` ASC); ALTER TABLE `synapse`.`org_question_response` ADD INDEX `created` (`created_at` ASC); ALTER TABLE `synapse`.`survey_response` ADD INDEX `created` (`created_at` ASC); ALTER TABLE `synapse`.`academic_update` DROP INDEX `fk_academic_update_organization1_idx` , ADD INDEX `fk_academic_update_organization1_idx` (`org_id` ASC, `person_id_student` ASC, `modified_at` ASC, `org_courses_id` ASC); ALTER TABLE `synapse`.`person_risk_level_history` ADD INDEX `captured` (`date_captured` ASC), DROP INDEX `fk_person_risk_level_history_person1_idx` ;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_book_main 预定主表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_book_main as a set a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_book_main as a set a.op_user=(select user_id from fh_user_base where fh_user_base.old_id=a.op_user limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_book_house 预定房屋关联表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_book_house as a set a.book_id=(select id from fh_book_main where fh_book_main.old_id=a.book_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_book_house as a set a.house_id=(select id from fh_house_info where fh_house_info.old_id=a.house_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_book_house 大楼信息表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_building_info as a set a.user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_book_house 房屋信息表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_house_info as a set a.building_id=(select id from fh_building_info where fh_building_info.old_id=a.building_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_house_info as a set a.add_userid=(select user_id from fh_user_base where fh_user_base.old_id=a.add_userid limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_lessee 租户信息表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_lessee as a set a.user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_workers_info 维修工信息表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_workers_info as a set a.add_people=(select username from fh_user_base where fh_user_base.old_id=a.add_people limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_sports_venues 运动场地信息 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_sports_venues as a set a.add_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.add_user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_parking 车位信息管理 fees_id收费标准ID fees_type_id收费类型ID 未改变 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_parking as a SET a.building_id=(select id from fh_building_info where fh_building_info.old_id=a.building_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_lease_cont 租赁合同表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_lease_cont as a set a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_lease_cont set old_lease_cont_id=( select f.old_lease_cont_ids from ( select e.* from ( select a.id, a.old_lease_cont_id, (select b.id from fh_lease_cont b where b.old_id=a.old_lease_cont_id)as old_lease_cont_ids from fh_lease_cont a where a.old_id > 0 and a.old_lease_cont_id > 0 ) as e ) as f where f.id=fh_lease_cont.id ) where fh_lease_cont.old_id >0 and fh_lease_cont.old_lease_cont_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_lease_cont as a set a.operate_id=(select user_id from fh_user_base where fh_user_base.old_id=a.operate_id limit 1) where a.old_id > 0 and a.operate_id > 0 ; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_lease_cont as a set a.book_id=(select id from fh_book_main where fh_book_main.old_id=a.book_id limit 1) where a.old_id > 0 and a.book_id > 0 ; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_lease_cont 租赁合同房屋管理表 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_lease_cont_house as a SET a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.lease_cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.lease_cont_id limit 1), a.house_id=(select house_id from fh_house_info where fh_house_info.old_id=a.house_id limit 1), a.building_id=(select id from fh_building_info where fh_building_info.old_id=a.building_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_lease_bill as a set a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.lease_cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.lease_cont_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_period_price as a set a.lease_cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.lease_cont_id limit 1), a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_property_cont as a SET a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.operate_id=(select user_id from fh_user_base where fh_user_base.old_id=a.operate_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_property_cont_house as a SET a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.property_cont_id=(select id from fh_property_cont where fh_property_cont.old_id=a.property_cont_id limit 1), a.house_id=(select house_id from fh_house_info where fh_house_info.old_id=a.house_id limit 1), a.building_id=(select id from fh_building_info where fh_building_info.old_id=a.building_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_property_bill as a set a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.property_cont_id=(select id from fh_property_cont where fh_property_cont.old_id=a.property_cont_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_throw_lease as a set a.lease_cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.lease_cont_id limit 1), a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_throw_property as a SET a.property_cont_id=(select id from fh_property_cont where fh_property_cont.old_id=a.property_cont_id limit 1), a.loan_user_id=(select user_id from fh_user_base where fh_user_base.old_id=a.loan_user_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_throw_lease_cw as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; UPDATE fh_throw_lease_zw as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_throw_lease_wy as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_throw_property_cw as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_throw_property_wy as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_throw_lease_qf as a SET a.throw_id = (select id from fh_throw_lease where fh_throw_lease.old_id=a.throw_id limit 1), a.op_id=(select user_id from fh_user_base where fh_user_base.old_id=a.op_id limit 1) where a.old_id > 0; UPDATE fh_bill_adjust as a set a.operate_id = (select user_id from fh_user_base where fh_user_base.old_id=a.operate_id limit 1), a.bill_id = (select id from fh_lease_bill where fh_lease_bill.old_id=a.bill_id limit 1) where a.type=1 and a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE fh_bill_adjust as a set a.operate_id = (select user_id from fh_user_base where fh_user_base.old_id=a.operate_id limit 1), a.bill_id = (select id from fh_property_bill where fh_property_bill.old_id=a.bill_id limit 1) where a.type=2 and a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_cont_bill_timetask 定时出账 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_cont_bill_timetask as a set a.cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.cont_id limit 1) where a.old_id > 0 and a.cont_type=1; UPDATE fh_cont_bill_timetask as a set a.cont_id=(select id from fh_property_cont where fh_property_cont.old_id=a.cont_id limit 1) where a.old_id > 0 and a.cont_type=2; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_cont_bill_timetask 合同的自定义出账 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_bill_custom as a set a.cont_id=(select id from fh_lease_cont where fh_lease_cont.old_id=a.cont_id limit 1) where a.old_id > 0 and a.cont_type=1; UPDATE fh_bill_custom as a set a.cont_id=(select id from fh_property_cont where fh_property_cont.old_id=a.cont_id limit 1) where a.old_id > 0 and a.cont_type=2; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_user_budget_log gaency_id 值要改变为当前值 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_user_budget_log as a set a.user_id = (select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0 ; UPDATE fh_user_budget_log as a set a.opt_id = (select user_id from fh_user_base where fh_user_base.old_id=a.opt_id limit 1) where a.old_id > 0 ; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_user_child_count gaency_id 值要改变为当前值 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_user_child_count as a set a.user_id = (select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0 ; UPDATE fh_user_child_count as a set a.cont_id = (select id from fh_lease_cont where fh_lease_cont.old_id=a.cont_id limit 1) where a.cont_type=1 and a.old_id > 0; UPDATE fh_user_child_count as a set a.cont_id = (select id from fh_property_cont where fh_property_cont.old_id=a.cont_id limit 1) where a.cont_type=2 and a.old_id > 0 ; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_user_count gaency_id 值要改变为当前值 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_user_count as a set a.user_id = (select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0 ; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- 表 fh_user_count_log gaency_id 值要改变为当前值 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UPDATE fh_user_count_log as a set a.user_id = (select user_id from fh_user_base where fh_user_base.old_id=a.user_id limit 1) where a.old_id > 0 ; UPDATE fh_user_count_log as a set a.cont_id = (select id from fh_lease_cont where fh_lease_cont.old_id=a.cont_id limit 1), a.deal_goal = (select id from fh_lease_bill where fh_lease_bill.old_id=a.deal_goal limit 1) where a.cont_type=1 and a.old_id > 0; UPDATE fh_user_count_log as a set a.cont_id = (select id from fh_property_cont where fh_property_cont.old_id=a.cont_id limit 1), a.deal_goal = (select id from fh_property_bill where fh_property_bill.old_id=a.deal_goal limit 1) where a.cont_type=2 and a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- member库 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_add_stuff as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_base as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_change as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; UPDATE rxt_company_change as a SET a.op_id=(select id from rxt_user where rxt_user.old_id=a.op_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_contact as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_legal as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_operation as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_personnel as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_qualification as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_regist as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_stocker as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_company_tax as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE rxt_daily_data as a SET a.user_id=(select id from rxt_user where rxt_user.old_id=a.user_id limit 1) where a.old_id > 0; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - UPDATE `rxt_company_contact` set company_name=(select company_name from rxt_company_base where rxt_company_base.user_id=rxt_company_contact.user_id limit 1) where old_id > 0; UPDATE `rxt_company_legal` set company_name=(select company_name from rxt_company_base where rxt_company_base.user_id=rxt_company_legal.user_id limit 1) where old_id > 0; UPDATE `rxt_company_operation` set company_name=(select company_name from rxt_company_base where rxt_company_base.user_id=rxt_company_operation.user_id limit 1) where old_id > 0; UPDATE `rxt_company_regist` set company_name=(select company_name from rxt_company_base where rxt_company_base.user_id=rxt_company_regist.user_id limit 1) where old_id > 0; UPDATE `rxt_company_stocker` set company_name=(select company_name from rxt_company_base where rxt_company_base.user_id=rxt_company_stocker.user_id limit 1) where old_id > 0;
-- -- PostgreSQL database dump -- SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: freesize; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- CREATE TABLE freesize ( ip text NOT NULL, freesize integer, hash text ); ALTER TABLE public.freesize OWNER TO postgres; -- -- Name: hooks; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- CREATE TABLE hooks ( absolutepath text NOT NULL, ip text NOT NULL, "timestamp" text, size integer, originip text ); ALTER TABLE public.hooks OWNER TO postgres; -- -- Name: video; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- CREATE TABLE video ( absolutepath text NOT NULL, ip text NOT NULL, audiobitrate integer, videobitrate integer, server text, originip text ); ALTER TABLE public.video OWNER TO postgres; -- -- Data for Name: freesize; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY freesize (ip, freesize, hash) FROM stdin; 192.168.1.1 20000 \N 192.1.1.1 50000 \N 192.2.2.2 3333 \N 10.11.113.58 57075 \N 127.0.0.1 40010 \N 192.168.0.2 666 \N 192.168.0.9 666 \N 192.168.0.3 104639976 \N 10.10.3.138 99340640 \N \. -- -- Data for Name: hooks; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY hooks (absolutepath, ip, "timestamp", size, originip) FROM stdin; /home/public/file.txt 192.168.1.1 20/3/2015 2000 \N /a/a/a 192.1.1.1 lolol 3000 192.1.1.2 /home/panda 192.1.1.1 some time 3333 192.1.1.2 client.py 192.168.0.9 xx 4 192.168.0.2 \. -- -- Data for Name: video; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY video (absolutepath, ip, audiobitrate, videobitrate, server, originip) FROM stdin; /home/public/file.txt 192.168.1.1 45 45 server1 \N \. -- -- Name: freesize_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- ALTER TABLE ONLY freesize ADD CONSTRAINT freesize_pkey PRIMARY KEY (ip); -- -- Name: hooks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- ALTER TABLE ONLY hooks ADD CONSTRAINT hooks_pkey PRIMARY KEY (absolutepath, ip); -- -- Name: video_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- ALTER TABLE ONLY video ADD CONSTRAINT video_pkey PRIMARY KEY (absolutepath, ip); -- -- Name: hooks_ip_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY hooks ADD CONSTRAINT hooks_ip_fkey FOREIGN KEY (ip) REFERENCES freesize(ip); -- -- Name: video_absolutepath_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY video ADD CONSTRAINT video_absolutepath_fkey FOREIGN KEY (absolutepath, ip) REFERENCES hooks(absolutepath, ip); -- -- Name: public; Type: ACL; Schema: -; Owner: postgres -- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete --
-- tpch3 using 1395599672 as a seed to the RNG select l.l_orderkey, sum(l.l_extendedprice * (1 - l.l_discount)) as revenue, o.o_orderdate, o.o_shippriority from cp.`tpch/customer.parquet` c, cp.`tpch/orders.parquet` o, cp.`tpch/lineitem.parquet` l where c.c_mktsegment = 'HOUSEHOLD' and c.c_custkey = o.o_custkey and l.l_orderkey = o.o_orderkey and o.o_orderdate < date '1995-03-25' and l.l_shipdate > date '1995-03-25' group by l.l_orderkey, o.o_orderdate, o.o_shippriority order by revenue desc, o.o_orderdate limit 10;
/* Создание процедуры постановки водителя на стоянку */ CREATE PROCEDURE /*PREFIX*/I_DRIVER_PARK ( DRIVER_ID VARCHAR(32), PARK_ID VARCHAR(32), DATE_IN TIMESTAMP ) AS BEGIN INSERT INTO /*PREFIX*/PARK_STATES(PARK_STATE_ID,DRIVER_ID,PARK_ID,DATE_IN) VALUES (/*PREFIX*/GET_UNIQUE_ID(),:DRIVER_ID,:PARK_ID,CURRENT_TIMESTAMP); END; -- /* Фиксация изменений */ COMMIT
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 27-11-2018 a las 07:07:00 -- Versión del servidor: 10.1.36-MariaDB -- Versión de PHP: 7.2.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Base de datos: `sala_de_juegos` -- CREATE DATABASE IF NOT EXISTS `sala_de_juegos` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `sala_de_juegos`; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE `usuarios` ( `correo` varchar(50) NOT NULL, `nombre` varchar(20) NOT NULL, `clave` varchar(12) NOT NULL, `puntaje_PPT` int(10) UNSIGNED NOT NULL, `puntaje_AA` int(10) UNSIGNED NOT NULL, `puntaje_AeN` int(10) UNSIGNED NOT NULL, `puntaje_mio` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`correo`, `nombre`, `clave`, `puntaje_PPT`, `puntaje_AA`, `puntaje_AeN`, `puntaje_mio`) VALUES ('icaruxx@gmail.com', 'icaruxx', '1234', 0, 12, 0, 0); COMMIT; /*!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 */;
CREATE DEFINER=`dba`@`%` PROCEDURE `INCLUIR_MUSICA`(IN P_ID_ARTISTA INT, OUT P_ID_MUSICA INT, IN P_MUS_NOME VARCHAR(255), IN P_MUS_LETRA TEXT, IN P_MUS_LINK_LETRA VARCHAR(500), IN P_COMMIT CHAR(1), OUT P_OK CHAR(1), OUT P_RETORNO VARCHAR(2000)) INCLUIR_MUSICA:BEGIN DECLARE V_TEXTO VARCHAR(2000); DECLARE V_ART_NOME VARCHAR(255); CALL VALIDA_CAMPO_OBRIGATORIO(P_MUS_NOME, 'MUSICA', 'MUS_NOME', P_OK, P_RETORNO); IF P_OK = 'N' THEN LEAVE INCLUIR_MUSICA; END IF; CALL VALIDA_CAMPO_OBRIGATORIO(P_MUS_LETRA, 'MUSICA', 'MUS_LETRA', P_OK, P_RETORNO); IF P_OK = 'N' THEN LEAVE INCLUIR_MUSICA; END IF; CALL VALIDA_LOOKUP(P_ID_ARTISTA, 'ARTISTA', 'ID_ARTISTA', P_OK, P_RETORNO); IF P_OK = 'N' THEN LEAVE INCLUIR_MUSICA; END IF; -- PEGA O NOME DO ARTISTA SELECT A.ART_NOME INTO V_ART_NOME FROM ARTISTA A WHERE A.ID_ARTISTA = P_ID_ARTISTA; -- VALIDA SE ARTISTA JÁ POSSUI A MESMA MUSÍCA SELECT COUNT(1) INTO @V_COUNT FROM MUSICA M, ARTISTA A WHERE M.ID_ARTISTA = A.ID_ARTISTA AND UPPER(TRIM(M.MUS_NOME)) = UPPER(TRIM(P_MUS_NOME)) AND A.ID_ARTISTA = P_ID_ARTISTA; IF @V_COUNT >0 THEN CALL MSG_ERRO('MUSICA_ARTISTA_EXISTE', V_ART_NOME, P_MUS_NOME, NULL, NULL, NULL, P_OK, P_RETORNO); -- O artista :param1 já possui a música :param2. LEAVE INCLUIR_MUSICA; END IF; -- INCLUIR MÚSICA INSERT INTO MUSICA (ID_ARTISTA, MUS_NOME, MUS_LETRA, MUS_LINK_LETRA) VALUES (P_ID_ARTISTA, P_MUS_NOME, P_MUS_LETRA, P_MUS_LINK_LETRA); CALL MSG_SUCESSO('INCLUIR_MUSICA', P_MUS_NOME, V_ART_NOME,NULL,NULL,NULL, P_OK, P_RETORNO); -- A música :param1 foi incluída para o artista :param2 com sucesso. IF P_OK = 'N' THEN LEAVE INCLUIR_MUSICA; END IF; IF IFNULL(P_COMMIT, 'N') = 'S'THEN COMMIT; END IF; -- RETORNA ID DA MÚSICA INCLUÍDA SET P_ID_MUSICA := LAST_INSERT_ID(); END
DROP TABLE IF EXISTS `__PREFIX__attachment`;
CREATE PROCEDURE FILTRAR_CATEGORIA_LIBRO @ID_CATEGORIA CHAR(2) AS BEGIN SELECT * FROM LIBRO WHERE ID_CATEGORIA = @ID_CATEGORIA END
{{ config({ "materialized" : "table", "sort" : "created_at", "unique_key" : "unique_id", }) }} Select --IDs md5('DTC' || id) as unique_id, 'DTC' as source, id::varchar as order_id, customer_id::varchar, --Item info gross_sales, net_sales, NULL as discounts, 1 as units, --Unit Info NULL as region, NULL as name, NULL as is_comp, NULL as unit_type, --Calendar created_at from {{ref('dtc_orders')}} UNION select --IDs md5('Retail' || id) as unique_id, 'Retail' as source, id as order_id, NULL as customer_id, gross_sales, net_sales, discounts, units, -- Unit Info region, location_code as name, is_comp, location_code as unit_type, --Retail Calendar created_at from {{ref('retail_orders')}} UNION SELECT --IDs md5('Wholesale' || unique_invoice_id) as unique_id, 'Wholesale' as source, unique_invoice_id as order_id, customer_code as customer_id, total_extension as gross_sales, total_extension as net_sales, NULL as discounts, total_weight as units, region, account_name as name, NULL as is_comp, customer_type as unit_type, transaction_date from {{ref('wholesale_invoices')}}
--02 INSERT INTO Clients(FirstName,LastName,Phone) VALUES ('Teri','Ennaco','570-889-5187'), ('Merlyn','Lawler','201-588-7810'), ('Georgene','Montezuma','925-615-5185'), ('Jettie',' Mconnell','908-802-3564'), ('Lemuel','Latzke','631-748-6479'), ('Melodie','Knipp', '805-690-1682'), ('Candida','Corbley','908-275-8357') INSERT INTO Parts(SerialNumber,Description, Price,VendorId) VALUES ('WP8182119','Door Boot Seal', 117.86,2), ('W10780048','Suspension Rod', 42.81,1), ('W10841140','Silicone Adhesive', 6.77, 4), ('WPY055980','High Temperature Adhesive',13.94,3) --03 UPDATE Jobs SET MechanicId = 3 WHERE Status = 'Pending' AND MechanicId IS NULL UPDATE Jobs SET Status = 'In Progress' WHERE MechanicId = 3 AND Status = 'Pending' --04 DELETE OrderParts WHERE OrderId = 19 DELETE Orders WHERE OrderId = 19
rename table SMS to CMB_SMS
CREATE TABLE Students ( StudentId VARCHAR(8) NOT NULL, FirstName VARCHAR(30) NOT NULL, MiddleName VARCHAR(30) NULL, LastName VARCHAR(30) NOT NULL, StreetAddress VARCHAR(40) NOT NULL, City VARCHAR(30) NOT NULL, State VARCHAR(2) NOT NULL, ZipCode VARCHAR(5) NOT NULL, DateOfBirth DATE NOT NULL, Email VARCHAR(60) NULL, Phone VARCHAR(20) NULL, EnrollmentTerm VARCHAR(6) NOT NULL, StudentStatusCode VARCHAR(1) NOT NULL, DegreeId INT NOT NULL, CONSTRAINT PK_Students PRIMARY KEY (StudentId), CONSTRAINT FK_Students_EnrollementTerm FOREIGN KEY (EnrollmentTerm) REFERENCES Terms (TermCode), CONSTRAINT FK_Students_StudentStatus FOREIGN KEY (StudentStatusCode) REFERENCES StudentStatus (StudentStatusCode), CONSTRAINT FK_Students_DegreeId FOREIGN KEY (DegreeId) REFERENCES Degrees (DegreeId) );
CREATE DATABASE IF NOT EXISTS `FRDB` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `FRDB`; -- MySQL dump 10.13 Distrib 5.6.17, for osx10.6 (i386) -- -- Host: 127.0.0.1 Database: FRDB -- ------------------------------------------------------ -- Server version 5.6.20 /*!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 `Person_Certificate` -- DROP TABLE IF EXISTS `Person_Certificate`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Person_Certificate` ( `employeeID` int(11) NOT NULL, `certificateID` int(11) NOT NULL, `lastRenewed` varchar(10) NOT NULL, PRIMARY KEY (`employeeID`,`certificateID`), KEY `fk_Person_Certificate_Certificate1_idx` (`certificateID`), KEY `fk_Person_Certificate_Person_idx` (`employeeID`), CONSTRAINT `fk_Person_Certificate_Certificate1` FOREIGN KEY (`certificateID`) REFERENCES `Certificate` (`certificateID`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Person_Certificate_Person` FOREIGN KEY (`employeeID`) REFERENCES `Person` (`employeeID`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Person_Certificate` -- LOCK TABLES `Person_Certificate` WRITE; /*!40000 ALTER TABLE `Person_Certificate` DISABLE KEYS */; INSERT INTO `Person_Certificate` VALUES (7,2,'2000-01-01'),(7,3,'2000-01-01'),(7,6,'2000-01-01'); /*!40000 ALTER TABLE `Person_Certificate` 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-05-01 14:46:14
DROP TABLE WorksOn PURGE; DROP TABLE Dependent PURGE; DROP TABLE DeptLocation PURGE; DROP TABLE Project PURGE; DROP TABLE Department cascade constraints PURGE; DROP TABLE Employee cascade constraints PURGE;
ALTER TABLE BEHANDLING RENAME COLUMN gjeldende_for_utbetaling TO gjeldende_for_fremtidig_utbetaling;
/* Создание таблицы групп клиентов */ CREATE TABLE /*PREFIX*/CLIENT_GROUPS ( CLIENT_GROUP_ID VARCHAR(32) NOT NULL, PARENT_ID VARCHAR(32), NAME VARCHAR(100) NOT NULL, DESCRIPTION VARCHAR(250), PRIORITY INTEGER NOT NULL, "LEVEL" INTEGER NOT NULL, PRIMARY KEY (CLIENT_GROUP_ID), FOREIGN KEY (PARENT_ID) REFERENCES /*PREFIX*/CLIENT_GROUPS (CLIENT_GROUP_ID) ) -- /* Создание просмотра таблицы групп клиентов */ CREATE VIEW /*PREFIX*/S_CLIENT_GROUPS ( CLIENT_GROUP_ID, PARENT_ID, NAME, DESCRIPTION, PRIORITY, "LEVEL", PARENT_NAME ) AS SELECT CG.*, CG1.NAME AS PARENT_NAME FROM /*PREFIX*/CLIENT_GROUPS CG LEFT JOIN /*PREFIX*/CLIENT_GROUPS CG1 ON CG1.CLIENT_GROUP_ID=CG.PARENT_ID -- /* Создание процедуры добавления группы клиента */ CREATE PROCEDURE /*PREFIX*/I_CLIENT_GROUP ( CLIENT_GROUP_ID VARCHAR(32), PARENT_ID VARCHAR(32), NAME VARCHAR(100), DESCRIPTION VARCHAR(250), PRIORITY INTEGER ) AS DECLARE VARIABLE LV INTEGER; BEGIN IF (:PARENT_ID IS NULL) THEN BEGIN LV=1; END ELSE BEGIN SELECT CG."LEVEL"+1 FROM /*PREFIX*/CLIENT_GROUPS CG WHERE CG.CLIENT_GROUP_ID=:PARENT_ID INTO :LV; END INSERT INTO /*PREFIX*/CLIENT_GROUPS (CLIENT_GROUP_ID,PARENT_ID,NAME,DESCRIPTION,PRIORITY,"LEVEL") VALUES (:CLIENT_GROUP_ID,:PARENT_ID,:NAME,:DESCRIPTION,:PRIORITY,:LV); END; -- /* Создание процедуры обновления уровней групп клиентов */ CREATE PROCEDURE /*PREFIX*/R_CLIENT_GROUP_LEVELS ( PARENT_ID VARCHAR(32), "LEVEL" INTEGER ) AS DECLARE VARIABLE CLIENT_GROUP_ID VARCHAR(32); DECLARE VARIABLE L INTEGER; BEGIN FOR SELECT CG.CLIENT_GROUP_ID FROM /*PREFIX*/CLIENT_GROUPS CG WHERE CG.PARENT_ID=:PARENT_ID INTO :CLIENT_GROUP_ID DO BEGIN L=:"LEVEL"+1; UPDATE /*PREFIX*/CLIENT_GROUPS SET "LEVEL"=:L WHERE CLIENT_GROUP_ID=:CLIENT_GROUP_ID; EXECUTE PROCEDURE R_CLIENT_GROUP_LEVELS(:CLIENT_GROUP_ID,:L); END END; -- /* Создание процедуры изменения группы клиента */ CREATE PROCEDURE /*PREFIX*/U_CLIENT_GROUP ( CLIENT_GROUP_ID VARCHAR(32), PARENT_ID VARCHAR(32), NAME VARCHAR(100), DESCRIPTION VARCHAR(250), PRIORITY INTEGER, OLD_CLIENT_GROUP_ID VARCHAR(32) ) AS DECLARE VARIABLE LV INTEGER; BEGIN IF (:PARENT_ID IS NULL) THEN BEGIN LV=1; END ELSE BEGIN SELECT CG."LEVEL"+1 FROM /*PREFIX*/CLIENT_GROUPS CG WHERE CG.CLIENT_GROUP_ID=:PARENT_ID INTO :LV; END UPDATE /*PREFIX*/CLIENT_GROUPS SET CLIENT_GROUP_ID=:CLIENT_GROUP_ID, PARENT_ID=:PARENT_ID, NAME=:NAME, DESCRIPTION=:DESCRIPTION, PRIORITY=:PRIORITY, "LEVEL"=:LV WHERE CLIENT_GROUP_ID=:OLD_CLIENT_GROUP_ID; EXECUTE PROCEDURE /*PREFIX*/R_CLIENT_GROUP_LEVELS(:CLIENT_GROUP_ID,:LV); END; -- /* Создание процедуры удаления группы клиента */ CREATE PROCEDURE /*PREFIX*/D_CLIENT_GROUP ( OLD_CLIENT_GROUP_ID VARCHAR(32) ) AS BEGIN DELETE FROM /*PREFIX*/CLIENT_GROUPS WHERE CLIENT_GROUP_ID=:OLD_CLIENT_GROUP_ID; END; -- /* Фиксация изменений */ COMMIT
CREATE TABLE `usuarios` ( `id` int(10) NOT NULL auto_increment, `nombre` varchar(30) collate latin1_general_ci NOT NULL, `clave` varchar(30) collate latin1_general_ci default NULL, `descripcion` varchar(200) collate latin1_general_ci NOT NULL, `ingreso` date NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `nombre` (`nombre`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=4 ; INSERT INTO `usuarios` (`id`, `nombre`, `clave`, `descripcion`, `ingreso`) VALUES (1, 'eplace', 'virtual', 'Enrique Place - Arquitecto', '2006-01-01'), (2, 'mperez', 'pepe', 'Marcelo Perez - Desarrollador', '2006-11-08'), (3, 'mclara', NULL, 'María Clara - Diseñadora Web', '2006-10-01');
CREATE TABLE school( id SERIAL, name VARCHAR, code INTEGER, owner_name VARCHAR, address1 VARCHAR, post VARCHAR, pin VARCHAR, state VARCHAR, country VARCHAR, contact_person VARCHAR, owner_mobile VARCHAR, email_id VARCHAR, active INTEGER, registration_name VARCHAR, enable_fees INTEGER, enable_attendance INTEGER, enable_printed_worksheet INTEGER, created_at TIMESTAMP, updatedd_at TIMESTAMP, deleted VARCHAR, PRIMARY KEY (id) ); CREATE TABLE role( id SERIAL , name VARCHAR, PRIMARY KEY (id) ); CREATE TABLE cred_manager( id SERIAL , user_name VARCHAR NOT NULL, email VARCHAR DEFAULT NULL, password VARCHAR DEFAULT NULL, school_id INTEGER REFERENCES school(id), role_id INTEGER REFERENCES role(id), PRIMARY KEY (id) ); -- create seed data for school and role INSERT INTO school(name,code,owner_name,address1,post,pin,state,country,contact_person,owner_mobile,email_id,active,registration_name,enable_fees,enable_attendance,enable_printed_worksheet,created_at,updatedd_at,deleted) VALUES('Demo SChool',123456,'Admin','Bangalore','Bangalore','560068','Karnataka','India','Admin','89099009','admin@email.com',1,'asdf',1,1,1,current_timestamp,current_timestamp,'N'); INSERT INTO role(name) VALUES ('SUPERADMIN'),('YOYOADMIN'),('SCHOOLOWNER'),('TEACHER'); INSERT INTO cred_manager(user_name,email,password,school_id,role_id) VALUES('TestAdmin','test@admin.com','Welcome@123',1,1);
-- 隐患监管视图 CREATE OR REPLACE VIEW `ssms`.`v_task_trouble_supervision` AS (SELECT A.`S_TENANT`,A.`P_PROFESSION`,A.`T_CREATE`,B.`R_INDUSTRY`,B.`C_NAME` AS `S_PROFESSION` ,FLOOR(TRUNCATE(A.`N_FINISH_TROUBLE`/A.`N_ALL_TROUBLE`,2)*100) AS C_RECTIFICATION ,C.`P_PROVINCE`,C.`P_CITY`, C.`P_COUNTY`, C.`C_ADDR`,C.`P_AT_PROVINCE` ,C.`P_AT_CITY` , C.`P_AT_COUNTY` FROM `SYS_TASK_TROUBLE_SUPERVISION` A JOIN `sys_profession` B ON A.`P_PROFESSION`= B.`SID` JOIN `sys_tenant_e` C ON A.`R_TENANT` = C.`SID`);
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : mer. 20 fév. 2019 à 01:24 -- Version du serveur : 10.3.12-MariaDB-log -- Version de PHP : 7.3.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Base de données : `local_db` -- -- -------------------------------------------------------- -- -- Structure de la table `params` -- CREATE TABLE `params` ( `id` int(11) NOT NULL, `view` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dev` int(1) DEFAULT 0, `local` int(1) DEFAULT 0, `stag` int(1) DEFAULT 0, `prod` int(1) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Déchargement des données de la table `params` -- INSERT INTO `params` (`id`, `view`, `dev`, `local`, `stag`, `prod`) VALUES (1, 'block', 1, 1, 1, 1); -- -------------------------------------------------------- -- -- Structure de la table `vhost` -- CREATE TABLE `vhost` ( `id` int(11) NOT NULL, `vhost_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `vhost_local_domain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `vhost_logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `position` int(11) DEFAULT 0, `env` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'local', `vhost_description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Déchargement des données de la table `vhost` -- -- -------------------------------------------------------- -- -- Structure de la table `vhost_access` -- CREATE TABLE `vhost_access` ( `id` int(11) NOT NULL, `access_label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `access_login` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `access_password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `id_vhost` int(11) NOT NULL, `updated_at` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Déchargement des données de la table `vhost_access` -- -- -- Index pour les tables déchargées -- -- -- Index pour la table `params` -- ALTER TABLE `params` ADD PRIMARY KEY (`id`); -- -- Index pour la table `vhost` -- ALTER TABLE `vhost` ADD PRIMARY KEY (`id`); -- -- Index pour la table `vhost_access` -- ALTER TABLE `vhost_access` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT pour les tables déchargées -- -- -- AUTO_INCREMENT pour la table `params` -- ALTER TABLE `params` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT pour la table `vhost` -- ALTER TABLE `vhost` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82; -- -- AUTO_INCREMENT pour la table `vhost_access` -- ALTER TABLE `vhost_access` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52; COMMIT; /*!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 */;
DROP TABLE IF EXISTS trx_data; CREATE TABLE trx_data ( id INT AUTO_INCREMENT PRIMARY KEY, account_number VARCHAR(10) NOT NULL, trx_amount DECIMAL(20,2) NOT NULL, description VARCHAR(150) NOT NULL, trx_date DATE NOT NULL, trx_time TIME NOT NULL, customer_id INT ); CREATE INDEX IF NOT EXISTS account_number_idx ON trx_data(account_number); CREATE INDEX IF NOT EXISTS description_idx ON trx_data(description); CREATE INDEX IF NOT EXISTS customer_id_idx ON trx_data(customer_id);
SET IDENTITY_INSERT DefenseSet ON INSERT INTO DefenseSet (DefenseSetID, Name) VALUES (1, 'No Defense') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 1, 0, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 2, 0, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 3, 0, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 4, 0, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 5, 0, 'Black') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 1, 6, 0, 'Black') INSERT INTO DefenseSet (DefenseSetID, Name) VALUES (2, 'Standard Doomtrooper') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 1, 1, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 2, 1, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 3, 1, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 4, 1, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 5, 1, 'Black') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 2, 6, 1, 'Black') INSERT INTO DefenseSet (DefenseSetID, Name) VALUES (3, 'Advanced Doomtrooper') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 1, 2, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 2, 2, 'White') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 3, 2, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 4, 2, 'Red') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 5, 2, 'Black') INSERT INTO DefenseRoll (DefenseSetID, Rank, DiceCount, DiceColor) VALUES ( 3, 6, 2, 'Black') SET IDENTITY_INSERT DefenseSet OFF
WITH RECURSIVE search_wait_chain(ash_time,pid, blockerpid, wait_event_type,wait_event,level, path) AS ( SELECT ash_time,pid, blockerpid, wait_event_type,wait_event, 1 AS level, 'pid:'||pid||' ('||wait_event_type||' : '||wait_event||') ->'||'pid:'||blockerpid AS path from pg_active_session_history WHERE blockers > 0 union ALL SELECT p.ash_time,p.pid, p.blockerpid, p.wait_event_type,p.wait_event, swc.level + 1 AS level, 'pid:'||p.pid||' ('||p.wait_event_type||' : '||p.wait_event||') ->'||swc.path AS path FROM pg_active_session_history p, search_wait_chain swc WHERE p.blockerpid = swc.pid and p.ash_time = swc.ash_time and p.blockers > 0 ) select round(100 * count(*) / cnt)||'%' as "% of total wait",count(*) as seconds,path as wait_chain from ( SELECT pid,wait_event,path,sum(count) over() as cnt from ( select ash_time,level,pid,wait_event,path,count(*) as count, max(level) over(partition by ash_time,pid) as max_level FROM search_wait_chain where level > 0 group by ash_time,level,pid,wait_event,path ) as all_wait_chain where level=max_level ) as wait_chain group by path,cnt order by count(*) desc;
SELECT count(distinct e.ID) as numbers_of_employees, SUM(Salary) as sum_of_salary FROM branchs join employees e on branchs.ID = e.BARNCH_ID
-- Nov 23, 2008 1:14:30 AM EET -- [ 2074600 ] Housekeeping - Process to delete historic information UPDATE U_POSTerminal SET CardTransferBankAccount_ID=100, Card_BankAccount_ID=100, CashTransferBankAccount_ID=100, CheckTransferBankAccount_ID=100, Check_BankAccount_ID=100,Updated=TO_DATE('2008-11-23 01:14:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE U_POSTerminal_ID=50000 ;
--primii 10 angajati cu FOR SET SERVEROUTPUT ON DECLARE v_angid GAM_ANGAJATI2.COD_ANGAJAT%TYPE; v_angnume gam_angajati2.nume%TYPE; CURSOR ang_gam_cursor IS SELECT cod_angajat, nume FROM gam_angajati2; BEGIN OPEN ang_gam_cursor; FOR i IN 1..10 LOOP FETCH ang_gam_cursor INTO v_angid, v_angnume; DBMS_OUTPUT.PUT_LINE(v_angid||' '||v_angnume); END LOOP; CLOSE ang_gam_cursor; END;
select ipr.issue_id, pr.id, count(*) as cnt from gha_issues_pull_requests ipr, gha_pull_requests pr where pr.id = ipr.pull_request_id and pr.created_at >= '{{from}}' and pr.created_at < '{{to}}' and pr.event_id = ( select i.event_id from gha_pull_requests i where i.id = pr.id order by i.updated_at desc limit 1 ) group by ipr.issue_id, pr.id order by cnt desc, ipr.issue_id;
ALTER TABLE `sys_attach_text` MODIFY COLUMN `C_CONTENT` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '内容' AFTER `R_FIELD`;
--relatorio de cadastro select n1.nome_coluna_1, n1.nome_coluna_2, n1.nome_coluna_3, n2.nome_coluna_1 as alias_name, n3.nome_coluna_1 as alias_name, n1.nome_coluna_4, n1.nome_coluna_5, n1.nome_coluna_6, n1.nome_coluna_7, n1.nome_coluna_8, n1.nome_coluna_9, n1.nome_coluna_10, n1.nome_coluna_12 from nome_tabela_1 n1 left join nome_tabela_2 n2 on n1.nome_tabela_2 = n2.id left join nome_tabela_3 n3 on n1.id_nome_tabela_3 = n3.id;
CREATE Procedure sp_Save_SManDSType ( @smanID Integer,@dsType1 Integer = 0,@dsType2 Integer = 0 ,@dsType3 Integer = 0, @dsType4 nVarchar(100)= N'' ,@dsType5 nVarchar(100) = N'',@dsType6 nVarchar(100) = N'' ) As Begin exec sp_SaveDshandle @smanID, @dsType1 exec sp_Update_DSTypeDetails @smanID, @dsType1,1 exec sp_Update_DSTypeDetails @smanID, @dsType2,2 exec sp_Update_DSTypeDetails @smanID, @dsType3,3 exec sp_Update_DSTypeDetails @smanID, @dsType4,4 exec sp_Update_DSTypeDetails @smanID, @dsType5,5 exec sp_Update_DSTypeDetails @smanID, @dsType6,6 End
CREATE PROCEDURE suspectsInvestigation2() BEGIN SELECT id,name,surname FROM Suspect WHERE height <= 170 OR upper(surname) NOT LIKE 'gre_n' OR upper(name) NOT LIKE 'B%' ORDER BY id; END
EXEC sp_rename 'dbo.Requests.SentDate', 'CreatedAt', 'COLUMN';
CREATE TABLE IF NOT EXISTS `dpd_geogaz_domestic` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `postcode_sector` VARCHAR(128) DEFAULT NULL, `dpd_depot` VARCHAR(128) DEFAULT NULL, `dpd_services_group` VARCHAR(128) DEFAULT NULL, `dpd_offshore_zone` VARCHAR(128) DEFAULT NULL, `timeslots_code` VARCHAR(128) DEFAULT NULL, `cluster` VARCHAR(128) DEFAULT NULL, `ilk_depot` VARCHAR(128) DEFAULT NULL, `ilk_services_group` VARCHAR(128) DEFAULT NULL, `ilk_offshore_zone` VARCHAR(128) DEFAULT NULL, `ilk_alternate_service` VARCHAR(128) DEFAULT NULL, `dpd_alternate_service` VARCHAR(128) DEFAULT NULL, `new_postcode` VARCHAR(128) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
------------------------------------------------------------ -- @param id select lid,rid,(rid - lid + 1)as width from mptta where id=?; ------------------------------------------------------------ -- @param lid -- @param rid -- @param width delete from mptta where lid between ? and ?; update mptta set rid = rid - ? where rid > ?; update mptta set lid = lid - ? where lid > ?; ------------------------------------------------------------ SELECT @myLeft := lid, @myRight := rid, @myWidth := rid - lid + 1 FROM mptta WHERE id = 1000068; DELETE FROM mptta WHERE lid BETWEEN @myLeft AND @myRight; UPDATE mptta SET rid = rid - @myWidth WHERE rid > @myRight; UPDATE mptta SET lid = lid - @myWidth WHERE lid > @myRight; delete from mptta where id>1000035; ------------------------------------------------------------
DELETE FROM Dates Where id = $1
DROP TABLE IF EXISTS game, comment, news, user; CREATE TABLE comment ( id BIGINT AUTO_INCREMENT PRIMARY KEY, username VARCHAR(255), comment_time TIME, comment_date DATE, comment_content VARCHAR(255) NOT NULL, game_id BIGINT, news_id BIGINT ); CREATE TABLE game ( id BIGINT AUTO_INCREMENT PRIMARY KEY, game_title VARCHAR(255), description VARCHAR(10000), review_time TIME, review_date DATE, review_author VARCHAR(255), rating INT, image_name VARCHAR(255) ); CREATE TABLE news ( id BIGINT AUTO_INCREMENT PRIMARY KEY, news_title VARCHAR(255), description VARCHAR(10000), news_time TIME, news_date DATE, news_author VARCHAR(255), news_image VARCHAR(255) ); CREATE TABLE user ( id BIGINT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(60) NOT NULL UNIQUE, username VARCHAR(15) NOT NULL UNIQUE, password VARCHAR(80) NOT NULL, active BIT, account_creation_time TIME, account_creation_date DATE, user_roles ENUM('ADMIN', 'USER'), image_name VARCHAR(255) );
CREATE DATABASE IF NOT EXISTS `assignment` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `assignment`; -- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64) -- -- Host: localhost Database: assignment -- ------------------------------------------------------ -- Server version 5.7.12-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 `game` -- DROP TABLE IF EXISTS `game`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `game` ( `game_id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(45) DEFAULT NULL, `company` varchar(45) DEFAULT NULL, `rdate` varchar(45) DEFAULT NULL, `description` varchar(300) DEFAULT NULL, `price` double DEFAULT NULL, `img` varchar(45) DEFAULT 'images/No.jpg', `own` varchar(3) DEFAULT NULL, PRIMARY KEY (`game_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10005 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `game` -- LOCK TABLES `game` WRITE; /*!40000 ALTER TABLE `game` DISABLE KEYS */; INSERT INTO `game` VALUES (1,'Ho','Hohoho','12/12/12','hello this is an example it\'s literally just an example',23.33,'images/1.png','yes'),(2,'updating!!','mmomo','11/11/11','dummmmm',99.99,'images/2.png','no'),(3,'Hey','Heyeye','12/5/21322','Hello this is a stupd',2222.22,'images/3.png','yes'),(4,'Hellooo','hehehehe','ww/ww/ww','wwwwwwwwwwwwww',111.11,'images/4.png','no'),(5,'This','is','just','scrweing around',23.42,'images/5.png','yes'),(9999,'No','No','No','No',0,'images/No.jpg','no'),(10004,'i need u to work','work pls','22/05/23','This really needs to work rn',23.32,'images/No.jpg','no'); /*!40000 ALTER TABLE `game` 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-05-22 17:02:37
select get_unique_id() call i_type ('E39C9F906766ADFD4EFB456CD9954110','Квартира','Квартира',1) call i_type ('82BB537F2358BE7E4DD45F921F2EFED0','Частный дом','Частный дом',2) call i_type ('A636412AA55C83774BC65F32E1F735E7','Дача','Дача',3); call i_type ('F96E23A585B4A0524B7516CD021D1D61','Загородний дом','Загородний дом',4); call i_type ('E97F9E7E469F946A4D785DAE8065AB4C','Таунхаус','Таунхаус',5); call i_type ('FF514D63F9EF8E384751FA1CECEEC2BB','Офис','Офис',6); call i_type ('C58D99195DC896CE4DC68042324D49FA','Отдельно стоящее здание','Отдельно стоящее здание',7); call i_type ('98355291AF3DA5BD4F1D0571EEBFFEF6','Ресторан, кафе','Ресторан, кафе',8); call i_type ('AD7FB1A7A902ACFC4B07D9F675632BB2','Торговые помещения','Торговые помещения',9); call i_type ('57A68A886F6FB9494E7654104F06984F','Гаражи','Гаражи',10); call i_type ('8F6DF19321BC91FF4B730E301C73BF69','Производство','Производство',11); call i_type ('D2A7B184DB49BCE04D7523B9D00B6E2B','Склады, базы','Склады, базы',12); select * from s_types order by priority
INSERT INTO 'grupo' ('nome') VALUES ('Materiais e Utensílios Diversos para Instalações, Manutenção e Reparo'), ('Dispositivos e Acessórios para Instalações Hidráulicas'), ('Acessórios e Componentes Elétrico / Eletrônico / Telefonia'), ('Ferragens e Suprimentos para Instalações Elétricas'); INSERT INTO 'local' ('codl', 'nome') VALUES (1, 'Campus Chapecó'), (2, 'Unidade Reitoria'); INSERT INTO 'fornecedor' ('cnpj', 'razao_social', 'nome_fantasia', 'endereco', 'telefone') VALUES (79245296000160, 'MEPAR MERCADO DE PARAFUSOS LTDA', 'MEPAR MERCADO DE PARAFUSOS LTDA', 'Av. Fernando Machado, 3240-D - Líder, SC, 89805-203', '(49) 3321-7777'), (05238271000527, 'Andrade Materiais de Construção Ltda', 'Andrade Materiais de Construção Ltda', 'Av. Atílio Fontana, Efapi, SC', '(49) 3329-7517'); INSERT INTO 'produto' ('cod', 'nome', 'qtd', 'codg', 'codl', 'qtdmin') VALUES (1000001, 'Massa para Calafetar, Embalagem 350 g', 15, 100, 1, 5), (1010001, 'Adesivo conexão hidráulica, para Cano PVC, Tubo 75 g', 18, 101, 1, 5), (1020001, 'Mini Disjuntor 20 A / 1 P, Monofasico', 25, 102, 1, 3), (1030001, 'Adaptador de Condulete PVC, 3/4, Cor Branco', 150, 103, 1, 50), (1030002, 'Eletroduto, Condulete, 3/4 ", PVC, Peça 3 M, Cinza', 11, 103, 2, 0), (1010002, 'Bucha de Redução, PVC, 1" 1/2" p/ 1" 1/4"', 8, 101, 2, 5), (1000002, 'Espuma Expansiva, Tubo 500 Ml', 18, 100, 1, 2), (1000003, 'Silicone - Adesivo Vedacalha, Tubo 280 g, Cor Cinza', 62, 100, 1, 15); INSERT INTO 'insercao' ('codp', 'qtd', 'data') VALUES (1000001, 10, '2016-10-24'), (1000002, 10, '2016-10-24'), (1000002, 10, '2016-10-24'), (1010001, 10, '2016-10-24'), (1010002, 10, '2016-10-24'), (1020001, 10, '2016-10-24'), (1030001, 10, '2016-10-24'), (1030002, 10, '2016-10-24'); INSERT INTO 'remocao' ('data', 'qtd', 'codp', 'destino') VALUES ('2016-10-24', 2, 1000001, 'Testes'), VALUES ('2016-09-24', 2, 1010001, 'Bloco A'), VALUES ('2016-08-24', 2, 1020001, 'Bloco de Professores'), VALUES ('2016-07-24', 2, 1030001, 'General Osório'), VALUES ('2016-06-24', 2, 1010002, 'Laboratório 01');
CREATE TABLE Gun ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255) NOT NULL, caliber DOUBLE NOT NULL ); INSERT INTO Gun (name, caliber) VALUES ('Kolt', 11.52); INSERT INTO Gun (name, caliber) VALUES ('Beretta', 6.35); INSERT INTO Gun (name, caliber) VALUES ('Glock', 9.0); INSERT INTO Gun (name, caliber) VALUES ('AKM-47', 7.62); INSERT INTO Gun (name, caliber) VALUES ('AK-74', 5.45);
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jan 14, 2019 at 04:51 PM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.3.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `ensa_deep_db` -- -- -------------------------------------------------------- -- -- Table structure for table `etudiants` -- CREATE TABLE `etudiants` ( `id` int(10) UNSIGNED NOT NULL, `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `prenom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `cne` int(11) NOT NULL DEFAULT '0', `abscence` int(11) NOT NULL DEFAULT '0', `filiere_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `etudiants` -- INSERT INTO `etudiants` (`id`, `nom`, `prenom`, `cne`, `abscence`, `filiere_id`, `created_at`, `updated_at`) VALUES (1, 'Handi', 'Fouad', 123456, 3, 1, '2019-01-13 17:17:01', '2019-01-13 17:17:01'), (2, 'Talhaoui', 'Ismail', 99999956, 5, 2, '2019-01-13 17:17:28', '2019-01-13 17:17:28'); -- -------------------------------------------------------- -- -- Table structure for table `filieres` -- CREATE TABLE `filieres` ( `id` int(10) UNSIGNED NOT NULL, `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_01_11_102906_create_profs_table', 1), (4, '2019_01_11_102919_create_scolarites_table', 1), (5, '2019_01_11_102938_create_filieres_table', 1), (6, '2019_01_11_103002_create_etudiants_table', 1), (7, '2019_01_11_103342_create_prof_filiere_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `profs` -- CREATE TABLE `profs` ( `id` int(10) UNSIGNED NOT NULL, `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `prenom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `is_super` tinyint(1) NOT NULL DEFAULT '0', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `profs` -- INSERT INTO `profs` (`id`, `nom`, `prenom`, `email`, `status`, `password`, `is_super`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Bouarifi', 'Walid', 'bouarifi@gmail.com', 'developper', '$2y$10$7JZNUHCYToqLURMpGO/NWeKsvoYwh0LNVHgvXmYvNpkybBvHx84D2', 0, NULL, '2019-01-13 16:11:30', '2019-01-13 16:11:30'), (2, 'Ech-chadi', 'said', 'said@gmail.com', 'ensignant', '$2y$10$551r5vH1G/SW8m8RHmtAIuDbo.e2tM6iK5ZA4q9qsNJFe2c/08nei', 0, NULL, '2019-01-13 17:46:50', '2019-01-13 17:46:50'), (3, 'gfhfgfhfgffh', 'ikikikiki', 'fdgdfdgdf@gmail.com', 'Professeur', '$2y$10$DugbGByrTNAnKfoPnqNg/.7c5NdFwedJbSzGELDaLq3Uj9wFOUm3i', 0, NULL, '2019-01-14 13:29:37', '2019-01-14 13:29:37'), (4, 'ujuikik', 'esdsesdse', 'ewdswe@gmail.com', 'Professeur', '$2y$10$.ytSfA4yuZRYmBr47JxUduLvKONjNACz2pqoJCFTFRQAJGBb4RPge', 0, NULL, '2019-01-14 14:07:00', '2019-01-14 14:07:00'); -- -------------------------------------------------------- -- -- Table structure for table `prof_filiere` -- CREATE TABLE `prof_filiere` ( `id` int(10) UNSIGNED NOT NULL, `prof_id` int(10) UNSIGNED NOT NULL, `filiere_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `scolarites` -- CREATE TABLE `scolarites` ( `id` int(10) UNSIGNED NOT NULL, `nom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `prenom` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `is_scol` tinyint(1) NOT NULL DEFAULT '0', `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `scolarites` -- INSERT INTO `scolarites` (`id`, `nom`, `prenom`, `email`, `password`, `is_scol`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'ikfikfi', 'dssrsfsr', 'dsesf@gmail.com', '$2y$10$Why1qtF0FjJoTjPHnaZ49e.tEheP5TS9JPrhITj4p1i5oFdN3nIem', 0, NULL, '2019-01-14 14:14:30', '2019-01-14 14:14:30'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Hoummani', 'yassine@gmail.com', NULL, '$2y$10$AIkr88ujP97GPvS40kEqH.KYy8TkI/LoTT13KwCr6ke/ykuxq0rY2', NULL, '2019-01-13 16:04:30', '2019-01-13 16:04:30'); -- -- Indexes for dumped tables -- -- -- Indexes for table `etudiants` -- ALTER TABLE `etudiants` ADD PRIMARY KEY (`id`); -- -- Indexes for table `filieres` -- ALTER TABLE `filieres` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `profs` -- ALTER TABLE `profs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `prof_filiere` -- ALTER TABLE `prof_filiere` ADD PRIMARY KEY (`id`); -- -- Indexes for table `scolarites` -- ALTER TABLE `scolarites` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `etudiants` -- ALTER TABLE `etudiants` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `filieres` -- ALTER TABLE `filieres` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `profs` -- ALTER TABLE `profs` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `prof_filiere` -- ALTER TABLE `prof_filiere` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `scolarites` -- ALTER TABLE `scolarites` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; COMMIT; /*!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 */;
-- pga_advice.sql -- display v$pga_target_advice -- of dubious worth @pgacols clear break set linesize 200 trimspool on set pagesize 100 select * from v$pga_target_advice order by pga_target_for_estimate /
if object_id('perfiles') is not null drop table perfiles; create table perfiles( id_perfil int primary key , --identity nombre_perfil varchar (30), id_privilegio int--, --foreign key(id_privilegio) references privilegios(id_privilegio) --on delete cascade --on update cascade ); --insert into perfiles(nombre_perfil, id_privilegio) values('gerente', 8); --insert into perfiles(nombre_perfil, id_privilegio) values('gerente', 9); --insert into perfiles(nombre_perfil, id_privilegio) values('gerente', 10); --insert into perfiles(nombre_perfil, id_privilegio) values('gerente', 2); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 3); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 5); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 6); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 7); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 13); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 12); --insert into perfiles(nombre_perfil, id_privilegio) values('encargado', 16); --insert into perfiles(nombre_perfil, id_privilegio) values('cajero', 2); --insert into perfiles(nombre_perfil, id_privilegio) values('cajero', 14); --insert into perfiles(nombre_perfil, id_privilegio) values('cajero', 15); --insert into perfiles(nombre_perfil, id_privilegio) values('cajero', 16);
insert into present (id,name) values(3,'FirstPresent'); insert into present (id,name) values(4,'SecondPresent'); insert into sweet (id,name, developer_name, shelf_life, present_id) values(3,'ChocolateRoshen', 'Roshen', '23.05.2019',3); insert into sweet (id,name, developer_name, shelf_life, present_id) values(6,'Not chocolate Roshen', 'Roshen','23.05.2019', 4);
Create function mERP_fn_list_PFM_UOMprice(@ITEM_CODE nvarchar(30), @UOM Int = 0, @TaxType Int = 1) returns @PFMPrices Table(Product_code nVarchar(30) Collate SQL_Latin1_General_CP1_CI_AS, PFM Decimal(18,6)) As Begin Insert into @PFMPrices Select Distinct I.Product_code, Cast(Case @UOM When 2 then (Case Isnull(I.UOM1_Conversion,0) When 0 Then 1 Else I.UOM1_Conversion End) * IsNull(BP.PFM,0) When 3 then (Case Isnull(I.UOM2_Conversion,0) When 0 Then 1 Else I.UOM2_Conversion End) * IsNull(BP.PFM,0) Else IsNull(BP.PFM,0) End as Decimal(18,6)) as PFM From Batch_products BP, Items I Where BP.Product_code = @ITEM_CODE and IsNull(BP.TaxType,1) = @TaxType and I.Product_code = BP.Product_Code and IsNull(BP.PFM,0) > 0 Return End
select `n_name` from `nation` where `n_nationkey` = 17 except select `n_name` from `nation` where `n_regionkey` = 2 union select `n_name` from `nation` where `n_regionkey` = 2 intersect select `n_name` from `nation` where `n_nationkey` > 15
CREATE TABLE IF NOT EXISTS `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `challenge_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `comment` longtext NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1-active,0-inactive', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
ALTER TABLE posts add title TEXT, add tags TEXT;
-- awr-top-events.sql -- get top 5 events per AWR snapshot, per instance -- Jared Still jkstill@gmail.com -- requires https://github.com/jkstill/oracle-script-lib/blob/master/sql/get_date_range.sql -- prompt for date range @get_date_range -- or just specify it here --@get_date_range '2016-10-26 10:00:00' '2016-10-26 16:00:00' break on begin_interval skip 1 with snaps as ( select min(snap_id) min_snap_id , max(snap_id) max_snap_id from dba_hist_snapshot where begin_interval_time >= to_date(:v_begin_date,'&d_date_format') and end_interval_time <= to_date(:v_end_date,'&d_date_format') ), data as ( select h.snap_id , h.dbid , h.instance_number , case h.session_state when 'ON CPU' then 'CPU' else h.event end event from dba_hist_active_sess_history h and h.event != 'ges generic event' -- see MOS 2638401.1 ), agg_data as ( select distinct to_char(hs.begin_interval_time,'&d_date_format') begin_interval , d.instance_number , d.event , count(d.event) over (partition by d.snap_id, d.event, d.instance_number) event_count from data d join dba_hist_snapshot hs on hs.snap_id = d.snap_id and hs.instance_number = d.instance_number and hs.dbid = d.dbid and hs.snap_id between (select min_snap_id from snaps) and (select max_snap_id from snaps) --where rownum <= 200 order by begin_interval, event_count desc, instance_number ), rank_output as ( select begin_interval , instance_number , event , event_count , row_number() over (partition by begin_interval, instance_number order by event_count desc) event_rank from agg_data ) select begin_interval , instance_number , event , event_count from rank_output where event_rank <= 5 order by begin_interval, event_count desc /
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Oct 12, 2021 at 04:24 PM -- Server version: 10.3.16-MariaDB -- PHP Version: 7.3.23 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!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 utf8mb4 */; -- -- Database: `id16918686_respikts` -- -- -------------------------------------------------------- -- -- Table structure for table `dustbins` -- CREATE TABLE `dustbins` ( `lat` text COLLATE utf8_unicode_ci NOT NULL, `lon` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `dustbins` -- INSERT INTO `dustbins` (`lat`, `lon`) VALUES ('32.183398333333336', '76.37279666666667'), ('32.19043833333333', '76.35265'), ('32.22928666666667', '76.308945'), ('32.206223333333334', '76.31209166666666'), ('32.20655333333333', '76.31929333333332'), ('32.207165', '76.32252833333334'), ('32.20146833333333', '76.3235'), ('32.19828166666667', '76.3223'), ('32.195838333333334', '76.32694833333333'), ('32.198795000000004', '76.33707666666666'), ('32.197786666666666', '76.34439166666667'), ('32.20063386962967', '76.33513133466083'), ('32.20559770727213', '76.32832007174811'), ('32.225054403628306', '76.31783654596327'), ('32.197761748218426', '76.32909431415557'), ('32.19551265162474', '76.32387014715194'), ('32.20064340838213', '76.32105721064886'), ('32.20976528694513', '76.31732730951946'), ('32.22917927787886', '76.31749107209524'), ('32.207752865963045', '76.31680979100545'), ('32.23513145627866', '76.30569784292221'), ('32.19782', '76.36243166666667'), ('32.212175', '76.37210166666667'), ('32.21294833333333', '76.36680666666666'), ('32.2143', '76.365785'), ('32.21344833333333', '76.34167333333333'), ('32.20634', '76.33889666666667'), ('32.20240666666667', '76.33649833333334'), ('32.20037333333333', '76.34404500000001'); -- -------------------------------------------------------- -- -- Table structure for table `respikttable` -- CREATE TABLE `respikttable` ( `id` text COLLATE utf8_unicode_ci NOT NULL, `respikts` int(11) NOT NULL, `name` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `respikttable` -- INSERT INTO `respikttable` (`id`, `respikts`, `name`) VALUES ('727073320557871137', 9, 'Sunlight#0135'), ('645258357241806848', 6, 'fly_unfettered#8215'), ('672155487088934912', 23, 'butter#1135'), ('348100803980165121', 17, '[ǝpıɹd pǝʇsıʍ⊥]#1904'), ('460043816339111937', 5, 'damnation#0991'), ('836512784241000488', 17, 'arcade#0665'), ('235148962103951360', 0, 'Carl-bot#1536'), ('425249826175975424', 8, 'babru#6295'), ('679735672021450755', 17, 'Visualter#2991'), ('806264320044433409', 7, 'kingpenguin#6298'), ('847806892281430097', -3, 'Respikt bot#6246'), ('658611922630868992', 7, 'SnowRaven#3496'), ('448238991935012865', 1, 'Rana#7723'), ('641612704351518730', 1, 'zfxbrutality#8169'), ('625339659282546725', 2, 'sushi#6616'), ('327025982798036992', 2, 'devilzworkshop#3064'); COMMIT; /*!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 */;
CREATE TABLE IF NOT EXISTS interceptions ( play_id integer, passer varchar(7), interceptor varchar(7), return_yardage smallint ); COPY interceptions FROM '/Users/sean.costello/Development/nfl_00-16/INTERCPT.csv' DELIMITER ',' CSV HEADER;
drop database if exists B6; create database B6; use B6; create table product( id int primary key, productCode int, productName varchar(50), productPrice double, productAmount double, productDescription text, productStatus varchar(50), id_test int, foreign key (id_test) references test(id) ); insert into product values (1, 1, 'name1', 20000, 10000, 'name1Of', 'on'), (2, 2, 'name2', 40000, 20000, 'name2Of', 'on'), (3, 3, 'name3', 60000, 30000, 'name3Of', 'off'), (4, 4, 'name2', 20000, 30000, 'name4Of', 'off'); -- index create index index_product on product (productCode); create index index_product2 on product (productName, productPrice); select * from product where productCode = 2; select * from product where productName = 'name2' and productPrice = 20000; -- view create view view_product as select productCode, productName, productPrice, productStatus from product; -- hiển thị full select productCode, productName from view_product; -- xóa view drop view if exists view_product; -- view còn có thể che dấu thông tin người dùng -- SP delimiter // create procedure find_name_product (in p_keywork varchar(10)) begin select * from product where name like concat('%', p_keywork, '%'); end; delimiter// call find_name_product ('n');
-- Jan 16, 2008 8:33:22 PM CST --[+1871641+]+Account+Bank+into+POS+Terminal INSERT INTO AD_Column (Name,IsMandatory,IsTranslated,Description,IsIdentifier,SeqNo,Help,Version,IsActive,AD_Table_ID,AD_Column_ID,ColumnName,AD_Client_ID,AD_Org_ID,FieldLength,IsParent,Created,IsSyncDatabase,AD_Reference_ID,CreatedBy,Updated,AD_Element_ID,IsUpdateable,IsKey,IsSelectionColumn,UpdatedBy,IsAlwaysUpdateable,IsEncrypted,EntityType) VALUES ('Bank Account','N','N','Account at the Bank','N',0,'The Bank Account identifies an account at this Bank.',0,'Y',748,54236,'C_BankAccount_ID',0,0,22,'N',TO_DATE('2008-01-16 20:33:21','YYYY-MM-DD HH24:MI:SS'),'N',19,0,TO_DATE('2008-01-16 20:33:21','YYYY-MM-DD HH24:MI:SS'),836,'Y','N','N',0,'N','N','D') ; -- Jan 16, 2008 8:33:22 PM CST --[+1871641+]+Account+Bank+into+POS+Terminal INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=54236 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jan 16, 2008 8:33:52 PM CST --[+1871641+]+Account+Bank+into+POS+Terminal INSERT INTO AD_Field (IsEncrypted,AD_Org_ID,UpdatedBy,IsDisplayed,IsCentrallyMaintained,IsActive,Created,AD_Client_ID,AD_Field_ID,Description,DisplayLength,AD_Column_ID,IsFieldOnly,CreatedBy,Help,Updated,Name,AD_Tab_ID,IsSameLine,IsHeading,IsReadOnly,EntityType) VALUES ('N',0,0,'Y','Y','Y',TO_DATE('2008-01-16 20:33:52','YYYY-MM-DD HH24:MI:SS'),0,54330,'Account at the Bank',22,54236,'N',0,'The Bank Account identifies an account at this Bank.',TO_DATE('2008-01-16 20:33:52','YYYY-MM-DD HH24:MI:SS'),'Bank Account',676,'N','N','N','D') ; -- Jan 16, 2008 8:33:52 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=54330 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=54330 ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=10811 ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=10810 ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=10798 ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=10803 ; -- Jan 16, 2008 8:34:08 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=52017 ; -- Jan 16, 2008 8:34:16 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2008-01-16 20:34:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=54330 ; -- Jan 16, 2008 9:23:14 PM CST -- [+1871641+]+Account+Bank+into+POS+Terminal ALTER TABLE C_POS ADD C_BankAccount_ID NUMBER(10) DEFAULT NULL ;
select DOCTYPID ,DOCSUBTYPID ,RPTID ,UPDDTM from DOCTYPRPT
ALTER TABLE SYS_TENANT_E ADD COLUMN R_REVIEW INT(11); ALTER TABLE SYS_TENANT_E ADD COLUMN S_REVIEW VARCHAR(300);
-- -------------------------------------------------------- -- -- Table structure for table `nepse_share_group` -- DROP TABLE IF EXISTS `nepse_share_group`; CREATE TABLE `nepse_share_group` ( `GroupID` int(11) NOT NULL, `GroupName` varchar(20) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, `login_id` int(11) NOT NULL, `created_by` varchar(25) NOT NULL, `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `Scope` varchar(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `nepse_share_group` -- INSERT INTO `nepse_share_group` (`GroupID`, `GroupName`, `login_id`, `created_by`, `create_date`, `Scope`) VALUES (1, 'Long term', 1, 'Test', '2017-12-14 15:04:22', '0'), (2, 'Short term', 1, 'Test', '2017-12-14 15:04:27', '0'), (3, 'Hamro Share Group', 151, 'Samit Raj Shilpkar', '2017-12-22 08:12:19', ''), (4, 'EBL Nepal', 183, 'Arun Gautam', '2018-07-22 06:32:39', ''), (5, 'suman vs sunita', 188, 'suman pokhrel', '2018-08-17 14:44:01', ''), (8, 'Bonus', 168, 'Tirtha poudel', '2019-05-15 04:44:24', ''), (9, 'Right', 168, 'Tirtha poudel', '2019-05-15 04:44:34', ''), (10, 'Bought New', 168, 'Tirtha poudel', '2019-05-15 04:44:52', '');
-- ---------------------------- -- table structure for tbl_pro_current -- ---------------------------- drop table if exists tbl_pro_current; create table tbl_pro_current ( height int(12) not null, txncount int(11) not null ); insert into tbl_pro_current(height,txncount) values(0,0); -- ---------------------------- -- records of tbl_pro_current -- ---------------------------- -- ---------------------------- -- table structure for tbl_pro_node -- ---------------------------- drop table if exists tbl_pro_node; create table tbl_pro_node ( id char(255) null, url varchar(255) null, nodetype char(1) null, block_status char(1) null, rpc_status char(1) null, updatetime varchar(20) null, system_info varchar(255) null, running_time varchar(255) null ); -- ---------------------------- -- table structure for tbl_pro_blocks -- ---------------------------- drop table if exists tbl_pro_blocks; create table tbl_pro_blocks ( height int(11) not null, hash varchar(64) not null, prevblock varchar(64) null, nextblock varchar(64) null, merkleroot varchar(64) null, blocktime int(11) not null, nonce varchar(20) null, miner varchar(35) null, txnum int(10) null, fee decimal(12,0) null, blocksize int(11) not null, primary key (height) ); -- ---------------------------- -- table structure for tbl_pro_txn_details -- ---------------------------- drop table if exists tbl_pro_txn_details; create table tbl_pro_txn_details ( txid varchar(64) not null, txtype int(4) not null, scripthash varchar(255) null, txtime char(14) not null, txflag char(1) null, height int(12) not null, amount decimal(12,0) null, fee decimal(12,0) null, assetid varchar(255) null, assetname varchar(255) null, txindex int(2) null, prevhash varchar(255) null, previndex varchar(255) null, tohash varchar(255) null, cakey varchar(255) null, spendflag int(1) null, counterparty varchar(255) null, description varchar(255) null, indexinblock int(10) ); -- ---------------------------- -- table structure for tbl_pro_assets -- ---------------------------- drop table if exists tbl_pro_assets; create table tbl_pro_assets ( assetid varchar(64) not null, assetname varchar(255) not null, issue varchar(255) not null, amount decimal(12,0) not null, assetdesc varchar(255) not null, controller varchar(255) not null, precisionlen int(4) not null, height int(12) not null, cakey varchar(255) null, primary key(assetid) ); -- ---------------------------- -- table structure for tbl_pro_machine -- ---------------------------- drop table if exists tbl_pro_machine; create table tbl_pro_machine ( now_date varchar(255) null, node_ip varchar(255) null, cpu_usedper varchar(255) null, mem_usedper varchar(255) null, dis_usedper varchar(255) null ); -- ---------------------------- -- table structure for view_pro_transactions -- ---------------------------- drop view if exists view_pro_transactions; create view view_pro_transactions as select distinct(a.txid) as txid, a.height as height,a.txtype as txtype,a.txtime as txtime,a.cakey as cakey,a.description as description, a.assetid as asserid,a.assetname as assetname,a.indexinblock as indexinblock from tbl_pro_txn_details a;