text
stringlengths
6
9.38M
select TZ_APPPRO_HF_BH, TZ_APPPRO_COLOR, TZ_CLS_RESULT, TZ_APPPRO_CONTENT, TZ_WFB_DEFALT_BZ, TZ_SYSVAR from PS_TZ_APPPRO_HF_T where TZ_APPPRO_TMP_ID=? and TZ_APPPRO_ID=?
-- phpMyAdmin SQL Dump -- version 4.2.9 -- http://www.phpmyadmin.net -- -- 主機: dbhome.cs.nctu.edu.tw -- 產生時間: 2015 年 05 月 07 日 23:49 -- 伺服器版本: 5.6.21-log -- PHP 版本: 5.3.29 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 */; -- -- 資料庫: `annie0111279_cs` -- -- -------------------------------------------------------- -- -- 資料表結構 `application` -- CREATE TABLE IF NOT EXISTS `application` ( `user_id` int(11) NOT NULL, `recruit_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- 資料表結構 `employer` -- CREATE TABLE IF NOT EXISTS `employer` ( `id` int(11) NOT NULL, `account` varchar(50) NOT NULL, `password` varchar(150) NOT NULL, `phone` varchar(50) NOT NULL, `mail` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- 資料表結構 `favorite` -- CREATE TABLE IF NOT EXISTS `favorite` ( `user_id` int(11) NOT NULL, `recruit_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- 資料表結構 `location` -- CREATE TABLE IF NOT EXISTS `location` ( `id` int(11) NOT NULL, `location` varchar(50) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- 資料表的匯出資料 `location` -- INSERT INTO `location` (`id`, `location`) VALUES (1, 'Taipei'), (2, 'Tauyuan'), (3, 'Taichung'), (4, 'Tainan'), (5, 'Kaohsiung'); -- -------------------------------------------------------- -- -- 資料表結構 `occupation` -- CREATE TABLE IF NOT EXISTS `occupation` ( `id` int(11) NOT NULL, `occupation` varchar(50) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- 資料表的匯出資料 `occupation` -- INSERT INTO `occupation` (`id`, `occupation`) VALUES (1, 'teacher'), (2, 'sailor'), (3, 'translator'), (4, 'tailor'), (5, 'actor/actress'); -- -------------------------------------------------------- -- -- 資料表結構 `recruit` -- CREATE TABLE IF NOT EXISTS `recruit` ( `id` int(11) NOT NULL, `employer_id` int(11) NOT NULL COMMENT 'who posted this job information', `occupation_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, `working_time` varchar(50) NOT NULL, `education` varchar(50) NOT NULL COMMENT 'educational background requirement', `experience` int(11) NOT NULL COMMENT 'minimum of working experience', `salary` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- 資料表結構 `specialty` -- CREATE TABLE IF NOT EXISTS `specialty` ( `id` int(11) NOT NULL, `specialty` varchar(50) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -- -- 資料表的匯出資料 `specialty` -- INSERT INTO `specialty` (`id`, `specialty`) VALUES (1, 'accounting'), (2, 'beauty'), (3, 'building & construction'), (4, 'design'), (5, 'education'); -- -------------------------------------------------------- -- -- 資料表結構 `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL, `account` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `education` varchar(50) NOT NULL COMMENT 'highest education', `expected_salary` int(11) NOT NULL, `phone` varchar(50) NOT NULL, `gender` varchar(50) NOT NULL, `age` int(11) NOT NULL, `email` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- 資料表結構 `user_specialty` -- CREATE TABLE IF NOT EXISTS `user_specialty` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `specialty_id` int(11) NOT NULL COMMENT 'what kind of specialty does the user(job seeker) have' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- 已匯出資料表的索引 -- -- -- 資料表索引 `application` -- ALTER TABLE `application` ADD KEY `user_id` (`user_id`), ADD KEY `recruit_id` (`recruit_id`); -- -- 資料表索引 `employer` -- ALTER TABLE `employer` ADD PRIMARY KEY (`id`); -- -- 資料表索引 `favorite` -- ALTER TABLE `favorite` ADD KEY `user_id` (`user_id`), ADD KEY `recruit_id` (`recruit_id`); -- -- 資料表索引 `location` -- ALTER TABLE `location` ADD PRIMARY KEY (`id`); -- -- 資料表索引 `occupation` -- ALTER TABLE `occupation` ADD PRIMARY KEY (`id`); -- -- 資料表索引 `recruit` -- ALTER TABLE `recruit` ADD PRIMARY KEY (`id`), ADD KEY `employer_id` (`employer_id`), ADD KEY `employer_id_2` (`employer_id`), ADD KEY `occupation_id` (`occupation_id`), ADD KEY `location_id` (`location_id`); -- -- 資料表索引 `specialty` -- ALTER TABLE `specialty` ADD PRIMARY KEY (`id`); -- -- 資料表索引 `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- 資料表索引 `user_specialty` -- ALTER TABLE `user_specialty` ADD PRIMARY KEY (`id`), ADD KEY `specialty_id` (`specialty_id`), ADD KEY `user_id` (`user_id`); -- -- 在匯出的資料表使用 AUTO_INCREMENT -- -- -- 使用資料表 AUTO_INCREMENT `employer` -- ALTER TABLE `employer` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- 使用資料表 AUTO_INCREMENT `location` -- ALTER TABLE `location` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- 使用資料表 AUTO_INCREMENT `occupation` -- ALTER TABLE `occupation` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- 使用資料表 AUTO_INCREMENT `recruit` -- ALTER TABLE `recruit` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- 使用資料表 AUTO_INCREMENT `specialty` -- ALTER TABLE `specialty` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6; -- -- 使用資料表 AUTO_INCREMENT `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- 使用資料表 AUTO_INCREMENT `user_specialty` -- ALTER TABLE `user_specialty` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- 已匯出資料表的限制(Constraint) -- -- -- 資料表的 Constraints `application` -- ALTER TABLE `application` ADD CONSTRAINT `application_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `application_ibfk_2` FOREIGN KEY (`recruit_id`) REFERENCES `recruit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- 資料表的 Constraints `favorite` -- ALTER TABLE `favorite` ADD CONSTRAINT `favorite_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `favorite_ibfk_2` FOREIGN KEY (`recruit_id`) REFERENCES `recruit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- 資料表的 Constraints `recruit` -- ALTER TABLE `recruit` ADD CONSTRAINT `recruit_ibfk_1` FOREIGN KEY (`employer_id`) REFERENCES `employer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `recruit_ibfk_2` FOREIGN KEY (`occupation_id`) REFERENCES `occupation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `recruit_ibfk_3` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- 資料表的 Constraints `user_specialty` -- ALTER TABLE `user_specialty` ADD CONSTRAINT `user_specialty_ibfk_1` FOREIGN KEY (`specialty_id`) REFERENCES `specialty` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `user_specialty_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) 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 */;
DROP TABLE IF EXISTS TARGET_SIM_LINEAR_REGRESSION; CREATE TABLE TARGET_SIM_LINEAR_REGRESSION ( ID INTEGER NOT NULL, VERSION INTEGER NOT NULL, INTEREST_RATE DOUBLE PRECISION, ACCOUNT_TYPE_ID DOUBLE PRECISION, ACCOUNT_STATUS_ID DOUBLE PRECISION );
drop table penpa_member; create table penpa_member( code number(38) unique not null , id varchar2(20) primary key /*회원 아이디*/ , pass varchar2(20) not null /*회원 비번*/ , name varchar2(50) not null /*회원 이름*/ , gender varchar2(5)not null /*성별*/ , birth varchar2(20)not null /*생년월일*/ , zip varchar2(5) not null /*5자리 우편번호*/ , addr1 varchar2(100) not null /* 주소*/ , addr2 varchar2(100) not null /*나머지 주소*/ , tel varchar2(20) not null /*전번*/ , phone varchar2(20) not null /*폰번호*/ , email varchar2(100) not null /*전자 우편 주소*/ , profile varchar2(100) /*프로필*/ , n_name varchar2(50)not null /*닉네임*/ , gugga varchar2(50)not null /*국가*/ , city varchar2(50)not null /*도시*/ , practice varchar2(50)not null /*연습언어*/ , native varchar2(50)not null /*모국어*/ , hobby varchar2(10)not null /*취미*/ , original varchar2(20) /*원래파일명*/ , state number(10) /*가입회원1, 탈퇴회원2*/ , declarcount number(10) /*신고횟수*/ ); insert into PENPA_MEMBER (code, id, pass, name, gender, birth, zip, addr1, addr2, tel, phone, email, profile, n_name, gugga, city, practice, native, hobby, original, state, declarcount) VALUES (1,'bae9176','1234','배희주','여','1997/11/26','12345','서울시','은평구','02-354-0843' ,'010-7144-9176','bae1123@naver.com','연석.png','싯주','한국','서울','영어','한국어','자전거','original.png',1,0); insert into PENPA_MEMBER (code, id, pass, name, gender, birth, zip, addr1, addr2, tel, phone, email, profile, n_name, gugga, city, practice, native, hobby, original, state, declarcount) VALUES (2,'bae9177','1234','자바','여','1997/11/26','12345','서울시','은평구','02-354-0843' ,'010-7144-9176','bae1123@naver.com','연석.png','싯주','한국','서울','영어','한국어','자전거','original.png',1,0); select*from penpa_member; /******* penpa_member 테이블의 시퀀스 생성 *****/ create sequence penpa_member_code_seq
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 12-Jan-2018 às 04:13 -- Versão do servidor: 10.1.28-MariaDB -- PHP Version: 7.1.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `expert` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `cidades` -- CREATE TABLE `cidades` ( `cod_cidade` int(11) NOT NULL, `nome` varchar(100) NOT NULL, `uf` varchar(2) NOT NULL, `estado` varchar(100) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `cidades` -- INSERT INTO `cidades` (`cod_cidade`, `nome`, `uf`, `estado`) VALUES (66, 'manaus', 'AM', 'AMAZÔNIA'), (59, 'CIANORTE', 'PR', 'PARANÁ'), (64, 'céu azul', 'MG', 'MINAS GERAIS'), (65, 'terra boa', 'PR', 'PARANÁ'), (67, 'jussara', 'PR', 'PARANÁ'), (68, 'brasília', 'DF', 'DISTRITO FEDERAL'), (69, 'moreira sales', 'PR', 'PARANÁ'); -- -------------------------------------------------------- -- -- Estrutura da tabela `cond_pgto` -- CREATE TABLE `cond_pgto` ( `cod_cond` int(11) NOT NULL, `tipo` varchar(10) NOT NULL, `num_parc` int(11) NOT NULL, `forma_pgto` varchar(20) NOT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `cond_pgto` -- INSERT INTO `cond_pgto` (`cod_cond`, `tipo`, `num_parc`, `forma_pgto`, `situacao`) VALUES (3, 'À vista', 3, 'Boleto', 'Ativo'), (2, 'À vista', 1, 'Boleto', 'Ativo'); -- -------------------------------------------------------- -- -- Estrutura da tabela `cursos` -- CREATE TABLE `cursos` ( `cod_curso` int(11) NOT NULL, `nome_curso` varchar(100) NOT NULL, `carga_horaria` int(5) NOT NULL, `preco` double NOT NULL, `qtde_aulas` int(11) NOT NULL, `qtde_material` int(11) DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `cursos` -- INSERT INTO `cursos` (`cod_curso`, `nome_curso`, `carga_horaria`, `preco`, `qtde_aulas`, `qtde_material`, `situacao`) VALUES (13, 'curso de power point', 26, 300.69, 14, 6, 'Ativo'), (11, 'curso de excel', 20, 699.15, 10, 1, 'Ativo'), (12, 'curso de word', 16, 100.6, 8, 1, 'Ativo'), (14, 'corel draw x9', 30, 19.63, 15, 2, 'Inativo'); -- -------------------------------------------------------- -- -- Estrutura da tabela `despesas` -- CREATE TABLE `despesas` ( `cod_despesa` int(11) NOT NULL, `cod_fornec` int(11) NOT NULL, `cod_cond` int(11) NOT NULL, `descricao` varchar(100) NOT NULL, `valor_despesa` float NOT NULL, `data_despesa` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `entregamateriais` -- CREATE TABLE `entregamateriais` ( `cod_entrega` int(11) NOT NULL, `cod_matricula` int(11) NOT NULL, `cod_material` int(11) NOT NULL, `data_entrega` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `estorno_parcela_despesas` -- CREATE TABLE `estorno_parcela_despesas` ( `cod_estorno` int(11) NOT NULL, `cod_parc` int(11) NOT NULL, `valo_juros` float DEFAULT NULL, `desconto` float DEFAULT NULL, `data_pgto` date DEFAULT NULL, `valor_pgto` float DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `estorno_parcela_matriculas` -- CREATE TABLE `estorno_parcela_matriculas` ( `cod_estorno` int(11) NOT NULL, `cod_parc` int(11) NOT NULL, `valor_juros` float DEFAULT NULL, `desconto` float DEFAULT NULL, `data_pgto` date DEFAULT NULL, `valor_pgto` float DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `fornecedor` -- CREATE TABLE `fornecedor` ( `cod_fornec` int(11) NOT NULL, `cod_cidade` int(11) NOT NULL, `nome` varchar(100) NOT NULL, `cnpj` varchar(25) NOT NULL, `endereco` varchar(100) NOT NULL, `complemento` varchar(100) DEFAULT NULL, `bairro` varchar(100) NOT NULL, `cep` varchar(20) NOT NULL, `fone` varchar(20) NOT NULL, `celular` varchar(20) DEFAULT NULL, `email` varchar(100) DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `frequencia` -- CREATE TABLE `frequencia` ( `cod_frequencia` int(11) NOT NULL, `cod_turma` int(11) NOT NULL, `cod_curso` int(11) NOT NULL, `cod_matricula` int(11) NOT NULL, `data_aula` date NOT NULL, `presente` char(1) DEFAULT NULL, `reposicao` char(1) DEFAULT NULL, `total_frequencia` float DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `materiais` -- CREATE TABLE `materiais` ( `cod_material` int(11) NOT NULL, `nome` varchar(100) NOT NULL, `preco` float DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `materiais` -- INSERT INTO `materiais` (`cod_material`, `nome`, `preco`, `situacao`) VALUES (1, 'APOSTILA MICROSOFT WORD 2010', 119.9, 'Atual'), (2, 'APOSTILAS MICROSOFT EXCEL 2010', 89.9, 'Atual'), (3, 'APOSTILA POWER POINT 2010', 89.9, 'Atual'), (5, 'apostila internet edge explorer', 129.91, 'Descartado'); -- -------------------------------------------------------- -- -- Estrutura da tabela `matricula` -- CREATE TABLE `matricula` ( `cod_matricula` int(11) NOT NULL, `cod_pessoa` int(11) NOT NULL, `cod_turma` int(11) NOT NULL, `cod_cond` int(11) NOT NULL, `data_matricula` date NOT NULL, `valor_matricula` float NOT NULL, `situacao` varchar(20) NOT NULL, `entrada` float DEFAULT NULL, `certificado` varchar(100) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `notas` -- CREATE TABLE `notas` ( `cod_nota` int(11) NOT NULL, `cod_matricula` int(11) NOT NULL, `desc_avaliacao` varchar(100) NOT NULL, `nota` float NOT NULL, `data_prova` date NOT NULL, `media` float NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `parcelamatriculas` -- CREATE TABLE `parcelamatriculas` ( `cod_parc` int(11) NOT NULL, `cod_pessoa` int(11) NOT NULL, `cod_matricula` int(11) NOT NULL, `n_parc` int(11) NOT NULL, `valor_parc` float NOT NULL, `data_vcto` date NOT NULL, `valor_juros` float DEFAULT NULL, `desconto` float DEFAULT NULL, `data_pgto` date DEFAULT NULL, `valor_pago` float DEFAULT NULL, `situacao` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `parcela_despesas` -- CREATE TABLE `parcela_despesas` ( `cod_parcela` int(11) NOT NULL, `cod_despesa` int(11) NOT NULL, `cod_fornec` int(11) NOT NULL, `n_parc` int(11) NOT NULL, `valor_parc` float NOT NULL, `data_vcto` date NOT NULL, `valor_juros` float DEFAULT NULL, `desconto` float DEFAULT NULL, `data_pgto` date DEFAULT NULL, `valor_pgto` float DEFAULT NULL, `situacao` char(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `pessoas` -- CREATE TABLE `pessoas` ( `cod_pessoa` int(11) NOT NULL, `cod_cidade` int(11) NOT NULL, `nome` varchar(20) NOT NULL, `funcao_aluno` varchar(20) DEFAULT NULL, `funcao_prof` varchar(20) DEFAULT NULL, `rg` varchar(20) DEFAULT NULL, `cpf` varchar(20) DEFAULT NULL, `data_nasc` date NOT NULL, `endereco` varchar(100) NOT NULL, `num_resid` varchar(20) NOT NULL, `bairro` varchar(100) NOT NULL, `complemento` varchar(100) DEFAULT NULL, `cep` varchar(8) NOT NULL, `email` varchar(100) DEFAULT NULL, `fone` varchar(20) NOT NULL, `celular` varchar(20) DEFAULT NULL, `celular2` varchar(20) DEFAULT NULL, `cod_cidade_resp` int(11) DEFAULT NULL, `nome_resp` varchar(100) DEFAULT NULL, `rg_resp` varchar(20) DEFAULT NULL, `cpf_resp` varchar(20) DEFAULT NULL, `data_nasc_resp` date DEFAULT NULL, `endereco_resp` varchar(100) DEFAULT NULL, `num_resid_resp` varchar(20) DEFAULT NULL, `bairro_resp` varchar(100) DEFAULT NULL, `complemento_resp` varchar(100) DEFAULT NULL, `cep_resp` varchar(8) DEFAULT NULL, `email_resp` varchar(100) DEFAULT NULL, `fone_resp` varchar(20) DEFAULT NULL, `celular_resp` varchar(20) DEFAULT NULL, `celular2_resp` varchar(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `turmas` -- CREATE TABLE `turmas` ( `cod_turma` int(11) NOT NULL, `cod_curso` int(11) NOT NULL, `data_criacao_turma` date NOT NULL, `nome_turma` varchar(100) NOT NULL, `data_inicio` date NOT NULL, `data_termino` date NOT NULL, `vagas` int(11) NOT NULL, `dia_curso` varchar(20) NOT NULL, `hora_inicio` varchar(5) DEFAULT NULL, `hora_fim` varchar(5) DEFAULT NULL, `situacao` varchar(20) NOT NULL, `obsevacao` varchar(100) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `usuarios` -- CREATE TABLE `usuarios` ( `cod_usuario` int(11) NOT NULL, `nome` varchar(100) NOT NULL, `login` varchar(100) DEFAULT NULL, `senha` varchar(32) DEFAULT NULL, `perfil` varchar(20) DEFAULT NULL, `situacao` varchar(15) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `usuarios` -- INSERT INTO `usuarios` (`cod_usuario`, `nome`, `login`, `senha`, `perfil`, `situacao`) VALUES (1, 'vagner', 'teste@teste.com', '202cb962ac59075b964b07152d234b70', 'Admin', 'Ativo'), (4, 'Catia', 'catia@catia.com', '202cb962ac59075b964b07152d234b70', 'Admin', 'Inativo'), (5, 'Julia', 'julia@julia.com', 'ec6a6536ca304edf844d1d248a4f08dc', 'Admin', 'Ativo'), (7, 'kassandra', 'ka@ka.com', '202cb962ac59075b964b07152d234b70', 'Professor(a)', 'Ativo'), (8, 'paula', 'paula@paula.com', '202cb962ac59075b964b07152d234b70', 'Professor(a)', 'Inativo'), (9, 'augustinho', 'augustinho@augustinho.com', 'd9b1d7db4cd6e70935368a1efb10e377', 'Admin', 'Inativo'); -- -- Indexes for dumped tables -- -- -- Indexes for table `cidades` -- ALTER TABLE `cidades` ADD PRIMARY KEY (`cod_cidade`); -- -- Indexes for table `cond_pgto` -- ALTER TABLE `cond_pgto` ADD PRIMARY KEY (`cod_cond`); -- -- Indexes for table `cursos` -- ALTER TABLE `cursos` ADD PRIMARY KEY (`cod_curso`); -- -- Indexes for table `despesas` -- ALTER TABLE `despesas` ADD PRIMARY KEY (`cod_despesa`), ADD KEY `condicao_e_despesas` (`cod_cond`), ADD KEY `fornecedor_e_despesas` (`cod_fornec`); -- -- Indexes for table `entregamateriais` -- ALTER TABLE `entregamateriais` ADD PRIMARY KEY (`cod_entrega`), ADD KEY `matricula_e_materiasentregue` (`cod_matricula`), ADD KEY `materiais_e_entrega_materiais` (`cod_material`); -- -- Indexes for table `estorno_parcela_despesas` -- ALTER TABLE `estorno_parcela_despesas` ADD PRIMARY KEY (`cod_estorno`), ADD KEY `parcDespesas_e_estorno` (`cod_parc`); -- -- Indexes for table `estorno_parcela_matriculas` -- ALTER TABLE `estorno_parcela_matriculas` ADD PRIMARY KEY (`cod_estorno`), ADD KEY `parcMatricula_e_estorno` (`cod_parc`); -- -- Indexes for table `fornecedor` -- ALTER TABLE `fornecedor` ADD PRIMARY KEY (`cod_fornec`), ADD KEY `cidade_e_fornecedor` (`cod_cidade`); -- -- Indexes for table `frequencia` -- ALTER TABLE `frequencia` ADD PRIMARY KEY (`cod_frequencia`), ADD KEY `matricula_e_frequencia` (`cod_matricula`), ADD KEY `cursos_e_frequencia` (`cod_curso`), ADD KEY `turmas_e_frequencia` (`cod_turma`); -- -- Indexes for table `materiais` -- ALTER TABLE `materiais` ADD PRIMARY KEY (`cod_material`); -- -- Indexes for table `matricula` -- ALTER TABLE `matricula` ADD PRIMARY KEY (`cod_matricula`), ADD KEY `turmas_e_matriculas` (`cod_turma`), ADD KEY `pessoas_e_matriculas` (`cod_pessoa`), ADD KEY `condicao_e_matricula` (`cod_cond`); -- -- Indexes for table `notas` -- ALTER TABLE `notas` ADD PRIMARY KEY (`cod_nota`), ADD KEY `matricula_e_notas` (`cod_matricula`); -- -- Indexes for table `parcelamatriculas` -- ALTER TABLE `parcelamatriculas` ADD PRIMARY KEY (`cod_parc`), ADD KEY `pessoas_e_parcelas` (`cod_pessoa`), ADD KEY `matricula_e_parcela` (`cod_matricula`); -- -- Indexes for table `parcela_despesas` -- ALTER TABLE `parcela_despesas` ADD PRIMARY KEY (`cod_parcela`), ADD KEY `despesas_e_parcelas` (`cod_despesa`), ADD KEY `fornecedor_e_parcelas_despesas` (`cod_fornec`); -- -- Indexes for table `pessoas` -- ALTER TABLE `pessoas` ADD PRIMARY KEY (`cod_pessoa`), ADD KEY `cidades_e_pessoas` (`cod_cidade`); -- -- Indexes for table `turmas` -- ALTER TABLE `turmas` ADD PRIMARY KEY (`cod_turma`), ADD KEY `cursos_e_turmas` (`cod_curso`); -- -- Indexes for table `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`cod_usuario`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `cidades` -- ALTER TABLE `cidades` MODIFY `cod_cidade` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=70; -- -- AUTO_INCREMENT for table `cond_pgto` -- ALTER TABLE `cond_pgto` MODIFY `cod_cond` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `cursos` -- ALTER TABLE `cursos` MODIFY `cod_curso` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `materiais` -- ALTER TABLE `materiais` MODIFY `cod_material` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `usuarios` -- ALTER TABLE `usuarios` MODIFY `cod_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; 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 PROCEDURE CPI.COPY_POL_WDISCOUNT_POLBAS; CREATE OR REPLACE PROCEDURE CPI.COPY_POL_WDISCOUNT_POLBAS( p_par_id IN GIPI_PARLIST.par_id%TYPE, p_policy_id IN GIPI_POLBASIC.policy_id%TYPE ) IS CURSOR discount IS SELECT line_cd, subline_cd, disc_rt, disc_amt, net_gross_tag, SEQUENCE, orig_prem_amt, net_prem_amt, last_update, remarks, surcharge_rt, surcharge_amt FROM GIPI_WPOLBAS_DISCOUNT WHERE par_id = p_par_id; BEGIN /* ** Created by : Jerome Orio ** Date Created : March 31, 2010 ** Reference By : (GIPIS055 - POST PAR) ** Description : COPY_POL_WDISCOUNT_POLBAS program unit */ FOR D1 IN DISCOUNT LOOP INSERT INTO GIPI_POLBASIC_DISCOUNT (policy_id, line_cd, subline_cd, disc_rt, disc_amt, net_gross_tag, SEQUENCE, orig_prem_amt, net_prem_amt, last_update, remarks, surcharge_rt, surcharge_amt) VALUES(p_policy_id, D1.line_cd, D1.subline_cd, D1.disc_rt, D1.disc_amt, D1.net_gross_tag, D1.SEQUENCE, D1.orig_prem_amt, D1.net_prem_amt, D1.last_update, D1.remarks, D1.surcharge_rt, D1.surcharge_amt); END LOOP; END; /
DROP SCHEMA IF EXISTS libreria; CREATE SCHEMA libreria; USE libreria; DROP TABLE IF EXISTS venta; DROP TABLE IF EXISTS libro; DROP TABLE IF EXISTS editorial; DROP TABLE IF EXISTS autor; CREATE TABLE autor( autId integer AUTO_INCREMENT PRIMARY KEY, autNombre varchar(30) NOT NULL, autApellido varchar(30) NOT NULL, autEmail char(25) NULL, autPais ENUM( 'Argentina' , 'Alemania', 'Colombia', 'Italia', 'Mexico','España', 'Brasil', 'EUA') DEFAULT 'Colombia' ); CREATE TABLE editorial( ediId smallint AUTO_INCREMENT PRIMARY KEY, ediNombre char(30) NOT NULL ); CREATE TABLE libro( libId integer PRIMARY KEY, libNombre char(50) NOT NULL, libPub smallint NULL, ediId smallint NOT NULL, autId integer NOT NULL, libPrecio double(7,1) NOT NULL, FOREIGN KEY(ediId)REFERENCES editorial(ediId), FOREIGN KEY(autId)REFERENCES autor(autId) ); CREATE TABLE venta( vtaId integer AUTO_INCREMENT PRIMARY KEY, vtaFecha date NOT NULL, libId integer NOT NULL, vtaCantidad smallint NOT NULL, vtaTotal double(10,1) NOT NULL, FOREIGN KEY(libId)REFERENCES libro(libId) ); INSERT INTO editorial(ediNombre) VALUES('Sudamericana'); INSERT INTO editorial(ediNombre) VALUES('Cromos'); INSERT INTO editorial(ediNombre) VALUES('GEUP Colombia'); INSERT INTO editorial(ediNombre) VALUES('Samuel'); INSERT INTO editorial(ediNombre) VALUES('Planeta'); INSERT INTO editorial(ediNombre) VALUES('Panamericana'); INSERT INTO editorial(ediNombre) VALUES('Penguin Random House'); INSERT INTO autor(autNombre, autApellido) VALUES('Gabriel', 'García Márquez'); INSERT INTO autor(autNombre, autApellido) VALUES('Rafael','Pombo'); INSERT INTO autor(autNombre, autApellido) VALUES('Jorge','Isaacs'); INSERT INTO autor(autNombre, autApellido) VALUES('José Eustasio','Rivera'); INSERT INTO autor(autNombre, autApellido) VALUES('Gustavo','Álvarez Gardeazábal'); INSERT INTO autor(autNombre, autApellido,autEmail,autPais) VALUES('Paulo','Coelho','pcoelho@gmail.com','Brasil'); INSERT INTO autor(autNombre, autApellido,autEmail) VALUES('Héctor','Abad Faciolince','hAbad@gmail.com'); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1001, 'Cien años de soledad',1967,1,1, 100000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1002, 'La Vorágine',1924,2,4, 110000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1003, 'María',1867,4,3, 80000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1004, 'Condores no entierran todos los días',1971,3,5,80000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1005, 'El renacuajo paseador',1867,5,2,60000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1006, 'El olvido que seremos',2005,6,7,150000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1007, 'El camino del arquero',2017,5,6,130000); INSERT INTO libro(libId,libNombre,libPub,ediId,autId,libPrecio) VALUES(1008, 'El amor en los tiempos del cólera',1985,6,1,120000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-04-17', 1005, 2,120000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-07-08', 1001, 2,200000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-09-23', 1001, 1,100000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-09-27', 1003, 1,80000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-11-07', 1003, 2,160000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-11-17', 1007, 2,260000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2020-12-18', 1007, 1,130000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-01-17', 1008, 1,120000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-02-17', 1002, 3,330000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-03-17', 1005, 1,60000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-03-17', 1006, 2,300000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-04-17', 1004, 1,80000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-04-17', 1001, 1,120000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-05-17', 1007, 1,130000); INSERT INTO venta(vtaFecha, libId, vtaCantidad, vtaTotal) VALUES ('2021-06-09', 1006, 1,150000);
delete from HtmlLabelIndex where id=25437 / delete from HtmlLabelInfo where indexid=25437 / INSERT INTO HtmlLabelIndex values(25437,'使用状态') / delete from HtmlLabelIndex where id=25439 / delete from HtmlLabelInfo where indexid=25439 / INSERT INTO HtmlLabelIndex values(25439,'停止使用') / delete from HtmlLabelIndex where id=25438 / delete from HtmlLabelInfo where indexid=25438 / INSERT INTO HtmlLabelIndex values(25438,'正常使用') / INSERT INTO HtmlLabelInfo VALUES(25437,'使用状态',7) / INSERT INTO HtmlLabelInfo VALUES(25437,'Use Status',8) / INSERT INTO HtmlLabelInfo VALUES(25437,'使用狀態',9) / INSERT INTO HtmlLabelInfo VALUES(25438,'正常使用',7) / INSERT INTO HtmlLabelInfo VALUES(25438,'Normal Use',8) / INSERT INTO HtmlLabelInfo VALUES(25438,'正常使用',9) / INSERT INTO HtmlLabelInfo VALUES(25439,'停止使用',7) / INSERT INTO HtmlLabelInfo VALUES(25439,'Stop Use',8) / INSERT INTO HtmlLabelInfo VALUES(25439,'停止使用',9) /
-- USE university -- define database to avoid referencing everytime -- adding data INSERT INTO `university`.`course` -- schema & table name (`course_id`, `course_name`) -- column/attributes name VALUES (001, "Biochemistry"), (002, "Data Science"), (003, "Operating Systems"); -- values to the attributes -- new table CREATE TABLE `university`.`person` ( `idperson` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, `dni` VARCHAR(11) NOT NULL, PRIMARY KEY (`idperson`), UNIQUE INDEX `idperson_UNIQUE` (`idperson` ASC) VISIBLE); -- seeing the table SELECT `course`.`course_id`, `course`.`course_name` FROM `university`.`coursecoursecourse_namecourse_idcoursecourse`; INSERT INTO `university`.`person` (`idperson`, `name`, `dni`) VALUES (1, "Sarah Morgan", "45234445"), (2,"Eric Kelly", "56678433"); -- updating values UPDATE `university`.`person` SET `name` = "Laura", `dni` = "45.678.888" WHERE `idperson` = 1; -- DESC person; sorting the selected data in descending order -- adding columns ALTER TABLE person ADD dateOfBirth DATE; -- modifying the columns ALTER TABLE person MODIFY dateofBirth YEAR; -- delete the new column ALTER TABLE person DROP COLUMN dateOfBirth; -- adding columns with default values -- change!!!!! for null ALTER TABLE person ADD dateofBirth INT NOT NULL DEFAULT 1990; -- updating the default values UPDATE `university`.`person` SET `dateOfBirth` = 1989 WHERE `idperson` = 1; UPDATE `university`.`person` SET `dateOfBirth` = 1999 WHERE `idperson` = 2; -- adding more values INSERT INTO `university`.`person` (`idperson`, `name`, `dni`, `dateOfBirth`) VALUES (3,"Lisa Loretta", "56.567.234", 1999); -- delete data DELETE FROM `university`.`person` WHERE dateOfBirth != 1999; -- delete the entire data from the table DELETE FROM course; -- remove the table itself from the database, use DROP TABLE DROP TABLE course; -- always delete the child table with the foreign key first -- because if we delete referenced table first, it will throw an error
delete from tbl_filter_activation where account_id = %1
SELECT * FROM MAIL_HOOK_CONDITIONS ORDER BY INSERT_DATETIME %s;
use sql_avancado; sp_help resposta; select * from aluno; select a.nome,c.nome from aluno a join matricula m on a.id=m.aluno_id join curso c on m.curso_id = c.id order by a.nome select count(*) from aluno; select a.nome from aluno a where not exists(select m.id from matricula m where m.data > dateadd(day,-45,getdate()) and m.aluno_id=a.id); select a.nome from aluno a left join matricula m on m.aluno_id=a.id and m.data > dateadd(day,-45,getdate()); select e.id,e.pergunta from exercicio e where not exists(select r.id from resposta r where r.exercicio_id=e.id); select * from curso c where not exists(select m.id from matricula m where m.curso_id=c.id); select a.nome, c.nome from aluno a join matricula m on m.aluno_id=a.id join curso c on m.curso_id=c.id where not exists(select r.aluno_id from resposta r where r.aluno_id=a.id); select a.nome from aluno a join resposta r on a.id=r.aluno_id where exists(select m.aluno_id from matricula m where m.aluno_id=a.id); create database sql2; select c.nome, avg(n.nota) as media_nota from nota n join resposta r on n.resposta_id=r.id join exercicio e on r.exercicio_id=e.id join secao s on e.secao_id=s.id join curso c on s.curso_id=c.id group by c.nome; select c.nome, avg(n.nota) as media_nota from nota n join resposta r on n.resposta_id=r.id join exercicio e on r.exercicio_id=e.id join secao s on e.secao_id=s.id join curso c on s.curso_id=c.id join aluno a on r.aluno_id=a.id where a.nome like '%Santos%' or a.nome like '%Silva%' group by c.nome; select c.nome, count(*) as contagem from exercicio e join secao s on e.secao_id=s.id join curso c on s.curso_id=c.id group BY c.nome; select c.nome,count(*) as qtd from curso c join matricula m on m.curso_id=c.id join aluno a on a.id=m.aluno_id group BY c.nome; select e.pergunta, count(*) as qtd_respostas from resposta r join exercicio e on r.exercicio_id=e.id group by e.pergunta order by count(*) desc; select c.nome,a.nome,avg(n.nota) as media_nota from nota n join resposta r on n.resposta_id=r.id join exercicio e on r.exercicio_id=e.id join secao s on e.secao_id=s.id join curso c on s.curso_id=c.id join aluno a on r.aluno_id=a.id group by c.nome,a.nome; select a.nome,c.nome, avg(n.nota) from nota n join resposta r on r.id=n.resposta_id join exercicio e on r.exercicio_id=e.id join secao s on s.id=e.secao_id join curso c on c.id=s.curso_id join aluno a on a.id=r.aluno_id group by a.nome,c.nome HAVING avg(n.nota) < 5; select c.nome,count(a.id) from curso c join matricula m on m.curso_id=c.id join aluno a on a.id=m.aluno_id group by c.nome having count(a.id) > 1; select c.nome, count(m.id) from curso c join matricula m on c.id = m.curso_id group by c.nome having count(m.id) > 1; select c.nome, count(c.id) as qtd_secao from curso c join secao s on s.curso_id=c.id group by c.nome having count(c.id) > 3;
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50505 Source Host : localhost:3306 Source Database : zjds Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2018-11-28 17:16:43 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for transport_template -- ---------------------------- DROP TABLE IF EXISTS `transport_template`; CREATE TABLE `transport_template` ( `transport_template_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '运费模板id', `pay_type` int(11) DEFAULT '1' COMMENT '计价方式,1重量,2件数', `transport_type` int(11) DEFAULT '1' COMMENT '运送方式 , 1快递,2平邮,3EMS 4货运', `desc` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '说明', `create_person` varchar(56) DEFAULT NULL COMMENT '创建人', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_person` varchar(56) DEFAULT NULL COMMENT '更新人', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `del_flag` tinyint(4) DEFAULT '0' COMMENT '删除标记,0不删除,1删除', `default_number` int(11) DEFAULT NULL COMMENT '默认件数', `default_price` decimal(10,0) DEFAULT NULL COMMENT '默认运费价格', `default_add_number` int(11) DEFAULT NULL COMMENT '增加件数', `default_add_price` decimal(10,0) DEFAULT NULL COMMENT '增加的价格', `transport_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '模版名称', PRIMARY KEY (`transport_template_id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 COMMENT='运费模板表'; -- ---------------------------- -- Records of transport_template -- ---------------------------- INSERT INTO `transport_template` VALUES ('9', '2', '2', '2', null, null, null, null, '0', '2', '2', '2', '2', '2'); INSERT INTO `transport_template` VALUES ('10', '1', '1', '首次', null, null, null, null, '0', '1', '12', '2', '23', '便宜货'); INSERT INTO `transport_template` VALUES ('11', '1', '1', '首次', null, null, null, null, '0', '1', '12', '2', '23', '便宜货'); INSERT INTO `transport_template` VALUES ('12', '1', '1', '首次', null, null, null, null, '0', '1', '12', '2', '23', '便宜货'); INSERT INTO `transport_template` VALUES ('13', '1', '1', '首次', null, null, null, null, '0', '1', '12', '2', '23', '便宜货'); INSERT INTO `transport_template` VALUES ('14', '1', '1', '首次', null, null, null, null, '0', '1', '12', '2', '23', '便宜货'); INSERT INTO `transport_template` VALUES ('15', '1', '1', '首次11', null, null, null, null, '0', '1', '12', '2', '23', '便宜货111');
# --- !Ups create table payment_expiration ( id bigint not null, is_deleted boolean, type varchar(255), total integer, brand_id bigint, user_id bigint, created_at timestamp not null, updated_at timestamp not null, constraint pk_payment_expiration primary key (id)) ; create sequence payment_expiration_seq; alter table payment_expiration add constraint fk_payment_expiration_brand_16 foreign key (brand_id) references brand (id); create index ix_payment_expiration_brand_16 on payment_expiration (brand_id); alter table payment_expiration add constraint fk_payment_expiration_userCms_18 foreign key (user_id) references user_cms (id); create index ix_payment_expiration_userCms_18 on payment_expiration (user_id); # --- !Downs drop table if exists payment_expiration cascade; drop sequence if exists payment_expiration_seq;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; INSERT INTO place (place_id, place_name, place_area, place_type, place_image) VALUES (uuid_generate_v4(),'Byblos Sur Mer','Byblos' ,'Hotel', '/place-images/byblos-sur-mer.jpg'); INSERT INTO place (place_id, place_name, place_area, place_type, place_image) VALUES (uuid_generate_v4(),'Movenpick','Beirut' ,'Hotel', '/place-images/movenpick.jpg'); INSERT INTO place (place_id, place_name, place_area, place_type, place_image) VALUES (uuid_generate_v4(),'Lancaster Plaza','Beirut' ,'Hotel', '/place-images/lancaster-plaza.jpg'); INSERT INTO place (place_id, place_name, place_area, place_type, place_image) VALUES (uuid_generate_v4(),'Imara','Jdeideh' ,'Restaurant', '/place-images/imara.jpg'); INSERT INTO place (place_id, place_name, place_area, place_type, place_image) VALUES (uuid_generate_v4(),'Music Hall','Beirut' ,'Night Club', '/place-images/music-hall.jpg');
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 02, 2018 at 04:07 PM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.2.7 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: `sim_radius` -- -- -------------------------------------------------------- -- -- Table structure for table `nas` -- CREATE TABLE `nas` ( `id` int(10) NOT NULL, `nasname` varchar(128) NOT NULL, `shortname` varchar(32) DEFAULT NULL, `type` varchar(30) DEFAULT 'other', `ports` int(5) DEFAULT NULL, `secret` varchar(60) NOT NULL DEFAULT 'secret', `server` varchar(64) DEFAULT NULL, `community` varchar(50) DEFAULT NULL, `description` varchar(200) DEFAULT 'RADIUS Client' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `radacct` -- CREATE TABLE `radacct` ( `radacctid` bigint(21) NOT NULL, `acctsessionid` varchar(64) NOT NULL DEFAULT '', `acctuniqueid` varchar(32) NOT NULL DEFAULT '', `username` varchar(64) NOT NULL DEFAULT '', `realm` varchar(64) DEFAULT '', `nasipaddress` varchar(15) NOT NULL DEFAULT '', `nasportid` varchar(15) DEFAULT NULL, `nasporttype` varchar(32) DEFAULT NULL, `acctstarttime` datetime DEFAULT NULL, `acctupdatetime` datetime DEFAULT NULL, `acctstoptime` datetime DEFAULT NULL, `acctinterval` int(12) DEFAULT NULL, `acctsessiontime` int(12) UNSIGNED DEFAULT NULL, `acctauthentic` varchar(32) DEFAULT NULL, `connectinfo_start` varchar(50) DEFAULT NULL, `connectinfo_stop` varchar(50) DEFAULT NULL, `acctinputoctets` bigint(20) DEFAULT NULL, `acctoutputoctets` bigint(20) DEFAULT NULL, `calledstationid` varchar(50) NOT NULL DEFAULT '', `callingstationid` varchar(50) NOT NULL DEFAULT '', `acctterminatecause` varchar(32) NOT NULL DEFAULT '', `servicetype` varchar(32) DEFAULT NULL, `framedprotocol` varchar(32) DEFAULT NULL, `framedipaddress` varchar(15) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Triggers `radacct` -- DELIMITER $$ CREATE TRIGGER `trig_update_userstats` AFTER UPDATE ON `radacct` FOR EACH ROW INSERT INTO user_status SET radacct_id = OLD.radacctid, username = OLD.username, nasipaddress = OLD.nasipaddress, framedipaddress = OLD.framedipaddress, callingstationid = OLD.callingstationid, acctinputoctets = (NEW.acctinputoctets - OLD.acctinputoctets), acctoutputoctets = (NEW.acctoutputoctets - OLD.acctoutputoctets) $$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `radcheck` -- CREATE TABLE `radcheck` ( `id` int(11) UNSIGNED NOT NULL, `username` varchar(64) NOT NULL DEFAULT '', `attribute` varchar(64) NOT NULL DEFAULT '', `op` char(2) NOT NULL DEFAULT '==', `value` varchar(253) NOT NULL DEFAULT '', `id_userinet` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `radcheck` -- INSERT INTO `radcheck` (`id`, `username`, `attribute`, `op`, `value`, `id_userinet`) VALUES (285, '3042015001', 'User-Pasword', '==', '3042015001', '156'), (286, '3042015001', 'User-Profile', ':=', 'Mahasiswa', '156'), (287, '3042015002', 'User-Pasword', '==', '3042015002', '157'), (288, '3042015002', 'User-Profile', ':=', 'Mahasiswa', '157'), (289, '3042015003', 'User-Pasword', '==', '3042015003', '158'), (290, '3042015003', 'User-Profile', ':=', 'Mahasiswa', '158'), (291, '3042015004', 'User-Pasword', '==', '3042015004', '159'), (292, '3042015004', 'User-Profile', ':=', 'Mahasiswa', '159'), (293, '3042015005', 'User-Pasword', '==', '3042015005', '160'), (294, '3042015005', 'User-Profile', ':=', 'Mahasiswa', '160'), (295, '3042015006', 'User-Pasword', '==', '3042015006', '161'), (296, '3042015006', 'User-Profile', ':=', 'Mahasiswa', '161'), (297, '3042015007', 'User-Pasword', '==', '3042015007', '162'), (298, '3042015007', 'User-Profile', ':=', 'Mahasiswa', '162'), (299, '3042015008', 'User-Pasword', '==', '3042015008', '163'), (300, '3042015008', 'User-Profile', ':=', 'Mahasiswa', '163'), (301, '3042015009', 'User-Pasword', '==', '3042015009', '164'), (302, '3042015009', 'User-Profile', ':=', 'Mahasiswa', '164'), (303, '3042015010', 'User-Pasword', '==', '3042015010', '165'), (304, '3042015010', 'User-Profile', ':=', 'Mahasiswa', '165'), (305, '3042015011', 'User-Pasword', '==', '3042015011', '166'), (306, '3042015011', 'User-Profile', ':=', 'Mahasiswa', '166'), (307, '3042015012', 'User-Pasword', '==', '3042015012', '167'), (308, '3042015012', 'User-Profile', ':=', 'Mahasiswa', '167'), (309, '3042015013', 'User-Pasword', '==', '3042015013', '168'), (310, '3042015013', 'User-Profile', ':=', 'Mahasiswa', '168'), (311, '3042015014', 'User-Pasword', '==', '3042015014', '169'), (312, '3042015014', 'User-Profile', ':=', 'Mahasiswa', '169'), (313, '3042015015', 'User-Pasword', '==', '3042015015', '170'), (314, '3042015015', 'User-Profile', ':=', 'Mahasiswa', '170'), (315, '3042015016', 'User-Pasword', '==', '3042015016', '171'), (316, '3042015016', 'User-Profile', ':=', 'Mahasiswa', '171'), (317, '3042015017', 'User-Pasword', '==', '3042015017', '172'), (318, '3042015017', 'User-Profile', ':=', 'Mahasiswa', '172'), (319, '3042015018', 'User-Pasword', '==', '3042015018', '173'), (320, '3042015018', 'User-Profile', ':=', 'Mahasiswa', '173'), (321, '3042015019', 'User-Pasword', '==', '3042015019', '174'), (322, '3042015019', 'User-Profile', ':=', 'Mahasiswa', '174'), (323, '3042015020', 'User-Pasword', '==', '3042015020', '175'), (324, '3042015020', 'User-Profile', ':=', 'Mahasiswa', '175'), (325, '3042015021', 'User-Pasword', '==', '3042015021', '176'), (326, '3042015021', 'User-Profile', ':=', 'Mahasiswa', '176'), (327, '3042015022', 'User-Pasword', '==', '3042015022', '177'), (328, '3042015022', 'User-Profile', ':=', 'Mahasiswa', '177'), (329, '3042015023', 'User-Pasword', '==', '3042015023', '178'), (330, '3042015023', 'User-Profile', ':=', 'Mahasiswa', '178'), (331, '3042015024', 'User-Pasword', '==', '3042015024', '179'), (332, '3042015024', 'User-Profile', ':=', 'Mahasiswa', '179'), (333, '3042015025', 'User-Pasword', '==', '3042015025', '180'), (334, '3042015025', 'User-Profile', ':=', 'Mahasiswa', '180'), (335, '3042015026', 'User-Pasword', '==', '3042015026', '181'), (336, '3042015026', 'User-Profile', ':=', 'Mahasiswa', '181'), (337, '3042015027', 'User-Pasword', '==', '3042015027', '182'), (338, '3042015027', 'User-Profile', ':=', 'Mahasiswa', '182'), (339, '3042015028', 'User-Pasword', '==', '3042015028', '183'), (340, '3042015028', 'User-Profile', ':=', 'Mahasiswa', '183'), (341, '3042015029', 'User-Pasword', '==', '3042015029', '184'), (342, '3042015029', 'User-Profile', ':=', 'Mahasiswa', '184'), (343, '3042015030', 'User-Pasword', '==', '3042015030', '185'), (344, '3042015030', 'User-Profile', ':=', 'Mahasiswa', '185'), (345, '3042015031', 'User-Pasword', '==', '3042015031', '186'), (346, '3042015031', 'User-Profile', ':=', 'Mahasiswa', '186'), (347, '3042015032', 'User-Pasword', '==', '3042015032', '187'), (348, '3042015032', 'User-Profile', ':=', 'Mahasiswa', '187'), (349, '3042015033', 'User-Pasword', '==', '3042015033', '188'), (350, '3042015033', 'User-Profile', ':=', 'Mahasiswa', '188'), (351, '3042015034', 'User-Pasword', '==', '3042015034', '189'), (352, '3042015034', 'User-Profile', ':=', 'Mahasiswa', '189'), (353, '3042015035', 'User-Pasword', '==', '3042015035', '190'), (354, '3042015035', 'User-Profile', ':=', 'Mahasiswa', '190'), (355, '3042015036', 'User-Pasword', '==', '3042015036', '191'), (356, '3042015036', 'User-Profile', ':=', 'Mahasiswa', '191'), (357, '3042015037', 'User-Pasword', '==', '3042015037', '192'), (358, '3042015037', 'User-Profile', ':=', 'Mahasiswa', '192'), (359, '3042015038', 'User-Pasword', '==', '3042015038', '193'), (360, '3042015038', 'User-Profile', ':=', 'Mahasiswa', '193'), (361, '3042015039', 'User-Pasword', '==', '3042015039', '194'), (362, '3042015039', 'User-Profile', ':=', 'Mahasiswa', '194'), (363, '3042015040', 'User-Pasword', '==', '3042015040', '195'), (364, '3042015040', 'User-Profile', ':=', 'Mahasiswa', '195'), (365, '3042015041', 'User-Pasword', '==', '3042015041', '196'), (366, '3042015041', 'User-Profile', ':=', 'Mahasiswa', '196'), (367, '3042015042', 'User-Pasword', '==', '3042015042', '197'), (368, '3042015042', 'User-Profile', ':=', 'Mahasiswa', '197'), (369, '3042015043', 'User-Pasword', '==', '3042015043', '198'), (370, '3042015043', 'User-Profile', ':=', 'Mahasiswa', '198'), (371, '3042015044', 'User-Pasword', '==', '3042015044', '199'), (372, '3042015044', 'User-Profile', ':=', 'Mahasiswa', '199'), (373, '3042015045', 'User-Pasword', '==', '3042015045', '200'), (374, '3042015045', 'User-Profile', ':=', 'Mahasiswa', '200'), (375, '3042015046', 'User-Pasword', '==', '3042015046', '201'), (376, '3042015046', 'User-Profile', ':=', 'Mahasiswa', '201'), (377, '3042015047', 'User-Pasword', '==', '3042015047', '202'), (378, '3042015047', 'User-Profile', ':=', 'Mahasiswa', '202'), (379, '3042015048', 'User-Pasword', '==', '3042015048', '203'), (380, '3042015048', 'User-Profile', ':=', 'Mahasiswa', '203'), (381, '3042015049', 'User-Pasword', '==', '3042015049', '204'), (382, '3042015049', 'User-Profile', ':=', 'Mahasiswa', '204'), (383, '3042015050', 'User-Pasword', '==', '3042015050', '205'), (384, '3042015050', 'User-Profile', ':=', 'Mahasiswa', '205'), (385, '3042015051', 'User-Pasword', '==', '3042015051', '206'), (386, '3042015051', 'User-Profile', ':=', 'Mahasiswa', '206'), (387, '3042015052', 'User-Pasword', '==', '3042015052', '207'), (388, '3042015052', 'User-Profile', ':=', 'Mahasiswa', '207'), (389, '3042015053', 'User-Pasword', '==', '3042015053', '208'), (390, '3042015053', 'User-Profile', ':=', 'Mahasiswa', '208'), (391, '3042015054', 'User-Pasword', '==', '3042015054', '209'), (392, '3042015054', 'User-Profile', ':=', 'Mahasiswa', '209'), (393, '3042015055', 'User-Pasword', '==', '3042015055', '210'), (394, '3042015055', 'User-Profile', ':=', 'Mahasiswa', '210'), (395, '3042015056', 'User-Pasword', '==', '3042015056', '211'), (396, '3042015056', 'User-Profile', ':=', 'Mahasiswa', '211'), (397, '3042015057', 'User-Pasword', '==', '3042015057', '212'), (398, '3042015057', 'User-Profile', ':=', 'Mahasiswa', '212'), (399, '3042015058', 'User-Pasword', '==', '3042015058', '213'), (400, '3042015058', 'User-Profile', ':=', 'Mahasiswa', '213'), (401, '3042015059', 'User-Pasword', '==', '3042015059', '214'), (402, '3042015059', 'User-Profile', ':=', 'Mahasiswa', '214'), (403, '161180915169', 'User-Profile', ':=', 'Dosen', '215'), (404, '161180915169', 'User-Password', '==', '161180915169', '215'); -- -------------------------------------------------------- -- -- Table structure for table `radgroupcheck` -- CREATE TABLE `radgroupcheck` ( `id` int(11) UNSIGNED NOT NULL, `groupname` varchar(64) NOT NULL DEFAULT '', `attribute` varchar(64) NOT NULL DEFAULT '', `op` char(2) NOT NULL DEFAULT '==', `value` varchar(253) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `radgroupreply` -- CREATE TABLE `radgroupreply` ( `id` int(11) UNSIGNED NOT NULL, `groupname` varchar(64) NOT NULL DEFAULT '', `attribute` varchar(64) NOT NULL DEFAULT '', `op` char(2) NOT NULL DEFAULT '=', `value` varchar(253) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `radgroupreply` -- INSERT INTO `radgroupreply` (`id`, `groupname`, `attribute`, `op`, `value`) VALUES (1, 'Limit-Mahasiswa', 'Mikrotik-Rate-Limit', ':=', '3M/512k'), (2, 'Limit-Staf', 'Mikrotik-Rate-Limit', ':=', '2M/512k'), (3, 'Limit-Dosen', 'Mikrotik-Rate-Limit', ':=', '5M/1M'), (4, 'Disable-User', 'Auth-Type', ':=', 'Reject'); -- -------------------------------------------------------- -- -- Table structure for table `radpostauth` -- CREATE TABLE `radpostauth` ( `id` int(11) NOT NULL, `username` varchar(64) NOT NULL DEFAULT '', `pass` varchar(64) NOT NULL DEFAULT '', `reply` varchar(32) NOT NULL DEFAULT '', `authdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `radreply` -- CREATE TABLE `radreply` ( `id` int(11) UNSIGNED NOT NULL, `username` varchar(64) NOT NULL DEFAULT '', `attribute` varchar(64) NOT NULL DEFAULT '', `op` char(2) NOT NULL DEFAULT '=', `value` varchar(253) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `radusergroup` -- CREATE TABLE `radusergroup` ( `id_group` int(11) NOT NULL, `username` varchar(64) NOT NULL DEFAULT '', `groupname` varchar(64) NOT NULL DEFAULT '', `priority` int(11) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `radusergroup` -- INSERT INTO `radusergroup` (`id_group`, `username`, `groupname`, `priority`) VALUES (1, 'Mahasiswa', 'Limit-Mahasiswa', 3), (2, 'Staf', 'Limit-Staf', 2), (3, 'Dosen', 'Limit-Dosen', 1), (4, 'DISABLE', 'Disable-User', 8); -- -------------------------------------------------------- -- -- Table structure for table `tbl_hak_akses` -- CREATE TABLE `tbl_hak_akses` ( `id` int(11) NOT NULL, `id_user_level` int(11) NOT NULL, `id_menu` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_hak_akses` -- INSERT INTO `tbl_hak_akses` (`id`, `id_user_level`, `id_menu`) VALUES (15, 1, 1), (19, 1, 3), (21, 2, 1), (24, 1, 9), (28, 2, 3), (29, 2, 2), (30, 1, 2), (31, 1, 10), (32, 1, 11), (33, 1, 12), (35, 1, 14), (36, 1, 15), (37, 1, 16), (38, 1, 13); -- -------------------------------------------------------- -- -- Table structure for table `tbl_menu` -- CREATE TABLE `tbl_menu` ( `id_menu` int(11) NOT NULL, `title` varchar(50) NOT NULL, `url` varchar(30) NOT NULL, `icon` varchar(30) NOT NULL, `is_main_menu` int(11) NOT NULL, `is_aktif` enum('y','n') NOT NULL COMMENT 'y=yes,n=no' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_menu` -- INSERT INTO `tbl_menu` (`id_menu`, `title`, `url`, `icon`, `is_main_menu`, `is_aktif`) VALUES (1, 'KELOLA MENU', 'kelolamenu', 'fa fa-server', 0, 'y'), (2, 'KELOLA PENGGUNA', 'user', 'fa fa-user-o', 0, 'y'), (3, 'level PENGGUNA', 'userlevel', 'fa fa-users', 0, 'y'), (9, 'Contoh Form', 'welcome/form', 'fa fa-id-card', 0, 'n'), (10, 'Data User', 'Data_User', 'fa fa-address-book', 0, 'y'), (11, 'Setting', 'radgroupcheck', 'fa fa-bars', 0, 'y'), (12, 'User', 'User_Inet', 'fa fa-graduation-cap', 10, 'y'), (13, 'Import User', 'Import_Excel', 'fa fa-check', 10, 'y'), (14, 'Profil', 'Profil_Radusergroup', 'fa fa-check', 11, 'y'), (15, 'Limit Profil', 'Limit_Radgroupreply', 'fa fa-check', 11, 'y'), (16, 'User Active', 'User_status', 'fa fa-wifi', 0, 'y'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_setting` -- CREATE TABLE `tbl_setting` ( `id_setting` int(11) NOT NULL, `nama_setting` varchar(50) NOT NULL, `value` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_setting` -- INSERT INTO `tbl_setting` (`id_setting`, `nama_setting`, `value`) VALUES (1, 'Tampil Menu', 'ya'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_user` -- CREATE TABLE `tbl_user` ( `id_users` int(11) NOT NULL, `full_name` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `images` text NOT NULL, `id_user_level` int(11) NOT NULL, `is_aktif` enum('y','n') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_user` -- INSERT INTO `tbl_user` (`id_users`, `full_name`, `email`, `password`, `images`, `id_user_level`, `is_aktif`) VALUES (1, 'Nuris Akbar M.Kom', 'nuris.akbar@gmail.com', '$2y$04$Wbyfv4xwihb..POfhxY5Y.jHOJqEFIG3dLfBYwAmnOACpH0EWCCdq', 'atomix_user31.png', 1, 'y'), (3, 'Muhammad hafidz Muzaki', 'hafid@gmail.com', '$2y$04$Wbyfv4xwihb..POfhxY5Y.jHOJqEFIG3dLfBYwAmnOACpH0EWCCdq', '7.png', 2, 'y'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_user_inet` -- CREATE TABLE `tbl_user_inet` ( `id_userinet` int(11) NOT NULL, `nama` varchar(50) NOT NULL, `ni_username` varchar(20) NOT NULL, `password` varchar(40) NOT NULL, `profil` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_user_inet` -- INSERT INTO `tbl_user_inet` (`id_userinet`, `nama`, `ni_username`, `password`, `profil`) VALUES (156, 'Susanti', '3042015001', '3042015001', 'Mahasiswa'), (157, 'Devi Riani Nuradmi', '3042015002', '3042015002', 'Mahasiswa'), (158, 'Satrio Akbar Kayung', '3042015003', '3042015003', 'Mahasiswa'), (159, 'Ayu Prihatin', '3042015004', '3042015004', 'Mahasiswa'), (160, 'Hidayat', '3042015005', '3042015005', 'Mahasiswa'), (161, 'Achmad Zakiyul Wafa', '3042015006', '3042015006', 'Mahasiswa'), (162, 'Winda Safitri', '3042015007', '3042015007', 'Mahasiswa'), (163, 'Novi Nisa Atussalehah', '3042015008', '3042015008', 'Mahasiswa'), (164, 'Ullan Pramasari', '3042015009', '3042015009', 'Mahasiswa'), (165, 'Nanda Nugraha', '3042015010', '3042015010', 'Mahasiswa'), (166, 'Nendya Putri Susanto', '3042015011', '3042015011', 'Mahasiswa'), (167, 'Feby Sundari', '3042015012', '3042015012', 'Mahasiswa'), (168, 'Ahmad Hafidz', '3042015013', '3042015013', 'Mahasiswa'), (169, 'Eko Hardianto', '3042015014', '3042015014', 'Mahasiswa'), (170, 'Winda Martasari', '3042015015', '3042015015', 'Mahasiswa'), (171, 'Muhammad Wahyudin', '3042015016', '3042015016', 'Mahasiswa'), (172, 'Pebri Hariansyah', '3042015017', '3042015017', 'Mahasiswa'), (173, 'Dedi Mohtar', '3042015018', '3042015018', 'Mahasiswa'), (174, 'M.Juni Rian Efendi', '3042015019', '3042015019', 'Mahasiswa'), (175, 'Budi Santoso', '3042015020', '3042015020', 'Mahasiswa'), (176, 'Utin Ana Zakiyatul Faudah', '3042015021', '3042015021', 'Mahasiswa'), (177, 'Nada Kristina', '3042015022', '3042015022', 'Mahasiswa'), (178, 'Suriani', '3042015023', '3042015023', 'Mahasiswa'), (179, 'Edi Gunawan', '3042015024', '3042015024', 'Mahasiswa'), (180, 'Muhardi', '3042015025', '3042015025', 'Mahasiswa'), (181, 'Adriya Pratama', '3042015026', '3042015026', 'Mahasiswa'), (182, 'Miftah Lana', '3042015027', '3042015027', 'Mahasiswa'), (183, 'Ahmad Asuardi', '3042015028', '3042015028', 'Mahasiswa'), (184, 'Ranimasari', '3042015029', '3042015029', 'Mahasiswa'), (185, 'Titi Purwanti', '3042015030', '3042015030', 'Mahasiswa'), (186, 'Frengki Firdaus', '3042015031', '3042015031', 'Mahasiswa'), (187, 'Agung Setiawan', '3042015032', '3042015032', 'Mahasiswa'), (188, 'June Irma Dhinita', '3042015033', '3042015033', 'Mahasiswa'), (189, 'Satria Agung Kurnia', '3042015034', '3042015034', 'Mahasiswa'), (190, 'Novi Tri Astuti', '3042015035', '3042015035', 'Mahasiswa'), (191, 'Yudha Sugara Pradhana', '3042015036', '3042015036', 'Mahasiswa'), (192, 'Nurlaila', '3042015037', '3042015037', 'Mahasiswa'), (193, 'Syarifa Yunida', '3042015038', '3042015038', 'Mahasiswa'), (194, 'M. Abdul Aziz', '3042015039', '3042015039', 'Mahasiswa'), (195, 'M. Rizky', '3042015040', '3042015040', 'Mahasiswa'), (196, 'Hamim Rizki Fadhilah', '3042015041', '3042015041', 'Mahasiswa'), (197, 'Dimas Gilang Gumelar', '3042015042', '3042015042', 'Mahasiswa'), (198, 'Jumiarti', '3042015043', '3042015043', 'Mahasiswa'), (199, 'Robi Tri Wardana', '3042015044', '3042015044', 'Mahasiswa'), (200, 'Azi Dwi Wahyudi', '3042015045', '3042015045', 'Mahasiswa'), (201, 'Yolanda', '3042015046', '3042015046', 'Mahasiswa'), (202, 'Wiwit', '3042015047', '3042015047', 'Mahasiswa'), (203, 'Hadi Prianto', '3042015048', '3042015048', 'Mahasiswa'), (204, 'Azmi Maulana', '3042015049', '3042015049', 'Mahasiswa'), (205, 'Indah Pratiwi', '3042015050', '3042015050', 'Mahasiswa'), (206, 'Desi Yunita', '3042015051', '3042015051', 'Mahasiswa'), (207, 'Maria Fivanti Aso', '3042015052', '3042015052', 'Mahasiswa'), (208, 'Jemi Saputra', '3042015053', '3042015053', 'Mahasiswa'), (209, 'Waluyo Sejati', '3042015054', '3042015054', 'Mahasiswa'), (210, 'Nufiah', '3042015055', '3042015055', 'Mahasiswa'), (211, 'Ricky Pratama', '3042015056', '3042015056', 'Mahasiswa'), (212, 'Rakhmad Riandi Nur', '3042015057', '3042015057', 'Mahasiswa'), (213, 'Aimi Rahayu', '3042015058', '3042015058', 'Mahasiswa'), (214, 'Erma Melianty', '3042015059', '3042015059', 'Mahasiswa'), (215, 'Saifudin Usman, ST', '161180915169', '161180915169', 'Dosen'); -- -------------------------------------------------------- -- -- Table structure for table `tbl_user_level` -- CREATE TABLE `tbl_user_level` ( `id_user_level` int(11) NOT NULL, `nama_level` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_user_level` -- INSERT INTO `tbl_user_level` (`id_user_level`, `nama_level`) VALUES (1, 'Super Admin'), (2, 'Admin'); -- -------------------------------------------------------- -- -- Table structure for table `user_status` -- CREATE TABLE `user_status` ( `id` int(11) NOT NULL, `radacct_id` int(11) NOT NULL, `username` varchar(64) NOT NULL, `nasipaddress` varchar(64) NOT NULL, `framedipaddress` varchar(15) NOT NULL, `callingstationid` varchar(50) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `acctinputoctets` bigint(20) NOT NULL, `acctoutputoctets` bigint(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `nas` -- ALTER TABLE `nas` ADD PRIMARY KEY (`id`), ADD KEY `nasname` (`nasname`); -- -- Indexes for table `radacct` -- ALTER TABLE `radacct` ADD PRIMARY KEY (`radacctid`), ADD UNIQUE KEY `acctuniqueid` (`acctuniqueid`), ADD KEY `username` (`username`), ADD KEY `framedipaddress` (`framedipaddress`), ADD KEY `acctsessionid` (`acctsessionid`), ADD KEY `acctsessiontime` (`acctsessiontime`), ADD KEY `acctstarttime` (`acctstarttime`), ADD KEY `acctinterval` (`acctinterval`), ADD KEY `acctstoptime` (`acctstoptime`), ADD KEY `nasipaddress` (`nasipaddress`); -- -- Indexes for table `radcheck` -- ALTER TABLE `radcheck` ADD PRIMARY KEY (`id`), ADD KEY `username` (`username`(32)); -- -- Indexes for table `radgroupcheck` -- ALTER TABLE `radgroupcheck` ADD PRIMARY KEY (`id`), ADD KEY `groupname` (`groupname`(32)); -- -- Indexes for table `radgroupreply` -- ALTER TABLE `radgroupreply` ADD PRIMARY KEY (`id`), ADD KEY `groupname` (`groupname`(32)); -- -- Indexes for table `radpostauth` -- ALTER TABLE `radpostauth` ADD PRIMARY KEY (`id`); -- -- Indexes for table `radreply` -- ALTER TABLE `radreply` ADD PRIMARY KEY (`id`), ADD KEY `username` (`username`(32)); -- -- Indexes for table `radusergroup` -- ALTER TABLE `radusergroup` ADD PRIMARY KEY (`id_group`); -- -- Indexes for table `tbl_hak_akses` -- ALTER TABLE `tbl_hak_akses` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tbl_menu` -- ALTER TABLE `tbl_menu` ADD PRIMARY KEY (`id_menu`); -- -- Indexes for table `tbl_setting` -- ALTER TABLE `tbl_setting` ADD PRIMARY KEY (`id_setting`); -- -- Indexes for table `tbl_user` -- ALTER TABLE `tbl_user` ADD PRIMARY KEY (`id_users`); -- -- Indexes for table `tbl_user_inet` -- ALTER TABLE `tbl_user_inet` ADD PRIMARY KEY (`id_userinet`); -- -- Indexes for table `tbl_user_level` -- ALTER TABLE `tbl_user_level` ADD PRIMARY KEY (`id_user_level`); -- -- Indexes for table `user_status` -- ALTER TABLE `user_status` ADD PRIMARY KEY (`id`), ADD KEY `radacct_id` (`radacct_id`), ADD KEY `username` (`username`), ADD KEY `nasipaddress` (`nasipaddress`), ADD KEY `callingstationid` (`callingstationid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `nas` -- ALTER TABLE `nas` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `radacct` -- ALTER TABLE `radacct` MODIFY `radacctid` bigint(21) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `radcheck` -- ALTER TABLE `radcheck` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=405; -- -- AUTO_INCREMENT for table `radgroupcheck` -- ALTER TABLE `radgroupcheck` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `radgroupreply` -- ALTER TABLE `radgroupreply` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `radpostauth` -- ALTER TABLE `radpostauth` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `radreply` -- ALTER TABLE `radreply` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `radusergroup` -- ALTER TABLE `radusergroup` MODIFY `id_group` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tbl_hak_akses` -- ALTER TABLE `tbl_hak_akses` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39; -- -- AUTO_INCREMENT for table `tbl_menu` -- ALTER TABLE `tbl_menu` MODIFY `id_menu` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `tbl_setting` -- ALTER TABLE `tbl_setting` MODIFY `id_setting` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tbl_user` -- ALTER TABLE `tbl_user` MODIFY `id_users` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tbl_user_inet` -- ALTER TABLE `tbl_user_inet` MODIFY `id_userinet` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=216; -- -- AUTO_INCREMENT for table `tbl_user_level` -- ALTER TABLE `tbl_user_level` MODIFY `id_user_level` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `user_status` -- ALTER TABLE `user_status` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; 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 */;
 /* Codes in the dataset have the last two digits masked. so we create a generic postal code set. Some codes cross state lines so we eliminate those from the set */ insert into dim.Geography (PostalCode, PlaceName, State, StateAbbreviation,County, Latitude, Longitude, CreatedDate) select distinct concat(left(PostalCode, 3), '00') PostalCode, '' as PlaceName, State, StateAbbreviation, '' as County, 0.0 as Latitude, 0.0 as Longitude, GETDATE() from Freddie.dim.Geography where GeographyKey not in (2200, 37209, 42058, 42059, 42064, 42065, 42066, 42067, 42068)
ALTER TABLE stocks ADD COLUMN created_at timestamp default '0000-00-00 00:00:00' not null; ALTER TABLE stocks ADD COLUMN updated_at timestamp default '0000-00-00 00:00:00' not null;
/* * MIT License * * Copyright (c) 2020 manager * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -- Logback: the reliable, generic, fast and flexible logging framework. -- Copyright (C) 1999-2010, QOS.ch. All rights reserved. -- -- See http://logback.qos.ch/license.html for the applicable licensing -- conditions. -- This SQL -- script creates the required tables by ch.qos.logback.classic.db.DBAppender. -- -- It is intended for H2 databases. DROP TABLE IF EXISTS LOGGING_EVENT CASCADE; CREATE TABLE LOGGING_EVENT ( timestmp BIGINT NOT NULL, formatted_message LONGVARCHAR NOT NULL, logger_name VARCHAR(256) NOT NULL, level_string VARCHAR(256) NOT NULL, thread_name VARCHAR(256), reference_flag SMALLINT, arg0 VARCHAR(256), arg1 VARCHAR(256), arg2 VARCHAR(256), arg3 VARCHAR(256), caller_filename VARCHAR(256), caller_class VARCHAR(256), caller_method VARCHAR(256), caller_line CHAR(4), event_id IDENTITY NOT NULL ); DROP TABLE IF EXISTS LOGGING_EVENT_PROPERTY CASCADE; CREATE TABLE LOGGING_EVENT_PROPERTY ( event_id BIGINT NOT NULL, mapped_key VARCHAR(254) NOT NULL, mapped_value LONGVARCHAR, PRIMARY KEY (event_id, mapped_key), FOREIGN KEY (event_id) REFERENCES logging_event (event_id) ); DROP TABLE IF EXISTS LOGGING_EVENT_EXCEPTION CASCADE; CREATE TABLE LOGGING_EVENT_EXCEPTION ( event_id BIGINT NOT NULL, i SMALLINT NOT NULL, trace_line VARCHAR(256) NOT NULL, PRIMARY KEY (event_id, i), FOREIGN KEY (event_id) REFERENCES logging_event (event_id) ); --SET MODE REGULAR; --CREATE ALIAS IF NOT EXISTS drop_sym_tables FOR "pt.unl.fct.miei.usmanagement.manager.database.DatabaseFunctions.dropSymTables"; --CALL drop_sym_tables(); --CREATE ALIAS IF NOT EXISTS drop_sym_triggers FOR "pt.unl.fct.miei.usmanagement.manager.database.DatabaseFunctions.dropSymTriggers"; --CALL drop_sym_triggers(); --CREATE ALIAS IF NOT EXISTS drop_sym_functions FOR "pt.unl.fct.miei.usmanagement.manager.database.DatabaseFunctions.dropSymFunctions"; --CALL drop_sym_functions(); --SET MODE MySQL;
SELECT name, imdb_rating FROM movies; # Multiple columns can be queried at once by separating column names with a comma SELECT DISTINCT genre FROM movies; # SELECT DISTINCT is used to return unique values in the result set # genre is the name of the column to display in the result set # FROM movies indicates the table name to query from SELECT * FROM movies WHERE imdb_rating > 8; # Here, only rows with a value greater than 8 in the imdb_rating column will be returned in the result set SELECT * FROM movies WHERE name LIKE 'Se_en'; # name LIKE Se_en is a condition evaluating the name column for a specific pattern SELECT * FROM movies WHERE name LIKE '%man%'; # A% matches all movies with names that begin with "A" # %a matches all movies that end with "a" SELECT * FROM movies WHERE name BETWEEN 'A' AND 'J'; # BETWEEN operator is used to filter the result set within a certain range SELECT * FROM movies WHERE year BETWEEN 1990 AND 2000; # BETWEEN operator is used to filter the result set within a certain range SELECT * FROM movies WHERE year BETWEEN 1990 AND 2000 # BEETWEEN AND genre = 'comedy'; # with second genre condition SELECT * FROM movies WHERE genre = 'comedy' OR year < 1980; SELECT * FROM movies ORDER BY imdb_rating DESC; # ORDER BY is a clause that indicates you want to sort the result set by a particular column either alphabetically or numerically # imdb_rating is the name of the column # DESC for sort the results in descending order (high to low or Z-A) SELECT * FROM movies ORDER BY imdb_rating ASC # ASC for sort the results in ascending order (low to high or A-Z) LIMIT 3;
CREATE TABLE IF NOT EXISTS tickets ( id integer NOT NULL AUTO_INCREMENT, compte integer NOT NULL, num_facture integer NOT NULL, num_abonne integer NOT NULL, date_ticket date NOT NULL, heure_ticket time NOT NULL, duree_volume_reel varchar(10), duree_volume_facture varchar(10), type_donnees varchar(50) NOT NULL, PRIMARY KEY (id) );
CREATE TABLE linksmenutop ( id CHAVE NOT NULL, id_shop CHAVE NOT NULL, new_window BOOLEAN NOT NULL, CONSTRAINT pk_linksmenutop PRIMARY KEY (id) );
use woocode; drop table if exists `repo`; create table repo( `id` int(11) NOT NULL AUTO_INCREMENT, `from_repo_id` int(11) NOT NULL DEFAULT '0', `owner_id` int(11) NOT NULL DEFAULT '0', `name` varchar(100) NOT NULL, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` varchar(1) NOT NULL DEFAULT '', `desc` text, PRIMARY KEY (`id`), UNIQUE KEY `index3` (`owner_id`,`name`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='movie report'; drop table if exists `user`; create table user( `id` int(11) NOT NULL AUTO_INCREMENT, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `name` varchar(100) NOT NULL UNIQUE, `email` varchar(100) NOT NULL UNIQUE, `password` varchar(100) NOT NULL, `status` varchar(1) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_status` (`name`, `status`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='movie report'; drop table if exists `pull_request`; create table pull_request( `id` int(11) NOT NULL AUTO_INCREMENT, `from_repo_id` int(11) NOT NULL, `to_repo_id` int(11) NOT NULL, `from_branch` varchar(100) NOT NULL, `to_branch` varchar(100) NOT NULL, `user_id` int(11) NOT NULL, `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` varchar(1) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_status` (`from_repo_id`, `to_repo_id`, `user_id`, `status`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='movie report';
-- Write a script that uses the hbtn_0d_tvshows database to lists all genres of the show Dexter -- The tv_shows table contains only one record where title = Dexter (but the id can be different) SELECT gr.name name FROM tv_genres AS gr JOIN tv_show_genres AS shgr ON gr.id=shgr.genre_id JOIN tv_shows AS sh ON shgr.show_id=sh.id WHERE sh.title = "Dexter" ORDER BY gr.name ASC;
/*********************************************************************************** || QUERY INFORMATION || || Department: Data Warehouse || Programmer: Luis Fuentes || Date: 04/03/2018 || Category: Table creation || || Description: Creates table T_DM_ENTDASH_SN_PROBLEM || || Parameters: None || || Historic Info: || Name: Date: Brief Description: || ----------------------------------------------------------------------------- || Luis Fuentes 05/23/2018 Initial Creation || luis Fuentes 05/24/2018 Adding ci_name || luis Fuentes 05/24/2018 Adding sys_class_name || ----------------------------------------------------------------------------- || || CURRENT REVISION STANDARD: v1.50 || ***********************************************************************************/ DROP TABLE DW.T_DM_ENTDASH_SN_PROBLEM cascade constraints; CREATE TABLE DW.T_DM_ENTDASH_SN_PROBLEM ( company_sk NUMBER(22) ,open_dt NUMBER(22) ,close_dt NUMBER(22) ,contact_type_sk NUMBER(22) ,group_sk NUMBER(22) ,ci_name VARCHAR2(255) ,NoOfInc NUMBER(22) ,sys_class_name VARCHAR2(255) ,resolvedSameDay NUMBER(22) ,IncLv1 NUMBER(22) ,IncLv2 NUMBER(22) ,IncLv3 NUMBER(22) ,IncLv4 NUMBER(22) ,dw_mod_date DATE DEFAULT ON NULL SYSDATE ,dw_load_date DATE DEFAULT ON NULL SYSDATE ) TABLESPACE TS_MEDIUM PCTUSED 0 PCTFREE 10 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 64K NEXT 1M MAXSIZE UNLIMITED MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT ) NOLOGGING NOCOMPRESS NOCACHE MONITORING; create bitmap index DW.T_DM_ENTDASH_SN_PROBLEM_I1 ON DW.T_DM_ENTDASH_SN_PROBLEM (company_sk) tablespace TS_SMALLX pctfree 10 initrans 2 maxtrans 255 storage ( initial 4M next 1M minextents 1 maxextents unlimited ); create bitmap index DW.T_DM_ENTDASH_SN_PROBLEM_I2 ON DW.T_DM_ENTDASH_SN_PROBLEM (open_dt) tablespace TS_SMALLX pctfree 10 initrans 2 maxtrans 255 storage ( initial 4M next 1M minextents 1 maxextents unlimited ); create bitmap index DW.T_DM_ENTDASH_SN_PROBLEM_I3 ON DW.T_DM_ENTDASH_SN_PROBLEM (close_dt) tablespace TS_SMALLX pctfree 10 initrans 2 maxtrans 255 storage ( initial 4M next 1M minextents 1 maxextents unlimited ); create bitmap index DW.T_DM_ENTDASH_SN_PROBLEM_I4 ON DW.T_DM_ENTDASH_SN_PROBLEM (contact_type_sk) tablespace TS_SMALLX pctfree 10 initrans 2 maxtrans 255 storage ( initial 4M next 1M minextents 1 maxextents unlimited ); create bitmap index DW.T_DM_ENTDASH_SN_PROBLEM_I5 ON DW.T_DM_ENTDASH_SN_PROBLEM (group_sk) tablespace TS_SMALLX pctfree 10 initrans 2 maxtrans 255 storage ( initial 4M next 1M minextents 1 maxextents unlimited ); GRANT SELECT ON DW.T_DM_ENTDASH_SN_PROBLEM TO MSTR; GRANT SELECT ON DW.T_DM_ENTDASH_SN_PROBLEM TO RPTGEN; GRANT SELECT ON DW.T_DM_ENTDASH_SN_PROBLEM TO SERVICE_ROLE; GRANT ALTER, DELETE, INSERT, SELECT, UPDATE, ON COMMIT REFRESH, QUERY REWRITE, DEBUG, FLASHBACK ON DW.T_DM_ENTDASH_SN_PROBLEM TO lf188653; GRANT ALTER, DELETE, INSERT, SELECT, UPDATE, ON COMMIT REFRESH, QUERY REWRITE, DEBUG, FLASHBACK ON DW.T_DM_ENTDASH_SN_PROBLEM TO TM1_ETL_ROLE;
prompt --application/pages/page_10024 begin -- Manifest -- PAGE: 10024 -- Manifest End wwv_flow_api.component_begin ( p_version_yyyy_mm_dd=>'2020.03.31' ,p_release=>'20.1.0.00.13' ,p_default_workspace_id=>20 ,p_default_application_id=>8950 ,p_default_id_offset=>33309244842782322 ,p_default_owner=>'ORACLE' ); wwv_flow_api.create_page( p_id=>10024 ,p_user_interface_id=>wwv_flow_api.id(1516216845576003405) ,p_name=>'Feedback' ,p_alias=>'FEEDBACK2' ,p_page_mode=>'MODAL' ,p_step_title=>'Feedback' ,p_autocomplete_on_off=>'OFF' ,p_javascript_code=>'var htmldb_delete_message=''"DELETE_CONFIRM_MSG"'';' ,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2( '/* Color feedback rating icons */', '.feedback-positive { color: #4caf50; }', '.feedback-neutral { color: #eb9f41; }', '.feedback-negative { color: #f44336; }')) ,p_required_role=>'MUST_NOT_BE_PUBLIC_USER' ,p_required_patch=>wwv_flow_api.id(539019964004599889) ,p_dialog_chained=>'N' ,p_protection_level=>'C' ,p_last_upd_yyyymmddhh24miss=>'20200116130642' ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(539021751085599890) ,p_plug_name=>'Form Items Region' ,p_region_template_options=>'#DEFAULT#:t-Form--stretchInputs' ,p_escape_on_http_output=>'Y' ,p_plug_template=>wwv_flow_api.id(1256114767162075643) ,p_plug_display_sequence=>10 ,p_plug_display_point=>'BODY' ,p_plug_query_num_rows=>15 ,p_attribute_01=>'N' ,p_attribute_02=>'HTML' ,p_attribute_03=>'Y' ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(539021775179599890) ,p_plug_name=>'Buttons Region' ,p_region_template_options=>'#DEFAULT#' ,p_escape_on_http_output=>'Y' ,p_plug_template=>wwv_flow_api.id(1256115554036075646) ,p_plug_display_sequence=>10 ,p_plug_display_point=>'REGION_POSITION_03' ,p_plug_query_num_rows=>15 ,p_attribute_01=>'N' ,p_attribute_02=>'HTML' ,p_attribute_03=>'Y' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(539021922419599890) ,p_button_sequence=>10 ,p_button_plug_id=>wwv_flow_api.id(539021775179599890) ,p_button_name=>'SAVE' ,p_button_action=>'SUBMIT' ,p_button_template_options=>'#DEFAULT#:t-Button--gapLeft' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_is_hot=>'Y' ,p_button_image_alt=>'Apply Changes' ,p_button_position=>'REGION_TEMPLATE_CREATE' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(539022006668599890) ,p_button_sequence=>20 ,p_button_plug_id=>wwv_flow_api.id(539021775179599890) ,p_button_name=>'CANCEL' ,p_button_action=>'DEFINED_BY_DA' ,p_button_template_options=>'#DEFAULT#' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_image_alt=>'Cancel' ,p_button_position=>'REGION_TEMPLATE_EDIT' ); wwv_flow_api.create_page_button( p_id=>wwv_flow_api.id(539022097058599890) ,p_button_sequence=>30 ,p_button_plug_id=>wwv_flow_api.id(539021775179599890) ,p_button_name=>'DELETE' ,p_button_action=>'REDIRECT_URL' ,p_button_template_options=>'#DEFAULT#:t-Button--danger:t-Button--simple' ,p_button_template_id=>wwv_flow_api.id(1256135138550075720) ,p_button_image_alt=>'Delete' ,p_button_position=>'REGION_TEMPLATE_EDIT' ,p_button_redirect_url=>'javascript:apex.confirm(htmldb_delete_message,''DELETE'');' ,p_button_condition=>'P10024_ID' ,p_button_condition_type=>'ITEM_IS_NOT_NULL' ,p_database_action=>'DELETE' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539037297600599912) ,p_name=>'P10024_ID' ,p_item_sequence=>10 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_display_as=>'NATIVE_HIDDEN' ,p_protection_level=>'S' ,p_attribute_01=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539037698425599912) ,p_name=>'P10024_PAGE_ID' ,p_item_sequence=>20 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Page' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_attribute_01=>'Y' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539038120620599912) ,p_name=>'P10024_FILED' ,p_item_sequence=>30 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Filed' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_begin_on_new_line=>'N' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_attribute_01=>'Y' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539038482635599913) ,p_name=>'P10024_RATING_ICON' ,p_item_sequence=>40 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Rating' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_begin_on_new_line=>'N' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_escape_on_http_output=>'N' ,p_attribute_01=>'Y' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539038943041599913) ,p_name=>'P10024_FEEDBACK' ,p_item_sequence=>50 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Feedback' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_attribute_01=>'Y' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539039338361599913) ,p_name=>'P10024_RESPONSE' ,p_item_sequence=>60 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Response' ,p_display_as=>'NATIVE_TEXTAREA' ,p_cSize=>64 ,p_cMaxlength=>4000 ,p_cHeight=>4 ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_lov_display_extra=>'NO' ,p_attribute_01=>'Y' ,p_attribute_02=>'N' ,p_attribute_03=>'N' ,p_attribute_04=>'BOTH' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539039725675599914) ,p_name=>'P10024_FEEDBACK_STATUS' ,p_item_sequence=>70 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'Status' ,p_display_as=>'NATIVE_SELECT_LIST' ,p_named_lov=>'FEEDBACK_STATUS' ,p_lov=>'.'||wwv_flow_api.id(539039840870599914)||'.' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_lov_display_extra=>'NO' ,p_attribute_01=>'NONE' ,p_attribute_02=>'N' ,p_attribute_03=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539042010051599915) ,p_name=>'P10024_ATTACHMENT_DISPLAY' ,p_item_sequence=>90 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_use_cache_before_default=>'NO' ,p_prompt=>'Attachment' ,p_source=>wwv_flow_string.join(wwv_flow_t_varchar2( 'select ''<a href="''||apex_util.get_blob_file_src(''P10023_ATTACHMENT'',id)||''">'' || apex_escape.html(filename) || ''</a>'' display_value', ' from apex$team_dev_files', ' where component_id = :P10024_ID', ' and component_type = ''FEEDBACK''')) ,p_source_type=>'QUERY' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_display_when=>'select 1 from apex$team_dev_files where component_id = :P10024_ID and component_type = ''FEEDBACK''' ,p_display_when_type=>'EXISTS' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_escape_on_http_output=>'N' ,p_attribute_01=>'N' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(539042378065599916) ,p_name=>'P10024_USER_AGENT' ,p_item_sequence=>100 ,p_item_plug_id=>wwv_flow_api.id(539021751085599890) ,p_prompt=>'User Agent' ,p_display_as=>'NATIVE_DISPLAY_ONLY' ,p_field_template=>wwv_flow_api.id(697281101547927820) ,p_protection_level=>'S' ,p_attribute_01=>'Y' ,p_attribute_02=>'VALUE' ,p_attribute_04=>'Y' ); wwv_flow_api.create_page_da_event( p_id=>wwv_flow_api.id(539022217344599890) ,p_name=>'Cancel Dialog' ,p_event_sequence=>10 ,p_triggering_element_type=>'BUTTON' ,p_triggering_button_id=>wwv_flow_api.id(539022006668599890) ,p_bind_type=>'bind' ,p_bind_event_type=>'click' ); wwv_flow_api.create_page_da_action( p_id=>wwv_flow_api.id(539043189493599919) ,p_event_id=>wwv_flow_api.id(539022217344599890) ,p_event_result=>'TRUE' ,p_action_sequence=>10 ,p_execute_on_page_init=>'N' ,p_action=>'NATIVE_DIALOG_CANCEL' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(539043693599599919) ,p_process_sequence=>10 ,p_process_point=>'AFTER_HEADER' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'Load Data' ,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2( 'for c1 in (', ' select page_id,', ' page_name,', ' case feedback_rating', ' when 1 then ''<span class="fa fa-frown-o feedback-negative" aria-hidden="true" title="Negative"></span>'' ', ' when 2 then ''<span class="fa fa-emoji-neutral feedback-neutral" aria-hidden="true" title="Neutral"></span>'' ', ' when 3 then ''<span class="fa fa-smile-o feedback-positive" aria-hidden="true" title="Positive"></span>'' ', ' end rating_icon,', ' lower(created_by) || '' - '' || apex_util.get_since(created_on) filed,', ' feedback,', ' public_response,', ' feedback_status,', ' http_user_agent', ' from apex_team_feedback', ' where feedback_id = :P10024_ID', ') loop', ' :P10024_PAGE_ID := c1.page_id||''. ''||c1.page_name;', ' :P10024_FILED := c1.filed;', ' :P10024_RATING_ICON := c1.rating_icon;', ' :P10024_FEEDBACK := c1.feedback;', ' :P10024_RESPONSE := c1.public_response;', ' :P10024_FEEDBACK_STATUS := c1.feedback_status;', ' :P10024_USER_AGENT := c1.http_user_agent;', 'end loop;')) ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(539044155206599920) ,p_process_sequence=>10 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'Update' ,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2( 'apex_util.reply_to_feedback (', ' p_feedback_id => :P10024_ID,', ' p_status => :P10024_FEEDBACK_STATUS,', ' p_public_response => :P10024_RESPONSE );')) ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(539021922419599890) ,p_process_success_message=>'Action Processed.' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(539044481641599920) ,p_process_sequence=>20 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_PLSQL' ,p_process_name=>'Delete' ,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2( 'apex_util.delete_feedback (', ' p_feedback_id => :P10024_ID );')) ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(539022097058599890) ,p_process_success_message=>'Action Processed.' ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(539044892210599922) ,p_process_sequence=>40 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_SESSION_STATE' ,p_process_name=>'E.PROPERTY.BUTTON_ACTION.LOV.RESET.D' ,p_attribute_01=>'CLEAR_CACHE_CURRENT_PAGE' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ,p_process_when_button_id=>wwv_flow_api.id(539022097058599890) ); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(539045324511599922) ,p_process_sequence=>50 ,p_process_point=>'AFTER_SUBMIT' ,p_process_type=>'NATIVE_CLOSE_WINDOW' ,p_process_name=>'Close Dialog' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ); wwv_flow_api.component_end; end; /
drop table if exists tmp.tags_tmp; create table tmp.tags_tmp as (select a4.nid, case num_tags when 1 then t1 when 2 then t1 || ',' || t2 when 3 then t1 || ',' || t2 || ',' || t3 when 4 then t1 || ',' || t2 || ',' || t3 || ',' || t4 when 5 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 when 6 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 when 7 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 when 8 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 || ',' || t8 when 9 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 || ',' || t8 || ',' || t9 when 10 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 || ',' || t8 || ',' || t9 || ',' || t10 when 11 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 || ',' || t8 || ',' || t9 || ',' || t10 || ',' || t11 when 12 then t1 || ',' || t2 || ',' || t3 || ',' || t4 || ',' || t5 || ',' || t6 || ',' || t7 || ',' || t8 || ',' || t9 || ',' || t10 || ',' || t11 || ',' || t12 end tags from (select a3.nid, max(t1) t1, max(t2) t2, max(t3) t3, max(t4) t4, max(t5) t5, max(t6) t6, max(t7) t7, max(t8) t8, max(t9) t9, max(t10) t10, max(t11) t11, max(t12) t12, num_tags from (select a2.nid, case when rn = 1 then tag else null end t1, case when rn = 2 then tag else null end t2, case when rn = 3 then tag else null end t3, case when rn = 4 then tag else null end t4, case when rn = 5 then tag else null end t5, case when rn = 6 then tag else null end t6, case when rn = 7 then tag else null end t7, case when rn = 8 then tag else null end t8, case when rn = 9 then tag else null end t9, case when rn = 10 then tag else null end t10, case when rn = 11 then tag else null end t11, case when rn = 12 then tag else null end t12, num_tags from (select a1.*, last_value(rn) over (partition by nid) num_tags from (SELECT tn.nid, td.name as tag, row_number() over (partition by tn.nid order by td.name) rn FROM drupal.term_node tn INNER JOIN drupal.term_data td ON tn.tid = td.tid WHERE td.vid = 6) a1 ) a2 ) a3 group by a3.nid, num_tags) a4); drop table if exists tmp.groups_tmp; create table tmp.groups_tmp (gid serial, tag_group varchar(255)); insert into tmp.groups_tmp (tag_group) (select distinct tags from tmp.tags_tmp); drop table if exists tmp.nid_tags; create table tmp.nid_tags as (select tt.nid, tg.gid from tmp.tags_tmp tt join tmp.groups_tmp tg on tt.tags = tg.tag_group); drop table if exists common.tag_groups; create table common.tag_groups as (select gid, td.tid, td.name, case WHEN strpos(g.tag_group, td.name) = 1 THEN 'Primary' ELSE 'Not Primary' end primary_tag from tmp.groups_tmp g join (SELECT d.tid, d.name FROM drupal.term_data d WHERE d.vid = 6) td on strpos(g.tag_group, td.name) > 0 ) ;
WITH RECURSIVE cte (uuid, filename, level_view_id, parent_id, description) AS ( SELECT i.uuid, d.filename, l.level_view_id, l.parent_id, l.description FROM level_view l JOIN cart_item c ON c.level_view_id=l.level_view_id JOIN information_package i ON i.information_package_id=l.information_package_id LEFT JOIN dao d ON d.level_view_id=l.level_view_id WHERE c.cart_order_id = 8 UNION DISTINCT SELECT cte.uuid, dao.filename, lv.level_view_id, lv.parent_id, lv.description FROM cte JOIN level_view lv ON cte.level_view_id=lv.parent_id LEFT JOIN dao dao ON dao.level_view_id=lv.level_view_id ) SELECT * FROM cte WHERE filename IS NOT null
set search_path to uber; --create a view for request and dropoff so that we can filter out all requests that are finished and get a client for each request drop view IF EXISTS finishedRequest CASCADE; create view finishedRequest as select r.request_id as request_id, r.client_id as client_id, r.datetime from request r, dropoff d where r.request_id = d.request_id; --create a view for clients and the count of rides they have in each year they have at least one ride drop view if EXISTS clientsCountofRides; create view clientsCountofRides as select client_id, EXTRACT(year from datetime) as year, count(request_id) as rides from finishedRequest group by client_id, EXTRACT(year from datetime); --create a view for the clients with the top 3 rides in a single year drop view if EXISTS topClients; create view topClients as select client_id, year, rides from clientsCountofRides where rides in (SELECT DISTINCT rides FROM clientsCountofRides ORDER BY rides DESC LIMIT 3) order by rides desc; select * from topClients; --create a view for clients with the bottom 3 rides in a single year drop view if EXISTS bottomClients; create view bottomClients as select client_id, year, rides from clientsCountofRides where rides in (SELECT DISTINCT rides FROM clientsCountofRides ORDER BY rides LIMIT 3) order by rides; SELECT * from bottomclients; --create a view to merge topClients with bottomClients and remove the duplicate drop view if EXISTS topAndBottomClients; create view topAndBottomClients as select DISTINCT * from ((select * from topclients) union (select * from bottomclients)) m order by rides desc; select * from topAndBottomClients; --create a table for the final answer drop table if exists q6; create table q6( client_id integer, year varchar(4), rides integer); insert into q6 select * from topAndBottomClients; select * from q6;
CREATE TABLE config ( "name" varchar(32) PRIMARY KEY, data jsonb ); CREATE TABLE "user" ( id bigserial PRIMARY KEY, type varchar(16) NOT NULL, cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, username varchar(64), pwd varchar(64), key varchar(128) ); ALTER SEQUENCE user_id_seq RESTART WITH 1000; CREATE TYPE oauth_type AS ENUM ('google'); CREATE TABLE oauth ( id bigserial PRIMARY KEY, type oauth_type NOT NULL DEFAULT 'google', cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, "userId" bigint NOT NULL, oauth_id varchar(128), oauth_name varchar(64), oauth_username varchar(64), oauth_token varchar(256), oauth_picture varchar(128), FOREIGN KEY ("userId") REFERENCES "user" (id) on delete cascade ); ALTER SEQUENCE oauth_id_seq RESTART WITH 1000; CREATE TYPE job_state AS ENUM ('new', 'queued', 'processing', 'completed', 'failed'); CREATE TABLE job ( id bigserial PRIMARY KEY, "newTime" timestamp with time zone, "queuedTime" timestamp with time zone, "processingTime" timestamp with time zone, "completedTime" timestamp with time zone, "failedTime" timestamp with time zone, "name" varchar(32), state job_state default 'new', data jsonb, result jsonb, error text ); CREATE TABLE "project" ( id bigserial PRIMARY KEY, cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, name varchar(64) ); ALTER SEQUENCE project_id_seq RESTART WITH 1000; CREATE TABLE "user_prole" ( "userId" bigint NOT NULL, "projectId" bigint NOT NULL, "name" varchar(32) NOT NULL, PRIMARY KEY("userId", "projectId"), FOREIGN KEY ("userId") REFERENCES "user" (id) on delete cascade, FOREIGN KEY ("projectId") REFERENCES "project" (id) on delete cascade ); CREATE TABLE "task" ( id bigserial PRIMARY KEY, cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, started boolean default false, completed boolean default false, "projectId" bigint NOT NULL, title varchar(128), FOREIGN KEY ("projectId") REFERENCES "project" (id) on delete cascade ); ALTER SEQUENCE task_id_seq RESTART WITH 1000; CREATE TABLE "label" ( id bigserial PRIMARY KEY, cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, "projectId" bigint NOT NULL, name varchar(128), color varchar(32) ); ALTER SEQUENCE label_id_seq RESTART WITH 1000; CREATE TABLE "task_label" ( "taskId" bigint NOT NULL, "labelId" bigint NOT NULL, cid bigint, ctime timestamp with time zone, mid bigint, mtime timestamp with time zone, PRIMARY KEY("taskId", "labelId"), FOREIGN KEY ("taskId") REFERENCES "task" (id) on delete cascade, FOREIGN KEY ("labelId") REFERENCES "label" (id) on delete cascade );
-- $Header: /u999/cvsadmin/cms_rep/repository/local_acc/resource/E16VCF/create_db_E16VCF.sql,v 1.1 2012/02/17 00:37:29 hongh Exp $ -- ---------------------------------------------------------------------------------------------- -- Script : init_db.sql -- Author : Haipeng Hong -- Purpose : -- Changes : -- Seq Name Date Description -- --- ------------- ---------- ------------------------------------------------------- -- 000 H Hong 2005/06/28 Initial creation. -- 001 H Hong 2005/07/14 updated to conform to the new standard layout -- ---------------------------------------------------------------------------------------------- set echo on CREATE DATABASE E16VCF MAXINSTANCES 1 MAXLOGHISTORY 9999 MAXLOGFILES 16 MAXLOGMEMBERS 4 MAXDATAFILES 500 ARCHIVELOG FORCE LOGGING DATAFILE '${DBF_BASE}/system01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE 8000M EXTENT MANAGEMENT LOCAL DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '${DBF_BASE}/temp01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE 8000M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M UNDO TABLESPACE "UNDOTBS" DATAFILE '${DBF_BASE}/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE 8000M LOGFILE GROUP 1 ('${DBF_BASE}/redo01a.log', '${ARCH_ROOT}/oradata/E16VCF/redo01b.log') SIZE 50M, GROUP 2 ('${DBF_BASE}/redo02a.log', '${ARCH_ROOT}/oradata/E16VCF/redo02b.log') SIZE 50M, GROUP 3 ('${DBF_BASE}/redo03a.log', '${ARCH_ROOT}/oradata/E16VCF/redo03b.log') SIZE 50M, GROUP 4 ('${DBF_BASE}/redo04a.log', '${ARCH_ROOT}/oradata/E16VCF/redo04b.log') SIZE 50M CHARACTER SET WE8ISO8859P1 --NATIONAL CHARACTER SET AL16UTF16 USER SYS IDENTIFIED BY e16sys USER SYSTEM IDENTIFIED BY e16sys / exit
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 04-Dez-2017 às 16:44 -- Versão do servidor: 10.1.28-MariaDB -- PHP Version: 7.0.25 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: `manutencao_sistema` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `softwares_cadastrados` -- CREATE TABLE `softwares_cadastrados` ( `id_software` int(11) NOT NULL, `nome_software` varchar(120) NOT NULL, `descricao_software` text NOT NULL, `nome_arquivo` varchar(120) NOT NULL, `nome_imagem` varchar(60) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `softwares_cadastrados` -- INSERT INTO `softwares_cadastrados` (`id_software`, `nome_software`, `descricao_software`, `nome_arquivo`, `nome_imagem`) VALUES (1, 'Android Studio', 'Android Studio é um ambiente de desenvolvimento integrado para desenvolver para a plataforma Android. ', 'android-studio-bundle-135.1641136.exe', 'android-studio.jpg'), (5, 'Astah', 'IDE para Modelagem de Dados (UML) criada com Java e de uso fácil e intuitivo.', 'astah-community-6_8_0-d254c5-jre-setup.exe', 'astah.png'), (6, 'Case Studio', 'Ferramenta para modelagem de dados.', 'CS2_setup.exe', 'case_studio.gif'); -- -------------------------------------------------------- -- -- Estrutura da tabela `softwares_deletados` -- CREATE TABLE `softwares_deletados` ( `id_software` int(11) NOT NULL, `data` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Estrutura da tabela `usuarios_restrito` -- CREATE TABLE `usuarios_restrito` ( `usuario` varchar(20) NOT NULL, `senha` varchar(60) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Extraindo dados da tabela `usuarios_restrito` -- INSERT INTO `usuarios_restrito` (`usuario`, `senha`) VALUES ('manutencao', 'e73f6fc519a024d72f855b254cad1277'); -- -- Indexes for dumped tables -- -- -- Indexes for table `softwares_cadastrados` -- ALTER TABLE `softwares_cadastrados` ADD PRIMARY KEY (`id_software`); -- -- Indexes for table `softwares_deletados` -- ALTER TABLE `softwares_deletados` ADD KEY `id_software` (`id_software`); -- -- Indexes for table `usuarios_restrito` -- ALTER TABLE `usuarios_restrito` ADD UNIQUE KEY `usuario` (`usuario`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `softwares_cadastrados` -- ALTER TABLE `softwares_cadastrados` MODIFY `id_software` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- Constraints for dumped tables -- -- -- Limitadores para a tabela `softwares_deletados` -- ALTER TABLE `softwares_deletados` ADD CONSTRAINT `softwares_deletados_ibfk_1` FOREIGN KEY (`id_software`) REFERENCES `softwares_cadastrados` (`id_software`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select Notes.NoteId, Notes.ScreenName, Screens.ScreenX, Screens.ScreenY, Screens.ScreenWidth, Screens.ScreenHeight from Notes left join -- 全件ひっかける Screens on ( Notes.ScreenName = Screens.ScreenName ) where Notes.NoteId = @NoteId
-- 1/Afficher la liste des h�tels avec leur station. SELECT hot_nom, sta_nom FROM hotel INNER JOIN station ON hot_sta_id -- 2/Afficher la liste des chambres et leur h�tel SELECT cha_numero, hot_nom FROM hotel INNER JOIN chambre ON cha_hot_id -- 3/Afficher la liste des r�servations avec le nom des clients SELECT res_date, cli_nom FROM reservation JOIN client ON reservation.res_cli_id = client.cli_id -- 4/Afficher la liste des chambres avec le nom de l'h�tel et le nom de la station SELECT sta_nom, hot_nom, cha_numero FROM station JOIN hotel ON station.sta_id = hotel.hot_sta_id JOIN chambre ON hotel.hot_id = chambre.cha_hot_id -- 5/Afficher les r�servations avec le nom du client et le nom de l'h�tel SELECT cli_nom, hot_nom, res_date_debut, datediff ('2017-07-15','2017-07-01') AS 'dur�e du s�jour' FROM hotel JOIN chambre ON hotel.hot_id = chambre.cha_hot_id JOIN reservation ON chambre.cha_id = reservation.res_cha_id JOIN client ON reservation.res_cli_id = client.cli_id
-- List all rows of the table first_table from the database hbtn_0c_0 in your MySQL server -- The database name will be passed as an argument of the mysql command SELECT * FROM first_table;
create table placeorder_dogs(order_dogno int , orderuser_phoneno bigint not null, orderuser_address varchar(25) not null , status varchar(25) not null , user_id int , order_id serial primary key , order_date timestamp without time zone , delivery_date timestamp without time zone ); select * from placeorder_dogs; drop table placeorder_dogs;
#CREATE sales TABLE CREATE DATABASE Sales; #CREATE SALESPEOPLE TABLE CREATE TABLE Sales.SALESPEOPLE (SNUM INT(10) NOT NULL AUTO_INCREMENT , SNAME VARCHAR(500) NOT NULL , CITY VARCHAR(500) NOT NULL , COMM INT , PRIMARY KEY (SNUM) ); #CREATE CUSTOMER TABLE CREATE TABLE Sales.CUSTOMER (CNUM INT(10) NOT NULL AUTO_INCREMENT , CNAME VARCHAR(200) , CITY VARCHAR(500) , SNUM INT, RATING INT, PRIMARY KEY (CNUM) , FOREIGN KEY (SNUM) REFERENCES SALESPEOPLE(SNUM) ); #CREATE ORDERS TABLE CREATE TABLE Sales.ORDERS (ONUM INT(10), AMT NUMERIC(10,2) , SNUM INT, CNUM INT, ODATE DATE, FOREIGN KEY (SNUM) REFERENCES SALESPEOPLE(SNUM) , FOREIGN KEY (CNUM) REFERENCES CUSTOMER(CNUM) ); # insert records into customer INSERT INTO customer VALUES(2001,'KELVIN','SANJOSE',1007,200); INSERT INTO customer VALUES(2002,'GIOVANNI','ROME',1003,200); INSERT INTO customer VALUES(2003,'LIU','SANJOSE',1002,200); INSERT INTO customer VALUES(2004,'GRASS','BARLIN',1002,300); INSERT INTO customer VALUES(2006,'CLEMENS','LONDON',1001,100); INSERT INTO customer VALUES(2007,'PEREIRA','ROME',1004,100); INSERT INTO customer VALUES(2008,'CISNEROS','SANJOSE',1007,300); #insert records into salespeople INSERT INTO salespeople VALUES(1002,'SERRES','SANJOSE',14); INSERT INTO salespeople VALUES(1003,'AXCELROD','NEW YORK',10); INSERT INTO salespeople VALUES(1004,'MOTIKA','LONDON',11); INSERT INTO salespeople VALUES(1005,'FRAN','LONDON',26); INSERT INTO salespeople VALUES(1007,'RIKKLIN','BARCELONA',21); #insert records into orders INSERT INTO orders VALUES (3001, 18.69 ,1007 ,2008 ,'1996/03/10'); INSERT INTO orders VALUES (3003 ,890 ,1001 ,2001 ,'1996/03/10'); INSERT INTO orders VALUES (3002, 1900.1 ,1004, 2007 ,'1996/03/10'); INSERT INTO orders VALUES (3005, 5160.45, 1002, 2003 ,'1996/03/10'); INSERT INTO orders VALUES (3006, 1098.16 ,1007, 2008 ,'1996/03/10'); INSERT INTO orders VALUES (3009 ,1713.23, 1003 ,2002,'1996/04/10'); INSERT INTO orders VALUES (3007, 75.75, 1003 ,2002,'1996/04/10'); INSERT INTO orders VALUES (3008, 4723 ,1001 ,2006,'1996/05/10'); INSERT INTO orders VALUES (3010, 1309.95 ,1002 ,2004,'1996/06/10'); INSERT INTO orders VALUES (3011, 9891.8, 1001, 2006,'1996/06/10'); #-1-Count the number of Non NULL rating fields in the Customers table (including repeats) SELECT COUNT(CNUM) AS CountOfRating FROM customer WHERE !ISNULL(RATING); #-2-Write a query that gives the names of both the salesperson and the customer for each order after the order number SELECT ords.ONUM OrderNumber,spl.SNAME SalesPerson ,cst.CNAME Customer FROM salespeople spl INNER JOIN orders ords ON spl.SNUM=ords.SNUM INNER JOIN customer cst ON cst.CNUM=ords.CNUM; #-3-Count the number of Salespeople registering orders for each day. -- (If a salespersons has more than one order on given day, he or she should be counted only once). SELECT IF(COUNT(DISTINCT onum)>1,1,COUNT(DISTINCT onum)) AS RegisteredOrder FROM orders GROUP BY odate; #-4-Find all orders attributed to salespeople in London. SELECT ords.ONUM,ords.AMT,ords.SNUM,ords.CNUM,ords.ODATE,spl.CITY FROM orders ords INNER JOIN salespeople spl ON ords.SNUM=spl.SNUM WHERE spl.CITY LIKE 'london'; #-5-Find all salespeople who have customers with more than one current order SELECT spl.SNAME FROM salespeople spl INNER JOIN customer cst ON cst.SNUM=spl.SNUM; #-6-Write a query that selects all customers whose names begins with ‘C’. SELECT * FROM customer cst WHERE cst.CNAME LIKE 'C%'; #-7-Write a query on the Customers table that will find the highest rating in each city. -- Put the output in this form: for the City (city) the highest rating is: (rating) SELECT MAX(RATING) FROM customer cst GROUP BY CITY; #-8-Write a query that selects each customer’s smallest order. SELECT cst.CNUM,cst.CNAME,MIN(ords.AMT) AS MinOrder FROM orders ords INNER JOIN customer cst ON ords.CNUM=cst.CNUM GROUP BY cst.CNAME; #-9-Write a query that selects the first customer in alphabetical order whose name begins with G SELECT cst.CNAME FROM customer cst WHERE cst.CNAME LIKE 'G%' ORDER BY cst.CNAME LIMIT 1; #-10-Write a query that counts the number of different non NULL city values in the Customers table SELECT COUNT(!ISNULL(CITY)) FROM customer GROUP BY CITY; #-11-Find the average amount from the Orders table. SELECT AVG(AMT) FROM orders; #-12-Find all customers who are not located in San Jose and whose rating is above 200. SELECT CNAME,CITY,RATING FROM customer WHERE CITY NOT IN ('SANJOSE') AND RATING > 200; #-13-Does the customer who has placed the maximum number of orders have the maximum rating? SELECT maxRecord.Employee, MAX(MaxOrder),MAX(MaxRating) FROM (SELECT cst.CNUM AS Employee,COUNT(DISTINCT ords.ONUM) MaxOrder,MAX(cst.RATING) MaxRating FROM customer cst INNER JOIN orders ords ON cst.CNUM=ords.CNUM GROUP BY cst.CNUM ORDER BY 2,3 ASC) AS maxRecord; #-14-Find all records in the Customer table with NULL values in the city column SELECT * FROM customer WHERE CITY = NULL; #-15-Arrange the Orders table by descending customer number. SELECT * FROM orders ORDER BY CNUM DESC; #-16-Find which salespeople currently have orders in the Orders table. SELECT ords.SNUM,spl.SNUM,spl.SNAME,ords.ONUM FROM orders ords,salespeople spl WHERE ords.SNUM=spl.SNUM GROUP BY ords.SNUM; #-17-Find the names and numbers of all salespeople who had more the one customer. SELECT spl.SNUM,spl.SNAME FROM salespeople spl WHERE 1 < (SELECT COUNT(*) FROM customer WHERE SNUM=spl.SNUM); #-18-Count the orders of each of the salespeople and output the results in descending order. SELECT ords.snum, spl.SNAME,COUNT(ords.SNUM) CountOrders FROM orders ords INNER JOIN salespeople spl ON ords.SNUM = spl.SNUM GROUP BY spl.SNUM ORDER BY ords.SNUM DESC; #-19-List the Customer table if and only if one or more of the Customers in the Customer table are located in San Jose. SELECT * FROM customer WHERE CITY = 'SANJOSE'; #-20-Find the largest order taken by each salesperson. SELECT SNUM,MAX(AMT) LargestOrder FROM orders GROUP BY SNUM; #-21-Find customers in San Jose who have a rating above 200. SELECT * FROM customer WHERE CITY = 'SANJOSE' AND RATING > 200; #-22-List all the orders of salesperson Motika from the Orders table. SELECT ords.* FROM orders ords INNER JOIN salespeople spl ON ords.SNUM =spl.SNUM WHERE spl.SNAME LIKE 'Motika'; #-23-Find salespeople who have multiple customers. SELECT spl.*, COUNT(cst.SNUM) NoOfCutomers FROM salespeople spl INNER JOIN customer cst ON spl.SNUM=cst.SNUM WHERE 1 < (SELECT COUNT(*) FROM customer WHERE SNUM=spl.SNUM) GROUP BY spl.SNUM; #-24-Find salespeople with customers located in their city. SELECT cst.cname CusomerName,cst.city CustomerCity,slp.sname SalespeopleName,slp.city SalespeopleCity FROM salespeople slp,customer cst WHERE slp.city=cst.city; #-25-Find the largest orders for serres and Rifkin. SELECT ords.ONUM,MAX(ords.AMT) LargestOrder,slp.SNAME FROM orders ords INNER JOIN salespeople slp ON ords.SNUM=slp.SNUM WHERE slp.SNAME IN ('serres','Rikklin') GROUP BY slp.SNAME; #-26-Find all salespeople that are located in either Barcelona or London. SELECT * FROM salespeople WHERE CITY='Barcelona' OR CITY='London'; #-27-Find all salespeople with only one customer. SELECT * FROM salespeople WHERE SNUM IN ( SELECT DISTINCT SNUM FROM customer cst WHERE NOT EXISTS ( SELECT * FROM customer cstr WHERE cst.CNUM=cstr.CNUM AND cst.CNAME<>cstr.CNAME)); #-28-Find salespeople whose sales is greater the avg sales SELECT * FROM salespeople slp WHERE slp.COMM > (SELECT AVG(slpl.COMM) FROM salespeople slpl);
USE f1_website; ALTER TABLE pilots ADD code VARCHAR(5); ALTER TABLE pilots ADD still_driving BOOLEAN NOT NULL DEFAULT TRUE; INSERT INTO pilots(first_name, last_name) VALUES("Lewis", "Hamilton"); INSERT INTO pilots(first_name, last_name) VALUES("Valtteri", "Bottas"); INSERT INTO pilots(first_name, last_name) VALUES("Max", "Verstappen"); INSERT INTO pilots(first_name, last_name) VALUES("Charles", "Leclerc"); INSERT INTO pilots(first_name, last_name) VALUES("Sebastian", "Vettel"); INSERT INTO pilots(first_name, last_name) VALUES("Carlos", "Sainz Jr"); INSERT INTO pilots(first_name, last_name) VALUES("Pierre", "Gasly"); INSERT INTO pilots(first_name, last_name) VALUES("Alexander", "Albon"); INSERT INTO pilots(first_name, last_name) VALUES("Daniel", "Ricciardo"); INSERT INTO pilots(first_name, last_name) VALUES("Sergio", "Perez"); INSERT INTO pilots(first_name, last_name) VALUES("Lando", "Norris"); INSERT INTO pilots(first_name, last_name) VALUES("Kimi", "Raikkonen"); INSERT INTO pilots(first_name, last_name) VALUES("Daniil", "Kvyat"); INSERT INTO pilots(first_name, last_name) VALUES("Nico", "Hulkennberg"); INSERT INTO pilots(first_name, last_name) VALUES("Lance", "Stroll"); INSERT INTO pilots(first_name, last_name) VALUES("Kevin", "Magnussen"); INSERT INTO pilots(first_name, last_name) VALUES("Antonio", "Giovinazzi"); INSERT INTO pilots(first_name, last_name) VALUES("Romain", "Grosjean"); INSERT INTO pilots(first_name, last_name) VALUES("Robert", "Kubica"); INSERT INTO pilots(first_name, last_name) VALUES("Georges", "Russel"); UPDATE pilots SET code = "HAM" WHERE last_name = "Hamilton"; UPDATE pilots SET code = "VER" WHERE last_name = "Verstappen"; UPDATE pilots SET code = "LEC" WHERE last_name = "Leclerc"; UPDATE pilots SET code = "BOT" WHERE last_name = "Bottas"; UPDATE pilots SET code = "VET" WHERE last_name = "Vettel"; UPDATE pilots SET code = "ALB" WHERE last_name = "Albon"; UPDATE pilots SET code = "PER" WHERE last_name = "Perez"; UPDATE pilots SET code = "NOR" WHERE last_name = "Norris"; UPDATE pilots SET code = "KVY" WHERE last_name = "Kvyat"; UPDATE pilots SET code = "SAI" WHERE last_name = "Sainz Jr"; UPDATE pilots SET code = "RIC" WHERE last_name = "Ricciardo"; UPDATE pilots SET code = "HUL" WHERE last_name = "Hulkennberg"; UPDATE pilots SET code = "RAI" WHERE last_name = "Raikkonen"; UPDATE pilots SET code = "MAG" WHERE last_name = "Magnussen"; UPDATE pilots SET code = "GRO" WHERE last_name = "Grosjean"; UPDATE pilots SET code = "GIO" WHERE last_name = "Giovinazzi"; UPDATE pilots SET code = "RUS" WHERE last_name = "Russel"; UPDATE pilots SET code = "GAS" WHERE last_name = "Gasly"; UPDATE pilots SET code = "KUB" WHERE last_name = "Kubica"; UPDATE pilots SET code = "STR" WHERE last_name = "Stroll"; ALTER TABLE tracks ADD circuitID VARCHAR(20); INSERT INTO tracks(country) VALUES("Australie"); INSERT INTO tracks(country) VALUES("Bahrein"); INSERT INTO tracks(country) VALUES("Chine"); INSERT INTO tracks(country) VALUES("Azerbaidjan"); INSERT INTO tracks(country) VALUES("Espagne"); INSERT INTO tracks(country) VALUES("Monaco"); INSERT INTO tracks(country) VALUES("Canada"); INSERT INTO tracks(country) VALUES("France"); INSERT INTO tracks(country) VALUES("Autriche"); INSERT INTO tracks(country) VALUES("Grande-Bretagne"); INSERT INTO tracks(country) VALUES("Allemagne"); INSERT INTO tracks(country) VALUES("Hongrie"); INSERT INTO tracks(country) VALUES("Belgique"); INSERT INTO tracks(country) VALUES("Italie"); INSERT INTO tracks(country) VALUES("Singapour"); INSERT INTO tracks(country) VALUES("Russie"); INSERT INTO tracks(country) VALUES("Japon"); INSERT INTO tracks(country) VALUES("Mexique"); INSERT INTO tracks(country) VALUES("USA"); INSERT INTO tracks(country) VALUES("Bresil"); INSERT INTO tracks(country) VALUES("EAU"); UPDATE tracks SET circuitID = "albert_park" WHERE country = ("Australie"); UPDATE tracks SET circuitID = "bahrain" WHERE country = ("Bahrein"); UPDATE tracks SET circuitID = "shanghai" WHERE country = ("Chine"); UPDATE tracks SET circuitID = "BAK" WHERE country = ("Azerbaidjan"); UPDATE tracks SET circuitID = "catalunya" WHERE country = ("Espagne"); UPDATE tracks SET circuitID = "monaco" WHERE country = ("Monaco"); UPDATE tracks SET circuitID = "villeneuve" WHERE country = ("Canada"); UPDATE tracks SET circuitID = "ricard" WHERE country = ("France"); UPDATE tracks SET circuitID = "red_bull_ring" WHERE country = ("Autriche"); UPDATE tracks SET circuitID = "silverstone" WHERE country = ("Grande-Bretagne"); UPDATE tracks SET circuitID = "hockenheimring" WHERE country = ("Allemagne"); UPDATE tracks SET circuitID = "hungaroring" WHERE country = ("Hongrie"); UPDATE tracks SET circuitID = "spa" WHERE country = ("Belgique"); UPDATE tracks SET circuitID = "monza" WHERE country = ("Italie"); UPDATE tracks SET circuitID = "marina_bay" WHERE country = ("Singapour"); UPDATE tracks SET circuitID = "sochi" WHERE country = ("Russie"); UPDATE tracks SET circuitID = "suzuka" WHERE country = ("Japon"); UPDATE tracks SET circuitID = "rodriguez" WHERE country = ("Mexique"); UPDATE tracks SET circuitID = "americas" WHERE country = ("USA"); UPDATE tracks SET circuitID = "interlagos" WHERE country = ("Bresil"); UPDATE tracks SET circuitID = "yas_marina" WHERE country = ("EAU"); INSERT INTO teams(name, engine, car_name) VALUES("Mercedes-AMG", "Mercedes", "W11"); INSERT INTO teams(name, engine, car_name) VALUES("Scuderia-Ferrari", "Ferrari", "SF1000"); INSERT INTO teams(name, engine, car_name) VALUES("Red-Bull", "Honda", "RB16"); INSERT INTO teams(name, engine, car_name) VALUES("McLaren-F1", "Renault", "MCL35"); INSERT INTO teams(name, engine, car_name) VALUES("Renault-F1", "Renault", "R.S.20"); INSERT INTO teams(name, engine, car_name) VALUES("Alfa-Romeo", "Ferrari", "C39"); INSERT INTO teams(name, engine, car_name) VALUES("BWT Racing-Point", "Mercedes", "RP20"); INSERT INTO teams(name, engine, car_name) VALUES("Scuderia-AlphaTauri", "Honda", "AT01"); INSERT INTO teams(name, engine, car_name) VALUES("Haas-F1", "Ferrari", "VF-20"); INSERT INTO teams(name, engine, car_name) VALUES("Williams-Racing", "Mercedes", "FW43"); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(1, 1, 44); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(2, 1, 77); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(5, 2, 5); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES (4, 2, 16); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(3, 3, 33); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(8, 3, 23); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(6, 4, 55); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(11, 4, 55); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(9, 5, 3); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(14, 5, 60); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(12, 6, 7); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(17, 6, 99); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(10, 7, 11); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(15, 7, 18); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(13, 8, 26); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(7, 8, 10); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(18, 9, 8); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(16, 9, 20); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(19, 10, 63); INSERT INTO pilot_team(pilot_id, team_id, pilot_number) VALUES(20, 10, 88);
delete from HtmlLabelIndex where id=22307 / delete from HtmlLabelInfo where indexid=22307 / INSERT INTO HtmlLabelIndex values(22307,'保存') / INSERT INTO HtmlLabelInfo VALUES(22307,'保存',7) / INSERT INTO HtmlLabelInfo VALUES(22307,'Save',8) / INSERT INTO HtmlLabelInfo VALUES(22307,'',9) / delete from HtmlLabelIndex where id=22307 / delete from HtmlLabelInfo where indexid=22307 / INSERT INTO HtmlLabelIndex values(22307,'暂存') / INSERT INTO HtmlLabelInfo VALUES(22307,'暂存',7) / INSERT INTO HtmlLabelInfo VALUES(22307,'Save',8) / INSERT INTO HtmlLabelInfo VALUES(22307,'',9) / delete from HtmlLabelIndex where id=22262 / delete from HtmlLabelInfo where indexid=22262 / INSERT INTO HtmlLabelIndex values(22262,'生成月报') / delete from HtmlLabelIndex where id=22261 / delete from HtmlLabelInfo where indexid=22261 / INSERT INTO HtmlLabelIndex values(22261,'生成年报') / INSERT INTO HtmlLabelInfo VALUES(22261,'生成年报',7) / INSERT INTO HtmlLabelInfo VALUES(22261,'Create Year Report',8) / INSERT INTO HtmlLabelInfo VALUES(22261,'生成年报',9) / INSERT INTO HtmlLabelInfo VALUES(22262,'生成月报',7) / INSERT INTO HtmlLabelInfo VALUES(22262,'Create Month Report',8) / INSERT INTO HtmlLabelInfo VALUES(22262,'生成月报',9) / delete from HtmlLabelIndex where id=22264 / delete from HtmlLabelInfo where indexid=22264 / INSERT INTO HtmlLabelIndex values(22264,'提交备注信息') / INSERT INTO HtmlLabelInfo VALUES(22264,'提交备注信息',7) / INSERT INTO HtmlLabelInfo VALUES(22264,'Remark',8) / INSERT INTO HtmlLabelInfo VALUES(22264,'',9) / delete from HtmlLabelIndex where id=22265 / delete from HtmlLabelInfo where indexid=22265 / INSERT INTO HtmlLabelIndex values(22265,'备注信息') / INSERT INTO HtmlLabelInfo VALUES(22265,'备注信息',7) / INSERT INTO HtmlLabelInfo VALUES(22265,'Remark info',8) / INSERT INTO HtmlLabelInfo VALUES(22265,'',9) / delete from HtmlLabelIndex where id=22266 / delete from HtmlLabelInfo where indexid=22266 / INSERT INTO HtmlLabelIndex values(22266,'每季') / INSERT INTO HtmlLabelInfo VALUES(22266,'每季',7) / INSERT INTO HtmlLabelInfo VALUES(22266,'By Quarter',8) / INSERT INTO HtmlLabelInfo VALUES(22266,'',9) /
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Waktu pembuatan: 14 Nov 2019 pada 16.24 -- Versi server: 10.1.36-MariaDB -- Versi PHP: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `laravel` -- CREATE DATABASE IF NOT EXISTS `laravel` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `laravel`; -- -------------------------------------------------------- -- -- Struktur dari tabel `discussion` -- DROP TABLE IF EXISTS `discussion`; CREATE TABLE IF NOT EXISTS `discussion` ( `id_discussion` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) NOT NULL, `discuss_name` varchar(50) NOT NULL, `discuss_thread` text NOT NULL, `likes` int(11) NOT NULL, `link` varchar(255) NOT NULL, PRIMARY KEY (`id_discussion`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `discussion_comment` -- DROP TABLE IF EXISTS `discussion_comment`; CREATE TABLE IF NOT EXISTS `discussion_comment` ( `id_comment` int(11) NOT NULL, `id_person` int(11) NOT NULL, `likes` int(11) NOT NULL, `text` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `friends` -- DROP TABLE IF EXISTS `friends`; CREATE TABLE IF NOT EXISTS `friends` ( `id_user` int(11) NOT NULL, `id_friend` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `groups` -- DROP TABLE IF EXISTS `groups`; CREATE TABLE IF NOT EXISTS `groups` ( `id_group` int(11) NOT NULL AUTO_INCREMENT, `nama` varchar(50) NOT NULL, `deskripsi` text NOT NULL, PRIMARY KEY (`id_group`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `group_post_comment` -- DROP TABLE IF EXISTS `group_post_comment`; CREATE TABLE IF NOT EXISTS `group_post_comment` ( `id_post` int(11) NOT NULL, `id_user` int(11) NOT NULL, `comments` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `message` -- DROP TABLE IF EXISTS `message`; CREATE TABLE IF NOT EXISTS `message` ( `id_message` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) NOT NULL, `id_penerima` int(11) NOT NULL, `message` varchar(255) NOT NULL, PRIMARY KEY (`id_message`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `post_comment` -- DROP TABLE IF EXISTS `post_comment`; CREATE TABLE IF NOT EXISTS `post_comment` ( `id_commentuser` int(11) NOT NULL AUTO_INCREMENT, `comments` text NOT NULL, `likes` int(11) NOT NULL, PRIMARY KEY (`id_commentuser`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `post_group` -- DROP TABLE IF EXISTS `post_group`; CREATE TABLE IF NOT EXISTS `post_group` ( `id_group` int(11) NOT NULL, `id_grouppost` int(11) NOT NULL, `post` text NOT NULL, `link` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `user` -- DROP TABLE IF EXISTS `user`; CREATE TABLE IF NOT EXISTS `user` ( `id_user` int(11) NOT NULL AUTO_INCREMENT, `id_avatar` int(11) NOT NULL, `username` varchar(20) NOT NULL, `password` varchar(12) NOT NULL, `email` varchar(50) NOT NULL, `nickname` varchar(16) NOT NULL, PRIMARY KEY (`id_user`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `user` -- INSERT INTO `user` (`id_user`, `id_avatar`, `username`, `password`, `email`, `nickname`) VALUES (2, 1, 'ariesliantono', 'titijelek2', 'nowiplaydota71@gmail.com', 'NickBaruCie'), (3, 1, 'benedictoRaka', 'titijelek2', 'aris@gmail.com', 'aris'), (4, 1, 'sayaraka', '123', 'BenedictoRaka@gmail.com', 'dittoraka'); -- -------------------------------------------------------- -- -- Struktur dari tabel `user_group` -- DROP TABLE IF EXISTS `user_group`; CREATE TABLE IF NOT EXISTS `user_group` ( `id_group` int(11) NOT NULL, `id_user` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Struktur dari tabel `user_post` -- DROP TABLE IF EXISTS `user_post`; CREATE TABLE IF NOT EXISTS `user_post` ( `id_user` int(11) NOT NULL, `post` text NOT NULL, `likes` int(11) NOT NULL, `link` varchar(255) NOT NULL, `id_post` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id_post`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 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 PROCEDURE SpLogin @USERNAME nvarchar(50), @PASSWORD nvarchar (50) AS BEGIN SELECT * FROM dbo.AUTH WHERE ((USERNAME = @USERNAME) and (PASSWORD = @PASSWORD)) END
select Name, [path] from reportserver.dbo.Catalog where type = 2 order by [Path], name
--liquibase formatted sql --changeset minikh:2018-07-26_08-05 objectQuotingStrategy="QUOTE_ALL_OBJECTS" failOnError: true create table "order" ( id uuid not null constraint order_pkey primary key DEFAULT public.uuid_generate_v1(), creation_date bigint not null, last_updated bigint not null, number varchar(64) not null, description varchar, account_number varchar, discount real not null, discount_sum decimal , count integer , summa decimal , area real , perimeter real , client_id uuid not null references client (id), reception_id uuid not null references reception (id), deleted boolean not null ); create table order_item ( id uuid not null constraint order_item_pkey primary key DEFAULT public.uuid_generate_v1(), creation_date bigint not null, last_updated bigint not null, description varchar, number varchar(64) not null, length real not null, width real not null, count integer not null, area real not null, perimeter real not null, process_sum decimal not null, summa decimal not null, order_id uuid not null references "order" (id), material_id uuid not null references material (id), deleted boolean not null ); create table order_item_process ( -- id uuid not null constraint order_item_process_pkey primary key DEFAULT public.uuid_generate_v1(), item_id uuid not null references order_item (id), process_id uuid not null references process (id) );
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- Server version: 5.7.24 -- PHP Version: 7.1.26 -- -- Database: `temp` -- CREATE DATABASE IF NOT EXISTS `temp` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `temp`; -- -------------------------------------------------------- -- -- Table structure for table `alarms` -- CREATE TABLE `alarms` ( `ID` int(11) NOT NULL, `EMAIL` varchar(255) DEFAULT NULL, `TEMP` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `devices` -- CREATE TABLE `devices` ( `ID` int(11) NOT NULL, `Name` varchar(255) DEFAULT NULL, `Campus` varchar(20) NOT NULL, `Location` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Table structure for table `locations` -- CREATE TABLE `locations` ( `ID` int(11) NOT NULL, `NAME` varchar(255) NOT NULL, `SHORTCODE` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Indexes for table `alarms` -- ALTER TABLE `alarms` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `devices` -- ALTER TABLE `devices` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `locations` -- ALTER TABLE `locations` ADD PRIMARY KEY (`ID`); -- -- AUTO_INCREMENT for table `alarms` -- ALTER TABLE `alarms` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `devices` -- ALTER TABLE `devices` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `locations` -- ALTER TABLE `locations` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Czas generowania: 17 Lip 2017, 09:24 -- Wersja serwera: 10.1.24-MariaDB -- Wersja PHP: 7.1.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Baza danych: `bazaro` -- -- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `klienci` -- CREATE TABLE `klienci` ( `idklienta` int(11) NOT NULL, `imie` text COLLATE utf8_polish_ci NOT NULL, `nazwisko` text COLLATE utf8_polish_ci NOT NULL, `firma` text COLLATE utf8_polish_ci NOT NULL, `ulica` text COLLATE utf8_polish_ci NOT NULL, `kodpocztowy` text COLLATE utf8_polish_ci NOT NULL, `miejscowosc` text COLLATE utf8_polish_ci NOT NULL, `telefon` text COLLATE utf8_polish_ci NOT NULL, `email` text COLLATE utf8_polish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci; -- -- Zrzut danych tabeli `klienci` -- INSERT INTO `klienci` (`idklienta`, `imie`, `nazwisko`, `firma`, `ulica`, `kodpocztowy`, `miejscowosc`, `telefon`, `email`) VALUES (4, '', '', 'RO', 'Poleczki 35', '02-822', 'Warszawa', '0', ''), (5, 'Slava', 'Lvovich', 'RO', 'Poleczki 35', '02-822', 'Warszawa', '783-002-232', 'slava@robocam.info'), (6, 'Piotr', 'Kiepas', '', '', '', 'Warszawa', '728-144-610', ''), (7, '', 'Dziedzicki', '', '', '', '', '0', ''), (8, '', 'Rogalski', 'Dental Labor Rogalski Sp. z o.o.', 'Wiosenna 7', '70-807', 'Szczecin', '+48-694-415-846', 'biuro@dental-labor.pl'), (9, 'Monika', 'Madej', 'Onildent', '', '', '', '509-971-361', 'sebastiansiuta@op.pl'), (10, '', '', 'Redent', '', '', '', '503-006-410', 'redent@wp.pl'); -- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `skanery` -- CREATE TABLE `skanery` ( `idskanera` int(11) NOT NULL, `firma` text COLLATE utf8_polish_ci NOT NULL, `model` text COLLATE utf8_polish_ci NOT NULL, `nrseryjny` text COLLATE utf8_polish_ci NOT NULL, `typ` text COLLATE utf8_polish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci; -- -- Zrzut danych tabeli `skanery` -- INSERT INTO `skanery` (`idskanera`, `firma`, `model`, `nrseryjny`, `typ`) VALUES (1, 'Medit', 'Identica Blue', 'BL1402052133', 'demo'), (2, 'Medit', 'Identica Hybrid', '1H16061L8792', 'standard'), (3, 'Medit', 'Identica Hybrid', '1H17011L9431\r\n', 'standard'), (4, 'Medit', 'Identica Hybrid', '1H17011L9432', 'standard'), (5, 'Medit', 'Identica Hybrid', '1H17021L9475', 'standard'), (6, 'Medit', 'Identica Hybrid', '1H17021L9467', 'standard'), (7, 'Medit', 'Identica Hybrid', '1H16121L9304', 'standard'), (8, 'Medit', 'Identica Hybrid', '1H16121L9305', 'standard'), (9, 'Medit', 'Identica Hybrid', '1H17021L9468', 'standard'), (10, 'Medit', 'Identica Hybrid', '1H17031L9597', 'standard'), (11, 'Medit', 'T500', '1M17051DA142', 'standard'), (12, 'Medit', 'T500', '1M17051DA143', 'standard'), (13, 'Medit', 'T500', '1M17051DA144', 'standard'), (14, 'Medit', 'T500', '1M17051DA145', 'standard'), (15, 'Medit', 'T500', '1M17051DA146', 'standard'), (16, 'Medit', 'T500', '1M17051DA147', 'standard'), (17, 'Medit', 'T500', '1M17051DA148', 'standard'), (18, 'Medit', 'T500', '1M17051DA149', 'standard'), (19, 'Medit', 'T500', '1M17051DA150', 'standard'), (20, 'Medit', 'T500', '1M17051DA151', 'standard'), (21, 'Medit', 'Identica Hybrid', '1H17031L9559', 'standard'); -- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `zamowienia` -- CREATE TABLE `zamowienia` ( `idzamowienia` int(11) NOT NULL, `idklienta` int(11) NOT NULL, `idskanera` int(11) NOT NULL, `data` date NOT NULL, `status` text COLLATE utf8_polish_ci NOT NULL, `uwagi` text COLLATE utf8_polish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci; -- -- Indeksy dla zrzutów tabel -- -- -- Indexes for table `klienci` -- ALTER TABLE `klienci` ADD PRIMARY KEY (`idklienta`); -- -- Indexes for table `skanery` -- ALTER TABLE `skanery` ADD PRIMARY KEY (`idskanera`); -- -- Indexes for table `zamowienia` -- ALTER TABLE `zamowienia` ADD PRIMARY KEY (`idzamowienia`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT dla tabeli `klienci` -- ALTER TABLE `klienci` MODIFY `idklienta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT dla tabeli `skanery` -- ALTER TABLE `skanery` MODIFY `idskanera` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT dla tabeli `zamowienia` -- ALTER TABLE `zamowienia` MODIFY `idzamowienia` int(11) NOT NULL AUTO_INCREMENT;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 `job_grades` (`id`, `job_name`, `grade`, `name`, `label`, `salary`, `skin_male`, `skin_female`) VALUES (83, 'avocat', 0, 'boss', 'Patron', 500, '', ''); INSERT INTO `jobs` (`name`, `label`, `whitelisted`) VALUES ('avocat', 'Avocat', 0); INSERT INTO `addon_account` (name, label, shared) VALUES ('society_avocat','Avocat',1) ; INSERT INTO `datastore` (name, label, shared) VALUES ('society_avocat','Avocat',1) ; INSERT INTO `addon_inventory` (name, label, shared) VALUES ('society_avocat', 'Avocat', 1) ;
# CREATE DATABASE sql_builder; # CREATE USER sql_builder; # GRANT ALL ON sql_builder.* TO 'sql_builder'@'localhost' IDENTIFIED BY '27N6ST7W1m43rCK'; DROP TABLE IF EXISTS test; CREATE TABLE test ( id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, code VARCHAR(20) NOT NULL UNIQUE, title VARCHAR(255) NOT NULL, description LONGTEXT, status1 TINYINT DEFAULT 0 NOT NULL, status2 TINYINT DEFAULT 1 NOT NULL, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, updated TIMESTAMP DEFAULT '0000-00-00 00:00:00' NOT NULL ); INSERT INTO test (code, title, description, status1, status2, created, updated) VALUES ('FIRST', 'First', 'descp 1', TRUE, FALSE, '2013-01-01', '2014-01-01'), ('SECOND', 'SECOND', 'descp 2', TRUE, TRUE, now(), now()), ('THIRD', 'THIRD', 'descp 3', FALSE, FALSE, '2014-12-31 13:45:32.44', '2014-12-31 23:59:59.99');
CREATE LOGIN [DESKTOP-9JH6FOM\mmber] FROM WINDOWS WITH DEFAULT_LANGUAGE = [us_english];
INSERT INTO form_gender (form_genderID, form_genderdesc) VALUES (1,'Not Known') INSERT INTO form_gender (form_genderID, form_genderdesc) VALUES (2,'Male') INSERT INTO form_gender (form_genderID, form_genderdesc) VALUES (3,'Female') INSERT INTO form_gender (form_genderID, form_genderdesc) VALUES (9,'Not Applicable') INSERT INTO form_civilStatus (form_civildesc) VALUES ('Married') INSERT INTO form_civilStatus (form_civildesc) VALUES ('Widowed') INSERT INTO form_civilStatus (form_civildesc) VALUES ('Separated') INSERT INTO form_civilStatus (form_civildesc) VALUES ('Divorced') INSERT INTO form_civilStatus (form_civildesc) VALUES ('Single') INSERT INTO form_religion (form_religionDesc) VALUES ('Roman Catholic') INSERT INTO form_religion (form_religionDesc) VALUES ('Islam') INSERT INTO form_religion (form_religionDesc) VALUES ('Evangelicals (PCEC)') INSERT INTO form_religion (form_religionDesc) VALUES ('Iglesia Ni Cristo') INSERT INTO form_religion (form_religionDesc) VALUES ('Non-Roman Catholic and Protestant (NCCP)') INSERT INTO form_religion (form_religionDesc) VALUES ('Aglipayan') INSERT INTO form_religion (form_religionDesc) VALUES ('Seventh-day Adventist') INSERT INTO form_religion (form_religionDesc) VALUES ('Bible Baptist Church') INSERT INTO form_religion (form_religionDesc) VALUES ('United Church of Christ in the Philippines') INSERT INTO form_religion (form_religionDesc) VALUES ('Jehovah''s Witnesses') INSERT INTO form_religion (form_religionDesc) VALUES ('Church of Christ') INSERT INTO form_religion (form_religionDesc) VALUES ('Jesus is Lord Church') INSERT INTO form_religion (form_religionDesc) VALUES ('Tribal Religions') INSERT INTO form_religion (form_religionDesc) VALUES ('United Pentecostal Church (Philippines) Incorporated') INSERT INTO form_religion (form_religionDesc) VALUES ('Other Baptist') INSERT INTO form_clientAssigned(form_clientAssigneddesc) VALUES ('Head Office') INSERT INTO form_examStatus (form_examStatusdesc) VALUES ('Passed') INSERT INTO form_examStatus (form_examStatusdesc) VALUES ('Failed') INSERT INTO form_examStatus (form_examStatusdesc) VALUES ('Incomplete') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('College Level') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('College Graduate') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('High School Graduate') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('Senior High School Graduate') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('Vocational Graduate') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('Vocational Level') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('Post Graduate Level') INSERT INTO form_educationAttain (form_educationAttaindesc) VALUES ('Post Graduate') INSERT INTO form_sourcedBy (form_sourcedBydesc) VALUES ('Walk-in') INSERT INTO form_sourcedBy (form_sourcedBydesc) VALUES ('Job Fair') INSERT INTO form_sourcedBy (form_sourcedBydesc) VALUES ('Referral') INSERT INTO form_sourcedBy (form_sourcedBydesc) VALUES ('Online') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Accepted') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Pooling') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Failed') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Not Qualified') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Back Out') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('No Show') INSERT INTO form_applicantStatus (form_applicantStatusdesc) VALUES ('Black Listed') INSERT INTO form_membershipType (form_membershipTypedesc) VALUES ('Reliever') INSERT INTO form_membershipType (form_membershipTypedesc) VALUES ('Regular Member') INSERT INTO form_membershipType (form_membershipTypedesc) VALUES ('Revenue Member') INSERT INTO form_membershipType (form_membershipTypedesc) VALUES ('Non Revenue Member') INSERT INTO form_violation (form_violationdesc) VALUES ('Absent without Permission') INSERT INTO form_violation (form_violationdesc) VALUES ('Not following specific instructions') INSERT INTO form_violation (form_violationdesc) VALUES ('Abandoning') INSERT INTO form_offense (form_offensedesc) VALUES ('1st') INSERT INTO form_offense (form_offensedesc) VALUES ('2nd') INSERT INTO form_offense (form_offensedesc) VALUES ('3rd') INSERT INTO form_offense (form_offensedesc) VALUES ('Stay Home') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Maternity') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Asiapro - Sickness') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Asiapro - Accident') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('SSS - Sickness') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Paternity') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Solo Parent') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('HMO') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('EC - Sickness') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('VAWC') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Magna Carta') INSERT INTO form_claimType (form_claimTypedesc) VALUES ('Asiapro - MIL') INSERT INTO form_deathClaim (form_deathClaimdesc) VALUES ('Natural') INSERT INTO form_deathClaim (form_deathClaimdesc) VALUES ('Accidental') INSERT INTO form_deathClaim (form_deathClaimdesc) VALUES ('EC') INSERT INTO form_deathClaim (form_deathClaimdesc) VALUES ('None') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('EL') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('MPL') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Education Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Cellphone Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Asiapro Calamity Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('SSS Salary Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('SSS Calamity Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Pag-ibig Salary Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Pag-ibig Calamity Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Pag-ibig Housing Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Pag-ibig Multi-Purpose Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Motorcycle Loan') INSERT INTO form_loanType (form_loanTypedesc) VALUES ('Appliances Loan') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Chest X-Ray') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Whole Abdomen Ultrasound') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Urinalysis') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('ECG') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Complete Blood Count') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('ESR') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Fasting Blood Sugar') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('HBA1C') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Blood Urea Nitrogen') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Creatinine') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Blood Uric Acid') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Cholesterol') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Triglycerides') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Lipoprotein Profile') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Fecalysis') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('SGPT') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('SGOT') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Alkaline Phosphatase') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Total Protein with A/G Ratio') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Bilirubin (B1B2)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('GGT') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Na (Sodium)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('K (Potassium)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('CL (Chloride)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('TCa (Total Calcium)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('CEA (Carcinoembryonic Antigen / Colon)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Occult Blood (FIT)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('Breast Ultrasound') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('PACP (Total ACP & Prostatic ACP)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('PSA (Prostatic Ca)') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('FT4') INSERT INTO form_laboratory (form_laboratorydesc) VALUES ('TSH') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Abra') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Agusan del Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Agusan del Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Aklan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Albay') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Angeles') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Antique') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Aurora') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bacolod') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bago') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Baguio') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bais') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Basilan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Basilan City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bataan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Batangas') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Batangas City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Benguet') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bohol') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bukidnon') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Bulacan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Butuan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cabanatuan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cadiz') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cagayan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cagayan de Oro') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Calbayog') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Caloocan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Camarines Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Camarines Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Camiguin') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Canlaon') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Capiz') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Catanduanes') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cavite') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cavite City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cebu') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cebu City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Cotabato') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Dagupan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Danao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Dapitan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Davao City Davao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Davao del Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Davao Oriental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Dipolog') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Dumaguete') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Easter Samar') INSERT INTO form_addressState (form_addStatedesc) VALUES ('General Santos') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ginoog') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ifugao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Iligan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ilocos Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ilocos Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Iloilo') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Iloilo City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Iriga') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Isabela') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Kalinga-Apayao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('La Carlota') INSERT INTO form_addressState (form_addStatedesc) VALUES ('La Union') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Laguna') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Lanao del Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Lanao del Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Laoag') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Lapu-Lapu') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Legazpi') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Leyte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Lipa') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Lucena') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Maguindanao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Makati City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mandaluyong City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mandaue') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Manila') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Marawi') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Marikina City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mandaluyong City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Marinduque') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Masbate') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mindoro Occidental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mindoro Oriental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Misamis Occidental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Misamis Oriental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Mountain Province') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Muntinlupa') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Naga') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Negros Occidental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Negros Oriental') INSERT INTO form_addressState (form_addStatedesc) VALUES ('North Cotabato') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Northern Samar') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Nueva Ecija') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Nueva Vizcaya') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Olongapo') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ormoc') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Oroquieta') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Ozamis') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Pagadian') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Palawan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Palayan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Pampanga') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Pangasinan') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Paranaque') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Pasay') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Pasig City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Puerto Princesa') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Quezon') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Quezon City') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Quirino') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Rizal') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Romblon') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Roxas') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Samar') INSERT INTO form_addressState (form_addStatedesc) VALUES ('San Carlos (Negros Occidental)') INSERT INTO form_addressState (form_addStatedesc) VALUES ('San Carlos (Pangasinan)') INSERT INTO form_addressState (form_addStatedesc) VALUES ('San Jose') INSERT INTO form_addressState (form_addStatedesc) VALUES ('San Pablo') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Silay') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Siquijor') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Sorsogon') INSERT INTO form_addressState (form_addStatedesc) VALUES ('South Cotabato') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Southern Leyte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Sultan Kudarat') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Sulu') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Surigao') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Surigao del Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Surigao del Sur') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tacloban') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tagaytay') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tagbilaran') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tangub') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tarlac') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Tawi-tawi') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Toledo') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Trece Marites') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Zambales') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Zamboanga') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Zamboanga del Norte') INSERT INTO form_addressState (form_addStatedesc) VALUES ('Zamboanga del Sur') INSERT INTO tbl_role (role_name) VALUES ('Super Admin') INSERT INTO tbl_role (role_name) VALUES ('Admin') INSERT INTO tbl_role (role_name) VALUES ('Employee') INSERT INTO tbl_access (accs_addUser, accs_actUser, accs_addDocu, accs_edtDocu, accs_delDocu, accs_opnDocu) VALUES (1,1,1,1,1,1) INSERT INTO tbl_user (role_ID, accs_ID, username, user_pword, user_firstName, user_lastName, user_email, user_contactNo, user_createdDate, user_activate) VALUES (1,1,'admin','admin', 'John', 'Doe', 'johndoe@example.com', 09123456789, getdate(), 1) INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('APP','Applicants (Sourcing)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('MEM','Member File 201 (Records, MBS, Sourcing)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('DIR','Disciplinary Records (MBS)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('BNF','Benefits (MBS)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('LOA','Loans (MBS, Finance)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('INV','Invoices (Finance)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('DTR','DTRs Only (Finance)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('RFP','Request for Payments (Finance)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('CWF','Clearances/Waiver Form (Finance, MBS)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('QUI','Quit Claim Form') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('LIQ','Liquidations (Finance)') INSERT INTO tbl_documentType (docuType_abbv, docuType_desc) VALUES ('APE','Annual Physical Exam')
delete from SystemRightDetail where rightid =1297 / delete from SystemRightsLanguage where id =1297 / delete from SystemRights where id =1297 / insert into SystemRights (id,rightdesc,righttype) values (1297,'模块设置','7') / insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (1297,7,'模块设置','模块设置') / insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (1297,8,'Mode Setting','Mode Setting') / insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (1297,9,'模塊設置','模塊設置') / insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (42573,'模块设置','ModeSetting:All',1297) /
DROP PROCEDURE IF EXISTS getBlog_Likes; DELIMITER $$ CREATE PROCEDURE getBlog_Likes( IN pc_idBlog INTEGER, OUT pcMensaje VARCHAR(2000), OUT pbOcurreError BOOLEAN ) BEGIN DECLARE temMensaje VARCHAR(1000); DECLARE vn_existeBlog INTEGER DEFAULT 0; SET pbOcurreError :=TRUE; SET pcMensaje :=''; /*Comprobando que la contraseña no sea null:*/ IF pc_idBlog = 0 OR pc_idBlog IS NULL THEN SET temMensaje := CONCAT(temMensaje,'id blog '); END IF; IF temMensaje<>'' THEN SET pcMensaje := CONCAT('Campos requeridos para poder realizar la matrícula:',temMensaje); END IF; SELECT COUNT(*) INTO vn_existeBlog FROM blog WHERE blog.idBlog = pc_idBlog; IF vn_existeBlog = 0 THEN SET pcMensaje := CONCAT('No existe el blog ',pc_idBlog); END IF; IF pcMensaje = '' THEN SELECT comentarioBlog.idComentarioBlog, COUNT(*) FROM likeComentario INNER JOIN comentarioBlog ON likeComentario.idComentarioBlog = comentarioBlog.idComentarioBlog WHERE comentarioBlog.idBlog = pc_idBlog GROUP BY comentarioBlog.idComentarioBlog; SET pbOcurreError := FALSE; SET pcMensaje :='Todo bien'; END IF; END $$ DELIMITER ;
insert into recipe (id,title) values (10,'Hashbrowns'); insert into recipe (id,title) values (20,'Sandwich');
CREATE TABLE `build_config_change` ( `build_id` bigint(20) unsigned not null comment '构建ID', `app_id` int(11) unsigned not null comment '应用ID', `app_name` varchar(255) not null comment '应用名称', `env_id` int(11) unsigned not null comment '环境ID', `env_name` varchar(255) not null comment '环境名称', `profile_id` int(11) unsigned not null comment 'Profile ID', `profile_name` varchar(255) not null comment 'Profile名称', `config_id` bigint(20) unsigned not null comment '配置ID', `config_name` varchar(255) not null comment '配置名', KEY(`build_id`), KEY app_env_build_idx(`app_id`,`env_id`,`build_id`) ) comment='构建的配置变更记录(Change List)' ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE ClientFamilyHistoryTBL ( ID BIGINT NOT NULL AUTO_INCREMENT, MEDPAL BIGINT NULL, RelationshipTypeID INTEGER UNSIGNED NULL, MedicalConditionID INTEGER UNSIGNED NULL, PRIMARY KEY(ID) ); CREATE TABLE MedicalComditionTBL ( ID INTEGER UNSIGNED NOT NULL, MedicalCondition VARCHAR(50) NULL, PRIMARY KEY(ID) );
ALTER DATABASE community DEFAULT CHARACTER SET utf8; use community; INSERT INTO user(ACCOUNT, EMAIL, NAME, PASSWORD, AVARTARURL) VALUE ('466423955@qq.com', '466423955@qq.com', 'Hasaki', '202cb962ac59075b964b07152d234b70', '/img/avatar/timg.jpg');
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 09-Jul-2021 às 21:09 -- Versão do servidor: 10.4.19-MariaDB -- versão do PHP: 7.3.28 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `formulario-dpego` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `image` -- CREATE TABLE `image` ( `id` int(11) NOT NULL, `Filename` varchar(100) NOT NULL, `image_text` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estrutura da tabela `usuarios` -- CREATE TABLE `usuarios` ( `id` int(11) NOT NULL, `nome` varchar(45) NOT NULL, `email` varchar(110) NOT NULL, `telefone` varchar(15) NOT NULL, `sexo` varchar(15) NOT NULL, `data_nasc` date NOT NULL, `cidade` varchar(45) NOT NULL, `estado` varchar(45) NOT NULL, `endereco` varchar(45) NOT NULL, `senha` varchar(45) NOT NULL, `cpf` varchar(15) NOT NULL, `rg` varchar(30) NOT NULL, `renda` float NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Extraindo dados da tabela `usuarios` -- INSERT INTO `usuarios` (`id`, `nome`, `email`, `telefone`, `sexo`, `data_nasc`, `cidade`, `estado`, `endereco`, `senha`, `cpf`, `rg`, `renda`) VALUES (0, 'nome', 'email', 'telefone', 'sexo', '0000-00-00', 'cidade', 'estado', 'endereco', 'senha', 'cpf', 'rg', 0), (20210, 'João Pedro Oliveira', 'JoaoPedroOliveira@gmail.com', '(062) 35513759', 'masculino', '2021-07-06', 'Goiânia', 'Goiás', 'Rua Abner Silva Sarrazin', '123', '041.903.040-93', '131.233.42', 1100), (20211, 'Rafaela da Costa', 'RafaeladaCosta@gmail.com', '(062) 986602300', 'feminino', '2021-07-06', 'Goiânia', 'Goiás', 'Rua Adriano Carvalho Leitão', '123', '130.763.686-13', '32.323.23', 1100), (20212, 'João Guilherme da Paz', 'JoaoGuilhermedaPaz@hotmail.com', '(062) 35512020', 'feminino', '2021-07-27', 'Goiânia', 'Goiás', 'Rua Agatha Rezende de', '123', '378.371.978-01', '232.23.21.1', 1100), (20213, 'Caio Araújo', 'CaioAraujo@hotmail.com', '(062) 35511133', 'masculino', '2021-07-28', 'Goiânia', 'Goiás', 'Rua Aline Medeiros Barboza', '123', '414.340.858-99', '56.6.3.234.32', 2200), (20214, 'Cauã Barros', 'CauaBarros@yahoo.com.br', '(062) 35513302', 'masculino', '2021-07-29', 'Goiânia', 'Goiás', 'Rua Amanda Alves Bezerra', '123', '446.989.018-98', '67.835.89.33', 2201), (20215, 'João Felipe Alves', 'JoaoFelipeAlves@terra.com.br', '(062) 35511643', 'masculino', '2021-07-30', 'Goiânia', 'Goiás', 'Rua Amanda de Oliveira', '123', '447.293.458-27', '928.22.222', 2202), (20216, 'Rafael Ferreira', 'RafaelFerreira@yahoo.com.br', '(062) 35513302', 'masculino', '2021-07-31', 'Goiânia', 'Goiás', 'Rua Ana Carolina Firmino', '123', '457.841.698-40', '22.56.29.5', 3800), (20217, 'Ian da Mota', 'IandaMota@hotmail.com', '(062) 35511643', 'masculino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Ana Clara Nunes', '123', '472.085.158-40', '924.442.43', 3600), (20218, 'Dr. Caio Rezende', 'DrCaioRezende@hotmail.com', '(062) 996900743', 'masculino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Ana Claudia Nunes', '123', '484.869.248-20', '928.283.92', 3500), (20219, 'Alícia Martins', 'AlíciaMartins@pandora.be', '(062) 996175398', 'feminino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Ana Luiza Teixeira', '123', '505.400.878-07', '273938737', 3678), (20220, 'Nathan Santos', 'NathanSantos@yahoo.com.br', '(062) 35513714', 'feminino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua André Bueno de', '123', '508.985.478-57', '273.2112.22', 5500), (20221, 'Dr. Vinicius da Rocha', 'DrViniciusdaRocha@hotmail.com', '(062) 999967460', 'masculino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Anna Beatriz Nogueira', '123', '513.080.058-30', '2348.736.38', 5501), (20222, 'Juliana Freitas', 'JulianaFreitas@hotmail.com', '(062) 35513203', 'feminino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Anna Clara Pinto', '123', '605.869.413-20', '39862222', 5502), (20223, 'Srta. Agatha Mendes', 'SrtaAgathaMendes@yahoo.com.br', '(062) 984025728', 'feminino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Beatriz Cairo Duarte', '123', '054.345.985-30', '234827', 5503), (20224, 'Jair Messias Bolsonaro', 'Bolsonaro@yahoo.com.br', '(062) 999551370', 'masculino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Beatriz Garcia Matsumoto', '123', '444.322.768-80', '284827098', 1200), (20225, 'Luiz Inacio Lula Da Silva', 'SofiaTeixeira@bol.com.br', '(062) 35510075', 'masculino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Beatriz Santos Domingues', '123', '035.586.968-09', '274.28.920', 4000), (20226, 'Maria bonita', 'AnaCarolinaCorreia@bol.com.br', '(062) 35510048', 'feminino', '0000-00-00', 'Goiânia', 'Goiás', 'Rua Bianca Pereira da', '123', '054.123.222-10', '2344.245.5', 1000); -- -- Índices para tabelas despejadas -- -- -- Índices para tabela `image` -- ALTER TABLE `image` ADD PRIMARY KEY (`id`); -- -- Índices para tabela `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT de tabelas despejadas -- -- -- AUTO_INCREMENT de tabela `image` -- ALTER TABLE `image` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
select c.ClientId , ush.Status as CurrentStatus , ushPrev.Status as PreviousStatus , cr.cnt into #needed from #cl c inner join dbo.FrontendUsers fu on fu.id = c.ClientId outer apply ( select top 1 ush.Status from dbo.UserStatusHistory ush where ush.UserId = c.ClientId and ush.IsLatest = 1 order by ush.DateCreated desc ) ush outer apply ( select top 1 ush.Status from dbo.UserStatusHistory ush where ush.UserId = c.ClientId and ush.IsLatest = 0 order by ush.DateCreated desc ) ushPrev outer apply ( select count(*) as cnt from dbo.Credits cr where cr.UserId = c.ClientId ) cr where ush.Status = 6 ; select ush.* -- update ush set IsLatest = 0, DateLastUpdated = getdate(), LastUpdatedByUserId = 1 from dbo.UserStatusHistory ush inner join #needed c on c.ClientId = ush.UserId where IsLatest = 1 ; --insert into dbo.UserStatusHistory (UserId,Status,IsLatest,DateCreated,CreatedByUserId) select ClientId as UserId , 9 as Status , 1 as IsLatest , getdate() , 1 as CreatedByUserId from #needed ; select ubh.* -- update ubh set IsLatest = 0, DateLastUpdated = getdate() from dbo.UserBlocksHistory ubh inner join #needed c on c.ClientId = ubh.UserId where IsLatest = 1 ; select uai.* -- update uai set State = 9 from dbo.UserAdminInformation uai inner join #needed c on c.ClientId = uai.UserId ; --insert into dbo.UserCustomLists (CustomlistID,UserId,DateCreated) select 1003 as CustomlistID , ClientId as UserId , getdate() as DateCreated from #needed select * from #needed
CREATE TABLE document ( document_id integer not null, PRIMARY KEY (document_id), CONSTRAINT SortingOrder_Position_1 CHECK (argument_column('document_id')) );
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jul 24, 2017 at 01:51 PM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.5.35 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: `update-multiple-marker-position-on-map` -- -- -------------------------------------------------------- -- -- Table structure for table `new_user` -- CREATE TABLE `new_user` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `lat` varchar(255) NOT NULL, `lng` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `new_user` -- INSERT INTO `new_user` (`id`, `name`, `lat`, `lng`) VALUES (1, 'user1', '22.416644', '75.1780865'), (2, 'user2', '22.1614460', '75.1750063'), (3, 'user3', '22.1647465', '75.1787460'); -- -- Indexes for dumped tables -- -- -- Indexes for table `City` -- ALTER TABLE `City` ADD PRIMARY KEY (`CityId`); -- -- Indexes for table `destination` -- ALTER TABLE `destination` ADD PRIMARY KEY (`id`); -- -- Indexes for table `Distance` -- ALTER TABLE `Distance` ADD PRIMARY KEY (`DistanceId`); -- -- Indexes for table `forgotPassword` -- ALTER TABLE `forgotPassword` ADD PRIMARY KEY (`id`); -- -- Indexes for table `new_user` -- ALTER TABLE `new_user` ADD PRIMARY KEY (`id`); -- -- Indexes for table `services` -- ALTER TABLE `services` ADD PRIMARY KEY (`serviceId`); -- -- Indexes for table `State` -- ALTER TABLE `State` ADD PRIMARY KEY (`StateId`); -- -- Indexes for table `token` -- ALTER TABLE `token` ADD PRIMARY KEY (`token_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`userId`); -- -- Indexes for table `userServiceLooking` -- ALTER TABLE `userServiceLooking` ADD PRIMARY KEY (`Id`); -- -- Indexes for table `userServiceProvided` -- ALTER TABLE `userServiceProvided` ADD PRIMARY KEY (`Id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `City` -- ALTER TABLE `City` MODIFY `CityId` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `destination` -- ALTER TABLE `destination` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `Distance` -- ALTER TABLE `Distance` MODIFY `DistanceId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `forgotPassword` -- ALTER TABLE `forgotPassword` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `new_user` -- ALTER TABLE `new_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `services` -- ALTER TABLE `services` MODIFY `serviceId` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `State` -- ALTER TABLE `State` MODIFY `StateId` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `token` -- ALTER TABLE `token` MODIFY `token_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `userId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `userServiceLooking` -- ALTER TABLE `userServiceLooking` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `userServiceProvided` -- ALTER TABLE `userServiceProvided` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=75; /*!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 */;
-- show all records of the table second_table of the database hbtn_0c_0 -- Don’t list rows without a name value -- Results should display the score and the name (in this order) -- cat 16-no_link.sql | mysql -hlocalhost -uroot -p hbtn_0c_0 SELECT score, name FROM second_table WHERE name IS NOT NULL ORDER BY score DESC;
USE employees; # Using the example in the Associative Table Joins section as a guide, write a query that shows each department along with the name of the current manager for that department. SELECT departments.dept_name AS 'Department Name', CONCAT(employees.first_name, ' ', employees.last_name) AS 'Department Manager' FROM departments LEFT JOIN dept_manager ON departments.dept_no = dept_manager.dept_no JOIN employees ON dept_manager.emp_no = employees.emp_no WHERE to_date LIKE '9999%' ORDER BY departments.dept_name; # Department Name | Department Manager # --------------------+-------------------- # Customer Service | Yuchang Weedman # Development | Leon DasSarma # Finance | Isamu Legleitner # Human Resources | Karsten Sigstam # Marketing | Vishwani Minakawa # Production | Oscar Ghazalie # Quality Management | Dung Pesch # Research | Hilary Kambil # Sales | Hauke Zhang # Find the name of all departments currently managed by women. SELECT departments.dept_name AS 'Department Name', CONCAT(employees.first_name, ' ', employees.last_name) AS 'Department Manager' FROM departments LEFT JOIN dept_manager ON departments.dept_no = dept_manager.dept_no JOIN employees ON dept_manager.emp_no = employees.emp_no WHERE to_date LIKE '9999%' AND employees.gender = 'F' ORDER BY departments.dept_name; # Department Name | Manager Name # ----------------+----------------- # Development | Leon DasSarma # Finance | Isamu Legleitner # Human Resources | Karsetn Sigstam # Research | Hilary Kambil # Find the current titles of employees currently working in the Customer Service department. SELECT t.title AS Title, COUNT(*) AS Count FROM titles AS t JOIN dept_emp AS de ON t.emp_no = de.emp_no WHERE de.to_date LIKE '9999%' AND t.to_date LIKE '9999%' AND de.dept_no = 'd009' GROUP BY t.title; # Title | Count # -------------------+------ # Assistant Engineer | 68 # Engineer | 627 # Manager | 1 # Senior Engineer | 1790 # Senior Staff | 11268 # Staff | 3574 # Technique Leader | 241 # Find the current salary of all current managers. SELECT d.dept_name AS 'Department Name', CONCAT(e.first_name, ' ', e.last_name) AS Name, s.salary AS Salary FROM departments AS d JOIN dept_manager AS dm ON d.dept_no = dm.dept_no JOIN employees AS e ON e.emp_no = dm.emp_no JOIN salaries AS s ON e.emp_no = s.emp_no WHERE dm.to_date LIKE '9999%' AND s.to_date LIKE '9999%' ORDER BY d.dept_name; # Department Name | Name | Salary # -------------------+-------------------+------- # Customer Service | Yuchang Weedman | 58745 # Development | Leon DasSarma | 74510 # Finance | Isamu Legleitner | 83457 # Human Resources | Karsten Sigstam | 65400 # Marketing | Vishwani Minakawa | 106491 # Production | Oscar Ghazalie | 56654 # Quality Management | Dung Pesch | 72876 # Research | Hilary Kambil | 79393 # Sales | Hauke Zhang | 101987 # Bonus Find the names of all current employees, their department name, and their current manager's name. SELECT CONCAT(e.first_name, ' ', e.last_name) AS 'Employee Name', d.dept_name AS 'Department Name', CONCAT(e2.first_name, ' ', e2.last_name) AS 'Manager Name' FROM employees AS e LEFT JOIN dept_emp AS de ON e.emp_no = de.emp_no JOIN departments AS d ON de.dept_no = d.dept_no JOIN dept_manager AS dm ON d.dept_no = dm.dept_no JOIN employees AS e2 ON dm.emp_no = e2.emp_no WHERE de.to_date LIKE '9999%' AND dm.to_date LIKE '9999%' ORDER BY e.last_name; # 240,124 Rows # # Employee Name | Department Name | Manager Name # --------------|------------------|----------------- # Huan Lortz | Customer Service | Yuchang Weedman # # ..... -- Write a query to get the average salary current managers make by gender -- M 79350.60 -- F 75690.00 SELECT e.gender, AVG(s.salary) FROM employees AS e JOIN dept_manager AS dm ON e.emp_no = dm.emp_no JOIN salaries AS s ON e.emp_no = s.emp_no WHERE s.to_date LIKE '9999%' AND dm.to_date LIKE '9999%' GROUP BY e.gender; -- Write a query to get the avg salary managers historically make by gender -- M 72810.94 -- F 62037.21 SELECT e.gender, AVG(s.salary) FROM employees AS e JOIN dept_manager AS dm ON e.emp_no = dm.emp_no JOIN salaries AS s on e.emp_no = s.emp_no GROUP BY e.gender; -- get avg salary for all current employees by gender -- M 72044.66 -- F 71963.57 SELECT e.gender, AVG(s.salary) FROM employees AS e JOIN salaries AS s ON e.emp_no = s.emp_no WHERE s.to_date LIKE '9999%' GROUP BY e.gender; -- get avg historic salary for all employees by gender -- M 63842.25 -- F 63750.17 SELECT e.gender, AVG(s.salary) FROM employees AS e JOIN salaries AS s ON e.emp_no = s.emp_no JOIN dept_emp AS emp ON e.emp_no = emp.emp_no GROUP BY e.gender; SELECT COUNT(*) FROM employees; SELECT COUNT(*) FROM dept_emp;
SELECT --BASIC DATA c.col_id AS ID, c.col_id AS COL_ID, c.col_caseid AS CaseId, c.col_extsysid AS ExtSysId, c.col_int_integtargetcase AS IntegTarget_Id, c.col_summary AS SUMMARY, --ce.col_description AS Description, (select col_description from tbl_caseext where col_caseextcase = c.col_id) as Description, c.col_createdby AS CreatedBy, c.col_createddate AS CreatedDate, c.col_modifiedby AS ModifiedBy, c.col_modifieddate AS ModifiedDate, c.col_dateassigned AS DateAssigned, c.col_dateclosed AS DateClosed, c.col_manualworkduration AS ManualWorkDuration, c.col_manualdateresolved AS ManualDateResolved, --ce.col_resolutiondescription AS ResolutionDescription, (select col_resolutiondescription from tbl_caseext where col_caseextcase = c.col_id) as ResolutionDescription, c.col_draft AS Draft, c.col_casefrom AS CaseFrom, --CASE TYPE cst.col_id AS CaseSysType_Id, cst.col_name AS CaseSysType_Name, cst.col_code AS CaseSysType_Code, cst.col_iconcode AS CaseSysType_IconCode, cst.col_colorcode AS CaseSysType_ColorCode, cst.col_usedatamodel AS CaseSysType_UseDataModel, cst.col_isdraftmodeavail AS CaseSysType_IsDraftModeAvail, --WORKITEM cw.col_id AS Workitem_Id, cw.col_activity AS Workitem_Activity, cw.col_workflow AS Workitem_Workflow, --PRIORITY prty.col_id AS Priority_Id, prty.col_name AS Priority_Name, prty.col_value AS Priority_Value, --Case STATE CONFIG (Milestones) sc.col_id AS StateConfig_id, sc.col_name AS StateConfig_Name, sc.col_code AS StateConfig_code, sc.col_isdefault AS StateConfig_IsDefault, --CASE STATE dts.col_id AS CaseState_Id, dts.col_name AS CaseState_name, dts.col_isstart AS CaseState_ISSTART, dts.col_isresolve AS CaseState_ISRESOLVE, dts.col_isfinish AS CaseState_ISFINISH, dts.col_isassign AS CaseState_ISASSIGN, dts.col_isfix AS CaseState_ISFIX, dts.col_isdefaultoncreate2 AS CaseState_ISINPROCESS, dts.col_isdefaultoncreate AS CaseState_ISDEFAULTONCREATE, --OWNERSHIP wb.id AS Workbasket_id, wb.calcname AS Workbasket_name, wb.calcname AS Owner_CaseWorker_Name, wb.workbaskettype_name AS Workbasket_type_name, wb.workbaskettype_code AS Workbasket_type_code, --RESOLUTION c.col_stp_resolutioncodecase AS ResolutionCode_Id, rc.col_name AS ResolutionCode_Name, rc.col_code AS ResolutionCode_Code, rc.col_iconcode AS ResolutionCode_Icon, rc.col_theme AS ResolutionCode_Theme, --(SELECT SUM(col_hoursspent) FROM tbl_dcm_workactivity WHERE col_workactivitycase = c.col_id) AS HoursSpent, NULL AS HoursSpent, --MILESTONE dict_state.col_id AS MS_StateId, dict_state.col_name AS MS_StateName, dict_state.col_commoncode AS MS_CommonCode, --Goal SLA (select col_id from tbl_dict_slaeventtype where col_code = 'GOAL') as GoalSlaEventTypeId, (select col_code from tbl_dict_slaeventtype where col_code = 'GOAL') as GoalSlaEventTypeCode, (select col_name from tbl_dict_slaeventtype where col_code = 'GOAL') as GoalSlaEventTypeName, c.col_goalsladatetime as GoalSlaDateTime, --DeadLine (DLine) SLA (select col_id from tbl_dict_slaeventtype where col_code = 'DEADLINE') as DLineSlaEventTypeId, (select col_code from tbl_dict_slaeventtype where col_code = 'DEADLINE') as DLineSlaEventTypeCode, (select col_name from tbl_dict_slaeventtype where col_code = 'DEADLINE') as DLineSlaEventTypeName, c.col_dlinesladatetime as DLineSlaDateTime ---- FROM tbl_case c --INNER JOIN tbl_caseext ce on c.col_id = ce.col_caseextcase LEFT JOIN tbl_stp_priority prty ON c.col_stp_prioritycase = prty.col_id LEFT JOIN tbl_cw_workitem cw ON c.col_cw_workitemcase = cw.col_id LEFT JOIN tbl_dict_casestate dts ON cw.col_cw_workitemdict_casestate = dts.col_id LEFT JOIN tbl_dict_casesystype cst ON c.col_casedict_casesystype = cst.col_id LEFT JOIN vw_ppl_workbasketsimple wb ON (wb.id = c.col_caseppl_workbasket) LEFT JOIN tbl_stp_resolutioncode rc ON c.col_stp_resolutioncodecase = rc.col_id LEFT JOIN TBL_DICT_STATECONFIG sc ON cst.col_stateconfigcasesystype = sc.col_id LEFT JOIN tbl_dict_state dict_state ON c.col_casedict_state = dict_state.col_id
2 camisas - pedro - 200 pago- falta 100 3 Bonecos do telyson - 40 2 camisa ao doca - 300 - pago 2 camisa ao luis paulo - 300 - pago 1 camisa nba para douglas - 130 - pago 2 camisas para o romario - 100 pago - falta 200 1 moleton ao doca - 170 Recebido 200+300+300+130+100=1030 Falta Receber 40+170+200+100 = 510 Retirado para compra 262
--HOMEWORK 3/11/2020 SELECT FROM employees VIEW employees --1. Get a table of all employees details, together with their --local_account_no and local_sort_code, if they have them. SELECT e.*, pd.local_account_no, pd.local_sort_code FROM employees AS e LEFT JOIN pay_details AS pd ON e.pay_detail_id = pd.id --2. Amend your query from question 1 above to also return the name of -- the team that each employee belongs to. SELECT e.*, pd.local_account_no, pd.local_sort_code, t.name AS team_name FROM employees AS e LEFT JOIN pay_details AS pd ON e.pay_detail_id = pd.id LEFT JOIN teams AS t ON e.team_id = t.id --3. Find the first name, last name and team name of employees who are members --of teams for which the charge cost is greater --than 80. Order the employees alphabetically by last name. SELECT e.first_name, e.last_name, t.name AS team_name, CAST(t.charge_cost AS int) > 80 ???? FROM employees AS e INNER JOIN teams AS t ON e.team_id = t.id ORDER BY e.last_name ASC NULLS LAST --4. Breakdown the number of employees in each of the teams, --including any teams without members. --Order the table by increasing size of team. SELECT t.name AS team_name, COUNT(e.id) AS num_employees FROM employees AS e RIGHT JOIN teams AS t ON e.team_id = t.id GROUP BY t.name ORDER BY num_employees ASC --5. The effective_salary of an employee is defined as -- their fte_hours multiplied by their salary --Get a table for each employee showing their id, first_name, --last_name, fte_hours, salary and effective_salary --along with a running total of effective_salary with employees placed --in ascending order of effective_salary. SELECT salary, fte_hours, id, first_name, last_name, fte_hours * salary AS effective_salary, SUM(fte_hours * salary) OVER (ORDER BY fte_hours * salary ASC NULLS LAST) AS running_tot_effective_salary FROM employees --6.The total_day_charge of a team is defined as the charge_cost of --the team multiplied by the number of employees in the team. --Calculate the total_day_charge for each team. SELECT t.name, COUNT(e.id) * CAST(t.charge_cost AS INT) AS total_day_charge FROM employees AS e INNER JOIN teams AS t ON e.team_id = t.id GROUP BY t.id --7.How would you amend your query from question 6 above to show only --those teams with a total_day_charge greater than 5000? SELECT t.name, COUNT(e.id) * CAST(t.charge_cost AS INT) AS total_day_charge FROM employees AS e ... JOIN AS t GROUP BY t.id ???
Delete from MovieCategory; Delete from OrderDetail; Delete from Comment; Delete from Favorite; Delete from Movie; DBCC CHECKIDENT (Movie,RESEED,0) INSERT INTO Movie VALUES ('Back To The Future I',1985,'Marty McFly, a 17-year-old high school student, is accidentally sent thirty years into the past in a time-traveling DeLorean invented by his close friend, the maverick scientist Doc Brown.',15,'2019-03-12'), ('Back to the Future Part II',1989,'After visiting 2015, Marty McFly must repeat his visit to 1955 to prevent disastrous changes to 1985...without interfering with his first trip.',15,'2019-03-12'), ('Back to the Future Part III',1990,'Learning about the death of Doc Brown in 1885, Marty travels back in time to save him. But when the fuel tank on the time machine is punctured, the two must figure out a way to escape the Old West before Emmet is murdered.',15,'2019-03-12'), ('The Lord of the Rings: The Fellowship of the Ring',2001,'A meek Hobbit from the Shire and eight companions set out on a journey to destroy the powerful One Ring and save Middle-earth from the Dark Lord Sauron.',20,'2019-03-12'), ('The Lord of the Rings: The Two Towers',2002,'While Frodo and Sam edge closer to Mordor with the help of the shifty Gollum, the divided fellowship makes a stand against Sauron'+CHAR(39)+'s new ally, Saruman, and his hordes of Isengard.',20,'2019-03-12'), ('The Lord of the Rings: The Return of the King',2003,'Gandalf and Aragorn lead the World of Men against Sauron'+CHAR(39)+'s army to draw his gaze from Frodo and Sam as they approach Mount Doom with the One Ring.',25,'2019-04-12'), ('The Shawshank Redemption',1994,'Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.',20,'2019-09-05'), ('The GodFather',1972,'The aging patriarch of an organized crime dynasty transfers control of his clandestine empire to his reluctant son.',30,'2019-09-05'), ('The Dark Knight',2008,'When the menace known as The Joker emerges from his mysterious past, he wreaks havoc and chaos on the people of Gotham. The Dark Knight must accept one of the greatest psychological and physical tests of his ability to fight injustice.',15,'2019-05-11'), ('The Godfather: Part II',194,'The early life and career of Vito Corleone in 1920s New York City is portrayed, while his son, Michael, expands and tightens his grip on the family crime syndicate.',15,'2019-04-24'), ('Pulp Fiction',1994,'The lives of two mob hitmen, a boxer, a gangster and his wife, and a pair of diner bandits intertwine in four tales of violence and redemption.',15,'2019-07-12'), ('Schindler'+CHAR(39)+'s List',1993,'In German-occupied Poland during World War II, industrialist Oskar Schindler gradually becomes concerned for his Jewish workforce after witnessing their persecution by the Nazis.',30,'2019-05-01'), ('12 Angry Men',1957,'A jury holdout attempts to prevent a miscarriage of justice by forcing his colleagues to reconsider the evidence.',50,'2019-04-12'), ('Inception',2010,'A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O.',20,'2019-07-12'), ('Fight Club',1999,'An insomniac office worker and a devil-may-care soapmaker form an underground fight club that evolves into something much, much more.',20,'2019-03-12'), ('Forrest Gump',1994,'The presidencies of Kennedy and Johnson, the events of Vietnam, Watergate, and other history unfold through the perspective of an Alabama man with an IQ of 75.',15,'2019-09-12'), ('İyi, Kötü ve Çirkin',1966,'A bounty hunting scam joins two men in an uneasy alliance against a third in a race to find a fortune in gold buried in a remote cemetery.',25,'2019-03-18'), ('The Silence of the Lambs',1991,'A young F.B.I. cadet must receive the help of an incarcerated and manipulative cannibal killer to help catch another serial killer, a madman who skins his victims.',25,'2019-02-12'), ('The Matrix',1999,'A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.',20,'2019-03-12'), ('Goodfellas',1990,'The story of Henry Hill and his life in the mob, covering his relationship with his wife Karen Hill and his mob partners Jimmy Conway and Tommy DeVito in the Italian-American crime syndicate.',25,'2019-03-12'), ('Léon ',1994,'Mathilda, a 12-year-old girl, is reluctantly taken in by Léon, a professional assassin, after her family is murdered. Léon and Mathilda form an unusual relationship, as she becomes his protégée and learns the assassin'+CHAR(39)+'s trade.',20,'2019-03-12'), ('Star Wars: Episode V - The Empire Strikes Back',1980,'After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda, while his friends are pursued by Darth Vader.',20,'2019-07-11'), ('One Flew Over the Cuckoo'+CHAR(39)+'s Nest',1975,'A criminal pleads insanity after getting into trouble again and once in the mental institution rebels against the oppressive nurse and rallies up the scared patients.',20,'2019-03-12'), ('Avengers: Endgame',2019,'After the devastating events of Avengers: Sonsuzluk Savasi (2018), the universe is in ruins. With the help of remaining allies, the Avengers assemble once more in order to reverse Thanos'+CHAR(39)+' actions and restore balance to the universe.',50,'2019-03-12'), ('Interstellar',2014,'A team of explorers travel through a wormhole in space in an attempt to ensure humanity'+CHAR(39)+'s survival.',25,'2019-03-12'), ('Cidade de Deus',2002,'In the slums of Rio, two kids'+CHAR(39)+' paths diverge as one struggles to become a photographer and the other a kingpin.',20,'2019-03-12'), ('Saving Private Ryan',1998,'Following the Normandy Landings, a group of U.S. soldiers go behind enemy lines to retrieve a paratrooper whose brothers have been killed in action.',20,'2019-02-12'), ('The Green Mile',1999,'The lives of guards on Death Row are affected by one of their charges: a black man accused of child murder and rape, yet who has a mysterious gift.',25,'2019-01-12'), ('Se7en',1995,'Two detectives, a rookie and a veteran, hunt a serial killer who uses the seven deadly sins as his motives.',25,'2019-06-12'), ('Life Is Beautiful',1997,'When an open-minded Jewish librarian and his son become victims of the Holocaust, he uses a perfect mixture of will, humor, and imagination to protect his son from the dangers around their camp.',25,'2019-03-12') select * from Movie Delete from MovieCategory; select * from MovieCategory INSERT INTO MovieCategory(MovieID,CategoryID) Values (1,2),(1,5),(1,9), (2,2),(2,5),(2,9), (3,2),(3,5),(3,9), (4,2),(4,7),(4,15), (5,2),(5,7),(5,15), (6,2),(6,7),(6,15), (7,7), (8,7),(8,6), (9,7),(9,6),(9,2), (10,7),(10,6), (11,7),(11,6), (12,7),(12,4),(12,10), (13,7), (14,1),(14,2),(14,9), (15,7), (16,7),(16,12), (17,14), (18,6),(18,7),(18,11), (19,1),(19,9), (20,4),(20,6),(20,7), (21,1),(21,6),(21,7), (22,1),(22,2),(22,15), (23,7), (24,1),(24,2),(24,9), (25,7),(25,2),(25,9), (26,6),(26,7), (27,7),(14,13), (28,6),(28,7),(28,15), (29,6),(29,7),(29,16), (30,5),(30,7),(30,12) Delete from Member; DBCC CHECKIDENT (Member,RESEED,0); INSERT INTO Member(UserName,Name,Surname,Email,Password,IsAdmin )VALUES ('fakin','Filiz','Akin','fakin@mail.com',123,0), ('takan','Tarık','Akan','takin@mail.com',123,0), ('carkın','Cüneyt','Arkın','carkin@mail.com',123,0), ('ksunal','Kemal','Sunal','ksunal@mail.com',123,0), ('hakcatepe','Halit','Akcatepe','hakcatepe@mail.com',123,0), ('admin','Admin','Admin','admin@mail.com',123,1), ('uye1','Ad1','Soyad1','uye1@mail.com',123,0), ('uye2','Ad2','Soyad2','uye2@mail.com',123,0), ('uye3','Ad3','Soyad3','uye3@mail.com',123,0) select * from Member Delete from Comment; DBCC CHECKIDENT (Comment,RESEED,0); INSERT INTO Comment(MovieID ,UserID, Comment)VALUES (1,1,'condimentum. Donec at arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec'), (1,2,'vitae risus. Duis a mi fringilla mi lacinia mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit'), (1,3,'Curabitur egestas nunc sed libero. Proin sed turpis nec mauris blandit mattis. Cras eget nisi dictum augue malesuada malesuada. Integer'), (2,1,'id, mollis nec, cursus a, enim. Suspendisse aliquet, sem ut cursus luctus, ipsum leo elementum sem, vitae aliquam eros turpis'), (2,2,'vulputate velit eu sem. Pellentesque ut ipsum ac mi eleifend egestas. Sed pharetra, felis eget varius ultrices, mauris ipsum porta'), (3,4,'condimentum. Donec at arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec'), (3,5,'vitae risus. Duis a mi fringilla mi lacinia mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit'), (3,1,'Curabitur egestas nunc sed libero. Proin sed turpis nec mauris blandit mattis. Cras eget nisi dictum augue malesuada malesuada. Integer'), (4,5,'id, mollis nec, cursus a, enim. Suspendisse aliquet, sem ut cursus luctus, ipsum leo elementum sem, vitae aliquam eros turpis'), (4,6,'vulputate velit eu sem. Pellentesque ut ipsum ac mi eleifend egestas. Sed pharetra, felis eget varius ultrices, mauris ipsum porta'),(5,7,'condimentum. Donec at arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec'), (5,6,'vitae risus. Duis a mi fringilla mi lacinia mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit'), (5,3,'Curabitur egestas nunc sed libero. Proin sed turpis nec mauris blandit mattis. Cras eget nisi dictum augue malesuada malesuada. Integer'), (6,1,'id, mollis nec, cursus a, enim. Suspendisse aliquet, sem ut cursus luctus, ipsum leo elementum sem, vitae aliquam eros turpis'), (6,2,'vulputate velit eu sem. Pellentesque ut ipsum ac mi eleifend egestas. Sed pharetra, felis eget varius ultrices, mauris ipsum porta'),(6,5,'condimentum. Donec at arcu. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec'), (7,1,'vitae risus. Duis a mi fringilla mi lacinia mattis. Integer eu lacus. Quisque imperdiet, erat nonummy ultricies ornare, elit elit'), (7,5,'Curabitur egestas nunc sed libero. Proin sed turpis nec mauris blandit mattis. Cras eget nisi dictum augue malesuada malesuada. Integer'), (7,3,'id, mollis nec, cursus a, enim. Suspendisse aliquet, sem ut cursus luctus, ipsum leo elementum sem, vitae aliquam eros turpis'), (8,1,'vulputate velit eu sem. Pellentesque ut ipsum ac mi eleifend egestas. Sed pharetra, felis eget varius ultrices, mauris ipsum porta') select * from Comment Delete from Favorite; insert into Favorite (UserID,MovieID) Values (5,20), (8,29), (2,27), (9,18), (4,21), (4,9), (4,20), (7,11), (2,7), (6,17), (6,10), (3,5), (2,29), (4,20), (1,26), (7,4), (2,26), (7,23), (6,28), (9,15), (1,2), (9,16), (2,8), (6,6), (7,3), (5,22), (3,13), (1,12), (2,16), (7,25), (2,11), (2,7), (9,12), (9,11), (3,5), (4,6), (4,11), (2,25), (4,16), (8,26) select * from Favorite Delete from OrderDetail; DBCC CHECKIDENT (OrderDetail,RESEED,0); select * from OrderDetail; insert into OrderDetail(UserID,MovieID,Date) values (5,20,'2018-09-28'), (8,29,'2019-07-21'), (2,27,'2019-07-10'), (9,18,'2019-08-28'), (4,21,'2019-07-18'), (4,9,'2019-01-27'), (4,20,'2018-10-02'), (7,11,'2019-04-16'), (2,7,'2018-09-15'), (6,17,'2019-04-17'), (6,10,'2019-08-24'), (3,5,'2018-11-21'), (2,29,'2019-06-11'), (4,20,'2018-10-11'), (1,26,'2019-08-06'), (7,4,'2019-05-08'), (2,26,'2019-08-05'), (7,23,'2019-04-15'), (6,28,'2019-08-17'), (9,15,'2019-09-02'), (1,2,'2018-09-20'), (9,16,'2018-11-04'), (2,8,'2019-08-26'), (6,6,'2019-03-11'), (7,3,'2019-03-31'), (5,22,'2019-05-25'), (3,13,'2019-04-16'), (1,12,'2019-05-20'), (2,16,'2019-01-31'), (7,25,'2018-10-31'), (2,11,'2019-03-18'), (2,7,'2018-11-01'), (9,12,'2018-10-20'), (9,11,'2019-06-24'), (3,5,'2018-09-14'), (4,6,'2019-01-25'), (4,11,'2019-07-14'), (2,25,'2018-09-16'), (4,16,'2019-04-03'), (8,26,'2019-02-18') --exec sp_rename 'Order','OrderDetail'
CREATE DATABASE db_minha_casa_mais_bonita; USE db_minha_casa_mais_bonita; CREATE TABLE tb_categoria ( id_categoria BIGINT auto_increment, nome VARCHAR (200), ativo BOOLEAN, PRIMARY KEY (id_categoria) ); INSERT INTO tb_categoria (nome, ativo) VALUE ("Banheiro", true); INSERT INTO tb_categoria (nome, ativo) VALUE ("Sala de Jantar", true); INSERT INTO tb_categoria (nome, ativo) VALUE ("Cozinha", true); INSERT INTO tb_categoria (nome, ativo) VALUE ("Quarto", true); INSERT INTO tb_categoria (nome, ativo) VALUE ("Sala de estar", true); SELECT * FROM tb_categoria; USE db_minha_casa_mais_bonita; CREATE TABLE tb_produto ( id_produto BIGINT auto_increment, nome_produto VARCHAR (200), valor DECIMAL (10,2), quantidade BIGINT (10), categoria_id BIGINT, PRIMARY KEY (id_produto), FOREIGN KEY (categoria_id) REFERENCES tb_categoria (id_categoria) ); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Vaso sanitário", 70.00, 3, 1); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Cuba para pia", 50.00, 5, 1); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Mesa de vidro redonda", 1000.00, 7, 2); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Cadeira", 50.00, 8, 2); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Fogão", 2000.00, 3, 3); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Kit facas profissional", 60.00, 3, 3); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Cama de casal", 70.00, 5, 4); INSERT INTO tb_produto (nome_produto, valor, quantidade, categoria_id) VALUE ("Sofá", 55.00, 10, 5); SELECT * FROM tb_produto; USE db_minha_casa_mais_bonita; CREATE TABLE tb_usuario ( id_usuario BIGINT AUTO_INCREMENT, nome_completo VARCHAR (200), idade INT (3), email VARCHAR (100), senha VARCHAR (100), PRIMARY KEY (id_usuario) ); INSERT INTO tb_usuario (nome_completo, idade, email, senha) VALUE ("Vanessa da Silva", 25, "vanessasilva@gmail.com", "vanessa133"); INSERT INTO tb_usuario (nome_completo, idade, email, senha) VALUE ("Ricardo Alves", 57, "ricardoalves@gmail.com", "2545658474"); INSERT INTO tb_usuario (nome_completo, idade, email, senha) VALUE ("Maria Clara Nunes", 21, "mcnunes@gmail.com", "vanessa133"); INSERT INTO tb_usuario (nome_completo, idade, email, senha) VALUE ("Gabriel Souza", 33, "gabrielsouza123@gmail.com", "gabriel123544588"); INSERT INTO tb_usuario (nome_completo, idade, email, senha) VALUE ("Roberta Macedo", 49, "RobertaMacedo@gmail.com", "roberta33"); SELECT * FROM tb_usuario; -- Faça um select que retorne os Produtos com o valor maior do que 50 reais. SELECT * FROM tb_produto WHERE valor > 50.00; -- Faça um select trazendo os Produtos com valor entre 3 e 60 reais. SELECT * FROM tb_produto WHERE valor BETWEEN 3.00 AND 60.00; -- Faça um select utilizando LIKE buscando os Produtos com a letra B. SELECT * FROM tb_produto WHERE nome_produto LIKE "%B%"; -- Faça um select utilizando LIKE buscando os Usuários com a letra C. SELECT * FROM tb_usuario WHERE nome_completo LIKE "%C%"; -- Faça um um select com Inner join entre tabela categoria e produto. SELECT * FROM tb_categoria INNER JOIN tb_produto ON tb_categoria.id_categoria = tb_produto.categoria_id; -- faça um select que retorne a média de preços dos produtos; SELECT AVG (valor) AS media FROM tb_produto; -- faça um select que quantidade de produtos cadastrados na tabela SELECT COUNT(*) FROM tb_produto; -- Faça um select onde traga todos os Produtos de uma categoria específica SELECT * FROM tb_produto WHERE tb_produto.categoria_id = 3;
-- Creates a table second_table and adds multiple rows CREATE TABLE IF NOT EXISTS second_table( id INT, name VARCHAR(256), score INT ); INSERT INTO second_table(id,name,score) VALUES (1,"John",10), (2,"Alex",3), (3,"Bob",14), (4,"George",8);
CREATE ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; CREATE ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; \set prevdb :DBNAME \set prevusr :USER CREATE TABLE session_hook_log(id SERIAL, dbname TEXT, username TEXT, hook_at TEXT); SELECT * FROM session_hook_log ORDER BY id; \c :prevdb regress_sess_hook_usr1 SELECT * FROM session_hook_log ORDER BY id; \c :prevdb regress_sess_hook_usr2 SELECT * FROM session_hook_log ORDER BY id; \c :prevdb :prevusr SELECT * FROM session_hook_log ORDER BY id;
alter table Books add genre varchar(155); create table BookAuthor ( id int AUTO_INCREMENT, bookId int, authorId int, primary key(id) ); insert into BookAuthor (bookId, authorId) values (1, 1), (2, 2), (3, 4), (4, 6), (5, 7); update Books set genre="educational"; alter table Books modify title varchar(255) character set utf8;
insert into ROLE(ID,NAME) values (1, 'USER'); insert into CUSTOMER(ID, ACCOUNT_NON_EXPIRED, ACCOUNT_NON_LOCKED, CREDENTIALS_NON_EXPIRED, EMAIL, ENABLED, NAME, PASSWORD, PHONE) values (10000, TRUE, TRUE, TRUE, 'rey@theresistance.com', TRUE, 'Rey', 'password', '+1(999)999-9999)'); insert into CUSTOMER_ROLES(CUSTOMER_ID, ROLES_ID) values (10000, 1);
--Checklist 49 DECLARE VaiDarErro CHAR(5); BEGIN VaiDarErro := 'MuitasLetras'; if VaiDarErro IS NULL THEN dbms_output.put_line('VaiDarErro é NULL'); END IF; EXCEPTION WHEN VALUE_ERROR THEN dbms_output.put_line('Erro!'); END; /
SELECT 'Informacoes para o periodo de ' || MIN(timestamp) || ' a ' || MAX(timestamp) AUDIT_RETENTION FROM dba_audit_trail; PROMPT PROMPT Logins successful total: PROMPT SELECT COUNT(1) logins_successful FROM dba_audit_trail WHERE action = 100 --LOGON AND returncode = 0; BREAK ON DATA SKIP 1 PROMPT PROMPT Logins successful break on DATA PROMPT SELECT TRUNC(timestamp) DATA , COUNT(1) logins_successful FROM dba_audit_trail WHERE action = 100 --LOGON AND returncode = 0 GROUP BY TRUNC(timestamp) ORDER BY 1; /* PROMPT PROMPT Logins successful break on DATE, OS_USERNAME PROMPT COL os_username FOR A30 SELECT TRUNC(timestamp) DATA , os_username , COUNT(1) logins_successful FROM dba_audit_trail WHERE action = 100 --LOGON AND returncode = 0 AND TRUNC(timestamp) = TRUNC(SYSDATE) GROUP BY TRUNC(timestamp) , os_username ORDER BY 1,2; */ PROMPT PROMPT Logins successful break on DATE, OS_USERNAME, USERNAME, USERHOST PROMPT /* SELECT TRUNC(timestamp) DATA , os_username , username , userhost , COUNT(1) logins_successful FROM dba_audit_trail WHERE action = 100 --LOGON AND returncode = 0 --AND username = 'USERPRD' GROUP BY TRUNC(timestamp) , os_username , username , userhost ORDER BY 1,2,3,4; */ COL os_username FOR A30 COL userhost FOR A30 COL return_code FOR A30 CLEAR BREAKS ACCEPT pBegin PROMPT "Type begin date (ddmmyyyy)[01012015]: " ACCEPT pEnd PROMPT "Type end date (ddmmyyyy)[SYSDATE]: " SELECT timestamp DATA , os_username , username , userhost FROM dba_audit_trail WHERE action = 100 --LOGON AND returncode = 0 AND timestamp BETWEEN NVL(TO_DATE('&pBegin','DDMMYYYY'),TO_DATE('01012015','DDMMYYYY')) AND NVL(TRUNC(TO_DATE('&pEnd','DDMMYYYY'))+1,SYSDATE) ORDER BY 1;
CREATE DATABASE db_skerkour;
-- lists all records of the table second_table of the database hbtn_0c_0. -- highest score up -- cat 10-top_score.sql | mysql -hlocalhost -uroot -p hbtn_0c_0 SELECT score, name FROM second_table ORDER BY score DESC;
use readme; insert into content_type (type,icon) values ('post-quote','quote'), ('post-text','text'), ('post-photo', 'photo'), ('post-link','link'), ('post-video','video'); insert into user(email,username,password) values ('larisa@amail.com','Лариса','larisa_password'), ('vladik@bmail.com','Владик','vladik_password'), ('viktor@cmail.com','Виктор', 'viktor_password'); insert into post (header, content_text,content_media,user_id,content_type_id,views) values ('Цитата','Мы в жизни любим только раз, а после ищем лишь похожих',null,1,1,10), ('Игра престолов','Не могу дождаться начала финального сезона своего любимого сериала!',null,2,2,1), ('Наконец, обработал фотки!',null,'rock-medium.jpg',3,3,10), ('Моя мечта',null,'coast-medium.jpg',1,3,101), ('Лучшие курсы',null,'www.htmlacademy.ru',2,4,5), ('Полезный пост про Байкал',null,'Озеро Байкал – огромное древнее озеро в горах Сибири к северу от монгольской границы. Байкал считается самым глубоким озером в мире. Он окружен сетью пешеходных маршрутов, называемых Большой байкальской тропой. Деревня Листвянка, расположенная на западном берегу озера, – популярная отправная точка для летних экскурсий. Зимой здесь можно кататься на коньках и собачьих упряжках.',1,2,15); insert into comment(content,user_id,post_id) values ('Lorem ipsum dolor','1','2'), ('Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia rem esse quis aliquid quam ea ratione vel cupiditate similique? Expedita tempora porro ad impedit dignissimos deleniti voluptates, ea consectetur delectus?','2','1'), ('Quia rem esse quis','2','6'), ('Expedita tempora porro','3','1'), ('Lorem ipsum dolor sit amet consectetur adipisicing elit','2','1'), ('Quia rem esse quis aliquid','1','3'), ('Lorem ipsum dolor sit amet','3','6'); select post.id, header,views, username, type from post join user on user_id = user.id join content_type on content_type_id = content_type.id order by views desc; select p.id,header, username,views from post p join user u on user_id = u.id where user_id = 1; select content,c.date_created,username,header from comment c join post p on post_id = p.id join user u on c.user_id = u.id where post_id = 1; insert into like_post (user_id,post_id) values (1,2), (2,4); insert into subscription (user_id, subscriber_id) values(2,3);
ALTER TABLE blog_reply ADD commentType integer NULL / ALTER TABLE blog_reply ADD workdate VARCHAR2(10) NULL / ALTER TABLE blog_reply ADD bediscussantid integer NULL / ALTER TABLE blog_reply ADD relatedid integer NULL /
insert into brand (name) values ('ETHOSENS'), ('STOF'), ('bedsidedrama'), ('STORAMA'), ('Portaille'), ('Dulcamara'), ('YARN&COPPER'), ('mitake'), ('OLTA DESIGNS'); insert into category (name) values ('TOPS'), ('OUTER'), ('PANTS'), ('SKIRT'), ('ONE PIECE'), ('BAG'), ('SHOES'), ('HAT'), ('SOCKS'); insert into color (name) values ('RED'), ('YELLOW'), ('GREEN'), ('BLUE'), ('PURPLE'), ('BROWN'), ('WHITE'), ('GRAY'), ('ORANGE'), ('NAVY'), ('BLACK'); insert into genre (name, category_id) values ('T Shirts', (select id from category where name = 'TOPS')), ('Shirts', (select id from category where name = 'TOPS')), ('Knit', (select id from category where name = 'TOPS')), ('PARKA', (select id from category where name = 'TOPS')), ('Sweat', (select id from category where name = 'TOPS')), ('Cardigan', (select id from category where name = 'TOPS')), ('Jacket', (select id from category where name = 'OUTER')), ('Coat', (select id from category where name = 'OUTER')), ('DenimPants', (select id from category where name = 'PANTS')), ('Pants', (select id from category where name = 'PANTS')), ('Skirt', (select id from category where name = 'SKIRT')), ('One Piece', (select id from category where name = 'ONE PIECE')), ('Bag', (select id from category where name = 'BAG')), ('Shoes', (select id from category where name = 'SHOES')), ('Hat', (select id from category where name = 'HAT')), ('Socks', (select id from category where name = 'SOCKS')); insert into item (brand_id, genre_id, color_id, image_url) values ((select id from brand where name = 'ETHOSENS'), (select id from genre where name = 'Shirts'), (select id from color where name = 'BLUE'), 'https://www.ethosens.com/onlinestore/wp-content/uploads/2019/12/e120-207a.jpg');
DROP TABLE IF EXISTS PRODUCT_TYPE; CREATE TABLE PRODUCT_TYPE ( PRODUCT_TYPE_ID VARCHAR(50) DEFAULT 0 NOT NULL, PRODUCT_TYPE_CODE VARCHAR(10), PRODUCT_TYPE_DESC VARCHAR(500), LOAD_DATE VARCHAR(10), LOAD_ID INTEGER, CONSTRAINT LOAD_ID_PK PRIMARY KEY(PRODUCT_TYPE_ID) );
INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (1, 'Математика', 1); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (2, 'Информатика', 1); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (3, 'Архитектура', 2); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (4, 'Градостроительство', 2); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (5, 'Строительство', 2); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (6, 'Поварское дело', 3); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (7, 'Швейное дело', 4); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (8, 'Дело производство', 5); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (9, 'Русский язык', 6); INSERT INTO journal.napr_podg (id_napr, name, id_kaf) VALUES (10, 'КУльтура речи', 6);
CREATE OR REPLACE PROCEDURE prc_resolve_alert -- l at the beginning of a variable represents that its a local variable used within the function ( l_dashboard_id IN VARCHAR2, l_resolved_comment IN VARCHAR2, l_resolved_datetime IN VARCHAR2, l_resolved_by IN VARCHAR2 ) IS BEGIN UPDATE dashboard_alert SET resolved_comment = l_resolved_comment, resolved_datetime = l_resolved_datetime, resolved_status = 1, resolved_by = l_resolved_by WHERE dashboard_id = l_dashboard_id; COMMIT; EXCEPTION WHEN OTHERS THEN raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM); END; /
SELECT * FROM MAIL_HOOK_CONDITIONS ORDER BY INSERT_DATETIME %s LIMIT ? OFFSET ?;
MATCH (e:ApplicationInstance) RETURN e
SELECT DISTINCT C.name FROM cnn C, (SELECT T.cnn_id FROM train T, (SELECT D.id FROM dataset D WHERE D.name = ?) E WHERE T.data_id = E.id) U WHERE C.id = U.cnn_id;
CREATE INDEX ON tilkjent_ytelse(behandling_id); ALTER TABLE behandling ADD COLUMN vedtakstidspunkt TIMESTAMP(3);
ALTER TABLE `newsfeeds_tbl` CHANGE COLUMN `n_image_url` `n_image_url` TEXT NULL DEFAULT NULL ;
-- displays the number of records with id = 89 in the table first_table -- count commands that count the once that are the words in specific in table of a databases SELECT city, AVG(value) AS avg_temp FROM temperatures WHERE month > 6 and month < 9 GROUP BY city ORDER BY avg_temp DESC LIMIT 3;
/*td:588 资产作维修处理,但是资产状态仍然不改变 */ CREATE or replace PROCEDURE CptUseLogMend_Insert ( capitalid_1 integer, usedate_2 char, usedeptid_3 integer, useresourceid_4 integer, usecount_5 integer, useaddress_6 varchar2, userequest_7 integer, maintaincompany_8 varchar2, fee_9 decimal, usestatus_10 varchar2, remark_11 varchar2, flag out integer, msg out varchar2, thecursor IN OUT cursor_define.weavercursor ) AS begin INSERT INTO CptUseLog ( capitalid, usedate, usedeptid, useresourceid, usecount, useaddress, userequest, maintaincompany, fee, usestatus, remark) VALUES ( capitalid_1, usedate_2, usedeptid_3, useresourceid_4, usecount_5, useaddress_6, userequest_7, maintaincompany_8, fee_9, '4', remark_11) ; Update CptCapital Set stateid = usestatus_10 where id = capitalid_1 ; end; / /* td:589 设置其中一个资产组的共享,那么所有资产组同步被设置了共享*/ CREATE or REPLACE PROCEDURE CptCapitalShareInfo_SbyRelated (relateditemid_1 integer , flag out integer , msg out varchar2, thecursor IN OUT cursor_define.weavercursor) as begin open thecursor for select * from CptCapitalShareInfo where ( relateditemid = relateditemid_1 ) order by sharetype; end; /
DELIMITER $$ CREATE TRIGGER `update_data` AFTER UPDATE on `srag`.`pessoa` FOR EACH ROW BEGIN IF (OLD.nu_idade >110) THEN INSERT INTO log (`id_pessoa` , `idade`) VALUES (OLD.id_pessoa, NEW.nu_idade); END IF; END$$ DELIMITER ;
REM sqlerrm.sql REM Version 1.0, last updated 4/8/97 REM This block illustrates the use of SQLERRM and SQLCODE inside a REM WHEN OTHERS exception handler, as described in Chapter 10 of REM _Oracle8 PL/SQL Programming_ by Scott Urman. DECLARE e_TooManyStudents EXCEPTION; -- Exception to indicate an error condition v_CurrentStudents NUMBER(3); -- Current number of students registered -- for HIS-101 v_MaxStudents NUMBER(3); -- Maximum number of students allowed for -- HIS-101 v_ErrorCode NUMBER; -- Variable to hold the error message code v_ErrorText VARCHAR2(200); -- Variable to hold the error message text BEGIN /* Find the current number of registered students, and the maximum number of students allowed. */ SELECT current_students, max_students INTO v_CurrentStudents, v_MaxStudents FROM classes WHERE department = 'HIS' AND course = 101; /* Check the number of students in this class. */ IF v_CurrentStudents > v_MaxStudents THEN /* Too many students registered - raise exception. */ RAISE e_TooManyStudents; END IF; EXCEPTION WHEN e_TooManyStudents THEN /* Handler which executes when there are too many students registered for HIS-101. We will insert a log message explaining what has happened. */ INSERT INTO log_table (info) VALUES ('History 101 has ' || v_CurrentStudents || 'students: max allowed is ' || v_MaxStudents); WHEN OTHERS THEN /* Handler which executes for all other errors. */ v_ErrorCode := SQLCODE; v_ErrorText := SUBSTR(SQLERRM, 1, 200); -- Note the use of SUBSTR here. INSERT INTO log_table (code, message, info) VALUES (v_ErrorCode, v_ErrorText, 'Oracle error occurred'); END; /
-- -- Base de données : `rob_world` -- -- -------------------------------------------------------- -- -- Structure de la table `creatures` -- CREATE TABLE `creatures` ( `uuid` INT PRIMARY KEY AUTO_INCREMENT, `creature_template_id` int(11) NOT NULL, `map_id` int(11) NOT NULL, `pos_x` float NOT NULL, `pos_y` float NOT NULL, `pos_z` float NOT NULL, `orientation` float NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Déchargement des données de la table `creatures` -- INSERT INTO `creatures` (`uuid`, `creature_template_id`, `map_id`, `pos_x`, `pos_y`, `pos_z`, `orientation`) VALUES (1, 1, 1, 2, 0, 1, 0), (2, 1, 1, 0, 0, 0, 0), (3, 2, 1, 2, 0, 2, 0); -- -------------------------------------------------------- -- -- Structure de la table `creatures_templates` -- CREATE TABLE `creatures_templates` ( `id` int(11) PRIMARY KEY AUTO_INCREMENT, `name` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Déchargement des données de la table `creatures_templates` -- INSERT INTO `creatures_templates` (`id`, `name`) VALUES (1, 'Sticky Spider'), (2, 'Wolf'), (3, 'Gobelin'); -- -------------------------------------------------------- -- -- Structure de la table `creatures_templates_locales` -- CREATE TABLE `creatures_templates_locales` ( `creature_template_id` int(11) NOT NULL, `locale` varchar(10) NOT NULL, `name` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Déchargement des données de la table `creatures_templates_locales` -- INSERT INTO `creatures_templates_locales` (`creature_template_id`, `locale`, `name`) VALUES (1, 'en', 'Sticky Spider'), (1, 'fr', 'Araignée Collante'); -- -- Index pour les tables déchargées -- -- -- Index pour la table `creatures_templates_locales` -- ALTER TABLE `creatures_templates_locales` ADD PRIMARY KEY (`creature_template_id`,`locale`);
CREATE TABLE `log_question_open_ai` ( `log_question_open_ai_id` int unsigned NOT NULL AUTO_INCREMENT, `question_id` int unsigned NOT NULL, `created` datetime DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`log_question_open_ai_id`), UNIQUE KEY `question_id` (`question_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_as_cs;
--UC2 ability to add address book table on the database create table address_book_table (first_name varchar(20) not null, last_name varchar(20) not null, address varchar(50) not null, city varchar(20) not null, state varchar(30) not null, zip int not null, phone bigint not null, email varchar(50) not null ) select * from address_book_table;
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Creato il: Gen 08, 2017 alle 20:04 -- Versione del server: 5.7.14 -- Versione PHP: 5.6.25 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: `bilancio` -- -- -------------------------------------------------------- -- -- Struttura della tabella `budget` -- CREATE TABLE `budget` ( `anno` int(11) NOT NULL, `id_cat` int(11) NOT NULL, `importo` decimal(10,2) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dump dei dati per la tabella `budget` -- INSERT INTO `budget` (`anno`, `id_cat`, `importo`) VALUES (2017, 1, '5000.00'), (2017, 5, '1000.00'), (2017, 9, '300.00'), (2017, 2, '0.00'), (2017, 3, '2000.00'), (2017, 4, '1000.00'), (2017, 6, '130.00'), (2017, 7, '700.00'), (2017, 8, '300.00'), (2017, 10, '500.00'), (2017, 11, '1100.00'), (2017, 12, '600.00'), (2017, 13, '600.00'), (2017, 14, '1000.00'), (2017, 15, '700.00'), (2017, 16, '550.00'), (2017, 17, '1000.00'), (2017, 18, '100.00'), (2017, 19, '200.00'), (2017, 20, '475.00'), (2017, 21, '1200.00'), (2017, 22, '100.00'), (2017, 23, '2000.00'), (2017, 24, '400.00'), (2017, 25, '7400.00'), (2017, 26, '1500.00'), (2017, 27, '500.00'), (2017, 28, '720.00'), (2017, 29, '4500.00'), (2017, 30, '8600.00'); -- -------------------------------------------------------- -- -- Struttura della tabella `categoria` -- CREATE TABLE `categoria` ( `id` int(11) NOT NULL, `nome` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dump dei dati per la tabella `categoria` -- INSERT INTO `categoria` (`id`, `nome`) VALUES (1, 'Cibo-spesa'), (2, 'cibo-fuori'), (3, 'divertimenti'), (4, 'varie'), (5, 'casa'), (6, 'lavanderia'), (7, 'salute'), (8, 'capelli'), (9, 'estetista'), (10, 'sigarette dany'), (11, 'sigarette fra'), (12, 'abbigliamento dany'), (13, 'abbigliamento fra'), (14, 'auto dany'), (15, 'auto fra'), (16, 'susi'), (17, 'acquiario'), (18, 'regali'), (19, 'telefono'), (20, 'assicurazione dany'), (21, 'assicurazione fra'), (22, 'caffe'), (23, 'sara'), (24, 'pannolini'), (25, 'finanziamenti banca'), (26, 'lenti a contatto'), (27, 'tassa casa dany'), (28, 'sky'), (29, 'investimenti'), (30, 'finanziamento auto fra'); -- -------------------------------------------------------- -- -- Struttura della tabella `entrate` -- CREATE TABLE `entrate` ( `id` int(11) NOT NULL, `data` int(11) NOT NULL, `importo` float NOT NULL, `nota` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dump dei dati per la tabella `entrate` -- INSERT INTO `entrate` (`id`, `data`, `importo`, `nota`) VALUES (1, 1484002800, 1800, 'stipendio fra'); -- -------------------------------------------------------- -- -- Struttura della tabella `uscite` -- CREATE TABLE `uscite` ( `id` int(11) NOT NULL, `data` int(11) NOT NULL, `importo` decimal(10,2) NOT NULL, `id_categoria` int(11) NOT NULL, `nota` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dump dei dati per la tabella `uscite` -- INSERT INTO `uscite` (`id`, `data`, `importo`, `id_categoria`, `nota`) VALUES (1, 1481410800, '120.00', 1, 'simply'), (2, 1481497200, '120.01', 21, 'assicuraizone'), (3, 1482188400, '120.22', 16, 'asd'), (4, 1481410800, '1254.15', 21, 'ba ba'), (5, 1475359200, '23.00', 1, 'bla bla'), (6, 1475359200, '23.00', 1, 'bla bla'), (7, 1475359200, '23.00', 1, 'bla bla'), (8, 1484002800, '45.00', 1, 'spesa comet'), (9, 1476136800, '22222.00', 1, ''), (10, 1483916400, '111111.00', 1, ''), (11, 1507672800, '4444.00', 1, ''), (12, 1484521200, '10.00', 4, ''), (13, 1483916400, '33.00', 6, ''); -- -- Indici per le tabelle scaricate -- -- -- Indici per le tabelle `budget` -- ALTER TABLE `budget` ADD PRIMARY KEY (`anno`,`id_cat`); -- -- Indici per le tabelle `categoria` -- ALTER TABLE `categoria` ADD PRIMARY KEY (`id`); -- -- Indici per le tabelle `entrate` -- ALTER TABLE `entrate` ADD PRIMARY KEY (`id`); -- -- Indici per le tabelle `uscite` -- ALTER TABLE `uscite` ADD PRIMARY KEY (`id`), ADD KEY `id_categoria` (`id_categoria`), ADD KEY `data` (`data`); -- -- AUTO_INCREMENT per le tabelle scaricate -- -- -- AUTO_INCREMENT per la tabella `categoria` -- ALTER TABLE `categoria` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; -- -- AUTO_INCREMENT per la tabella `entrate` -- ALTER TABLE `entrate` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT per la tabella `uscite` -- ALTER TABLE `uscite` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
SELECT choices.choice_content, choice_value, choices.question_id from choices left join questions on choices.quiz_id = questions.quiz_id ORDER BY question_content; SELECT choices.choice_content, choice_value, choices.question_id from choices left join questions on choices.quiz_id = questions.quiz_id GROUP BY question_id; GROUP BY question_id SELECT choices.choice_content, choice_value, choices.question_id from choices left join questions on choices.quiz_id = questions.quiz_id; SELECT choices.choice_content, choice_value, choices.question_id from choices left join questions on choices.quiz_id = questions.quiz_id; SELECT choices.choice_content, choice_value from choices left join questions on choices.quiz_id = questions.quiz_id; SELECT * choices.choice_content, choice_value from choices left join questions on choices.quiz_id = questions.quiz_id; SELECT choice.choice_content, choice_value from choices left join questions on choices.quiz_id = questions.quiz_id; SELECT questions.id, question_content from questions left join choices on choices.quiz_id = questions.quiz_id; INSERT INTO answers (user_id, question_id, choice_id) VALUES (3,1,3), (3,2,6), (3,3,10), (3,4,14), (3,5,19), (3,6,23), (3,7,27), (3,8,30), (3,9,35), (3,10,40); INSERT INTO answers (user_id, question_id, choice_id) VALUES (2,1,3), (2,2,6), (2,3,9), (2,4,15), (2,5,17), (2,6,22), (2,7,26), (2,8,29), (2,9,34), (2,10,40); INSERT INTO answers (user_id, question_id, choice_id) VALUES (2,1,3), (2,2,6), (2,3,9), (2,4,15), (2,5,17) (2,6,22), (2,7,26), (2,8,29), (2,9,34), (2,10,40); INSERT INTO answers (user_id, question_id, choice_id) VALUES (2,1,3), (2,2,6), (2,3,9),(2,4,15), (2,5,17) (2,6,22), (2,7,26),(2,8,29),(2,9,34),(2,10,40); INSERT INTO answers (user_id, question_id, choice_id) VALUES (1,1,3), (1,2,6), (1,3,9),(1,4,15), (1,5,17), (1,6,22),(1,7,25),(1,8,31),(1,9,33),(1,10,43); INSERT INTO answers (user_id, question_id, choice_id) VALUES (1,1,3), (1,2,6), (1,3,9),(1,4,15), (1,5,17), (1,6,22),(1,7,25),(1,8,31),(1,9,33),(1,10,43) INSERT INTO answers (user_id, question_id, choice_id) VALUES (2,1,3), (2,2,6), (2,3,9),(2,4,15), (2,5,17) (2,6,22), (2,7,26),(2,8,29),(2,9,34),(2,10,40) INSERT INTO answers (user_id, question_id, choice_id) VALUES (3,1,3), (3,2,6), (3,3, 10),(3,4,14), (3,5,19), (3,6,23),(3,7,27),(3,8,30),(3,9,35),(3,10,40); INSERT INTO answers (user_id, question_id, choice_id) VALUES (1,1,3), (1,2,6), (1,3,9),(1,4,15), (1,5 17); INSERT INTO answers (user_id, question_id, choice_id) VALUES (1,1,3), (1,2,6), (1,3,9),(1,4,15), (1,5 17), (1,6,22),(1,7,25),(1,8,31),(1,9,33),(1,10,43); 17), (1,6,22),(1,7,25),(1,8,31),(1,9,33),(1,10,43); INSERT INTO answers (user_id, question_id, choice_id) VALUES (1,1,3), (1,2,6), (1,3,9),(1,4,15), (1,5 17), (1,6,22),(1,7,25),(1,8,31),(1,9,33),(1,10,43) INSERT INTO answers (user_id, question_id, choice_id) VALUES (2,1,3), (2,2,6), (2,3,9),(2,4,15), (2,5 17) (2,6,22), (2,7,26),(2,8,29),(2,9,34),(2,10,40) INSERT INTO answers (user_id, question_id, choice_id) VALUES (3,1,3), (3,2,6), (3,3, 10),(3,4,14) (3,5,19), (3,6,23),(3,7,27),(3,8,30),(3,9,35),(3,10,40); SELECT questions.id, question_content, choices_id, choice_content from questions join choices on choices.questions_id = questions.id Where choices_value = "T"; INSERT INTO choices (quiz_id, question_id, choice_content, choice_value) VALUES (2, 2, '3', 'F'),(2, 2,'51','T'), (2, 2, '3', 'F'),(2, 2, '8', 'F'), (2, 3, '3', 'T'),(2, 3,'8','F'), (2, 3, '4', 'F'),(2, 3, '8', 'F'), (2, '4' ,'blue', 't'),(2, 4,'yellow','F'), (2, 4, 'purple', 'T'),(2, 4, 'orange', 'F'), (2, '5', 'boot', 'T'),(2, 5,'square','F'), (2, 5, 'circular', 'F'),(2, 5, 'red', 'F'), (2, 6, '1492', 'F'),(2, 6,'1778','T'), (2, 6, '1992','F'),(2, 6, 'good', 'F'), (1, 7, '4', 'T'),(1, 7,'100','F'), (1, 7, '19', 'F'),(1, 7, '88', 'F'), (1, 8, '13', 'F'),(1, 8,'51','F'), (1, 8, '3', 'T'),(1, 8, '8','F'), (1, 9, '5', 'T'),(1, 9,'78','F'), (1, 9, 'K3', 'F'),(1, 9, '800', 'F'), (1, 10, '3', 'F'),(1, 10,'7','F'), (1, 10, '373', 'F'),(1, 10, '0', 'T')
-- Create the Reference Species Group table create table FIA.REF_SPECIES_GROUP( SPGRPCD numeric(2,0), NAME varchar(40), REGION varchar(8), CLASS varchar(8), CREATED_BY varchar(30), CREATED_DATE date, CREATED_IN_INSTANCE varchar(6), MODIFIED_BY varchar(30), MODIFIED_DATE date, MODIFIED_IN_INSTANCE varchar(6), PRIMARY KEY(SPGRPCD) );
{% macro get_schemas_used(schema_name) %} {% set schemas = [ schema_name, schema_name + '_re', schema_name + '_re_internal', schema_name + '_sources', schema_name + '_dbt_test__audit' ] %} {{ return (schemas) }} {% endmacro %} {% macro drop_all_schemas(schema_name) %} {% set schemas_to_drop = get_schemas_used(schema_name) %} {{ adapter.dispatch('drop_all_schemas')(schemas_to_drop) }} {% endmacro %} {% macro default__drop_all_schemas(schemas_to_drop) %} {% for schema in schemas_to_drop %} {% set relation = api.Relation.create(database=target.database, schema=schema) %} {% do adapter.drop_schema(relation) %} {% endfor %} {% endmacro %} {% macro redshift__drop_all_schemas(schemas_to_drop) %} {# dropping schemas with adapter.drop_schema doesn't seem to work with redshift so we default to issuing DDL commands to redshift #} {% set drop_query %} {% for schema in schemas_to_drop %} drop schema if exists {{schema}} cascade; {% endfor %} {% endset %} {% do run_query(drop_query) %} {% endmacro %} {% macro create_required_schemas(schema_name) %} {# required to manually create schemas used for redshift tests #} {% set schemas_to_drop = get_schemas_used(schema_name) %} {% set create_query %} {% for schema in schemas_to_drop %} create schema if not exists {{schema}}; {% endfor %} {% endset %} {% do run_query(create_query) %} {% endmacro %}
CREATE TABLE notes ( id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, noteType TEXT NOT NULL, contents TEXT NOT NULL, user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL, folder_id INTEGER REFERENCES traits(id) ON DELETE CASCADE NOT NULL );
-- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Mer 29 Juin 2016 à 13:36 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.3.13 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données: `railonline` -- -- -------------------------------------------------------- -- -- Structure de la table `accueil_annonce` -- CREATE TABLE IF NOT EXISTS `accueil_annonce` ( `id_acan` int(11) NOT NULL AUTO_INCREMENT, `lib_acan` varchar(600) NOT NULL, `actif` varchar(1) NOT NULL, PRIMARY KEY (`id_acan`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ; -- -------------------------------------------------------- -- -- Structure de la table `action_bourse` -- CREATE TABLE IF NOT EXISTS `action_bourse` ( `id_joueur` int(11) NOT NULL, `cours_action` int(11) NOT NULL, PRIMARY KEY (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `agence_pub` -- CREATE TABLE IF NOT EXISTS `agence_pub` ( `id_agence` int(11) NOT NULL AUTO_INCREMENT, `nom_agence` varchar(30) NOT NULL, `notoriete` int(11) NOT NULL, `honoraire` int(11) NOT NULL, PRIMARY KEY (`id_agence`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -------------------------------------------------------- -- -- Structure de la table `aide` -- CREATE TABLE IF NOT EXISTS `aide` ( `id_aide` int(11) NOT NULL AUTO_INCREMENT, `num_ordre` int(11) NOT NULL, `nom_page` varchar(30) NOT NULL, `titre` varchar(50) NOT NULL, `texte` longtext NOT NULL, PRIMARY KEY (`id_aide`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ; -- -------------------------------------------------------- -- -- Structure de la table `alliance` -- CREATE TABLE IF NOT EXISTS `alliance` ( `id_alliance` int(11) NOT NULL AUTO_INCREMENT, `id_fondateur` int(11) NOT NULL, `nom_alliance` varchar(50) NOT NULL, `url_alliance` varchar(150) DEFAULT NULL, `url_forum` varchar(100) NOT NULL, `objectif_alliance` varchar(300) DEFAULT NULL, `recrutement` varchar(1) NOT NULL, PRIMARY KEY (`id_alliance`), UNIQUE KEY `id_fondateur` (`id_fondateur`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=96 ; -- -------------------------------------------------------- -- -- Structure de la table `appel_offre` -- CREATE TABLE IF NOT EXISTS `appel_offre` ( `id_ao` int(11) NOT NULL AUTO_INCREMENT, `titre` varchar(50) NOT NULL, `libelle_ao` mediumtext NOT NULL, `date_limite_reponse` date NOT NULL, `date_prestation` date NOT NULL, `heure_arr` int(11) NOT NULL, `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `nbre_C1` int(11) NOT NULL, `nbre_C2` int(11) NOT NULL, `montant_penalite` float(10,5) NOT NULL, `nom_img` varchar(30) NOT NULL, `termine` varchar(1) NOT NULL, `non_avenu` varchar(1) NOT NULL, PRIMARY KEY (`id_ao`), UNIQUE KEY `id_ao` (`id_ao`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=949 ; -- -------------------------------------------------------- -- -- Structure de la table `appel_offre_reponse` -- CREATE TABLE IF NOT EXISTS `appel_offre_reponse` ( `id_ao_reponse` int(11) NOT NULL AUTO_INCREMENT, `id_ao` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `nbre_C1` int(11) NOT NULL, `nbre_C2` int(11) NOT NULL, `prix_C1` int(11) NOT NULL, `prix_C2` int(11) NOT NULL, `id_train` int(11) NOT NULL, `choisi` varchar(1) NOT NULL, PRIMARY KEY (`id_ao_reponse`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=54 ; -- -------------------------------------------------------- -- -- Structure de la table `augmentation_capital` -- CREATE TABLE IF NOT EXISTS `augmentation_capital` ( `id_augment_kal` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `nbre_part` int(11) NOT NULL, `date_demande` date NOT NULL, PRIMARY KEY (`id_augment_kal`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=136 ; -- -------------------------------------------------------- -- -- Structure de la table `avirer` -- CREATE TABLE IF NOT EXISTS `avirer` ( `id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `a_rembourser` -- CREATE TABLE IF NOT EXISTS `a_rembourser` ( `id_aremb` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `date` date NOT NULL, `heure` time NOT NULL, `tot_penalite` int(11) NOT NULL, PRIMARY KEY (`id_aremb`), KEY `id_joueur` (`id_joueur`), KEY `date` (`date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `cal_jour` -- CREATE TABLE IF NOT EXISTS `cal_jour` ( `id_cal_jour` int(11) NOT NULL AUTO_INCREMENT, `heure` int(11) NOT NULL, `coeff_affluence` int(11) NOT NULL, PRIMARY KEY (`id_cal_jour`), KEY `heure` (`heure`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ; -- -------------------------------------------------------- -- -- Structure de la table `categ_infra` -- CREATE TABLE IF NOT EXISTS `categ_infra` ( `id_categ_infra` int(11) NOT NULL AUTO_INCREMENT, `nom_categ` varchar(100) NOT NULL, `type` varchar(2) NOT NULL DEFAULT 'C' COMMENT 'Central ou Local ', `description` longtext NOT NULL, `coeff` int(11) NOT NULL, `nom_photo` varchar(50) NOT NULL, `prix_init` int(11) NOT NULL, `loyer_init` int(11) NOT NULL, `num_ordre` int(11) NOT NULL, `id_type_march` int(11) DEFAULT NULL, `cout_unitaire_niv1` int(11) DEFAULT NULL, `nbre_unite_niv1` int(11) DEFAULT NULL, `duree_iteration_fab_avirer` int(11) DEFAULT NULL, PRIMARY KEY (`id_categ_infra`), KEY `type` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1038 ; -- -------------------------------------------------------- -- -- Structure de la table `concession` -- CREATE TABLE IF NOT EXISTS `concession` ( `id_concession` int(11) NOT NULL AUTO_INCREMENT, `nom_concession` varchar(25) NOT NULL, `id_ville` int(11) NOT NULL, `date_creation` date NOT NULL, PRIMARY KEY (`id_concession`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=204 ; -- -------------------------------------------------------- -- -- Structure de la table `concession_commande` -- CREATE TABLE IF NOT EXISTS `concession_commande` ( `id_cc` int(11) NOT NULL AUTO_INCREMENT, `id_concession` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `id_type_mat` int(11) NOT NULL, `id_ville_livraison` int(11) NOT NULL, `date_livraison` datetime NOT NULL, PRIMARY KEY (`id_cc`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5964 ; -- -------------------------------------------------------- -- -- Structure de la table `concession_offre` -- CREATE TABLE IF NOT EXISTS `concession_offre` ( `id_concession` int(11) NOT NULL, `id_type_mat` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `conjoncture_pays` -- CREATE TABLE IF NOT EXISTS `conjoncture_pays` ( `date_indic` date NOT NULL, `id_pays` int(11) NOT NULL, `indic_eco` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `conjoncture_pays_jalon` -- CREATE TABLE IF NOT EXISTS `conjoncture_pays_jalon` ( `date_jalon` date NOT NULL, `id_pays` int(11) NOT NULL, `indic_jalon` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `contrat_train_pub` -- CREATE TABLE IF NOT EXISTS `contrat_train_pub` ( `id_contrat` int(11) NOT NULL AUTO_INCREMENT, `id_train` int(11) NOT NULL, `id_agence` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `slogan` text NOT NULL, `id_banniere` int(11) NOT NULL, `date_fin` date NOT NULL, PRIMARY KEY (`id_contrat`), KEY `id_joueur` (`id_joueur`), KEY `date_fin` (`date_fin`), KEY `id_agence` (`id_agence`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6299 ; -- -------------------------------------------------------- -- -- Structure de la table `emprunt` -- CREATE TABLE IF NOT EXISTS `emprunt` ( `id_emprunt` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `montant` int(11) NOT NULL, `taux` int(11) NOT NULL, PRIMARY KEY (`id_emprunt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `enchere` -- CREATE TABLE IF NOT EXISTS `enchere` ( `id_enchere` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_objet` int(11) NOT NULL, `id` int(11) NOT NULL, `texte_enchere` varchar(500) NOT NULL, `date_debut_enchere` datetime NOT NULL, `date_fin_enchere` datetime NOT NULL, `prix_depart` bigint(20) NOT NULL, `prix_actuel` bigint(20) DEFAULT NULL, `id_meilleur_encherisseur` int(11) DEFAULT NULL, PRIMARY KEY (`id_enchere`), KEY `id_joueur` (`id_joueur`), KEY `id` (`id`), KEY `date_fin_enchere` (`date_fin_enchere`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=515360 ; -- -------------------------------------------------------- -- -- Structure de la table `enchere_old` -- CREATE TABLE IF NOT EXISTS `enchere_old` ( `id_enchere` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_objet` int(11) NOT NULL, `id` int(11) NOT NULL, `texte_enchere` varchar(500) NOT NULL, `date_debut_enchere` datetime NOT NULL, `date_fin_enchere` datetime NOT NULL, `prix_depart` bigint(20) NOT NULL, `prix_actuel` bigint(20) DEFAULT NULL, `id_meilleur_encherisseur` int(11) DEFAULT NULL, PRIMARY KEY (`id_enchere`), KEY `id_joueur` (`id_joueur`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=513121 ; -- -------------------------------------------------------- -- -- Structure de la table `encherisseur` -- CREATE TABLE IF NOT EXISTS `encherisseur` ( `id_enchere` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `date_enchere` datetime NOT NULL, `prix_max` bigint(20) NOT NULL, `id_ville_livraison` int(11) DEFAULT NULL, KEY `id_enchere` (`id_enchere`), KEY `date_enchere` (`date_enchere`), KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `etat_moteur` -- CREATE TABLE IF NOT EXISTS `etat_moteur` ( `actif` varchar(1) NOT NULL, `dern_MAJ` datetime NOT NULL, KEY `actif` (`actif`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `expedition` -- CREATE TABLE IF NOT EXISTS `expedition` ( `id_expe` int(11) NOT NULL AUTO_INCREMENT, `id_march` int(11) NOT NULL, `id_train` int(11) NOT NULL, `id_ville_dest` int(11) NOT NULL, `date_demande` datetime NOT NULL, PRIMARY KEY (`id_expe`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `financier` -- CREATE TABLE IF NOT EXISTS `financier` ( `id_joueur` int(11) NOT NULL, `tresorerie` bigint(11) NOT NULL, PRIMARY KEY (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `greve` -- CREATE TABLE IF NOT EXISTS `greve` ( `id_greve` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `date_fin` date NOT NULL, `coeff_perturb` int(11) NOT NULL, PRIMARY KEY (`id_greve`), KEY `id_joueur` (`id_joueur`), KEY `date_fin` (`date_fin`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `historique` -- CREATE TABLE IF NOT EXISTS `historique` ( `id_historique` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_evenement` int(11) NOT NULL, `evenement` varchar(150) NOT NULL, `date` date NOT NULL, `heure` time NOT NULL, `montant` int(11) NOT NULL, `id_train` int(8) NOT NULL, PRIMARY KEY (`id_historique`), KEY `id_joueur` (`id_joueur`), KEY `type_evenement` (`type_evenement`), KEY `date` (`date`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1071168945 ; -- -------------------------------------------------------- -- -- Structure de la table `historique_joueur` -- CREATE TABLE IF NOT EXISTS `historique_joueur` ( `id_historique` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `date_histo` date NOT NULL, `charges` int(11) NOT NULL, `recettes` int(11) NOT NULL, `voy_C1` int(11) NOT NULL, `voy_C2` int(11) NOT NULL, `nbre_rame` int(11) NOT NULL, `dividendes` int(11) NOT NULL, `actif` varchar(1) NOT NULL, PRIMARY KEY (`id_historique`), KEY `id_joueur` (`id_joueur`), KEY `id_historique` (`id_historique`,`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=197103 ; -- -------------------------------------------------------- -- -- Structure de la table `histo_temp` -- CREATE TABLE IF NOT EXISTS `histo_temp` ( `id_histo_temp` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_evenement` int(11) NOT NULL, `evenement` varchar(150) NOT NULL, `montant` int(11) NOT NULL, `id_train` int(8) NOT NULL, PRIMARY KEY (`id_histo_temp`), KEY `id_joueur` (`id_joueur`), KEY `type_evenement` (`type_evenement`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `infra` -- CREATE TABLE IF NOT EXISTS `infra` ( `id_infra` int(11) NOT NULL AUTO_INCREMENT, `id_categ_infra` int(11) NOT NULL, `id_ville` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `taille` int(11) NOT NULL, `niveau` int(11) NOT NULL, `date_fin` datetime NOT NULL, `operation` varchar(1) NOT NULL, `prix` int(11) NOT NULL, `autor_autre_joueur` varchar(1) NOT NULL, `prix_revision` int(11) NOT NULL, `prix_vente_ress` int(11) DEFAULT NULL, `id_type_march` int(11) DEFAULT NULL, `id_type_mat` int(11) DEFAULT NULL, `date_dern_fab` datetime DEFAULT NULL, `qualite` int(11) NOT NULL, `delai` int(11) NOT NULL, `techno` int(11) NOT NULL, `ecologie` int(11) NOT NULL, `lib_commercial` varchar(50) NOT NULL, PRIMARY KEY (`id_infra`), KEY `id_joueur` (`id_joueur`), KEY `id_ville` (`id_ville`), KEY `id_categ_infra` (`id_categ_infra`), KEY `date_fin` (`date_fin`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=242230 ; -- -------------------------------------------------------- -- -- Structure de la table `infra_rh` -- CREATE TABLE IF NOT EXISTS `infra_rh` ( `id_infra` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `id_sal` int(11) NOT NULL, KEY `id_infra` (`id_infra`), KEY `id_joueur` (`id_joueur`), KEY `id_sal` (`id_sal`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `infra_techno` -- CREATE TABLE IF NOT EXISTS `infra_techno` ( `id_categ_infra` int(11) NOT NULL, `id_categ_infra_prq` int(11) NOT NULL, `niveau_prerequis` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `inventaire` -- CREATE TABLE IF NOT EXISTS `inventaire` ( `id_joueur` int(11) NOT NULL, `id_rame` int(11) NOT NULL, `nom_inventaire` varchar(25) NOT NULL, `date_achat` date NOT NULL, PRIMARY KEY (`id_rame`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `joueur` -- CREATE TABLE IF NOT EXISTS `joueur` ( `id_joueur` int(11) NOT NULL AUTO_INCREMENT, `pseudo` varchar(16) NOT NULL, `password` varchar(16) NOT NULL, `nationalite` varchar(3) NOT NULL, `id_pays` int(11) NOT NULL, `date_inscript` date NOT NULL, `email` varchar(50) NOT NULL, `nom_compagnie` varchar(40) NOT NULL, `id_ville_implantation` int(11) NOT NULL, `id_alliance` int(11) DEFAULT NULL, `statut` varchar(1) DEFAULT NULL COMMENT 'C)andidature M)embre', `date_candidature` datetime DEFAULT NULL, `motivation` varchar(100) DEFAULT NULL, `date_adhesion_alliance` datetime DEFAULT NULL, `rollard` int(11) NOT NULL, `popularite` int(11) NOT NULL, `niveau_siege` int(11) NOT NULL, `total_C1` bigint(20) NOT NULL, `total_C2` bigint(20) NOT NULL, `total_fret` bigint(20) NOT NULL, `total_charge` int(11) NOT NULL, `total_recette` int(11) NOT NULL, `admin` varchar(1) NOT NULL, `pilori` varchar(1) DEFAULT NULL, `date_pilori` datetime DEFAULT NULL, `raison_exclusion` varchar(75) DEFAULT NULL, `dern_date_connexion` date NOT NULL, `dern_heure_connexion` time NOT NULL, `msg_nouv_conc` varchar(1) NOT NULL, `msg_faillite` varchar(1) NOT NULL, `msg_dem` varchar(1) NOT NULL, `log_nouv_conc` varchar(1) NOT NULL, `log_faillite` varchar(1) NOT NULL, `log_dem` varchar(1) NOT NULL, `interface` varchar(50) NOT NULL, `info_bulle` tinyint(1) NOT NULL, PRIMARY KEY (`id_joueur`), KEY `total_C1` (`total_C1`), KEY `total_C2` (`total_C2`), KEY `popularite` (`popularite`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1 AUTO_INCREMENT=22418 ; -- -------------------------------------------------------- -- -- Structure de la table `langue` -- CREATE TABLE IF NOT EXISTS `langue` ( `id_langue` int(11) NOT NULL AUTO_INCREMENT, `code_langue` varchar(3) NOT NULL, `lib_langue` varchar(40) NOT NULL, PRIMARY KEY (`id_langue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -------------------------------------------------------- -- -- Structure de la table `liste_ip` -- CREATE TABLE IF NOT EXISTS `liste_ip` ( `id_joueur` int(19) NOT NULL, `num_ip` varchar(20) NOT NULL, `date_log` datetime NOT NULL, KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `liste_prenom` -- CREATE TABLE IF NOT EXISTS `liste_prenom` ( `id_prenom` int(11) NOT NULL AUTO_INCREMENT, `prenom` varchar(20) NOT NULL, `sexe` varchar(1) NOT NULL, PRIMARY KEY (`id_prenom`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=230 ; -- -------------------------------------------------------- -- -- Structure de la table `liste_rame` -- CREATE TABLE IF NOT EXISTS `liste_rame` ( `id_rame` int(11) NOT NULL AUTO_INCREMENT, `id_modele` int(11) NOT NULL, `km_parcouru` int(11) NOT NULL, `coeff_vetuste` int(11) NOT NULL, `annee_fab` int(4) NOT NULL, `id_ville_emplacement` int(11) NOT NULL, `date_fin_revision` date NOT NULL, `id_wagon` int(11) NOT NULL, PRIMARY KEY (`id_rame`), KEY `id_modele` (`id_modele`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2672 ; -- -------------------------------------------------------- -- -- Structure de la table `log` -- CREATE TABLE IF NOT EXISTS `log` ( `id_log` int(11) NOT NULL AUTO_INCREMENT, `date_log` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `id_script` int(11) NOT NULL, `texte` varchar(2000) NOT NULL, PRIMARY KEY (`id_log`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=58 ; -- -------------------------------------------------------- -- -- Structure de la table `marchandise` -- CREATE TABLE IF NOT EXISTS `marchandise` ( `id_march` int(11) NOT NULL AUTO_INCREMENT, `id_fabriquant` int(11) DEFAULT NULL, `lib_commercial` varchar(50) NOT NULL, `id_joueur` int(11) NOT NULL, `id_type_march` int(11) NOT NULL, `coeff_qual` int(11) NOT NULL, `qte` decimal(15,5) NOT NULL, `id_ville` int(11) DEFAULT NULL, `id_infra` int(11) DEFAULT NULL, `px_vte` int(11) DEFAULT NULL, `id_train` int(11) DEFAULT NULL, PRIMARY KEY (`id_march`), KEY `id_type_march` (`id_type_march`), KEY `id_ville` (`id_ville`), KEY `id_infra` (`id_infra`), KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5930067 ; -- -------------------------------------------------------- -- -- Structure de la table `marchandise_fab` -- CREATE TABLE IF NOT EXISTS `marchandise_fab` ( `id_type_march_fab` int(11) NOT NULL, `qte_march_fab` decimal(10,0) NOT NULL, `id_type_march_besoin` int(11) NOT NULL, `qte_march_besoin` int(10) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `marchandise_type` -- CREATE TABLE IF NOT EXISTS `marchandise_type` ( `id_type_march` int(11) NOT NULL AUTO_INCREMENT, `lib_march` varchar(50) NOT NULL, `id_unite` int(11) NOT NULL, `nom_photo` varchar(50) NOT NULL, `categ_march` varchar(2) NOT NULL COMMENT 'MP, PI, PF', `type_stockage` varchar(2) NOT NULL COMMENT 'POutre COuvert SIlo TRemie MEssagerie SAble MInerai CiterneP CiterneH CiterneL VErre BAches MetauxP', `prix_max` float(10,5) NOT NULL, `encombrement` int(11) NOT NULL COMMENT '100 pour wagon, 1000 pour rame, 10 pour moteur...', `id_categ_infra` int(11) NOT NULL, `qte_niv1` int(11) NOT NULL, `periodicite_prod_niv1` int(11) NOT NULL, `flag_id_type_mat` tinyint(1) NOT NULL, PRIMARY KEY (`id_type_march`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ; -- -------------------------------------------------------- -- -- Structure de la table `materiel` -- CREATE TABLE IF NOT EXISTS `materiel` ( `id_mat` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `id_type_mat` int(11) NOT NULL, `id_ville_emplacement` int(11) NOT NULL, `coeff_vetuste` int(11) NOT NULL, `fiab_mat` int(11) NOT NULL, `km_parcouru` int(11) NOT NULL, `id_rame` int(11) DEFAULT NULL, `km_mensuel` int(11) NOT NULL, `date_achat` datetime NOT NULL, `id_infra` int(11) DEFAULT NULL, `date_fin_revision` datetime DEFAULT NULL, `trace` float DEFAULT NULL, `fiabilite` int(11) NOT NULL, PRIMARY KEY (`id_mat`), KEY `id_type_mat` (`id_type_mat`), KEY `id_infra` (`id_infra`), KEY `id_joueur` (`id_joueur`), KEY `id_rame` (`id_rame`), KEY `id_ville_emplacement` (`id_ville_emplacement`), KEY `date_fin_revision` (`date_fin_revision`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=485790 ; -- -------------------------------------------------------- -- -- Structure de la table `materiel_location` -- CREATE TABLE IF NOT EXISTS `materiel_location` ( `id_mat` int(11) NOT NULL, `id_proprietaire` int(11) NOT NULL, `id_locataire` int(11) DEFAULT NULL, `prix_jour` int(11) NOT NULL, `date_fin` datetime DEFAULT NULL, `date_annonce` datetime NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `materiel_type` -- CREATE TABLE IF NOT EXISTS `materiel_type` ( `id_type_mat` int(11) NOT NULL AUTO_INCREMENT, `categ` varchar(2) NOT NULL, `nom_type` varchar(50) NOT NULL, `id_pays_orig` int(11) NOT NULL, `nom_photo` varchar(40) NOT NULL, `vmax` int(11) NOT NULL, `duree_vie` int(11) NOT NULL, `capacite_C1` int(11) NOT NULL, `capacite_C2` int(11) NOT NULL, `capacite_fret` int(11) DEFAULT NULL, `prix_neuf` int(11) DEFAULT NULL, `id_unite_stockage_fret` int(11) DEFAULT NULL, `type_stockage` varchar(2) NOT NULL COMMENT 'POutre COuvert SIlo TRemie MEssagerie SAble MInerai CiterneP CiterneH CiterneL VErre BAches MetauxP', `niveau_techn` int(11) NOT NULL, `coeff_confort` int(11) NOT NULL, `cout_km` double NOT NULL, `annee_deb_fab` int(11) NOT NULL, `annee_fin_fab` int(11) NOT NULL, `puissance` int(11) NOT NULL, `commentaire` varchar(200) NOT NULL, `capacite_traction` int(11) NOT NULL, `fiabilite` int(11) NOT NULL, `actif` varchar(1) NOT NULL, `type_materiel` varchar(5) NOT NULL, `nb_UM` varchar(1) NOT NULL, `type_UM` varchar(5) NOT NULL, `ponderation` int(1) NOT NULL COMMENT '1= Z100 - TGV, 2= AUTOM - VB2N - RRR, 3= Locomotives, 4= Premiere Classe, 5= XR, 6= XU (Autor), 7= Voitures 2nde, 8= Wagons', `cumul_quot` int(11) NOT NULL, `cumul_hebdo` int(11) NOT NULL, `cumul_mensuel` int(11) NOT NULL, `fabrik` char(1) NOT NULL, PRIMARY KEY (`id_type_mat`), KEY `categ` (`categ`), KEY `actif` (`actif`), KEY `type_UM` (`type_UM`), KEY `ponderation` (`ponderation`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=508 ; -- -------------------------------------------------------- -- -- Structure de la table `message` -- CREATE TABLE IF NOT EXISTS `message` ( `id_message` int(11) NOT NULL AUTO_INCREMENT, `id_joueur_orig` int(11) NOT NULL, `id_joueur_dest` int(11) NOT NULL, `objet` varchar(100) NOT NULL, `texte` varchar(600) NOT NULL, `date_msg` date NOT NULL, `heure_msg` time NOT NULL, PRIMARY KEY (`id_message`), KEY `id_joueur_dest` (`id_joueur_dest`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1498034 ; -- -------------------------------------------------------- -- -- Structure de la table `modele_rame` -- CREATE TABLE IF NOT EXISTS `modele_rame` ( `id_modele` int(11) NOT NULL AUTO_INCREMENT, `nom_rame` varchar(40) NOT NULL, `prix` int(8) NOT NULL, `vmax` int(3) NOT NULL, `duree_vie` int(11) NOT NULL, `nbre_C1` int(11) NOT NULL, `nbre_C2` int(11) NOT NULL, `niveau_techn` int(11) NOT NULL, `coeff_confort` int(11) NOT NULL, `cout_km` int(11) NOT NULL, `annee_deb_fab` varchar(4) NOT NULL, `annee_fin_fab` varchar(4) NOT NULL, `puissance` int(11) NOT NULL, `commentaire` longtext NOT NULL, `techno_propulsion` varchar(40) NOT NULL, `nom_photo` varchar(25) NOT NULL, `rame_complete` varchar(1) NOT NULL, `actif` varchar(1) NOT NULL, PRIMARY KEY (`id_modele`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=119 ; -- -------------------------------------------------------- -- -- Structure de la table `ordre_action` -- CREATE TABLE IF NOT EXISTS `ordre_action` ( `id_ordre` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `id_compagnie_action` int(11) NOT NULL, `nbre_action` int(11) NOT NULL, `prix_vente` int(11) NOT NULL, `sens` varchar(1) NOT NULL, PRIMARY KEY (`id_ordre`), KEY `id_joueur` (`id_joueur`), KEY `id_compagnie_action` (`id_compagnie_action`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1412377 ; -- -------------------------------------------------------- -- -- Structure de la table `parametres` -- CREATE TABLE IF NOT EXISTS `parametres` ( `id_param` int(11) NOT NULL, `nom_param` varchar(50) NOT NULL, `val_param` int(11) NOT NULL, `id_categ_infra_prq` int(11) NOT NULL, `niveau_prq` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `pays` -- CREATE TABLE IF NOT EXISTS `pays` ( `id_pays` int(11) NOT NULL AUTO_INCREMENT, `code_pays` varchar(3) NOT NULL, `nom_pays` varchar(40) NOT NULL, PRIMARY KEY (`id_pays`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ; -- -------------------------------------------------------- -- -- Structure de la table `politique` -- CREATE TABLE IF NOT EXISTS `politique` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_pays` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `type` char(1) NOT NULL DEFAULT 'M', PRIMARY KEY (`id`), KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='type D pour député et M pour ministre' AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `politique_candidats` -- CREATE TABLE IF NOT EXISTS `politique_candidats` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `slogan` varchar(50) NOT NULL, `campagne` text NOT NULL, `type` char(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -------------------------------------------------------- -- -- Structure de la table `politique_votes` -- CREATE TABLE IF NOT EXISTS `politique_votes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_pays` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `pour` int(11) NOT NULL, `type` char(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='type D pour député et M pour ministre' AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Structure de la table `portefeuille` -- CREATE TABLE IF NOT EXISTS `portefeuille` ( `id_joueur` int(11) NOT NULL, `id_compagnie_action` int(11) NOT NULL, `nbre_action` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `rame` -- CREATE TABLE IF NOT EXISTS `rame` ( `id_rame` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_rame` varchar(1) NOT NULL COMMENT 'V)oyageur F)ret', `capacite_C1` int(11) NOT NULL, `capacite_C2` int(11) NOT NULL, `vmax` int(11) NOT NULL, `coeff_confort` int(11) NOT NULL, `nom_rame` varchar(60) NOT NULL, `id_ville_emplacement` int(11) NOT NULL, `cout_km` double NOT NULL, `coeff_vetuste` int(11) NOT NULL, `date_creation` datetime NOT NULL, `valide` varchar(1) NOT NULL, PRIMARY KEY (`id_rame`,`id_joueur`,`id_ville_emplacement`), KEY `capacite_C1` (`capacite_C1`), KEY `capacite_C2` (`capacite_C2`), KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=117958 ; -- -------------------------------------------------------- -- -- Structure de la table `rame_activite_mensuelle` -- CREATE TABLE IF NOT EXISTS `rame_activite_mensuelle` ( `id_activite` int(11) NOT NULL AUTO_INCREMENT, `id_rame` int(11) NOT NULL, `nbre_km` int(11) NOT NULL, `nbre_visite` int(11) NOT NULL, PRIMARY KEY (`id_activite`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21880490 ; -- -------------------------------------------------------- -- -- Structure de la table `recette_train` -- CREATE TABLE IF NOT EXISTS `recette_train` ( `id_train` int(11) NOT NULL, `id_rame` int(11) NOT NULL, `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `nbre_voy_c1` int(11) NOT NULL, `nbre_voy_c2` int(11) NOT NULL, `prix_c1` int(11) NOT NULL, `prix_c2` int(11) NOT NULL, `recette` int(11) NOT NULL, `date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `rentab_train` -- CREATE TABLE IF NOT EXISTS `rentab_train` ( `id_rentab` int(11) NOT NULL AUTO_INCREMENT, `id_train` int(11) NOT NULL, `id_rame` int(11) NOT NULL, `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `nbre_voy_c1` int(11) NOT NULL, `nbre_voy_c2` int(11) NOT NULL, `prix_c1` int(11) NOT NULL, `prix_c2` int(11) NOT NULL, `recette` int(11) NOT NULL, `charge` int(11) NOT NULL, `date` date NOT NULL, `heure` time NOT NULL, PRIMARY KEY (`id_rentab`), KEY `id_train` (`id_train`), KEY `id_rame` (`id_rame`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=25139547 ; -- -------------------------------------------------------- -- -- Structure de la table `ressource` -- CREATE TABLE IF NOT EXISTS `ressource` ( `id_ress` int(11) NOT NULL AUTO_INCREMENT, `lib_ress` varchar(50) NOT NULL, `nom_photo` varchar(40) NOT NULL, PRIMARY KEY (`id_ress`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=27 ; -- -------------------------------------------------------- -- -- Structure de la table `revision` -- CREATE TABLE IF NOT EXISTS `revision` ( `id_revision` int(11) NOT NULL AUTO_INCREMENT, `id_depot` int(11) NOT NULL, `id_rame` int(11) NOT NULL, `date_fin_revision` date NOT NULL, PRIMARY KEY (`id_revision`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `salarie` -- CREATE TABLE IF NOT EXISTS `salarie` ( `id_sal` int(11) NOT NULL AUTO_INCREMENT, `id_profil` int(11) NOT NULL, `id_compagnie` int(11) DEFAULT '0', `id_infra` int(11) DEFAULT NULL, `nom` varchar(25) NOT NULL, `prenom` varchar(25) NOT NULL, `age` int(11) NOT NULL, `sexe` varchar(1) NOT NULL, `salaire` int(11) NOT NULL, `niveau` int(11) NOT NULL, `etat_esprit` int(11) NOT NULL, `niv_conduite` int(11) NOT NULL, `niv_controle` int(11) NOT NULL, `niv_informatique` int(11) NOT NULL, `niv_admin` int(11) NOT NULL, `niv_vente` int(11) NOT NULL, `niv_mecanique` int(11) NOT NULL, `niv_trafic` int(11) NOT NULL, `niv_rh` int(11) NOT NULL, `niv_marketting` int(11) NOT NULL, `honnetete` int(11) NOT NULL, `politique` int(11) NOT NULL, `num_img` varchar(20) NOT NULL, PRIMARY KEY (`id_sal`), KEY `id_compagnie` (`id_compagnie`), KEY `etat_esprit` (`etat_esprit`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=370304 ; -- -------------------------------------------------------- -- -- Structure de la table `semaphore_moteur` -- CREATE TABLE IF NOT EXISTS `semaphore_moteur` ( `dernier_lancement` datetime NOT NULL, `type` varchar(20) NOT NULL, `actif` varchar(1) NOT NULL, `suspendu` varchar(1) NOT NULL, KEY `dernier_lancement` (`dernier_lancement`), KEY `type` (`type`), KEY `actif` (`actif`), KEY `suspendu` (`suspendu`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Structure de la table `session` -- CREATE TABLE IF NOT EXISTS `session` ( `id_session` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `date_session` datetime NOT NULL, `heure_session` time NOT NULL, `page` varchar(50) NOT NULL, PRIMARY KEY (`id_session`), KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=19749017 ; -- -------------------------------------------------------- -- -- Structure de la table `sillon` -- CREATE TABLE IF NOT EXISTS `sillon` ( `id_sillon` int(11) NOT NULL AUTO_INCREMENT, `id_ville_1` int(20) NOT NULL, `id_ville_2` int(20) NOT NULL, `nbre_km` int(11) NOT NULL, `coeff_vitesse` int(11) NOT NULL, `actif` varchar(1) NOT NULL, `prix_sillon` int(11) NOT NULL, `type_ligne` varchar(1) NOT NULL COMMENT 'C(lassique) L(gv) M(ixte LGV/Classique) I(de France) T(er)', `paris_o` varchar(1) DEFAULT NULL, PRIMARY KEY (`id_sillon`), KEY `id_ville_1` (`id_ville_1`), KEY `id_ville_2` (`id_ville_2`), KEY `actif` (`actif`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=381 ; -- -------------------------------------------------------- -- -- Structure de la table `temp_attribution_train_fret` -- CREATE TABLE IF NOT EXISTS `temp_attribution_train_fret` ( `id_train` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `id_ville_conso` int(11) NOT NULL, `id_type_march` int(11) NOT NULL, `qte` decimal(11,2) NOT NULL, `prix_fixe` float NOT NULL, `prix_variable` float NOT NULL, `id_ville_prod` int(11) DEFAULT NULL, `qte_en_cours` float DEFAULT NULL, KEY `id_train` (`id_train`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `temp_capacite_vente_global_joueur` -- CREATE TABLE IF NOT EXISTS `temp_capacite_vente_global_joueur` ( `id_joueur` int(11) NOT NULL, `capacite_vente` int(11) NOT NULL, KEY `id_joueur` (`id_joueur`), KEY `capacite_vente` (`capacite_vente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `temp_capacite_vente_joueur` -- CREATE TABLE IF NOT EXISTS `temp_capacite_vente_joueur` ( `id_joueur` int(11) NOT NULL, `id_ville` int(11) NOT NULL, `capacite_vente` int(11) NOT NULL, PRIMARY KEY (`id_joueur`,`id_ville`), KEY `capacite_vente` (`capacite_vente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `temp_coeff_joueur` -- CREATE TABLE IF NOT EXISTS `temp_coeff_joueur` ( `id_joueur` int(11) NOT NULL, `id_train` int(11) NOT NULL, `id_sillon` int(11) NOT NULL, `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `heure` int(11) NOT NULL, `coeff_prix_C1_1` float NOT NULL, `coeff_prix_C1_2` float NOT NULL, `coeff_prix_C2_1` float NOT NULL, `coeff_prix_C2_2` float NOT NULL, `coeff_temps_1` float NOT NULL, `coeff_temps_2` float NOT NULL, `produit_coeff_C1` int(11) NOT NULL, `produit_coeff_C2` int(11) NOT NULL, `niveau_market` float NOT NULL, PRIMARY KEY (`id_joueur`,`id_train`,`id_ville_dep`,`id_ville_arr`), KEY `coeff_prix_C1_1` (`coeff_prix_C1_1`), KEY `coeff_prix_C1_2` (`coeff_prix_C1_2`), KEY `coeff_prix_C2_1` (`coeff_prix_C2_1`), KEY `coeff_prix_C2_2` (`coeff_prix_C2_2`), KEY `coeff_temps_1` (`coeff_temps_1`), KEY `coeff_temps_2` (`coeff_temps_2`), KEY `produit_coeff_C1` (`produit_coeff_C1`,`produit_coeff_C2`), KEY `id_joueur` (`id_joueur`), KEY `id_train` (`id_train`), KEY `id_ville_dep` (`id_ville_dep`), KEY `id_ville_arr` (`id_ville_arr`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `temp_impot` -- CREATE TABLE IF NOT EXISTS `temp_impot` ( `id_joueur` int(11) NOT NULL, `recette` int(11) NOT NULL, `charge` int(11) NOT NULL, KEY `id_joueur` (`id_joueur`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `temp_repartition_horaire_sillon` -- CREATE TABLE IF NOT EXISTS `temp_repartition_horaire_sillon` ( `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `fini` smallint(6) NOT NULL, `nbre_km` int(11) NOT NULL, `voy_moyen_C1_J1` int(11) NOT NULL, `voy_moyen_C2_J1` int(11) NOT NULL, `voy_moyen_C1_J2` int(11) NOT NULL, `voy_moyen_C2_J2` int(11) NOT NULL, `voy_moyen_C1_J3` int(11) NOT NULL, `voy_moyen_C2_J3` int(11) NOT NULL, `voy_moyen_C1_J4` int(11) NOT NULL, `voy_moyen_C2_J4` int(11) NOT NULL, `voy_moyen_C1_J5` int(11) NOT NULL, `voy_moyen_C2_J5` int(11) NOT NULL, `voy_moyen_C1_J6` int(11) NOT NULL, `voy_moyen_C2_J6` int(11) NOT NULL, `voy_moyen_C1_J7` int(11) NOT NULL, `voy_moyen_C2_J7` int(11) NOT NULL, PRIMARY KEY (`id_ville_dep`,`id_ville_arr`), KEY `fini` (`fini`), KEY `voy_moyen_C1_J1` (`voy_moyen_C1_J1`), KEY `voy_moyen_C2_J1` (`voy_moyen_C2_J1`), KEY `voy_moyen_C1_J2` (`voy_moyen_C1_J2`), KEY `voy_moyen_C2_J2` (`voy_moyen_C2_J2`), KEY `voy_moyen_C1_J3` (`voy_moyen_C1_J3`), KEY `voy_moyen_C2_J3` (`voy_moyen_C2_J3`), KEY `voy_moyen_C1_J4` (`voy_moyen_C1_J4`), KEY `voy_moyen_C2_J4` (`voy_moyen_C2_J4`), KEY `voy_moyen_C1_J5` (`voy_moyen_C1_J5`), KEY `voy_moyen_C2_J5` (`voy_moyen_C2_J5`), KEY `voy_moyen_C1_J6` (`voy_moyen_C1_J6`), KEY `voy_moyen_C2_J6` (`voy_moyen_C2_J6`), KEY `voy_moyen_C1_J7` (`voy_moyen_C1_J7`), KEY `voy_moyen_C2_J7` (`voy_moyen_C2_J7`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `traduction` -- CREATE TABLE IF NOT EXISTS `traduction` ( `id_lib` int(11) NOT NULL AUTO_INCREMENT, `id_pays` int(11) NOT NULL, `code_langue` varchar(3) NOT NULL, `lib_court` varchar(40) NOT NULL, `lib_long` varchar(500) NOT NULL, `commentaire` varchar(200) NOT NULL, PRIMARY KEY (`id_lib`,`lib_court`), KEY `code_langue` (`code_langue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1095 ; -- -------------------------------------------------------- -- -- Structure de la table `train` -- CREATE TABLE IF NOT EXISTS `train` ( `id_train` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `nom_train` varchar(40) NOT NULL, `id_rame` int(11) NOT NULL, `id_sillon` int(11) NOT NULL, `id_ville_dep` int(40) NOT NULL, `id_ville_arr` int(40) NOT NULL, `heure_dep` int(2) NOT NULL, `mn_dep` int(2) NOT NULL, `heure_arr` int(2) NOT NULL, `mn_arr` int(2) NOT NULL, `prix_c1` int(11) NOT NULL DEFAULT '0', `prix_c2` int(11) NOT NULL DEFAULT '0', `prix_fret_fixe` float DEFAULT NULL, `prix_fret_variable` float DEFAULT NULL, `prix_fret_km` float DEFAULT NULL, `date_traitement` date NOT NULL, `duree_theorique` int(11) NOT NULL, `proch_heure_arr` datetime DEFAULT NULL, `C1_jour1` int(11) NOT NULL COMMENT 'dimanche', `C2_jour1` int(11) NOT NULL, `C1_CA_J1` int(11) NOT NULL, `C2_CA_J1` int(11) NOT NULL, `C1_jour2` int(11) NOT NULL COMMENT 'lundi', `C2_jour2` int(11) NOT NULL, `C1_CA_J2` int(11) NOT NULL, `C2_CA_J2` int(11) NOT NULL, `C1_jour3` int(11) NOT NULL COMMENT 'mardi', `C2_jour3` int(11) NOT NULL, `C1_CA_J3` int(11) NOT NULL, `C2_CA_J3` int(11) NOT NULL, `C1_jour4` int(11) NOT NULL COMMENT 'mercredi', `C2_jour4` int(11) NOT NULL, `C1_CA_J4` int(11) NOT NULL, `C2_CA_J4` int(11) NOT NULL, `C1_jour5` int(11) NOT NULL COMMENT 'jeudi', `C2_jour5` int(11) NOT NULL, `C1_CA_J5` int(11) NOT NULL, `C2_CA_J5` int(11) NOT NULL, `C1_jour6` int(11) NOT NULL COMMENT 'vendredi', `C2_jour6` int(11) NOT NULL, `C1_CA_J6` int(11) NOT NULL, `C2_CA_J6` int(11) NOT NULL, `C1_jour7` int(11) NOT NULL COMMENT 'samedi', `C2_jour7` int(11) NOT NULL, `C1_CA_J7` int(11) NOT NULL, `C2_CA_J7` int(11) NOT NULL, `taux_remp_C1` int(11) NOT NULL, `taux_remp_C2` int(11) NOT NULL, `benef` int(11) NOT NULL, PRIMARY KEY (`id_train`), KEY `id_ville_dep` (`id_ville_dep`), KEY `id_ville_arr` (`id_ville_arr`), KEY `id_joueur` (`id_joueur`), KEY `id_rame` (`id_rame`), KEY `heure_dep` (`heure_dep`), KEY `heure_arr` (`heure_arr`), KEY `mn_dep` (`mn_dep`), KEY `mn_arr` (`mn_arr`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=402864 ; -- -------------------------------------------------------- -- -- Structure de la table `train_temp` -- CREATE TABLE IF NOT EXISTS `train_temp` ( `id_train` int(11) NOT NULL, `heure1` time NOT NULL, `heure2` time NOT NULL, `date_1` datetime NOT NULL, `date_2` varchar(25) NOT NULL, `id_agent_conduite` int(11) NOT NULL, `id_controleur` int(11) DEFAULT NULL, `nbre_voy_C1` int(11) DEFAULT NULL, `nbre_voy_C2` int(11) DEFAULT NULL, `type` varchar(1) NOT NULL COMMENT 'F)ret V)oyageurs', PRIMARY KEY (`id_train`), KEY `id_agent_conduite` (`id_agent_conduite`), KEY `id_controleur` (`id_controleur`), KEY `heure1` (`heure1`), KEY `heure2` (`heure2`), KEY `nbre_voy_C1` (`nbre_voy_C1`), KEY `nbre_voy_C2` (`nbre_voy_C2`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `train_temp_port` -- CREATE TABLE IF NOT EXISTS `train_temp_port` ( `id_train` int(11) NOT NULL, `type_stockage` varchar(2) NOT NULL, `capacite_dispo` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `train_troncon` -- CREATE TABLE IF NOT EXISTS `train_troncon` ( `id_tt` int(11) NOT NULL AUTO_INCREMENT, `id_train` int(11) NOT NULL, `id_ville_dep` int(11) NOT NULL, `id_ville_arr` int(11) NOT NULL, `heure_dep` time NOT NULL, `heure_arr` time NOT NULL, PRIMARY KEY (`id_tt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21547 ; -- -------------------------------------------------------- -- -- Structure de la table `unite_fret` -- CREATE TABLE IF NOT EXISTS `unite_fret` ( `id_unite` int(11) NOT NULL AUTO_INCREMENT, `lib_unite` varchar(10) NOT NULL, `lib_long_unite` varchar(40) NOT NULL, PRIMARY KEY (`id_unite`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -------------------------------------------------------- -- -- Structure de la table `usine_conso` -- CREATE TABLE IF NOT EXISTS `usine_conso` ( `id_infra` int(11) NOT NULL, `id_ress` int(11) NOT NULL, `cours` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `usine_type_conso` -- CREATE TABLE IF NOT EXISTS `usine_type_conso` ( `id_categ_infra` int(11) NOT NULL, `id_type_march` int(11) NOT NULL, `qte` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `ville` -- CREATE TABLE IF NOT EXISTS `ville` ( `id_ville` int(11) NOT NULL AUTO_INCREMENT, `nom_ville` varchar(40) NOT NULL, `nbre_voies` int(11) NOT NULL, `voy_annuel` int(11) NOT NULL, `code_pays` varchar(2) NOT NULL, `id_pays` int(11) NOT NULL, `lati` decimal(20,5) NOT NULL, `longi` decimal(20,5) NOT NULL, PRIMARY KEY (`id_ville`), KEY `code_pays` (`code_pays`), KEY `id_pays` (`id_pays`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=203 ; -- -------------------------------------------------------- -- -- Structure de la table `ville_conso` -- CREATE TABLE IF NOT EXISTS `ville_conso` ( `id_ville` int(11) NOT NULL, `id_ress` int(11) NOT NULL, `cours` int(11) NOT NULL, `qte` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `ville_coord` -- CREATE TABLE IF NOT EXISTS `ville_coord` ( `nom_ville` varchar(50) DEFAULT NULL, `lati` decimal(20,5) DEFAULT NULL, `longi` decimal(20,5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `ville_marchandise` -- CREATE TABLE IF NOT EXISTS `ville_marchandise` ( `id_ville` int(11) NOT NULL, `id_type_march` int(11) NOT NULL, `qte_stock` decimal(11,2) NOT NULL, `prod_horaire` int(11) NOT NULL, `conso_horaire` int(11) NOT NULL, KEY `id_ville` (`id_ville`), KEY `id_type_march` (`id_type_march`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `ville_ress_stock_avirer` -- CREATE TABLE IF NOT EXISTS `ville_ress_stock_avirer` ( `id_ville` int(11) NOT NULL, `id_ress` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `qte` int(11) NOT NULL, `cours` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `ville_stock_avirer` -- CREATE TABLE IF NOT EXISTS `ville_stock_avirer` ( `id_ville` int(11) NOT NULL, `id_ress` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `qte` int(11) NOT NULL, `cours` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `wagon` -- CREATE TABLE IF NOT EXISTS `wagon` ( `id_wagon` int(11) NOT NULL, `nom` varchar(50) NOT NULL, `date_deb` int(11) NOT NULL, `date_fin` int(11) NOT NULL, `nom_img` varchar(50) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `zz_enchere_old` -- CREATE TABLE IF NOT EXISTS `zz_enchere_old` ( `id_enchere` int(11) NOT NULL AUTO_INCREMENT, `id_joueur` int(11) NOT NULL, `type_objet` int(11) NOT NULL, `id` int(11) NOT NULL, `texte_enchere` varchar(500) NOT NULL, `date_debut_enchere` datetime NOT NULL, `date_fin_enchere` datetime NOT NULL, `prix_depart` bigint(20) NOT NULL, `prix_actuel` bigint(20) DEFAULT NULL, `id_meilleur_encherisseur` int(11) DEFAULT NULL, PRIMARY KEY (`id_enchere`), KEY `id_joueur` (`id_joueur`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=498365 ; -- -------------------------------------------------------- -- -- Structure de la table `zz_encherisseur_old` -- CREATE TABLE IF NOT EXISTS `zz_encherisseur_old` ( `id_enchere` int(11) NOT NULL, `id_joueur` int(11) NOT NULL, `date_enchere` datetime NOT NULL, `prix_max` bigint(20) NOT NULL, `id_ville_livraison` int(11) DEFAULT NULL, KEY `id_enchere` (`id_enchere`), KEY `date_enchere` (`date_enchere`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 27, 2018 at 11:13 AM -- Server version: 5.7.23-0ubuntu0.16.04.1 -- PHP Version: 7.1.20-1+ubuntu16.04.1+deb.sury.org+1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `minehub` -- DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `addMiningBonus` (IN `pUserName` VARCHAR(250)) addMiningBonus: BEGIN DECLARE success,done,doneInner,selectedUserId,lastInsertedId,isMonthlyApplicable,isDailyApplicable,selectedPoolId INT(11) DEFAULT 0; DECLARE responseMessage,selectedFullname,selectedUserName,selectedEmail,selectedStatus,selectedPassword,selectedSponsor,selectedPoolName,selectedPooltableName,tempStr,miningMonthDate,currentMonthDate VARCHAR(250) DEFAULT ''; DECLARE selecetdCreatedAt DATE; DECLARE selectedStarterDailyBonus,selectedStarterMonthlyBonus,selectedMiniDailyBonus,selectedMiniMonthlyBonus,selectedMediumDailyBonus,selectedMediumMonthlyBonus DECIMAL(14,4) DEFAULT 0.00; DECLARE selectedSponsorResidualBonus DECIMAL(14,4) DEFAULT 0.00; DECLARE selectedGrandDailyBonus,selectedGrandMonthlyBonus,selectedUltimateDailyBonus,selectedUltimatMonthlyBonus,sumOfbenifits DECIMAL(14,4) DEFAULT 0.00; DECLARE selectedStarterPurchaseDate,selectedStarterMiningDate,selectedStarterCompletionDate,selectedStarterStatus VARCHAR(250) DEFAULT ''; DECLARE selectedMiniPurchaseDate,selectedMiniMiningDate,selectedMiniCompletionDate,selectedMiniStatus VARCHAR(250) DEFAULT ''; DECLARE selectedMediumPurchaseDate,selectedMediumMiningDate,selectedMediumCompletionDate,selectedMediumStatus VARCHAR(250) DEFAULT ''; DECLARE selectedGrandPurchaseDate,selectedGrandMiningDate,selectedGrandCompletionDate,selectedGrandStatus VARCHAR(250) DEFAULT ''; DECLARE selectedUltimatePurchaseDate,selectedUltimateMiningDate,selectedUltimateCompletionDate,selectedUltimateStatus VARCHAR(250) DEFAULT ''; SET success = 0; SET lastInsertedId = 0; SET selectedStarterDailyBonus = 1.5; SET selectedStarterMonthlyBonus = 30; SET selectedMiniDailyBonus = 3; SET selectedMiniMonthlyBonus = 90; SET selectedMediumDailyBonus = 6; SET selectedMediumMonthlyBonus = 180; SET selectedGrandDailyBonus = 12; SET selectedGrandMonthlyBonus = 360; SET selectedUltimateDailyBonus = 24; SET selectedUltimatMonthlyBonus = 720; CREATE TEMPORARY TABLE IF NOT EXISTS tmp_target_user( temp_id integer(10) PRIMARY KEY AUTO_INCREMENT, user_name VARCHAR(250), pool_name VARCHAR(250), pool_table_name VARCHAR(250), benifit_type TINYINT DEFAULT 0, benifit_amount_usd DECIMAL(14,4), created_date DATE ); innerBlock:BEGIN DECLARE targetUserCursor CURSOR FOR SELECT u.id, u.Fullname, u.Username, u.Email, u.Status, u.Password, u.Sponsor, u.created_at, starter.PurchaseDate,starter.MiningDate,starter.CompletionDate,starter.Status, mini.PurchaseDate,mini.MiningDate,mini.CompletionDate,mini.Status, medium.PurchaseDate,medium.MiningDate,medium.CompletionDate,medium.Status, grand.PurchaseDate,grand.MiningDate,grand.CompletionDate,grand.Status, ultimate.PurchaseDate,ultimate.MiningDate,ultimate.CompletionDate,ultimate.Status FROM users AS u LEFT JOIN starterpack AS starter ON starter.Username=u.Username LEFT JOIN minipack AS mini ON mini.Username=u.Username LEFT JOIN mediumpack AS medium ON medium.Username=u.Username LEFT JOIN grandpack AS grand ON grand.Username=u.Username LEFT JOIN ultimatepack AS ultimate ON ultimate.Username=u.Username WHERE u.Status = 'Close' AND u.Activation = '1' AND if((pUserName <> ''),u.Username=pUserName, 1=1) ORDER BY u.id DESC; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN targetUserCursor; targetUser: LOOP FETCH targetUserCursor INTO selectedUserId,selectedFullname,selectedUserName,selectedEmail,selectedStatus,selectedPassword,selectedSponsor,selecetdCreatedAt, selectedStarterPurchaseDate,selectedStarterMiningDate,selectedStarterCompletionDate,selectedStarterStatus, selectedMiniPurchaseDate,selectedMiniMiningDate,selectedMiniCompletionDate,selectedMiniStatus, selectedMediumPurchaseDate,selectedMediumMiningDate,selectedMediumCompletionDate,selectedMediumStatus, selectedGrandPurchaseDate,selectedGrandMiningDate,selectedGrandCompletionDate,selectedGrandStatus, selectedUltimatePurchaseDate,selectedUltimateMiningDate,selectedUltimateCompletionDate,selectedUltimateStatus ; IF done = 1 THEN LEAVE targetUser; END IF; SET sumOfbenifits = 0; IF (date(selectedStarterCompletionDate) > CURRENT_DATE() AND selectedStarterCompletionDate <> 0 AND date(selectedStarterMiningDate) < CURRENT_DATE() AND selectedStarterMiningDate <> 0 AND selectedStarterStatus = 'Active') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Starter','starterpack',1,selectedStarterDailyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Starter', 0, selectedStarterDailyBonus, 'Paid', selectedUserName, '0'); SET sumOfbenifits = (sumOfbenifits + selectedStarterDailyBonus); IF DATE_FORMAT(selectedStarterMiningDate,'%d') = DATE_FORMAT(CURRENT_DATE(),'%d') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Starter','starterpack',2,selectedStarterMonthlyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Starter', 0, selectedStarterMonthlyBonus, 'Paid', selectedUserName, '1'); SET sumOfbenifits = (sumOfbenifits + selectedStarterMonthlyBonus); END IF; END IF; IF (date(selectedMiniCompletionDate) > CURRENT_DATE() AND selectedMiniCompletionDate <> 0 AND date(selectedMiniMiningDate) < CURRENT_DATE() AND selectedMiniMiningDate <> 0 AND selectedMiniStatus = 'Active') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Mini','minipack',1,selectedMiniDailyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Mini', 0, selectedMiniDailyBonus, 'Paid', selectedUserName, '0'); SET sumOfbenifits = (sumOfbenifits + selectedMiniDailyBonus); IF DATE_FORMAT(selectedMiniMiningDate,'%d') = DATE_FORMAT(CURRENT_DATE(),'%d') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Mini','minipack',2,selectedMiniMonthlyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Mini', 0, selectedMiniMonthlyBonus, 'Paid', selectedUserName, '1'); SET sumOfbenifits = (sumOfbenifits + selectedMiniMonthlyBonus); END IF; END IF; IF (date(selectedMediumCompletionDate) > CURRENT_DATE() AND selectedMediumCompletionDate <> 0 AND date(selectedMediumMiningDate) < CURRENT_DATE() AND selectedMediumMiningDate <> 0 AND selectedMediumStatus = 'Active') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Medium','mediumpack',1,selectedMediumDailyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Medium', 0, selectedMediumDailyBonus, 'Paid', selectedUserName, '0'); SET sumOfbenifits = (sumOfbenifits + selectedMediumDailyBonus); IF DATE_FORMAT(selectedMediumMiningDate,'%d') = DATE_FORMAT(CURRENT_DATE(),'%d') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Medium','mediumpack',2,selectedMediumMonthlyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Medium', 0, selectedMediumMonthlyBonus, 'Paid', selectedUserName, '1'); SET sumOfbenifits = (sumOfbenifits + selectedMediumMonthlyBonus); END IF; END IF; IF (date(selectedGrandCompletionDate) > CURRENT_DATE() AND selectedGrandCompletionDate <> 0 AND date(selectedGrandMiningDate) < CURRENT_DATE() AND selectedGrandMiningDate <> 0 AND selectedGrandStatus = 'Active') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Grand','grandpack',1,selectedGrandDailyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Grand', 0, selectedGrandDailyBonus, 'Paid', selectedUserName, '0'); SET sumOfbenifits = (sumOfbenifits + selectedGrandDailyBonus); IF DATE_FORMAT(selectedGrandMiningDate,'%d') = DATE_FORMAT(CURRENT_DATE(),'%d') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Grand','grandpack',2,selectedGrandMonthlyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Grand', 0, selectedGrandMonthlyBonus, 'Paid', selectedUserName, '1'); SET sumOfbenifits = (sumOfbenifits + selectedGrandMonthlyBonus); END IF; END IF; IF (date(selectedUltimateCompletionDate) > CURRENT_DATE() AND selectedUltimateCompletionDate <> 0 AND date(selectedUltimateMiningDate) < CURRENT_DATE() AND selectedUltimateMiningDate <> 0 AND selectedUltimateStatus = 'Active') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Ultimate','ultimatepack',1,selectedUltimateDailyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Ultimate', 0, selectedUltimateDailyBonus, 'Paid', selectedUserName, '0'); SET sumOfbenifits = (sumOfbenifits + selectedUltimateDailyBonus); IF DATE_FORMAT(selectedUltimateMiningDate,'%d') = DATE_FORMAT(CURRENT_DATE(),'%d') THEN INSERT INTO tmp_target_user(user_name,pool_name,pool_table_name,benifit_type,benifit_amount_usd, created_date) VALUES(selectedUserName,'Ultimate','ultimatepack',2,selectedUltimateMonthlyBonus,now()); INSERT INTO dailymine (`Date`, Pack, Btc, Usd, Status, Username, is_monthly_mining) VALUES (now(), 'Ultimate', 0, selectedUltimateMonthlyBonus, 'Paid', selectedUserName, '1'); SET sumOfbenifits = (sumOfbenifits + selectedUltimateMonthlyBonus); END IF; END IF; IF(sumOfbenifits > 0 ) THEN UPDATE mining SET Balance = (Balance+sumOfbenifits),updated_at=now() WHERE Username=selectedUserName; UPDATE accountbalance SET Balance = (Balance+sumOfbenifits),updated_at=now() WHERE Username=selectedUserName; INSERT INTO bmp_bonus_commission_earn_log (user_name, reason_id, reason_description, is_added_by_cron, amount, added_in) VALUES (selectedUserName, '5', CONCAT('Mining earning of user ',selectedUserName), '1', sumOfbenifits, 'mining'); SET selectedSponsorResidualBonus = 0; IF(selectedSponsor <> '' AND selectedSponsor IS NOT NULL) THEN SET selectedSponsorResidualBonus = (sumOfbenifits * 0.005); UPDATE team SET Balance = (Balance+selectedSponsorResidualBonus),updated_at=now() WHERE Username=selectedSponsor; UPDATE accountbalance SET Balance = (Balance+selectedSponsorResidualBonus),updated_at=now() WHERE Username=selectedSponsor; INSERT INTO bmp_bonus_commission_earn_log (user_name, reason_id, reason_description, is_added_by_cron, amount, added_in) VALUES (selectedSponsor, '4', CONCAT('Residual bonus of parent user ',selectedSponsor,' on joining of ',selectedUserName), '1', selectedSponsorResidualBonus, 'team'); END IF; END IF; END LOOP targetUser; CLOSE targetUserCursor; END innerBlock; SELECT * FROM tmp_target_user; DROP TEMPORARY TABLE tmp_target_user; END$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `getUserRankData` (IN `pUserName` VARCHAR(250)) getUserRankData: BEGIN DECLARE success,done,selectedRankId,purchasedRegistrationMembership,purchasedAnyOfPool,dealerTotalEnrollment,dealerSixMinersEnrollment,dealerSixMinersWithTwoSubMinersEnrollment,superDealerTotalEnrollment,superDealerThreeDealersEnrollment INT(11) DEFAULT 0; DECLARE executiveDealerTotalEnrollment,executiveDealerTwoSuperDealersEnrollment,crownDealerTotalEnrollment,crownDealerThreeExecutiveDealersEnrollment,globalCrownDealerTotalEnrollment,globalCrownDealerThreeCrownDealersEnrollment INT(11) DEFAULT 0; DECLARE selectedAccountBalance,selectedMiningBalance,selectedTeamBalance,selectedCommissionBalance,selectedTeamVolumeBalance DECIMAL(14,4) DEFAULT 0.00; DECLARE responseMessage,selectedRank VARCHAR(250) DEFAULT ''; DECLARE isMinerRankAchieved,isDealerRankAchieved,isSuperDealerRankAchieved,isExecutiveRankAchieved,isCrownRankAchieved,isGlobalCrownRankAchieved INT(11) DEFAULT 0; SET success = 0; IF EXISTS (SELECT * FROM users WHERE Username=pUserName order by id desc limit 1) THEN SELECT Balance INTO selectedAccountBalance FROM accountbalance WHERE Username = pUserName; SELECT Balance INTO selectedMiningBalance FROM mining WHERE Username = pUserName; SELECT Balance INTO selectedTeamBalance FROM team WHERE Username = pUserName; SELECT Balance INTO selectedCommissionBalance FROM commission WHERE Username = pUserName; SELECT Balance INTO selectedTeamVolumeBalance FROM teamvolume WHERE Username = pUserName; SELECT Rank,Rankid INTO selectedRank,selectedRankId FROM rank WHERE Username = pUserName; IF EXISTS(SELECT * FROM invoice where Purpose = 'Registration' AND Status = 'Paid' AND Username = pUserName order by id desc limit 1) THEN SET purchasedRegistrationMembership = 1; END IF; IF EXISTS(SELECT * FROM invoice where Purpose <> 'Registration' AND Status = 'Paid' AND Username = pUserName order by id desc limit 1) THEN SET purchasedAnyOfPool = 1; END IF; IF(purchasedRegistrationMembership = 1 AND purchasedAnyOfPool = 1) THEN SET isMinerRankAchieved = 1; UPDATE rank SET Rank='Miner', Rankid='1' WHERE Username = pUserName; END IF; SELECT (balance >= 11400) INTO dealerTotalEnrollment FROM teamvolume WHERE Username = pUserName; SELECT (count(*) >= 6 ) INTO dealerSixMinersEnrollment FROM invoice AS i JOIN users AS u ON u.Username=i.Username AND u.Sponsor = pUserName AND i.status='Paid'; SELECT ( (count(*) >= 6 ) AND (t.left IS NOT NULL AND t.right IS NOT NULL) ) INTO dealerSixMinersWithTwoSubMinersEnrollment FROM invoice AS i JOIN users AS u ON u.Username=i.Username AND u.Sponsor = pUserName AND i.status='Paid' JOIN tree AS t ON t.userid=i.Username; IF(dealerTotalEnrollment = 1 AND dealerSixMinersEnrollment = 1 AND dealerSixMinersWithTwoSubMinersEnrollment = 1 ) THEN SET isDealerRankAchieved = 1; UPDATE rank SET Rank='Dealer', Rankid='2' WHERE Username = pUserName; END IF; SELECT (balance >= 50000) INTO superDealerTotalEnrollment FROM teamvolume WHERE Username = pUserName; SELECT (count(*) >= 3 ) INTO superDealerThreeDealersEnrollment FROM users AS u JOIN rank AS r on r.Username=u.Username WHERE u.Sponsor = pUserName AND r.Rankid >= 2; IF(superDealerTotalEnrollment = 1 AND superDealerThreeDealersEnrollment = 1 ) THEN SET isSuperDealerRankAchieved = 1; UPDATE rank SET Rank='Super Dealer', Rankid='3' WHERE Username = pUserName; END IF; SELECT (balance >= 220000) INTO executiveDealerTotalEnrollment FROM teamvolume WHERE Username = pUserName; SELECT (count(*) >= 2 ) INTO executiveDealerTwoSuperDealersEnrollment FROM users AS u JOIN rank AS r on r.Username=u.Username WHERE u.Sponsor = pUserName AND r.Rankid >= 3; IF(executiveDealerTotalEnrollment = 1 AND executiveDealerTwoSuperDealersEnrollment = 1 ) THEN SET isExecutiveRankAchieved = 1; UPDATE rank SET Rank='Executive Dealer', Rankid='4' WHERE Username = pUserName; END IF; SELECT (balance >= 2000000) INTO crownDealerTotalEnrollment FROM teamvolume WHERE Username = pUserName; SELECT (count(*) >= 3 ) INTO crownDealerThreeExecutiveDealersEnrollment FROM users AS u JOIN rank AS r on r.Username=u.Username WHERE u.Sponsor = pUserName AND r.Rankid >= 4; IF(crownDealerTotalEnrollment = 1 AND crownDealerThreeExecutiveDealersEnrollment = 1 ) THEN SET isCrownRankAchieved = 1; UPDATE rank SET Rank='Crown Dealer', Rankid='5' WHERE Username = pUserName; END IF; SELECT (balance >= 10000000) INTO globalCrownDealerTotalEnrollment FROM teamvolume WHERE Username = pUserName; SELECT (count(*) >= 3 ) INTO globalCrownDealerThreeCrownDealersEnrollment FROM users AS u JOIN rank AS r on r.Username=u.Username WHERE u.Sponsor = pUserName AND r.Rankid >= 5; IF(globalCrownDealerTotalEnrollment = 1 AND globalCrownDealerThreeCrownDealersEnrollment = 1 ) THEN SET isGlobalCrownRankAchieved = 1; UPDATE rank SET Rank='Global Crown Dealer', Rankid='6' WHERE Username = pUserName; END IF; SET responseMessage = 'Success'; SET success = 1; SELECT success AS response,responseMessage, isMinerRankAchieved,isDealerRankAchieved,isSuperDealerRankAchieved,isExecutiveRankAchieved,isCrownRankAchieved,isGlobalCrownRankAchieved,selectedAccountBalance,selectedMiningBalance,selectedTeamBalance,selectedCommissionBalance,selectedTeamVolumeBalance,selectedRank,selectedRankId, purchasedRegistrationMembership,purchasedAnyOfPool, dealerTotalEnrollment,dealerSixMinersEnrollment,dealerSixMinersWithTwoSubMinersEnrollment, superDealerTotalEnrollment,superDealerThreeDealersEnrollment, executiveDealerTotalEnrollment,executiveDealerTwoSuperDealersEnrollment, crownDealerTotalEnrollment,crownDealerThreeExecutiveDealersEnrollment, globalCrownDealerTotalEnrollment,globalCrownDealerThreeCrownDealersEnrollment ; ELSE SET responseMessage = 'Customer is not exist.'; SET success = 0; SELECT success AS response, responseMessage; END IF; END$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertCustomer` (IN `name` VARCHAR(250), IN `country` VARCHAR(250), IN `email` VARCHAR(250), IN `telephone` VARCHAR(250), IN `gender` VARCHAR(250), IN `user_name` VARCHAR(250), IN `password` VARCHAR(250), IN `token` VARCHAR(250), IN `account` VARCHAR(250), IN `sponsor_account` VARCHAR(250), IN `status` VARCHAR(250), IN `activation` VARCHAR(250), IN `platform` TINYINT(4), IN `isWalletUser` TINYINT(4)) insertCustomer: BEGIN DECLARE success INT(11) DEFAULT 0; DECLARE approve_bill, custBillCount, customerId,lastInsertedId INT(11) DEFAULT 0; DECLARE responseMessage VARCHAR(250) DEFAULT ''; SET success = 0; SET lastInsertedId = 0; START TRANSACTION; IF NOT EXISTS (SELECT * FROM `users` WHERE Username=user_name AND Password=password order by id desc limit 1) THEN INSERT INTO users (Fullname, Country, Email, Telephone, Gender, Username, Password, Sponsor, Token, Account, Status, Activation, treestatus,platform,is_wallet_user) VALUES(name,country,email,telephone,gender,user_name,password,sponsor_account,token,account,status,activation,'notree',platform,isWalletUser); SET lastInsertedId = LAST_INSERT_ID(); SET customerId = LAST_INSERT_ID(); INSERT INTO accountbalance (Balance, Username) VALUES('0',user_name); INSERT INTO binaryincome(userid, day_bal, current_bal, total_bal) VALUES(user_name,'0','0','0'); INSERT INTO hubcoin (Balance, Username) VALUES('0',user_name); INSERT INTO team (Balance, Username) VALUES('0',user_name); INSERT INTO teamvolume (Balance, Username) VALUES('0',user_name); INSERT INTO rank (Rank, Rankid, Username, Sponsor) VALUES('Guest','0',user_name,sponsor_account); INSERT INTO mining (Balance, Username) VALUES('0',user_name); INSERT INTO commission (Balance, Username) VALUES('0',user_name); INSERT INTO starterpack (PurchaseDate, MiningDate, Username, Status, CompletionDate, TotalMinable,Withdrawal, Comment) VALUES('0', '0', user_name, 'Inactive', '0', '547.50', '0', 'Not-Purchased'); INSERT INTO minipack (PurchaseDate, MiningDate, Username, Status, CompletionDate, TotalMinable,Withdrawal, Comment) VALUES('0', '0', user_name, 'Inactive', '0', '1095', '0', 'Not-Purchased'); INSERT INTO mediumpack (PurchaseDate, MiningDate, Username, Status, CompletionDate, TotalMinable,Withdrawal, Comment) VALUES('0', '0', user_name, 'Inactive', '0', '2190', '0', 'Not-Purchased'); INSERT INTO grandpack (PurchaseDate, MiningDate, Username, Status, CompletionDate, TotalMinable,Withdrawal, Comment) VALUES('0', '0', user_name, 'Inactive', '0', '4380', '0', 'Not-Purchased'); INSERT INTO ultimatepack (PurchaseDate, MiningDate, Username, Status, CompletionDate, TotalMinable, Withdrawal, Comment) VALUES('0', '0', user_name, 'Inactive', '0', '8760', '0', 'Not-Purchased'); INSERT INTO register (EntryDate, Amount, Username) VALUES('0', '0', user_name); IF EXISTS (SELECT * FROM `users` WHERE Username=sponsor_account AND is_admin_user = '1' order by id desc limit 1 ) THEN INSERT INTO tree (userid) VALUES(user_name); END IF; IF lastInsertedId = 0 THEN SET responseMessage = 'Problem to add customer.'; SET success = 0; ROLLBACK; SELECT success AS response,lastInsertedId,responseMessage; LEAVE insertCustomer; ELSE SET responseMessage = 'Customer added succesfully.'; SET success = 1; COMMIT; SELECT success AS response,lastInsertedId,responseMessage; LEAVE insertCustomer; END IF; ELSE SET responseMessage = 'Customer already exist.'; SET success = 0; END IF; SELECT success AS response, lastInsertedId,responseMessage; COMMIT; END$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `insertTree` (IN `parentUser` VARCHAR(250), IN `side` VARCHAR(250), IN `pUserName` VARCHAR(250)) insertTree: BEGIN DECLARE success INT(11) DEFAULT 0; DECLARE customerId,lastInsertedId,parentRankId,capping INT(11) DEFAULT 0; DECLARE responseMessage,parentUserSponsor,parantLeftNode,parantRightNode VARCHAR(250) DEFAULT ''; DECLARE dayBal,currentBal,totalBal,inDirectBinaryCommisionAmount,matchingBonusAmount DECIMAL(14,4) DEFAULT 0.00; SET success = 0; SET lastInsertedId = 0; SET inDirectBinaryCommisionAmount = 200; SET matchingBonusAmount = 10; START TRANSACTION; INSERT INTO user(Username,under_userid,side) values(pUserName,parentUser,side); SET lastInsertedId = LAST_INSERT_ID(); IF NOT EXISTS (SELECT * FROM tree WHERE userid = pUserName) THEN INSERT INTO tree (userid) VALUES (pUserName); END IF; IF side = 'left' THEN UPDATE tree SET `left` = pUserName WHERE userid = parentUser; ELSE UPDATE tree SET `right` = pUserName WHERE userid = parentUser; END IF; SELECT Rankid INTO parentRankId FROM rank WHERE Username = pUserName; IF (parentRankId = 1) THEN SET capping = 800; ELSEIF (parentRankId = 2) THEN SET capping = 1000; ELSEIF (parentRankId = 3) THEN SET capping = 1200; ELSEIF (parentRankId = 4) THEN SET capping = 1400; ELSEIF (parentRankId = 5) THEN SET capping = 1600; ELSEIF (parentRankId = 6) THEN SET capping = 2000; ELSE SET capping = 2000; END IF; SELECT day_bal,current_bal,total_bal INTO dayBal,currentBal,totalBal FROM binaryincome WHERE userid=pUserName; SELECT Sponsor INTO parentUserSponsor FROM users WHERE Username=pUserName; IF (currentBal < capping) THEN SELECT tree.left,tree.right INTO parantLeftNode,parantRightNode FROM tree WHERE userid = parentUser; IF((parantLeftNode <> '' AND parantLeftNode IS NOT NULL) AND (parantRightNode <> '' AND parantRightNode IS NOT NULL)) THEN UPDATE binaryincome SET day_bal = (day_bal+inDirectBinaryCommisionAmount),current_bal = (current_bal+inDirectBinaryCommisionAmount),total_bal = (total_bal+inDirectBinaryCommisionAmount),updated_at=now() WHERE userid = parentUser; UPDATE accountbalance SET Balance = (Balance+inDirectBinaryCommisionAmount),updated_at=now() WHERE Username=parentUser; INSERT INTO bmp_bonus_commission_earn_log (user_name, reason_id, reason_description, is_added_by_cron, amount, added_in) VALUES (parentUser, '2', CONCAT('Indirect Binary commision of user ',pUserName), '0', inDirectBinaryCommisionAmount, 'binaryincome'); IF (parentUserSponsor <> '' AND parentUserSponsor IS NOT NULL) THEN UPDATE team SET Balance = (Balance+matchingBonusAmount),updated_at=now() WHERE Username=parentUserSponsor; UPDATE accountbalance SET Balance = (Balance+matchingBonusAmount),updated_at=now() WHERE Username=parentUserSponsor; INSERT INTO bmp_bonus_commission_earn_log (user_name, reason_id, reason_description, is_added_by_cron, amount, added_in) VALUES (parentUserSponsor, '3', CONCAT('Matching bonus of parent user ',parentUser,' on joining of ',pUserName), '0', matchingBonusAmount, 'team'); END IF; END IF; END IF; UPDATE users set treestatus= 'tree' where Username = pUserName; IF lastInsertedId = 0 THEN SET responseMessage = 'Problem to add tree data.'; SET success = 0; ROLLBACK; SELECT success AS response,lastInsertedId,responseMessage; LEAVE insertTree; ELSE SET responseMessage = 'Tree data added succesfully.'; SET success = 1; COMMIT; SELECT success AS response,lastInsertedId,responseMessage; LEAVE insertTree; END IF; SELECT success AS response, lastInsertedId,responseMessage; COMMIT; END$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `accountbalance` -- CREATE TABLE `accountbalance` ( `id` int(100) NOT NULL, `Balance` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Register` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `accountbalance` -- INSERT INTO `accountbalance` (`id`, `Balance`, `Username`, `Register`, `created_at`, `updated_at`) VALUES (88, '6.03', 'mshai', '', '2018-08-27 19:38:14', '2018-09-26 16:33:58'), (89, '6', 'meettomangesh@gmail.com', '', '2018-08-27 19:38:14', '2018-09-26 16:33:58'), (90, '0', 'test1@gmail.com', '', '2018-08-27 19:38:14', '2018-09-26 16:31:38'), (91, '0', 'test2@gmail.com', '', '2018-08-27 19:38:14', '2018-09-26 16:31:38'), (92, '0', 'test6@gmail.com', '', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (93, '0', 'test7@gmail.com', '', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (94, '0', 'test8@gmail.com', '', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `binaryincome` -- CREATE TABLE `binaryincome` ( `id` int(11) NOT NULL, `userid` varchar(250) NOT NULL, `day_bal` varchar(250) NOT NULL, `current_bal` varchar(250) NOT NULL, `total_bal` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `binaryincome` -- INSERT INTO `binaryincome` (`id`, `userid`, `day_bal`, `current_bal`, `total_bal`, `created_at`, `updated_at`) VALUES (44, 'mshai', '0', '0', '0', '2018-08-27 19:39:00', '2018-08-27 19:39:00'), (45, 'meettomangesh@gmail.com', '0', '0', '0', '2018-08-27 19:39:00', '2018-08-27 19:39:00'), (46, 'test1@gmail.com', '0', '0', '0', '2018-08-27 19:39:00', '2018-08-27 19:39:00'), (47, 'test2@gmail.com', '0', '0', '0', '2018-08-27 19:39:00', '2018-08-27 19:39:00'), (48, 'test6@gmail.com', '0', '0', '0', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (49, 'test7@gmail.com', '0', '0', '0', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (50, 'test8@gmail.com', '0', '0', '0', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `bmp_bonus_commission_earn_log` -- CREATE TABLE `bmp_bonus_commission_earn_log` ( `id` int(11) NOT NULL, `user_name` varchar(250) DEFAULT NULL, `reason_id` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0' COMMENT '0: N/A,1:Direct Commission , 2:Indirect Commission, 3:Matching Bonus, 4:Residual Bonus, 5:Mining Earning ', `reason_description` text, `is_added_by_cron` enum('1','0') NOT NULL DEFAULT '0' COMMENT '1:Yes 0:No', `amount` decimal(14,4) NOT NULL, `added_in` varchar(250) NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bmp_bonus_commission_earn_log` -- INSERT INTO `bmp_bonus_commission_earn_log` (`id`, `user_name`, `reason_id`, `reason_description`, `is_added_by_cron`, `amount`, `added_in`, `created_at`, `updated_at`) VALUES (1, 'meettomangesh@gmail.com', '5', 'Mining earning of user meettomangesh@gmail.com', '1', '1.5000', 'mining', '2018-09-26 11:03:58', '2018-09-26 11:03:58'), (2, 'mshai ', '4', 'Residual bonus of parent user mshai on joining of meettomangesh@gmail.com', '1', '0.0075', 'team', '2018-09-26 11:03:58', '2018-09-26 11:03:58'), (3, 'mshai', '5', 'Mining earning of user mshai', '1', '1.5000', 'mining', '2018-09-26 11:03:59', '2018-09-26 11:03:59'); -- -------------------------------------------------------- -- -- Table structure for table `bmp_pool_benifits` -- CREATE TABLE `bmp_pool_benifits` ( `id` int(11) NOT NULL, `pool_name` varchar(250) DEFAULT NULL, `pool_table_name` varchar(250) DEFAULT NULL, `daily_bonus` decimal(14,4) NOT NULL DEFAULT '0.0000', `monthly_bonus` decimal(14,4) NOT NULL DEFAULT '0.0000', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bmp_pool_benifits` -- INSERT INTO `bmp_pool_benifits` (`id`, `pool_name`, `pool_table_name`, `daily_bonus`, `monthly_bonus`, `created_at`, `updated_at`) VALUES (1, 'Starter', 'starterpack', '1.5000', '30.0000', '2018-09-10 14:23:08', '2018-09-10 14:23:08'), (2, 'Mini', 'minipack', '3.0000', '90.0000', '2018-09-10 14:23:08', '2018-09-10 14:23:08'), (3, 'Medium', 'mediumpack', '6.0000', '180.0000', '2018-09-10 14:25:05', '2018-09-10 14:25:05'), (4, 'Grand', 'grandpack', '12.0000', '360.0000', '2018-09-10 14:25:05', '2018-09-10 14:25:05'), (5, 'Ultimate', 'ultimatepack', '24.0000', '420.0000', '2018-09-10 14:25:05', '2018-09-10 14:25:05'); -- -------------------------------------------------------- -- -- Table structure for table `bmp_wallet` -- CREATE TABLE `bmp_wallet` ( `id` int(11) NOT NULL, `user_name` varchar(250) DEFAULT NULL, `email_address` varchar(250) DEFAULT NULL, `address` varchar(250) DEFAULT NULL, `password` varchar(250) DEFAULT NULL, `label` varchar(250) DEFAULT NULL, `guid` varchar(250) DEFAULT NULL, `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '1:Active 2:Inactive', `is_register_for_bmp` enum('1','2') NOT NULL DEFAULT '2' COMMENT '1:Yes 2:No', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bmp_wallet` -- INSERT INTO `bmp_wallet` (`id`, `user_name`, `email_address`, `address`, `password`, `label`, `guid`, `status`, `is_register_for_bmp`, `created_at`, `updated_at`) VALUES (4, 'meettomangesh@gmail.com', 'meettomangesh@gmail.com', '18SPT5NUNzkvibfw9J1ANkaF1y5NRFm1KS', '7u8i9o0p', 'Main address of wallet of test8@gmail.com', '7e40a36a-d61a-4636-aa0e-a4ed3b06d237', '1', '2', '2018-08-28 01:40:29', '2018-08-28 01:40:29'); -- -------------------------------------------------------- -- -- Table structure for table `bmp_wallet_sent_receive_transactions` -- CREATE TABLE `bmp_wallet_sent_receive_transactions` ( `id` int(11) NOT NULL, `user_name` varchar(250) DEFAULT NULL, `invoice_id` varchar(250) DEFAULT NULL, `sent_receive_flag` enum('1','2') NOT NULL DEFAULT '1' COMMENT '1:Sent 2:Receive', `amount` varchar(250) DEFAULT NULL, `from_address` varchar(250) DEFAULT NULL, `to_address` varchar(250) DEFAULT NULL, `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '1:Unpaid/Pending 2:Paid', `response` text NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `bmp_wallet_withdrawl_transactions` -- CREATE TABLE `bmp_wallet_withdrawl_transactions` ( `id` int(11) NOT NULL, `user_name` varchar(250) DEFAULT NULL, `to_address` varchar(250) DEFAULT NULL, `amount` decimal(14,4) NOT NULL DEFAULT '0.0000', `status` enum('1','2','3') NOT NULL DEFAULT '1' COMMENT '1:Pending 2:Processed 3:Rejected', `response` text, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bmp_wallet_withdrawl_transactions` -- INSERT INTO `bmp_wallet_withdrawl_transactions` (`id`, `user_name`, `to_address`, `amount`, `status`, `response`, `created_at`, `updated_at`) VALUES (1, 'meettomangesh@gmail.com', 'ABDVD', '100.0000', '1', '', '2018-09-19 14:11:23', '2018-09-19 14:11:23'), (2, 'meettomangesh@gmail.com', 'ABDVD', '100.0000', '1', '', '2018-09-19 14:13:26', '2018-09-19 14:13:26'), (3, 'meettomangesh@gmail.com', 'ABDVD', '200.0000', '1', '', '2018-09-19 14:13:34', '2018-09-19 14:13:34'); -- -------------------------------------------------------- -- -- Table structure for table `commission` -- CREATE TABLE `commission` ( `id` int(11) NOT NULL, `Balance` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `commission` -- INSERT INTO `commission` (`id`, `Balance`, `Username`, `created_at`, `updated_at`) VALUES (56, '120', 'mshai', '2018-08-27 19:46:46', '2018-08-27 19:46:46'), (57, '0', 'meettomangesh@gmail.com', '2018-08-27 19:46:46', '2018-08-27 19:46:46'), (58, '0', 'test1@gmail.com', '2018-08-27 19:46:46', '2018-08-27 19:46:46'), (59, '0', 'test2@gmail.com', '2018-08-27 19:46:46', '2018-08-27 19:46:46'), (60, '0', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (61, '0', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (62, '0', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `dailymine` -- CREATE TABLE `dailymine` ( `id` int(11) NOT NULL, `Date` date DEFAULT NULL, `Pack` varchar(250) NOT NULL, `Btc` decimal(14,4) NOT NULL DEFAULT '0.0000', `Usd` decimal(14,4) NOT NULL DEFAULT '0.0000', `Status` varchar(250) NOT NULL, `Username` varchar(250) DEFAULT NULL, `is_monthly_mining` enum('1','0') NOT NULL DEFAULT '0' COMMENT '1:Yes 0:No', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `dailymine` -- INSERT INTO `dailymine` (`id`, `Date`, `Pack`, `Btc`, `Usd`, `Status`, `Username`, `is_monthly_mining`, `created_at`, `updated_at`) VALUES (1, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-12 18:53:39', '2018-09-12 18:53:39'), (2, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'meettomangesh@gmail.com', '1', '2018-09-12 18:53:39', '2018-09-12 18:53:39'), (3, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-12 18:53:39', '2018-09-12 18:53:39'), (4, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'mshai', '1', '2018-09-12 18:53:39', '2018-09-12 18:53:39'), (5, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-12 18:55:23', '2018-09-12 18:55:23'), (6, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'meettomangesh@gmail.com', '1', '2018-09-12 18:55:23', '2018-09-12 18:55:23'), (7, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-12 18:55:23', '2018-09-12 18:55:23'), (8, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'mshai', '1', '2018-09-12 18:55:23', '2018-09-12 18:55:23'), (9, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-12 18:59:47', '2018-09-12 18:59:47'), (10, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'meettomangesh@gmail.com', '1', '2018-09-12 18:59:47', '2018-09-12 18:59:47'), (11, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-12 18:59:47', '2018-09-12 18:59:47'), (12, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'mshai', '1', '2018-09-12 18:59:47', '2018-09-12 18:59:47'), (13, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-12 19:15:12', '2018-09-12 19:15:12'), (14, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'meettomangesh@gmail.com', '1', '2018-09-12 19:15:12', '2018-09-12 19:15:12'), (15, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-12 19:15:12', '2018-09-12 19:15:12'), (16, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'mshai', '1', '2018-09-12 19:15:12', '2018-09-12 19:15:12'), (17, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-12 19:15:25', '2018-09-12 19:15:25'), (18, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'meettomangesh@gmail.com', '1', '2018-09-12 19:15:25', '2018-09-12 19:15:25'), (19, '2018-09-12', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-12 19:15:25', '2018-09-12 19:15:25'), (20, '2018-09-12', 'Starter', '0.0000', '30.0000', 'Paid', 'mshai', '1', '2018-09-12 19:15:25', '2018-09-12 19:15:25'), (21, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-26 16:30:20', '2018-09-26 16:30:20'), (22, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-26 16:30:20', '2018-09-26 16:30:20'), (23, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-26 16:31:07', '2018-09-26 16:31:07'), (24, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-26 16:31:07', '2018-09-26 16:31:07'), (25, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-26 16:31:38', '2018-09-26 16:31:38'), (26, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-26 16:31:39', '2018-09-26 16:31:39'), (27, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'meettomangesh@gmail.com', '0', '2018-09-26 16:33:58', '2018-09-26 16:33:58'), (28, '2018-09-26', 'Starter', '0.0000', '1.5000', 'Paid', 'mshai', '0', '2018-09-26 16:33:58', '2018-09-26 16:33:58'); -- -------------------------------------------------------- -- -- Table structure for table `grandpack` -- CREATE TABLE `grandpack` ( `id` int(11) NOT NULL, `PurchaseDate` varchar(250) NOT NULL, `MiningDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `CompletionDate` varchar(250) NOT NULL, `TotalMinable` varchar(250) NOT NULL, `Withdrawal` varchar(250) NOT NULL, `Comment` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `grandpack` -- INSERT INTO `grandpack` (`id`, `PurchaseDate`, `MiningDate`, `Username`, `Status`, `CompletionDate`, `TotalMinable`, `Withdrawal`, `Comment`, `created_at`, `updated_at`) VALUES (55, '0', '0', 'mshai', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (56, '0', '0', 'meettomangesh@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (57, '0', '0', 'test1@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (58, '0', '0', 'test2@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (59, '0', '0', 'test6@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (60, '0', '0', 'test7@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (61, '0', '0', 'test8@gmail.com', 'Inactive', '0', '4380', '0', 'Not-Purchased', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `hangbtc` -- CREATE TABLE `hangbtc` ( `id` int(11) NOT NULL, `SendDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Btcamount` varchar(250) NOT NULL, `Btcaddress` varchar(250) NOT NULL, `Purpose` varchar(250) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `hubcoin` -- CREATE TABLE `hubcoin` ( `id` int(100) NOT NULL, `Balance` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `hubcoin` -- INSERT INTO `hubcoin` (`id`, `Balance`, `Username`, `created_at`, `updated_at`) VALUES (88, '0', 'mshai', '2018-08-27 19:39:56', '2018-08-27 19:39:56'), (89, '0', 'meettomangesh@gmail.com', '2018-08-27 19:39:56', '2018-08-27 19:39:56'), (90, '0', 'test1@gmail.com', '2018-08-27 19:39:56', '2018-08-27 19:39:56'), (91, '0', 'test2@gmail.com', '2018-08-27 19:39:56', '2018-08-27 19:39:56'), (92, '0', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (93, '0', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (94, '0', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `invoice` -- CREATE TABLE `invoice` ( `id` int(100) NOT NULL, `Paydate` varchar(250) NOT NULL, `Invoiceid` varchar(250) NOT NULL, `Purpose` varchar(250) NOT NULL, `Btcaddress` varchar(250) NOT NULL, `Amount` varchar(250) NOT NULL, `Btcamount` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `api_response` text, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `invoice` -- INSERT INTO `invoice` (`id`, `Paydate`, `Invoiceid`, `Purpose`, `Btcaddress`, `Amount`, `Btcamount`, `Status`, `Username`, `api_response`, `created_at`, `updated_at`) VALUES (63, '22-07-2018', '2591182', 'Registration', '1FM3mZdwvfYGBYBhwD3jEj8c6YvH6KFm28', '100', '0.01407895', 'Paid', 'mshai2', NULL, '2018-08-12 14:15:32', '2018-08-12 14:15:32'), (73, '15-08-2018', '8443413', 'Registration', '1GVq2C3rZezXgU4cTvkXcjPVxSvUpRe6zc', '100', '0.01663408', 'Paid', 'test1@gmail.com', '{\n "address" : "1GVq2C3rZezXgU4cTvkXcjPVxSvUpRe6zc",\n "index" : 36,\n "callback" : "https://bitminepool.com/bitcoin_system/production/payment/callback.php?invoice=8443413&secret=10081988Mangesh"\n}', '2018-08-15 13:28:11', '2018-08-15 13:28:11'), (65, '22-07-2018', '3801286', 'Starter', '1CPvdSmjvQt48ZiCYUnEMywPf1og1K3nwE', '300', '0.04116418', 'Paid', 'mshai2', NULL, '2018-08-12 14:15:32', '2018-08-12 14:15:32'), (66, '22-07-2018', '4237888', 'Starter', '1GxnZhQdwVwgg87JrrsKMtW3dVKmY7uezB', '300', '0.04116418', 'Unpaid', 'mshai2', NULL, '2018-08-12 14:15:32', '2018-08-12 14:15:32'), (68, '13-08-2018', '1234', 'Registration', '18jDWHD6ono1FyGf4eDKF4reQu9ZAkMGCj', '100', '0.1234', 'Paid', 'test@gmail.com', '{"btc_address":"18jDWHD6ono1FyGf4eDKF4reQu9ZAkMGCj","index":8,"callback":"https:\\/\\/bitminepool.com\\/bitcoin_system\\/production\\/payment\\/callback.php?invoice=1234&secret=10081988Bmp"}', '2018-08-13 23:52:00', '2018-08-13 23:52:00'), (69, '13-08-2018', '1234', 'Registration', '17EH21T3dyZ1h8RJCsGbNE2scy3NvBCkRA', '100', '0.1234', 'Paid', 'test2@gmail.com', 'Exception: The environment parameters are missing. in G:\\xampp\\htdocs\\bmp_api\\src\\Controllers\\ReceiveController.php:34\nStack trace:\n#0 G:\\xampp\\htdocs\\bmp_api\\src\\Bootstrap.php(67): Api\\Controllers\\ReceiveController->generateAddressToRecivePayment(Array)\n#1 G:\\xampp\\htdocs\\bmp_api\\public\\index.php(13): require(\'G:\\\\xampp\\\\htdocs...\')\n#2 {main}', '2018-08-13 23:59:10', '2018-08-13 23:59:10'), (70, '13-08-2018', '1234', 'Registration', '17EH21T3dyZ1h8RJCsGbNE2scy3NvBCkRA', '100', '0.1234', 'Unpaid', 'test3@gmail.com', 'Exception: The environment parameters are missing. in G:\\xampp\\htdocs\\bmp_api\\src\\Controllers\\ReceiveController.php:34\nStack trace:\n#0 G:\\xampp\\htdocs\\bmp_api\\src\\Bootstrap.php(67): Api\\Controllers\\ReceiveController->generateAddressToRecivePayment(Array)\n#1 G:\\xampp\\htdocs\\bmp_api\\public\\index.php(13): require(\'G:\\\\xampp\\\\htdocs...\')\n#2 {main}', '2018-08-14 00:04:22', '2018-08-14 00:04:22'), (71, '13-08-2018', '1234', 'Registration', '17EH21T3dyZ1h8RJCsGbNE2scy3NvBCkRA', '100', '0.1234', 'Paid', 'test4@gmail.com', '{"btc_address":"17EH21T3dyZ1h8RJCsGbNE2scy3NvBCkRA","index":9,"callback":"https:\\/\\/bitminepool.com\\/bitcoin_system\\/production\\/payment\\/callback.php?invoice=1234&secret=10081988Bmp"}', '2018-08-14 00:05:59', '2018-08-14 00:05:59'), (72, '13-08-2018', '2643300', 'Registration', '1NoQ8bV2r3wjZ4jUqvGfq3ut4eLobz6KPL', '100', '0.01672678', 'Paid', 'meettomangesh@gmail.com', NULL, '2018-08-14 00:35:34', '2018-08-14 00:35:34'), (74, '15-08-2018', '4291339', 'Starter', '1LvyrttP3uoG7xSCjWqn5e46bRfZqmnsq4', '300', '0.04772899', 'Paid', 'meettomangesh2@gmail.com', '{\n "address" : "1LvyrttP3uoG7xSCjWqn5e46bRfZqmnsq4",\n "index" : 37,\n "callback" : "https://bitminepool.com/bitcoin_system/production/payment/callback.php?invoice=4291339&secret=10081988Mangesh"\n}', '2018-08-15 15:24:42', '2018-08-15 15:24:42'), (75, '15-08-2018', '2376757', 'Starter', '1AMWyUqCd8AT8HZrbzMYJQS14668cSff1T', '300', '0.04772899', 'Paid', 'meettomangesh@gmail.com', '{\n "address" : "1AMWyUqCd8AT8HZrbzMYJQS14668cSff1T",\n "index" : 38,\n "callback" : "https://bitminepool.com/bitcoin_system/production/payment/callback.php?invoice=2376757&secret=10081988Mangesh"\n}', '2018-08-15 15:48:15', '2018-08-15 15:48:15'); -- -------------------------------------------------------- -- -- Table structure for table `mediumpack` -- CREATE TABLE `mediumpack` ( `id` int(11) NOT NULL, `PurchaseDate` varchar(250) NOT NULL, `MiningDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `CompletionDate` varchar(250) NOT NULL, `TotalMinable` varchar(250) NOT NULL, `Withdrawal` varchar(250) NOT NULL, `Comment` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `mediumpack` -- INSERT INTO `mediumpack` (`id`, `PurchaseDate`, `MiningDate`, `Username`, `Status`, `CompletionDate`, `TotalMinable`, `Withdrawal`, `Comment`, `created_at`, `updated_at`) VALUES (55, '0', '0', 'mshai', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (56, '0', '0', 'meettomangesh@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (57, '0', '0', 'test1@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (58, '0', '0', 'test2@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (59, '0', '0', 'test6@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (60, '0', '0', 'test7@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (61, '0', '0', 'test8@gmail.com', 'Inactive', '0', '2190', '0', 'Not-Purchased', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `mining` -- CREATE TABLE `mining` ( `id` int(100) NOT NULL, `Balance` decimal(14,4) NOT NULL DEFAULT '0.0000', `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `mining` -- INSERT INTO `mining` (`id`, `Balance`, `Username`, `created_at`, `updated_at`) VALUES (56, '69.0000', 'mshai', '2018-08-27 19:45:39', '2018-09-26 16:33:58'), (57, '69.0000', 'meettomangesh@gmail.com', '2018-08-27 19:45:39', '2018-09-26 16:33:58'), (58, '0.0000', 'test1@gmail.com', '2018-08-27 19:45:39', '2018-09-26 16:31:38'), (59, '0.0000', 'test2@gmail.com', '2018-08-27 19:45:39', '2018-09-26 16:31:38'), (60, '0.0000', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (61, '0.0000', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (62, '0.0000', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `minipack` -- CREATE TABLE `minipack` ( `id` int(11) NOT NULL, `PurchaseDate` varchar(250) NOT NULL, `MiningDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `CompletionDate` varchar(250) NOT NULL, `TotalMinable` varchar(250) NOT NULL, `Withdrawal` varchar(250) NOT NULL, `Comment` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `minipack` -- INSERT INTO `minipack` (`id`, `PurchaseDate`, `MiningDate`, `Username`, `Status`, `CompletionDate`, `TotalMinable`, `Withdrawal`, `Comment`, `created_at`, `updated_at`) VALUES (55, '0', '0', 'mshai', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-27 19:48:19', '2018-08-27 19:48:19'), (56, '0', '0', 'meettomangesh@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-27 19:48:19', '2018-08-27 19:48:19'), (57, '0', '0', 'test1@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-27 19:48:19', '2018-08-27 19:48:19'), (58, '0', '0', 'test2@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-27 19:48:19', '2018-08-27 19:48:19'), (59, '0', '0', 'test6@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (60, '0', '0', 'test7@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (61, '0', '0', 'test8@gmail.com', 'Inactive', '0', '1095', '0', 'Not-Purchased', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_access_tokens` -- CREATE TABLE `oauth_access_tokens` ( `access_token` varchar(40) NOT NULL, `client_id` varchar(80) NOT NULL, `user_id` varchar(80) DEFAULT NULL, `expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `scope` varchar(4000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `oauth_access_tokens` -- INSERT INTO `oauth_access_tokens` (`access_token`, `client_id`, `user_id`, `expires`, `scope`) VALUES ('3241da18cae0d9ee2cab4ca0633bfa507a56c673', 'web8989dsad8ff365fdg843839b', NULL, '2022-09-10 16:08:53', NULL); -- -------------------------------------------------------- -- -- Table structure for table `oauth_authorization_codes` -- CREATE TABLE `oauth_authorization_codes` ( `authorization_code` varchar(40) NOT NULL, `client_id` varchar(80) NOT NULL, `user_id` varchar(80) DEFAULT NULL, `redirect_uri` varchar(2000) DEFAULT NULL, `expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `scope` varchar(4000) DEFAULT NULL, `id_token` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `oauth_clients` -- CREATE TABLE `oauth_clients` ( `client_id` varchar(80) NOT NULL, `client_secret` varchar(80) DEFAULT NULL, `redirect_uri` varchar(2000) DEFAULT NULL, `grant_types` varchar(80) DEFAULT NULL, `scope` varchar(4000) DEFAULT NULL, `user_id` varchar(80) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `oauth_clients` -- INSERT INTO `oauth_clients` (`client_id`, `client_secret`, `redirect_uri`, `grant_types`, `scope`, `user_id`) VALUES ('web8989dsad8ff365fdg843839b', '4c7f6f8fa93ghwd4302c0ae8c4aweb', 'https://bitminepool.com/', NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `oauth_jwt` -- CREATE TABLE `oauth_jwt` ( `client_id` varchar(80) NOT NULL, `subject` varchar(80) DEFAULT NULL, `public_key` varchar(2000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `oauth_refresh_tokens` -- CREATE TABLE `oauth_refresh_tokens` ( `refresh_token` varchar(40) NOT NULL, `client_id` varchar(80) NOT NULL, `user_id` varchar(80) DEFAULT NULL, `expires` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `scope` varchar(4000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `oauth_scopes` -- CREATE TABLE `oauth_scopes` ( `scope` varchar(80) NOT NULL, `is_default` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `oauth_users` -- CREATE TABLE `oauth_users` ( `username` varchar(80) NOT NULL, `password` varchar(80) DEFAULT NULL, `first_name` varchar(80) DEFAULT NULL, `last_name` varchar(80) DEFAULT NULL, `email` varchar(80) DEFAULT NULL, `email_verified` tinyint(1) DEFAULT NULL, `scope` varchar(4000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `payments` -- CREATE TABLE `payments` ( `id` int(11) NOT NULL, `Paydate` varchar(250) NOT NULL, `Payuser` varchar(250) NOT NULL, `Amountbtc` varchar(250) NOT NULL, `Amountusd` varchar(250) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `payments` -- INSERT INTO `payments` (`id`, `Paydate`, `Payuser`, `Amountbtc`, `Amountusd`) VALUES (29, '2018-07-22', 'mshai', '0.01356391', '101.15882695'), (30, '2018-07-22', 'meettomangesh@gmail.com', '0.01356391', '101.15882695'), (31, '2018-07-22', 'mshai', '0.01356391', '101.15882695'), (32, '2018-07-22', 'meettomangesh@gmail.com', '0.01356391', '101.15882695'), (33, '2018-08-15', 'meettomangesh@gmail.com', '0', '0'), (34, '2018-08-15', 'meettomangesh@gmail.com', '0.01584199', '0.00631234'), (35, '2018-08-15', 'test1@gmail.com', '0.01584199', '0.00631234'), (36, '2018-08-15', 'test4@gmail.com', '0.01584199', '0.00631234'), (37, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (38, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (39, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (40, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (41, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (42, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (43, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (44, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (45, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (46, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (47, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (48, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (49, '2018-08-15', 'meettomangesh@gmail.com', '0.0155469', '0.00643215'), (50, '2018-08-15', 'meettomangesh@gmail.com', '369.51206051', '152.87657538'), (51, '2018-08-15', 'meettomangesh@gmail.com', '369.51206051', '152.87657538'), (52, '2018-08-15', 'meettomangesh@gmail.com', '0.0466407', '0.01929645'), (53, '2018-08-15', 'meettomangesh@gmail.com', '0.01579454', '0.0063313'), (54, '2018-08-15', 'meettomangesh@gmail.com', '0.01579454', '0.0063313'); -- -------------------------------------------------------- -- -- Table structure for table `payment_callback_log` -- CREATE TABLE `payment_callback_log` ( `id` int(10) NOT NULL, `username` varchar(250) DEFAULT NULL, `invoice_id` varchar(250) DEFAULT NULL, `amount_btc` varchar(250) DEFAULT NULL, `current_amount_btc` varchar(250) DEFAULT NULL, `amount_usd` varchar(250) DEFAULT NULL, `response` text, `status` enum('1','2') NOT NULL DEFAULT '1' COMMENT '1:Unpaid/Pending', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payment_callback_log` -- INSERT INTO `payment_callback_log` (`id`, `username`, `invoice_id`, `amount_btc`, `current_amount_btc`, `amount_usd`, `response`, `status`, `created_at`) VALUES (2, 'meettomangesh@gmail.com', '4291339', '0.04772899', '0.0155469', '0.00643215', '{"invoice":"4291339","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"100"}', '1', '2018-08-15 15:37:35'), (3, 'meettomangesh@gmail.com', '2643300', '0.01672678', '0.0155469', '0.00643215', '{"invoice":"2643300","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"100"}', '1', '2018-08-15 15:46:45'), (4, 'meettomangesh@gmail.com', '2376757', '0.04772899', '369.51206051', '152.87657538', '{"invoice":"2376757","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"2376757"}', '1', '2018-08-15 15:49:22'), (5, 'meettomangesh@gmail.com', '2376757', '0.04772899', '0.0466407', '300 - ', '{"invoice":"2376757","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"300"}', '1', '2018-08-15 16:02:56'), (6, 'meettomangesh@gmail.com', '2643300', '0.01672678', '0.01579454', '100', '{"invoice":"2643300","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"100"}', '1', '2018-08-15 16:45:29'), (7, 'meettomangesh@gmail.com', '2643300', '0.01672678', '0.01579454', '100', '{"invoice":"2643300","transaction_hash":"ttyytuytf","secret":"10081988Mangesh","value":"100","confirmations":"4"}', '2', '2018-08-15 16:47:04'); -- -------------------------------------------------------- -- -- Table structure for table `rank` -- CREATE TABLE `rank` ( `id` int(100) NOT NULL, `Rank` varchar(250) NOT NULL, `Rankid` varchar(50) NOT NULL, `Username` varchar(250) NOT NULL, `Sponsor` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `rank` -- INSERT INTO `rank` (`id`, `Rank`, `Rankid`, `Username`, `Sponsor`, `created_at`, `updated_at`) VALUES (59, 'Miner', '1', 'mshai', 'mshai', '2018-08-27 19:42:41', '2018-08-27 19:42:41'), (60, 'Miner', '1', 'meettomangesh@gmail.com', 'mshai ', '2018-08-27 19:42:41', '2018-08-27 19:42:41'), (61, 'Miner', '1', 'test1@gmail.com', 'meettomangesh@gmail.com ', '2018-08-27 19:42:41', '2018-08-27 19:42:41'), (62, 'Miner', '1', 'test2@gmail.com', 'meettomangesh@gmail.com ', '2018-08-27 19:42:41', '2018-08-27 19:42:41'), (63, 'Miner', '1', 'test6@gmail.com', 'mshai', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (64, 'Miner', '1', 'test7@gmail.com', 'mshai', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (65, 'Miner', '1', 'test8@gmail.com', 'mshai', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `register` -- CREATE TABLE `register` ( `id` int(11) NOT NULL, `EntryDate` varchar(250) NOT NULL, `Amount` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `register` -- INSERT INTO `register` (`id`, `EntryDate`, `Amount`, `Username`, `created_at`, `updated_at`) VALUES (53, '2018-07-22', '100', 'mshai', '2018-08-27 19:50:09', '2018-08-27 19:50:09'), (54, '2018-08-15', '100', 'meettomangesh@gmail.com', '2018-08-27 19:50:09', '2018-08-27 19:50:09'), (55, '2018-08-15', '100', 'test1@gmail.com', '2018-08-27 19:50:09', '2018-08-27 19:50:09'), (56, '0', '0', 'test2@gmail.com', '2018-08-27 19:50:09', '2018-08-27 19:50:09'), (57, '0', '0', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (58, '0', '0', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (59, '0', '0', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `starterpack` -- CREATE TABLE `starterpack` ( `id` int(11) NOT NULL, `PurchaseDate` varchar(250) NOT NULL, `MiningDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `CompletionDate` varchar(250) NOT NULL, `TotalMinable` varchar(250) NOT NULL, `Withdrawal` varchar(250) NOT NULL, `Comment` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `starterpack` -- INSERT INTO `starterpack` (`id`, `PurchaseDate`, `MiningDate`, `Username`, `Status`, `CompletionDate`, `TotalMinable`, `Withdrawal`, `Comment`, `created_at`, `updated_at`) VALUES (56, '2018-07-22', '2018-08-12', 'mshai', 'Active', '2019-07-22', '547.50', '0', 'Purchased', '2018-08-27 19:47:31', '2018-08-27 19:47:31'), (58, '0', '0', 'test1@gmail.com', 'Inactive', '0', '547.50', '0', 'Not-Purchased', '2018-08-27 19:47:31', '2018-08-27 19:47:31'), (59, '0', '0', 'test2@gmail.com', 'Inactive', '0', '547.50', '0', 'Not-Purchased', '2018-08-27 19:47:31', '2018-08-27 19:47:31'), (60, '2018-07-22', '2018-08-12', 'meettomangesh@gmail.com', 'Active', '2019-07-22', '547.50', '0', 'Purchased', '2018-08-27 19:47:31', '2018-08-27 19:47:31'), (61, '0', '0', 'test6@gmail.com', 'Inactive', '0', '547.50', '0', 'Not-Purchased', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (62, '0', '0', 'test7@gmail.com', 'Inactive', '0', '547.50', '0', 'Not-Purchased', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (63, '0', '0', 'test8@gmail.com', 'Inactive', '0', '547.50', '0', 'Not-Purchased', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `support` -- CREATE TABLE `support` ( `id` int(100) NOT NULL, `ticket_id` varchar(250) NOT NULL, `date` date DEFAULT NULL, `user_name` varchar(250) NOT NULL, `issue` text, `status` enum('1','2','3') NOT NULL DEFAULT '1' COMMENT '1:Pending 2:Processed 3:Deleted', `category` enum('1','2','3','4') NOT NULL DEFAULT '4' COMMENT '1:Registration 2:Account Activation 3:Payment 4: Others', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `support` -- INSERT INTO `support` (`id`, `ticket_id`, `date`, `user_name`, `issue`, `status`, `category`, `created_at`, `updated_at`) VALUES (7, '123456', '2018-09-20', 'meettomangesh@gmail.com', 'fsdfgsdf', '1', '1', '2018-09-20 14:35:47', '2018-09-20 14:35:47'), (8, '123456', '2018-09-20', 'meettomangesh@gmail.com', 'fsdfgsdf', '1', '1', '2018-09-20 14:37:19', '2018-09-20 14:37:19'); -- -------------------------------------------------------- -- -- Table structure for table `team` -- CREATE TABLE `team` ( `id` int(100) NOT NULL, `Balance` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `team` -- INSERT INTO `team` (`id`, `Balance`, `Username`, `created_at`, `updated_at`) VALUES (94, '0.03', 'mshai', '2018-08-27 19:40:42', '2018-09-26 16:33:58'), (95, '0', 'meettomangesh@gmail.com', '2018-08-27 19:40:42', '2018-09-26 16:31:38'), (96, '0', 'test1@gmail.com', '2018-08-27 19:40:42', '2018-08-27 19:40:42'), (97, '0', 'test2@gmail.com', '2018-08-27 19:40:42', '2018-08-27 19:40:42'), (98, '0', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (99, '0', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (100, '0', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `teamvolume` -- CREATE TABLE `teamvolume` ( `id` int(100) NOT NULL, `Balance` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `teamvolume` -- INSERT INTO `teamvolume` (`id`, `Balance`, `Username`, `created_at`, `updated_at`) VALUES (88, '300', 'mshai', '2018-08-27 19:42:01', '2018-08-27 19:42:01'), (89, '11400', 'meettomangesh@gmail.com', '2018-08-27 19:42:01', '2018-08-27 19:42:01'), (90, '0', 'test1@gmail.com', '2018-08-27 19:42:01', '2018-08-27 19:42:01'), (91, '0', 'test2@gmail.com', '2018-08-27 19:42:01', '2018-08-27 19:42:01'), (92, '0', 'test6@gmail.com', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (93, '0', 'test7@gmail.com', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (94, '0', 'test8@gmail.com', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `tree` -- CREATE TABLE `tree` ( `id` int(11) NOT NULL, `userid` varchar(250) DEFAULT NULL, `left` varchar(250) DEFAULT NULL, `right` varchar(250) DEFAULT NULL, `leftcount` int(50) DEFAULT '0', `rightcount` int(50) DEFAULT '0', `leftcredits` int(50) DEFAULT '0', `rightcredits` int(50) DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `tree` -- INSERT INTO `tree` (`id`, `userid`, `left`, `right`, `leftcount`, `rightcount`, `leftcredits`, `rightcredits`) VALUES (74, 'mshai', 'meettomangesh@gmail.com', '', 3, 0, 0, 0), (75, 'meettomangesh@gmail.com', 'testabc@gmail.com', 'test1@gmail.com', 0, 3, 0, 0), (76, 'test1@gmail.com', 'test2@gmail.com', NULL, 0, 0, 0, 0), (81, 'test2@gmail.com', 'test3@gmail.com', NULL, 0, 0, 0, 0), (86, 'test3@gmail.com', 'test4@gmail.com', NULL, 0, 0, 0, 0), (82, 'testabc@gmail.com', NULL, NULL, 0, 0, 0, 0), (87, 'test4@gmail.com', NULL, NULL, 0, 0, 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `tree_cycle_log` -- CREATE TABLE `tree_cycle_log` ( `id` int(11) NOT NULL, `parent_user_name` varchar(250) DEFAULT NULL, `child_user_name` varchar(250) DEFAULT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `ultimatepack` -- CREATE TABLE `ultimatepack` ( `id` int(11) NOT NULL, `PurchaseDate` varchar(250) NOT NULL, `MiningDate` varchar(250) NOT NULL, `Username` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `CompletionDate` varchar(250) NOT NULL, `TotalMinable` varchar(250) NOT NULL, `Withdrawal` varchar(250) NOT NULL, `Comment` varchar(250) NOT NULL, `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `ultimatepack` -- INSERT INTO `ultimatepack` (`id`, `PurchaseDate`, `MiningDate`, `Username`, `Status`, `CompletionDate`, `TotalMinable`, `Withdrawal`, `Comment`, `created_at`, `updated_at`) VALUES (55, '0', '0', 'mshai', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (56, '0', '0', 'meettomangesh@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (57, '0', '0', 'test1@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (58, '0', '0', 'test2@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-27 19:49:24', '2018-08-27 19:49:24'), (59, '0', '0', 'test6@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (60, '0', '0', 'test7@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (61, '0', '0', 'test8@gmail.com', 'Inactive', '0', '8760', '0', 'Not-Purchased', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `Username` varchar(100) NOT NULL, `under_userid` varchar(50) NOT NULL, `side` enum('left','right') NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `Username`, `under_userid`, `side`) VALUES (54, 'meettomangesh@gmail.com', 'mshai', 'left'), (55, 'test1@gmail.com', 'meettomangesh@gmail.com', 'left'), (60, 'test2@gmail.com', 'meettomangesh@gmail.com', 'right'), (61, 'testabc@gmail.com', 'meettomangesh@gmail.com', 'left'), (62, 'testabc@gmail.com', 'meettomangesh@gmail.com', 'left'), (63, 'testabc@gmail.com', 'meettomangesh@gmail.com', 'left'), (64, 'testabc@gmail.com', 'meettomangesh@gmail.com', 'right'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(100) NOT NULL, `Fullname` varchar(250) NOT NULL, `Country` varchar(250) NOT NULL, `Email` varchar(250) NOT NULL, `Telephone` varchar(250) NOT NULL, `Gender` varchar(50) NOT NULL, `Username` varchar(250) NOT NULL, `Password` varchar(250) NOT NULL, `Status` varchar(250) NOT NULL, `Sponsor` varchar(250) NOT NULL, `Token` varchar(250) NOT NULL, `Account` varchar(250) NOT NULL, `Activation` varchar(250) NOT NULL, `treestatus` varchar(250) NOT NULL, `platform` enum('1','2','3') NOT NULL DEFAULT '3' COMMENT '1:Android 2:IOS,3:Web', `is_wallet_user` enum('1','2') NOT NULL DEFAULT '2' COMMENT '1:Yes 2: No', `is_admin_user` enum('1','2') NOT NULL DEFAULT '2' COMMENT '1:Yes 2: No', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `Fullname`, `Country`, `Email`, `Telephone`, `Gender`, `Username`, `Password`, `Status`, `Sponsor`, `Token`, `Account`, `Activation`, `treestatus`, `platform`, `is_wallet_user`, `is_admin_user`, `created_at`, `updated_at`) VALUES (89, 'Mshai', 'Kenya', 'family88@bitcoinminehub.com', '33446611', '2', 'mshai', '123', 'Close', '', '14685', '24rgxpwex1b4ko88owko ', '1', 'tree', '3', '2', '1', '2018-08-27 19:37:23', '2018-08-27 19:37:23'), (90, 'mangesh', 'India', 'meettomangesh@gmail.com', '7567567', '1', 'meettomangesh@gmail.com', '7u8i9o0p', 'Close', 'mshai ', '294570', '42pswl2ze2gwg8c8gcg8 ', '1', 'tree', '3', '2', '2', '2018-08-27 19:37:23', '2018-08-27 19:37:23'), (91, 'Mangesh Navale', 'India', 'test1@gmail.com', '65765765', '1', 'test1@gmail.com', '7u8i9o0p', 'Close', 'meettomangesh@gmail.com ', '646148', 'darlrulbrvsokwoookk0 ', '1', 'tree', '3', '2', '2', '2018-08-27 19:37:23', '2018-08-27 19:37:23'), (92, 'Mangesh Navale', 'India', 'test2@gmail.com', '645656', '1', 'test2@gmail.com', '7u8i9o0p', 'Close', 'meettomangesh@gmail.com ', '854139', '2n4xpqp6fygww80gggkk ', '1', 'tree', '3', '2', '2', '2018-08-27 19:37:23', '2018-08-27 19:37:23'), (93, 'Mangesh Navale', 'India', 'test6@gmail.com', '9730872969', 'Male', 'test3@gmail.com', '7u8i9o0p', 'Open', 'mshai', '455ter', 'ABIABIB&yt78tgg8g', '0', 'tree', '3', '2', '2', '2018-08-27 23:52:22', '2018-08-27 23:52:22'), (94, 'Mangesh Navale', 'India', 'test4@gmail.com', '9730872969', 'Male', 'test4@gmail.com', '7u8i9o0p', 'Open', 'mshai', '223749', 'cxtm97b1a74k048sg4o4', '0', 'tree', '3', '2', '2', '2018-08-28 00:06:51', '2018-08-28 00:06:51'), (95, 'Mangesh Navale', 'India', 'test4@gmail.com', '9730872969', 'Male', 'test8@gmail.com', '7u8i9o0p', 'Open', 'mshai', '355048', '26fxnu32t7ok0o4s0kok', '0', 'tree', '3', '2', '2', '2018-08-28 00:20:59', '2018-08-28 00:20:59'); -- -- Indexes for dumped tables -- -- -- Indexes for table `accountbalance` -- ALTER TABLE `accountbalance` ADD PRIMARY KEY (`id`); -- -- Indexes for table `binaryincome` -- ALTER TABLE `binaryincome` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bmp_bonus_commission_earn_log` -- ALTER TABLE `bmp_bonus_commission_earn_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bmp_pool_benifits` -- ALTER TABLE `bmp_pool_benifits` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bmp_wallet` -- ALTER TABLE `bmp_wallet` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bmp_wallet_sent_receive_transactions` -- ALTER TABLE `bmp_wallet_sent_receive_transactions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `bmp_wallet_withdrawl_transactions` -- ALTER TABLE `bmp_wallet_withdrawl_transactions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `commission` -- ALTER TABLE `commission` ADD PRIMARY KEY (`id`); -- -- Indexes for table `dailymine` -- ALTER TABLE `dailymine` ADD PRIMARY KEY (`id`); -- -- Indexes for table `grandpack` -- ALTER TABLE `grandpack` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hangbtc` -- ALTER TABLE `hangbtc` ADD PRIMARY KEY (`id`); -- -- Indexes for table `hubcoin` -- ALTER TABLE `hubcoin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `invoice` -- ALTER TABLE `invoice` ADD PRIMARY KEY (`id`); -- -- Indexes for table `mediumpack` -- ALTER TABLE `mediumpack` ADD PRIMARY KEY (`id`); -- -- Indexes for table `mining` -- ALTER TABLE `mining` ADD PRIMARY KEY (`id`); -- -- Indexes for table `minipack` -- ALTER TABLE `minipack` ADD PRIMARY KEY (`id`); -- -- Indexes for table `oauth_access_tokens` -- ALTER TABLE `oauth_access_tokens` ADD PRIMARY KEY (`access_token`); -- -- Indexes for table `oauth_authorization_codes` -- ALTER TABLE `oauth_authorization_codes` ADD PRIMARY KEY (`authorization_code`); -- -- Indexes for table `oauth_clients` -- ALTER TABLE `oauth_clients` ADD PRIMARY KEY (`client_id`); -- -- Indexes for table `oauth_refresh_tokens` -- ALTER TABLE `oauth_refresh_tokens` ADD PRIMARY KEY (`refresh_token`); -- -- Indexes for table `oauth_scopes` -- ALTER TABLE `oauth_scopes` ADD PRIMARY KEY (`scope`); -- -- Indexes for table `oauth_users` -- ALTER TABLE `oauth_users` ADD PRIMARY KEY (`username`); -- -- Indexes for table `payments` -- ALTER TABLE `payments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `payment_callback_log` -- ALTER TABLE `payment_callback_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `rank` -- ALTER TABLE `rank` ADD PRIMARY KEY (`id`); -- -- Indexes for table `register` -- ALTER TABLE `register` ADD PRIMARY KEY (`id`); -- -- Indexes for table `starterpack` -- ALTER TABLE `starterpack` ADD PRIMARY KEY (`id`); -- -- Indexes for table `support` -- ALTER TABLE `support` ADD PRIMARY KEY (`id`); -- -- Indexes for table `team` -- ALTER TABLE `team` ADD PRIMARY KEY (`id`); -- -- Indexes for table `teamvolume` -- ALTER TABLE `teamvolume` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tree` -- ALTER TABLE `tree` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tree_cycle_log` -- ALTER TABLE `tree_cycle_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ultimatepack` -- ALTER TABLE `ultimatepack` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `accountbalance` -- ALTER TABLE `accountbalance` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=95; -- -- AUTO_INCREMENT for table `binaryincome` -- ALTER TABLE `binaryincome` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=51; -- -- AUTO_INCREMENT for table `bmp_bonus_commission_earn_log` -- ALTER TABLE `bmp_bonus_commission_earn_log` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `bmp_pool_benifits` -- ALTER TABLE `bmp_pool_benifits` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `bmp_wallet` -- ALTER TABLE `bmp_wallet` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `bmp_wallet_sent_receive_transactions` -- ALTER TABLE `bmp_wallet_sent_receive_transactions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `bmp_wallet_withdrawl_transactions` -- ALTER TABLE `bmp_wallet_withdrawl_transactions` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `commission` -- ALTER TABLE `commission` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63; -- -- AUTO_INCREMENT for table `dailymine` -- ALTER TABLE `dailymine` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29; -- -- AUTO_INCREMENT for table `grandpack` -- ALTER TABLE `grandpack` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62; -- -- AUTO_INCREMENT for table `hangbtc` -- ALTER TABLE `hangbtc` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `hubcoin` -- ALTER TABLE `hubcoin` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=95; -- -- AUTO_INCREMENT for table `invoice` -- ALTER TABLE `invoice` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=76; -- -- AUTO_INCREMENT for table `mediumpack` -- ALTER TABLE `mediumpack` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62; -- -- AUTO_INCREMENT for table `mining` -- ALTER TABLE `mining` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63; -- -- AUTO_INCREMENT for table `minipack` -- ALTER TABLE `minipack` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62; -- -- AUTO_INCREMENT for table `payments` -- ALTER TABLE `payments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55; -- -- AUTO_INCREMENT for table `payment_callback_log` -- ALTER TABLE `payment_callback_log` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `rank` -- ALTER TABLE `rank` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66; -- -- AUTO_INCREMENT for table `register` -- ALTER TABLE `register` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=60; -- -- AUTO_INCREMENT for table `starterpack` -- ALTER TABLE `starterpack` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64; -- -- AUTO_INCREMENT for table `support` -- ALTER TABLE `support` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `team` -- ALTER TABLE `team` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=101; -- -- AUTO_INCREMENT for table `teamvolume` -- ALTER TABLE `teamvolume` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=95; -- -- AUTO_INCREMENT for table `tree` -- ALTER TABLE `tree` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=88; -- -- AUTO_INCREMENT for table `tree_cycle_log` -- ALTER TABLE `tree_cycle_log` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ultimatepack` -- ALTER TABLE `ultimatepack` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=96; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Feb 23, 2019 at 10:18 AM -- Server version: 5.7.22 -- PHP Version: 7.0.30-0ubuntu0.16.04.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `wzW5xdQemU` -- -- -------------------------------------------------------- -- -- Table structure for table `skills` -- CREATE TABLE `skills` ( `id` smallint(5) UNSIGNED NOT NULL, `name` varchar(8) COLLATE utf8_bin NOT NULL, `ordre` smallint(5) UNSIGNED NOT NULL, `expl` varchar(40) COLLATE utf8_bin NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- -- Dumping data for table `skills` -- INSERT INTO `skills` (`id`, `name`, `ordre`, `expl`) VALUES (1, 'explo', 1, 'explorateur'), (2, 'carto', 2, 'cartographe'), (3, 'spy', 6, 'espion'), (4, 'cland', 8, 'clandestin'), (5, 'shield', 10, 'bouclier'), (6, 'shpar', 20, 'parable seulement avec un bouclier'), (7, 'nopar', 21, 'imparable'), (8, 'noesq', 22, 'inesquivable'), (9, 'crit', 30, 'coups critiques'), (10, 'noemb', 40, 'pas de tir embarqué'), (11, 'insub', 50, 'insubbordoné'), (12, 'medic', 60, 'médecin de combat'), (13, 'armarch', 70, 'arrêt marchand'), (14, 'chefchan', 75, 'producteur ou récolteur'), (15, 'produc', 71, 'chef de chantier'), (16, 'regu', 9, 'armée régulière'), (17, 'info', 5, 'informateur'); -- -- Indexes for dumped tables -- -- -- Indexes for table `skills` -- ALTER TABLE `skills` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `name` (`name`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `skills` -- ALTER TABLE `skills` MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; /*!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 */;