text
stringlengths
6
9.38M
create or replace view V_JG_ZFSQ as (select c."JSDE301", c."JSDE302", c."JSDE303", c."DE186", c."DE156", c."CZDE951", c."DE042", c."JSDE955", c."DE084", c."JSDE702", c."CZDE119", c."JSDE802", c."JSDE901", c."DE181", c."JSDE940", c."DE190", c."JSDE305", c."DE195", c."JSDE364", c."DE194", c."JSDE306", c."JSDE307", c."JSDE308", c."JSDE316", c."CZDE390", c."DE192", c."DE011", to_char(jsde342, 'mm') as DE007, c."DE062", c."CZDE938", c."DE151", c."DE001", c."JSDE909", c."JSDE007", c."JSDE910", c."DE202", c."JSDE345", c."JSDE346", c."JSDE347", c."JSDE348", c."JSDE312", c."JSDE912", c."JSDE021", c."JSDE902", c."JSDE049", c."JSDE012", c."CZDE420", c."DE022", c."JSDE960", c."DE043", c."JSDE926", c."JSDE966", c."CZDE416", c."CZDEB01", pzbh, jsde342, zhdm, skdw from (select a.*, (select de151 from zf002 b where b.jsde302 = a.jsde302) as pzbh, (select jsde940 from zf002 b where b.jsde302 = a.jsde302) as pzzt, (select jsde342 from zf002 b where b.jsde302 = a.jsde302) as jsde342, (select zhdm from V_JG_YHZH b where b.de195 = a.jsde307 and a.jsde007 <> 31 and rownum = 1) as zhdm, (select jsde955 from V_JG_YHZH b where b.de195 = a.jsde307 and zhfl = '01' and rownum = 1) as skdw from zf001 a) c where pzzt >= '31' );
DROP TABLE If exists Examples.gadget; CREATE TABLE Examples.Gadget ( GadgetId int IDENTITY(1,1) NOT NULL CONSTRAINT PKGadget PRIMARY KEY, GadgetCode varchar(10) NOT NULL ); INSERT INTO Examples.Gadget (GadgetCode) VALUES ('LENOVO-101'); DELETE FROM Examples.Gadget WHERE GadgetId in (2,3); ALTER TABLE Examples.Gadget ADD CONSTRAINT AKGadget UNIQUE (GadgetCode); SELECT * FROM Examples.Gadget; CREATE TABLE Examples.GroceryItem ( ItemId int IDENTITY(1,1) PRIMARY KEY, ItemDescr varchar(200) NOT NULL, ItemCost smallmoney NULL, CONSTRAINT CHKGroceryItem_ItemCostRange CHECK (ItemCost > 0 AND ItemCost <1000) ); SELECT * FROM Examples.GroceryItem; CREATE TABLE Examples.Message ( MessageTag char(5) NOT NULL, Comment nvarchar(MAX) NULL ); ALTER TABLE Examples.Message ADD CONSTRAINT CHKMessage_MessageTagformat CHECK (MessageTag LIKE '[A-Z]-[0-9][0-9][0-9]'); ALTER TABLE Examples.Message ADD CONSTRAINT CHKMessage_CommentNotempty CHECK (LEN(Comment) >0); INSERT INTO Examples.Message (MessageTag, Comment) VALUES ('A-001', 'This is a comment'); Select * from Examples.Message;
DROP TABLE IF EXISTS `userphones`; CREATE TABLE `userphones` ( `id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `number` VARCHAR(15), `userid` INT DEFAULT NULL, `relationshipid` INT DEFAULT NULL, CONSTRAINT `FK_userphones_users` FOREIGN KEY (`userid`) REFERENCES users(`id`), CONSTRAINT `FK_userphones_relationships` FOREIGN KEY (`relationshipid`) REFERENCES relationships(`id`) );
USE [master] IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'$(Name)') BEGIN DROP LOGIN [$(Name)] END
CREATE TYPE observacion from varchar(1000)
CREATE SCHEMA `springsecurity` ; CREATE TABLE `springsecurity`.`user` ( `id` INT NOT NULL, `user_name` VARCHAR(45) NULL, `password` VARCHAR(45) NULL, `roles` VARCHAR(45) NULL, `active` TINYINT NULL); INSERT INTO `springsecurity`.`user` (`id`, `user_name`, `password`, `roles`, `active`) VALUES (1, 'USER', 'pass', 'ROLE_USER', true);
insert into repository (url, name, namespace) values('url1', 'foo', 'namespace1'); insert into repository (url, name, namespace) values('url2', 'bar', 'namespace2'); insert into repository (url, name, namespace) values('url3', 'baz', 'namespace3'); insert into repository (url, name, namespace) values('url4', 'foo', 'namespace4'); insert into repository (url, name, namespace) values('url5', 'bar', 'namespace5'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id1', 'url1', '1.0.0', '18'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id2', 'url2', '1.0.0', '18'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id3', 'url3', '1.0.0', '18'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id4', 'url4', '1.0.0', '18'); insert into package_versions (version_id, repository_url, ref, erl_version) values('version_id5', 'url5', '1.0.0', '18'); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_id1', 'version_id1', 'true', 'artifact', 'path1', now()); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_id2', 'version_id2', 'true', 'artifact', 'path1', now()); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_id3', 'version_id3', 'true', 'artifact', 'path1', now()); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_id4', 'version_id4', 'true', 'artifact', 'path1', now()); insert into builds (build_id, package_version_id, result, message, artifact_path, created_date) values('build_id5', 'version_id5', 'true', 'artifact', 'path1', now());
/* 1.사원테이블에서 부서 인원수가 6명이상인 부서코드 검색 */ SELECT * FROM EMP; SELECT DEPTNO ,COUNT(*) FROM EMP GROUP BY DEPTNO HAVING COUNT(*)>=6; /* 2.사원테이블로부터 부서번호 ,업무별 급여합계를 계산하고자 한다 .다음과 같은 결과를 출력할수 있는 SQL문장 작성 DEPTNO CLERK MANAGER PRESIDENT ANALYST SALSEMAN ------------------------------------------------ 10 1300 2450 5000 0 0 20 1900 2975 0 6000 0 30 950 2850 0 0 5600 */ SELECT DEPTNO,SUM(DECODE(JOB,'CLERK',SAL,0)), SUM(DECODE(JOB,'MANAGER',SAL,0)), SUM(DECODE(JOB,'PRESIDENT',SAL,0)), SUM(DECODE(JOB,'ANALYST',SAL,0)), SUM(DECODE(JOB,'SALESMAN',SAL,0)) FROM EMP GROUP BY DEPTNO ORDER BY 1; /* 3. 사원테이블로 부터 년도별 ,월별 급여합계를 출력할 수 있는 SQL문장 작성? */ SELECT TO_CHAR(HIREDATE,'YYYY') 년,TO_CHAR(HIREDATE,'MM') 월,SUM(SAL) 급여 FROM EMP GROUP BY TO_CHAR(HIREDATE,'YYYY'),TO_CHAR(HIREDATE,'MM') ORDER BY 1,2; /* 4.사원테이블에서 부서별 COMM(커미션)을 포함하지 않는 연봉의합과 포함한 연봉의 합을 구하는 SQL을 작성하시오 */ SELECT DEPTNO,SUM(NVL2(COMM,(SAL+COMM)*12,SAL*12) ) FROM EMP GROUP BY DEPTNO ORDER BY DEPTNO ; SELECT * FROM EMP; SELECT DEPTNO,SUM(SAL*12) FROM EMP GROUP BY DEPTNO ORDER BY DEPTNO ; SELECT * FROM EMP; /* 5.사원테이블에서 SALESMAN을 제외한 JOB별 급여합계 */ SELECT JOB ,SUM(SAL) FROM EMP GROUP BY JOB HAVING JOB!='SALESMAN' ; ------------------------------------------------------------------------------------------------------------------ --1. SELECT * FROM EMP; SELECT * FROM DEPT; SELECT EMPNO,ENAME,d.DEPTNO,DNAME FROM DEPT d,EMP e WHERE d.DEPTNO=e.DEPTNO ORDER BY ENAME ASC; --1-2 SELECT EMPNO,ENAME,d.DEPTNO,DNAME FROM EMP e JOIN DEPT d ON e.DEPTNO=d.DEPTNO ORDER BY ENAME ASC; --1-3 SELECT EMPNO,ENAME,DEPTNO,DNAME FROM EMP NATURAL JOIN DEPT; --2. SELECT EMPNO,ENAME,SAL,DNAME FROM DEPT d,EMP e WHERE d.DEPTNO=e.DEPTNO AND SAL>=2000 ORDER BY SAL ASC; --2-1 SELECT EMPNO,ENAME,SAL,DNAME FROM EMP JOIN DEPT USING (DEPTNO) WHERE SAL>=2000 ORDER BY SAL ASC; --2-2 SELECT*FROM EMP; SELECT EMPNO,ENAME,SAL,DNAME FROM EMP e JOIN DEPT d ON e.DEPTNO=d.DEPTNO AND SAL>=2000 ORDER BY SAL DESC; --3 SELECT EMPNO,ENAME,JOB,SAL,DNAME FROM EMP e,DEPT d WHERE e.DEPTNO=d.DEPTNO AND JOB='MANAGER' AND SAL>=2500 ORDER BY EMPNO ASC ; --3-2 SELECT EMPNO,ENAME,JOB,SAL,DNAME FROM EMP e JOIN DEPT d ON e.DEPTNO=d.DEPTNO AND JOB='MANAGER' AND SAL>=2500 ORDER BY EMPNO ASC; --4 SELECT * FROM SALGRADE; SELECT EMPNO,ENAME,SAL,GRADE FROM EMP e ,SALGRADE s WHERE SAL<=HISAL AND SAL>=LOSAL AND GRADE=4 ORDER BY SAL DESC; --4-2 SELECT EMPNO,ENAME,SAL,GRADE FROM EMP JOIN SALGRADE ON SAL<=HISAL AND SAL>=LOSAL AND GRADE=4 ORDER BY SAL DESC; --5 SELECT EMPNO ,ENAME,DNAME,SAL,GRADE FROM EMP e,DEPT d,SALGRADE WHERE e.DEPTNO=d.DEPTNO AND SAL>=LOSAL AND SAL<=HISAL ORDER BY GRADE DESC; --5.1 SELECT EMPNO ,ENAME ,DNAME ,SAL,GRADE FROM EMP NATURAL JOIN DEPT JOIN SALGRADE ON SAL>=LOSAL AND SAL<=HISAL ORDER BY GRADE DESC; --5-2 SELECT EMPNO,ENAME,DNAME,SAL,GRADE FROM EMP e JOIN DEPT d ON e.DEPTNO=d.DEPTNO JOIN SALGRADE ON SAL>=LOSAL AND SAL<=HISAL ORDER BY GRADE DESC; --6 SELECT e.ENAME ,m.ENAME FROM EMP e ,EMP m WHERE e.MGR=m.EMPNO ; SELECT * FROM EMP; --6-2 SELECT e.ENAME,m.ENAME FROM EMP e JOIN EMP m ON e.MGR=m.EMPNO; --7 SELECT e.ENAME,m.ENAME,k.ENAME FROM EMP e ,EMP m,EMP K WHERE e.MGR=m.EMPNO AND m.MGR=K.EMPNO; --7-2 SELECT e.ENAME,m.ENAME,k.ENAME FROM EMP e JOIN EMP m ON e.MGR=m.EMPNO JOIN EMP k ON m.MGR=k.EMPNO; --8 SELECT e.ENAME,m.ENAME,k.ENAME FROM EMP e ,EMP m,EMP K WHERE e.MGR=m.EMPNO(+) AND m.MGR=K.EMPNO(+); --8-2 SELECT e.ENAME,m.ENAME,k.ENAME FROM EMP e LEFT OUTER JOIN EMP m ON e.MGR=m.EMPNO LEFT OUTER JOIN EMP k ON m.MGR=k.EMPNO; SELECT *FROM EMP;
create table conn ( day Date DEFAULT toDate(ts), ts DateTime, uid String, orig_h String, orig_p UInt16, resp_h String, resp_p UInt16, proto Enum8('icmp'=1, 'tcp'=6, 'udp'=17), service Array(String), duration Float32, orig_bytes UInt64, resp_bytes UInt64, conn_state Enum8('OTH'=0, 'REJ'=1, 'RSTO'=2, 'RSTOS0'=3, 'RSTR'=4, 'RSTRH'=5, 'S0'=6, 'S1'=7, 'S2'=8, 'S3'=9, 'SF'=10, 'SH'=11, 'SHR'=12), local_orig Enum8('F'=0, 'T'=1), local_resp Enum8('F'=0, 'T'=1), missed_bytes UInt64, history String, orig_pkts UInt64, orig_ip_bytes UInt64, resp_pkts UInt64, resp_ip_bytes UInt64, orig_cc FixedString(2), resp_cc FixedString(2), peer String ) ENGINE = MergeTree(day,sipHash64(uid), (day,sipHash64(uid), uid), 8192);
alter table tempinteriors add column primaryId int not null auto_increment primary key;
/* Navicat Premium Data Transfer Source Server : 47.106.95.195 Source Server Type : MySQL Source Server Version : 50726 Source Host : 47.106.95.195:3306 Source Schema : test Target Server Type : MySQL Target Server Version : 50726 File Encoding : 65001 Date: 15/08/2019 17:24:26 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for db -- ---------------------------- DROP TABLE IF EXISTS `db`; CREATE TABLE `db` ( `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'name', `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'username', `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'password', `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'url', `driver_class_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'driverClassName', PRIMARY KEY (`name`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'db' ROW_FORMAT = Dynamic; -- ---------------------------- -- Records of db -- ---------------------------- INSERT INTO `db` VALUES ('dynamic_master', 'root', '123456', 'jdbc:mysql://we/dynamic_master?useUnicode=true&characterEncoding=utf-8&useSSL=false', 'com.mysql.jdbc.Driver'); INSERT INTO `db` VALUES ('slave', 'root', '123456', 'jdbc:mysql://we/test?useUnicode=true&characterEncoding=utf-8&useSSL=false', 'com.mysql.jdbc.Driver'); SET FOREIGN_KEY_CHECKS = 1;
--PROBLEM 05 --Write a query that selects: --• EmployeeID --• FirstName --Filter only employees without a project. Return the first 3 rows sorted by EmployeeID in ascending order. SELECT TOP 3 e.EmployeeID ,e.FirstName FROM Employees AS e LEFT JOIN EmployeesProjects AS temp ON temp.EmployeeID=e.EmployeeID WHERE ProjectID IS NULL ORDER BY e.EmployeeID
USE Parking INSERT INTO Personnes VALUES ('First', 'Adam'); INSERT INTO Personnes VALUES ('Goku', 'San'); INSERT INTO Personnes VALUES ('Denis', 'Jean'); SELECT * FROM Personnes;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; CREATE SCHEMA IF NOT EXISTS `Portunes` DEFAULT CHARACTER SET latin1 ; USE `Portunes` ; -- ----------------------------------------------------- -- Table `Portunes`.`User` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Portunes`.`User` ( `userName` VARCHAR(18) NOT NULL, `name` VARCHAR(45) NULL DEFAULT NULL, `password` BINARY(32) NULL DEFAULT NULL, `salt` BINARY(32) NULL DEFAULT NULL, PRIMARY KEY (`userName`), INDEX `password` (`password` ASC)) ENGINE = InnoDB DEFAULT CHARACTER SET = latin1; -- ----------------------------------------------------- -- Table `Portunes`.`Admin` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Portunes`.`Admin` ( `adminName` VARCHAR(18) NOT NULL, `userName` VARCHAR(18) NOT NULL, PRIMARY KEY (`adminName`, `userName`), INDEX `userName_idx` (`userName` ASC), CONSTRAINT `adminName` FOREIGN KEY (`adminName`) REFERENCES `Portunes`.`User` (`userName`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `userName` FOREIGN KEY (`userName`) REFERENCES `Portunes`.`User` (`userName`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = latin1; -- ----------------------------------------------------- -- Table `Portunes`.`History` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Portunes`.`History` ( `length` INT(11) NULL DEFAULT NULL, `lastLoginIndex` INT(11) NULL DEFAULT NULL, `userName` VARCHAR(18) NOT NULL, `hid` INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`hid`), UNIQUE INDEX `userName_UNIQUE` (`userName` ASC), CONSTRAINT `User_userName` FOREIGN KEY (`userName`) REFERENCES `Portunes`.`User` (`userName`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARACTER SET = latin1; -- ----------------------------------------------------- -- Table `Portunes`.`LogIn` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Portunes`.`LogIn` ( `hid` INT(11) NOT NULL, `ip` INT(10) UNSIGNED NULL DEFAULT NULL, `month` TINYINT(3) UNSIGNED NULL DEFAULT NULL, `day` TINYINT(3) UNSIGNED NULL DEFAULT NULL, `year` SMALLINT(5) UNSIGNED NULL DEFAULT NULL, `index` INT(11) NOT NULL, `hours` TINYINT(3) UNSIGNED NULL DEFAULT NULL, `minutes` TINYINT(3) UNSIGNED NULL DEFAULT NULL, PRIMARY KEY (`hid`, `index`), CONSTRAINT `History_hid` FOREIGN KEY (`hid`) REFERENCES `Portunes`.`History` (`hid`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB DEFAULT CHARACTER SET = latin1; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-- dbms_output-abstracted.sql -- some abstracted functions and procedures for using dbms_output -- Jared Still jkstill@gmail.com -- Pythisn 2019 -- these are demonstrated here in an anonymous block, but are really best -- used in stored procedures and packages; especially packages -- at least in sqlplus it is still necessary to turn serveroutput on external to the PL/SQL set serveroutput on set feed off declare v_msg varchar2(1024); /* == abstracted interface to dbms_output */ -- do not set these outside of the control procedures b_p_enabled boolean := false; b_logging boolean := false; v_platform varchar2(10) := 'unix'; /* =============================================== == procedure set platform == valid input values are 'windows' and 'unix' == default is 'unix' =============================================== */ procedure set_platform ( platform_in in varchar2 default v_platform) is invalid_platform exception; pragma exception_init(invalid_platform, -20001); begin if platform_in not in ('unix', 'windows') then raise invalid_platform; end if; v_platform := platform_in; exception when invalid_platform then -- p() not available at this point -- could be used if this were a package dbms_output.put_line('invalid platform of "' || platform_in || '"'); when others then raise; end; /* =============================================== == get platform - return the value of v_platform =============================================== */ function get_platform return varchar2 is begin return v_platform; end; /* =============================================== == function embed_newline == returns a newline character == pass platform => 'windows' and it will return CRLF =============================================== */ function embed_newline ( platform in varchar2 default 'unix') return varchar2 is newline_str varchar2(2); begin if get_platform = 'windows' then newline_str := chr(13)||chr(10); else newline_str := chr(10); end if; return newline_str; end; /* =============================================== == function p_enabled == return true/false to check if dbms_output == is enabled internally =============================================== */ function p_enabled return boolean is begin return b_p_enabled; end; /* =============================================== == procedure p_enable == enable dbms_output =============================================== */ procedure p_enable is begin -- NULL == unlimited dbms_output.enable(null); end; /* =============================================== == procedure p_on == internally enable dbms_output use via p() and pl() =============================================== */ procedure p_on is begin p_enable; b_p_enabled := true; end; /* =============================================== == procedure p_off == internally disable dbms_output use via p() and pl() =============================================== */ procedure p_off is begin b_p_enabled := false; end; /* =============================================== == procedure p == print a line without linefeed =============================================== */ procedure p (p_in varchar2) is begin if p_enabled then dbms_output.put(p_in); end if; end; /* =============================================== == procedure p; == print a line with linefeed =============================================== */ procedure pl (p_in varchar2) is begin if p_enabled then p(p_in); dbms_output.new_line; end if; end; /* =============================================== == procedure banner; == print a line of 80 '=' == specify an optional character with v_banner_char_in =============================================== */ procedure banner( v_banner_char_in varchar2 default '=') is begin pl(rpad(v_banner_char_in,80,v_banner_char_in)); end; begin -- dbms_output.put_line is used for testing purposes only dbms_output.put_line('Testing the p_ procedures'); dbms_output.put_line('Output from the following lines will not be seen'); p_off; pl('This is a test - output is disabled'); dbms_output.put_line('Output now enabled with p_on()'); p_on; banner; pl('output is enabled '); banner; -- create a multiline message -- dbms_output will use the correct line terminator for whatever platform it is installed on -- the embed_newline function is useful for creating multiline text with the correct line terminator set_platform('unix'); v_msg := 'this is line 1' || embed_newline || 'this is line 2' || embed_newline || 'this is line 3'; pl(v_msg); end; / set feed on
--link: https://leetcode.com/problems/rank-scores/description/ select Score, (SELECT Count(DISTINCT Score) from Scores WHERE Score >= s.Score) as Rank from Scores s order by Score DESC;
-- -- Designer:huanggx -- Description:add sellout and polygon for relation house tables -- Created:04/16/2015 -- History: -- ============================================================== -- Author DateTime Alert Desciption -- ============================================================== -- huanggx 04/16/2015 add sellout and polygon for relation house tables -- -- -- DELIMITER $$ CREATE PROCEDURE ADD_COLUMN() BEGIN IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'house' AND column_name = 'sell_out' )THEN ALTER TABLE HOUSE ADD sell_out INT; END IF; END$$ DELIMITER ; CALL ADD_COLUMN(); DROP PROCEDURE IF EXISTS ADD_COLUMN; DELIMITER $$ CREATE PROCEDURE ADD_COLUMN() BEGIN IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'house_floor' AND column_name = 'sell_out' )THEN ALTER TABLE HOUSE_FLOOR ADD sell_out INT; END IF; END$$ DELIMITER ; CALL ADD_COLUMN(); DROP PROCEDURE IF EXISTS ADD_COLUMN; DELIMITER $$ CREATE PROCEDURE ADD_COLUMN() BEGIN IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'house_floor' AND column_name = 'graph_type' )THEN ALTER TABLE HOUSE_FLOOR ADD graph_type INT; END IF; END$$ DELIMITER ; CALL ADD_COLUMN(); DROP PROCEDURE IF EXISTS ADD_COLUMN; DELIMITER $$ CREATE PROCEDURE ADD_COLUMN() BEGIN IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'house_number' AND column_name = 'sell_out' )THEN ALTER TABLE HOUSE_NUMBER ADD sell_out INT; END IF; END$$ DELIMITER ; CALL ADD_COLUMN(); DROP PROCEDURE IF EXISTS ADD_COLUMN; DELIMITER $$ CREATE PROCEDURE ADD_COLUMN() BEGIN IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'house_room' AND column_name = 'sell_out' )THEN ALTER TABLE HOUSE_ROOM ADD sell_out INT; END IF; END$$ DELIMITER ; CALL ADD_COLUMN(); DROP PROCEDURE IF EXISTS ADD_COLUMN;
insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (2, 2); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (10, 8); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 4); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (6, 6); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 9); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (4, 6); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (4, 2); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (4, 3); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (4, 1); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 7); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 2); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 3); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (7, 3); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (3, 2); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 5); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (3, 9); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 6); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (3, 5); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (10, 7); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (6, 5); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (2, 9); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (5, 8); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 4); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 6); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (10, 1); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (4, 7); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 10); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (10, 9); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (1, 8); insert into UNHEALTHYTOHEALTHY (UNHEALTHY_FOOD_ID, HEALTHY_FOOD_ID) values (9, 10);
SET SERVEROUTPUT ON; DECLARE promedio number(5,2); BEGIN << ciclo_filas_notas >> FOR fila IN ( SELECT * FROM NOTAS ORDER BY NOMBRE ASC ) LOOP -- recoremos toda una tabla cambiando su valor cada que itere por la fila promedio := (fila.NOTA1 + fila.NOTA2 + fila.NOTA3 + fila.NOTA4) / 4; dbms_output.put_line('Nombre: ' || fila.NOMBRE || ' - Promedio: ' || promedio); END LOOP ciclo_filas_notas; END; /
USE a1; DROP TABLE article; CREATE TABLE article( num INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, views INT(10) UNSIGNED NOT NULL, replyNum INT(10) UNSIGNED NOT NULL, memberNum INT(10) UNSIGNED NOT NULL, boardNum INT(10) UNSIGNED NOT NULL, recommandNum INT(10) UNSIGNED NOT NULL, regDate DATETIME NOT NULL, updateDate DATETIME NOT NULL, title VARCHAR(100) NOT NULL, `body` TEXT NOT NULL ); DESC article; SELECT * FROM article; DROP TABLE `Member`; CREATE TABLE `Member`( memberNum INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, regDate DATETIME NOT NULL, `name` VARCHAR(100) NOT NULL, `id` VARCHAR(100) NOT NULL, `password` VARCHAR(100) NOT NULL ); INSERT INTO `Member` SET memberNum = 999, regDate = NOW(), `name` = '방혜성', `id` = 'admin', `password` = 'admin123'; SELECT article.* , `Member`.name AS extra__writer, board.name extra__board FROM article INNER JOIN `Member` ON article.memberNum = Member.memberNum INNER JOIN board ON article.boardNum = board.boardNum; DESC `Member`; SELECT * FROM `Member`; DROP TABLE board; CREATE TABLE board( boardNum INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, regDate DATETIME NOT NULL, updateDate DATETIME NOT NULL, `name` VARCHAR(100) NOT NULL, `code` VARCHAR(20) NOT NULL ); DESC `board`; SELECT * FROM `board`; DROP TABLE Reply; CREATE TABLE Reply( replyNum INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, articleNum INT(10) UNSIGNED NOT NULL, `name` VARCHAR(100) NOT NULL, regDate DATETIME NOT NULL, updateDate DATETIME NOT NULL, `body` TEXT NOT NULL ); DESC Reply; SELECT * FROM Reply; DROP TABLE Recommand; CREATE TABLE Recommand( id INT(10) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, regDate DATETIME NOT NULL, updateDate DATETIME NOT NULL, memberId INT(10) UNSIGNED NOT NULL, articleId INT(10) UNSIGNED NOT NULL ); DESC Recommand; SELECT * FROM Recommand;
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: login -- ------------------------------------------------------ -- Server version 5.7.23-0ubuntu0.18.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `cars` -- DROP TABLE IF EXISTS `cars`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cars` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `price` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `color_id` int(10) unsigned NOT NULL, `brand_id` int(10) unsigned NOT NULL, `car_type_id` int(10) unsigned NOT NULL, `year` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `cars_color_id_foreign` (`color_id`), KEY `cars_brand_id_foreign` (`brand_id`), KEY `cars_car_type_id_foreign` (`car_type_id`), CONSTRAINT `cars_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE CASCADE, CONSTRAINT `cars_car_type_id_foreign` FOREIGN KEY (`car_type_id`) REFERENCES `car_types` (`id`) ON DELETE CASCADE, CONSTRAINT `cars_color_id_foreign` FOREIGN KEY (`color_id`) REFERENCES `colors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cars` -- LOCK TABLES `cars` WRITE; /*!40000 ALTER TABLE `cars` DISABLE KEYS */; INSERT INTO `cars` VALUES (3,'A6','49.9 lakh',1,1,6,'2018','2018-11-15 02:16:39','2018-11-15 02:16:39','1542267999.jpg'),(4,'R8','2.72 crore',3,1,1,'2016','2018-11-15 02:19:22','2018-11-15 02:19:35','2018-audi-r8-coupe-angular-front_1542268162.png'),(5,'i8','2.62 Crores',1,2,1,'2014','2018-11-15 02:21:13','2018-11-15 02:21:13','new-2019-bmw-i8-roadster-7551-18014055-1-1024_1542268273.jpg'),(6,'Aventador','4.76 Crores',2,5,8,'2015','2018-11-15 02:23:45','2018-11-15 02:24:09','2016-lamborghini-aventador-lp750-4-superveloce-test-review-car-and-driver-photo-667354-s-original_1542268425.jpg'),(7,'Italia','4000',2,3,8,'2010','2018-11-15 23:56:24','2018-11-15 23:56:24','2012-ferrari-458 italia-frontside_fef458it121_1542345984.jpg'); /*!40000 ALTER TABLE `cars` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2019-01-16 11:08:40
DELETE FROM StockTable; DBCC CHECKIDENT (StockTable, RESEED, 0);
/* Using Oracle to perform linear regression */ /* Create a data table and populate it with data. */ DROP TABLE foo; CREATE TABLE foo ( x INTEGER, y INTEGER ); INSERT INTO foo VALUES (1,3); INSERT INTO foo VALUES (2,5); INSERT INTO foo VALUES (3,7); INSERT INTO foo VALUES (5,10); INSERT INTO foo VALUES (10,22); INSERT INTO foo VALUES (11,23); INSERT INTO foo VALUES (12,25); /* For a linear equation we need to find the slope and the y-intercept. We also want to estimate how well our line fits the data. The R2 coefficient of determination R^2 gives us a number betweeen 0 and 1. 1 is a perfect fit. */ SELECT REGR_SLOPE(y, x) SLOPE, REGR_INTERCEPT(y, x) INTERCEPT, REGR_COUNT(y, x) COUNT, REGR_R2(y, x) R2 FROM foo; CREATE TABLE CORR_REGR AS ( SELECT CORR( WEATHER.CW_TOTAL_RAIN, FACT.AVGSPEED ) FROM FACT INNER JOIN WEATHER ON FACT.RIDE_DATE = WEATHER.CW_DATE WHERE FACT.RIDE_TYPE = 'C');
-- Jul 9, 2008 3:33:39 PM COT -- Jul 9, 2008 3:33:39 PM COT -- Financial Report Source with Type Combination -- recreate index to include the two new columns drop index FACT_ACCT_BALANCE_AKEY; CREATE UNIQUE INDEX FACT_ACCT_BALANCE_AKEY ON FACT_ACCT_BALANCE (AD_CLIENT_ID, AD_ORG_ID, C_ACCTSCHEMA_ID, DATEACCT, ACCOUNT_ID, POSTINGTYPE, M_PRODUCT_ID, C_BPARTNER_ID, C_PROJECT_ID, AD_ORGTRX_ID, C_SALESREGION_ID, C_ACTIVITY_ID, C_CAMPAIGN_ID, C_LOCTO_ID, C_LOCFROM_ID, USER1_ID, USER2_ID, USERELEMENT1_ID, USERELEMENT2_ID, GL_BUDGET_ID); /* Alternatively - in case you replaced fact_acct_balance with a view - this is the view replacement: CREATE OR REPLACE VIEW fact_acct_balance AS SELECT ad_client_id, ad_org_id, c_acctschema_id, TRUNC (dateacct) as dateacct, account_id, postingtype, m_product_id, c_bpartner_id, c_project_id, ad_orgtrx_id, c_salesregion_id, c_activity_id, c_campaign_id, c_locto_id, c_locfrom_id, user1_id, user2_id, gl_budget_id, COALESCE (SUM (amtacctdr), 0) as amtacctdr, COALESCE (SUM (amtacctcr), 0) as amtacctcr, COALESCE (SUM (qty), 0) as qty, MAX (createdby) as createdby, MAX (created) as created, MAX (updatedby) as updatedby, MAX (updated) as updated, MAX (isactive) as isactive, MAX (c_subacct_id) as c_subacct_id, userelement1_id, userelement2_id, MAX (c_projectphase_id) as c_projectphase_id, MAX (c_projecttask_id) as c_projecttask_id FROM fact_acct a GROUP BY ad_client_id, ad_org_id, c_acctschema_id, TRUNC (dateacct), account_id, postingtype, m_product_id, c_bpartner_id, c_project_id, ad_orgtrx_id, c_salesregion_id, c_activity_id, c_campaign_id, c_locto_id, c_locfrom_id, user1_id, user2_id, userelement1_id, userelement2_id, gl_budget_id / */ -- Jul 9, 2008 3:33:39 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Reference (UpdatedBy,ValidationType,AD_Org_ID,Updated,VFormat,Help,Created,AD_Client_ID,AD_Reference_ID,EntityType,Name,CreatedBy,IsActive,Description,IsOrderByValue) VALUES (100,'L',0,TO_TIMESTAMP('2008-07-09 15:33:11','YYYY-MM-DD HH24:MI:SS'),'AA','Hardcoded Element Types',TO_TIMESTAMP('2008-07-09 15:33:11','YYYY-MM-DD HH24:MI:SS'),0,53280,'D','PA_ReportSource ElementType',100,'Y','Element Types for Accounting Elements - equal to C_AcctSchema ElementType plus Combination','N') ; -- Jul 9, 2008 3:33:39 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53280 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID) ; SET CLIENT_ENCODING TO 'LATIN1'; -- Jul 9, 2008 3:34:47 PM COT -- Financial Report Source with Type Combination UPDATE AD_Reference_Trl SET Description='Tipos de elementos para elementos contables - igual a C_AcctSchema ElementType mas Combinación',Help='Tipos de elementos definidos en forma fija',Updated=TO_TIMESTAMP('2008-07-09 15:34:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53280 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:35:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:35:10','YYYY-MM-DD HH24:MI:SS'),'AC',TO_TIMESTAMP('2008-07-09 15:35:10','YYYY-MM-DD HH24:MI:SS'),0,53280,53418,'D','Account',100,'Y','Natural Account') ; -- Jul 9, 2008 3:35:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53418 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:36:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:35:58','YYYY-MM-DD HH24:MI:SS'),'AY',TO_TIMESTAMP('2008-07-09 15:35:58','YYYY-MM-DD HH24:MI:SS'),0,53280,53419,'D','Activity',100,'Y','Business Activity') ; -- Jul 9, 2008 3:36:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53419 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:36:42 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:36:38','YYYY-MM-DD HH24:MI:SS'),'BP',TO_TIMESTAMP('2008-07-09 15:36:38','YYYY-MM-DD HH24:MI:SS'),0,53280,53420,'D','BPartner',100,'Y','Business Partner') ; -- Jul 9, 2008 3:36:42 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53420 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:37:02 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:36:55','YYYY-MM-DD HH24:MI:SS'),'LF',TO_TIMESTAMP('2008-07-09 15:36:55','YYYY-MM-DD HH24:MI:SS'),0,53280,53421,'D','Location From',100,'Y','Location From') ; -- Jul 9, 2008 3:37:03 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53421 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:37:14 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:37:13','YYYY-MM-DD HH24:MI:SS'),'LT',TO_TIMESTAMP('2008-07-09 15:37:13','YYYY-MM-DD HH24:MI:SS'),0,53280,53422,'D','Location To',100,'Y','Location To') ; -- Jul 9, 2008 3:37:14 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53422 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:37:32 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:37:31','YYYY-MM-DD HH24:MI:SS'),'MC',TO_TIMESTAMP('2008-07-09 15:37:31','YYYY-MM-DD HH24:MI:SS'),0,53280,53423,'D','Campaign',100,'Y','Marketing Campaign') ; -- Jul 9, 2008 3:37:32 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53423 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:37:46 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:37:45','YYYY-MM-DD HH24:MI:SS'),'OO',TO_TIMESTAMP('2008-07-09 15:37:45','YYYY-MM-DD HH24:MI:SS'),0,53280,53424,'D','Organization',100,'Y','Owning Organization') ; -- Jul 9, 2008 3:37:46 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53424 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:38:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:37:59','YYYY-MM-DD HH24:MI:SS'),'OT',TO_TIMESTAMP('2008-07-09 15:37:59','YYYY-MM-DD HH24:MI:SS'),0,53280,53425,'D','Org Trx',100,'Y','Transaction Organization') ; -- Jul 9, 2008 3:38:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53425 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:38:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:38:11','YYYY-MM-DD HH24:MI:SS'),'PJ',TO_TIMESTAMP('2008-07-09 15:38:11','YYYY-MM-DD HH24:MI:SS'),0,53280,53426,'D','Project',100,'Y','Project') ; -- Jul 9, 2008 3:38:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53426 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:38:26 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:38:25','YYYY-MM-DD HH24:MI:SS'),'PR',TO_TIMESTAMP('2008-07-09 15:38:25','YYYY-MM-DD HH24:MI:SS'),0,53280,53427,'D','Product',100,'Y','Product') ; -- Jul 9, 2008 3:38:26 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53427 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:38:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:38:37','YYYY-MM-DD HH24:MI:SS'),'SA',TO_TIMESTAMP('2008-07-09 15:38:37','YYYY-MM-DD HH24:MI:SS'),0,53280,53428,'D','Sub Account',100,'Y','Sub Account for Element Value') ; -- Jul 9, 2008 3:38:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53428 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:38:50 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:38:49','YYYY-MM-DD HH24:MI:SS'),'SR',TO_TIMESTAMP('2008-07-09 15:38:49','YYYY-MM-DD HH24:MI:SS'),0,53280,53429,'D','Sales Region',100,'Y','Sales Region') ; -- Jul 9, 2008 3:38:50 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53429 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:39:01 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:39:01','YYYY-MM-DD HH24:MI:SS'),'U1',TO_TIMESTAMP('2008-07-09 15:39:01','YYYY-MM-DD HH24:MI:SS'),0,53280,53430,'D','User List 1',100,'Y','User 1') ; -- Jul 9, 2008 3:39:01 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53430 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:39:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:39:15','YYYY-MM-DD HH24:MI:SS'),'U2',TO_TIMESTAMP('2008-07-09 15:39:15','YYYY-MM-DD HH24:MI:SS'),0,53280,53431,'D','User List 2',100,'Y','User 2') ; -- Jul 9, 2008 3:39:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53431 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:39:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:39:27','YYYY-MM-DD HH24:MI:SS'),'X1',TO_TIMESTAMP('2008-07-09 15:39:27','YYYY-MM-DD HH24:MI:SS'),0,53280,53432,'D','User Element 1',100,'Y') ; -- Jul 9, 2008 3:39:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53432 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:39:40 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:39:39','YYYY-MM-DD HH24:MI:SS'),'X2',TO_TIMESTAMP('2008-07-09 15:39:39','YYYY-MM-DD HH24:MI:SS'),0,53280,53433,'D','User Element 2',100,'Y') ; -- Jul 9, 2008 3:39:40 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53433 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:40:02 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List (UpdatedBy,AD_Org_ID,Updated,Value,Created,AD_Client_ID,AD_Reference_ID,AD_Ref_List_ID,EntityType,Name,CreatedBy,IsActive,Description) VALUES (100,0,TO_TIMESTAMP('2008-07-09 15:39:57','YYYY-MM-DD HH24:MI:SS'),'CO',TO_TIMESTAMP('2008-07-09 15:39:57','YYYY-MM-DD HH24:MI:SS'),0,53280,53434,'D','Combination',100,'Y','Combination of accounting dimensions') ; -- Jul 9, 2008 3:40:02 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53434 AND EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Ref_List_ID!=t.AD_Ref_List_ID) ; -- Jul 9, 2008 3:40:17 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Cuenta',Description='Cuenta Natural',Updated=TO_TIMESTAMP('2008-07-09 15:40:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53418 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:40:32 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Actividad',Description=NULL,Updated=TO_TIMESTAMP('2008-07-09 15:40:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53419 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:40:49 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Socio del Negocio',Description='Socio del Negocio',Updated=TO_TIMESTAMP('2008-07-09 15:40:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53420 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:41:05 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Localización Desde',Description='Localización Desde',Updated=TO_TIMESTAMP('2008-07-09 15:41:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53421 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:41:18 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Localización A',Description='Localización A',Updated=TO_TIMESTAMP('2008-07-09 15:41:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53422 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:41:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Campaña',Description='Campaña de Mercadotecnia',Updated=TO_TIMESTAMP('2008-07-09 15:41:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53423 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:41:50 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Organización',Description='Organización Poseedora',Updated=TO_TIMESTAMP('2008-07-09 15:41:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53424 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:42:05 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Trans Org',Description='Transacción de la Organización',Updated=TO_TIMESTAMP('2008-07-09 15:42:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53425 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:42:19 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Proyecto',Description='Proyecto',Updated=TO_TIMESTAMP('2008-07-09 15:42:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53426 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:42:31 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Producto',Description='Producto',Updated=TO_TIMESTAMP('2008-07-09 15:42:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53427 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:42:47 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Sub Cuenta',Description='Sub Cuenta para Valor del Elemento',Updated=TO_TIMESTAMP('2008-07-09 15:42:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53428 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:43:02 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Región de Ventas',Description='Región de Ventas',Updated=TO_TIMESTAMP('2008-07-09 15:43:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53429 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:43:24 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Lista Usuario 1',Description='Usuario 1',Updated=TO_TIMESTAMP('2008-07-09 15:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53430 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:43:39 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Lista Usuario 2',Description='Usuario 2',Updated=TO_TIMESTAMP('2008-07-09 15:43:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53431 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:43:52 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Elemento de Usuario 1',Updated=TO_TIMESTAMP('2008-07-09 15:43:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53432 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:44:01 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Elemento de Usuario 2',Updated=TO_TIMESTAMP('2008-07-09 15:44:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53433 AND AD_Language LIKE 'es_%' ; -- Jul 9, 2008 3:44:20 PM COT -- Financial Report Source with Type Combination UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Name='Combinación',Description='Combinacion de dimensiones contables',Updated=TO_TIMESTAMP('2008-07-09 15:44:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53434 AND AD_Language LIKE 'es_%' ; SET CLIENT_ENCODING TO 'UTF8'; -- Jul 9, 2008 3:45:38 PM COT -- Financial Report Source with Type Combination UPDATE AD_Column SET AD_Reference_Value_ID=53280,Updated=TO_TIMESTAMP('2008-07-09 15:45:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6085 ; -- Jul 9, 2008 3:46:39 PM COT -- Financial Report Source with Type Combination UPDATE AD_Column SET AD_Reference_Value_ID=53280,Updated=TO_TIMESTAMP('2008-07-09 15:46:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6024 ; -- Jul 9, 2008 3:48:55 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=OO | @ElementType@=OT | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:48:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4815 ; -- Jul 9, 2008 3:48:57 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=AC | @ElementType@=U1 | @ElementType@=U2 | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:48:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4805 ; -- Jul 9, 2008 3:48:59 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=BP | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:48:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4816 ; -- Jul 9, 2008 3:49:01 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=PR | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4807 ; -- Jul 9, 2008 3:49:02 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=LF | @ElementType@=LT | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4808 ; -- Jul 9, 2008 3:49:04 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=PJ | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4806 ; -- Jul 9, 2008 3:49:05 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=SR | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4809 ; -- Jul 9, 2008 3:49:06 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=AY | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4810 ; -- Jul 9, 2008 3:49:09 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=MC | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4817 ; -- Jul 9, 2008 3:49:44 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=OO | @ElementType@=OT | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4764 ; -- Jul 9, 2008 3:49:45 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=AC | @ElementType@=U1 | @ElementType@=U2 | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4765 ; -- Jul 9, 2008 3:49:47 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=PR | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4766 ; -- Jul 9, 2008 3:49:49 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=MC | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4777 ; -- Jul 9, 2008 3:49:50 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=BP | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4776 ; -- Jul 9, 2008 3:49:51 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=PJ | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4775 ; -- Jul 9, 2008 3:49:53 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=LF | @ElementType@=LT | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4767 ; -- Jul 9, 2008 3:49:54 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=SR | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:49:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4768 ; -- Jul 9, 2008 3:50:03 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic='@ElementType@=AY | @ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-09 15:50:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4769 ; -- Jul 9, 2008 3:50:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2008-07-09 15:50:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4756 ; -- Jul 9, 2008 3:57:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Val_Rule SET Code='C_ElementValue.C_Element_ID IN (SELECT C_Element_ID FROM C_AcctSchema_Element WHERE C_AcctSchema_ID=@$C_AcctSchema_ID@ AND (ElementType=''@ElementType@'' OR (''@ElementType@''=''CO'' AND ElementType=''AC'')))',Updated=TO_TIMESTAMP('2008-07-09 15:57:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=258 ; -- Jul 9, 2008 5:40:22 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,Help,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',10,100,'UserElement1_ID',0,'N',0,TO_TIMESTAMP('2008-07-09 17:40:17','YYYY-MM-DD HH24:MI:SS'),'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested)','N',TO_TIMESTAMP('2008-07-09 17:40:17','YYYY-MM-DD HH24:MI:SS'),0,56151,13,'D','User Element 1','N',100,'N','N','Y',2877,'User defined accounting Element','N','N') ; -- Jul 9, 2008 5:40:22 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56151 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 9, 2008 5:40:28 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN UserElement1_ID NUMERIC(10) ; -- Jul 9, 2008 5:41:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,Help,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',10,100,'UserElement2_ID',0,'N',0,TO_TIMESTAMP('2008-07-09 17:41:12','YYYY-MM-DD HH24:MI:SS'),'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested) ','N',TO_TIMESTAMP('2008-07-09 17:41:12','YYYY-MM-DD HH24:MI:SS'),0,56152,13,'D','User Element 2','N',100,'N','N','Y',2878,'User defined accounting Element','N','N') ; -- Jul 9, 2008 5:41:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56152 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 9, 2008 5:41:16 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN UserElement2_ID NUMERIC(10) ; -- Jul 9, 2008 5:42:04 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,Help,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',10,100,'UserElement1_ID',0,'N',0,TO_TIMESTAMP('2008-07-09 17:42:00','YYYY-MM-DD HH24:MI:SS'),'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested)','N',TO_TIMESTAMP('2008-07-09 17:42:00','YYYY-MM-DD HH24:MI:SS'),0,56153,13,'D','User Element 1','N',100,'N','N','Y',2877,'User defined accounting Element','N','N') ; -- Jul 9, 2008 5:42:04 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56153 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 9, 2008 5:42:07 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN UserElement1_ID NUMERIC(10) ; -- Jul 9, 2008 5:42:48 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,Help,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',10,100,'UserElement2_ID',0,'N',0,TO_TIMESTAMP('2008-07-09 17:42:43','YYYY-MM-DD HH24:MI:SS'),'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested) ','N',TO_TIMESTAMP('2008-07-09 17:42:43','YYYY-MM-DD HH24:MI:SS'),0,56154,13,'D','User Element 2','N',100,'N','N','Y',2878,'User defined accounting Element','N','N') ; -- Jul 9, 2008 5:42:48 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56154 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 9, 2008 5:42:49 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN UserElement2_ID NUMERIC(10) ; -- Jul 9, 2008 5:48:36 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,SeqNo,Updated,DisplayLength,Help,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,DisplayLogic,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,310,TO_TIMESTAMP('2008-07-09 17:48:33','YYYY-MM-DD HH24:MI:SS'),14,'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested)',TO_TIMESTAMP('2008-07-09 17:48:33','YYYY-MM-DD HH24:MI:SS'),'Y',0,56151,'N','D','N','User Element 1','N','@ElementType@=X1 | @ElementType@=CO & @$Element_X1@=Y',100,'Y','Y',56281,'User defined accounting Element','N') ; -- Jul 9, 2008 5:48:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56281 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 9, 2008 5:48:58 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,SeqNo,Updated,DisplayLength,Help,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,DisplayLogic,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,320,TO_TIMESTAMP('2008-07-09 17:48:58','YYYY-MM-DD HH24:MI:SS'),14,'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested) ',TO_TIMESTAMP('2008-07-09 17:48:58','YYYY-MM-DD HH24:MI:SS'),'Y',0,56152,'N','D','N','User Element 2','N','@ElementType@=X2 | @ElementType@=CO & @$Element_X2@=Y',100,'Y','Y',56282,'User defined accounting Element','N') ; -- Jul 9, 2008 5:48:59 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56282 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 9, 2008 5:50:43 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,SeqNo,Updated,DisplayLength,Help,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,DisplayLogic,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,170,TO_TIMESTAMP('2008-07-09 17:50:43','YYYY-MM-DD HH24:MI:SS'),14,'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested)',TO_TIMESTAMP('2008-07-09 17:50:43','YYYY-MM-DD HH24:MI:SS'),'Y',0,56153,'N','D','N','User Element 1','N','@ElementType@=X1 | @ElementType@=CO & @$Element_X1@=Y',100,'Y','Y',56283,'User defined accounting Element','N') ; -- Jul 9, 2008 5:50:44 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56283 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 9, 2008 5:51:07 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,SeqNo,Updated,DisplayLength,Help,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,DisplayLogic,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,180,TO_TIMESTAMP('2008-07-09 17:51:02','YYYY-MM-DD HH24:MI:SS'),14,'A user defined accounting element referres to a Adempiere table. This allows to use any table content as an accounting dimension (e.g. Project Task). Note that User Elements are optional and are populated from the context of the document (i.e. not requested) ',TO_TIMESTAMP('2008-07-09 17:51:02','YYYY-MM-DD HH24:MI:SS'),'Y',0,56154,'N','D','N','User Element 2','N','@ElementType@=X2 | @ElementType@=CO & @$Element_X2@=Y',100,'Y','Y',56284,'User defined accounting Element','N') ; -- Jul 9, 2008 5:51:07 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56284 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:40:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsOrg',0,TO_TIMESTAMP('2008-07-10 16:40:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:40:08','YYYY-MM-DD HH24:MI:SS'),'Include Nulls Org',0,'D','Include Nulls Org',100,'Y',53657,'Include nulls in the selection of the organization') ; -- Jul 10, 2008 4:40:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53657 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:41:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsElementValue',0,TO_TIMESTAMP('2008-07-10 16:41:22','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:41:22','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Account',0,'D','Include Nulls in Account',100,'Y',53658,'Include nulls in the selection of the account') ; -- Jul 10, 2008 4:41:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53658 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Element SET PrintName='Include Nulls in Org', Name='Include Nulls in Org',Updated=TO_TIMESTAMP('2008-07-10 16:41:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53657 ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=53657 ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Column SET ColumnName='IsIncludeNullsOrg', Name='Include Nulls in Org', Description='Include nulls in the selection of the organization', Help=NULL WHERE AD_Element_ID=53657 ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET Name='Include Nulls in Org', Description='Include nulls in the selection of the organization', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53657) AND IsCentrallyMaintained='Y' ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Process_Para SET ColumnName='IsIncludeNullsOrg', Name='Include Nulls in Org', Description='Include nulls in the selection of the organization', Help=NULL, AD_Element_ID=53657 WHERE UPPER(ColumnName)='ISINCLUDENULLSORG' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Process_Para SET ColumnName='IsIncludeNullsOrg', Name='Include Nulls in Org', Description='Include nulls in the selection of the organization', Help=NULL WHERE AD_Element_ID=53657 AND IsCentrallyMaintained='Y' ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_PrintFormatItem SET PrintName='Include Nulls in Org', Name='Include Nulls in Org' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53657) ; -- Jul 10, 2008 4:41:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_PrintFormatItem SET PrintName='Include Nulls in Org', Name='Include Nulls in Org' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53657) ; -- Jul 10, 2008 4:41:55 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Help,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsBpartner',0,TO_TIMESTAMP('2008-07-10 16:41:54','YYYY-MM-DD HH24:MI:SS'),NULL,TO_TIMESTAMP('2008-07-10 16:41:54','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in BPartner',0,'D','Include Nulls in BPartner',100,'Y',53659,'Include nulls in the selection of the business partner') ; -- Jul 10, 2008 4:41:55 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53659 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Element SET ColumnName='IsIncludeNullsBPartner',Updated=TO_TIMESTAMP('2008-07-10 16:42:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=53659 ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Column SET ColumnName='IsIncludeNullsBPartner', Name='Include Nulls in BPartner', Description='Include nulls in the selection of the business partner', Help=NULL WHERE AD_Element_ID=53659 ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET Name='Include Nulls in BPartner', Description='Include nulls in the selection of the business partner', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=53659) AND IsCentrallyMaintained='Y' ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Process_Para SET ColumnName='IsIncludeNullsBPartner', Name='Include Nulls in BPartner', Description='Include nulls in the selection of the business partner', Help=NULL, AD_Element_ID=53659 WHERE UPPER(ColumnName)='ISINCLUDENULLSBPARTNER' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_Process_Para SET ColumnName='IsIncludeNullsBPartner', Name='Include Nulls in BPartner', Description='Include nulls in the selection of the business partner', Help=NULL WHERE AD_Element_ID=53659 AND IsCentrallyMaintained='Y' ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_PrintFormatItem SET PrintName='Include Nulls in BPartner', Name='Include Nulls in BPartner' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53659) ; -- Jul 10, 2008 4:42:07 PM COT -- Financial Report Source with Type Combination UPDATE AD_PrintFormatItem SET PrintName='Include Nulls in BPartner', Name='Include Nulls in BPartner' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=53659) ; -- Jul 10, 2008 4:42:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsProduct',0,TO_TIMESTAMP('2008-07-10 16:42:37','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:42:37','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Product',0,'D','Include Nulls in Product',100,'Y',53660,'Include nulls in the selection of the product') ; -- Jul 10, 2008 4:42:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53660 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:42:54 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsLocation',0,TO_TIMESTAMP('2008-07-10 16:42:53','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:42:53','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Location',0,'D','Include Nulls in Location',100,'Y',53661,'Include nulls in the selection of the location') ; -- Jul 10, 2008 4:42:55 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53661 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:43:14 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsProject',0,TO_TIMESTAMP('2008-07-10 16:43:13','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:43:13','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Project',0,'D','Include Nulls in Project',100,'Y',53662,'Include nulls in the selection of the project') ; -- Jul 10, 2008 4:43:15 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53662 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:43:34 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsSalesRegion',0,TO_TIMESTAMP('2008-07-10 16:43:33','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:43:33','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Sales Region',0,'D','Include Nulls in Sales Region',100,'Y',53663,'Include nulls in the selection of the sales region') ; -- Jul 10, 2008 4:43:34 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53663 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:43:51 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsActivity',0,TO_TIMESTAMP('2008-07-10 16:43:50','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:43:50','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Activity',0,'D','Include Nulls in Activity',100,'Y',53664,'Include nulls in the selection of the activity') ; -- Jul 10, 2008 4:43:51 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53664 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:44:05 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsCampaign',0,TO_TIMESTAMP('2008-07-10 16:44:04','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:44:04','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in Campaign',0,'D','Include Nulls in Campaign',100,'Y',53665,'Include nulls in the selection of the campaign') ; -- Jul 10, 2008 4:44:05 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53665 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:44:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsUserElement1',0,TO_TIMESTAMP('2008-07-10 16:44:22','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:44:22','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in User Element 1',0,'D','Include Nulls in User Element 1',100,'Y',53666,'Include nulls in the selection of the user element 1') ; -- Jul 10, 2008 4:44:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53666 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:44:31 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element (UpdatedBy,ColumnName,AD_Org_ID,Updated,Created,PrintName,AD_Client_ID,EntityType,Name,CreatedBy,IsActive,AD_Element_ID,Description) VALUES (100,'IsIncludeNullsUserElement2',0,TO_TIMESTAMP('2008-07-10 16:44:30','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2008-07-10 16:44:30','YYYY-MM-DD HH24:MI:SS'),'Include Nulls in User Element 2',0,'D','Include Nulls in User Element 2',100,'Y',53667,'Include nulls in the selection of the user element 2') ; -- Jul 10, 2008 4:44:31 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PrintName,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PrintName,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53667 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID) ; -- Jul 10, 2008 4:45:53 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsOrg',0,'N',0,TO_TIMESTAMP('2008-07-10 16:45:51','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:45:51','YYYY-MM-DD HH24:MI:SS'),0,56155,20,'D','Include Nulls in Org','N',100,'Y','N','Y',53657,'Include nulls in the selection of the organization','N','N') ; -- Jul 10, 2008 4:45:53 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56155 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:45:57 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsOrg CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsOrg IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:46:26 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsElementValue',0,'N',0,TO_TIMESTAMP('2008-07-10 16:46:26','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:46:26','YYYY-MM-DD HH24:MI:SS'),0,56156,20,'D','Include Nulls in Account','N',100,'Y','N','Y',53658,'Include nulls in the selection of the account','N','N') ; -- Jul 10, 2008 4:46:27 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56156 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:46:31 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsElementValue CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsElementValue IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:46:47 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsBPartner',0,'N',0,TO_TIMESTAMP('2008-07-10 16:46:46','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:46:46','YYYY-MM-DD HH24:MI:SS'),0,56157,20,'D','Include Nulls in BPartner','N',100,'Y','N','Y',53659,'Include nulls in the selection of the business partner','N','N') ; -- Jul 10, 2008 4:46:47 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56157 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:46:50 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsBPartner CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsBPartner IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:47:02 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsProduct',0,'N',0,TO_TIMESTAMP('2008-07-10 16:47:02','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:47:02','YYYY-MM-DD HH24:MI:SS'),0,56158,20,'D','Include Nulls in Product','N',100,'Y','N','Y',53660,'Include nulls in the selection of the product','N','N') ; -- Jul 10, 2008 4:47:03 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56158 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:47:04 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsProduct CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsProduct IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:47:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsLocation',0,'N',0,TO_TIMESTAMP('2008-07-10 16:47:15','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:47:15','YYYY-MM-DD HH24:MI:SS'),0,56159,20,'D','Include Nulls in Location','N',100,'Y','N','Y',53661,'Include nulls in the selection of the location','N','N') ; -- Jul 10, 2008 4:47:16 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56159 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:47:18 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsLocation CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsLocation IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:47:30 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsProject',0,'N',0,TO_TIMESTAMP('2008-07-10 16:47:29','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:47:29','YYYY-MM-DD HH24:MI:SS'),0,56160,20,'D','Include Nulls in Project','N',100,'Y','N','Y',53662,'Include nulls in the selection of the project','N','N') ; -- Jul 10, 2008 4:47:30 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56160 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:47:32 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsProject CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsProject IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:47:43 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsSalesRegion',0,'N',0,TO_TIMESTAMP('2008-07-10 16:47:42','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:47:42','YYYY-MM-DD HH24:MI:SS'),0,56161,20,'D','Include Nulls in Sales Region','N',100,'Y','N','Y',53663,'Include nulls in the selection of the sales region','N','N') ; -- Jul 10, 2008 4:47:43 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56161 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:47:45 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsSalesRegion CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsSalesRegion IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:48:04 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsActivity',0,'N',0,TO_TIMESTAMP('2008-07-10 16:48:03','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:48:03','YYYY-MM-DD HH24:MI:SS'),0,56162,20,'D','Include Nulls in Activity','N',100,'Y','N','Y',53664,'Include nulls in the selection of the activity','N','N') ; -- Jul 10, 2008 4:48:04 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56162 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:48:06 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsActivity CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsActivity IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:48:17 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsCampaign',0,'N',0,TO_TIMESTAMP('2008-07-10 16:48:16','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:48:16','YYYY-MM-DD HH24:MI:SS'),0,56163,20,'D','Include Nulls in Campaign','N',100,'Y','N','Y',53665,'Include nulls in the selection of the campaign','N','N') ; -- Jul 10, 2008 4:48:17 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56163 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:48:19 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsCampaign CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsCampaign IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:49:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsUserElement1',0,'N',0,TO_TIMESTAMP('2008-07-10 16:48:59','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:48:59','YYYY-MM-DD HH24:MI:SS'),0,56164,20,'D','Include Nulls in User Element 1','N',100,'Y','N','Y',53666,'Include nulls in the selection of the user element 1','N','N') ; -- Jul 10, 2008 4:49:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56164 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:49:03 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsUserElement1 CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsUserElement1 IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:49:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',450,0,'N','Y',1,100,'IsIncludeNullsUserElement2',0,'N',0,TO_TIMESTAMP('2008-07-10 16:49:12','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:49:12','YYYY-MM-DD HH24:MI:SS'),0,56165,20,'D','Include Nulls in User Element 2','N',100,'Y','N','Y',53667,'Include nulls in the selection of the user element 2','N','N') ; -- Jul 10, 2008 4:49:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56165 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:49:15 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportSource ADD COLUMN IsIncludeNullsUserElement2 CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsUserElement2 IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:51:52 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsOrg',0,'N',0,TO_TIMESTAMP('2008-07-10 16:51:51','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:51:51','YYYY-MM-DD HH24:MI:SS'),0,56166,20,'D','Include Nulls in Org','N',100,'Y','N','Y',53657,'Include nulls in the selection of the organization','N','N') ; -- Jul 10, 2008 4:51:52 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56166 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:51:53 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsOrg CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsOrg IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:52:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsElementValue',0,'N',0,TO_TIMESTAMP('2008-07-10 16:52:12','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:52:12','YYYY-MM-DD HH24:MI:SS'),0,56167,20,'D','Include Nulls in Account','N',100,'Y','N','Y',53658,'Include nulls in the selection of the account','N','N') ; -- Jul 10, 2008 4:52:12 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56167 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:52:14 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsElementValue CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsElementValue IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:52:32 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsBPartner',0,'N',0,TO_TIMESTAMP('2008-07-10 16:52:31','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:52:31','YYYY-MM-DD HH24:MI:SS'),0,56168,20,'D','Include Nulls in BPartner','N',100,'Y','N','Y',53659,'Include nulls in the selection of the business partner','N','N') ; -- Jul 10, 2008 4:52:32 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56168 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:52:34 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsBPartner CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsBPartner IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:52:48 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsProduct',0,'N',0,TO_TIMESTAMP('2008-07-10 16:52:46','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:52:46','YYYY-MM-DD HH24:MI:SS'),0,56169,20,'D','Include Nulls in Product','N',100,'Y','N','Y',53660,'Include nulls in the selection of the product','N','N') ; -- Jul 10, 2008 4:52:48 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56169 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:52:50 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsProduct CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsProduct IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:53:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsLocation',0,'N',0,TO_TIMESTAMP('2008-07-10 16:52:59','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:52:59','YYYY-MM-DD HH24:MI:SS'),0,56170,20,'D','Include Nulls in Location','N',100,'Y','N','Y',53661,'Include nulls in the selection of the location','N','N') ; -- Jul 10, 2008 4:53:00 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56170 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:53:01 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsLocation CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsLocation IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:53:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsProject',0,'N',0,TO_TIMESTAMP('2008-07-10 16:53:12','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:53:12','YYYY-MM-DD HH24:MI:SS'),0,56171,20,'D','Include Nulls in Project','N',100,'Y','N','Y',53662,'Include nulls in the selection of the project','N','N') ; -- Jul 10, 2008 4:53:13 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56171 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:53:14 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsProject CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsProject IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:53:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsSalesRegion',0,'N',0,TO_TIMESTAMP('2008-07-10 16:53:26','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:53:26','YYYY-MM-DD HH24:MI:SS'),0,56172,20,'D','Include Nulls in Sales Region','N',100,'Y','N','Y',53663,'Include nulls in the selection of the sales region','N','N') ; -- Jul 10, 2008 4:53:28 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56172 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:53:29 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsSalesRegion CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsSalesRegion IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:53:42 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsActivity',0,'N',0,TO_TIMESTAMP('2008-07-10 16:53:40','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:53:40','YYYY-MM-DD HH24:MI:SS'),0,56173,20,'D','Include Nulls in Activity','N',100,'Y','N','Y',53664,'Include nulls in the selection of the activity','N','N') ; -- Jul 10, 2008 4:53:42 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56173 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:53:44 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsActivity CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsActivity IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:53:54 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsCampaign',0,'N',0,TO_TIMESTAMP('2008-07-10 16:53:54','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:53:54','YYYY-MM-DD HH24:MI:SS'),0,56174,20,'D','Include Nulls in Campaign','N',100,'Y','N','Y',53665,'Include nulls in the selection of the campaign','N','N') ; -- Jul 10, 2008 4:53:55 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56174 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:53:58 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsCampaign CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsCampaign IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:54:10 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsUserElement1',0,'N',0,TO_TIMESTAMP('2008-07-10 16:54:09','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:54:09','YYYY-MM-DD HH24:MI:SS'),0,56175,20,'D','Include Nulls in User Element 1','N',100,'Y','N','Y',53666,'Include nulls in the selection of the user element 1','N','N') ; -- Jul 10, 2008 4:54:10 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56175 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:54:12 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsUserElement1 CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsUserElement1 IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:54:24 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column (IsParent,AD_Table_ID,Version,IsIdentifier,IsUpdateable,FieldLength,UpdatedBy,ColumnName,AD_Org_ID,IsSyncDatabase,SeqNo,Updated,DefaultValue,IsTranslated,Created,AD_Client_ID,AD_Column_ID,AD_Reference_ID,EntityType,Name,IsSelectionColumn,CreatedBy,IsMandatory,IsKey,IsActive,AD_Element_ID,Description,IsEncrypted,IsAlwaysUpdateable) VALUES ('N',446,0,'N','Y',1,100,'IsIncludeNullsUserElement2',0,'N',0,TO_TIMESTAMP('2008-07-10 16:54:23','YYYY-MM-DD HH24:MI:SS'),'N','N',TO_TIMESTAMP('2008-07-10 16:54:23','YYYY-MM-DD HH24:MI:SS'),0,56176,20,'D','Include Nulls in User Element 2','N',100,'Y','N','Y',53667,'Include nulls in the selection of the user element 2','N','N') ; -- Jul 10, 2008 4:54:24 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=56176 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID) ; -- Jul 10, 2008 4:54:26 PM COT -- Financial Report Source with Type Combination ALTER TABLE PA_ReportColumn ADD COLUMN IsIncludeNullsUserElement2 CHAR(1) DEFAULT 'N' CHECK (IsIncludeNullsUserElement2 IN ('Y','N')) NOT NULL ; -- Jul 10, 2008 4:55:32 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:29','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:29','YYYY-MM-DD HH24:MI:SS'),'Y',0,56156,'N','D','N','Include Nulls in Account','N',100,'Y','Y',56285,'Include nulls in the selection of the account','N') ; -- Jul 10, 2008 4:55:33 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56285 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:34 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:33','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:33','YYYY-MM-DD HH24:MI:SS'),'Y',0,56162,'N','D','N','Include Nulls in Activity','N',100,'Y','Y',56286,'Include nulls in the selection of the activity','N') ; -- Jul 10, 2008 4:55:34 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56286 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:35 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:34','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:34','YYYY-MM-DD HH24:MI:SS'),'Y',0,56157,'N','D','N','Include Nulls in BPartner','N',100,'Y','Y',56287,'Include nulls in the selection of the business partner','N') ; -- Jul 10, 2008 4:55:36 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56287 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:36 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:36','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:36','YYYY-MM-DD HH24:MI:SS'),'Y',0,56163,'N','D','N','Include Nulls in Campaign','N',100,'Y','Y',56288,'Include nulls in the selection of the campaign','N') ; -- Jul 10, 2008 4:55:36 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56288 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:37 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:36','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:36','YYYY-MM-DD HH24:MI:SS'),'Y',0,56159,'N','D','N','Include Nulls in Location','N',100,'Y','Y',56289,'Include nulls in the selection of the location','N') ; -- Jul 10, 2008 4:55:38 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56289 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:39 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:38','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:38','YYYY-MM-DD HH24:MI:SS'),'Y',0,56155,'N','D','N','Include Nulls in Org','N',100,'Y','Y',56290,'Include nulls in the selection of the organization','N') ; -- Jul 10, 2008 4:55:39 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56290 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:40 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:39','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:39','YYYY-MM-DD HH24:MI:SS'),'Y',0,56158,'N','D','N','Include Nulls in Product','N',100,'Y','Y',56291,'Include nulls in the selection of the product','N') ; -- Jul 10, 2008 4:55:41 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56291 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:43 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:41','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:41','YYYY-MM-DD HH24:MI:SS'),'Y',0,56160,'N','D','N','Include Nulls in Project','N',100,'Y','Y',56292,'Include nulls in the selection of the project','N') ; -- Jul 10, 2008 4:55:43 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56292 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:44 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:43','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:43','YYYY-MM-DD HH24:MI:SS'),'Y',0,56161,'N','D','N','Include Nulls in Sales Region','N',100,'Y','Y',56293,'Include nulls in the selection of the sales region','N') ; -- Jul 10, 2008 4:55:45 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56293 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:45 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:45','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:45','YYYY-MM-DD HH24:MI:SS'),'Y',0,56164,'N','D','N','Include Nulls in User Element 1','N',100,'Y','Y',56294,'Include nulls in the selection of the user element 1','N') ; -- Jul 10, 2008 4:55:46 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56294 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:55:47 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,377,TO_TIMESTAMP('2008-07-10 16:55:46','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:55:46','YYYY-MM-DD HH24:MI:SS'),'Y',0,56165,'N','D','N','Include Nulls in User Element 2','N',100,'Y','Y',56295,'Include nulls in the selection of the user element 2','N') ; -- Jul 10, 2008 4:55:47 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56295 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4811 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=4812 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=4813 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=4803 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=4802 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=4814 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=4804 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=4815 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=56290 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=56285 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=4816 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=56287 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=4807 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=56291 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=4808 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=56289 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=4806 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=56292 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=4809 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=56293 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=4810 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=56286 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=230,IsDisplayed='Y' WHERE AD_Field_ID=4817 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=56288 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=56283 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=56294 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=56284 ; -- Jul 10, 2008 4:57:15 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=56295 ; -- Jul 10, 2008 4:57:40 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2008-07-10 16:57:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56290 ; -- Jul 10, 2008 4:57:52 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:57:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56290 ; -- Jul 10, 2008 4:57:56 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:57:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56285 ; -- Jul 10, 2008 4:57:59 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:57:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56287 ; -- Jul 10, 2008 4:58:03 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56291 ; -- Jul 10, 2008 4:58:06 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56289 ; -- Jul 10, 2008 4:58:10 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56292 ; -- Jul 10, 2008 4:58:12 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56293 ; -- Jul 10, 2008 4:58:16 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56286 ; -- Jul 10, 2008 4:58:19 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 16:58:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56288 ; -- Jul 10, 2008 4:58:29 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO & @$Element_X1@=Y',Updated=TO_TIMESTAMP('2008-07-10 16:58:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56294 ; -- Jul 10, 2008 4:58:38 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO & @$Element_X2@=Y',Updated=TO_TIMESTAMP('2008-07-10 16:58:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56295 ; -- Jul 10, 2008 4:58:52 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 16:58:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4816 ; -- Jul 10, 2008 4:58:54 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 16:58:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4807 ; -- Jul 10, 2008 4:58:58 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 16:58:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4808 ; -- Jul 10, 2008 4:59:19 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:18','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:18','YYYY-MM-DD HH24:MI:SS'),'Y',0,56167,'N','D','N','Include Nulls in Account','N',100,'Y','Y',56296,'Include nulls in the selection of the account','N') ; -- Jul 10, 2008 4:59:20 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56296 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:21 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:20','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:20','YYYY-MM-DD HH24:MI:SS'),'Y',0,56173,'N','D','N','Include Nulls in Activity','N',100,'Y','Y',56297,'Include nulls in the selection of the activity','N') ; -- Jul 10, 2008 4:59:21 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56297 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:22 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:21','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:21','YYYY-MM-DD HH24:MI:SS'),'Y',0,56168,'N','D','N','Include Nulls in BPartner','N',100,'Y','Y',56298,'Include nulls in the selection of the business partner','N') ; -- Jul 10, 2008 4:59:22 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56298 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:22','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:22','YYYY-MM-DD HH24:MI:SS'),'Y',0,56174,'N','D','N','Include Nulls in Campaign','N',100,'Y','Y',56299,'Include nulls in the selection of the campaign','N') ; -- Jul 10, 2008 4:59:23 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56299 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:24 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:23','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:23','YYYY-MM-DD HH24:MI:SS'),'Y',0,56170,'N','D','N','Include Nulls in Location','N',100,'Y','Y',56300,'Include nulls in the selection of the location','N') ; -- Jul 10, 2008 4:59:24 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56300 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:25 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:24','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:24','YYYY-MM-DD HH24:MI:SS'),'Y',0,56166,'N','D','N','Include Nulls in Org','N',100,'Y','Y',56301,'Include nulls in the selection of the organization','N') ; -- Jul 10, 2008 4:59:25 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56301 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:26 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:25','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:25','YYYY-MM-DD HH24:MI:SS'),'Y',0,56169,'N','D','N','Include Nulls in Product','N',100,'Y','Y',56302,'Include nulls in the selection of the product','N') ; -- Jul 10, 2008 4:59:26 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56302 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:27 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:26','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:26','YYYY-MM-DD HH24:MI:SS'),'Y',0,56171,'N','D','N','Include Nulls in Project','N',100,'Y','Y',56303,'Include nulls in the selection of the project','N') ; -- Jul 10, 2008 4:59:27 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56303 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:29 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:27','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:27','YYYY-MM-DD HH24:MI:SS'),'Y',0,56172,'N','D','N','Include Nulls in Sales Region','N',100,'Y','Y',56304,'Include nulls in the selection of the sales region','N') ; -- Jul 10, 2008 4:59:29 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56304 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:30 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:29','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:29','YYYY-MM-DD HH24:MI:SS'),'Y',0,56175,'N','D','N','Include Nulls in User Element 1','N',100,'Y','Y',56305,'Include nulls in the selection of the user element 1','N') ; -- Jul 10, 2008 4:59:30 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56305 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 4:59:31 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field (IsFieldOnly,UpdatedBy,AD_Org_ID,AD_Tab_ID,Updated,DisplayLength,Created,IsCentrallyMaintained,AD_Client_ID,AD_Column_ID,IsReadOnly,EntityType,IsHeading,Name,IsSameLine,CreatedBy,IsDisplayed,IsActive,AD_Field_ID,Description,IsEncrypted) VALUES ('N',100,0,374,TO_TIMESTAMP('2008-07-10 16:59:30','YYYY-MM-DD HH24:MI:SS'),1,TO_TIMESTAMP('2008-07-10 16:59:30','YYYY-MM-DD HH24:MI:SS'),'Y',0,56176,'N','D','N','Include Nulls in User Element 2','N',100,'Y','Y',56306,'Include nulls in the selection of the user element 2','N') ; -- Jul 10, 2008 4:59:31 PM COT -- Financial Report Source with Type Combination INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Name,Description, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Name,t.Description, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=56306 AND EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Field_ID!=t.AD_Field_ID) ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=0,IsDisplayed='N' WHERE AD_Field_ID=4747 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=4748 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=4771 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=4749 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=4750 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=4751 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=4772 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=4752 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=4773 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=4753 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=4754 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=4760 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=120,IsDisplayed='Y' WHERE AD_Field_ID=4758 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=130,IsDisplayed='Y' WHERE AD_Field_ID=4774 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=140,IsDisplayed='Y' WHERE AD_Field_ID=4770 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=150,IsDisplayed='Y' WHERE AD_Field_ID=4756 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=160,IsDisplayed='Y' WHERE AD_Field_ID=4757 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=170,IsDisplayed='Y' WHERE AD_Field_ID=4759 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=180,IsDisplayed='Y' WHERE AD_Field_ID=4761 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=190,IsDisplayed='Y' WHERE AD_Field_ID=4762 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=200,IsDisplayed='Y' WHERE AD_Field_ID=4763 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=210,IsDisplayed='Y' WHERE AD_Field_ID=4764 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=220,IsDisplayed='Y' WHERE AD_Field_ID=56301 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=240,IsDisplayed='Y' WHERE AD_Field_ID=56296 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=250,IsDisplayed='Y' WHERE AD_Field_ID=4766 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=260,IsDisplayed='Y' WHERE AD_Field_ID=56302 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=270,IsDisplayed='Y' WHERE AD_Field_ID=4777 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=280,IsDisplayed='Y' WHERE AD_Field_ID=56299 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=290,IsDisplayed='Y' WHERE AD_Field_ID=4776 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=300,IsDisplayed='Y' WHERE AD_Field_ID=56298 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=310,IsDisplayed='Y' WHERE AD_Field_ID=4775 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=320,IsDisplayed='Y' WHERE AD_Field_ID=56303 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=330,IsDisplayed='Y' WHERE AD_Field_ID=4767 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=340,IsDisplayed='Y' WHERE AD_Field_ID=56300 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=350,IsDisplayed='Y' WHERE AD_Field_ID=4768 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=360,IsDisplayed='Y' WHERE AD_Field_ID=56304 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=370,IsDisplayed='Y' WHERE AD_Field_ID=4769 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=380,IsDisplayed='Y' WHERE AD_Field_ID=56297 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=390,IsDisplayed='Y' WHERE AD_Field_ID=56281 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=400,IsDisplayed='Y' WHERE AD_Field_ID=56305 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=410,IsDisplayed='Y' WHERE AD_Field_ID=56282 ; -- Jul 10, 2008 5:00:34 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET SeqNo=420,IsDisplayed='Y' WHERE AD_Field_ID=56306 ; -- Jul 10, 2008 5:04:32 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56301 ; -- Jul 10, 2008 5:04:35 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56296 ; -- Jul 10, 2008 5:04:39 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56302 ; -- Jul 10, 2008 5:04:47 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56299 ; -- Jul 10, 2008 5:04:50 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56298 ; -- Jul 10, 2008 5:04:52 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56303 ; -- Jul 10, 2008 5:04:54 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56300 ; -- Jul 10, 2008 5:04:57 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:04:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56304 ; -- Jul 10, 2008 5:05:02 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO',Updated=TO_TIMESTAMP('2008-07-10 17:05:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56297 ; -- Jul 10, 2008 5:05:09 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO & @$Element_X1@=Y',Updated=TO_TIMESTAMP('2008-07-10 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56305 ; -- Jul 10, 2008 5:05:14 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET IsSameLine='Y', DisplayLogic='@ElementType@=CO & @$Element_X2@=Y',Updated=TO_TIMESTAMP('2008-07-10 17:05:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56306 ; -- Jul 10, 2008 5:05:20 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 17:05:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4766 ; -- Jul 10, 2008 5:05:22 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 17:05:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4776 ; -- Jul 10, 2008 5:05:25 PM COT -- Financial Report Source with Type Combination UPDATE AD_Field SET DisplayLength=14,Updated=TO_TIMESTAMP('2008-07-10 17:05:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4767 ;
-- 619. 只出现一次的最大数字 -- 表 my_numbers 的 num 字段包含很多数字,其中包括很多重复的数字。 -- -- 你能写一个 SQL 查询语句,找到只出现过一次的数字中,最大的一个数字吗? -- -- +---+ -- |num| -- +---+ -- | 8 | -- | 8 | -- | 3 | -- | 3 | -- | 1 | -- | 4 | -- | 5 | -- | 6 | -- 对于上面给出的样例数据,你的查询语句应该返回如下结果: -- -- +---+ -- |num| -- +---+ -- | 6 | -- 注意: -- -- 如果没有只出现一次的数字,输出 null 。 -- -- 来源:力扣(LeetCode) -- 链接:https://leetcode-cn.com/problems/biggest-single-number -- 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 SELECT max( num ) AS num FROM ( SELECT num FROM my_numbers GROUP BY num HAVING count( * ) = 1 ) AS t
-- Vraag 1 select soort, count(*) as aantal, avg(prijs) as 'gemiddelde prijs' from planten group by soort -- Vraag 2 select kleur, min(prijs) as 'minimum prijs' from planten where soort='vast' group by kleur order by min(prijs) -- Vraag 3 select lev_code, count(*) from offertes where lev_tijd <= 10 group by lev_code -- Vraag 4 select art_code, min(off_prijs) as 'laagste prijs', max(off_prijs) as 'hoogste prijs' from offertes group by art_code -- Vraag 5 select soort, avg(prijs)as'gemiddelde prijs' from planten group by soort having count(*) >= 5 -- Vraag 6 select lev_tijd, avg(off_prijs) as 'gemiddelde prijs' from offertes group by lev_tijd -- Vraag 7 select soort, min(prijs) as 'laagste prijs' from planten where bloeibegin <= 6 and bloeieinde >= 5 group by soort
-- phpMyAdmin SQL Dump -- version 4.2.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 26 Mei 2019 pada 22.12 -- Versi Server: 5.6.21 -- PHP Version: 5.6.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `pemilu` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `amn` -- CREATE TABLE IF NOT EXISTS `amn` ( `username` varchar(50) NOT NULL, `pass` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `amn` -- INSERT INTO `amn` (`username`, `pass`) VALUES ('admin', 'admin'); -- -------------------------------------------------------- -- -- Struktur dari tabel `data_calon` -- CREATE TABLE IF NOT EXISTS `data_calon` ( `no` int(10) NOT NULL, `nik` varchar(10) NOT NULL, `nama` varchar(200) NOT NULL, `jenis_kelamin` varchar(200) NOT NULL, `telp` varchar(200) NOT NULL, `visi` varchar(200) NOT NULL, `misi` varchar(200) NOT NULL, `foto` varchar(200) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `data_calon` -- INSERT INTO `data_calon` (`no`, `nik`, `nama`, `jenis_kelamin`, `telp`, `visi`, `misi`, `foto`) VALUES (4, '1167050011', 'Agus', 'laki laki', '02589645732', 'HAHA HIHIHI', 'UIN', '260520192207102014-04-27 16.42.37.jpg'); -- -------------------------------------------------------- -- -- Struktur dari tabel `data_calon_rt` -- CREATE TABLE IF NOT EXISTS `data_calon_rt` ( `nik` varchar(200) NOT NULL, `nama` varchar(200) NOT NULL, `jenis_kelamin` varchar(200) NOT NULL, `telp` varchar(200) NOT NULL, `visi` varchar(200) NOT NULL, `misi` varchar(200) NOT NULL, `foto` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `user` -- CREATE TABLE IF NOT EXISTS `user` ( `nik` varchar(200) NOT NULL, `pass` varchar(200) NOT NULL, `verification` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `user` -- INSERT INTO `user` (`nik`, `pass`, `verification`) VALUES ('1167050011', '123456', 'biru'), ('1167050012', 'yogandiagus', 'merah'); -- -- Indexes for dumped tables -- -- -- Indexes for table `data_calon` -- ALTER TABLE `data_calon` ADD PRIMARY KEY (`no`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`nik`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `data_calon` -- ALTER TABLE `data_calon` MODIFY `no` int(10) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5; /*!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 */;
--This is a simple database for the project-- Table structure for table `courses` -- CREATE TABLE IF NOT EXISTS `courses` ( `id` int(9))
//create 8 employees for this role CREATE USER crimrecords8 IDENTIFIED BY password; //not using password expire because it doesnt work in developer CREATE ROLE c_rec_role; GRANT CREATE SESSION TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.criminals TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.crimes TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.crime_charges TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.aliases TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.officers TO c_rec_role; GRANT SELECT, INSERT, UPDATE ON student.crime_codes TO c_rec_role; //created crimrecords 1-8 and grant role GRANT c_rec_role TO crimrecords8; //create 7 employees for this role CREATE USER courtrecord7 IDENTIFIED BY password; CREATE ROLE crt_rec_role; GRANT CREATE SESSION TO crt_rec_role; GRANT SELECT, INSERT, UPDATE ON student.appeals TO crt_rec_role; GRANT SELECT, INSERT, UPDATE ON student.sentences TO crt_rec_role; GRANT SELECT, INSERT, UPDATE ON student.prob_officers TO crt_rec_role; //created courtrecord 1-7 and grant role GRANT crt_rec_role TO courtrecord7; //create 4 employees for this role CREATE USER crimeanal4 IDENTIFIED BY password; CREATE ROLE c_analysis_role; GRANT CREATE SESSION TO c_analysis_role; GRANT SELECT ANY TABLE TO c_analysis_role; //created crimeanal 1-4 and grant role GRANT c_analysis_role TO crimeanal4; CREATE USER dofficer IDENTIFIED BY passowrd; CREATE ROLE d_officer_role; GRANT CREATE SESSION TO d_officer_role; GRANT SELECT, DELETE ON student.sentences TO d_officer_role; GRANT SELECT, DELETE ON student.crimes TO d_officer_role; GRANT SELECT, DELETE ON student.crime_charges TO d_officer_role; GRANT SELECT, DELETE ON student.appeals TO d_officer_role; GRANT d_officer_role TO dofficer;
INSERT INTO questions (name, question, status) VALUES ($1, $2, 'waiting');
/* SQL Basics - How to get data from tables - Select statements - FROM clause - WHERE clause Common symbols used in WHERE statements include: > (greater than) < (less than) >= (greater than or equal to) <= (less than or equal to) = (equal to) != (not equal to) - LIKE operator - IN operator - NOT LIKE - NOT IN - AND / BETWEEN - OR */ /* SQL JOINs - A way of combining two tables information - JOIN ON clause - Multiple filters with JOIN clause JOIN region r ON r.id = s.region_id AND r.name = 'Midwest' AND s.name LIKE '% K%' -- SELECT DISTINCT */ /* SQL AGREGATIONS - Performing an operation on multiple rows in the table - AGREGATION FUNCTIONS - SUM - MIN - MAX - AVG - COUNT - GROUP BY clause (A way of segmenting data based on columns provided) - WORKING WITH DATES - DATE_TRUNC() - DATE_PART() - CASE WHEN */ /* SQL SUB_QUERIES AND TEMP TABLES - WITH AS table () - FOR TEMP TABLES */ /* SQL DATA_CLEANING - LEFT() - RIGHT() - LENGTH() - POSITION() - STRPOS() - SUBSTRING() | SUBSTR() - REPLACE() - LOWER() - UPPER() - CONCAT() - CAST() - COLASCE() */ /* SQL WINDOWS FUNCTION - OVER: is the main clause for the windows function - PARTITION BY: tells how the data is to be partitioned or grouped, if not specified, it treates all the rows as belonging to one group - ORDER BY: This orders the table by the specified column and also performs the specified aggregation function on all the data above a specific row. If not specified, then it performs the aggregation function for the whole rows in the partition. - ROW_NUMBER() - RANK() - DENSE_RANK() - LAG() AND LEAD() - USEFUL FOR ROW COMPARISION - NTILE() - -- A valid windows function syntax. -- You can specify the windows required by aliasing. Goes between the WHERE clause and the GROUP BY clause. -- You can only use windows function in SELECT clause and ORDER BY clause and no where else. SELECT account_id, COUNT(account_id) OVER w FROM orders WINDOW w AS (PARTITION BY account_id ORDER BY id), w2 AS (PARTITION BY account_id) ORDER BY COUNT(account_id) OVER w DESC, 1 */ /* SQL ADVANCED JOINS AND PERFORMANCE TUNING - FULL JOIN - LEFT JOIN - RIGHT JOIN - CROSS JOIN - WEBSITE WITH DIAGRAM OF JOIN - UNION () - NO DUPLICATES IN BOTH TABLES - UNION ALL() - STACKS EVERYTHING - PERFOMANCE TUNING - PERFORM AGREGATION BEFORE JOINING - LIMIT YOUR DATA WHEN TESTING, THEN BRING IN EVERYTHING AFTERWARDS */
CREATE TABLE Movie (id INT PRIMARY KEY, title VARCHAR(100), year INT, rating VARCHAR(10), company VARCHAR(50)); CREATE TABLE Actor (id INT PRIMARY KEY, last VARCHAR(20), first VARCHAR(20), sex VARCHAR(6), dob DATE, dod DATE); CREATE TABLE Director (id INT PRIMARY KEY, last VARCHAR(20), first VARCHAR(20), dob DATE, dod DATE); CREATE TABLE MovieGenre (mid INT PRIMARY KEY, genre VARCHAR(20)); CREATE TABLE MovieDirector (mid INT, did INT); CREATE TABLE MovieActor (mid INT, aid INT, role VARCHAR(50)); CREATE TABLE Review (name VARCHAR(20), time TIMESTAMP, mid INT, rating INT, comment VARCHAR(500)); CREATE TABLE MaxPersonID (id INT PRIMARY KEY); CREATE TABLE MaxMovieID (id INT PRIMARY KEY);
INSERT INTO persona (nombre, paterno, email) VALUES ('Admin', 'admin', 'admin@mail.com'), ('Juan', 'Perez', 'jperez@mail.com'), ('Juan', 'Rodriguez', 'jrodriguez@mail.com');
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 10-05-2018 a las 14:10:34 -- Versión del servidor: 5.6.17 -- 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: `tfg` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `atletas` -- CREATE TABLE IF NOT EXISTS `atletas` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Nombre` varchar(30) NOT NULL, `Apellidos` varchar(30) NOT NULL, `Email` varchar(30) NOT NULL, `Club_organizacion` varchar(30) NOT NULL, `Sector` varchar(30) NOT NULL, `Especialidad` varchar(30) NOT NULL, `Fecha` varchar(4) NOT NULL, `Id_entrenador` int(5) NOT NULL, `Usuario` varchar(30) NOT NULL, `Password` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Volcado de datos para la tabla `atletas` -- INSERT INTO `atletas` (`Id`, `Nombre`, `Apellidos`, `Email`, `Club_organizacion`, `Sector`, `Especialidad`, `Fecha`, `Id_entrenador`, `Usuario`, `Password`) VALUES (3, 'Albert', 'Vélez Martín', 'nuvilavelez@hotmail.com', 'F.C.Barcelona', 'Saltos', 'Salto de altura', '1988', 2, 'Nuvila', '$2y$10$yuc5ADyN6vII0r2Nm8gY/ucv4100La9.aEXTnIp13VEER72lnDqMi'), (4, 'Miquel', 'Vélez Martín', 'michi@gmail.com', 'U.A.Terrassa', 'Saltos', 'Salto de altura', '1983', 2, 'Michi', '$2y$10$zv216IINLzRAfFZieTYqDu5bZPnS9SmUrEpO0c7vU9.XE7d7BHSKK'), (5, 'Miguel Ángel', 'Sancho Rubio', 'sancho@gmail.com', 'Playas de Castellón', 'Saltos', 'Salto de altura', '1983', 2, 'Sancho', '$2y$10$iV6IathG6YRvt4Vahi0.8exwKOc4Yr/t0zYwgPFcxfIPKiyrotiHa'), (6, 'Marc', 'Pagès Corella', 'marcpages@gmail.com', 'J.A.Sabadell', 'Saltos', 'Salto de altura', '1974', 2, 'Marcp', '$2y$10$NwSUVBYpY1IkeAnNkINQX.vmo8fs01vZH0f6t4Z1DiCkmGY9BDvry'), (7, 'Alfonso', 'Badolato Martín', 'alf@gmail.com', 'Universidad de Oviedo', 'Saltos', 'Salto de altura', '1973', 3, 'Alfonso', '$2y$10$lpPEg2epUNsX1P2n2SiHAuHNnE4zjDoUqcMrc5ByeKM4sivfSTmQK'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `entrenadores` -- CREATE TABLE IF NOT EXISTS `entrenadores` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Nombre` varchar(30) NOT NULL, `Apellidos` varchar(30) NOT NULL, `Email` varchar(30) NOT NULL, `Club_organizacion` varchar(30) NOT NULL, `Sector` varchar(30) NOT NULL, `Especialidad` varchar(30) NOT NULL, `Titulacion` varchar(30) NOT NULL, `Usuario` varchar(30) NOT NULL, `Password` varchar(255) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Volcado de datos para la tabla `entrenadores` -- INSERT INTO `entrenadores` (`Id`, `Nombre`, `Apellidos`, `Email`, `Club_organizacion`, `Sector`, `Especialidad`, `Titulacion`, `Usuario`, `Password`) VALUES (2, 'Miguel', 'Vélez Blasco', 'miklos@gmail.com', 'RFEA', 'Saltos', 'Salto de altura', 'Nacional especializado', 'Miklos', '$2y$10$c.2tZDP72MdCkK.R90UExevhSb/2nf8sfhK.xvdsGjUPh0qmYSTPi'), (3, 'Hans', 'Ruf Jiménez', 'ruf@gmail.com', 'RFEA', 'Saltos', 'Salto de altura', 'Club', 'Rufina', '$2y$10$qI/PW2.VfTBnGK9dTJrhkuM3.ADEu8tmt/XduQ0Y9ZCdwOneGLJBq'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `planificacion` -- CREATE TABLE IF NOT EXISTS `planificacion` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Nombre` varchar(30) NOT NULL, `Id_entrenador` varchar(30) NOT NULL, `Temporada` varchar(30) NOT NULL, `Periodo` varchar(30) NOT NULL, `P_marcha` varchar(5) NOT NULL, `A_funcional` varchar(5) NOT NULL, `Int_p_marcha` varchar(5) NOT NULL, `Int_a_funcional` varchar(5) NOT NULL, `Prep_general` varchar(5) NOT NULL, `Fuerza` varchar(5) NOT NULL, `F_velocidad` varchar(5) NOT NULL, `Int_fuerza` varchar(5) NOT NULL, `Int_f_velocidad` varchar(5) NOT NULL, `Prep_especial` varchar(5) NOT NULL, `V_tecnica` varchar(5) NOT NULL, `M_competitiva` varchar(5) NOT NULL, `Int_v_tecnica` varchar(5) NOT NULL, `Int_m_competitiva` varchar(5) NOT NULL, `Prep_tecnica` varchar(5) NOT NULL, `Competitivo` varchar(5) NOT NULL, `Int_competitivo` varchar(5) NOT NULL, `Per_competitivo` varchar(5) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Volcado de datos para la tabla `planificacion` -- INSERT INTO `planificacion` (`Id`, `Nombre`, `Id_entrenador`, `Temporada`, `Periodo`, `P_marcha`, `A_funcional`, `Int_p_marcha`, `Int_a_funcional`, `Prep_general`, `Fuerza`, `F_velocidad`, `Int_fuerza`, `Int_f_velocidad`, `Prep_especial`, `V_tecnica`, `M_competitiva`, `Int_v_tecnica`, `Int_m_competitiva`, `Prep_tecnica`, `Competitivo`, `Int_competitivo`, `Per_competitivo`) VALUES (1, 'Plan1', 'Miklos', '2017/2018', 'Aire libre', '0', '2', '0', '1', '1', '4', '4', '2', '3', '1', '3', '3', '4', '4', '1', '8', '5', '1'), (2, 'Plan2', 'Miklos', '2018/2019', 'Pista cubierta', '2', '3', '1', '2', '1', '4', '4', '3', '3', '1', '4', '0', '4', '0', '1', '6', '5', '1'), (3, 'plan3', 'Miklos', '2020/2021', 'Pista cubierta', '2', '4', '1', '1', '1', '4', '4', '2', '3', '1', '3', '0', '4', '0', '1', '7', '5', '1'), (4, 'plan4auto', 'Miklos', '2019/2020', 'Aire libre', '0', '0', '0', '0', '0', '3', '3', '2', '3', '1', '3', '2', '4', '4', '1', '4', '5', '1'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `resultados_atleta` -- CREATE TABLE IF NOT EXISTS `resultados_atleta` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Id_atleta` int(5) NOT NULL, `Fecha` varchar(20) NOT NULL, `Competicion` varchar(30) NOT NULL, `Lugar` varchar(30) NOT NULL, `Posicion` varchar(4) NOT NULL, `Prueba` varchar(30) NOT NULL, `Marca` varchar(10) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Volcado de datos para la tabla `resultados_atleta` -- INSERT INTO `resultados_atleta` (`Id`, `Id_atleta`, `Fecha`, `Competicion`, `Lugar`, `Posicion`, `Prueba`, `Marca`) VALUES (1, 3, '20/10/2011', 'C. de España', 'Madrid', '1º', 'Salto de altura', '2.16'), (2, 3, '15/11/2011', 'C. Cataluña', 'Barcelona', '2º', 'Salto de altura', '2.05'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `semana_mesociclo` -- CREATE TABLE IF NOT EXISTS `semana_mesociclo` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Id_planificacion` int(5) NOT NULL, `Mesociclo` varchar(30) NOT NULL, `Semana` varchar(30) NOT NULL, `Dia` varchar(30) NOT NULL, `U_entrenamiento1` varchar(10) NOT NULL, `U_entrenamiento2` varchar(10) NOT NULL, `U_entrenamiento3` varchar(10) NOT NULL, `U_entrenamiento4` varchar(10) NOT NULL, `U_entrenamiento5` varchar(10) NOT NULL, `U_entrenamiento6` varchar(10) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=29 ; -- -- Volcado de datos para la tabla `semana_mesociclo` -- INSERT INTO `semana_mesociclo` (`Id`, `Id_planificacion`, `Mesociclo`, `Semana`, `Dia`, `U_entrenamiento1`, `U_entrenamiento2`, `U_entrenamiento3`, `U_entrenamiento4`, `U_entrenamiento5`, `U_entrenamiento6`) VALUES (1, 3, 'Puesta en marcha', '1', 'Lunes', 'ROD', 'F1', '---', 'MV', '---', '---'), (2, 3, 'Puesta en marcha', '1', 'Martes', 'ET', 'T', '---', '---', '---', '---'), (3, 3, 'Puesta en marcha', '1', 'Miércoles', 'ROD', 'F2', '---', 'MH', '---', '---'), (4, 3, 'Puesta en marcha', '1', 'Jueves', 'ROD', '---', '---', '---', '---', '---'), (5, 3, 'Puesta en marcha', '1', 'Viernes', 'ET', 'T', '---', '---', '---', '---'), (6, 3, 'Puesta en marcha', '1', 'Sábado', 'ROD', 'MN', '---', '---', '---', '---'), (7, 3, 'Puesta en marcha', '1', 'Domingo', '---', '---', '---', '---', '---', '---'), (8, 2, 'Competitivo', '23', 'Lunes', 'F1', '---', '---', 'F2', '---', '---'), (9, 2, 'Competitivo', '23', 'Martes', 'MN', '---', '---', 'MH', '---', '---'), (10, 2, 'Competitivo', '23', 'Miércoles', 'MV', '---', '---', 'ROD', '---', '---'), (11, 2, 'Competitivo', '23', 'Jueves', 'CR', '---', '---', 'VEL', '---', '---'), (12, 2, 'Competitivo', '23', 'Viernes', 'CUE', '---', '---', 'ARR', '---', '---'), (13, 2, 'Competitivo', '23', 'Sábado', 'ET', '---', '---', 'T', '---', '---'), (14, 2, 'Competitivo', '23', 'Domingo', 'F1', '---', '---', 'F2', '---', '---'), (15, 1, 'Modelación competitiva', '16', 'Lunes', 'F1', '---', '---', 'MN', '---', '---'), (16, 1, 'Modelación competitiva', '16', 'Martes', 'F1', '---', '---', 'MN', '---', '---'), (17, 1, 'Modelación competitiva', '16', 'Miércoles', 'F1', '---', '---', 'MN', '---', '---'), (18, 1, 'Modelación competitiva', '16', 'Jueves', 'F1', '---', '---', 'MN', '---', '---'), (19, 1, 'Modelación competitiva', '16', 'Viernes', 'MH', '---', '---', 'ROD', '---', '---'), (20, 1, 'Modelación competitiva', '16', 'Sábado', 'MH', '---', '---', 'ROD', '---', '---'), (21, 1, 'Modelación competitiva', '16', 'Domingo', 'MH', '---', '---', 'ROD', '---', '---'), (22, 2, 'Adaptación funcional', '5', 'Lunes', 'F1', 'F2', 'MN', 'MH', 'MV', '---'), (23, 2, 'Adaptación funcional', '5', 'Martes', 'ROD', 'CR', 'VEL', 'ET', 'T', '---'), (24, 2, 'Adaptación funcional', '5', 'Miércoles', '---', '---', '---', '---', '---', '---'), (25, 2, 'Adaptación funcional', '5', 'Jueves', '---', '---', '---', '---', '---', '---'), (26, 2, 'Adaptación funcional', '5', 'Viernes', '---', '---', '---', '---', '---', '---'), (27, 2, 'Adaptación funcional', '5', 'Sábado', '---', '---', '---', '---', '---', '---'), (28, 2, 'Adaptación funcional', '5', 'Domingo', 'T', '---', '---', '---', '---', '---'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `volumenes_planificacion` -- CREATE TABLE IF NOT EXISTS `volumenes_planificacion` ( `Id` int(5) NOT NULL AUTO_INCREMENT, `Id_planificacion` int(5) NOT NULL, `Ciclo` varchar(30) NOT NULL, `Mesociclo` varchar(30) NOT NULL, `Semana` varchar(5) NOT NULL, `Volumen` int(5) NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=87 ; -- -- Volcado de datos para la tabla `volumenes_planificacion` -- INSERT INTO `volumenes_planificacion` (`Id`, `Id_planificacion`, `Ciclo`, `Mesociclo`, `Semana`, `Volumen`) VALUES (1, 1, 'Preparación General', 'Adaptación funcional', '1', 50), (2, 1, 'Preparación General', 'Adaptación funcional', '2', 60), (3, 1, 'Preparación Especial', 'Fuerza', '3', 60), (4, 1, 'Preparación Especial', 'Fuerza', '4', 70), (5, 1, 'Preparación Especial', 'Fuerza', '5', 80), (6, 1, 'Preparación Especial', 'Fuerza', '6', 60), (7, 1, 'Preparación Especial', 'Fuerza velocidad', '7', 60), (8, 1, 'Preparación Especial', 'Fuerza velocidad', '8', 80), (9, 1, 'Preparación Especial', 'Fuerza velocidad', '9', 90), (10, 1, 'Preparación Especial', 'Fuerza velocidad', '10', 60), (11, 1, 'Preparación Técnica', 'Velocidad técnica', '11', 70), (12, 1, 'Preparación Técnica', 'Velocidad técnica', '12', 90), (13, 1, 'Preparación Técnica', 'Velocidad técnica', '13', 100), (14, 1, 'Preparación Técnica', 'Modelación competitiva', '14', 80), (15, 1, 'Preparación Técnica', 'Modelación competitiva', '15', 60), (16, 1, 'Preparación Técnica', 'Modelación competitiva', '16', 50), (17, 1, 'Periodo Competitivo', 'Competitivo', '17', 40), (18, 1, 'Periodo Competitivo', 'Competitivo', '18', 40), (19, 1, 'Periodo Competitivo', 'Competitivo', '19', 40), (20, 1, 'Periodo Competitivo', 'Competitivo', '20', 40), (21, 1, 'Periodo Competitivo', 'Competitivo', '21', 40), (22, 1, 'Periodo Competitivo', 'Competitivo', '22', 40), (23, 1, 'Periodo Competitivo', 'Competitivo', '23', 40), (24, 1, 'Periodo Competitivo', 'Competitivo', '24', 40), (25, 2, 'Preparación General', 'Puesta en marcha', '1', 50), (26, 2, 'Preparación General', 'Puesta en marcha', '2', 60), (27, 2, 'Preparación General', 'Adaptación funcional', '3', 70), (28, 2, 'Preparación General', 'Adaptación funcional', '4', 80), (29, 2, 'Preparación General', 'Adaptación funcional', '5', 90), (30, 2, 'Preparación Especial', 'Fuerza', '6', 70), (31, 2, 'Preparación Especial', 'Fuerza', '7', 100), (32, 2, 'Preparación Especial', 'Fuerza', '8', 90), (33, 2, 'Preparación Especial', 'Fuerza', '9', 50), (34, 2, 'Preparación Especial', 'Fuerza velocidad', '10', 70), (35, 2, 'Preparación Especial', 'Fuerza velocidad', '11', 100), (36, 2, 'Preparación Especial', 'Fuerza velocidad', '12', 70), (37, 2, 'Preparación Especial', 'Fuerza velocidad', '13', 50), (38, 2, 'Preparación Técnica', 'Velocidad técnica', '14', 90), (39, 2, 'Preparación Técnica', 'Velocidad técnica', '15', 70), (40, 2, 'Preparación Técnica', 'Velocidad técnica', '16', 80), (41, 2, 'Preparación Técnica', 'Velocidad técnica', '17', 50), (42, 2, 'Periodo Competitivo', 'Competitivo', '18', 40), (43, 2, 'Periodo Competitivo', 'Competitivo', '19', 40), (44, 2, 'Periodo Competitivo', 'Competitivo', '20', 40), (45, 2, 'Periodo Competitivo', 'Competitivo', '21', 30), (46, 2, 'Periodo Competitivo', 'Competitivo', '22', 30), (47, 2, 'Periodo Competitivo', 'Competitivo', '23', 30), (48, 3, 'Preparación General', 'Puesta en marcha', '1', 50), (49, 3, 'Preparación General', 'Puesta en marcha', '2', 60), (50, 3, 'Preparación General', 'Adaptación funcional', '3', 70), (51, 3, 'Preparación General', 'Adaptación funcional', '4', 80), (52, 3, 'Preparación General', 'Adaptación funcional', '5', 90), (53, 3, 'Preparación General', 'Adaptación funcional', '6', 90), (54, 3, 'Preparación Especial', 'Fuerza', '7', 100), (55, 3, 'Preparación Especial', 'Fuerza', '8', 100), (56, 3, 'Preparación Especial', 'Fuerza', '9', 100), (57, 3, 'Preparación Especial', 'Fuerza', '10', 100), (58, 3, 'Preparación Especial', 'Fuerza velocidad', '11', 100), (59, 3, 'Preparación Especial', 'Fuerza velocidad', '12', 100), (60, 3, 'Preparación Especial', 'Fuerza velocidad', '13', 90), (61, 3, 'Preparación Especial', 'Fuerza velocidad', '14', 90), (62, 3, 'Preparación Técnica', 'Velocidad técnica', '15', 80), (63, 3, 'Preparación Técnica', 'Velocidad técnica', '16', 70), (64, 3, 'Preparación Técnica', 'Velocidad técnica', '17', 60), (65, 3, 'Periodo Competitivo', 'Competitivo', '18', 40), (66, 3, 'Periodo Competitivo', 'Competitivo', '19', 40), (67, 3, 'Periodo Competitivo', 'Competitivo', '20', 40), (68, 3, 'Periodo Competitivo', 'Competitivo', '21', 40), (69, 3, 'Periodo Competitivo', 'Competitivo', '22', 40), (70, 3, 'Periodo Competitivo', 'Competitivo', '23', 40), (71, 3, 'Periodo Competitivo', 'Competitivo', '24', 40), (72, 4, 'Preparación Especial', 'Fuerza', '1', 70), (73, 4, 'Preparación Especial', 'Fuerza', '2', 90), (74, 4, 'Preparación Especial', 'Fuerza', '3', 100), (75, 4, 'Preparación Especial', 'Fuerza velocidad', '4', 70), (76, 4, 'Preparación Especial', 'Fuerza velocidad', '5', 100), (77, 4, 'Preparación Especial', 'Fuerza velocidad', '6', 80), (78, 4, 'Preparación Técnica', 'Velocidad técnica', '7', 100), (79, 4, 'Preparación Técnica', 'Velocidad técnica', '8', 70), (80, 4, 'Preparación Técnica', 'Velocidad técnica', '9', 80), (81, 4, 'Preparación Técnica', 'Modelación competitiva', '10', 70), (82, 4, 'Preparación Técnica', 'Modelación competitiva', '11', 50), (83, 4, 'Periodo Competitivo', 'Competitivo', '12', 40), (84, 4, 'Periodo Competitivo', 'Competitivo', '13', 40), (85, 4, 'Periodo Competitivo', 'Competitivo', '14', 40), (86, 4, 'Periodo Competitivo', 'Competitivo', '15', 40); /*!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 */;
##1 Write a query that returns all employees (emp_no), their department number, their start date, their end date, and a new column 'is_current_employee' that is a 1 if the employee is still with the company and 0 if not. SELECT dept_emp.emp_no, dept_no, hire_date, to_date, IF(to_date > '9999-01-01', TRUE, FALSE) AS current_employee FROM dept_emp JOIN (SELECT emp_no, MAX(to_date) AS max_date FROM dept_emp GROUP BY emp_no) AS last_dept ON dept_emp.emp_no = last_dept.emp_no AND dept_emp.to_date = last_dept.max_date JOIN employees AS e ON e.emp_no = dept_emp.emp_no; ##2Write a query that returns all employee names (previous and current), and a new column 'alpha_group' that returns 'A-H', 'I-Q', or 'R-Z' depending on the first letter of their last name. SELECT CONCAT(first_name, ' ', last_name) AS employee_name, CASE WHEN LEFT(last_name, 1) IN('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h') THEN 'A-H' WHEN LEFT(last_name, 1) IN('i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q') THEN 'I-Q' ELSE 'R-Z' END AS main_group FROM employees; ## 3.How many employees (current or previous) were born in each decade? SELECT * FROM employees ORDER BY birth_date ASC; SELECT CASE WHEN birth_date LIKE '195%' THEN '50s' WHEN birth_date LIKE '196%' THEN '60s' ELSE 'young generations' END AS decade, COUNT(*) FROM employees GROUP BY decade;
CREATE PROCEDURE pr_GetOrderSummary ( @StartDate DATE, @EndDate DATE, @EmployeeID INT, @CustomerID NCHAR(10) ) AS -------------------------------------------------------------------------------------------------------------------- -- Purpose: Generate an Order Summary for the suppied parameters -------------------------------------------------------------------------------------------------------------------- BEGIN SELECT E.TitleOfCourtesy + ' ' + E.FirstName + ' ' + E.LastName AS [EmployeeFullName] ,S.CompanyName AS [Shipper] ,C.CompanyName AS [Customer] ,COUNT(distinct O.OrderId) AS [NumberOfOders] ,O.OrderDate AS [Date] ,O.Freight AS [TotalFreightCost] ,COUNT(OD.ProductID) AS [NumberOfDifferentProducts] ,ROUND((SUM((OD.UnitPrice * OD.Quantity) - (OD.Quantity * OD.Discount)) + O.Freight),2) [TotalOrderValue] -- dbo.udf_GetTotal(O.OrderID) function can be used instead, but inline functions are not efficient. FROM dbo.Employees E JOIN dbo.Orders O ON E.EmployeeID = O.EmployeeID JOIN dbo.Customers C ON C.CustomerID = O.CustomerID JOIN dbo.Shippers S ON S.ShipperID = O.ShipVia JOIN dbo.[Order Details] OD ON OD.OrderID = O.OrderID WHERE O.OrderDate between @StartDate AND @EndDate AND E.EmployeeID = CASE WHEN @EmployeeID IS NULL THEN E.EmployeeID ELSE @EmployeeID END AND C.CustomerID = CASE WHEN @CustomerID IS NULL ThEN C.CustomerID ELSE @CustomerID END GROUP BY O.OrderDate, E.TitleOfCourtesy, E.FirstName, E.LastName, S.CompanyName, C.CompanyName,O.Freight END
/* SQLyog Ultimate v10.42 MySQL - 5.6.14-log : Database - flamenco ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`flamenco` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `flamenco`; /*Table structure for table `course` */ DROP TABLE IF EXISTS `course`; CREATE TABLE `course` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `created` datetime NOT NULL, `modified` datetime DEFAULT NULL, `deleted` tinyint(1) DEFAULT '0', `title` varchar(255) CHARACTER SET utf8 NOT NULL, `color` varchar(7) CHARACTER SET utf8 DEFAULT '#bababa', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*Data for the table `course` */ insert into `course`(`id`,`created`,`modified`,`deleted`,`title`,`color`) values (1,'2013-07-28 13:46:13',NULL,0,'Кастаньеты','#ffe9a8'),(2,'2013-07-31 16:52:40',NULL,0,'Розовая Пантера','#ebfffc'),(3,'2013-07-31 16:58:02',NULL,0,'Фламенко','#d8ffd6'),(4,'2013-07-31 16:52:40',NULL,0,'розовая Пантера','#ebfffc'),(5,'2013-07-31 16:52:40',NULL,0,'розовая Пантера','#ebfffc'),(6,'2013-07-31 16:52:40',NULL,0,'розовая Пантера','#ebfffc'),(7,'2013-07-31 16:52:40',NULL,0,'Розовая Пантера','#ebfffc'),(8,'0000-00-00 00:00:00',NULL,0,'goo','#bababa'),(9,'0000-00-00 00:00:00',NULL,0,'goo','#bababa'),(10,'0000-00-00 00:00:00',NULL,0,'Goo','#bababa'),(11,'0000-00-00 00:00:00',NULL,0,'Goo','#bababa'),(12,'0000-00-00 00:00:00',NULL,0,'Goo','#bababa'),(13,'2013-07-31 16:52:40',NULL,0,'Розовая Пантера','#ebfffc'),(14,'2013-07-31 16:52:40',NULL,0,'Розовая Пантера','#ebfffc'); /*Table structure for table `person` */ DROP TABLE IF EXISTS `person`; CREATE TABLE `person` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `created` datetime NOT NULL, `modified` datetime DEFAULT NULL, `deleted` tinyint(1) DEFAULT '0', `name` varchar(150) NOT NULL, `last_name` varchar(150) NOT NULL, `third_name` varchar(150) DEFAULT NULL, `notes` text, `is_teacher` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; /*Data for the table `person` */ insert into `person`(`id`,`created`,`modified`,`deleted`,`name`,`last_name`,`third_name`,`notes`,`is_teacher`) values (1,'2013-07-04 16:38:24',NULL,0,'Учитель','Волочкова','Давыдовна','Что-то важное.',1),(2,'2013-07-04 16:38:24',NULL,0,'Екатерина','Волочкова','Давыдовна','Что-то важное.',0),(3,'2013-07-04 16:38:24',NULL,0,'София','Брунькова','Семеньядевна','Что-то важное.',0),(4,'2013-07-04 16:38:24',NULL,0,'Просковья','Ларьева','Денисовна',NULL,0),(5,'2013-07-04 16:38:24',NULL,0,'Маша','Эльгиева','Герундиевна',NULL,0),(6,'2013-07-04 16:38:24',NULL,0,'Учитель','Ларьева','Денисовна',NULL,1); /*Table structure for table `ticket` */ DROP TABLE IF EXISTS `ticket`; CREATE TABLE `ticket` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `created` datetime NOT NULL, `modified` datetime DEFAULT NULL, `deleted` tinyint(1) DEFAULT '0', `person_id` int(11) unsigned NOT NULL, `date_from` date NOT NULL, `days` tinyint(3) unsigned NOT NULL DEFAULT '8', PRIMARY KEY (`id`), KEY `ticket2person` (`person_id`), CONSTRAINT `ticket2person` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; /*Data for the table `ticket` */ insert into `ticket`(`id`,`created`,`modified`,`deleted`,`person_id`,`date_from`,`days`) values (7,'2013-07-25 12:04:50','2013-07-31 11:38:59',0,2,'2013-07-05',2),(9,'2013-07-27 22:37:42','2013-07-27 22:37:42',0,2,'2013-07-06',8),(16,'2013-07-31 11:35:31','2013-07-31 11:35:31',1,2,'2013-07-31',8); /*Table structure for table `ticket2course` */ DROP TABLE IF EXISTS `ticket2course`; CREATE TABLE `ticket2course` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `ticket_id` int(11) unsigned NOT NULL, `course_id` int(11) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `ticket2course2ticket` (`ticket_id`), KEY `ticket2course2course` (`course_id`), CONSTRAINT `ticket2course2course` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `ticket2course2ticket` FOREIGN KEY (`ticket_id`) REFERENCES `ticket` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `ticket2course` */ /*Table structure for table `times` */ DROP TABLE IF EXISTS `times`; CREATE TABLE `times` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `time` time NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*Data for the table `times` */ insert into `times`(`id`,`time`) values (1,'14:00:00'),(2,'15:30:00'),(3,'21:00:00'); /*Table structure for table `visit` */ DROP TABLE IF EXISTS `visit`; CREATE TABLE `visit` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `created` datetime NOT NULL, `deleted` tinyint(1) DEFAULT '0', `person_id` int(11) unsigned NOT NULL, `teacher_id` int(11) unsigned NOT NULL, `course_id` int(11) unsigned NOT NULL, `date` date NOT NULL, `time_id` int(11) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `visit2person` (`person_id`), KEY `visit2teacher` (`teacher_id`), KEY `visit2course` (`course_id`), KEY `visit2schedule` (`time_id`), CONSTRAINT `visit2course` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `visit2person` FOREIGN KEY (`person_id`) REFERENCES `person` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `visit2schedule` FOREIGN KEY (`time_id`) REFERENCES `times` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `visit2teacher` FOREIGN KEY (`teacher_id`) REFERENCES `person` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `visit` */ /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
set echo on -- Create Toad User CREATE USER TOAD IDENTIFIED BY VALUES '1020304050BA3F6EC3E3CE0C' DEFAULT TABLESPACE SYSAUX TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; -- 5 Roles for TOAD GRANT CONNECT TO TOAD; GRANT RESOURCE TO TOAD; ALTER USER TOAD DEFAULT ROLE ALL; GRANT UNLIMITED TABLESPACE TO TOAD; GRANT SELECT ON SYS.DBA_OBJECTS TO TOAD; GRANT SELECT ON SYS.DBA_SOURCE TO TOAD; GRANT SELECT ON SYS.DBA_TRIGGERS TO TOAD; -------------------------------- -- Create Quest SQLab Role -------------------------------- CREATE ROLE QUEST_SL_SQLAB_ROLE; CREATE OR REPLACE PUBLIC SYNONYM QUEST_SL_EXPLAIN FOR TOAD.QUEST_SL_EXPLAIN; CREATE or replace PUBLIC SYNONYM TOAD_PLAN_SQL FOR TOAD.TOAD_PLAN_SQL; CREATE or replace PUBLIC SYNONYM TOAD_PLAN_TABLE FOR TOAD.TOAD_PLAN_TABLE; GRANT SELECT ON SYS.V_$INSTANCE TO QUEST_SL_SQLAB_ROLE; GRANT SELECT ON SYS.V_$MYSTAT TO QUEST_SL_SQLAB_ROLE; GRANT SELECT ON SYS.V_$PARAMETER TO QUEST_SL_SQLAB_ROLE; GRANT SELECT ON SYS.V_$PROCESS TO QUEST_SL_SQLAB_ROLE; GRANT SELECT ON SYS.V_$SESSION TO QUEST_SL_SQLAB_ROLE; GRANT SELECT ON SYS.V_$STATNAME TO QUEST_SL_SQLAB_ROLE; ----------------------------- -- Create Toad Tables ----------------------------- @$AUTO_CONN toad CREATE TABLE toad_plan_sql ( username VARCHAR2(30), statement_id VARCHAR2(32), timestamp DATE, statement VARCHAR2(2000) ); CREATE UNIQUE INDEX tpsql_idx ON toad_plan_sql ( STATEMENT_ID ); CREATE TABLE toad_plan_table ( statement_id VARCHAR2(32), timestamp DATE, remarks VARCHAR2(80), operation VARCHAR2(30), options VARCHAR2(30), object_node VARCHAR2(128), object_owner VARCHAR2(30), object_name VARCHAR2(30), object_instance NUMBER, object_type VARCHAR2(30), search_columns NUMBER, id NUMBER, cost NUMBER, parent_id NUMBER, position NUMBER, cardinality NUMBER, optimizer VARCHAR2(255), bytes NUMBER, other_tag VARCHAR2(255), partition_id NUMBER, partition_start VARCHAR2(255), partition_stop VARCHAR2(255), distribution VARCHAR2(30), other LONG); CREATE INDEX tptbl_idx ON toad_plan_table ( STATEMENT_ID ); CREATE TABLE quest_sl_explain ( statement_id VARCHAR2(60), timestamp DATE, remarks VARCHAR2(2000), operation VARCHAR2(30), options VARCHAR2(30), object_node VARCHAR2(128), object_owner VARCHAR2(30), object_name VARCHAR2(30), object_instance NUMBER(*,0), object_type VARCHAR2(30), search_columns NUMBER(*,0), id NUMBER(*,0), parent_id NUMBER(*,0), position NUMBER(*,0), other LONG, collector VARCHAR2(31), address VARCHAR2(16), hash_value NUMBER, optimizer VARCHAR2(255), cost NUMBER(*,0), cardinality NUMBER(*,0), bytes NUMBER(*,0), other_tag VARCHAR2(255), join_text VARCHAR2(1000), filter_text VARCHAR2(1000), view_text VARCHAR2(1000), partition_start VARCHAR2(255), partition_stop VARCHAR2(255), partition_id NUMBER(*,0), distribution VARCHAR2(30), cpu_cost NUMBER(*,0), io_cost NUMBER(*,0), temp_space NUMBER(*,0), access_predicates VARCHAR2(2000), filter_predicates VARCHAR2(2000)); CREATE INDEX quest_sl_explain_n1 ON quest_sl_explain (collector ASC,id ASC ); CREATE UNIQUE INDEX quest_sl_explain_u1 ON quest_sl_explain (statement_id ASC, parent_id ASC, id ASC); -------------------- -- Grants -------------------- grant select, insert, update, delete on quest_sl_explain to public; grant select, insert, update, delete on quest_sl_explain to public; GRANT SELECT, INSERT, UPDATE, DELETE ON TOAD_PLAN_SQL TO PUBLIC; GRANT SELECT, INSERT, UPDATE, DELETE ON TOAD_PLAN_TABLE TO PUBLIC; CREATE TABLE TOAD.TOAD_RESTRICTIONS ( USER_NAME VARCHAR2(32 BYTE) NOT NULL, FEATURE VARCHAR2(20 BYTE) NOT NULL ) TABLESPACE SYSAUX; CREATE UNIQUE INDEX TOAD.TOAD_RES_PK ON TOAD.TOAD_RESTRICTIONS (FEATURE, USER_NAME) TABLESPACE SYSAUX; ALTER TABLE TOAD.TOAD_RESTRICTIONS ADD CONSTRAINT TOAD_RES_PK PRIMARY KEY (FEATURE, USER_NAME) USING INDEX ; GRANT SELECT ON TOAD.TOAD_RESTRICTIONS TO PUBLIC; GRANT ALTER, DELETE, INDEX, INSERT, REFERENCES, SELECT, UPDATE ON TOAD.TOAD_RESTRICTIONS TO SYSTEM WITH GRANT OPTION; conn / CREATE PUBLIC SYNONYM TOAD_RESTRICTIONS FOR TOAD.TOAD_RESTRICTIONS; create role no_toad_role; grant no_toad_role to AAM_USER ; grant no_toad_role to AAM_WORK ; grant no_toad_role to ACMS_USER ; grant no_toad_role to ACMS_WORK ; grant no_toad_role to AFL_USER ; grant no_toad_role to AFL_WORK ; grant no_toad_role to ANONYMOUS ; grant no_toad_role to AUTHWORK ; grant no_toad_role to BC_ALFRESCO_WORK ; grant no_toad_role to CNV_DOWNLOAD_BATCH ; grant no_toad_role to CTXSYS ; grant no_toad_role to DBA_OPER ; grant no_toad_role to DBSNMP ; grant no_toad_role to DIP ; grant no_toad_role to DLV_USER ; grant no_toad_role to DLV_WORK ; grant no_toad_role to EAI_USER ; grant no_toad_role to EAI_WORK ; grant no_toad_role to OP_USER ; grant no_toad_role to OP_WORK ; grant no_toad_role to OUTLN ; grant no_toad_role to PARAM_WORK ; grant no_toad_role to PC_USER ; grant no_toad_role to PC_WORK ; grant no_toad_role to PD_USER ; grant no_toad_role to PD_WORK ; grant no_toad_role to PERFSTAT ; grant no_toad_role to REFREAD ; grant no_toad_role to REFRESH_MNGR ; grant no_toad_role to REFWORK ; grant no_toad_role to REF_APPL ; grant no_toad_role to REF_UPDATE ; grant no_toad_role to SO_USER ; grant no_toad_role to SO_WORK ; grant no_toad_role to TOAD ; grant no_toad_role to UAMS_WORK ; grant no_toad_role to XDB ;
INSERT INTO estado (id, nome, uf) VALUES (1, 'Acre', 'AC'); INSERT INTO estado (id, nome, uf) values (2, 'Alagoas', 'AL'); INSERT INTO estado (id, nome, uf) values (3, 'Amazonas', 'AM'); INSERT INTO cidade (id, nome, estado_id) VALUES (1, 'Afonso Cláudio', 1); INSERT INTO cidade (id, nome, estado_id) values (2, 'Água Doce do Norte', 1); INSERT INTO cidade (id, nome, estado_id) values (3, 'Águia Branca', 2); INSERT INTO bairro (id, nome, cidade_id) VALUES (1, 'Aurenny I', 1); INSERT INTO bairro (id, nome, cidade_id) VALUES (2, 'Aurenny II', 1); INSERT INTO bairro (id, nome, cidade_id) VALUES (3, 'Aurenny III', 2); INSERT INTO bairro (id, nome, cidade_id) VALUES (4, 'Taquaralto', 3); INSERT INTO hotel (id, nome, bairro_id) VALUES (1, 'Mob Choir', 1); INSERT INTO hotel (id, nome, bairro_id) VALUES (2, 'Tenshi no Thesis', 2); INSERT INTO hotel (id, nome, bairro_id) VALUES (3, 'Impact', 3); INSERT INTO hotel (id, nome, bairro_id) VALUES (4, 'Howling', 4); INSERT INTO hotelquarto (quartoNum, andar, totalCamas, preco, hotel_id) VALUES ( 1, 1, 1, 150, 1);
INSERT INTO ORDERS (ORDER_ID) VALUES ('0f6011c9-fe19-45a1-86fa-421641447172'); INSERT INTO ORDERS (ORDER_ID) VALUES ('3de0c8ac-4ad3-40ef-8a19-10c932e7e260'); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('ae1666d6-6100-4ef0-9037-b45dd0d5bb0e', 'adipisicing culpa Lorem laboris adipisicing', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('22d580fc-d02e-4f70-9980-f9693c18f6e0', 'dolore aliqua sint ipsum laboris', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('d02b58ae-8731-451c-9acb-1941adf88501', 'ullamco do voluptate cillum amet', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('8d80c009-b3be-4d9d-95ba-cec1e7a2d52b', 'Lorem sint adipisicing consectetur anim', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('12494472-c905-4ac0-a133-5ebb3b4751e4', 'excepteur eiusmod cupidatat in amet', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('302bbd26-2d64-40f1-9f53-dd3a6e858e05', 'do esse amet dolor Lorem', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('b6e8c865-2221-4435-9a65-d30ca0a63701', 'ad laborum pariatur consequat commodo', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('7bcffbdf-2fcc-4a63-9a16-e9439575a473', 'Lorem do reprehenderit aliqua esse', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('172d3d74-99c4-43cd-a7c3-d6df4017402d', 'in aliqua est duis excepteur', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('58716995-b335-4bb0-89c1-3503bc003118', 'nulla qui proident consectetur occaecat', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('e415e3af-e87e-47e6-9bf2-f08c72e2f281', 'Lorem esse nostrud irure tempor', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('a5242079-0f51-4fd5-9066-bde39f569587', 'nisi ex est elit magna', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('a1aa23bc-cee9-449e-afde-7c64a32f04f1', 'labore occaecat consequat incididunt officia', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('eff2f24e-9ca2-4b8d-a5ae-3aba16c219f5', 'non ea consequat veniam fugiat', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('623d6650-5d98-457d-aacc-deba222f5cde', 'occaecat laborum officia ad ipsum', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('93136a2b-9e9d-4fb4-957b-19444a4ae293', 'non labore commodo culpa commodo', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('863b8f96-c254-473b-973f-87c63bb3ca42', 'veniam ut consectetur non ipsum', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('05d9a752-ddc3-4336-a82d-325ae561960b', 'do nostrud proident sunt proident', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('9ae5ff9e-4e2c-489c-b5bd-c3b2fe70dbde', 'est ut voluptate laboris cupidatat', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('ec60435b-ffcf-4ac3-97a4-f5f9113601b0', 'qui commodo tempor aliqua incididunt', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('577ece52-b66c-44f2-baeb-47c35cd05afc', 'aliquip et ad quis fugiat', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('9f55ac40-fd1a-438a-988b-5b06c4feb93d', 'ullamco qui aute excepteur id', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('d0cb049e-8c91-4303-91cb-98072482f689', 'Lorem excepteur commodo incididunt sint', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('f540de5c-6e18-444a-b135-605e2303f352', 'voluptate laborum elit dolor ex', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('58ea0a10-81a5-4ec6-b5dc-8067ab9db18b', 'sit est adipisicing esse amet', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('d81cc891-8cee-4412-a271-264f57cba326', 'cupidatat magna occaecat dolore magna', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('8dcb1109-7e38-49d4-ba3f-5caa9e6f83ce', 'aliqua enim enim exercitation veniam', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('ab36bcb5-9fb6-4ea4-86b0-068eaaf34fd5', 'ipsum proident adipisicing aute pariatur', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('593ebe81-19f2-46fc-b340-aa76d8a9f987', 'adipisicing excepteur esse adipisicing quis', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('22627251-75ea-441f-b58d-09d8b470f661', 'in et cillum sint cupidatat', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('79658a46-3089-4ebc-8d02-4a24d01de66c', 'laboris cillum excepteur do nisi', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('a1ff3cf9-3c42-4364-bd12-f0e9632d3bb6', 'irure commodo ad minim amet', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('2b998229-b44a-468f-bd49-e5b4cb4c6ec2', 'irure sit adipisicing nisi est', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('eb0ad1e1-9ca4-4a98-aae7-b534829f445c', 'sit officia tempor laborum aliquip', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('b0fad70f-0c21-4c11-9c11-15053967da55', 'culpa reprehenderit eu reprehenderit dolor', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('6ad79328-7849-45a5-a67e-98757fcf1d6d', 'deserunt veniam sint cillum laborum', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('f46b0701-a20d-4f08-8444-66e4b22884a0', 'aliqua duis labore deserunt reprehenderit', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('3546e7c7-498b-43c0-bf9e-4ab95e2d44fb', 'commodo amet nisi cillum id', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('63a0b8ad-8d90-459c-9106-1e161ef668ab', 'nostrud nisi est velit cupidatat', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('5de03ba5-b2f1-45ce-98ff-42586cc344ec', 'mollit labore esse culpa excepteur', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('3f3087bc-a9e2-47a2-9a33-98ea003aaf3d', 'tempor occaecat qui ullamco nisi', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('776cedd2-a707-439b-8d58-01b1d488e2c0', 'dolor nisi fugiat dolore dolore', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('20e3b5e2-10ec-4ec1-97cb-9e4c692fc196', 'ad eu duis nisi ullamco', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('67bbfb06-d174-4a6b-85c1-3a67784801eb', 'sunt veniam reprehenderit quis nisi', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('78ca7e05-e9a0-4118-ad76-20a234d3f6b9', 'ex dolor voluptate velit aute', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('9755d862-6ad3-408f-b785-2d28e4717bbd', 'consequat esse Lorem sint elit', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('93adf3be-831f-4fb2-9599-2067494fb3d3', 'cillum labore nostrud ipsum Lorem', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('e8760db9-da11-410c-810d-53cbaf86fd0a', 'duis minim exercitation cupidatat eiusmod', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('7eee4c87-4557-434b-8ecf-73ca10f1a367', 'ea laboris elit mollit labore', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('44713759-12d6-4679-9c0d-4ddd47679e35', 'incididunt enim officia anim commodo', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('e0a06cda-55e5-4c92-897f-159d3b0696f4', 'excepteur incididunt enim adipisicing ad', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('2ab76066-167c-407b-be84-89825812e5ed', 'culpa nulla officia sunt ea', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('2bcef893-ca8c-4cdc-9f78-f66c58062837', 'id et pariatur ea exercitation', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('b3061912-eb57-4321-8fee-13f4aaf636af', 'ad dolor fugiat exercitation eu', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('18192373-7811-48d0-9ec9-850c584954d1', 'ullamco aliqua aute deserunt Lorem', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('e6eab887-14ee-47f3-9f9e-3f88ae9646eb', 'sunt duis ex quis qui', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('50a01f5a-8d6f-4adc-abfb-fd280358abf9', 'sint magna eu ipsum non', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('39fbb5f1-0066-426f-8d13-fd712e12f429', 'incididunt et qui culpa sit', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('04267f5e-9e0e-407f-9917-57655eb426db', 'adipisicing exercitation amet sit sint', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('60a3cfa7-4352-48dd-9352-571c6e634673', 'velit qui id reprehenderit incididunt', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('80d9f5e3-e959-4365-b75f-7ca90e90057f', 'ex officia nostrud enim incididunt', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('b264b5c1-96d4-4b96-967a-214858c996ea', 'consectetur ut ullamco eiusmod ut', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('6f5e37cb-924e-40b6-aeac-436cccefb413', 'commodo minim laborum voluptate aute', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('4b5f6f06-fcf8-4c75-98ce-98202ab3082a', 'dolore adipisicing duis reprehenderit id', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('6fcf1723-e8a4-4e4a-b84b-f29d1f7393e6', 'esse ad aliqua ipsum excepteur', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('55dd2a56-317d-437c-a46d-65f1e414edaf', 'mollit labore sit magna esse', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('f42061be-8148-4014-a5e0-7b5a751386b0', 'reprehenderit amet elit veniam tempor', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('e25ef467-7efc-40b4-9e6e-65a5c23be6d9', 'aliquip adipisicing irure dolore tempor', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('c47ff8ac-ffd4-4e47-abf0-e55edc1dc489', 'excepteur duis ea culpa in', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('fedb4d23-2008-4200-b38a-e38813a4d673', 'elit ut ullamco commodo minim', 5); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('3b13588c-1cad-41c7-bd82-2ae48ee2eb95', 'adipisicing sit sit eu laborum', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('7ecc8de0-7c3b-4c51-b106-441400c08df3', 'deserunt nostrud non quis deserunt', 0); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('37a65ea3-72e0-4e7d-8862-e79008ed6060', 'reprehenderit sint dolor in sunt', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('4effd8c9-fe56-4397-9daa-9e08cd10b4ce', 'est adipisicing dolore id veniam', 2); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('8e90cd18-2f3c-450e-846f-c635f7ce7aed', 'sunt dolor aliquip do do', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('d8774843-e203-4464-8677-701e859190e1', 'excepteur Lorem sint reprehenderit ea', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('14e05a52-eec7-4ff4-af1b-d6fd1cb90207', 'irure aute aliquip occaecat anim', 3); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('f09387f4-0ec5-4ff4-bc64-3b4bf6108aa1', 'enim in commodo consectetur non', 4); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('92259b63-2440-4782-9855-25d359d75590', 'do laboris Lorem irure mollit', 1); INSERT INTO BOOKS (BOOK_ID, BOOK_NAME, BOOK_QUANTITY) VALUES ('7916a830-0e9b-4aab-8982-f55d76c6a156', 'et eu magna id excepteur', 4);
DROP TABLE IF EXISTS menu_items CASCADE; CREATE TABLE menu_items ( id SERIAL PRIMARY KEY NOT NULL, name TEXT NOT NULL, price INTEGER NOT NULL, prep_time INTEGER NOT NULL, category TEXT NOT NULL, description TEXT NOT NULL, photo TEXT NOT NULL );
CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2; -- -- Dumping data for table `users` -- -- admin/admin INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `email`, `password`, `date_added`) VALUES (1, 'Admin', 'PHP', 'admin@admin.com', '$2y$10$QCvJcIBCaZNSuCQDFFFk8.WW9aZ4zpXccyLg7ev3aDiMGNjSaT.Dq', '2021-01-18 18:00:00');
-- 문제1. -- 사번이 10944인 사원의 이름은(전체 이름) select concat(first_name, ' ', last_name) as '이름' from employees where emp_no = 10944; -- 문제2. -- 전체직원의 다음 정보를 조회하세요. 가장 선임부터 출력이 되도록 하세요. -- 출력은 이름, 성별, 입사일 순서이고 “이름”, “성별”, “입사일"로 컬럼 이름을 대체해 보세요. select concat(first_name, ' ', last_name) as '이름', gender as '성별', hire_date as '입사일' from employees order by hire_date asc; -- 문제3. -- 여직원과 남직원은 각 각 몇 명이나 있나요? select gender as '성별', count(gender) as '인원 수' from employees group by gender; -- 문제4. -- 현재 근무하고 있는 직원 수는 몇 명입니까? (salaries 테이블을 사용합니다.) select count(emp_no) as '현재 근무 직원 수' from salaries where to_date = '9999-01-01'; -- 문제5. -- 부서는 총 몇 개가 있나요? select count(dept_no) as '부서 수' from departments; -- 문제6. -- 현재 부서 매니저는 몇 명이나 있나요?(역임 매너저는 제외) select count(dept_no) as '매니저 수' from dept_manager where to_date = '9999-01-01'; -- 문제7. -- 전체 부서를 출력하려고 합니다. 순서는 부서이름이 긴 순서대로 출력해 보세요. select dept_name as '부서이름' from departments order by char_length(dept_name) desc; -- 문제8. -- 현재 급여가 120,000이상 받는 사원은 몇 명이나 있습니까? select count(emp_no) as '사원 수' from salaries where salary >= 120000 and to_date='9999-01-01'; -- 문제9. -- 어떤 직책들이 있나요? 중복 없이 이름이 긴 순서대로 출력해 보세요. select distinct title as '직책' from titles order by char_length(title) desc; -- 문제10. -- 현재 Enginner 직책의 사원은 총 몇 명입니까? -- 풀이1 select title as '직책', count(title) as '사원수' from titles where to_date='9999-01-01' group by title having title='Engineer'; -- 풀이2 select count(*) as '엔지니어 수' from titles where to_date='9999-01-01' and title='Engineer'; -- 문제11. -- 사번이 13250(Zeydy)인 지원이 직책 변경 상황을 시간순으로 출력해보세요. select title as '직책', concat(from_date, ' ~ ', if(to_date='9999-01-01', '근무 중', to_date)) as '해당 직책 근무 날짜' from titles where emp_no=13250 order by to_date asc;
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: 07-Dez-2017 às 18:15 -- Versão do servidor: 10.1.26-MariaDB-1 -- PHP Version: 7.0.26-1 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 utf8mb4 */; -- -- Database: `task_bd` -- CREATE DATABASE IF NOT EXISTS `task_bd` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; USE `task_bd`; -- -------------------------------------------------------- -- -- Estrutura da tabela `login` -- CREATE TABLE `login` ( `id` int(11) NOT NULL, `email` varchar(60) NOT NULL, `senha` varchar(60) NOT NULL, `data` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Extraindo dados da tabela `login` -- INSERT INTO `login` (`id`, `email`, `senha`, `data`) VALUES (17, 'marcusbrune@outlook.com', '698dc19d489c4e4db73e28a713eab07b', ''), (18, 'teste@outlook.com', '202cb962ac59075b964b07152d234b70', ''), (19, 'brunemarcus@gmail.com', '202cb962ac59075b964b07152d234b70', ''); -- -------------------------------------------------------- -- -- Estrutura da tabela `registro` -- CREATE TABLE `registro` ( `id` int(11) NOT NULL, `email` varchar(60) NOT NULL, `senha` varchar(150) NOT NULL, `conf_senha` varchar(150) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Extraindo dados da tabela `registro` -- INSERT INTO `registro` (`id`, `email`, `senha`, `conf_senha`) VALUES (23, 'teste@outlook.com', '202cb962ac59075b964b07152d234b70', '202cb962ac59075b964b07152d234b70'), (24, 'brunemarcus@gmail.com', '202cb962ac59075b964b07152d234b70', '202cb962ac59075b964b07152d234b70'); -- -------------------------------------------------------- -- -- Estrutura da tabela `tarefas` -- CREATE TABLE `tarefas` ( `id` int(11) NOT NULL, `nome` varchar(60) NOT NULL, `descricao` text NOT NULL, `upload` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`id`); -- -- Indexes for table `registro` -- ALTER TABLE `registro` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tarefas` -- ALTER TABLE `tarefas` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `login` -- ALTER TABLE `login` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `registro` -- ALTER TABLE `registro` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `tarefas` -- ALTER TABLE `tarefas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; /*!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 */;
-- -- PostgreSQL database dump -- -- Dumped from database version 9.5.6 -- Dumped by pg_dump version 9.5.6 SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: task; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE task ( task_id integer NOT NULL, task_priority_id integer, task_status_id integer, user_id integer, task_name character varying(50), task_description character varying(5000) ); -- -- Name: task_priority; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE task_priority ( task_priority_id integer NOT NULL, task_priority_name character varying(20), task_priority_value smallint NOT NULL, CONSTRAINT task_priority_task_priority_value_check CHECK ((task_priority_value > 0)) ); -- -- Name: task_priority_task_priority_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE task_priority_task_priority_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: task_priority_task_priority_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE task_priority_task_priority_id_seq OWNED BY task_priority.task_priority_id; -- -- Name: task_status; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE task_status ( task_status_id integer NOT NULL, task_status_name character varying(20) ); -- -- Name: task_status_task_status_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE task_status_task_status_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: task_status_task_status_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE task_status_task_status_id_seq OWNED BY task_status.task_status_id; -- -- Name: task_task_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE task_task_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: task_task_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE task_task_id_seq OWNED BY task.task_id; -- -- Name: user_data; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE user_data ( user_id integer NOT NULL, user_role_id integer, user_name character varying(30), user_password character varying(65) ); -- -- Name: user_role; Type: TABLE; Schema: public; Owner: - -- CREATE TABLE user_role ( user_role_id integer NOT NULL, user_role_name character varying(20) ); -- -- Name: user_role_user_role_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE user_role_user_role_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: user_role_user_role_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE user_role_user_role_id_seq OWNED BY user_role.user_role_id; -- -- Name: username_user_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE username_user_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: username_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE username_user_id_seq OWNED BY user_data.user_id; -- -- Name: task_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY task ALTER COLUMN task_id SET DEFAULT nextval('task_task_id_seq'::regclass); -- -- Name: task_priority_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY task_priority ALTER COLUMN task_priority_id SET DEFAULT nextval('task_priority_task_priority_id_seq'::regclass); -- -- Name: task_status_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY task_status ALTER COLUMN task_status_id SET DEFAULT nextval('task_status_task_status_id_seq'::regclass); -- -- Name: user_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY user_data ALTER COLUMN user_id SET DEFAULT nextval('username_user_id_seq'::regclass); -- -- Name: user_role_id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY user_role ALTER COLUMN user_role_id SET DEFAULT nextval('user_role_user_role_id_seq'::regclass); -- -- Data for Name: task; Type: TABLE DATA; Schema: public; Owner: - -- COPY task (task_id, task_priority_id, task_status_id, user_id, task_name, task_description) FROM stdin; \. -- -- Data for Name: task_priority; Type: TABLE DATA; Schema: public; Owner: - -- COPY task_priority (task_priority_id, task_priority_name, task_priority_value) FROM stdin; 1 High 1 2 Medium 2 3 Low 3 \. -- -- Name: task_priority_task_priority_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('task_priority_task_priority_id_seq', 3, true); -- -- Data for Name: task_status; Type: TABLE DATA; Schema: public; Owner: - -- COPY task_status (task_status_id, task_status_name) FROM stdin; 1 done 2 pending \. -- -- Name: task_status_task_status_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('task_status_task_status_id_seq', 2, true); -- -- Name: task_task_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('task_task_id_seq', 20, true); -- -- Data for Name: user_data; Type: TABLE DATA; Schema: public; Owner: - -- COPY user_data (user_id, user_role_id, user_name, user_password) FROM stdin; 1 1 MainAdm 123 8 2 User1 qwerty \. -- -- Data for Name: user_role; Type: TABLE DATA; Schema: public; Owner: - -- COPY user_role (user_role_id, user_role_name) FROM stdin; 1 admin 2 user \. -- -- Name: user_role_user_role_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('user_role_user_role_id_seq', 2, true); -- -- Name: username_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: - -- SELECT pg_catalog.setval('username_user_id_seq', 8, true); -- -- Name: task_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task ADD CONSTRAINT task_pkey PRIMARY KEY (task_id); -- -- Name: task_priority_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task_priority ADD CONSTRAINT task_priority_pkey PRIMARY KEY (task_priority_id); -- -- Name: task_priority_task_priority_name_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task_priority ADD CONSTRAINT task_priority_task_priority_name_key UNIQUE (task_priority_name); -- -- Name: task_priority_task_priority_value_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task_priority ADD CONSTRAINT task_priority_task_priority_value_key UNIQUE (task_priority_value); -- -- Name: task_status_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task_status ADD CONSTRAINT task_status_pkey PRIMARY KEY (task_status_id); -- -- Name: task_status_task_status_name_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task_status ADD CONSTRAINT task_status_task_status_name_key UNIQUE (task_status_name); -- -- Name: user_role_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_role ADD CONSTRAINT user_role_pkey PRIMARY KEY (user_role_id); -- -- Name: user_role_user_role_name_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_role ADD CONSTRAINT user_role_user_role_name_key UNIQUE (user_role_name); -- -- Name: username_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_data ADD CONSTRAINT username_pkey PRIMARY KEY (user_id); -- -- Name: username_user_name_key; Type: CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_data ADD CONSTRAINT username_user_name_key UNIQUE (user_name); -- -- Name: task_task_priority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task ADD CONSTRAINT task_task_priority_id_fkey FOREIGN KEY (task_priority_id) REFERENCES task_priority(task_priority_id) ON DELETE RESTRICT; -- -- Name: task_task_status_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task ADD CONSTRAINT task_task_status_id_fkey FOREIGN KEY (task_status_id) REFERENCES task_status(task_status_id) ON DELETE RESTRICT; -- -- Name: task_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY task ADD CONSTRAINT task_user_id_fkey FOREIGN KEY (user_id) REFERENCES user_data(user_id) ON DELETE CASCADE; -- -- Name: username_user_role_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY user_data ADD CONSTRAINT username_user_role_id_fkey FOREIGN KEY (user_role_id) REFERENCES user_role(user_role_id) ON DELETE RESTRICT; -- -- PostgreSQL database dump complete --
CREATE OR REPLACE VIEW V_ZB012 AS ( /*******************工会费转入************ ********************create liuft 2012-06-04 *****************************************/ SELECT A."JSDE395",A."JSDE107",A."JSDE201",A."JSDE301",A."JSDE955",A."JSDE901",A."DE181",A."JSDE940",A."JSDE306",A."JSDE307",A."JSDE308",A."JSDE316",A."DE192",A."DE011",A."DE007",A."CZDE938",A."DE001",A."JSDE909",A."JSDE007",A."DE022",A."JSDE014",A."CZDE940",A."JSDE090",A."JSDE019",A."JSDE999",B.DE084,B.JSDE702,B.JSDE802,B.CZDE951,B.JSDE902 FROM ZF012 A ,V_ZB006_ZX B WHERE A.JSDE107 = B.JSDE107 AND A.DE011 = B.DE011 AND A.DE022 = B.DE022 );
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Anamakine: 127.0.0.1 -- Üretim Zamanı: 22 May 2016, 20:04:08 -- Sunucu sürümü: 10.1.8-MariaDB -- PHP Sürümü: 5.6.14 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 utf8mb4 */; -- -- Veritabanı: `riza` -- -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `mesajlar` -- CREATE TABLE `mesajlar` ( `id` int(11) NOT NULL, `kim` varchar(200) COLLATE utf8_turkish_ci NOT NULL, `yaz` varchar(200) COLLATE utf8_turkish_ci NOT NULL, `mk` varchar(200) COLLATE utf8_turkish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci; -- -- Tablo döküm verisi `mesajlar` -- INSERT INTO `mesajlar` (`id`, `kim`, `yaz`, `mk`) VALUES (5, 'Sen', 'Merhaba', 'testere'), (6, 'Rıza', 'Merhaba', 'testere'), (7, 'Sen', 'Yarın hava nasıl olacak?', 'testere'), (8, 'Rıza', 'Kader!', 'testere'), (9, 'Sen', 'Benim adım ne?', 'testere'), (10, 'Rıza', 'hmmm düşünmeme izin verir misin?', 'testere'), (11, 'Sen', 'evet', 'testere'), (12, 'Rıza', 'adında o harfi var mı?', 'testere'), (13, 'Sen', 'var', 'testere'), (14, 'Rıza', 'senin adın hasan :D', 'testere'), (15, 'Sen', 'benim sevgilimin adını biliyor musun?', 'testere'), (16, 'Rıza', '', 'testere'), (17, 'Sen', 'bilmiyor musun', 'testere'), (18, 'Rıza', '2 dk sabret düşüneyim ', 'testere'); -- -- Dökümü yapılmış tablolar için indeksler -- -- -- Tablo için indeksler `mesajlar` -- ALTER TABLE `mesajlar` ADD PRIMARY KEY (`id`); -- -- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri -- -- -- Tablo için AUTO_INCREMENT değeri `mesajlar` -- ALTER TABLE `mesajlar` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; /*!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 %snm_device_info ( "id" varchar(64) not null unique primary key, "timestamped" timestamp, "user_id" varchar(64), "device_id" varchar(64), "os_type" varchar(64), "os_version" varchar(64), "device_model" varchar(64), "build_version" varchar(64), "build_number" varchar(64), "fresh_install" boolean );
-- Generated by Oracle SQL Developer Data Modeler 4.1.2.895 -- at: 2015-12-13 17:58:51 CET -- site: SQL Server 2005 -- type: SQL Server 2005 CREATE TABLE Journey ( j_id BIGINT NOT NULL , j_points BIGINT NOT NULL , j_points_max BIGINT NOT NULL , j_status SMALLINT , User_u_id BIGINT ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'Maximum avaliable points for this journey' , 'USER' , 'dbo' , 'TABLE' , 'Journey' , 'COLUMN' , 'j_points_max' GO EXEC sp_addextendedproperty 'MS_Description' , 'The current status of the quest of the user.' , 'USER' , 'dbo' , 'TABLE' , 'Journey' , 'COLUMN' , 'j_status' GO ALTER TABLE Journey ADD CONSTRAINT Journey_PK PRIMARY KEY CLUSTERED (j_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE JourneyTask ( QuestTask_qt_id BIGINT NOT NULL , QuestTaskItem_qi_id BIGINT NOT NULL , Journey_j_id BIGINT NOT NULL ) ON "default" GO ALTER TABLE JourneyTask ADD CONSTRAINT JourneyTask_PK PRIMARY KEY CLUSTERED ( QuestTask_qt_id, Journey_j_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE Quest ( q_id BIGINT NOT NULL , q_start DATETIME , q_end DATETIME NOT NULL , World_w_id BIGINT ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'The begining of the quest is not mandatory as the old qest were not marked with start date, but new records should treat this field as mandatory.' , 'USER' , 'dbo' , 'TABLE' , 'Quest' , 'COLUMN' , 'q_start' GO EXEC sp_addextendedproperty 'MS_Description' , 'The end of the qest is mandatory' , 'USER' , 'dbo' , 'TABLE' , 'Quest' , 'COLUMN' , 'q_end' GO ALTER TABLE Quest ADD CONSTRAINT Quest_PK PRIMARY KEY CLUSTERED (q_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE QuestTask ( qt_id BIGINT NOT NULL , qt_name VARCHAR (60) NOT NULL , qt_type SMALLINT NOT NULL , qt_dificulty SMALLINT NOT NULL , qt_uri_data TEXT , qt_uri_badge TEXT , Quest_q_id BIGINT ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'We allow only 60bytes in qest-task. No reason really, just old habits.' , 'USER' , 'dbo' , 'TABLE' , 'QuestTask' , 'COLUMN' , 'qt_name' GO EXEC sp_addextendedproperty 'MS_Description' , 'The quest-task have fixed type for which smallint is sufficient.' , 'USER' , 'dbo' , 'TABLE' , 'QuestTask' , 'COLUMN' , 'qt_type' GO EXEC sp_addextendedproperty 'MS_Description' , '0-100 -> dificulty multiplicator for the quest' , 'USER' , 'dbo' , 'TABLE' , 'QuestTask' , 'COLUMN' , 'qt_dificulty' GO EXEC sp_addextendedproperty 'MS_Description' , 'URI for the game data if any.' , 'USER' , 'dbo' , 'TABLE' , 'QuestTask' , 'COLUMN' , 'qt_uri_data' GO EXEC sp_addextendedproperty 'MS_Description' , 'URI to <Quest Task> image for the menu.' , 'USER' , 'dbo' , 'TABLE' , 'QuestTask' , 'COLUMN' , 'qt_uri_badge' GO ALTER TABLE QuestTask ADD CONSTRAINT QuestTask_PK PRIMARY KEY CLUSTERED (qt_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE QuestTaskItem ( qi_id BIGINT NOT NULL , qi_name VARCHAR (60) NOT NULL , qi_data TEXT NOT NULL , qi_uri_image TEXT , qi_evaluation BIGINT NOT NULL , qt_id BIGINT NOT NULL , qi_id1 BIGINT NOT NULL , QuestTask_qt_id BIGINT ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'JSON data for the quest task' , 'USER' , 'dbo' , 'TABLE' , 'QuestTaskItem' , 'COLUMN' , 'qi_data' GO EXEC sp_addextendedproperty 'MS_Description' , 'Point or percent to evaluate.' , 'USER' , 'dbo' , 'TABLE' , 'QuestTaskItem' , 'COLUMN' , 'qi_evaluation' GO ALTER TABLE QuestTaskItem ADD CONSTRAINT QuestTaskItem_PK PRIMARY KEY CLUSTERED (qi_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE "User" ( u_id BIGINT NOT NULL , u_password VARCHAR (128) NOT NULL , u_email VARCHAR (255) NOT NULL , u_role_str VARCHAR (60) NOT NULL ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'Primary key of <USER> table' , 'USER' , 'dbo' , 'TABLE' , 'User' , 'COLUMN' , 'u_id' GO EXEC sp_addextendedproperty 'MS_Description' , 'Passwords are mandatory, no user can exist without password for security reasons.' , 'USER' , 'dbo' , 'TABLE' , 'User' , 'COLUMN' , 'u_password' GO EXEC sp_addextendedproperty 'MS_Description' , 'Uses common axiom, that user`s email should not be longer than 255 characters.' , 'USER' , 'dbo' , 'TABLE' , 'User' , 'COLUMN' , 'u_email' GO EXEC sp_addextendedproperty 'MS_Description' , 'Shoud not by longer than 60 characters' , 'USER' , 'dbo' , 'TABLE' , 'User' , 'COLUMN' , 'u_role_str' GO ALTER TABLE "User" ADD CONSTRAINT User_PK PRIMARY KEY CLUSTERED (u_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE UserDetails ( ue_name VARCHAR (80) NOT NULL , ue_surname VARCHAR (100) , ue_nickname VARCHAR (30) , ue_dob DATETIME NOT NULL , ue_uri_avatar TEXT , ue_level SMALLINT NOT NULL , User_u_id BIGINT NOT NULL ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'Maximum allowed 'name' range is 80Bytes' , 'USER' , 'dbo' , 'TABLE' , 'UserDetails' , 'COLUMN' , 'ue_name' GO EXEC sp_addextendedproperty 'MS_Description' , 'Maximum allowed length is 100Bytes' , 'USER' , 'dbo' , 'TABLE' , 'UserDetails' , 'COLUMN' , 'ue_surname' GO EXEC sp_addextendedproperty 'MS_Description' , 'Nickname are usually short : max length 30B' , 'USER' , 'dbo' , 'TABLE' , 'UserDetails' , 'COLUMN' , 'ue_nickname' GO EXEC sp_addextendedproperty 'MS_Description' , 'DOB = day of birth, manadatory' , 'USER' , 'dbo' , 'TABLE' , 'UserDetails' , 'COLUMN' , 'ue_dob' GO EXEC sp_addextendedproperty 'MS_Description' , 'URI of the user image.' , 'USER' , 'dbo' , 'TABLE' , 'UserDetails' , 'COLUMN' , 'ue_uri_avatar' GO CREATE UNIQUE NONCLUSTERED INDEX UserDetails__IDX ON UserDetails ( User_u_id ) ON "default" GO CREATE TABLE UserIntentory ( i_id BIGINT NOT NULL , i_name VARCHAR (50) NOT NULL , i_type SMALLINT , i_content TEXT ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'Names of items should be keept long to allow simpler search.' , 'USER' , 'dbo' , 'TABLE' , 'UserIntentory' , 'COLUMN' , 'i_name' GO EXEC sp_addextendedproperty 'MS_Description' , 'We only support fixed set of equipment and item types, thous we can use fixed smallint without accom. table with types, because as such we know them and only need to enumerate them. Also item can have no type indicating it has multiple types. In those cases the JSON inside <i_value> keeps track of all it' s properties.' , 'USER' , 'DBO' , 'TABLE' , 'UserIntentory' , 'COLUMN' , ' i_type' GO EXEC sp_addextendedproperty 'MS_Description' , 'JSON string describing properties OF the object; because we have really strange objects we keep it IN JSON WITH the original parser FROM OLD engine OF JM.' , 'USER' , 'DBO' , 'TABLE' , 'UserIntentory' , 'COLUMN ' , 'i_content' GO ALTER TABLE UserIntentory ADD CONSTRAINT UserIntentory_PK PRIMARY KEY CLUSTERED (i_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE User_inventory ( User_u_id BIGINT NOT NULL , UserIntentory_i_id BIGINT NOT NULL ) ON "default" GO ALTER TABLE User_inventory ADD CONSTRAINT User_inventory_PK PRIMARY KEY CLUSTERED (User_u_id, UserIntentory_i_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE Users__World ( User_u_id BIGINT NOT NULL , World_w_id BIGINT NOT NULL ) ON "default" GO ALTER TABLE Users__World ADD CONSTRAINT Users__World_PK PRIMARY KEY CLUSTERED ( User_u_id, World_w_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO CREATE TABLE World ( w_id BIGINT NOT NULL , w_short_name VARCHAR (10) NOT NULL , w_fullname VARCHAR (255) NOT NULL ) ON "default" GO EXEC sp_addextendedproperty 'MS_Description' , 'ASCII short name for the server/world' , 'USER' , 'dbo' , 'TABLE' , 'World' , 'COLUMN' , 'w_short_name' GO EXEC sp_addextendedproperty 'MS_Description' , 'We adhere old issue fix #3405 to trim name if longer then 255B to support some weird devices.' , 'USER' , 'dbo' , 'TABLE' , 'World' , 'COLUMN' , 'w_fullname' GO ALTER TABLE World ADD CONSTRAINT World_PK PRIMARY KEY CLUSTERED (w_id) WITH ( ALLOW_PAGE_LOCKS = ON , ALLOW_ROW_LOCKS = ON ) ON "default" GO ALTER TABLE Users__World ADD CONSTRAINT FK_ASS_12 FOREIGN KEY ( User_u_id ) REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE Users__World ADD CONSTRAINT FK_ASS_13 FOREIGN KEY ( World_w_id ) REFERENCES World ( w_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE User_inventory ADD CONSTRAINT FK_ASS_8 FOREIGN KEY ( User_u_id ) REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE User_inventory ADD CONSTRAINT FK_ASS_9 FOREIGN KEY ( UserIntentory_i_id ) REFERENCES UserIntentory ( i_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE JourneyTask ADD CONSTRAINT JourneyTask_Journey_FK FOREIGN KEY ( Journey_j_id ) REFERENCES Journey ( j_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE JourneyTask ADD CONSTRAINT JourneyTask_QuestTaskItem_FK FOREIGN KEY ( QuestTaskItem_qi_id ) REFERENCES QuestTaskItem ( qi_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE JourneyTask ADD CONSTRAINT JourneyTask_QuestTask_FK FOREIGN KEY ( QuestTask_qt_id ) REFERENCES QuestTask ( qt_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE Journey ADD CONSTRAINT Journey_User_FK FOREIGN KEY ( User_u_id ) REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE QuestTaskItem ADD CONSTRAINT QuestTaskItem_QuestTask_FK FOREIGN KEY ( QuestTask_qt_id ) REFERENCES QuestTask ( qt_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE QuestTask ADD CONSTRAINT QuestTask_Quest_FK FOREIGN KEY ( Quest_q_id ) REFERENCES Quest ( q_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE Quest ADD CONSTRAINT Quest_World_FK FOREIGN KEY ( World_w_id ) REFERENCES World ( w_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE UserDetails ADD CONSTRAINT UserDetails_User_FK FOREIGN KEY ( User_u_id ) REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE UserIntentory ADD CONSTRAINT User_inventory FOREIGN KEY REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE "User" ADD CONSTRAINT User_inventoryv1 FOREIGN KEY REFERENCES UserIntentory ( i_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE World ADD CONSTRAINT Users__World FOREIGN KEY REFERENCES "User" ( u_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO ALTER TABLE "User" ADD CONSTRAINT Users__Worldv1 FOREIGN KEY REFERENCES World ( w_id ) ON DELETE NO ACTION ON UPDATE NO ACTION GO -- Oracle SQL Developer Data Modeler Summary Report: -- -- CREATE TABLE 11 -- CREATE INDEX 1 -- ALTER TABLE 26 -- CREATE VIEW 0 -- ALTER VIEW 0 -- CREATE PACKAGE 0 -- CREATE PACKAGE BODY 0 -- CREATE PROCEDURE 0 -- CREATE FUNCTION 0 -- CREATE TRIGGER 0 -- ALTER TRIGGER 0 -- CREATE DATABASE 0 -- CREATE DEFAULT 0 -- CREATE INDEX ON VIEW 0 -- CREATE ROLLBACK SEGMENT 0 -- CREATE ROLE 0 -- CREATE RULE 0 -- CREATE SCHEMA 0 -- CREATE PARTITION FUNCTION 0 -- CREATE PARTITION SCHEME 0 -- -- DROP DATABASE 0 -- -- ERRORS 0 -- WARNINGS 0
--listando todas as faixas de nosso números cadastradas select cce.cd_cce, gem.cd_gem || ' - ' || gem.nm_gem as grupo_empresarial, emp.cd_emp || ' - ' || emp.nm_emp as empresa, cnt.cd_cnt || ' - ' || cnt.nm_cnt as conta, cun.nr_cpf_cnpj_cun as cnpj, cun.nm_cun as razao_social, cce.ns_nmr_ini_cce || ' - ' || cce.ns_nmr_fin_cce as faixa_nosso_numero from sc_cce.tbl_cce cce inner join sc_cad.tbl_cun cun on cce.cd_cun = cun.cd_cun inner join sc_cad.tbl_fem fem on cun.cd_cun = fem.cd_cun and fem.cd_fem = 1 inner join sc_cad.tbl_emp emp on fem.cd_emp = emp.cd_emp inner join sc_cad.tbl_gem gem on emp.cd_gem = gem.cd_gem inner join sc_cnt.tbl_cnt cnt on cce.cd_cnt = cnt.cd_cnt order by faixa_nosso_numero asc;
-- upgrade -- CREATE TABLE IF NOT EXISTS "UserAccounts_persontype" ( "id" SERIAL NOT NULL PRIMARY KEY, "person_type" VARCHAR(100) NOT NULL, "person_slug" VARCHAR(100) NOT NULL, "person_desc" TEXT ); COMMENT ON COLUMN "UserAccounts_persontype"."person_type" IS 'User type'; COMMENT ON COLUMN "UserAccounts_persontype"."person_slug" IS 'Identifier'; COMMENT ON COLUMN "UserAccounts_persontype"."person_desc" IS 'Description'; COMMENT ON TABLE "UserAccounts_persontype" IS 'User type'; CREATE TABLE IF NOT EXISTS "UserAccounts_user" ( "id" SERIAL NOT NULL PRIMARY KEY, "user_uuid" UUID NOT NULL UNIQUE, "username" VARCHAR(30) NOT NULL UNIQUE, "email" VARCHAR(255) NOT NULL UNIQUE, "password" VARCHAR(255) NOT NULL, "is_active" BOOL NOT NULL DEFAULT True, "is_superuser" BOOL NOT NULL DEFAULT False, "is_verified" BOOL NOT NULL DEFAULT False, "first_name" VARCHAR(100) NOT NULL, "last_name" VARCHAR(150) NOT NULL, "middle_name" VARCHAR(100), "phone" VARCHAR(15) NOT NULL, "address" TEXT, "is_staff" BOOL NOT NULL DEFAULT False, "is_legal_person" BOOL NOT NULL DEFAULT False, "last_login" TIMESTAMPTZ, "date_joined" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, "avatar" VARCHAR(255), "role_id" INT NOT NULL DEFAULT 4 REFERENCES "UserAccounts_persontype" ("id") ON DELETE CASCADE ); CREATE INDEX IF NOT EXISTS "idx_UserAccount_user_uu_c8d546" ON "UserAccounts_user" ("user_uuid"); CREATE INDEX IF NOT EXISTS "idx_UserAccount_usernam_fb3b81" ON "UserAccounts_user" ("username"); CREATE INDEX IF NOT EXISTS "idx_UserAccount_email_23b168" ON "UserAccounts_user" ("email"); COMMENT ON TABLE "UserAccounts_user" IS 'User'; CREATE TABLE IF NOT EXISTS "verification" ( "link" UUID NOT NULL PRIMARY KEY, "user_id" INT NOT NULL REFERENCES "UserAccounts_user" ("id") ON DELETE CASCADE ); COMMENT ON TABLE "verification" IS 'Модель для подтверждения регистрации пользователя '; CREATE TABLE IF NOT EXISTS "aerich" ( "id" SERIAL NOT NULL PRIMARY KEY, "version" VARCHAR(255) NOT NULL, "app" VARCHAR(20) NOT NULL, "content" TEXT NOT NULL );
/*** * RequestForQuotes ***/ drop table if exists RequestForQuotes cascade; create table RequestForQuotes( id serial primary key title text, description text, period_startdate timestamp, period_enddate timestamp, ); drop table if exists RequestForQuotesItems cascade; create table RequestForQuotesItems( id serial primary key, requestforquotes_id integer references RequestForQuotes(id) on delete cascade /*incluir campos*/ ); drop table ir exists RequestForQuotesPossibleSuppliers cascade; create table RequestForQuotesPossibleSuppliers( id serial primary key, requestforquotes_id integer references RequestForQuotes(id) on delete cascade, parties_id integer references Parties(id) ); drop table Quotes cascade; create table Quotes( id serial primary key, requestforquotes_id integer references RequestForQuotes(id) on delete cascade /* incluir campos */ ); drop table QuotesItems cascade; create table QuotesItems( id serial primary key, quotes_id integer references Quotes(id) on delete cascade /*incluir campos*/ ); /*** * ClarificationMeetings ***/ drop table ClarificationMeeting cascade; create table ClarificationMeeting( id serial primary key, date timestamp ); create table attendees( id serial primary key, clarificationmeeting_id integer references ClarificationMeeting(id) on delete cascade, parties_id integer references Parties(id) ); create table officials( id serial primary key, clarificationmeeting_id integer references ClarificationMeeting(id) on delete cascade, parties_id integer references Parties(id) );
INSERT INTO estados (nome, sigla, regiao, populacao) VALUES ('Acre', 'AC', 'Norte', 0.83); INSERT INTO estados (nome, sigla, regiao, populacao) VALUES ('Alagoas', 'AL', 'Nordeste', 3.38), ('Amapá', 'AP', 'Norte', 0.8), ('Amazonas', 'AM', 'Norte', 4.06); INSERT INTO estados (nome, sigla, regiao, populacao) VALUES (1000, 'Novo', 'NV', 'Nordeste', 21.5), --Apesar de ser auto-inc. é possivel informar um ID -- POREM o próximo gerado de forma automática será o sucessor ao colocado manualmente(no ex. 1001)
-- Your SQL goes here CREATE TABLE word_entry_readings ( id SERIAL PRIMARY KEY, word_entry_id INTEGER NOT NULL, reading VARCHAR NOT NULL, reading_tag VARCHAR );
/* Sample Output : * *** ***** ******* ********* *********** ************* *********** ********* ******* ***** *** * */ DECLARE cntr number; vNewLine VARCHAR2(250); BEGIN cntr := 0; WHILE cntr <= 13 LOOP vNewLine := ''; cntr:= cntr +1; FOR Lcntr IN 1.. ABS(7-cntr) LOOP vNewLine := CONCAT(vNewLine, ' '); END LOOP; IF cntr <= 7 THEN FOR Lcntr IN REVERSE 1.. 2*MOD(cntr,14)-1 LOOP vNewLine := CONCAT(vNewLine, '*'); END LOOP; ELSE FOR Lcntr IN REVERSE 1.. 2*(14-cntr)-1 LOOP vNewLine := CONCAT(vNewLine, '*'); END LOOP; END IF; dbms_output.put_line(vNewLine); END LOOP; END;
-- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema daju_2004 -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `daju_2004` ; -- ----------------------------------------------------- -- Schema daju_2004 -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `daju_2004` DEFAULT CHARACTER SET utf8 ; USE `daju_2004` ; -- ----------------------------------------------------- -- Table `daju_2004`.`proveedores_clientes` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proveedores_clientes` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proveedores_clientes` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `direccion_fiscal` VARCHAR(255) NULL, `telefono` VARCHAR(255) NULL, `fax` VARCHAR(255) NULL, `correo` VARCHAR(255) NULL, `pagina_web` VARCHAR(255) NULL, `NIF_CIF` VARCHAR(20) NULL, `observaciones` VARCHAR(1024) NULL, `proveedor_cliente` TINYINT(1) NULL DEFAULT 0, `visible` TINYINT(1) NOT NULL DEFAULT 1, `persona_contacto` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`direcciones` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`direcciones` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`direcciones` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proveedores_cliente_id` INT UNSIGNED NULL, `direccion` VARCHAR(255) NULL, `telefono` VARCHAR(255) NULL, `fax` VARCHAR(255) NULL, `correo` VARCHAR(255) NULL, `pagina_web` VARCHAR(255) NULL, `observaciones` VARCHAR(2505) NULL, PRIMARY KEY (`id`), INDEX `fk_direcciones_proveedores_clientes_idx` (`proveedores_cliente_id` ASC), CONSTRAINT `fk_direcciones_proveedores_clientes` FOREIGN KEY (`proveedores_cliente_id`) REFERENCES `daju_2004`.`proveedores_clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`ivas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`ivas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`ivas` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `valor` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`monedas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`monedas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`monedas` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `valor` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`centros` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`centros` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`centros` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `direccion` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`entradas_de_materiales` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`entradas_de_materiales` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`entradas_de_materiales` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proveedores_cliente_id` INT UNSIGNED NULL, `referencia` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, `albaran` VARCHAR(255) NULL, `fecha_envio` DATETIME NULL, `centro_id` INT UNSIGNED NULL, `fecha_recepcion` DATETIME NULL, PRIMARY KEY (`id`), INDEX `fk_entradas_material_proveedores_clientes1_idx` (`proveedores_cliente_id` ASC), INDEX `fk_entradas_material_centros1_idx` (`centro_id` ASC), CONSTRAINT `fk_entradas_material_proveedores_clientes1` FOREIGN KEY (`proveedores_cliente_id`) REFERENCES `daju_2004`.`proveedores_clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_entradas_material_centros1` FOREIGN KEY (`centro_id`) REFERENCES `daju_2004`.`centros` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`familias` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`familias` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`familias` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`material` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`material` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`material` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `referencia_proveedor` VARCHAR(255) NULL, `familia_id` INT UNSIGNED NULL, `longitud` FLOAT NULL, `anchura` FLOAT NULL, `profundidad` FLOAT NULL, `color` VARCHAR(255) NULL, `gramaje` FLOAT NULL, `peso_ud` FLOAT NULL, `unidades_embalaje` INT UNSIGNED NULL, `precio` FLOAT NULL, `moneda_id` INT UNSIGNED NULL, `iva_id` INT UNSIGNED NULL, `observaciones` VARCHAR(1024) NULL, `visible` TINYINT(1) NULL DEFAULT 1, PRIMARY KEY (`id`), INDEX `fk_material_ivas1_idx` (`iva_id` ASC), INDEX `fk_material_monedas1_idx` (`moneda_id` ASC), INDEX `fk_material_familias1_idx` (`familia_id` ASC), CONSTRAINT `fk_material_ivas10` FOREIGN KEY (`iva_id`) REFERENCES `daju_2004`.`ivas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_material_monedas10` FOREIGN KEY (`moneda_id`) REFERENCES `daju_2004`.`monedas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_material_familias1` FOREIGN KEY (`familia_id`) REFERENCES `daju_2004`.`familias` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`localizaciones` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`localizaciones` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`localizaciones` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `centro_id` INT UNSIGNED NULL, PRIMARY KEY (`id`), INDEX `fk_localizaciones_centros1_idx` (`centro_id` ASC), CONSTRAINT `fk_localizaciones_centros1` FOREIGN KEY (`centro_id`) REFERENCES `daju_2004`.`centros` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`materiales` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`materiales` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`materiales` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `material_id` INT UNSIGNED NULL, `fecha_entega` DATETIME NULL, `localizacione_id` INT UNSIGNED NULL, `entradas_de_materiale_id` INT UNSIGNED NULL, `bobina_lote` TINYINT(1) NULL DEFAULT 0, `bobinas` INT NULL, `bobinas_actual` INT NULL, `lote` VARCHAR(255) NULL, `numero_bobina` INT NULL, `taras` INT NULL, `taras_reales` INT NULL, `taras_mediciones` VARCHAR(255) NULL, `metros_brutos` FLOAT NULL, `metros_netos` FLOAT NULL, `metros_actuales` FLOAT NULL, `metros_utiles` FLOAT NULL, `scrap` FLOAT NULL, `en_uso` TINYINT(1) NULL DEFAULT 0, `terminado` TINYINT(1) NULL, `peso_ud` FLOAT NULL, PRIMARY KEY (`id`), INDEX `fk_materiales_entradas_material1_idx` (`entradas_de_materiale_id` ASC), INDEX `fk_materiales_material1_idx` (`material_id` ASC), INDEX `fk_materiales_localizaciones1_idx` (`localizacione_id` ASC), CONSTRAINT `fk_materiales_entradas_material1` FOREIGN KEY (`entradas_de_materiale_id`) REFERENCES `daju_2004`.`entradas_de_materiales` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_materiales_material1` FOREIGN KEY (`material_id`) REFERENCES `daju_2004`.`material` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_materiales_localizaciones1` FOREIGN KEY (`localizacione_id`) REFERENCES `daju_2004`.`localizaciones` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`proveedores_material` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proveedores_material` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proveedores_material` ( `id` INT UNSIGNED NOT NULL, `proveedores_cliente_id` INT UNSIGNED NULL, `material_id` INT UNSIGNED NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_proveedores_material_proveedores_clientes1_idx` (`proveedores_cliente_id` ASC), INDEX `fk_proveedores_material_material1_idx` (`material_id` ASC), CONSTRAINT `fk_proveedores_material_proveedores_clientes1` FOREIGN KEY (`proveedores_cliente_id`) REFERENCES `daju_2004`.`proveedores_clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proveedores_material_material1` FOREIGN KEY (`material_id`) REFERENCES `daju_2004`.`material` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`producto` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`producto` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`producto` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `referencia_proveedor` VARCHAR(255) NULL, `familia_id` INT UNSIGNED NULL, `precio` FLOAT NULL, `moneda_id` INT UNSIGNED NULL, `iva_id` INT UNSIGNED NULL, `observaciones` VARCHAR(255) NULL, `visible` TINYINT(1) NULL DEFAULT 1, `peso` FLOAT NULL, `cantidad` INT NULL, `descripcion` VARCHAR(255) NULL, `larga` VARCHAR(2550) NULL, `coste` FLOAT NULL, `ancho` FLOAT NULL, `largo` FLOAT NULL, `tolerancia` FLOAT NULL, PRIMARY KEY (`id`), INDEX `fk_producto_familias1_idx` (`familia_id` ASC), INDEX `fk_producto_monedas1_idx` (`moneda_id` ASC), INDEX `fk_producto_ivas1_idx` (`iva_id` ASC), CONSTRAINT `fk_producto_familias1` FOREIGN KEY (`familia_id`) REFERENCES `daju_2004`.`familias` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_producto_monedas1` FOREIGN KEY (`moneda_id`) REFERENCES `daju_2004`.`monedas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_producto_ivas1` FOREIGN KEY (`iva_id`) REFERENCES `daju_2004`.`ivas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`proceso` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proceso` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proceso` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `familia_id` INT UNSIGNED NULL, `precio` FLOAT NULL, `moneda_id` INT UNSIGNED NULL, `iva_id` INT UNSIGNED NULL, `observaciones` VARCHAR(255) NULL, `visible` TINYINT(1) NULL DEFAULT 1, `enlaces` VARCHAR(255) NULL, `centro_id` INT UNSIGNED NULL, `segundos_tiempo` INT NULL, `coste_operaciones` VARCHAR(45) NULL, `descripcion` VARCHAR(255) NULL, `larga` VARCHAR(2500) NULL, `atributos` LONGTEXT NULL, PRIMARY KEY (`id`), INDEX `fk_proceso_ivas1_idx` (`iva_id` ASC), INDEX `fk_proceso_monedas1_idx` (`moneda_id` ASC), INDEX `fk_proceso_familias1_idx` (`familia_id` ASC), INDEX `fk_proceso_centros1_idx` (`centro_id` ASC), CONSTRAINT `fk_proceso_ivas1` FOREIGN KEY (`iva_id`) REFERENCES `daju_2004`.`ivas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_monedas1` FOREIGN KEY (`moneda_id`) REFERENCES `daju_2004`.`monedas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_familias1` FOREIGN KEY (`familia_id`) REFERENCES `daju_2004`.`familias` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_centros1` FOREIGN KEY (`centro_id`) REFERENCES `daju_2004`.`centros` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`proceso_producto_entrada` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proceso_producto_entrada` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proceso_producto_entrada` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proceso_id` INT UNSIGNED NULL, `producto_id` INT UNSIGNED NULL, `cantidad` INT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_proceso_has_producto_producto1_idx` (`producto_id` ASC), INDEX `fk_proceso_has_producto_proceso1_idx` (`proceso_id` ASC), CONSTRAINT `fk_proceso_has_producto_proceso1` FOREIGN KEY (`proceso_id`) REFERENCES `daju_2004`.`proceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_has_producto_producto1` FOREIGN KEY (`producto_id`) REFERENCES `daju_2004`.`producto` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB COMMENT = 'Entradas salidas productos en los procesos\n'; -- ----------------------------------------------------- -- Table `daju_2004`.`proceso_material_entrada` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proceso_material_entrada` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proceso_material_entrada` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proceso_id` INT UNSIGNED NULL, `material_id` INT UNSIGNED NULL, `metros_lineales` FLOAT NULL, `metros_cuadrados` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_proceso_has_material_material1_idx` (`material_id` ASC), INDEX `fk_proceso_has_material_proceso1_idx` (`proceso_id` ASC), CONSTRAINT `fk_proceso_has_material_proceso1` FOREIGN KEY (`proceso_id`) REFERENCES `daju_2004`.`proceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_has_material_material1` FOREIGN KEY (`material_id`) REFERENCES `daju_2004`.`material` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`estados` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`estados` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`estados` ( `id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `descripcion` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`prioridades` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`prioridades` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`prioridades` ( `id` INT NOT NULL, `name` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`ordens` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`ordens` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`ordens` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `cantidad` INT NULL, `defectuosos` INT NULL, `fecha_creacion` DATETIME NULL, `fecha_terminacion` DATETIME NULL, `estado_id` MEDIUMINT UNSIGNED NULL, `centro_id` INT UNSIGNED NULL, `proceso_id` INT UNSIGNED NOT NULL, `coste_operario` FLOAT NULL, `observaciones` VARCHAR(255) NULL, `prioridade_id` INT NULL, `atributos` LONGTEXT NULL, PRIMARY KEY (`id`), INDEX `fk_ordenes_produccion_centros1_idx` (`centro_id` ASC), INDEX `fk_ordenes_produccion_estados1_idx` (`estado_id` ASC), INDEX `fk_ordenes_produccion_proceso1_idx` (`proceso_id` ASC), INDEX `fk_ordens_prioridades1_idx` (`prioridade_id` ASC), CONSTRAINT `fk_ordenes_produccion_centros1` FOREIGN KEY (`centro_id`) REFERENCES `daju_2004`.`centros` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ordenes_produccion_estados1` FOREIGN KEY (`estado_id`) REFERENCES `daju_2004`.`estados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ordenes_produccion_proceso1` FOREIGN KEY (`proceso_id`) REFERENCES `daju_2004`.`proceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_ordens_prioridades1` FOREIGN KEY (`prioridade_id`) REFERENCES `daju_2004`.`prioridades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB COMMENT = 'orden de produccion o de trabajo.\nSe relaciona con el proceso, donde se describen que tipos de materiales y productos se gastan y cuanto salen.\nquiero relacionar también las piezas ok y no ok .'; -- ----------------------------------------------------- -- Table `daju_2004`.`pedidos_empresas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`pedidos_empresas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`pedidos_empresas` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `proveedores_cliente_id` INT UNSIGNED NULL, `fecha` DATETIME NULL, `albaran` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, `terminado` TINYINT(1) NULL, PRIMARY KEY (`id`), INDEX `fk_pedidos_empresa_proveedores_clientes1_idx` (`proveedores_cliente_id` ASC), CONSTRAINT `fk_pedidos_empresa_proveedores_clientes1` FOREIGN KEY (`proveedores_cliente_id`) REFERENCES `daju_2004`.`proveedores_clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`envios` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`envios` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`envios` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proveedores_cliente_id` INT UNSIGNED NULL, `fecha_pedido` DATETIME NULL, `fecha_envio` DATETIME NULL, `albaran` VARCHAR(255) NULL, `pedidos_empresa_id` INT UNSIGNED NULL, `centro_id` INT UNSIGNED NULL, `fecha_entrega` DATETIME NULL, `observaciones` VARCHAR(255) NULL, `direccione_id` INT UNSIGNED NULL, PRIMARY KEY (`id`), INDEX `fk_salidas_productos_proveedores_clientes1_idx` (`proveedores_cliente_id` ASC), INDEX `fk_salidas_productos_pedidos_empresa1_idx` (`pedidos_empresa_id` ASC), INDEX `fk_salidas_productos_centros1_idx` (`centro_id` ASC), INDEX `fk_salidas_objetos_direcciones1_idx` (`direccione_id` ASC), CONSTRAINT `fk_salidas_productos_proveedores_clientes1` FOREIGN KEY (`proveedores_cliente_id`) REFERENCES `daju_2004`.`proveedores_clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_salidas_productos_pedidos_empresa1` FOREIGN KEY (`pedidos_empresa_id`) REFERENCES `daju_2004`.`pedidos_empresas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_salidas_productos_centros1` FOREIGN KEY (`centro_id`) REFERENCES `daju_2004`.`centros` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_salidas_objetos_direcciones1` FOREIGN KEY (`direccione_id`) REFERENCES `daju_2004`.`direcciones` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`objetos` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`objetos` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`objetos` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NULL, `producto_id` INT UNSIGNED NULL, `numero_serie` INT NULL, `referencia` VARCHAR(255) NULL, `orden_id` INT UNSIGNED NOT NULL, `lote` VARCHAR(255) NULL, `localizacione_id` INT UNSIGNED NOT NULL, `coste` FLOAT NULL, `defectuosos` INT NULL, `peso` FLOAT NULL, `observaciones` VARCHAR(255) NULL, `envio_id` INT UNSIGNED NULL, PRIMARY KEY (`id`), INDEX `fk_productos_producto1_idx` (`producto_id` ASC), INDEX `fk_objetos_ordens1_idx` (`orden_id` ASC), INDEX `fk_objetos_localizaciones1_idx` (`localizacione_id` ASC), INDEX `fk_objetos_envios1_idx` (`envio_id` ASC), CONSTRAINT `fk_productos_producto1` FOREIGN KEY (`producto_id`) REFERENCES `daju_2004`.`producto` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_objetos_ordens1` FOREIGN KEY (`orden_id`) REFERENCES `daju_2004`.`ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_objetos_localizaciones1` FOREIGN KEY (`localizacione_id`) REFERENCES `daju_2004`.`localizaciones` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_objetos_envios1` FOREIGN KEY (`envio_id`) REFERENCES `daju_2004`.`envios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`maquinas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`maquinas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`maquinas` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, `coste_operacion` FLOAT NULL, `coste_tiempo` FLOAT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`utensilios` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`utensilios` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`utensilios` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `referencia` VARCHAR(255) NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`pedidos_productos_detalle` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`pedidos_productos_detalle` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`pedidos_productos_detalle` ( `id` INT UNSIGNED NOT NULL, `pedidos_empresa_id` INT UNSIGNED NULL, `producto_id` INT UNSIGNED NULL, `cantidad` INT NULL, `fecha` DATETIME NULL, `observaciones` VARCHAR(255) NULL, `prioridade_id` INT NULL, `terminado` TINYINT(1) NULL, PRIMARY KEY (`id`), INDEX `fk_pedidos_empresas_producto_prioridades1_idx` (`prioridade_id` ASC), INDEX `fk_pedidos_productos_detalle_pedidos_empresas1_idx` (`pedidos_empresa_id` ASC), INDEX `fk_pedidos_productos_detalle_producto1_idx` (`producto_id` ASC), CONSTRAINT `fk_pedidos_empresas_producto_prioridades1` FOREIGN KEY (`prioridade_id`) REFERENCES `daju_2004`.`prioridades` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_pedidos_productos_detalle_pedidos_empresas1` FOREIGN KEY (`pedidos_empresa_id`) REFERENCES `daju_2004`.`pedidos_empresas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_pedidos_productos_detalle_producto1` FOREIGN KEY (`producto_id`) REFERENCES `daju_2004`.`producto` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`estados_de_ordens` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`estados_de_ordens` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`estados_de_ordens` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `orden_id` INT UNSIGNED NULL, `estado_id` MEDIUMINT UNSIGNED NULL, `fecha_inicio` DATETIME NULL, `fecha_fin` DATETIME NULL, `descripcion` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_estados_de_ordenes_ordens1_idx` (`orden_id` ASC), INDEX `fk_estados_de_ordenes_estados1_idx` (`estado_id` ASC), CONSTRAINT `fk_estados_de_ordenes_ordens1` FOREIGN KEY (`orden_id`) REFERENCES `daju_2004`.`ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_estados_de_ordenes_estados1` FOREIGN KEY (`estado_id`) REFERENCES `daju_2004`.`estados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`users` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`users` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`users` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL, `apellidos` VARCHAR(255) NULL, `username` VARCHAR(45) NOT NULL, `password` VARCHAR(255) NOT NULL, `email` VARCHAR(45) NULL, `direccion` VARCHAR(45) NULL, `tipo` VARCHAR(45) NULL, `coste_operacion` FLOAT NULL, `coste_tiempo` FLOAT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`usuarios_en_estados_orden` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`usuarios_en_estados_orden` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`usuarios_en_estados_orden` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `estados_de_orden_id` INT UNSIGNED NULL, `user_id` INT UNSIGNED NULL, `parte` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_usuarios_en_estados_orden_estados_de_ordens1_idx` (`estados_de_orden_id` ASC), INDEX `fk_usuarios_en_estados_orden_usuarios1_idx` (`user_id` ASC), CONSTRAINT `fk_usuarios_en_estados_orden_estados_de_ordens1` FOREIGN KEY (`estados_de_orden_id`) REFERENCES `daju_2004`.`estados_de_ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_usuarios_en_estados_orden_usuarios1` FOREIGN KEY (`user_id`) REFERENCES `daju_2004`.`users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`maquinas_usadas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`maquinas_usadas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`maquinas_usadas` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `estados_de_orden_id` INT UNSIGNED NULL, `maquina_id` INT UNSIGNED NULL, `operaciones` INT NULL, `uso` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_maquinas_usadas_estados_de_ordens1_idx` (`estados_de_orden_id` ASC), INDEX `fk_maquinas_usadas_maquinas1_idx` (`maquina_id` ASC), CONSTRAINT `fk_maquinas_usadas_estados_de_ordens1` FOREIGN KEY (`estados_de_orden_id`) REFERENCES `daju_2004`.`estados_de_ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_maquinas_usadas_maquinas1` FOREIGN KEY (`maquina_id`) REFERENCES `daju_2004`.`maquinas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`utensilios_usados` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`utensilios_usados` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`utensilios_usados` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `estados_de_orden_id` INT UNSIGNED NULL, `utensilio_id` INT UNSIGNED NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_utensilios_usados_estados_de_ordens1_idx` (`estados_de_orden_id` ASC), INDEX `fk_utensilios_usados_utensilios1_idx` (`utensilio_id` ASC), CONSTRAINT `fk_utensilios_usados_estados_de_ordens1` FOREIGN KEY (`estados_de_orden_id`) REFERENCES `daju_2004`.`estados_de_ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_utensilios_usados_utensilios1` FOREIGN KEY (`utensilio_id`) REFERENCES `daju_2004`.`utensilios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`proceso_producto_salida` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`proceso_producto_salida` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`proceso_producto_salida` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proceso_id` INT UNSIGNED NULL, `producto_id` INT UNSIGNED NULL, `cantidad` INT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_proceso_has_producto_producto2_idx` (`producto_id` ASC), INDEX `fk_proceso_has_producto_proceso2_idx` (`proceso_id` ASC), CONSTRAINT `fk_proceso_has_producto_proceso2` FOREIGN KEY (`proceso_id`) REFERENCES `daju_2004`.`proceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_proceso_has_producto_producto2` FOREIGN KEY (`producto_id`) REFERENCES `daju_2004`.`producto` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`materiales_entrada` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`materiales_entrada` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`materiales_entrada` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `objeto_id` INT UNSIGNED NULL, `materiale_id` INT UNSIGNED NULL, `cantidad_producida` INT NULL, `metros_gastados` FLOAT NULL, `metros_utiles` FLOAT NULL, `scrap` FLOAT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_objetos_has_materiales_materiales1_idx` (`materiale_id` ASC), INDEX `fk_objetos_has_materiales_objetos1_idx` (`objeto_id` ASC), CONSTRAINT `fk_objetos_has_materiales_objetos1` FOREIGN KEY (`objeto_id`) REFERENCES `daju_2004`.`objetos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_objetos_has_materiales_materiales1` FOREIGN KEY (`materiale_id`) REFERENCES `daju_2004`.`materiales` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`objetos_entrada` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`objetos_entrada` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`objetos_entrada` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `entrada_id` INT UNSIGNED NULL, `objeto_id` INT UNSIGNED NULL, `cantidad_entrada` INT NULL, `cantidad_producida` INT NULL, `observaciones` VARCHAR(255) NULL, PRIMARY KEY (`id`), INDEX `fk_objetos_has_objetos_objetos2_idx` (`objeto_id` ASC), INDEX `fk_objetos_has_objetos_objetos1_idx` (`entrada_id` ASC), CONSTRAINT `fk_objetos_has_objetos_objetos1` FOREIGN KEY (`entrada_id`) REFERENCES `daju_2004`.`objetos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_objetos_has_objetos_objetos2` FOREIGN KEY (`objeto_id`) REFERENCES `daju_2004`.`objetos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`subproceso` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`subproceso` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`subproceso` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `proceso_id` INT UNSIGNED NULL, `name` VARCHAR(255) NULL, `segundos_inicio` INT NULL, `segundos_duracion` INT NULL, `descripcion` VARCHAR(2245) NULL, PRIMARY KEY (`id`), INDEX `fk_subproceso_proceso1_idx` (`proceso_id` ASC), CONSTRAINT `fk_subproceso_proceso1` FOREIGN KEY (`proceso_id`) REFERENCES `daju_2004`.`proceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `daju_2004`.`tareas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `daju_2004`.`tareas` ; CREATE TABLE IF NOT EXISTS `daju_2004`.`tareas` ( `id` INT UNSIGNED NOT NULL, `subproceso_id` INT UNSIGNED NULL, `orden_id` INT UNSIGNED NULL, `segundos_duracion` INT NULL, PRIMARY KEY (`id`), INDEX `fk_tareas_subproceso1_idx` (`subproceso_id` ASC), INDEX `fk_tareas_ordens1_idx` (`orden_id` ASC), CONSTRAINT `fk_tareas_subproceso1` FOREIGN KEY (`subproceso_id`) REFERENCES `daju_2004`.`subproceso` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_tareas_ordens1` FOREIGN KEY (`orden_id`) REFERENCES `daju_2004`.`ordens` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
DROP TABLE IF EXISTS User ; CREATE TABLE User (user_id SERIAL NOT NULL, username CHAR(256), password CHAR(256), quota BIGINT, priority INT, subscription_date TIMESTAMP WITH TIME ZONE, PRIMARY KEY (user_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Observation_sequence ; CREATE TYPE obs_state ENUM ('pending','running','done','outdated'); CREATE TABLE Observation_sequence (observation_id SERIAL NOT NULL, observation_state OBS_STATE, exposure_time INT, observation_attempts SMALLINT, request_id SERIAL NOT NULL, PRIMARY KEY (request_id, observation_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Request ; CREATE TABLE Request (request_id SERIAL NOT NULL, request_name CHAR(256), request_target CHAR(256), target_dec FLOAT, target_ra FLOAT, request_state OBS_STATE, duration INT, observation_interval_start TIMESTAMP, observation_interval_end TIMESTAMP, observation_repetition INT, observation_period BIGINT, minimum_height FLOAT, minimum_moon_distance FLOAT, PRIMARY KEY (request_id) ) ENGINE=InnoDB; CREATE TYPE equipment_state ENUM('operationnal','maintenance','broken'); DROP TABLE IF EXISTS Telescope ; CREATE TABLE Telescope (telescope_id SERIAL NOT NULL, telescope_reference CHAR(256), telescope_name CHAR(256), telescope_mounting CHAR(256), focal_distance FLOAT, telescope_opening FLOAT, telescope_state EQUIPMENT_STATE, camera_camera_id SERIAL, PRIMARY KEY (telescope_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Camera ; CREATE TABLE Camera (camera_id SERIAL NOT NULL, camera_reference CHAR(256), camera_name CHAR(256), camera_sensor CHAR(256), sensor_size FLOAT, pixel_size FLOAT, camera_gain FLOAT, camera_state EQUIPMENT_STATE, telescope_telescope_id SERIAL, PRIMARY KEY (camera_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Filter_type ; CREATE TABLE Filter_type (filter_type_id SERIAL NOT NULL, filter_type_name CHAR(256), filter_type_description TEXT, PRIMARY KEY (filter_type_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Filter ; CREATE TABLE Filter (filter_id SERIAL NOT NULL, filter_state EQUIPMENT_STATE, filter_reference CHAR(256), filter_name CHAR(256), filter_type_id BIGINT, telescope_telescope_id SERIAL, PRIMARY KEY (filter_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS Alert ; CREATE TABLE Alert (alert_id SERIAL NOT NULL, alert_type CHAR(256), alert_name CHAR(256), alert_description LONGTEXT, PRIMARY KEY (alert_id) ) ENGINE=InnoDB; /*********************************** Associations *************************************/ DROP TABLE IF EXISTS user_request ; CREATE TABLE user_request (user_id SERIAL NOT NULL, request_id SERIAL NOT NULL, submission_date TIMESTAMP WITH TIME ZONE, PRIMARY KEY (user_id, request_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS observation_telescope ; CREATE TABLE observation_telescope (observation_id SERIAL NOT NULL, telescope_id SERIAL NOT NULL, observation_date_start TIMESTAMP, observation_date_end TIMESTAMP, PRIMARY KEY (observation_id, telescope_id) ) ENGINE=InnoDB; DROP TABLE IF EXISTS observation_filter ; CREATE TABLE observation_filter (filter_type_id SERIAL NOT NULL, observation_id SERIAL NOT NULL, filter_user_exposure_time INT, PRIMARY KEY (filter_type_id, observation_id) ) ENGINE=InnoDB; /*Done part*/ DROP TABLE IF EXISTS alert_request ; CREATE TABLE alert_request (request_id SERIAL NOT NULL, alert_id SERIAL NOT NULL, alert_date TIMESTAMP WITH TIME ZONE, PRIMARY KEY (request_id, alert_id) ) ENGINE=InnoDB; ALTER TABLE Observation_sequence ADD CONSTRAINT FK_Observation_sequence_request_id FOREIGN KEY (request_id) REFERENCES Request (request_id); ALTER TABLE Telescope ADD CONSTRAINT FK_Telescope_camera_id FOREIGN KEY (camera_id) REFERENCES Camera (camera_id); ALTER TABLE Camera ADD CONSTRAINT FK_Camera_telescope_id FOREIGN KEY (telescope_id) REFERENCES Telescope (telescope_id); ALTER TABLE Filter ADD CONSTRAINT FK_Filter_filter_type_id FOREIGN KEY (filter_type_id) REFERENCES Filter_type (filter_type_id); ALTER TABLE Filter ADD CONSTRAINT FK_Filter_telescope_id FOREIGN KEY (telescope_id) REFERENCES Telescope (telescope_id); ALTER TABLE user_request ADD CONSTRAINT FK_user_request_user_id FOREIGN KEY (user_id) REFERENCES User (user_id); ALTER TABLE user_request ADD CONSTRAINT FK_user_request_request_id FOREIGN KEY (request_id) REFERENCES Request (request_id); ALTER TABLE observation_telescope ADD CONSTRAINT FK_observation_telescope_observation_id FOREIGN KEY (observation_id) REFERENCES Observation_sequence (observation_id); ALTER TABLE observation_telescope ADD CONSTRAINT FK_observation_telescope_telescope_id FOREIGN KEY (telescope_id) REFERENCES Telescope (telescope_id); ALTER TABLE observation_filter ADD CONSTRAINT FK_observation_filter_filter_type_id FOREIGN KEY (filter_type_id) REFERENCES Filter_type (filter_type_id); ALTER TABLE observation_filter ADD CONSTRAINT FK_observation_filter_observation_id FOREIGN KEY (observation_id) REFERENCES Observation_sequence (observation_id); ALTER TABLE alert_request ADD CONSTRAINT FK_alert_request_request_id FOREIGN KEY (request_id) REFERENCES Request (request_id); ALTER TABLE alert_request ADD CONSTRAINT FK_alert_request_alert_id FOREIGN KEY (alert_id) REFERENCES Alert (alert_id);
DROP SCHEMA IF EXISTS kwiaciarnia CASCADE; CREATE SCHEMA IF NOT EXISTS kwiaciarnia; CREATE TABLE kwiaciarnia.klienci ( idklienta VARCHAR(10) PRIMARY KEY, haslo VARCHAR(10) CHECK (length(haslo) >= 4), /* PLAIN TEXT */ nazwa VARCHAR(40) NOT NULL, miasto VARCHAR(40) NOT NULL, kod VARCHAR(6) NOT NULL, adres VARCHAR(40) NOT NULL, email VARCHAR(40) NOT NULL, telefon VARCHAR(16) NOT NULL, fax VARCHAR(16), nip VARCHAR(13) CHECK (length(nip) = 13), regon VARCHAR(9) CHECK (length(regon) = 9) ); CREATE TABLE kwiaciarnia.kompozycje ( idkompozycji CHAR(5) CHECK (length(idkompozycji) = 5) PRIMARY KEY, nazwa VARCHAR(40) NOT NULL, opis VARCHAR(100), cena NUMERIC(7, 2) CHECK (cena >= 40.00), minimum INTEGER, stan INTEGER ); CREATE TABLE kwiaciarnia.odbiorcy ( idodbiorcy SERIAL PRIMARY KEY, nazwa VARCHAR(40) NOT NULL, miasto VARCHAR(40) NOT NULL, kod VARCHAR(6) CHECK (length(kod) = 6) NOT NULL, adres VARCHAR(40) NOT NULL ); CREATE TABLE kwiaciarnia.zamowienia ( idzamowienia INTEGER PRIMARY KEY, idklienta VARCHAR(10) REFERENCES kwiaciarnia.klienci, idodbiorcy INTEGER REFERENCES kwiaciarnia.odbiorcy, idkompozycji CHAR(5) CHECK (length(idkompozycji) = 5) REFERENCES kwiaciarnia.kompozycje, termin DATE NOT NULL, cena NUMERIC(7, 2), zaplacone BOOLEAN, uwagi VARCHAR(200) ); CREATE TABLE kwiaciarnia.historia ( idzamowienia INTEGER PRIMARY KEY, idklienta VARCHAR(10), idkompozycji CHAR(5) CHECK (length(idkompozycji) = 5), cena NUMERIC(7, 2), termin DATE ); CREATE TABLE kwiaciarnia.zapotrzebowanie ( idkompozycji CHAR(5) CHECK (length(idkompozycji) = 5) PRIMARY KEY REFERENCES kwiaciarnia.kompozycje, data DATE );
/** CREATE DATABASE zf2course CHARACTER SET UTF8 COLLATE utf8_general_ci; **/ CREATE TABLE categories ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(200) NOT NULL UNIQUE, created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP );
-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64) -- -- Host: localhost Database: questionbank -- ------------------------------------------------------ -- Server version 8.0.17 /*!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 */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `comments` -- DROP TABLE IF EXISTS `comments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `comments` ( `questionId` int(3) NOT NULL, `anwers` varchar(255) NOT NULL, `username` varchar(255) NOT NULL, PRIMARY KEY (`questionId`), UNIQUE KEY `questionId` (`questionId`), CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`questionId`) REFERENCES `question` (`questionId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `comments` -- LOCK TABLES `comments` WRITE; /*!40000 ALTER TABLE `comments` DISABLE KEYS */; INSERT INTO `comments` VALUES (0,'你猜一猜我回复了什么啊!','a'),(1,'你猜一猜我回复了什么','andmin'); /*!40000 ALTER TABLE `comments` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `question` -- DROP TABLE IF EXISTS `question`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `question` ( `questionId` int(3) NOT NULL, `questionNum` int(3) NOT NULL, `questionName` varchar(255) NOT NULL, `zanNum` int(3) NOT NULL DEFAULT '0', `watchNum` int(3) NOT NULL DEFAULT '0', `commentsNum` int(3) NOT NULL DEFAULT '0', PRIMARY KEY (`questionId`), UNIQUE KEY `questionId` (`questionId`), UNIQUE KEY `questionName` (`questionName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `question` -- LOCK TABLES `question` WRITE; /*!40000 ALTER TABLE `question` DISABLE KEYS */; INSERT INTO `question` VALUES (0,20,'JS基础',67,982,30),(1,32,'Vue',167,1132,81); /*!40000 ALTER TABLE `question` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `questioncontent` -- DROP TABLE IF EXISTS `questioncontent`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `questioncontent` ( `questionId` int(3) NOT NULL, `questionCont` varchar(255) NOT NULL, `quesetionAnser` varchar(255) DEFAULT NULL, `abcd` varchar(5) DEFAULT NULL, `code` varchar(255) NOT NULL, KEY `questionId` (`questionId`), CONSTRAINT `questioncontent_ibfk_1` FOREIGN KEY (`questionId`) REFERENCES `question` (`questionId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `questioncontent` -- LOCK TABLES `questioncontent` WRITE; /*!40000 ALTER TABLE `questioncontent` DISABLE KEYS */; INSERT INTO `questioncontent` VALUES (1,'将数组扁平化并去除其中重复数据,最终得到一个升序且不重复的数组',NULL,NULL,'var arr=[[1,2,2],[3,4,5,5],[6,7,8,9]]'),(1,'我们需要向对线person添加什么,以致执行[...person]时获得形如[\'Lydia Hallie\',21]的输出?','对面默认并不是可迭代的,巴拉巴拉小魔仙,全身变','C','const person={name:\'Lydia Hallie\',age:21} [...person]'),(0,'这里是题目1号',NULL,NULL,'console.log(\'hello world\')'),(0,'我们需要??出??','这是参考答案,巴拉巴拉黑魔仙,全身变','A','alert(\'Are you ok?!\')'); /*!40000 ALTER TABLE `questioncontent` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `time` -- -- -- Dumping data for table `time` -- LOCK TABLES `time` WRITE; /*!40000 ALTER TABLE `time` DISABLE KEYS */; /*!40000 ALTER TABLE `time` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `userpwd` varchar(255) NOT NULL, `solveNum` int(3) NOT NULL DEFAULT '0', `dayNum` int(5) NOT NULL DEFAULT '0', `ideaNum` int(5) NOT NULL DEFAULT '0', `role` varchar(10) DEFAULT 'editor', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` VALUES (0,'admin','root',-1,-1,-1,'admin'),(1,'a','123',10,10,10,'editor'),(5,'b','123',0,0,0,'editor'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-03-14 0:56:45
INSERT INTO arrangements(balcony,rooms,toilets,floors,furniture,pool,garden) VALUES ('false',2,2,1,'true','false','false') ,('true',7,2,2,'false','false','false') ,('true',5,2,1,'false','false','true') ,('false',7,2,2,'true','true','true') ,('true',5,1,1,'false','false','false') ,('true',2,1,2,'true','true','true') ,('true',5,2,2,'true','false','false') ,('false',4,2,1,'true','true','false') ,('true',4,2,1,'true','true','false') ,('true',4,1,2,'true','true','true') ,('true',2,1,2,'true','false','true') ,('false',1,2,2,'true','true','true') ,('true',6,1,2,'false','true','false') ,('false',4,1,1,'true','false','false') ,('true',4,1,2,'false','false','false') ,('true',3,1,1,'false','false','true') ,('true',1,1,2,'false','false','false') ,('true',7,1,2,'false','false','false') ,('false',7,2,1,'false','false','true') ,('true',1,2,1,'false','true','false') ,('false',6,2,2,'false','true','false') ,('true',6,2,2,'true','true','true') ,('true',4,1,1,'false','true','true') ,('false',4,1,2,'true','true','false') ,('false',2,1,2,'false','true','false') ,('false',5,2,2,'true','false','false') ,('true',6,2,1,'false','false','true') ,('true',7,1,2,'true','true','true') ,('true',3,2,2,'true','true','true') ,('false',6,1,1,'true','false','false') ,('true',6,2,1,'false','false','false') ,('true',4,1,2,'false','true','false') ,('true',2,1,1,'true','true','true') ,('true',5,1,2,'true','true','false') ,('false',6,2,2,'true','true','true') ,('false',7,1,2,'true','false','false') ,('false',4,2,2,'true','true','true') ,('false',7,2,2,'true','false','false') ,('false',1,2,2,'false','true','false') ,('false',3,2,1,'false','true','true') ,('false',3,1,1,'true','true','true') ,('true',4,2,2,'false','false','false') ,('false',6,2,2,'true','false','true') ,('false',1,1,1,'true','true','false') ,('false',1,1,2,'true','true','true') ,('true',6,1,1,'true','false','true') ,('false',7,1,1,'true','false','true') ,('false',1,1,2,'true','false','false') ,('true',4,1,1,'false','false','true') ,('false',5,1,1,'false','false','false') ,('false',1,1,2,'false','false','false') ,('false',2,1,1,'false','false','true') ,('true',3,2,1,'true','false','false') ,('true',1,1,1,'false','true','true') ,('true',5,1,2,'true','false','true') ,('false',3,1,1,'false','false','false') ,('true',1,2,1,'true','true','false') ,('true',1,1,2,'true','true','false') ,('true',4,1,2,'false','true','true') ,('true',4,2,2,'false','true','false') ,('true',7,1,1,'false','false','false') ,('true',2,1,1,'false','false','false') ,('true',7,2,1,'false','false','false') ,('false',1,2,1,'true','false','true') ,('true',3,1,1,'true','true','false') ,('true',5,1,1,'false','true','true') ,('true',5,2,2,'true','true','false') ,('false',5,2,1,'false','false','false') ,('false',3,2,2,'true','false','true') ,('true',6,2,1,'true','true','true') ,('false',2,2,2,'false','true','false') ,('false',6,1,1,'true','true','true') ,('false',7,1,1,'false','false','false') ,('true',1,2,1,'false','true','true') ,('false',3,2,1,'true','false','true') ,('true',4,2,2,'false','true','true') ,('true',4,1,2,'true','false','true') ,('false',7,1,2,'false','true','false') ,('true',2,1,1,'true','false','true') ,('false',7,1,2,'true','true','false') ,('true',1,2,2,'true','false','false') ,('true',4,1,2,'true','false','false') ,('false',7,2,2,'false','true','true') ,('true',5,2,1,'false','false','false') ,('false',4,2,2,'false','false','true') ,('false',4,1,1,'true','true','false') ,('false',6,1,1,'true','true','false') ,('true',5,1,1,'true','false','true') ,('false',7,2,2,'false','false','true') ,('true',7,1,1,'true','true','false') ,('false',2,2,1,'false','false','false') ,('false',4,2,1,'true','true','true') ,('false',3,1,2,'true','false','false') ,('false',5,1,2,'false','true','true') ,('false',3,2,2,'true','false','false') ,('true',5,2,2,'false','false','true') ,('true',7,2,2,'true','false','false') ,('false',2,1,2,'true','false','true') ,('false',2,1,1,'false','true','true') ,('true',1,2,2,'false','true','true') ,('true',3,1,2,'true','true','false') ,('false',1,1,1,'false','true','false') ,('true',2,1,1,'true','false','false') ,('false',2,2,2,'true','false','false') ,('false',2,1,1,'true','false','false') ,('false',5,1,2,'true','true','true') ,('false',1,2,1,'false','true','true') ,('false',7,2,1,'true','true','false') ,('true',3,2,1,'false','false','false') ,('false',5,1,1,'false','false','true') ,('true',3,2,1,'false','true','true') ,('false',1,2,2,'true','true','false') ,('false',3,2,2,'false','true','true') ,('false',1,1,2,'true','true','false') ,('true',5,1,2,'true','true','true') ,('true',2,2,1,'false','false','false') ,('true',5,1,1,'true','true','true') ,('true',4,2,1,'false','true','false') ,('false',2,2,1,'true','false','true') ,('true',2,1,1,'false','true','true') ,('true',5,2,1,'true','false','false') ,('true',4,2,2,'true','false','true') ,('true',6,2,2,'false','false','false') ,('true',4,2,1,'false','false','false') ,('false',6,2,1,'false','true','true') ,('false',2,1,1,'false','false','false') ,('false',4,2,1,'false','true','true') ,('false',6,2,1,'true','true','true') ,('true',1,1,1,'true','false','true') ,('false',2,2,2,'false','true','true') ,('false',4,2,2,'true','false','true') ,('true',5,2,1,'false','true','true') ,('false',5,2,1,'true','true','true') ,('true',6,1,2,'false','true','true') ,('true',3,1,1,'false','true','false') ,('true',7,2,1,'false','true','true') ,('false',3,1,2,'true','true','false') ,('false',4,1,1,'true','true','true') ,('false',1,2,1,'false','false','true') ,('false',6,2,1,'true','true','false') ,('false',1,1,1,'true','false','false') ,('true',4,2,1,'true','false','true') ,('false',1,1,1,'false','false','false') ,('true',1,1,2,'true','false','true') ,('true',4,2,1,'true','true','true') ,('true',5,2,2,'true','true','true') ,('true',4,2,2,'false','false','true') ,('true',2,2,2,'true','false','true') ,('false',3,1,1,'true','false','false') ,('false',7,1,2,'false','true','true') ,('true',2,2,1,'true','true','true') ,('true',7,1,2,'false','true','false') ,('false',6,2,2,'false','true','true') ,('true',5,1,2,'false','false','true') ,('true',7,2,1,'false','true','false') ,('false',3,1,1,'false','true','true') ,('true',3,2,2,'false','false','true') ,('true',3,1,2,'true','false','true') ,('false',7,2,2,'false','false','false') ,('true',6,1,1,'true','true','true') ,('true',7,1,1,'false','true','true') ,('true',6,1,1,'true','true','false') ,('false',3,1,2,'false','false','true') ,('false',6,2,2,'true','false','false') ,('false',3,1,2,'false','false','false') ,('true',6,1,2,'false','false','true') ,('false',5,1,2,'false','false','false') ,('false',1,2,1,'false','true','false') ,('true',7,1,1,'false','true','false') ,('true',2,2,1,'false','true','true') ,('false',5,2,1,'true','false','false') ,('false',5,1,1,'true','true','false') ,('false',1,1,2,'true','false','true') ,('false',3,2,1,'true','false','false') ,('false',6,1,2,'true','false','true') ,('true',1,1,2,'false','true','true') ,('true',1,1,1,'false','true','false') ,('true',7,1,2,'false','false','true') ,('true',2,2,2,'true','false','false') ,('true',5,1,2,'false','true','true') ,('false',1,1,2,'false','false','true') ,('false',1,1,1,'true','true','true') ,('false',1,2,2,'false','false','false') ,('true',7,1,1,'false','false','true') ,('true',1,1,2,'false','true','false') ,('false',2,1,2,'false','false','true') ,('false',3,2,2,'true','true','false') ,('true',7,2,1,'true','true','false') ,('true',2,1,1,'false','true','false') ,('false',4,1,1,'false','true','true') ,('false',1,2,1,'false','false','false') ,('false',3,1,2,'false','true','false') ,('true',2,1,2,'false','false','false') ,('false',5,1,1,'false','true','false') ,('true',6,1,2,'true','false','false') ,('false',6,1,1,'false','true','false') ,('false',5,2,2,'false','true','false') ,('false',4,2,2,'false','true','false') ,('false',7,2,1,'false','true','false') ,('true',4,1,1,'false','true','false') ,('false',1,1,2,'false','true','true') ,('false',3,2,2,'false','false','false') ,('false',5,2,2,'false','false','true') ,('true',1,1,2,'true','true','true') ,('true',7,2,2,'false','true','false') ,('true',7,2,1,'false','false','true') ,('true',4,1,1,'false','false','false') ,('true',6,1,2,'true','false','true') ,('true',1,1,1,'true','true','true') ,('false',6,2,2,'false','false','false') ,('false',2,2,1,'false','false','true') ,('false',3,1,1,'true','true','false') ,('false',5,2,1,'true','false','true') ,('false',1,1,1,'false','false','true') ,('true',6,1,2,'true','true','false') ,('false',3,2,1,'true','true','true') ,('false',6,1,1,'false','false','true') ,('false',6,2,2,'true','true','false') ,('false',7,1,1,'false','false','true') ,('false',3,2,2,'false','true','false') ,('false',4,1,1,'false','true','false') ,('true',3,2,1,'true','true','false') ,('true',2,2,2,'false','false','false') ,('false',2,2,1,'false','true','false') ,('true',4,1,1,'true','true','true') ,('true',7,2,1,'true','false','false') ,('true',6,2,2,'false','false','true') ,('true',7,1,1,'true','true','true') ,('true',7,1,2,'true','false','false') ,('true',1,1,1,'false','false','false') ,('true',3,1,2,'false','false','false') ,('false',4,2,2,'true','true','false') ,('true',2,1,2,'false','true','false') ,('false',6,2,1,'true','false','false') ,('true',3,2,2,'true','false','true') ,('false',3,2,2,'false','false','true') ,('false',2,2,2,'true','false','true') ,('false',7,1,1,'false','true','true') ,('true',7,1,1,'true','false','false') ,('false',6,1,1,'false','false','false') ,('false',2,2,1,'true','true','true') ,('true',3,1,1,'true','false','true') ,('true',5,1,2,'false','false','false') ,('true',4,1,2,'true','true','false') ,('false',6,2,1,'false','false','true') ,('true',7,1,1,'true','false','true') ,('false',5,2,1,'false','false','true') ,('false',7,2,1,'false','true','true') ,('true',1,2,1,'true','false','true') ,('true',3,1,2,'true','false','false') ,('true',2,2,2,'false','true','false') ,('true',5,2,2,'false','false','false') ,('false',1,2,1,'true','true','false') ,('false',6,1,2,'true','true','true') ,('false',3,2,1,'false','false','true') ,('false',1,2,2,'true','false','false') ,('true',6,1,1,'false','true','true') ,('false',6,1,2,'true','true','false') ,('true',1,2,2,'true','false','true') ,('true',1,2,1,'false','false','false') ,('true',3,1,1,'true','false','false') ,('false',2,1,2,'false','true','true') ,('true',5,1,1,'true','true','false') ,('false',7,2,1,'true','false','true') ,('true',1,1,2,'true','false','false') ,('false',6,1,2,'false','false','false') ,('false',4,2,1,'true','false','true') ,('true',6,1,1,'true','false','false') ,('false',6,1,2,'false','false','true') ,('true',1,2,2,'true','true','false') ,('false',2,2,2,'false','false','false') ,('false',7,1,1,'true','true','true') ,('true',4,2,1,'true','false','false') ,('false',6,2,1,'false','true','false') ,('false',3,2,2,'true','true','true') ,('true',3,2,2,'false','false','false') ,('false',6,1,2,'false','true','true') ,('false',4,1,2,'false','false','false') ,('true',3,1,1,'true','true','true') ,('true',4,1,1,'true','false','false') ,('true',3,1,2,'true','true','true') ,('true',2,2,1,'true','false','true') ,('false',5,1,2,'true','false','false') ,('true',6,1,1,'false','true','false') ,('false',5,2,2,'true','false','true') ,('true',2,1,2,'false','false','true') ,('false',1,1,2,'false','true','false') ,('false',5,2,1,'false','true','false') ,('true',6,2,2,'true','true','false') ,('false',2,1,1,'false','true','false') ,('true',1,2,1,'true','true','true') ,('true',6,1,2,'true','true','true') ,('true',1,1,1,'false','false','true') ,('true',4,2,1,'false','true','true') ,('true',3,2,1,'false','false','true') ,('false',5,2,1,'false','true','true') ,('true',2,2,2,'false','true','true') ,('true',7,2,1,'true','true','true') ,('true',3,2,2,'true','false','false') ,('true',7,2,2,'false','false','true'); INSERT INTO arrangements(balcony,rooms,toilets,floors,furniture,pool,garden) VALUES ('false',2,1,2,'true','true','true') ,('true',2,1,1,'false','false','true') ,('false',5,2,1,'true','true','false') ,('true',3,1,2,'false','true','false') ,('false',3,1,2,'true','false','true') ,('true',5,2,1,'false','true','false') ,('false',3,1,2,'true','true','true') ,('false',7,1,2,'false','false','false') ,('true',5,2,2,'true','false','true') ,('false',3,2,1,'false','true','false') ,('false',1,2,2,'false','false','true') ,('false',5,2,2,'false','false','false') ,('true',2,1,2,'true','true','false') ,('false',1,2,1,'true','false','false') ,('true',3,1,1,'false','true','true') ,('false',4,1,1,'false','false','false') ,('true',5,2,1,'true','true','false') ,('true',4,1,2,'false','false','true') ,('true',1,2,2,'false','true','false') ,('false',5,1,2,'false','true','false') ,('false',5,1,2,'false','false','true') ,('false',2,1,1,'true','false','true') ,('false',2,1,1,'true','true','true') ,('false',4,1,1,'false','false','true') ,('true',1,2,2,'false','false','false') ,('false',6,1,2,'true','false','false') ,('false',1,2,2,'false','true','true') ,('false',4,2,1,'false','false','true') ,('true',5,1,1,'true','false','false') ,('false',7,1,2,'true','true','true') ,('false',5,1,1,'true','false','true') ,('true',3,1,1,'false','false','false') ,('true',7,1,2,'true','false','true') ,('true',4,2,2,'true','true','false') ,('true',1,2,2,'false','false','true') ,('true',6,1,1,'false','false','false') ,('false',2,1,2,'true','true','false') ,('false',2,1,1,'true','true','false') ,('true',1,2,1,'true','false','false') ,('true',3,2,1,'true','true','true') ,('false',1,2,1,'true','true','true') ,('false',4,2,2,'false','true','true') ,('false',2,1,2,'true','false','false') ,('false',3,1,1,'false','true','false') ,('true',1,1,1,'true','false','false') ,('true',6,2,2,'true','false','true') ,('false',5,1,1,'true','true','true') ,('true',1,2,2,'true','true','true') ,('true',5,2,2,'false','true','true') ,('false',5,1,2,'true','false','true') ,('true',4,1,1,'true','false','true') ,('true',5,1,2,'false','true','false') ,('true',1,1,2,'false','false','true') ,('true',3,2,2,'false','true','false') ,('false',4,1,2,'true','true','true') ,('false',2,2,2,'false','false','true') ,('false',4,1,1,'true','false','true') ,('false',4,2,1,'false','true','false') ,('true',4,2,1,'false','false','true') ,('false',2,2,2,'true','true','false') ,('false',4,2,1,'true','false','false') ,('true',2,1,1,'true','true','false') ,('true',3,2,1,'true','false','true') ,('true',6,2,2,'false','true','false') ,('true',6,1,1,'false','false','true') ,('true',6,2,1,'true','false','false') ,('true',5,2,1,'true','true','true') ,('false',4,2,2,'false','false','false') ,('false',3,1,1,'true','false','true') ,('false',6,2,1,'true','false','true') ,('true',5,2,1,'true','false','true') ,('false',7,1,1,'false','true','false') ,('true',7,2,2,'true','false','true') ,('false',4,2,1,'false','false','false') ,('true',2,1,2,'true','false','false') ,('false',4,1,2,'false','true','false') ,('false',6,1,2,'false','true','false') ,('true',6,1,2,'false','false','false') ,('true',5,1,2,'true','false','false') ,('false',6,1,1,'false','true','true') ,('true',2,2,1,'false','true','false') ,('true',2,2,2,'true','true','false') ,('false',3,2,1,'false','false','false') ,('true',6,2,1,'false','true','true') ,('true',7,1,2,'true','true','false') ,('false',7,1,2,'false','false','true') ,('true',2,2,1,'false','false','true') ,('true',5,1,1,'false','true','false') ,('false',2,2,1,'false','true','true') ,('false',5,1,1,'true','false','false') ,('true',5,1,1,'false','false','true') ,('false',7,2,2,'true','true','false') ,('false',4,1,2,'true','false','true') ,('true',3,2,2,'true','true','false') ,('true',4,2,2,'true','true','true') ,('false',3,1,1,'false','false','true') ,('true',7,2,2,'false','true','true') ,('true',7,2,2,'true','true','true') ,('false',2,2,1,'true','true','false') ,('true',7,2,1,'true','false','true') ,('true',4,2,2,'true','false','false') ,('false',1,1,1,'true','false','true') ,('true',4,1,1,'true','true','false') ,('false',2,2,2,'true','true','true') ,('false',2,1,2,'false','false','false') ,('true',2,2,2,'true','true','true') ,('false',4,1,2,'true','false','false') ,('true',1,2,1,'false','false','true') ,('true',7,2,2,'true','true','false') ,('true',2,2,2,'false','false','true') ,('true',6,2,1,'true','true','false') ,('true',3,2,2,'false','true','true') ,('false',6,1,1,'true','false','true') ,('true',6,2,1,'false','true','false') ,('false',5,2,2,'true','true','true') ,('false',7,2,2,'false','true','false') ,('true',2,2,1,'true','true','false') ,('false',1,1,1,'false','true','true') ,('false',4,1,2,'false','true','true') ,('false',7,1,2,'true','false','true') ,('false',6,2,1,'false','false','false') ,('false',6,2,2,'false','false','true') ,('false',4,1,2,'false','false','true') ,('false',4,2,2,'true','false','false') ,('true',6,2,2,'false','true','true') ,('true',3,1,2,'false','false','true') ,('true',5,2,2,'false','true','false') ,('true',1,1,1,'true','true','false') ,('false',3,1,2,'false','true','true') ,('false',5,1,2,'true','true','false') ,('true',2,1,2,'false','true','true') ,('false',5,1,1,'false','true','true') ,('false',7,2,2,'true','false','true') ,('true',3,1,2,'false','true','true') ,('false',7,2,1,'true','true','true') ,('false',7,2,1,'false','false','false') ,('false',5,2,2,'false','true','true') ,('true',6,2,2,'true','false','false') ,('false',5,2,2,'true','true','false') ,('true',7,1,2,'false','true','true') ,('true',3,2,1,'false','true','false') ,('false',7,1,1,'true','true','false') ,('true',6,2,1,'true','false','true') ,('false',1,2,2,'true','false','true') ,('true',2,2,1,'true','false','false') ,('false',7,1,1,'true','false','false') ,('false',7,2,1,'true','false','false') ,('false',3,2,1,'true','true','false');
drop table if exists working_committees; create table working_committees as (select committee_id, committee_name, committee_type, committee_subtype, party_descr as party_affiliation, candidate_work_phone as phone, concat(active_election, ' ', candidate_office_group,' ',raw_committees.candidate_office) as election_office, candidate_first_name ||' '|| candidate_last_name as candidate_name, candidate_email as candidate_email_address, concat('wk:', candidate_work_phone,' hm:', candidate_residence_phone, ' fx:', candidate_fax) as "candidate_work_phone_home_phone_fax", candidate_maling_address as candidate_address, concat(treasurer_first_name,' ',treasurer_last_name) as treasurer_name, concat('wk:',treasurer_work_phone,' fx:', treasurer_fax) as treasurer_work_phone_home_phone_fax, treasurer_mailing_address, web_address, measure from raw_committees left outer join working_candidate_filings on raw_committees.candidate_first_name = working_candidate_filings.first_name and raw_committees.candidate_last_name = working_candidate_filings.last_name); delete from working_committees where committee_id in (select id from raw_committees_scraped); insert into working_committees (select id as committee_id, name as committee_name, committee_type, pac_type as committee_subtype, candidate_party_affiliation as party_affiliation, campaign_phone as phone, candidate_election_office as election_office, candidate_name, candidate_email_address, candidate_work_phone_home_phone_fax, candidate_candidate_address as candidate_address, treasurer_name, treasurer_work_phone_home_phone_fax, treasurer_mailing_address, NULL as web_address from raw_committees_scraped); UPDATE working_committees SET phone = 'Candidate work/home/fax: '||candidate_work_phone_home_phone_fax WHERE phone IS NULL AND candidate_work_phone_home_phone_fax IS NOT NULL AND candidate_work_phone_home_phone_fax != 'wk: hm: fx:'; UPDATE working_committees SET phone = 'Treasurer work/fax: '||treasurer_work_phone_home_phone_fax WHERE phone IS NULL AND treasurer_work_phone_home_phone_fax IS NOT NULL AND treasurer_work_phone_home_phone_fax !='wk: fx:'; UPDATE working_committees SET phone = '(Phone number not found)' WHERE phone IS NULL OR phone = 'wk: hm: fx:'; ALTER TABLE working_committees ADD COLUMN simple_election text; UPDATE working_committees SET simple_election = regexp_replace(election_office, 'Primary |General ',''); UPDATE working_committees SET candidate_name = committee_name WHERE candidate_name = ' ' OR candidate_name is null; ALTER TABLE working_committees ADD COLUMN db_update_status text; UPDATE working_committees SET db_update_status = 'Last full update: 3/14/2014' WHERE committee_id IN (SELECT committee_id FROM raw_committees); UPDATE working_committees SET db_update_status = 'Last full update: 10/25/2014' WHERE committee_id IN (SELECT id FROM raw_committees_scraped); UPDATE working_committees SET db_update_status = (SELECT 'Last full update: '||sdate as smess FROM (SELECT id, MAX(scrape_date) AS sdate FROM import_dates GROUP BY id ) idat WHERE working_committees.committee_id = idat.id);
CREATE TABLE [actual].[u_happynow_response_data] ( [sys_id_value] NVARCHAR(255) NULL, [u_domain_id_value] NVARCHAR(40) NULL, [u_related_incident_value] NVARCHAR(255) NULL, [u_business_time_value] INT NULL, [u_feedback_text_value] NVARCHAR(MAX) NULL, [u_feedback_slug_value] NVARCHAR(255) NULL, [u_related_catalog_item_value] NVARCHAR(40) NULL, [u_caller_value] NVARCHAR(255) NULL, [u_feedback_type_value] NVARCHAR(40) NULL, [u_caller_company_value] NVARCHAR(255) NULL, [u_ticket_short_description_value] NVARCHAR(MAX) NULL, [sys_updated_on_value] DATETIME NULL, [u_lost_work_time_value] INT NULL, [u_score_value] INT NULL, [sys_updated_by_value] NVARCHAR(255) NULL, [u_mood_value] NVARCHAR(40) NULL, [u_severity_value] INT NULL, [sys_created_on_value] DATETIME NULL, [sys_domain_value] NVARCHAR(40) NULL, [u_task_value] NVARCHAR(255) NULL, [u_related_item_value] NVARCHAR(255) NULL, [u_caller_location_value] NVARCHAR(255) NULL, [u_related_assignment_groups_value] NVARCHAR(1000) NULL, [sys_created_by_value] NVARCHAR(255) NULL, [u_number_value] NVARCHAR(40) NULL, [u_provider_value] NVARCHAR(40) NULL, [u_caller_country_value] NVARCHAR(40) NULL, [u_duration_value] INT NULL, [u_reassignment_count_value] INT NULL, [u_questionnaire_type_value] NVARCHAR(40) NULL, [sys_mod_count_value] INT NULL, [u_resolved_at_value] DATETIME NULL, [u_resolved_by_user_value] NVARCHAR(255) NULL, [u_contact_type_value] NVARCHAR(40) NULL, [sys_tags_value] NVARCHAR(40) NULL, [u_ticket_id_value] NVARCHAR(40) NULL, [u_category_value] NVARCHAR(40) NULL, [u_service_value] NVARCHAR(40) NULL, [u_sub_category_value] NVARCHAR(40) NULL, [u_related_users_value] NVARCHAR(MAX) NULL, [u_closing_assignment_group_value] NVARCHAR(255) NULL, [u_factors_value] NVARCHAR(1000) NULL, [u_made_sla_value] NVARCHAR(40) NULL, [u_profile_value] NVARCHAR(40) NULL, [u_configuration_item_value] NVARCHAR(255) NULL )
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: `vpmsdb` -- -- -------------------------------------------------------- -- -- Table structure for table `tbladmin` -- CREATE TABLE `tbladmin` ( `ID` int(10) NOT NULL, `AdminName` varchar(120) DEFAULT NULL, `UserName` varchar(120) DEFAULT NULL, `MobileNumber` bigint(10) DEFAULT NULL, `Email` varchar(200) DEFAULT NULL, `Password` varchar(120) DEFAULT NULL, `AdminRegdate` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbladmin` -- INSERT INTO `tbladmin` (`ID`, `AdminName`, `UserName`, `MobileNumber`, `Email`, `Password`, `AdminRegdate`) VALUES (1, 'admin', 'admin', 8792823161, 'vp14032001@gmail.com', 'f925916e2754e5e03f75dd58a5733251', '2021-08-20 05:38:23'); -- -------------------------------------------------------- -- -- Table structure for table `tblcategory` -- CREATE TABLE `tblcategory` ( `ID` int(10) NOT NULL, `VehicleCat` varchar(120) DEFAULT NULL, `CreationDate` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblcategory` -- INSERT INTO `tblcategory` (`ID`, `VehicleCat`, `CreationDate`) VALUES (1, 'Heavy Duty Vehicle', '2021-08-20 11:06:50'), (2, 'Four Wheeler Vehicle', '2021-08-20 11:07:09'), (3, 'Two Wheeler Vehicle', '2021-08-20 11:31:17'); -- -------------------------------------------------------- -- -- Table structure for table `tblvehicle` -- CREATE TABLE `tblvehicle` ( `ID` int(10) NOT NULL, `ParkingNumber` varchar(120) DEFAULT NULL, `VehicleCategory` varchar(120) NOT NULL, `VehicleCompanyname` varchar(120) DEFAULT NULL, `RegistrationNumber` varchar(120) DEFAULT NULL, `OwnerName` varchar(120) DEFAULT NULL, `OwnerContactNumber` bigint(10) DEFAULT NULL, `InTime` timestamp NULL DEFAULT current_timestamp(), `OutTime` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(), `ParkingCharge` varchar(120) NOT NULL, `Remark` mediumtext NOT NULL, `Status` varchar(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tblvehicle` -- INSERT INTO `tblvehicle` (`ID`, `ParkingNumber`, `VehicleCategory`, `VehicleCompanyname`, `RegistrationNumber`, `OwnerName`, `OwnerContactNumber`, `InTime`, `OutTime`, `ParkingCharge`, `Remark`, `Status`) VALUES (1, '521796069', 'Two Wheeler Category', 'Hyundai', 'KA05B8622', 'Rakesh Chandra', 8956232528, '2021-07-05 05:58:38', '2021-07-07 11:09:36', '500 Rs.', 'NA', 'Out'), (2, '469052796', 'Two Wheeler Vehicle', 'Activa', 'KA01S8751', 'Pankaj', 8989898989, '2021-07-06 08:58:38', '2021-07-07 11:09:33', '350 Rs.', 'NA', 'Out'), (3, '734465023', 'Heavy Duty Vehicle', 'Hondacity', 'KA25W1436', 'Avinash', 7845123697, '2019-07-06 08:58:38', '2019-07-06 08:59:36', '550 Rs.', 'Vehicle Out', 'Out'), (4, '432190880', 'Two Wheeler Vehicle', 'Hero Honda', 'DL45W1236', 'Harish', 2132654447, '2021-07-06 08:58:38', '2021-07-06 09:53:35', '350 Rs.', 'Vehicle Out', 'Out'), (5, '323009894', 'Two Wheeler Vehicle', 'Activa', 'DL02S776', 'Abhi', 4654654654, '2020-07-06 08:58:38', '2020-07-06 08:59:24', '', '', ''), (6, '522578915', 'Four Wheeler Vehicle', 'Hondacity', 'KA20W5623', 'Mahesh', 7978999879, '2021-07-06 08:58:38', NULL, '', '', ''), (7, '917725207', 'Two Wheeler Vehicle', 'Honda', 'DL1CT2323', 'Vageesh', 9901049006, '2017-07-07 11:03:05', '2017-08-07 11:03:05', '999 Rs.', '', ''), (8, '486258836', 'Two Wheeler Vehicle', 'Honda Activa', 'DL1CY2322', 'Yashaswini', 9945502268, '2020-07-07 11:32:02', '2020-07-07 11:32:42', '400 Rs.', 'Vehicle Out', 'Out'); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbladmin` -- ALTER TABLE `tbladmin` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `tblcategory` -- ALTER TABLE `tblcategory` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `tblvehicle` -- ALTER TABLE `tblvehicle` ADD PRIMARY KEY (`ID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbladmin` -- ALTER TABLE `tbladmin` MODIFY `ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tblcategory` -- ALTER TABLE `tblcategory` MODIFY `ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tblvehicle` -- ALTER TABLE `tblvehicle` MODIFY `ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; 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.8.0.1 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 10-07-2018 a las 03:14:01 -- Versión del servidor: 10.1.32-MariaDB -- Versión de PHP: 7.2.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `db_empresas` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `empresas` -- CREATE TABLE `empresas` ( `Autorizacion` int(2) NOT NULL DEFAULT '1', `usuario` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `empresa` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `telefono` int(9) NOT NULL, `direccion` text COLLATE utf8mb4_unicode_ci NOT NULL, `informacion` text COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `empresas` -- INSERT INTO `empresas` (`Autorizacion`, `usuario`, `password`, `empresa`, `telefono`, `direccion`, `informacion`) VALUES (3, 'InKaRiNg', 'empresa_inkarings123', 'Inka_Rings', 964760654, 'Eduardo Lopez de Romaña 109 -Cercado', 'Todo lo que es bueno es para siempre, asi como nuestros anillos elaborados con aleaciones de plata y oro , usamos pedreira de rubi, esmeralda, diamante y las piedras preciosas\r\n mas hermosas que te puedas imaginar , haz que tus recuerdos sean eternos, no dudes en nosotros. '), (1, 'DiamonPeru123', 'DiamondPeru_2018', 'Diamonds_Peru', 959560108, 'Filtro - Calle El Filtro 501 Plaza de Armas ', 'Somos una empresa con el unico proposito de plasmar tus sueños en un anillo, elaborandolos con aleaciones de oro y pplata , y con uestro sello caracteristico ,impregnar el diamante \r\n en todas nuestras piezas, porque tu te mereces lo mejor.'), (3, 'EternaPas_007', 'Eter_pass_admin', 'Eternal_Passion', 945046467, 'ODAC - Parque Lambramani Nivel -2 (costado de Metro)', 'Somos una empresa peruana, trabajando con aleaciones de oro y plata pura, porque un anillo refleja mucho de una persona, tenemos todo lo indicado para ti , porque sabemos que \r\n es lo que te gusta, no dudes en solicitarnos.'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- CREATE TABLE `productos` ( `nombre` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `categoria` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `empresa` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `precio` float NOT NULL, `stock` int(2) NOT NULL, `descuento` int(2) NOT NULL DEFAULT '0', `metal` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, `peso` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `piedra` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, `forma` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL, `quilates` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `piedras` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, `diametro` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='productos'; -- -- Volcado de datos para la tabla `productos` -- INSERT INTO `productos` (`nombre`, `categoria`, `empresa`, `precio`, `stock`, `descuento`, `metal`, `peso`, `piedra`, `forma`, `quilates`, `piedras`, `diametro`) VALUES ('Begonia', 'Compromiso', 'Diamonds_Peru', 2246, 15, 0, 'Oro blanco & Rosa', '6.16 gramos', 'Diamante', 'Redondo', '0.084', '14', '1.1 mm'), ('Kabena', 'Compromiso', 'Diamonds_Peru', 2267, 9, 0, 'Oro Blanco 585', '3.53 gramos', 'Diamante', 'Redondo', '0.07', '17', '3.0 mm'), ('Empire', 'Compromiso', 'Diamonds_Peru', 1866, 15, 0, 'Oro Blanco 585', '1.16 gramos', 'Diamante', 'Redondo', '0.09', '18', '1.0mm'), ('Pure_Love', 'Bodas', 'Diamonds_Peru', 1135, 15, 0, 'Oro Amarillo 585', '5.87 gramos', 'Circonita(SOLO MUJER)', 'Redondo', '0.018', '1(SOLO MUJER)', '1.6 mm'), ('Natural_Sensation', 'Bodas', 'Diamonds_Peru', 1221, 15, 0, 'Oro Amarillo 585', '4.43 gramos', 'Circonita(SOLO MUJER)', 'Redondo', '0.018', '1(SOLO MUJER)', '1.6 mm'), ('Unique_Luxury', 'Bodas', 'Diamonds_Peru', 1201, 12, 0, 'Oro Amarillo 585', '4.22 gramos', 'Circonita(SOLO MUJER)', 'Redondo', '0.018', '1(SOLO MUJER)', '1.6 mm'), ('Harriet', 'Eternidad', 'Diamonds_Peru', 1713, 15, 0, 'Oro Blanco 585', '1.37', 'Diamante', 'Redondo', '0.04', '8', '2.0 mm'), ('Mila', 'Eternidad', 'Diamonds_Peru', 1832, 15, 0, 'Oro Blanco 585', '3.51', 'Diamante', 'Redondo', '0.162', '99', '1.6 mm'), ('Sonne', 'Amistad', 'Diamonds_Peru', 5783, 15, 0, 'Oro Blanco 375', '5.10', 'Diamante', 'Baguette', '0.33', '3', '4.0 x 2.0 mm'), ('Losse', 'Amistad', 'Diamonds_Peru', 635, 10, 0, 'Oro Amarillo & Blanco 375', '3.40 gramos', '-', 'Acorde al estilo', '-', '-', '1.1 mm'), ('Estelle', 'Compromiso', 'Eternal_Passion', 4206, 8, 0, 'Oro Blanco 585', '3.62 gramos', 'Diamante', 'Redondo', '0.195', '28', '4.0 mm'), ('Ring_Auretta', 'Compromiso', 'Eternal_Passion', 4303, 10, 0, 'Oro Blanco 585', '3.89 gramos', 'Diamante Verde ', 'Redondo', '0.033', '1', '4.0 mm'), ('Hissa', 'Compromiso', 'Eternal_Passion', 4540, 19, 0, 'Oro Blanco 585', '6.50 gramos', 'Diamante', 'Marquesa', '0.40', '4', '5.3 mm'), ('Universe_Uranus', 'Bodas', 'Eternal_Passion', 4756, 5, 0, 'Oro Rosa 585', '17.44 gramos', 'Circonita(SOLO MUJER)', 'Redondo', '0.162', '102(SOLO MUJER)', '1.6 mm'), ('Golden_Miracle', 'Bodas', 'Eternal_Passion', 5590, 9, 0, 'Oro Blanco & Rosa 585', '22.69 gramos', 'Circonita(SOLO MUJER)', 'Redondo', '0.57', '38(SOLO MUJER)', '1.1 mm'), ('Mystic_Winter', 'Bodas', 'Eternal_Passion', 2982, 7, 0, 'Oro Blanco 375', '15.57 gramos', 'Diamante(SOLO MUJER)', 'Redondo', '0.23', '25(SOLO MUJER)', '1.1 mm'), ('Ring_Elisha', 'Eternidad', 'Eternal_Passion', 1837, 2, 0, 'Oro Blanco 585', '4.14 gramos', 'Cristal de Swarovski', 'Redondo', '0.75', '3', '4.0 mm'), ('Loronda', 'Eternidad', 'Eternal_Passion', 1919, 3, 0, 'Oro Blanco 585', '4.67 gramos', 'Cristal de Swarovski', 'Redondo', '0.558', '31', '1.6 mm'), ('Smolare', 'Amistad', 'Eternal_Passion', 445, 18, 0, 'Oro Blanco & Rosa 375', '1.90 gramos', '-', 'Acorde al estilo', '-', '-', ''), ('Hark', 'Amistad', 'Eternal_Passion', 460, 10, 0, 'Oro Blanco & Rosa 375', '2.10 gramos', '-', 'a', '', '', ''), ('Gratia', 'Compromiso', 'Inka_Rings', 1380, 11, 0, 'Oro Blanco & Rosa 585', '2.96 gramos', 'Diamante', 'Redondo', '0.073', '3', '2.0 mm'), ('Alidia', 'Compromiso', 'Inka_Rings', 1745, 10, 0, 'Oro Blanco & Rosa 585', '3.31 gramos', 'Diamante', 'Redondo', '0.033', '4', '1.3 mm'), ('Hibiscus', 'Compromiso', 'Inka_Rings', 1773, 15, 0, 'Oro Blanco & Rosa 585', '4.45 gramos', 'Diamante', 'Redondo', '0.09', '2', '2.3 mm'), ('Bright_Youth', 'Bodas', 'Inka_Rings', 6560, 5, 0, 'Platino 950', '12.78', 'Diamante(SOLO MUJER)', 'Redondo', '-', '', ''), ('Classic_Choice', 'Bodas', 'Inka_Rings', 6822, 8, 0, 'Platino 950', '13.28 gramos', 'Diamante(SOLO MUJER)', 'Redondo', '0.24', '23(SOLO MUJER)', '1.1 mm'), ('Dinamic_Structure', 'Bodas', 'Inka_Rings', 4175, 5, 0, 'Oro Blanco & Rosa 585', '24.151 gramos', 'Diamante(SOLO MUJER)', 'Redondo', '0.05', '5(SOLO MUJER)', '1.3 mm'), ('Sifnas', 'Eternidad', 'Inka_Rings', 5533, 11, 0, 'Oro Blanco 750', '4.43 gramos', 'Esmeralda', 'Redondo', '0.45', '30', '1.5 mm'), ('Bretha', 'Eternidad', 'Inka_Rings', 2172, 3, 0, 'Oro Blanco 750', '2.21 gramos', 'Rubi', 'Redondo', '0.74', '37', '1.6 mm'), ('Cannestee', 'Amistad', 'Inka_Rings', 790, 14, 0, 'Oro Rosa 585', '2.60 gramos', '-', '', '', '', ''), ('Ruacanna', 'Amistad', 'Inka_Rings', 997, 10, 0, 'Oro Rosa 585', '3.77 gramos', '-', 'Acorde al estilo', '0.09', '-', '1.1 mm'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventas` -- CREATE TABLE `ventas` ( `nombre` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `apellido` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `DNI` int(8) NOT NULL, `producto` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `ventas` -- INSERT INTO `ventas` (`nombre`, `apellido`, `DNI`, `producto`) VALUES ('Andy', 'Ñaca', 74423584, 'Begonia'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
DROP TABLE IF EXISTS `svcart_cards`; CREATE TABLE `svcart_cards` ( `id` int(11) NOT NULL auto_increment COMMENT '贺卡编号', `orderby` tinyint(4) NOT NULL default '50' COMMENT '排序', `img01` varchar(200) collate utf8_unicode_ci NOT NULL COMMENT '图片', `img02` varchar(200) collate utf8_unicode_ci NOT NULL COMMENT '图片2', `fee` decimal(6,2) unsigned NOT NULL default '0.00', `free_money` decimal(6,2) unsigned NOT NULL default '0.00', `status` char(1) collate utf8_unicode_ci NOT NULL default '1' COMMENT '状态[0:无效;1:有效;]', `created` datetime NOT NULL default '2008-01-01 00:00:00' COMMENT '创建时间', `modified` datetime NOT NULL default '2008-01-01 00:00:00' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `status` (`status`) ) ENGINE=MyISAM AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='贺卡'; INSERT INTO `svcart_cards` VALUES ( '10', '50', '10', '10', '0.00', '0.00', '1', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '20', '50', '20', '20', '0.00', '0.00', '1', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ); DROP TABLE IF EXISTS `svcart_carts`; CREATE TABLE `svcart_carts` ( `id` int(10) unsigned NOT NULL auto_increment COMMENT 'ID', `session_id` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT '进程编号', `user_id` int(11) NOT NULL default '0' COMMENT '用户编号', `store_id` int(11) NOT NULL default '0' COMMENT '商店编号', `product_id` int(11) NOT NULL COMMENT '商品编号', `product_code` varchar(100) collate utf8_unicode_ci NOT NULL COMMENT '商品代码', `product_name` varchar(200) collate utf8_unicode_ci NOT NULL COMMENT '商品名称', `product_price` float(12,2) NOT NULL COMMENT '商品价格', `product_quantity` smallint(6) NOT NULL COMMENT '购买商品数量', `product_attrbute` text collate utf8_unicode_ci NOT NULL COMMENT '商品属性', `type` char(1) collate utf8_unicode_ci default NULL, `extension_code` varchar(20) collate utf8_unicode_ci NOT NULL COMMENT 'virtual_card:虚拟商品', `created` datetime NOT NULL default '2008-01-01 00:00:00' COMMENT '创建时间', `modified` datetime NOT NULL default '2008-01-01 00:00:00' COMMENT '修改时间', PRIMARY KEY (`id`), UNIQUE KEY `user_id` (`user_id`), KEY `store_id` (`store_id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='购物车表'; INSERT INTO `svcart_carts` VALUES ( '1', '1', '1', '1', '1', '1', '1', '1.00', '1', '1', '1', '1', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '2', '2', '2', '2', '2', '2', '2', '2.00', '2', '2', '2', '2', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '3', '3', '3', '1', '1', '1', '1', '1.00', '1', '1', '1', '1', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '4', '4', '4', '2', '2', '2', '2', '2.00', '2', '2', '2', '2', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '5', '3', '5', '1', '1', '1', '1', '1.00', '1', '1', '1', '1', '2008-01-01 00:00:00', '2008-01-01 00:00:00' ), ( '6', '4', '6', '2', '2', '2', '2', '2.00', '2', '2', '2', '2', '2008-01-01 00:00:00', '2008-01-01 00:00:00' );
-- phpMyAdmin SQL Dump -- version phpStudy 2014 -- http://www.phpmyadmin.net -- -- 主机: 127.0.0.1 -- 生成日期: 2016 年 07 月 15 日 13:57 -- 服务器版本: 5.6.23-log -- PHP 版本: 5.6.9 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 */; -- -- 数据库: `mmjifen` -- -- -------------------------------------------------------- -- -- 表的结构 `haoyou` -- CREATE TABLE IF NOT EXISTS `haoyou` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `fid` int(11) NOT NULL, `tm` int(11) NOT NULL COMMENT '请求和回复', PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `fid` (`fid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -------------------------------------------------------- -- -- 表的结构 `jifen` -- CREATE TABLE IF NOT EXISTS `jifen` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `jifen` int(11) NOT NULL, `des` int(11) NOT NULL COMMENT '基础分 收到赠送的 签到的 答题和调查的 还有完善资料的', PRIMARY KEY (`id`), KEY `uid` (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `jifengzengsong` -- CREATE TABLE IF NOT EXISTS `jifengzengsong` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` int(11) NOT NULL, `to` int(11) NOT NULL, `fenshu` int(11) NOT NULL, `tm` int(11) NOT NULL COMMENT '时间戳', PRIMARY KEY (`id`), KEY `from` (`from`), KEY `to` (`to`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- 转存表中的数据 `jifengzengsong` -- INSERT INTO `jifengzengsong` (`id`, `from`, `to`, `fenshu`, `tm`) VALUES (3, 29, 23, 5, 1467128474); -- -------------------------------------------------------- -- -- 表的结构 `qiandao` -- CREATE TABLE IF NOT EXISTS `qiandao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `tm` varchar(64) NOT NULL COMMENT '签到时间', PRIMARY KEY (`id`), KEY `uid` (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- 转存表中的数据 `qiandao` -- INSERT INTO `qiandao` (`id`, `uid`, `tm`) VALUES (1, 87, '2016-07-07 11:00:00'); -- -------------------------------------------------------- -- -- 表的结构 `remote` -- CREATE TABLE IF NOT EXISTS `remote` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rid` int(11) NOT NULL, `deny` int(11) NOT NULL DEFAULT '0', `save` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `rid` (`rid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=94 ; -- -- 转存表中的数据 `remote` -- INSERT INTO `remote` (`id`, `rid`, `deny`, `save`) VALUES (89, 58, 0, 0), (88, 57, 0, 0), (87, 56, 0, 0), (86, 55, 0, 0), (85, 54, 0, 0), (84, 53, 0, 0), (83, 52, 0, 0), (82, 51, 0, 0), (81, 50, 0, 0), (80, 49, 0, 0), (79, 48, 0, 0), (78, 47, 0, 0), (77, 46, 0, 0), (76, 45, 0, 0), (75, 44, 0, 0), (74, 43, 0, 0), (73, 42, 0, 0), (72, 41, 0, 0), (71, 40, 0, 0), (70, 39, 0, 0), (69, 38, 0, 0), (68, 37, 0, 0), (67, 36, 0, 0), (66, 35, 0, 0), (65, 34, 0, 0), (64, 33, 0, 0), (63, 32, 0, 0), (62, 31, 0, 0), (61, 30, 0, 0), (60, 29, 0, 0), (31, 59, 0, 0), (32, 60, 0, 0), (33, 61, 0, 0), (34, 62, 0, 0), (35, 63, 0, 0), (36, 64, 0, 0), (37, 65, 0, 0), (38, 66, 0, 0), (39, 67, 0, 0), (40, 68, 0, 0), (41, 69, 0, 0), (42, 70, 0, 0), (43, 71, 0, 0), (44, 72, 0, 0), (45, 73, 0, 0), (46, 74, 0, 0), (47, 75, 0, 0), (48, 76, 0, 0), (49, 79, 0, 0), (50, 80, 0, 0), (51, 81, 0, 0), (52, 82, 0, 0), (53, 83, 0, 0), (54, 84, 0, 0), (55, 85, 0, 0), (56, 86, 0, 1), (57, 87, 0, 1), (58, 88, 0, 0), (59, 89, 0, 0), (90, 90, 0, 0), (91, 91, 0, 0), (92, 92, 0, 0), (93, 93, 0, 0); -- -------------------------------------------------------- -- -- 表的结构 `s_da` -- CREATE TABLE IF NOT EXISTS `s_da` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL, `type` varchar(11) NOT NULL COMMENT 'diaocha or zhishi', `da` text NOT NULL, `fen` int(11) NOT NULL DEFAULT '0' COMMENT '分数', `tm` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `type` (`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -------------------------------------------------------- -- -- 表的结构 `s_diaocha` -- CREATE TABLE IF NOT EXISTS `s_diaocha` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(256) NOT NULL, `des` varchar(256) DEFAULT NULL, `optionA` varchar(128) NOT NULL, `optionB` varchar(128) DEFAULT NULL, `optionC` varchar(128) DEFAULT NULL, `optionD` varchar(128) DEFAULT NULL, `sort` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `sort` (`sort`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- 转存表中的数据 `s_diaocha` -- INSERT INTO `s_diaocha` (`id`, `title`, `des`, `optionA`, `optionB`, `optionC`, `optionD`, `sort`) VALUES (1, '你喜欢什么颜色', NULL, '红色', '绿色', '黄色', '白色', 2), (2, '哪个语言是最好的语言', 'php', 'c', 'c++', 'java', 'perl', 3); -- -------------------------------------------------------- -- -- 表的结构 `s_zhishi` -- CREATE TABLE IF NOT EXISTS `s_zhishi` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(256) NOT NULL, `des` varchar(256) DEFAULT NULL, `optionA` varchar(128) NOT NULL, `optionB` varchar(128) DEFAULT NULL, `optionC` varchar(128) DEFAULT NULL, `optionD` varchar(128) DEFAULT NULL, `da` varchar(2) DEFAULT NULL, `sort` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `sort` (`sort`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- 转存表中的数据 `s_zhishi` -- INSERT INTO `s_zhishi` (`id`, `title`, `des`, `optionA`, `optionB`, `optionC`, `optionD`, `da`, `sort`) VALUES (1, '你喜欢什么颜色', NULL, '红色', '绿色', '黄色', '', 'B', 2), (2, '哪个语言是最好的语言', 'php', 'c', 'c++', 'java', 'perl', 'A', 0); -- -------------------------------------------------------- -- -- 表的结构 `user` -- CREATE TABLE IF NOT EXISTS `user` ( `uid` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(32) DEFAULT NULL COMMENT '姓名', `mima` varchar(64) DEFAULT NULL, `code` varchar(64) DEFAULT NULL, `headimg` varchar(128) DEFAULT NULL, `mobile` varchar(32) DEFAULT NULL COMMENT '手机号', `password` varchar(64) DEFAULT NULL COMMENT '密码', `gender` int(2) DEFAULT NULL COMMENT '性别', `company` varchar(64) DEFAULT NULL COMMENT '公司', `title` varchar(64) DEFAULT NULL COMMENT '职位', `weixin` varchar(64) DEFAULT NULL COMMENT '微信号', `createAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `regAt` int(11) NOT NULL DEFAULT '0', `active` int(2) NOT NULL DEFAULT '1' COMMENT '是否有效', `sort` int(2) NOT NULL DEFAULT '0' COMMENT '排序', `send` int(11) NOT NULL DEFAULT '0' COMMENT '积分赠送次数', `received` int(11) NOT NULL DEFAULT '0' COMMENT '积分接收次数', PRIMARY KEY (`uid`), KEY `sort` (`sort`), KEY `send` (`send`), KEY `received` (`received`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=88 ; -- -- 转存表中的数据 `user` -- INSERT INTO `user` (`uid`, `name`, `mima`, `code`, `headimg`, `mobile`, `password`, `gender`, `company`, `title`, `weixin`, `createAt`, `regAt`, `active`, `sort`, `send`, `received`) VALUES (43, '雒珊珊', '5525175', '7794674', NULL, '18519330917', NULL, NULL, '市场主管', '市场主管', NULL, 1467712717, 0, 1, 0, 0, 0), (12, ' 游晓峰', 'you4045', '1005367', NULL, '13513644045', NULL, 1, '', '', '', 1467066948, 0, 1, 0, 0, 0), (87, '测试', '123', '123', '/upload/201607/07/b4189e598f2a971a7b88c4571d30e7db.jpg', '13811069199', NULL, 1, 'h s j d j', 'd h d j j d', 'hshdjd', 1467860468, 0, 1, 0, 0, 0), (25, '陈合喜', '8994143', '9043818', NULL, '13255316043', NULL, NULL, 'SEO', 'SEO', NULL, 1467110969, 0, 1, 0, 0, 0), (45, 'leibo@netconcepts.cn', '5842386', '1536983', NULL, '13827292981', NULL, NULL, '大大大是', '大大大是', NULL, 1467712721, 0, 1, 0, 0, 0), (32, '洪永志', '8239251', '3310686', NULL, '18401482381', NULL, NULL, '员工', '员工', NULL, 1467192091, 0, 1, 0, 0, 0), (33, '封小洋', '5488563', '4273689', NULL, '15821162195', NULL, NULL, 'sem/seo', 'sem/seo', NULL, 1467712668, 0, 1, 0, 0, 0), (34, '刘海政', '4940371', '8590972', NULL, '13466589581', NULL, NULL, '营销策划', '营销策划', NULL, 1467712668, 0, 1, 0, 0, 0); /*!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 */;
-- Drops the favorite_db if it exists currently -- DROP DATABASE IF EXISTS bamazon; -- Creates the "favorite_db" database -- CREATE DATABASE bamazon; USE bamazon; CREATE TABLE products ( item_id INT (10) AUTO_INCREMENT PRIMARY KEY, product_name VARCHAR (50) NOT NULL, department_name VARCHAR(30), price DECIMAL (10,2) NOT NULL, stock_quantity INT (10) NOT NULL ); SELECT * FROM bamazon.products;
--Non Gmail Students SELECT name, id, email, cohort_id FROM students WHERE email NOT LIKE '%@gmail.com' AND phone IS NULL;
2018-10-16 20:00:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.420ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.490ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 466.720ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 9.030ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.140ms 2018-10-16 20:01:35 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.030ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.530ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 179.800ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.300ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.580ms 2018-10-16 20:02:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.290ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.560ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 517.980ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.530ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.580ms 2018-10-16 20:03:35 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.010ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.700ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 184.430ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 14.780ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.980ms 2018-10-16 20:04:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.110ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.690ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 506.650ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 4.030ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.480ms 2018-10-16 20:05:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 18.900ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 6.000ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 811.530ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 5.190ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.920ms 2018-10-16 20:06:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.400ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 8.380ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 594.930ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 5.170ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.590ms 2018-10-16 20:07:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.220ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.440ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 639.510ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.440ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.790ms 2018-10-16 20:08:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.050ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 13.140ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 672.860ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 8.610ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.210ms 2018-10-16 20:09:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 7.010ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 1.850ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 663.290ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.130ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 5.130ms 2018-10-16 20:10:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.110ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.000ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 645.610ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.830ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.540ms 2018-10-16 20:11:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.620ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.330ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 502.720ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.660ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.450ms 2018-10-16 20:12:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.420ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.100ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 751.000ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.980ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.320ms 2018-10-16 20:13:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.190ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.480ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 440.550ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.960ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.360ms 2018-10-16 20:14:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.020ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 6.980ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 282.160ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.670ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.560ms 2018-10-16 20:15:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.400ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.620ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 664.820ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.700ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.380ms 2018-10-16 20:16:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.660ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 5.590ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 546.870ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.790ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 8.830ms 2018-10-16 20:17:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.970ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.710ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 304.280ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.280ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.580ms 2018-10-16 20:18:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.220ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.480ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 565.380ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.190ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.530ms 2018-10-16 20:19:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.820ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.140ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 677.150ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.420ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.240ms 2018-10-16 20:20:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.850ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.470ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 561.490ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 6.410ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.780ms 2018-10-16 20:21:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.870ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.390ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 204.380ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.180ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-16 20:22:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.940ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.670ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 185.220ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.310ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.360ms 2018-10-16 20:23:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.010ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.670ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 181.230ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.800ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.660ms 2018-10-16 20:24:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 10.540ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.660ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 182.250ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.600ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.390ms 2018-10-16 20:25:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.970ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.770ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 182.750ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.810ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.430ms 2018-10-16 20:26:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.720ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.730ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 778.130ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.780ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.020ms 2018-10-16 20:27:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.100ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.720ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 482.570ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 5.080ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.770ms 2018-10-16 20:28:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 9.910ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.640ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 641.810ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.050ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 7.270ms 2018-10-16 20:29:36 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 8.650ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.530ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 207.370ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.020ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.510ms 2018-10-16 20:30:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.210ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 12.250ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 602.340ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.930ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.600ms 2018-10-16 20:31:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.320ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.460ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 459.560ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 24.370ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.590ms 2018-10-16 20:32:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.940ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.750ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 252.830ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.520ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.780ms 2018-10-16 20:33:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.310ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.790ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 373.630ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.640ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.390ms 2018-10-16 20:34:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.860ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.820ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 319.480ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.720ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 6.090ms 2018-10-16 20:35:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.220ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.580ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 385.650ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.040ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.870ms 2018-10-16 20:36:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.940ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.760ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 228.190ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.740ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.670ms 2018-10-16 20:37:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.900ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.200ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 364.610ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.760ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-16 20:38:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.080ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.550ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 319.460ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.470ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 4.020ms 2018-10-16 20:39:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.960ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.200ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 500.200ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.920ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.790ms 2018-10-16 20:40:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 6.590ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.710ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 723.320ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.880ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.560ms 2018-10-16 20:41:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 102.740ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.010ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 214.670ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.400ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.380ms 2018-10-16 20:42:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 7.520ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.590ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 227.570ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.050ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.780ms 2018-10-16 20:43:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.380ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.610ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 176.950ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.090ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.410ms 2018-10-16 20:44:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.500ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.310ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 443.250ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.950ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.580ms 2018-10-16 20:45:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.100ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.490ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 247.360ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.600ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-16 20:46:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 11.540ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.440ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 177.520ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.060ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.550ms 2018-10-16 20:47:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.170ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.790ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 510.980ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 86.610ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.990ms 2018-10-16 20:48:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.370ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.170ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 517.270ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.400ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.510ms 2018-10-16 20:49:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 6.660ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.420ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 185.740ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.060ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.600ms 2018-10-16 20:50:38 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.770ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.680ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 630.040ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.880ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-16 20:51:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.890ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.580ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 178.130ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.040ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.680ms 2018-10-16 20:52:38 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.530ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 4.970ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 581.580ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.810ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.880ms 2018-10-16 20:53:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.910ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.510ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 183.090ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.620ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-16 20:54:38 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.480ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.030ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 538.010ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 11.300ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.940ms 2018-10-16 20:55:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.880ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.450ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 176.620ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.820ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.480ms 2018-10-16 20:56:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.850ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.940ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 209.770ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.760ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.470ms 2018-10-16 20:57:38 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 138.370ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.850ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 372.030ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 37.500ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.470ms 2018-10-16 20:58:38 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.400ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.990ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 257.790ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 71.510ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.520ms 2018-10-16 20:59:37 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.360ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.160ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540224000 group by `lottery_id` 191.090ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.720ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.960ms
alter table selection_filters drop foreign key if exists FK32ql4ga245b7ukkaw77c33a7q; alter table selection_filters add constraint FK32ql4ga245b7ukkaw77c33a7q foreign key (filter_id) references filter (id) on delete cascade; alter table selection_filters add constraint fk_sf_selection foreign key (selection_id) references selection (id) on delete cascade; -- ----------------------------------------- alter table user drop foreign key if exists FKiybtklwoljb0m27cxy08wv4s8; alter table user add constraint fk_u_current_selection foreign key (current_selection_id) references selection (id) on delete set null;
DROP TABLE IF EXISTS `videos`; CREATE TABLE IF NOT EXISTS `videos` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL, `date` datetime DEFAULT NULL, `ytid` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `title` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL, `description` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `ytid` (`ytid`), KEY `user` (`user`(191)), KEY `date` (`date`), KEY `title` (`title`(191)), FULLTEXT KEY `description` (`description`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Write queries to return the following: -- The following changes are applied to the "pagila" database.** -- 1. Add actors, Hampton Avenue, and Lisa Byway to the actor table. BEGIN TRANSACTION; INSERT INTO actor (first_name, last_name) VALUES('Hampton', 'Avenue') INSERT INTO actor (first_name, last_name) VALUES('Lisa', 'Byway') SELECT * FROM actor WHERE first_name = 'Hampton' AND last_name = 'Avenue' SELECT * FROM actor WHERE first_name = 'Lisa' COMMIT; ROLLBACK; -- 2. Add "Euclidean PI", "The epic story of Euclid as a pizza delivery boy in -- ancient Greece", to the film table. The movie was released in 2008 in English. -- Since its an epic, the run length is 3hrs and 18mins. There are no special -- features, the film speaks for itself, and doesn't need any gimmicks. BEGIN TRANSACTION; INSERT INTO film (film_id, title, description, language_id, release_year, rental_duration, rental_rate, replacement_cost, length) VALUES (DEFAULT, 'Euclidean PI', 'The epic story of Euclid as a pizza delivery boy in ancient Greece', 1, 2008, 3, 4.99, 20.99, 198) SELECT * from film Where title = 'Euclidean PI' COMMIT; ROLLBACK; -- 3. Hampton Avenue plays Euclid, while Lisa Byway plays his slightly -- overprotective mother, in the film, "Euclidean PI". Add them to the film. BEGIN TRANSACTION; INSERT INTO film_actor (actor_id, film_id) VALUES ( 204, 1002) INSERT INTO film_actor (actor_id, film_id) VALUES ( 205, 1002) SELECT film_id FROM film_actor WHERE actor_id = 204 COMMIT; ROLLBACK; -- 4. Add Mathmagical to the category table. BEGIN TRANSACTION; INSERT INTO category (category_id, name) VALUES (default, 'Mathmagical') SELECT category_id FROM category WHERE name = 'Mathmagical' COMMIT; ROLLBACK; -- 5. Assign the Mathmagical category to the following films, "Euclidean PI", -- "EGG IGBY", "KARATE MOON", "RANDOM GO", and "YOUNG LANGUAGE" BEGIN TRANSACTION; UPDATE film_category SET category_id = 17 WHERE film_id IN (SELECT film_id FROM film WHERE title IN ('Euclidean PI', 'EGG IGBY', 'RANDOM GO', 'YOUNG LANGUAGE')) INSERT INTO film_category (film_id , category_id) VALUES ((SELECT film_id FROM film WHERE title IN ('Euclidean PI')), 17) SELECT title, film.film_id FROM film JOIN film_category fc ON fc.film_id = film.film_id WHERE fc.category_id = 17 COMMIT; ROLLBACK; -- 6. Mathmagical films always have a "G" rating, adjust all Mathmagical films -- accordingly. -- (5 rows affected) BEGIN TRANSACTION; UPDATE film SET rating = 'G' WHERE film_id IN (SELECT film_id FROM film_category WHERE category_id =17) SELECT rating FROM film WHERE title = 'RANDOM GO' COMMIT; ROLLBACK; SELECT * FROM film WHERE title = 'Euclidean PI' -- 7. Add a copy of "Euclidean PI" to all the stores. BEGIN TRANSACTION; INSERT INTO inventory (film_id, store_id) VALUES (1002, 1) INSERT INTO inventory (film_id, store_id) VALUES (1002, 2) COMMIT; ROLLBACK; -- 8. The Feds have stepped in and have impounded all copies of the pirated film, -- "Euclidean PI". The film has been seized from all stores, and needs to be -- deleted from the film table. Delete "Euclidean PI" from the film table. -- (Did it succeed? Why?) BEGIN TRANSACTION; DELETE FROM film WHERE title = 'Euclidean PI' COMMIT; ROLLBACK; --No because I have referenced this movie's key ID's to other tables such as inventory and film category. -- 9. Delete Mathmagical from the category table. -- (Did it succeed? Why?) BEGIN TRANSACTION; DELETE FROM category WHERE name = 'Mathmagical' COMMIT; ROLLBACK; --No because it is used as a foreign key on film_category -- 10. Delete all links to Mathmagical in the film_category tale. -- (Did it succeed? Why?) BEGIN TRANSACTION; DELETE FROM film_category WHERE category_id IN (SELECT category_id FROM category WHERE name = 'Mathmagical') SELECT * FROM film_category WHERE category_id IN (SELECT category_id FROM category WHERE name = 'Mathmagical') COMMIT; ROLLBACK; --Yes it did because Mathmagical on the film_category was a reference from category, but not the actual category row. -- 11. Retry deleting Mathmagical from the category table, followed by retrying -- to delete "Euclidean PI". -- (Did either deletes succeed? Why?) BEGIN TRANSACTION; DELETE FROM category WHERE name = 'Mathmagical' SELECT * FROM category WHERE name = 'Mathmagical' COMMIT; ROLLBACK; --Yes it did because we severed the connection that 'Mathmagical' had with film_category and therefore took away the forein key. -- 12. Check database metadata to determine all constraints of the film id, and -- describe any remaining adjustments needed before the film "Euclidean PI" can -- be removed from the film table. SELECT * FROM film WHERE title = 'Euclidean PI' SELECT * FROM inventory WHERE film_id IN(SELECT film_id FROM film WHERE title = 'Euclidean PI') BEGIN TRANSACTION; DELETE FROM film_actor WHERE film_id IN(SELECT film_id FROM film WHERE title = 'Euclidean PI') DELETE FROM inventory WHERE film_id IN(SELECT film_id FROM film WHERE title = 'Euclidean PI') DELETE FROM film WHERE title = 'Euclidean PI' COMMIT; ROLLBACK;
SET NAMES 'utf8'; -- ############################### ACCOUNTS ################################# -- REGULAR NOT_ACTIVE INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(1, 'mock', now(), 'mock', now(), 0, false, 'account1@email.com', null, 'password1', 'REGULAR', 'NOT_ACTIVE', 'User1'); -- REGULAR ACTIVE INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(2, 'mock', now(), 'mock', now(), 0, false, 'account2@email.com', null, 'password2', 'REGULAR', 'ACTIVE', 'User2'); -- REGULAR LOCKED INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(3, 'mock', now(), 'mock', now(), 0, false, 'locked@email.com', 'SECURITY', 'password3', 'REGULAR', 'LOCKED', 'User3'); -- REGULAR DELETED INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(4, 'mock', now(), 'mock', now(), 0, true, 'account4@email.com', null, 'password4', 'REGULAR', 'ACTIVE', 'User4'); -- GUEST NOT_ACTIVE INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(5, 'mock', now(), 'mock', now(), 0, false, 'account5@email.com', null, 'password5', 'GUEST', 'NOT_ACTIVE', 'User5'); -- GUEST ACTIVE INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(6, 'mock', now(), 'mock', now(), 0, false, 'account6@email.com', null, 'password6', 'GUEST', 'ACTIVE', 'User6'); -- GUEST LOCKED INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(7, 'mock', now(), 'mock', now(), 0, false, 'banned-locked@email.com', 'BANNED', 'password7', 'GUEST', 'LOCKED', 'User7'); -- GUEST DELETED INSERT INTO account(id, created_by, created_on, updated_by, updated_on, version, deleted, email, lock_reason, password, account_role, account_status, user_alias) VALUES(8, 'mock', now(), 'mock', now(), 0, true, 'account8@email.com', null, 'password8', 'GUEST', 'ACTIVE', 'User8'); -- ############################# END ACCOUNTS ###############################
-- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema sys_boletagem -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `sys_boletagem` ; -- ----------------------------------------------------- -- Schema sys_boletagem -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `sys_boletagem` DEFAULT CHARACTER SET utf8 ; USE `sys_boletagem` ; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_devedor` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_devedor` ( `CPF` VARCHAR(14) NOT NULL, `NOME` VARCHAR(100) NOT NULL, `ENDERECO` VARCHAR(120) NOT NULL, `NUMERO` VARCHAR(5) NOT NULL, `COMPLEMENTO` VARCHAR(120) NULL, `BAIRRO` VARCHAR(50) NOT NULL, `CIDADE` VARCHAR(30) NOT NULL, `UF` VARCHAR(5) NOT NULL, `CEP` VARCHAR(8) NULL, PRIMARY KEY (`CPF`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_divida` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_divida` ( `tb_devedor_CPF` VARCHAR(14) NULL, `FATURA_CARTAO` VARCHAR(45) NULL, `VALOR_PRINCIPAL` VARCHAR(10) NULL, `VALOR_ATUALIZADO` VARCHAR(10) NULL, `VALOR_DE_LIQUID` VARCHAR(10) NULL, `NUMERO_PRESTACAO` VARCHAR(5) NULL, `PLANO` VARCHAR(5) NULL, INDEX `fk_tb_divida_tb_devedor_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_divida_tb_devedor` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_parcelamento1` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_parcelamento1` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `DESCRICAO` VARCHAR(20) NULL, `TIPO` VARCHAR(20) NULL, `VALOR_ENTRADA` VARCHAR(6) NULL, `TIPO2` VARCHAR(20) NULL, `NUMERO_PARCELAS` INT NULL, `VALOR_PARCELA` FLOAT NULL, INDEX `fk_tb_parcelamento_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_parcelamento_tb_devedor1` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_bandida` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_bandida` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `SETOR` INT NULL, `EQUIPE` INT NULL, INDEX `fk_tb_bandida_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_bandida_tb_devedor1` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_boleto` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_boleto` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `CODIGO_BARRAS` VARCHAR(50) NOT NULL, `LINHA_DIGITAVEL` VARCHAR(60) NOT NULL, `NOSSO_NUMERO` VARCHAR(45) NOT NULL, INDEX `fk_tb_boleto_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_boleto_tb_devedor10` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_quitacao` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_quitacao` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `DESCRICAO` VARCHAR(20) NULL, `TIPO` VARCHAR(20) NULL, `NUMERO_PARCELAS` INT NULL, `VALOR_PARCELA` FLOAT NOT NULL, INDEX `fk_tb_parcelamento_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_parcelamento_tb_devedor10000` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_parcelamento2` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_parcelamento2` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `DESCRICAO` VARCHAR(20) NULL, `TIPO` VARCHAR(20) NULL, `VALOR_ENTRADA` VARCHAR(6) NULL, `TIPO2` VARCHAR(20) NULL, `NUMERO_PARCELAS` INT NULL, `VALOR_PARCELA` FLOAT NULL, INDEX `fk_tb_parcelamento_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_parcelamento_tb_devedor10` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_parcelamento3` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_parcelamento3` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `DESCRICAO` VARCHAR(20) NULL, `TIPO` VARCHAR(20) NULL, `VALOR_ENTRADA` VARCHAR(6) NULL, `TIPO2` VARCHAR(20) NULL, `NUMERO_PARCELAS` INT NULL, `VALOR_PARCELA` FLOAT NULL, INDEX `fk_tb_parcelamento_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_parcelamento_tb_devedor100` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `sys_boletagem`.`tb_parcelamento4` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `sys_boletagem`.`tb_parcelamento4` ( `tb_devedor_CPF` VARCHAR(14) NOT NULL, `DESCRICAO` VARCHAR(20) NULL, `TIPO` VARCHAR(20) NULL, `VALOR_ENTRADA` VARCHAR(6) NULL, `TIPO2` VARCHAR(20) NULL, `NUMERO_PARCELAS` INT NULL, `VALOR_PARCELA` FLOAT NULL, INDEX `fk_tb_parcelamento_tb_devedor1_idx` (`tb_devedor_CPF` ASC), CONSTRAINT `fk_tb_parcelamento_tb_devedor1000` FOREIGN KEY (`tb_devedor_CPF`) REFERENCES `sys_boletagem`.`tb_devedor` (`CPF`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
/* Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 50632 Source Host : localhost:3306 Source Database : thome.user Target Server Type : MYSQL Target Server Version : 50632 File Encoding : 65001 Date: 2017-07-27 13:45:52 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for tb_membership -- ---------------------------- DROP TABLE IF EXISTS `tb_membership`; CREATE TABLE `tb_membership` ( `UserId` int(11) NOT NULL COMMENT '用户自增ID,主键+外键,标识了是哪一个用户', `CreateDate` datetime DEFAULT NULL COMMENT '创建日期', `ConfirmationToken` varchar(128) DEFAULT NULL COMMENT 'Token,确认,修改密码用', `IsConfirmed` bit(1) DEFAULT b'0' COMMENT 'LastPasswordFailureDate datetime 0 0 -1 0 0 0 0 0 0 0', `LastPasswordFailureDate` datetime DEFAULT NULL COMMENT '最后一次密码错误时间', `PasswordFailuresSinceLastSuccess` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次成功登陆后密码错误登录时间', `Password` varchar(128) NOT NULL COMMENT '密码,被加密', `PasswordChangedDate` datetime DEFAULT NULL COMMENT '密码更改日期', `PasswordSalt` varchar(128) NOT NULL COMMENT '密码salt值', `PasswordVerificationToken` varchar(128) DEFAULT NULL COMMENT '密码验证Token,更改密码用', `PasswordVerificationTokenExpirationDate` datetime DEFAULT NULL COMMENT '密码验证Token生成日期', PRIMARY KEY (`UserId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ash-top-events.sql -- Jared Still -- -- jkstill@gmail.com set linesize 200 trimspool on set pagesize 100 col event format a60 col event_count format 99,999,999,990 -- top N events to show def event_rank_limit = 20 -- AWR --def data_source=dba_hist_active_sess_history --def instance_indicator=instance_number -- ASH def data_source=gv$active_session_history def instance_indicator=inst_id clear break break on &instance_indicator skip 1 --spool ash-top-events.log prompt ================================== prompt == ash-top-events.sql prompt ================================== prompt ================================== prompt == top &event_rank_limit ASH by instance prompt ================================== with rawdata as ( select distinct &instance_indicator, event, count(*) over (partition by &instance_indicator,event order by &instance_indicator, event) event_count from &data_source where event is not null and (event not in ('ges generic event' )) order by 3 desc ), data as ( select &instance_indicator, event, event_count from ( select &instance_indicator , event , event_count , rank() over (partition by &instance_indicator order by &instance_indicator, event_count desc) as event_rank from rawdata ) where event_rank <= &event_rank_limit ) select * from data / prompt ================================== prompt == top &event_rank_limit ASH cluster wide prompt ================================== with data as ( select distinct event, count(*) over (partition by event) event_count from &data_source where event is not null and (event not in ('ges generic event' )) order by 2 desc ) select * from data where rownum <= &event_rank_limit / --spool off
use mysql; grant all on tap.* to BigJim@localhost; use tap; grant all on tap to BigJim@localhost; grant create on tap to BigJim@localhost; flush privileges;
create table admin ( a_id serial PRIMARY KEY, username VARCHAR(50), password VARCHAR(50), email varchar(50) ); insert into admin (a_id, username, password, email) values (1, 'kepa', '2111734a2ac9c405a963a124beb8d1e2', 'kepatoto@gmail.com'); ALTER SEQUENCE admin_a_id_seq RESTART WITH 2;
COL snap_id FOR 999999 HEA 'Snap|ID'; COL begin_time FOR A19 HEA 'Begin Interval Time'; COL end_time FOR A19 HEA 'End Interval Time'; COL con_id FOR 999 HEA 'Con|ID'; COL pdb_name FOR A30 HEA 'PDB Name' FOR A30 TRUNC; COL plan_hash_value FOR 9999999999 HEA 'Plan|Hash Value'; COL aas_db FOR 999,990.000 HEA 'Avg Active|Sessions|On Database'; COL aas_cpu FOR 999,990.000 HEA 'Avg Active|Sessions|On CPU'; COL avg_et_ms FOR 99,999,990.000 HEA 'Avg Elapsed|Time (ms)'; COL avg_cpu_ms FOR 99,999,990.000 HEA 'Avg CPU|Time (ms)'; COL avg_io_ms FOR 99,999,990.000 HEA 'Avg User IO|Time (ms)'; COL avg_appl_ms FOR 99,999,990.000 HEA 'Avg Appl|Time (ms)'; COL avg_conc_ms FOR 99,999,990.000 HEA 'Avg Conc|Time (ms)'; COL avg_bg FOR 999,999,999,990 HEA 'Avg|Buffer Gets'; COL avg_disk FOR 999,999,999,990 HEA 'Avg|Disk Reads'; COL avg_read_bytes FOR 999,999,999,990 HEA 'Avg Physical|Read Bytes'; COL avg_write_bytes FOR 999,999,999,990 HEA 'Avg Physical|Write Bytes'; COL avg_row FOR 999,999,990.000 HEA 'Avg Rows|Processed'; COL executions_delta FOR 999,999,999,990 HEA 'Executions|Delta'; COL fetches_delta FOR 999,999,999,990 HEA 'Fetches|Delta'; COL fetch_size FOR 999,990 HEA 'Fetch|Size'; COL delta_et_secs FOR 999,999,990 HEA 'ET Delta|(secs)'; COL delta_cpu_secs FOR 999,999,990 HEA 'CPU Delta|(secs)'; COL delta_io_secs FOR 999,999,990 HEA 'IO Delta|(secs)'; COL delta_appl_secs FOR 999,999,990 HEA 'Appl Delta|(secs)'; COL delta_conc_secs FOR 999,999,990 HEA 'Conc Delta|(secs)'; COL delta_buffer_gets FOR 999,999,999,990 HEA 'Buffer Gets|Delta'; COL delta_disk_reads FOR 999,999,999,990 HEA 'Disk Reads|Delta'; COL delta_physical_read_bytes FOR 999,999,999,999,990 HEA 'Physical Read Bytes|Delta'; COL delta_physical_write_bytes FOR 999,999,999,999,990 HEA 'Physical Write Bytes|Delta'; COL delta_rows_processed FOR 999,999,999,990 HEA 'Rows Processed|Delta'; COL optimizer_cost FOR 9999999999 HEA 'Optimizer|Cost'; COL optimizer_env_hash_value FOR 9999999999 HEA 'Optimizer|Hash Value'; COL sharable_mem FOR 99,999,999,990 HEA 'Sharable Mem|(bytes)'; COL version_count FOR 999,990 HEA 'Version|Count'; COL loads_delta FOR 999,990 HEA 'Loads|Delta'; COL invalidations_delta FOR 999,990 HEA 'Inval|Delta'; COL parsing_schema_name FOR A30 HEA 'Parsing Schema Name'; COL module FOR A40 HEA 'Module' TRUNC; -- BRE ON snap_id ON begin_time ON end_time; -- PRO PRO SQL STATS DELTA (cdb_hist_sqlstat) PRO ~~~~~~~~~~~~~~~ SELECT h.snap_id, TO_CHAR(s.begin_interval_time, '&&cs_datetime_full_format.') AS begin_time, TO_CHAR(s.end_interval_time, '&&cs_datetime_full_format.') AS end_time, h.con_id, c.name AS pdb_name, h.plan_hash_value, h.elapsed_time_delta/1e6/(24*3600*(CAST(s.end_interval_time AS DATE) - CAST(s.begin_interval_time AS DATE))) AS aas_db, h.cpu_time_delta/1e6/(24*3600*(CAST(s.end_interval_time AS DATE) - CAST(s.begin_interval_time AS DATE))) AS aas_cpu, h.elapsed_time_delta/NULLIF(h.executions_delta, 0)/1e3 AS avg_et_ms, h.cpu_time_delta/NULLIF(h.executions_delta, 0)/1e3 AS avg_cpu_ms, h.iowait_delta/NULLIF(h.executions_delta, 0)/1e3 AS avg_io_ms, h.apwait_delta/NULLIF(h.executions_delta, 0)/1e3 AS avg_appl_ms, h.ccwait_delta/NULLIF(h.executions_delta, 0)/1e3 AS avg_conc_ms, h.buffer_gets_delta/NULLIF(h.executions_delta, 0) AS avg_bg, h.disk_reads_delta/NULLIF(h.executions_delta, 0) AS avg_disk, h.physical_read_bytes_delta/NULLIF(h.executions_delta, 0) AS avg_read_bytes, h.physical_write_bytes_delta/NULLIF(h.executions_delta, 0) AS avg_write_bytes, h.rows_processed_delta/NULLIF(h.executions_delta, 0) AS avg_row, h.executions_delta, h.fetches_delta, h.rows_processed_delta/NULLIF(h.fetches_delta, 0) AS fetch_size, h.elapsed_time_delta/1e6 AS delta_et_secs, h.cpu_time_delta/1e6 AS delta_cpu_secs, h.iowait_delta/1e6 AS delta_io_secs, h.apwait_delta/1e6 AS delta_appl_secs, h.ccwait_delta/1e6 AS delta_conc_secs, h.buffer_gets_delta AS delta_buffer_gets, h.disk_reads_delta AS delta_disk_reads, h.physical_read_bytes_delta AS delta_physical_read_bytes, h.physical_write_bytes_delta AS delta_physical_write_bytes, h.rows_processed_delta AS delta_rows_processed, h.optimizer_cost, h.optimizer_env_hash_value, h.sharable_mem, h.version_count, h.loads_delta, h.invalidations_delta, h.parsing_schema_name, h.module FROM cdb_hist_sqlstat h, dba_hist_snapshot s, v$containers c WHERE h.dbid = TO_NUMBER('&&cs_dbid.') AND h.instance_number = TO_NUMBER('&&cs_instance_number.') AND h.sql_id = '&&cs_sql_id.' AND s.end_interval_time > SYSDATE - &&cs_sqlstat_days. AND (h.elapsed_time_delta > 0 OR h.buffer_gets_delta > 0 OR h.executions_delta > 0) AND s.snap_id = h.snap_id AND s.dbid = h.dbid AND s.instance_number = h.instance_number AND c.con_id = h.con_id ORDER BY h.snap_id, h.plan_hash_value, h.con_id, h.plan_hash_value, h.parsing_schema_name / -- CL BRE; --
alter table disciplina modify nome VARCHAR(50); /*Altera uma propriedade da coluna nome, nos estamos alterando a capacidade de caracteres.*/ ALTER TABLE disciplina CHANGE COLUMN nome nome_dis VARCHAR(70) NULL DEFAULT NULL; /*Aqui nos estamos alterando o nome da column nome para nome_dis, aumentando o tamanho da quantidade de caracteres para 70 e as propriedades desta column sendo vazio como padra*/ ALTER TABLE disciplina ADD INDEX ind_carga_horaria (carga_horaria ASC) VISIBLE; ALTER TABLE professor CHANGE COLUMN nome nome_pro VARCHAR(70) NULL DEFAULT NULL; ALTER TABLE professor CHANGE COLUMN nome_pro nome VARCHAR(90) NULL DEFAULT NULL; ALTER TABLE professor ADD COLUMN cidade VARCHAR(80) NULL; ALTER TABLE professor ADD COLUMN titulo VARCHAR(10) NULL AFTER cidade;
CREATE VIEW ticket_by_stage AS SELECT project_issue.id, (SELECT task.name FROM project_task_type task WHERE (project_issue.stage_id = task.id)) AS stage FROM project_issue WHERE ((project_issue.state)::text <> ALL ((ARRAY['done'::character varying, 'cancelled'::character varying])::text[]))
select lname, fname, idactors, gender into actors1 from actors; select idactors, idseries, idmovies, characters into cast_list1 from cast_list; select idaka_names,idactors,name into aka_names1 from aka_names; select idmovies,season,idseries into series1 from series; select idmovies,title,year into movies1 from movies; select idmovies_keywords, idmovies, idkeywords into movie_keyword1 from movie_keyword; select idmovies_genres, idmovies,idgenres into movies_genres1 from movies_genres; select idkeyword, keyword into keywords1 from keywords; select idgenres, gerne into genres1 from genres; select idactors,idmovies into actors_movies1 from actors_movies; select idmovies into cast_movies1 from cast_movies; drop table cast_movies,actors_movies,genres,keywords,movie_keyword,movies_genres,movies; drop table series,aka_names,cast_list,actors; alter table actors1 rename to actors; alter table actors_movies1 rename to actors_movies; alter table aka_names1 rename to aka_names; alter table cast_list1 rename to cast_list; alter table genres1 rename to genres; alter table keywords1 rename to keywords; alter table cast_movies1 rename to cast_movies; alter table movie_keyword1 rename to movies_keywords; alter table movies1 rename to movies; alter table movies_genres1 rename to movies_genres; alter table series1 rename to series; insert into cast_movies(idmovies) select idmovies from movies; insert into actors_movies(idactors) select idactors from actors; insert into actors_movies(idmovies) select idmovies from movies;
-- Adminer 3.7.1 MySQL dump SET NAMES utf8; SET foreign_key_checks = 0; SET time_zone = '+06:00'; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DROP TABLE IF EXISTS `shares`; CREATE TABLE `shares` ( `id` int(11) NOT NULL AUTO_INCREMENT, `url` text NOT NULL, `items` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create sequence hibernate_sequence start with 1 increment by 1; create table task_deployment ( id bigint not null, object_version bigint, task_deployment_id varchar(255) not null, task_definition_name varchar(255) not null, platform_name varchar(255) not null, created_on timestamp ); create index idx_rel_name on task_deployment (platform_name); create table app_registration ( id bigint not null, object_version bigint, default_version boolean, metadata_uri clob, name varchar(255), type integer, uri clob, version varchar(255), boot_version varchar(16), primary key (id) ); create table audit_records ( id bigint not null, audit_action bigint, audit_data varchar(4000), audit_operation bigint, correlation_id varchar(255), created_by varchar(255), created_on timestamp, platform_name varchar(255), primary key (id) ); create table stream_definitions ( definition_name varchar(255) not null, definition clob, original_definition clob, description varchar(255), primary key (definition_name) ); create table task_definitions ( definition_name varchar(255) not null, definition clob, description varchar(255), primary key (definition_name) ); CREATE TABLE TASK_EXECUTION ( TASK_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, START_TIME TIMESTAMP DEFAULT NULL, END_TIME TIMESTAMP DEFAULT NULL, TASK_NAME VARCHAR(100), EXIT_CODE INTEGER, EXIT_MESSAGE VARCHAR(2500), ERROR_MESSAGE VARCHAR(2500), LAST_UPDATED TIMESTAMP, EXTERNAL_EXECUTION_ID VARCHAR(255), PARENT_EXECUTION_ID BIGINT ); CREATE TABLE TASK_EXECUTION_PARAMS ( TASK_EXECUTION_ID BIGINT NOT NULL, TASK_PARAM VARCHAR(2500), constraint TASK_EXEC_PARAMS_FK foreign key (TASK_EXECUTION_ID) references TASK_EXECUTION(TASK_EXECUTION_ID) ); CREATE TABLE TASK_TASK_BATCH ( TASK_EXECUTION_ID BIGINT NOT NULL, JOB_EXECUTION_ID BIGINT NOT NULL, constraint TASK_EXEC_BATCH_FK foreign key (TASK_EXECUTION_ID) references TASK_EXECUTION(TASK_EXECUTION_ID) ); CREATE SEQUENCE TASK_SEQ; CREATE TABLE TASK_LOCK ( LOCK_KEY CHAR(36) NOT NULL, REGION VARCHAR(100) NOT NULL, CLIENT_ID CHAR(36), CREATED_DATE TIMESTAMP NOT NULL, constraint LOCK_PK primary key (LOCK_KEY, REGION) ); CREATE TABLE BATCH_JOB_INSTANCE ( JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, VERSION BIGINT, JOB_NAME VARCHAR(100) NOT NULL, JOB_KEY VARCHAR(32) NOT NULL, constraint JOB_INST_UN unique (JOB_NAME, JOB_KEY) ); CREATE TABLE BATCH_JOB_EXECUTION ( JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, VERSION BIGINT, JOB_INSTANCE_ID BIGINT NOT NULL, CREATE_TIME TIMESTAMP NOT NULL, START_TIME TIMESTAMP DEFAULT NULL, END_TIME TIMESTAMP DEFAULT NULL, STATUS VARCHAR(10), EXIT_CODE VARCHAR(2500), EXIT_MESSAGE VARCHAR(2500), LAST_UPDATED TIMESTAMP, JOB_CONFIGURATION_LOCATION VARCHAR(2500) NULL, constraint JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID) references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID) ); CREATE TABLE BATCH_JOB_EXECUTION_PARAMS ( JOB_EXECUTION_ID BIGINT NOT NULL, TYPE_CD VARCHAR(6) NOT NULL, KEY_NAME VARCHAR(100) NOT NULL, STRING_VAL VARCHAR(250), DATE_VAL TIMESTAMP DEFAULT NULL, LONG_VAL BIGINT, DOUBLE_VAL DOUBLE PRECISION , IDENTIFYING CHAR(1) NOT NULL , constraint JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID) references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ); CREATE TABLE BATCH_STEP_EXECUTION ( STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, VERSION BIGINT NOT NULL, STEP_NAME VARCHAR(100) NOT NULL, JOB_EXECUTION_ID BIGINT NOT NULL, START_TIME TIMESTAMP NOT NULL, END_TIME TIMESTAMP DEFAULT NULL, STATUS VARCHAR(10), COMMIT_COUNT BIGINT, READ_COUNT BIGINT, FILTER_COUNT BIGINT, WRITE_COUNT BIGINT, READ_SKIP_COUNT BIGINT, WRITE_SKIP_COUNT BIGINT, PROCESS_SKIP_COUNT BIGINT, ROLLBACK_COUNT BIGINT, EXIT_CODE VARCHAR(2500), EXIT_MESSAGE VARCHAR(2500), LAST_UPDATED TIMESTAMP, constraint JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID) references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ); CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT ( STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, SHORT_CONTEXT VARCHAR(2500) NOT NULL, SERIALIZED_CONTEXT LONGVARCHAR, constraint STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID) references BATCH_STEP_EXECUTION(STEP_EXECUTION_ID) ); CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT ( JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, SHORT_CONTEXT VARCHAR(2500) NOT NULL, SERIALIZED_CONTEXT LONGVARCHAR, constraint JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID) references BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ); CREATE TABLE task_execution_metadata ( ID BIGINT NOT NULL, TASK_EXECUTION_ID BIGINT NOT NULL, TASK_EXECUTION_MANIFEST CLOB, PRIMARY KEY (ID), CONSTRAINT TASK_METADATA_FK FOREIGN KEY (TASK_EXECUTION_ID) REFERENCES TASK_EXECUTION(TASK_EXECUTION_ID) ); CREATE SEQUENCE task_execution_metadata_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE BATCH_STEP_EXECUTION_SEQ; CREATE SEQUENCE BATCH_JOB_EXECUTION_SEQ; CREATE SEQUENCE BATCH_JOB_SEQ; create index STEP_NAME_IDX on BATCH_STEP_EXECUTION (STEP_NAME); create index TASK_EXECUTION_ID_IDX on TASK_EXECUTION_PARAMS (TASK_EXECUTION_ID); CREATE TABLE BOOT3_TASK_EXECUTION ( TASK_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY , START_TIME TIMESTAMP(9) DEFAULT NULL , END_TIME TIMESTAMP(9) DEFAULT NULL , TASK_NAME VARCHAR(100) , EXIT_CODE INTEGER , EXIT_MESSAGE VARCHAR(2500) , ERROR_MESSAGE VARCHAR(2500) , LAST_UPDATED TIMESTAMP(9), EXTERNAL_EXECUTION_ID VARCHAR(255), PARENT_EXECUTION_ID BIGINT ); CREATE TABLE BOOT3_TASK_EXECUTION_PARAMS ( TASK_EXECUTION_ID BIGINT NOT NULL , TASK_PARAM VARCHAR(2500) , constraint BOOT3_TASK_EXEC_PARAMS_FK foreign key (TASK_EXECUTION_ID) references BOOT3_TASK_EXECUTION(TASK_EXECUTION_ID) ) ; CREATE TABLE BOOT3_TASK_EXECUTION_METADATA ( ID BIGINT NOT NULL, TASK_EXECUTION_ID BIGINT NOT NULL, TASK_EXECUTION_MANIFEST LONGTEXT, primary key (ID), CONSTRAINT BOOT3_TASK_METADATA_FK FOREIGN KEY (TASK_EXECUTION_ID) REFERENCES BOOT3_TASK_EXECUTION (TASK_EXECUTION_ID) ); CREATE SEQUENCE BOOT3_TASK_EXECUTION_METADATA_SEQ; CREATE TABLE BOOT3_TASK_TASK_BATCH ( TASK_EXECUTION_ID BIGINT NOT NULL , JOB_EXECUTION_ID BIGINT NOT NULL , constraint BOOT3_TASK_EXEC_BATCH_FK foreign key (TASK_EXECUTION_ID) references BOOT3_TASK_EXECUTION(TASK_EXECUTION_ID) ) ; CREATE SEQUENCE BOOT3_TASK_SEQ; CREATE TABLE BOOT3_TASK_LOCK ( LOCK_KEY CHAR(36) NOT NULL, REGION VARCHAR(100) NOT NULL, CLIENT_ID CHAR(36), CREATED_DATE TIMESTAMP(9) NOT NULL, constraint BOOT3_LOCK_PK primary key (LOCK_KEY, REGION) ); CREATE TABLE BOOT3_BATCH_JOB_INSTANCE ( JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT , JOB_NAME VARCHAR(100) NOT NULL, JOB_KEY VARCHAR(32) NOT NULL, constraint BOOT3_JOB_INST_UN unique (JOB_NAME, JOB_KEY) ) ; CREATE TABLE BOOT3_BATCH_JOB_EXECUTION ( JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT , JOB_INSTANCE_ID BIGINT NOT NULL, CREATE_TIME TIMESTAMP(9) NOT NULL, START_TIME TIMESTAMP(9) DEFAULT NULL , END_TIME TIMESTAMP(9) DEFAULT NULL , STATUS VARCHAR(10) , EXIT_CODE VARCHAR(2500) , EXIT_MESSAGE VARCHAR(2500) , LAST_UPDATED TIMESTAMP(9), constraint BOOT3_JOB_INST_EXEC_FK foreign key (JOB_INSTANCE_ID) references BOOT3_BATCH_JOB_INSTANCE(JOB_INSTANCE_ID) ) ; CREATE TABLE BOOT3_BATCH_JOB_EXECUTION_PARAMS ( JOB_EXECUTION_ID BIGINT NOT NULL , PARAMETER_NAME VARCHAR(100) NOT NULL , PARAMETER_TYPE VARCHAR(100) NOT NULL , PARAMETER_VALUE VARCHAR(2500) , IDENTIFYING CHAR(1) NOT NULL , constraint BOOT3_JOB_EXEC_PARAMS_FK foreign key (JOB_EXECUTION_ID) references BOOT3_BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ) ; CREATE TABLE BOOT3_BATCH_STEP_EXECUTION ( STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT NOT NULL, STEP_NAME VARCHAR(100) NOT NULL, JOB_EXECUTION_ID BIGINT NOT NULL, CREATE_TIME TIMESTAMP(9) NOT NULL, START_TIME TIMESTAMP(9) DEFAULT NULL , END_TIME TIMESTAMP(9) DEFAULT NULL , STATUS VARCHAR(10) , COMMIT_COUNT BIGINT , READ_COUNT BIGINT , FILTER_COUNT BIGINT , WRITE_COUNT BIGINT , READ_SKIP_COUNT BIGINT , WRITE_SKIP_COUNT BIGINT , PROCESS_SKIP_COUNT BIGINT , ROLLBACK_COUNT BIGINT , EXIT_CODE VARCHAR(2500) , EXIT_MESSAGE VARCHAR(2500) , LAST_UPDATED TIMESTAMP(9), constraint BOOT3_JOB_EXEC_STEP_FK foreign key (JOB_EXECUTION_ID) references BOOT3_BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ) ; CREATE TABLE BOOT3_BATCH_STEP_EXECUTION_CONTEXT ( STEP_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, SHORT_CONTEXT VARCHAR(2500) NOT NULL, SERIALIZED_CONTEXT LONGVARCHAR , constraint BOOT3_STEP_EXEC_CTX_FK foreign key (STEP_EXECUTION_ID) references BOOT3_BATCH_STEP_EXECUTION(STEP_EXECUTION_ID) ) ; CREATE TABLE BOOT3_BATCH_JOB_EXECUTION_CONTEXT ( JOB_EXECUTION_ID BIGINT NOT NULL PRIMARY KEY, SHORT_CONTEXT VARCHAR(2500) NOT NULL, SERIALIZED_CONTEXT LONGVARCHAR , constraint BOOT3_JOB_EXEC_CTX_FK foreign key (JOB_EXECUTION_ID) references BOOT3_BATCH_JOB_EXECUTION(JOB_EXECUTION_ID) ) ; CREATE SEQUENCE BOOT3_BATCH_STEP_EXECUTION_SEQ; CREATE SEQUENCE BOOT3_BATCH_JOB_EXECUTION_SEQ; CREATE SEQUENCE BOOT3_BATCH_JOB_SEQ; CREATE VIEW AGGREGATE_TASK_EXECUTION AS SELECT TASK_EXECUTION_ID, START_TIME, END_TIME, TASK_NAME, EXIT_CODE, EXIT_MESSAGE, ERROR_MESSAGE, LAST_UPDATED, EXTERNAL_EXECUTION_ID, PARENT_EXECUTION_ID, 'boot2' AS SCHEMA_TARGET FROM TASK_EXECUTION UNION ALL SELECT TASK_EXECUTION_ID, START_TIME, END_TIME, TASK_NAME, EXIT_CODE, EXIT_MESSAGE, ERROR_MESSAGE, LAST_UPDATED, EXTERNAL_EXECUTION_ID, PARENT_EXECUTION_ID, 'boot3' AS SCHEMA_TARGET FROM BOOT3_TASK_EXECUTION; CREATE VIEW AGGREGATE_TASK_EXECUTION_PARAMS AS SELECT TASK_EXECUTION_ID, TASK_PARAM, 'boot2' AS SCHEMA_TARGET FROM TASK_EXECUTION_PARAMS UNION ALL SELECT TASK_EXECUTION_ID, TASK_PARAM, 'boot3' AS SCHEMA_TARGET FROM BOOT3_TASK_EXECUTION_PARAMS; CREATE VIEW AGGREGATE_JOB_EXECUTION AS SELECT JOB_EXECUTION_ID, VERSION, JOB_INSTANCE_ID, CREATE_TIME, START_TIME, END_TIME, STATUS, EXIT_CODE, EXIT_MESSAGE, LAST_UPDATED, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION UNION ALL SELECT JOB_EXECUTION_ID, VERSION, JOB_INSTANCE_ID, CREATE_TIME, START_TIME, END_TIME, STATUS, EXIT_CODE, EXIT_MESSAGE, LAST_UPDATED, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION; CREATE VIEW AGGREGATE_JOB_INSTANCE AS SELECT JOB_INSTANCE_ID, VERSION, JOB_NAME, JOB_KEY, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_INSTANCE UNION ALL SELECT JOB_INSTANCE_ID, VERSION, JOB_NAME, JOB_KEY, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_INSTANCE; CREATE VIEW AGGREGATE_TASK_BATCH AS SELECT TASK_EXECUTION_ID, JOB_EXECUTION_ID, 'boot2' AS SCHEMA_TARGET FROM TASK_TASK_BATCH UNION ALL SELECT TASK_EXECUTION_ID, JOB_EXECUTION_ID, 'boot3' AS SCHEMA_TARGET FROM BOOT3_TASK_TASK_BATCH; CREATE VIEW AGGREGATE_STEP_EXECUTION AS SELECT STEP_EXECUTION_ID, VERSION, STEP_NAME, JOB_EXECUTION_ID, START_TIME, END_TIME, STATUS, COMMIT_COUNT, READ_COUNT, FILTER_COUNT, WRITE_COUNT, READ_SKIP_COUNT, WRITE_SKIP_COUNT, PROCESS_SKIP_COUNT, ROLLBACK_COUNT, EXIT_CODE, EXIT_MESSAGE, LAST_UPDATED, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION UNION ALL SELECT STEP_EXECUTION_ID, VERSION, STEP_NAME, JOB_EXECUTION_ID, START_TIME, END_TIME, STATUS, COMMIT_COUNT, READ_COUNT, FILTER_COUNT, WRITE_COUNT, READ_SKIP_COUNT, WRITE_SKIP_COUNT, PROCESS_SKIP_COUNT, ROLLBACK_COUNT, EXIT_CODE, EXIT_MESSAGE, LAST_UPDATED, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION; ALTER TABLE task_execution_metadata RENAME TO task_execution_metadata_lc; ALTER TABLE task_execution_metadata_lc RENAME TO TASK_EXECUTION_METADATA; CREATE SEQUENCE task_execution_metadata_seq_lc; ALTER SEQUENCE task_execution_metadata_seq_lc RESTART WITH (NEXT VALUE FOR task_execution_metadata_seq); DROP SEQUENCE task_execution_metadata_seq; CREATE SEQUENCE TASK_EXECUTION_METADATA_SEQ; ALTER SEQUENCE TASK_EXECUTION_METADATA_SEQ RESTART WITH (NEXT VALUE FOR task_execution_metadata_seq_lc); DROP SEQUENCE task_execution_metadata_seq_lc;
-- phpMyAdmin SQL Dump -- version 3.3.3 -- http://www.phpmyadmin.net -- -- 主机: 192.168.5.12:3306 -- 生成日期: 2014 年 01 月 09 日 14:43 -- 服务器版本: 5.0.77 -- PHP 版本: 5.3.2 set names utf8; drop database IF EXISTS zsg_bi_rc; create database zsg_bi_rc; use zsg_bi_rc; SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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 */; -- -- 数据库: `bi_fenku_v1_0` -- -- -------------------------------------------------------- -- -- 表的结构 `bi_consume_first` -- CREATE TABLE IF NOT EXISTS `bi_consume_first` ( `record_time` int(11) NOT NULL COMMENT '消费时间', `user_id` bigint(20) NOT NULL COMMENT '玩家平台ID', `player` varchar(30) NOT NULL COMMENT '角色名', `grade` int(11) NOT NULL COMMENT '消费时的玩家等级', `type` int(11) NOT NULL COMMENT '消费类别', `shop` int(11) NOT NULL COMMENT '商品ID', `amount` int(11) NOT NULL COMMENT '消费数量', `money` int(11) NOT NULL COMMENT '金额', `num` int(11) unsigned NOT NULL COMMENT '消费次数', `sum_money` int(11) unsigned NOT NULL COMMENT '消费总金额', PRIMARY KEY (`user_id`), KEY `time` (`record_time`), KEY `type` (`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='首次消费表'; -- -------------------------------------------------------- -- -- 表的结构 `bi_consume_logs` -- CREATE TABLE IF NOT EXISTS `bi_consume_logs` ( `id` bigint(20) NOT NULL auto_increment COMMENT '自增ID', `record_time` int(11) NOT NULL COMMENT '消费时间,时间戳 秒', `user_id` bigint(20) NOT NULL COMMENT '玩家ID', `player` varchar(30) default NULL COMMENT '角色名', `grade` int(11) NOT NULL default '0' COMMENT '消费时的玩家等级', `type` int(11) NOT NULL default '0' COMMENT '消费类别,比如功能性消费,道具购买型消费', `shop` int(11) NOT NULL default '0' COMMENT '商品ID,该字段归属于type分类下面', `amount` int(11) NOT NULL default '0' COMMENT '消费数量', `money` int(11) NOT NULL default '0' COMMENT '消费总货币数', `money_type_id` int(11) NOT NULL default '1' COMMENT '消费货币类型,与bi_money_list表的typ_id含义一样', PRIMARY KEY (`id`), KEY `time` (`record_time`), KEY `user_id` (`user_id`), KEY `type` (`type`,`shop`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='消费日志表' AUTO_INCREMENT=3 ; -- -- 触发器 `bi_consume_logs` -- DROP TRIGGER IF EXISTS `first_consume`; DELIMITER // CREATE TRIGGER `first_consume` AFTER INSERT ON `bi_consume_logs` FOR EACH ROW INSERT INTO bi_consume_first (record_time,user_id,player,grade,type,shop,amount,money,num,sum_money) VALUES(NEW.record_time,NEW.user_id,NEW.player,NEW.grade,NEW.type,NEW.shop,NEW.amount,NEW.money,1,NEW.money) ON DUPLICATE KEY UPDATE num=num+1,sum_money=sum_money+NEW.money // DELIMITER ; -- -------------------------------------------------------- -- -- 表的结构 `bi_customspass_info` -- CREATE TABLE IF NOT EXISTS `bi_customspass_info` ( `id` bigint(20) unsigned NOT NULL auto_increment COMMENT '自增ID', `uid` bigint(20) NOT NULL COMMENT '玩家ID', `type_id` tinyint(3) NOT NULL default '1' COMMENT '关卡类型', `lsid` int(11) NOT NULL default '0' COMMENT '关卡sid', `finish` int(1) NOT NULL default '0' COMMENT '完成度', `ftime` int(11) NOT NULL default '0' COMMENT '达到当前完成度的时间 时间戳 秒', `wincount` int(1) NOT NULL default '0' COMMENT '完成次数', `losecount` int(1) NOT NULL default '0' COMMENT '失败次数', `firsttime` int(11) NOT NULL default '0' COMMENT '首次完成时间 时间戳 秒', PRIMARY KEY (`id`), KEY `lsid` (`lsid`), KEY `uid` (`uid`), KEY `fristtime` (`firsttime`), KEY `type_id` (`type_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='BI用玩家关卡完成情况' AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_day` -- CREATE TABLE IF NOT EXISTS `bi_day` ( `id` int(11) unsigned NOT NULL auto_increment, `record_time` int(11) NOT NULL COMMENT '采集日期:20010807', `total_onlinetime` int(11) NOT NULL COMMENT '总在线时长 分钟', `avg_onlinetime` int(11) NOT NULL COMMENT '平均在线时长 分钟', `total_money` bigint(20) NOT NULL COMMENT '产出的总游戏币', `consume_money` bigint(20) NOT NULL COMMENT '消耗的总游戏币', `money` bigint(20) NOT NULL COMMENT '存量游戏币', `token` bigint(20) NOT NULL COMMENT '存量代币', PRIMARY KEY (`id`), KEY `time` (`record_time`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='日采集数据表' AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_login_logs` -- CREATE TABLE IF NOT EXISTS `bi_login_logs` ( `id` bigint(20) unsigned NOT NULL auto_increment, `user_id` bigint(20) NOT NULL COMMENT '玩家ID', `player` varchar(40) NOT NULL default '0' COMMENT '登录的角色名', `grade` int(11) NOT NULL default '0' COMMENT '玩家登录时的等级', `record_time` int(11) NOT NULL default '0' COMMENT '登录时间 时间戳 秒', `ip` varchar(39) NOT NULL default '0' COMMENT '登录时的IP地址', `type` char(1) NOT NULL default '0' COMMENT '0.登录,1.注销', `onlinetime` int(11) NOT NULL default '0' COMMENT 'type=1时为此次游戏的在线时长,否则置0 ,在注销的时候记录在线时长 分钟', PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `time` (`record_time`,`user_id`), KEY `grade` (`grade`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='登录日志' AUTO_INCREMENT=1 ; -- -- 触发器 `bi_login_logs` -- DROP TRIGGER IF EXISTS `bi_login_logs_TRIGGER`; DELIMITER // CREATE TRIGGER `bi_login_logs_TRIGGER` AFTER INSERT ON `bi_login_logs` FOR EACH ROW begin INSERT INTO bi_login_logs_day(`user_id`,login_date,login_count,nickname,onlinetimes) VALUES(NEW.user_id,FROM_UNIXTIME( NEW.record_time, "%Y%m%d"),1,NEW.player,NEW.onlinetime) ON DUPLICATE KEY UPDATE login_count=login_count+1,onlinetimes=onlinetimes+NEW.onlinetime; if (NEW.type > 0) then update bi_player set level = NEW.grade where uid = NEW.user_id; end if; end // DELIMITER ; -- -------------------------------------------------------- -- -- 表的结构 `bi_login_logs_day` -- CREATE TABLE IF NOT EXISTS `bi_login_logs_day` ( `user_id` bigint(20) unsigned NOT NULL COMMENT '玩家ID', `login_date` int(11) unsigned NOT NULL COMMENT '登陆日期 如20130918', `login_count` int(11) unsigned NOT NULL default '1' COMMENT '当天登陆次数', `nickname` char(30) NOT NULL COMMENT '登陆角色', `onlinetimes` int(11) unsigned NOT NULL default '0' COMMENT '当天在线时长 分', PRIMARY KEY (`user_id`,`login_date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='玩家登陆日志,按天统计,该表是用触发器写入,程序不需要关心此表'; -- -------------------------------------------------------- -- -- 表的结构 `bi_money_list` -- CREATE TABLE IF NOT EXISTS `bi_money_list` ( `id` int(11) NOT NULL auto_increment, `uid` bigint(20) NOT NULL COMMENT '用户ID', `type_id` tinyint(3) NOT NULL default '0' COMMENT '货币种类,项目组定义好比如1表示元宝 2表示金券等', `amount` bigint(11) NOT NULL default '0' COMMENT '数量,增加用正数,消耗用负数', `balance` bigint(11) unsigned NOT NULL default '0' COMMENT '操作后的余额', `act_type` tinyint(3) NOT NULL default '0' COMMENT '操作类别 1:增加;2:消耗', `act_method` varchar(20) NOT NULL default '0' COMMENT '操作途径', `record_time` int(11) unsigned NOT NULL default '0' COMMENT '操作时间 时间戳 秒', PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `record_time` (`record_time`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='货币流水表' AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_online_times` -- CREATE TABLE IF NOT EXISTS `bi_online_times` ( `id` bigint(20) unsigned NOT NULL auto_increment, `record_time` int(11) NOT NULL COMMENT '采集时间,时间戳', `amount` int(11) NOT NULL COMMENT '在线人数', PRIMARY KEY (`id`), KEY `time` (`record_time`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='10分钟采集' AUTO_INCREMENT=5 ; -- -- 触发器 `bi_online_times` -- DROP TRIGGER IF EXISTS `bi_online_times_TRIGGER`; DELIMITER // CREATE TRIGGER `bi_online_times_TRIGGER` AFTER INSERT ON `bi_online_times` FOR EACH ROW begin INSERT INTO bi_online_times_hour(log_date,hour,max_online_count) VALUES(FROM_UNIXTIME( NEW.record_time, "%Y%m%d"),FROM_UNIXTIME( NEW.record_time, "%H"),NEW.amount) ON DUPLICATE KEY UPDATE max_online_count = max_online_count; update bi_online_times_hour set max_online_count = NEW.amount where log_date=FROM_UNIXTIME( NEW.record_time, "%Y%m%d") and NEW.amount>max_online_count and hour = FROM_UNIXTIME( NEW.record_time, "%H"); end // DELIMITER ; -- -------------------------------------------------------- -- -- 表的结构 `bi_online_times_hour` -- CREATE TABLE IF NOT EXISTS `bi_online_times_hour` ( `log_date` int(11) NOT NULL COMMENT '存储日期 格式 20131209', `hour` tinyint(3) NOT NULL COMMENT '小时,数值是 0-23', `max_online_count` int(11) unsigned NOT NULL COMMENT '最大在线人数', PRIMARY KEY (`log_date`,`hour`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='按小时存储该小时内的最高在线人数 触发器完成,程序不需要关心'; -- -------------------------------------------------------- -- -- 表的结构 `bi_order_logs` -- CREATE TABLE IF NOT EXISTS `bi_order_logs` ( `id` int(11) unsigned NOT NULL auto_increment, `order_id` varchar(70) NOT NULL COMMENT '平台订单号', `record_time` int(11) NOT NULL default '0' COMMENT '充值时间 时间戳', `user_id` bigint(20) NOT NULL default '0' COMMENT '玩家平台ID', `grade` int(11) NOT NULL default '0' COMMENT '玩家充值时的等级', `money` int(11) NOT NULL default '0' COMMENT '充值的元宝', `rmb` float(8,2) NOT NULL default '0.00' COMMENT '人民币', `is_first` char(1) NOT NULL default '0' COMMENT '0.非首充,1.首充', PRIMARY KEY (`id`), UNIQUE KEY `order_id` (`order_id`), KEY `user_id` (`user_id`), KEY `record_time` (`record_time`), KEY `grade` (`grade`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='充值日志表' AUTO_INCREMENT=8 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_player` -- CREATE TABLE IF NOT EXISTS `bi_player` ( `id` int(11) unsigned NOT NULL auto_increment, `uid` bigint(20) NOT NULL COMMENT '玩家ID', `name` char(32) NOT NULL default '0' COMMENT '玩家昵称', `is_true_user` tinyint(3) NOT NULL default '0' COMMENT '是否是有效用户,0无效;1有效', `true_user_time` int(11) NOT NULL default '0' COMMENT '成为有效用户的时间', `is_pay_user` tinyint(3) NOT NULL default '0' COMMENT '是否为付费用户,0为未付费 1为有付费记录;该字段请程序忽略,触发器会自动完成该字段的填充', `pay_user_time` int(11) NOT NULL default '0' COMMENT '成为付费用户的时间(程序开发不用关心,由BI系统完成)', `is_pay_chixu_user` tinyint(3) NOT NULL default '0' COMMENT '是否为持续付费用户,(程序开发不用关心,由触发器完成)', `pay_chixu_use_time` int(11) NOT NULL default '0' COMMENT '成为持续付费用户的时间(程序开发不用关心,由触发器完成)', `pay_count` int(11) NOT NULL default '0' COMMENT '付费次数(程序开发不用关心,由BI系统完成)', `level` int(1) NOT NULL default '0' COMMENT '玩家等级,项目组不需要更新,有触发器完成', `vip` int(1) NOT NULL default '0' COMMENT '玩家vip等级', `money` bigint(11) NOT NULL default '0' COMMENT '玩家龙币', `rmb` int(11) NOT NULL default '0' COMMENT '玩家代币,此处的代币不是人民币,是人民币转换来的币', `friendcount` smallint(1) NOT NULL default '0' COMMENT '玩家好友数量', `platform_id` int(11) NOT NULL default '0' COMMENT '平台ID', `platform_user_id` char(70) default NULL COMMENT '平台上用户的平台用户ID', `created_time` int(11) NOT NULL default '0' COMMENT '创建角色时间 时间戳 秒', `record_time` int(11) NOT NULL default '0' COMMENT '记录产生的时间,注册用户的时候写入该时间 时间戳秒', `ip` char(15) default NULL COMMENT '注册时的IP', `system_type` tinyint(3) NOT NULL default '0' COMMENT '用户操作系统,具体操作系统编号文档上查询,项目组只需要接收到参数写入,主要针对手游', `phone_device` char(70) default NULL COMMENT '手机设备号,针对页游', PRIMARY KEY (`id`), UNIQUE KEY `uid` (`uid`), KEY `name` (`name`), KEY `level` (`level`), KEY `platform_user_id` (`platform_user_id`), KEY `created_time` (`created_time`), KEY `record_time` (`record_time`), KEY `pay_user_time` (`pay_user_time`), KEY `pay_chixu_use_time` (`pay_chixu_use_time`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='BI用玩家基础信息表,注册账号的时候插入数据,创建角色的时候更新昵称和时间' AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_task` -- CREATE TABLE IF NOT EXISTS `bi_task` ( `id` bigint(20) unsigned NOT NULL auto_increment, `user_id` bigint(20) unsigned NOT NULL COMMENT '玩家ID', `level` int(11) NOT NULL default '0' COMMENT '玩家当前等级', `task_id` char(30) NOT NULL default '0' COMMENT '任务ID', `type_id` char(30) NOT NULL default '0' COMMENT '任务类别ID', `status` tinyint(3) NOT NULL default '1' COMMENT '任务完成状态,目前只存1,只存完成状态', `record_time` int(11) NOT NULL default '0' COMMENT '记录时间 时间戳', PRIMARY KEY (`id`), KEY `user_id` (`user_id`,`task_id`,`type_id`,`record_time`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='任务列表' AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_tool_list` -- CREATE TABLE IF NOT EXISTS `bi_tool_list` ( `id` int(11) NOT NULL auto_increment, `uid` bigint(20) NOT NULL COMMENT '用户ID', `tool_type` int(11) NOT NULL default '0' COMMENT '道具类别', `tool_id` int(20) NOT NULL default '0' COMMENT '道具ID', `amount` int(11) NOT NULL default '0' COMMENT '数量,增加用正数,消耗用负数', `balance` int(11) unsigned NOT NULL default '0' COMMENT '操作后的余额', `act_type` tinyint(3) NOT NULL default '0' COMMENT '自定义类别:比如0为系统产生;1为元宝购买等', `act_method` varchar(20) NOT NULL default '0' COMMENT '操作途径', `note` varchar(20) NOT NULL default '0' COMMENT '描述', `record_time` int(11) unsigned NOT NULL default '0' COMMENT '操作时间', PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `tool_type` (`tool_type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='道具流水表' AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- 表的结构 `bi_version` -- CREATE TABLE IF NOT EXISTS `bi_version` ( `version` char(10) NOT NULL COMMENT '接入BI的版本号' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='接入BI的版本号';
select count(distinct if(follower_num_2019 is not null, room_id, null)) as num_2019, count(distinct if(follower_num_2018 is not null, room_id, null)) as num_2018, count(distinct if(follower_num_2017 is not null, room_id, null)) as num_2017, count(distinct room_id) as total_num from follower_wide
DROP DATABASE IF EXISTS `todo-app-db`; CREATE DATABASE `todo-app-db`; USE `todo-app-db`; DROP TABLE IF EXISTS `todos`; CREATE TABLE `todos` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL DEFAULT '', `created` datetime NOT NULL, `updated` datetime, `completed` enum('false', 'true') NOT NULL DEFAULT 'false', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `todos` (`title`, `created`, `completed`) VALUES ('create a todo', now(), 'false'), ('do laundry', now(), 'false'), ('finish todo app', now(), 'false');
ALTER table employeeleave Drop Column userid; DROP Table employeeleave
------------------------------------------------------------------------------- -- Foreign Key Unit Tests: ------------------------------------------------------------------------------- -- buyerID field test: INSERT INTO Trades(exchangeID, symbol, tradeTS, buyerID, sellerID, price, volume) VALUES ('NASDAQ', 'AAPL', TIMESTAMP '1999-01-08 04:05:06', 9999, 1456, 3.25, 50); -- Result: -- ERROR: insert or update on table "trades" violates foreign key constraint "trades_buyerid_fkey" ------------------------------------------------------------------------------- -- sellerID field test: INSERT INTO Trades(exchangeID, symbol, tradeTS, buyerID, sellerID, price, volume) VALUES ('NASDAQ', 'AAPL', TIMESTAMP '1999-01-08 04:05:06', 1456, 9988, 3.25, 50); -- Result: -- ERROR: insert or update on table "trades" violates foreign key constraint "trades_buyerid_fkey" ------------------------------------------------------------------------------- -- Trades (exchangeID, symbol) field test: INSERT INTO Trades(exchangeID, symbol, tradeTS, buyerID, sellerID, price, volume) VALUES ('NYSE', 'ZZYZ', TIMESTAMP '1999-01-08 04:05:06', 1456, 1489, 3.25, 50); -- Result: -- ERROR: insert or update on table "trades" violates foreign key constraint "trades_exchangeid_fkey" ------------------------------------------------------------------------------- -- Quotes (exchangeID, symbol) field test: INSERT INTO Quotes(exchangeID, symbol, quoteTS, price) VALUES ('NYSE', 'ZZYZ', TIMESTAMP '1999-01-08 04:05:06', 3.25); -- Result: -- ERROR: insert or update on table "quotes" violates foreign key constraint "quotes_exchangeid_fkey" ------------------------------------------------------------------------------- -- General Constraint Unit Tests: ------------------------------------------------------------------------------- -- Price must be positive unit test (Update that meets constraint) UPDATE Quotes SET price = 0.05 WHERE (price > 500); -- Result: -- Query returned successfully -- Price must be positive unit test (Update that DOES NOT meets constraint) UPDATE Quotes SET price = -0.05 WHERE (price > 500); -- Result: -- ERROR: new row for relation "quotes" violates check constraint "positive_price" ------------------------------------------------------------------------------- -- Cost must be positive unit test (Update that meets constraint) UPDATE Trades SET price = 1050 WHERE (price > 500); -- Result: -- Query returned successfully -- Cost must be positive unit test (Update that DOES NOT meets constraint) UPDATE Trades SET price = -0.05 WHERE (price > 1000); -- Result: -- ERROR: new row for relation "trades" violates check constraint "positive_cost" ------------------------------------------------------------------------------- -- buyerID != sellerID unit test (Update that meets constraint) UPDATE Trades SET buyerID = 1456 WHERE (sellerID = 1854); -- Result: -- Query returned successfully -- buyerID != sellerID unit test (Update that DOES NOT meets constraint) UPDATE Trades SET buyerID = 1456 WHERE (sellerID = 1456); -- Result: -- ERROR: new row for relation "trades" violates check constraint "uniqueids" ------------------------------------------------------------------------------- -- if category is 'H', then is valid customer unit test (Update that meets constraint) UPDATE Customers SET category = 'H' WHERE (category = 'L'); -- Result: -- Query returned successfully -- if category is 'H', then is valid customer unit test (Update that DOES NOT meets constraint) UPDATE Customers SET isValidCustomer = FALSE WHERE (category = 'H'); -- Result: -- ERROR: new row for relation "trades" violates check constraint "uniqueids"
CREATE DATABASE Address_Book_Service; USE Address_Book_Service; CREATE TABLE Person( PersonId int auto_increment primary Key, FirstName varchar(100) NOT NULL, LastName varchar(100) NOT NULL, Address varchar(100) NOT NULL, City varchar(100) NOT NULL, State varchar(100)NOT NUll, Zip int(6) NULL NUll, MobileNumber bigint(10)NOT NULL, EmailId Varchar(100) NOT NULL ); select * from Person; drop table Person; INSERT INTO Person(FirstName,LastName,Address,City,State,Zip,MobileNumber,EmailId) VALUES ('Jugal','Kishor','GandhiChowk','Bantumilli','AndhraPradesh',521324,8712443377,'jugal@gmail.com'), ('Roop','Kumar','AronodayaColony','Hyderabad','Telangana',500081,9295702642,'abc@gmail.com'), ('Saraiya','Purkana','Krths','Bantumilli','AndhraPradesh',123456,4567890123,'saru@gmail.com'), ('Manju','Chedhalla','Ponnuru','Guntur','AndhraPradesh',678901,9876543210,'manju@gmail.com'), ('Akhilesh','Krishna','Perungudi','Chennai','Tamilnadu',876904,9765432167,'akhi@gmail.com'); Select * from Person; SELECT @Person_id:=last_insert_id(); UPDATE Person SET State='Maharastra' WHERE FirstName='Akhilesh'; delete from Person Where PersonId=5; select * from Person Where State='AndhraPradesh' OR City='Bantumilli'; select * from Person Where State='AndhraPradesh' order by FirstName; SELECT COUNT(PersonId),PersonId from Person GROUP BY PersonId; select COUNT(State) from Person Where State='AndhraPradesh' AND City='Bantumilli'; Select * from Person Where City='Bantumilli' Order By FirstName; CREATE TABLE AddressBookType( AddressBookId int auto_increment Primary Key, AddressBookType varchar(100) NOT NULL, AddressBookName varchar(100) NOT NULL ); INSERT INTO AddressBookType(AddressBookType,AddressBookName) values('Friend','FriendAddressBook'), ('Profession','ProfesionAddressBook'), ('Family','FamilyAddressBook'); Delete from AddressBookType Where AddressBookID=3; select * From AddressBookType; Drop Table AddressBookType; CREATE TABLE PersonAddressBook( AddressBookId int, PersonId int, constraint PersonAddressBook_fk FOREIGN KEY (PersonId) REFERENCES Person(PersonId), constraint PersonAddressBook_fk1 FOREIGN KEY (AddressBookId) REFERENCES AddressBookType(AddressBookId) ); INSERT INTO PersonAddressBook(AddressBookId,PersonId) values(1,1), (2,1), (2,2), (1,3), (1,4), (3,5); select @addressbook_id_Friend :=AddressBookId From AddressBookType where AddressBookType='Friend'; select @addressbook_id_Family :=AddressBookId From AddressBookType where AddressBookType='Family'; select @addressbook_id_Profession :=AddressBookId From AddressBookType where AddressBookType='Profession'; INSERT INTO PersonAddressBook(AddressBookId,PersonId) values(@addressbook_id_Family,@Person_id); Select * from PersonAddressBook;
SELECT TUMBLE_END(geo_events.event_time, INTERVAL '3' MINUTE) as windowEnd, geo_events.driverId,geo_events.driverName,geo_events.route, avg(speed_events.speed) as driverAvgSpeed FROM truck_geo_events as geo_events, truck_speed_events as speed_events where geo_events.driverId = speed_events.driverId AND geo_events.event_time BETWEEN speed_events.event_time - INTERVAL '1' SECOND AND speed_events.event_time + INTERVAL '1' SECOND GROUP BY TUMBLE(geo_events.event_time, INTERVAL '3' MINUTE), geo_events.driverId, geo_events.driverName, geo_events.route;
CREATE Procedure sp_get_StockTransferOut_BatchInfo (@DocSerial int, @ItemCode nvarchar(20)) As Select StockTransferOutDetail.Batch_Number, Batch_Products.Expiry, Batch_Products.PKD, Sum(StockTransferOutDetail.Quantity), StockTransferOutDetail.Rate, StockTransferOutDetail.Free, StockTransferOutDetail.TaxSuffered, StockTransferOutDetail.PTS, StockTransferOutDetail.PTR, StockTransferOutDetail.ECP, StockTransferOutDetail.SpecialPrice,StockTransferOutDetail.TaxSuffApplicableOn, StockTransferOutDetail.TaxSuffPartOff ,StockTransferOutDetail.MRPPerPack,StockTransferOutDetail.TaxType ,StockTransferOutDetail.MRPforTax,Isnull(StockTransferOutDetail.TOQ,0) TOQ,Isnull(StockTransferOutDetail.TaxID,0) TaxID From StockTransferOutDetail, Batch_Products Where StockTransferOutDetail.Batch_Code = Batch_Products.Batch_Code And StockTransferOutDetail.Product_Code = @ItemCode And StockTransferOutDetail.DocSerial = @DocSerial Group By StockTransferOutDetail.Product_Code, StockTransferOutDetail.Batch_Number, StockTransferOutDetail.PTS, StockTransferOutDetail.PTR, StockTransferOutDetail.ECP, StockTransferOutDetail.SpecialPrice, StockTransferOutDetail.Free, Batch_Products.PKD, Batch_Products.Expiry, StockTransferOutDetail.TaxSuffered,StockTransferOutDetail.Rate, StockTransferOutDetail.TaxSuffApplicableOn,StockTransferOutDetail.TaxSuffPartOff ,StockTransferOutDetail.MRPPerPack,StockTransferOutDetail.TaxType ,StockTransferOutDetail.MRPforTax,Isnull(StockTransferOutDetail.TOQ,0) ,isnull(StockTransferOutDetail.TaxID,0)
use cs6400_sfa17_team033; # Clerk Users #clerk:1 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin@gatech.edu','2015-12-01', 'password', 'The', 'Best', 'Admin', 'admin@gatech.edu', 'hunter2'); #clerk:2 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin1@gatech.edu','2015-01-01', 'password', 'The', 'Best', 'Admin1', 'admin1@gatech.edu', 'hunter2'); #clerk:3 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin2@gatech.edu','2015-05-01', 'password', 'The', 'Best', 'Admin2', 'admin2@gatech.edu', 'hunter2'); #clerk:4 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin3@gatech.edu','2017-02-01', 'password', 'The', 'Best', 'Admin3', 'admin3@gatech.edu', 'hunter2'); #clerk:5 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin4@gatech.edu','2017-08-01', 'password', 'The', 'Best', 'Admin4', 'admin4@gatech.edu', 'hunter2'); #clerk:6 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin5@gatech.edu','2010-12-01', 'password', 'The', 'Best', 'Admin5', 'admin5@gatech.edu', 'hunter2'); #clerk:7 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin6@gatech.edu','2010-09-01', 'password', 'The', 'Best', 'Admin6', 'admin6@gatech.edu', 'hunter2'); #clerk:8 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin7@gatech.edu','2014-05-01', 'password', 'The', 'Best', 'Admin7', 'admin7@gatech.edu', 'hunter2'); #clerk:9 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin8@gatech.edu','2011-12-01', 'password', 'The', 'Best', 'Admin8', 'admin8@gatech.edu', 'hunter2'); #clerk:10 insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('admin9@gatech.edu','2012-12-01', 'password', 'The', 'Best', 'Admin9', 'admin9@gatech.edu', 'hunter2'); #clerk:11 System insert into Clerk (user_name, date_of_hire,temp_password, first_name, middle_name, last_name, email, password) values('jwatson@tools4rent.com','2000-01-01', 'password', 'Jill', '', 'Watson', 'jwatson@tools4rent.com', 'hunter2'); # Customers #customer:1 insert into Address (street, city, state, zip) values('123 main street', 'Gotham City', 'NY', '55555-5555'); set @addressId := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Bruce Wayne', '0000-5555-5555-0232', '004', 2, 2020); set @creditCardId := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('thebatman', 'Bruce', 'Tyrone', 'Wayne', 'thebatman@aol.com', 'robin', @addressId, @creditCardId); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5309', NULL, 'cell', TRUE, 'thebatman'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5308', NULL, 'work', False, 'thebatman'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '867-5308', NULL, 'home', False, 'thebatman'); #customer:2 insert into Address (street, city, state, zip) values('77 weekly street', 'Diablo City', 'UT', '6666-5555'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Bryan Fernando', '0000-6666-5555-0232', '005', 2, 2022); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('thehulk', 'Bryan', 'Wilson', 'Fernando', 'thehulk@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5307', NULL, 'cell', TRUE, 'thehulk'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5309', NULL, 'work', False, 'thehulk'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '867-5303', NULL, 'home', False, 'thehulk'); #customer:3 insert into Address (street, city, state, zip) values('7 bellevue way', 'Bellevue City', 'WA', '9999-0008'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Robert Mayer', '0000-7777-5555-0232', '006', 2, 2024); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('thor', 'Robert', 'W.', 'Mayer', 'thor@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5317', NULL, 'cell', TRUE, 'thor'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-5319', NULL, 'work', False, 'thor'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '867-5313', NULL, 'home', False, 'thor'); #customer:4 insert into Address (street, city, state, zip) values('55 weekly street', 'Bambo City', 'UT', '6666-8888'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Andrei Sebastian', '0000-8888-5555-0232', '005', 2, 2023); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('andreiseb', 'Andrei', 'X.', 'Sebastian', 'andreiseb@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-7777', NULL, 'cell', TRUE, 'andreiseb'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-4444', NULL, 'work', False, 'andreiseb'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '867-3333', NULL, 'home', False, 'andreiseb'); #customer:5 insert into Address (street, city, state, zip) values('7 Redmond way', 'Redmond City', 'WA', '9999-0024'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Dan Rob', '0000-7777-7272-0232', '012', 2, 2021); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('dan1', 'Dan', 'M.', 'Rob', 'dan1@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5317', NULL, 'cell', FALSE, 'dan1'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5319', NULL, 'work', False, 'dan1'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '323-5313', NULL, 'home', TRUE, 'dan1'); #customer:6 insert into Address (street, city, state, zip) values('7 massac street', 'Bothel City', 'WA', '6666-5555'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Bryan Fernando', '0000-3676-5555-0232', '015', 2, 2022); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('max9', 'Max', 'Wilson', 'Zor', 'max9@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '223-5307', NULL, 'cell', TRUE, 'max9'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '223-5309', NULL, 'work', False, 'max9'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '223-5303', NULL, 'home', False, 'max9'); #customer:7 insert into Address (street, city, state, zip) values('7 renton way', 'Renton City', 'WA', '9999-0208'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Rassel Wilson', '0000-4433-5555-0232', '077', 2, 2024); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('rasselw', 'Rassel', 'B.', 'Wilson', 'rasselw@outlook.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-7373', NULL, 'cell', TRUE, 'rasselw'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '867-7733', NULL, 'work', False, 'rasselw'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '867-7772', NULL, 'home', False, 'rasselw'); #customer:8 insert into Address (street, city, state, zip) values('55 Lamburd street', 'San Fransisco City', 'CA', '7383-8888'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Christiano Ronaldo', '0000-2727-5555-0232', '033', 2, 2023); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('christronald', 'Christiano', 'X.', 'Ronaldo', 'christronald@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '666-7767', NULL, 'cell', TRUE, 'christronald'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '666-4464', NULL, 'work', False, 'christronald'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '666-3363', NULL, 'home', False, 'christronald'); #customer:9 insert into Address (street, city, state, zip) values('7 Minor street', 'Seattle City', 'WA', '9999-2323'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Van Goh', '3333-7777-7272-0232', '012', 2, 2019); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('vangoh', 'Van', 'M.', 'Goh', 'vangoh@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5317', NULL, 'cell', TRUE, 'vangoh'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5319', NULL, 'work', False, 'vangoh'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '323-5313', NULL, 'home', False, 'vangoh'); #customer:10 insert into Address (street, city, state, zip) values('7 Union street', 'New York City', 'NY', '9899-0111'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Mark Vand', '2828-7777-7272-0232', '018', 4, 2019); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('markoo', 'Mark', 'B.', 'Vand', 'markoo@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5317', NULL, 'cell', TRUE, 'markoo'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '323-5319', NULL, 'work', False, 'markoo'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '323-5313', NULL, 'home', False, 'markoo'); #customer:11 insert into Address (street, city, state, zip) values('7 Beach street', 'Honololou City', 'HW', '3434-0033'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Van Goh', '3334-7777-4432-0232', '314', 2, 2019); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('winne', 'Winne', 'the', 'Pooh', 'winne@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '444-4343', NULL, 'cell', TRUE, 'winne'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('321', '444-3434', NULL, 'work', False, 'winne'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('444', '444-5553', NULL, 'home', False, 'winne'); #customer:12 insert into Address (street, city, state, zip) values('7 Union street', 'Tennisse City', 'WI', '3424-0111'); set @addressId1 := last_insert_id(); insert into CreditCard (name, card_number, cvc, expiration_month, expiration_year) values('Mark Vand', '2828-3883-7272-9393', '241', 4, 2020); set @creditCardId1 := last_insert_id(); insert into Customer (user_name, first_name,middle_name,last_name,email,password,Address_Id, CreditCard_Id) values('williamshk', 'William', 'B.', 'Shekspear', 'williamshk@gmail.com', 'user123', @addressId1, @creditCardId1); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('232', '323-9339', NULL, 'cell', TRUE, 'williamshk'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('232', '323-3319', NULL, 'work', False, 'williamshk'); insert into PhoneNumber (area_code, number, extension, type, `primary`, Customer_UserName) values('232', '323-4413', NULL, 'home', False, 'williamshk'); # Category and subtypes insert into Category (name) VALUES ('Hand'); set @handCategoryId := last_insert_id(); insert into Category (name) VALUES ('Garden'); set @gardenCategoryId := last_insert_id(); insert into Category (name) VALUES ('Ladder'); set @ladderCategoryId := last_insert_id(); insert into Category (name) VALUES ('Power'); set @powerCategoryId := last_insert_id(); #Power sources insert into PowerSource (name) VALUES ('Manual'); set @manualPowerSourceId := last_insert_id(); insert into PowerSource (name) VALUES ('A/C'); set @acPowerSourceId := last_insert_id(); insert into PowerSource (name) VALUES ('D/C'); set @dcPowerSourceId := last_insert_id(); insert into PowerSource (name) VALUES ('Gas'); set @gasPowerSourceId := last_insert_id(); # Power Source Category relationship insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@manualPowerSourceId, @handCategoryId); insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@manualPowerSourceId, @gardenCategoryId); insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@manualPowerSourceId, @ladderCategoryId); insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@acPowerSourceId, @powerCategoryId); insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@dcPowerSourceId, @powerCategoryId); insert into PowerSourceCategory (PowerSource_Id, Category_Id) VALUES (@gasPowerSourceId, @powerCategoryId); # Sub Types Hand insert into SubType (name, Category_Id) VALUES ('Screwdriver', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('phillips (cross)', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('hex', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('torx', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('slotted (flat)', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Socket', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('deep', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('standard', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Ratchet', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('adjustable', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('fixed', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Wrench', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('crescent', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('torque', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('pipe', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Pliers', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('needle nose', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('cutting', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('crimper', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Gun', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('nail', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('staple', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Hammer', @handCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('claw', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('sledge', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('framing', @lastSubtype); # Garden Subtypes insert into SubType (name, Category_Id) VALUES ('Digger', @gardenCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('pointed shovel', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('flat shovel', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('scoop shovel', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('edger', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Pruner', @gardenCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('sheer', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('loppers', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('hedge', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Rakes', @gardenCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('leaf', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('landscaping', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('rock', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Wheelbarrows', @gardenCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('1-wheel', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('2-wheel', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Striking', @gardenCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('bar pry', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('rubber mallet', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('tamper', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('pick axe', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('single bit axe', @lastSubtype); # Ladder insert into SubType (name, Category_Id) VALUES ('Straight', @ladderCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('rigid', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('telescoping', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Step', @ladderCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('folding', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('multi-position', @lastSubtype); # Power insert into SubType (name, Category_Id) VALUES ('Drill', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('driver', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('hammer', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Saw', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('circular', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('reciprocating', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('jig', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Sander', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('finish', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('sheet', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('belt', @lastSubtype); insert into SubOption (name, SubType_Id) VALUES ('random orbital', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Air-Compressor', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('reciprocating', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Mixer', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('concrete', @lastSubtype); insert into SubType (name, Category_Id) VALUES ('Generator', @powerCategoryId); set @lastSubtype := last_insert_id(); insert into SubOption (name, SubType_Id) VALUES ('electric', @lastSubtype); # setup powersource subtype relationship insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Screwdriver'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Socket'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Ratchet'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Wrench'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Pliers'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Gun'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Hammer'), @manualPowerSourceId, @handCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Digger'), @manualPowerSourceId, @gardenCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Pruner'), @manualPowerSourceId, @gardenCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Rakes'), @manualPowerSourceId, @gardenCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Wheelbarrows'), @manualPowerSourceId, @gardenCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Striking'), @manualPowerSourceId, @gardenCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Straight'), @manualPowerSourceId, @ladderCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Step'), @manualPowerSourceId, @ladderCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Drill'), @acPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Drill'), @dcPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Saw'), @acPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Saw'), @dcPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Sander'), @acPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Sander'), @dcPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Air-Compressor'), @acPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Air-Compressor'), @gasPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Mixer'), @acPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Mixer'), @gasPowerSourceId, @powerCategoryId); insert into SubTypePowerSource (SubType_Id, PowerSource_Id, Category_Id) VALUES ((select id from SubType where name = 'Generator'), @gasPowerSourceId, @powerCategoryId); # Insert Hand Tools #Hand tool : 1 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 44.0, @handCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Screwdriver'), (select id from SubOption where name = 'hex')); set @lastTool:= last_insert_id(); insert into HandTool VALUES (@lastTool); set @lastTool:= last_insert_id(); insert into ScrewDriver (id, screw_size) VALUES (@lastTool, 4); #Hand tool : 2 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 55, @handCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Screwdriver'), (select id from SubOption where name = 'hex')); set @lastTool:= last_insert_id(); insert into HandTool VALUES (@lastTool); set @lastTool:= last_insert_id(); insert into ScrewDriver (id, screw_size) VALUES (@lastTool, 4); #Hand tool : 3 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (12.0, 5.25, 68, 'Dewalt', 'plastic', 0.60, 12.44,99, @handCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Screwdriver'), (select id from SubOption where name = 'hex')); set @lastTool:= last_insert_id(); insert into HandTool VALUES (@lastTool); set @lastTool:= last_insert_id(); insert into ScrewDriver (id, screw_size) VALUES (@lastTool, 7); #Hand socket #Hand tool : 4 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 3, @handCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Socket'), (select id from SubOption where name = 'deep')); set @lastTool:= last_insert_id(); insert into HandTool VALUES (@lastTool); set @lastTool:= last_insert_id(); insert into HandSocket (id, drive_size, sae_size, deep_socket) VALUES (@lastTool, .5, .25, true); #Hand tool : 5 # Hand Ratchet insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 7, @handCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Ratchet'), (select id from SubOption where name = 'fixed')); set @lastTool:= last_insert_id(); insert into HandTool VALUES (@lastTool); set @lastTool:= last_insert_id(); insert into HandRatchet (id, drive_size) VALUES (@lastTool, .5); # Garden tools insert #Garden tool:1 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 66.9, @gardenCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Digger'), (select id from SubOption where name = 'edger')); set @lastTool:= last_insert_id(); insert into GardenTool (id, handle_material) VALUES (@lastTool, 'wood'); set @lastTool:= last_insert_id(); insert into DiggingTool (id, blade_width, blade_length) VALUES (@lastTool, NULL, .25); #Garden tool:2 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (8.0, 5, 132, 'Fiskars', 'steel', 14, 5.25, 35, @gardenCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Pruner'), (select id from SubOption where name = 'sheer')); set @lastTool:= last_insert_id(); insert into GardenTool (id, handle_material) VALUES (@lastTool, 'Fiberglass'); set @lastTool:= last_insert_id(); insert into PruningTool (id, blade_material, blade_length) VALUES (@lastTool, 'steel', 1.5); #Garden tool:3 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (26, 3, 71, 'Ames', 'plastic', 8, 3, 20, @gardenCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Rakes'), (select id from SubOption where name = 'leaf')); set @lastTool:= last_insert_id(); insert into GardenTool (id, handle_material) VALUES (@lastTool, 'steel'); set @lastTool:= last_insert_id(); insert into RakeTool (id, tine_count) VALUES (@lastTool, 39); #Garden tool:4 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (36, 3, 66, 'Midwest Gloves', 'metal', 22.124, 8.2965, 55.31, @gardenCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Rakes'), (select id from SubOption where name = 'landscaping')); set @lastTool:= last_insert_id(); insert into GardenTool (id, handle_material) VALUES (@lastTool, 'aluminum'); set @lastTool:= last_insert_id(); insert into RakeTool (id, tine_count) VALUES (@lastTool, 40); #Garden tool:5 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (4, 2, 44.5, 'Gardeners', 'steel', 27.98, 10.4925, 69.95, @gardenCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Rakes'), (select id from SubOption where name = 'rock')); set @lastTool:= last_insert_id(); insert into GardenTool (id, handle_material) VALUES (@lastTool, 'wood'); set @lastTool:= last_insert_id(); insert into RakeTool (id, tine_count) VALUES (@lastTool, 4); # Ladder Tools Insert #Ladder tool : 1 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.0, 2.25, 6, 'Dewalt', 'steel', 15.60, 5.33, 33.0, @ladderCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Step'), (select id from SubOption where name = 'folding')); set @lastTool:= last_insert_id(); insert into LadderTool (id, step_count, weight_capacity) VALUES (@lastTool, 10, 6.3); set @lastTool:= last_insert_id(); insert into StepLadder (id, pail_shelf) VALUES (@lastTool, true); #Ladder tool : 2 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (22.8, 4.63, 29.1, 'Finether', 'Aluminium', 24, 9, 60, @ladderCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Step'), (select id from SubOption where name = 'folding')); set @lastTool:= last_insert_id(); insert into LadderTool (id, step_count, weight_capacity) VALUES (@lastTool, 3, 330); set @lastTool:= last_insert_id(); insert into StepLadder (id, pail_shelf) VALUES (@lastTool, true); #Ladder tool : 3 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (22.4, 13.4, 28.5, 'Louisville', 'fiberglass', 15.60, 5.33, 33.0, @ladderCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Straight'), (select id from SubOption where name = 'telescoping')); set @lastTool:= last_insert_id(); insert into LadderTool (id, step_count, weight_capacity) VALUES (@lastTool, 6, 300); set @lastTool:= last_insert_id(); insert into StraightLadder (id, rubber_feet) VALUES (@lastTool, 6); #Ladder tool : 4 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (18.125, 13.4, 144, 'Werner', 'Aluminium', 70.4, 26.4, 176, @ladderCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Straight'), (select id from SubOption where name = 'telescoping')); set @lastTool:= last_insert_id(); insert into LadderTool (id, step_count, weight_capacity) VALUES (@lastTool, 12, 300); set @lastTool:= last_insert_id(); insert into StraightLadder (id, rubber_feet) VALUES (@lastTool, 12); #Ladder tool : 5 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (18, 19, 126, 'Xtend & Climb', 'steel', 58, 21.75, 145, @ladderCategoryId, @manualPowerSourceId, (select id from SubType where name = 'Straight'), (select id from SubOption where name = 'telescoping')); set @lastTool:= last_insert_id(); insert into LadderTool (id, step_count, weight_capacity) VALUES (@lastTool, 12, 225); set @lastTool:= last_insert_id(); insert into StraightLadder (id, rubber_feet) VALUES (@lastTool, 10.5); # Power Tool insert #power tool: 1 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (22.0, 2.25, 6, 'Dewalt', 'steel', 14, 88.98, 55, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Drill'), (select id from SubOption where name = 'hammer')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 110, 30, 2000, 4500); set @lastTool:= last_insert_id(); insert into PowerDrill (id, adjustable_clutch, min_torque_rating, max_torque_rating) VALUES (@lastTool, true, 80.5, NULL); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Drill Bits', 6, @lastTool); #power tool:2 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (7.2, 5.6, 12, 'Dewalt', 'steel', 40, 15, 100, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Drill'), (select id from SubOption where name = 'hammer')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 36, 5, 0, 1600); set @lastTool:= last_insert_id(); insert into PowerDrill (id, adjustable_clutch, min_torque_rating, max_torque_rating) VALUES (@lastTool, true, 80.5, NULL); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('36.0V 5.0A Li-ION Battery', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Power drill bits', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Soft Carrying case', 1, @lastTool); #power tool:3 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (18.66, 132, 21.64, 'Eagle', 'steel', 220, 82.5, 550, @powerCategoryId, @acPowerSourceId, (select id from SubType where name = 'Air-Compressor'), (select sb.id from SubOption sb JOIN SubType st ON sb.subtype_id = st.id where sb.name = 'reciprocating' AND st.name = 'Air-Compressor')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 115, 14, 0, 2400); set @lastTool:= last_insert_id(); insert into PowerAirCompressor (id, tank_size, pressure_rating) VALUES (@lastTool, 20, 125); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Puma 20-Piece Air Compressor Accessory Kit', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Eagle Hybri-Flex 1/4inch x 25inch Air Hose w/ 1/4inch MNPT Fittings', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Freeman Mini-Palm Nailer', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Campbell Hausfeld Caulk Gun', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Legacy Air Powered Grease Gun w/Extension', 1, @lastTool); #power tool:4 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (14.64, 132, 8.85, 'Milwaukee', 'steel', 100, 37.5, 250, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Saw'), (select id from SubOption where name = 'circular')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 18, 14, 0, 5000); set @lastTool:= last_insert_id(); insert into PowerSaw (id, blade_size) VALUES (@lastTool, 7.25); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Diablo 7-1/4 in. x 60-Tooth Fine Finish Saw Blade', 2, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('MilwaukeeM18 FUEL 18-Volt Lithium-Ion Cordless SAWZALL Reciprocating Saw with M18 9.0Ah Starter Kit', 1, @lastTool); #power tool:5 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (25, 515, 48, 'Generac', 'aluminum ', 1120, 420, 2800, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Generator'), (select id from SubOption where name = 'electric')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 120, 200, 0, 3600); set @lastTool:= last_insert_id(); insert into PowerGenerator (id, power_rating) VALUES (@lastTool, 22000); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Scheduled maintaince kit', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Auxiliary transfer switch lockout', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Fasica base wrap', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Wireless local monitor', 1, @lastTool); #power tool:6 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (14.64, 132, 8.85, 'Dewalt', 'steel', 100, 37.5, 250, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Saw'), (select id from SubOption where name = 'circular')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 18, 14, 0, 5000); set @lastTool:= last_insert_id(); insert into PowerSaw (id, blade_size) VALUES (@lastTool, 7.25); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Diablo 7-1/4 in. x 60-Tooth Fine Finish Saw Blade', 2, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Dewalt FUEL 18-Volt Lithium-Ion Cordless SAWZALL Reciprocating Saw with M18 9.0Ah Starter Kit', 1, @lastTool); #power tool:7 insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (25, 515, 48, 'Eagle', 'aluminum ', 1120, 420, 2800, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Generator'), (select id from SubOption where name = 'electric')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 120, 200, 0, 3600); set @lastTool:= last_insert_id(); insert into PowerGenerator (id, power_rating) VALUES (@lastTool, 22000); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Scheduled maintaince kit', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Auxiliary transfer switch lockout', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Fasica base wrap', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Wireless local monitor', 1, @lastTool); # Reservations #insert into Reservation (booking_date, start_date, end_date, Customer_UserName, DropOffClerk_UserName, PickupClerk_UserName) #VALUES (NOW(), '2017-10-02', '2017-10-12', 'thebatman', NULL, NULL); INSERT INTO `Reservation` VALUES (1,'2017-11-26 09:15:24','2017-10-02 00:00:00','2017-10-12 00:00:00','thebatman',NULL,NULL),(2,'2017-11-26 08:57:50','2017-11-26 00:00:00','2017-11-28 00:00:00','thor',NULL,NULL),(3,'2017-11-26 09:16:24','2017-12-15 00:00:00','2017-12-30 00:00:00','thor',NULL,NULL),(4,'2017-11-26 09:17:55','2017-11-29 00:00:00','2017-11-30 00:00:00','thehulk',NULL,NULL),(5,'2017-11-26 09:18:25','2017-11-28 00:00:00','2017-11-29 00:00:00','thehulk',NULL,NULL),(6,'2017-11-26 09:19:01','2017-12-01 00:00:00','2017-12-03 00:00:00','thehulk',NULL,NULL); # Sale Order insert into SaleOrder (for_sale_date, sold_date, purchase_price, Customer_UserName, Tool_Id, Clerk_UserName) VALUES ('2017-10-02', '2017-10-09', 47.88, 'thebatman', 1, 'admin@gatech.edu'); # Service Order insert into ServiceOrder (start_date, end_date, service_cost, Tool_Id) VALUES ('2017-10-02', '2017-10-09', 47.88, 1); # Tool Reservation #INSERT INTO ToolReservations (Tool_Id, Reservations_Id) VALUES (1, 1); #INSERT INTO ToolReservations (Tool_Id, Reservations_Id) VALUES (2, 1); #INSERT INTO `ToolReservations` VALUES (6,2),(7,2); INSERT INTO `ToolReservations` VALUES (1,1),(2,1),(6,2),(7,2),(17,3),(18,3),(19,3),(20,3),(6,4),(7,4),(8,4),(9,4),(2,5),(4,5),(5,5),(21,6),(22,6); # Tool Rentals INSERT INTO Rentals (Tool_Id, start_date, end_date, number_of_rentals) VALUES (1, '2017-10-02', '2017-10-12', 1); INSERT INTO Rentals (Tool_Id, start_date, end_date, number_of_rentals) VALUES (2, '2017-10-02', '2017-10-12', 49); #Cordless Power Tools insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (7.2, 5.6, 12, 'Cordless Dewalt', 'steel', 52, 15, 130, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Drill'), (select id from SubOption where name = 'driver')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 110, 30, 2000, 4500); set @lastTool:= last_insert_id(); insert into PowerDrill (id, adjustable_clutch, min_torque_rating, max_torque_rating) VALUES (@lastTool, true, 80.5, NULL); insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (2.2, 3.6, 1, 'Cordless Dewalt', 'steel', 32, 15, 200, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Saw'), (select id from SubOption where name = 'jig')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 110, 30, 2000, 4500); set @lastTool:= last_insert_id(); insert into PowerSaw (id, blade_size) VALUES (@lastTool, 80.5); set @lastTool:= last_insert_id(); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Li-Ion', 1, @lastTool); insert into Tool (width, weight, length, manufacturer, material, deposit_price, rental_price, original_price, Category_Id, PowerSource_Id, SubType_Id, SubOption_Id) VALUES (3.2, 8.6, 323, 'Cordless Dewalt', 'steel', 75, 15, 160, @powerCategoryId, @dcPowerSourceId, (select id from SubType where name = 'Sander'), (select id from SubOption where name = 'belt')); set @lastTool:= last_insert_id(); insert into PowerTool (id, volt_rating, amp_rating, min_rpm_rating, max_rpm_rating) VALUES (@lastTool, 110, 30, 2000, 4500); set @lastTool:= last_insert_id(); insert into PowerSander (id, dust_bag) VALUES (@lastTool, false); #Power tool accessory insert into Accessory (description, quantity, PowerTool_Id) VALUES ('Li-Ion', 1, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('NiCd', 2, @lastTool); insert into Accessory (description, quantity, PowerTool_Id) VALUES ('NiMH', 7, @lastTool);
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Jan 28, 2021 at 03:43 PM -- Server version: 10.3.22-MariaDB-log -- PHP Version: 7.1.33 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: `dbproduct` -- -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(5) NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `parentId` int(5) NOT NULL, `text` text COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `parentId`, `text`) VALUES (1, 'Computers', 0, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'), (2, 'Kitchen', 0, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'), (3, 'Cars', 0, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'), (5, 'Sports', 0, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'), (15, 'Guns', 0, 'For guns'), (22, 'Dell', 1, 'computers'), (34, 'Forniture', 2, 'Best forni'), (35, 'Balls', 5, 'Balls for '), (36, 'BasketBall', 35, 'Good ball'), (37, 'Dell inspiron 12', 22, 'Best computer'), (38, 'Dell inspiron 2', 22, 'Bad computer'), (40, 'Accer', 1, '12345'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(5) NOT NULL, `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `username`, `password`) VALUES (4, 'admin12', '$2y$10$XefEgq9vi6CWH/1v3SYUMenusUMMohCjzGqeHjnS9u3fNT40Vsb6K'); -- -- Indexes for dumped tables -- -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; 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 */;
-- BIS_FIN_PRODUCT_INFO DECLARE V_CNT NUMBER; BEGIN SELECT COUNT(*) INTO V_CNT FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'BIS_FIN_PRODUCT_INFO' AND COLUMN_NAME = 'SELL_TARGET'; IF V_CNT = 0 THEN EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_PRODUCT_INFO ADD SELL_TARGET CHAR(1)'; END IF; END; / COMMENT ON COLUMN BIS_FIN_PRODUCT_INFO.TARGET IS '客户类型2 公司 ;4 同业'; COMMENT ON COLUMN BIS_FIN_PRODUCT_INFO.SELL_TARGET IS '销售对象1 个人 (不提供);2 公司 ;3 全部 ;4 同业'; COMMIT; DECLARE V_CNT NUMBER; BEGIN SELECT COUNT(CONSTRAINT_NAME) INTO V_CNT FROM USER_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'P' AND TABLE_NAME = 'BIS_FIN_PRODUCT_INFO'; IF V_CNT = 0 THEN EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_PRODUCT_INFO ADD CONSTRAINT PK_BIS_FIN_PRODUCT_INFO PRIMARY KEY (PRODNO, BIF_CODE, TARGET)'; ELSE EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_PRODUCT_INFO DROP CONSTRAINT PK_BIS_FIN_PRODUCT_INFO'; EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_PRODUCT_INFO ADD CONSTRAINT PK_BIS_FIN_PRODUCT_INFO PRIMARY KEY (PRODNO, BIF_CODE, TARGET)'; END IF; END; / -- BIS_FIN_BUY DECLARE V_CNT NUMBER; BEGIN SELECT COUNT(*) INTO V_CNT FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'BIS_FIN_BUY' AND COLUMN_NAME = 'TARGET'; IF V_CNT = 0 THEN EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_BUY ADD TARGET CHAR(1)'; END IF; END; / COMMENT ON COLUMN BIS_FIN_BUY.TARGET IS '客户类型2 公司 ;4 同业'; -- BIS_FIN_CONTRACT DECLARE V_CNT NUMBER; BEGIN SELECT COUNT(*) INTO V_CNT FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'BIS_FIN_CONTRACT' AND COLUMN_NAME = 'TARGET'; IF V_CNT = 0 THEN EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_CONTRACT ADD TARGET CHAR(1)'; END IF; END; / -- ADD COMMENTS TO THE COLUMNS COMMENT ON COLUMN BIS_FIN_CONTRACT.TARGET IS '客户类型;2 公司 4 同业'; DECLARE V_CNT NUMBER; BEGIN SELECT COUNT(*) INTO V_CNT FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'BIS_FIN_BAL' AND COLUMN_NAME = 'TARGET'; IF V_CNT = 0 THEN EXECUTE IMMEDIATE 'ALTER TABLE BIS_FIN_BAL ADD TARGET CHAR(1)'; END IF; END; / CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_MONY_QUERY AS SELECT DISTINCT C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORT_NAME, D.BIF_CODE, F.NAME AS BIF_NAME, C.ACCTID, TO_CHAR (ROUND (D.PRODBAL, 2), '9999999999990.00' ) AS PRODBAL, TO_CHAR (ROUND (D.DEALSHARES, 2), '9999999999990.00' ) AS DEALSHARES, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASH_NAME, TO_CHAR (ROUND (D.AVAILBAL, 2), '9999999999990.00' ) AS AVAILBAL, D.RETURN_MSG FROM BIS_FIN_BAL D LEFT JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO LEFT JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE LEFT JOIN BT_CORP T ON C.CORP_ID = T.ID; ------- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_QYHI_QUERY AS SELECT SERIAL_ID, CORP_ID, CORP_NAME, PRODNO, SHORTNAME, BIF_CODE, BIF_NAME, ACCTID, TRNCODE, TRNSTATUS, TO_CHAR (ROUND (APPLYAMT, 2), '9999999999990.00') AS APPLYAMT, TO_CHAR (ROUND (SHAREAPPLY, 2), '9999999999990.00') AS SHAREAPPLY, CASHFLAG, CASHFLAG_NAME, TO_CHAR (ROUND (DEALAMT, 2), '9999999999990.00') AS DEALAMT, TO_CHAR (ROUND (DEALSHARES, 2), '9999999999990.00') AS DEALSHARES, TRANS_TIME, RETURN_MSG, BROKER FROM (SELECT DISTINCT D.SERIAL_ID, --C.CONTRACT_ID, ACC.CORP_ID, CP.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_DTL D JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_BANK_ACC ACC ON D.ACCTID = ACC.BANK_ACC JOIN BT_CORP CP ON CP.ID = ACC.CORP_ID AND D.TRANS_TYPE = '0' UNION ALL SELECT DISTINCT D.SERIAL_ID, --C.CONTRACT_ID, ACC.CORP_ID, CP.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_HIS_DTL D JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_BANK_ACC ACC ON D.ACCTID = ACC.BANK_ACC JOIN BT_CORP CP ON CP.ID = ACC.CORP_ID AND D.TRANS_TYPE = '0'); -------------- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_INFO_QUERY AS SELECT P.PRODNO, P.PRODNAME, P.CURRENCY, C.CUR_NAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, P.BIF_CODE, B.NAME AS TYPE_NAME, P.RETURN_TYPE, (CASE WHEN P.RETURN_TYPE = '1' THEN '收益率' WHEN P.RETURN_TYPE = '2' THEN '净值' END ) AS RETURN_TYPE_NAME, P.DTSTART, P.DTEND, P.INTRSTEDTSTART, P.EXPIREDATE, P.DTEXCHANGE, TO_CHAR (ROUND (P.REFVALUE, 2), '9999999999990.00') AS REFVALUE, TO_CHAR (ROUND (P.MANAGEMENTFEE, 2), '9999999999990.00' ) AS MANAGEMENTFEE, TO_CHAR (ROUND (P.SBSCRFEE, 2), '9999999999990.00') AS SBSCRFEE, TO_CHAR (ROUND (P.PURCHFEE, 2), '9999999999990.00') AS PURCHFEE, TO_CHAR (ROUND (P.REDMFEE, 2), '9999999999990.00') AS REDMFEE, P.SBSCRFLG, (CASE WHEN P.SBSCRFLG = '0' THEN '不可操作' WHEN P.SBSCRFLG = '1' THEN '可操作' END ) AS SBSCRFLG_NAME, P.PURCHFLG, (CASE WHEN P.PURCHFLG = '0' THEN '不可操作' WHEN P.PURCHFLG = '1' THEN '可操作' END ) AS PURCHFLG_NAME, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, TO_CHAR (ROUND (P.SBSCRMINAMT, 2), '9999999999990.00' ) AS SBSCRMINAMT, TO_CHAR (ROUND (P.SBSCRINCAMT, 2), '9999999999990.00' ) AS SBSCRINCAMT, TO_CHAR (ROUND (P.PURCHMINAMT, 2), '9999999999990.00' ) AS PURCHMINAMT, TO_CHAR (ROUND (P.PURCHINCAMT, 2), '9999999999990.00' ) AS PURCHINCAMT, TO_CHAR (ROUND (P.HOLDMINAMT, 2), '9999999999990.00') AS HOLDMINAMT, TO_CHAR (ROUND (P.HOLDMAXAMT, 2), '9999999999990.00') AS HOLDMAXAMT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, TO_CHAR (ROUND (P.REDMINCAMT, 2), '9999999999990.00') AS REDMINCAMT, P.AGREEMCONTENT, TO_CHAR (P.RETURN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS RETURN_TIME, P.VOUCHER_STAT, P.RETURN_MSG FROM BIS_FIN_PRODUCT_INFO P LEFT JOIN BIS_BIF_INIT B ON P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE; CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_SIGN AS SELECT F.CONTRACT_ID, P.PRODNO, P.PRODNAME, P.CURRENCY, C.CUR_NAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, P.BIF_CODE, B.NAME AS TYPE_NAME, P.RETURN_TYPE, (CASE WHEN P.RETURN_TYPE = '1' THEN '收益率' WHEN P.RETURN_TYPE = '2' THEN '净值' END ) AS RETURN_TYPE_NAME, P.DTSTART, P.DTEND, P.INTRSTEDTSTART, P.EXPIREDATE, P.DTEXCHANGE, TO_CHAR (ROUND (P.REFVALUE, 2), '9999999999990.00') AS REFVALUE, TO_CHAR (ROUND (P.MANAGEMENTFEE, 2), '9999999999990.00' ) AS MANAGEMENTFEE, TO_CHAR (ROUND (P.SBSCRFEE, 2), '9999999999990.00') AS SBSCRFEE, TO_CHAR (ROUND (P.PURCHFEE, 2), '9999999999990.00') AS PURCHFEE, TO_CHAR (ROUND (P.REDMFEE, 2), '9999999999990.00') AS REDMFEE, P.SBSCRFLG, (CASE WHEN P.SBSCRFLG = '0' THEN '不可操作' WHEN P.SBSCRFLG = '1' THEN '可操作' END ) AS SBSCRFLG_NAME, P.PURCHFLG, (CASE WHEN P.PURCHFLG = '0' THEN '不可操作' WHEN P.PURCHFLG = '1' THEN '可操作' END ) AS PURCHFLG_NAME, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, TO_CHAR (ROUND (P.SBSCRMINAMT, 2), '9999999999990.00' ) AS SBSCRMINAMT, TO_CHAR (ROUND (P.SBSCRINCAMT, 2), '9999999999990.00' ) AS SBSCRINCAMT, TO_CHAR (ROUND (P.PURCHMINAMT, 2), '9999999999990.00' ) AS PURCHMINAMT, TO_CHAR (ROUND (P.PURCHINCAMT, 2), '9999999999990.00' ) AS PURCHINCAMT, TO_CHAR (ROUND (P.HOLDMINAMT, 2), '9999999999990.00') AS HOLDMINAMT, TO_CHAR (ROUND (P.HOLDMAXAMT, 2), '9999999999990.00') AS HOLDMAXAMT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, TO_CHAR (ROUND (P.REDMINCAMT, 2), '9999999999990.00') AS REDMINCAMT, TO_CHAR (P.RETURN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS RETURN_TIME, F.VOUCHER_STAT, F.SIGNFLG, (CASE WHEN F.SIGNFLG = '0' THEN (CASE WHEN F.VOUCHER_STAT = '0' THEN '已签约' WHEN F.VOUCHER_STAT = '1' THEN '结果待查' WHEN F.VOUCHER_STAT = '2' THEN '银行处理失败' WHEN F.VOUCHER_STAT = '3' THEN '准备发送' WHEN F.VOUCHER_STAT = '9' THEN '接口处理失败' END ) WHEN F.SIGNFLG = '1' THEN '签约中' WHEN F.SIGNFLG = '2' THEN '未签约' WHEN F.SIGNFLG = '3' THEN '签约失败' END ) AS SIGNFLG_NAME, F.RETURN_MSG, F.SIGN_CORP AS CORP_ID, T.CORP_NAME AS SIGN_CORP_NAME, TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS SIGN_TIME, F.ACCTID, F.SIGN_USER_ID, (CASE WHEN P.SBSCRFLG = 0 THEN 0 WHEN P.SBSCRFLG = 1 AND (TO_CHAR (SYSDATE, 'YYYY-MM-DD') BETWEEN TO_CHAR (P.DTSTART, 'YYYY-MM-DD' ) AND TO_CHAR (P.DTEND, 'YYYY-MM-DD' ) ) THEN 1 ELSE 0 END ) AS IS_SBSCRFLG FROM BIS_FIN_CONTRACT F LEFT JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = F.PRODNO AND P.BIF_CODE=F.BIF_CODE AND P.TARGET=F.TARGET LEFT JOIN BT_CORP T ON F.SIGN_CORP = T.ID LEFT JOIN BIS_BIF_INIT B ON P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE; ---- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_BACK AS SELECT E.CORP_ID, T.CORP_NAME, E.BIF_CODE, B.NAME AS BIF_NAME, E.ACCTID, E.PRODNO, P.PRODNAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, F.CASHFLAG, (CASE WHEN F.CASHFLAG = '0' THEN '钞' WHEN F.CASHFLAG = '1' THEN '汇' END ) AS CASH_NAME, P.DTSTART, P.DTEND, P.CURRENCY, C.CUR_NAME, TO_CHAR (ROUND (F.PRODBAL, 2), '9999999999990.00') AS PRODBAL, TO_CHAR (ROUND (F.AVAILBAL, 2),'9999999999990.00') AS AVAILBAL, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, SUM (CASE WHEN E.BIS_TYPE = '01' AND S.BIS_TYPE = '01' AND S.VOUCHER_STAT = '0' THEN 1 WHEN E.BIS_TYPE = '02' AND S.BIS_TYPE = '02' AND S.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) AS PURCHASE_COUNT, SUM (CASE WHEN E.BIS_TYPE = '05' AND S.BIS_TYPE = '05' AND S.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) AS BACK_COUNT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00' ) AS REDMMINAMT, P.RETURN_MSG FROM BIS_FIN_BUY E JOIN BIS_FIN_EXC S ON E.VOUCHER_NO = S.THIRD_ID JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = E.PRODNO AND E.BIF_CODE = P.BIF_CODE AND E.TARGET=P.TARGET JOIN BIS_FIN_BAL F ON F.PRODNO = E.PRODNO AND P.PRODNO = F.PRODNO LEFT JOIN BT_CORP T ON E.CORP_ID = T.ID LEFT JOIN BIS_BIF_INIT B ON E.BIF_CODE = B.BIF_CODE AND P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE GROUP BY E.CORP_ID, T.CORP_NAME, E.BIF_CODE, B.NAME, E.ACCTID, E.PRODNO, P.PRODNAME, P.TARGET, F.CASHFLAG, P.DTSTART, P.DTEND, P.CURRENCY, C.CUR_NAME, F.PRODBAL, F.AVAILBAL, P.REDMFLG, P.REDMMINAMT, P.RETURN_MSG; ---- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_BKED AS SELECT E.VOUCHER_NO, E.CORP_ID, T.CORP_NAME, E.BIF_CODE, B.NAME AS BIF_NAME, E.ACCTID, E.PRODNO, P.PRODNAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, F.CASHFLAG, (CASE WHEN F.CASHFLAG = '0' THEN '钞' WHEN F.CASHFLAG = '1' THEN '汇' END ) AS CASH_NAME, P.DTSTART, P.DTEND, P.CURRENCY, C.CUR_NAME, TO_CHAR (ROUND (F.PRODBAL, 2), '9999999999990.00') AS PRODBAL, TO_CHAR (ROUND ( F.AVAILBAL,2),'9999999999990.00') AS AVAILBAL, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, E.REDM_AMT, TO_CHAR (E.TRANS_TIME, 'YYYY-MM-DD HH24:MI:SS') AS TRANS_TIME, E.STATUS AS VOUCHER_STAT, (CASE WHEN E.STATUS = '500' THEN '暂存' WHEN E.STATUS = '450' THEN '打回' END ) AS VOUCHER_STAT_NAME, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, (SELECT SUM (CASE WHEN BFB.BIS_TYPE = '01' AND BFE.BIS_TYPE = '01' AND BFE.VOUCHER_STAT = '0' THEN 1 WHEN BFB.BIS_TYPE = '02' AND BFE.BIS_TYPE = '02' AND BFE.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) FROM BIS_FIN_BUY BFB JOIN BIS_FIN_EXC BFE ON BFB.VOUCHER_NO = BFE.THIRD_ID WHERE BFB.CORP_ID = E.CORP_ID AND BFB.PRODNO = E.PRODNO) AS PURCHASE_COUNT, (SELECT SUM (CASE WHEN BFB.BIS_TYPE = '05' AND BFE.BIS_TYPE = '05' AND BFE.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) FROM BIS_FIN_BUY BFB JOIN BIS_FIN_EXC BFE ON BFB.VOUCHER_NO = BFE.THIRD_ID WHERE BFB.CORP_ID = E.CORP_ID AND BFB.PRODNO = E.PRODNO) AS BACK_COUNT, P.RETURN_MSG FROM BIS_FIN_BUY E LEFT JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = E.PRODNO AND E.BIF_CODE = P.BIF_CODE AND E.TARGET=P.TARGET JOIN BIS_FIN_BAL F ON F.PRODNO = E.PRODNO AND P.PRODNO = F.PRODNO LEFT JOIN BT_CORP T ON E.CORP_ID = T.ID LEFT JOIN BIS_BIF_INIT B ON E.BIF_CODE = B.BIF_CODE AND P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE WHERE E.BIS_TYPE = '05'; --- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_BKQY AS SELECT E.VOUCHER_NO, E.CORP_ID, T.CORP_NAME, E.BIF_CODE, B.NAME AS BIF_NAME, E.ACCTID, E.PRODNO, P.PRODNAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, F.CASHFLAG, (CASE WHEN F.CASHFLAG = '0' THEN '钞' WHEN F.CASHFLAG = '1' THEN '汇' END ) AS CASH_NAME, P.DTSTART, P.DTEND, P.CURRENCY, C.CUR_NAME, TO_CHAR (ROUND(F.PRODBAL, 2), '9999999999990.00') AS PRODBAL, TO_CHAR (ROUND(E.AVAILBAL, 2), '9999999999990.00') AS AVAILBAL, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, E.REDM_AMT, TO_CHAR (E.TRANS_TIME, 'YYYY-MM-DD HH24:MI:SS') AS TRANS_TIME, (CASE WHEN S.VOUCHER_STAT IS NULL THEN E.STATUS || '' ELSE TRIM (S.VOUCHER_STAT) END ) AS VOUCHER_STAT, (CASE WHEN S.VOUCHER_STAT IS NULL THEN (CASE WHEN E.STATUS = '550' THEN '审批中' WHEN E.STATUS = '500' THEN '暂存' WHEN E.STATUS = '450' THEN '打回' WHEN E.STATUS = '95' THEN '审批通过' WHEN E.STATUS = '250' THEN '删除' WHEN E.STATUS = '200' THEN '无效' WHEN E.STATUS = '150' THEN '过期' WHEN E.STATUS = '11' THEN '待审批' ELSE '审批中' END ) ELSE (CASE WHEN TRIM (S.VOUCHER_STAT) = '3' THEN '准备发送' WHEN TRIM (S.VOUCHER_STAT) = '1' THEN '数据报文报错' WHEN TRIM (S.VOUCHER_STAT) = '9' THEN '接口处理失败' WHEN TRIM (S.VOUCHER_STAT) = '2' THEN '银行处理失败' WHEN TRIM (S.VOUCHER_STAT) = '0' THEN '交易成功' END ) END ) AS VOUCHER_STAT_NAME, (CASE WHEN S.VOUCHER_STAT = '2' THEN 1 WHEN S.VOUCHER_STAT = '1' THEN 1 WHEN S.VOUCHER_STAT = '9' THEN 1 ELSE 0 END ) AS IS_INVAIL, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, (SELECT SUM (CASE WHEN BFB.BIS_TYPE = '01' AND BFE.BIS_TYPE = '01' AND BFE.VOUCHER_STAT = '0' THEN 1 WHEN BFB.BIS_TYPE = '02' AND BFE.BIS_TYPE = '02' AND BFE.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) FROM BIS_FIN_BUY BFB JOIN BIS_FIN_EXC BFE ON BFB.VOUCHER_NO = BFE.THIRD_ID WHERE BFB.CORP_ID = E.CORP_ID AND BFB.PRODNO = E.PRODNO) AS PURCHASE_COUNT, (SELECT SUM (CASE WHEN BFB.BIS_TYPE = '05' AND BFE.BIS_TYPE = '05' AND BFE.VOUCHER_STAT = '0' THEN 1 ELSE 0 END ) FROM BIS_FIN_BUY BFB JOIN BIS_FIN_EXC BFE ON BFB.VOUCHER_NO = BFE.THIRD_ID WHERE BFB.CORP_ID = E.CORP_ID AND BFB.PRODNO = E.PRODNO) AS BACK_COUNT, S.RETURN_MSG FROM BIS_FIN_BUY E LEFT JOIN BIS_FIN_EXC S ON E.VOUCHER_NO = S.THIRD_ID AND S.BIS_TYPE = '05' LEFT JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = E.PRODNO AND E.BIF_CODE = P.BIF_CODE AND E.TARGET=P.TARGET JOIN BIS_FIN_BAL F ON F.PRODNO = E.PRODNO AND P.PRODNO = F.PRODNO LEFT JOIN BT_CORP T ON E.CORP_ID = T.ID LEFT JOIN BIS_BIF_INIT B ON E.BIF_CODE = B.BIF_CODE AND P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE WHERE E.BIS_TYPE = '05'; -- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_INFO AS SELECT P.PRODNO, P.PRODNAME, P.CURRENCY, C.CUR_NAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, P.BIF_CODE, B.NAME AS TYPE_NAME, P.RETURN_TYPE, (CASE WHEN P.RETURN_TYPE = '1' THEN '收益率' WHEN P.RETURN_TYPE = '2' THEN '净值' END ) AS RETURN_TYPE_NAME, P.DTSTART, P.DTEND, P.INTRSTEDTSTART, P.EXPIREDATE, P.DTEXCHANGE, TO_CHAR (ROUND (P.REFVALUE, 2), '9999999999990.00') AS REFVALUE, TO_CHAR (ROUND (P.MANAGEMENTFEE, 2), '9999999999990.00' ) AS MANAGEMENTFEE, TO_CHAR (ROUND (P.SBSCRFEE, 2), '9999999999990.00') AS SBSCRFEE, TO_CHAR (ROUND (P.PURCHFEE, 2), '9999999999990.00') AS PURCHFEE, TO_CHAR (ROUND (P.REDMFEE, 2), '9999999999990.00') AS REDMFEE, P.SBSCRFLG, (CASE WHEN P.SBSCRFLG = '0' THEN '不可操作' WHEN P.SBSCRFLG = '1' THEN '可操作' END ) AS SBSCRFLG_NAME, P.PURCHFLG, (CASE WHEN P.PURCHFLG = '0' THEN '不可操作' WHEN P.PURCHFLG = '1' THEN '可操作' END ) AS PURCHFLG_NAME, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, TO_CHAR (ROUND (P.SBSCRMINAMT, 2), '9999999999990.00' ) AS SBSCRMINAMT, TO_CHAR (ROUND (P.SBSCRINCAMT, 2), '9999999999990.00' ) AS SBSCRINCAMT, TO_CHAR (ROUND (P.PURCHMINAMT, 2), '9999999999990.00' ) AS PURCHMINAMT, TO_CHAR (ROUND (P.PURCHINCAMT, 2), '9999999999990.00' ) AS PURCHINCAMT, TO_CHAR (ROUND (P.HOLDMINAMT, 2), '9999999999990.00') AS HOLDMINAMT, TO_CHAR (ROUND (P.HOLDMAXAMT, 2), '9999999999990.00') AS HOLDMAXAMT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, TO_CHAR (ROUND (P.REDMINCAMT, 2), '9999999999990.00') AS REDMINCAMT, P.AGREEMCONTENT, TO_CHAR (P.RETURN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS RETURN_TIME, P.VOUCHER_STAT, P.RETURN_MSG FROM BIS_FIN_PRODUCT_INFO P LEFT JOIN BIS_BIF_INIT B ON P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE WHERE NOT EXISTS ( SELECT I.PRODNO FROM BIS_FIN_PRODUCT_INFO I WHERE I.PRODNO = P.PRODNO AND I.SBSCRFLG = '0' AND I.PURCHFLG = '0'); --- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_MODY AS SELECT E.VOUCHER_NO, P.PRODNO, P.PRODNAME, P.CURRENCY, C.CUR_NAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, P.BIF_CODE, B.NAME AS TYPE_NAME, P.RETURN_TYPE, (CASE WHEN P.RETURN_TYPE = '1' THEN '收益率' WHEN P.RETURN_TYPE = '2' THEN '净值' END ) AS RETURN_TYPE_NAME, P.DTSTART, P.DTEND, P.INTRSTEDTSTART, P.EXPIREDATE, P.DTEXCHANGE, TO_CHAR (ROUND (P.REFVALUE, 2), '9999999999990.00') AS REFVALUE, TO_CHAR (ROUND (P.MANAGEMENTFEE, 2), '9999999999990.00' ) AS MANAGEMENTFEE, TO_CHAR (ROUND (P.SBSCRFEE, 2), '9999999999990.00') AS SBSCRFEE, TO_CHAR (ROUND (P.PURCHFEE, 2), '9999999999990.00') AS PURCHFEE, TO_CHAR (ROUND (P.REDMFEE, 2), '9999999999990.00') AS REDMFEE, P.SBSCRFLG, (CASE WHEN P.SBSCRFLG = '0' THEN '不可操作' WHEN P.SBSCRFLG = '1' THEN '可操作' END ) AS SBSCRFLG_NAME, P.PURCHFLG, (CASE WHEN P.PURCHFLG = '0' THEN '不可操作' WHEN P.PURCHFLG = '1' THEN '可操作' END ) AS PURCHFLG_NAME, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, TO_CHAR (ROUND (P.SBSCRMINAMT, 2), '9999999999990.00' ) AS SBSCRMINAMT, TO_CHAR (ROUND (P.SBSCRINCAMT, 2), '9999999999990.00' ) AS SBSCRINCAMT, TO_CHAR (ROUND (P.PURCHMINAMT, 2), '9999999999990.00' ) AS PURCHMINAMT, TO_CHAR (ROUND (P.PURCHINCAMT, 2), '9999999999990.00' ) AS PURCHINCAMT, TO_CHAR (ROUND (P.HOLDMINAMT, 2), '9999999999990.00') AS HOLDMINAMT, TO_CHAR (ROUND (P.HOLDMAXAMT, 2), '9999999999990.00') AS HOLDMAXAMT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, TO_CHAR (ROUND (P.REDMINCAMT, 2), '9999999999990.00') AS REDMINCAMT, TO_CHAR (P.RETURN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS RETURN_TIME, E.STATUS AS VOUCHER_STAT, (CASE WHEN E.STATUS = '500' THEN '暂存' WHEN E.STATUS = '450' THEN '打回' END ) AS VOUCHER_STAT_NAME, F.SIGNFLG, (CASE WHEN F.SIGNFLG = '0' THEN (CASE WHEN F.VOUCHER_STAT = '0' THEN '已签约' WHEN F.VOUCHER_STAT = '1' THEN '结果待查' WHEN F.VOUCHER_STAT = '2' THEN '银行处理失败' WHEN F.VOUCHER_STAT = '3' THEN '准备发送' WHEN F.VOUCHER_STAT = '9' THEN '接口处理失败' END ) WHEN F.SIGNFLG = '1' THEN '签约中' WHEN F.SIGNFLG = '2' THEN '未签约' WHEN F.SIGNFLG = '3' THEN '签约失败' END ) AS SIGNFLG_NAME, F.RETURN_MSG, F.SIGN_CORP AS CORP_ID, T.CORP_NAME AS SIGN_CORP_NAME, TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS SIGN_TIME, F.ACCTID, E.CONTRACT_ID, F.SIGN_USER_ID, TO_CHAR (E.TRANS_TIME, 'YYYY-MM-DD HH24:MI:SS') AS TRANS_TIME, TO_CHAR (ROUND (E.AMT, 2), '9999999999990.00') AS AMT, E.BIS_TYPE, (CASE WHEN E.BIS_TYPE = '01' THEN '认购' WHEN E.BIS_TYPE = '02' THEN '申购' END ) AS BIS_TYPE_NAME FROM BIS_FIN_BUY E LEFT JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = E.PRODNO AND P.BIF_CODE=E.BIF_CODE AND P.TARGET = E.TARGET LEFT JOIN BIS_FIN_CONTRACT F ON P.PRODNO = F.PRODNO AND E.CONTRACT_ID = F.CONTRACT_ID LEFT JOIN BT_CORP T ON F.SIGN_CORP = T.ID LEFT JOIN BIS_BIF_INIT B ON P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE WHERE F.SIGNFLG = '0' AND TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD') = TO_CHAR (SYSDATE, 'YYYY-MM-DD'); ---- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_MONY AS SELECT DISTINCT C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORT_NAME, D.BIF_CODE,C.TARGET, F.NAME AS BIF_NAME, C.ACCTID, TO_CHAR (ROUND (D.PRODBAL, 2), '9999999999990.00' ) AS PRODBAL, TO_CHAR (ROUND (D.DEALSHARES, 2), '9999999999990.00' ) AS DEALSHARES, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASH_NAME, TO_CHAR (ROUND (D.AVAILBAL, 2), '9999999999990.00' ) AS AVAILBAL, D.RETURN_MSG FROM BIS_FIN_BAL D LEFT JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO LEFT JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE LEFT JOIN BT_CORP T ON C.CORP_ID = T.ID; ---- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_QUEY AS SELECT E.VOUCHER_NO, P.PRODNO, P.PRODNAME, P.CURRENCY, C.CUR_NAME, P.TARGET, (CASE WHEN P.TARGET = 1 THEN '个人' WHEN P.TARGET = 2 THEN '公司' WHEN P.TARGET = 3 THEN '全部' WHEN P.TARGET = 4 THEN '同业' END ) AS TARGET_NAME, P.BIF_CODE, B.NAME AS TYPE_NAME, P.RETURN_TYPE, (CASE WHEN P.RETURN_TYPE = '1' THEN '收益率' WHEN P.RETURN_TYPE = '2' THEN '净值' END ) AS RETURN_TYPE_NAME, P.DTSTART, P.DTEND, P.INTRSTEDTSTART, P.EXPIREDATE, P.DTEXCHANGE, TO_CHAR (ROUND (P.REFVALUE, 2), '9999999999990.00') AS REFVALUE, TO_CHAR (ROUND (P.MANAGEMENTFEE, 2), '9999999999990.00' ) AS MANAGEMENTFEE, TO_CHAR (ROUND (P.SBSCRFEE, 2), '9999999999990.00') AS SBSCRFEE, TO_CHAR (ROUND (P.PURCHFEE, 2), '9999999999990.00') AS PURCHFEE, TO_CHAR (ROUND (P.REDMFEE, 2), '9999999999990.00') AS REDMFEE, P.SBSCRFLG, (CASE WHEN P.SBSCRFLG = '0' THEN '不可操作' WHEN P.SBSCRFLG = '1' THEN '可操作' END ) AS SBSCRFLG_NAME, P.PURCHFLG, (CASE WHEN P.PURCHFLG = '0' THEN '不可操作' WHEN P.PURCHFLG = '1' THEN '可操作' END ) AS PURCHFLG_NAME, P.REDMFLG, (CASE WHEN P.REDMFLG = '0' THEN '不可操作' WHEN P.REDMFLG = '1' THEN '可操作' END ) AS REDMFLG_NAME, TO_CHAR (ROUND (P.SBSCRMINAMT, 2), '9999999999990.00' ) AS SBSCRMINAMT, TO_CHAR (ROUND (P.SBSCRINCAMT, 2), '9999999999990.00' ) AS SBSCRINCAMT, TO_CHAR (ROUND (P.PURCHMINAMT, 2), '9999999999990.00' ) AS PURCHMINAMT, TO_CHAR (ROUND (P.PURCHINCAMT, 2), '9999999999990.00' ) AS PURCHINCAMT, TO_CHAR (ROUND (P.HOLDMINAMT, 2), '9999999999990.00') AS HOLDMINAMT, TO_CHAR (ROUND (P.HOLDMAXAMT, 2), '9999999999990.00') AS HOLDMAXAMT, TO_CHAR (ROUND (P.REDMMINAMT, 2), '9999999999990.00') AS REDMMINAMT, TO_CHAR (ROUND (P.REDMINCAMT, 2), '9999999999990.00') AS REDMINCAMT, TO_CHAR (P.RETURN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS RETURN_TIME, (CASE WHEN S.VOUCHER_STAT IS NULL THEN E.STATUS || '' WHEN S.VOUCHER_STAT IS NOT NULL THEN TRIM (S.VOUCHER_STAT) END ) AS VOUCHER_STAT, (CASE WHEN S.VOUCHER_STAT IS NULL THEN (CASE WHEN E.STATUS = '550' THEN '审批中' WHEN E.STATUS = '500' THEN '暂存' WHEN E.STATUS = '450' THEN '打回' WHEN E.STATUS = '95' THEN '审批通过' WHEN E.STATUS = '250' THEN '删除' WHEN E.STATUS = '200' THEN '无效' WHEN E.STATUS = '150' THEN '过期' WHEN E.STATUS = '11' THEN '待审批' ELSE '审批中' END ) ELSE (CASE WHEN TRIM (S.VOUCHER_STAT) = '3' THEN '准备发送' WHEN TRIM (S.VOUCHER_STAT) = '1' THEN '结果待查' WHEN TRIM (S.VOUCHER_STAT) = '9' THEN '接口处理失败' WHEN TRIM (S.VOUCHER_STAT) = '2' THEN '银行处理失败' WHEN TRIM (S.VOUCHER_STAT) = '0' THEN '交易成功' END ) END ) AS VOUCHER_STAT_NAME, (CASE WHEN S.VOUCHER_STAT = '2' THEN 1 WHEN S.VOUCHER_STAT = '9' THEN 1 ELSE 0 END ) AS IS_INVAIL, F.SIGNFLG, (CASE WHEN F.SIGNFLG = '0' THEN '已签约' WHEN F.SIGNFLG = '1' THEN '签约中' WHEN F.SIGNFLG = '2' THEN '未签约' WHEN F.SIGNFLG = '3' THEN '签约失败' END ) AS SIGNFLG_NAME, S.RETURN_MSG, T.CORP_NAME AS SIGN_CORP_NAME, TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS SIGN_TIME, F.ACCTID, F.SIGN_USER_ID, E.CORP_ID, TO_CHAR (E.TRANS_TIME, 'YYYY-MM-DD HH24:MI:SS') AS TRANS_TIME, TO_CHAR (ROUND (E.AMT, 2), '9999999999990.00') AS AMT, E.BIS_TYPE, (CASE WHEN E.BIS_TYPE = '01' THEN '认购' WHEN E.BIS_TYPE = '02' THEN '申购' END ) AS BIS_TYPE_NAME FROM BIS_FIN_BUY E LEFT JOIN BIS_FIN_EXC S ON E.VOUCHER_NO = S.THIRD_ID AND S.BIS_TYPE <= '02' LEFT JOIN BIS_FIN_PRODUCT_INFO P ON P.PRODNO = E.PRODNO AND P.BIF_CODE=E.BIF_CODE AND P.TARGET=E.TARGET LEFT JOIN BIS_FIN_CONTRACT F ON P.PRODNO = F.PRODNO AND E.CONTRACT_ID = F.CONTRACT_ID LEFT JOIN BT_CORP T ON F.SIGN_CORP = T.ID LEFT JOIN BIS_BIF_INIT B ON P.BIF_CODE = B.BIF_CODE LEFT JOIN BT_CURRENCY C ON P.CURRENCY = C.CUR_CODE WHERE E.BIS_TYPE <= '02'; ---- CREATE OR REPLACE VIEW V_BIS_FIN_PRODUCT_QYHI AS SELECT SERIAL_ID, CONTRACT_ID, CORP_ID, CORP_NAME, PRODNO, SHORTNAME, BIF_CODE, BIF_NAME, ACCTID, TRNCODE, TRNSTATUS, TO_CHAR (ROUND (APPLYAMT, 2), '9999999999990.00') AS APPLYAMT, TO_CHAR (ROUND (SHAREAPPLY, 2), '9999999999990.00') AS SHAREAPPLY, CASHFLAG, CASHFLAG_NAME, TO_CHAR (ROUND (DEALAMT, 2), '9999999999990.00') AS DEALAMT, TO_CHAR (ROUND (DEALSHARES, 2), '9999999999990.00') AS DEALSHARES, TRANS_TIME, RETURN_MSG, BROKER FROM (SELECT DISTINCT D.SERIAL_ID, C.CONTRACT_ID, C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_DTL D JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO JOIN BIS_FIN_CONTRACT BFC ON C.CONTRACT_ID = BFC.CONTRACT_ID AND BFC.TARGET=C.TARGET AND C.BIF_CODE=BFC.BIF_CODE JOIN BIS_FIN_EXC E ON C.VOUCHER_NO = E.THIRD_ID AND C.BIS_TYPE = E.BIS_TYPE AND E.ACCTID = C.ACCTID JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_CORP T ON C.CORP_ID = T.ID JOIN BT_USER U ON T.ID = U.CORP_ID AND U.USER_CODE = C.OPER_USER_ID JOIN BIS_ACC_GRANT BAG ON BAG.USER_CODE = U.USER_CODE AND BAG.BANK_ACC = E.ACCTID AND E.ACCTID = D.ACCTID WHERE E.VOUCHER_STAT ='0' AND D.TRANS_TYPE = '0' UNION ALL SELECT DISTINCT D.SERIAL_ID, C.CONTRACT_ID, C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_HIS_DTL D JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO JOIN BIS_FIN_CONTRACT BFC ON C.CONTRACT_ID = BFC.CONTRACT_ID AND BFC.TARGET=C.TARGET AND C.BIF_CODE=BFC.BIF_CODE JOIN BIS_FIN_EXC E ON C.VOUCHER_NO = E.THIRD_ID AND C.BIS_TYPE = E.BIS_TYPE AND E.ACCTID = C.ACCTID JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_CORP T ON C.CORP_ID = T.ID JOIN BT_USER U ON T.ID = U.CORP_ID AND U.USER_CODE = C.OPER_USER_ID JOIN BIS_ACC_GRANT BAG ON BAG.USER_CODE = U.USER_CODE AND BAG.BANK_ACC = E.ACCTID AND E.ACCTID = D.ACCTID WHERE E.VOUCHER_STAT ='0' AND D.TRANS_TYPE = '0' UNION ALL SELECT DISTINCT D.SERIAL_ID, C.CONTRACT_ID, C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_DTL D JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO AND D.BIF_CODE=C.BIF_CODE JOIN BIS_FIN_CONTRACT BFC ON C.CONTRACT_ID = BFC.CONTRACT_ID AND BFC.TARGET=C.TARGET AND C.BIF_CODE=BFC.BIF_CODE AND TO_CHAR(D.TRANS_TIME, 'YYYY-MM-DD') = TO_CHAR(BFC.REQ_DATE, 'YYYY-MM-DD') JOIN BIS_FIN_EXC E ON C.VOUCHER_NO = E.THIRD_ID AND C.BIS_TYPE = E.BIS_TYPE AND E.ACCTID = C.ACCTID JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_CORP T ON C.CORP_ID = T.ID JOIN BT_USER U ON T.ID = U.CORP_ID AND U.USER_CODE = C.OPER_USER_ID JOIN BIS_ACC_GRANT BAG ON BAG.USER_CODE = U.USER_CODE AND BAG.BANK_ACC = E.ACCTID AND E.ACCTID = D.ACCTID WHERE E.VOUCHER_STAT ='0' AND D.TRANS_TYPE = '0' UNION ALL SELECT DISTINCT D.SERIAL_ID, C.CONTRACT_ID, C.CORP_ID, T.CORP_NAME, D.PRODNO, D.SHORTNAME, D.BIF_CODE, F.NAME AS BIF_NAME, D.ACCTID, D.TRNCODE, D.TRNSTATUS, D.APPLYAMT, D.SHAREAPPLY, D.CASHFLAG, (CASE WHEN D.CASHFLAG = '0' THEN '钞' WHEN D.CASHFLAG = '1' THEN '汇' END ) AS CASHFLAG_NAME, D.DEALAMT, D.DEALSHARES, D.TRANS_TIME, D.RETURN_MSG, D.BROKER FROM BIS_FIN_HIS_DTL D JOIN BIS_FIN_BUY C ON C.PRODNO = D.PRODNO AND D.BIF_CODE=C.BIF_CODE JOIN BIS_FIN_CONTRACT BFC ON C.CONTRACT_ID = BFC.CONTRACT_ID AND BFC.TARGET=C.TARGET AND C.BIF_CODE=BFC.BIF_CODE AND TO_CHAR(D.TRANS_TIME, 'YYYY-MM-DD') = TO_CHAR(BFC.REQ_DATE, 'YYYY-MM-DD') JOIN BIS_FIN_EXC E ON C.VOUCHER_NO = E.THIRD_ID AND C.BIS_TYPE = E.BIS_TYPE AND E.ACCTID = C.ACCTID JOIN BIS_BIF_INIT F ON D.BIF_CODE = F.BIF_CODE JOIN BT_CORP T ON C.CORP_ID = T.ID JOIN BT_USER U ON T.ID = U.CORP_ID AND U.USER_CODE = C.OPER_USER_ID JOIN BIS_ACC_GRANT BAG ON BAG.USER_CODE = U.USER_CODE AND BAG.BANK_ACC = E.ACCTID AND E.ACCTID = D.ACCTID WHERE E.VOUCHER_STAT ='0' AND D.TRANS_TYPE = '0'); ---- CREATE OR REPLACE VIEW V_BIS_FIN_STATES_QUERY AS SELECT F.CONTRACT_ID, F.SIGN_CORP AS CORP_ID, T.CORP_NAME AS SIGN_CORP_NAME, P.PRODNO, F.BIF_CODE, P.PRODNAME, F.ACCTID, P.TARGET, F.SIGNFLG, TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD HH24:MI:SS') AS SIGN_TIME, (CASE WHEN F.SIGNFLG = 0 THEN '已签约' WHEN F.SIGNFLG = 1 THEN '签约中' WHEN F.SIGNFLG = 2 THEN '未签约' WHEN F.SIGNFLG = 3 THEN '签约失败' END ) AS SIGNFLG_NAME, (CASE WHEN F.SIGNFLG = 0 THEN 0 WHEN F.SIGNFLG = 1 THEN 0 WHEN F.SIGNFLG = 2 THEN 0 WHEN F.SIGNFLG = 3 AND F.VOUCHER_STAT = 2 THEN 0 WHEN F.SIGNFLG = 3 AND F.VOUCHER_STAT = 9 AND TO_CHAR (F.SIGN_TIME, 'YYYY-MM-DD') = TO_CHAR (SYSDATE, 'YYYY-MM-DD') THEN 1 ELSE 0 END ) AS IS_RESET, F.VOUCHER_STAT, (CASE WHEN F.VOUCHER_STAT = 0 THEN '签约成功' WHEN F.VOUCHER_STAT = 1 THEN '结果待查' WHEN F.VOUCHER_STAT = 2 THEN '银行处理失败' WHEN F.VOUCHER_STAT = 3 THEN '准备发送' WHEN F.VOUCHER_STAT = 9 THEN '接口处理失败' END ) AS VOUCHER_STAT_NAME, F.RETURN_MSG FROM BIS_FIN_PRODUCT_INFO P JOIN BIS_FIN_CONTRACT F ON P.PRODNO = F.PRODNO AND P.TARGET=F.TARGET AND P.BIF_CODE=F.BIF_CODE LEFT JOIN BT_CORP T ON F.SIGN_CORP = T.ID; COMMIT /
CREATE PROCEDURE [actual].[pDel_cmdb_ci_spkg] AS TRUNCATE TABLE [actual].[cmdb_ci_spkg]
-- CreateTable CREATE TABLE "item" ( "item_id" SERIAL NOT NULL, "item_name" TEXT NOT NULL, PRIMARY KEY ("item_id") );
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: 11-Out-2020 às 22:17 -- Versão do servidor: 8.0.15 -- versão do PHP: 7.2.15 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: `appstarter` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `api` -- CREATE TABLE `api` ( `id` int(9) NOT NULL, `versao` text, `status` int(9) NOT NULL, `termos` text ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Extraindo dados da tabela `api` -- INSERT INTO `api` (`id`, `versao`, `status`, `termos`) VALUES (1, '1', 200, NULL); -- -------------------------------------------------------- -- -- Estrutura da tabela `arquivos` -- CREATE TABLE `arquivos` ( `id` int(9) NOT NULL, `arquivo` text, `data_cadastro` text ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Extraindo dados da tabela `arquivos` -- INSERT INTO `arquivos` (`id`, `arquivo`, `data_cadastro`) VALUES (1, 'APPSTARTER-bc8ceaf789f00e1aa5044f6ffd0848fb.jpg', '06/10/2020 10:10:34:000000'); -- -------------------------------------------------------- -- -- Estrutura da tabela `usuarios` -- CREATE TABLE `usuarios` ( `id` int(9) NOT NULL, `token_sms` text, `nome` text, `email` text, `celular` text, `senha` text, `data_cadastro` text, `ultimo_login` text ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Extraindo dados da tabela `usuarios` -- INSERT INTO `usuarios` (`id`, `token_sms`, `nome`, `email`, `celular`, `senha`, `data_cadastro`, `ultimo_login`) VALUES (1, '48974', 'Diogenes Junior', 'diogenesjunior.ti@gmail.com', '11945027877', '12345', NULL, '12/10/2020 02:04:19:000000'), (3, NULL, 'Diogenes Junior 2', 'contato@diogenesjunior.com.br', '11978031419', '123456', '04/10/2020 18:31:40:000000', NULL), (4, NULL, 'Diogenes teste 3', 'diogenes3@diogenes3.com.br', NULL, '12345', '12/10/2020 02:00:48:000000', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `api` -- ALTER TABLE `api` ADD PRIMARY KEY (`id`); -- -- Indexes for table `arquivos` -- ALTER TABLE `arquivos` ADD PRIMARY KEY (`id`); -- -- Indexes for table `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `api` -- ALTER TABLE `api` MODIFY `id` int(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `arquivos` -- ALTER TABLE `arquivos` MODIFY `id` int(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `usuarios` -- ALTER TABLE `usuarios` MODIFY `id` int(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; 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 */;
--MVP --Q1 SELECT COUNT(id) AS num_pay_details_no_local_acct_iban FROM pay_details WHERE local_account_no IS NULL AND iban IS NULL --Q2 SELECT first_name, last_name, country FROM employees ORDER BY country, last_name NULLS LAST; --Q3 SELECT * FROM employees ORDER BY salary DESC NULLS LAST LIMIT 10; --Q4 SELECT first_name, last_name, salary FROM employees WHERE country = 'Hungary' ORDER BY salary ASC NULLS LAST LIMIT 1; --Q5 SELECT * FROM employees WHERE email LIKE '%yahoo%' --Q6 SELECT COUNT(id), department FROM employees WHERE start_date >= '2003-01-01' AND start_date < '2004-01-01' GROUP BY department --Q7 SELECT department, fte_hours, COUNT(id) FROM employees GROUP BY department, fte_hours ORDER BY department, fte_hours --Q8 SELECT pension_enrol, COUNT(id) AS num_employees FROM employees GROUP BY pension_enrol --Q9 SELECT salary FROM employees WHERE department = 'Engineering' AND fte_hours = '1.0' ORDER BY salary DESC LIMIT 1; --Q10 SELECT country, COUNT(id) AS num_employees, ROUND(AVG(salary)) AS avg_salary FROM employees GROUP BY country HAVING COUNT(id) > 30 ORDER BY avg_salary DESC --Q11 SELECT first_name, last_name, fte_hours, salary, fte_hours * salary AS effective_yearly_salary FROM employees; --Q12 SELECT first_name, last_name FROM employees AS e LEFT JOIN pay_details as p ON e.id = p.id WHERE local_tax_code IS NULL --Q13 SELECT e.id, e.first_name, e.last_name, (48 * 35 * CAST(t.charge_cost AS INTEGER) - e.salary) * e.fte_hours AS expected_profit FROM employees AS e INNER JOIN teams AS t ON e.team_id = t.id --Q14 SELECT department, COUNT(id) AS no_name FROM employees WHERE first_name IS NULL GROUP BY department HAVING COUNT(id) >= 2 ORDER BY no_name DESC, department ASC --Q15 SELECT first_name, COUNT(id) FROM employees WHERE first_name IS NOT NULL GROUP BY first_name ORDER BY COUNT(id) DESC, first_name ASC --Q16 SELECT department, CAST(COUNT(id) AS REAL) AS grade_1, ROUND(SUM(CAST(grade = 1 AS INTEGER))/CAST(COUNT(id) AS REAL)*100) AS proportion_of_grade_1 FROM employees GROUP BY department --Extension --Q17 ---------------- Not managed this one! ----------- WITH dept_avg_sal(id, department , avg_salary) AS ( SELECT id, department, AVG(salary) FROM employees GROUP BY department ) SELECT e.first_name, e.last_name, e.salary, e.salary / dept_avg_sal.avg_salary AS salary_over_dept_avg FROM employees AS e INNER JOIN dept_avg_sal ON e.id = dept_avg_sal.id --Q18 SELECT CASE WHEN pension_enrol IS NULL THEN 'Unknown' WHEN pension_enrol = FALSE THEN 'Not enrolled' WHEN pension_enrol = TRUE THEN 'Enrolled' END AS pension_scheme, COUNT(id) AS num_employees FROM employees GROUP BY pension_enrol --Q19 SELECT e.first_name, e.last_name, e.email, e.start_date FROM employees AS e LEFT JOIN employees_committees AS ec ON e.id = ec.employee_id LEFT JOIN committees AS c ON ec.committee_id = c.id WHERE c.name = 'Equality and Diversity' ORDER BY start_date ASC --Q20 ---- Not got working ---- SELECT CASE WHEN e.salary IS NULL THEN 'none' WHEN e.salary < 40000 THEN 'low' WHEN e.salary >= 40000 THEN 'high' END AS salary_class, COUNT(DISTINCT(e.id)) AS num_committee_members FROM employees AS e INNER JOIN employees_committees AS ec ON e.id = ec.employee_id GROUP BY salary_class