text
stringlengths
6
9.38M
DROP DATABASE `agenda`; CREATE DATABASE `agenda`; USE `agenda`; CREATE TABLE `pais` ( `idPais` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) NOT NULL, PRIMARY KEY (`idPais`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; CREATE TABLE `provincia` ( `idProvincia` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) NOT NULL, `pais` int NOT NULL, PRIMARY KEY (`idProvincia`), KEY `fk_pais_idx` (`pais`), CONSTRAINT `fk_pais` FOREIGN KEY (`pais`) REFERENCES `pais` (`idPais`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; CREATE TABLE `localidad` ( `idlocalidad` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) NOT NULL, `provincia` int NOT NULL, PRIMARY KEY (`idlocalidad`), KEY `fk_provincia_idx` (`provincia`), CONSTRAINT `fk_provincia` FOREIGN KEY (`provincia`) REFERENCES `provincia` (`idProvincia`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; CREATE TABLE `tipocontacto` ( `idTipoContacto` int NOT NULL AUTO_INCREMENT, `tipo` varchar(45) NOT NULL, PRIMARY KEY (`idTipoContacto`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `deporte` ( `id` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `personas` ( `idPersona` int NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) NOT NULL, `Telefono` varchar(20) NOT NULL, `Calle` varchar(45), `Nacimiento` date, `Altura` varchar(10), `Piso` varchar(10), `Departamento` varchar(45), `Email` varchar(45) NOT NULL, `localidad` int, `tipoDeContacto` int NOT NULL, `deporte` int, PRIMARY KEY (`idPersona`), KEY `fk_tipoDeContacto_idx` (`tipoDeContacto`), KEY `fk_deporte_idx` (`deporte`), CONSTRAINT `fk_deporte` FOREIGN KEY (`deporte`) REFERENCES `deporte` (`id`), CONSTRAINT `fk_tipoDeContacto` FOREIGN KEY (`tipoDeContacto`) REFERENCES `tipocontacto` (`idTipoContacto`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 02, 2020 at 03:08 PM -- Server version: 10.4.10-MariaDB -- PHP Version: 7.1.33 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: `volunteer_db` -- -- -------------------------------------------------------- -- -- Table structure for table `help` -- CREATE TABLE `help` ( `id` int(44) NOT NULL, `title` varchar(100) DEFAULT NULL, `details` varchar(500) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` int(44) NOT NULL, `title` varchar(100) DEFAULT NULL, `details` varchar(500) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `useraccount` -- CREATE TABLE `useraccount` ( `id` int(44) NOT NULL, `userid` int(44) DEFAULT NULL, `password` varchar(20) DEFAULT NULL, `role` varchar(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `userhelp` -- CREATE TABLE `userhelp` ( `id` int(44) NOT NULL, `userid` int(44) DEFAULT NULL, `help` varchar(4000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `userinfo` -- CREATE TABLE `userinfo` ( `id` int(44) NOT NULL, `firstname` varchar(100) DEFAULT NULL, `lastname` varchar(100) DEFAULT NULL, `gender` char(1) DEFAULT NULL, `dob` date DEFAULT NULL, `email` text NOT NULL, `phone` varchar(15) DEFAULT NULL, `country` varchar(70) DEFAULT NULL, `city` varchar(200) DEFAULT NULL, `websiteLink` text DEFAULT NULL, `status` varchar(50) DEFAULT NULL, `dor` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `userpermission` -- CREATE TABLE `userpermission` ( `id` int(44) NOT NULL, `userid` int(44) DEFAULT NULL, `permissions` varchar(4000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `help` -- ALTER TABLE `help` ADD PRIMARY KEY (`id`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `useraccount` -- ALTER TABLE `useraccount` ADD PRIMARY KEY (`id`); -- -- Indexes for table `userhelp` -- ALTER TABLE `userhelp` ADD PRIMARY KEY (`id`); -- -- Indexes for table `userinfo` -- ALTER TABLE `userinfo` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`) USING HASH; -- -- Indexes for table `userpermission` -- ALTER TABLE `userpermission` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `help` -- ALTER TABLE `help` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `useraccount` -- ALTER TABLE `useraccount` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `userhelp` -- ALTER TABLE `userhelp` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `userinfo` -- ALTER TABLE `userinfo` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `userpermission` -- ALTER TABLE `userpermission` MODIFY `id` int(44) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; 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 */;
insert into avatars (avatar_base_type_id, level, skin, hair, picture_url, night_background_url, day_background_url, status, text_id, created_by, created_date) values (10, 1, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 2, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 3, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 4, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 5, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 6, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 7, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 8, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 9, 1, 2, 's1h2.png', 'night1.png', 'day1.png', 'ACTIVE', 1, 1, current_timestamp), (10, 10, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 11, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 12, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 13, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 14, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 15, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 16, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 17, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 18, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 19, 1, 2, 's1h2.png', 'night10.png', 'day10.png', 'ACTIVE', 1, 1, current_timestamp), (10, 20, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 21, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 22, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 23, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 24, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 25, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 26, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 27, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 28, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 29, 1, 2, 's1h2.png', 'night20.png', 'day20.png', 'ACTIVE', 1, 1, current_timestamp), (10, 30, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 31, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 32, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 33, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 34, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 35, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 36, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 37, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 38, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 39, 1, 2, 's1h2.png', 'night30.png', 'day30.png', 'ACTIVE', 1, 1, current_timestamp), (10, 40, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 41, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 42, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 43, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 44, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 45, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 46, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 47, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 48, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp), (10, 49, 1, 2, 's1h2.png', 'night40.png', 'day40.png', 'ACTIVE', 1, 1, current_timestamp);
CREATE PROCEDURE sp_alteracao ( @ID INT, @nome VARCHAR(100), @cpf VARCHAR(11), @tipoCliente INT, @sexo CHAR, @situacao INT, @status INT OUTPUT ) AS BEGIN IF NOT EXISTS (SELECT 1 FROM Cliente WHERE CPF = @cpf AND ClienteId <> @ID) BEGIN UPDATE Cliente SET Nome = @nome, CPF = @cpf, mTipoCliente = @tipoCliente, Sexo = @sexo, mSituacao = @situacao WHERE ClienteId = @ID SELECT @status = 1 END ELSE BEGIN SELECT @status = 2 END END;
/* ################################################################################ Migration script to add indexes to large tables author: Jon Stewart date: 13 Dec 2019 version: 2.4.0.001 ################################################################################ */ CREATE INDEX "GWAS"."AN_ST_IDX" ON "GWAS"."ANCESTRY" ("STUDY_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."ASOC_ST_IDX" ON "GWAS"."ASSOCIATION" ("STUDY_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."ASSOC_EVT_IDX" ON "GWAS"."ASSOCIATION_EVENT" ("ASSOCIATION_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."DAE_ID_IDX" ON "GWAS"."DELETED_ASSOCIATION_EVENT" ("DELETED_ASSOCIATION_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."AET_ID_IDX" ON "GWAS"."ASSOCIATION_EFO_TRAIT" ("ASSOCIATION_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."ARG_ID_IDX" ON "GWAS"."AUTHOR_REPORTED_GENE" ("REPORTED_GENE_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."GC_ID_IDX" ON "GWAS"."GENOMIC_CONTEXT" ("ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."GC_SNP_IDX" ON "GWAS"."GENOMIC_CONTEXT" ("SNP_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."STDY_PUB_IDX" ON "GWAS"."STUDY" ("PUBLICATION_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."RA_SNP_ID_IDX" ON "GWAS"."RISK_ALLELE_SNP" ("RISK_ALLELE_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ; CREATE INDEX "GWAS"."SE_STUDY_ID_IDX" ON "GWAS"."STUDY_EVENT" ("STUDY_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "SPOT_DATA" ;
CREATE TABLE `com_menu_permission` ( `rid` int(16) NOT NULL AUTO_INCREMENT COMMENT '主键ID', `mcode` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '菜单code', `pcode` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '权限(按钮)code', PRIMARY KEY (`rid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- -------------------------------------------------------- -- Servidor: 127.0.0.1 -- Versão do servidor: 5.7.11 - MySQL Community Server (GPL) -- OS do Servidor: Win32 -- HeidiSQL Versão: 11.3.0.6295 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- Copiando estrutura do banco de dados para db_ecommerce CREATE DATABASE IF NOT EXISTS `db_ecommerce` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `db_ecommerce`; -- Copiando estrutura para procedure db_ecommerce.sp_addresses_save DELIMITER // CREATE PROCEDURE `sp_addresses_save`( IN `pidaddress` int(11), IN `pidperson` int(11), IN `pdesaddress` varchar(128), IN `pdescomplement` varchar(32), IN `pdescity` varchar(32), IN `pdesstate` varchar(32), IN `pdescountry` varchar(32), IN `pdeszipcode` char(8), IN `pdesdistrict` varchar(32) ) BEGIN IF pidaddress > 0 THEN UPDATE tb_addresses SET idperson = pidperson, desaddress = pdesaddress, descomplement = pdescomplement, descity = pdescity, desstate = pdesstate, descountry = pdescountry, deszipcode = pdeszipcode, desdistrict = pdesdistrict WHERE idaddress = pidaddress; ELSE INSERT INTO tb_addresses (idperson, desaddress, descomplement, descity, desstate, descountry, deszipcode, desdistrict) VALUES(pidperson, pdesaddress, pdescomplement, pdescity, pdesstate, pdescountry, pdeszipcode, pdesdistrict); SET pidaddress = LAST_INSERT_ID(); END IF; UPDATE tb_persons SET idaddress = pidaddress WHERE idperson = pidperson; UPDATE tb_carts SET idaddress = pidaddress WHERE iduser = pidperson; SELECT * FROM tb_addresses WHERE idaddress = pidaddress; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_carts_save DELIMITER // CREATE PROCEDURE `sp_carts_save`( IN `pidcart` INT, IN `pdessessionid` VARCHAR(64), IN `piduser` INT, IN `pdeszipcode` CHAR(8), IN `pvlfreight` DECIMAL(10,2), IN `pnrdays` INT, IN `pidaddress` INT ) BEGIN IF pidcart > 0 THEN UPDATE tb_carts SET dessessionid = pdessessionid, iduser = piduser, deszipcode = pdeszipcode, vlfreight = pvlfreight, nrdays = pnrdays, idaddress=pidaddress WHERE idcart = pidcart; ELSE INSERT INTO tb_carts (dessessionid, iduser, deszipcode, vlfreight, nrdays, idaddress) VALUES(pdessessionid, piduser, pdeszipcode, pvlfreight, pnrdays, pidaddress); SET pidcart = LAST_INSERT_ID(); END IF; SELECT * FROM tb_carts WHERE idcart = pidcart; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_categories_save DELIMITER // CREATE PROCEDURE `sp_categories_save`( pidcategory INT, pdescategory VARCHAR(64) ) BEGIN IF pidcategory > 0 THEN UPDATE tb_categories SET descategory = pdescategory WHERE idcategory = pidcategory; ELSE INSERT INTO tb_categories (descategory) VALUES(pdescategory); SET pidcategory = LAST_INSERT_ID(); END IF; SELECT * FROM tb_categories WHERE idcategory = pidcategory; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_orders_save DELIMITER // CREATE PROCEDURE `sp_orders_save`( IN `pidorder` INT, IN `pidcart` int(11), IN `piduser` int(11), IN `pidstatus` int(11), IN `pidaddress` int(11), IN `pvltotal` decimal(10,2) ) BEGIN IF pidorder > 0 THEN UPDATE tb_orders SET idcart = pidcart, iduser = piduser, idstatus = pidstatus, idaddress = pidaddress, vltotal = pvltotal WHERE idorder = pidorder; ELSE INSERT INTO tb_orders (idcart, iduser, idstatus, idaddress, vltotal) VALUES(pidcart, piduser, pidstatus, pidaddress, pvltotal); SET pidorder = LAST_INSERT_ID(); END IF; SELECT * FROM tb_orders a INNER JOIN tb_ordersstatus b USING(idstatus) INNER JOIN tb_carts c USING(idcart) INNER JOIN tb_users d ON d.iduser = a.iduser INNER JOIN tb_addresses e WHERE idorder = pidorder; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_products_save DELIMITER // CREATE PROCEDURE `sp_products_save`( pidproduct int(11), pdesproduct varchar(64), pvlprice decimal(10,2), pvlwidth decimal(10,2), pvlheight decimal(10,2), pvllength decimal(10,2), pvlweight decimal(10,2), pdesurl varchar(128) ) BEGIN IF pidproduct > 0 THEN UPDATE tb_products SET desproduct = pdesproduct, vlprice = pvlprice, vlwidth = pvlwidth, vlheight = pvlheight, vllength = pvllength, vlweight = pvlweight, desurl = pdesurl WHERE idproduct = pidproduct; ELSE INSERT INTO tb_products (desproduct, vlprice, vlwidth, vlheight, vllength, vlweight, desurl) VALUES(pdesproduct, pvlprice, pvlwidth, pvlheight, pvllength, pvlweight, pdesurl); SET pidproduct = LAST_INSERT_ID(); END IF; SELECT * FROM tb_products WHERE idproduct = pidproduct; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_userspasswordsrecoveries_create DELIMITER // CREATE PROCEDURE `sp_userspasswordsrecoveries_create`( piduser INT, pdesip VARCHAR(45) ) BEGIN INSERT INTO tb_userspasswordsrecoveries (iduser, desip) VALUES(piduser, pdesip); SELECT * FROM tb_userspasswordsrecoveries WHERE idrecovery = LAST_INSERT_ID(); END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_usersupdate_save DELIMITER // CREATE PROCEDURE `sp_usersupdate_save`( IN `piduser` INT, IN `pdesperson` VARCHAR(64), IN `pdeslogin` VARCHAR(64), IN `pdespassword` VARCHAR(256), IN `pdesemail` VARCHAR(128), IN `pnrphone` VARCHAR(60), IN `pinadmin` TINYINT ) BEGIN DECLARE vidperson INT; SELECT idperson INTO vidperson FROM tb_users WHERE iduser = piduser; UPDATE tb_persons SET desperson = pdesperson, desemail = pdesemail, nrphone = pnrphone WHERE idperson = vidperson; UPDATE tb_users SET deslogin = pdeslogin, despassword = pdespassword, inadmin = pinadmin WHERE iduser = piduser; SELECT * FROM tb_users a INNER JOIN tb_persons b USING(idperson) WHERE a.iduser = piduser; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_users_delete DELIMITER // CREATE PROCEDURE `sp_users_delete`( piduser INT ) BEGIN DECLARE vidperson INT; SELECT idperson INTO vidperson FROM tb_users WHERE iduser = piduser; DELETE FROM tb_users WHERE iduser = piduser; DELETE FROM tb_persons WHERE idperson = vidperson; END// DELIMITER ; -- Copiando estrutura para procedure db_ecommerce.sp_users_save DELIMITER // CREATE PROCEDURE `sp_users_save`( pdesperson VARCHAR(64), pdeslogin VARCHAR(64), pdespassword VARCHAR(256), pdesemail VARCHAR(128), pnrphone BIGINT, pinadmin TINYINT ) BEGIN DECLARE vidperson INT; INSERT INTO tb_persons (desperson, desemail, nrphone) VALUES(pdesperson, pdesemail, pnrphone); SET vidperson = LAST_INSERT_ID(); INSERT INTO tb_users (idperson, deslogin, despassword, inadmin) VALUES(vidperson, pdeslogin, pdespassword, pinadmin); SELECT * FROM tb_users a INNER JOIN tb_persons b USING(idperson) WHERE a.iduser = LAST_INSERT_ID(); END// DELIMITER ; -- Copiando estrutura para tabela db_ecommerce.tb_addresses CREATE TABLE IF NOT EXISTS `tb_addresses` ( `idaddress` int(11) NOT NULL AUTO_INCREMENT, `idperson` int(11) NOT NULL, `desaddress` varchar(128) NOT NULL, `descomplement` varchar(32) DEFAULT NULL, `descity` varchar(32) NOT NULL, `desstate` varchar(32) NOT NULL, `descountry` varchar(32) NOT NULL, `deszipcode` char(8) NOT NULL, `desdistrict` varchar(32) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idaddress`), KEY `fk_addresses_persons_idx` (`idperson`), CONSTRAINT `fk_addresses_persons` FOREIGN KEY (`idperson`) REFERENCES `tb_persons` (`idperson`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_carts CREATE TABLE IF NOT EXISTS `tb_carts` ( `idcart` int(11) NOT NULL AUTO_INCREMENT, `dessessionid` varchar(64) NOT NULL, `iduser` int(11) DEFAULT NULL, `deszipcode` char(8) DEFAULT NULL, `vlfreight` decimal(10,2) DEFAULT NULL, `nrdays` int(11) DEFAULT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `idaddress` int(11) DEFAULT NULL, PRIMARY KEY (`idcart`), KEY `FK_carts_users_idx` (`iduser`), KEY `fk_carts_addresses` (`idaddress`), CONSTRAINT `fk_carts_addresses` FOREIGN KEY (`idaddress`) REFERENCES `tb_addresses` (`idaddress`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_carts_users` FOREIGN KEY (`iduser`) REFERENCES `tb_users` (`iduser`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_cartsproducts CREATE TABLE IF NOT EXISTS `tb_cartsproducts` ( `idcartproduct` int(11) NOT NULL AUTO_INCREMENT, `idcart` int(11) NOT NULL, `idproduct` int(11) NOT NULL, `dtremoved` datetime DEFAULT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idcartproduct`), KEY `FK_cartsproducts_carts_idx` (`idcart`), KEY `FK_cartsproducts_products_idx` (`idproduct`), CONSTRAINT `fk_cartsproducts_carts` FOREIGN KEY (`idcart`) REFERENCES `tb_carts` (`idcart`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_cartsproducts_products` FOREIGN KEY (`idproduct`) REFERENCES `tb_products` (`idproduct`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=204 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_categories CREATE TABLE IF NOT EXISTS `tb_categories` ( `idcategory` int(11) NOT NULL AUTO_INCREMENT, `descategory` varchar(32) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idcategory`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_categoriesproducts CREATE TABLE IF NOT EXISTS `tb_categoriesproducts` ( `idcategory` int(11) NOT NULL, `idproduct` int(11) NOT NULL, PRIMARY KEY (`idcategory`,`idproduct`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_orders CREATE TABLE IF NOT EXISTS `tb_orders` ( `idorder` int(11) NOT NULL AUTO_INCREMENT, `idcart` int(11) NOT NULL, `iduser` int(11) NOT NULL, `idstatus` int(11) NOT NULL, `idaddress` int(11) NOT NULL, `vltotal` decimal(10,2) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idorder`), KEY `FK_orders_users_idx` (`iduser`), KEY `fk_orders_ordersstatus_idx` (`idstatus`), KEY `fk_orders_carts_idx` (`idcart`), KEY `fk_orders_addresses_idx` (`idaddress`), CONSTRAINT `fk_orders_addresses` FOREIGN KEY (`idaddress`) REFERENCES `tb_addresses` (`idaddress`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_orders_carts` FOREIGN KEY (`idcart`) REFERENCES `tb_carts` (`idcart`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_orders_ordersstatus` FOREIGN KEY (`idstatus`) REFERENCES `tb_ordersstatus` (`idstatus`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_orders_users` FOREIGN KEY (`iduser`) REFERENCES `tb_users` (`iduser`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_ordersstatus CREATE TABLE IF NOT EXISTS `tb_ordersstatus` ( `idstatus` int(11) NOT NULL AUTO_INCREMENT, `desstatus` varchar(32) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idstatus`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_persons CREATE TABLE IF NOT EXISTS `tb_persons` ( `idperson` int(11) NOT NULL AUTO_INCREMENT, `desperson` varchar(64) NOT NULL, `desemail` varchar(128) DEFAULT NULL, `nrphone` varchar(50) DEFAULT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `idaddress` int(11) DEFAULT NULL, PRIMARY KEY (`idperson`), UNIQUE KEY `idaddress` (`idaddress`) ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_products CREATE TABLE IF NOT EXISTS `tb_products` ( `idproduct` int(11) NOT NULL AUTO_INCREMENT, `desproduct` varchar(128) NOT NULL, `vlprice` decimal(10,2) NOT NULL, `vlwidth` decimal(10,2) NOT NULL, `vlheight` decimal(10,2) NOT NULL, `vllength` decimal(10,2) NOT NULL, `vlweight` decimal(10,2) NOT NULL, `desurl` varchar(128) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idproduct`) ) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_users CREATE TABLE IF NOT EXISTS `tb_users` ( `iduser` int(11) NOT NULL AUTO_INCREMENT, `idperson` int(11) NOT NULL, `deslogin` varchar(64) NOT NULL, `despassword` varchar(256) NOT NULL, `inadmin` tinyint(4) NOT NULL DEFAULT '0', `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`iduser`), KEY `FK_users_persons_idx` (`idperson`), CONSTRAINT `fk_users_persons` FOREIGN KEY (`idperson`) REFERENCES `tb_persons` (`idperson`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_userslogs CREATE TABLE IF NOT EXISTS `tb_userslogs` ( `idlog` int(11) NOT NULL AUTO_INCREMENT, `iduser` int(11) NOT NULL, `deslog` varchar(128) NOT NULL, `desip` varchar(45) NOT NULL, `desuseragent` varchar(128) NOT NULL, `dessessionid` varchar(64) NOT NULL, `desurl` varchar(128) NOT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idlog`), KEY `fk_userslogs_users_idx` (`iduser`), CONSTRAINT `fk_userslogs_users` FOREIGN KEY (`iduser`) REFERENCES `tb_users` (`iduser`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. -- Copiando estrutura para tabela db_ecommerce.tb_userspasswordsrecoveries CREATE TABLE IF NOT EXISTS `tb_userspasswordsrecoveries` ( `idrecovery` int(11) NOT NULL AUTO_INCREMENT, `iduser` int(11) NOT NULL, `desip` varchar(45) NOT NULL, `dtrecovery` datetime DEFAULT NULL, `dtregister` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`idrecovery`), KEY `fk_userspasswordsrecoveries_users_idx` (`iduser`), CONSTRAINT `fk_userspasswordsrecoveries_users` FOREIGN KEY (`iduser`) REFERENCES `tb_users` (`iduser`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; -- Exportação de dados foi desmarcado. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
use Formulario_102A alter table Form107 drop column v_301,v_303,v_305,v_307,v_311,v_313,v_315,v_317,v_351,v_353,v_361,v_363,v_365,v_367,v_369,v_371,v_373,v_381,v_399,v_401,v_403,v_405,v_407 alter table Form107 add v_301 varchar (10), v_303 varchar (10), v_305 varchar (10), v_307 varchar (10), v_311 varchar (10), v_313 varchar (10), v_315 varchar (10), v_317 varchar (10), v_351 varchar (10), v_353 varchar (10), v_361 varchar (10), v_363 varchar (10), v_365 varchar (10), v_367 varchar (10), v_369 varchar (10), v_371 varchar (10), v_373 varchar (10), v_381 varchar (10), v_399 varchar (10), v_401 varchar (10), v_403 varchar (10), v_405 varchar (10), v_407 varchar (10)
drop table SYS_ROLE_PERMISSION; -- Create table create table SYS_ROLE_PERMISSION ( PERMISSION_ID NUMBER(11), ROLE_ID NUMBER(11) ); -- Add comments to the table comment on table SYS_ROLE_PERMISSION is '系统角色权限信息登记簿'; -- Add comments to the columns comment on column SYS_ROLE_PERMISSION.PERMISSION_ID is '权限编号'; comment on column SYS_ROLE_PERMISSION.ROLE_ID is '角色编号';
SELECT CUSTOMER_MST.CUSTOMER_CODE FROM CUSTOMER_MST WHERE CUSTOMER_MST.TAXPAYER_NO = /*dto.taxpayerID*/'' /*IF (dto.customerCode != null)*/ AND CUSTOMER_MST.CUSTOMER_CODE <> /*dto.customerCode*/'' /*END*/ AND CUSTOMER_MST.DELETE_FLG <> CAST(/*oneValue*/ AS CHAR(1))
-- MariaDB 5.3 USE _; DELIMITER || -- Overwrite generic implementation, -- as MariaDB exposes a variable for this. DROP FUNCTION IF EXISTS is_trx_in_progress; CREATE FUNCTION is_trx_in_progress() RETURNS BOOL NOT DETERMINISTIC READS SQL DATA COMMENT 'Return wether a transaction is in progress' BEGIN RETURN @@session.in_transaction; END || DELIMITER ;
-- The reference used: http://stackoverflow.com/questions/4743649/cant-get-join-on-mysql-delete-query-to-work delete E, EM from Echo E join EchoMetrics EM on E.echoMetricsId = EM.id where E.landingPageUrl like '%test888%'; delete SP, PU, PS, P from ShopifyPartner SP join PartnerUser PU on SP.partnerId = PU.partnerId join PartnerSettings PS on SP.partnerId = PS.partnerId join Partner P on SP.partnerId = P.id where SP.partnerId = '4bd0df96-e461-4894-a25d-c84dae3176a';
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jul 20, 2018 at 03:39 PM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.1.19 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: `lidosuites` -- -- -------------------------------------------------------- -- -- Table structure for table `alicuotas` -- CREATE TABLE `alicuotas` ( `id_alicuota` int(10) UNSIGNED NOT NULL, `alicuota` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `monto` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `alicuotas` -- INSERT INTO `alicuotas` (`id_alicuota`, `alicuota`, `monto`, `created`) VALUES (2, '3%', '3', '2018-06-26 06:52:09'), (3, '4%', '4', '2018-06-26 06:52:12'); -- -------------------------------------------------------- -- -- Table structure for table `apartamentos` -- CREATE TABLE `apartamentos` ( `id_apartamento` int(10) UNSIGNED NOT NULL, `id_alicuota` int(10) UNSIGNED NOT NULL, `nombre` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `saldo` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `estado` int(2) NOT NULL DEFAULT '0', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `apartamentos` -- INSERT INTO `apartamentos` (`id_apartamento`, `id_alicuota`, `nombre`, `saldo`, `estado`, `created`) VALUES (3, 2, 'Apartamento Nro 3', '100.00', 1, '2018-06-26 06:53:04'), (4, 3, 'Apartamento Nro 4', '100.00', 1, '2018-06-26 06:53:15'), (5, 2, 'Apartamento 5', '200', 1, '2018-07-19 15:26:31'), (6, 3, 'Apartamento 6', '230', 1, '2018-07-19 18:44:54'); -- -------------------------------------------------------- -- -- Table structure for table `auditorias` -- CREATE TABLE `auditorias` ( `id_auditoria` int(10) UNSIGNED NOT NULL, `id_usuario` int(10) UNSIGNED NOT NULL, `evento` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `tabla` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `auditorias` -- INSERT INTO `auditorias` (`id_auditoria`, `id_usuario`, `evento`, `tabla`, `created`) VALUES (1, 2, 'Agregar un gasto', 'gastos', '2018-07-10 19:00:21'), (2, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-10 19:00:39'), (3, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-10 19:00:42'), (4, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-10 19:00:42'), (5, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-10 19:00:43'), (6, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-10 19:00:43'), (7, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-10 19:00:43'), (8, 5, 'Agregar una novedad', 'novedades', '2018-07-12 13:09:08'), (9, 2, 'Agregar una novedad', 'novedades', '2018-07-12 14:13:58'), (10, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:03:20'), (11, 2, 'Eliminar una alicuota', 'alicuotas', '2018-07-12 15:07:00'), (12, 2, 'Eliminar una alicuota', 'alicuotas', '2018-07-12 15:07:17'), (13, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:07:29'), (14, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:19:29'), (15, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:20:01'), (16, 2, 'Eliminar una alicuota', 'alicuotas', '2018-07-12 15:25:58'), (17, 2, 'Eliminar una alicuota', 'alicuotas', '2018-07-12 15:26:26'), (18, 2, 'Eliminar una alicuota', 'alicuotas', '2018-07-12 15:27:44'), (19, 2, 'Eliminar un documento', 'documentos', '2018-07-12 15:27:58'), (20, 2, 'Eliminar un documento', 'documentos', '2018-07-12 15:28:01'), (21, 2, 'Eliminar un documento', 'documentos', '2018-07-12 15:28:25'), (22, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:31:31'), (23, 2, 'Eliminar un documento', 'documentos', '2018-07-12 15:34:32'), (24, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:35:01'), (25, 2, 'Eliminar un documento', 'documentos', '2018-07-12 15:35:12'), (26, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:36:30'), (27, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:41:06'), (28, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 15:51:29'), (29, 2, 'Agregar un apartamento', 'apartamentos', '2018-07-12 18:24:02'), (30, 2, 'Editar un documento', 'documentos', '2018-07-12 18:27:44'), (31, 2, 'Editar un documento', 'documentos', '2018-07-12 18:28:57'), (32, 2, 'Editar un documento', 'documentos', '2018-07-12 18:30:35'), (33, 2, 'Editar un documento', 'documentos', '2018-07-12 18:32:25'), (34, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-12 19:33:18'), (35, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-12 19:57:25'), (36, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-12 19:57:25'), (37, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-13 14:35:09'), (38, 2, 'Eliminar una mensualidad', 'mensualidad', '2018-07-13 19:59:57'), (39, 2, 'Agregar un gasto', 'gastos', '2018-07-13 20:00:12'), (40, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-13 20:00:34'), (41, 2, 'Agregar un contrato', 'contrato', '2018-07-18 19:20:58'), (42, 2, 'Agregar un contrato', 'contrato', '2018-07-18 19:21:12'), (43, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-18 19:21:16'), (44, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-18 19:21:16'), (45, 5, 'Agregar una notificacion ', 'pagos', '2018-07-18 19:22:11'), (46, 2, 'Aprobar pago', 'pagos', '2018-07-18 19:22:24'), (47, 1, 'Agregar un apartamento', 'apartamentos', '2018-07-19 15:26:31'), (48, 2, 'Agregar un contrato', 'contrato', '2018-07-19 15:35:41'), (49, 2, 'Agregar un contrato', 'contrato', '2018-07-19 15:41:50'), (50, 1, 'Agregar un apartamento', 'apartamentos', '2018-07-19 18:44:54'), (51, 2, 'Agregar un contrato', 'contrato', '2018-07-19 18:45:23'), (52, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-19 18:47:16'), (53, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:47:19'), (54, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:47:19'), (55, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:47:19'), (56, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:47:19'), (57, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-19 18:55:47'), (58, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:55:53'), (59, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:55:53'), (60, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:55:53'), (61, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 18:55:53'), (62, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-19 19:06:36'), (63, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 19:06:40'), (64, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 19:06:40'), (65, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 19:06:40'), (66, 2, 'Agregar una cuenta por co', 'cxc', '2018-07-19 19:06:40'), (67, 2, 'Agregar una mensualidad', 'mensualidad', '2018-07-19 19:08:25'); -- -------------------------------------------------------- -- -- Table structure for table `bancos` -- CREATE TABLE `bancos` ( `id_banco` int(10) UNSIGNED NOT NULL, `descripcion` varchar(115) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `bancos` -- INSERT INTO `bancos` (`id_banco`, `descripcion`, `created`) VALUES (1, 'Banesco', '2018-06-26 06:53:30'), (2, 'Mercantil', '2018-06-26 06:53:37'), (3, 'BBVA Provincial', '2018-06-26 06:53:44'), (4, 'BOD', '2018-06-26 06:53:49'), (5, 'Banco de Venezuela', '2018-06-26 06:54:00'), (6, 'Banco Bicentenario', '2018-06-26 06:54:08'), (7, 'Banco Exterior', '2018-06-26 06:54:18'), (8, 'Sofitasa', '2018-06-26 06:54:23'), (9, '100% Banco', '2018-06-26 06:54:32'), (10, 'Banco Activo', '2018-06-26 06:54:40'), (11, 'Banco del Sur', '2018-06-26 06:54:47'), (12, 'Fondo Comun', '2018-06-26 06:55:06'); -- -------------------------------------------------------- -- -- Table structure for table `contrato` -- CREATE TABLE `contrato` ( `id_contrato` int(10) UNSIGNED NOT NULL, `id_apartamento` int(10) UNSIGNED NOT NULL, `id_propietario` int(10) UNSIGNED NOT NULL, `fecha_inicio` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `fecha_fin` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `contrato` -- INSERT INTO `contrato` (`id_contrato`, `id_apartamento`, `id_propietario`, `fecha_inicio`, `fecha_fin`, `created`) VALUES (4, 5, 5, '2018-07-01', '2018-07-31', '2018-07-19 15:41:50'), (5, 6, 6, '2018-07-01', '2018-07-31', '2018-07-19 18:45:23'); -- -------------------------------------------------------- -- -- Table structure for table `cxc` -- CREATE TABLE `cxc` ( `id_cxc` int(10) UNSIGNED NOT NULL, `id_apartamento` int(10) UNSIGNED NOT NULL, `id_alicuota` int(10) UNSIGNED NOT NULL, `id_mensualidad` int(10) UNSIGNED NOT NULL, `monto` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `cancelado` int(10) UNSIGNED NOT NULL DEFAULT '0', `fecha` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `cxc` -- INSERT INTO `cxc` (`id_cxc`, `id_apartamento`, `id_alicuota`, `id_mensualidad`, `monto`, `cancelado`, `fecha`, `created`) VALUES (3, 3, 2, 1, '61800000.00', 1, '2018-07-10', '2018-07-10 19:00:43'), (4, 4, 3, 1, '62400000.00', 0, '2018-07-10', '2018-07-10 19:00:43'), (6, 3, 2, 2, '12360000.00', 0, '2018-08-01', '2018-07-12 19:57:25'), (7, 4, 3, 2, '12480000.00', 0, '2018-08-01', '2018-07-12 19:57:25'), (8, 3, 2, 4, '13596000.00', 0, '2018-09-01', '2018-07-18 19:21:16'), (9, 4, 3, 4, '13728000.00', 0, '2018-09-01', '2018-07-18 19:21:16'), (18, 3, 2, 7, '13596000.00', 0, '2018-09-01', '2018-07-19 19:06:40'), (19, 4, 3, 7, '13728000.00', 0, '2018-09-01', '2018-07-19 19:06:40'), (20, 5, 2, 7, '13596000.00', 0, '2018-09-01', '2018-07-19 19:06:40'), (21, 6, 3, 7, '13728000.00', 0, '2018-09-01', '2018-07-19 19:06:40'); -- -------------------------------------------------------- -- -- Table structure for table `cxc_has_pago` -- CREATE TABLE `cxc_has_pago` ( `id_cxc_has_pago` int(10) UNSIGNED NOT NULL, `id_cxc` int(10) UNSIGNED NOT NULL, `cancelado` int(10) UNSIGNED NOT NULL DEFAULT '0', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -------------------------------------------------------- -- -- Table structure for table `detalle` -- CREATE TABLE `detalle` ( `id_detalle` int(10) UNSIGNED NOT NULL, `id_gasto` int(10) UNSIGNED NOT NULL, `id_proveedor` int(10) UNSIGNED NOT NULL, `id_ut` int(10) UNSIGNED NOT NULL, `id_mensualidad` int(10) UNSIGNED NOT NULL, `monto` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `tipo` tinyint(4) DEFAULT '0', `descripcion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -------------------------------------------------------- -- -- Table structure for table `detalle_mensualidad` -- CREATE TABLE `detalle_mensualidad` ( `id_detalle_mensualidad` int(10) UNSIGNED NOT NULL, `id_mensualidad` int(10) UNSIGNED NOT NULL, `id_gasto` int(10) UNSIGNED NOT NULL, `cantidad` varchar(35) COLLATE utf8_spanish_ci NOT NULL, `fecha` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `detalle_mensualidad` -- INSERT INTO `detalle_mensualidad` (`id_detalle_mensualidad`, `id_mensualidad`, `id_gasto`, `cantidad`, `fecha`, `created`) VALUES (1, 1, 1, '10', '2018-07-10', '2018-07-10 19:00:39'), (2, 2, 1, '2', '2018-08-01', '2018-07-12 19:33:18'), (10, 7, 1, '2', '2018-09-01', '2018-07-19 19:06:36'), (11, 7, 2, '1', '2018-09-01', '2018-07-19 19:06:36'), (12, 8, 1, '4', '2018-10-01', '2018-07-19 19:08:25'), (13, 8, 2, '1', '2018-10-01', '2018-07-19 19:08:25'); -- -------------------------------------------------------- -- -- Table structure for table `documentos` -- CREATE TABLE `documentos` ( `id_documento` int(10) UNSIGNED NOT NULL, `id_usuario` int(10) UNSIGNED NOT NULL, `fecha` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `ubicacion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `descripcion` varchar(115) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `documentos` -- INSERT INTO `documentos` (`id_documento`, `id_usuario`, `fecha`, `ubicacion`, `descripcion`, `created`) VALUES (1, 2, '2018-07-12', '2017-Scrum-Guide-Spanish-SouthAmerican.pdf', 'Scrum Guia 2017', '2018-07-12 15:51:29'), (2, 2, '2018-07-12', 'curso.txt', 'curso txt', '2018-07-12 18:24:02'); -- -------------------------------------------------------- -- -- Table structure for table `formas_pagos` -- CREATE TABLE `formas_pagos` ( `id_forma_pago` int(10) UNSIGNED NOT NULL, `descripcion` varchar(115) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `formas_pagos` -- INSERT INTO `formas_pagos` (`id_forma_pago`, `descripcion`, `created`) VALUES (1, 'Debito', '2018-06-26 06:57:55'), (2, 'Deposito', '2018-06-26 06:58:02'), (3, 'Transferencia', '2018-06-26 06:58:10'), (4, 'Cheque', '2018-06-26 06:58:17'), (5, 'Pago movil', '2018-06-26 06:58:24'), (6, 'Efectivo', '2018-06-26 06:58:29'); -- -------------------------------------------------------- -- -- Table structure for table `gastos` -- CREATE TABLE `gastos` ( `id_gasto` int(10) UNSIGNED NOT NULL, `id_ut` int(10) UNSIGNED NOT NULL, `descripcion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `monto` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `tipo` tinyint(4) DEFAULT '0', `numeroUts` int(11) DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `gastos` -- INSERT INTO `gastos` (`id_gasto`, `id_ut`, `descripcion`, `monto`, `tipo`, `numeroUts`, `created`) VALUES (1, 1, 'Bolsas', '6000000.00', 2, 5, '2018-07-10 19:00:21'), (2, 1, 'Alquiler', '1200000.00', 2, 1, '2018-07-13 20:00:12'); -- -------------------------------------------------------- -- -- Table structure for table `mensualidad` -- CREATE TABLE `mensualidad` ( `id_mensualidad` int(10) UNSIGNED NOT NULL, `descripcion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `total` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `fecha` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `tipo` tinyint(4) DEFAULT '0', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `mensualidad` -- INSERT INTO `mensualidad` (`id_mensualidad`, `descripcion`, `total`, `fecha`, `tipo`, `created`) VALUES (1, 'Julio', '60000000.00', '2018-07-10', 1, '2018-07-10 19:00:39'), (2, 'Agosto', '12000000.00', '2018-08-01', 1, '2018-07-12 19:33:18'), (7, 'Septiembre', '13200000.00', '2018-09-01', 1, '2018-07-19 19:06:36'), (8, 'Octubre', '25200000.00', '2018-10-01', 0, '2018-07-19 19:08:25'); -- -------------------------------------------------------- -- -- Table structure for table `niveles` -- CREATE TABLE `niveles` ( `id_nivel` int(10) UNSIGNED NOT NULL, `nivel` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `descripcion` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `niveles` -- INSERT INTO `niveles` (`id_nivel`, `nivel`, `descripcion`, `created`) VALUES (1, 'Administrador del sistema', 'Administrador del sistema', '2018-06-26 06:49:16'), (2, 'Administrador condiminio', 'Administrador condiminio', '2018-06-26 06:50:19'), (3, 'Propietario', 'Propietario', '2018-06-26 06:50:29'); -- -------------------------------------------------------- -- -- Table structure for table `novedades` -- CREATE TABLE `novedades` ( `id_novedad` int(10) UNSIGNED NOT NULL, `id_usuario` int(10) UNSIGNED NOT NULL, `descripcion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `novedades` -- INSERT INTO `novedades` (`id_novedad`, `id_usuario`, `descripcion`, `created`) VALUES (1, 5, 'Nueva novedad', '2018-07-12 13:09:08'), (2, 2, 'Novedad ok', '2018-07-12 14:13:58'); -- -------------------------------------------------------- -- -- Table structure for table `pagos` -- CREATE TABLE `pagos` ( `id_pago` int(10) UNSIGNED NOT NULL, `id_forma_pago` int(10) UNSIGNED NOT NULL, `id_apartamento` int(10) UNSIGNED NOT NULL, `id_banco` int(10) UNSIGNED NOT NULL, `id_usuario` int(10) UNSIGNED NOT NULL, `monto` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `referencia` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `aprobado` tinyint(1) NOT NULL DEFAULT '0', `descripcion` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `fecha` varchar(25) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `pagos` -- INSERT INTO `pagos` (`id_pago`, `id_forma_pago`, `id_apartamento`, `id_banco`, `id_usuario`, `monto`, `referencia`, `aprobado`, `descripcion`, `fecha`, `created`) VALUES (1, 1, 3, 2, 5, '61800000.00', '45454545', 1, 'Pago julio', '2018-07-18', '2018-07-18 19:22:11'); -- -------------------------------------------------------- -- -- Table structure for table `propietarios` -- CREATE TABLE `propietarios` ( `id_propietario` int(10) UNSIGNED NOT NULL, `cedula` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `nombres` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `apellidos` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `telefono` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `correo` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `notas` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `contrato` int(11) NOT NULL DEFAULT '0', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `propietarios` -- INSERT INTO `propietarios` (`id_propietario`, `cedula`, `nombres`, `apellidos`, `telefono`, `correo`, `notas`, `contrato`, `created`) VALUES (1, '8554452', 'Karla', 'Mejias', '4545551', 'karlam@outlook.com', 'Propietario Karla', 1, '2018-06-26 06:56:16'), (2, '21212221', 'Carlos', 'Gutierrez', '455421221', 'carlosg@gmail.com', 'Propietario Carlos', 1, '2018-06-26 06:56:55'); -- -------------------------------------------------------- -- -- Table structure for table `proveedores` -- CREATE TABLE `proveedores` ( `id_proveedor` int(10) UNSIGNED NOT NULL, `nombres` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `apellidos` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `correo` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `telefono` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `notas` varchar(255) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -------------------------------------------------------- -- -- Table structure for table `usuarios` -- CREATE TABLE `usuarios` ( `id_usuario` int(10) UNSIGNED NOT NULL, `id_nivel` int(10) UNSIGNED NOT NULL, `nombres` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `apellidos` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `correo` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `contrasena` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `telefono` varchar(100) COLLATE utf8_spanish_ci NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `usuarios` -- INSERT INTO `usuarios` (`id_usuario`, `id_nivel`, `nombres`, `apellidos`, `correo`, `contrasena`, `telefono`, `created`) VALUES (1, 1, 'Luis', 'Rondon', 'leduardo.rondon@gmail.com', '202cb962ac59075b964b07152d234b70', '04121805865', '2018-06-26 07:26:18'), (2, 2, 'Ronald', 'Rodriguez', 'ronaldr@gmail.com', '202cb962ac59075b964b07152d234b70', '04141881071', '2018-06-26 07:27:14'), (5, 3, 'Karla', 'Mejias', 'karlam@outlook.com', '202cb962ac59075b964b07152d234b70', '4545551', '2018-06-26 06:56:16'), (6, 3, 'Carlos', 'Gutierrez', 'carlosg@gmail.com', '202cb962ac59075b964b07152d234b70', '455421221', '2018-06-26 06:56:55'); -- -------------------------------------------------------- -- -- Table structure for table `ut` -- CREATE TABLE `ut` ( `id_ut` int(10) UNSIGNED NOT NULL, `ut` varchar(55) COLLATE utf8_spanish_ci NOT NULL, `anio` int(5) NOT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; -- -- Dumping data for table `ut` -- INSERT INTO `ut` (`id_ut`, `ut`, `anio`, `created`) VALUES (1, '1200000', 2018, '2018-06-26 07:02:18'); -- -- Indexes for dumped tables -- -- -- Indexes for table `alicuotas` -- ALTER TABLE `alicuotas` ADD PRIMARY KEY (`id_alicuota`); -- -- Indexes for table `apartamentos` -- ALTER TABLE `apartamentos` ADD PRIMARY KEY (`id_apartamento`), ADD KEY `id_alicuota` (`id_alicuota`); -- -- Indexes for table `auditorias` -- ALTER TABLE `auditorias` ADD PRIMARY KEY (`id_auditoria`), ADD KEY `id_usuario` (`id_usuario`); -- -- Indexes for table `bancos` -- ALTER TABLE `bancos` ADD PRIMARY KEY (`id_banco`); -- -- Indexes for table `contrato` -- ALTER TABLE `contrato` ADD PRIMARY KEY (`id_contrato`), ADD KEY `id_apartamento` (`id_apartamento`); -- -- Indexes for table `cxc` -- ALTER TABLE `cxc` ADD PRIMARY KEY (`id_cxc`), ADD KEY `id_apartamento` (`id_apartamento`); -- -- Indexes for table `cxc_has_pago` -- ALTER TABLE `cxc_has_pago` ADD PRIMARY KEY (`id_cxc_has_pago`), ADD KEY `id_cxc` (`id_cxc`); -- -- Indexes for table `detalle` -- ALTER TABLE `detalle` ADD PRIMARY KEY (`id_detalle`), ADD KEY `id_gasto` (`id_gasto`); -- -- Indexes for table `detalle_mensualidad` -- ALTER TABLE `detalle_mensualidad` ADD PRIMARY KEY (`id_detalle_mensualidad`), ADD KEY `id_mensualidad` (`id_mensualidad`); -- -- Indexes for table `documentos` -- ALTER TABLE `documentos` ADD PRIMARY KEY (`id_documento`); -- -- Indexes for table `formas_pagos` -- ALTER TABLE `formas_pagos` ADD PRIMARY KEY (`id_forma_pago`); -- -- Indexes for table `gastos` -- ALTER TABLE `gastos` ADD PRIMARY KEY (`id_gasto`), ADD KEY `id_ut` (`id_ut`); -- -- Indexes for table `mensualidad` -- ALTER TABLE `mensualidad` ADD PRIMARY KEY (`id_mensualidad`); -- -- Indexes for table `niveles` -- ALTER TABLE `niveles` ADD PRIMARY KEY (`id_nivel`); -- -- Indexes for table `novedades` -- ALTER TABLE `novedades` ADD PRIMARY KEY (`id_novedad`), ADD KEY `id_usuario` (`id_usuario`); -- -- Indexes for table `pagos` -- ALTER TABLE `pagos` ADD PRIMARY KEY (`id_pago`), ADD KEY `id_apartamento` (`id_apartamento`); -- -- Indexes for table `propietarios` -- ALTER TABLE `propietarios` ADD PRIMARY KEY (`id_propietario`); -- -- Indexes for table `proveedores` -- ALTER TABLE `proveedores` ADD PRIMARY KEY (`id_proveedor`); -- -- Indexes for table `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id_usuario`), ADD UNIQUE KEY `correo` (`correo`), ADD KEY `id_nivel` (`id_nivel`); -- -- Indexes for table `ut` -- ALTER TABLE `ut` ADD PRIMARY KEY (`id_ut`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `alicuotas` -- ALTER TABLE `alicuotas` MODIFY `id_alicuota` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `apartamentos` -- ALTER TABLE `apartamentos` MODIFY `id_apartamento` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `auditorias` -- ALTER TABLE `auditorias` MODIFY `id_auditoria` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68; -- -- AUTO_INCREMENT for table `bancos` -- ALTER TABLE `bancos` MODIFY `id_banco` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `contrato` -- ALTER TABLE `contrato` MODIFY `id_contrato` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `cxc` -- ALTER TABLE `cxc` MODIFY `id_cxc` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `cxc_has_pago` -- ALTER TABLE `cxc_has_pago` MODIFY `id_cxc_has_pago` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `detalle` -- ALTER TABLE `detalle` MODIFY `id_detalle` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `detalle_mensualidad` -- ALTER TABLE `detalle_mensualidad` MODIFY `id_detalle_mensualidad` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `documentos` -- ALTER TABLE `documentos` MODIFY `id_documento` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `formas_pagos` -- ALTER TABLE `formas_pagos` MODIFY `id_forma_pago` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `gastos` -- ALTER TABLE `gastos` MODIFY `id_gasto` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `mensualidad` -- ALTER TABLE `mensualidad` MODIFY `id_mensualidad` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `niveles` -- ALTER TABLE `niveles` MODIFY `id_nivel` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `novedades` -- ALTER TABLE `novedades` MODIFY `id_novedad` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `pagos` -- ALTER TABLE `pagos` MODIFY `id_pago` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `propietarios` -- ALTER TABLE `propietarios` MODIFY `id_propietario` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `proveedores` -- ALTER TABLE `proveedores` MODIFY `id_proveedor` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `usuarios` -- ALTER TABLE `usuarios` MODIFY `id_usuario` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `ut` -- ALTER TABLE `ut` MODIFY `id_ut` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `apartamentos` -- ALTER TABLE `apartamentos` ADD CONSTRAINT `apartamentos_ibfk_1` FOREIGN KEY (`id_alicuota`) REFERENCES `alicuotas` (`id_alicuota`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `auditorias` -- ALTER TABLE `auditorias` ADD CONSTRAINT `auditorias_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `contrato` -- ALTER TABLE `contrato` ADD CONSTRAINT `contrato_ibfk_1` FOREIGN KEY (`id_apartamento`) REFERENCES `apartamentos` (`id_apartamento`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `cxc` -- ALTER TABLE `cxc` ADD CONSTRAINT `cxc_ibfk_1` FOREIGN KEY (`id_apartamento`) REFERENCES `apartamentos` (`id_apartamento`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `cxc_has_pago` -- ALTER TABLE `cxc_has_pago` ADD CONSTRAINT `cxc_has_pago_ibfk_1` FOREIGN KEY (`id_cxc`) REFERENCES `cxc` (`id_cxc`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `detalle` -- ALTER TABLE `detalle` ADD CONSTRAINT `detalle_ibfk_1` FOREIGN KEY (`id_gasto`) REFERENCES `gastos` (`id_gasto`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `detalle_mensualidad` -- ALTER TABLE `detalle_mensualidad` ADD CONSTRAINT `detalle_mensualidad_ibfk_1` FOREIGN KEY (`id_mensualidad`) REFERENCES `mensualidad` (`id_mensualidad`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `gastos` -- ALTER TABLE `gastos` ADD CONSTRAINT `gastos_ibfk_1` FOREIGN KEY (`id_ut`) REFERENCES `ut` (`id_ut`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `novedades` -- ALTER TABLE `novedades` ADD CONSTRAINT `novedades_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `pagos` -- ALTER TABLE `pagos` ADD CONSTRAINT `pagos_ibfk_1` FOREIGN KEY (`id_apartamento`) REFERENCES `apartamentos` (`id_apartamento`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `usuarios` -- ALTER TABLE `usuarios` ADD CONSTRAINT `usuarios_ibfk_1` FOREIGN KEY (`id_nivel`) REFERENCES `niveles` (`id_nivel`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
CREATE DATABASE alunos; USE alunos; CREATE TABLE alunos ( codigo integer auto_increment primary key, nome varchar(45) not null, dataNasc date not null, curso varchar(60) ); insert into alunos(nome,dataNasc,curso) values ('Jenifernando','1997/05/09','Mecatronica'), ('Bertoldo','1962/01/19','Cacheta'), ('Claldio','2000/11/10','Eletroeletrônica'), ('Angelino','1959/07/03','Domino'), ('Pierre','1989/04/29','Música'), ('Lebdowsky','1993/07/03','Teatro'), ('Algusto','1999/09/12','Técnico em Mineração'); select * from alunos; drop table alunos;
-- database: presto; groups: tpch; tables: supplier,nation,partsupp,lineitem,part SELECT s_name, s_address FROM supplier, nation WHERE s_suppkey IN (SELECT ps_suppkey FROM partsupp WHERE ps_partkey IN (SELECT p_partkey FROM part WHERE p_name LIKE 'forest%') AND ps_availqty > (SELECT 0.5 * sum(l_quantity) FROM lineitem WHERE l_partkey = ps_partkey AND l_suppkey = ps_suppkey AND l_shipdate >= date ('1994-01-01') AND l_shipdate < date ('1994-01-01') + interval '1' YEAR ) ) AND s_nationkey = n_nationkey AND n_name = 'CANADA' ORDER BY s_name
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64) -- -- Host: 127.0.0.1 Database: enkidu_prod -- ------------------------------------------------------ -- 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 `bolsa_voluntario` -- DROP TABLE IF EXISTS `bolsa_voluntario`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bolsa_voluntario` ( `id` int(11) NOT NULL, `inicio_vigencia` datetime DEFAULT NULL, `percentual_desconto` double DEFAULT NULL, `termino_vigencia` datetime DEFAULT NULL, `voluntario_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FKsy77mm8a8h7ivo1kgx5d4f6in` (`voluntario_id`), CONSTRAINT `FKsy77mm8a8h7ivo1kgx5d4f6in` FOREIGN KEY (`voluntario_id`) REFERENCES `voluntario` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `bolsa_voluntario` -- LOCK TABLES `bolsa_voluntario` WRITE; /*!40000 ALTER TABLE `bolsa_voluntario` DISABLE KEYS */; INSERT INTO `bolsa_voluntario` VALUES (1,NULL,0.3,NULL,2),(2,NULL,0.3,NULL,3),(3,NULL,0.3,NULL,5),(5,NULL,0.25,NULL,26),(6,NULL,0.25,NULL,28),(7,NULL,0.6129,NULL,35),(38,NULL,0.166666667,NULL,8),(39,NULL,0.166666667,NULL,10),(40,NULL,0.166666667,NULL,12),(41,NULL,0.166666667,NULL,13),(42,NULL,0.166666667,NULL,14),(43,NULL,0.166666667,NULL,16),(44,NULL,0.166666667,NULL,19),(45,NULL,0.166666667,NULL,22),(46,NULL,0.166666667,NULL,26),(47,NULL,0.166666667,NULL,28),(48,NULL,0.166666667,NULL,29),(49,NULL,0.166666667,NULL,32),(50,NULL,0.166666667,NULL,34); /*!40000 ALTER TABLE `bolsa_voluntario` 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 2018-08-05 22:41:41
INSERT INTO users (id, name, age) VALUES (1, 'Finnebar', 17), (2, 'Bear', 6), (3, 'Iguana', 4), (4, 'Alex', 33), (5, 'Amanda', 24), (6, 'Sophie', 24), (7, 'Rosey', 9), (8, 'Victoria', 23), (9, 'Franz', 100), (10, 'Hermione', 30), (11, 'Voldemort', 90), (12, 'Marisa', 24), (13, 'Swizzle', 4), (14, 'Sirius', 36), (15, 'Albus', 113), (16, 'Squid', 5), (17, 'Whale', 6), (18, 'Pacha', 5), (19, 'Ena', 24), (20, 'Katie', 24); INSERT INTO projects (id, title, category, funding_goal, start_date, end_date) VALUES (1, 'Help me buy a guitar', 'music', 500.00, '2013-06-30', '2013-07-30'), (2, 'My book on SQL', 'books', 20.00, '2013-01-01', '2014-01-01'), (3, 'The next Harry Potter', 'books', 1000.00, '2013-05-30', '2015-05-30'), (4, 'Animal shelter needs dog food', 'charity', 400.00, '2013-03-14', '2013-06-30'), (5, 'Voldement needs a body', 'charity', 6000.00, '2013-03-20', '2013-09-20'), (6, 'The next Inna-Gadda-Davida', 'music', 200.00, '2014-12-30', '2015-12-30'), (7, 'Iguana needs tail operation', 'charity', 2000.00, '2013-10-02', '2013-10-30'), (8, 'I have bed bugs!', 'charity', 800.00, '2014-06-30', '2014-06-31'), (9, 'I want to teach English in China', 'charity', 3000.00, '2013-06-30', '2013-09-30'), (10, 'Help save birds of paradise', 'charity', 5000.00, '2012-03-20', '2013-06-30'); INSERT INTO pledges (id, amount, user_id, project_id) VALUES (1, 10.00, 1, 2), (2, 20.00, 1, 3), (3, 40.00, 1, 4), (4, 50.00, 2, 3), (5, 10.00, 3, 2), (6, 20.00, 4, 4), (7, 40.00, 5, 10), (8, 60.00, 6, 10), (9, 50.00, 7, 9), (10, 700.00, 8, 8), (11, 1000.00, 8, 7), (12, 40.00, 9, 6), (13, 50.00, 9, 3), (14, 50.00, 10, 4), (15, 24.00, 12, 1), (16, 34.00, 11, 1), (17, 12.00, 13, 6), (18, 19.00, 14, 5), (19, 20.00, 15, 5), (20, 40.00, 16, 6), (21, 35.50, 17, 7), (22, 40.00, 18, 8), (23, 60.00, 19, 9), (24, 70.00, 20, 10), (25, 100.00, 20, 4), (26, 40.00, 19, 1), (27, 20.00, 18, 6), (28, 90.00, 17, 9), (29, 230.00, 16, 6), (30, 450.00, 15, 5); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Boop 'N' Bop", "funtimes", 10000, "2018-02-15", "2019-01-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Food for the Homeless", "charity", 20000, "2018-02-01", "2018-12-24"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Destroy All the McDonald's", "charity", 2000000, "2018-02-01", "2020-04-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Exile Donald Trump to Mars", "charity", 2500000, "2018-03-01", "2020-03-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Make LEGOs Great Again", "fun charity", 1000000, "2018-02-05", "2019-12-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Eat Moar Plants", "activism", 500000, "2018-02-14", "2020-09-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Send Cats to Mars Colonists", "community service", 3000000, "2018-02-06", "2030-06-30"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("New Roads for Boston", "community service", 4000000, "2018-02-01", "2040-12-25"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Better Our Publich Schools", "community development", 2000000, "2018-04-21", "2020-09-01"); -- INSERT INTO projects (title, category, funding_goal, start_date, end_date) VALUES ("Replace Dunkin Donuts with Peet's Coffee", "community development", 5000000, "2018-05-05", "2027-07-04"); -- -- INSERT INTO users (name, age) VALUES ("John", 35); -- INSERT INTO users (name, age) VALUES ("Jacob", 41); -- INSERT INTO users (name, age) VALUES ("Jingleheimer", 83); -- INSERT INTO users (name, age) VALUES ("Schmitty", 11); -- INSERT INTO users (name, age) VALUES ("Patricia", 28); -- INSERT INTO users (name, age) VALUES ("Don", 49); -- INSERT INTO users (name, age) VALUES ("Pat", 21); -- INSERT INTO users (name, age) VALUES ("Melissa", 32); -- INSERT INTO users (name, age) VALUES ("Earl", 97); -- INSERT INTO users (name, age) VALUES ("St. Belvedere", 112); -- INSERT INTO users (name, age) VALUES ("Andy", 26); -- INSERT INTO users (name, age) VALUES ("Jesus", 1); -- INSERT INTO users (name, age) VALUES ("Voldemort", 125); -- INSERT INTO users (name, age) VALUES ("Martha", 53); -- INSERT INTO users (name, age) VALUES ("Judy", 34); -- INSERT INTO users (name, age) VALUES ("Northwest", 15); -- INSERT INTO users (name, age) VALUES ("Mike", 23); -- INSERT INTO users (name, age) VALUES ("Marie", 39); -- INSERT INTO users (name, age) VALUES ("Ethel", 91); -- INSERT INTO users (name, age) VALUES ("Chuck", 22); -- -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES (); -- INSERT INTO pledges (amount, user_id, project_id) VALUES ();
{\rtf1\ansi\ansicpg1252\cocoartf1343\cocoasubrtf140 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural \f0\fs24 \cf0 -- phpMyAdmin SQL Dump\ -- version 4.2.10\ -- http://www.phpmyadmin.net\ --\ -- Client : localhost:8889\ -- G\'e9n\'e9r\'e9 le : Mar 10 F\'e9vrier 2015 \'e0 14:38\ -- Version du serveur : 5.5.38\ -- Version de PHP : 5.6.2\ \ SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";\ SET time_zone = "+00:00";\ \ --\ -- Base de donn\'e9es : `zikon`\ --\ \ -- --------------------------------------------------------\ \ --\ -- Structure de la table `comptesutilisateurs`\ --\ \ CREATE TABLE `comptesutilisateurs` (\ `id` int(254) NOT NULL,\ `nom` varchar(15) NOT NULL,\ `prenom` varchar(15) NOT NULL,\ `login` varchar(15) NOT NULL,\ `password` varchar(15) NOT NULL\ ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;\ \ --\ -- Contenu de la table `comptesutilisateurs`\ --\ \ INSERT INTO `comptesutilisateurs` (`id`, `nom`, `prenom`, `login`, `password`) VALUES\ (1, 'a', 'a', 'a', '0'),\ (2, 'a', 'a', 'a', '0'),\ (3, 'h', 'g', 'g', '0'),\ (4, 'h', 'g', 'g', '0'),\ (5, 'h', 'g', 'g', '0'),\ (6, '', '', '', ''),\ (7, 'aazz', 'aazz', 'aazz', 'aazz'),\ (8, 'aazz', '', '', ''),\ (9, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (10, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (11, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (12, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (13, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (14, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (15, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (16, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (17, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (18, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (19, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (20, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (21, 'bradai', 'hazem', 'bradai.hazem@gm', 'isimsfaxA1'),\ (22, 'azeazegggg', 'azeaz', 'azeazeazaz', 'azeazeza'),\ (23, 'azeazegggg', 'azeaz', 'azeazeazaz', 'azeazeza');\ \ --\ -- Index pour les tables export\'e9es\ --\ \ --\ -- Index pour la table `comptesutilisateurs`\ --\ ALTER TABLE `comptesutilisateurs`\ ADD PRIMARY KEY (`id`);\ \ --\ -- AUTO_INCREMENT pour les tables export\'e9es\ --\ \ --\ -- AUTO_INCREMENT pour la table `comptesutilisateurs`\ --\ ALTER TABLE `comptesutilisateurs`\ MODIFY `id` int(254) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=24;}
drop table if exists category_max_staletime; create table category_max_staletime as( select s.cat_title, max(cast(p1.page_touched as date) - cast(p.page_touched as date)) as stale_time from (select cat_title ,row_number()over(order by cat_pages desc )as rn from category)s join categorylinks cl on s.cat_title=cl.cl_to join page p on cl.cl_from=p.page_id join pagelinks pl on p.page_id=pl.pl_from join page p1 on pl.pl_title=p1.page_title where s.rn<=10 and cast(p.page_touched as date)< cast(p1.page_touched as date) group by s.cat_title );
/* ################################################################################ Create shortcut views between various concepts for use in the REST API author: Dani Welter date: Nov 24th 2016 version: 2.2.0.013 ################################################################################ */ -------------------------------------------------------- -- Generate ASSOCIATION_SNP view -------------------------------------------------------- CREATE OR REPLACE VIEW ASSOCIATION_SNP_VIEW AS SELECT DISTINCT A.ID AS ASSOCIATION_ID, S.ID AS SNP_ID FROM ASSOCIATION A, ASSOCIATION_LOCUS AL, LOCUS_RISK_ALLELE LRA, RISK_ALLELE_SNP RAS, SINGLE_NUCLEOTIDE_POLYMORPHISM S WHERE AL.ASSOCIATION_ID = A.ID AND AL.LOCUS_ID=LRA.LOCUS_ID AND LRA.RISK_ALLELE_ID=RAS.RISK_ALLELE_ID AND S.ID = RAS.SNP_ID ORDER BY A.ID; -------------------------------------------------------- -- Generate ASSOCIATION_GENE view -------------------------------------------------------- CREATE OR REPLACE VIEW ASSOCIATION_GENE_VIEW AS SELECT DISTINCT A.ID AS ASSOCIATION_ID, G.ID AS GENE_ID FROM ASSOCIATION A, ASSOCIATION_LOCUS AL, LOCUS_RISK_ALLELE LRA, RISK_ALLELE_SNP RAS, GENOMIC_CONTEXT GC, GENE G WHERE AL.ASSOCIATION_ID = A.ID AND AL.LOCUS_ID=LRA.LOCUS_ID AND LRA.RISK_ALLELE_ID=RAS.RISK_ALLELE_ID AND GC.SNP_ID = RAS.SNP_ID AND G.ID = GC.GENE_ID ORDER BY A.ID; -------------------------------------------------------- -- Generate SNP_GENE view -------------------------------------------------------- CREATE OR REPLACE VIEW SNP_GENE_VIEW AS SELECT DISTINCT S.ID AS SNP_ID, G.ID AS GENE_ID FROM SINGLE_NUCLEOTIDE_POLYMORPHISM S, GENOMIC_CONTEXT GC, GENE G WHERE GC.SNP_ID = S.ID AND G.ID = GC.GENE_ID ORDER BY S.ID;
--INSERT INTO GRADO_ESTUDIOS(GRADO_ESTUDIOS_ID, DESCRIPCION) --VALUES (3, 'POSGRADO EN POTENCIA ELECTRICA'); --UPDATE PROFESOR_CARRERA --SET GRADO_MAX_ES_ID = 3 --WHERE PROFESOR_ID = 1; --SELECT * FROM GRADO_ESTUDIOS_HISTORICO; UPDATE CURSO SET CALIFICACION = 9 WHERE CURSO_ID = 1; SELECT * FROM bitacoraCalif;
drop procedure if exists DeleteUser; delimiter $$; create procedure DeleteUser( in intUserId int ) begin update users set statId = 0 where userId = intUserId; end;
/* Navicat MySQL Data Transfer Source Server : local Source Server Version : 50718 Source Host : localhost:3306 Source Database : czczl Target Server Type : MYSQL Target Server Version : 50718 File Encoding : 65001 Date: 2021-07-04 18:53:21 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for exam_item -- ---------------------------- DROP TABLE IF EXISTS `exam_item`; CREATE TABLE `exam_item` ( `id` bigint(20) unsigned NOT NULL, `stem` varchar(255) DEFAULT NULL COMMENT '题干', `material_id` bigint(20) DEFAULT NULL COMMENT '对应材料id', `stem_type` tinyint(1) DEFAULT NULL COMMENT '试题类型(选择判断填空123)', `choice_a` varchar(8) DEFAULT NULL, `choice_b` varchar(8) DEFAULT NULL, `choice_c` varchar(8) DEFAULT NULL, `choice_d` varchar(8) DEFAULT NULL, `choice_answer` varchar(8) DEFAULT NULL COMMENT '选择题答案', `judge_answer` varchar(8) DEFAULT NULL COMMENT '判断题答案', `fill_answer` varchar(8) DEFAULT NULL COMMENT '填空题答案', `create_time` datetime DEFAULT CURRENT_TIMESTAMP, `modify_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `is_delete` tinyint(1) unsigned zerofill NOT NULL COMMENT '逻辑删除 1为删除', `is_prize_raincoat` tinyint(1) DEFAULT NULL COMMENT '草鞋1还是蓑衣2', `choicea` varchar(255) DEFAULT NULL, `choiceb` varchar(255) DEFAULT NULL, `choicec` varchar(255) DEFAULT NULL, `choiced` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of exam_item -- ---------------------------- -- ---------------------------- -- Table structure for hibernate_sequence -- ---------------------------- DROP TABLE IF EXISTS `hibernate_sequence`; CREATE TABLE `hibernate_sequence` ( `next_val` bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records of hibernate_sequence -- ---------------------------- INSERT INTO `hibernate_sequence` VALUES ('3'); -- ---------------------------- -- Table structure for journey_point -- ---------------------------- DROP TABLE IF EXISTS `journey_point`; CREATE TABLE `journey_point` ( `id` bigint(20) NOT NULL, `name` varchar(32) DEFAULT NULL COMMENT '长征点的名字', `is_main` tinyint(3) unsigned DEFAULT NULL COMMENT '是否为主线 1是主线', `is_open` tinyint(3) unsigned DEFAULT NULL COMMENT '是否开放 1为开放', `parent_id` bigint(20) DEFAULT NULL COMMENT '如果是主线,为0;如果是支线,为从属主线的id', `id_delete` tinyint(1) unsigned zerofill DEFAULT NULL, `is_hidentask` tinyint(1) DEFAULT NULL COMMENT '是否有隐藏任务', `create_time` datetime DEFAULT NULL, `modify_time` datetime DEFAULT NULL, `is_delete` bit(1) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of journey_point -- ---------------------------- -- ---------------------------- -- Table structure for material -- ---------------------------- DROP TABLE IF EXISTS `material`; CREATE TABLE `material` ( `id` bigint(20) NOT NULL, `content` varchar(255) DEFAULT NULL, `journey_id` bigint(20) DEFAULT NULL COMMENT '长征点的id', `create_time` datetime DEFAULT CURRENT_TIMESTAMP, `modify_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `is_delete` tinyint(1) unsigned zerofill DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of material -- ---------------------------- -- ---------------------------- -- Table structure for question_record -- ---------------------------- DROP TABLE IF EXISTS `question_record`; CREATE TABLE `question_record` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) DEFAULT NULL, `point_id` bigint(20) DEFAULT NULL COMMENT '长征点', `question_id` bigint(20) DEFAULT NULL COMMENT '没用了,10道题目总共10个答案,怎么可能只有一个questionId呢', `is_answer` tinyint(1) DEFAULT NULL COMMENT '1是答题过', `q1` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q2` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q3` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q4` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q5` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q6` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q7` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q8` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q9` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `q10` tinyint(1) DEFAULT NULL COMMENT '1是正确的,0是错误的', `create_time` datetime DEFAULT CURRENT_TIMESTAMP, `modify_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `is_delete` tinyint(1) unsigned zerofill NOT NULL COMMENT '逻辑删除 1为删除', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of question_record -- ---------------------------- -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` bigint(20) unsigned NOT NULL, `university` varchar(32) DEFAULT NULL COMMENT '学校', `college` varchar(32) DEFAULT NULL COMMENT '学院', `major` varchar(32) DEFAULT NULL COMMENT '专业', `grade` varchar(255) DEFAULT NULL COMMENT '年级', `clazz` varchar(255) DEFAULT NULL COMMENT '班级', `name` varchar(32) DEFAULT NULL, `idcard` varchar(255) DEFAULT NULL, `stuno` varchar(255) DEFAULT NULL COMMENT '学号', `openid` varchar(255) DEFAULT NULL COMMENT '小程序openid', `score` int(11) DEFAULT NULL COMMENT '积分', `add_score` int(11) DEFAULT '0' COMMENT '入账积分', `sub_score` int(11) DEFAULT '0' COMMENT '出账积分', `step` int(11) DEFAULT '0' COMMENT '学习步骤', `shoe` int(11) DEFAULT '0' COMMENT '草鞋', `raincoat` int(11) DEFAULT '0' COMMENT '蓑衣', `create_time` datetime DEFAULT CURRENT_TIMESTAMP, `modify_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `is_delete` tinyint(1) unsigned zerofill NOT NULL COMMENT '逻辑删除 1为删除', `is_bind` tinyint(1) DEFAULT '0' COMMENT '是否绑定了学生信息。', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('2', null, null, null, null, null, null, null, null, 'oVibi5NLksGX7bZUr8y0oyIUVMLI', '60', '60', null, '0', null, null, null, null, '0', '0');
/* SQLyog Ultimate v12.09 (64 bit) MySQL - 5.5.62-0+deb8u1 : Database - arma3sql1 ********************************************************************* */ /*!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 */; /*Table structure for table `allowed_objects` */ DROP TABLE IF EXISTS `allowed_objects`; CREATE TABLE `allowed_objects` ( `id` int(11) NOT NULL AUTO_INCREMENT, `objectClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `objectType` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `objectAllowed` int(1) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `allowed_vehicles` */ DROP TABLE IF EXISTS `allowed_vehicles`; CREATE TABLE `allowed_vehicles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vehicleClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleType` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleAllowed` int(1) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `icons` */ DROP TABLE IF EXISTS `icons`; CREATE TABLE `icons` ( `iconID` int(11) NOT NULL AUTO_INCREMENT, `iconClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `iconImg` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`iconID`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `marker` */ DROP TABLE IF EXISTS `marker`; CREATE TABLE `marker` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `markerName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `markerDescription` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `markerDir` int(11) DEFAULT '0', `markerPos` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `mission_FK` int(3) DEFAULT NULL, KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `mission` */ DROP TABLE IF EXISTS `mission`; CREATE TABLE `mission` ( `id` int(11) NOT NULL AUTO_INCREMENT, `missionMap` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `missionName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `missionLoaded` datetime DEFAULT NULL, `defaultPos` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, UNIQUE KEY `id_2` (`id`), KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `objects` */ DROP TABLE IF EXISTS `objects`; CREATE TABLE `objects` ( `id` int(11) NOT NULL AUTO_INCREMENT, `objName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `objClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `objCategory` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `objInit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `objPos` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `objDir` char(3) COLLATE utf8_unicode_ci DEFAULT NULL, `objDamage` float DEFAULT NULL, `objRecDate` timestamp NULL DEFAULT NULL, `objInvItem` text COLLATE utf8_unicode_ci, `objInvBackpack` text COLLATE utf8_unicode_ci, `objInvMagazine` text COLLATE utf8_unicode_ci, `objInvWeapon` text COLLATE utf8_unicode_ci, `mission_FK` int(11) DEFAULT NULL, UNIQUE KEY `id_2` (`id`), KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `player` */ DROP TABLE IF EXISTS `player`; CREATE TABLE `player` ( `id` int(11) NOT NULL AUTO_INCREMENT, `playerUID` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `playerName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `playerRank` varchar(100) COLLATE utf8_unicode_ci DEFAULT 'vDSK_Schuetze', `playerAdmin` int(1) DEFAULT '0', `playerLastOnline` datetime DEFAULT NULL, UNIQUE KEY `playerUID` (`playerUID`), KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `player_mission_connection` */ DROP TABLE IF EXISTS `player_mission_connection`; CREATE TABLE `player_mission_connection` ( `id` int(11) NOT NULL AUTO_INCREMENT, `playerInv` text COLLATE utf8_unicode_ci NOT NULL, `playerPos` char(30) COLLATE utf8_unicode_ci NOT NULL, `playerDir` char(3) COLLATE utf8_unicode_ci NOT NULL, `mission_FK` int(11) DEFAULT NULL, `playerUID` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `playerLastOnline` char(19) COLLATE utf8_unicode_ci NOT NULL, UNIQUE KEY `playerMission` (`mission_FK`,`playerUID`), KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `ranks` */ DROP TABLE IF EXISTS `ranks`; CREATE TABLE `ranks` ( `r_id` int(5) unsigned NOT NULL AUTO_INCREMENT, `r_name` varchar(50) CHARACTER SET utf8 NOT NULL, `r_className` varchar(50) DEFAULT NULL, `r_short` varchar(10) CHARACTER SET utf8 NOT NULL, `r_order` int(4) NOT NULL, PRIMARY KEY (`r_id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*Table structure for table `test` */ DROP TABLE IF EXISTS `test`; CREATE TABLE `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `val` tinytext COLLATE utf8_unicode_ci, `rec_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `vehicles` */ DROP TABLE IF EXISTS `vehicles`; CREATE TABLE `vehicles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `vehicleName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleType` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleClass` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `vehiclePos` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleDir` char(3) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleDamage` float DEFAULT NULL, `vehicleHitpoints` text COLLATE utf8_unicode_ci, `vehicleFuel` float DEFAULT NULL, `vehicleInvItem` text COLLATE utf8_unicode_ci, `vehicleInvBackpack` text COLLATE utf8_unicode_ci, `vehicleInvMagazine` text COLLATE utf8_unicode_ci, `vehicleInvWeapon` text COLLATE utf8_unicode_ci, `vehicleInvExt` text COLLATE utf8_unicode_ci, `vehicleLastDriver` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `vehicleLastRide` timestamp NULL DEFAULT NULL, `vehicleCrew` int(1) DEFAULT '0', `rec_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `mission_FK` int(3) DEFAULT NULL, UNIQUE KEY `id_2` (`id`), KEY `id` (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `wi_inventory_templates` */ DROP TABLE IF EXISTS `wi_inventory_templates`; CREATE TABLE `wi_inventory_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `invName` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `invItem` text COLLATE utf8_unicode_ci, `invBackpack` text COLLATE utf8_unicode_ci, `invMagazine` text COLLATE utf8_unicode_ci, `invWeapon` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `wi_reqobj` */ DROP TABLE IF EXISTS `wi_reqobj`; CREATE TABLE `wi_reqobj` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ro_class` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `ro_type` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'just to sort in the webinterface (V = vehicle, S = Supply, O = Object)', `ro_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `ro_requestable` int(1) DEFAULT '1', `ro_reqTime` int(5) DEFAULT '24', `ro_blockRadius` int(3) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `wi_request` */ DROP TABLE IF EXISTS `wi_request`; CREATE TABLE `wi_request` ( `r_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `r_user` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `r_type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `r_template_id` int(11) DEFAULT '0', `r_reqdate` datetime DEFAULT NULL, `r_dateapproved` datetime DEFAULT NULL, `r_date` datetime DEFAULT NULL, `r_pos` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `r_marker_id` int(11) DEFAULT NULL, `r_object_id` int(11) DEFAULT NULL, `r_status` int(1) DEFAULT '0', `r_mission` int(11) DEFAULT NULL, `r_remarks` text COLLATE utf8_unicode_ci, `r_comments` text COLLATE utf8_unicode_ci, `r_apprperson` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`r_id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*Table structure for table `wi_user` */ DROP TABLE IF EXISTS `wi_user`; CREATE TABLE `wi_user` ( `u_id` int(5) unsigned NOT NULL AUTO_INCREMENT, `u_A3UID` varchar(20) DEFAULT NULL, `u_name` varchar(50) CHARACTER SET utf8 NOT NULL, `u_pwd` varchar(255) CHARACTER SET utf8 NOT NULL, `u_access` varchar(255) DEFAULT NULL, `u_lastlogin` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`u_id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*!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 */;
ALTER TABLE note_user ADD COLUMN pass_hash VARCHAR(126); ALTER TABLE note_user ADD COLUMN email VARCHAR(36); ALTER TABLE note_user ADD COLUMN user_name VARCHAR(36); CREATE TABLE IF NOT EXISTS sessions ( id SERIAL PRIMARY KEY, user_id INT, refresh_hash VARCHAR(64), created TIMESTAMP, refresh_uses INT, voided BOOLEAN, CONSTRAINT fk_session_user FOREIGN KEY (user_id) REFERENCES note_user (id) );
USE academia; DROP TABLE IF EXISTS actores; DROP TABLE IF EXISTS tipo_documento; DROP TABLE IF EXISTS tipo_actores; DROP TABLE IF EXISTS estado_actores; DROP TABLE IF EXISTS modulos; CREATE TABLE tipo_documento( codigo VARCHAR(3) PRIMARY KEY, descripcion VARCHAR(100) NOT NULL ); CREATE TABLE tipo_actores( id INT(5) UNSIGNED AUTO_INCREMENT, perfil VARCHAR(100), PRIMARY KEY(id) ); -- Insertar informacion en tipo_actores INSERT INTO tipo_actores VALUES(1,'Alumno'); INSERT INTO tipo_actores(perfil) VALUES('Docente'); -- Insertar unicamente a columnas expecificas INSERT INTO tipo_actores(perfil) VALUES ('Cordinador'),('Rector'); -- Insertar valores multiples -- Actualizar un registro UPDATE tipo_actores SET perfil = 'Estudiante' WHERE id = 1; UPDATE tipo_actores SET perfil = 'Estudiante' WHERE id IN (1,2,3); -- Se transfiere el valor a los registros expecificados -- Eliminar un registro de la tabla DELETE FROM tipo_actores WHERE id = 1; -- Elimina el registro 1 DELETE FROM tipo_actores; -- Elimina todos los registros TRUNCATE tipo_actores; -- Resetea la tabla completamente SELECT perfil FROM tipo_actores; SELECT id FROM tipo_actores; SELECT * FROM tipo_actores; SELECT perfil, id, NOW() FROM tipo_actores; -- Fin insertar informacion en tipo_actores CREATE TABLE estado_actores( id INTEGER(5) UNSIGNED PRIMARY KEY AUTO_INCREMENT, estado VARCHAR(30) ) ENGINE = INNODB; CREATE TABLE modulos( id INT(5), modulo VARCHAR(255), mo VARCHAR(10) ) ENGINE = INNODB; ALTER TABLE modulos ADD PRIMARY KEY(id); ALTER TABLE modulos DROP COLUMN mo; ALTER TABLE modulos ADD COLUMN `mod` VARCHAR(10); CREATE TABLE actores( id INT(5) UNSIGNED PRIMARY KEY AUTO_INCREMENT, documento VARCHAR(20) NOT NULL UNIQUE, tipo_documento VARCHAR(3) NOT NULL, nombres VARCHAR(255), apellidos VARCHAR(255), contrasena VARCHAR(100) NOT NULL, correo VARCHAR(255) NOT NULL DEFAULT 'correo@dominio.com', telefono_celular VARCHAR(30) COMMENT 'Telefono celular del estudiante', numero_expediente VARCHAR(255) NOT NULL UNIQUE, genero ENUM('hombre','mujer') NOT NULL, fecha_nacimiento DATE NOT NULL, -- DEFAULT NOW() estado_actor_id INT(5) UNSIGNED, institucion_id INT(5), tipo_actor_id INT(5) UNSIGNED, fecha_creacion TIMESTAMP DEFAULT CURRENT_TIMESTAMP, fecha_actualizacion TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FOREIGN KEY (`tipo_actor_id`) REFERENCES `tipo_actores` (`id`) ) ENGINE=INNODB; ALTER TABLE actores ADD CONSTRAINT `fk_estado_actor` FOREIGN KEY (`estado_actor_id`) REFERENCES `estado_actores` (`id`) ON DELETE RESTRICT -- Restringe la eliminacion en la relacion ON UPDATE CASCADE; -- Si se actualiza automaticamente se actualiza en la tabla de la relacion
INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (41,'DHL',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (43,'UPS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (44,'OnTheRoad Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (45,'Jane transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (51,'JP Enterprises',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (52,'Customer Pickup',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (61,'Maritime',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (62,'National Fast Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (63,'SCP Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (64,'Clarke Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (65,'Apex',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (66,'Day & Ross',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (67,'Fedex',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (70,'Purolator',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (71,'BW Wood',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (73,'Sameday',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (74,'Cam Cartage',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (77,'Cormakye',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (78,'K-W Messenger Service',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (84,'Just Rush',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (107,'Roadway',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (108,'Epic Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (109,'Cardinal',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (110,'Robert Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (111,'Vitran',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (112,'Thibodeau',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (113,'C&D Logistics',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (117,'ADK',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (122,'Dave''s Van',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (123,'Canada Post',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (124,'Grand Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (126,'Tiger',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (127,'Best Choice',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (128,'Key International',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (129,'Midland Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (131,'Remco',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (132,'Manitoulin Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (135,'Kindersley',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (136,'Rosedale Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (137,'Kingsway PPD',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (138,'Centre Line Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (140,'Cavalier',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (141,'Apps Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (143,'Pinacle Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (144,'Current ',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (145,'ABF',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (146,'Cabano Kingsway',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (147,'Select Daily',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (148,'CanPar',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (149,'Bouiret',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (150,'Canadian Freight Ways',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (151,'All Connect Logistics',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (153,'Concord Logistics',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (154,'DHL Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (156,'Tripp Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (157,'TST Overland',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (158,'Drapeau Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (159,'FastFrate',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (160,'Slade Cartage',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (161,'Mckevitt Trucking',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (162,'Bourrett Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (163,'Mainliner',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (164,'Ace Group',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (166,'Bestway',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (167,'NACC',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (168,'Purolator Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (169,'Purolator Express 10:30AM',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (170,'UPS Expedited',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (171,'UPS Early AM',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (172,'UPS Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (173,'Dicom',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (174,'Dynamex',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (175,'Nolan',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (177,'Four Points Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (179,'Zale Van',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (181,'Midland Courier',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (182,'Western Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (184,'YRC',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (185,'QRC',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (186,'Trans Provincial',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (188,'Nimble Transportation',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (189,'Armbro Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (191,'PLS Logistics',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (193,'Speedy',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (194,'BROWN TRANSPORTATION SOLUTIONS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (195,'Consolidated Fast Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (198,'Little Guys Del Service',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (201,'USPS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (202,'DTC',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (203,'Overland West',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (207,'Kingsway Collect',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (208,'Century Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (209,'Hepta Run',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (210,'Fast Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (211,'LD Logistics',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (212,'TQS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (213,'Trans X',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (214,'Loomis',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (215,'Bourassa',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (216,'UPS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (217,'Tango',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (218,'Quik X',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (219,'Erb Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (220,'Enviro-eze Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (221,'GoJit',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (222,'Select Thibodeau',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (223,'Kingsway',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (224,'Provoost Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (225,'Recurring Tuesday pick-up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (226,'Recurring Monday pick-up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (227,'Recurring Friday pick-up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (228,'AIT',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (229,'FEDEX FREIGHT ECONOMY',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (230,'Fleet Engineers',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (231,'Recurring Thursday pick-up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (232,'Recurring Wednesday pick-up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (233,'Epic Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (234,'Wolverine',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (235,'USPS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (236,'Customer Pick Up',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (237,'Central Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (238,'Roadrunner',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (239,'Estes Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (240,'BTS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (241,'CH ROBINSON',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (242,'PRONTO',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (243,'CONWAY',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (244,'R & L CARRIERS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (245,'WHITEHEAD',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (246,'SAIA',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (247,'BEAVER EXPRESS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (248,'OTHER',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (249,'VOCAR',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (250,'DAVID MCDONALD',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (251,'C & M',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (252,'HOTLINE',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (253,'FedEx',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (254,'WILL CALL',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (255,'3 PL Third Party Bill',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (256,'Modani',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (257,'EDC MOVING SYSTEMS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (258,'Steinman',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (259,'Central Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (260,'Steinman Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (261,'DELIVERY',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (262,'MEYERS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (263,'AAA COOPER',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (264,'SEFL',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (265,'OLD DOMINION',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (266,'ACI MOTOR FREIGHT',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (267,'CHASE COURIERS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (268,'TEXAS EXPRESS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (269,'DFW EXPRESS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (270,'KAIDEX',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (271,'ACI',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (272,'ECHO LOGISTICS',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (273,'All Ontario Express',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (274,'PASHA ENTERPRISE',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (275,'ETL TRANSPORT',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (276,'BELL CARTAGE',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (277,'DICOM',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (278,'Morneau',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (279,'Golden State Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (280,'Rosedale',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (281,'Milgram Freight',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (282,'Total',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (283,'Enviro EZE Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (284,'3 PL',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP)); INSERT INTO "carrier" (id, "name", active, created_at, updated_at) VALUES (285,'Meyers Transport',true, date_trunc('second', LOCALTIMESTAMP), date_trunc('second', LOCALTIMESTAMP));
runscript from '1994-census-summary.sql'; -- Below each question, fill in your SQL, remembering to use 'limit 10' -- at the end of each line. -- I have provided the answer for question 1 so that you can see what I want. -- 1. show the age of the males in the data set ; select age from census where sex='Male' limit 10; --> 39 --> 50 --> 38 --> 53 --> 52 --> 42 --> 37 --> 30 --> 32 --> 40 ; -- 2. show all columns for the people with a usid between 100 and 120 ; Select * from census where usid > 99 and usid < 120 limit 10; --> 100 32 Federal_gov 249409 HS_grad 9 Never_married Other_service Own_child Black Male 0 0 40 United_States <=50K --> 101 76 Private 124191 Masters 14 Married_civ_spouse Exec_managerial Husband White Male 0 0 40 United_States >50K --> 102 44 Private 198282 Bachelors 13 Married_civ_spouse Exec_managerial Husband White Male 15024 0 60 United_States >50K --> 103 47 Self_emp_not_inc 149116 Masters 14 Never_married Prof_specialty Not_in_family White Female 0 0 50 United_States <=50K --> 104 20 Private 188300 Some_college 10 Never_married Tech_support Own_child White Female 0 0 40 United_States <=50K --> 105 29 Private 103432 HS_grad 9 Never_married Craft_repair Not_in_family White Male 0 0 40 United_States <=50K --> 106 32 Self_emp_inc 317660 HS_grad 9 Married_civ_spouse Craft_repair Husband White Male 7688 0 40 United_States >50K --> 107 17 NA 304873 10th 6 Never_married NA Own_child White Female 34095 0 32 United_States <=50K --> 108 30 Private 194901 11th 7 Never_married Handlers_cleaners Own_child White Male 0 0 40 United_States <=50K --> 109 31 Local_gov 189265 HS_grad 9 Never_married Adm_clerical Not_in_family White Female 0 0 40 United_States <=50K ; -- 3. show the workclass and education of people under 20 ; select workclass, education from census where age < 20 limit 10; --> Private HS_grad --> Private HS_grad --> Private HS_grad --> Private Some_college --> Private 11th --> Private HS_grad --> NA 10th --> Private Some_college --> Private Some_college --> Private 11th ; -- 4. show all columns for people over 80 ; select * from census where age > 80 limit 10; --> 223 90 Private 51744 HS_grad 9 Never_married Other_service Not_in_family Black Male 0 2206 40 United_States <=50K --> 919 81 Self_emp_not_inc 136063 HS_grad 9 Married_civ_spouse Exec_managerial Husband White Male 0 0 30 United_States <=50K --> 1041 90 Private 137018 HS_grad 9 Never_married Other_service Not_in_family White Female 0 0 40 United_States <=50K --> 1169 88 Self_emp_not_inc 206291 Prof_school 15 Married_civ_spouse Prof_specialty Husband White Male 0 0 40 United_States <=50K --> 1936 90 Private 221832 Bachelors 13 Married_civ_spouse Exec_managerial Husband White Male 0 0 45 United_States <=50K --> 2304 90 Private 52386 Some_college 10 Never_married Other_service Not_in_family Asian_Pac_Islander Male 0 0 35 United_States <=50K --> 2892 90 Private 171956 Some_college 10 Separated Adm_clerical Own_child White Female 0 0 40 Puerto_Rico <=50K --> 2907 81 Private 114670 9th 5 Widowed Priv_house_serv Not_in_family Black Female 2062 0 5 United_States <=50K --> 3212 82 NA 29441 7th_8th 4 Widowed NA Not_in_family White Male 0 0 5 United_States <=50K --> 3538 81 Self_emp_not_inc 137018 HS_grad 9 Widowed Adm_clerical Not_in_family White Female 0 0 20 United_States <=50K ; -- 5. show the sex of people who are over 80 and have never married ; select sex from census where age > 80 and marital_status = 'Never_married' limit 10; --> Male --> Female --> Male --> Male --> Male --> Female --> Male --> Male --> Female --> Male ; -- 6. show the number of years of education for people having education of 'Some_college' ; select education_num from census where education = 'Some_college' limit 10; --> 10 --> 10 --> 10 --> 10 --> 10 --> 10 --> 10 --> 10 --> 10 --> 10 ; -- 7. show the age, sex, years of education, and capital gains of people with capital gains > 10000 ; select age, sex, education_num, capital_gain from census where capital_gain > 1000 limit 10; --> 31 Female 14 14084 --> 44 Female 9 14344 --> 44 Male 13 15024 --> 17 Female 6 34095 --> 40 Female 14 14084 --> 58 Female 9 15024 --> 57 Male 14 15024 --> 46 Male 16 15024 --> 38 Male 13 15024 --> 38 Male 13 15024 ; -- 8. show the sex, age, and marital status for people in the armed forces ; select sex, age, marital_status from census where occupation = 'Armed_Forces' limit 10; --> Male 24 Never_married --> Male 29 Never_married --> Male 39 Never_married --> Male 24 Never_married --> Male 34 Married_civ_spouse --> Male 23 Never_married --> Male 30 Married_civ_spouse --> Male 46 Married_civ_spouse --> Male 23 Never_married ; -- 9. show the number of years of education for people over 40 years old who are in the armed forces ; select education_num from census where age > 40 and occupation = 'Armed_Forces' limit 10; --> 14 ; -- 10. show the marital status of people of age 50 with relationship 'Not_in_family' ; select merital_status from census where age = 50 and relationship = 'Not_in_family' limit 10; --> Divorced --> Divorced --> Divorced --> Divorced --> Separated --> Divorced --> Divorced --> Divorced --> Divorced --> Never_married ; -- 11. show all columns for 17 year olds with less than 5 years of education ; select * from census where age = 17 and education_num < 5 limit 10; --> 336 17 Private 270942 5th_6th 3 Never_married Other_service Other_relative White Male 0 0 48 Mexico <=50K --> 9972 17 Private 168807 7th_8th 4 Never_married Craft_repair Not_in_family White Male 0 0 45 United_States <=50K --> 17475 17 Private 168203 7th_8th 4 Never_married Farming_fishing Other_relative Other Male 0 0 40 Mexico <=50K --> 28771 17 Private 46402 7th_8th 4 Never_married Sales Own_child White Male 0 0 8 United_States <=50K ; -- 12. show the occupation of women under the age of 40 with a Doctorate degree ; select occupation from census where sex = 'Female' and age < 40 and education = 'Doctorate' limit 10; --> Prof_specialty --> Prof_specialty --> Prof_specialty --> Exec_managerial --> Tech_support --> Adm_clerical --> Prof_specialty --> Prof_specialty --> Prof_specialty --> Prof_specialty ; -- 13. show the workclass of people under the age of 25 with a Masters degree ; select workclass from census where age < 25 and education = 'Masters' limit 10; --> Private --> State_gov --> State_gov --> Private --> Private --> Local_gov --> Private --> State_gov --> Private --> Private ; -- 14. show all columns for people under the age of 21 with a Masters degree ; select * from census where age < 21 and education = 'Masters' limit 10; --> 12184 18 Local_gov 155905 Masters 14 Never_married Prof_specialty Own_child White Female 0 0 60 United_States <=50K --> 31053 20 Private 190227 Masters 14 Never_married Exec_managerial Own_child White Male 0 0 25 United_States <=50K ; -- 15. show the age of females with either a bachelors or a masters degree ; select age from census where sex = 'Female' and (education = 'Masters' or education = 'Bachelors') limit 10; --> 28 --> 37 --> 31 --> 23 --> 43 --> 44 --> 31 --> 47 --> 47 --> 33 ;
CREATE TABLE "SCCTOOLS"."TMP_PARCELA_CESSAO2" ( "PARCELA_CED_COD_EMP" CHAR(2), "PARCELA_CED_CONTRATO" VARCHAR2(9), "PARCELA_CED_PARCELA" NUMBER(3,0), "PARCELA_CED_CONTRATO_CESSAO" CHAR(9), "PARCELA_CED_PARCELA_CESSAO" NUMBER, "PARCELA_CED_NUM_SEQ_CESSAO" NUMBER, "PARCELA_CED_DT_CESSAO" DATE, "PARCELA_CED_ST_CESSAO" CHAR(1), "PARCELA_CED_ST_TIPO_CESSAO" CHAR(1), "PARCELA_CED_DT_VCT" DATE, "PARCELA_CED_VAL_PRT" NUMBER(14,5), "PARCELA_CED_STATUS_PARCELA" CHAR(1), "PARCELA_CED_DT_RCB" DATE, "PARCELA_CED_VAL_DESCONTO" NUMBER(20,5), "PARCELA_CED_VAL_MULTA" NUMBER(20,5), "PARCELA_CED_VAL_DIF_RCB" NUMBER(20,5), "PARCELA_CED_DT_REABP" DATE, "PARCELA_CED_DT_REPASSE" DATE, "PARCELA_CED_COD_BCO_RCB" VARCHAR2(3), "PARCELA_CED_COD_AGENCIA_RCB" VARCHAR2(9), "CONTRATO_CED_STATUS_CONTRATO" CHAR(1), "CONTRATO_CED_CPF_CGC" VARCHAR2(14), "CONTRATO_CED_VAL_RETEN" NUMBER(14,5), "CONTRATO_CED_TX_FIN" NUMBER(14,6), "PARCELA_ADQ_COD_EMP" CHAR(2), "PARCELA_ADQ_DT_VCT" DATE, "PARCELA_ADQ_VAL_PRT" NUMBER(14,5), "PARCELA_ADQ_STATUS_PARCELA" CHAR(1), "PARCELA_ADQ_DT_RCB" DATE, "PARCELA_ADQ_VAL_DESCONTO" NUMBER(20,5), "PARCELA_ADQ_VAL_MULTA" NUMBER(20,5), "PARCELA_ADQ_VAL_DIF_RCB" NUMBER(20,5), "PARCELA_ADQ_DT_CESSAO" DATE, "PARCELA_ADQ_DT_REABP" DATE, "PARCELA_ADQ_DT_REPASSE" DATE, "CONTRATO_ADQ_STATUS_CONTRATO" CHAR(1), "CONTRATO_ADQ_CPF_CGC" VARCHAR2(14), "CONTRATO_ADQ_VAL_RETEN" NUMBER(14,5), "CONTRATO_ADQ_TX_FIN" NUMBER(14,6), "NEXISTECONTRATO2" NUMBER, "NEXISTECESSAODECESSAO" NUMBER, "NEXISTEPRCABERTOLOTE" NUMBER, "NEXISTERECEBADQ" NUMBER, "NUM_IDENT" NUMBER(30,0) ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT) TABLESPACE "PARCELA_CESSAO" PARTITION BY LIST ("PARCELA_CED_COD_EMP") (PARTITION "CED_COD_EMP_47" VALUES ('47') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_55" VALUES ('55') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_99" VALUES ('99') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_04" VALUES ('04') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_45" VALUES ('45') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_73" VALUES ('73') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_86" VALUES ('86') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_58" VALUES ('58') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_61" VALUES ('61') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_50" VALUES ('50') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_93" VALUES ('93') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_97" VALUES ('97') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_00" VALUES ('00') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_48" VALUES ('48') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_75" VALUES ('75') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_71" VALUES ('71') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_87" VALUES ('87') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_72" VALUES ('72') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_01" VALUES ('01') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_82" VALUES ('82') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_81" VALUES ('81') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_88" VALUES ('88') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_89" VALUES ('89') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_21" VALUES ('21') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_95" VALUES ('95') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_94" VALUES ('94') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_59" VALUES ('59') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_66" VALUES ('66') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_78" VALUES ('78') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_83" VALUES ('83') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_49" VALUES ('49') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_77" VALUES ('77') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_44" VALUES ('44') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_20" VALUES ('20') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_22" VALUES ('22') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_19" VALUES ('19') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_63" VALUES ('63') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_76" VALUES ('76') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_69" VALUES ('69') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_67" VALUES ('67') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_03" VALUES ('03') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_02" VALUES ('02') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_92" VALUES ('92') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_98" VALUES ('98') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_42" VALUES ('42') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_43" VALUES ('43') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_56" VALUES ('56') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_39" VALUES ('39') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_74" VALUES ('74') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_51" VALUES ('51') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_80" VALUES ('80') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_91" VALUES ('91') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_84" VALUES ('84') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_85" VALUES ('85') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_52" VALUES ('52') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_46" VALUES ('46') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_38" VALUES ('38') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_90" VALUES ('90') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_64" VALUES ('64') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_41" VALUES ('41') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_40" VALUES ('40') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_70" VALUES ('70') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_79" VALUES ('79') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_60" VALUES ('60') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_57" VALUES ('57') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_65" VALUES ('65') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_53" VALUES ('53') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_62" VALUES ('62') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_96" VALUES ('96') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_68" VALUES ('68') PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS , PARTITION "CED_COD_EMP_VARIOS" VALUES (default) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT 8388608 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CONTRATO" NOCOMPRESS ) ; GRANT ALTER ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT DELETE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT INDEX ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT INSERT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT SELECT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT UPDATE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT REFERENCES ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT ON COMMIT REFRESH ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT QUERY REWRITE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT DEBUG ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT FLASHBACK ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCJUN"; GRANT DELETE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCTOOLS_JOBS"; GRANT INSERT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCTOOLS_JOBS"; GRANT SELECT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCTOOLS_JOBS"; GRANT UPDATE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "SCCTOOLS_JOBS"; GRANT SELECT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "RL_SUPORTE_TI"; GRANT DELETE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "RL_SUPORTE_TI_DML"; GRANT INSERT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "RL_SUPORTE_TI_DML"; GRANT UPDATE ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "RL_SUPORTE_TI_DML"; GRANT SELECT ON "SCCTOOLS"."TMP_PARCELA_CESSAO2" TO "LK_TOOLS_BACEN";
SELECT DISTINCT CITY FROM STATION WHERE NOT CITY REGEXP '[aeiou]$';
create unique index UIDX_BDG_BDG_CLE_KEY on BDG (ID_BDG, B_CLE) ; create index idx_cdt_sel11_em_addr on cdt (sel11_em_addr) ; create index idx_cdt_prv12_em_addr on cdt (prv12_em_addr) ; create unique index UIDX_CRTSERIE_KEY on CRTSERIE (ID_CRT_SERIE, NUM_CRT_SERIE, VAL_CRT_SERIE) ; create unique index UIDX_DIS_G_CLE_KEY on DIS (D_CLE) ; create unique index UIDX_DVS_DVS_CLE_KEY on DVS (DVS_CLE) ; create unique index UIDX_EXO_EXO_CLE_KEY on EXO (EXO_CLE) ; create unique index UIDX_FAM_F_CLE_KEY on FAM (F_CLE); create unique index UIDX_FORM_ETAT_CLE_KEY on FORM (ID_ETAT, CLE_ETAT); create unique index UIDX_GEO_G_CLE_KEY on GEO (G_CLE); create unique index UIDX_MAIL_INFO_KEY on MAIL_INFO (ID_TEMPLATE, CLE_TEMPLATE); create unique index UIDX_NCT_NOM_CT_KEY on NCT (ID_CT, NUM_CT, NOM); create unique index UIDX_OPTION_PARAM_KEY on OPTION_PARAM (ID_OPTION, CLE_OPTION); create unique index UIDX_PROFIL_PROFIL_CLE_KEY on PROFIL (PROFIL_CLE); create unique index UIDX_PRV_PRV_CLE_KEY on PRV (PRV_CLE); create index idx_prvsel_prv_sel on prvsel (prv15_em_addr,sel16_em_addr); create unique index UIDX_PVT_PVT_CLE_KEY on PVT (PVT_CLE); create index idx_pvt_fam4_em_addr on pvt (fam4_em_addr); create index idx_pvt_geo5_em_addr on pvt (geo5_em_addr); create index idx_pvt_dis6_em_addr on pvt (dis6_em_addr); create unique index UIDX_RMS_RMS_CLE_KEY on RMS (RMS_CLE); alter table rsp add constraint uidx_rsp_sel_pvt unique (SEL13_EM_ADDR,PVT14_EM_ADDR); create unique index UIDX_SCL_SCL_CLE_KEY on SCL (SCL_CLE); create unique index UIDX_PVT_SEL_DBG_KEY on SEL (SEL_BUD, SEL_CLE); create unique index UIDX_SEL_SEL_CLE_KEY on SEL (SEL_CLE); create unique index UIDX_SERIE_SUPPLIER_KEY on SERIE_SUPPLIER (PRO_CLE, GEO_CLE, DIS_CLE); create unique index UIDX_SETUPTYPE_PVT_CLE_KEY on SETUPTYPE (SETUP_CLE); create unique index UIDX_SYSMESSAGE_KEY on SYSMESSAGE (CODE_LANGUE, MESSAGE_ID); create unique index UIDX_TRF_TRF_CLE_KEY on TRF (TRF_CLE); create unique index UIDX_USER_ID_USER_KEY on USER_ (ID_USER); create unique index UIDX_USER_USER_CLE_KEY on USER_ (USER_CLE); create unique index UIDX_VCT_VAL_CT_KEY on VCT (ID_CRT, NUM_CRT, VAL); create UNIQUE index uidx_pvt_pro_geo_dis_key on pvt (adr_pro ,adr_geo ,adr_dis ); create UNIQUE index uidx_supplier_adr_fils_bdg_key on supplier (id_supplier ,pere_bdg,fils_bdg ); create index idx_prvsel_prv on prvsel (prv15_em_addr); create index idx_prvsel_sel on prvsel (sel16_em_addr); create index idx_prb_rbp22_annee on prb(rbp22_em_addr,annee_prv); create index idx_rbp_sel21_numprv on rbp(sel21_em_addr,num_prv); create index idx_BDGK_MOD on MOD (NUM_MOD, BDG30_EM_ADDR); create index idx_aggruleid_ids_nodeid on aggregatenode_fullid(aggregationid,aggregatefullid,aggregatenodeid); create index idx_rpd_pvt17_em_addr on rpd(pvt17_em_addr); create index idx_rpd_pvtserisno on rpd(pvt17_em_addr,num_serie); create index idx_rbp_sel21_en_addr on rbp(sel21_em_addr); create index IDX_DON_RPD18_EM_ADDR on DON (RPD18_EM_ADDR); create index idx_RFC_DIS on RFC (DIS9_EM_ADDR); create index idx_RFC_FAM on RFC (FAM7_EM_ADDR); create index idx_RFC_GEO on RFC (GEO8_EM_ADDR); create index idx_prvselpvt_prvid on prvselpvt(prvid);
ALTER TABLE GameRankings ADD CONSTRAINT FK_GameRankings_GameId FOREIGN KEY (GameId) REFERENCES Games(GameId) ;
SELECT * FROM modeanalytics.sessions
USE `tienda`; -- Creación de la tabla para el cliente CREATE TABLE IF NOT EXISTS `Cliente` ( `IdCliente` INT UNSIGNED NOT NULL AUTO_INCREMENT, `Nombre` VARCHAR(50), `Apellido1` VARCHAR(50), `Apellido2` VARCHAR(50), `RFC` VARCHAR(50), PRIMARY KEY `pk_IdCliente`(`IdCliente`) ) ENGINE = InnoDB; -- Creación de la tabla para el inventario CREATE TABLE IF NOT EXISTS `Inventario` ( `IdProducto` INT UNSIGNED NOT NULL AUTO_INCREMENT, `Nombre` VARCHAR(50), `Descripcion` VARCHAR(50), `PrecioVenta` DOUBLE, `Stock` BOOLEAN, PRIMARY KEY `pk_IdProducto`(`IdProducto`) ) ENGINE = InnoDB; -- Creación de la tabla para Venta CREATE TABLE IF NOT EXISTS `Venta` ( `IdVenta` INT UNSIGNED NOT NULL AUTO_INCREMENT, `Fecha` DATE, IdCliente INT UNSIGNED NOT NULL, PRIMARY KEY `pk_IdVenta`(`IdVenta`), FOREIGN KEY (IdCliente) REFERENCES Cliente(IdCliente) ) ENGINE = InnoDB; -- Creación de la tabla para el Proveedor CREATE TABLE IF NOT EXISTS `Proveedor` ( `IdProveedor` INT UNSIGNED NOT NULL AUTO_INCREMENT, `Nombre` VARCHAR(50), `Calle` VARCHAR(50), `Numero` VARCHAR(50), `Colonia` VARCHAR(50), `CodigoPostal` VARCHAR(50), `RFC` VARCHAR(50), PRIMARY KEY `pk_IdProveedor`(`IdProveedor`) ) ENGINE = InnoDB; -- Creación de la tabla de Venta-Inventario CREATE TABLE IF NOT EXISTS `VentaInventario` ( `Cantidad` INT NOT NULL, `PrecioVentaUnitario` DOUBLE NOT NULL, `IdVenta` INT UNSIGNED NOT NULL, `IdProducto` INT UNSIGNED NOT NULL, FOREIGN KEY (IdVenta) REFERENCES Venta(IdVenta), FOREIGN KEY (IdProducto) REFERENCES Inventario(IdProducto) ) ENGINE = InnoDB; -- Creción de la tabla para la compra CREATE TABLE IF NOT EXISTS `Compra` ( `IdCompra` INT UNSIGNED NOT NULL AUTO_INCREMENT, `IdProveedor` INT UNSIGNED NOT NULL, PRIMARY KEY `pk_IdCompra`(`IdCompra`), FOREIGN KEY (IdProveedor) REFERENCES Proveedor(IdProveedor) ) ENGINE = InnoDB; -- Creación de la tabla para CompraInventario CREATE TABLE IF NOT EXISTS `CompraInventario` ( `IdCompra` INT UNSIGNED NOT NULL AUTO_INCREMENT, `IdProducto` INT UNSIGNED NOT NULL, `Cantidad` INT NOT NULL, `PrecioUnitario` DOUBLE NOT NULL, FOREIGN KEY (IdCompra) REFERENCES Compra(IdCompra), FOREIGN KEY (IdProducto) REFERENCES Inventario(IdProducto) ) ENGINE = InnoDB; -- Agregar una nueva columna a la tabla Compra ALTER TABLE `Compra` ADD COLUMN `Fecha` DATE NOT NULL; -- Renombrar una tabla ALTER TABLE `Inventario` RENAME TO `Producto`; -- Mostrar las bases de datos SHOW DATABASES; -- -- MUESTRA LAS TABLAS DE LA BASE DE DATOS SHOW TABLES; -- -- Muestra la estructura de una tabla -- DESCRIBE Cliente;
-- name: SelectAll SELECT user_id, name, age FROM USERS; -- name: Insert INSERT INTO USERS(user_id, name, age) VALUES ($1, $2, $3); -- name: DeleteAll DELETE FROM USERS; -- name: GetByID SELECT user_id, name, age FROM USERS WHERE user_id = $1; -- name: GetUserWithPosts SELECT u.*, json_agg(up) AS posts FROM users u LEFT JOIN user_posts up USING (user_id) WHERE u.user_id = $1 GROUP BY u.user_id, u.name, u.age;
CREATE TABLE MAP_IMAGE ( MAP_ID INT PRIMARY KEY, IMG_FULL VARCHAR(255) NOT NULL, SPRITE VARCHAR(255) NOT NULL, IMG_GROUP VARCHAR(255) NOT NULL, IMG_SRC BYTEA NOT NULL, X INT NOT NULL, Y INT NOT NULL, W INT NOT NULL, H INT NOT NULL, FOREIGN KEY (MAP_ID) REFERENCES MAP (ID) );
col redo_size format 999,999,999,999 --set echo on select sid, value redo_size from v$mystat where statistic#=(select statistic# from v$statname where name = 'redo size'); set echo off
-- Adminer 4.6.2 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DROP DATABASE IF EXISTS `facebook`; CREATE DATABASE `facebook` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `facebook`; DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `text` text NOT NULL, `post_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `time_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `post_id` (`post_id`), KEY `user_id` (`user_id`), CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`), CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `friends`; CREATE TABLE `friends` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `friends_with` int(11) NOT NULL, `time_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `friends_with` (`friends_with`), CONSTRAINT `friends_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT `friends_ibfk_2` FOREIGN KEY (`friends_with`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `posts`; CREATE TABLE `posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `text` text NOT NULL, `user_id` int(11) NOT NULL, `comments_count` int(10) DEFAULT '0', `likes_count` int(10) DEFAULT '0', `dislikes_count` int(10) DEFAULT '0', `time_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `names` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` text NOT NULL, `liked_posts` int(11) NOT NULL DEFAULT '0', `disliked_posts` int(11) NOT NULL DEFAULT '0', `last_login` timestamp NULL DEFAULT NULL, `time_created` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `users` (`id`, `username`, `names`, `email`, `password`, `liked_posts`, `disliked_posts`, `last_login`, `time_created`) VALUES (1, 'gracejoy', 'Grace Kanyanya', 'gracejoy.kanyanya@gmail.com', '$2y$10$UjIOLG9tqHGm38Lh05eQRuSPOflM7ClVJoyKIX7pfczitOeyRSx0K', 0, 0, NULL, NULL); -- 2018-06-20 15:56:44
WHERE @field NOT IN (@vector)
ALTER TABLE school_codes MODIFY COLUMN code_type ENUM('FICE', 'ATP', 'ACT', 'IPEDS', 'OPEID', 'CEEB', 'CDS') NOT NULL; INSERT INTO school_codes (code, code_type, organization_id) VALUES ('04614160451153','CDS',2);
-- -------------------------------------------------------- CREATE DATABASE IF NOT EXISTS db; use db; -- -- Table structure for table `User_Entity` -- CREATE TABLE If Not Exists `USER_ENTITY` ( `uuid` varchar(64) NOT NULL, `username` varchar(20) NOT NULL, `pwd` varchar(64) DEFAULT NULL, `payPwd` varchar(20) DEFAULT NULL, `questionIndex` int(20) DEFAULT NULL, `answer` varchar(64) DEFAULT NULL, primary key(uuid), unique key(uuid) ) ENGINE=InnoDB; -- -- Table structure for table `Account_Entity` -- CREATE TABLE If Not Exists `ACCOUNT_ENTITY` ( `uuid` varchar(64) NOT NULL, `startingBalance` decimal(15,5) DEFAULT 10000, `accountBalance` decimal(15,5) DEFAULT NULL, `assets` decimal(15,5) DEFAULT NULL, `yesterdayYield` decimal(15,5) DEFAULT NULL, `holdingYield` decimal(15,5) DEFAULT NULL, `totalYield` decimal(15,5) DEFAULT NULL, primary key (uuid) ) ENGINE=InnoDB; -- -- Table structure for table `Holding_Entity` -- CREATE TABLE If Not Exists `HOLDING_ENTITY` ( `uuid` varchar(64) NOT NULL, `fundId` varchar(20) NOT NULL, `holdingShares` decimal(15,5) DEFAULT NULL, `startHoldingDate` TIMESTAMP DEFAULT NULL, `transactionPrice` decimal(15,5) DEFAULT NULL ) ENGINE=InnoDB; -- -- Table structure for table `selfListed` -- CREATE TABLE If Not Exists `selfListed` ( `uuid` varchar(64) NOT NULL, `fundId` varchar(20) NOT NULL, unique index(`uuid`, `fundId`) ) ENGINE=InnoDB; -- -- Table structure for table `yieldHistory` -- CREATE TABLE If Not Exists `yieldHistory` ( `uuid` varchar(64) NOT NULL, `fundId` varchar(20) NOT NULL, `yieldRecord` decimal(15,5) DEFAULT NULL, `date` TIMESTAMP DEFAULT NULL, unique index(`uuid` ,`fundId`,`date`) ) ENGINE=InnoDB; -- -- Table structure for table `TRADE_ENTITY` -- CREATE TABLE If Not Exists `TRADE_ENTITY` ( `uuid` varchar(64) NOT NULL, `orderId` varchar(64) NOT NULL, `fundId` varchar(20) DEFAULT NULL, `tradeType` int(10) DEFAULT NULL COMMENT '0-buy; 1-sell', `tradeShares` decimal(15,5) DEFAULT NULL, `tradePrice` decimal(15,5) DEFAULT NULL, `orderDate` TIMESTAMP DEFAULT NULL, `tradeDate` TIMESTAMP DEFAULT NULL, primary key (orderID) ) ENGINE=InnoDB; -- -- Table structure for table `ORDER_ENTITY` -- CREATE TABLE If Not Exists `ORDER_ENTITY` ( `uuid` varchar(64) NOT NULL, `orderId` varchar(64) NOT NULL, `fundId` varchar(20) DEFAULT NULL, `orderType` int(10) DEFAULT NULL, `sellingShares` decimal(15,5) DEFAULT NULL, `buyingAmount` decimal(15,5) DEFAULT NULL, `orderDate` TIMESTAMP DEFAULT NULL, `orderStatus` varchar(20) DEFAULT NULL, primary key (orderID) ) ENGINE=InnoDB;
CREATE TABLE tasks ( id int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, created_at timestamp, updated_at timestamp, PRIMARY KEY (`id`) ) ENGINE=InnoDB;
CREATE TABLE teachers ( name VARCHAR(50), department VARCHAR(40), id INT PRIMARY KEY); CREATE TABLE courses (id INT PRIMARY KEY, name VARCHAR(20)); CREATE TABLE students( rut VARCHAR(12)PRIMARY KEY, name VARCHAR (50), course_id INT REFERENCES courses(id)); CREATE TABLE tests ( student_id VARCHAR(12) REFERENCES students(rut),teacher_id INT REFERENCES teachers(id));
--********************【TFS向け仕様追加・変更対応】 wangxuejun del 2012/12/28 start************************ --SELECT --COUNT(CUSTOMER_MST.CUSTOMER_CODE) AS CNT --FROM CUSTOMER_MST --WHERE --CUSTOMER_MST.AGENCY_SHOP_FLG = /*oneValue*/'' --/*IF (dto.customerCode != null)*/ --AND CUSTOMER_MST.CUSTOMER_CODE <> /*dto.customerCode*/'' --/*END*/ --AND CUSTOMER_MST.AGENCY_CODE = /*dto.agencyCode*/'' -- AND CUSTOMER_MST.DELETE_FLG <> /*oneValue*/'' --********************【TFS向け仕様追加・変更対応】 wangxuejun del 2012/12/28 end************************
-- phpMyAdmin SQL Dump -- version 4.3.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 11, 2015 at 10:54 PM -- Server version: 5.5.27-log -- PHP Version: 5.4.6 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: `useri_site` -- -- -------------------------------------------------------- -- -- Table structure for table `age_category` -- CREATE TABLE IF NOT EXISTS `age_category` ( `id` int(11) NOT NULL, `category` varchar(8) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1; -- -- Dumping data for table `age_category` -- INSERT INTO `age_category` (`id`, `category`) VALUES (1, '-'), (21, '32-35'), (24, '35-36'), (25, '36-37'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL, `username` varchar(30) NOT NULL, `password` varchar(32) NOT NULL, `phone_number` varchar(12) NOT NULL, `email` varchar(30) NOT NULL, `type` varchar(1) NOT NULL, `description` varchar(200) NOT NULL, `age_id` int(11) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `phone_number`, `email`, `type`, `description`, `age_id`) VALUES (22, 'alexandru', '7e60b30fdc66d44807493ac7a777ff26', '+0755555555', 'catarex00@gmail.com', 'u', 'ahz', 1), (25, 'catalin', 'f992437e5f60fe0043a4384cd7ba72be', '+40755800468', 'catalingy@yahoo.com', 'a', 'a', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `age_category` -- ALTER TABLE `age_category` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD UNIQUE KEY `username` (`username`), ADD KEY `ID` (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `age_category` -- ALTER TABLE `age_category` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=28; /*!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 */;
TRUNCATE TABLE PDP_PAYEE_ACH_ACCT_T / INSERT INTO PDP_PAYEE_ACH_ACCT_T (ACH_ACCT_GNRTD_ID,OBJ_ID,VER_NBR,BNK_RTNG_NBR,BNK_ACCT_NBR,PAYEE_NM,PAYEE_EMAIL_ADDR,PAYEE_ID_TYP_CD,ACH_TRANS_TYP,ROW_ACTV_IND,BNK_ACCT_TYP_CD,PAYEE_ID_NBR) VALUES (10000.0,'3DD0823DD81A9036E043814FD8819036',1.0,'012345678','XBy8HbA0p2kc3lalnjPKpA==','John Doe','xy@xy.com','E','PRAP','Y','22','1') / INSERT INTO PDP_PAYEE_ACH_ACCT_T (ACH_ACCT_GNRTD_ID,OBJ_ID,VER_NBR,BNK_RTNG_NBR,BNK_ACCT_NBR,PAYEE_NM,PAYEE_EMAIL_ADDR,PAYEE_ID_TYP_CD,ACH_TRANS_TYP,ROW_ACTV_IND,BNK_ACCT_TYP_CD,PAYEE_ID_NBR) VALUES (10001.0,'3DD0823DD81B9036E043814FD8819036',1.0,'876543210','UeteX8/H6dO39UFEd4GMnQ==','Jane Smith','xy@xy.com','E','PRAP','Y','22','1') / INSERT INTO PDP_PAYEE_ACH_ACCT_T (ACH_ACCT_GNRTD_ID,OBJ_ID,VER_NBR,BNK_RTNG_NBR,BNK_ACCT_NBR,PAYEE_NM,PAYEE_EMAIL_ADDR,PAYEE_ID_TYP_CD,ACH_TRANS_TYP,ROW_ACTV_IND,BNK_ACCT_TYP_CD,PAYEE_ID_NBR) VALUES (10002.0,'3DD0823DD81A9036E043814FD8819036',1.0,'012345678','XBy8HbA0p2kc3lalnjPKpA==','John Doe','xy@xy.com','E','PRAP','Y','22','1') / INSERT INTO PDP_PAYEE_ACH_ACCT_T (ACH_ACCT_GNRTD_ID,OBJ_ID,VER_NBR,BNK_RTNG_NBR,BNK_ACCT_NBR,PAYEE_NM,PAYEE_EMAIL_ADDR,PAYEE_ID_TYP_CD,ACH_TRANS_TYP,ROW_ACTV_IND,BNK_ACCT_TYP_CD,PAYEE_ID_NBR) VALUES (10003.0,'3DD0823DD81B9036E043814FD8819036',1.0,'876543210','UeteX8/H6dO39UFEd4GMnQ==','Jane Smith','xy@xy.com','E','PRAP','Y','22','1') /
/*Task 1 GRINGOTTS DATABASE*/ SELECT COUNT(*) FROM `wizzard_deposits`; /*Task 2*/ SELECT MAX(`magic_wand_size`) AS 'longest_magic_wand' FROM `wizzard_deposits`; /*Task 3*/ SELECT `deposit_group`, MAX(`magic_wand_size`) AS 'longest_magic_wand' FROM `wizzard_deposits` GROUP BY `deposit_group` ORDER BY `longest_magic_wand`, `deposit_group`; /*Task 4*/ SELECT MIN(`deposit_group`) FROM `wizzard_deposits` GROUP BY `deposit_group` ORDER BY AVG(`magic_wand_size`) LIMIT 1; /*Task 5*/ SELECT `deposit_group`, SUM(`deposit_amount`) AS 'total_sum' FROM `wizzard_deposits` GROUP BY `deposit_group` ORDER BY `total_sum`; /*Task 6*/ SELECT `deposit_group`, SUM(`deposit_amount`) AS 'total_sum' FROM `wizzard_deposits` WHERE `magic_wand_creator` = 'Ollivander family' GROUP BY `deposit_group` ORDER BY `deposit_group`; /*Task 7*/ SELECT `deposit_group`, SUM(`deposit_amount`) AS 'total_sum' FROM `wizzard_deposits` WHERE `magic_wand_creator` = 'Ollivander family' GROUP BY `deposit_group` HAVING `total_sum` < 150000 ORDER BY `total_sum` DESC; /*Task 8*/ SELECT `deposit_group`, `magic_wand_creator`, MIN(`deposit_charge`) AS 'min_deposit_charge' FROM `wizzard_deposits` GROUP BY `deposit_group`, `magic_wand_creator` ORDER BY `magic_wand_creator`, `deposit_group`; /*Task 9*/ SELECT CASE WHEN `age` <= 10 THEN '[0-10]' WHEN `age` > 10 AND `age` <= 20 THEN '[11-20]' WHEN `age` > 20 AND `age` <= 30 THEN '[21-30]' WHEN `age` > 30 AND `age` <= 40 THEN '[31-40]' WHEN `age` > 40 AND `age` <= 50 THEN '[41-50]' WHEN `age` > 50 AND `age` <= 60 THEN '[51-60]' ELSE '[61+]' END AS `age_group`, COUNT(*) AS 'wizard_count' FROM `wizzard_deposits` GROUP BY `age_group` ORDER BY `age_group`; /*Task 10*/ SELECT SUBSTRING(`first_name`,1,1) AS 'first_letter' FROM `wizzard_deposits` WHERE `deposit_group` = 'Troll Chest' GROUP BY `first_letter` ORDER BY `first_letter`; /*Task 11*/ SELECT `deposit_group`, `is_deposit_expired`, AVG(`deposit_interest`) AS 'average_interest' FROM `wizzard_deposits` WHERE `deposit_start_date` > '1985/01/01' GROUP BY `is_deposit_expired`, `deposit_group` ORDER BY `deposit_group` DESC, `is_deposit_expired`; /*Task 12*/ SELECT SUM(diff.next) AS 'sum_difference' FROM ( SELECT `deposit_amount` - (SELECT `deposit_amount` FROM `wizzard_deposits` WHERE `id` = curr.id + 1) AS 'next' FROM `wizzard_deposits` AS curr) AS diff; /*Task 13 SOFTUNI DATABASE*/ SELECT `department_id`, MIN(`salary`) AS 'minimum_salary' FROM `employees` WHERE `department_id` IN (2,5,7) AND `hire_date` > '2000/01/01' GROUP BY `department_id` ORDER BY `department_id`; /*Task 14*/ CREATE TABLE EmployeesWithHighSalary SELECT * FROM `employees` WHERE `salary` > 30000; DELETE FROM `employeeswithhighsalary` WHERE `manager_id` = 42; UPDATE `employeeswithhighsalary` SET `salary` = `salary` + 5000 WHERE `department_id` = 1; SELECT `department_id`, AVG(`salary`) AS 'avg_salary' FROM `employeeswithhighsalary` GROUP BY `department_id` ORDER BY `department_id`; /*Task 15*/ SELECT `department_id`, MAX(`salary`) AS 'max_salary' FROM `employees` GROUP BY `department_id` HAVING `max_salary` NOT BETWEEN 30000 AND 70000 ORDER BY `department_id`; /*Task 16*/ SELECT COUNT(*) FROM `employees` WHERE `manager_id` IS NULL; /*Task 17*/ SELECT `department_id`, (SELECT DISTINCT `e2`.`salary` FROM `employees` AS `e2` WHERE `e2`.`department_id` = `e1`.`department_id` ORDER BY `e2`.`salary` DESC LIMIT 2 , 1) AS `third_highest_salary` FROM `employees` AS `e1` GROUP BY `department_id` HAVING `third_highest_salary` IS NOT NULL; /*Task 18*/ SELECT `first_name`, `last_name`, `department_id` FROM `employees` AS e1 WHERE e1.salary > ( SELECT AVG(`salary`) FROM `employees` AS e2 WHERE e1.department_id = e2.department_id ) ORDER BY e1.department_id ASC LIMIT 10; /*Task 19*/ SELECT `department_id`, SUM(`salary`) AS 'total_salary' FROM `employees` GROUP BY `department_id` ORDER BY `department_id`;
CREATE TABLE ivfluids ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, StudyNo char(255), Hour char(255), NaCl char(255), NaClRateCorrect char(255), BMLessThan14 char(255), TenPercentDextrose char(255), DextroseRateCorrect char(255), KPlus char(255), KPlusReplacement char(255), InsulinUnitsPerHour char(255), PRIMARY KEY (id) );
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Dec 12, 2016 at 12:33 AM -- Server version: 5.7.16-0ubuntu0.16.04.1 -- PHP Version: 7.0.8-0ubuntu0.16.04.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 utf8mb4 */; -- -- Database: `company` -- -- -------------------------------------------------------- -- -- Table structure for table `auth_assignment` -- CREATE TABLE `auth_assignment` ( `item_name` varchar(64) NOT NULL, `user_id` varchar(64) NOT NULL, `created_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `auth_assignment` -- INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES ('admin', '1', 1481491448), ('editor', '2', 1481491448), ('ord', '3', 1481491448); -- -------------------------------------------------------- -- -- Table structure for table `auth_item` -- CREATE TABLE `auth_item` ( `name` varchar(64) NOT NULL, `type` int(11) NOT NULL, `description` text, `rule_name` varchar(64) DEFAULT NULL, `data` text, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `auth_item` -- INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES ('create', 2, 'create', NULL, NULL, 1481491441, 1481491441), ('delete', 2, 'delete', NULL, NULL, 1481491441, 1481491441), ('index', 2, 'View index', NULL, NULL, 1481491441, 1481491441), ('update', 2, 'update', NULL, NULL, 1481491441, 1481491441), ('view', 2, 'view', NULL, NULL, 1481491441, 1481491441); -- -------------------------------------------------------- -- -- Table structure for table `auth_item_child` -- CREATE TABLE `auth_item_child` ( `parent` varchar(64) NOT NULL, `child` varchar(64) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `auth_item_child` -- INSERT INTO `auth_item_child` (`parent`, `child`) VALUES ('admin', 'create'), ('admin', 'delete'), ('admin', 'editor'), ('ord', 'index'), ('editor', 'ord'), ('editor', 'update'), ('ord', 'view'); -- -------------------------------------------------------- -- -- Table structure for table `auth_rule` -- CREATE TABLE `auth_rule` ( `name` varchar(64) NOT NULL, `data` text, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `departments` -- CREATE TABLE `departments` ( `departmentID` int(11) NOT NULL, `departmentName` varchar(50) COLLATE utf8_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `departments` -- INSERT INTO `departments` (`departmentID`, `departmentName`) VALUES (19, 'HR'), (20, 'CS'), (21, 'Accounting'); -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE `employees` ( `employeeID` int(10) NOT NULL, `fName` varchar(50) COLLATE utf8_bin NOT NULL, `lName` varchar(50) COLLATE utf8_bin NOT NULL, `salary` int(10) NOT NULL, `departmentID` int(50) NOT NULL, `titleID` int(50) DEFAULT NULL, `supervisorID` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`employeeID`, `fName`, `lName`, `salary`, `departmentID`, `titleID`, `supervisorID`) VALUES (1, 'Salwa', 'Saed', 6300, 5, 1, 0), (3, 'mohamed', 'ibrahim', 1940, 8, 2, 19), (19, 'Salam', 'Mohamed', 4500, 5, 1, 0), (32, 'Abdullah', 'Ahmed', 1300, 15, 2, 34), (34, 'Mustafa', 'Saed', 6200, 15, 1, 0), (36, 'Ahmed', 'Mustafa', 1400, 14, 2, 37), (38, 'Zeinab ', 'Ali', 3200, 14, 2, 37), (39, 'Ahmed', 'Adel', 1500, 19, 2, 0), (40, 'Islam', 'Mohamed', 8000, 19, 1, 0), (41, 'Sally', 'Mustafa', 7400, 20, 1, 0), (42, 'Ali', 'Ismael', 4900, 21, 1, 0), (43, 'Zeinab', 'ibrahim', 2500, 20, 2, 41), (44, 'Eman', 'Ali', 2900, 20, 2, 41), (45, 'Salma', 'Rashed', 3200, 19, 2, 40); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `roleID` int(10) NOT NULL, `name` varchar(20) COLLATE utf8_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`roleID`, `name`) VALUES (1, 'High Admin'), (2, 'Admin'), (3, 'Ordinary'); -- -------------------------------------------------------- -- -- Table structure for table `titles` -- CREATE TABLE `titles` ( `titleID` int(20) NOT NULL, `titleName` varchar(50) NOT NULL DEFAULT 'Ordinary' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `titles` -- INSERT INTO `titles` (`titleID`, `titleName`) VALUES (0, 'None'), (1, 'Supervisor'), (2, 'Ordinary'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `userID` int(20) NOT NULL, `username` varchar(250) COLLATE utf8_bin NOT NULL, `email` varchar(250) COLLATE utf8_bin NOT NULL, `password` varchar(250) COLLATE utf8_bin NOT NULL, `roleID` int(20) NOT NULL DEFAULT '3', `statusID` int(20) NOT NULL DEFAULT '0', `token` varchar(255) COLLATE utf8_bin DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `users` -- INSERT INTO `users` (`userID`, `username`, `email`, `password`, `roleID`, `statusID`, `token`) VALUES (1, 'ahmed', 'a.sallam@fetchr.us', '$2y$10$3wU4qreKCIv6Zh5SyISi9.8fDH4zEKbbYyxCfKYoWsAHnlIGagopu', 3, 0, 'bf542e42f2070a59aa28e0eb1304d5c5'), (26, 'hassan', 'h.hassan@fetchr.us', '$2y$10$shsTteaLlDQCjjaIoNXpsO5UU8FA8opwW3OPak5h.8PTV5XiItYua', 3, 0, '7d198805a504b839a7ce78d6638e5994'), (455, 'HightAdmin', 'd', '$2y$10$KSImmevLYc5Dkf8PgfZvg.qStFn1N9zBAOg6B9u8CWlISPWRAn0/m', 1, 1, '02af5882f68b8a724e3105b30bb68c34'), (467, 'ahmed1', 'a.sallam@das.co', '$2y$13$N66Sse7Xx6Hu6dSyLJczeev1N4zt7vvA/hM6c/BOf4Reh//gjQW9.', 3, 0, NULL); -- -------------------------------------------------------- -- -- Table structure for table `userstatus` -- CREATE TABLE `userstatus` ( `statusID` int(20) NOT NULL, `status` varchar(20) COLLATE utf8_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `userstatus` -- INSERT INTO `userstatus` (`statusID`, `status`) VALUES (0, 'Inactive'), (1, 'Active'); -- -- Indexes for dumped tables -- -- -- Indexes for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD PRIMARY KEY (`item_name`,`user_id`); -- -- Indexes for table `auth_item` -- ALTER TABLE `auth_item` ADD PRIMARY KEY (`name`), ADD KEY `rule_name` (`rule_name`), ADD KEY `type` (`type`); -- -- Indexes for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD PRIMARY KEY (`parent`,`child`), ADD KEY `child` (`child`); -- -- Indexes for table `auth_rule` -- ALTER TABLE `auth_rule` ADD PRIMARY KEY (`name`); -- -- Indexes for table `departments` -- ALTER TABLE `departments` ADD PRIMARY KEY (`departmentID`); -- -- Indexes for table `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`employeeID`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`roleID`); -- -- Indexes for table `titles` -- ALTER TABLE `titles` ADD PRIMARY KEY (`titleID`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`userID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `departments` -- ALTER TABLE `departments` MODIFY `departmentID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `employees` -- ALTER TABLE `employees` MODIFY `employeeID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `userID` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=468; -- -- Constraints for dumped tables -- -- -- Constraints for table `auth_assignment` -- ALTER TABLE `auth_assignment` ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `auth_item` -- ALTER TABLE `auth_item` ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Constraints for table `auth_item_child` -- ALTER TABLE `auth_item_child` ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE; /*!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 */;
insert into provider_type (description) values ('physician'); insert into provider_type (description) values ('lab'); insert into provider_type (description) values ('hospital'); insert into provider (name, address_id, phone, fax, email, provider_type) values ('John Hopkins Physicians', 1, '240.123.1234', '301.123.1234', 'doctor@test.com', 1); insert into provider (name, address_id, phone, fax, email, provider_type) values ('Shady Grove Radiology', 2, '240.123.1234', '301.123.1234', 'lab@test.com', 2); insert into provider (name, address_id, phone, fax, email, provider_type) values ('Shady Grove Hospital', 1, '240.123.1234', '301.123.1234', 'hospital@test.com', 3); insert into provider (name, address_id, phone, fax, email, provider_type) values ('Capital Digestive Consultants', 1, '240.123.1234', '301.123.1234', 'gi@test.com', 3); insert into prescription (dosage, frequency, description, active, note) values ('24mg', 'daily', 'Amitiza', 1, ''); insert into prescription (dosage, frequency, description, active, note) values ('10mg', 'daily', 'Miralax', 1, ''); insert into insurance_type (description) values ('Medical'); insert into insurance_type (description) values ('Dental'); insert into insurance_type (description) values ('Vision'); insert into insurance (address_id, phone, secondary, insurance_type, effective_date, policy_no, group_id, carrier) values (1, '800.888.8888', 0, 1, str_to_date('01/01/2017', '%m/%d/%Y'), 'B123123', '99K1', 'Carefirst');
DROP DATABASE IF EXISTS bamazon_DB; CREATE DATABASE bamazon_DB; USE bamazon_DB; CREATE TABLE products( item_id INTEGER AUTO_INCREMENT NOT NULL, product_name VARCHAR(50) NOT NULL, department_name VARCHAR(50) NOT NULL, price VARCHAR(30) NOT NULL, stock_quanity INTEGER NOT NULL, PRIMARY KEY (item_id) ); SELECT * FROM products; INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Fitbit Alta HR Wristband", "Health & Household" , 145.95 , 48 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Echo Spot", "Electronics & Computers" , 129.99 , 24 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Apple AirPods", "Earbuds & In-Ear Headphones" , 159.00 , 82 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Hydro Flask Water Bottle", "Sports & Outdoors" , 44.95 , 37 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Adidas Ultra Boost Running Shoe", "Clothing, Shoes & Jewelry" , 179.95 , 3 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Vitamix Professional Blender", "Home , Garden& Tool" , 587.01 , 12 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Peak Design Camera Strap", "Electronics & Computers" , 49.95 , 83 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Zhiyun Crane Gimbal", "Electronics & Computers" , 569.00 , 7 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Arnicare Gel", "Home & Household" , 7.99, 76 ); INSERT INTO products(product_name,department_name,price,stock_quanity) VALUES ("Hyperice Fitness Roller", "Sports & Outdoor" , 199.99 , 12 ); SELECT * FROM products;
/* Navicat MySQL Data Transfer Source Server : test Source Server Version : 50527 Source Host : localhost:3306 Source Database : yiiboot Target Server Type : MYSQL Target Server Version : 50527 File Encoding : 65001 Date: 2016-11-10 17:03:29 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `wx_user` -- ---------------------------- DROP TABLE IF EXISTS `wx_user`; CREATE TABLE `wx_user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `open_id` varchar(50) NOT NULL COMMENT 'openid', `nike_name` varchar(30) NOT NULL COMMENT '昵称', `head_img_url` varchar(255) NOT NULL COMMENT '头像', `sex` varchar(20) NOT NULL COMMENT '性别', `city` varchar(50) NOT NULL COMMENT '所在城市', `update_date` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of wx_user -- ---------------------------- INSERT INTO `wx_user` VALUES ('1', 'ozRSwwvdtiIIOa3gJvNbO23OOaS0', '简jian单dan', 'http://wx.qlogo.cn/mmopen/PiajxSqBRaELvh9RrMj8LsUg2s6QxkMxBxB3j5iaBs32tL9WnGgmp4GdeCMaPn9A090Q3icnfGx4K5nUfUP0lnyAg/0', '1', '成都', '2016-11-10 16:44:03'); INSERT INTO `wx_user` VALUES ('3', 'ozRSwwvdtiIIOa3gJvNbO23OOaS0', '简jian单dan', 'http://wx.qlogo.cn/mmopen/PiajxSqBRaELvh9RrMj8LsUg2s6QxkMxBxB3j5iaBs32tL9WnGgmp4GdeCMaPn9A090Q3icnfGx4K5nUfUP0lnyAg/0', '1', '成都', '2016-11-10 17:00:22');
DROP SCHEMA IF EXISTS memory_improve; CREATE SCHEMA memory_improve; USE memory_improve; SET AUTOCOMMIT=0; SELECT 'CREATING SCHEMA STRUCTURE' as 'INFO'; DROP TABLE IF EXISTS user, patient, guardian, quiz, question, personal_info, picture; -- Category tables to be deleted DROP TABLE IF EXISTS category_city, category_food, category_people_male, category_people_female, category_tools, category_cars, category_hobbies, category_sports, category_music, category_books, category_songs, category_celebrities, category_genre, category_animals, category_plants, category_flowers, category_vegetables, category_color, category_number, category_month, category_movie, category_phone; /*!50503 set default_storage_engine = InnoDB */; /*!50503 select CONCAT('storage engine: ', @@default_storage_engine) as INFO */; CREATE TABLE user ( user_id INT(11) NOT NULL AUTO_INCREMENT, username CHAR(30) NOT NULL UNIQUE, password_hash CHAR(61) NOT NULL, first_name CHAR(30) NOT NULL, last_name CHAR(30) NOT NULL, dob DATE NOT NULL, gender CHAR(1), PRIMARY KEY (user_id) ); CREATE TABLE guardian ( guardian_id INT(11) NOT NULL AUTO_INCREMENT, user_id INT(11) NOT NULL, FOREIGN KEY (user_id) REFERENCES user (user_id) ON DELETE CASCADE, PRIMARY KEY (guardian_id) ); CREATE TABLE patient ( patient_id INT(11) NOT NULL AUTO_INCREMENT, guardian_id INT(11) NOT NULL, user_id INT(11) NOT NULL, /*Patient Information goes here*/ FOREIGN KEY (guardian_id) REFERENCES guardian (guardian_id), FOREIGN KEY (user_id) REFERENCES user (user_id) ON DELETE CASCADE, PRIMARY KEY (patient_id) ); CREATE TABLE quiz ( quiz_id INT(11) NOT NULL AUTO_INCREMENT, score INT NOT NULL CHECK(score <= 100), patient_id INT(11) NOT NULL, start_date DATETIME NOT NULL, state TEXT, FOREIGN KEY (patient_id) REFERENCES patient (patient_id) ON DELETE CASCADE, PRIMARY KEY (quiz_id) ); CREATE TABLE question ( question_id INT(11) NOT NULL AUTO_INCREMENT, category CHAR(35) NOT NULL, question_string CHAR(100) NOT NULL, answer CHAR(30) NOT NULL, patient_id INT(11) NOT NULL, FOREIGN KEY (patient_id) REFERENCES patient (patient_id) ON DELETE CASCADE, PRIMARY KEY (question_id) ); CREATE TABLE picture ( id INT(11) NOT NULL AUTO_INCREMENT, question_string CHAR(100) NOT NULL, answer CHAR(50) NOT NULL, loc CHAR(100) NOT NULL, patient_id INT(11) NOT NULL, FOREIGN KEY (patient_id) REFERENCES patient (patient_id) ON DELETE CASCADE, PRIMARY KEY (id) ); CREATE TABLE personal_info ( id INT(11) NOT NULL AUTO_INCREMENT, category CHAR(35) NOT NULL, question_string CHAR(100) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE images ( id INT(11) NOT NULL AUTO_INCREMENT, image blob NOT NULL DEFAULT '', question_id INT(11) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (question_id) REFERENCES question (question_id) ); CREATE TABLE category_city ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ) ; CREATE TABLE category_food ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_people_male ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_people_female ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_tools ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_cars ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_hobbies ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_sports ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_music ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_books ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_songs ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_celebrities ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_genre ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_animals ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_plants ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_flowers ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_vegetables ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_color ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_number ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_month ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_movie ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); CREATE TABLE category_phone ( id int(11) NOT NULL AUTO_INCREMENT, c_name char(35) NOT NULL DEFAULT '', PRIMARY KEY (id) ); INSERT INTO category_city VALUES (1, "Mumbai"); INSERT INTO category_city VALUES (2, "Boston"); INSERT INTO category_city VALUES (3, "Seattle"); INSERT INTO category_city VALUES (4, "Rome"); INSERT INTO category_city VALUES (5, "London"); INSERT INTO category_food VALUES (1, "Sushi"); INSERT INTO category_food VALUES (2, "Chicken Curry"); INSERT INTO category_food VALUES (3, "Teriyaki Chiken"); INSERT INTO category_food VALUES (4, "Grilled Steak"); INSERT INTO category_food VALUES (5, "Sandwich"); INSERT INTO category_people_male VALUES (1, "John"); INSERT INTO category_people_male VALUES (2, "Matthew"); INSERT INTO category_people_male VALUES (3, "Brandon"); INSERT INTO category_people_male VALUES (4, "Raymond"); INSERT INTO category_people_male VALUES (5, "Kenneth"); INSERT INTO category_people_female VALUES (1, "Rebecca"); INSERT INTO category_people_female VALUES (2, "Whittany"); INSERT INTO category_people_female VALUES (3, "Kristina"); INSERT INTO category_people_female VALUES (4, "Jane"); INSERT INTO category_people_female VALUES (5, "Marissa"); INSERT INTO category_tools VALUES (1, "Hammer"); INSERT INTO category_tools VALUES (2, "Screw Driver"); INSERT INTO category_tools VALUES (3, "Chisel"); INSERT INTO category_tools VALUES (4, "Scissors"); INSERT INTO category_tools VALUES (5, "Pincers"); INSERT INTO category_cars VALUES (1, "Jeep"); INSERT INTO category_cars VALUES (2, "Ford"); INSERT INTO category_cars VALUES (3, "Mercedes"); INSERT INTO category_cars VALUES (4, "Lexus"); INSERT INTO category_cars VALUES (5, "Porsche"); INSERT INTO category_hobbies VALUES (1, "Reading"); INSERT INTO category_hobbies VALUES (2, "Philately"); INSERT INTO category_hobbies VALUES (3, "Numismatics"); INSERT INTO category_hobbies VALUES (4, "Sports"); INSERT INTO category_hobbies VALUES (5, "Gardening"); INSERT INTO category_sports VALUES (1, "Soccer"); INSERT INTO category_sports VALUES (2, "Baseball"); INSERT INTO category_sports VALUES (3, "Football"); INSERT INTO category_sports VALUES (4, "Hockey"); INSERT INTO category_sports VALUES (5, "Basketball"); INSERT INTO category_sports VALUES (6, "Tennis"); INSERT INTO category_music VALUES (1, "Pop"); INSERT INTO category_music VALUES (2, "Jazz"); INSERT INTO category_music VALUES (3, "Rock"); INSERT INTO category_music VALUES (4, "Classical"); INSERT INTO category_music VALUES (5, "Hip hop"); INSERT INTO category_books VALUES (1, "Harry Potter"); INSERT INTO category_books VALUES (2, "Twilight"); INSERT INTO category_books VALUES (3, "To kill a Mockingbird"); INSERT INTO category_books VALUES (4, "Life of Pi"); INSERT INTO category_books VALUES (5, "The Great Gatzby"); INSERT INTO category_songs VALUES (1, "Stairway to Heaven"); INSERT INTO category_songs VALUES (2, "Imagine"); INSERT INTO category_songs VALUES (3, "Smells like Teen Spirit"); INSERT INTO category_songs VALUES (4, "Hotel California"); INSERT INTO category_songs VALUES (5, "Sweet Child O'Mine"); INSERT INTO category_celebrities VALUES (1, "Michael Jackson"); INSERT INTO category_celebrities VALUES (2, "Tom Cruise"); INSERT INTO category_celebrities VALUES (3, "Beyonce"); INSERT INTO category_celebrities VALUES (4, "Al Pacino"); INSERT INTO category_celebrities VALUES (5, "Tom Brady"); INSERT INTO category_genre VALUES (1, "Action"); INSERT INTO category_genre VALUES (2, "Adventure"); INSERT INTO category_genre VALUES (3, "Comedy"); INSERT INTO category_genre VALUES (4, "Drama"); INSERT INTO category_genre VALUES (5, "Crime"); INSERT INTO category_animals VALUES (1, "Dog"); INSERT INTO category_animals VALUES (2, "Cat"); INSERT INTO category_animals VALUES (3, "Rabbit"); INSERT INTO category_animals VALUES (4, "Snake"); INSERT INTO category_animals VALUES (5, "Fish"); INSERT INTO category_plants VALUES (1, "Bamboo"); INSERT INTO category_plants VALUES (2, "Chestnut"); INSERT INTO category_plants VALUES (3, "Mango"); INSERT INTO category_plants VALUES (4, "Pine"); INSERT INTO category_plants VALUES (5, "Nighshade"); INSERT INTO category_flowers VALUES (1, "Lily"); INSERT INTO category_flowers VALUES (2, "Rose"); INSERT INTO category_flowers VALUES (3, "Marigold"); INSERT INTO category_flowers VALUES (4, "Orchid"); INSERT INTO category_flowers VALUES (5, "Lotus"); INSERT INTO category_vegetables VALUES (1, "Tomato"); INSERT INTO category_vegetables VALUES (2, "Spinach"); INSERT INTO category_vegetables VALUES (3, "Broccoli"); INSERT INTO category_vegetables VALUES (4, "Carrot"); INSERT INTO category_vegetables VALUES (5, "Mushroom"); INSERT INTO category_color VALUES (1, "Red"); INSERT INTO category_color VALUES (2, "Green"); INSERT INTO category_color VALUES (3, "Blue"); INSERT INTO category_color VALUES (4, "Yellow"); INSERT INTO category_color VALUES (5, "Magenta"); INSERT INTO category_number VALUES (1, "14"); INSERT INTO category_number VALUES (2, "46"); INSERT INTO category_number VALUES (3, "99"); INSERT INTO category_number VALUES (4, "44"); INSERT INTO category_number VALUES (5, "75"); INSERT INTO category_month VALUES (1, "January"); INSERT INTO category_month VALUES (2, "February"); INSERT INTO category_month VALUES (3, "March"); INSERT INTO category_month VALUES (4, "April"); INSERT INTO category_month VALUES (5, "May"); INSERT INTO category_month VALUES (6, "June"); INSERT INTO category_month VALUES (7, "July"); INSERT INTO category_month VALUES (8, "August"); INSERT INTO category_month VALUES (9, "September"); INSERT INTO category_month VALUES (10, "October"); INSERT INTO category_month VALUES (11, "November"); INSERT INTO category_month VALUES (12, "December"); INSERT INTO category_movie VALUES (1, "The Heat"); INSERT INTO category_movie VALUES (2, "Taxi Driver"); INSERT INTO category_movie VALUES (3, "Scarface"); INSERT INTO category_movie VALUES (4, "Ghostbusters"); INSERT INTO category_movie VALUES (5, "Shawshank Redemption"); INSERT INTO category_phone VALUES (1, "Android"); INSERT INTO category_phone VALUES (2, "iPhone"); INSERT INTO category_phone VALUES (3, "Windows Phone"); INSERT INTO category_phone VALUES (4, "Blackberry"); -- Insertion of test data 'test_password' INSERT INTO user VALUES (1, 'test_patient', '$2a$12$G8mqNEqTgdHo.fzfCprTk.L5zI4NPIF92pCD3.Nl1Y.rWZvJW0UWa', 'John', 'Doe', '1986-07-14', 'M'); INSERT INTO user VALUES (2, 'test_guardian', '$2a$12$G8mqNEqTgdHo.fzfCprTk.L5zI4NPIF92pCD3.Nl1Y.rWZvJW0UWa', 'Jane', 'Doe', '1970-12-23', 'F'); INSERT INTO user VALUES (3, 'test_patient2', '$2a$12$G8mqNEqTgdHo.fzfCprTk.L5zI4NPIF92pCD3.Nl1Y.rWZvJW0UWa', 'Bob', 'Dylan', '1976-09-22', 'M'); -- guardian for user 1 INSERT INTO guardian VALUES (1,2); -- patient with user_id 1 and guardian_id 1 INSERT INTO patient VALUES (1,1,1); -- patient with user_id 3 and guardian_id 1 INSERT INTO patient VALUES (2,1,3); INSERT INTO question VALUES(1, 'category_color', 'What is your favorite colour ?', 'Purple', 1); INSERT INTO question VALUES(2, 'category_city', 'Which is your favorite holiday destination?', 'Venice', 1); INSERT INTO question VALUES(3, 'category_people_female', 'What is your mother\'s maiden name?', 'Marie', 1); INSERT INTO question VALUES(4, 'category_number', 'What are the last two digits of your cellphone number?', '23', 1); INSERT INTO question VALUES(5, 'category_city', 'In which city were your born?', 'Los Angeles', 1); INSERT INTO question VALUES(6, 'category_month', 'Which month of the year is your birthday?', 'June', 1); INSERT INTO question VALUES(7, 'category_celebrities', 'Who is your favorite celebrity?', 'Bill Murray', 1); INSERT INTO question VALUES(8, 'category_movie', 'Which is your favorite movie?', 'Dog Day Afternoon', 1); INSERT INTO question VALUES(9, 'category_sports', 'Which sport do you like the most?', 'Cricket', 1); INSERT INTO question VALUES(10, 'category_animals', 'Which pet do you have?', 'Hamster', 1); -- populate questions INSERT INTO personal_info VALUES(1, 'category_color', 'What is your favorite colour ?'); INSERT INTO personal_info VALUES(2, 'category_city', 'Which is your favorite holiday destination?'); INSERT INTO personal_info VALUES(3, 'category_people_female', 'What is your mother\'s maiden name?'); INSERT INTO personal_info VALUES(4, 'category_number', 'What are the last two digits of your cellphone number?'); INSERT INTO personal_info VALUES(5, 'category_city', 'In which city were your born?'); INSERT INTO personal_info VALUES(6, 'category_month', 'Which month of the year is your birthday?'); INSERT INTO personal_info VALUES(7, 'category_celebrities', 'Who is your favorite celebrity?'); INSERT INTO personal_info VALUES(8, 'category_movie', 'Which is your favorite movie?'); INSERT INTO personal_info VALUES(9, 'category_sports', 'Which sport do you like the most?'); INSERT INTO personal_info VALUES(10, 'category_animals', 'Which pet do you have?'); INSERT INTO personal_info VALUES(11, 'category_phone', 'Which smartphone do you use?'); INSERT INTO personal_info VALUES(12, 'category_food', 'What is your favorite food?'); INSERT INTO personal_info VALUES(13, 'category_celebrities', 'Who is your role model?'); INSERT INTO personal_info VALUES(14, 'category_hobbies', 'What do you like to do in your spare time?'); INSERT INTO personal_info VALUES(15, 'category_songs', 'Which song do you like the most?'); INSERT INTO personal_info VALUES(16, 'category_music', 'What kind of music do you like?'); INSERT INTO picture VALUES(1, 'Who is your favorite celebrity?', 'Bill Murray', 'a3b0c624-9250-47c6-a7a2-4918b7964042.jpg', 2); INSERT INTO picture VALUES(2, 'Who is this little girl?', 'Daughter', '0c4de627-924e-418f-ae9a-91dd95328d70.jpg', 2); INSERT INTO picture VALUES(3, 'Which city is this house in?', 'New York', 'ef5c2e11-e5a6-4297-9319-5e9de83b6725.jpg', 2); COMMIT;
--initiate Database. --create role with required permissions. CREATE ROLE assignment WITH SUPERUSER; ALTER ROLE assignment WITH CREATEDB; ALTER ROLE assignment WITH LOGIN; ALTER ROLE assignment WITH CREATEUSER; --create database with USER 'assignment'. CREATE DATABASE assignment WITH OWNER = assignment; --set password for user 'assignment'. ALTER USER assignment WITH PASSWORD 'assignment!123';
CREATE TABLE user ( userID INT NOT NULL, userName varchar (255) UNIQUE NOT NULL, password varchar (255) NOT NULL, deviceName varchar (255) NOT NULL, createdTime timestamp without time zone default now(), latestLogin timestamp without time zone default now(), constraint user_pkey primary key(userID), ) CREATE TABLE deviceInfo ( deviceID INT NOT NULL, deviceName varchar (255) NOT NULL, platform varchar (255) NOT NULL, userID INT NOT NULL, constraint deviceinfo_pkey primary key(deviceID), )
SELECT * FROM "user" /*SELECT 'INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (' + CAST( id AS varchar(50) ) + ', ''' + username + ''', ''' + [name] + ''', ''' + email + ''', date_trunc(''second'', LOCALTIMESTAMP), date_trunc(''second'', LOCALTIMESTAMP), ' + CASE WHEN IsActive = 1 THEN 'true' ELSE 'false' END + ', ''placeholder'');' FROM tblUser ----------------------*/ INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (11, 'dculbert', 'Dave Culbert', 'dculbert@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (7, 'Bay', 'Master Client', 'jim@larkinweb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (10, 'newuser', 'New User', 'jim@larkinweb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (12, 'cmathis', 'Colette Mathis', 'cmathis@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (15, 'joneill', 'John ONeill', 'jponeill@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (17, 'rmathis', 'Rachel Mathis', 'rmathis@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (19, 'dkerr', 'Dave Kerr', 'dkerr@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (22, 'lshafer', 'Luke Shafer', 'luke@flowercitytissue.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (23, 'ebaker', 'Elizabeth Baker', 'elizabeth@geandb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (24, 'cbishop', 'Carmen Bishop', 'carmen@superseal.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (28, 'jyu', 'Joseph Yu', 'joseph.yu@hbc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (29, 'kchu', 'Kam Joi Chu', 'kamjoi.chu@hbc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (31, 'cyan', 'Claire Yan', 'claire.yan@hbc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (32, 'lmorse', 'Laura Morse', 'lmorse@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (34, 'ikhan', 'Imran Khan', 'supplyline@istop.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (35, 'rob', 'Rob', 'jassupply@cogeco.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (37, 'mlash', 'Marty Lash', 'mlash@transco.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (38, 'glopackinc', 'GLOPACKINC', 'STse@glopackinc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (39, 'rlian', 'Rena Lian', 'RLian@glopackinc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (40, 'mlee', 'Mary Lee', 'mlee@bagempackaging.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (43, 'aporter', 'Allison Porter', 'aporter@sutus.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (44, 'smoy', 'Stephanie Moy', 'smoy@recochem.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (48, 'mbillings', 'Michael Billings', 'mbillings@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (49, 'bpajnigara', 'Burzin Pajnigara', 'pajnigara@hotmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (50, 'lstephenson', 'Linda Stephenson', 'linda@mereadesso.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (52, 'larkinjp', 'Jim Larkin', 'jim@larkinweb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (53, 'mhnuta', 'Michael Hnuta', 'mhnuta@bcimporters.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (54, 'jeliashevsky', 'John Eliashevsky', 'mungdahl@magma.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (55, 'vchan', 'Vivian Chan', 'vchan@bcimporters.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (57, 'charles', 'Charles', 'expressgreenpackaging@rogers.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (58, 'lisa', 'Lisa Dell', 'lisa.janmar@sympatico.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (64, 'rmiller', 'Renee Miller', 'rmiller@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (67, 'mps', 'MPS', 'mps@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (68, 'ldalgard', 'Linda Dalgard', 'linda@geandb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (69, 'jwildoner', 'Jamie Wildoner', 'jwildoner@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (70, 'swalker', 'Stephanie Walker', 'swalker@sierrahomeproducts.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (71, 'sbrown', 'Stacie Brown', 'sbrown@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (72, 'rparsons', 'Robin Parsons', 'rparsons@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (76, 'ghahn', 'Greg Hahn', 'greg.hahn@seastone.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (77, 'lgriep', 'Lisa Griep', 'lgriep@seastone.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (79, 'lgilman', 'Lynne Gilman', 'lgilman@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (80, 'kfilippone', 'Kim Filippone', 'kfilippone@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (81, 'malshaweesh', 'Martha Alshaweesh', 'ca_fulfillment@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (82, 'melqabbany', 'Moustafa Elqabbany', 'moustafa@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (84, 'nabushmais', 'Nirmeen Abushmais', 'nirmeen@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (86, 'sensient', 'Sensient', 'sdf.canada@sensient-tech.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (87, 'mrappaport', 'Matthew Rappaport', 'mrappaport@transco.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (88, 'larkin123', 'Jim Larkin', 'jim@larkinweb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (92, 'pgoodwin', 'Paul Goodwin', 'mg.sales@sympatico.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (94, 'rpaterson', 'Rod Paterson', 'info@aspaterson.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (95, 'ablake', 'Arlene Blake', 'ablake@aspaterson.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (98, 'ssharieha', 'Safa Abu Sharieha', 'ssharieha@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (99, 'cyoung', 'Cody Young', 'cody@carmensvacuum.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (100, 'ddurbin', 'Drew Durbin', 'drew@carmensvacuum.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (103, 'plim', 'Pauline Lim', 'pyuping@dongshengfoodsusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (106, 'mpsdist', 'MPS Distributor', 'mps@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (111, 'aalrabie', 'Amina Alrabie', 'amina@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (113, 'rmacphee', 'Rob MacPhee', 'csr@htgriffin.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (120, 'ccrews', 'Chris Crews', 'chrisc@eventivemarketing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (121, 'valerie', 'Valerie Burke', 'valerie.burke@organiccolorsystems.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (123, 'rleguillou', 'Robert Leguillou', 'robert.leguillou@sensient.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (125, 'turlock', 'turlock', 'sally.wiley@sensient.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (127, 'jcolburn', 'James Colburn', 'orders@pbwc.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (130, 'spadidar', 'Sia Padidar', 'cwm@intergate.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (131, 'jwhite', 'Jessica White', 'Jessica@carmensvacuum.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (132, 'dkamien', 'Debbie Kamien', 'dkamien@transco.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (137, 'jmartindill', 'Jennifer Martindill', 'services@sunraygroup.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (138, 'pkoon', 'Prakash Koon', 'prakash_koon_koon@bradycorp.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (139, 'seton', 'Seton', 'DMNAPurchasing@bradycorp.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (142, 'rgrossman', 'Ryan Grossman', 'ryan@maracaibodistribution.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (144, 'maxine', 'Maxine', 'max@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (145, 'pyung', 'Pamela Yung', 'pamela.yung1@pepsico.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (151, 'Laura', 'Laura', 'laura@organiccolorsystems.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (152, 'lflorent', 'Louise Florent', 'louise@florent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (153, 'cflorent', 'Claude Florent', 'claude@florent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (154, 'bkerr', 'Brad Kerr', 'brad@tactical-inc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (157, 'schippa', 'Sabir Chippa', 'impexinternational@sympatico.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (159, 'jpent', 'Giselle Palumbo', 'gpalumbo@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (161, 'nmeyer', 'Nate Meyer', 'nmeyer@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (162, 'eshneur', 'Elana Shneur', 'eshneur@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (163, 'dblack', 'Danielle Black', 'dblack@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (164, 'abrown', 'Anne Brown', 'abrown@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (165, 'ipc', 'Ipc Orders', 'ipcorders@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (166, 'food', 'Scoular Food', 'food@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (168, 'arahmey', 'Albert Rahmey', 'arahmey@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (169, 'kstoyer', 'Keri Stoyer', 'kstoyer@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (170, 'ysmith', 'Yvonne Smith', 'ysmith@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (171, 'kmooney', 'Kris Mooney', 'kmoone@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (172, 'mclemente', 'Mark Clemente', 'mclemente@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (173, 'avalencia', 'Alta Valencia', 'avalen@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (174, 'hluo', 'Haijun Luo', 'hluo@axiombrands.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (175, 'ykorner', 'YellowKorner', 'gc@yellowkorner.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (176, 'rkerr', 'Robert Kerr', 'rjkerr@sympatico.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (177, 'sharvest', 'Season Harvest', 'denise@seasonharvestfoods.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (178, 'marisol', 'Marisol', 'marisol@yellowkorner.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (179, 'psikorski', 'Patti Sikorski', 'patti.sikorski@hbc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (180, 'dalbarq', 'Dalia Albarq', 'dalia@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (181, 'mnaas', 'Mehdi Naas', 'mnaas@axiombrands.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (182, 'elisha', 'Elisha', 'cs@aspaterson.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (184, 'shussien', 'Sumaya Hussien', 'sumaya@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (185, 'mdoucette', 'Melinda Doucette', 'mdoucette@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (186, 'Amanda', 'Amanda', 'Amanda@organiccolorsystems.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (188, 'edweck', 'Ezra Dweck', 'ezra@daicompany.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (189, 'kmclaughlin', 'Kevin Mclaughlin', 'Kevin@golifeworks.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (191, 'emcgrath', 'Euan McGrath', 'euan.mcgrath@sympatico.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (192, 'gtawil', 'George Tawil', 'GeorgeT@gmaaccessories.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (193, 'mng', 'Maggie Ng', 'maggie@accutimewatch.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (194, 'mshama', 'Marc Shama', 'mshama@accutimewatch.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (195, 'rjenetti', 'Robert Jenetti', 'robert@gourmettrading.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (196, 'rstaple', 'Roz Staple', 'roz@smartrink.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (197, 'mthoson', 'Malena Thoson', 'mthoson@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (198, 'ealinas', 'Erick Alinas', 'npsisuppliesmgmt.external@hbc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (202, 'vgualtieri', 'Victoria Gualtieri', 'Victoria@avaises.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (203, 'dvilleda', 'Daniel Villeda', 'dvilleda@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (205, 'lvann', 'Lee-Ann Vann', 'leeannv@superiorfinishesinc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (206, 'jphillips', 'Joann Phillips', 'jphillips@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (207, 'rhansbrar', 'Rani Hans-Brar', 'rhansbrar@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (208, 'fshukayr', 'Farah Shukayr', 'farah.sh@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (209, 'ayeung', 'Adam Yeung', 'adam@giantairsupplies.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (210, 'dtatoy', 'Denver Tatoy', 'Denver.Tatoy@bionime.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (211, 'kpark', 'Kim Park', 'order@superiorfinishesinc.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (213, 'malejo', 'Mary Lou Alejo', 'marylou@jwlamerica.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (215, 'llosada', 'Luis Losada', 'llosada@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (216, 'gsuleiman', 'Ghassan Suleiman', 'ghassan@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (217, 'tdula', 'Tiffany Dula', 'tdula@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (218, 'jlee', 'Justine Lee', 'iconna@netvigator.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (219, 'aharrigan', 'Amy Harrigan', 'aharrigan@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (221, 'jramirez', 'Jose Ramirez', 'jramirez@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (222, 'ashgour', 'Aliaa Shgour', 'aliaa.sh@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (223, 'aburridge', 'Andrea Burridge', 'andrea@mereadesso.com', now(), now(), false, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (224, 'bellery', 'Barbro Ellery', 'barbro@mereadesso.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (228, 'gstratakos', 'Gary Stratakos', 'gary@neo-image.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (229, 'SUNGWHIKIM', 'Sung Whi Kim', 'sungwhikim@gmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (231, 'djaser', 'Dania Jaser', 'dania@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (232, 'aanandani', 'Ash Anandani', 'ash@jwlamerica.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (233, 'rdemko', 'Rich Demko', 'rdemko@jwlamerica.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (234, 'jrodriguez', 'Juan Rodriguez', 'Juanr@jwlamerica.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (235, 'ferani', 'Fred Erani', 'FErani@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (237, 'abrown2', 'Ann Brown', 'abrown@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (238, 'Ecom1', 'Rino', 'spadafina@rogers.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (241, 'thomson', 'Thomson Group', 'sshoemaker@thomsongroup.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (242, 'klai', 'Kristi Lai', 'chankristi@yahoo.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (243, 'SUNGWHIKIM1', 'sung whi client', 'sungwhikim@gmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (244, 'enauth', 'Elisha Nauth', 'cs@aspaterson.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (245, 'drailey', 'Dominique Railey', 'DRailey@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (246, 'shashash', 'Sarah Hashash', 'sarah.ha@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (247, 'msousa', 'Margaret Sousa', 'msousa@classicpkg.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (248, 'hobeidat', 'Haneen Obeidat', 'haneen@shukrclothing.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (249, 'kbarbour', 'Kevin Barbour', 'kbarbour@jpent.com', now(), now(), false, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (250, 'isasson', 'Israel Sasson', 'isasson@accutimewatch.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (251, 'nkarr', 'Nicole Karr', 'Accounts.receivable@rivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (252, 'mzaret', 'Michele Zaret', 'Michele.zaret@rivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (253, 'jstrnad', 'Jim Strnad', 'jstrnad@rivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (254, 'jmooney', 'Jay Mooney', 'jay@mooneysales.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (255, 'rhernandez', 'Rosa Hernandez', 'rosa@rainguard.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (256, 'mlessa', 'Mike Lessa', 'Customer.Service@rivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (257, 'kboudaeva', 'Kristina Boudaeva', 'kristina@kristinsgifts.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (258, 'kanderson', 'Kyle Anderson', 'kyle@mereadesso.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (260, 'bman', 'Bliss Man', 'bliss@monsterfactory.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (262, 'hreider', 'Hayley Reider', 'hreider@scoular.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (263, 'client', 'Test Login', 'test@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (264, 'vsoni', 'Vridula Soni', 'vsoni@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (265, 'jdriehorst', 'Jack Driehorst', 'jdriehorst@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (266, 'lshama', 'Leon Shama', 'lshama@accutimewatch.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (268, 'mimperato', 'Mellissa Imperato', 'mellissa.imperato@yahoo.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (269, 'ibbusa', 'IBB User', 'ibbwal@ibbusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (270, 'IndRivet', 'IndRivet', 'indrivet@indrivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (271, 'pgaskin', 'Peter Gaskin', 'peter@golifeworks.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (273, 'AceRiv', 'Ace Rivet', 'acerivet@acerivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (274, 'StepRiv', 'Stephens Rivet', 'stephens@rivet.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (278, 'tmyers', 'Tonya Myers', 'tmyers@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (279, 'jwalker', 'Jayde Walker', 'jwalker@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (280, 'GTranz', 'Global Tranz', 'scm@globaltranz.com', now(), now(), false, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (281, 'dparker', 'Dee Parker', 'dparker@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (282, '3pl', '3 PL Links', 'dispatch@3pllinks.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (283, 'wrdisplay', 'WR Display', 'mattwalford@wrdisplay.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (284, 'nlau', 'Natalie Lau', 'natalielau@dongshengfoodsusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (285, 'mmissry', 'Michelle Missry', 'mmissry@accutimewatch.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (286, 'JPprod', 'JP Enterprises', 'estachulak@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (287, 'kristin', 'Kristins Gifts', 'info@kristinsgifts.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (288, 'dsomerville', 'David Somerville', 'dsomerville@sterlingmed.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (290, 'gburicea', 'Gabby Buricea', 'gburicea@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (291, 'kburton', 'Kim Burton', 'kimb@roneymk.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (292, 'lhuang', 'Lulu Huang', 'luluhuang@sakoura.net', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (293, 'ccampbell', 'Christian Campbell', 'christian@mereadesso.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (295, 'nwu', 'Ning Wu', 'ning.wu@tycheinternationalgroup.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (296, 'mking', 'Mei King', 'Mei.King@c-lifegroup.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (297, 'mcohen', 'Morris Cohen', 'morris.cohen@c-lifegroup.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (298, 'msalguero', 'Manuela Salguero', 'Manuela.SalgueroGarcia@xt-t.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (299, 'modani', 'Modani', 'iva@modani.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (301, 'jessica', 'Jessica', 'jessica@modani.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (302, 'dpellegrin', 'David Pellegrin', 'davidpellegrin@modani.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (303, 'snapav', 'snapav', 'admin@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (304, 'alfredo', 'Alfredo', 'Edi@golifeworks.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (305, 'ekoh', 'Evon Koh', 'evon.cpg@gmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (306, 'jcohen', 'Joey Cohen', 'joey@creativepetgroup.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (307, 'dpellegrin2', 'David Pellegrin 2', 'purchasing@modani.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (308, 'mkemp', 'Mark Kemp', 'mark.kemp@advpackaging.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (309, 'bmay', 'Brian May', 'brian.may@advpackaging.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (312, 'jhuang', 'John Huang', 'johnhuang@dongshengfoodsusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (313, 'aliu', 'Ansel Liu', 'ansel.liu@spaceways.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (314, 'ssondheimer', 'Sebastian Sondheimer', 'sebastian.sondheimer@spaceways.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (315, 'dfuchs', 'David Fuchs', 'david.fuchs@spaceways.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (316, 'hnjones', 'Hal Neville-Jones', 'hal.neville-jones@spaceways.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (318, 'dwilliams', 'Donna Williams', 'Donna.Williams@advpackaging.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (320, 'anita', 'Anita Giri', 'agiri@jpent.com', now(), now(), false, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (321, 'lpetrenko', 'Lyuba Petrenko', 'lyuba@neo-image.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (322, 'lle', 'Lien Le', 'cs@dongshengfoodsusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (323, 'dbisaccio', 'Doreen Bisaccio', 'doreen@us-group.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (324, 'rmcgiffin', 'Rebecca McGiffin', 'rebecca1@us-group.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (325, 'jquillen', 'John Quillen', 'jquillen@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (326, 'jgarcia', 'Jocelynne Garcia', 'whse@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (327, 'jmcginnis', 'John McGinnis', 'jmcginnis@morbern.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (328, 'cwhitesell', 'Chris Whitsell', 'cwhitesell@morbern.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (329, 'shargett', 'Susie Hargett', 'shargett@morbern.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (331, 'reebok', 'Reebok', 'SBrown@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (332, 'dadams', 'Diane Adams', 'Diane.Adams@advpackaging.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (333, 'mchristie', 'Meghan Christie', 'mchristie@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (334, 'kmithcell', 'Karen Mitchell', 'sales@flowercitytissue.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (335, 'nfidler', 'Nancy Fidler', 'nancyf@hailiangusa.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (336, 'test', 'test', '', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (337, 'dbuie', 'Denise Buie', 'denise@simplyorganicbeauty.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (338, 'kdonovan', 'Kelly Donovan', 'kelly@organiccolorsystems.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (339, 'mshaikh', 'Mubbashir Shaikh', 'magnus.inco@gmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (340, 'cparris', 'Catherine Parris', 'cparris@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (341, 'rb1', 'Reebok Manger 1', 'jim@larkinweb.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (342, 'lrobinson', 'Lynn Robinson', 'lrobinson@wrgtexas.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (343, 'cblouin', 'Christina Blouin', 'cblouin@jpent.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (344, 'bvanjahnke', 'Bill Van Jahnke', 'bill@goliathgames.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (345, 'cmugisha', 'Christian Mugisha', 'christian.mugisha@modani.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (346, 'Jwong', 'Jean Wong', 'jean@mereadesso.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (347, 'skane', 'Shelly Kane', 'skane@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (348, 'BVolk', 'Brian Volk', 'bill@mooneysales.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (349, 'rjohnson', 'Ron Johnson', 'ronjohnson@prestonwoodchristian.org', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (350, 'dtharpe', 'Dan Tharpe', 'dtharpe@prestonwoodchristian.org', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (351, 'Path', 'Path Impact', 'bill@mooneysales.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (352, 'ahawkins', 'Amy Hawkins', 'Amy.Hawkins@mg-dev.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (353, 'dspozarski', 'Danielle Spozarski', 'Danielle.Spozarski@mg-dev.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (354, 'boltsplus', 'Bolts Plus', 'bill@mooneysales.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (355, 'jpdrec', 'Jacmel Rec', 'JPDREC@jacmel.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (356, 'aalighazi', 'Ashraf Alighazi', 'info@dimesproducts.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (357, 'malighazi', 'Maqsud Alighazi', 'MA@dimesproducts.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (358, 'ameltz', 'Adam Meltz', 'adam@cantrio.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (359, 'advir', 'Assaf Dvir', 'assaf@cantrio.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (360, 'tsukraj', 'Tracy Sukraj', 'tracy@cantrio.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (362, 'fnestel', 'Fred Nestel', 'fred.nestel@scouting.org', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (363, 'smirkovic', 'Sandra Mirkovic', 'Sandra@bravoeducation.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (364, 'rmirkovic', 'Rob Mirkovic', 'Rob@bravoeducation.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (365, 'cosmic', 'Cosmic Box', 'cosmicbox@rogers.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (366, 'kinksology', 'Kinksology', 'kinkshairstudioandspa@gmail.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (367, 'mgillum', 'Michelle Gillum', 'MGillum@pak2000.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (368, 'Sagotoys', 'Samson James Lee', 'slee@sagosago.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (369, 'Sago1', 'Nicole Sago', 'sales@sagosago.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (370, 'tharrison', 'Tray Harrison', 'TrayHarr@aol.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (371, 'dsigouin', 'Darren Sigouin', 'darren@cupro.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (372, 'bryan', 'Bryan Cantrio', 'bryan@cantrio.ca', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (373, 'Sensient2', 'Sensient 2', 'sni.inventory@sensient.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (374, 'dmabee', 'Dan Mabee', 'dan.mabee@bcfoods.com', now(), now(), true, 'placeholder'); INSERT INTO "user" (id, username, "name", email, created_at, updated_at, active, password ) VALUES (375, 'dtrigiani', 'David Trigiani', 'davidtrigiani@sbcglobal.net', now(), now(), true, 'placeholder');
/* Navicat MySQL Data Transfer Source Server : mysql Source Server Version : 50553 Source Host : localhost:3306 Source Database : portal Target Server Type : MYSQL Target Server Version : 50553 File Encoding : 65001 Date: 2018-12-28 17:14:34 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for db_cate -- ---------------------------- DROP TABLE IF EXISTS `db_cate`; CREATE TABLE `db_cate` ( `id` int(5) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL COMMENT '分类名', `icon` varchar(255) DEFAULT NULL COMMENT '图标', `create_time` int(11) DEFAULT NULL COMMENT '创建时间', `update_time` int(11) DEFAULT NULL COMMENT '更新时间', `delete_time` int(11) DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='分类大类表'; -- ---------------------------- -- Records of db_cate -- ---------------------------- INSERT INTO `db_cate` VALUES ('1', '内部网站', '#icon-neibuzhanghaoguanli', null, null, null); INSERT INTO `db_cate` VALUES ('2', '对外展示', '#icon-waibulianjie', null, null, null); INSERT INTO `db_cate` VALUES ('3', '前端', '#icon-qianduan', null, null, null); INSERT INTO `db_cate` VALUES ('4', '后端', '#icon-houduanicon', null, null, null); INSERT INTO `db_cate` VALUES ('5', '数据分析', '#icon-shujufenxi', null, null, null); INSERT INTO `db_cate` VALUES ('6', '数据库', '#icon-shujuku1', null, null, null); INSERT INTO `db_cate` VALUES ('7', 'VueJS', '#icon-vuejs', null, null, null); INSERT INTO `db_cate` VALUES ('8', 'Java', '#icon-java1', null, null, null); INSERT INTO `db_cate` VALUES ('9', 'Python', '#icon-python', null, null, null); INSERT INTO `db_cate` VALUES ('10', 'Linux', '#icon-linux', null, null, null); INSERT INTO `db_cate` VALUES ('11', '微信', '#icon-weixin', null, null, null); INSERT INTO `db_cate` VALUES ('12', 'QQ', '#icon-weixin', '1544779037', null, '1544779079'); -- ---------------------------- -- Table structure for db_company -- ---------------------------- DROP TABLE IF EXISTS `db_company`; CREATE TABLE `db_company` ( `id` int(5) NOT NULL DEFAULT '1', `name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司名称', `industry` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属行业', `features` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司性质', `regmoney` int(20) DEFAULT NULL COMMENT '注册资金', `staffnum` int(10) DEFAULT NULL COMMENT '员工人数', `introduce` text COLLATE utf8mb4_unicode_ci COMMENT '公司简介', `contact` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系人', `phonenum` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系人电话', `adress` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司地址', `email` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司邮箱', `mainpage` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司主页', `create_time` int(15) DEFAULT NULL, `update_time` int(15) DEFAULT NULL, `delete_time` int(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of db_company -- ---------------------------- INSERT INTO `db_company` VALUES ('1', 'TD', 'IT', '数据挖掘', '100000000', '10000', 'Teradata天睿公司(纽交所代码:TDC),是美国前十大上市软件公司之一。经过逾30 年的发展,Teradata天睿公司已经成为全球最大的专注于大数据分析、数据仓库和整合营销管理解决方案的供应商之一。\n数量庞大、增长迅猛、种类多样的数据已经成为企业在大数据时代发展不得不面临的现实境况。这是挑战,也是机遇。对此,Teradata天睿公司基于客户需求,提供领先、全面、有效的解决方案,帮助企业获取商业洞察力,并且将之转化为行动力,创造商业价值。', '林小姐', '16575559898', '广州市天河区林和西路161号中泰国际广场B座2303 Teradata(地铁广州东站B2出口)', 'teradata@123.com', 'https://www.teradata.com.cn', '1545963121', '1545963121', null); -- ---------------------------- -- Table structure for db_item -- ---------------------------- DROP TABLE IF EXISTS `db_item`; CREATE TABLE `db_item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cate_id` int(5) DEFAULT NULL COMMENT '分类ID', `name` varchar(255) DEFAULT NULL COMMENT '网站名', `url` varchar(255) DEFAULT NULL COMMENT '网站链接', `desc` varchar(255) DEFAULT NULL COMMENT '描述', `tags` varchar(255) DEFAULT NULL COMMENT '标签', `icon` varchar(255) DEFAULT NULL COMMENT '图标链接', `create_time` int(11) DEFAULT NULL COMMENT '创建时间', `update_time` int(11) DEFAULT NULL COMMENT '更新时间', `delete_time` int(11) DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COMMENT='链接表'; -- ---------------------------- -- Records of db_item -- ---------------------------- INSERT INTO `db_item` VALUES ('1', '1', 'C006-SVN后台', 'http://c006.jwdsk.cn/svnadmin', 'SVN后台', 'C006,SVN', 'http://c006.jwdsk.cn/svnadmin/templates/images/logo.png', null, null, null); INSERT INTO `db_item` VALUES ('2', '1', 'C005-showdoc后台', 'http://c005.jwdsk.cn/showdoc', 'API接口文档制作工具', 'C005,showdoc', 'http://c005.jwdsk.cn/showdoc/web/static/logo/b_64.png', null, null, null); INSERT INTO `db_item` VALUES ('3', '1', 'C006-owncloud私有云', 'http://c006.jwdsk.cn/owncloud', 'owncloud私有云', 'C006,owncloud', 'http://c006.jwdsk.cn/owncloud/core/img/favicon.ico', null, null, null); INSERT INTO `db_item` VALUES ('4', '1', '阿里云-SVN网页后台', 'https://120.76.221.145', 'SVN网页后台', '阿里云,SVN', 'https://120.76.221.145/favicon.ico', null, null, null); INSERT INTO `db_item` VALUES ('5', '1', 'C004-geoserver网页后台(https)', 'https://c004.jwdsk.cn:8443/geoserver/web', 'geoserver网页后台', 'C004,geoserver', 'https://c004.jwdsk.cn:8443/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/favicon-ver-CD7C91844A87FE589C62DFE238A2ACA7.ico', null, null, null); INSERT INTO `db_item` VALUES ('6', '1', 'C004-geoserver网页后台(http)', 'http://c004.jwdsk.cn:8080/geoserver/web', 'geoserver网页后台', 'C004,geoserver', 'http://c004.jwdsk.cn:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/favicon-ver-CD7C91844A87FE589C62DFE238A2ACA7.ico', null, null, null); INSERT INTO `db_item` VALUES ('7', '1', 'C003-geoserver网页后台(http)', 'http://c003.jwdsk.cn:8080/geoserver/web', 'geoserver网页后台', 'C003,geoserver', 'http://c003.jwdsk.cn:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/favicon-ver-CD7C91844A87FE589C62DFE238A2ACA7.ico', null, null, null); INSERT INTO `db_item` VALUES ('8', '1', '阿里云-geoserver网页后台', 'http://120.76.221.145:8080/geoserver/web', 'geoserver网页后台', '阿里云,geoserver', 'http://120.76.221.145:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/favicon-ver-CD7C91844A87FE589C62DFE238A2ACA7.ico', null, null, null); INSERT INTO `db_item` VALUES ('9', '1', '微查岗后台', 'http://c006.jwdsk.cn/shareLoc-backstage', '微查岗后台', 'C006,微查岗', 'http://c006.jwdsk.cn/shareLoc-backstage/Project/Home/View/Public/img/100/2.gif', null, null, null); INSERT INTO `db_item` VALUES ('10', '1', '工作量填写', 'https://docs.qq.com/sheet/DV1pkYkV3d0hhS2NR', '工作量填写', '工作', 'https://sqimg.qq.com/qq_product_operations/tencent-doc/title-icon/title/excel_32x32.png', null, null, null); INSERT INTO `db_item` VALUES ('11', '2', '阿里云-渠道选址平台', 'http://120.76.221.145/herogis/chanelLocation', '渠道选址平台', '阿里云,选址', 'http://120.76.221.145/herogis/chanelLocation/dist/icon.png', null, null, null); INSERT INTO `db_item` VALUES ('25', '2', '小程序网页版', 'https://tdbd.pub', '小程序网页版', '小程序', 'https://tdbd.pub/dist/icon.png', '1542967136', null, null); INSERT INTO `db_item` VALUES ('26', '2', '招聘网页', 'https://tdbd.pub/recruitment', '招聘网站', '招聘', '', '1542967231', null, null); INSERT INTO `db_item` VALUES ('27', '2', 'C004-渠道选址平台', 'https://c004.jwdsk.cn:8443/ChannelAidedLocationSystem/home.action#/index', '渠道选址平台', 'C004,渠道选址平台', 'https://c004.jwdsk.cn:8443/ChannelAidedLocationSystem/dist/icon.png', '1542967296', null, null); INSERT INTO `db_item` VALUES ('28', '2', 'C001-渠道选址平台', 'http://c001.jwdsk.cn/ChannelAidedLocationSystem/home.action#/index', '渠道选址平台', 'C001,渠道选址平台', 'http://c001.jwdsk.cn/ChannelAidedLocationSystem/dist/icon.png', '1542967328', null, null); INSERT INTO `db_item` VALUES ('29', '2', '阿里云-经济地图', 'http://120.76.221.145/econMap/#/', '经济地图', '阿里云,经济地图', 'http://120.76.221.145/econMap/static/city.png', '1542967388', null, null); INSERT INTO `db_item` VALUES ('30', '2', '阿里云-点石成金', 'http://120.76.221.145/locPlatform/#/', '点石成金', '阿里云,点石成金', 'http://120.76.221.145/locPlatform/static/icon.png', '1542967429', null, null); INSERT INTO `db_item` VALUES ('31', '2', '阿里云-合理性分析', 'http://120.76.221.145/herogis/blockChanelLocation/#/index', '合理性分析', '阿里云,合理性分析', 'http://120.76.221.145/herogis/blockChanelLocation/dist/icon.png', '1542967463', null, null); INSERT INTO `db_item` VALUES ('34', '1', '全景后台', 'http://120.76.221.145:8081/VR/index.html', '全景后台', '全景', 'http://120.76.221.145:8081/tomcat.png', '1543305898', null, null); INSERT INTO `db_item` VALUES ('35', '7', 'vuex', 'https://vuex.vuejs.org/', '', '', '', '1544518354', null, '1544778874'); -- ---------------------------- -- Table structure for db_jobs -- ---------------------------- DROP TABLE IF EXISTS `db_jobs`; CREATE TABLE `db_jobs` ( `id` int(5) NOT NULL AUTO_INCREMENT, `job_name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位名称', `job_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '岗位属性', `job_skills` text COLLATE utf8mb4_unicode_ci COMMENT '岗位职能', `create_time` int(15) DEFAULT NULL, `update_time` int(15) DEFAULT NULL, `delete_time` int(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of db_jobs -- ---------------------------- INSERT INTO `db_jobs` VALUES ('1', '微信运营员', '运营岗', '1、 参加基于大数据平台的数据分析、挖掘项目工作;\n2、 负责数据模型建立、数据处理与挖掘工作支撑;\n3、负责数据挖掘算法的验证与测试工。\n任职资格:\n1、 熟练Unix/Linux操作系统,熟悉掌握常用Shell/Python/Perl等脚本工具;\n2、 熟练掌握Unix/Linux C、C++语言编程,精通Java开发语言更佳;\n3、 熟悉Hadoop、Hive、MapReduce、Spark等大数据技术;\n4、 熟练掌握SQL语言查询及优化,熟练使用SPSS clementine、SAS、R语言等常用挖掘工具,熟悉常用经典的等数据挖掘算法;\n5、 具备通信行业背景及相关知识优先,具备中国移动(电信、联通)经分/BI、金融及其他行业数据挖掘项目经验者优先;\n6、 计算机、通信、应用数学相关专业本科及以上毕业。', '1545880259', '1545881634', null); INSERT INTO `db_jobs` VALUES ('3', '数据挖掘', '运营岗', '1、 参加基于大数据平台的数据分析、挖掘项目工作;\n2、 负责数据模型建立、数据处理与挖掘工作支撑;\n3、负责数据挖掘算法的验证与测试工。\n任职资格:\n1、 熟练Unix/Linux操作系统,熟悉掌握常用Shell/Python/Perl等脚本工具;\n2、 熟练掌握Unix/Linux C、C++语言编程,精通Java开发语言更佳;\n3、 熟悉Hadoop、Hive、MapReduce、Spark等大数据技术;\n4、 熟练掌握SQL语言查询及优化,熟练使用SPSS clementine、SAS、R语言等常用挖掘工具,熟悉常用经典的等数据挖掘算法;\n5、 具备通信行业背景及相关知识优先,具备中国移动(电信、联通)经分/BI、金融及其他行业数据挖掘项目经验者优先;\n6、 计算机、通信、应用数学相关专业本科及以上毕业。', '1545906472', '1545906472', null); INSERT INTO `db_jobs` VALUES ('4', '数据挖掘工程师', '技术岗', '1、 参加基于大数据平台的数据分析、挖掘项目工作;\n2、 负责数据模型建立、数据处理与挖掘工作支撑;\n3、负责数据挖掘算法的验证与测试工。\n任职资格:\n1、 熟练Unix/Linux操作系统,熟悉掌握常用Shell/Python/Perl等脚本工具;\n2、 熟练掌握Unix/Linux C、C++语言编程,精通Java开发语言更佳;\n3、 熟悉Hadoop、Hive、MapReduce、Spark等大数据技术;\n4、 熟练掌握SQL语言查询及优化,熟练使用SPSS clementine、SAS、R语言等常用挖掘工具,熟悉常用经典的等数据挖掘算法;\n5、 具备通信行业背景及相关知识优先,具备中国移动(电信、联通)经分/BI、金融及其他行业数据挖掘项目经验者优先;\n6、 计算机、通信、应用数学相关专业本科及以上毕业。', '1545965734', '1545965734', null); -- ---------------------------- -- Table structure for db_recruitment -- ---------------------------- DROP TABLE IF EXISTS `db_recruitment`; CREATE TABLE `db_recruitment` ( `id` int(5) NOT NULL AUTO_INCREMENT COMMENT '招聘岗位ID', `companyid` int(5) DEFAULT NULL COMMENT '公司ID', `education` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学历要求', `treatment` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工资待遇', `jobid` int(5) DEFAULT NULL COMMENT '岗位ID', `number` int(10) DEFAULT NULL COMMENT '招聘人数', `workarea` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '工作地点', `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '招聘标题', `imgs` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片', `essay` text COLLATE utf8mb4_unicode_ci COMMENT '招聘短文', `sendemail` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '简历投递邮箱', `age` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '年龄要求', `create_time` int(15) DEFAULT NULL, `delete_time` int(15) DEFAULT NULL, `update_time` int(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of db_recruitment -- ---------------------------- INSERT INTO `db_recruitment` VALUES ('10', '1', '研究生', '5000+', '1', '10', '广州越秀区', 'teratata校招啦', '/uploads/20181228/c4b303701dee4dfc108a62502fb016b1.jpg', '大声道撒大撒多付', '45454524545@qq.com', '30以内', '1545985080', null, '1545985080'); INSERT INTO `db_recruitment` VALUES ('11', '1', '研究生', '5000+', '2', '10', '广州越秀区', 'teratata校招啦', '/uploads/20181228/3dd19453c69d7dac0b6cbb674a17ffec.jpg,/uploads/20181228/1951193fe2017d1207e4d642ba51b9b6.jpg,/uploads/20181228/60871dfa3852bab4b4cbaac2b334daa7.jpg', '大声道撒大撒多付', '45454524545@qq.com', '30以内', '1545985123', null, '1545986493'); -- ---------------------------- -- Table structure for db_staff -- ---------------------------- DROP TABLE IF EXISTS `db_staff`; CREATE TABLE `db_staff` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '姓名', `img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '头像', `company` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '公司', `itemgroup` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '项目小组', `position` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '职位', `school` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '毕业学校', `major` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '专业', `keyword` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '关键词', `phone` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系方式', `education` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '学历', `jointime` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '入职时间', `leavetime` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '离职时间', `create_time` int(15) DEFAULT NULL, `update_time` int(15) DEFAULT NULL, `delete_time` int(15) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- ---------------------------- -- Records of db_staff -- ---------------------------- INSERT INTO `db_staff` VALUES ('2', '大大', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1544769076', null, null); INSERT INTO `db_staff` VALUES ('21', '大xiao', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1545881337', '1545881337', null); INSERT INTO `db_staff` VALUES ('3', '大大', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1544770756', null, null); INSERT INTO `db_staff` VALUES ('4', '大xiao', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1544770756', '1544780235', null); INSERT INTO `db_staff` VALUES ('5', '大大', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1544770757', null, '1544772496'); INSERT INTO `db_staff` VALUES ('6', '大大', '/uploads/img/moren.jpg', 'teradata', 'CMCC', '前端工程师', '广工', '软件工程', '大方美丽善良可爱', '13537116097', '本科', '2018/12/03', null, '1544770754', null, '1544772466'); -- ---------------------------- -- Table structure for db_user -- ---------------------------- DROP TABLE IF EXISTS `db_user`; CREATE TABLE `db_user` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `username` varchar(100) DEFAULT NULL COMMENT '管理后台账号', `password` varchar(100) DEFAULT NULL COMMENT '管理后台密码', `remark` varchar(100) DEFAULT NULL COMMENT '用户备注', `create_time` int(11) DEFAULT NULL, `realname` varchar(100) DEFAULT NULL COMMENT '真实姓名', `structure_id` int(11) DEFAULT NULL COMMENT '部门', `post_id` int(11) DEFAULT NULL COMMENT '岗位', `status` tinyint(3) DEFAULT NULL COMMENT '状态,1启用0禁用', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of db_user -- ---------------------------- INSERT INTO `db_user` VALUES ('1', '见闻', '0ed9a50281e0b5f49ceacebde948cc24', '', '1543214996', '超级管理员', '1', '1', '1'); INSERT INTO `db_user` VALUES ('2', '王星宇', '0ed9a50281e0b5f49ceacebde948cc24', null, '1543214996', '王星宇', null, null, '1'); INSERT INTO `db_user` VALUES ('6', 'jiang', '14fc9fa1826e16baeda6832ecbaafa2c', '1', '1544779190', 'jiang', '1', '1', '1');
-- MySQL Script generated by MySQL Workbench -- Thu Jul 1 20:44:06 2021 -- Model: New Model Version: 1.0 -- 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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema agendame -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema agendame -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `agendame` DEFAULT CHARACTER SET utf8mb4 ; USE `agendame` ; -- ----------------------------------------------------- -- Table `agendame`.`usuarios` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `agendame`.`usuarios` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `nombes` VARCHAR(40) NULL DEFAULT NULL, `apellidos` VARCHAR(50) NULL DEFAULT NULL, `fechanac` DATE NULL DEFAULT NULL, `ocupacion` CHAR(50) NULL DEFAULT NULL, `email` VARCHAR(60) NULL DEFAULT NULL, `clave` VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `email` (`email` ASC)) ENGINE = InnoDB AUTO_INCREMENT = 15 DEFAULT CHARACTER SET = utf8mb4; -- ----------------------------------------------------- -- Table `agendame`.`eventos` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `agendame`.`eventos` ( `idevento` INT(11) NOT NULL AUTO_INCREMENT, `idusuario` INT(11) NULL DEFAULT NULL, `fecha` DATE NULL DEFAULT NULL, `hora` CHAR(10) NULL DEFAULT NULL, `fecha_hora` DATETIME NULL DEFAULT NULL, `descripcion` VARCHAR(500) NULL DEFAULT NULL, `lugar` VARCHAR(250) NULL DEFAULT NULL, PRIMARY KEY (`idevento`), INDEX `idusuario` (`idusuario` ASC), CONSTRAINT `eventos_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `agendame`.`usuarios` (`id`)) ENGINE = InnoDB AUTO_INCREMENT = 202 DEFAULT CHARACTER SET = utf8mb4; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
select * from sakila.country order by country asc; select * from sakila.customer order by first_name asc;
-- • Find the locations that receive at least 5 ratings of “5” in Dec 2020, and order them by their average ratings. SELECT Location.location_id, name, AVG(CAST(checkout_rating AS FLOAT)) AS AvgRating FROM Location, CheckInOut WHERE Location.location_id = CheckInOut.location_id AND Location.location_id IN (SELECT location_id FROM CheckInOut WHERE checkout_rating = 5 AND MONTH(checkout_time) = 12 AND YEAR(checkout_time) = 2020 GROUP BY location_id HAVING COUNT(*) >= 5) GROUP BY Location.location_id, name ORDER BY AVG(CAST(checkout_rating AS FLOAT)) DESC ; --• Find the companies whose posts have received the most number of comments for each week of the past month. SELECT CONVERT(DATE, DATEADD(week, DATEDIFF(week, 0, comment_timestamp - 1), 0)) AS WeekStart, company_id, company_name, COUNT(comment_id) AS NumComments FROM Company AS C1, Post, Comment AS X WHERE C1.contact_person_id = Post.person_id AND Post.post_id = X.post_id AND comment_timestamp <= GETDATE() AND comment_timestamp >= DATEADD(month, -1, GETDATE()) GROUP BY DATEPART(week, X.comment_timestamp), DATEADD(week, DATEDIFF(week, 0, comment_timestamp - 1), 0), company_id, company_name HAVING COUNT(comment_id) >= ALL ( SELECT COUNT(comment_id) FROM Comment AS Y, Company AS C2, Post WHERE C2.contact_person_id = Post.person_id AND Post.post_id = Y.post_id AND DATEPART(week, Y.comment_timestamp) = DATEPART(week, X.comment_timestamp) AND C1.company_id <> C2.company_id GROUP BY company_id ) ORDER BY DATEPART(week, X.comment_timestamp); COMMIT;
BEGIN null; END; /
CLEAR SCREEN; SET SERVEROUTPUT ON; SET FEEDBACK ON; DECLARE rb RMAN_RULEBLOCKS%ROWTYPE; BEGIN -- BEGINNING OF RULEBLOCK -- rb.blockid:='cd_cardiac_vte'; DELETE FROM rman_ruleblocks WHERE blockid=rb.blockid; rb.picoruleblock:=' /* Algorithm to assess VTE */ #define_ruleblock([[rb_id]], { description: "Algorithm to assess VTE", is_active:2 } ); #doc(,{ section:"Pulmonary embolism" }); pe_fd => eadv.[icd_i26%,icpc_k93002].dt.min(); pe_ld => eadv.[icd_i26%,icpc_k93002].dt.max(); pe_multi : { pe_ld - pe_fd > 90 =>1},{=>0}; dvt_fd => eadv.[icd_i82_2,icd_i82_3,icd_82_9].dt.min(); svt_fd => eadv.[icd_i82_8].dt.min(); budd_chiari_fd =>eadv.[icd_i82_0].dt.min(); #doc(,{ txt:" anticoagulation" }); rxn_anticoag_dt => eadv.[rxnc_b01aa,rxnc_b01af,rxnc_b01ae,rxnc_b01ab].dt.min().where(val=1); rxn_anticoag : { rxn_anticoag_dt!? => 1},{=>0}; [[rb_id]] : { coalesce(pe_fd,dvt_fd,budd_chiari_fd,svt_fd)!? =>1},{=>0}; #define_attribute( [[rb_id]], { label:"VTE", desc:"Venous-thrombo embolism", is_reportable:1, type:2 } ); '; rb.picoruleblock := replace(rb.picoruleblock,'[[rb_id]]',rb.blockid); rb.picoruleblock:=rman_pckg.sanitise_clob(rb.picoruleblock); INSERT INTO rman_ruleblocks(blockid,picoruleblock) VALUES(rb.blockid,rb.picoruleblock); COMMIT; -- END OF RULEBLOCK -- END;
1. SELECT id, title FROM movie WHERE yr = 1962; 2. SELECT yr FROM movie WHERE title = 'Citizen Kane'; 3. SELECT id, title, yr FROM movie WHERE title LIKE '%Star Trek%' ORDER BY yr 4. SELECT title FROM movie WHERE id IN (11768, 11955, 21191); 5. SELECT id FROM actor WHERE name = 'Glenn Close'; 6. SELECT id FROM movie WHERE title = 'Casablanca'; 7. SELECT name FROM actor JOIN casting ON id = actorid WHERE movieid = 11768; 8. SELECT name FROM actor JOIN casting ON id = actorid WHERE movieid = (SELECT id FROM movie WHERE title = 'Alien'); 9. SELECT title FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid WHERE actor.name = 'Harrison Ford'; 10. SELECT title FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid WHERE actor.name = 'Harrison Ford' AND ord != 1; 11. SELECT title, name FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid WHERE ord = 1 AND yr = 1962; 12. SELECT yr,COUNT(title) FROM movie JOIN casting ON movie.id=movieid JOIN actor ON actorid=actor.id WHERE name='John Travolta' GROUP BY yr HAVING COUNT(title) > 2 13. SELECT title, name FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid WHERE movie.id IN ( SELECT DISTINCT movie.id FROM movie JOIN casting ON movie.id = movieid JOIN actor on actor.id = actorid WHERE actor.name = 'Julie Andrews' ) AND ord = 1; 14. SELECT name FROM casting JOIN actor ON casting.actorid = actor.id WHERE ord = 1 GROUP BY actorid HAVING COUNT(actorid)>=30 ORDER BY name; 15. SELECT title, cast FROM movie JOIN ( SELECT movieid, COUNT(actorid) AS cast FROM casting GROUP BY movieid)AS q ON movieid = movie.id WHERE yr = 1978 GROUP BY movieid ORDER BY cast DESC, title ASC 16. SELECT name FROM actor JOIN casting ON actor.id = actorid WHERE movieid IN (SELECT movieid FROM casting WHERE actorid = ( SELECT id FROM actor WHERE name = 'Art Garfunkel') ) AND name <> 'Art Garfunkel';
SELECT --契約番号 APPLY.CONTRACT_NO AS contractNo, --支払番号 PAY.PAY_NO AS payNo, --期間From PAY.PERIOD_FROM AS periodFrom, --期間To PAY.PERIOD_TO AS periodTo, --支払ベース金額 PAY.PAY_BASE_AMOUNT AS payBaseAmount, --支払基準利率 PAY.PAY_BASE_PERCENTAGE AS payBasepercentage, --支払予定金額 PAY.PAY_SCHEDULED_AMOUNT AS payScheduledAmount, --申請状況 APPLY.APPLY_STATE AS status, --顧客_名称 APPLY.CUSTOMER_NAME AS customerName, --物件名称 APPLY_SUPPLIES.SUPPLIES_NAME AS suppliesName, --支払総回数 OTHER_PAY.PAY_COUPON AS payCoupon FROM --支払予定情報 APPLY_PAY_INFO PAY, --申請情報 APPLY_INFO APPLY, --申請物件情報 APPLY_SUPPLIES_INFO APPLY_SUPPLIES, --子支払情報 (SELECT --COUNT(支払番号) COUNT(PAY_NO) AS PAY_COUPON, --申請番号 APPLY_NO, --物件番号 SUPPLIES_NO, --支払小分類 PAY_TYPE_DETAIL FROM APPLY_PAY_INFO WHERE --支払情報.支払小分類=31:保険料(包括) PAY_TYPE_DETAIL=CAST(/*payTypeDetail*/ AS CHAR(2)) GROUP BY APPLY_NO,SUPPLIES_NO,PAY_TYPE_DETAIL )AS OTHER_PAY WHERE --支払情報.支払種別=3:保険料 AND PAY.PAY_TYPE=CAST(/*payType*/ AS CHAR(1)) AND --支払予定情報.期間From>=パラメータ.開始日 AND PAY.PERIOD_FROM>=/*startDate*/ AND --支払予定情報.申請番号=申請物件情報.申請番号 AND PAY.APPLY_NO=APPLY_SUPPLIES.APPLY_NO AND --支払予定情報.物件番号=申請物件情報.物件番号 AND PAY.SUPPLIES_NO=APPLY_SUPPLIES.SUPPLIES_NO AND --申請物件情報.保険会社_取引先コード=パラメータ.保険会社_取引先コード AND /*IF(dto.customerCodeSearch!=null)*/ APPLY_SUPPLIES.INSURANCE_COMPANY_CODE=/*dto.customerCodeSearch*/ AND /*END*/ --申請物件情報.保険種類 IN (パラメータ.保険種類IDリスト) AND APPLY_SUPPLIES.INSURANCE_TYPE IN /*dto.insuranceTypes*/() AND --支払予定情報.申請番号=申請情報.申請番号 AND PAY.APPLY_NO=APPLY.APPLY_NO AND --申請情報.申請状況<>10:決裁済 AND APPLY.APPLY_STATE<>CAST(/*applyState*/ AS CHAR(2)) AND --申請情報.取消状況=1:未取消 AND APPLY.CANCAL_STATE=CAST(/*cancalState*/ AS CHAR(1)) AND --支払予定情報.申請番号=子支払予定情報.申請番号 AND PAY.APPLY_NO=OTHER_PAY.APPLY_NO AND --支払予定情報.物件番号=子支払予定情報.物件番号 AND PAY.SUPPLIES_NO=OTHER_PAY.SUPPLIES_NO AND --支払予定情報.支払小分類=子支払予定情報.支払小分類 PAY.PAY_TYPE_DETAIL=OTHER_PAY.PAY_TYPE_DETAIL ORDER BY contractNo ASC
TRUNCATE picturades_words, picturades_lists, picturades_users RESTART IDENTITY CASCADE;
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 25, 2019 at 07:44 AM -- Server version: 10.1.29-MariaDB -- PHP Version: 7.1.12 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: `myshop` -- -- -------------------------------------------------------- -- -- Table structure for table `brands` -- CREATE TABLE `brands` ( `brand_id` int(11) NOT NULL, `brand_title` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `brands` -- INSERT INTO `brands` (`brand_id`, `brand_title`) VALUES (1, 'sony'), (2, 'nokia'), (3, 'dell'), (4, 'ipad'); -- -------------------------------------------------------- -- -- Table structure for table `cart` -- CREATE TABLE `cart` ( `p_id` int(11) NOT NULL, `ip_title` int(11) NOT NULL, `qty` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `cat_id` int(50) NOT NULL, `cat_title` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`cat_id`, `cat_title`) VALUES (1, 'computer'), (2, 'laptope'), (3, 'cameras'), (4, 'tables\r\n'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `product_id` int(50) NOT NULL, `cat_id` int(40) NOT NULL, `band_id` int(20) NOT NULL, `date` datetime(6) NOT NULL, `product_title` text NOT NULL, `product_img1` text NOT NULL, `product_img2` text NOT NULL, `product_price` int(50) NOT NULL, `product_des` text NOT NULL, `status` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `brands` -- ALTER TABLE `brands` ADD PRIMARY KEY (`brand_id`); -- -- Indexes for table `cart` -- ALTER TABLE `cart` ADD PRIMARY KEY (`p_id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`cat_id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`product_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
drop table vehicle cascade; create table vehicle( islandId int4 PRIMARY KEY, serviceNo varchar(64), category varchar(20), tonage int2, numberOfSeats int2, apartPlace varchar(100), terminalPlace varchar(100) );
ALTER TABLE media_content DROP COLUMN uri;
angle/* * This is actually the exact opposite case from Draw the Triangle 1! Only new trick here * is to make sure we add an upperbound on our SELECT statement so that it stops printing at 20. */ SET @NUMBER_OF_ASTERISKS_IN_ROW:=0; SELECT REPEAT('* ', @NUMBER_OF_ASTERISKS_IN_ROW:= @NUMBER_OF_ASTERISKS_IN_ROW + 1) FROM INFORMATION_SCHEMA.TABLES WHERE @NUMBER_OF_ASTERISKS_IN_ROW < 20;
group_subjects subject_id, group_id groups group_id, name_group students student_id, firstname, lastname, group_id students_progress student_id, subject_id, progress subjects subject_id, name, description teachers teacher_id, firstname, lastname, subject_id, experience CREATE TABLE groups( group_id int PRIMARY KEY AUTO_INCREMENT, name_group VARCHAR(45) UNIQUE NOT NULL ); CREATE TABLE students( student_id int PRIMARY KEY AUTO_INCREMENT, firstname VARCHAR(20), lastname VARCHAR(20), group_id int, FOREIGN KEY(group_id) REFERENCES groups(group_id) ); CREATE TABLE subjects( subject_id int PRIMARY KEY AUTO_INCREMENT, name VARCHAR(45), description VARCHAR(45) ); CREATE TABLE teachers( teacher_id int PRIMARY KEY AUTO_INCREMENT, firstname VARCHAR(20), lastname VARCHAR(20), subject_id int, experience int, FOREIGN KEY(subject_id) REFERENCES subjects(subject_id) ); CREATE TABLE group_subjects( subject_id int, group_id int, FOREIGN KEY(subject_id) REFERENCES subjects(subject_id), FOREIGN KEY(group_id) REFERENCES groups(group_id) ); CREATE TABLE students_progress( student_id int, subject_id int, progress int NOT NULL, FOREIGN KEY(subject_id) REFERENCES subjects(subject_id), FOREIGN KEY(student_id) REFERENCES students(student_id) ); --default values for tests INSERT INTO groups(group_name) VALUES('IAP101'); INSERT INTO groups(group_name) VALUES('IKIT101'); INSERT INTO students(first_name, last_name, group_id) VALUES('Alex', 'Browko', 1); INSERT INTO students(first_name, last_name, group_id) VALUES('Dima', 'Vasiliv', 2); INSERT INTO students(first_name, last_name, group_id) VALUES('Oleg', 'Vorona', 2); INSERT INTO students(first_name, last_name, group_id) VALUES('Katja', 'Kirko', 1); INSERT INTO subjects(subject_name, description) VALUES('Math', 'Technical'); INSERT INTO subjects(subject_name, description) VALUES('Eanglish', 'Humanities'); INSERT INTO subjects(subject_name, description) VALUES('History', 'Humanities'); INSERT INTO subjects(subject_name, description) VALUES('Programming', 'Technical'); INSERT INTO subjects(subject_name, description) VALUES('Construction', 'Technical'); INSERT INTO teachers(first_name, last_name, subject_id, experience) VALUES('Irina', 'Holovko', 1, 12); INSERT INTO teachers(first_name, last_name, subject_id, experience) VALUES('Igor', 'Voevoda', 3, 21); INSERT INTO teachers(first_name, last_name, subject_id, experience) VALUES('Lidia', 'Ivanova', 2, 18); INSERT INTO teachers(first_name, last_name, subject_id, experience) VALUES('Kolja', 'Barkar', 4, 25); INSERT INTO teachers(first_name, last_name, subject_id, experience) VALUES('Pasha', 'Stepanenko', 5, 34); INSERT INTO group_subjects(subject_id, group_id) VALUES(1, 1); INSERT INTO group_subjects(subject_id, group_id) VALUES(1, 2); INSERT INTO group_subjects(subject_id, group_id) VALUES(2, 1); INSERT INTO group_subjects(subject_id, group_id) VALUES(2, 2); INSERT INTO group_subjects(subject_id, group_id) VALUES(3, 1); INSERT INTO group_subjects(subject_id, group_id) VALUES(3, 2); INSERT INTO group_subjects(subject_id, group_id) VALUES(4, 2); INSERT INTO group_subjects(subject_id, group_id) VALUES(5, 1); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(1, 1, 87); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(1, 2, 88); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(1, 3, 76); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(1, 5, 90); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(2, 1, 87); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(2, 2, 88); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(2, 3, 91); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(2, 4, 92); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(3, 1, 78); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(3, 2, 74); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(3, 3, 65); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(3, 4, 89); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(4, 1, 90); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(4, 2, 76); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(4, 3, 82); INSERT INTO student_progress(student_id, subject_id, mark) VALUES(4, 5, 91);
CREATE DATABASE project2; \c project2; CREATE TABLE mode ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(20) NOT NULL, ); CREATE TABLE descriptions ( id SERIAL PRIMARY KEY NOT NULL, mode_id SERIAL REFERENCES mode(id) NOT NULL, tone VARCHAR(50) NOT NULL ); CREATE TABLE alterations ( id SERIAL PRIMARY KEY NOT NULL, mode_id SERIAL REFERENCES mode(id) NOT NULL, alter_2 SMALLINT NOT NULL, alter_3 SMALLINT NOT NULL, alter_4 SMALLINT NOT NULL, alter_5 SMALLINT NOT NULL, alter_6 SMALLINT NOT NULL, alter_7 SMALLINT NOT NULL, mood_1 SMALLINT NOT NULL, mood_2 SMALLINT NOT NULL, mood_3 SMALLINT NOT NULL, mood_4 SMALLINT NOT NULL, mood_5 SMALLINT NOT NULL, mood_6 SMALLINT NOT NULL, mood_7 SMALLINT NOT NULL ); INSERT INTO mode(name) VALUES ('Ionian'), ('Lydian'), ('Mixolydian'), ('Dorian'), ('Aeolian'), ('Phrygian'), ('Locarian'), ('Major Pentatonic'), ('Minor Pentatonic'), ('Major Blues Scale'), ('Minor Blues Scale'); INSERT INTO descriptions(mode_id, tone) VALUES ('1','Neutral'), ('1','Good Time'), ('1','Positive'), ('2','Bright'), ('2','Triumphant'), ('2','Sharp'), ('3','Less Bright'), ('3','Bluesy'), ('3','Fun'), ('4','Dark'), ('4','Sexy'), ('4','Edgy'), ('5','Darker'), ('5','Melancholy'), ('5','Dramatic'), ('6','Darkest'), ('6','Introspective'), ('6','Defiant'), ('7','Mostly Unusable'), ('7','Gloomy'), ('7','Restless'); INSERT INTO alterations(mode_id, alter_2, alter_3, alter_4, alter_5, alter_6, alter_7, mood_1, mood_2, mood_3, mood_4, mood_5, mood_6, mood_7) VALUES ('1', '0','0','0','0','0','0', '1','0','0','1','1','0','2'), ('2', '0','0','1','0','0','0', '1','1','0','2','1','0','0'), ('3', '0','0','0','0','0','-1', '1','0','2','1','0','0','1'), ('4', '0','-1','0','0','0','-1', '0','0','1','1','0','2','1'), ('5', '0','-1','0','0','-1','-1', '0','2','1','0','0','1','1'), ('6', '-1','-1','0','0','-1','-1', '0','1','1','0','2','1','0'), ('7', '-1','-1','0','-1','-1','-1', '2','1','0','0','1','1','1'); CREATE USER critter WITH PASSWORD 'critter'; GRANT SELECT, INSERT, UPDATE ON mode TO critter; GRANT USAGE, SELECT ON SEQUENCE mode_id_seq TO critter;
ALTER TABLE COMM_SCHEDULE_MINUTES ADD IACUC_PROTOCOL_ID_FK NUMBER(12,0) NULL / ALTER TABLE COMM_SCHEDULE_MINUTES ADD IACUC_SUBMISSION_ID_FK NUMBER(12,0) NULL / ALTER TABLE COMM_SCHEDULE_MINUTES ADD IACUC_PROTOCOL_ONLN_RVW_FK NUMBER(12,0) NULL / ALTER TABLE COMM_SCHEDULE_MINUTES ADD IACUC_REVIEWER_ID_FK NUMBER(12,0) NULL /
CREATE directory ONE_XML AS 'C:\Users\luc\Documents\GitHub\luc-PLSQL\XML'; grant read, write on DIRECTORY ONE_XML to Test;
--Criação do banco de dados create table clientes ( cpf char(11) unique, nome varchar(150) ); create table vendedores ( cpf char(11) unique, nome varchar(150) ); create table pedidos ( id serial primary key, valor int, cliente_cpf char(11) not null references clientes(cpf), vendedor_cpf char(11) not null references vendedores(cpf) ); create table categorias ( id serial primary key, nome varchar(50) ); create table produtos ( id serial primary key, nome varchar(100), descricao text, preco int, quantidade_em_estoque int, categoria_id int not null references categorias(id) ); create table itens_do_pedido ( id serial primary key, pedido_id int not null references pedidos(id), quantidade int, produto_id int not null references produtos(id) ); --01 insert into categorias (nome) values ('frutas'), ('verduras'), ('massas'), ('bebidas'), ('utilidades'); --02 insert into produtos (nome, descricao, preco, quantidade_em_estoque, categoria_id) values ('Mamão', 'Rico em vitamina A, potássio e vitamina C', 300, 123, 1), ('Maça', 'Fonte de potássio e fibras.', 90, 34, 1), ('Cebola', 'Rico em quercetina, antocianinas, vitaminas do complexo B, C.', 50, 76, 2), ('Abacate', 'NÃO CONTÉM GLÚTEN.', 150, 64, 1), ('Tomate', 'Rico em vitaminas A, B e C.', 125, 88, 2), ('Acelga', 'NÃO CONTÉM GLÚTEN.', 235, 13, 2), ('Macarrão parafuso', 'Sêmola de trigo enriquecida com ferro e ácido fólico, ovos e corantes naturais', 690, 5, 3), ('Massa para lasanha', 'Uma reunião de família precisa ter comida boa e muita alegria.', 875, 19, 3), ('Refrigerante coca cola lata', 'Sabor original', 350, 189, 4), ('Refrigerante Pepsi 2l', 'NÃO CONTÉM GLÚTEN. NÃO ALCOÓLICO.', 700, 12, 4), ('Cerveja Heineken 600ml', 'Heineken é uma cerveja lager Puro Malte, refrescante e de cor amarelo-dourado', 1200, 500, 4), ('Agua mineral sem gás', 'Smartwater é água adicionado de sais mineirais (cálcio, potássio e magnésio) livre de sódio e com pH neutro.', 130, 478, 4), ('Vassoura', 'Pigmento, matéria sintética e metal.', 2350, 30, 5), ('Saco para lixo', 'Reforçado para garantir mais segurança', 1340, 90, 5), ('Escova dental', 'Faça uma limpeza profunda com a tecnologia inovadora', 1000, 44, 5), ('Balde para lixo 50l', 'Possui tampa e fabricado com material reciclado', 2290, 55, 5), ('Manga', 'Rico em Vitamina A, potássio e vitamina C', 198, 176, 1), ('Uva', 'NÃO CONTÉM GLÚTEN.', 420, 90, 1); --03 insert into clientes (cpf, nome) values ('80371350042', 'José Augusto Silva'), ('67642869061', 'Antonio Oliveira'), ('63193310034', 'Ana Rodrigues'), ('75670505018', 'Maria da Conceição'); --04 insert into vendedores (cpf, nome) values ('82539841031', 'Rodrigo Sampaio'), ('23262546003', 'Beatriz Souza Santos'), ('28007155023', 'Carlos Eduardo'); --05 --Vendas --1ª Venda insert into pedidos (valor, cliente_cpf, vendedor_cpf) values (9650, '80371350042', '28007155023'); insert into itens_do_pedido (pedido_id, quantidade, produto_id) values (1, 1, 1), (1, 1, 10), (1, 6, 11), (1, 1, 15), (1, 5, 2); update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=1; update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=10; update produtos set quantidade_em_estoque = quantidade_em_estoque - 6 where id=11; update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=15; update produtos set quantidade_em_estoque = quantidade_em_estoque - 5 where id=2; --2ª Venda insert into pedidos (valor, cliente_cpf, vendedor_cpf) values (6460, '63193310034', '23262546003'); insert into itens_do_pedido (pedido_id, quantidade, produto_id) values (2, 10, 17),(2, 3, 18), (2, 5, 1), (2, 10, 5), (2, 2, 6); update produtos set quantidade_em_estoque = quantidade_em_estoque - 10 where id=17; update produtos set quantidade_em_estoque = quantidade_em_estoque - 3 where id=18; update produtos set quantidade_em_estoque = quantidade_em_estoque - 5 where id=1; update produtos set quantidade_em_estoque = quantidade_em_estoque - 10 where id=5; update produtos set quantidade_em_estoque = quantidade_em_estoque - 2 where id=6; --3ª Venda insert into pedidos (valor, cliente_cpf, vendedor_cpf) values (4120, '75670505018', '23262546003'); insert into itens_do_pedido (pedido_id, quantidade, produto_id) values (3, 1, 13), (3, 6, 12), (3, 5, 17); update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=13; update produtos set quantidade_em_estoque = quantidade_em_estoque - 6 where id=12; update produtos set quantidade_em_estoque = quantidade_em_estoque - 5 where id=17; --4ª Venda insert into pedidos (valor, cliente_cpf, vendedor_cpf) values (7120, '75670505018', '82539841031'); insert into itens_do_pedido (pedido_id, quantidade, produto_id) values (4, 1, 16), (4, 6, 18), (4, 1, 7), (4, 3, 1), (4, 20, 5), (4, 2, 6); update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=16; update produtos set quantidade_em_estoque = quantidade_em_estoque - 8 where id=18; update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=7; update produtos set quantidade_em_estoque = quantidade_em_estoque - 3 where id=1; update produtos set quantidade_em_estoque = quantidade_em_estoque - 20 where id=5; update produtos set quantidade_em_estoque = quantidade_em_estoque - 2 where id=6; --5ª Venda insert into pedidos (valor, cliente_cpf, vendedor_cpf) values (9129, '67642869061', '82539841031'); insert into itens_do_pedido (pedido_id, quantidade, produto_id) values (5, 8, 18), (5, 1, 8), (5, 3, 17), (5, 8, 5), (5, 2, 11); update produtos set quantidade_em_estoque = quantidade_em_estoque - 8 where id=18; update produtos set quantidade_em_estoque = quantidade_em_estoque - 1 where id=8; update produtos set quantidade_em_estoque = quantidade_em_estoque - 3 where id=17; update produtos set quantidade_em_estoque = quantidade_em_estoque - 8 where id=5; update produtos set quantidade_em_estoque = quantidade_em_estoque - 2 where id=11; --06 --a select produtos.nome as produtos, categorias.nome as categorias from produtos left join categorias on produtos.id = categorias.id; --b select clientes.nome as clientes, vendedores.nome as vendedores from pedidos left join clientes on pedidos.cliente_cpf = clientes.cpf left join vendedores on pedidos.vendedor_cpf = vendedores.cpf; --c select categorias.nome, sum(produtos.quantidade_em_estoque) from categorias left join produtos on categorias.id = produtos.categoria_id group by categorias.nome; --d select produtos.nome, sum(itens_do_pedido.quantidade) as quantidade_vendida from produtos left join itens_do_pedido on produtos.id = itens_do_pedido.produto_id group by produtos.nome;
-- MySQL Script generated by MySQL Workbench -- Sat Jun 2 16:44:56 2018 -- Model: New Model Version: 1.0 -- 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 hackson -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema hackson -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `hackson` DEFAULT CHARACTER SET utf8 ; USE `hackson` ; -- ----------------------------------------------------- -- Table `hackson`.`user` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`user` ( `openid` VARCHAR(45) NOT NULL, `name` VARCHAR(45) NULL, `birthday` DATE NULL, `role` VARCHAR(45) NULL, `family_id` VARCHAR(45) NULL, PRIMARY KEY (`openid`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`family` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`family` ( `id` INT NOT NULL, `name` VARCHAR(45) NULL, `count` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`scene` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`scene` ( `id` INT NOT NULL, `name` VARCHAR(45) NULL, `description` VARCHAR(200) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`templete` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`templete` ( `id` INT NOT NULL, `name` VARCHAR(45) NULL, `scene_id` VARCHAR(45) NULL, `description` VARCHAR(200) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`markday` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`markday` ( `id` INT NOT NULL, `date` DATE NULL, `name` VARCHAR(45) NULL, `user_id` VARCHAR(45) NULL, `family_id` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`imageList` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`imageList` ( `id` INT NOT NULL AUTO_INCREMENT, `uri` VARCHAR(45) NULL, `user_id` VARCHAR(45) NULL, `to_id` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`voiceList` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`voiceList` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` VARCHAR(45) NULL, `uri` VARCHAR(45) NULL, `to_id` VARCHAR(45) NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `hackson`.`message` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `hackson`.`message` ( `id` INT NOT NULL AUTO_INCREMENT, `from_id` VARCHAR(45) NULL, `to_id` VARCHAR(45) NULL, `templete_type` INT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
use amha2_TL create table Librarian ( librarianID int not null IDENTITY PRIMARY KEY, fName varchar(32), lName varchar(32), DOB date, uName varchar(32), pWord varchar(32) ) create table Membership ( loginPassword varchar(32), loginName varchar(32), childID int FOREIGN KEY REFERENCES Child(childID), ALTER TABLE Membership ADD ID int not null IDENTITY PRIMARY KEY; ) create table Lending ( lendingID int not null IDENTITY PRIMARY KEY, lendingDate timestamp, deadline date, returnedOn date, lendingState varchar(32), rating numeric(5), childID int foreign key references Child(childID), toyID int foreign key references Toy(toyID), --foreign key (childID)references Child, ) create table Child ( childID int not null IDENTITY PRIMARY KEY, fname varchar(32), lname varchar(32), iwi varchar(32, DOB date, gender varchar(32, note varchar(32), childLanguage varchar(32), ALTER TABLE Child alter COLUMN gender varchar(32); ) create table Disability ( disabilityID int not null IDENTITY PRIMARY KEY, title varchar(32), disabilityDescription varchar(32), ) create table Toy ( toyID int not null IDENTITY PRIMARY KEY, name varchar(32), toyDescription varchar(32), purchasedOn timestamp, --photo replaceCost money, originalCost money, libraryLocation varchar(32), legacyID int, parts varchar(32), toyStatus bit, toyType varchar(32), select * from Toy ALTER TABLE Toy alter COLUMN toyDescription varchar(50); ) create table Category ( categoryID int not null IDENTITY PRIMARY KEY, title varchar(32), categoryDscription varchar(32), ) create table ChildDisabilityRelate ( childID int foreign key references Child(childID), disabilityID int foreign key references Disability(disabilityID), primary key(childID, disabilityID), ) create table ToyInCategoryRelate ( toyID int foreign key references Toy(toyID), categoryID int foreign key references Category(categoryID), primary key(toyID, categoryID), ) drop TABLE Membership; drop TABLE Lending; drop TABLE Child; drop TABLE Disability; drop TABLE Toy; drop TABLE Category; drop TABLE ChildDisabilityRelate; drop TABLE ToyInCategoryRelate; insert into Librarian(fName, lName, DOB, uName, pWord) values ('Zeddy', 'Andijani', '1992-07-07', 'zeddyx0', '1234') insert into Librarian(fName, lName, DOB, uName, pWord) values ('John', 'Cena', '1720-01-01', 'jhonnyD', 'cenabb') select * from Librarian insert into Category(title) values('Active Play') where categoryID ='1'; insert into Category(title) values('Animals') insert into Category(title) values('Asking questions') insert into Category(title) values('Babies') insert into Category(title) values('Balance') insert into Category(title) values('Books') insert into Category(title) values('Cars') insert into Category(title) values('CD music') insert into Category(title) values('CD story') insert into Category(title) values('CD') insert into Category(title) values('Colour') insert into Category(title) values('Communication') insert into Category(title) values('Construction') insert into Category(title) values('Construction') insert into Category(title) values('Coordination') insert into Category(title) values('Counting') insert into Category(title) values('Dancing') insert into Category(title) values('Dice') insert into Category(title) values('Dinosaurs') insert into Category(title) values('Dolls') insert into Category(title) values('Dolls house') insert into Category(title) values('Dress up') insert into Category(title) values('DVD') insert into Category(title) values('DVD - Film') insert into Category(title) values('DVD - music') insert into Category(title) values('Early child hood') insert into Category(title) values('Fine Motor') insert into Category(title) values('Fire engine ') insert into Category(title) values('Firemen ') insert into Category(title) values('Flash cards') insert into Category(title) values('Floor play') insert into Category(title) values('Floor puzzles ') insert into Category(title) values('Games') insert into Category(title) values('Gardening') insert into Category(title) values('Gears') insert into Category(title) values('Gross Motor') insert into Category(title) values('Hammering') insert into Category(title) values('House') insert into Category(title) values('Imaginative play') insert into Category(title) values('Jumping') insert into Category(title) values('Kaleidoscopes ') insert into Category(title) values('Kitchen') insert into Category(title) values('Kits') insert into Category(title) values('Light') insert into Category(title) values('Literacy') insert into Category(title) values('Loud sounds') insert into Category(title) values('Machines') insert into Category(title) values('Magnets') insert into Category(title) values('Marble runs') insert into Category(title) values('Maths') insert into Category(title) values('Memory') insert into Category(title) values('Music') insert into Category(title) values('Nature') insert into Category(title) values('Outdoor games') insert into Category(title) values('Phonetics') insert into Category(title) values('Police') insert into Category(title) values('Posting') insert into Category(title) values('Pretend play') insert into Category(title) values('Prisms') insert into Category(title) values('Puppets') insert into Category(title) values('Puzzles') insert into Category(title) values('Ride-on') insert into Category(title) values('Role play') insert into Category(title) values('Science') insert into Category(title) values('Sensory') insert into Category(title) values('Singing') insert into Category(title) values('Soft sounds') insert into Category(title) values('Space') insert into Category(title) values('Stacking') insert into Category(title) values('Taking turns') insert into Category(title) values('Tents') insert into Category(title) values('Texture') insert into Category(title) values('Threading') insert into Category(title) values('Trains') insert into Category(title) values('Trucks') insert into Category(title) values('Vehicles') insert into Category(title) values('Walking') insert into Category(title) values('Water play') insert into Category(title) values('Water play') insert into Category(title) values('Words') SELECT * FROM Category DBCC CHECKIDENT ('[Disability]', RESEED, 0); delete from Disability where title >''; insert into Disability(title) values('ADHD') insert into Disability(title) values('ASD - Autism spectrum disorder') insert into Disability(title) values('Asthma ') insert into Disability(title) values('Blind ') insert into Disability(title) values('Cerebral palsy ') insert into Disability(title) values('Cystic fibrosis') insert into Disability(title) values('Deaf') insert into Disability(title) values('Developmental delay') insert into Disability(title) values('Down syndrome') insert into Disability(title) values('Dyslexia') insert into Disability(title) values('Epilepsy') insert into Disability(title) values('Traumatic brain injury') insert into Disability(title) values('Intellectual disability') insert into Disability(title) values('Multiple Sclerosis (MS)') insert into Disability(title) values('Muscular Dystrophy') insert into Disability(title) values('Paraplegia') insert into Disability(title) values('Parkinson disease, ') insert into Disability(title) values('Physical disability') insert into Disability(title) values('Quadriplegia ') SELECT * FROM Disability insert into Child(fname, lname, iwi, DOB, gender, note, childLanguage) VALUES('Thomas', 'Louden', 'yes', '2011-06-15', 'male', 'poor eye sight', 'Chinese') insert into Child(fname, lname, iwi, DOB, gender, note, childLanguage) VALUES('Keith', 'Daxter', 'no', '2010-08-06', 'male', 'paraplegic', 'Arabic') insert into Child(fname, lname, iwi, DOB, gender, note, childLanguage) VALUES('Hannah', 'Schmiere', 'no', '2009-03-29', 'female', 'anxiet disorder', 'English') insert into Child(fname, lname, iwi, DOB, gender, note, childLanguage) VALUES('Gavin', 'Ward', 'yes', '2014-09-10', 'non-binary', 'has ADHD', 'English') insert into Child(fname, lname, iwi, DOB, gender, note, childLanguage) VALUES('Emily', 'Schmiere', 'no', '2015-12-13', 'female', 'autistic', 'English') SELECT * FROM Child insert into Membership (loginPassword, loginName) values('20110615', 'thomasL') insert into Membership (loginPassword, loginName) values('20100806', 'keithD') insert into Membership (loginPassword, loginName) values('20090329', 'hannahS') insert into Membership (loginPassword, loginName) values('1', '1') select * from Membership delete from Membership where loginPassword ='hannahS'; insert into Toy(name, toyDescription, libraryLocation, parts, toyStatus, toyType)values('Beary', 'a stuffed teddy bear', 'Hamilton', 'whole toy', 'lended', 'Teddy Bear') insert into Toy(name, toyDescription, libraryLocation, parts, toyStatus, toyType)values('Monstrum', 'a monster car that makes a sound when moved', 'Hamilton', 'whole toy', 'available','Monster Car') insert into Toy(name, toyDescription, libraryLocation, parts, toyStatus, toyType)values('Dolly', 'a dolly that cries when a button is pushed', 'Hamilton', 'whole toy', 'lended','Crying Doll') insert into Toy(name, toyDescription, libraryLocation, parts, toyStatus, toyType)values('T-Rex', 'a stuffed dinosour toy', 'Hamilton', 'whole toy', 'available','Dinosaur') insert into Toy(name, toyDescription, libraryLocation, parts, toyStatus, toyType)values('Dumbo', 'a stuffed animal', 'Hamilton', 'whole toy', 'available','Elephant') select * from Toy delete from Toy where libraryLocation ='Hamilton'; DBCC CHECKIDENT ('[Toy]', RESEED, 0);
# --- Created by Slick DDL # To stop Slick DDL generation, remove this comment and start using Evolutions # --- !Ups create table "phones_table" ("id" INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,"name" VARCHAR NOT NULL,"phone_number" VARCHAR NOT NULL); # --- !Downs drop table "phones_table";
--15. `playlists_track_count.sql`: --Provide a query that shows the total number of tracks --in each playlist. The Playlist name should be included --on the resultant table. SELECT Name AS 'Playlist Name', COUNT(*) FROM PlaylistTrack JOIN Playlist ON Playlist.PlayListId = PlaylistTrack.PlaylistId GROUP BY Name
DROP TABLE IF EXISTS books CASCADE; DROP TABLE IF EXISTS authors CASCADE; CREATE TABLE authors ( id INTEGER PRIMARY KEY AUTO_INCREMENT, name VARCHAR UNIQUE ); CREATE TABLE books ( id INTEGER PRIMARY KEY AUTO_INCREMENT, title VARCHAR NOT NULL, author_id INTEGER, FOREIGN KEY (author_id) REFERENCES authors(id) ON DELETE CASCADE );
-- -- base de donn�es: 'baseavion' -- create database if not exists baseagence default character set utf8 collate utf8_general_ci; use baseagence; -- -------------------------------------------------------- -- creation des tables set foreign_key_checks =0; -- table contact drop table if exists contact; create table contact ( con_id int not null auto_increment primary key, con_nom varchar(255) not null, con_prenom VARCHAR(255) not null, con_adresse VARCHAR(255) not null, con_ville VARCHAR(255) not null, con_cp int not null )engine=innodb; -- table vendre drop table if exists vendre; create table vendre ( ven_id int not null auto_increment primary key, ven_type varchar (255) not null, ven_caracteristique VARCHAR(255) not null, ven_adresse VARCHAR(255) not null )engine=innodb; -- table louer drop table if exists louer; create table louer ( lou_id int not null auto_increment primary key, lou_type varchar (255) not null, lou_caracteristique VARCHAR(255) not null, lou_adresse VARCHAR(255) not null )engine=innodb; -- table achater drop table if exists acheter; create table acheter ( ach_id int not null auto_increment primary key, ach_type varchar(255) not null, ach_caracteristique VARCHAR(255) not null, ach_article VARCHAR(255) not null )engine=innodb; -- contraintes set foreign_key_checks = 1; -- jeu de données
CREATE TABLE [BudgetManager].[SubCategory] ( [Id] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (MAX) NOT NULL, [CategoryId] INT NULL, CONSTRAINT [PK_SubCategory] PRIMARY KEY CLUSTERED ([Id] ASC), CONSTRAINT [FK_SubCategory_CategoryId] FOREIGN KEY ([CategoryId]) REFERENCES [BudgetManager].[Category] ([Id]) );
SELECT id, kyu, languages, description, starter_code, name, examples, tags, creator FROM katas;
-- 12/03/2017 -- Showing tag of products on homepage ALTER TABLE `tags` ADD `is_main` TINYINT(1) DEFAULT 0 AFTER `modified_dtm`;
DROP DATABASE IF EXISTS `speedvoterdb`; CREATE DATABASE `speedvoterdb` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_danish_ci */; USE `speedvoterdb`; DROP DATABASE IF EXISTS `orgs`; CREATE TABLE `orgs` ( `org_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `orgname` varchar(45) DEFAULT NULL, PRIMARY KEY (`org_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `events`; CREATE TABLE `events` ( `event_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `event_name` varchar(45) DEFAULT NULL, `start_date` timestamp NULL DEFAULT NULL, `end_date` timestamp NULL DEFAULT NULL, `events_org_id_fk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`event_id`), KEY `events_org_id_fk_idx` (`events_org_id_fk`), CONSTRAINT `events_org_id_fk` FOREIGN KEY (`events_org_id_fk`) REFERENCES `orgs` (`org_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `elections`; CREATE TABLE `elections` ( `election_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `post` varchar(45) DEFAULT NULL, `date` timestamp NULL DEFAULT NULL, `min_votes` int(11) DEFAULT NULL, `max_votes` int(11) DEFAULT NULL, `secret` bit(1) DEFAULT 1, `active` bit(1) DEFAULT 0, `elections_event_id_fk` int(10) unsigned NOT NULL, PRIMARY KEY (`election_id`), KEY `elections_event_id_fk_idx` (`elections_event_id_fk`), CONSTRAINT `elections_event_id_fk` FOREIGN KEY (`elections_event_id_fk`) REFERENCES `events` (`event_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `voter`; CREATE TABLE `voter` ( `voter_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `member_code` varchar(10) DEFAULT NULL, `name` varchar(120) DEFAULT NULL, `mail` varchar(60) DEFAULT NULL, `mobil` varchar(12) DEFAULT NULL, `voter_org_id_fk` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`voter_id`), KEY `voter_org_id_fk_idx` (`voter_org_id_fk`), CONSTRAINT `voter_org_id_fk` FOREIGN KEY (`voter_org_id_fk`) REFERENCES `orgs` (`org_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `gate`; CREATE TABLE `gate` ( `gate_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `gate_event_id_fk` int(10) unsigned NOT NULL, `gate_voter_id_fk` int(10) unsigned NOT NULL, `access_code` varchar(16) DEFAULT NULL, `active` bit(1) DEFAULT 0, PRIMARY KEY (`gate_id`), UNIQUE KEY `access_code_UNIQUE` (`access_code`), KEY `gate_event_id_fk_idx` (`gate_event_id_fk`), KEY `gate_voter_id_fk_idx` (`gate_voter_id_fk`), CONSTRAINT `gate_event_id_fk` FOREIGN KEY (`gate_event_id_fk`) REFERENCES `events` (`event_id`), CONSTRAINT `gate_voter_id_fk` FOREIGN KEY (`gate_voter_id_fk`) REFERENCES `voter` (`voter_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `options`; CREATE TABLE `options` ( `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `the_option` varchar(45) DEFAULT NULL, `options_election_id_fk` int(10) unsigned NOT NULL, PRIMARY KEY (`option_id`), KEY `options_election_id_fk_idx` (`options_election_id_fk`), CONSTRAINT `options_election_id_fk` FOREIGN KEY (`options_election_id_fk`) REFERENCES `elections` (`election_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `series`; CREATE TABLE `series` ( `series_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `access_code` varchar(16) DEFAULT NULL, `serie` varchar(2) DEFAULT NULL, `vacant` bit(1) DEFAULT 1, PRIMARY KEY (`series_id`), UNIQUE KEY `access_code_UNIQUE` (`access_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `speakers`; CREATE TABLE `speakers` ( `speakers_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `speakers_access_code_fk` varchar(16) DEFAULT NULL, `speakers_event_id_fk` int(10) unsigned NOT NULL, `time` time DEFAULT NULL, PRIMARY KEY (`speakers_id`), KEY `speakers_access_code_fk_idx` (`speakers_access_code_fk`), KEY `speakers_event_id_fk_idx` (`speakers_event_id_fk`), CONSTRAINT `speakers_access_code_fk` FOREIGN KEY (`speakers_access_code_fk`) REFERENCES `gate` (`access_code`) , CONSTRAINT `speakers_event_id_fk` FOREIGN KEY (`speakers_event_id_fk`) REFERENCES `events` (`event_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `users`; CREATE TABLE `users` ( `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(60) NOT NULL, `userpassword` varchar(255) NOT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `email_UNIQUE` (`email`), KEY `userpassword_idx` (`userpassword`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `userrights`; CREATE TABLE `userrights` ( `userrights_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `level` int(11) NOT NULL, `org` int(11) DEFAULT NULL, `active` bit(1) DEFAULT 0, PRIMARY KEY (`userrights_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `users_userrights`; CREATE TABLE `users_userrights` ( `users_userrights_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `users_userrights_userrights_id_fk` int(10) unsigned NOT NULL, `users_userrights_user_id_fk` int(10) unsigned NOT NULL, PRIMARY KEY (`users_userrights_id`), KEY `users_userrights_userrights_id_fk_idx` (`users_userrights_userrights_id_fk`), KEY `users_userrights_user_id_fk_idx` (`users_userrights_user_id_fk`), CONSTRAINT `users_userrights_userrights_id_fk` FOREIGN KEY (`users_userrights_userrights_id_fk`) REFERENCES `userrights` (`userrights_id`), CONSTRAINT `users_userrights_user_id_fk` FOREIGN KEY (`users_userrights_user_id_fk`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `votes`; CREATE TABLE `votes` ( `vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `votes_option_id_fk` int(10) unsigned NOT NULL, `votes_election_id_fk` int(10) unsigned NOT NULL, PRIMARY KEY (`vote_id`), KEY `votes_option_id_idx` (`votes_option_id_fk`), KEY `votes_election_id_fk_idx` (`votes_election_id_fk`), CONSTRAINT `votes_election_id_fk` FOREIGN KEY (`votes_election_id_fk`) REFERENCES `elections` (`election_id`) , CONSTRAINT `votes_option_id_fk` FOREIGN KEY (`votes_option_id_fk`) REFERENCES `options` (`option_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP DATABASE IF EXISTS `voters_votes`; CREATE TABLE `voters_votes` ( `voters_vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `voters_votes_access_code_fk` varchar(16) NOT NULL, `voters_votes_vote_id_fk` int(10) unsigned NOT NULL, PRIMARY KEY (`voters_vote_id`), KEY `voters_votes_access_code_fk_idx` (`voters_votes_access_code_fk`), KEY `voters_votes_vote_id_fk_idx` (`voters_votes_vote_id_fk`), CONSTRAINT `voters_votes_access_code_fk` FOREIGN KEY (`voters_votes_access_code_fk`) REFERENCES `gate` (`access_code`) , CONSTRAINT `voters_votes_vote_id_fk` FOREIGN KEY (`voters_votes_vote_id_fk`) REFERENCES `votes` (`vote_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create database quizapp; use quizapp; create table questions ( id int not null auto_increment, question_name varchar(250), question_content varchar(250), created_at timestamp, primary key(id) ); create table q_answers ( id int not null auto_increment, answer_title varchar(250), answer_description varchar(250), created_at timestamp, primary key(id) ); create table quizes ( id int not null auto_increment, quiz_name varchar(250), created_at timestamp, primary key(id) ); create table students ( id int not null auto_increment, first_name varchar(100), last_name varchar(100), email varchar(100), created_at timestamp, primary key(id) ); create table student_answers ( id int not null auto_increment, student_answers varchar(100), primary key(id) ); create table ad_pivot ( questions_id int not null, q_answers_id int not null, quizes_id int not null, students_id int not null, students_answers_id int not null, foreign key (questions_id) references questions(id), foreign key (q_answers_id) references q_answers(id), foreign key (quizes_id) references quizes(id), foreign key (students_id) references students(id), foreign key (students_answers_id) references student_answers(id) );
CREATE FUNCTION INCREMENT ( @Val1 int) RETURNS int BEGIN RETURN (@Val1 + 1) END
CREATE TABLE jedict_entries ( id SERIAL PRIMARY KEY, sequence_id integer ); CREATE TABLE jedict_kanji ( id SERIAL PRIMARY KEY, entry_id integer, kanji varchar(255) ); CREATE TABLE jedict_meaning ( id SERIAL PRIMARY KEY, entry_id integer, meaning varchar(1024) ); CREATE TABLE jedict_reading ( id SERIAL PRIMARY KEY, entry_id integer, reading varchar(1024) );
CREATE TABLE IF NOT EXISTS `search` ( `iSearchID` INT NOT NULL AUTO_INCREMENT, `cSearch` VARCHAR(200), `cSource` TEXT, `dDated` DATETIME, PRIMARY KEY (`iSearchID`), INDEX (`dDated`) );
-- -- scripts para acompanhar as conexoes de reports existentes e o percentual de uso da tablespace temporaria -- SET LINESIZE 2000 SET PAGESIZE 5000 ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS'; SELECT SYSDATE AS "HORARIO DA VERIFICACAO" FROM DUAL / PROMPT AVALIA O REPORTS EM USO NO MOMENTO SELECT SUBSTR(PROGRAM,1,15),SUBSTR(USERNAME,1,10), SID,serial#, LOCKWAIT, LOGON_TIME, SYSDATE, SQL_HASH_VALUE,AUDSID, CLIENT_INFO, COMMAND, LAST_CALL_ET, MACHINE, MODULE, OSUSER, PADDR, PROCESS, SCHEMANAME, SERIAL#, SERVER, STATUS, TERMINAL, TYPE, ACTION, FAILOVER_METHOD, FAILED_OVER, FAILOVER_TYPE, PDML_ENABLED, PDDL_STATUS, PDML_STATUS, PQ_STATUS, RESOURCE_CONSUMER_GROUP, SQL_CHILD_NUMBER FROM GV$SESSION S WHERE ( (S.USERNAME IS NOT NULL) AND (NVL (S.OSUSER, 'X') <> 'SYSTEM') AND (S.TYPE <> 'BACKGROUND') ) AND UPPER(PROGRAM) LIKE 'RE%' / -- -- AVALIA OS ESPACOS DE TABLESPACE, INCLUSIVE A TABLESPACE TEMPORARIA -- PROMPT AVALIA OS ESPACOS DE TABLESPACE, INCLUSIVE A TABLESPACE TEMPORARIA SET ECHO OFF SET LINESIZE 100 CLEAR BREAKS COLUMNS COMPUTES TTITLE LEFT 'Tablespace Usage (Mb & %) Information' SKIP 2 COLUMN abytes FORMAT 999,999,999 HEADING 'Allocated' COLUMN ubytes FORMAT 999,999,999 HEADING 'Used' COLUMN fbytes FORMAT 999,999,999 HEADING 'Free' COLUMN uperct FORMAT 999.99 HEADING '% Used' COLUMN fperct FORMAT 999.99 HEADING '% Free' COMPUTE SUM LABEL "Totals (Mb)" OF abytes ubytes fbytes ON REPORT BREAK ON REPORT SELECT * FROM ( SELECT a.tablespace_name Tablespaces, a.tsize abytes, a.tsize - b.tsize ubytes, ROUND(100 * ((a.tsize - b.tsize) / a.tsize), 2) uperct, b.tsize fbytes, ROUND((100 * b.tsize) / a.tsize, 2) fperct FROM (SELECT tablespace_name, ROUND((SUM(bytes) / 1024) / 1024, 0) tsize FROM dba_data_files GROUP BY tablespace_name UNION SELECT tablespace_name, ROUND((SUM(bytes) / 1024) / 1024, 0) tsize FROM dba_temp_files GROUP BY tablespace_name) a, (SELECT tablespace_name, ROUND((SUM(bytes) / 1024) / 1024, 0) tsize FROM dba_free_space GROUP BY tablespace_name UNION SELECT tablespace_name, ROUND((SUM(bytes_free) / 1024) / 1024, 0) tsize FROM v$temp_space_header GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name(+)) WHERE Tablespaces = 'TEMP' --ORDER BY fperct DESC / prompt AVALIA O PERCENTUAL DE USO DA TABLESPACE NO MOMENTO -- SELECT 1 AS INST_ID,D.TABLESPACE_NAME, NVL (a.BYTES / 1024 / 1024, 0) size_mb, NVL (t.BYTES / 1024 / 1024, 0) used_mb, ROUND (NVL (t.BYTES / a.BYTES * 100, 0), 2) AS percentual_em_uso FROM SYS.dba_tablespaces d, (SELECT tablespace_name, SUM (BYTES) BYTES FROM dba_temp_files GROUP BY tablespace_name) a, (SELECT INST_ID, ss.tablespace_name, SUM ((ss.used_blocks * ts.BLOCKSIZE)) BYTES FROM gv$sort_segment ss, SYS.ts$ ts WHERE inst_id = 1 and ss.tablespace_name = ts.NAME GROUP BY INST_ID , ss.tablespace_name) t WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = t.tablespace_name(+) AND d.extent_management LIKE 'LOCAL' AND d.CONTENTS LIKE 'TEMPORARY' UNION ALL SELECT 2 AS INST_ID,D.TABLESPACE_NAME, NVL (a.BYTES / 1024 / 1024, 0) size_mb, NVL (t.BYTES / 1024 / 1024, 0) used_mb, ROUND (NVL (t.BYTES / a.BYTES * 100, 0), 2) AS percentual_em_uso FROM SYS.dba_tablespaces d, (SELECT tablespace_name, SUM (BYTES) BYTES FROM dba_temp_files GROUP BY tablespace_name) a, (SELECT INST_ID, ss.tablespace_name, SUM ((ss.used_blocks * ts.BLOCKSIZE)) BYTES FROM gv$sort_segment ss, SYS.ts$ ts WHERE inst_id = 2 and ss.tablespace_name = ts.NAME GROUP BY INST_ID , ss.tablespace_name) t WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = t.tablespace_name(+) AND d.extent_management LIKE 'LOCAL' AND d.CONTENTS LIKE 'TEMPORARY' / SET LINESIZE 2000 SET PAGESIZE 5000 -- -- AVALIAR QUANTO TEMPO A QUERY IRAR DEMORAR O RETORNO -- PROMPT AVALIAR QUANTO TEMPO A QUERY IRAR DEMORAR O RETORNO SELECT SID, DECODE (totalwork, 0, 0, ROUND (100 * sofar / totalwork, 2) ) "Percent", substr(MESSAGE,1,60) "Message", start_time, elapsed_seconds, time_remaining FROM gv$session_longops WHERE (SID = 293 AND serial# = 16646) ORDER BY SID / SET LINESIZE 145 SET PAGESIZE 9999 SET VERIFY off COLUMN tablespace_name FORMAT a15 HEAD 'Tablespace Name' COLUMN username FORMAT a15 HEAD 'Username' COLUMN sid FORMAT 9999 HEAD 'SID' COLUMN serial_id FORMAT 99999999 HEAD 'Serial#' COLUMN contents FORMAT a9 HEAD 'Contents' COLUMN extents FORMAT 999,999 HEAD 'Extents' COLUMN blocks FORMAT 999,999 HEAD 'Blocks' COLUMN bytes FORMAT 999,999,999 HEAD 'Bytes' COLUMN segtype FORMAT a12 HEAD 'Segment Type' BREAK ON tablespace_name ON report COMPUTE SUM OF extents ON report COMPUTE SUM OF blocks ON report COMPUTE SUM OF bytes ON report SELECT a.inst_id, b.tablespace tablespace_name , a.username username , a.sid sid , a.serial# serial_id , b.contents contents , b.segtype segtype , b.extents extents , b.blocks blocks , (b.blocks * c.value) bytes FROM gv$session a , gv$sort_usage b , (select value from v$parameter where name = 'db_block_size') c WHERE a.saddr = b.session_addr /
/* SQLyog Enterprise Trial - MySQL GUI v7.11 MySQL - 5.7.19-log : Database - item ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`item` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `item`; /*Table structure for table `item` */ DROP TABLE IF EXISTS `item`; CREATE TABLE `item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `item_number` varchar(255) DEFAULT NULL, `item_name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; /*Data for the table `item` */ insert into `item`(`id`,`item_number`, `item_name`) values (1,'101', 'Item101'),(2,'102','Item102'),(3,'103','Item103'),(4,'104','Item104'),(5,'105','Item105'),(6,'106','Item106'); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
CREATE DEFINER = CURRENT_USER TRIGGER `mydb`.`ORDER_STORE_PRICE` AFTER INSERT ON `ORDER` FOR EACH ROW BEGIN UPDATE `ORDER` AS `O` SET `O`.`ProductPriceThen` = `PRODUCT`.`Price` WHERE `ORDER`.`ProductPriceThen` IS NULL AND `O`.`ProductID` = `PRODUCT`.`ProductID`; END
-- phpMyAdmin SQL Dump -- version 4.1.6 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 2014-12-18 02:38:16 -- 服务器版本: 5.6.16 -- PHP Version: 5.5.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 */; -- -- Database: `test` -- -- -------------------------------------------------------- -- -- 表的结构 `exp_address` -- CREATE TABLE IF NOT EXISTS `exp_address` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `code` varchar(10) DEFAULT NULL, `name` varchar(10) DEFAULT NULL, `addr` text, `cata` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=105 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_client` -- CREATE TABLE IF NOT EXISTS `exp_client` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `code` varchar(10) DEFAULT NULL, `name` varchar(10) DEFAULT NULL, `cata` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_hawb` -- CREATE TABLE IF NOT EXISTS `exp_hawb` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `hawb` varchar(12) DEFAULT NULL, `mawb` varchar(12) DEFAULT NULL, `opdate` date DEFAULT NULL, `dest` varchar(10) DEFAULT NULL, `fltno` varchar(12) DEFAULT NULL, `fltdate` date DEFAULT NULL, `forward` varchar(20) DEFAULT NULL, `seller` varchar(20) DEFAULT NULL, `factory` varchar(20) DEFAULT NULL, `carrier` varchar(10) DEFAULT NULL, `carriername` varchar(20) DEFAULT NULL, `paymt` varchar(10) DEFAULT NULL, `arranged` int(11) DEFAULT NULL, `num` int(11) DEFAULT NULL, `gw` int(11) DEFAULT NULL, `cw` int(11) DEFAULT NULL, `cbm` float DEFAULT NULL, `remark` varchar(50) DEFAULT NULL, `depar` varchar(10) DEFAULT NULL, `desti` varchar(20) DEFAULT NULL, `consignee` text, `notify` text, `shipper` text, `curr` varchar(10) DEFAULT NULL, `nvd` varchar(10) DEFAULT NULL, `ncv` varchar(10) DEFAULT NULL, `package` varchar(10) DEFAULT NULL, `rclass` varchar(10) DEFAULT NULL, `special` text, `cgodescp` text, `agentabbr` varchar(10) DEFAULT NULL, `regtime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1638 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_mawb` -- CREATE TABLE IF NOT EXISTS `exp_mawb` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `mawb` varchar(12) DEFAULT NULL, `oversea` varchar(20) DEFAULT NULL, `dest` varchar(10) DEFAULT NULL, `desti` varchar(20) DEFAULT NULL, `depa` varchar(10) DEFAULT NULL, `depar` varchar(20) DEFAULT NULL, `shipper` text, `consignee` text, `agentabbr` varchar(50) DEFAULT NULL, `agentcode` varchar(20) DEFAULT NULL, `agentaccount` varchar(20) DEFAULT NULL, `carrier` varchar(20) DEFAULT NULL, `fltno` varchar(12) DEFAULT NULL, `fltdate` date DEFAULT NULL, `special` text, `package` varchar(10) DEFAULT NULL, `num` int(11) DEFAULT NULL, `gw` int(11) DEFAULT NULL, `cw` int(11) DEFAULT NULL, `cbm` float DEFAULT NULL, `rclass` varchar(10) DEFAULT NULL, `up` decimal(10,2) DEFAULT NULL, `freight` decimal(10,2) DEFAULT NULL, `awn` varchar(5) DEFAULT NULL, `myn` varchar(5) DEFAULT NULL, `scn` varchar(5) DEFAULT NULL, `myup` decimal(10,2) DEFAULT NULL, `scup` decimal(10,2) DEFAULT NULL, `aw` decimal(10,2) DEFAULT NULL, `my` decimal(10,2) DEFAULT NULL, `sc` decimal(10,2) DEFAULT NULL, `other` decimal(10,2) DEFAULT NULL, `amount` decimal(10,2) DEFAULT NULL, `cgodescp` text, `signature` varchar(50) DEFAULT NULL, `atplace` varchar(20) DEFAULT NULL, `operator` varchar(20) DEFAULT NULL, `opdate` date DEFAULT NULL, `regtime` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=829 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_port` -- CREATE TABLE IF NOT EXISTS `exp_port` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `code` varchar(5) DEFAULT NULL, `name` varchar(20) DEFAULT NULL, `zone` varchar(10) DEFAULT NULL, `m` decimal(12,2) DEFAULT NULL, `n` decimal(12,2) DEFAULT NULL, `q` decimal(12,2) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_seller` -- CREATE TABLE IF NOT EXISTS `exp_seller` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `forward` varchar(20) DEFAULT NULL, `seller` varchar(20) DEFAULT NULL, `remark` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; -- -------------------------------------------------------- -- -- 表的结构 `exp_user` -- CREATE TABLE IF NOT EXISTS `exp_user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(32) DEFAULT NULL, `pass` varchar(64) DEFAULT NULL, `nick` varchar(32) DEFAULT NULL, `dept` varchar(30) DEFAULT NULL, `grade` int(11) DEFAULT NULL, `access` int(11) DEFAULT NULL, `regdate` datetime DEFAULT NULL, `lastdate` datetime DEFAULT NULL, `remark` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- 替换视图以便查看 `exp_v_manifest` -- CREATE TABLE IF NOT EXISTS `exp_v_manifest` ( `hawb` varchar(12) ,`mawb` varchar(12) ,`num` int(11) ,`gw` int(11) ,`dest` varchar(10) ,`shipper` text ,`consignee` text ,`cgodescp` text ); -- -------------------------------------------------------- -- -- 替换视图以便查看 `exp_v_qty` -- CREATE TABLE IF NOT EXISTS `exp_v_qty` ( `fltdate` date ,`sumgw` decimal(32,0) ,`sumcw` decimal(32,0) ,`sumcbm` double ,`hawb` varchar(12) ,`mawb` varchar(12) ,`forward` varchar(20) ,`seller` varchar(20) ,`carrier` varchar(10) ); -- -------------------------------------------------------- -- -- 视图结构 `exp_v_manifest` -- DROP TABLE IF EXISTS `exp_v_manifest`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `exp_v_manifest` AS select `exp_hawb`.`hawb` AS `hawb`,`exp_hawb`.`mawb` AS `mawb`,`exp_hawb`.`num` AS `num`,`exp_hawb`.`gw` AS `gw`,`exp_hawb`.`dest` AS `dest`,`exp_hawb`.`shipper` AS `shipper`,`exp_hawb`.`consignee` AS `consignee`,`exp_hawb`.`cgodescp` AS `cgodescp` from `exp_hawb`; -- -------------------------------------------------------- -- -- 视图结构 `exp_v_qty` -- DROP TABLE IF EXISTS `exp_v_qty`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `exp_v_qty` AS select `exp_hawb`.`fltdate` AS `fltdate`,sum(`exp_hawb`.`gw`) AS `sumgw`,sum(`exp_hawb`.`cw`) AS `sumcw`,sum(`exp_hawb`.`cbm`) AS `sumcbm`,`exp_hawb`.`hawb` AS `hawb`,`exp_hawb`.`mawb` AS `mawb`,`exp_hawb`.`forward` AS `forward`,`exp_hawb`.`seller` AS `seller`,`exp_hawb`.`carrier` AS `carrier` from `exp_hawb` where (`exp_hawb`.`hawb` <> '') group by `exp_hawb`.`hawb` order by `exp_hawb`.`fltdate`; /*!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 database db_escola; use db_escola; create table tb_alunos( id bigint auto_increment, nome varchar(50) not null, matricula varchar(50) not null, rg varchar(50) not null, serie varchar(20) not null, nota decimal(9,2) not null, primary key(id) ); insert into tb_alunos(nome,matricula,rg,serie,nota) values ("Sabrina", "007987", "12.334.355", "5ª série", 7.5); insert into tb_alunos(nome,matricula,rg,serie,nota) values ("Nneka", "216484", "45.645.547", "8ª série", 5.5); insert into tb_alunos(nome,matricula,rg,serie,nota) values ("Sue", "468866", "32.567.980", "7ª série", 8.5); insert into tb_alunos(nome,matricula,rg,serie,nota) values ("Napheesa", "667689", "99.977.000", "4ª série", 10); insert into tb_alunos(nome,matricula,rg,serie,nota) values ("Stewie", "987955", "70.117.234", "1ª série", 8); select nota from tb_alunos where nota < 7; select nota from tb_alunos where nota> 7; update tb_produtos set nota=10 where id=5;
ALTER TABLE `user` CHANGE `type` `type` ENUM('student','teacher','admin') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'student'; INSERT INTO `user` (`id`, `username`, `password`, `hash`, `email`, `birth_day`, `date_created`, `date_updated`, `date_activated`, `online`, `activation_key`, `type`, `profile_picture`, `upgraded`, `status`, `recovery_key`, `email_alert`) VALUES (NULL, 'admin', 'ae3ebd006a57bbc751915a114df78857e17f3e8b', 'f24a3b36f93e90ad3fdbb1e36300', 'admin@quizzy.sg', '2014-12-31 16:00:00', '2015-01-27 12:47:27', NULL, '2015-01-26 16:00:00', 'no', NULL, 'admin', '/images/profile/user.png', 'no', 'active', NULL, 'yes');
/*-------------SUBQUERIES-------------*/ /* 4 WAYS TO MAKE A SUBQUERY 1. In a WHERE clause as a *search* condition 2. In a HAVING clause as a *search* condition 3. In the FROM clause as a *table* specification 4. In the SELECT clause as a *column* specification*/ SELECT invoice_number, invoice_date, invoice_total FROM invoices WHERE invoice_total > (SELECT AVG(invoice_total) FROM invoices) ORDER BY invoice_total; /* JOIN or SUBQUERY*/ /*---JOIN---*/ SELECT invoice_number, invoice_date, invoice_total FROM invoices JOIN vendors ON invoices.vendor_id = vendors.vendor_id WHERE vendor_state = 'CA' ORDER BY invoice_date; /*SUBQUERY*/ SELECT invoice_number, invoice_date, invoice_total FROM invoices WHERE vendor_id IN (SELECT vendor_id FROM vendors WHERE vendor_state = 'CA') ORDER BY invoice_date; /*--------Advantages of joins • The SELECT clause of a join can include columns from both tables. • A join tends to be more intuitive when it uses an existing relationship between the two tables, such as a primary key to foreign key relationship.*/ /*---------Advantages of subqueries • You can use a subquery to pass an aggregate value to the main query. • A subquery tends to be more intuitive when it uses an ad hoc relationship between the two tables. • Long, complex queries can sometimes be easier to code using subqueries.*/ /*USING WHERE for a Subquery*/ /*WHERE test_expression [NOT] IN (subquery)*/ SELECT vendor_id, vendor_name, vendor_state FROM vendors WHERE vendor_id NOT IN (SELECT DISTINCT vendor_id FROM invoices ) ORDER BY vendor_id; /*where with comparison operartors (SOME, ANY, ALL) /*EX: Get invoices with a balance due less than the average*/ SELECT invoice_number, invoice_date,invoice_total - payment_total-credit_total AS balance_due FROM invoices WHERE invoice_total-payment_total-credit_total > 0 AND invoice_total - payment_total - credit_total < (SELECT AVG(invoice_total - payment_total - credit_total) FROM invoices WHERE invoice_total - payment_total - credit_total > 0 ) /*without the comparison operators the subquery returns only one value*/ ORDER BY invoice_total DESC; /*Use the ALL operator*/ SELECT vendor_name, invoice_number, invoice_total FROM invoices i JOIN vendors v ON i.vendor_id = v.vendor_id WHERE invoice_total > ALL (SELECT invoice_total FROM invoices WHERE vendor_id = 34) /*en este caso, el query resultante tiene que ser mayor a los dos valores del subquery*/ ORDER BY vendor_name; /* ANY or SOME keyboards*/ SELECT vendor_name, invoice_number, invoice_total FROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_id WHERE invoice_total < ANY /*If we used all then we wouldnt have any results since it will have to be greater than all four values of the subquery*/ (SELECT invoice_total FROM invoices WHERE vendor_id = 115); /*correlated subqueries*/ SELECT vendor_id, invoice_number, invoice_total FROM invoices i WHERE invoice_total > (SELECT AVG(invoice_total) FROM invoices WHERE vendor_id = i.vendor_id) ORDER BY vendor_id, invoice_total; /* EXISTS operator*/ /*SYNTAX WERE [NOT] EXISTS (subquery)*/ SELECT vendor_id, vendor_name, vendor_state FROM vendors WHERE EXISTS (SELECT * FROM invoices WHERE vendor_id = vendors.vendor_id); /*Code a SUBQUERY with a FROM clause*/ SELECT vendor_state, MAX(sum_of_invoices) AS max_sum_of_invoices FROM ( SELECT vendor_state, vendor_name, SUM(invoice_total) AS sum_of_invoices FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id GROUP BY vendor_state, vendor_name ) t /*When you code a subquery in the FROM clause, you must assign an alias to it.*/ GROUP BY vendor_state ORDER BY vendor_state; /*COMPLEX query that uses THREE subqueries*/ /*This query retrieves the vendor from each state that has the largest invoice total. To do that, it uses three subqueries*/ SELECT t1.vendor_state, vendor_name, t1.sum_of_invoices FROM( -- invoice totals by vendor SELECT vendor_state, vendor_name, SUM(invoice_total) AS sum_of_invoices FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id GROUP BY vendor_state, vendor_name ) t1 JOIN ( -- top invoice totals by state SELECT vendor_state, MAX(sum_of_invoices) AS sum_of_invoices FROM ( -- invoice totals by vendor SELECT vendor_state, vendor_name, SUM(invoice_total) AS sum_of_invoices FROM vendors v JOIN invoices i ON v.vendor_id= i.vendor_id GROUP BY vendor_state, vendor_name ) t2 GROUP BY vendor_state ) t3 ON tl.vendor_state = t3.vendor_state AND tl.sum_of_invoices= t3.sum_of_invoices ORDER BY vendor_state
PARAMETERS [@LoteID] Text ( 255 ), [@Campaña] Text (255); SELECT B.TipoVenta, A.KilosProducidos, A.KilosMerma, A.KilosVendidos, A.ImporteTotal/A.KilosVendidos AS Precio, A.ImporteTotal, A.DepositoBanco, A.PagoEfectivo FROM VR_VentaResumen_00 AS A LEFT JOIN TB_TipoVenta AS B ON A.TipoVentaID=B.TipoVentaID UNION ALL SELECT * FROM VR_VentaResumen_Exp UNION ALL SELECT * FROM VR_VentaResumen_Pod
select * from demo.accounts where name = 'Apple'
CREATE TABLE Product ( id int primary key, "Name" text ); CREATE TABLE Category ( id int primary key, "Name" text ); CREATE TABLE ProductCategory ( ProductId int foreign key references Product(id), CategoryId int foreign key references Category(id) ); INSERT INTO Product VALUES (1, 'Карамель'), (2, 'Зефир'), (3, 'Стиральный порошок'), (4, 'Колбаса'); INSERT INTO Category VALUES (1, 'Кондитерские товары'), (2, 'Хлебобулочные изделия'), (3, 'Бытовая химия'); INSERT INTO ProductCategory VALUES (1, 1), (2, 1), (3, 3); SELECT prdct.Name as 'Название продукта', ctgr.Name as 'Категория продукта' FROM Product prdct LEFT JOIN ProductCategory prdctCtgr ON prdct.id = prdctCtgr.ProductId LEFT JOIN Category ctgr ON prdctCtgr.CategoryId = ctgr.id
-- Deletes hbtn_0c_0 database if exists DROP DATABASE IF EXISTS hbtn_0c_0;
protocol 'jdbc:derby:'; connect 'jobs.db'; readonly on; -- plot of timeline CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select CREATION, QUEUED, DOWNLOAD, RUNNING, UPLOAD from jobs where EXIT_CODE=0', 'timeline.dat', ',', '"', 'UTF-8'); -- latency calculation CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select QUEUED from jobs where EXIT_CODE=0' ,'queued.dat', ',', '"', 'UTF-8'); -- global statistics CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select count(RUNNING) from jobs where COMMAND like ''mask%'' and EXIT_CODE=0', 'patients.dat', ',', '"', 'UTF-8'); CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select count(RUNNING) from jobs where COMMAND like ''fsl%'' and EXIT_CODE=0', 'images.dat', ',', '"', 'UTF-8'); CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select max(CREATION + QUEUED + DOWNLOAD + RUNNING + UPLOAD) from jobs where EXIT_CODE=0', 'timespan.dat', ',', '"', 'UTF-8'); CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select RUNNING from jobs where EXIT_CODE=0', 'running.dat', ',', '"', 'UTF-8'); CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select count(RUNNING) from jobs', 'total.dat', ',', '"', 'UTF-8'); CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY('select CREATION + QUEUED + DOWNLOAD + RUNNING + UPLOAD from jobs where EXIT_CODE=0', 'alltimespan.dat', ',', '"', 'UTF-8');