text
stringlengths
6
9.38M
/*!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 `alarms` -- DROP TABLE IF EXISTS `alarms`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `alarms` ( `OrgId` varchar(100) NOT NULL DEFAULT 'default', `Controller` int(11) NOT NULL, `Time` datetime NOT NULL, `ID` int(11) NOT NULL AUTO_INCREMENT, `AlarmName` varchar(50) NOT NULL, `AlarmState` bit(1) NOT NULL, PRIMARY KEY (`ID`), KEY `IX_Org_Controller_Time` (`OrgId`,`Controller`,`Time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table `audittrail` -- DROP TABLE IF EXISTS `audittrail`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `audittrail` ( `OrgId` varchar(100) NOT NULL DEFAULT 'default', `Controller` int(11) NOT NULL, `Time` datetime NOT NULL, `ID` int(11) NOT NULL AUTO_INCREMENT, `Operator` int(11) NOT NULL DEFAULT '0', `VariableName` varchar(50) NOT NULL, `Value` double NOT NULL, `OldValue` double DEFAULT NULL, PRIMARY KEY (`ID`), KEY `IX_Org_Controller_Time` (`OrgId`,`Controller`,`Time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table `cycledata` -- DROP TABLE IF EXISTS `cycledata`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cycledata` ( `OrgId` varchar(100) NOT NULL DEFAULT 'default', `Controller` int(11) NOT NULL, `Time` datetime NOT NULL, `ID` int(11) NOT NULL AUTO_INCREMENT, `UniqueID` varchar(50) DEFAULT NULL, `Operator` int(11) NOT NULL DEFAULT '0', `OpMode` tinyint(3) unsigned DEFAULT NULL, `JobMode` tinyint(3) unsigned DEFAULT NULL, `JobCard` varchar(100) DEFAULT NULL, `Mold` varchar(100) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `IX_Org_Controller_Time` (`OrgId`,`Controller`,`Time`), KEY `IX_UniqueID` (`UniqueID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table `cycledatavalues` -- DROP TABLE IF EXISTS `cycledatavalues`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cycledatavalues` ( `ID` int(11) NOT NULL, `VariableName` varchar(50) NOT NULL, `Value` double NOT NULL, PRIMARY KEY (`ID`,`VariableName`), CONSTRAINT `FK_CycleData` FOREIGN KEY (`ID`) REFERENCES `cycledata` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table `events` -- DROP TABLE IF EXISTS `events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `events` ( `OrgId` varchar(100) NOT NULL DEFAULT 'default', `Controller` int(11) NOT NULL, `Time` datetime NOT NULL, `ID` int(11) NOT NULL AUTO_INCREMENT, `Operator` int(11) DEFAULT '0', `Connected` bit(1) DEFAULT NULL, `IP` varchar(25) DEFAULT NULL, `GeoLatitude` double DEFAULT NULL, `GeoLongitude` double DEFAULT NULL, `OpMode` tinyint(3) unsigned DEFAULT NULL, `JobMode` tinyint(3) unsigned DEFAULT NULL, `JobCard` varchar(100) DEFAULT NULL, `Mold` char(38) DEFAULT NULL, PRIMARY KEY (`ID`), KEY `IX_Org_Controller_Time` (`OrgId`,`Controller`,`Time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; /*!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 */;
SELECT PR_CORE_YTD.DIVISION_NAME AS REGION, PR_CORE_YTD.REGION_NAME AS DISTRICT, PR_CORE_YTD.ACCOUNT_NAME, --PR_CORE_YTD.YEARMONTH, PR_CORE_YTD.TITLE_DESC, PR_CORE_YTD.SALESMAN_CODE REP_CODE, PR_CORE_YTD.SALESREP_NAME, --HIER.BUSCAT2, NVL (HIER.HILEV, 'SP-') HILEV, HIER.DET1, --HIER.DET2, -- NVL (PR_CORE_YTD.DISCOUNT_GROUP_NK, 'SP-') AS DISC_GRP, -- HIER.DESCRIPTION, SUM (PR_CORE_YTD.LINES) LINES, SUM (PR_CORE_YTD.AVG_COGS) AVG_COGS, SUM (PR_CORE_YTD.INVOICE_COGS) INVOICE_COGS, SUM (PR_CORE_YTD.SALES) SALES, SUM (PR_CORE_YTD.CORE_COST_SUBTOTAL) CORE_COST_SUBTOTAL, SUM (PR_CORE_YTD.CORE_ADJ_AVG_COGS) CORE_ADJ_AVG_COGS FROM AAA6863.PR_CORE_YTD2_SEHVAC PR_CORE_YTD LEFT OUTER JOIN USER_SHARED.BUSGRP_PROD_HIERARCHY HIER ON (PR_CORE_YTD.DISCOUNT_GROUP_NK = HIER.DISCOUNT_GROUP_NK) GROUP BY PR_CORE_YTD.DIVISION_NAME, PR_CORE_YTD.REGION_NAME, PR_CORE_YTD.ACCOUNT_NAME, --PR_CORE_YTD.YEARMONTH, PR_CORE_YTD.SALESMAN_CODE, PR_CORE_YTD.SALESREP_NAME, PR_CORE_YTD.TITLE_DESC, --HIER.BUSCAT2, NVL (HIER.HILEV, 'SP-'), HIER.DET1--, --HIER.DET2, --PR_CORE_YTD.DISCOUNT_GROUP_NK, --HIER.DESCRIPTION ;
SELECT CASE chars.name WHEN '<control>' THEN '' ELSE '&#' || code || ';' END AS char, chars.code, chars.code_hex AS "hexCode", chars.name, chars.alt_name AS "altName", chars.wgl4, chars.html_entity AS "htmlEntity", blocks.name AS block, blocks.id AS "blockId" FROM chars INNER JOIN blocks ON chars.block_id = blocks.id
CREATE TABLE `activities` ( `id` int(11) NOT NULL AUTO_INCREMENT, `UUID` varchar(255) DEFAULT NULL, `version` bigint(20) DEFAULT NULL, `activityEntryId` int(11) NOT NULL, `activityStreamEntryType` int(11) DEFAULT NULL, `activityTime` datetime DEFAULT NULL, `eventJson` varchar(255) DEFAULT NULL, `userId` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK_7f76jrr3lb9i0k82nlcu3djhs` (`userId`), CONSTRAINT `FK_7f76jrr3lb9i0k82nlcu3djhs` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP PROCEDURE CPI.EXT_PRODUCTION_ACCTNG; CREATE OR REPLACE PROCEDURE CPI.Ext_Production_Acctng IS /** Created by: Lhen Valderrama Date Created : 10/31/03 This bulk procedure will extract production summary(including RI production) versus payment summary on a particular period, regardless if there is no production summary but has acctng transaction made summary and vice versa. **/ TYPE tab_acct_date IS TABLE OF gipi_polbasic.acct_ent_date%TYPE; TYPE tab_line IS TABLE OF eim_prodacctg_ext.line_cd%TYPE; TYPE tab_subline IS TABLE OF eim_prodacctg_ext.subline_cd%TYPE; TYPE tab_branch IS TABLE OF eim_prodacctg_ext.branch_cd%TYPE; TYPE tab_intm IS TABLE OF eim_prodacctg_ext.intm_no%TYPE; TYPE tab_assd IS TABLE OF eim_prodacctg_ext.assd_no%TYPE; TYPE tab_pol_id IS TABLE OF eim_prodacctg_ext.policy_id%TYPE; TYPE tab_prod_tsi IS TABLE OF eim_prodacctg_ext.prod_prem%TYPE; TYPE tab_prod_prem IS TABLE OF eim_prodacctg_ext.prod_tsi%TYPE; TYPE tab_prod_nop IS TABLE OF eim_prodacctg_ext.prod_nop%TYPE; TYPE tab_colln_branch IS TABLE OF eim_prodacctg_ext.colln_branch%TYPE; TYPE tab_or_pref_suf IS TABLE OF eim_prodacctg_ext.or_pref_suf%TYPE; TYPE tab_or_no IS TABLE OF eim_prodacctg_ext.or_no%TYPE; TYPE tab_payor IS TABLE OF eim_prodacctg_ext.payor%TYPE; TYPE tab_prem_seq_no IS TABLE OF eim_prodacctg_ext.prem_seq_no%TYPE; TYPE tab_colln_prem IS TABLE OF eim_prodacctg_ext.colln_prem%TYPE; TYPE tab_comm_amt IS TABLE OF eim_prodacctg_ext.comm_amt%TYPE; TYPE tab_input_vat IS TABLE OF eim_prodacctg_ext.input_vat%TYPE; TYPE tab_tax_amt IS TABLE OF eim_prodacctg_ext.tax_amt%TYPE; TYPE tab_colln_amt IS TABLE OF eim_prodacctg_ext.colln_amt%TYPE; TYPE tab_particulars IS TABLE OF eim_prodacctg_ext.particulars%TYPE; TYPE tab_tran_date IS TABLE OF eim_prodacctg_ext.tran_date%TYPE; TYPE tab_posting_date IS TABLE OF eim_prodacctg_ext.posting_date%TYPE; v_acct_date tab_acct_date; v_line tab_line; v_subline tab_subline; v_branch tab_branch; v_intm tab_intm; v_assd tab_assd; v_pol_id tab_pol_id; v_prod_tsi tab_prod_tsi; v_prod_prem tab_prod_prem; v_prod_nop tab_prod_nop; v_colln_branch tab_colln_branch; v_or_pref_suf tab_or_pref_suf; v_or_no tab_or_no; v_payor tab_payor; v_prem_seq_no tab_prem_seq_no; v_colln_prem tab_colln_prem; v_comm_amt tab_comm_amt; v_input_vat tab_input_vat; v_tax_amt tab_tax_amt; v_colln_amt tab_colln_amt; v_particulars tab_particulars; v_tran_date tab_tran_date; v_posting_date tab_posting_date; BEGIN /** to delete previous data before extracting to have an updated data**/ DELETE eim_prodacctg_ext WHERE user_id = USER; /** union has been created here to grouped data of production and of losses **/ SELECT acct_prod_date, line, subline, branch, intm, assd, policy_id, prod_tsi, prod_prem, prod_nop, colln_branch, or_pref_suf, or_no, payor, prem_seq_no, colln_prem, comm_amt, input_vat, tax_amt, colln_amt, particulars, tran_date, posting_date BULK COLLECT INTO v_acct_date , v_line , v_subline , v_branch , v_intm , v_assd , v_pol_id , v_prod_tsi , v_prod_prem , v_prod_nop , v_colln_branch , v_or_pref_suf , v_or_no , v_payor , v_prem_seq_no , v_colln_prem , v_comm_amt , v_input_vat , v_tax_amt , v_colln_amt , v_particulars , v_tran_date , v_posting_date FROM (SELECT TRUNC(a.acct_ent_date) acct_prod_date, f.line_cd line, f.subline_cd subline, a.iss_cd branch, c.intrmdry_intm_no intm, b.assd_no assd, a.policy_id, SUM(ROUND(a.tsi_amt*c.share_percentage/100,2)) prod_tsi, SUM(ROUND(c.premium_amt*d.currency_rt,2)) prod_prem, SUM(DECODE(a.endt_seq_no, 0,1,0)) prod_nop, h.colln_branch, h.or_pref_suf, h.or_no, h.payor, h.prem_seq_no, SUM(NVL(h.premium_amt,0)) colln_prem, SUM(NVL(h.comm_amt,0)) comm_amt, SUM(NVL(h.input_vat_amt,0)) input_vat, SUM(NVL(h.tax_amt,0)) tax_amt, SUM(NVL(h.collection_amt,0)) colln_amt, h.particulars, h.tran_date, h.posting_date FROM gipi_parlist b, gipi_polbasic a, gipi_comm_invoice c, gipi_invoice d, giis_line e, giis_subline f, (SELECT a.gibr_branch_cd colln_branch, a.or_pref_suf, a.or_no, a.payor, b.b140_prem_seq_no prem_seq_no, b.premium_amt, e.comm_amt, e.input_vat_amt, b.tax_amt, b.collection_amt, a.particulars, c.tran_date, c.posting_date, b.b140_iss_cd iss_cd FROM giac_direct_prem_collns b, giac_acctrans c, giac_comm_payts e, giac_order_of_payts a WHERE a.gacc_tran_id = b.gacc_tran_id AND a.gacc_tran_id = c.tran_id AND c.tran_flag <> 'D' AND e.gacc_tran_id = a.gacc_tran_id AND e.iss_cd = b.b140_iss_cd AND e.prem_seq_no = b.b140_prem_seq_no AND NOT EXISTS (SELECT gacc_tran_id FROM giac_acctrans z,giac_reversals t WHERE z.tran_id = t.reversing_tran_id AND z.tran_id = a.gacc_tran_id AND z.tran_flag <>'D')) h WHERE 1 = 1 AND e.line_cd = f.line_cd AND f.line_cd = a.line_cd(+) AND f.subline_cd = a.subline_cd(+) AND a.par_id = b.par_id AND a.policy_id = c.policy_id AND a.policy_id = c.policy_id AND a.policy_id = c.policy_id+0 AND c.iss_cd = h.iss_cd(+) AND c.prem_seq_no = h.prem_seq_no(+) AND c.iss_cd = d.iss_cd AND c.prem_seq_no = d.prem_seq_no AND a.policy_id > -1 AND b.par_id > -1 AND NVL(e.sc_tag,'N') <> 'Y' AND NVL(f.op_flag, 'N') <> 'Y' AND e.line_cd > '%' AND c.iss_cd > '%' AND c.prem_seq_no > -10 AND a.acct_ent_date IS NOT NULL GROUP BY TRUNC(a.acct_ent_date), f.line_cd, f.subline_cd, a.iss_cd, c.intrmdry_intm_no, b.assd_no, a.policy_id, a.pol_flag, h.colln_branch, h.or_pref_suf, h.or_no, h.payor, h.prem_seq_no, h.particulars, h.tran_date, h.posting_date UNION SELECT TRUNC(a.spld_acct_ent_date) acct_prod_date, f.line_cd line, f.subline_cd subline, a.iss_cd branch, c.intrmdry_intm_no intm, b.assd_no assd, a.policy_id, SUM(ROUND(a.tsi_amt*c.share_percentage/100,2)*-1) prod_tsi, SUM(ROUND(c.premium_amt*d.currency_rt,2)*-1) prod_prem, SUM(DECODE(a.endt_seq_no, 0,1,0)) prod_nop, h.colln_branch, h.or_pref_suf, h.or_no, h.payor, h.prem_seq_no, SUM(NVL(h.premium_amt,0)*-1) colln_prem, SUM(NVL(h.comm_amt,0)*-1) comm_amt, SUM(NVL(h.input_vat_amt,0)*-1) input_vat, SUM(NVL(h.tax_amt,0)*-1) tax_amt, SUM(NVL(h.collection_amt,0)*-1) colln_amt, h.particulars, h.tran_date, h.posting_date FROM gipi_parlist b, gipi_polbasic a, gipi_comm_invoice c, gipi_invoice d, giis_line e, giis_subline f, (SELECT a.gibr_branch_cd colln_branch, a.or_pref_suf, a.or_no, a.payor, b.b140_prem_seq_no prem_seq_no, b.premium_amt, e.comm_amt, e.input_vat_amt, b.tax_amt, b.collection_amt, a.particulars, c.tran_date, c.posting_date, b.b140_iss_cd iss_cd FROM giac_direct_prem_collns b, giac_acctrans c, giac_comm_payts e, giac_order_of_payts a WHERE a.gacc_tran_id = b.gacc_tran_id AND a.gacc_tran_id = c.tran_id AND c.tran_flag <> 'D' AND e.gacc_tran_id = a.gacc_tran_id AND e.iss_cd = b.b140_iss_cd AND e.prem_seq_no = b.b140_prem_seq_no AND NOT EXISTS (SELECT gacc_tran_id FROM giac_acctrans z,giac_reversals t WHERE z.tran_id = t.reversing_tran_id AND z.tran_id = a.gacc_tran_id AND z.tran_flag <>'D')) h WHERE 1 = 1 AND e.line_cd = f.line_cd AND f.line_cd = a.line_cd(+) AND f.subline_cd = a.subline_cd(+) AND a.par_id = b.par_id AND a.policy_id = c.policy_id AND a.policy_id = c.policy_id AND a.policy_id = c.policy_id+0 AND c.iss_cd = h.iss_cd(+) AND c.prem_seq_no = h.prem_seq_no(+) AND c.iss_cd = d.iss_cd AND c.prem_seq_no = d.prem_seq_no AND a.policy_id > -1 AND b.par_id > -1 AND NVL(e.sc_tag,'N') <> 'Y' AND NVL(f.op_flag, 'N') <> 'Y' AND e.line_cd > '%' AND c.iss_cd > '%' AND c.prem_seq_no > -10 AND a.spld_acct_ent_date IS NOT NULL GROUP BY TRUNC(a.spld_acct_ent_date), f.line_cd, f.subline_cd, a.iss_cd, c.intrmdry_intm_no, b.assd_no, a.policy_id, h.colln_branch, h.or_pref_suf, h.or_no, h.payor, h.prem_seq_no, h.particulars, h.tran_date, h.posting_date); IF SQL%FOUND THEN FOR cnt IN v_acct_date.first..v_acct_date.last LOOP INSERT INTO eim_prodacctg_ext ( acct_prod_date, assd_no, assured_name, prem_seq_no, branch_cd, branch_name, colln_amt, colln_branch, colln_branch_name, colln_prem, comm_amt, extraction_date, input_vat, intermediary_name, intm_no, intm_type, intm_type_desc, line_cd, line_name, or_no, particulars, payor, policy_id, policy_no, posting_date, prod_nop, prod_tsi, subline_cd, subline_name, tax_amt, tran_date, user_id, prod_prem, or_pref_suf) VALUES ( v_acct_date(cnt), v_assd(cnt), Get_Assd_Name(v_assd(cnt)), v_prem_seq_no(cnt), v_branch(cnt), Get_Iss_Name(v_branch(cnt)), v_colln_amt(cnt), v_colln_branch(cnt), Get_Iss_Name(v_colln_branch(cnt)), v_colln_prem(cnt), v_comm_amt(cnt), TRUNC(SYSDATE), v_input_vat(cnt), Get_Intm_Name(v_intm(cnt)), v_intm(cnt), Get_Intm_Type(v_intm(cnt)), Get_Intm_Type_Desc(Get_Intm_Type(v_intm(cnt))),v_line(cnt), Get_Line_Name(v_line(cnt)), v_or_no(cnt), v_particulars(cnt), v_payor(cnt), v_pol_id(cnt), Get_Policy_No(v_pol_id(cnt)), v_posting_date(cnt), v_prod_nop(cnt), v_prod_tsi(cnt), v_subline(cnt), Get_Subline_Name(v_subline(cnt)), v_tax_amt(cnt), v_tran_date(cnt), NULL, v_prod_prem(cnt), v_or_pref_suf(cnt)); END LOOP; COMMIT; END IF; END; / DROP PROCEDURE CPI.EXT_PRODUCTION_ACCTNG;
-- -- P_L1_TO_L2_VOICE_TEMP (Procedure) -- CREATE OR REPLACE PROCEDURE DWH_USER.P_L1_TO_L2_VOICE_TEMP (P_PROCESS_DATE VARCHAR2) IS VCOUNT NUMBER; VDATE_KEY NUMBER; VSTATUS NUMBER; VSTATUS2 NUMBER; VDATE DATE := TO_DATE(TO_DATE(P_PROCESS_DATE,'YYYYMMDD'),'DD/MM/RRRR'); BEGIN SELECT COUNT(*) INTO VCOUNT FROM CDR_HEAD_MERGE WHERE SOURCE = 'voice' AND PROCESS_STATUS = 96 AND TO_DATE(PROCESS_DATE,'DD/MM/RRRR') = VDATE; SELECT DATE_KEY INTO VDATE_KEY FROM DATE_DIM WHERE DATE_KEY = (SELECT A.DATE_KEY FROM DATE_DIM A WHERE A.DATE_VALUE = VDATE); IF VCOUNT >= 1 THEN INSERT INTO ETL_LOG (LAYER, DATE_KEY, SOURCE, STATUS, FILE_COUNT, PER_COUNT, POST_COUNT, INSERT_TIME) VALUES ('L1_VOICE',VDATE_KEY,'voice','96',VCOUNT,'','',SYSDATE); COMMIT; SELECT STATUS INTO VSTATUS FROM ETL_LOG WHERE DATE_KEY = (SELECT A.DATE_KEY FROM DATE_DIM A WHERE A.DATE_VALUE = VDATE-1) AND LAYER = 'L2_VOICE' AND SOURCE = 'voice'; SELECT STATUS INTO VSTATUS2 FROM TEMP_TABLE_ALTER_LOG WHERE trunc(ALTER_DATE) = trunc(sysdate) AND TABLE_NAME = 'L1_VOICE_TEMP'; IF VSTATUS = 96 AND VSTATUS2= 96 THEN INSERT INTO ETL_LOG (LAYER, DATE_KEY, SOURCE, STATUS, FILE_COUNT, PER_COUNT, POST_COUNT, INSERT_TIME) VALUES ('L2_VOICE',VDATE_KEY,'voice','30',VCOUNT,'','',SYSDATE); COMMIT; INSERT INTO L2_VOICE SELECT /*+ PARALLEL(V,16) */ C.DATE_KEY AS ETL_DATE_KEY, v.FILE_NAME, V24_SERVICE_CATEGORY , V25_USAGE_SERVICE_TYPE , V35_RATE_USAGE , V36_SERVICE_UNIT_TYPE , NVL(V41_DEBIT_AMOUNT,0) / 1000000 AS V41_DEBIT_AMOUNT, NVL(V44_DEBIT_FROM_ADVANCE_PRE,0) / 1000000 AS V44_DEBIT_FROM_ADVANCE_PRE, V49_PAY_FREE_UNIT_TIMES , V50_PAY_FREE_UNIT_DURATION , NVL(V55_CUR_BALANCE,0) / 1000000 AS V55_CUR_BALANCE, V372_CALLINGPARTYNUMBER , V373_CALLEDPARTYNUMBER , V378_SERVICEFLOW , V380_CALLINGROAMINFO , V381_CALLINGCELLID , V383_CALLEDCELLID , V386_BEARERCAPABILITY , B.DATE_KEY AS V387_CHARGINGTIME_KEY , -- convert to key TO_CHAR(TO_DATE( SUBSTR(V387_CHARGINGTIME,9,4), 'HH24MI')+360/1440, 'HH24MI') AS V387_CHARGINGTIME_HOUR,--SUBSTR(V387_CHARGINGTIME,9,4) AS V387_CHARGINGTIME_HOUR ,-- NEW V389_TERMINATIONREASON , V391_IMEI , V394_REDIRECTINGPARTYID , V395_MSCADDRESS , V397_MAINOFFERINGID , V400_PAYTYPE , V403_ROAMSTATE , V405_CALLINGHOMEAREANUMBER , V417_HOTLINEINDICATOR, V425_CALLINGNETWORKTYPE , V434_ONLINECHARGINGFLAG , V457_PREPAID_BALANCE / 1000000 as V457_PREPAID_BALANCE, V476_ONNETINDICATOR , V402_CALLTYPE , V436_LASTEFFECTOFFERING FROM L1_VOICE_TEMP_FULL V,DATE_DIM B,DATE_DIM C WHERE TO_CHAR(B.DATE_VALUE,'YYYYMMDD')=TO_CHAR(TO_DATE( SUBSTR(V.V387_CHARGINGTIME,1,12), 'YYYYMMDDHH24MI')+6/24, 'YYYYMMDD')--WHERE TO_DATE(B.DATE_VALUE,'DD/MM/YYYY')=TO_DATE(TO_DATE( SUBSTR(V.V387_CHARGINGTIME,1,8), 'YYYYMMDD'), 'DD/MM/YYYY') AND TRUNC(C.DATE_VALUE)=TRUNC(SYSDATE-1); COMMIT; UPDATE ETL_LOG SET STATUS = 96, UPDATE_TIME=SYSDATE WHERE DATE_KEY = VDATE_KEY AND LAYER = 'L2_VOICE'; COMMIT; END IF; ELSE INSERT INTO ETL_LOG (LAYER, DATE_KEY, SOURCE, STATUS, FILE_COUNT, PER_COUNT, POST_COUNT, INSERT_TIME) VALUES ('L2_VOICE',VDATE_KEY,'voice','34',VCOUNT,'','',SYSDATE); COMMIT; END IF; EXCEPTION WHEN OTHERS THEN NULL; END; /
create table users ( id int primary key, name varchar(128), login varchar(32), passwd varchar(32) );
/* Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 50172 Source Host : localhost:3306 Source Database : express Target Server Type : MYSQL Target Server Version : 50172 File Encoding : 65001 Date: 2016-10-12 22:01:51 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for wechat_platform -- ---------------------------- DROP TABLE IF EXISTS `wechat_platform`; CREATE TABLE `wechat_platform` ( `app_id` varchar(11) DEFAULT NULL, `app_secret` varchar(255) DEFAULT NULL, `access_token` varchar(255) DEFAULT NULL, `jsapi_ticket` varchar(255) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE quiz_games ( game_id BIGSERIAL NOT NULL PRIMARY KEY, game_date DATE NOT NULL, game_type VARCHAR(100) NOT NULL, table_url VARCHAR(256) NOT NULL ); CREATE TABLE team_results ( team_result_id BIGSERIAL PRIMARY KEY, team_name VARCHAR(100) NOT NULL, game_id BIGINT NOT NULL, place SMALLINT NOT NULL, summary SMALLINT NOT NULL, need_manual_correction BOOLEAN NOT NULL DEFAULT FALSE, FOREIGN KEY (game_id) REFERENCES quiz_games (game_id) ); CREATE TABLE round_results ( round_result_id BIGSERIAL PRIMARY KEY, team_result_id BIGINT NOT NULL, round SMALLINT NOT NULL, result SMALLINT NOT NULL, FOREIGN KEY (team_result_id) REFERENCES team_results (team_result_id) );
SELECT setMetric('OpenMFGServerVersion', '2.3.1RC1');
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 20, 2018 at 11:11 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 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: `riantengineersltdnew` -- -- -------------------------------------------------------- -- -- Table structure for table `galleries` -- CREATE TABLE `galleries` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '0', `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 `galleries` -- INSERT INTO `galleries` (`id`, `title`, `image`, `status`, `created_at`, `updated_at`) VALUES (2, 'new image', 'gallery/vndF3Xb2NLaeWw6RKmRQ49CNY1oEC1cyakqAYM4H.jpeg', 1, '2018-11-20 03:13:17', '2018-11-20 03:13:43'); -- -------------------------------------------------------- -- -- Table structure for table `logos` -- CREATE TABLE `logos` ( `id` int(10) UNSIGNED NOT NULL, `type` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `image` varchar(191) 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; -- -- Dumping data for table `logos` -- INSERT INTO `logos` (`id`, `type`, `status`, `image`, `created_at`, `updated_at`) VALUES (1, 1, 1, 'logo/logo.png', NULL, '2018-11-20 01:30:23'), (2, 3, 1, 'logo/QY4jFAZqo1BCaJkwYf6p0gJa675bwBcPJgBzwcwu.jpeg', '2018-11-20 01:20:21', '2018-11-20 01:46:30'), (4, 2, 1, 'logo/gFfLWP9NSLTYHK7M0QBNq7znVPZ2eARnmTny3qsO.jpeg', '2018-11-20 03:17:28', '2018-11-20 03:17:57'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) 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, '2018_11_03_103159_create_sliders_table', 1), (4, '2018_11_04_110501_create_logos_table', 1), (5, '2018_11_05_103242_create_galleries_table', 1), (6, '2018_11_08_105312_create_services_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) 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 `services` -- CREATE TABLE `services` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL, `image` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(191) 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; -- -- Dumping data for table `services` -- INSERT INTO `services` (`id`, `title`, `status`, `image`, `description`, `created_at`, `updated_at`) VALUES (1, 'Gallery Title', 1, 'service/CeMd5xGn6MQoC0F3aCwIGNfP22tNEwpwoy2y8ilg.jpeg', 'Hello World', '2018-11-20 03:29:49', '2018-11-20 03:46:50'); -- -------------------------------------------------------- -- -- Table structure for table `sliders` -- CREATE TABLE `sliders` ( `id` int(10) UNSIGNED NOT NULL, `slider_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slider_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `slider_subtitle` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '0', `image` varchar(191) 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; -- -- Dumping data for table `sliders` -- INSERT INTO `sliders` (`id`, `slider_name`, `slider_title`, `slider_subtitle`, `status`, `image`, `created_at`, `updated_at`) VALUES (1, 'Slider Name', 'Slider Title', 'Slider Subtitle', 1, 'slider/xBcEe0RtXbnH8rU02dsnMTZGvxaG8EvbK2r7iKMo.jpeg', '2018-11-19 06:53:25', '2018-11-20 01:05:36'), (3, 'Slider', 'test title', 'test subtitle', 1, 'slider/6HRwRUROHb9wJJtlxgfVJ5EvRNYdoHFlQoP7Bgt2.jpeg', '2018-11-19 23:16:04', '2018-11-20 01:06:45'), (5, 'new', 'Innovation', 'test', 1, 'slider/bksD9GRUAsYIf7sVmGapLF7gP5JLH2vvkrmTHXbU.jpeg', '2018-11-20 01:00:05', '2018-11-20 01:07:07'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) 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, 'Admin', 'admin@gmail.com', NULL, '$2y$10$5LY2cA3h8NgV5M7sGZZJNuTYqTzhNGHm1b9AkyPT05yfuKzT6zLju', NULL, '2018-11-19 05:46:07', '2018-11-19 05:46:07'); -- -- Indexes for dumped tables -- -- -- Indexes for table `galleries` -- ALTER TABLE `galleries` ADD PRIMARY KEY (`id`); -- -- Indexes for table `logos` -- ALTER TABLE `logos` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `services` -- ALTER TABLE `services` ADD PRIMARY KEY (`id`); -- -- Indexes for table `sliders` -- ALTER TABLE `sliders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `galleries` -- ALTER TABLE `galleries` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `logos` -- ALTER TABLE `logos` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `services` -- ALTER TABLE `services` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `sliders` -- ALTER TABLE `sliders` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- 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 */;
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 26, 2019 at 03:38 PM -- Server version: 10.4.6-MariaDB -- PHP Version: 7.3.9 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: `perpustakaan` -- -- -------------------------------------------------------- -- -- Table structure for table `books` -- CREATE TABLE `books` ( `id` varchar(5) NOT NULL, `name` varchar(20) DEFAULT NULL, `stok` int(3) DEFAULT NULL, `image` text DEFAULT NULL, `deskripsi` tinytext DEFAULT NULL, `category_id` varchar(5) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `books` -- INSERT INTO `books` (`id`, `name`, `stok`, `image`, `deskripsi`, `category_id`) VALUES ('BO1', 'One Piece', 10, 'images.jpg', 'Buku Anak yang Menceritakan Tentang Perjalan Seorang Bajak Laut', '01'), ('BO2', 'Sejarah Lengkap Indo', 5, 'images (1).jpg', 'Sejak ribuan bahkan jutaan tahun silam, nusantara telah menorehkan jejak sejarahnya sendiri. Kehidupan di nusantara ini memang telah dimulai jauh sebelum kemerdekaan negara kesatuan Republik Indonesia diproklamirkan oleh Soekarno.\r\nDi dalam buku ini, diha', '02'), ('BO3', 'AGAMA UNTUK PERADABA', 2, 'images (2).jpg', 'Agama merupakan elemen penting yang melahirkan peradaban sekaligus menjadi pilar utama penyangganya. Hampir tak ada peradaban besar di dunia lepas dari peran dan pengaruh agama. Agama menjadi sumber inspirasi, fondasi, nilai, maupun etos yang menjaga kebe', '04'), ('BO4', 'Rasulullah Saw: The ', 7, 'images (3).jpg', 'Berbagai literatur sejarah mengungkapkan bahwa Rasulullah Muhammad saw., adalah seseorang yang mempunyai prestasi luar biasa. Beliau berhasil mendirikan peradaban Madinah sebagai mercusuar keunggulan peradaban dunia, menaklukkan kota Mekkah tanpa pertumpa', '03'); -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` varchar(5) NOT NULL, `name` varchar(25) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`) VALUES ('01', 'Komik'), ('02', 'Sejarah'), ('03', 'Novel'), ('04', 'Agama'), ('05', 'Kesehatan'); -- -- Indexes for dumped tables -- -- -- Indexes for table `books` -- ALTER TABLE `books` ADD PRIMARY KEY (`id`), ADD KEY `categories.id` (`category_id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Constraints for dumped tables -- -- -- Constraints for table `books` -- ALTER TABLE `books` ADD CONSTRAINT `categories.id` FOREIGN KEY (`category_id`) REFERENCES `categories` (`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 */;
CREATE TABLE IF NOT EXISTS `user` ( `username` VARCHAR(45) NULL, `password` TEXT NULL, PRIMARY KEY (`username`)); CREATE TABLE IF NOT EXISTS `userotp` ( `username` VARCHAR(45) NOT NULL, `code` VARCHAR(45) NULL, PRIMARY KEY (`username`));
DROP PROCEDURE CPI.GENERATE_REF_NO; CREATE OR REPLACE PROCEDURE CPI.generate_ref_no ( p_acct_iss_cd IN giis_ref_seq.acct_iss_cd%TYPE, p_branch_cd IN giis_ref_seq.branch_cd%TYPE, p_ref_no OUT giis_ref_seq.ref_no%TYPE, p_module_id IN giis_modules.module_id%TYPE) IS v_module_desc giis_modules.module_desc%TYPE; v_ref_no giis_ref_seq.ref_no%TYPE; BEGIN BEGIN SELECT module_desc INTO v_module_desc FROM giis_modules WHERE module_id = p_module_id; EXCEPTION WHEN NO_DATA_FOUND THEN NULL; END; SELECT ref_no INTO v_ref_no FROM giis_ref_seq WHERE acct_iss_cd = p_acct_iss_cd AND branch_cd = p_branch_cd; UPDATE giis_ref_seq SET ref_no = ref_no + 1 WHERE acct_iss_cd = p_acct_iss_cd AND branch_cd = p_branch_cd; IF SQL%FOUND THEN INSERT INTO gipi_ref_no_hist (acct_iss_cd, branch_cd, ref_no, mod_no, user_id, last_update, remarks) VALUES (p_acct_iss_cd, p_branch_cd, v_ref_no + 1, TO_NUMBER (modulus_10 ( TRIM (TO_CHAR (p_acct_iss_cd, '00')) || '-' || TRIM (TO_CHAR (p_branch_cd, '0000')) || '-' || TRIM (TO_CHAR (p_ref_no, '0000000')) ) ), NVL(giis_users_pkg.app_user, USER), SYSDATE, 'Generated using ' || p_module_id || ' - ' || v_module_desc); p_ref_no := v_ref_no + 1; END IF; --COMMIT; EXCEPTION WHEN NO_DATA_FOUND THEN v_ref_no := 1; INSERT INTO giis_ref_seq VALUES (p_acct_iss_cd, p_branch_cd, v_ref_no, NVL(giis_users_pkg.app_user, USER), SYSDATE, 'Generated using ' || p_module_id || ' - ' || v_module_desc); INSERT INTO gipi_ref_no_hist (acct_iss_cd, branch_cd, ref_no, mod_no, user_id, last_update, remarks) VALUES (p_acct_iss_cd, p_branch_cd, v_ref_no, TO_NUMBER (modulus_10 ( TRIM (TO_CHAR (p_acct_iss_cd, '00')) || '-' || TRIM (TO_CHAR (p_branch_cd, '0000')) || '-' || TRIM (TO_CHAR (p_ref_no, '0000000')) ) ), NVL(giis_users_pkg.app_user, USER), SYSDATE, 'Generated using ' || p_module_id || ' - ' || v_module_desc); p_ref_no := v_ref_no; --COMMIT; END generate_ref_no; /
DROP DATABASE lojinha; CREATE DATABASE lojinha CHARSET utf8; USE lojinha; CREATE TABLE institucional ( idInstituicao int NOT NULL AUTO_INCREMENT, nome varchar(50) DEFAULT NULL, cpf_cnpj varchar(14) DEFAULT NULL UNIQUE, tipoPessoa char(1) DEFAULT 'F' COMMENT '{ ''F'' , ''J'' }', endereco varchar(50) DEFAULT NULL, bairro varchar(30) DEFAULT NULL, cidade varchar(50) DEFAULT NULL, uf varchar(2) DEFAULT NULL, cep varchar(9) DEFAULT NULL, telefone varchar(15) DEFAULT NULL, email varchar(100) DEFAULT NULL UNIQUE, logo varchar(255) DEFAULT NULL, PRIMARY KEY (idInstituicao) ); CREATE TABLE nivelUsuarios ( idNivelUsuario int NOT NULL AUTO_INCREMENT, nivel varchar(20) DEFAULT NULL COMMENT '{''Cliente '', ''Funcionário'', ''Caixa '', ''Financeiro '', ''Gerente '', ''Diretor'', ''Administrador''}', PRIMARY KEY (idNivelUsuario) ); CREATE TABLE usuarios ( idUsuario int NOT NULL AUTO_INCREMENT, email varchar(100) DEFAULT NULL UNIQUE, senha varchar(64) NOT NULL, idNivelUsuario int DEFAULT '1', nome varchar(50) DEFAULT NULL, cpf varchar(14) DEFAULT NULL UNIQUE, endereco varchar(50) DEFAULT NULL, bairro varchar(30) DEFAULT NULL, cidade varchar(50) DEFAULT NULL, uf varchar(2) DEFAULT NULL, cep varchar(9) DEFAULT NULL, telefone varchar(15) DEFAULT NULL, foto varchar(255) DEFAULT NULL, ativo varchar(1) DEFAULT 'N', PRIMARY KEY (idUsuario) ); CREATE TABLE categorias ( idCategoria int NOT NULL AUTO_INCREMENT, descricao varchar(30) DEFAULT NULL, PRIMARY KEY (idCategoria) ); CREATE TABLE produtos ( idProduto int NOT NULL AUTO_INCREMENT, fabricante varchar(100) DEFAULT NULL, nome varchar(100) DEFAULT NULL, marca varchar(100) DEFAULT NULL, modelo varchar(100) DEFAULT NULL, idCategoria int DEFAULT NULL, descricao text, unidadeMedida varchar(15) DEFAULT NULL, largura decimal(10,3) DEFAULT NULL COMMENT '9999999.999', altura decimal(10,3) DEFAULT NULL COMMENT '9999999.999', profundidade decimal(10,3) DEFAULT NULL COMMENT '9999999.999', peso decimal(10,3) DEFAULT NULL COMMENT '9999999.999', cor varchar(7) DEFAULT NULL, dtFabricacao varchar(45) DEFAULT NULL, PRIMARY KEY (idProduto), FOREIGN KEY (idCategoria) REFERENCES categorias (idCategoria) ); CREATE TABLE estoque ( idEstoque int NOT NULL AUTO_INCREMENT, idProduto int DEFAULT NULL, dtEntrada date DEFAULT NULL COMMENT 'YYYY/MM/DD', quantidade int DEFAULT '0', dtFabricacao date DEFAULT NULL COMMENT 'YYYY/MM/DD', dtVencimento date DEFAULT NULL COMMENT 'YYYY/MM/DD', nfCompra text, precoCompra decimal(15,2) DEFAULT NULL, icmsCompra decimal(15,2) DEFAULT NULL, precoVenda decimal(15,2) DEFAULT NULL, qtdVendida int DEFAULT NULL, qtdOcorrencia int DEFAULT NULL, ocorrencia varchar(1024) DEFAULT NULL, PRIMARY KEY (idEstoque), FOREIGN KEY (idProduto) REFERENCES produtos (idProduto) ); CREATE TABLE pedidos ( idPedido int NOT NULL AUTO_INCREMENT, idUsuario int DEFAULT NULL, dtPedido datetime DEFAULT NULL, dtPagamento datetime DEFAULT NULL, dtNotaFiscal datetime DEFAULT NULL, notaFiscal text, dtEnvio datetime DEFAULT NULL, dtRecebimento datetime DEFAULT NULL, tipoFrete int DEFAULT '0' COMMENT '{ { 0, Retirada }, { 1, PAC }, { 2, SEDEX }, { 3, MOTOBOY }, { 4, TRANSPORTADORA} }', rastreioFrete varchar(255) DEFAULT NULL, entregaendereco varchar(50) DEFAULT NULL, entregaNumero varchar(10) DEFAULT NULL, entregaCompl varchar(50) DEFAULT NULL, entregaBairro varchar(30) DEFAULT NULL, entregaCidade varchar(50) DEFAULT NULL, entregaUF varchar(2) DEFAULT NULL, entregaCEP varchar(9) DEFAULT NULL, entregaTelefone varchar(15) DEFAULT NULL, entregaRefer varchar(255) DEFAULT NULL, valorTotal decimal(12,2) DEFAULT NULL, qtdItems int DEFAULT NULL, dtDevolucao datetime DEFAULT NULL, motivoDevolucao text, PRIMARY KEY (idPedido), FOREIGN KEY (idUsuario) REFERENCES usuarios (idUsuario) ); CREATE TABLE itemsPedido ( idItemPedido int NOT NULL AUTO_INCREMENT, ordem int DEFAULT NULL, idPedido int DEFAULT NULL, idEstoque int DEFAULT NULL, qtdItem int DEFAULT NULL, dtDevolucao datetime DEFAULT NULL, motivoDevolucao text, PRIMARY KEY (idItemPedido), FOREIGN KEY (idEstoque) REFERENCES estoque (idEstoque) );
begin declare num int; set num = 1; while num < 2 do select @day:=MAX(tran_timestamp) from 10x_access_transactions; select @date:=MAX(TRAN_DATE) from 10x_access_transactions; select @maxid:=MAX(tran_ID) from 10x_access_transactions; insert into 10x_access_transactions (tran_ID, GATEWAY_ID, tran_timestamp,TRAN_TIMESTAMP_EST,LOCAL_TIME, INSERT_TS,UPDATE_TS,ACCESS_STATUS_ID,TRAN_DATE,TRAN_DATE_EST) select tran_ID+@maxid,GATEWAY_ID,date_add(from_unixtime(UNIX_TIMESTAMP(@day)+ UNIX_TIMESTAMP(@day)-UNIX_TIMESTAMP(tran_timestamp)),interval 1 month), date_add(from_unixtime(UNIX_TIMESTAMP(@day)+ UNIX_TIMESTAMP(@day)-UNIX_TIMESTAMP(TRAN_TIMESTAMP_EST)),interval 1 month),date_add(from_unixtime(UNIX_TIMESTAMP(@day)+ UNIX_TIMESTAMP(@day)-UNIX_TIMESTAMP(LOCAL_TIME)),interval 1 month) ,date_add(from_unixtime(UNIX_TIMESTAMP(@day)+ UNIX_TIMESTAMP(@day)-UNIX_TIMESTAMP(INSERT_TS)),interval 1 month) , date_add(from_unixtime(UNIX_TIMESTAMP(@day)+ UNIX_TIMESTAMP(@day)-UNIX_TIMESTAMP(UPDATE_TS)),interval 1 month) ,1 ,convert(date_add(from_unixtime(UNIX_TIMESTAMP(@date)+ UNIX_TIMESTAMP(@date)-UNIX_TIMESTAMP(TRAN_DATE)),interval 1 month),date) ,convert(date_add(from_unixtime(UNIX_TIMESTAMP(@date)+ UNIX_TIMESTAMP(@date)-UNIX_TIMESTAMP(TRAN_DATE_EST)),interval 1 month),date) from access_transactions; set num=num+1; end while; end
alter table workflow_base add isneeddelacc varchar2(1) / update workflow_base set isneeddelacc='0' /
CREATE TABLE Клієнт( Код_клієнта INTEGER NOT NULL, Імя CHAR(15) NOT NULL, Номер_телефону INTEGER, Прізвище CHAR(20) NOT NULL, По_батькові CHAR(20) NOT NULL, Електронна_пошта VARCHAR(50) NOT NULL, PRIMARY KEY (Код_клієнта), ); CREATE TABLE Постачальник( Код_постачальника INTEGER NOT NULL, Назва_фірми CHAR(15) NOT NULL, Посилання_на_веб_сторінку VARCHAR(30) NOT NULL, Місто_розташування CHAR(20) NOT NULL, Вулиця CHAR(20) NOT NULL, Будинок CHAR(6) NOT NULL, Номер_телефону INTEGER, PRIMARY KEY (Код_постачальника) ); CREATE TABLE Адміністратор( Код_адміністратора INTEGER NOT NULL, Імя CHAR(15) NOT NULL, Номер_телефону_адміністратора INTEGER, Прізвище CHAR(20) NOT NULL, По_батькові CHAR(20) NOT NULL, Електронна_пошта VARCHAR(50) NOT NULL, PRIMARY KEY (Код_адміністратора), ); CREATE TABLE Салон( Код_салону INTEGER NOT NULL, Назва_салону CHAR(15) NOT NULL, Посилання_на_веб_сторінку VARCHAR(50) NOT NULL, Місто_розташування CHAR(15) NOT NULL, Вулиця CHAR(20) NOT NULL, Будинок CHAR(6) NOT NULL, Опис_салону CHAR(100) NOT NULL, PRIMARY KEY (Код_салону) ); CREATE TABLE Авто( Код_авто INTEGER NOT NULL, Тип_авто CHAR(20) NOT NULL, Колір CHAR(15) NOT NULL, Модель CHAR(20) NOT NULL, Рік_випуску INTEGER NOT NULL, Максимальна_швидкість INTEGER NOT NULL, PRIMARY KEY (Код_авто) ); CREATE TABLE Контракт( Код_контракту INTEGER NOT NULL, Код_салону INTEGER NOT NULL, Код_адміністратора INTEGER NOT NULL, Дата_заключення DATE NOT NULL, Дата_закінчення DATE NOT NULL, PRIMARY KEY(Код_контракту), CONSTRAINT Фксалон FOREIGN KEY(Код_салону) REFERENCES Салон ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT Фкадміністратора FOREIGN KEY(Код_адміністратора) REFERENCES Адміністратор ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE Договір_про_оренду( Код_договору_про_оренду INTEGER NOT NULL, Код_клієнта INTEGER NOT NULL, Код_салону INTEGER NOT NULL, Код_авто INTEGER NOT NULL, Код_адміністратора INTEGER NOT NULL, Дата_заключення DATE NOT NULL, Дата_закінчення DATE NOT NULL, Ціна_оренди MONEY NOT NULL, PRIMARY KEY(Код_договору_про_оренду), CONSTRAINT Фкклієнта FOREIGN KEY(Код_клієнта) REFERENCES клієнт ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT Фкавто FOREIGN KEY(Код_авто) REFERENCES авто ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT Фк_адміністратора FOREIGN KEY(Код_адміністратора) REFERENCES Адміністратор ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT Фк_салон FOREIGN KEY(Код_салону) REFERENCES Салон ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE Договір_поставки( Код_договору_поставки INTEGER NOT NULL, Код_салону INTEGER NOT NULL, Код_постачальника INTEGER NOT NULL, Дата_заключення DATE NOT NULL, Дата_закінчення DATE NOT NULL, Кількість_авто INTEGER NOT NULL, Список_авто CHAR(80) NOT NULL, Сума_виплати MONEY NOT NULL, PRIMARY KEY(Код_договору_поставки), CONSTRAINT Фксалону FOREIGN KEY(Код_салону) REFERENCES Салон ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT Фкпостачальника FOREIGN KEY(Код_постачальника) REFERENCES постачальник ON DELETE CASCADE ON UPDATE CASCADE );
CREATE TABLE EMPLOYEE ( ID NUMBER GENERATED ALWAYS AS IDENTITY INCREMENT BY 1 START WITH 1 MINVALUE 1 NOT NULL, TEAM_ID NUMBER, DEPARTMENT_ID NUMBER, FIRSTNAME VARCHAR2(100) NOT NULL, MIDDLENAME VARCHAR2(100), LASTNAME VARCHAR2(100) NOT NULL, EMAIL VARCHAR2(350) ); COMMENT ON COLUMN EMPLOYEE.ID IS 'Unique value, serves as the primary key for the table'; COMMENT ON COLUMN EMPLOYEE.TEAM_ID IS 'Id of team that employee may belongs to'; COMMENT ON COLUMN EMPLOYEE.DEPARTMENT_ID IS 'Id of department that employee belongs to'; COMMENT ON COLUMN EMPLOYEE.FIRSTNAME IS 'Employee firstname'; COMMENT ON COLUMN EMPLOYEE.MIDDLENAME IS 'Employee middlename, may be null in specific cases' ; COMMENT ON COLUMN EMPLOYEE.LASTNAME IS 'Employee lastname'; COMMENT ON COLUMN EMPLOYEE.EMAIL IS 'Employee email';
Create Database ebookrepository Use ebookrepository Create Table book_language ( language_id Integer Primary Key Not Null Auto_increment, language_name Varchar(30), language_deleted Bit ); Create Table category ( category_id Integer Primary Key Not Null Auto_increment, category_name Varchar(30), category_deleted Bit ); Create Table book_file ( file_id Integer Primary Key Not Null Auto_increment, file_name Varchar(200), file_mime Varchar(100) ); Create Table app_user ( app_user_id Integer Primary Key Not Null Auto_increment, app_user_firstname Varchar(30), app_user_lastname Varchar(30), app_user_username Varchar(10) Unique Not Null, app_user_password Varchar(10), app_user_category_id Integer, app_user_type Varchar(30), app_user_deleted Bit, Foreign Key (app_user_category_id) References category(category_id) ); Create Table ebook ( eBook_id Integer Primary Key Not Null Auto_increment, eBook_title Varchar(80), eBook_author Varchar(120), eBook_keywords Varchar(120), eBook_publication_year Integer, eBook_language Integer, eBook_category Integer, eBook_file_id Integer, eBook_deleted Bit, Foreign Key (eBook_language) References book_language(language_id), Foreign Key (eBook_category) References category(category_id), Foreign Key (eBook_file_id) References book_file(file_id) );
exec fias.dict.spgetaddress N'ЕКАТЕРИНБУРГ Г, СВЕТЛЫЙ ПЕР, Д.3', '0697B011-731C-45C3-847F-D4319F59004D' with n as ( select ha.houseguid as BuildingId ,ha.aoguid as LocationId ,ha.postalcode as PostCode ,ha.address as AddressStr ,ha.regioncode as RegionId ,'383' as apartment ,hp.aoguid as PlacementId ,hp.name as Placement from fias.dict.houseactive ha inner join fias.dict.hierarchy h on h.aoguid = ha.aoguid inner join fias.dict.hierarchy hp on hp.aoguid = h.placementGuid where ha.houseguid = '22AE4B51-9C48-45D4-AFC8-BF6EA7D928DE' ) update a set a.BuildingId = n.BuildingId ,a.LocationId = n.LocationId ,a.PostCode = n.PostCode ,a.AddressStr = n.AddressStr ,a.RegionId = n.RegionId ,a.apartment = n.apartment ,a.PlacementId = n.PlacementId ,a.Placement = n.Placement from client.address a, n where a.clientid = 1774203 and a.AddressType = 1 select * from client.address where clientid = 1774203 and AddressType = 1
/*==============================================================*/ /* DBMS name: PostgreSQL 8 */ /* Created on: 2014/1/26 9:45:36 */ /*==============================================================*/ /*==============================================================*/ /* Table: FDB_COLUMN_REGISTRY */ /*==============================================================*/ CREATE TABLE FDE.FDB_COLUMN_REGISTRY ( COLUMNID SERIAL NOT NULL, DOMAINID INT4 NULL, CLASSID INT4 NOT NULL, FIELDNAME VARCHAR(255) NOT NULL, ALIASNAME VARCHAR(255) NULL, DEFAULTVALUESTRING VARCHAR(255) NULL, DEFAULTVALUENUMBER NUMERIC(38,8) NULL, ISNULLABLE INT4 NOT NULL, ISEDITABLE INT4 NOT NULL, ISREQUIRED INT4 NULL, ISSYSTEMCOLUMN INT4 NULL, ISRANDERINDEXFIELD INT4 NOT NULL DEFAULT 0, FDE_TYPE INT4 NOT NULL, COLUMN_SIZE INT4 NOT NULL, DECIMAL_DIGITS INT4 NOT NULL, CONSTRAINT PK_FDB_COLUMN_REGISTRY PRIMARY KEY (COLUMNID) )/*#*/; /*==============================================================*/ /* Index: FDB_COLUMN_REGISTRY_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_COLUMN_REGISTRY_PK ON FDE.FDB_COLUMN_REGISTRY ( COLUMNID )/*#*/; /*==============================================================*/ /* Index: TABLECOLUMNLINK_FK */ /*==============================================================*/ CREATE INDEX TABLECOLUMNLINK_FK ON FDE.FDB_COLUMN_REGISTRY ( CLASSID )/*#*/; /*==============================================================*/ /* Index: RELATIONSHIP_16_FK */ /*==============================================================*/ CREATE INDEX RELATIONSHIP_16_FK ON FDE.FDB_COLUMN_REGISTRY ( DOMAINID )/*#*/; /*==============================================================*/ /* Table: FDB_FEATUREDATASET */ /*==============================================================*/ CREATE TABLE FDE.FDB_FEATUREDATASET ( DATASETID SERIAL NOT NULL, DATASETNAME VARCHAR(128) NOT NULL, DATASETALIASNAME VARCHAR(255) NULL, DATASETUUID VARCHAR(40) NOT NULL, DATABASENAME VARCHAR(32) NULL, SCHEMANAME VARCHAR(32) NULL, DESCRIPTION VARCHAR(1024) NULL, SRID INT4 NOT NULL, TRID INT4 NOT NULL, REGISTEROPTION INT4 NOT NULL DEFAULT 0, EDITVERSION INT4 NOT NULL DEFAULT 0, CREATETIME TIMESTAMP NOT NULL, LASTUPDATETIME TIMESTAMP NOT NULL, CONSTRAINT PK_FDB_FEATUREDATASET PRIMARY KEY (DATASETID) )/*#*/; CREATE UNIQUE INDEX FDB_FEATUREDATASET_UK_NAME ON FDE.FDB_FEATUREDATASET ( DATASETNAME ASC )/*#*/; /*==============================================================*/ /* Index: FDB_FEATUREDATASET_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_FEATUREDATASET_PK ON FDE.FDB_FEATUREDATASET ( DATASETID )/*#*/; /*==============================================================*/ /* Table: FDB_GEOCOLUMN */ /*==============================================================*/ CREATE TABLE FDE.FDB_GEOCOLUMN ( COLUMNID INT4 NOT NULL, F_TABLENAME VARCHAR(32) NOT NULL, AVGPOINTCNT INT4 NOT NULL, GEOTYPE INT4 NOT NULL, HASID INT4 NOT NULL, HASM INT4 NOT NULL, HASZ INT4 NOT NULL, STORAGETYPE INT4 NOT NULL, MAXX FLOAT8 NOT NULL, MAXY FLOAT8 NOT NULL, MAXZ FLOAT8 NOT NULL, MAXM FLOAT8 NOT NULL, MINX FLOAT8 NOT NULL, MINY FLOAT8 NOT NULL, MINZ FLOAT8 NOT NULL, MINM FLOAT8 NOT NULL, CONSTRAINT PK_FDB_GEOCOLUMN PRIMARY KEY (COLUMNID) )/*#*/; /*==============================================================*/ /* Index: FDB_GEOCOLUMN_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_GEOCOLUMN_PK ON FDE.FDB_GEOCOLUMN ( COLUMNID )/*#*/; /*==============================================================*/ /* Table: FDB_GRIDINDEX */ /*==============================================================*/ CREATE TABLE FDE.FDB_GRIDINDEX ( COLUMNID INT4 NOT NULL, S_TABLENAME VARCHAR(32) NOT NULL, INDEXNAME VARCHAR(255) NOT NULL, CENTERX FLOAT8 NOT NULL, CENTERY FLOAT8 NOT NULL, L1 FLOAT8 NOT NULL, L2 FLOAT8 NOT NULL, L3 FLOAT8 NOT NULL, RADIO FLOAT8 NOT NULL, CONSTRAINT PK_FDB_GRIDINDEX PRIMARY KEY (COLUMNID) )/*#*/; /*==============================================================*/ /* Index: FDB_GRIDINDEX_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_GRIDINDEX_PK ON FDE.FDB_GRIDINDEX ( COLUMNID )/*#*/; /*==============================================================*/ /* Table: FDB_ITEMS */ /*==============================================================*/ CREATE TABLE FDE.FDB_ITEMS ( ID SERIAL NOT NULL, NAME VARCHAR(128) NOT NULL, FULLNAME VARCHAR(255) NOT NULL, GUID VARCHAR(40) NOT NULL, TYPE VARCHAR(40) NOT NULL, BASETYPE VARCHAR(40) NOT NULL, DEFAULTS CHAR NULL, DEFINITION BYTEA NULL, DOCUMENTATION CHAR NULL, CONSTRAINT PK_FDB_ITEMS PRIMARY KEY (ID) )/*#*/; /*==============================================================*/ /* Index: FDB_ITEMS_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_ITEMS_PK ON FDE.FDB_ITEMS ( ID )/*#*/; /*==============================================================*/ /* Table: FDB_ITEMTYPES */ /*==============================================================*/ CREATE TABLE FDE.FDB_ITEMTYPES ( ID SERIAL NOT NULL, NAME VARCHAR(255) NOT NULL, GUID VARCHAR(40) NOT NULL, PARENTTYPEGUID VARCHAR(40) NOT NULL, CONSTRAINT PK_FDB_ITEMTYPES PRIMARY KEY (ID), CONSTRAINT AK_IDENTIFIER_2_FDB_ITEM UNIQUE (NAME) )/*#*/; /*==============================================================*/ /* Index: FDB_ITEMTYPES_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_ITEMTYPES_PK ON FDE.FDB_ITEMTYPES ( ID )/*#*/; /*==============================================================*/ /* Table: FDB_OBJECTCLASSES */ /*==============================================================*/ CREATE TABLE FDE.FDB_OBJECTCLASSES ( CLASSID SERIAL NOT NULL, DATASETID INT4 NOT NULL, DATABASENAME VARCHAR(32) NOT NULL, SCHEMANAME VARCHAR(32) NOT NULL, CLASSNAME VARCHAR(128) NOT NULL, ALIASNAME VARCHAR(255) NOT NULL, CLSUUID VARCHAR(40) NOT NULL, OIDCOLUMN VARCHAR(32) NOT NULL, CLASSTYPE INT4 NOT NULL, DESCRIPTION VARCHAR(1024) NULL, CREATETIME TIMESTAMP NOT NULL, LASTUPDATETIME TIMESTAMP NOT NULL, REGISTEROPTION INT4 NOT NULL DEFAULT 0, CONSTRAINT PK_FDB_OBJECTCLASSES PRIMARY KEY (CLASSID) )/*#*/; /*==============================================================*/ /* Index: FDB_OBJECTCLASSES_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_OBJECTCLASSES_PK ON FDE.FDB_OBJECTCLASSES ( CLASSID )/*#*/; /*==============================================================*/ /* Index: FEATUREDATASETCLASSLINK_FK */ /*==============================================================*/ CREATE INDEX FEATUREDATASETCLASSLINK_FK ON FDE.FDB_OBJECTCLASSES ( DATASETID )/*#*/; CREATE UNIQUE INDEX FDB_OBJECTCLASS_UK_NAME ON FDE.FDB_OBJECTCLASSES ( DATASETID ASC, CLASSNAME ASC )/*#*/; /*==============================================================*/ /* Table: FDB_RENDERINDEX */ /*==============================================================*/ CREATE TABLE FDE.FDB_RENDERINDEX ( COLUMNID INT4 NOT NULL, INDEXNAME VARCHAR(255) NOT NULL, CENTERX FLOAT8 NOT NULL, CENTERY FLOAT8 NOT NULL, L1 FLOAT8 NOT NULL, L2 FLOAT8 NOT NULL, L3 FLOAT8 NOT NULL, RADIO FLOAT8 NOT NULL, FB_TABLENAME VARCHAR(255), CONSTRAINT PK_FDB_RENDERINDEX PRIMARY KEY (COLUMNID) )/*#*/; /*==============================================================*/ /* Index: FDB_RENDERINDEX_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_RENDERINDEX_PK ON FDE.FDB_RENDERINDEX ( COLUMNID )/*#*/; /*==============================================================*/ /* Table: FDB_REPLICATION_STEP */ /*==============================================================*/ CREATE TABLE FDE.FDB_REPLICATION_STEP ( ID INT4 NOT NULL, DATASETID INT4 NOT NULL, OPTYPE INT4 NOT NULL, STEP INT4 NOT NULL, SUBSTEP INT4 NULL DEFAULT 0, DESCRIPTION VARCHAR(1024) NULL, ISDONE INT4 NOT NULL, DATA BYTEA NULL, CONSTRAINT PK_FDB_REPLICATION_STEP PRIMARY KEY (ID) )/*#*/; /*==============================================================*/ /* Index: FDB_REPLICATION_STEP_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_REPLICATION_STEP_PK ON FDE.FDB_REPLICATION_STEP ( ID )/*#*/; /*==============================================================*/ /* Table: FDB_SERVERCONFIG */ /*==============================================================*/ CREATE TABLE FDE.FDB_SERVERCONFIG ( PARAMETERNAME VARCHAR(128) NOT NULL, PARAMETERVALUE VARCHAR(255) NOT NULL, CONSTRAINT PK_FDB_SERVERCONFIG PRIMARY KEY (PARAMETERNAME) )/*#*/; /*==============================================================*/ /* Index: FDB_SERVERCONFIG_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_SERVERCONFIG_PK ON FDE.FDB_SERVERCONFIG ( PARAMETERNAME )/*#*/; /*==============================================================*/ /* Table: FDB_SERVERINFO */ /*==============================================================*/ CREATE TABLE FDE.FDB_SERVERINFO ( DATABASENAME VARCHAR(255) NULL, INSTANCENAME VARCHAR(255) NULL, USERNAME VARCHAR(255) NOT NULL, CREATETIME TIMESTAMP NOT NULL, FDBVERSIONMAJOR INT4 NOT NULL, FDBVERSIONMINOR INT4 NOT NULL, FDBVERSIONBUGFIX INT4 NOT NULL, FDEPROVIDERNAME VARCHAR(255) NOT NULL, FDEDESCRIPTION VARCHAR(1024) NULL, UID VARCHAR(64) NOT NULL )/*#*/; /*==============================================================*/ /* Table: FDB_TABLE_REGISTRY */ /*==============================================================*/ CREATE TABLE FDE.FDB_TABLE_REGISTRY ( TABLEREGISTRATION_ID SERIAL NOT NULL, CLASSID INT4 NULL, DATABASENAME VARCHAR(32) NOT NULL, SCHEMANAME VARCHAR(32) NOT NULL, TABLENAME VARCHAR(32) NOT NULL, TABLETYPE INT4 NOT NULL, ISSYSTEMTABLE INT4 NOT NULL, DESCRIPTION VARCHAR(1024) NULL, REGISTRATIONDATE TIMESTAMP NOT NULL, LASTUPDATETIME TIMESTAMP NOT NULL, CONSTRAINT PK_FDB_TABLE_REGISTRY PRIMARY KEY (TABLEREGISTRATION_ID) )/*#*/; /*==============================================================*/ /* Index: FDB_TABLE_REGISTRY_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDB_TABLE_REGISTRY_PK ON FDE.FDB_TABLE_REGISTRY ( TABLEREGISTRATION_ID )/*#*/; /*==============================================================*/ /* Index: OBJECTATTACHLINK_FK */ /*==============================================================*/ CREATE INDEX OBJECTATTACHLINK_FK ON FDE.FDB_TABLE_REGISTRY ( CLASSID )/*#*/; /*==============================================================*/ /* Table: FDE_PROCESS_INFORMATION */ /*==============================================================*/ CREATE TABLE FDE.FDE_PROCESS_INFORMATION ( FDEID INT4 NOT NULL, SPID INT4 NOT NULL, PID INT4 NOT NULL, STARTTIME DATE NOT NULL, OWNER VARCHAR(266) NOT NULL, DIRECTCONNECT CHAR(1) NOT NULL, CONSTRAINT PK_FDE_PROCESS_INFORMATION PRIMARY KEY (FDEID) )/*#*/; /*==============================================================*/ /* Index: FDE_PROCESS_INFORMATION_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_PROCESS_INFORMATION_PK ON FDE.FDE_PROCESS_INFORMATION ( FDEID )/*#*/; /*==============================================================*/ /* Table: FDE_REP_CHECKOUTINFO */ /*==============================================================*/ CREATE TABLE FDE.FDE_REP_CHECKOUTINFO ( ID INT4 NOT NULL, DATASETID INT4 NULL, CHECKOUTNAME VARCHAR(40) NOT NULL, CHECKOUTDATETIME DATE NOT NULL, BCHECKOUT INT4 NOT NULL, BMASTER INT4 NOT NULL DEFAULT 0, CONN VARCHAR(1024) NULL, CONSTRAINT PK_FDE_REP_CHECKOUTINFO PRIMARY KEY (ID), CONSTRAINT AK_CHECKOUTNAME_FDE_REP_ UNIQUE (CHECKOUTNAME) )/*#*/; /*==============================================================*/ /* Index: FDE_REP_CHECKOUTINFO_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_REP_CHECKOUTINFO_PK ON FDE.FDE_REP_CHECKOUTINFO ( ID )/*#*/; /*==============================================================*/ /* Index: CHECKOUTDATASETLINK_FK */ /*==============================================================*/ CREATE INDEX CHECKOUTDATASETLINK_FK ON FDE.FDE_REP_CHECKOUTINFO ( DATASETID )/*#*/; /*==============================================================*/ /* Table: FDE_REP_FULLREPLICATIONTABLE */ /*==============================================================*/ CREATE TABLE FDE.FDE_REP_FULLREPLICATIONTABLE ( ID INT4 NOT NULL, REGISTERCLASSID INT4 NOT NULL, DATASETID INT4 NOT NULL, CONSTRAINT PK_FDE_REP_FULLREPLICATIONTABL PRIMARY KEY (ID) )/*#*/; /*==============================================================*/ /* Index: FDE_REP_FULLREPLICATIONTABLE_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_REP_FULLREPLICATIONTABLE_PK ON FDE.FDE_REP_FULLREPLICATIONTABLE (ID)/*#*/; /*==============================================================*/ /* Table: FDE_REP_TABLE_MODIFIED */ /*==============================================================*/ CREATE TABLE FDE.FDE_REP_TABLE_MODIFIED ( ID INT4 NOT NULL, TABLEREGISTERID INT4 NOT NULL, FIELDID INT4 NOT NULL, OPTYPE INT4 NOT NULL, BKEEP INT4 NOT NULL, CONSTRAINT PK_FDE_REP_TABLE_MODIFIED PRIMARY KEY (ID) )/*#*/; /*==============================================================*/ /* Index: FDE_REP_TABLE_MODIFIED_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_REP_TABLE_MODIFIED_PK ON FDE.FDE_REP_TABLE_MODIFIED ( ID )/*#*/; /*==============================================================*/ /* Table: FDE_SPATIAL_REFERENCES */ /*==============================================================*/ CREATE TABLE FDE.FDE_SPATIAL_REFERENCES ( SRID SERIAL NOT NULL, DESCRIPTION VARCHAR(1024) NULL, AUTH_NAME VARCHAR(255) NULL, AUTH_SRID INT4 NULL, FALSEX FLOAT8 NOT NULL, FALSEY FLOAT8 NOT NULL, XYUNITS FLOAT8 NOT NULL, FALSEZ FLOAT8 NOT NULL, ZUNITS FLOAT8 NOT NULL, FALSEM FLOAT8 NOT NULL, MUNITS FLOAT8 NOT NULL, XYCLUSTER_TOL FLOAT8 NULL, ZCLUSTER_TOL FLOAT8 NULL, MCLUSTER_TOL FLOAT8 NULL, SRTEXT VARCHAR(1024) NOT NULL, CONSTRAINT PK_FDE_SPATIAL_REFERENCES PRIMARY KEY (SRID) )/*#*/; /*==============================================================*/ /* Index: FDE_SPATIAL_REFERENCES_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_SPATIAL_REFERENCES_PK ON FDE.FDE_SPATIAL_REFERENCES ( SRID )/*#*/; /*==============================================================*/ /* Table: FDE_TABLE_LOCKS */ /*==============================================================*/ CREATE TABLE FDE.FDE_TABLE_LOCKS ( FDEID INT4 NOT NULL, LOCKTYPE CHAR(1) DEFAULT 'E' NOT NULL, CLASSID INT4 NOT NULL, CONSTRAINT PK_FDE_TABLE_LOCKS PRIMARY KEY (FDEID, LOCKTYPE, CLASSID) )/*#*/; /*==============================================================*/ /* Index: FDE_TABLE_LOCKS_PK */ /*==============================================================*/ CREATE UNIQUE INDEX FDE_TABLE_LOCKS_PK ON FDE.FDE_TABLE_LOCKS ( FDEID, LOCKTYPE, CLASSID )/*#*/; /*==============================================================*/ /* Table: FDE_OBJECT_LOCKS */ /*==============================================================*/ CREATE TABLE FDE.FDE_OBJECT_LOCKS ( FDEID INT4 NOT NULL, LOCKTYPE CHAR(1) DEFAULT 'E' NOT NULL, CLASSID INT4 NOT NULL, OBJECTID INT4 NOT NULL, CONSTRAINT PK_FDE_OBJECT_LOCKS PRIMARY KEY (FDEID, LOCKTYPE, CLASSID, OBJECTID) )/*#*/; /*==============================================================*/ /* Index: FDE_PROCESSINFO_TABLELOCKS_FK */ /*==============================================================*/ CREATE INDEX FDE_PROCESSINFO_TABLELOCKS_FK ON FDE.FDE_TABLE_LOCKS ( FDEID )/*#*/; /*==============================================================*/ /* Index: TABLETABLELOCKLINK_FK */ /*==============================================================*/ CREATE INDEX TABLETABLELOCKLINK_FK ON FDE.FDE_TABLE_LOCKS ( CLASSID )/*#*/; ALTER TABLE FDE.FDB_COLUMN_REGISTRY ADD CONSTRAINT FK_FDB_COLU_RELATIONS_FDB_ITEM FOREIGN KEY (DOMAINID) REFERENCES FDE.FDB_ITEMS (ID) /*#*/; ALTER TABLE FDE.FDB_COLUMN_REGISTRY ADD CONSTRAINT FK_FDB_COLU_TABLECOLU_FDB_OBJE FOREIGN KEY (CLASSID) REFERENCES FDE.FDB_OBJECTCLASSES (CLASSID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDB_GEOCOLUMN ADD CONSTRAINT FK_FDB_GEOC_FDB_GEOCO_FDB_COLU FOREIGN KEY (COLUMNID) REFERENCES FDE.FDB_COLUMN_REGISTRY (COLUMNID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDB_GRIDINDEX ADD CONSTRAINT FK_FDB_GRID_GEOCOLUMN_FDB_COLU FOREIGN KEY (COLUMNID) REFERENCES FDE.FDB_COLUMN_REGISTRY (COLUMNID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDB_OBJECTCLASSES ADD CONSTRAINT FK_FDB_OBJE_FEATUREDA_FDB_FEAT FOREIGN KEY (DATASETID) REFERENCES FDE.FDB_FEATUREDATASET (DATASETID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDB_RENDERINDEX ADD CONSTRAINT FK_FDB_REND_COLUMN_RE_FDB_COLU FOREIGN KEY (COLUMNID) REFERENCES FDE.FDB_COLUMN_REGISTRY (COLUMNID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDB_TABLE_REGISTRY ADD CONSTRAINT FK_FDB_TABL_OBJECTATT_FDB_OBJE FOREIGN KEY (CLASSID) REFERENCES FDE.FDB_OBJECTCLASSES (CLASSID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDE_REP_CHECKOUTINFO ADD CONSTRAINT FK_FDE_REP__CHECKOUTD_FDB_FEAT FOREIGN KEY (DATASETID) REFERENCES FDE.FDB_FEATUREDATASET (DATASETID) /*#*/; ALTER TABLE FDE.FDE_TABLE_LOCKS ADD CONSTRAINT FK_FDE_TABL_FDE_PROCE_FDE_PROC FOREIGN KEY (FDEID) REFERENCES FDE.FDE_PROCESS_INFORMATION (FDEID) ON DELETE CASCADE /*#*/; ALTER TABLE FDE.FDE_TABLE_LOCKS ADD CONSTRAINT FK_FDE_TABL_TABLETABL_FDB_OBJE FOREIGN KEY (CLASSID) REFERENCES FDE.FDB_OBJECTCLASSES (CLASSID) ON DELETE CASCADE /*#*/;
DROP DATABASE IF EXISTS TEST; CREATE DATABASE TEST; USE TEST; DROP TABLE IF EXISTS `test`.`books`; CREATE TABLE `books`( `id` INT(9) NOT NULL AUTO_INCREMENT, `title` VARCHAR(100) NOT NULL DEFAULT '0', `description` VARCHAR(255) NOT NULL DEFAULT '0', `author` VARCHAR(100) NOT NULL DEFAULT '0', `isbn` VARCHAR(20) NOT NULL DEFAULT '0', `printYear` INT(4) NOT NULL DEFAULT '0', `readAlready` BIT NOT NULL, `createdDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO test.books (TITLE, DESCRIPTION, AUTHOR,ISBN, PRINTYEAR, READALREADY) VALUES ('Lesson 1 Javarush','String and int types.' , 'Risha', '0101', '1900' , b'0'), ('Lesson 2 Javarush','Variables, methods,classes.' , ' Captain ', '0102', '1901' , b'0'), ('Lesson 3 Javarush','Working in IDE' , 'Billabao. ', '0103', '1902' , b'0'), ('Lesson 4 Javarush ','for' , ' Elly. ', '0104', '1903' , b'0'), ('Lesson 5 Javarush','Constructors.' , ' Kim ', '0105', '1904' , b'0'), ('Lesson 6 Javarush','Static variables.' , ' Professor. ', '0106', '1905' , b'0'), ('Lesson 7 Javarush','Array, ArrayList.' , ' Diego ', '0107', '1906' , b'0'), ('Lesson 8 Javarush','List, Map, Date.' , ' Amigo ', '0108', '1907' , b'0'), ('Lesson 9 Javarush','try,catch' , ' Hulio ', '0109', '1908' , b'0'), ('Lesson 10 Javarush','types' , ' Risha ', '0110', '1909' , b'0'), ('Lesson 11 Javarush','Implementation, incapsulation.' , ' Billabao ', '0201', '1910' , b'0'), ('Lesson 12 Javarush','Interfaces.' , ' Elly ', '0202', '1911' , b'0'), ('Lesson 13 Javarush','More interfaces.' , ' Diego ', '0203', '1912' , b'0'), ('Lesson 14 Javarush','Instanceof.' , ' Captain ', '0204', '1913' , b'0'), ('Lesson 15 Javarush','More constructors.' , ' Kim ', '0205', '1914' , b'0'), ('Lesson 16 Javarush','Threads.' , ' Risha ', '0206', '1915' , b'0'), ('Lesson 17 Javarush','Synchronization.' , ' Amigo ', '0207', '1916' , b'0'), ('Lesson 18 Javarush','Streams.' , ' Amigo ', '0208', '1917' , b'0'), ('Lesson 19 Javarush','Readers and writers.' , ' Amigo ', '0209', '1918' , b'0'), ('Lesson 20 Javarush','Serialization.' , ' Diego ', '0210', '1919' , b'0'), ('Lesson 21 Javarush','Equals and hashcode.' , ' Diego ', '0301', '1920' , b'0'), ('Lesson 22 Javarush','More Sring.' , ' Elly ', '0302', '1921' , b'0'), ('Lesson 23 Javarush','Map.Entry.' , ' Elly ', '0303', '1922' , b'0'), ('Lesson 24 Javarush','Inner classes.' , ' Elly ', '0304', '1923' , b'0'), ('Lesson 25 Javarush','Start, interrupt, sleap, yield.' , ' Billabao ', '0305', '1924' , b'0'), ('Lesson 26 Javarush','Synchronized, volatile.' , ' Hulio ', '0306', '1925' , b'0'), ('Lesson 27 Javarush',' DeadLock.' , ' Hulio ', '0307', '1926' , b'0'), ('Lesson 28 Javarush','ThreadGroup.' , ' Hulio ', '0308', '1927' , b'0'), ('Lesson 29 Javarush','Autoboxing.' , ' Kim ', '0309', '1928' , b'0'), ('Lesson 30 Javarush','Swing.' , ' Kim ', '0310', '1929' , b'0'), ('Lesson 31 Javarush','Files and archives.' , ' Kim ', '0401', '1930' , b'0'), ('Lesson 32 Javarush','RMI.' , ' Risha ', '0402', '1931' , b'0'), ('Lesson 33 Javarush','JSON' , ' Risha ', '0403', '1932' , b'0'), ('Lesson 34 Javarush','Recursion.' , ' Risha ', '0404', '1933' , b'0'), ('Lesson 35 Javarush','Git, SVN.' , ' Risha ', '0405', '1934' , b'0'), ('Lesson 36 Javarush','More collections.' , ' Diego ', '0406', '1935' , b'0'), ('Lesson 37 Javarush','Patterns.' , ' Diego ', '0407', '1936' , b'0'), ('Lesson 38 Javarush','Annotations.' , ' Diego ', '0408', '1937' , b'0'), ('Lesson 39 Javarush','Tomcat.' , ' Amigo ', '0409', '1938' , b'0'), ('Lesson 40 Javarush','URI, URL.' , ' Amigo ', '0410', '1939' , b'0')
CREATE VIEW view_contacts AS SELECT contacts._id AS _id, contacts.color AS color, contacts.email AS email, contacts.name AS name, contacts.contact_id AS contact_id FROM contacts;
CREATE TABLE exercise ( exerciseID INT NOT NULL, exerciseName VARCHAR(30) NOT NULL, description VARCHAR(150) , PRIMARY KEY(exerciseID) ); CREATE TABLE exerciseTemplate( templateID INT NOT NULL, templateName VARCHAR(100) NOT NULL, PRIMARY KEY (templateID) ); CREATE TABLE templateExerciseRelation( templateID INT not null, exerciseID INT not null, FOREIGN KEY (templateID) REFERENCES exerciseTemplate(templateID) on delete cascade on update cascade, FOREIGN key (exerciseID) REFERENCES exercise(exerciseID) on delete cascade on update cascade ); CREATE TABLE user ( userID INT NOT NULL, name VARCHAR(30) NOT NULL, birthdate DATE , PRIMARY KEY(userID) ); CREATE TABLE session( sessionID INT NOT NULL, shape INT CHECK ( shape >=1 AND shape <= 10 ), note VARCHAR(140), performance INT CHECK ( shape >=1 AND shape <= 10 ), start DATETIME NOT NULL, end DATETIME NOT NULL, userID INT NOT NULL PRIMARY KEY(sessionID), FOREIGN KEY(userID) REFERENCES user(userID) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE sessionOutdoors( temperature FLOAT, weather VARCHAR(140), sessionID INT NOT NULL, FOREIGN KEY (sessionID) REFERENCES session(sessionID) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE sessionIndoors( spectators INT , airQuality VARCHAR(140), sessionID INT NOT NULL, FOREIGN KEY (sessionID) REFERENCES session(sessionID) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE exerciseSessionRelation( sessionID INT NOT NULL, exerciseID INT NOT NULL, FOREIGN KEY (sessionID ) REFERENCES session(sessionID) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (exerciseID) REFERENCES exercise(exerciseID) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE exerciseGroup ( groupID INT NOT NULL, groupName VARCHAR(45) NOT NULL, parentGroupID INT , PRIMARY KEY(groupID), FOREIGN KEY(parentGroupID) REFERENCES exerciseGroup(groupID) ); CREATE TABLE exerciseBelongsToGroup ( exerciseID INT NOT NULL, groupID INT NOT NULL, PRIMARY KEY(exerciseID, groupID), FOREIGN KEY(exerciseID) REFERENCES exercise(exerciseID), FOREIGN KEY(groupID) REFERENCES exerciseGroup(groupID) ); CREATE TABLE exerciseReplacement ( exercise1ID INT NOT NULL, exercise2ID INT NOT NULL, PRIMARY KEY(exercise1ID, exercise2ID), FOREIGN KEY(exercise1ID) REFERENCES exercise(exerciseID), FOREIGN KEY(exercise2ID) REFERENCES exercise(exerciseID) ); CREATE TABLE personalBest ( encumbrance INT NOT NULL, setdate DATE NOT NULL, reps INT, userID INT NOT NULL, exerciseID INT NOT NULL, PRIMARY KEY(userID, exerciseID, setdate), FOREIGN KEY(exerciseID) REFERENCES exercise(exerciseID), FOREIGN KEY(userID) REFERENCES user(userID) ); CREATE TABLE goal ( userID INT NOT NULL, exerciseID INT NOT NULL, setdate DATE NOT NULL, encumbrance INT , reps INT , PRIMARY KEY(userID, exerciseID, setdate), FOREIGN KEY(exerciseID) REFERENCES exercise(exerciseID), FOREIGN KEY(userID) REFERENCES user(userID) ); drop table exercise , exerciseBelongsToGroup , exerciseGroup , exerciseReplacement , exerciseSessionRelation , goal , personalBest , session , sessionIndoors , sessionOutdoors , user , exerciseTemplate ,templateExerciseRelation ;
ALTER TABLE LeftMenuInfo MODIFY ( linkaddress varchar2(2000)) /
-- -------------------------------------------------- -- Generated by Enterprise Architect Version 8.0.856 -- Created On : jueves, 29 octubre, 2015 -- DBMS : SQL Server 2005 -- -------------------------------------------------- CREATE TABLE ADM_TDEPT ( DEPT_DEPT numeric(38) NOT NULL, -- ID DE LA TABLA DEPARTAMENTO DEPT_CODI numeric(38), -- CÓDIGO DE DEPARTAMENTO DEPT_NOMB varchar(100), -- NOMBRE DEL DEPARTAMENTO DEPT_PAIS numeric(38), -- ID DEL PAÍS AL QUE PERTENECE DEPT_ESTA varchar(1), -- ESTADO DEL DEPARTAMENTO DEPT_CREA numeric(38), -- ID DEL USUARIO CREADOR DEL REGISTRO DEPT_UPDA numeric(38) -- ID DEL ÚLTIMO USUARIO QUE MODIFICÓ EL REGISTRO ) ; ALTER TABLE ADM_TDEPT ADD CONSTRAINT PK_ADM_DEPT PRIMARY KEY (DEPT_DEPT) ;
-- It will produce the exact same results as when we leave the INNER keyword off -- An INNER JOIN will only give us rows where there is a match between the two tables. -- Any students with a cohort_id of NULL will not appear in the results of this kind of join. SELECT students.name as student_name, email, cohorts.name as cohort_name FROM students INNER JOIN cohorts ON cohorts.id = cohort_id;
ALTER TABLE school_class ADD UNIQUE (name);
-- phpMyAdmin SQL Dump -- version 2.6.3-pl1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Erstellungszeit: 01. Januar 2006 um 20:59 -- Server Version: 4.1.15 -- PHP-Version: 5.0.4 -- -- -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>Admin>Module` -- CREATE TABLE `RheinaufCMS>Admin>Module` ( `ID` int(11) NOT NULL default '0', `Name` text NOT NULL, `LongName` text NOT NULL, `Icon` text NOT NULL ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>Admin>Module` -- INSERT INTO `RheinaufCMS>Admin>Module` VALUES (0, 'SeiteEdit', 'Seiten bearbeiten', 'Classes/Admin/Icons/32x32/filenew.png'); INSERT INTO `RheinaufCMS>Admin>Module` VALUES (1, 'NaviEdit', 'Navigation bearbeiten', 'Classes/Admin/Icons/32x32/folder_new.png'); INSERT INTO `RheinaufCMS>Admin>Module` VALUES (2, 'User', 'User registrieren', 'Classes/Admin/Icons/32x32/edit_user.png'); INSERT INTO `RheinaufCMS>Admin>Module` VALUES (3, 'Module', 'Module', 'Classes/Admin/Icons/32x32/connect_no.png'); INSERT INTO `RheinaufCMS>Admin>Module` VALUES (4, 'Gruppen', 'Gruppen verwalten', 'Classes/Admin/Icons/32x32/edit_group.png'); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>Groups` -- CREATE TABLE `RheinaufCMS>Groups` ( `id` int(11) NOT NULL auto_increment, `Name` text NOT NULL, `Rechte` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>Groups` -- INSERT INTO `RheinaufCMS>Groups` VALUES (0, 'Verwalter', 'a:8:{i:0;s:13:"GruppenRechte";i:1;s:6:"Module";i:2;s:18:"NaviEditRubrikEdit";i:3;s:17:"NaviEditRubrikNeu";i:4;s:17:"NaviEditSeiteEdit";i:5;s:16:"NaviEditSeiteNeu";i:6;s:5:"Seite";i:7;s:7:"UserNeu";}'); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>Module` -- CREATE TABLE `RheinaufCMS>Module` ( `id` int(11) NOT NULL default '0', `Name` text NOT NULL ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>Module` -- INSERT INTO `RheinaufCMS>Module` VALUES (0, 'Admin'); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>Navi` -- CREATE TABLE `RheinaufCMS>Navi` ( `id` int(11) NOT NULL default '0', `Hierarchy` tinyint(4) NOT NULL default '0', `Rubrik_key` int(11) NOT NULL default '0', `Rubrik` varchar(100) character set latin1 NOT NULL default '', `Page_key` int(11) NOT NULL default '0', `Seite` varchar(100) character set latin1 NOT NULL default '', `Show` tinyint(4) NOT NULL default '0', `Show_to` varchar(200) character set latin1 NOT NULL default '', `Modul` varchar(100) character set latin1 NOT NULL default '', `ext_link` varchar(200) character set latin1 NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>Navi` -- INSERT INTO `RheinaufCMS>Navi` VALUES (0, 0, 0, 'Startseite', 0, '', 1, '', '', ''); INSERT INTO `RheinaufCMS>Navi` VALUES (1, 1, 0, 'Startseite', 0, 'index', 1, '', '', ''); INSERT INTO `RheinaufCMS>Navi` VALUES (2, 0, 1, 'Admin', 0, '', 0, '', 'Admin', ''); INSERT INTO `RheinaufCMS>Navi` VALUES (3, 1, 1, 'Admin', 0, 'index', 1, '', '', ''); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>Rechte` -- CREATE TABLE `RheinaufCMS>Rechte` ( `id` varchar(30) NOT NULL default '', `Frontend_Backend` text NOT NULL, `ModulName` text NOT NULL, `RechtName` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>Rechte` -- INSERT INTO `RheinaufCMS>Rechte` VALUES ('NaviEditRubrikNeu', 'Backend', 'NaviEdit', 'Rubrik erstellen'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('NaviEditRubrikEdit', 'Backend', 'NaviEdit', 'Rubrik bearbeiten'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('NaviEditSeiteNeu', 'Backend', 'NaviEdit', 'Seite erstellen'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('NaviEditSeiteEdit', 'Backend', 'NaviEdit', 'Seite Eigenschaften bearbeiten'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('Seite', 'Backend', 'SeiteEdit', 'Seite bearbeiten'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('GruppenRechte', 'Backend', 'Gruppen', 'Gruppen bearbeiten'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('UserNeu', 'Backend', 'User', 'Benutzer eintragen'); INSERT INTO `RheinaufCMS>Rechte` VALUES ('Module', 'Backend', 'Module', 'Module installieren'); -- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `RheinaufCMS>User` -- CREATE TABLE `RheinaufCMS>User` ( `id` int(11) NOT NULL auto_increment, `Name` text NOT NULL, `LoginName` text NOT NULL, `Password` text NOT NULL, `E-Mail` text NOT NULL, `Verantwortlichkeitsbereich` text NOT NULL, `Kontaktierbar` tinyint(4) NOT NULL default '0', `Group` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM ; -- -- Daten für Tabelle `RheinaufCMS>User` -- INSERT INTO `RheinaufCMS>User` VALUES (0, 'admin', '', 'admin', '', '', 0, 'dev');
-- MySQL dump 10.13 Distrib 8.0.27, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: attributes -- ------------------------------------------------------ -- Server version 8.0.16 -- -- Table structure for table `customer` -- CREATE TABLE `customer` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `identifier` varchar(128) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `identifier` (`identifier`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- -- Table structure for table `learner` -- CREATE TABLE `learner` ( `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `external_id` varchar(255) NOT NULL, `customer_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unique_learner_by_customer` (`external_id`,`customer_id`), KEY `learner_customer_id_index` (`customer_id`), CONSTRAINT `learner_customer_id_fk` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; -- -- Table structure for table `learner_attribute` -- CREATE TABLE `learner_attribute` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `level` double NOT NULL, `interest` double NOT NULL, `learner_id` int(10) unsigned NOT NULL, `attribute_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `learner_attribute_learner_id_index` (`learner_id`), KEY `learner_attribute_attribute_id_index` (`attribute_id`), CONSTRAINT `learner_attribute_learner_id_fk` FOREIGN KEY (`learner_id`) REFERENCES `learner` (`id`), CONSTRAINT `learner_attribute_attribute_id_fk` FOREIGN KEY (`attribute_id`) REFERENCES `attribute` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=415 DEFAULT CHARSET=utf8; -- -- Table structure for table `attribute` -- CREATE TABLE `attribute` ( `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `translations` json NOT NULL, `mapped_attribute_id` int(10) unsigned DEFAULT NULL, `internal_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `attribute_internal_id_uniq` (`internal_id`), KEY `attribute_mapped_attribute_id_index` (`mapped_attribute_id`), CONSTRAINT `attribute_mapped_attribute_id_fk` FOREIGN KEY (`mapped_attribute_id`) REFERENCES `attribute` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=190 DEFAULT CHARSET=utf8; -- -- Table structure for table `product` -- CREATE TABLE `product` ( `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `external_id` int(10) unsigned NOT NULL, `customer_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unique_training_by_customer` (`external_id`,`customer_id`), KEY `product_customer_id_index` (`customer_id`), CONSTRAINT `product_customer_id_fk` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; -- -- Table structure for table `product_attribute` -- CREATE TABLE `product_attribute` ( `id` int(11) NOT NULL AUTO_INCREMENT, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL, `relevance` double NOT NULL, `attribute_id` int(10) unsigned NOT NULL, `training_course_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `product_attribute_attribute_id_index` (`attribute_id`), KEY `products_training_course_id_index` (`training_course_id`), CONSTRAINT `products_training_course_id_fk` FOREIGN KEY (`training_course_id`) REFERENCES `product` (`id`), CONSTRAINT `product_attribute_attribute_id_fk` FOREIGN KEY (`attribute_id`) REFERENCES `attribute` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8; -- Dump completed on 2021-11-08 22:58:26
DROP PROCEDURE CPI.GIPIS097_WHEN_VAL_PREM_RT; CREATE OR REPLACE PROCEDURE CPI.gipis097_when_val_prem_rt ( p_par_id gipi_witmperl.par_id%TYPE, p_item_no gipi_witmperl.item_no%TYPE, p_peril_cd gipi_witmperl.peril_cd%TYPE, p_prem_rt gipi_witmperl.prem_rt%TYPE, p_tsi_amt gipi_witmperl.tsi_amt%TYPE, p_rec_flag gipi_witmperl.rec_flag%TYPE, p_coverage_cd gipi_witem.coverage_cd%TYPE, p_tariff_zone gipi_wvehicle.tariff_zone%TYPE, p_subline_type_cd gipi_wvehicle.subline_type_cd%TYPE, p_mot_type gipi_wvehicle.mot_type%TYPE, p_construction_cd gipi_wfireitm.construction_cd%TYPE, p_tarf_cd gipi_wfireitm.tarf_cd%TYPE, p_changed_tag gipi_witem.changed_tag%TYPE, p_ann_tsi_amt gipi_witmperl.ann_tsi_amt%TYPE, p_ann_prem_amt gipi_witmperl.ann_prem_amt%TYPE, p_item_tsi_amt gipi_witem.tsi_amt%TYPE, p_item_prem_amt gipi_witem.prem_amt%TYPE, p_item_ann_tsi_amt gipi_witem.ann_tsi_amt%TYPE, p_item_ann_prem_amt gipi_witem.ann_prem_amt%TYPE, p_no_of_days NUMBER, p_to_date VARCHAR2,--gipi_witem.TO_DATE%TYPE, p_from_date VARCHAR2,--gipi_witem.from_date%TYPE, p_comp_sw gipi_witem.comp_sw%TYPE, p_out_prem_amt OUT NUMBER, --gipi_witmperl.prem_amt%TYPE, p_out_ann_prem_amt OUT NUMBER, --gipi_witmperl.ann_prem_amt%TYPE, p_base_ann_prem_amt OUT NUMBER -- gipi_witmperl.ann_prem_amt%TYPE ) IS CURSOR vehicle IS (SELECT mot_type, subline_cd FROM gipi_wvehicle WHERE par_id = p_par_id AND item_no = p_item_no); v_prem_tag giis_tariff_rates_hdr.default_prem_tag%TYPE; v_tariff_cd giis_tariff_rates_hdr.tariff_cd%TYPE; v_fixed_prem giis_tariff_rates_dtl.fixed_premium%TYPE; tarf_sw VARCHAR2 (1) := 'N'; v_subline_cd gipi_wpolbas.subline_cd%TYPE; v_prorate_flag gipi_wpolbas.prorate_flag%TYPE; v_prov_prem_tag gipi_wpolbas.prov_prem_tag%TYPE; v_line_cd gipi_wpolbas.line_cd%TYPE; v_iss_cd gipi_wpolbas.iss_cd%TYPE; v_tariff_sw gipi_wpolbas.with_tariff_sw%TYPE; v_peril_type giis_peril.peril_type%TYPE; v_out_tsi_amt gipi_witmperl.tsi_amt%TYPE; v_out_ann_tsi_amt gipi_witmperl.ann_tsi_amt%TYPE; BEGIN --/*BETH 10 20 98 if changes are made in prem rate then --** deletion of records in bill and distribution table will be enabled --*/ -- IF :SYSTEM.record_status NOT IN ('NEW', 'QUERY') AND :b490.nbt_prem_rt IS NOT NULL AND :b490.nbt_prem_rt != :b490.prem_rt -- THEN -- :parameter.commit_sw := 'Y'; -- END IF; -- IF :SYSTEM.record_status != 'QUERY' -- THEN -- IF NVL (:b490.prem_rt, 0) < 0 -- THEN -- :b490.prem_rt := NULL; -- msg_alert ('Rate must not be less than zero (0%).', 'E', TRUE); -- ELSIF NVL (:b490.prem_rt, 100) > 100 -- THEN -- :b490.prem_rt := NULL; -- msg_alert ('Rate must not be greater than a hundred (100%).', 'E', TRUE); -- END IF; SELECT subline_cd, prorate_flag, prov_prem_tag, line_cd, iss_cd, with_tariff_sw INTO v_subline_cd, v_prorate_flag, v_prov_prem_tag, v_line_cd, v_iss_cd, v_tariff_sw FROM gipi_wpolbas WHERE par_id = p_par_id; --BETH 110899 determine if peril should compute premium based on tariff -- only if premium_rt is 0 and computation of premium is based -- on straight 1 year IF NVL (p_prem_rt, 0) = 0 AND NVL (v_tariff_sw, 'N') = 'Y' AND v_prorate_flag = '2' AND NVL (v_prov_prem_tag, 'N') = 'N' AND NVL (p_tsi_amt, 0) > 0 AND NVL (p_rec_flag, 'A') = 'A' AND p_peril_cd != NULL THEN IF v_line_cd = giisp.v ('MOTOR CAR') THEN FOR chk1 IN (SELECT a.default_prem_tag, a.tariff_cd FROM giis_tariff_rates_hdr a, gipi_wvehicle b WHERE a.motortype_cd = NVL (b.mot_type, p_mot_type) AND a.subline_type_cd = NVL (b.subline_type_cd, p_subline_type_cd) AND NVL (a.tariff_zone, '##') = NVL (b.tariff_zone, NVL (p_tariff_zone, '##')) AND a.coverage_cd = p_coverage_cd AND a.line_cd = v_line_cd AND a.subline_cd = v_subline_cd AND a.peril_cd = p_peril_cd AND b.item_no = p_item_no AND b.par_id = p_par_id) LOOP v_prem_tag := chk1.default_prem_tag; tarf_sw := 'Y'; v_tariff_cd := chk1.tariff_cd; END LOOP; ELSIF v_line_cd = giisp.v ('FIRE') THEN FOR chk2 IN (SELECT a.default_prem_tag, a.tariff_cd FROM giis_tariff_rates_hdr a, gipi_wfireitm b WHERE NVL (a.tarf_cd, '##') = NVL (b.tarf_cd, NVL (p_tarf_cd, '##')) AND NVL (a.construction_cd, '##') = NVL (b.construction_cd, NVL (p_construction_cd, '##')) AND NVL (a.tariff_zone, '##') = NVL (b.tariff_zone, NVL (p_tariff_zone, '##')) AND a.line_cd = v_line_cd AND a.subline_cd = v_subline_cd AND a.peril_cd = p_peril_cd AND b.par_id = p_par_id AND b.item_no = p_item_no) LOOP v_prem_tag := chk2.default_prem_tag; tarf_sw := 'Y'; v_tariff_cd := chk2.tariff_cd; END LOOP; END IF; IF v_prem_tag = '1' THEN tarf_sw := 'N'; FOR fix IN (SELECT fixed_premium FROM giis_tariff_rates_dtl WHERE fixed_si = p_tsi_amt AND tariff_cd = v_tariff_cd) LOOP v_fixed_prem := NVL (fix.fixed_premium, 0); tarf_sw := 'Y'; END LOOP; END IF; END IF; IF p_peril_cd != NULL THEN SELECT peril_type INTO v_peril_type FROM giis_peril WHERE line_cd = v_line_cd AND peril_cd = p_peril_cd; END IF; IF NVL (tarf_sw, 'N') = 'Y' THEN gipis097_compute_tarf (p_par_id, p_peril_cd, v_peril_type, p_tsi_amt, p_prem_rt, p_ann_tsi_amt, p_ann_prem_amt, p_item_tsi_amt, p_item_prem_amt, p_item_ann_tsi_amt, p_item_ann_prem_amt, v_tariff_cd, v_prem_tag, v_fixed_prem, p_out_prem_amt, v_out_ann_tsi_amt, p_out_ann_prem_amt, p_base_ann_prem_amt ); ELSE gipis097_compute_tsi (p_par_id, p_peril_cd, v_peril_type, p_changed_tag, p_tsi_amt, p_prem_rt, p_ann_tsi_amt, p_ann_prem_amt, p_item_tsi_amt, p_item_prem_amt, p_item_ann_tsi_amt, p_item_ann_prem_amt, p_no_of_days, TO_DATE(p_to_date, 'MM-DD-YYYY'), TO_DATE(p_from_date, 'MM-DD-YYYY'), p_comp_sw, NULL, v_out_tsi_amt, p_out_prem_amt, v_out_ann_tsi_amt, p_out_ann_prem_amt, p_base_ann_prem_amt ); END IF; --END IF; --END IF; END; /
DELETE FROM ledge_naming_attribute; DELETE FROM ledge_naming_context; INSERT INTO ledge_naming_context (context_id, dn, parent) VALUES(1, 'dc=objectledge,dc=org', -1); INSERT INTO ledge_naming_context (context_id, dn, parent) VALUES(2, 'ou=people,dc=objectledge,dc=org', 1); ALTER SEQUENCE ledge_naming_context_seq RESTART WITH 3;
USE employees; SELECT first_name, last_name, gender FROM employees WHERE first_name IN('Irena', 'Vidya', 'Maya') ORDER BY last_name DESC, first_name DESC; SELECT last_name FROM employees WHERE last_name LIKE 'E%' ORDER BY emp_no; # Employees hired in the 90s SELECT hire_date FROM employees WHERE hire_date LIKE '199%'; # Employees born on Christmas SELECT birth_date FROM employees WHERE birth_date LIKE '%12-25'; # Employees with a q in their last name SELECT last_name FROM employees WHERE last_name LIKE '%q%'; # Employees whose last name starts or ends with E SELECT last_name FROM employees WHERE last_name LIKE '%e' or last_name LIKE 'e%' ORDER BY emp_no; # Employees whose last name starts AND ends with E SELECT last_name FROM employees WHERE last_name LIKE '%e' and last_name LIKE 'e%' ORDER BY emp_no; # Employees hired in the 90s and born on Christmas SELECT first_name, last_name, hire_date, birth_date FROM employees WHERE hire_date LIKE '199%' and birth_date LIKE '%12-25' ORDER BY birth_date, hire_date DESC; # Employees with a q in their last name but not qu SELECT last_name FROM employees WHERE last_name LIKE '%q%' and last_name NOT LIKE '%qu%';
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 28, 2021 at 06:40 PM -- Server version: 10.4.19-MariaDB -- PHP Version: 8.0.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 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: `java_food_delivery` -- -- -------------------------------------------------------- -- -- Table structure for table `client` -- CREATE TABLE `client` ( `client_id` int(11) NOT NULL, `name` varchar(45) NOT NULL, `email` varchar(45) NOT NULL, `phone` varchar(10) NOT NULL, `registration` varchar(11) NOT NULL, `address` varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `client` -- INSERT INTO `client` (`client_id`, `name`, `email`, `phone`, `registration`, `address`) VALUES (1, 'Mihai', 'mihai.mail.ro', '0123456789', 'data de azi', 'adresa mea'); -- -------------------------------------------------------- -- -- Table structure for table `item` -- CREATE TABLE `item` ( `item_id` int(11) NOT NULL, `name` varchar(45) NOT NULL, `description` varchar(45) DEFAULT NULL, `price` double NOT NULL, `category` varchar(45) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `item` -- INSERT INTO `item` (`item_id`, `name`, `description`, `price`, `category`) VALUES (1, 'Burger', 'e un burger', 25.99, 'main'), (2, 'Pizza', 'e o Pizza ', 18.99, 'main'), (5, 'Pepsi', 'e o daza de pepsi', 2.6, 'drink'), (10, 'Fanta', 'e o daza', 5, 'drink'), (11, 'Cartofi prajiti', 'cartofi', 5.9, 'sidedish'); -- -------------------------------------------------------- -- -- Table structure for table `menu` -- CREATE TABLE `menu` ( `restaurant_id` int(11) DEFAULT NULL, `item_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `menu` -- INSERT INTO `menu` (`restaurant_id`, `item_id`) VALUES (1, 1), (1, 2), (1, 5), (1, 10), (1, 11); -- -------------------------------------------------------- -- -- Table structure for table `restaurant` -- CREATE TABLE `restaurant` ( `restaurant_id` int(11) NOT NULL, `name` varchar(45) NOT NULL, `email` varchar(45) NOT NULL, `phone` varchar(10) NOT NULL, `registration` varchar(11) NOT NULL, `address` varchar(45) NOT NULL, `schedule` varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `restaurant` -- INSERT INTO `restaurant` (`restaurant_id`, `name`, `email`, `phone`, `registration`, `address`, `schedule`) VALUES (1, 'Restaurant1', 'restaurant1@mail.com', '0123456789', 'candva', 'adresa1', 'program'); -- -- Indexes for dumped tables -- -- -- Indexes for table `client` -- ALTER TABLE `client` ADD PRIMARY KEY (`client_id`); -- -- Indexes for table `item` -- ALTER TABLE `item` ADD PRIMARY KEY (`item_id`); -- -- Indexes for table `menu` -- ALTER TABLE `menu` ADD KEY `restaurant_id` (`restaurant_id`), ADD KEY `item_id` (`item_id`); -- -- Indexes for table `restaurant` -- ALTER TABLE `restaurant` ADD PRIMARY KEY (`restaurant_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `client` -- ALTER TABLE `client` MODIFY `client_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `item` -- ALTER TABLE `item` MODIFY `item_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `restaurant` -- ALTER TABLE `restaurant` MODIFY `restaurant_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; 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 */;
-- auto Generated on 2017-03-21 15:00:44 -- DROP TABLE IF EXISTS `user`; CREATE TABLE `user`( `id` BIGINT (15) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id', `username` VARCHAR (255) UNIQUE NOT NULL DEFAULT '' COMMENT 'username', `password` VARCHAR (255) NOT NULL DEFAULT '' COMMENT 'password', `create_at` DATETIME NOT NULL COMMENT 'createAt', PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '`user`';
SELECT TO_CHAR(last_analyzed,'dd/mm/yyyy') Analyzed, COUNT(*) Table_Partitions FROM dba_tab_partitions WHERE table_owner = 'DATAW' GROUP BY TO_CHAR(last_analyzed,'dd/mm/yyyy') / QUIT
SELECT * FROM USERS ORDER BY NAME ASC;
-- Simulación del calculo de negociaciones del tipo Logistico. -- PARAMETROS INICIALES -- Id Negociacion => '2015-0001430' -- Periodo => Junio de 2015 (del 1o. al 30 de junio). -- SKU's => '1741, 1754, 1763, 1764, 1765, 1767, 2443, 3128, 3772, 3773, 3774, 4537, 4657, 5919, 9788, 10084, 12134, 12136, 15800' -- Sucursales => '002' -- Valor de forma de calculo: 3% (porcentaje). -- Tipo de Objetivo: No tiene objetivo. -- Proveedor: '000003037 - BRITISH AMERICAN TOBACCO MEXICO COMERCIAL SA DE CV' -- Las tablas de orden de compra con mercancia recibida (recepciones) son: dbo.cprrme y dbo.cprrde SELECT * FROM ( SELECT A.proveedor [Proveedor], B.alm [Suc], B.cve_art [SKU], A.factura [Factura], A.fec_rec [FechaRecepcion], B.rec [Cantidad], B.CostoNeto [CostoNeto], B.costo_rec [CostoRecibido], B.sub_total [SubTotal], B.dsc [Descuento], B.imp_nor [Imp1], B.imp_esp [Imp2], B.imp_esp2 [Imp3], CASE WHEN ((B.imp_nor + B.imp_esp + B.imp_esp2) > 0) THEN (B.imp_nor + B.imp_esp + B.imp_esp2) + ((B.rec * B.costo_rec) - B.dsc) ELSE ((B.rec * B.costo_rec) - B.dsc) END [TotalConImpuesto], ((B.rec * B.costo_rec) - B.dsc) [TotalSinImpuesto] FROM dbo.cprrme A WITH(INDEX = cprrme2, ROWLOCK) INNER JOIN dbo.cprrde B WITH(INDEX = cprrde2, ROWLOCK) ON (A.cia = B.cia) AND (A.n_rec = B.n_rec) AND (A.ord = B.ord) ) A WHERE (A.proveedor = '000003037') AND (A.SKU in (1741, 1754, 1763, 1764, 1765, 1767, 2443, 3128, 3772, 3773, 3774, 4537, 4657, 5919, 9788, 10084, 12134, 12136, 15800)) AND (A.FechaRecepcion >= '20150601') AND (A.FechaRecepcion <= '20150630') AND (A.Suc IN ('002')) GROUP BY A.Proveedor, A.Suc, A.SKU, A.FechaRecepcion, A.CostoNeto, A.Factura, A.Descuento, A.CostoRecibido, A.Cantidad, A.SubTotal, A.Imp1, A.Imp2, A.Imp3, A.TotalConImpuesto, A.TotalSinImpuesto ORDER BY A.factura; -- PARAMETROS INICIALES -- Id Negociacion => '2015-0001429' -- Periodo => Junio de 2015 (del 1o. al 30 de junio). -- SKU's => '6501, 7033, 10168, 14630' -- Sucursales => '002, 005, 006, 009, 010, 013, 015, 016, 017, 021, 026, 027, 028, 029, 033, 036, 037, 040, 044, 046, 047, 048, 062, 065, 066, 076, 077, 078, 079, 080, 081, 082, 083, 085, 086, 087, 088, 089, 090, 091, 092, 093, 097, 099, 102, 103, 104, 105, 106, 107' -- Valor de forma de calculo: 3% (porcentaje). -- Tipo de Objetivo: 2 - Cantidad fisicas con compra minima de 4000 kilos (4000). -- Proveedor: '000002765 - ABASTECEDORA IÑAKI SA DE CV' -- Las tablas de orden de compra con mercancia recibida (recepciones) son: dbo.cprrme y dbo.cprrde SELECT * FROM ( SELECT A.proveedor [Proveedor], B.alm [Suc], B.cve_art [SKU], A.factura [Factura], A.fec_rec [FechaRecepcion], B.rec [Cantidad], B.CostoNeto [CostoNeto], B.costo_rec [CostoRecibido], B.sub_total [SubTotal], B.dsc [Descuento], B.imp_nor [Imp1], B.imp_esp [Imp2], B.imp_esp2 [Imp3], CASE WHEN ((B.imp_nor + B.imp_esp + B.imp_esp2) > 0) THEN (B.imp_nor + B.imp_esp + B.imp_esp2) + ((B.rec * B.costo_rec) - B.dsc) ELSE ((B.rec * B.costo_rec) - B.dsc) END [TotalConImpuesto], ((B.rec * B.costo_rec) - B.dsc) [TotalSinImpuesto] FROM dbo.cprrme A WITH(INDEX = cprrme2, ROWLOCK) INNER JOIN dbo.cprrde B WITH(INDEX = cprrde2, ROWLOCK) ON (A.cia = B.cia) AND (A.n_rec = B.n_rec) AND (A.ord = B.ord) ) A WHERE (A.proveedor = '000002765') AND (A.SKU in (6501, 7033, 10168, 14630)) AND (A.FechaRecepcion >= '20150601') AND (A.FechaRecepcion <= '20150630') AND (A.Suc IN ('002', '005', '006', '009', '010', '013', '015', '016', '017', '021', '026', '027', '028', '029', '033', '036', '037', '040', '044', '046', '047', '048', '062', '065', '066', '076', '077', '078', '079', '080', '081', '082', '083', '085', '086', '087', '088', '089', '090', '091', '092', '093', '097', '099', '102', '103', '104', '105', '106', '107')) GROUP BY A.Proveedor, A.Suc, A.SKU, A.FechaRecepcion, A.CostoNeto, A.Descuento, A.factura, A.CostoRecibido, A.Cantidad, A.SubTotal, A.Imp1, A.Imp2, A.Imp3, A.TotalConImpuesto, A.TotalSinImpuesto ORDER BY A.factura; -- PARAMETROS INICIALES -- Id Negociacion => '2015-0001428' -- Periodo => Junio de 2015 (del 1o. al 30 de junio). -- SKU's => '11471, 11473, 11474, 11475, 12506' -- Sucursales => '005, 006, 009, 010, 013, 015, 016, 017, 021, 036, 037, 040, 044, 046, 047, 048, 076, 077, 078, 079, 080, 081, 082, 083, 085, 086, 087, 088, 089, 090, 091, 092, 097, 099, 103, 105, 106, 107' -- Valor de forma de calculo: 3% (porcentaje). -- Tipo de Objetivo: 1 - Valor => Compra minima de $10,000 (10000). -- Proveedor: '000003192 - 3M MEXICO SA DE CV' -- Las tablas de orden de compra con mercancia recibida (recepciones) son: dbo.cprrme y dbo.cprrde SELECT * FROM ( SELECT LTRIM(RTRIM(A.proveedor)) [Proveedor], LTRIM(RTRIM(B.alm)) [Suc], LTRIM(RTRIM(B.cve_art)) [SKU], LTRIM(RTRIM(A.factura)) [Factura], LTRIM(RTRIM(A.fec_rec)) [FechaRecepcion], B.rec [Cantidad], B.CostoNeto [CostoNeto], B.costo_rec [CostoRecibido], B.sub_total [SubTotal], B.dsc [Descuento], B.imp_nor [Imp1], B.imp_esp [Imp2], B.imp_esp2 [Imp3], CASE WHEN ((B.imp_nor + B.imp_esp + B.imp_esp2) > 0) THEN (B.imp_nor + B.imp_esp + B.imp_esp2) + ((B.rec * B.costo_rec) - B.dsc) ELSE ((B.rec * B.costo_rec) - B.dsc) END [TotalConImpuesto], ((B.rec * B.costo_rec) - B.dsc) [TotalSinImpuesto] FROM dbo.cprrme A WITH(INDEX = cprrme2, ROWLOCK) INNER JOIN dbo.cprrde B WITH(INDEX = cprrde2, ROWLOCK) ON (A.cia = B.cia) AND (A.n_rec = B.n_rec) AND (A.ord = B.ord) ) A WHERE (A.proveedor = '000003192') AND (A.SKU in (11471, 11473, 11474, 11475, 12506)) AND (A.FechaRecepcion >= '20150601') AND (A.FechaRecepcion <= '20150630') AND (A.Suc IN ('005', '006', '009', '010', '013', '015', '016', '017', '021', '036', '037', '040', '044', '046', '047', '048', '076', '077', '078', '079', '080', '081', '082', '083', '085', '086', '087', '088', '089', '090', '091', '092', '097', '099', '103', '105', '106', '107')) GROUP BY A.Proveedor, A.Suc, A.SKU, A.FechaRecepcion, A.CostoNeto, A.Descuento, A.Factura, A.CostoRecibido, A.Cantidad, A.SubTotal, A.Imp1, A.Imp2, A.Imp3, A.TotalConImpuesto, A.TotalSinImpuesto ORDER BY A.FechaRecepcion, A.Factura;
ALTER TABLE Autobus ADD CONSTRAINT Autobus_PK PRIMARY KEY ( reg ) ;
Create table product ( id serial primary key, name_product character(100) not null, type_id int, expired_date timestamp, price real); Create table types ( id serial primary key, name_type character(100) not null); insert into product (name_product, type_id, expired_date, price, id_types) values ('Сыр Нижегородский', 1234527, '2020-08-31 06:30:00', 200.00,(select id from types where name_type='СЫР') ); insert into product (name_product, type_id, expired_date, price, id_types) values ('Сыр Плавленный', 12345671, '2020-08-31 06:30:00', 208.00, (select id from types where name_type='СЫР')); insert into product (name_product, type_id, expired_date, price, id_types) values ('Сыр Белорусский', 12345271, '2020-08-6 06:30:00', 225.00, (select id from types where name_type='СЫР')); insert into product (name_product, type_id, expired_date, price, id_types) values ('Молоко цельное', 22345671, '2020-08-11 06:30:00', 80.00, (select id from types where name_type='МОЛОКО')); insert into product (name_product, type_id, expired_date, price, id_types) values ('Молоко топленое', 223245671, '2020-08-12 06:30:00', 79.00, (select id from types where name_type='МОЛОКО')); insert into product (name_product, type_id, expired_date, price, id_types) values ('Молоко топленое Вологодское', 223415671, '2020-09-23 06:30:00', 109.00, (select id from types where name_type='МОЛОКО')); insert into product (name_product, type_id, expired_date, price, id_types) values ('Сахар песок', 293415671, '2021-09-23 06:30:00', 59.00, (select id from types where name_type='САХАР')); select * from product; insert into types ( name_type) values ('СЫР'); insert into types ( name_type) values ('МОЛОКО'); insert into types ( name_type) values ('САХАР'); select * from product as u where u.id_types=1; select * from product as u where u.name_product like '%топленое%' ; select * from product as u where u.expired_date between '2020-08-01 00:00:00' and '2020-08-31 23:59:59'; select * from product as u where u.price = (Select max (price) from product); select count(*) from product as u where u.id_types=1; select count(*) from product as u where u.id_types=1 or u.id_types=2; select name_type from types as c where ( select count(id_types) from product as u where u.id_types= c.id)<2; select u.name_product, c.name_type from product as u inner join types as c on u.id_types=c.id;
DELETE FROM CONFIRM_MAIL_CHANGES WHERE ID = ? ;
ALTER TABLE tb_usuarios ADD free_reset_atributos INT UNSIGNED DEFAULT 0 NULL; INSERT INTO tb_migrations (cod_migration) VALUE (104);
-- -------------------------------------------------------- -- 主机: 10.1.2.163 -- 服务器版本: 10.0.8-MariaDB - mariadb.org binary distribution -- 服务器操作系统: Win64 -- HeidiSQL 版本: 9.4.0.5125 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!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' */; -- 导出 表 test.app_request 结构 CREATE TABLE IF NOT EXISTS `app_request` ( `id` char(36) NOT NULL DEFAULT '', `url` text, `starttime` bigint(20) DEFAULT NULL, `endtime` bigint(20) DEFAULT NULL, `threadid` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- 正在导出表 test.app_request 的数据:~0 rows (大约) /*!40000 ALTER TABLE `app_request` DISABLE KEYS */; /*!40000 ALTER TABLE `app_request` ENABLE KEYS */; -- 导出 表 test.app_sql 结构 CREATE TABLE IF NOT EXISTS `app_sql` ( `request_id` char(100) DEFAULT NULL, `sql_txt` text, `starttime` bigint(20) DEFAULT NULL, `endtime` bigint(20) DEFAULT NULL, `isasyn` varchar(5) DEFAULT NULL, `isredis` varchar(10) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- 正在导出表 test.app_sql 的数据:~0 rows (大约) /*!40000 ALTER TABLE `app_sql` DISABLE KEYS */; /*!40000 ALTER TABLE `app_sql` ENABLE KEYS */; -- 导出 表 test.sys_api 结构 CREATE TABLE IF NOT EXISTS `sys_api` ( `id` varchar(100) NOT NULL, `url` varchar(200) DEFAULT NULL, `requestparam` text, `modename` varchar(100) DEFAULT NULL, `describle` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- 正在导出表 test.sys_api 的数据:~0 rows (大约) /*!40000 ALTER TABLE `sys_api` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_api` ENABLE KEYS */; -- 导出 表 test.sys_log 结构 CREATE TABLE IF NOT EXISTS `sys_log` ( `username` varchar(50) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `remoteaddress` varchar(1000) DEFAULT NULL, `des` varchar(1000) DEFAULT NULL, `updatetime` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统log表'; -- 正在导出表 test.sys_log 的数据:~0 rows (大约) /*!40000 ALTER TABLE `sys_log` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_log` ENABLE KEYS */; -- 导出 表 test.sys_menu 结构 CREATE TABLE IF NOT EXISTS `sys_menu` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL, `des` varchar(255) DEFAULT NULL, `orderby` double DEFAULT NULL, `isused` int(11) DEFAULT NULL, `parentid` bigint(20) DEFAULT NULL, `url` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1024 DEFAULT CHARSET=utf8 COMMENT='菜单表'; -- 正在导出表 test.sys_menu 的数据:~11 rows (大约) /*!40000 ALTER TABLE `sys_menu` DISABLE KEYS */; INSERT INTO `sys_menu` (`id`, `name`, `des`, `orderby`, `isused`, `parentid`, `url`) VALUES (1001, '用户管理', '用户管理', 33.68764877319336, 1, 1008, 'userManager'), (1002, '系统设置', '系统设置', 7.9276299476623535, 1, 0, NULL), (1004, '菜单管理', '菜单管理', 3.5210700035095215, 1, 1002, 'meunManager'), (1006, 'SQL管理', 'SQL管理', 3.0522499084472656, 1, 1002, 'sqlManager'), (1008, '字典设置', '业务字典维护', 23.363910675048828, 1, 0, ''), (1010, '系统日志', '系统日志查看', 73.68765258789062, 1, 1002, 'log'), (1011, '角色管理', '角色管理', 13.699040412902832, 1, 1002, 'roleManager'), (1012, '开发学习案例', '开发学习案例', 93.68765258789062, 1, 1002, 'test'), (1019, '健康监控', '开发人员添加菜单,系统健康监控,添加菜单等', 49.375980377197266, 1, 0, ''), (1020, '性能监控', '请求使用时间和sql使用时间监控', NULL, 1, 1019, 'watch_requestAndSql'), (1021, '前端api接口测试', '前端工程师api接口测试', 113.68765258789062, 1, 1002, 'api_interface'); /*!40000 ALTER TABLE `sys_menu` ENABLE KEYS */; -- 导出 表 test.sys_role 结构 CREATE TABLE IF NOT EXISTS `sys_role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `des` varchar(1000) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1002 DEFAULT CHARSET=utf8 COMMENT='角色表'; -- 正在导出表 test.sys_role 的数据:~0 rows (大约) /*!40000 ALTER TABLE `sys_role` DISABLE KEYS */; INSERT INTO `sys_role` (`id`, `name`, `des`) VALUES (1000, '管理员', '最高权限'), (1001, '测试角色', '测试角色'); /*!40000 ALTER TABLE `sys_role` ENABLE KEYS */; -- 导出 表 test.sys_role_menu 结构 CREATE TABLE IF NOT EXISTS `sys_role_menu` ( `roleid` bigint(20) DEFAULT NULL, `menuid` bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色 菜单外联表'; -- 正在导出表 test.sys_role_menu 的数据:~11 rows (大约) /*!40000 ALTER TABLE `sys_role_menu` DISABLE KEYS */; INSERT INTO `sys_role_menu` (`roleid`, `menuid`) VALUES (1000, 1006), (1000, 1004), (1000, 1011), (1000, 1010), (1000, 1012), (1000, 1021), (1000, 1001), (1000, 1003), (1000, 1007), (1000, 1009), (1000, 1020); /*!40000 ALTER TABLE `sys_role_menu` ENABLE KEYS */; -- 导出 表 test.sys_sql 结构 CREATE TABLE IF NOT EXISTS `sys_sql` ( `id` varchar(50), `sqlname` varchar(255) DEFAULT NULL, `sqlstr` varchar(2000) DEFAULT NULL, `max` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `modename` varchar(100) DEFAULT NULL COMMENT '模块名称', `requestparam` text ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='sql'; -- 正在导出表 test.sys_sql 的数据:~19 rows (大约) /*!40000 ALTER TABLE `sys_sql` DISABLE KEYS */; INSERT INTO `sys_sql` (`id`, `sqlname`, `sqlstr`, `max`, `name`, `modename`, `requestparam`) VALUES ('sqlselect', 'sql_select', 'select * from sys_sql where 1=1\n<%if( guanjianci ){%>\n and(sqlname like \'%<%=guanjianci%>%\'\n or sqlstr like \'%<%=guanjianci%>%\'\n or name like \'%<%=guanjianci%>%\'\n or modename like \'%<%=guanjianci%>%\')\n<%}%>\n<% if( modename ){ %>\n and modename=#{ modename }\n<% } %>', 20, 'sql 查询通过条件', 'sql管理', '{"guanjianci":"管理","modename":"sql管理"}'), ('sql_check_sqlname_uuid', 'sql_check_sqlname_uuid', 'select count(*) from sys_sql where sqlname=#{sqlname}', 30, '检查sqlname是否重复', 'sql管理', '{"sqlname":"sql_select"}'), ('5399EA44-A061-4CB5-8CCF-2F2D74472532', 'menu_all', 'select * from sys_menu', 20, '菜单查询', '菜单管理', '""'), ('0D9D580D-B8C7-48B4-B4AC-0049A85B7225', 'sql_get_id_by_sqlname', 'select id from sys_sql where sqlname=#{sqlname}', 30, '通过sqlname获取id,用于修改最大行数使用id', 'sql管理', '""'), ('C8F970E1-8432-43E7-8174-C9AF62E60C6E', 'menu_by_parentid_and_userid', 'select c.* from sys_user_role a join sys_role_menu b on a.roleid=b.roleid join sys_menu c on b.menuid=c.id where c.parentid=#{parentid} and a.userid=#{userid} order by c.orderby', 0, '按照userid查询子菜单', '用户管理', '""'), ('5C16DEE7-6F2C-4277-BA5C-0F1DAE48EDA1', 'menu_get_max_order_code_by_parentid', 'select max(orderby)+20 from sys_menu where parentid=#{parentid}', 20, '通过父id获取子菜单最大的排序代码', '菜单管理', '""'), ('1CE7F51B-D780-4C22-AD4D-917919CDE726', 'role_all', 'select * from sys_role', 0, '查询全部角色', '角色管理', '""'), ('A96A8788-FCD9-4A3C-9D6B-38DC27830EED', 'menuid_by_roleid', 'select menuid from sys_role_menu where roleid=#{roleid}', 0, '通过角色id查询菜单列表', '菜单管理', '""'), ('02CC6AD5-DEC3-4412-A1F3-14EC0D4F4C0E', 'delete_sys_role_menu', 'delete from sys_role_menu where roleid=#{roleid}', 20, '通过roleid删除所有菜单', '角色管理', '{"roleid":"123"}'), ('B35470B3-307E-4CCA-B18F-7CC31FBBCBE5', 'user_select_by_where', 'select * from t_user <%=where%> order by addtime desc', 20, '通过条件查询用户', '用户管理', '""'), ('194FB05A-027E-4490-8D17-BDAE0C4C94EA', 'user_check_username_isused', 'select count(*) from t_user where username=#{username}', 20, '检查用户名是否重复', '用户管理', '""'), ('272696A8-602A-4022-A288-D2D2719BC4C2', 'role_slect_by_userid', 'select roleid from sys_user_role where userid=#{userid}', 20, '通过userid查询角色', '用户管理', '""'), ('33DE660B-F0B5-49E8-BBBF-41EA05EBE455', 'test_select_by_where', 'select * from sys_test \n<% if( guanjianci ){ %>\n where username like \'%<%=guanjianci %>%\' or tel like \'%<%=guanjianci %>%\' or name like \'%<%=guanjianci %>%\'\n<% } %>\norder by addtime desc', 20, '测试查询通过条件', '案例', '{"guanjianci":"test"}'), ('19DCA181-71C5-4F3B-A14A-AF7ACADB3BE1', 'test_check_username_isused', 'select count(*) from sys_test where username=#{username}', 20, '查询测试表username是否重复', '案例', '""'), ('201701171736120210', 'log_select_by_where', 'select * from sys_log <%=where%> order by updatetime desc', 20, '通过条件查询log', '系统日志', '""'), ('201701171826065240', 'menu_by_parentid', 'select * from sys_menu where parentid=#{parentid} order by orderby', 20, '通过parentid查询菜单', '菜单管理', '""'), ('201703231345064150', 'select_all_modename', 'select distinct modename from sys_sql ', 20, '查询所有sql模块名称', 'sql管理', '""'), ('201703242105399460', 'watch_request', 'select d.id as requestid,d.url,d.usetime,d.starttime,d.sqlallusetime,d.sqlcount,(d.usetime-d.sqlallusetime) as javausetime from (select c.id,c.url,c.usetime,c.starttime,sum(sqlusetime) as sqlallusetime,count(sqlusetime) as sqlcount from (select a.id,a.url,a.starttime,(a.endtime-a.starttime) as usetime,(b.endtime-b.starttime) as sqlusetime from app_request a join app_sql b on a.id=b.request_id) c group by c.url,c.usetime,c.id) d', 20, '查询请求监控', '性能监控', '""'), ('201703251838229420', 'select_sql_by_requestid', 'select sql_txt,starttime,endtime,(endtime-starttime) as usetime,isasyn,isredis from app_sql where request_id =#{requestid}', 20, '通过requestid查询所有sql', '性能监控', '{"requestid":"201703242342475550"}'), ('201703311352056310', 'select_sql_by_sqlname', 'select * from sys_sql where sqlname=#{sqlname}', 20, '通过sqlname获取sql模板', 'api接口测试', '{"sqlname":"sql_select"}'), ('201703312317559120', 'select_api_by_modename', 'select * from sys_api where modename=#{modename}', 20, '通过modename获取api', 'api接口测试', '{"modename":"用户管理"}'); /*!40000 ALTER TABLE `sys_sql` ENABLE KEYS */; -- 导出 表 test.sys_test 结构 CREATE TABLE IF NOT EXISTS `sys_test` ( `id` varchar(50) NOT NULL, `name` varchar(50) DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `password` varchar(50) DEFAULT NULL, `tel` varchar(50) DEFAULT NULL, `addtime` varchar(50) DEFAULT NULL, `islock` int(11) DEFAULT NULL, `lastsetpasswordtime` varchar(100) DEFAULT NULL, `errorpasswordtimes` int(11) DEFAULT NULL, `appclienttype` varchar(50) DEFAULT NULL COMMENT '用于推送消息ios or andriod ', `approle` varchar(50) DEFAULT NULL COMMENT 'app的角色', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- 正在导出表 test.sys_test 的数据:~9 rows (大约) /*!40000 ALTER TABLE `sys_test` DISABLE KEYS */; INSERT INTO `sys_test` (`id`, `name`, `username`, `password`, `tel`, `addtime`, `islock`, `lastsetpasswordtime`, `errorpasswordtimes`, `appclienttype`, `approle`) VALUES ('40206791-4596-4319-bd4f-a1f8cbe53490', '士大夫撒旦', '是大方的说法', 'password', '士大夫撒旦', '2017-04-02 22:28:49', NULL, 'newuser', NULL, NULL, 'service'), ('47e1305b-83df-4194-b260-9c09d5b37a50', 'dfdf', 'dddf', 'password', 'dfdf', '2017-03-29 18:04:41', 0, 'newuser', 0, NULL, 'engineer'), ('5a67cda4-baa0-4bc7-ac25-fdc98b00d027', 'df', 'dfdsd', 'password', 'dfdg', '2017-03-31 18:05:26', 0, 'newuser', 0, NULL, 'service'), ('6f780f40-ac44-47ac-ad24-e3a1bf54a2b3', '撒旦法士大夫', '是对方是范德萨', 'password', '士大夫撒旦法', '2017-04-02 23:26:21', 0, 'newuser', 0, NULL, 'engineer'), ('762d40bc-b705-4870-8c6e-5474e424bb2e', '撒旦法师的', 'asdfsd123432', 'password', '撒旦飞洒地方', '2017-04-02 23:01:36', 0, 'newuser', 0, NULL, 'service'), ('8559df0d-dc08-4585-bf34-3bf34416cc6f', '撒旦飞洒地方23', '士大夫撒旦法123', 'password', '士大夫撒', '2017-04-02 22:59:23', 0, 'newuser', 0, NULL, 'engineer'), ('8dd76515-0566-4d11-9c1d-6f7dd4911742', '速度速度', '速度速度', 'password', '是多少', '2017-04-02 22:32:30', NULL, 'newuser', NULL, NULL, 'service'), ('a9eeea7a-b300-46db-9acb-4f1083fc3dfd', '所得税法国', '速度速度速度速度', 'password', '按时打算', '2017-04-02 22:54:17', 0, 'newuser', 0, NULL, 'service'), ('d7f33b08-1a0c-4cd7-abc9-5808aaf2180d', 'test1', 'test1', 'password', 'test1', '2017-03-27 22:58:58', 0, 'newuser', 0, NULL, 'service'); /*!40000 ALTER TABLE `sys_test` ENABLE KEYS */; -- 导出 表 test.sys_user_role 结构 CREATE TABLE IF NOT EXISTS `sys_user_role` ( `userid` bigint(20) DEFAULT NULL, `roleid` bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色外联表'; -- 正在导出表 test.sys_user_role 的数据:~2 rows (大约) /*!40000 ALTER TABLE `sys_user_role` DISABLE KEYS */; INSERT INTO `sys_user_role` (`userid`, `roleid`) VALUES (1005, 1000), (1005, 1001); /*!40000 ALTER TABLE `sys_user_role` ENABLE KEYS */; -- 导出 表 test.t_user 结构 CREATE TABLE IF NOT EXISTS `t_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(50) DEFAULT NULL, `username` varchar(50) DEFAULT NULL, `password` varchar(50) DEFAULT NULL, `tel` varchar(50) DEFAULT NULL, `addtime` varchar(50) DEFAULT NULL, `islock` int(11) DEFAULT NULL, `lastsetpasswordtime` varchar(100) DEFAULT NULL, `errorpasswordtimes` int(11) DEFAULT NULL, `appclienttype` varchar(50) DEFAULT NULL COMMENT '用于推送消息ios or andriod ', `approle` varchar(50) DEFAULT NULL COMMENT 'app的角色', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1009 DEFAULT CHARSET=utf8; -- 正在导出表 test.t_user 的数据:~7 rows (大约) /*!40000 ALTER TABLE `t_user` DISABLE KEYS */; INSERT INTO `t_user` (`id`, `name`, `username`, `password`, `tel`, `addtime`, `islock`, `lastsetpasswordtime`, `errorpasswordtimes`, `appclienttype`, `approle`) VALUES (1000, 'test', 'test', 'password', 'test', '2017-01-15 16:01:46', 0, 'newuser', 0, NULL, 'service'), (1001, '宋荣洋', 'yyang', 'password', '18612290350', '2017-01-14 14:45:14', 0, 'newuser', 0, NULL, ''), (1005, '管理员', 'admin', 'admin', '', '2017-01-17 13:48:04', 0, 'newuser', 0, NULL, ''); /*!40000 ALTER TABLE `t_user` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-- Some sample data insert into Participant (name, counts) VALUES ('See', 0); insert into Participant (name, counts) VALUES ('Speak', 0); insert into Participant (name, counts) VALUES ('Listen', 0);
-- Query 1 SELECT countries.name, languages.language, languages.percentage FROM countries JOIN languages ON countries.id = languages.country_id WHERE languages.language = "Slovene" ORDER BY percentage DESC -- Query 2 SELECT countries.name, COUNT(cities.id) AS city_count FROM countries JOIN cities ON countries.id = cities.country_id GROUP BY countries.name ORDER BY city_count DESC -- Query 3 SELECT cities.name, cities.population FROM cities JOIN countries ON cities.country_id = countries.id WHERE countries.name = "Mexico" AND cities.population > 500000 ORDER BY cities.population DESC -- Query 4 SELECT countries.name, languages.language, languages.percentage FROM countries JOIN languages ON countries.id = languages.country_id WHERE languages.percentage > 89 ORDER BY languages.percentage DESC -- Query 5 SELECT countries.name, countries.surface_area, countries.population FROM countries WHERE countries.surface_area < 501 AND countries.population > 100000 -- Query 6 SELECT countries.name, countries.government_form, countries.capital, countries.life_expectancy FROM countries WHERE countries.government_form = "Constitutional Monarchy" AND capital > 200 AND countries.life_expectancy > 75 -- Query 7 SELECT countries.name, cities.name, cities.district, cities.population FROM countries JOIN cities ON countries.id = cities.country_id WHERE countries.name = "Argentina" AND cities.district = "Buenos Aires" AND cities.population > 500000 -- Query 8 SELECT countries.region, COUNT(countries.id) AS number_of_countries FROM countries GROUP BY countries.region ORDER BY number_of_countries DESC
select id,age,t.coins,t.power from (select code,min(coins_needed) as coins,power from wands group by power,code) as t join wands w on w.code=t.code and w.coins_needed=t.coins and w.power=t.power join wands_property p on p.code=t.code where is_evil=0 order by t.power desc,age desc;
WITH CTE_1 AS ( SELECT OBJECT_NAME(a.Object_id) as table_name, a.Name as columnname, CONVERT(bigint, ISNULL(a.last_value,0)) AS last_value, Case When b.name = 'tinyint' Then 255 When b.name = 'smallint' Then 32767 When b.name = 'int' Then 2147483647 When b.name = 'bigint' Then 9223372036854775807 End As dt_value FROM sys.identity_columns a INNER JOIN sys.types As b ON a.system_type_id = b.system_type_id ), CTE_2 AS ( SELECT *, CONVERT(Numeric(18,2), ((CONVERT(Float, last_value) / CONVERT(Float, dt_value)) * 100)) AS "Percent" FROM CTE_1 ) SELECT * FROM CTE_2 ORDER BY "Percent" DESC;
SET TERM ^ ; CREATE OR ALTER PROCEDURE GET_DATOS_ANIMAL_FECHA( ID_ANIMAL INTEGER, ESTABLECIMIENTO INTEGER, FECHA DATE) RETURNS( POTRERO INTEGER, RODEO INTEGER, CRONOLOGIA_DENTARIA INTEGER, ESTADO_REPRODUCTIVO INTEGER, CATEGORIA INTEGER, COND_CORP INTEGER, GDR INTEGER) AS DECLARE VARIABLE EVENTO INTEGER; DECLARE VARIABLE TIPO INTEGER; DECLARE VARIABLE FECHA_NAC DATE; DECLARE VARIABLE EDAD INTEGER; DECLARE VARIABLE SEXO INTEGER; DECLARE VARIABLE CAT_AUX INTEGER; DECLARE VARIABLE F DATE; BEGIN --Estado Reproductivo EVENTO = NULL; SELECT FIRST 1 ID_EVENTO, TIPO FROM EVE_EVENTOS WHERE FECHA <= :FECHA AND ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO AND (TIPO = 1 OR TIPO = 2 OR TIPO = 11 OR TIPO = 13 OR TIPO = 15 OR TIPO = 17 OR TIPO = 20 OR TIPO = 28 OR TIPO = 24 OR TIPO = 39) ORDER BY FECHA/*, ID_EVENTO*/ DESC INTO :EVENTO, :TIPO; IF (EVENTO IS NOT NULL) THEN BEGIN -- aborto if (tipo = 1 ) then begin select first 1 estado_reproductivo from eve_aborto where (id_evento = :EVENTO) into :estado_reproductivo; end -- alta if (tipo = 2) then begin select first 1 estado_reproductivo from eve_alta_directa where (id_evento = :evento) into :estado_reproductivo; end -- deteccion de celo if (tipo = 11) then begin select first 1 estado_reproductivo from eve_deteccion_celo where (id_evento = :evento) into :estado_reproductivo; end -- diagnostico de gestacion if (tipo = 13) then begin select first 1 estado_reproductivo from eve_diagnostico_gestacion where (id_evento = :evento) into :estado_reproductivo; end -- Egreso Servicio if (tipo = 15) then begin select first 1 estado_reproductivo from eve_egreso_servicio where (id_evento = :evento) into :estado_reproductivo; end -- Evaluacion Preservicio if (tipo = 17) then begin select first 1 estado_reproductivo from eve_evaluacion_preservicio where (id_evento = :evento) into :estado_reproductivo; end -- Ingreso Servicio if (tipo = 20) then begin select first 1 estado_reproductivo from eve_ingreso_servicio where (id_evento = :evento) into :estado_reproductivo; end -- Parto if (tipo = 24) then begin select first 1 estado_reproductivo from eve_parto where (id_evento = :evento) into :estado_reproductivo; end -- Parto Masivo if (tipo = 39) then estado_reproductivo = 4; -- Siempre esta como parida -- Inseminacion Artificial if (tipo = 28) then begin select first 1 estado_reproductivo from eve_inseminacion_artificial where (id_evento = :evento) into :estado_reproductivo; end END --Camibio de Ubicacion EVENTO = NULL; SELECT FIRST 1 EE.ID_EVENTO, ee.fecha, ECU.POTRERO FROM EVE_EVENTOS EE JOIN EVE_CAMBIO_UBICACION ECU ON EE.ID_EVENTO = ECU.ID_EVENTO WHERE EE.FECHA <= :FECHA AND EE.TIPO = 5 AND EE.ANIMAL = :ID_ANIMAL AND EE.ESTABLECIMIENTO = :ESTABLECIMIENTO AND ECU.ESTABLECIMIENTO_ANTERIOR IS NULL ORDER BY ee.FECHA DESC,ee.ID_EVENTO DESC INTO :EVENTO,:f,:POTRERO; --IF (EVENTO IS NOT NULL) THEN -- SELECT FIRST 1 POTRERO, RODEO FROM EVE_CAMBIO_UBICACION WHERE ID_EVENTO = :EVENTO ORDER BY INTO :POTRERO, :RODEO; ---Cronologia Dentaria EVENTO = NULL; SELECT FIRST 1 ID_EVENTO, TIPO FROM EVE_EVENTOS WHERE FECHA <= :FECHA AND (TIPO = 2 OR TIPO = 13) AND ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO ORDER BY FECHA/*, ID_EVENTO*/ DESC INTO :EVENTO, :TIPO; IF (EVENTO IS NOT NULL) THEN BEGIN IF (TIPO = 2) THEN SELECT CRONOLOGIA_DENTARIA FROM EVE_ALTA_DIRECTA WHERE ID_EVENTO = :EVENTO INTO :CRONOLOGIA_DENTARIA; ELSE SELECT CRONOLOGIA_DENTARIA FROM EVE_DIAGNOSTICO_GESTACION WHERE ID_EVENTO = :EVENTO INTO :CRONOLOGIA_DENTARIA; END --GDR EVENTO = NULL; SELECT FIRST 1 ID_EVENTO, TIPO FROM EVE_EVENTOS WHERE FECHA <= :FECHA AND (TIPO = 2 OR TIPO = 17) AND ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO ORDER BY FECHA/*, ID_EVENTO*/ DESC INTO :EVENTO, :TIPO; IF (EVENTO IS NOT NULL) THEN BEGIN IF (TIPO = 2) THEN SELECT GDR FROM EVE_ALTA_DIRECTA WHERE ID_EVENTO = :EVENTO INTO :GDR; ELSE SELECT GDR FROM EVE_EVALUACION_PRESERVICIO WHERE ID_EVENTO = :EVENTO INTO :GDR; END --Condicion Corporal EVENTO = NULL; SELECT FIRST 1 ECC.CONDICION_CORPORAL FROM EVE_CONDICION_CORPORAL ECC JOIN EVE_EVENTOS EE ON EE.ID_EVENTO=ECC.ID_EVENTO WHERE EE.FECHA <= :FECHA AND EE.ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO ORDER BY EE.FECHA/*, EE.ID_EVENTO*/ DESC INTO :COND_CORP; --Categoria EVENTO = NULL; SELECT TA.FECHA_NACIMIENTO, CS.TIPO FROM TAB_ANIMALES TA join COD_SEXOS CS ON TA.SEXO = CS.ID_SEXO WHERE TA.ID_ANIMAL = :ID_ANIMAL AND TA.ESTABLECIMIENTO = :ESTABLECIMIENTO INTO :FECHA_NAC, :SEXO; EDAD = (FECHA-FECHA_NAC)/30; IF (SEXO = 1) THEN --Macho BEGIN SELECT FIRST 1 ID_EVENTO FROM EVE_EVENTOS WHERE ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO AND FECHA <= :FECHA AND TIPO = 7 ORDER BY FECHA DESC INTO :EVENTO; IF (EDAD < 7) THEN CATEGORIA = 1; --Ternero ELSE BEGIN IF (EVENTO IS NOT NULL) THEN CATEGORIA = 2; --Novillo ELSE BEGIN SELECT FIRST 1 ALD.CATEGORIA FROM EVE_ALTA_DIRECTA ALD JOIN EVE_EVENTOS EE ON EE.ID_EVENTO=ALD.ID_EVENTO WHERE EE.ANIMAL =:ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO ORDER BY EE.FECHA DESC INTO :CAT_AUX; IF (CAT_AUX = 2) THEN CATEGORIA = 2; ELSE BEGIN IF (EDAD < 9) THEN CATEGORIA = 1; -- Ternero ELSE CATEGORIA = 3; --Toro END END END END ELSE --Hembra BEGIN IF (EDAD < 9) THEN CATEGORIA = 4; --Ternera ELSE BEGIN SELECT FIRST 1 ID_EVENTO FROM EVE_EVENTOS WHERE ANIMAL = :ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO AND FECHA <= :FECHA AND (TIPO = 24 OR TIPO = 39) ORDER BY FECHA, ID_EVENTO DESC INTO :EVENTO; IF (EVENTO IS NOT NULL) THEN CATEGORIA = 6; ELSE BEGIN SELECT FIRST 1 ALD.CATEGORIA FROM EVE_ALTA_DIRECTA ALD JOIN EVE_EVENTOS EE ON EE.ID_EVENTO=ALD.ID_EVENTO WHERE EE.ANIMAL =:ID_ANIMAL AND ESTABLECIMIENTO = :ESTABLECIMIENTO ORDER BY EE.FECHA DESC INTO :CAT_AUX; IF (CAT_AUX = 6) THEN CATEGORIA = 6; --Vaca ELSE CATEGORIA =5; END END END SUSPEND; END ^ SET TERM ; ^
REM debug1.sql REM Version 1.0, last updated 5/14/97 REM This is the first version of the Debug package, which inserts into a REM debugging table, as described in Chapter 8 of REM _Oracle8 PL/SQL Programming_ by Scott Urman. CREATE OR REPLACE PACKAGE Debug AS /* First version of the debug package. This package works by inserting into the debug_table table. In order to see the output, select from debug_table in SQL*Plus with: SELECT debug_str FROM debug_table ORDER BY linecount; */ /* This is the main debug procedure. p_Description will be concatenated with p_Value, and inserted into debug_table. */ PROCEDURE Debug(p_Description IN VARCHAR2, p_Value IN VARCHAR2); /* Resets the Debug environment. Reset is called when the package is instantiated for the first time, and should be called to delete the contents of debug_table for a new session. */ PROCEDURE Reset; END Debug; / CREATE OR REPLACE PACKAGE BODY Debug AS /* v_LineCount is used to order the rows in debug_table. */ v_LineCount NUMBER; PROCEDURE Debug(p_Description IN VARCHAR2, p_Value IN VARCHAR2) IS BEGIN INSERT INTO debug_table (linecount, debug_str) VALUES (v_LineCount, p_Description || ': ' || p_Value); COMMIT; v_LineCount := v_LineCount + 1; END Debug; PROCEDURE Reset IS BEGIN v_LineCount := 1; DELETE FROM debug_table; END Reset; BEGIN /* Package initialization code */ Reset; END Debug; /
CREATE TABLE public."Knowledges" ( "Id" bigserial NOT NULL, "Title" text NOT NULL, "Description" text, "CreatedOn" timestamp with time zone NOT NULL DEFAULT now(), "ModifiedOn" timestamp without time zone NOT NULL DEFAULT now(), "CreatedBy" bigint NOT NULL, "ModifiedBy" bigint NOT NULL, PRIMARY KEY ("Id"), FOREIGN KEY ("CreatedBy") REFERENCES public."Users" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY ("ModifiedBy") REFERENCES public."Users" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ); ALTER TABLE public."Knowledges" ADD COLUMN "Deleted" boolean NOT NULL DEFAULT false;
SELECT e.firstName, COUNT(p.productCode) AS 'Number of products sold' FROM employees e LEFT JOIN customers c ON e.employeeNumber = c.salesRepEmployeeNumber LEFT JOIN orders o ON c.customerNumber = o.customerNumber LEFT JOIN orderitems oi ON o.orderNumber = oi.orderNumber LEFT JOIN products p ON oi.productCode = p.productCode WHERE e.jobTitle = 'Sales Rep' GROUP BY e.employeeNumber ORDER BY COUNT(p.productCode);
/* 增加一个用户-资源访问许可(仅限存储过程调用) */ CREATE OR REPLACE PROCEDURE Doc_DirAccessPermission_Insert ( dirid_1 integer, dirtype_1 integer, userid_1 integer, usertype_1 integer, operationcode_1 integer) AS count_1 integer; count_num integer; begin if operationcode_1 = 0 then select count(createdoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if count_num =0 then insert into DirAccessPermission(dirid, dirtype, userid, usertype, createdoc, createdir, movedoc, copydoc) values(dirid_1, dirtype_1, userid_1, usertype_1, 1, 0, 0, 0); else select createdoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; update DirAccessPermission set createdoc = (count_1+1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; elsif operationcode_1 = 1 then select count(createdir) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if count_num =0 then insert into DirAccessPermission(dirid, dirtype, userid, usertype, createdoc, createdir, movedoc, copydoc) values(dirid_1, dirtype_1, userid_1, usertype_1, 0, 1, 0, 0); else select createdir into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; update DirAccessPermission set createdir = (count_1+1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; elsif operationcode_1 = 2 then select count(movedoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if count_num =0 then insert into DirAccessPermission(dirid, dirtype, userid, usertype, createdoc, createdir, movedoc, copydoc) values(dirid_1, dirtype_1, userid_1, usertype_1, 0, 0, 1, 0); else select movedoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; update DirAccessPermission set movedoc = (count_1+1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; elsif operationcode_1 = 3 then select count(copydoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if count_num =0 then insert into DirAccessPermission(dirid, dirtype, userid, usertype, createdoc, createdir, movedoc, copydoc) values(dirid_1, dirtype_1, userid_1, usertype_1, 0, 0, 0, 1); else select copydoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; update DirAccessPermission set copydoc = (count_1+1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; end if; end; / CREATE OR REPLACE PROCEDURE Doc_DirAccessPermission_Delete ( dirid_1 integer, dirtype_1 integer, userid_1 integer, usertype_1 integer, operationcode_1 integer) AS count_1 integer; count_num integer; begin if operationcode_1 = 0 then select count(createdoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if (count_num > 0) then select createdoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; if (count_1 >0) then update DirAccessPermission set createdoc = (count_1-1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; end if; elsif operationcode_1 = 1 then select count(createdir) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if (count_num >0 ) then select createdir into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; if( count_1 >0) then update DirAccessPermission set createdir = (count_1-1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; end if; elsif operationcode_1 = 2 then select count(movedoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if (count_num > 0 ) then select movedoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; if( count_1 >0) then update DirAccessPermission set movedoc = (count_1-1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; end if; elsif operationcode_1 = 3 then select count(copydoc) into count_num from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; if (count_num >0) then select copydoc into count_1 from DirAccessPermission where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1 and rownum =1; if( count_1 >0) then update DirAccessPermission set copydoc = (count_1-1) where dirid = dirid_1 and dirtype = dirtype_1 and userid = userid_1 and usertype = usertype_1; end if; end if; end if; end; /
CREATE or REPLACE PROCEDURE hrmroles_selectall ( flag out integer , msg out varchar2, thecursor IN OUT cursor_define.weavercursor ) as id_1 integer; rolesmark_1 varchar2(60); rolesname_1 varchar2(200); id_2 integer; cnt_2 integer; CURSOR all_cursor is select id,rolesmark,rolesname from hrmroles ; CURSOR roles_cursor is select id from hrmroles ; begin open all_cursor; loop fetch all_cursor INTO id_1,rolesmark_1,rolesname_1; exit when all_cursor%NOTFOUND; insert into temp_table_02 (id,rolesmark,rolesname) values (id_1,rolesmark_1,rolesname_1) ; end loop; open roles_cursor; loop fetch roles_cursor INTO id_2; exit when roles_cursor%NOTFOUND; select count(id) INTO cnt_2 from HrmRoleMembers where roleid=id_2 ; update temp_table_02 set cnt=cnt_2 where id=id_2 ; end loop; open thecursor for select id,rolesmark,rolesname,cnt from temp_table_02 order by rolesmark; close all_cursor ; close roles_cursor ; end; /
-- 1. Vytvořte dotaz, který z data narození, vytvoří 1.část rodného čísla.2 část -- bude tvořena: 1.číslice je 5, 2.číslice- den v týdnu, 3. a 4.číslice týden v roce. select date_format(DatNar,"%y%m%d/5%w%u") from student; -- 2. Vytvořte dotaz, který podle -- rodného čísla určí pohlaví osoby a z rodného čísla určí datum narození. select substr(RodCislo,3,1),if(substr(RodCislo,3,1) IN(5,6),'žena','muž') AS pohlaví, concat(round(substr(RodCislo,5,2)),'.',round(substr(RodCislo,3,2)),'.',if(round(substr(RodCislo,1,2)) between 0 and 54,if(length(RodCislo)=11,"20","19"),"19"),left(RodCislo,2)) from student; -- 3. Do tabulky student přidejte sloupce: pohlaví a rc_st. Vložte data z minulých dotazů. alter table student add pohlavi varchar(6); insert into pohlavi values(); -- 4. Vytvořte dotaz, který vypíše studenta, -- jejichž jméno s příjmením má alespoň 25 znaků a má absenci max.30 hodin. select s.*,sum(a.pocethod) from student s left join absence a using(IDS) where length(concat(jmeno,prijmeni))>11 group by s.jmeno having sum(pocethod) <30; select length(concat(jmeno,prijmeni)),RodCislo from student;
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 02-08-2016 a las 16:35:19 -- Versión del servidor: 5.6.17-log -- Versión de PHP: 5.5.12 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 */; -- -- Base de datos: `equipo` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `modules` -- CREATE TABLE IF NOT EXISTS `modules` ( `idmodule` int(10) unsigned NOT NULL AUTO_INCREMENT, `codeModule` varchar(10) COLLATE utf8_spanish_ci DEFAULT NULL, `nameModule` varchar(20) COLLATE utf8_spanish_ci DEFAULT NULL, `descModule` varchar(250) COLLATE utf8_spanish_ci DEFAULT NULL, `dateModule` date DEFAULT NULL, `statusModu` set('Enabled','Disabled') COLLATE utf8_spanish_ci DEFAULT NULL, PRIMARY KEY (`idmodule`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=18 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `mod_profile` -- CREATE TABLE IF NOT EXISTS `mod_profile` ( `idmod_prof` int(10) unsigned NOT NULL AUTO_INCREMENT, `idmodule` int(11) DEFAULT NULL, `idProfile` int(11) DEFAULT NULL, PRIMARY KEY (`idmod_prof`), KEY `fk1` (`idmodule`), KEY `fk2` (`idProfile`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=101 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `profiles` -- CREATE TABLE IF NOT EXISTS `profiles` ( `idProfile` int(10) unsigned NOT NULL AUTO_INCREMENT, `codeProfi` varchar(10) COLLATE utf8_spanish_ci DEFAULT NULL, `nameProfi` varchar(10) COLLATE utf8_spanish_ci DEFAULT NULL, `descProfi` varchar(250) COLLATE utf8_spanish_ci DEFAULT NULL, `dateProfi` date DEFAULT NULL, `statusPro` set('Enabled','Disabled') COLLATE utf8_spanish_ci DEFAULT NULL, PRIMARY KEY (`idProfile`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `roles` -- CREATE TABLE IF NOT EXISTS `roles` ( `idRole` int(10) unsigned NOT NULL AUTO_INCREMENT, `codeRole` varchar(10) COLLATE utf8_spanish_ci DEFAULT NULL, `nameRole` varchar(250) COLLATE utf8_spanish_ci DEFAULT NULL, `descRole` longtext COLLATE utf8_spanish_ci, `dateRole` date DEFAULT NULL, `statRole` set('Enabled','Disabled') COLLATE utf8_spanish_ci DEFAULT NULL, `idmodule` int(11) DEFAULT NULL, PRIMARY KEY (`idRole`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=47 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `role_user` -- CREATE TABLE IF NOT EXISTS `role_user` ( `idRolUs` int(10) unsigned NOT NULL AUTO_INCREMENT, `idUsers` int(11) DEFAULT NULL, `idRole` int(11) DEFAULT NULL, PRIMARY KEY (`idRolUs`), KEY `fk1` (`idUsers`), KEY `fk2` (`idRole`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=770 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `users` -- CREATE TABLE IF NOT EXISTS `users` ( `idUsers` int(10) unsigned NOT NULL AUTO_INCREMENT, `loginUsers` varchar(15) COLLATE utf8_spanish_ci DEFAULT NULL, `passUsers` varchar(20) COLLATE utf8_spanish_ci DEFAULT NULL, `emailUser` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `idActiveCode` varchar(50) COLLATE utf8_spanish_ci DEFAULT NULL, `path_imgUser` longtext COLLATE utf8_spanish_ci, `statusUsers` set('Enabled','Disabled') COLLATE utf8_spanish_ci DEFAULT NULL, `idexistindb` int(11) DEFAULT NULL, `funcionario_id` int(11) DEFAULT NULL, PRIMARY KEY (`idUsers`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=55 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `user_pro` -- CREATE TABLE IF NOT EXISTS `user_pro` ( `idUserPro` int(10) unsigned NOT NULL AUTO_INCREMENT, `idProfile` int(11) DEFAULT NULL, `idUsers` int(11) DEFAULT NULL, `default` int(11) DEFAULT NULL, PRIMARY KEY (`idUserPro`), KEY `fk1` (`idProfile`), KEY `fk2` (`idUsers`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=163 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE IF NOT EXISTS `usuarios` ( `id_documento` int(11) NOT NULL, `usuario` varchar(45) DEFAULT NULL, `nombres` varchar(45) DEFAULT NULL, `apellidos` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, `pass` varchar(45) DEFAULT NULL, `activa` int(11) DEFAULT NULL, `perfiles_id` int(11) DEFAULT NULL, PRIMARY KEY (`id_documento`) ) 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 */;
-- Table: muni.subject_category -- DROP TABLE muni.subject_category; CREATE TABLE muni.subject_category ( faculty character varying COLLATE pg_catalog."default" NOT NULL, code character varying COLLATE pg_catalog."default" NOT NULL, guild_id bigint NOT NULL, category_name character varying COLLATE pg_catalog."default" NOT NULL, CONSTRAINT subject_category_fkey_code FOREIGN KEY (faculty, code) REFERENCES muni.subjects (faculty, code) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT subject_category_fkey_guild FOREIGN KEY (guild_id) REFERENCES server.guilds (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE muni.subject_category OWNER to masaryk; -- Index: fki_subject_category_fkey_code -- DROP INDEX muni.fki_subject_category_fkey_code; CREATE INDEX fki_subject_category_fkey_code ON muni.subject_category USING btree (faculty COLLATE pg_catalog."default" ASC NULLS LAST, code COLLATE pg_catalog."default" ASC NULLS LAST) TABLESPACE pg_default; -- Index: fki_subject_category_fkey_guild -- DROP INDEX muni.fki_subject_category_fkey_guild; CREATE INDEX fki_subject_category_fkey_guild ON muni.subject_category USING btree (guild_id ASC NULLS LAST) TABLESPACE pg_default; -- Index: subject_category_idx_unique -- DROP INDEX muni.subject_category_idx_unique; CREATE UNIQUE INDEX subject_category_idx_unique ON muni.subject_category USING btree (faculty COLLATE pg_catalog."default" ASC NULLS LAST, code COLLATE pg_catalog."default" ASC NULLS LAST, guild_id ASC NULLS LAST) TABLESPACE pg_default;
declare v_type nvarchar2(20); v_modelId number; v_apiCode nvarchar2(255); v_name nvarchar2(255); v_code nvarchar2(255); v_columName nvarchar2(255); v_description nvarchar2(500); v_objectApiCode nvarchar2(255); v_objectTypeCode nvarchar2(255); v_dataTypeCode nvarchar2(255); v_config nvarchar2(32767); v_isInsertable number; v_isSearchable number; v_isUpdatable number; v_isRetrievableInDetail number; v_isRetrievableInList number; v_isSystem number; v_isRequired number; v_domInsertAttrId number; v_domUpdateAttrId number; v_attrFormatCode nvarchar2(255); v_fomAttrId number; v_renderObjectId number; v_typeCode nvarchar2(255); v_somObjectId number; v_domObjectId number; v_objectCode nvarchar2(255); v_attrOrder number; v_isRoot number; begin -- Init v_type := :Type; v_modelId := :ModelId; v_apiCode := :ApiCode; v_name := :Name; v_code := :Code; v_description := :Description; v_columName := :ColumnName; v_objectApiCode := :ObjectApiCode; v_objectTypeCode := :ObjectTypeCode; v_objectCode := :ObjectCode; v_dataTypeCode := :DataTypeCode; v_config := :Config; v_isInsertable := :IsInsertable; v_isSearchable := :IsSearchable; v_isUpdatable := :IsUpdatable; v_isRetrievableInDetail := :IsRetrievableInDetail; v_isRetrievableInList := :IsRetrievableInList; v_isSystem := :IsSystem; v_isRequired := :IsRequired; :ErrorMessage := ''; :ErrorCode := 0; v_attrOrder := 0; v_isRoot := 0; if (v_modelId is null or v_apiCode is null) then :ErrorCode := 101; :ErrorMessage := 'Input parameters can not be null'; goto exit_; end if; if (v_objectTypeCode = 'parentBusinessObject') then v_attrFormatCode := v_code; else -- Calculate correct format code v_attrFormatCode := v_objectCode || '_' || v_code; v_attrFormatCode := upper(v_attrFormatCode); if length(v_attrFormatCode) > 30 then v_attrFormatCode := substr(v_attrFormatCode, 1, 15) || substr(v_attrFormatCode, -15); end if; end if; begin begin select d.col_id, nvl(d.col_isroot, 0) into v_domObjectId, v_isRoot from tbl_fom_object f inner join tbl_dom_object d on d.col_dom_objectfom_object = f.col_id where upper(f.col_apicode) = upper(v_objectApiCode) and upper(d.col_code) = upper(v_objectCode) and d.col_dom_objectdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId); exception when no_data_found then :ErrorMessage := 'Error on ' || (case when v_type = 'MODIFY' then 'modify' else 'create' end) || ' attribute with code - ' || v_apiCode || ': '; :ErrorMessage := :ErrorMessage || 'Object is not found'; :ErrorCode := 101; goto exit_; end; begin select s.col_id into v_somObjectId from tbl_fom_object f inner join tbl_som_object s on s.col_som_objectfom_object = f.col_id where upper(f.col_apicode) = upper(v_objectApiCode) and upper(s.col_code) = upper(v_objectCode) and s.col_som_objectsom_model = (select col_id from tbl_som_model where col_som_modelmdm_model = v_modelId); exception when no_data_found then :ErrorMessage := 'Error on ' || (case when v_type = 'MODIFY' then 'modify' else 'create' end) || ' attribute with code - ' || v_apiCode || ': '; :ErrorMessage := :ErrorMessage || 'Object is not found'; :ErrorCode := 101; goto exit_; end; -- For root order is 100 -- For none root order is 200 -- For reference object order is 1000 if (v_objectTypeCode = 'referenceObject') then v_attrOrder := 1000; else if(v_isRoot = 1) then v_attrOrder := 100; else v_attrOrder := 200; end if; end if; if v_type = 'CREATE' then -- Create tbl_fom_attribute if (v_objectTypeCode IN ('rootBusinessObject', 'businessObject')) then insert into tbl_fom_attribute (col_code, col_name, col_apicode, col_columnname, col_alias, col_storagetype, col_fom_attributefom_object, col_fom_attributedatatype) values (v_attrFormatCode, v_name, v_apiCode, v_columName, -- temporary fix, todo remove it (case when lower(v_columName) = 'col_id' then 'ID' else to_char(v_attrFormatCode) end), 'SIMPLE', (select col_id from tbl_fom_object where upper(col_apicode) = upper(v_objectApiCode)), (select col_id from tbl_dict_datatype where upper(col_code) = upper(v_dataTypeCode))) returning col_id into v_fomAttrId; else select col_id into v_fomAttrId from tbl_fom_attribute where upper(col_apicode) = upper(v_apiCode); end if; --Create tbl_dom_attribute insert into tbl_dom_attribute (col_code, col_name, col_description, col_isinsertable, col_isupdatable, col_issearchable, col_isretrievableindetail, col_isretrievableinlist, col_dom_attrfom_attr, col_dom_attributedom_object, col_config, col_issystem, col_isrequired, col_dorder) values (v_attrFormatCode, v_name, v_description, v_isInsertable, v_isUpdatable, v_isSearchable, v_isRetrievableInDetail, v_isRetrievableInList, v_fomAttrId, v_domObjectId, v_config, v_isSystem, v_isRequired, v_attrOrder); --Calculate RenderObject.col_id select (case when lower(v_typeCode) in ('createdby', 'createddate', 'modifiedby', 'modifieddate') then case when lower(v_objectApiCode) = lower('root_Case') then (select ro.col_id from tbl_dom_renderobject ro inner join tbl_dict_datatype dt on ro.col_dom_renderobjectdatatype = dt.col_id where lower(ro.col_code) = lower('CASE' || v_typeCode)) else (select ro.col_id from tbl_dom_renderobject ro inner join tbl_dict_datatype dt on ro.col_dom_renderobjectdatatype = dt.col_id where lower(ro.col_code) = lower(v_typeCode)) end when v_objectTypeCode = 'referenceObject' then (select ro.col_id from tbl_dom_renderobject ro inner join tbl_dom_referenceobject refo on ro.col_renderobjectfom_object = refo.col_dom_refobjectfom_object inner join tbl_fom_object fo on ro.col_renderobjectfom_object = fo.col_id where lower(col_apicode) = lower(v_objectApiCode)) when lower(v_objectApiCode) = lower('root_Case') and v_objectTypeCode = 'parentBusinessObject' and lower(v_code) = lower('CASE_CASEID') then (select col_id from tbl_dom_renderobject where lower(col_code) = lower('CASEID')) else null end) into v_renderObjectId from dual; --Create tbl_dom_attribute insert into tbl_som_attribute (col_code, col_name, col_description, col_isinsertable, col_isupdatable, col_issearchable, col_isretrievableindetail, col_isretrievableinlist, col_som_attrfom_attr, col_som_attributesom_object, col_config, col_issystem, col_som_attributerenderobject, col_som_attributerefobject, col_dorder) values (v_attrFormatCode, v_name, v_description, v_isInsertable, v_isUpdatable, v_isSearchable, v_isRetrievableInDetail, v_isRetrievableInList, v_fomAttrId, v_somObjectId, v_config, v_isSystem, v_renderObjectId, (select refo.col_id from tbl_dom_referenceobject refo inner join tbl_fom_object fo on refo.col_dom_refobjectfom_object = fo.col_id where lower(fo.col_apicode) = lower(v_objectApiCode)), v_attrOrder); -- Create tbl_dom_insertattr if (v_isInsertable = 1) then insert into tbl_dom_insertattr (col_code, col_name, col_mappingname, col_dom_insertattrdom_config, col_dom_insertattrfom_attr, col_dom_insertattrdom_attr, col_dom_insertattrfom_path, col_dorder) values (v_attrFormatCode, v_name, upper(v_attrFormatCode), (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'CREATE'), v_fomAttrId, (select d.col_id from tbl_dom_attribute d where d.col_dom_attrfom_attr = v_fomAttrId and d.col_dom_attributedom_object = v_domObjectId and upper(col_code) = upper(v_attrFormatCode)), (select d.col_dom_object_pathtoprntext from tbl_dom_object d where d.col_id = v_domObjectId), v_attrOrder); end if; -- Create v_isUpdatable if (v_isUpdatable = 1) then insert into tbl_dom_updateattr (col_code, col_name, col_mappingname, col_dom_updateattrdom_config, col_dom_updateattrfom_attr, col_dom_updateattrdom_attr, col_dom_updateattrfom_path, col_dorder) values (v_attrFormatCode, v_name, upper(v_attrFormatCode), (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'EDIT'), v_fomAttrId, (select d.col_id from tbl_dom_attribute d where d.col_dom_attrfom_attr = v_fomAttrId and d.col_dom_attributedom_object = v_domObjectId and upper(col_code) = upper(v_attrFormatCode)), (select d.col_dom_object_pathtoprntext from tbl_dom_object d where d.col_id = v_domObjectId), v_attrOrder); end if; elsif v_type = 'MODIFY' then select col_id into v_fomAttrId from tbl_fom_attribute where upper(col_apicode) = upper(v_apiCode); if (v_objectTypeCode IN ('rootBusinessObject', 'businessObject')) then update tbl_fom_attribute set col_name = v_name, col_fom_attributedatatype = (select col_id from tbl_dict_datatype where upper(col_code) = upper(v_dataTypeCode)) where col_id = v_fomAttrId; end if; update tbl_dom_attribute set col_name = v_name, col_description = v_description, col_isinsertable = v_isInsertable, col_isupdatable = v_isUpdatable, col_issearchable = v_isSearchable, col_isretrievableindetail = v_isRetrievableInDetail, col_isretrievableinlist = v_isRetrievableInList, col_config = v_config, col_isrequired = v_isRequired where col_dom_attributedom_object = v_domObjectId and upper(col_code) = upper(v_attrFormatCode) and col_dom_attrfom_attr = v_fomAttrId; update tbl_som_attribute set col_name = v_name, col_description = v_description, col_isinsertable = v_isInsertable, col_isupdatable = v_isUpdatable, col_issearchable = v_isSearchable, col_isretrievableindetail = v_isRetrievableInDetail, col_isretrievableinlist = v_isRetrievableInList, col_config = v_config where col_som_attributesom_object = v_somObjectId and upper(col_code) = upper(v_attrFormatCode) and col_som_attrfom_attr = v_fomAttrId; begin select col_id into v_domInsertAttrId from tbl_dom_insertattr where col_dom_insertattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_dom_insertattrdom_config = (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'CREATE'); exception when no_data_found then v_domInsertAttrId := null; end; if (v_isInsertable = 1) then if(v_domInsertAttrId is null) then insert into tbl_dom_insertattr ( col_code, col_name, col_mappingname, col_dom_insertattrdom_config, col_dom_insertattrfom_attr, col_dom_insertattrdom_attr, col_dom_insertattrfom_path, col_dorder ) values ( v_attrFormatCode, v_name, upper(v_attrFormatCode), (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'CREATE'), v_fomAttrId, (select d.col_id from tbl_dom_attribute d where d.col_dom_attrfom_attr = v_fomAttrId and d.col_dom_attributedom_object = v_domObjectId and upper(col_code) = upper(v_attrFormatCode)), (select d.col_dom_object_pathtoprntext from tbl_dom_object d where d.col_id = v_domObjectId), v_attrOrder ); else update tbl_dom_insertattr set col_name = v_name where col_id = v_domInsertAttrId; end if; else if(v_domInsertAttrId is not null) then delete from tbl_dom_insertattr where col_id = v_domInsertAttrId; end if; end if; begin select col_id into v_domUpdateAttrId from tbl_dom_updateattr where col_dom_updateattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_dom_updateattrdom_config = (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'EDIT'); exception when no_data_found then v_domUpdateAttrId := null; end; if (v_isUpdatable = 1) then if(v_domUpdateAttrId is null) then insert into tbl_dom_updateattr ( col_code, col_name, col_mappingname, col_dom_updateattrdom_config, col_dom_updateattrfom_attr, col_dom_updateattrdom_attr, col_dom_updateattrfom_path, col_dorder ) values ( v_attrFormatCode, v_name, upper(v_attrFormatCode), (select dc.col_id from tbl_dom_config dc where dc.col_dom_configdom_model = (select col_id from tbl_dom_model where col_dom_modelmdm_model = v_modelId) and dc.col_purpose = 'EDIT'), v_fomAttrId, (select d.col_id from tbl_dom_attribute d where d.col_dom_attrfom_attr = v_fomAttrId and d.col_dom_attributedom_object = v_domObjectId and upper(col_code) = upper(v_attrFormatCode)), (select d.col_dom_object_pathtoprntext from tbl_dom_object d where d.col_id = v_domObjectId), v_attrOrder ); else update tbl_dom_updateattr set col_name = v_name where col_id = v_domUpdateAttrId; end if; else if(v_domUpdateAttrId is not null) then delete from tbl_dom_updateattr where col_id = v_domUpdateAttrId; end if; end if; if (v_isSearchable = 1) then update tbl_som_searchattr set col_name = v_name where col_som_searchattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_som_searchattrsom_config in (select sc.col_id from tbl_som_model sm inner join tbl_som_config sc on sm.col_id = sc.col_som_configsom_model where sm.col_som_modelmdm_model = v_modelId); else delete from tbl_som_searchattr where col_som_searchattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_som_searchattrsom_config in (select sc.col_id from tbl_som_model sm inner join tbl_som_config sc on sm.col_id = sc.col_som_configsom_model where sm.col_som_modelmdm_model = v_modelId); end if; if (v_isRetrievableInList = 1) then update tbl_som_resultattr set col_name = v_name where col_som_resultattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_som_resultattrsom_config in (select sc.col_id from tbl_som_model sm inner join tbl_som_config sc on sm.col_id = sc.col_som_configsom_model where sm.col_som_modelmdm_model = v_modelId); else delete from tbl_som_resultattr where col_som_resultattrfom_attr = v_fomAttrId and upper(col_code) = upper(v_attrFormatCode) and col_som_resultattrsom_config in (select sc.col_id from tbl_som_model sm inner join tbl_som_config sc on sm.col_id = sc.col_som_configsom_model where sm.col_som_modelmdm_model = v_modelId); end if; end if; exception when OTHERS then :ErrorMessage := 'Error on ' || (case when v_type = 'MODIFY' then 'modify' else 'create' end) || ' attribute with code - ' || v_apiCode || ' ' || SUBSTR(SQLERRM, 1, 150); :ErrorCode := 101; end; <<exit_>> NULL; end;
CREATE TABLE CLASSINFO ( CLASSID CHAR(15) not null primary key, /** 班级编号 */ CLASSBID CHAR(10) not null, /** 总部班级编号 */ CLASSTEACHER VARCHAR(10), /** 授课教员 */ CLASSMANAGER VARCHAR(10), /** 班主任 */ CLASSBEGINDATE VARCHAR(10), /** 开课日期 */ CLASSFINISHDATE VARCHAR(10), /** 预计结课日期 */ CLASSTESTDATE VARCHAR(10), /** 预计参加考试时间 */ CLASSTYPE VARCHAR(10), /** 班级种类 */ CLASSPERWEEK SMALLINT default 12, /** 周课时数 */ CLASSBEGINNUMBER SMALLINT default 0, /** 开课人数 */ CLASSSTUIN SMALLINT default 0, /** 转入 */ CLASSSTUOUT SMALLINT default 0, /** 转出 */ CLASSSTUPAUSE SMALLINT default 0, /** 休学 */ CLASSSTUNUMBER SMALLINT default 0, /** 班级人数 */ CLASSENDDATE VARCHAR(10), /** 结课日期 */ CLASSENDNUMBER SMALLINT default 0, /** 结课时人数 */ CLASSPRERATE FLOAT default 0.0, /** 预计升学率 */ CLASSPASSNUMBER SMALLINT default 0, /** 获证人数 */ CLASSREALNUMBER SMALLINT default 0, /** 实际开学人数 */ CLASSREALRATE FLOAT default 0.0, /** 实际升学率 */ CLASSSEME CHAR(2) default 'S1' /** 学期 */ ); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006S10617A', '6071041T01', '陈丽娜', '朱梅松', 'T135AM','S1'); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006S10722A', '6072841T01', '史晓伦', '张慧慧', 'T135PM','S1'); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006S20628A', '6062842Y01', '党国涛', '张淑红', 'T246AM','S2'); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006S20814A', '6081082T01', '王海龙', '朱梅松', 'T246PM','S2'); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006Y20310A', '6031043T01', '姬晓峰', '孙燕', 'T135AM','Y2'); insert into classinfo(classid,classbid,classteacher,classmanager,classtype,classseme) values ('ACCP2006Y20322A', '6032243W01', '周磊', '杨俊英', 'T135PM','Y2');
create table ACT_RU_TASK ( ID_ nvarchar(64), REV_ int, EXECUTION_ID_ nvarchar(64), PROC_INST_ID_ nvarchar(64), PROC_DEF_ID_ nvarchar(64), TASK_DEF_ID_ nvarchar(64), SCOPE_ID_ nvarchar(255), SUB_SCOPE_ID_ nvarchar(255), SCOPE_TYPE_ nvarchar(255), SCOPE_DEFINITION_ID_ nvarchar(255), PROPAGATED_STAGE_INST_ID_ nvarchar(255), NAME_ nvarchar(255), PARENT_TASK_ID_ nvarchar(64), DESCRIPTION_ nvarchar(4000), TASK_DEF_KEY_ nvarchar(255), OWNER_ nvarchar(255), ASSIGNEE_ nvarchar(255), DELEGATION_ nvarchar(64), PRIORITY_ int, CREATE_TIME_ datetime, DUE_DATE_ datetime, CATEGORY_ nvarchar(255), SUSPENSION_STATE_ int, TENANT_ID_ nvarchar(255) default '', FORM_KEY_ nvarchar(255), CLAIM_TIME_ datetime, IS_COUNT_ENABLED_ tinyint, VAR_COUNT_ int, ID_LINK_COUNT_ int, SUB_TASK_COUNT_ int, primary key (ID_) ); create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); create index ACT_IDX_TASK_SCOPE on ACT_RU_TASK(SCOPE_ID_, SCOPE_TYPE_); create index ACT_IDX_TASK_SUB_SCOPE on ACT_RU_TASK(SUB_SCOPE_ID_, SCOPE_TYPE_); create index ACT_IDX_TASK_SCOPE_DEF on ACT_RU_TASK(SCOPE_DEFINITION_ID_, SCOPE_TYPE_); insert into ACT_GE_PROPERTY values ('task.schema.version', '6.8.1.0', 1);
declare v_TaskId Integer; v_SlaEventId Integer; v_stateClosed nvarchar2(255); v_result number; begin v_TaskId := :TaskId; v_SlaEventId := 0; v_stateClosed := f_dcm_getTaskClosedState(); for rec in (select se.col_id as SlaEventId, tsk.col_id as TaskId, tsk.col_name as TaskName, tsk.col_taskid as TaskTitle, tsk.col_casetask as CaseId, tsk.col_parentid as TaskParentId, tsk.col_tw_workitemtask as TaskWorkitemId, setp.col_id as SlaEventTypeId, setp.col_code as SlaEventTypeCode, setp.col_name as SlaEventTypeName, setp.col_intervalds as SlaEventTypeIntervalDS, setp.col_intervalym as SlaEventTypeIntervalYM, sel.col_id as SlaEventLevelId, sel.col_code as SlaEventLevelCode, sel.col_name as SlaEventCodeName, det.col_id as DateEventTypeId, det.col_code as DateEventTypeCode, det.col_name as DateEventTypeName, de.col_id as DateEventId, de.col_datename as DateEventName, de.col_datevalue as DateEventValue, de.col_performedby as DateEventPerformedBy, cast (de.col_datevalue as timestamp) as DateTimeEventValue, sa.col_id as SlaActionId, sa.col_code as SlaActionCode, sa.col_name as SlaActionName, sa.col_processorcode as SlaActionProcessor from tbl_slaevent se inner join tbl_task tsk on se.col_slaeventtask = tsk.col_id inner join tbl_tw_workitem twi on tsk.col_tw_workitemtask = twi.col_id inner join tbl_dict_slaeventtype setp on se.col_slaeventdict_slaeventtype = setp.col_id inner join tbl_dict_slaeventlevel sel on se.col_slaevent_slaeventlevel = sel.col_id inner join tbl_dict_dateeventtype det on se.col_slaevent_dateeventtype = det.col_id inner join tbl_dateevent de on tsk.col_id = de.col_dateeventtask and se.col_slaevent_dateeventtype = de.col_dateevent_dateeventtype inner join tbl_slaaction sa on se.col_id = sa.col_slaactionslaevent where tsk.col_id = v_TaskId and de.col_datevalue + (case when se.col_intervalds is not null then to_dsinterval(se.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) * (se.col_attemptcount + 1) + (case when se.col_intervalym is not null then to_yminterval(se.col_intervalym) else to_yminterval('0-0') end) * (se.col_attemptcount + 1) <= --(case when setp.col_intervalds is not null then to_dsinterval(setp.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) * (se.col_attemptcount + 1) + --(case when setp.col_intervalym is not null then to_yminterval(setp.col_intervalym) else to_yminterval('0-0') end) * (se.col_attemptcount + 1) <= sysdate and se.col_maxattempts > se.col_attemptcount and twi.col_activity not in (v_stateClosed)) loop v_result := f_DCM_invokeslaprocessor(ProcessorName => rec.SlaActionProcessor, SlaActionId => rec.SlaActionId); if v_SlaEventId <> rec.SlaEventId then update tbl_slaevent set col_attemptcount = col_attemptcount + 1 where col_id = rec.SlaEventId; v_SlaEventId := rec.SlaEventId; end if; end loop; end;
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 11, 2020 at 06:25 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.26 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: `webtech` -- -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `Name` text NOT NULL, `Email` text NOT NULL, `Password` text NOT NULL, `Mobile` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `login` -- INSERT INTO `login` (`Name`, `Email`, `Password`, `Mobile`) VALUES ('Sneha Vasa', 'S123@gmail.com', 'adesfsre232', '1234567890'); 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 */;
REM INSERTING into TAB_SEQ_DAILY SET DEFINE OFF; Insert into TAB_SEQ_DAILY (SEQ_DATE) values (to_date('16-FEB-17','DD-MON-RR'));
DROP DATABASE usarps; CREATE OR REPLACE DATABASE usarps; USE usarps; CREATE TABLE game( pk_game_id INTEGER PRIMARY KEY AUTO_INCREMENT, player1 VARCHAR(40), player2 VARCHAR(40), date DATE ); CREATE TABLE round( pk_round_id INTEGER PRIMARY KEY AUTO_INCREMENT, fk_pk_game_id INTEGER, symbol1 VARCHAR(40), symbol2 VARCHAR(40), winner INTEGER, time TIME, CONSTRAINT game FOREIGN KEY (fk_pk_game_id) REFERENCES game(pk_game_id) ); INSERT INTO game(player1, player2, date) VALUES ("Elias", "Hasan", '2020-05-04'); INSERT INTO game(player1, player2, date) VALUES ("Samuel", "Elias", '2020-05-04'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (1, "rock", "paper", 2, '14:31:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (1, "rock", "paper", 2, '14:33:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (1, "paper", "rock", 1, '14:35:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (1, "rock", "scissors", 1, '14:36:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (1, "paper", "rock", 1, '14:38:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "scissors", "paper", 1, '15:12:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "paper", "paper", 0, '15:14:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "scissors", "rock", 2, '15:15:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "rock", "scissors", 1, '15:17:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "scissors", "rock", 2, '15:18:00'); INSERT INTO round(fk_pk_game_id, symbol1, symbol2, winner, time) VALUES (2, "rock", "scissors", 1, '15:20:00');
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Creato il: Gen 10, 2019 alle 23:40 -- Versione del server: 5.7.23 -- Versione 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 */; -- -- Database: `common` -- -- -------------------------------------------------------- -- -- Struttura della tabella `timeline_events` -- DROP TABLE IF EXISTS `timeline_events`; CREATE TABLE IF NOT EXISTS `timeline_events` ( `id` int(11) NOT NULL AUTO_INCREMENT, `year` int(4) NOT NULL, `title` varchar(150) NOT NULL, `text` varchar(255) NOT NULL, `color` varchar(10) NOT NULL, `icon` varchar(30) NOT NULL, `event_order` int(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dump dei dati per la tabella `timeline_events` -- INSERT INTO `timeline_events` (`id`, `year`, `title`, `text`, `color`, `icon`, `event_order`) VALUES (1, 0, 'Laurea Triennale', 'Nel 2013 mi sono laureata in Scienze e Tecniche Psicologiche, presso l\'Università degli Studi di Firenze.', '#d9534f', 'fa fa-graduation-cap', 0), (2, 0, 'Laurea Magistrale', 'Nel 2015 ho conseguito la laurea magistrale in Processi di Sviluppo e Tutela dell\'Infanzia, presso l\'Università Cattolica del Sacro Cuore di Milano.', '#3f903f', 'fa fa-graduation-cap', 1), (3, 0, 'Master Post Laurea', 'Nel 2017 mi sono specializzata con un master in Psicodiagnostica Clinica e Forense, Psicologia Giuridica.', '#00009C', 'fa fa-book', 2), (4, 0, 'Psicologa e Psicodiagnosta Clinica e Forense', 'Adesso lavoro come psicologa competente nei processi di promozione delle risorse in bambini, adolescenti e adulti. <br> <a href=\'/about-my-work\'>Clicca qui per saperne di più sulle mie attività..</a>', '#ff9fdf', 'fa fa-briefcase', 3); 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 */;
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Dim 11 Mars 2018 à 17:17 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.4.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 */; -- -- Base de données: `test1` -- -- -------------------------------------------------------- -- -- Structure de la table `arbitre` -- CREATE TABLE IF NOT EXISTS `arbitre` ( `id_arbitre` int(11) NOT NULL AUTO_INCREMENT, `Prenom` varchar(100) DEFAULT NULL, `Nom` varchar(100) DEFAULT NULL, `Nationalite` varchar(100) DEFAULT NULL, `Age` int(11) DEFAULT NULL, `id_renc` int(11) DEFAULT NULL, PRIMARY KEY (`id_arbitre`), KEY `fk_renco` (`id_renc`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `coach` -- CREATE TABLE IF NOT EXISTS `coach` ( `id_coach` int(11) NOT NULL AUTO_INCREMENT, `Prenom` varchar(100) DEFAULT NULL, `Nom` varchar(100) DEFAULT NULL, `Nationalite` varchar(100) DEFAULT NULL, `Age` int(11) DEFAULT NULL, PRIMARY KEY (`id_coach`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `equipe` -- CREATE TABLE IF NOT EXISTS `equipe` ( `Nom_equipe` varchar(100) NOT NULL DEFAULT '', `id_coach` int(11) DEFAULT NULL, PRIMARY KEY (`Nom_equipe`), KEY `fk_coach` (`id_coach`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `evenement` -- CREATE TABLE IF NOT EXISTS `evenement` ( `id_even` int(11) NOT NULL AUTO_INCREMENT, `Type_even` varchar(20) DEFAULT NULL, `Heure` varchar(15) DEFAULT NULL, `id_renc` int(11) DEFAULT NULL, `id_joueur` int(11) DEFAULT NULL, `Nom_equipe` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_even`), KEY `fk_renc` (`id_renc`), KEY `fk_joueur` (`id_joueur`), KEY `fk_ekip` (`Nom_equipe`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `joueur` -- CREATE TABLE IF NOT EXISTS `joueur` ( `id_joueur` int(11) NOT NULL AUTO_INCREMENT, `Prenom` varchar(100) DEFAULT NULL, `Nom` varchar(100) DEFAULT NULL, `Nationalite` varchar(100) DEFAULT NULL, `Age` int(11) DEFAULT NULL, `Taille` int(11) DEFAULT NULL, `Nom_equipe` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_joueur`), KEY `fk_equip` (`Nom_equipe`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `phase` -- CREATE TABLE IF NOT EXISTS `phase` ( `id_phase` int(11) NOT NULL AUTO_INCREMENT, `Etape_Phase` varchar(20) DEFAULT NULL, `Duree_Phase` varchar(20) DEFAULT NULL, `id_tourn` int(11) DEFAULT NULL, `Nom_stade` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_phase`), KEY `fk_tourn` (`id_tourn`), KEY `fk_stad` (`Nom_stade`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `poule` -- CREATE TABLE IF NOT EXISTS `poule` ( `id_poule` varchar(20) NOT NULL DEFAULT '', `id_phas` int(11) DEFAULT NULL, PRIMARY KEY (`id_poule`), KEY `fk_phase` (`id_phas`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `rencontre` -- CREATE TABLE IF NOT EXISTS `rencontre` ( `id_renc` int(11) NOT NULL AUTO_INCREMENT, `Lieu_renc` varchar(100) DEFAULT NULL, `Date_renc` date DEFAULT NULL, `Heure_renc` varchar(20) DEFAULT NULL, `Nom_Stade` varchar(100) DEFAULT NULL, `id_phase` int(11) DEFAULT NULL, `Nom_equipe` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_renc`), KEY `fk_stade` (`Nom_Stade`), KEY `fk_equipe` (`Nom_equipe`), KEY `fk_phas` (`id_phase`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `stade` -- CREATE TABLE IF NOT EXISTS `stade` ( `Nom_Stade` varchar(100) NOT NULL DEFAULT '', `Lieu` varchar(100) DEFAULT NULL, PRIMARY KEY (`Nom_Stade`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `tournoi` -- CREATE TABLE IF NOT EXISTS `tournoi` ( `id_tour` int(11) NOT NULL AUTO_INCREMENT, `Nom` varchar(100) DEFAULT NULL, PRIMARY KEY (`id_tour`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Contraintes pour les tables exportées -- -- -- Contraintes pour la table `arbitre` -- ALTER TABLE `arbitre` ADD CONSTRAINT `fk_renco` FOREIGN KEY (`id_renc`) REFERENCES `rencontre` (`id_renc`); -- -- Contraintes pour la table `equipe` -- ALTER TABLE `equipe` ADD CONSTRAINT `fk_coach` FOREIGN KEY (`id_coach`) REFERENCES `coach` (`id_coach`); -- -- Contraintes pour la table `evenement` -- ALTER TABLE `evenement` ADD CONSTRAINT `fk_ekip` FOREIGN KEY (`Nom_equipe`) REFERENCES `equipe` (`Nom_equipe`), ADD CONSTRAINT `fk_joueur` FOREIGN KEY (`id_joueur`) REFERENCES `joueur` (`id_joueur`), ADD CONSTRAINT `fk_renc` FOREIGN KEY (`id_renc`) REFERENCES `rencontre` (`id_renc`); -- -- Contraintes pour la table `joueur` -- ALTER TABLE `joueur` ADD CONSTRAINT `fk_equip` FOREIGN KEY (`Nom_equipe`) REFERENCES `equipe` (`Nom_equipe`); -- -- Contraintes pour la table `phase` -- ALTER TABLE `phase` ADD CONSTRAINT `fk_stad` FOREIGN KEY (`Nom_stade`) REFERENCES `stade` (`Nom_Stade`), ADD CONSTRAINT `fk_tourn` FOREIGN KEY (`id_tourn`) REFERENCES `tournoi` (`id_tour`); -- -- Contraintes pour la table `poule` -- ALTER TABLE `poule` ADD CONSTRAINT `fk_phase` FOREIGN KEY (`id_phas`) REFERENCES `phase` (`id_phase`); -- -- Contraintes pour la table `rencontre` -- ALTER TABLE `rencontre` ADD CONSTRAINT `fk_phas` FOREIGN KEY (`id_phase`) REFERENCES `phase` (`id_phase`), ADD CONSTRAINT `fk_equipe` FOREIGN KEY (`Nom_equipe`) REFERENCES `equipe` (`Nom_equipe`), ADD CONSTRAINT `fk_stade` FOREIGN KEY (`Nom_Stade`) REFERENCES `stade` (`Nom_Stade`); /*!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 */;
# --- !Ups ALTER TABLE member ADD COLUMN province_id bigint; ALTER TABLE member ADD COLUMN city_id bigint; ALTER TABLE member ADD COLUMN address varchar(255); ALTER TABLE member ADD COLUMN refferal_id bigint; # --- !Downs ALTER TABLE member DROP COLUMN province_id; ALTER TABLE member DROP COLUMN city_id; ALTER TABLE member DROP COLUMN address; ALTER TABLE member DROP COLUMN refferal_id;
-- Explore data formats; get data types and syntax from schema SELECT * FROM city_list LIMIT 10; SELECT * FROM city_data LIMIT 10; SELECT * FROM global_data LIMIT 10; -- This works because there are no instances of these cities in other countries SELECT * FROM city_list WHERE city IN ('Los Angeles', 'London', 'Moscow') AND country IN ('United States', 'United Kingdom', 'Russia') LIMIT 10; -- Get city data SELECT year, city, avg_temp FROM city_data WHERE city IN ('Los Angeles', 'London', 'Moscow') AND country IN ('United States', 'United Kingdom', 'Russia') AND year >= 1900 ORDER BY city, year; -- Get global data SELECT * FROM global_data WHERE year >= 1900 ORDER BY year;
CREATE TABLE `user` ( `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(50) NOT NULL DEFAULT '', `login` VARCHAR(50) NOT NULL DEFAULT '', `password` CHAR(32) ) ENGINE=MyISAM COLLATE utf8_unicode_ci; CREATE TABLE `task` ( `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user_id` INT(11) UNSIGNED NOT NULL, `title` VARCHAR(50) NOT NULL DEFAULT '', `description` VARCHAR(255) NOT NULL DEFAULT '', `date_completed` INT(11), `status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1 - new, 2 - completed', INDEX idx_date_completed (date_completed), FULLTEXT idx_title (title), FULLTEXT idx_description (description) ) ENGINE=InnoDB COLLATE utf8_unicode_ci;
CREATE DATABASE IF NOT EXISTS database_docker; GRANT ALL PRIVILEGES on database_docker.* TO 'root'@'%' IDENTIFIED BY 'ppshein123456' WITH GRANT OPTION;
prompt --application/pages/page_00025 begin -- Manifest -- PAGE: 00025 -- Manifest End wwv_flow_api.component_begin ( p_version_yyyy_mm_dd=>'2020.03.31' ,p_release=>'20.1.0.00.13' ,p_default_workspace_id=>20 ,p_default_application_id=>8950 ,p_default_id_offset=>33309244842782322 ,p_default_owner=>'ORACLE' ); wwv_flow_api.create_page( p_id=>25 ,p_user_interface_id=>wwv_flow_api.id(1516216845576003405) ,p_name=>'Manage Sample Data' ,p_alias=>'MANAGE-SAMPLE-DATA' ,p_step_title=>'&APP_NAME. - Manage Sample Data' ,p_reload_on_submit=>'A' ,p_warn_on_unsaved_changes=>'N' ,p_autocomplete_on_off=>'ON' ,p_step_template=>wwv_flow_api.id(1256085647684075543) ,p_page_template_options=>'#DEFAULT#' ,p_required_role=>'MUST_NOT_BE_PUBLIC_USER' ,p_protection_level=>'C' ,p_last_upd_yyyymmddhh24miss=>'20200116130021' ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(1995642959414547622) ,p_plug_name=>'Manage Sample Data' ,p_region_css_classes=>'t-Alert--accessibleHeading' ,p_region_template_options=>'#DEFAULT#:t-Alert--wizard:t-Alert--defaultIcons:t-Alert--info' ,p_component_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(1256113281342075627) ,p_plug_display_sequence=>10 ,p_plug_display_point=>'BODY' ,p_plug_source=>'<p>This application ships with sample data. You can remove and recreate sample data using this page. If the sample data is old recreating the data makes the dates more current. Removing or adding sample data will not affect any decisions you creat' ||'ed.</p>' ,p_plug_query_headings_type=>'QUERY_COLUMNS' ,p_plug_query_num_rows=>15 ,p_plug_query_num_rows_type=>'NEXT_PREVIOUS_LINKS' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' ,p_plug_query_show_nulls_as=>' - ' ,p_pagination_display_position=>'BOTTOM_RIGHT' ,p_attribute_01=>'N' ,p_attribute_02=>'HTML' ,p_attribute_03=>'N' ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(1995643287536547623) ,p_plug_name=>'Button Region' ,p_parent_plug_id=>wwv_flow_api.id(1995642959414547622) ,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noPadding:t-ButtonRegion--noUI' ,p_plug_template=>wwv_flow_api.id(1256115554036075646) ,p_plug_display_sequence=>10 ,p_plug_display_point=>'BODY' ,p_translate_title=>'N' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' ,p_attribute_01=>'N' ,p_attribute_02=>'HTML' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(1995644154276547624) ,p_button_sequence=>10 ,p_button_plug_id=>wwv_flow_api.id(1995643287536547623) ,p_button_name=>'remove_sample_data' ,p_button_action=>'SUBMIT' ,p_button_template_options=>'#DEFAULT#:t-Button--large:t-Button--primary' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_image_alt=>'Remove Sample Data' ,p_button_position=>'REGION_TEMPLATE_CREATE' ,p_button_condition=>wwv_flow_string.join(wwv_flow_t_varchar2( 'select null from demo_product_info where product_id <= 10', 'union all', 'select null from demo_customers where customer_id <= 10', 'union all', 'select null from demo_states', 'union all', 'select null from demo_constraint_lookup where constraint_name in (''DEMO_CUST_CREDIT_LIMIT_MAX'',''DEMO_CUSTOMERS_UK'',''DEMO_PRODUCT_INFO_UK'',''DEMO_ORDER_ITEMS_UK'');')) ,p_button_condition_type=>'EXISTS' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(1995643694954547624) ,p_button_sequence=>20 ,p_button_plug_id=>wwv_flow_api.id(1995643287536547623) ,p_button_name=>'load_sample_data' ,p_button_action=>'SUBMIT' ,p_button_template_options=>'#DEFAULT#:t-Button--large:t-Button--primary' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_image_alt=>'Load Sample Data' ,p_button_position=>'REGION_TEMPLATE_CREATE' ,p_button_condition=>wwv_flow_string.join(wwv_flow_t_varchar2( 'select null from demo_product_info where product_id <= 10', 'union all', 'select null from demo_customers where customer_id <= 10', 'union all', 'select null from demo_states', 'union all', 'select null from demo_constraint_lookup where constraint_name in (''DEMO_CUST_CREDIT_LIMIT_MAX'',''DEMO_CUSTOMERS_UK'',''DEMO_PRODUCT_INFO_UK'',''DEMO_ORDER_ITEMS_UK'');')) ,p_button_condition_type=>'NOT_EXISTS' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(1995644565977547624) ,p_button_sequence=>30 ,p_button_plug_id=>wwv_flow_api.id(1995643287536547623) ,p_button_name=>'reset_data' ,p_button_action=>'SUBMIT' ,p_button_template_options=>'#DEFAULT#:t-Button--large' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_is_hot=>'Y' ,p_button_image_alt=>'Reset Data' ,p_button_position=>'REGION_TEMPLATE_CREATE' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(1995644953595547625) ,p_button_sequence=>40 ,p_button_plug_id=>wwv_flow_api.id(1995643287536547623) ,p_button_name=>'CANCEL' ,p_button_action=>'REDIRECT_PAGE' ,p_button_template_options=>'#DEFAULT#:t-Button--large' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_image_alt=>'Cancel' ,p_button_position=>'REGION_TEMPLATE_PREVIOUS' ,p_button_redirect_url=>'f?p=&APP_ID.:SETTINGS:&SESSION.::&DEBUG.:RP,SETTINGS::' ); wwv_flow_api.create_page_branch( p_id=>wwv_flow_api.id(1995646895226547628) ,p_branch_name=>'Go To Administration' ,p_branch_action=>'f?p=&APP_ID.:SETTINGS:&SESSION.::&DEBUG.:::&success_msg=#SUCCESS_MSG#' ,p_branch_point=>'AFTER_PROCESSING' ,p_branch_type=>'REDIRECT_URL' ,p_branch_sequence=>10 ,p_branch_comment=>'Created 06-JAN-2012 15:08 by MIKE' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(1995645625937547626) ,p_process_sequence=>10 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'reset data' ,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2( 'sample_data_pkg.delete_data();', 'sample_data_pkg.insert_data();')) ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(1995644565977547624) ,p_process_success_message=>'Sample data reset.' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(1995646036240547627) ,p_process_sequence=>20 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'remove sample data' ,p_process_sql_clob=>'sample_data_pkg.delete_data();' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(1995644154276547624) ,p_process_success_message=>'Sample Data Removed' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(1995646374512547627) ,p_process_sequence=>30 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'Load Sample Data' ,p_process_sql_clob=>'sample_data_pkg.insert_data();' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(1995643694954547624) ,p_process_success_message=>'Sample Data Loaded.' ); wwv_flow_api.component_end; end; /
/* THIS CODE WAS OUR OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING ANY SOURCES OUTSIDE OF THOSE APPROVED BY THE INSTRUCTOR. Bhargav Annigeri, Simon Marty */ SET search_path to artistdb; DROP VIEW IF EXISTS A1; DROP VIEW IF EXISTS A2; DROP VIEW IF EXISTS VarArtists; DROP VIEW IF EXISTS VarSongwriters; CREATE VIEW VarArtists AS ( SELECT Album.artist_id as a_id, role, count(distinct genre_id) as genres FROM Album JOIN Role ON Album.artist_id = Role.artist_id GROUP BY Album.artist_id, Role HAVING count(distinct genre_id) >= 3 AND role <> 'Songwriter' ); CREATE VIEW VarSongwriters AS ( SELECT songwriter_id as a_id, role, count(distinct genre_id) as genres FROM Song JOIN BelongsToAlbum ON Song.song_id = BelongsToAlbum.song_id JOIN Album ON BelongsToAlbum.album_id = Album.album_id JOIN Role ON Song.songwriter_id = Role.artist_id JOIN Artist ON Album.artist_id = Artist.artist_id GROUP BY songwriter_id, role HAVING count(DISTINCT genre_id) >=3 AND role = 'Songwriter' ); CREATE VIEW a1 AS ( SELECT name as artist, role as capacity, genres, 0 as filter FROM VarArtists JOIN Artist ON VarArtists.a_id = Artist.artist_id ORDER BY genres DESC, name ASC ); CREATE VIEW a2 as ( SELECT name as artist, role as capacity, genres, 1 as filter FROM VarSongwriters JOIN Artist ON VarSongwriters.a_id = Artist.artist_id ORDER BY genres DESC, name ASC ); SELECT artist, capacity, genres FROM (SELECT * FROM a1 UNION SELECT * FROM a2 ORDER BY filter ASC) mix; DROP VIEW IF EXISTS A1; DROP VIEW IF EXISTS A2; DROP VIEW IF EXISTS VarArtists; DROP VIEW IF EXISTS VarSongwriters;
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 05, 2016 at 10:20 AM -- Server version: 5.6.16-1~exp1 -- PHP Version: 5.5.9-1ubuntu4 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: `foodplazashubham` -- -- -------------------------------------------------------- -- -- Table structure for table `Admin` -- CREATE TABLE IF NOT EXISTS `Admin` ( `adminname` varchar(25) DEFAULT NULL, `adminusername` varchar(25) NOT NULL DEFAULT '', `adminpassword` varchar(10) DEFAULT NULL, PRIMARY KEY (`adminusername`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `Admin` -- INSERT INTO `Admin` (`adminname`, `adminusername`, `adminpassword`) VALUES ('anup', 'anup21017', 'sdfg'), ('kunal', 'kunal21027', 'as'); -- -------------------------------------------------------- -- -- Table structure for table `Cart` -- CREATE TABLE IF NOT EXISTS `Cart` ( `cartid` int(11) NOT NULL AUTO_INCREMENT, `customerid` int(11) DEFAULT NULL, `foodname` varchar(20) DEFAULT NULL, `foodquantity` int(11) DEFAULT NULL, `foodprice` int(11) DEFAULT NULL, PRIMARY KEY (`cartid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data for table `Cart` -- INSERT INTO `Cart` (`cartid`, `customerid`, `foodname`, `foodquantity`, `foodprice`) VALUES (4, 456, 'spicy', 3, 370), (5, 457, 'veggie pizza', 5, 170), (6, 458, 'double cheese pizza', 2, 270); -- -------------------------------------------------------- -- -- Table structure for table `Customer` -- CREATE TABLE IF NOT EXISTS `Customer` ( `customerid` int(11) NOT NULL AUTO_INCREMENT, `customername` varchar(25) DEFAULT NULL, `customeraddress` char(20) DEFAULT NULL, `contact` mediumtext, `customerusername` varchar(20) NOT NULL DEFAULT '', `customerpassword` varchar(20) DEFAULT NULL, PRIMARY KEY (`customerid`,`customerusername`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=462 ; -- -- Dumping data for table `Customer` -- INSERT INTO `Customer` (`customerid`, `customername`, `customeraddress`, `contact`, `customerusername`, `customerpassword`) VALUES (456, 'shubham', 'b-201,sec-19,airoli', '8898600239', 'shub09', 'zxc'), (457, 'sunny', 'thane', '9323998570', 'sun09', 'werty'), (458, 'sonu', 'nerul', '9773190293', 'son09', 'erty'), (459, 'sanjay', 'mulund', '9323998594', 'san09', 'uiui'), (461, 'nisha ', 'thane', '9619152737', 'nish09', 'yuyu'); -- -------------------------------------------------------- -- -- Table structure for table `Food` -- CREATE TABLE IF NOT EXISTS `Food` ( `foodid` int(11) NOT NULL, `foodname` varchar(20) DEFAULT NULL, `foodprice` double DEFAULT NULL, `foodtype` char(8) DEFAULT NULL, PRIMARY KEY (`foodid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `Food` -- INSERT INTO `Food` (`foodid`, `foodname`, `foodprice`, `foodtype`) VALUES (1212, 'double cheese pizza', 270, 'non veg'), (1222, 'spicy chicken wrap', 170, 'non veg'), (1227, 'Aloo Tikki', 40, 'veg'), (1313, 'chicken nuggets ', 200, 'non veg'), (1342, 'spicy cheese pizza', 470, 'non veg'), (1453, 'pops ', 77, 'veg'); -- -------------------------------------------------------- -- -- Table structure for table `Foodorder` -- CREATE TABLE IF NOT EXISTS `Foodorder` ( `orderid` int(11) NOT NULL AUTO_INCREMENT, `customerid` int(11) DEFAULT NULL, `totalbill` double DEFAULT NULL, `orderstatus` varchar(15) DEFAULT NULL, `orderdate` date DEFAULT NULL, PRIMARY KEY (`orderid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `Foodorder` -- INSERT INTO `Foodorder` (`orderid`, `customerid`, `totalbill`, `orderstatus`, `orderdate`) VALUES (1, 456, 1110, 'delivered', '2016-06-21'), (2, 457, 850, 'delivered', '2016-06-21'), (3, 458, 540, 'Delivered', '2016-06-21'); /*!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 */;
 -- -- what's in there? -- select distinct standard_name, standard_version -- from iso_versions -- order by standard_name, standard_version; -- how common are they? -- as pct per host of iso records -- with j as -- ( -- with i as -- ( -- select d.response_id, jsonb_array_elements(d.identity::jsonb) ident -- from identities d -- where d.identity is not null -- ), a as ( -- select r.host, count(r.id) as num_per_host -- from responses r join i on i.response_id = r.id -- where i.ident->>'protocol' = 'ISO' -- group by r.host -- ) -- -- select r.id, r.host, a.num_per_host -- from responses r join i on i.response_id = r.id -- join a on a.host = r.host -- where i.ident->>'protocol' = 'ISO' -- ), v as -- ( -- select response_id, -- standard_name || '; ' || standard_version as the_version -- from iso_versions -- ) -- -- select v.the_version, j.host, --count(j.id) as num_iso_responses, -- round(count(j.id) / max(j.num_per_host)::numeric * 100.0, 2) as pct_of_iso -- from responses r join v on v.response_id = r.id -- join j on j.id = r.id -- group by v.the_version, j.host -- order by j.host, pct_of_iso DESC; -- -- order by count(v.response_id) DESC; -- -- pct of all iso for a version with j as ( with i as ( select d.response_id, jsonb_array_elements(d.identity::jsonb) ident from identities d where d.identity is not null ), a as ( select count(*) as total from responses r join i on i.response_id = r.id where i.ident->>'protocol' = 'ISO' ) select r.id, a.total from responses r join i on i.response_id = r.id natural inner join a where i.ident->>'protocol' = 'ISO' ), v as ( select response_id, standard_name || '; ' || standard_version as the_version from iso_versions ) select v.the_version, count(v.response_id) as num, round(count(v.response_id) / max(j.total)::numeric * 100.0, 2) as pct_of_iso from responses r join v on v.response_id = r.id join j on j.id = r.id group by v.the_version order by pct_of_iso DESC;
/* Finds all factFinancials for 12 months from @period */ CREATE TABLE FactProject ( [Employee] nvarchar(200), [Customer] nvarchar(250), [Value] decimal(18,2), [Probability] decimal(3,2) NOT NULL CHECK (Probability >= 0 AND Probability <= 1), [Start Date] date, [End Date] date );
DROP PROCEDURE IF EXISTS extractAccountActivityTimed# CREATE PROCEDURE extractAccountActivityTimed(IN runtimeParam TIMESTAMP) begin declare runtime timestamp; declare lastDistinctPlayersRuntime timestamp; declare lastAuditCommandAutoId int; declare maxAuditCommandAutoId int; declare lastDistinctUsersRuntime timestamp; declare startOfCurrentWeek date; declare startOfCurrentMonth date; declare lastCompleteWeekWeekEnding date default '2010-08-01'; declare lastCompleteMonthEnding date default '2010-07-31'; set @runtime = runtimeParam; -- update player activity select val, action_ts into @lastAuditCommandAutoId, @lastDistinctPlayersRuntime from rpt_report_status where report_action = 'distinctPlayers'; select max(auto_id) into @maxAuditCommandAutoId from AUDIT_COMMAND; replace into rpt_account_activity (player_id, audit_date, game_type) select distinct account_id, date(audit_ts), game_type from AUDIT_COMMAND ac join strataprod.TABLE_INFO ti on ac.table_id = ti.table_id where auto_id > @lastAuditCommandAutoId and auto_id <= @maxAuditCommandAutoId and command_type not in ('Leave', 'GetStatus'); update rpt_report_status set action_ts = @runtime, val = @maxAuditCommandAutoId where report_action = 'distinctPlayers'; -- update users select action_ts into @lastDistinctUsersRuntime from rpt_report_status where report_action = 'distinctUsers'; update rpt_report_status set action_ts = @runtime where report_action = 'distinctUsers'; -- update daily distinct players by game_type replace into rpt_players_daily(reportDate, players, game_type) select audit_date, count(player_id), game_type from rpt_account_activity aa where aa.audit_date >= date(@lastDistinctPlayersRuntime) and aa.game_type != '' group by aa.audit_date, game_type; -- update daily distinct players replace into rpt_players_daily(reportDate, players, game_type) select audit_date, count(distinct player_id), '' from rpt_account_activity aa where aa.audit_date >= date(@lastDistinctPlayersRuntime) and aa.game_type != '' group by aa.audit_date; -- update daily distinct users (people who have played or logged on) replace into rpt_users_daily(reportDate, users) select audit_date, count(distinct account_id) from rpt_activity_by_account_id aa where aa.audit_date >= date(@lastDistinctUsersRuntime) group by aa.audit_date; -- update weekly distinct users set @startOfCurrentWeek = date(date_sub(@runtime, interval weekday(@runtime) day)); select max(weekEnding) into @lastCompleteWeekWeekEnding from rpt_users_weekly; if date(date_add(@lastCompleteWeekWeekEnding, interval 1 week)) < @startOfCurrentWeek then replace into rpt_users_weekly(weekEnding, users) select date(date_add(aa.audit_date, interval (6 - weekday(aa.audit_date)) day)), count(distinct account_id) from rpt_activity_by_account_id aa where aa.audit_date > @lastCompleteWeekWeekEnding and aa.audit_date < @startOfCurrentWeek group by yearweek(aa.audit_date, 5); end if; -- update weekly distinct players select max(weekEnding) into @lastCompleteWeekWeekEnding from rpt_players_weekly; if date(date_add(@lastCompleteWeekWeekEnding, interval 1 week)) < @startOfCurrentWeek then replace into rpt_players_weekly(weekEnding, players, game_type) select date(date_add(aa.audit_date, interval (6 - weekday(aa.audit_date)) day)), count(distinct player_id), game_type from rpt_account_activity aa where aa.audit_date > @lastCompleteWeekWeekEnding and aa.audit_date < @startOfCurrentWeek and aa.game_type != '' group by yearweek(aa.audit_date, 5), game_type; replace into rpt_players_weekly(weekEnding, players, game_type) select date(date_add(aa.audit_date, interval (6 - weekday(aa.audit_date)) day)), count(distinct player_id), '' from rpt_account_activity aa where aa.audit_date > @lastCompleteWeekWeekEnding and aa.audit_date < @startOfCurrentWeek and aa.game_type != '' group by yearweek(aa.audit_date, 5); end if; set @endOfPreviousMonth = last_day(date_sub(@runtime, interval 1 month)); -- update monthy distinct players select max(monthEnding) into @lastCompleteMonthEnding from rpt_players_monthly; if (@lastCompleteMonthEnding < @endOfPreviousMonth) then replace into rpt_players_monthly(monthEnding, players, game_type) select last_day(aa.audit_date), count(distinct player_id), game_type from rpt_account_activity aa where aa.audit_date > @lastCompleteMonthEnding and aa.audit_date <= @endOfPreviousMonth and aa.game_type != '' group by DATE_FORMAT(aa.audit_date, '%m %Y'), game_type; replace into rpt_players_monthly(monthEnding, players, game_type) select last_day(aa.audit_date), count(distinct player_id), '' from rpt_account_activity aa where aa.audit_date > @lastCompleteMonthEnding and aa.audit_date <= @endOfPreviousMonth and aa.game_type != '' group by DATE_FORMAT(aa.audit_date, '%m %Y'); end if; -- update monthly distinct users select max(monthEnding) into @lastCompleteMonthEnding from rpt_users_monthly; if (@lastCompleteMonthEnding < @endOfPreviousMonth) then replace into rpt_users_monthly(monthEnding, users) select last_day(aa.audit_date), count(distinct account_id) from rpt_activity_by_account_id aa where aa.audit_date > @lastCompleteMonthEnding and aa.audit_date <= @endOfPreviousMonth group by DATE_FORMAT(aa.audit_date, '%m %Y'); end if; end; # DROP PROCEDURE IF EXISTS extractAccountActivity# CREATE PROCEDURE extractAccountActivity() begin CALL extractAccountActivityTimed(now()); end #
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE table IF NOT EXISTS Jobseeker ( UNIQUE (Email_Address), UNIQUE (fb_id), Num_Employer_Scanned int not NULL DEFAULT 0, Num_Employer_Viewed_Resume int not NULL DEFAULT 0, Pending_Interest int not NULL DEFAULT 0, Potential_Client boolean not NULL DEFAULT False, Acceptance_Wage decimal(10, 2) DEFAULT 0, Goal_Wage decimal(10, 2) DEFAULT 0, Open_relocation boolean not NULL default False, PRIMARY KEY(uid) ) INHERITS (Users);
-- phpMyAdmin SQL Dump -- version 4.0.9 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jan 16, 2014 at 01:57 AM -- Server version: 5.5.34 -- PHP Version: 5.4.22 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: `birthwatch` -- -- -------------------------------------------------------- -- -- Table structure for table `birth` -- CREATE TABLE IF NOT EXISTS `birth` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `name_of_father` varchar(50) NOT NULL, `name_of_mother` varchar(50) NOT NULL, `place_of_brth` varchar(50) NOT NULL, `date_of_birth` date NOT NULL, `hospital` varchar(50) NOT NULL, `district` varchar(50) NOT NULL, `region` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `birth` -- INSERT INTO `birth` (`id`, `first_name`, `last_name`, `name_of_father`, `name_of_mother`, `place_of_brth`, `date_of_birth`, `hospital`, `district`, `region`) VALUES (1, 'Hadi', 'Mukaila', 'Dinki', 'Boss', 'Accra', '2014-01-01', 'Korle-Bu', 'Districto', 'Gt. Accra'); -- -------------------------------------------------------- -- -- Table structure for table `community` -- CREATE TABLE IF NOT EXISTS `community` ( `id` int(11) NOT NULL AUTO_INCREMENT, `district` varchar(100) NOT NULL, `region` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `community` -- INSERT INTO `community` (`id`, `district`, `region`) VALUES (1, 'districto', 'Gt. Accra'); -- -------------------------------------------------------- -- -- Table structure for table `death` -- CREATE TABLE IF NOT EXISTS `death` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `date_of_death` date NOT NULL, `place` varchar(50) NOT NULL, `district` varchar(50) NOT NULL, `region` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `questions` -- CREATE TABLE IF NOT EXISTS `questions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `recipient_number` int(10) NOT NULL, `question` varchar(160) NOT NULL, `possible_response` varchar(160) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `registrar` -- CREATE TABLE IF NOT EXISTS `registrar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `phone_number` int(10) NOT NULL, `district` varchar(100) NOT NULL, `region` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `responses` -- CREATE TABLE IF NOT EXISTS `responses` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sender` varchar(50) NOT NULL, `questions` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; /*!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 */;
SELECT * FROM USER_NOTIFICATIONS WHERE DELETE_FLAG = 0 ORDER BY INSERT_DATETIME %s LIMIT ? OFFSET ?;
create database Hospital; use Hospital; create table Departamento( CveDepartamento varchar(4) not null, Nombre varchar(50), constraint DepartamentoPK primary key (CveDepartamento)); create table TipoMedicamento( CveTipoMedicamento varchar(4) not null, Descripcion varchar(200), constraint TipoMedicamento primary key (CveTipoMedicamento)); create table EspecialidadDoctor( CveEspecialidad varchar(4) not null, Descripcion varchar(200), constraint EspecialidadDoctorPK primary key (CveEspecialidad)); create table Enfermedad( CveEnfermedad varchar(4) not null, Descripcion varchar(200), constraint EnfermedadPK primary key (CveEnfermedad)); create table TipoPaciente( CveTipoPaciente varchar(4) not null, Descripcion varchar(200), constraint TipoPacientePK primary key (CveTipoPaciente)); create table TipoEstudio(CveTipoEstudio varchar(4) not null, Descripcion varchar(200), constraint TipoEstudioPK primary key (CveTipoEstudio)); create table SalaQuirofano( CveSala varchar(4) not null, Descripcion varchar(200), constraint SalaQuiforanoPK primary key (CveSala)); create table TipoHabitacion (CveTipoHabitacion varchar(4) not null, Descripcion varchar(200), constraint TipoHabitacionPK primary key (CveTipoHabitacion)); create table Enfermera( CveEnfermera varchar(4) not null, Nombre varchar(50), Edad tinyint, constraint EnfermeraPK primary key (CveEnfermera)); create table Doctor( Licencia varchar(20) not null, CveEspecialidad varchar(4), Nombre varchar(50), CURP varchar(20), Sexo varchar(1), Edad tinyint, constraint DoctorPK primary key (Licencia), constraint DoctorFK1 foreign key (CveEspecialidad) references EspecialidadDoctor(CveEspecialidad)); create table Medicamento(CveMedicamento varchar(4) not null, CveTipoMedicamento varchar(4), Nombre varchar(50), constraint MedicamentoPK primary key (CveMedicamento), constraint MedicamentoFK1 foreign key (CveTipoMedicamento) references TipoMedicamento (CveTipoMedicamento)); create table Consultorio( CveConsultorio varchar(4) not null, CveDepartamento varchar(4), constraint ConsultorioPK primary key (CveConsultorio), constraint ConsultorioFK foreign key (CveDepartamento) references Departamento(CveDepartamento)); create table Laboratorios( CveLaboratorios varchar(4) not null, CveDepartamento varchar(4), Descripcion varchar(200), constraint LaboratoriosPK primary key (CveLaboratorios), constraint LaboratoriosFK1 foreign key (CveDepartamento) references Departamento(CveDepartamento)); create table Paciente( CvePaciente varchar(4) not null, CveTipoPaciente varchar(4), Nombre varchar(50), Sexo varchar(1), Edad tinyint, CURP varchar(20), constraint PacientePK primary key (CvePaciente), constraint PacienteFK1 foreign key (CveTipoPaciente) references TipoPaciente(CveTipoPaciente)); create table Estudio( CveEstudio varchar(4) not null, Licencia varchar(20), CveTipoEstudio varchar(4), Razon varchar(200), Fecha date, constraint EstudioPK primary key (CveEstudio), constraint EstudioFK1 foreign key (Licencia) references Doctor(Licencia), constraint EstudioFK2 foreign key (CveTipoEstudio) references TipoEstudio(CveTipoEstudio)); create table Habitacion(CveHabitacion varchar(4) not null, CveTipohabitacion varchar(4), CvePaciente varchar(4), Descripcion varchar(200), constraint HabitacionPK primary key (CveHabitacion), constraint HabitacionFK1 foreign key (CveTipoHabitacion) references TipoHabitacion(CveTipoHabitacion), constraint HabitacionFK2 foreign key (CvePaciente) references Paciente(CvePaciente)); create table Asignado( CvePaciente varchar(4) not null, CveEnfermera varchar(4) not null, constraint AsignadoPK primary key (CvePaciente,CveEnfermera), constraint AsignadoFK1 foreign key (CvePaciente) references Paciente(CvePaciente), constraint AsignadoFK2 foreign key (CveEnfermera) references Enfermera(CveEnfermera)); create table Operacion( CvePaciente varchar(4) not null, Numero int not null, CveSala varchar(4), Descripcion varchar(200), Fecha date, constraint OperacionPK primary key (CvePaciente, Numero), constraint OperacionFK1 foreign key (CvePaciente) references Paciente(CvePaciente), constraint OperacionFK2 foreign key (CveSala) references SalaQuirofano(CveSala)); create table Consulta( CveConsulta varchar(4) not null, CveConsultorio varchar(4), CvePaciente varchar(4), Licencia varchar(20), constraint ConsultaPK primary key (CveConsulta), constraint ConsultaFK1 foreign key (CveConsultorio) references Consultorio(CveConsultorio), constraint ConsultaFK2 foreign key (CvePaciente) references Paciente(CvePaciente), constraint ConsultaFK3 foreign key (Licencia) references Doctor(Licencia)); create table Receta( CveMedicamento varchar(4) not null, CveConsulta varchar(4) not null, constraint RecetaPK primary key (CveMedicamento,CveConsulta), constraint RecetaFK1 foreign key (CveMedicamento) references Medicamento(CveMedicamento), constraint RecetaFK2 foreign key (CveConsulta) references Consulta(CveConsulta)); create table Diagnostico( CveConsulta varchar(4) not null, Numero int not null, CveEnfermedad varchar(4), Descripcion varchar(200), constraint DiagnosticoPK primary key (CveConsulta, Numero), constraint DiagnosticoFK foreign key (CveEnfermedad) references Enfermedad(CveEnfermedad));
drop table venues create table venues ( venueid int primary key NOT NULL, name varchar(40), city varchar(40) )
-- phpMyAdmin SQL Dump -- version 4.7.7 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Czas generowania: 03 Cze 2018, 16:23 -- Wersja serwera: 10.1.30-MariaDB -- Wersja PHP: 7.2.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 */; -- -- Baza danych: `mlchat_temp` -- -- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `users` -- CREATE TABLE `users` ( `gid` varchar(18) COLLATE utf8mb4_bin NOT NULL COMMENT 'Guild ID', `uid` varchar(18) COLLATE utf8mb4_bin NOT NULL COMMENT 'User ID', `coins` int(11) NOT NULL DEFAULT '0' COMMENT 'Coins (Normal)', `ml_coins` int(11) NOT NULL DEFAULT '0' COMMENT 'ML Coins', `gifts` int(11) NOT NULL DEFAULT '0', `daily` varchar(10) COLLATE utf8mb4_bin NOT NULL DEFAULT '0.0', `messages` int(11) NOT NULL DEFAULT '0' COMMENT 'Messages counter', `deleted_messages` int(11) NOT NULL DEFAULT '0' COMMENT 'Deleted Messages Counter' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- -- Zrzut danych tabeli `users` -- INSERT INTO `users` (`gid`, `uid`, `coins`, `ml_coins`, `gifts`, `daily`, `messages`, `deleted_messages`) VALUES ('430837985437810688', '249602562372665346', 14400, 3, 4, '1.5.2018', 81, 1), ('430837985437810688', '337949837960019970', 450, 0, 1, '1.5.2018', 25, 0); -- -- Indeksy dla zrzutów tabel -- -- -- Indeksy dla tabeli `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`gid`,`uid`); 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 */;
select distinct(hobby) from pres_hobby join president on president.id = pres_hobby.pres_id where president."name" not in (select distinct(president."name") from president join election on president."name" = election.candidate where election.winner_loser_indic = 'L') order by hobby asc
insert into users(username, password, enabled) VALUES ('Allen', 'password','true'); insert into users(username, password, enabled) VALUES ('Guess', 'password','true'); insert into users(username, password, enabled) VALUES ('User', 'password','true'); insert into users(username, password, enabled) VALUES ('Admin', 'password','true'); -- default proxy should be ROLE_ insert into authorities(username, authority) VALUES ('Allen', 'ROLE_ADMIN'); insert into authorities(username, authority) VALUES ('Guess', 'ROLE_GUESS'); insert into authorities(username, authority) VALUES ('Admin', 'ROLE_ADMIN'); insert into authorities(username, authority) VALUES ('User', 'ROLE_USER');
DROP SEQUENCE CPI.LOSS_RATIO_SESSION_ID_S; CREATE SEQUENCE CPI.LOSS_RATIO_SESSION_ID_S START WITH 1 MAXVALUE 999999999999999999999999999 MINVALUE 1 NOCYCLE NOCACHE NOORDER;
delete from HtmlLabelIndex where id=27645 / delete from HtmlLabelInfo where indexid=27645 / INSERT INTO HtmlLabelIndex values(27645,'薪酬报表') / INSERT INTO HtmlLabelInfo VALUES(27645,'薪酬报表',7) / INSERT INTO HtmlLabelInfo VALUES(27645,'finance report',8) / INSERT INTO HtmlLabelInfo VALUES(27645,'薪酬報表',9) / delete from HtmlLabelIndex where id=27648 / delete from HtmlLabelInfo where indexid=27648 / INSERT INTO HtmlLabelIndex values(27648,'导出报表') / INSERT INTO HtmlLabelInfo VALUES(27648,'导出报表',7) / INSERT INTO HtmlLabelInfo VALUES(27648,'export report',8) / INSERT INTO HtmlLabelInfo VALUES(27648,'導出報表',9) / delete from HtmlLabelIndex where id=27652 / delete from HtmlLabelInfo where indexid=27652 / INSERT INTO HtmlLabelIndex values(27652,'薪酬报表共享设置') / INSERT INTO HtmlLabelInfo VALUES(27652,'薪酬报表共享设置',7) / INSERT INTO HtmlLabelInfo VALUES(27652,'Salary statements sharing Settings',8) / INSERT INTO HtmlLabelInfo VALUES(27652,'薪酬報表共享設置',9) /
-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ -- Server version 5.6.41 /*!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 */; /*!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' */; -- -- Create schema medalfa -- CREATE DATABASE IF NOT EXISTS medalfa; USE medalfa; -- -- Definition of table `_sequences` -- DROP TABLE IF EXISTS `_sequences`; CREATE TABLE `_sequences` ( `name` varchar(70) NOT NULL, `next` int(11) NOT NULL, `inc` int(11) NOT NULL, UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `_sequences` -- /*!40000 ALTER TABLE `_sequences` DISABLE KEYS */; INSERT INTO `_sequences` (`name`,`next`,`inc`) VALUES ('entradasalida_id_seq',3,1), ('producto_id_seq',4,1), ('usuario_id_seq',4,1); /*!40000 ALTER TABLE `_sequences` ENABLE KEYS */; -- -- Definition of table `entradasalida` -- DROP TABLE IF EXISTS `entradasalida`; CREATE TABLE `entradasalida` ( `id` int(10) unsigned NOT NULL, `productoId` int(10) unsigned NOT NULL, `tipo` int(10) unsigned NOT NULL, `cantidad` int(10) unsigned NOT NULL, `motivo` varchar(90) NOT NULL, `fecha` datetime NOT NULL, `sumatoria` int(10) unsigned DEFAULT NULL, `usuarioId` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK_entradasalida_producto` (`productoId`), KEY `FK_entradasalida_usuario` (`usuarioId`), CONSTRAINT `FK_entradasalida_producto` FOREIGN KEY (`productoId`) REFERENCES `producto` (`id`), CONSTRAINT `FK_entradasalida_usuario` FOREIGN KEY (`usuarioId`) REFERENCES `usuario` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `entradasalida` -- /*!40000 ALTER TABLE `entradasalida` DISABLE KEYS */; INSERT INTO `entradasalida` (`id`,`productoId`,`tipo`,`cantidad`,`motivo`,`fecha`,`sumatoria`,`usuarioId`) VALUES (1,1,0,23,'MOtivo','2019-06-27 20:38:39',23,NULL), (2,1,0,30,'Algo','2019-06-27 20:48:16',53,NULL); /*!40000 ALTER TABLE `entradasalida` ENABLE KEYS */; -- -- Definition of trigger `movimiento_i` -- DROP TRIGGER /*!50030 IF EXISTS */ `movimiento_i`; DELIMITER $$ CREATE TRIGGER `movimiento_i` BEFORE INSERT ON `entradasalida` FOR EACH ROW BEGIN DECLARE suma integer; SELECT sumatoria INTO suma FROM entradasalida where productoId = NEW.productoId order by id desc limit 1; IF ISNULL(suma) THEN SET suma = 0; END IF; IF NEW.tipo = 0 THEN SET NEW.sumatoria = suma + NEW.cantidad; ELSE SET NEW.sumatoria = suma - NEW.cantidad; END IF; END $$ DELIMITER ; -- -- Definition of table `producto` -- DROP TABLE IF EXISTS `producto`; CREATE TABLE `producto` ( `id` int(10) unsigned NOT NULL, `nombre` varchar(45) NOT NULL, `descripcion` varchar(45) NOT NULL, `lote` varchar(45) NOT NULL, `caducidad` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `producto` -- /*!40000 ALTER TABLE `producto` DISABLE KEYS */; INSERT INTO `producto` (`id`,`nombre`,`descripcion`,`lote`,`caducidad`) VALUES (1,'Producto','Descripcion del producto','123-AFR','2019-06-19 09:14:55'), (2,'Prueba','Prueba descripcion','ABC-654X','2019-06-20 19:00:00'), (3,'Orefta','Prueba descripcion','ABC-654X','2019-06-26 19:00:00'); /*!40000 ALTER TABLE `producto` ENABLE KEYS */; -- -- Definition of table `usuario` -- DROP TABLE IF EXISTS `usuario`; CREATE TABLE `usuario` ( `id` int(10) unsigned NOT NULL, `nombre` varchar(45) NOT NULL, `correo` varchar(45) NOT NULL, `pass` varchar(150) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `usuario` -- /*!40000 ALTER TABLE `usuario` DISABLE KEYS */; INSERT INTO `usuario` (`id`,`nombre`,`correo`,`pass`) VALUES (1,'Aldo Escalona','aldo@prueba.com','*43684660CFDF6DCF5DBFDCD4B3246E50A5F0D23A'), (2,'Prueba','prueba@prueba.com','*F39A85FC42383B9852E49678DF30B923A0A7CA0E'), (3,'Prueba','prueba@prueba.com','*E9FC3A221BA421ED5BE7B70BAD6139AC280FADC6'); /*!40000 ALTER TABLE `usuario` ENABLE KEYS */; -- -- Definition of function `NextVal` -- DROP FUNCTION IF EXISTS `NextVal`; DELIMITER $$ /*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE='' */ $$ CREATE FUNCTION `NextVal`(vname VARCHAR(30)) RETURNS int(11) BEGIN UPDATE _sequences SET next = (@next := next) + 1 WHERE name = vname; RETURN @next; END $$ /*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */ $$ DELIMITER ; /*!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 */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
DECLARE v_userid number; v_errorCode number; v_errorMessage nvarchar2(255); BEGIN v_userid := :UserId; v_errorCode := 0; v_errorMessage := ''; IF v_userid IS NULL THEN v_errorCode := 121; v_errorMessage := 'UserId must not be empty'; goto cleanup; END IF; delete from Tbl_Ac_Accesssubject where col_id in ( select col_caseworkeraccesssubject from Tbl_ppl_caseworker where col_userid = v_userid); delete from Tbl_Ppl_Workbasket where COL_CASEWORKERWORKBASKET in ( select col_id from Tbl_ppl_caseworker where col_userid = v_userid); delete from Tbl_Ppl_Caseworker where col_userid = v_userid; <<cleanup>> :ErrorCode := v_errorCode; :ErrorMessage := V_Errormessage; END;
ALTER TABLE sessions DROP CONSTRAINT FKsessions800212; ALTER TABLE "order" DROP CONSTRAINT FKorder8292; ALTER TABLE "order" DROP CONSTRAINT FKorder585286; ALTER TABLE products DROP CONSTRAINT FKproducts495211; ALTER TABLE products DROP CONSTRAINT FKproducts732050; ALTER TABLE products DROP CONSTRAINT FKproducts907628; ALTER TABLE profile_previously_viewed DROP CONSTRAINT FKprofile_pr728803; ALTER TABLE profile_previously_viewed DROP CONSTRAINT FKprofile_pr801267; DROP TABLE IF EXISTS categories CASCADE; DROP TABLE IF EXISTS target_audience CASCADE; DROP TABLE IF EXISTS "order" CASCADE; DROP TABLE IF EXISTS profiles CASCADE; DROP TABLE IF EXISTS products CASCADE; DROP TABLE IF EXISTS sessions CASCADE; DROP TABLE IF EXISTS brands CASCADE; DROP TABLE IF EXISTS profile_previously_viewed CASCADE; CREATE TABLE categories (ID varchar(255) NOT NULL, category varchar(255), subcategory varchar(255), subsubcategory varchar(255), PRIMARY KEY (ID)); CREATE TABLE target_audience (ID varchar(255) NOT NULL, gender varchar(1) DEFAULT 'O', doelgroep varchar(255) NOT NULL, PRIMARY KEY (ID)); CREATE TABLE "order" (sessionsID varchar(255) NOT NULL, productID varchar(255) NOT NULL, PRIMARY KEY (sessionsID)); CREATE TABLE profiles (ID varchar(255) NOT NULL, segment varchar(255), PRIMARY KEY (ID)); CREATE TABLE products (ID varchar(255) NOT NULL, doelgroepenID varchar(255) NOT NULL, categoriesID varchar(255) NOT NULL, brandID varchar(255) NOT NULL, name varchar(255), description varchar(400), herhaalaankopen bool, price int4, mcrp int4, inhoud varchar(255), discount int4, PRIMARY KEY (ID)); CREATE TABLE sessions (ID varchar(255) NOT NULL, profilesID varchar(255) NOT NULL, device_type varchar(255), PRIMARY KEY (ID)); CREATE TABLE brands (ID varchar(255) NOT NULL, brand char(255), PRIMARY KEY (ID)); CREATE TABLE profile_previously_viewed (profileID varchar(255) NOT NULL, productID varchar(255) NOT NULL); ALTER TABLE sessions ADD CONSTRAINT FKsessions800212 FOREIGN KEY (profilesID) REFERENCES profiles (ID); ALTER TABLE "order" ADD CONSTRAINT FKorder8292 FOREIGN KEY (sessionsID) REFERENCES sessions (ID); ALTER TABLE "order" ADD CONSTRAINT FKorder585286 FOREIGN KEY (productID) REFERENCES products (ID); ALTER TABLE products ADD CONSTRAINT FKproducts495211 FOREIGN KEY (doelgroepenID) REFERENCES target_audience (ID); ALTER TABLE products ADD CONSTRAINT FKproducts732050 FOREIGN KEY (categoriesID) REFERENCES categories (ID); ALTER TABLE products ADD CONSTRAINT FKproducts907628 FOREIGN KEY (brandID) REFERENCES brands (ID); ALTER TABLE profile_previously_viewed ADD CONSTRAINT FKprofile_pr728803 FOREIGN KEY (productID) REFERENCES products (ID); ALTER TABLE profile_previously_viewed ADD CONSTRAINT FKprofile_pr801267 FOREIGN KEY (profileID) REFERENCES profiles (ID);
-- CREATE DATABASE IF NOT EXISTS `toggl`; -- CREATE USER IF NOT EXISTS 'toggle_user'@'localhost' IDENTIFIED BY '1B6ED928C37FB88C89299B0E799025D0'; -- GRANT ALL ON * TO 'toggle_user'@'localhost'; -- FLUSH PRIVILEGES; -- USE toggl;
DROP TABLE IF EXISTS `Persons`; CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) ); CREATE TABLE user_value ( id varchar(200), first_name varchar(255), last_name varchar(255), email_address varchar(255), password varchar(255), account_created varchar(255), account_updated varchar(255), salt varchar(255) ); CREATE TABLE bill ( id varchar(200), created_ts varchar(255), updated_ts varchar(255), owner_id varchar(255), vendor varchar(255), bill_date varchar(255), due_date varchar(255), amount_due varchar(255), categories varchar(255), paymentStatus varchar(255) ); INSERT INTO Persons VALUES ( 1, "Foo", "Baz", "123 Bar Street", "FooBazBar City" );
DROP TABLE IF EXISTS nyss_temp_staging_contact; CREATE TABLE nyss_temp_staging_contact ( id INT(10) UNSIGNED NOT NULL, is_deleted_changed TINYINT(1) NOT NULL DEFAULT 0, log_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, log_end_date TIMESTAMP NULL DEFAULT NULL, INDEX idx__staging_date (log_date,log_end_date), INDEX idx__staging_id (id) ) SELECT a.id, IFNULL(a.is_deleted XOR ( SELECT b.is_deleted FROM log_civicrm_contact b WHERE b.log_date < a.log_date and a.id=b.id ORDER BY b.log_date DESC LIMIT 1 ),0) as is_deleted_changed, a.log_date, IFNULL(( SELECT DATE_SUB(b.log_date,INTERVAL 1 SECOND) as log_end_date FROM log_civicrm_contact b WHERE b.log_date > a.log_date and a.id=b.id ORDER BY b.log_date LIMIT 1), NOW()) as log_end_date FROM log_civicrm_contact a;
-- Your SQL goes here CREATE TABLE users ( id UUID NOT NULL PRIMARY KEY, -- uuid v4 email VARCHAR(100) NOT NULL UNIQUE, hash VARCHAR(122) NOT NULL, --argon2 hash first_name VARCHAR(50) NOT NULL, last_name VARCHAR(50) NOT NULL, created_at TIMESTAMP NOT NULL, yapily_id VARCHAR NOT NULL -- From yapily );
CREATE OR REPLACE FUNCTION _median_transfn(state internal, val anyelement) RETURNS internal AS 'MODULE_PATHNAME', 'median_transfn' LANGUAGE C IMMUTABLE; CREATE OR REPLACE FUNCTION _median_finalfn(state internal, val anyelement) RETURNS anyelement AS 'MODULE_PATHNAME', 'median_finalfn' LANGUAGE C IMMUTABLE; DROP AGGREGATE IF EXISTS median (ANYELEMENT); CREATE AGGREGATE median (ANYELEMENT) ( sfunc = _median_transfn, stype = internal, finalfunc = _median_finalfn, finalfunc_extra ); /* Debug run in psql: MODULE_PATHNAME /usr/lib/postgresql/10/lib/median.so CREATE OR REPLACE FUNCTION _median_transfn(state internal, val anyelement) RETURNS internal AS '/usr/lib/postgresql/10/lib/median.so', 'median_transfn' LANGUAGE C IMMUTABLE; CREATE OR REPLACE FUNCTION _median_finalfn(state internal, val anyelement) RETURNS anyelement AS '/usr/lib/postgresql/10/lib/median.so', 'median_finalfn' LANGUAGE C IMMUTABLE; DROP AGGREGATE IF EXISTS median (ANYELEMENT); CREATE AGGREGATE median (ANYELEMENT) ( sfunc = _median_transfn, stype = internal, finalfunc = _median_finalfn, finalfunc_extra ); */
select * from cities; CREATE TABLE States ( ID int NOT NULL PRIMARY KEY AUTO_INCREMENT, StateName varchar(255) ); insert into states (stateName) select distinct state from cities; select * from states; CREATE TABLE ZipCodes ( ID int NOT NULL PRIMARY KEY AUTO_INCREMENT, ZipCode varchar(5) ); insert into ZipCodes (ZipCode) select distinct Zip from cities; products
drop table Role cascade constraint; drop table Users cascade constraint; drop table Survey cascade constraint; drop table Questions cascade constraint; drop table Likert_Choice cascade constraint; drop table Bool_Choice cascade constraint; drop table Text_Choice cascade constraint; drop table submission cascade constraint;
prompt --application/shared_components/navigation/lists/application_navigation begin -- Manifest -- LIST: Application Navigation -- Manifest End wwv_flow_api.component_begin ( p_version_yyyy_mm_dd=>'2020.03.31' ,p_release=>'20.1.0.00.13' ,p_default_workspace_id=>20 ,p_default_application_id=>8950 ,p_default_id_offset=>33309244842782322 ,p_default_owner=>'ORACLE' ); wwv_flow_api.create_list( p_id=>wwv_flow_api.id(654006116952224623) ,p_name=>'Application Navigation' ,p_list_status=>'PUBLIC' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006185370224623) ,p_list_item_display_sequence=>10 ,p_list_item_link_text=>'Home' ,p_list_item_link_target=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.::::' ,p_list_item_icon=>'fa-home' ,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST' ,p_list_item_current_for_pages=>'1,15,30' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006270127224623) ,p_list_item_display_sequence=>20 ,p_list_item_link_text=>'Customers [&A01.]' ,p_list_item_link_target=>'f?p=&APP_ID.:2:&SESSION.::&DEBUG.:RIR:::' ,p_list_item_icon=>'fa-users' ,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST' ,p_list_item_current_for_pages=>'2,7,21,22,23,24,51,52,53,54' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006449548224623) ,p_list_item_display_sequence=>30 ,p_list_item_link_text=>'Products [&A02.]' ,p_list_item_link_target=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.:RIR:::' ,p_list_item_icon=>'fa-shopping-cart' ,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST' ,p_list_item_current_for_pages=>'3,6' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006531664224623) ,p_list_item_display_sequence=>40 ,p_list_item_link_text=>'Orders [&A03.]' ,p_list_item_link_target=>'f?p=&APP_ID.:4:&SESSION.::&DEBUG.:RIR:::' ,p_list_item_icon=>'fa-list-alt' ,p_list_item_current_type=>'COLON_DELIMITED_PAGE_LIST' ,p_list_item_current_for_pages=>'4,11,12,14,29,14' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400800842930230469) ,p_list_item_display_sequence=>50 ,p_list_item_link_text=>'Orders Calendar' ,p_list_item_link_target=>'f?p=&APP_ID.:10:&SESSION.::&DEBUG.:RP,10:::' ,p_list_item_disp_cond_type=>'NEVER' ,p_parent_list_item_id=>wwv_flow_api.id(654006531664224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_display_sequence=>60 ,p_list_item_link_text=>'Reports' ,p_list_item_link_target=>'f?p=&APP_ID.:26:&SESSION.::&DEBUG.::::' ,p_list_item_icon=>'fa-table' ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400801234374236795) ,p_list_item_display_sequence=>70 ,p_list_item_link_text=>'Sales by Category' ,p_list_item_link_target=>'f?p=&APP_ID.:16:&SESSION.::&DEBUG.:RP,16:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400801398618238881) ,p_list_item_display_sequence=>80 ,p_list_item_link_text=>'Sales by Month' ,p_list_item_link_target=>'f?p=&APP_ID.:5:&SESSION.::&DEBUG.:RP,5:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400801754301241037) ,p_list_item_display_sequence=>90 ,p_list_item_link_text=>'Sales by Product' ,p_list_item_link_target=>'f?p=&APP_ID.:27:&SESSION.::&DEBUG.:RP,27:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400801869698243813) ,p_list_item_display_sequence=>100 ,p_list_item_link_text=>'Sales by State' ,p_list_item_link_target=>'f?p=&APP_ID.:31:&SESSION.::&DEBUG.:RP,31:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400799197934224865) ,p_list_item_display_sequence=>110 ,p_list_item_link_text=>'Customer Map' ,p_list_item_link_target=>'f?p=&APP_ID.:13:&SESSION.::&DEBUG.:RP,13:::' ,p_list_item_disp_cond_type=>'NEVER' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400801037885232910) ,p_list_item_display_sequence=>120 ,p_list_item_link_text=>'Product Order Tree' ,p_list_item_link_target=>'f?p=&APP_ID.:19:&SESSION.::&DEBUG.:RP,19:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400800374952227696) ,p_list_item_display_sequence=>130 ,p_list_item_link_text=>'Customer Orders' ,p_list_item_link_target=>'f?p=&APP_ID.:17:&SESSION.::&DEBUG.:RP,17:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(1400802158473246498) ,p_list_item_display_sequence=>140 ,p_list_item_link_text=>'Tags' ,p_list_item_link_target=>'f?p=&APP_ID.:28:&SESSION.::&DEBUG.:RP,28:::' ,p_parent_list_item_id=>wwv_flow_api.id(654006637301224623) ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.create_list_item( p_id=>wwv_flow_api.id(654006766116224623) ,p_list_item_display_sequence=>150 ,p_list_item_link_text=>'Administration' ,p_list_item_link_target=>'f?p=&APP_ID.:33:&SESSION.::&DEBUG.::::' ,p_list_item_icon=>'fa-gear' ,p_list_item_current_type=>'TARGET_PAGE' ); wwv_flow_api.component_end; end; /
# --- !Ups create table Province ( id bigint not null AUTO_INCREMENT, name varchar(255), primary key (id) ); ALTER TABLE Advertisement ADD COLUMN province_id bigint(20); ALTER TABLE Advertisement ADD CONSTRAINT `province_fk` FOREIGN KEY (province_id) REFERENCES Province(id); ALTER TABLE Address ADD COLUMN province_id bigint(20); ALTER TABLE Address ADD CONSTRAINT `province_address_fk` FOREIGN KEY (province_id) REFERENCES Province(id); # -- Adds more Province INSERT INTO Province(name) VALUES('DKI Jakarta'); INSERT INTO Province(name) VALUES('Jawa Barat'); INSERT INTO Province(name) VALUES('Jawa Tengah'); INSERT INTO Province(name) VALUES('Jawa Timur'); INSERT INTO Province(name) VALUES('Banten'); INSERT INTO Province(name) VALUES('Aceh'); INSERT INTO Province(name) VALUES('Bali'); INSERT INTO Province(name) VALUES('Bengkulu'); INSERT INTO Province(name) VALUES('Gorontalo'); INSERT INTO Province(name) VALUES('Jambi'); INSERT INTO Province(name) VALUES('Kalimantan Barat'); INSERT INTO Province(name) VALUES('Kalimantan Selatan'); INSERT INTO Province(name) VALUES('Kalimantan Tengah'); INSERT INTO Province(name) VALUES('Kalimantan Timur'); INSERT INTO Province(name) VALUES('Kalimantan Utara'); INSERT INTO Province(name) VALUES('Kepulauan Bangka Belitung'); INSERT INTO Province(name) VALUES('Kepulauan Riau'); INSERT INTO Province(name) VALUES('Lampung'); INSERT INTO Province(name) VALUES('Maluku'); INSERT INTO Province(name) VALUES('Maluku Utara'); INSERT INTO Province(name) VALUES('Nusa Tenggara Barat'); INSERT INTO Province(name) VALUES('Nusa Tenggara Timur'); INSERT INTO Province(name) VALUES('Papua'); INSERT INTO Province(name) VALUES('Papua Barat'); INSERT INTO Province(name) VALUES('Riau'); INSERT INTO Province(name) VALUES('Sulawesi Barat'); INSERT INTO Province(name) VALUES('Sulawesi Tengah'); INSERT INTO Province(name) VALUES('Sulawesi Selatan'); INSERT INTO Province(name) VALUES('Sulawesi Tenggara'); INSERT INTO Province(name) VALUES('Sulawesi Utara'); INSERT INTO Province(name) VALUES('Sumatera Barat'); INSERT INTO Province(name) VALUES('Sumatera Selatan'); INSERT INTO Province(name) VALUES('Sumatera Utara'); INSERT INTO Province(name) VALUES('Yogyakarta'); # --- !Downs drop table if exists Province;
delete from HtmlLabelIndex where id=22904 / delete from HtmlLabelInfo where indexid=22904 / INSERT INTO HtmlLabelIndex values(22904,'是否可启动收文流程') / INSERT INTO HtmlLabelInfo VALUES(22904,'是否可启动收文流程',7) / INSERT INTO HtmlLabelInfo VALUES(22904,'Whether can start child request',8) / INSERT INTO HtmlLabelInfo VALUES(22904,'是否可啟動收文流程',9) /
select ciudad from proyecto; select distinct ciudad from proyecto; commit; exit;