blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
dbdef1a2493886051e6b1b0467a6e3e6c80f4a70 | SQL | PreranaChandru/SQL | /HackerRank/Top Earners.sql | UTF-8 | 128 | 2.671875 | 3 | [] | no_license | SELECT (MONTHS * SALARY) AS EARNINGS, COUNT((MONTHS * SALARY))
FROM EMPLOYEE
GROUP BY EARNINGS
ORDER BY EARNINGS DESC
LIMIT 1;
| true |
2a240a69269366438371818b0174d14b23c9713e | SQL | TallesCosta/E-CommerceBooks | /src/main/resources/db/migration/V6__Create_price_group_table.sql | UTF-8 | 203 | 2.625 | 3 | [] | no_license | /*
Create price-group table
*/
CREATE TABLE PriceGroups (
id INT NOT NULL AUTO_INCREMENT,
enabled BOOLEAN NOT NULL,
markup DECIMAL(4,2) NOT NULL,
CONSTRAINT PK_PriceGroup PRIMARY KEY (id)
); | true |
e565a780119b854c72e0cd1a5f1d569b00bafb4f | SQL | Olivvvia/UNSW-COMP3311 | /Prac_Exercise/Prac04.sql | UTF-8 | 2,376 | 4.21875 | 4 | [] | no_license | -- COMP3311 Prac Exercise
--
-- Written by: YOU
-- Q1: how many page accesses on March 2
... replace this line by auxiliary views (or delete it) ...
create view Q1 as
select count(page) from Accesses where acctime like '%-03-02%'
;
-- Q2: how many times was the MessageBoard search facility used?
... replace this line by auxiliary views (or delete it) ...
create or replace view Q2(nsearches) as
select count(*) from accesses where page like '%webcms%messageboard%'
and params like '%state=search%'
;
-- Q3: on which Tuba lab machines were there incomplete sessions?
... replace this line by auxiliary views (or delete it) ...
create view Q3 as
select distinct h.hostname from sessions s
join hosts h on h.id = s.host
where s.complete = 'f' and h.hostname like '%tuba%'
order by h.hostname
;
-- Q4: min,avg,max bytes transferred in page accesses
create view Q4 as
select min(nbytes),round(avg(nbytes)),max(nbytes)
from accesses
;
-- Q5: number of sessions from CSE hosts
create or replace view Q5(nhosts) as
select count(distinct s.id), h.hostname
from hosts h
join sessions s on s.host = h.id
join accesses a on a.session = s.id
where h.hostname like '%cse.unsw.edu.au' and h.hostname is not null
;
-- Q6: number of sessions from non-CSE hosts
create or replace view Q6(nhosts) as
select count(distinct s.id), h.hostname
from hosts h
join sessions s on s.host = h.id
join accesses a on a.session = s.id
where h.hostname not like '%cse.unsw.edu.au'
and h.hostname is not null
;
-- Q7: session id and number of accesses for the longest session?
create view Q7helper as
select session, count(accTime) as ntime from accesses
group by session
;
create view Q7 as
select * from q7helper
where ntime in (select max(ntime) from Q7helper)
;
-- Q8: frequency of page accesses
create view Q8 as
select page,count(*) as freq from accesses
group by page
;
-- Q9: frequency of module accesses
create or replace view Q9(module,freq) as
select
;
-- Q10: "sessions" which have no page accesses
create view Q10 as
select s.id from sessions s
where s.id not in (select session from accesses)
;
-- Q11: hosts which are not the source of any sessions
drop view if exists q11;
create view Q11 as
select h.hostname from hosts h where
h.id not in (select distinct s.host from sessions s
join accesses a on a.session = s.id
) and h.hostname is not null
;
| true |
70b8e4e62acb7aa04021291e726ed334153bd7f4 | SQL | arbrix/mms | /exampl/db/mms.sql | UTF-8 | 2,383 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 23, 2012 at 08:05 PM
-- Server version: 5.1.53
-- PHP Version: 5.3.2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `mms`
--
-- --------------------------------------------------------
--
-- Table structure for table `order`
--
CREATE TABLE IF NOT EXISTS `order` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`userId` varchar(24) NOT NULL,
`amount` decimal(10,2) unsigned NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`comment` varchar(2000) DEFAULT NULL,
`state` int(2) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `order`
--
INSERT INTO `order` (`id`, `userId`, `amount`, `created`, `comment`, `state`) VALUES
(1, '50af7aa0f12a6f7c08000000', '25.00', '2012-11-23 13:36:10', 'test1', 0),
(2, '50af7a71f12a6f740a000001', '10.00', '2012-11-23 13:36:10', 'test2', 0),
(3, '50af7aa0f12a6f7c08000000', '17.00', '2012-11-23 13:36:31', 'test3', 0);
-- --------------------------------------------------------
--
-- Table structure for table `order_item`
--
CREATE TABLE IF NOT EXISTS `order_item` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`orderId` int(10) unsigned NOT NULL,
`itemId` varchar(24) NOT NULL,
`price` decimal(10,2) NOT NULL,
`count` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `order_item`
--
INSERT INTO `order_item` (`id`, `orderId`, `itemId`, `price`, `count`) VALUES
(1, 1, '50af7b17f12a6f7c08000001', '1.00', 10),
(2, 1, '50af7b03f12a6f740a000002', '1.00', 15),
(3, 2, '50af7b17f12a6f7c08000001', '1.00', 4),
(4, 2, '50af7b03f12a6f740a000002', '1.00', 6),
(5, 3, '50af7b17f12a6f7c08000001', '1.00', 9),
(6, 3, '50af7b03f12a6f740a000002', '1.00', 8);
/*!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 */;
| true |
604651c4e1bd5f7604cb6319458aa167e61a7d4c | SQL | Mat4wrk/Functions-for-Manipulating-Data-in-PostgreSQL-Datacamp | /1.Overview of Common Data Types/Searching an ARRAY with @>.sql | UTF-8 | 159 | 2.765625 | 3 | [] | no_license | SELECT
title,
special_features
FROM film
-- Filter where special_features contains 'Deleted Scenes'
WHERE special_features @> ARRAY['Deleted Scenes'];
| true |
67a6103b52fb5ef6631ad7e7f36dfb0309637810 | SQL | TeguhP7/Sidapin-Diskominfo-Kudus | /DB/sidapin.sql | UTF-8 | 5,821 | 2.9375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 06, 2020 at 03:04 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4
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: `sidapin`
--
-- --------------------------------------------------------
--
-- Table structure for table `assets`
--
CREATE TABLE `assets` (
`id_assets` int(11) NOT NULL,
`kode_aset` text NOT NULL,
`nama_aset` text NOT NULL,
`tahun` text NOT NULL,
`kondisi` enum('Baik','Rusak') NOT NULL,
`ket_lain` text,
`foto_aset` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `assets`
--
INSERT INTO `assets` (`id_assets`, `kode_aset`, `nama_aset`, `tahun`, `kondisi`, `ket_lain`, `foto_aset`) VALUES
(1, '23487672HH', 'Laptop Asus Core i7', '2018', 'Rusak', 'Ga ada', 'laptop.jpg'),
(2, '897778GT11', 'Printer JET 86', '2018', 'Rusak', 'Ga ada', 'printer.jpg'),
(3, '342432432POT', 'Komputer DELL Series 10A', '2018', 'Rusak', 'Ga ada', 'komputer.jpg'),
(7, '1117287NUBB', 'Daikin AC 9000', '2012', 'Rusak', 'Masih di gudang', 'ac.jpeg'),
(8, '1117287CV', 'Laptop Asus 2 Core i7', '2018', 'Rusak', 'Lancar', 'laptop.jpg'),
(9, '1117287COC', 'Digitec Wireless Mouse 110', '2018', 'Baik', 'OK', 'mouse.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `inven`
--
CREATE TABLE `inven` (
`id` int(11) NOT NULL,
`id_assets` bigint(50) NOT NULL,
`id_peg` bigint(50) NOT NULL,
`ket_lain` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `inven`
--
INSERT INTO `inven` (`id`, `id_assets`, `id_peg`, `ket_lain`) VALUES
(1, 1, 8, 'Ga ada ah'),
(2, 2, 4, 'Ga ada'),
(3, 3, 4, 'Ga ada'),
(7, 7, 1, 'Masih di gudang'),
(8, 8, 1, 'Lancarr'),
(9, 9, 8, 'OK'),
(10, 8, 11, 'ndak'),
(16, 8, 12, 'sip');
-- --------------------------------------------------------
--
-- Table structure for table `pegawai`
--
CREATE TABLE `pegawai` (
`id_peg` bigint(50) NOT NULL,
`nip_pegawai` bigint(50) NOT NULL,
`nama_pegawai` varchar(50) NOT NULL,
`jabatan` text NOT NULL,
`telepon` text NOT NULL,
`status_p` enum('PNS','Honorer / Kontrak','Lainnya') NOT NULL,
`alamat` text NOT NULL,
`jenis_k` enum('Laki-laki','Perempuan') NOT NULL,
`agama` varchar(20) NOT NULL,
`status` enum('Lajang','Menikah') NOT NULL,
`nama_file` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pegawai`
--
INSERT INTO `pegawai` (`id_peg`, `nip_pegawai`, `nama_pegawai`, `jabatan`, `telepon`, `status_p`, `alamat`, `jenis_k`, `agama`, `status`, `nama_file`) VALUES
(1, 11962176120, 'Dartii', 'Staff', '0874152417', 'PNS', 'Jl. Poll', 'Perempuan', 'Islam', 'Lajang', 'user3x4.png'),
(4, 11962341261, 'Rudi', 'Umum', '0895671282', 'PNS', 'Jl. Menara umum', 'Laki-laki', 'Islam', 'Lajang', 'user3x4.png'),
(8, 11962514321, 'Budiono Wong', 'Kepala Dinas', '082991345672', 'PNS', 'Jl. Mager no. 77, Ds. Jati Kulon', 'Laki-laki', 'Kristen', 'Lajang', 'user3x4.png'),
(9, 11962666091, 'Sunarto', 'Teller', '081245678666', 'PNS', 'Jl. jalankuy', 'Laki-laki', 'Kristen', 'Menikah', 'user3x4.png'),
(11, 11920206712, 'Odading', 'Kepala Divisi', '082177653452', 'PNS', 'Jl. Sambat', 'Laki-laki', 'Islam', 'Menikah', 'user3x4.png'),
(12, 11920288712, 'Arifin', 'Sekretaris', '082177653452', 'PNS', 'Jl. Magang meneh', 'Laki-laki', 'Islam', 'Lajang', 'user3x4.png'),
(13, 11920206888, 'Catur', 'Ketua Pramuka', '083178653153', 'Lainnya', 'Jl. Deket', 'Laki-laki', 'Islam', 'Lajang', 'user3x4.png'),
(14, 11920288714, 'Dadang', 'Kabid', '082177653777', 'PNS', 'Jl. juga', 'Laki-laki', 'Islam', 'Lajang', 'user3x4.png'),
(15, 11976506771, 'Pinta', 'Ibu Negaraa', '082877659354', 'PNS', 'Jl. in aja', 'Perempuan', 'Islam', 'Lajang', 'user3x4.png'),
(17, 11920288713, 'Sari', 'Sekretaris', '082177653452', 'PNS', 'Jl. jalankuyyy', 'Perempuan', 'Islam', 'Lajang', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`status` enum('admin','pegawai') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`username`, `password`, `status`) VALUES
('admin', 'admin', 'admin'),
('bot', 'bot', 'pegawai'),
('kominfo', 'kominfo', 'admin'),
('teguh', 'teguh', 'admin');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `assets`
--
ALTER TABLE `assets`
ADD PRIMARY KEY (`id_assets`);
--
-- Indexes for table `inven`
--
ALTER TABLE `inven`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pegawai`
--
ALTER TABLE `pegawai`
ADD PRIMARY KEY (`id_peg`) USING BTREE,
ADD UNIQUE KEY `id` (`nip_pegawai`) USING BTREE;
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `assets`
--
ALTER TABLE `assets`
MODIFY `id_assets` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `inven`
--
ALTER TABLE `inven`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `pegawai`
--
ALTER TABLE `pegawai`
MODIFY `id_peg` bigint(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
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 */;
| true |
1e66eaa03e17e2e6519ed0c4cd9072e214845dd0 | SQL | MrD0079/portal | /sql/emp_exp.sql | UTF-8 | 1,287 | 3.4375 | 3 | [] | no_license | /* Formatted on 05/08/2014 13:57:55 (QP5 v5.227.12220.39724) */
SELECT ROWNUM,
e.*,
fn_getname (e.emp_tn) emp_name,
fn_getname (e.exp_tn) exp_name,
emp_tn emp_svid,
exp_tn exp_svid,
d_m.dpt_name dpt_name_m,
d_x.dpt_name dpt_name_x,
TO_CHAR (st_m.datauvol, 'dd.mm.yyyy') emp_datauvol,
TO_CHAR (st_x.datauvol, 'dd.mm.yyyy') exp_datauvol
FROM emp_exp e,
spdtree st_m,
spdtree st_x,
departments d_m,
departments d_x
WHERE st_m.svideninn = e.emp_tn
AND st_x.svideninn = e.exp_tn
AND st_m.dpt_id = D_m.DPT_ID
AND st_x.dpt_id = D_x.DPT_ID
AND (st_m.dpt_id = :dpt_id OR st_x.dpt_id = :dpt_id)
AND ( DECODE (:flt,
0, SYSDATE,
1, NVL (st_m.datauvol, SYSDATE),
-1, st_m.datauvol) =
DECODE (:flt, 0, SYSDATE, 1, SYSDATE, -1, st_m.datauvol)
/*OR DECODE (:flt,
0, SYSDATE,
1, NVL (st_x.datauvol, SYSDATE),
-1, st_x.datauvol) =
DECODE (:flt, 0, SYSDATE, 1, SYSDATE, -1, st_x.datauvol)*/)
ORDER BY emp_name, exp_name | true |
df9bad074041a59b753b7673180cfe7ff7face04 | SQL | xiaoya6/Nodejs | /NodejsProject/backEnd/com/wonderlabs/file/sql/design_week_customer_info.sql | UTF-8 | 855 | 2.859375 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50621
Source Host : localhost:3306
Source Database : node_test
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2018-07-17 15:16:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for design_week_customer_info
-- ----------------------------
DROP TABLE IF EXISTS `design_week_customer_info`;
CREATE TABLE `design_week_customer_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'customer id',
`words` varchar(255) DEFAULT NULL COMMENT 'the words recieve from h5 client',
`is_finished` int(1) DEFAULT '0' COMMENT 'finished flag',
`update_datetime` datetime DEFAULT NULL COMMENT 'last update time',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
40febcfa109248c7c27d8b513ae3fa7f696cfa90 | SQL | babamba/sql | /문자열리터럴.sql | UHC | 317 | 2.921875 | 3 | [] | no_license | --ڿ ͷ
select first_name || '----' || last_name as " ڿ" from employees; --θͷ ǥ as ūǥ
select SYSDATE from dual; --¥ ⺻
select to_char(SYSDATE,'YY/MM/DD')from dual;
select TO_CHAR(SYSDATE, 'YYYY-MM-DD hh:mm:ss') from dual; | true |
d6bfb0c44cc8d98d517c124e34b948788d7fa7da | SQL | ProvisionLab/LINCollect | /database/structure/init_users_language.sql | UTF-8 | 363 | 3.15625 | 3 | [] | no_license | USE DBSurveys;
select 'user_language_cross' as '';
CREATE TABLE IF NOT EXISTS User_Language_Cross(
id SERIAL,
user_id BIGINT UNSIGNED NOT NULL,
language_id BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (user_id) REFERENCES User (id)
ON DELETE CASCADE,
FOREIGN KEY (language_id) REFERENCES User_Language (id)
ON DELETE CASCADE
);
| true |
6949b7cbda179a3933c99c6e767cafdaf3bc78ee | SQL | jemoore329/code | /python/dynamo_test/jsonfiles/backup/emailtest/sqlemail/daily_issueid.sql | UTF-8 | 278 | 3.59375 | 4 | [] | no_license | select count(*) as opens, b.publicationname, b.logicalissuename, date(b.live) as live_date, a.issueid
from intake.access_log a, intake.logical_issues b
where a.issueid = b.id
and act = 'open'
and date(b.live) > current_date - 60
group by 2,3,4,5
order by 2 asc, issueid asc
;
| true |
e4607999d97e4b6ebd94147e11f29d4922b8273d | SQL | valber-renan/Aprendendo_MySQL | /aprendendo My SQL/db_construindo_a_nossa_vida.sql | UTF-8 | 2,137 | 3.84375 | 4 | [] | no_license | -- criando banco de dados
create database db_construindo_a_nossa_vida;
-- acionando o banco de dados
use db_construindo_a_nossa_vida
-- criando a tabela categoria
create table tb_categoria(
id bigint auto_increment,
nome varchar(50)not null,
tipo varchar (50)not null,
setor varchar(50),
primary key (id)
)
-- populando a tabela
insert into tb_categoria(nome,tipo,setor) values("construção","alvenaria","construção");
insert into tb_categoria(nome,tipo,setor) values("construção","drywall","construção");
insert into tb_categoria(nome,tipo,setor) values("acabamento","pintura","decoração");
insert into tb_categoria(nome,tipo,setor) values("acabamento","revestimento ","construção");
-- criando a tabela
create table tb_produto(
id bigint auto_increment,
nome varchar(30),
preco decimal(6,2)not null,
tipo_id bigint,
qtd_estoque int,
peso float not null,
primary key (id),
foreign key (tipo_id)references tb_categoria(id)
);
-- populando a tabela
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("bloco",2.00,1,10000,0.300);
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("cimento",20.00,1,50000,50);
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("lata tinta",200.00,3,10000,18);
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("revestimento",150,4,10000,20);
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("viga ",80,1,10000,130);
insert into tb_produto(nome,preco,tipo_id,qtd_estoque,peso)values ("chapa ",25.00,2,10000,.18);
-- chamando os produtos com valor maior que 50
select*from tb_produto where preco>50;
-- chamando os produtos com valor entre 3e 60
select*from tb_produto where preco>3 &&preco<60;
-- produtos que começam com ci
select* from tb_produto where nome like "%ci%";
-- join para chamar a relação das tabelas
select*from tb_produto
inner join tb_categoria on tb_categoria.id = tb_produto.tipo_id;
select tb_produto.nome,tb_produto.preco,tb_categoria.nome
from tb_produto
inner join tb_categoria on tb_categoria.id = tb_produto.tipo_id where tb_categoria.nome like "%acab%";
| true |
121c66c0109dcd55cbc4fe47bbeec102d4e764be | SQL | RubenMaier/PracticaGD1C2017 | /Practica SQL/Resuelto de sql/18.sql | UTF-8 | 1,372 | 3.5 | 4 | [] | no_license | SELECT rubr_detalle 'Rubro',
SUM(item_cantidad*item_precio) 'Total Ventas',
(SELECT TOP 1 prod_codigo
FROM Producto JOIN Item_Factura
ON prod_codigo = item_producto
WHERE prod_rubro = rubr_id
GROUP BY prod_codigo
ORDER BY SUM(item_cantidad) DESC) 'Producto mas Vendido',
ISNULL((SELECT TOP 1 prod_codigo
FROM Producto JOIN Item_Factura
ON prod_codigo = item_producto
WHERE prod_rubro = rubr_id AND prod_codigo != (SELECT TOP 1 prod_codigo
FROM Producto JOIN Item_Factura
ON prod_codigo = item_producto
WHERE prod_rubro = rubr_id
GROUP BY prod_codigo
ORDER BY SUM(item_cantidad) DESC)
GROUP BY prod_codigo
ORDER BY SUM(item_cantidad) DESC) , 0) 'Segundo Producto mas Vendido',
ISNULL((SELECT TOP 1 fact_cliente
FROM Producto
JOIN Item_Factura ON item_producto = prod_codigo
JOIN Factura ON fact_tipo + fact_sucursal + fact_numero = item_tipo + item_sucursal + item_numero
WHERE prod_rubro = rubr_id AND fact_fecha > DATEADD(DAY,-30, (SELECT MAX(fact_fecha) FROM Factura))
GROUP BY fact_cliente
ORDER BY SUM(item_cantidad) DESC),'-') 'Cliente'
FROM Rubro
JOIN Producto ON rubr_id = prod_rubro
JOIN Item_Factura ON prod_codigo = item_producto
GROUP BY rubr_id, rubr_detalle
ORDER BY COUNT(DISTINCT prod_codigo) | true |
27fe0d97548576254f8c25b7f030a0b5adac6af6 | SQL | petarcvetic/magacin | /IN/Staro/db.sql | UTF-8 | 1,816 | 2.875 | 3 | [] | no_license | CREATE TABLE `members` (
`memberID` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`active` varchar(255) NOT NULL,
`resetToken` varchar(255) DEFAULT NULL,
`resetComplete` varchar(3) DEFAULT 'No',
`status` enum('0','1','2','3','4') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1',
PRIMARY KEY (`memberID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `artikli` (
`id_artikla` int(11) NOT NULL,
`id_korisnika` int(11) NOT NULL,
`artikal` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`jedinica_mere` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`cena` decimal(6,2) NOT NULL,
`pdv` int(2) NOT NULL,
`status` enum('0','1','2') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `korisnici` (
`id_korisnika` int(11) NOT NULL,
`korisnik` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`adresa` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`mesto` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`maticni_broj` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`pib` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`sifra_delatnosti` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`telefon` varchar(26) COLLATE utf8_unicode_ci NOT NULL,
`fax` varchar(26) COLLATE utf8_unicode_ci NOT NULL,
`tekuci_racun` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`banka` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`logo` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`dodatak_broju` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`status` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
| true |
8726a6ad16889c0f693b5bb1f561952de673a1a1 | SQL | jacobrees/SQL-Zoo | /6_JOIN.sql | UTF-8 | 1,384 | 4.25 | 4 | [] | no_license | SELECT matchid, player FROM goal
WHERE teamid = 'GER'
SELECT id,stadium,team1,team2 FROM game
WHERE id = 1012
SELECT player, teamid, stadium, mdate FROM game
JOIN goal ON (id=matchid)
WHERE teamid ='GER'
SELECT team1, team2, player FROM game
JOIN goal ON (id=matchid)
WHERE player LIKE 'Mario%'
SELECT player, teamid, coach, gtime FROM goal
JOIN eteam ON (teamid=id)
WHERE gtime<=10
SELECT mdate,teamname FROM game
JOIN eteam ON (team1= eteam.id)
WHERE coach ='Fernando Santos'
SELECT player FROM game
JOIN goal ON(id=matchid)
WHERE stadium = 'National Stadium, Warsaw'
SELECT DISTINCT player FROM game
JOIN goal ON id=matchid
WHERE teamid!='GER' AND (team1='GER' XOR team2='GER')
SELECT teamname, COUNT(gtime)FROM eteam
JOIN goal ON id=teamid
GROUP BY teamname
SELECT stadium, COUNT(gtime)FROM game
JOIN goal ON (id=matchid)
GROUP BY stadium
SELECT matchid,mdate, COUNT(teamid) FROM game
JOIN goal ON matchid = id
WHERE (team1 = 'POL' OR team2 = 'POL')
GROUP BY matchid, mdate
SELECT DISTINCT matchid,mdate, COUNT(teamid) FROM game
JOIN goal ON matchid = id
WHERE (teamid ='GER')
GROUP BY matchid,mdate
SELECT mdate, team1, SUM(CASE WHEN teamid=team1 THEN 1 ELSE 0 END) score1, team2, SUM(CASE WHEN teamid=team2 THEN 1 ELSE 0 END) score2 FROM game
LEFT JOIN goal ON (id=matchid)
GROUP BY mdate, teamid, team1,team2
ORDER BY mdate | true |
41f8bd2d7942ef5d22d0e26a6fddc71d7f615fd1 | SQL | GayatriHushe/Swabhav-Database-Mysql | /swabhav/dept.sql | UTF-8 | 369 | 2.71875 | 3 | [] | no_license | USE SWABHAV;
#CREATE TABLE DEPT ( DEPTNO integer NOT NULL, DNAME varchar(14), LOC varchar(13), CONSTRAINT DEPT_PRIMARY_KEY PRIMARY KEY (DEPTNO));
INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK');
INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
INSERT INTO DEPT VALUES (30,'SALES','CHICAGO');
INSERT INTO DEPT VALUES (40,'OPERATIONS','BOSTON');
SELECT * FROM DEPT; | true |
67401273289bd1e9d16b578ff7d62a3750430771 | SQL | CKudella/corr_data | /intersections_pirckheimer_erasmus/sql_queries/no_epp_per_correspondent_mut_corr_era_pirck/no_epp_sent_by_era_to_mut_corr_era_pirck.sql | UTF-8 | 839 | 3.921875 | 4 | [] | no_license | SELECT DISTINCT EL.recipient_id, EC.name_in_edition,
COUNT(*) AS 'Number of letters sent by Erasmus per mututal correspondent'
FROM era_cdb_v3.letters AS EL, era_cdb_v3.correspondents AS EC,
(SELECT *
FROM era_cdb_v3.correspondents AS X
WHERE X.correspondents_id IN
(SELECT P.correspondents_id
FROM wpirck_cdb_v1.correspondents AS P,
era_cdb_v3.correspondents AS E
WHERE P.correspondents_id = E.correspondents_id
AND P.correspondents_id NOT LIKE 'be1dcbc4-3987-472a-b4a0-c3305ead139f'
AND E.correspondents_id NOT LIKE 'be1dcbc4-3987-472a-b4a0-c3305ead139f')) AS MC
WHERE EL.recipient_id = MC.correspondents_id AND EC.correspondents_id = EL.recipient_id
AND sender_id = '17c580aa-3ba7-4851-8f26-9b3a0ebeadbf'
GROUP BY EL.recipient_id
ORDER BY COUNT(*) DESC
| true |
6c231b282ec8c6825e44ffffd2aeceb412cc932e | SQL | githubken0426/thinking | /thinking-common/src/main/resources/sql/ACL_VC_SIT.sql | UTF-8 | 1,454 | 3.015625 | 3 | [] | no_license | select id,uuid,id_process,POS_SELECTED,sellerplace_code
from t_application where id=435665029;
SELECT * FROM t_application where id between 434666636 and 435666636 order by cdate desc;
select * from t_vendor_order where ID_APPLICATION=435665029;
select * from t_tracking where ID_APPLICATION=435665029;
select * from t_application where id=435667605;
SELECT * FROM T_CONTRACT WHERE ID_APPLICATION = '435662515';
select * from t_application where uuid='19297e59-0130-4d00-8214-2ddde74f2632';
select * from t_timeout_notification where id_application =435662478;
SELECT * FROM t_outbound_result where id_application=435667626 order by id desc;
select * from t_applicant where idcard_nbr='310106198908072892';
select * from t_timeout_notification order by id desc;
update t_applicant set id_province =64 where id_application=435661237;
update t_timeout_notification set status =1 where id_application =435661237;
commit;
explain plan for select distinct t.id_application from t_vendor v
inner join t_vendor_order o on v.id = o.id_vendor
inner join t_trx_journal t on o.id_application = t.id_application
where v.status = 1 and t.id_status = 12
and v.vendor_code = 12
and o.cdate >= to_date('2019-09-24T13:36:13.105')
and o.cdate <= to_date('2019-09-24T13:36:13.105');
explain plan for select * from t_vendor_order where cdate <=to_date(sysdate,'yyyy-mm-dd hh24:mi:ss');
select * from table(dbms_xplan.display); | true |
cb1bd27edfa6d1e99d6c1a150878946cc48c52d3 | SQL | dbrtly-upguard/cosmos | /cosmos-backend/postgres/migrations/0000000000.sql | UTF-8 | 10,740 | 3.265625 | 3 | [
"MIT"
] | permissive | CREATE TABLE connectors (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
docker_image_name TEXT NOT NULL,
docker_image_tag TEXT NOT NULL,
destination_type TEXT NOT NULL,
spec TEXT NOT NULL,
created_at TEXT DEFAULT TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD"T"HH24:MI:SS"Z"'),
updated_at TEXT DEFAULT TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD"T"HH24:MI:SS"Z"'),
UNIQUE(name, type),
UNIQUE(docker_image_name, docker_image_tag)
);
CREATE INDEX connectors_type_idx ON connectors (type);
CREATE TABLE endpoints (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
type TEXT NOT NULL,
connector_id INT NOT NULL REFERENCES connectors (id) ON DELETE CASCADE,
config TEXT NOT NULL,
catalog TEXT NOT NULL,
last_discovered TEXT NOT NULL,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
UNIQUE(name, type)
);
CREATE INDEX endpoints_type_idx ON endpoints (type);
CREATE TABLE syncs (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
source_endpoint_id INT NOT NULL REFERENCES endpoints (id) ON DELETE CASCADE,
destination_endpoint_id INT NOT NULL REFERENCES endpoints (id) ON DELETE CASCADE,
schedule_interval INT NOT NULL,
enabled BOOLEAN NOT NULL,
basic_normalization BOOLEAN NOT NULL,
namespace_definition TEXT NOT NULL,
namespace_format TEXT NOT NULL,
stream_prefix TEXT NOT NULL,
state TEXT NOT NULL,
config TEXT NOT NULL,
configured_catalog TEXT NOT NULL,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
UNIQUE(name)
);
CREATE TABLE runs (
id SERIAL PRIMARY KEY,
sync_id INT NOT NULL REFERENCES syncs (id) ON DELETE CASCADE,
execution_date TEXT NOT NULL,
status TEXT NOT NULL,
stats TEXT NOT NULL,
options TEXT NOT NULL,
temporal_workflow_id TEXT NOT NULL,
temporal_run_id TEXT NOT NULL,
UNIQUE(sync_id, execution_date)
);
CREATE INDEX runs_status_idx ON runs (status);
CREATE INDEX runs_sync_id_idx ON runs (sync_id);
CREATE UNIQUE INDEX runs_sync_id_execution_date_idx ON runs (sync_id, execution_date);
INSERT INTO connectors(name, type, docker_image_name, docker_image_tag, destination_type, spec) VALUES
('Local JSON', 'destination', 'airbyte/destination-local-json', '0.2.8', 'other', '{"type": "SPEC"}'),
('Local CSV', 'destination', 'airbyte/destination-csv', '0.2.8', 'other', '{"type": "SPEC"}'),
('Postgres', 'destination', 'airbyte/destination-postgres', '0.3.8', 'postgres', '{"type": "SPEC"}'),
('BigQuery', 'destination', 'airbyte/destination-bigquery', '0.3.8', 'bigquery', '{"type": "SPEC"}'),
('BigQuery (denormalized typed struct)', 'destination', 'airbyte/destination-bigquery-denormalized', '0.1.1', 'other', '{"type": "SPEC"}'),
('Google Cloud Storage (GCS)', 'destination', 'airbyte/destination-gcs', '0.1.0', 'other', '{"type": "SPEC"}'),
('Google PubSub', 'destination', 'airbyte/destination-pubsub', '0.1.0', 'other', '{"type": "SPEC"}'),
('Snowflake', 'destination', 'airbyte/destination-snowflake', '0.3.11', 'snowflake', '{"type": "SPEC"}'),
('S3', 'destination', 'airbyte/destination-s3', '0.1.9', 'other', '{"type": "SPEC"}'),
('Redshift', 'destination', 'airbyte/destination-redshift', '0.3.12', 'redshift', '{"type": "SPEC"}'),
('MeiliSearch', 'destination', 'airbyte/destination-meilisearch', '0.2.8', 'other', '{"type": "SPEC"}'),
('MySQL', 'destination', 'airbyte/destination-mysql', '0.1.9', 'mysql', '{"type": "SPEC"}'),
('MS SQL Server', 'destination', 'airbyte/destination-mssql', '0.1.6', 'other', '{"type": "SPEC"}'),
('Oracle (Alpha)', 'destination', 'airbyte/destination-oracle', '0.1.3', 'other', '{"type": "SPEC"}'),
('Kafka', 'destination', 'airbyte/destination-kafka', '0.1.0', 'other', '{"type": "SPEC"}')
;
INSERT INTO connectors(name, type, docker_image_name, docker_image_tag, destination_type, spec) VALUES
('Amazon Seller Partner', 'source', 'airbyte/source-amazon-seller-partner', '0.1.3', '', '{"type": "SPEC"}'),
('Asana', 'source', 'airbyte/source-asana', '0.1.1', '', '{"type": "SPEC"}'),
('Exchange Rates Api', 'source', 'airbyte/source-exchange-rates', '0.2.3', '', '{"type": "SPEC"}'),
('File', 'source', 'airbyte/source-file', '0.2.4', '', '{"type": "SPEC"}'),
('Google Ads', 'source', 'airbyte/source-google-ads', '0.1.2', '', '{"type": "SPEC"}'),
('Google Adwords (Deprecated)', 'source', 'airbyte/source-google-adwords-singer', '0.2.6', '', '{"type": "SPEC"}'),
('GitHub', 'source', 'airbyte/source-github', '0.1.2', '', '{"type": "SPEC"}'),
('Microsoft SQL Server (MSSQL)', 'source', 'airbyte/source-mssql', '0.3.3', '', '{"type": "SPEC"}'),
('Pipedrive', 'source', 'airbyte/source-pipedrive', '0.1.0', '', '{"type": "SPEC"}'),
('Postgres', 'source', 'airbyte/source-postgres', '0.3.7', '', '{"type": "SPEC"}'),
('Cockroachdb', 'source', 'airbyte/source-cockroachdb', '0.1.1', '', '{"type": "SPEC"}'),
('PostHog', 'source', 'airbyte/source-posthog', '0.1.2', '', '{"type": "SPEC"}'),
('Recurly', 'source', 'airbyte/source-recurly', '0.2.4', '', '{"type": "SPEC"}'),
('Sendgrid', 'source', 'airbyte/source-sendgrid', '0.2.6', '', '{"type": "SPEC"}'),
('Marketo', 'source', 'airbyte/source-marketo-singer', '0.2.3', '', '{"type": "SPEC"}'),
('Google Sheets', 'source', 'airbyte/source-google-sheets', '0.2.3', '', '{"type": "SPEC"}'),
('MySQL', 'source', 'airbyte/source-mysql', '0.4.0', '', '{"type": "SPEC"}'),
('Salesforce', 'source', 'airbyte/source-salesforce-singer', '0.2.4', '', '{"type": "SPEC"}'),
('Stripe', 'source', 'airbyte/source-stripe', '0.1.14', '', '{"type": "SPEC"}'),
('Mailchimp', 'source', 'airbyte/source-mailchimp', '0.2.5', '', '{"type": "SPEC"}'),
('Google Analytics', 'source', 'airbyte/source-googleanalytics-singer', '0.2.6', '', '{"type": "SPEC"}'),
('Facebook Marketing', 'source', 'airbyte/source-facebook-marketing', '0.2.14', '', '{"type": "SPEC"}'),
('Hubspot', 'source', 'airbyte/source-hubspot', '0.1.5', '', '{"type": "SPEC"}'),
('Klaviyo', 'source', 'airbyte/source-klaviyo', '0.1.1', '', '{"type": "SPEC"}'),
('Shopify', 'source', 'airbyte/source-shopify', '0.1.10', '', '{"type": "SPEC"}'),
('HTTP Request', 'source', 'airbyte/source-http-request', '0.2.4', '', '{"type": "SPEC"}'),
('Redshift', 'source', 'airbyte/source-redshift', '0.3.1', '', '{"type": "SPEC"}'),
('Twilio', 'source', 'airbyte/source-twilio', '0.1.0', '', '{"type": "SPEC"}'),
('Freshdesk', 'source', 'airbyte/source-freshdesk', '0.2.5', '', '{"type": "SPEC"}'),
('Braintree', 'source', 'airbyte/source-braintree-singer', '0.2.3', '', '{"type": "SPEC"}'),
('Greenhouse', 'source', 'airbyte/source-greenhouse', '0.2.3', '', '{"type": "SPEC"}'),
('Zendesk Chat', 'source', 'airbyte/source-zendesk-chat', '0.1.1', '', '{"type": "SPEC"}'),
('Zendesk Support', 'source', 'airbyte/source-zendesk-support-singer', '0.2.3', '', '{"type": "SPEC"}'),
('Intercom', 'source', 'airbyte/source-intercom', '0.1.0', '', '{"type": "SPEC"}'),
('Jira', 'source', 'airbyte/source-jira', '0.2.7', '', '{"type": "SPEC"}'),
('Mixpanel', 'source', 'airbyte/source-mixpanel', '0.1.0', '', '{"type": "SPEC"}'),
('Mixpanel Singer', 'source', 'airbyte/source-mixpanel-singer', '0.2.4', '', '{"type": "SPEC"}'),
('Zoom', 'source', 'airbyte/source-zoom-singer', '0.2.4', '', '{"type": "SPEC"}'),
('Microsoft teams', 'source', 'airbyte/source-microsoft-teams', '0.2.2', '', '{"type": "SPEC"}'),
('Drift', 'source', 'airbyte/source-drift', '0.2.2', '', '{"type": "SPEC"}'),
('Looker', 'source', 'airbyte/source-looker', '0.2.4', '', '{"type": "SPEC"}'),
('Plaid', 'source', 'airbyte/source-plaid', '0.2.1', '', '{"type": "SPEC"}'),
('Appstore', 'source', 'airbyte/source-appstore-singer', '0.2.4', '', '{"type": "SPEC"}'),
('Mongo DB', 'source', 'airbyte/source-mongodb', '0.3.3', '', '{"type": "SPEC"}'),
('Google Directory', 'source', 'airbyte/source-google-directory', '0.1.3', '', '{"type": "SPEC"}'),
('Instagram', 'source', 'airbyte/source-instagram', '0.1.7', '', '{"type": "SPEC"}'),
('Gitlab', 'source', 'airbyte/source-gitlab', '0.1.0', '', '{"type": "SPEC"}'),
('Google Workspace Admin Reports', 'source', 'airbyte/source-google-workspace-admin-reports', '0.1.4', '', '{"type": "SPEC"}'),
('Tempo', 'source', 'airbyte/source-tempo', '0.2.3', '', '{"type": "SPEC"}'),
('Smartsheets', 'source', 'airbyte/source-smartsheets', '0.1.5', '', '{"type": "SPEC"}'),
('Oracle DB', 'source', 'airbyte/source-oracle', '0.3.1', '', '{"type": "SPEC"}'),
('Zendesk Talk', 'source', 'airbyte/source-zendesk-talk', '0.1.2', '', '{"type": "SPEC"}'),
('Quickbooks', 'source', 'airbyte/source-quickbooks-singer', '0.1.2', '', '{"type": "SPEC"}'),
('Iterable', 'source', 'airbyte/source-iterable', '0.1.6', '', '{"type": "SPEC"}'),
('PokeAPI', 'source', 'airbyte/source-pokeapi', '0.1.1', '', '{"type": "SPEC"}'),
('Google Search Console', 'source', 'airbyte/source-google-search-console-singer', '0.1.3', '', '{"type": "SPEC"}'),
('ClickHouse', 'source', 'airbyte/source-clickhouse', '0.1.1', '', '{"type": "SPEC"}'),
('Recharge', 'source', 'airbyte/source-recharge', '0.1.1', '', '{"type": "SPEC"}'),
('Harvest', 'source', 'airbyte/source-harvest', '0.1.3', '', '{"type": "SPEC"}'),
('Amplitude', 'source', 'airbyte/source-amplitude', '0.1.1', '', '{"type": "SPEC"}'),
('Snowflake', 'source', 'airbyte/source-snowflake', '0.1.0', '', '{"type": "SPEC"}'),
('IBM Db2', 'source', 'airbyte/source-db2', '0.1.0', '', '{"type": "SPEC"}'),
('Slack', 'source', 'airbyte/source-slack', '0.1.8', '', '{"type": "SPEC"}'),
('AWS CloudTrail', 'source', 'airbyte/source-aws-cloudtrail', '0.1.1', '', '{"type": "SPEC"}'),
('US Census', 'source', 'airbyte/source-us-census', '0.1.0', '', '{"type": "SPEC"}'),
('Okta', 'source', 'airbyte/source-okta', '0.1.2', '', '{"type": "SPEC"}'),
('Survey Monkey', 'source', 'airbyte/source-surveymonkey', '0.1.0', '', '{"type": "SPEC"}'),
('Square', 'source', 'airbyte/source-square', '0.1.1', '', '{"type": "SPEC"}'),
('Zendesk Sunshine', 'source', 'airbyte/source-zendesk-sunshine', '0.1.0', '', '{"type": "SPEC"}'),
('Paypal Transaction', 'source', 'airbyte/source-paypal-transaction', '0.1.0', '', '{"type": "SPEC"}'),
('Dixa', 'source', 'airbyte/source-dixa', '0.1.0', '', '{"type": "SPEC"}'),
('Typeform', 'source', 'airbyte/source-typeform', '0.1.0', '', '{"type": "SPEC"}')
;
| true |
884799682190231364c9277c2397e34ec614b1c3 | SQL | lDanlte/MusicShop | /db/mysql/migrations/scripts/20170319155232_insert_actions.sql | UTF-8 | 448 | 2.78125 | 3 | [] | no_license | -- // insert actions
-- Migration SQL that makes the change goes here.
INSERT INTO `actions` (`id`,`description`) VALUES (1,'Покупка альбома');
INSERT INTO `actions` (`id`,`description`) VALUES (2,'Перевод денег на счет');
INSERT INTO `actions` (`id`,`description`) VALUES (3,'Перевод денег со счета');
-- //@UNDO
-- SQL to undo the change goes here.
DELETE FROM actions WHERE id IN (1, 2, 3);
| true |
8d16a7bec535476a395a35606a34a536ed9d00bf | SQL | Matteo-Buonastella/SQL | /Lab6.sql | UTF-8 | 3,157 | 4.3125 | 4 | [] | no_license | -- ***********************
-- Name: Matteo Buonastella
-- ID: #########
-- Date: June 14 2017
-- Purpose: Lab 6 DBS301
-- ***********************
-- 1
AUTOCOMMIT ON
-- 2
INSERT INTO EMPLOYEES (FIRST_NAME, LAST_NAME, SALARY, COMMISSION_PCT, DEPARTMENT_ID, MANAGER_ID, HIRE_DATE, EMPLOYEE_ID, EMAIL, JOB_ID)
VALUES ('Matteo', 'Buonastella', null, 0.2, 90,100, SYSDATE, 999, 'WORK', 'IT_PROG')
-- 3
UPDATE EMPLOYEES
SET SALARY = 2500
WHERE LAST_NAME = 'Matos' OR LAST_NAME = 'Whalen';
--4.Display the last names of all employees who are in the same department as the employee named Abel.
--SOLUTION
SELECT LAST_NAME AS "Last Name"
FROM EMPLOYEES
WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID
FROM EMPLOYEES
WHERE LAST_NAME = 'Abel');
--5. Display the last name of the lowest paid employee(s)
--SOLUTION
SELECT LAST_NAME AS "Last Name"
FROM EMPLOYEES
WHERE SALARY = (SELECT MIN(SALARY)
FROM EMPLOYEES);
-- 6.Display the city that the lowest paid employee(s) are located in.
--SOLUTION
SELECT CITY AS City
FROM LOCATIONS JOIN DEPARTMENTS
USING (LOCATION_ID)
JOIN EMPLOYEES
USING(DEPARTMENT_ID)
WHERE SALARY = (SELECT MIN(SALARY)
FROM EMPLOYEES);
--7.Display the last name, department_id, and salary of the lowest paid employee(s)
--in each department. Sort by Department_ID. (HINT: careful with department 60)
--SOLUTION
SELECT LAST_NAME AS "Last Name", DEPARTMENT_ID AS "Department Id", SALARY AS Salary
FROM EMPLOYEES JOIN DEPARTMENTS
USING(DEPARTMENT_ID)
WHERE SALARY IN (SELECT MIN(SALARY)
FROM EMPLOYEES
GROUP BY DEPARTMENT_ID)
ORDER BY DEPARTMENT_ID;
--8.Display the last name of the lowest paid employee(s) in each city
SELECT LAST_NAME AS "Last Name", CITY AS City, SALARY
FROM EMPLOYEES JOIN DEPARTMENTS
USING (DEPARTMENT_ID)
JOIN LOCATIONS
USING(LOCATION_ID)
WHERE SALARY IN (SELECT MIN(SALARY)
FROM EMPLOYEES
JOIN DEPARTMENTS
USING (DEPARTMENT_ID)
JOIN LOCATIONS
USING(LOCATION_ID)
GROUP BY CITY);
--9.Display last name and salary for all employees who earn less than the lowest salary in
--ANY department. Sort the output by top salaries first and then by last name.
--SOLUTION
SELECT LAST_NAME AS "Last Name", SALARY AS "Salary"
FROM EMPLOYEES JOIN DEPARTMENTS
USING(DEPARTMENT_ID)
WHERE SALARY < ANY (SELECT MIN(SALARY)
FROM EMPLOYEES JOIN DEPARTMENTS
USING(DEPARTMENT_ID)
GROUP BY DEPARTMENT_ID)
ORDER BY SALARY DESC, LAST_NAME;
--10.Display last name, job title and salary for all employees whose salary matches
--any of the salaries from the IT Department. Do NOT use Join method.
--Sort the output by salary ascending first and then by last_name
SELECT LAST_NAME AS "Last Name", DEPARTMENT_NAME AS "Job Id", SALARY AS "Salary"
FROM EMPLOYEES e, DEPARTMENTS d
WHERE SALARY = ANY(SELECT SALARY
FROM EMPLOYEES,DEPARTMENTS
WHERE JOB_ID = 'IT_PROG')
AND e.DEPARTMENT_ID = d.DEPARTMENT_ID
| true |
7ea80e64a5f6d16b1b43fac6cd4a7fe6f154e09d | SQL | ottinger/simplecms | /simplecms.sql | UTF-8 | 854 | 2.53125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 10, 2012 at 08:25 AM
-- Server version: 5.1.44
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `simplecms`
--
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE IF NOT EXISTS `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`content` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `posts`
--
| true |
7e7d05cb7c69d4cbb837e19a6e319b862024126a | SQL | toasahi/asahi_portfolio | /asa_farm.sql | UTF-8 | 11,222 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- ホスト: 127.0.0.1
-- 生成日時: 2021-03-26 10:48:24
-- サーバのバージョン: 10.4.14-MariaDB
-- PHP のバージョン: 7.4.11
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 */;
--
-- データベース: `asa_farm`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `categorys`
--
CREATE TABLE `categorys` (
`category_id` int(11) NOT NULL,
`category_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `categorys`
--
INSERT INTO `categorys` (`category_id`, `category_name`) VALUES
(1, 'Spring'),
(2, 'Summer'),
(3, 'Autumn'),
(4, 'Winter');
-- --------------------------------------------------------
--
-- テーブルの構造 `items`
--
CREATE TABLE `items` (
`item_id` int(11) NOT NULL,
`item_name` varchar(100) NOT NULL,
`item_price` int(11) NOT NULL,
`item_stocks` int(11) NOT NULL,
`description` varchar(200) NOT NULL,
`item_image` text NOT NULL,
`user_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`created_date` datetime NOT NULL DEFAULT current_timestamp(),
`updated_date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `items`
--
INSERT INTO `items` (`item_id`, `item_name`, `item_price`, `item_stocks`, `description`, `item_image`, `user_id`, `category_id`, `created_date`, `updated_date`) VALUES
(1, 'トマト', 500, 974, 'AsaFarmで作られたトマトです。', 'item1.png', 1, 2, '2021-03-10 18:32:59', '2021-03-26 18:29:37'),
(2, 'ジャガイモ', 350, 270, '北海道産のじゃがいも。普段はポテトチップスに使われているよ。', 'item2.png', 1, 1, '2021-03-11 15:24:31', '2021-03-18 18:07:03'),
(3, 'キャベツ', 200, 9869, '有機栽培で作りました。体にやさしいキャベツです。', 'item3.png', 1, 1, '2021-03-12 18:49:32', '2021-03-24 18:35:27'),
(5, 'タマネギ', 398, 20000, '淡路島の家族が丹精込めて作ったタマネギです。', 'item5.png', 1, 1, '2021-03-16 16:35:47', '2021-03-24 18:35:41'),
(6, 'ブロッコリー', 200, 90, 'シチューやサラダ、カレーにも合います。', 'Group 11.png', 1, 4, '2021-03-16 16:43:22', '2021-03-19 16:18:56'),
(9, 'ナス', 250, 996, '野菜嫌いな子供たちのために作った最高の逸品です。', 'item4.png', 1, 2, '2021-03-18 18:05:18', '2021-03-18 18:05:53'),
(10, 'アスパラガス', 350, 97, '葉のように見えるものは実際は極端にほそく細かく分枝した茎。\r\n丹精込めて育てました。', 'Group 12.png', 1, 4, '2021-03-19 16:20:51', '2021-03-19 16:20:51'),
(11, 'ニンジン', 358, 490, 'カレー、煮物、にんじんしりしりにおすすめします。とても豊潤で甘くくせになる一品となりました。', 'Group 10.png', 1, 4, '2021-03-19 16:22:53', '2021-03-19 16:22:53'),
(12, 'パプリカ', 400, 194, '日本ではさぞかし有名となった野菜でした。今日の晩御飯はパプリカにきまり!パプリカ花が咲いたらー', 'Group 13.png', 1, 2, '2021-03-19 16:34:56', '2021-03-19 16:34:56'),
(13, 'ダイコン', 100, 200, '形が不揃いのため安く販売しています。在庫が少ないため早い者勝ちになります。', 'Group 14.png', 1, 4, '2021-03-19 16:36:38', '2021-03-19 16:36:38'),
(14, 'サツマイモ', 500, 287, 'とても甘いサツマイモです。ぜひご賞味あれ。', 'Group 15 (1).png', 1, 3, '2021-03-19 18:32:16', '2021-03-19 18:32:16'),
(15, 'レンコン', 350, 197, '煮物、レンコンチップスなどおいしい食べ方がたくさんあります。', 'Group 16.png', 1, 3, '2021-03-19 18:41:27', '2021-03-19 18:41:27');
-- --------------------------------------------------------
--
-- テーブルの構造 `orders`
--
CREATE TABLE `orders` (
`order_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`buy_quantity` int(11) NOT NULL,
`ordered_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `orders`
--
INSERT INTO `orders` (`order_id`, `user_id`, `item_id`, `buy_quantity`, `ordered_date`) VALUES
(30, 2, 2, 1, '2021-03-26 15:20:03'),
(31, 1, 12, 4, '2021-03-26 15:25:30');
-- --------------------------------------------------------
--
-- テーブルの構造 `receipts`
--
CREATE TABLE `receipts` (
`receipt_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`purchase_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`purchase_items`)),
`receipts_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `receipts`
--
INSERT INTO `receipts` (`receipt_id`, `user_id`, `purchase_items`, `receipts_date`) VALUES
(2, 4, '[{\"item_id\":\"2\",\"buy_quantity\":\"10\"},{\"item_id\":\"3\",\"buy_quantity\":\"10\"}]', '2021-03-23 17:22:05'),
(3, 4, '[{\"item_id\":\"3\",\"buy_quantity\":\"10\"}]', '2021-03-23 18:20:14'),
(4, 4, '[{\"item_id\":\"3\",\"buy_quantity\":\"10\"}]', '2021-03-23 18:21:30'),
(5, 4, '[{\"item_id\":\"6\",\"buy_quantity\":\"4\"},{\"item_id\":\"5\",\"buy_quantity\":\"1\"}]', '2021-03-23 18:22:10'),
(6, 2, '[{\"item_id\":\"11\",\"buy_quantity\":\"10\"}]', '2021-03-23 18:40:50'),
(7, 4, '[{\"item_id\":\"12\",\"buy_quantity\":\"2\"}]', '2021-03-24 17:20:39'),
(8, 2, '[{\"item_id\":\"15\",\"buy_quantity\":\"3\"}]', '2021-03-24 18:04:33'),
(9, 4, '[{\"item_id\":\"6\",\"buy_quantity\":\"6\"},{\"item_id\":\"10\",\"buy_quantity\":\"3\"},{\"item_id\":\"9\",\"buy_quantity\":\"4\"}]', '2021-03-24 18:08:44'),
(10, 1, '[{\"item_id\":\"2\",\"buy_quantity\":\"9\"}]', '2021-03-24 18:10:17'),
(11, 4, '[{\"item_id\":\"3\",\"buy_quantity\":\"1\"}]', '2021-03-26 16:05:37'),
(12, 7, '[{\"item_id\":\"1\",\"buy_quantity\":\"4\"}]', '2021-03-26 18:28:20');
-- --------------------------------------------------------
--
-- テーブルの構造 `reviews`
--
CREATE TABLE `reviews` (
`review_id` int(11) NOT NULL,
`review_text` varchar(200) NOT NULL,
`user_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`created_date` datetime NOT NULL DEFAULT current_timestamp(),
`updated_date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `reviews`
--
INSERT INTO `reviews` (`review_id`, `review_text`, `user_id`, `item_id`, `created_date`, `updated_date`) VALUES
(1, 'おたけサイコチョー', 2, 1, '2021-03-17 18:27:02', '2021-03-17 18:27:02'),
(2, 'ジャガビー、ポテチ、あとじゃがりこ', 2, 2, '2021-03-17 18:29:08', '2021-03-17 18:29:08'),
(3, 'ジャガビー、ポテ', 2, 2, '2021-03-17 18:31:14', '2021-03-17 18:31:14'),
(4, '別に君を求めてないけど、君といられると思い出す、君のソラニン&チャコニン,もう毒素の一種なんだー!!', 2, 2, '2021-03-17 18:33:57', '2021-03-17 18:33:57'),
(5, 'こんなにおいしいトマトは食べたことがありません。', 4, 1, '2021-03-22 17:33:19', '2021-03-22 17:33:19'),
(6, '今日はフライドポテトとしていただきました。本当においしかったです', 4, 2, '2021-03-26 16:22:44', '2021-03-26 16:22:44'),
(7, 'This tomato is very tasty.', 1, 1, '2021-03-26 18:30:53', '2021-03-26 18:30:53');
-- --------------------------------------------------------
--
-- テーブルの構造 `users`
--
CREATE TABLE `users` (
`user_id` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(100) NOT NULL,
`first_name` varchar(20) NOT NULL,
`last_name` varchar(20) NOT NULL,
`status` varchar(1) NOT NULL DEFAULT 'U',
`created_date` datetime NOT NULL DEFAULT current_timestamp(),
`updated_date` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- テーブルのデータのダンプ `users`
--
INSERT INTO `users` (`user_id`, `username`, `password`, `first_name`, `last_name`, `status`, `created_date`, `updated_date`) VALUES
(1, 'admin', '$2y$10$KR6SZqO7R5F1qe.Exu4fI.E5Df87uUEdHS6EDDkOYBJRny/cWDNvq', 'admin', 'admin', 'A', '2021-03-10 17:21:33', '2021-03-10 17:21:33'),
(2, 'test', '$2y$10$0vPGwiYY/WaGNxB4HAh.DuFb0QHLECgn1oDO.KqY5HyQs/iimibgW', 'test', 'test', 'U', '2021-03-10 18:22:02', '2021-03-10 18:22:02'),
(3, '', '$2y$10$DX0mShOxJayGy1Js8bN0DOsvpfblqfTHhGb7ajGFj0gzMY1bOOKve', '', '', 'U', '2021-03-15 16:24:58', '2021-03-15 16:24:58'),
(4, 'natu', '$2y$10$Bxf2hEcWiJBWbpj6FkVGL.QpHoZivqS.LxAmR6oqw3r/s47IEZ/86', 'Natu', 'Doragonil', 'U', '2021-03-17 16:15:23', '2021-03-17 16:15:23'),
(5, '', '$2y$10$hWJRNem1FDO.gW3kh3eD4OpIIkBdtar0wULpDNAca3AtgqZv2Tj1K', '', '', 'U', '2021-03-18 18:36:48', '2021-03-18 18:36:48'),
(6, 'asa', '$2y$10$.MzDsa3X.rYyIOLC/Hgl..gSiONgQ/SRFnx8fpnWWyeOyLoPAoG36', 'to', 'as', 'U', '2021-03-26 18:06:45', '2021-03-26 18:06:45'),
(7, 'mac', '$2y$10$vH9bdKjYPX/5WyInJrLko.sGIVJ39s9RRIBNhcFRFdW0pHC78t6xm', 'mac', 'get', 'U', '2021-03-26 18:27:37', '2021-03-26 18:27:37');
--
-- ダンプしたテーブルのインデックス
--
--
-- テーブルのインデックス `categorys`
--
ALTER TABLE `categorys`
ADD PRIMARY KEY (`category_id`);
--
-- テーブルのインデックス `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`item_id`);
--
-- テーブルのインデックス `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`order_id`);
--
-- テーブルのインデックス `receipts`
--
ALTER TABLE `receipts`
ADD PRIMARY KEY (`receipt_id`);
--
-- テーブルのインデックス `reviews`
--
ALTER TABLE `reviews`
ADD PRIMARY KEY (`review_id`);
--
-- テーブルのインデックス `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`);
--
-- ダンプしたテーブルのAUTO_INCREMENT
--
--
-- テーブルのAUTO_INCREMENT `categorys`
--
ALTER TABLE `categorys`
MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- テーブルのAUTO_INCREMENT `items`
--
ALTER TABLE `items`
MODIFY `item_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- テーブルのAUTO_INCREMENT `orders`
--
ALTER TABLE `orders`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- テーブルのAUTO_INCREMENT `receipts`
--
ALTER TABLE `receipts`
MODIFY `receipt_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- テーブルのAUTO_INCREMENT `reviews`
--
ALTER TABLE `reviews`
MODIFY `review_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- テーブルのAUTO_INCREMENT `users`
--
ALTER TABLE `users`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
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 */;
| true |
982ddb2b76ed44efe8aab9b1fae0bdb689cc5dd8 | SQL | tedovn/Project---AtleticApp | /Web/phpappdb (1).sql | UTF-8 | 4,078 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2014 at 05:17 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `phpappdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `alcoholic beverages`
--
CREATE TABLE IF NOT EXISTS `alcoholic beverages` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`calories_id` int(11) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `consumed_drinks`
--
CREATE TABLE IF NOT EXISTS `consumed_drinks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alcoholic_beverages` int(11) NOT NULL,
`soft_drinks` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `consumed_foods`
--
CREATE TABLE IF NOT EXISTS `consumed_foods` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`cons_fruits` int(11) DEFAULT NULL,
`cons_vegetables` int(11) DEFAULT NULL,
`cons_meats` int(11) DEFAULT NULL,
`cons_desserts` int(11) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `food_dessert`
--
CREATE TABLE IF NOT EXISTS `food_dessert` (
`id` int(11) NOT NULL,
`type` varchar(20) NOT NULL,
`calories_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `food_fruits`
--
CREATE TABLE IF NOT EXISTS `food_fruits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(20) DEFAULT NULL,
`calories_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `food_meats`
--
CREATE TABLE IF NOT EXISTS `food_meats` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`calories_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `food_vegetables`
--
CREATE TABLE IF NOT EXISTS `food_vegetables` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`food_vegetables` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `info_recev_cons_calories`
--
CREATE TABLE IF NOT EXISTS `info_recev_cons_calories` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`daily_calories` int(11) DEFAULT NULL,
`daily_activities` int(11) DEFAULT NULL,
`daily_result` int(11) DEFAULT NULL,
`days` int(11) DEFAULT NULL,
`weekly_result` int(11) DEFAULT NULL,
`monthly_result` int(11) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `soft_drinks`
--
CREATE TABLE IF NOT EXISTS `soft_drinks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`calories_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
8c71a32ffb0fc5e272ab0e40426343d1cc0c2920 | SQL | bellmit/practicas_empresa | /BD/changes25012019.sql | UTF-8 | 10,215 | 2.828125 | 3 | [] | no_license | ALTER TABLE DFEMP RENAME COLUMN FLOTA_AUTOM TO FLOTA_AUTOM_OLD;
ALTER TABLE DFEMP ADD COND_AUTOM VARCHAR2(1);
ALTER TABLE DFEMP ADD VEH_AUTOM VARCHAR2(1);
UPDATE DFEMP SET COND_AUTOM = 'S', VEH_AUTOM='S' WHERE FLOTA_AUTOM_OLD = 'S';
COMMIT;
CREATE OR REPLACE VIEW CDVDFEMP AS
SELECT
DFEMP.CIF,
DFEMP.NOMB,
DFEMP.IS_DEMO,
CG_EMPR,
DOMI,
CG_PROV,
CG_MUNI,
CG_POBL,
CG_POSTAL,
TELF,
FAX,
CIF_CO,
F_FIN_HF,
CL_PROR,
IDENTIFICADOR,
REGI_IDEN,
TIPO_IDEN,
F_ALTA,
EMAIL,
PAG_WEB,
DFEMP.CG_NACI,
DIRECCION,
USUARIO_ALTA,
F_MODIF,
USUARIO_MODIF,
MUNI,
POBL,
OBSR,
TIPO,
IDGRUPO,
MOVIL,
PCONTACTO,
MCONTACTO,
LOCALE,
MAILINFORMEANALISIS,
PAIS.DSCR AS PAIS,
PAIS.PREFIJO AS PREFIJO,
COND_AUTOM,
VEH_AUTOM,
IS_COOPERATIVA,
DFEMP.CIF_COOPERATIVA,
CONTRATO_COOP,
DFEMP.TDI,
DFEMP.TDI_IP,
DFEMP.TDI_PORT,
DFEMP.TDI_USER,
DFEMP.TDI_PASS,
DFEMP.TDI_GROUPID,
DFEMP.GRUPOCLIENTE,
DFEMP.MOVIL2,
DFEMP.Z_ERRORES,
DFEMP.Z_PROCESADO,
DFEMP.Z_FECHA,
DFEMP.EMP_FTPSYNC,
DFEMP.EMP_FTP_URL,
DFEMP.EMP_FTP_USR,
DFEMP.EMP_FTP_PAS,
DFEMP.EMP_FTP_PATH,
DFEMP.CCC,
(SELECT COUNT(*) FROM CDVEHICULOS_EMP WHERE CIF = DFEMP.CIF) AS NUM_VEHICLES
FROM
DFEMP,
PAIS
WHERE
DFEMP.CG_NACI = PAIS.CG_NACI (+);
CREATE OR REPLACE VIEW CDVDFEMP_COOP AS
SELECT
CIF,
NOMB,
CG_EMPR,
DOMI,
CG_PROV,
CG_MUNI,
CG_POBL,
CG_POSTAL,
TELF,
FAX,
CIF_CO,
F_FIN_HF,
CL_PROR,
IDENTIFICADOR,
REGI_IDEN,
TIPO_IDEN,
F_ALTA,
EMAIL,
PAG_WEB,
DFEMP.CG_NACI,
DIRECCION,
USUARIO_ALTA,
F_MODIF,
USUARIO_MODIF,
MUNI,
POBL,
OBSR,
TIPO,
IDGRUPO,
MOVIL,
PCONTACTO,
MCONTACTO,
LOCALE,
MAILINFORMEANALISIS,
PAIS.DSCR AS PAIS,
PAIS.PREFIJO AS PREFIJO,
COND_AUTOM,
VEH_AUTOM,
IS_COOPERATIVA,
NULL AS CIF_COOPERATIVA,
CONTRATO_COOP,
DFEMP.GRUPOCLIENTE,
DFEMP.MOVIL2,
DFEMP.Z_ERRORES,
DFEMP.Z_PROCESADO,
DFEMP.Z_FECHA
FROM
DFEMP,
PAIS
WHERE
DFEMP.CG_NACI = PAIS.CG_NACI (+)
AND (IS_COOPERATIVA = 'S' OR CIF_COOPERATIVA IS NULL)
;
CREATE OR REPLACE VIEW CDVDFEMP_NO_COOP AS
SELECT
DFEMP.CIF,
DFEMP.NOMB,
DFEMP.CG_EMPR,
DFEMP.DOMI,
DFEMP.CG_PROV,
DFEMP.CG_MUNI,
DFEMP.CG_POBL,
DFEMP.CG_POSTAL,
DFEMP.TELF,
DFEMP.FAX,
DFEMP.CIF_CO,
DFEMP.F_FIN_HF,
DFEMP.CL_PROR,
DFEMP.IDENTIFICADOR,
DFEMP.REGI_IDEN,
DFEMP.TIPO_IDEN,
DFEMP.F_ALTA,
DFEMP.EMAIL,
DFEMP.PAG_WEB,
DFEMP.CG_NACI,
DFEMP.DIRECCION,
DFEMP.USUARIO_ALTA,
DFEMP.F_MODIF,
DFEMP.USUARIO_MODIF,
DFEMP.MUNI,
DFEMP.POBL,
DFEMP.OBSR,
DFEMP.TIPO,
DFEMP.IDGRUPO,
DFEMP.MOVIL,
DFEMP.PCONTACTO,
DFEMP.MCONTACTO,
DFEMP.LOCALE,
DFEMP.MAILINFORMEANALISIS,
PAIS.DSCR AS PAIS,
PAIS.PREFIJO AS PREFIJO,
DFEMP.COND_AUTOM,
DFEMP.VEH_AUTOM,
DFEMP.IS_COOPERATIVA,
DFEMP.CIF_COOPERATIVA,
NVL((SELECT D.NOMB FROM DFEMP D WHERE D.CIF = DFEMP.CIF_COOPERATIVA), NULL) AS NOMB_COOP,
DFEMP.CONTRATO_COOP,
DFEMP.GRUPOCLIENTE,
DFEMP.MOVIL2,
DFEMP.Z_ERRORES,
DFEMP.Z_PROCESADO,
DFEMP.Z_FECHA
FROM
DFEMP,
PAIS
WHERE
DFEMP.CG_NACI = PAIS.CG_NACI(+)
AND (DFEMP.IS_COOPERATIVA = 'N')
;
CREATE OR REPLACE VIEW CDVEMPRE_REQ_REALES AS
SELECT
CDEMPRE_REQ.NUMREQ,
CDEMPRE_REQ.CIF,
DFEMP.NOMB,
CDEMPRE_REQ.IDINSPECCION,
CDEMPRE_REQ.F_REQ,
CDEMPRE_REQ.USUARIO_ALTA,
CDEMPRE_REQ.F_ALTA,
CDEMPRE_REQ.F_MODIF,
CDEMPRE_REQ.USUARIO_MODIF,
CDEMPRE_REQ.F_BAJA,
CDEMPRE_REQ.CG_ORGA,
CDEMPRE_REQ.FECINI AS FECINID,
CDEMPRE_REQ.FECFIN AS FECFIND,
CDEMPRE_REQ.AVISO_EXPIRACION,
CDEMPRE_REQ.CG_CONTRATO,
CDEMPRE_REQ.F_CONTRATO,
CDEMPRE_REQ.MAX_COND,
CDEMPRE_REQ.MAX_VEH,
DFEMP.COND_AUTOM,
DFEMP.VEH_AUTOM,
CDEMPRE_REQ.TERMDATEDEMO,
CDEMPRE_REQ.ENDDATEDEMO,
CDEMPRE_REQ.ESTADO,
CDEMPRE_REQ.DSCR,
CDEMPRE_REQ.AGENTE,
CDEMPRE_REQ.ZONA,
CDEMPRE_REQ.F_RENOVACION,
CDEMPRE_REQ.ESTADO_VALIDACION,
CDEMPRE_REQ.IDKIT,
CDEMPRE_REQ.DSCR_KIT,
CDEMPRE_REQ.OBSR_KIT,
CDEMPRE_REQ.MODALIDAD_DIGITAL,
CDEMPRE_REQ.DSCR_MODALIDAD_DIGITAL,
CDEMPRE_REQ.Z_FECHA,
CDEMPRE_REQ.RENOV_CONTRATO,
CDEMPRE_REQ.RENUEVA,
CDEMPRE_REQ.Z_ERRORES,
CDEMPRE_REQ.Z_PROCESADO,
CDEMPRE_REQ.F_ANULACION,
CDEMPRE_REQ.U_NUM_MAXIMO,
CDEMPRE_REQ.FICTICIO,
CDEMPRE_REQ.ESTADO_ACTIVIDAD,
CDEMPRE_REQ.F_FIN_CONTRATO,
CDEMPRE_REQ.TIPO_FACTURACION
FROM CDEMPRE_REQ, DFEMP WHERE CDEMPRE_REQ.CIF = DFEMP.CIF
AND FICTICIO = 'N'
UNION ALL
SELECT
CDEMPRE_REQ.NUMREQ,
DFEMP_FIC.CIF,
DFEMP_FIC.NOMB,
CDEMPRE_REQ.IDINSPECCION,
CDEMPRE_REQ.F_REQ,
CDEMPRE_REQ.USUARIO_ALTA,
CDEMPRE_REQ.F_ALTA,
CDEMPRE_REQ.F_MODIF,
CDEMPRE_REQ.USUARIO_MODIF,
CDEMPRE_REQ.F_BAJA,
CDEMPRE_REQ.CG_ORGA,
CDEMPRE_REQ.FECINI AS FECINID,
CDEMPRE_REQ.FECFIN AS FECFIND,
CDEMPRE_REQ.AVISO_EXPIRACION,
CDEMPRE_REQ.CG_CONTRATO,
CDEMPRE_REQ.F_CONTRATO,
CDEMPRE_REQ.MAX_COND,
CDEMPRE_REQ.MAX_VEH,
DFEMP_FIC.COND_AUTOM,
DFEMP_FIC.VEH_AUTOM,
CDEMPRE_REQ.TERMDATEDEMO,
CDEMPRE_REQ.ENDDATEDEMO,
CDEMPRE_REQ.ESTADO,
CDEMPRE_REQ.DSCR,
CDEMPRE_REQ.AGENTE,
CDEMPRE_REQ.ZONA,
CDEMPRE_REQ.F_RENOVACION,
CDEMPRE_REQ.ESTADO_VALIDACION,
CDEMPRE_REQ.IDKIT,
CDEMPRE_REQ.DSCR_KIT,
CDEMPRE_REQ.OBSR_KIT,
CDEMPRE_REQ.MODALIDAD_DIGITAL,
CDEMPRE_REQ.DSCR_MODALIDAD_DIGITAL,
CDEMPRE_REQ.Z_FECHA,
CDEMPRE_REQ.RENOV_CONTRATO,
CDEMPRE_REQ.RENUEVA,
CDEMPRE_REQ.Z_ERRORES,
CDEMPRE_REQ.Z_PROCESADO,
CDEMPRE_REQ.F_ANULACION,
CDEMPRE_REQ.U_NUM_MAXIMO,
CDEMPRE_REQ.FICTICIO,
CDEMPRE_REQ.ESTADO_ACTIVIDAD,
CDEMPRE_REQ.F_FIN_CONTRATO,
CDEMPRE_REQ.TIPO_FACTURACION
FROM CDEMPRE_REQ, (SELECT DFEMP.CIF, DFEMP.NOMB,CIF_COOPERATIVA, NUMREQ, COND_AUTOM, VEH_AUTOM FROM CDEMPRE_REQ, DFEMP WHERE CDEMPRE_REQ.CIF = DFEMP.CIF AND FICTICIO='S')DFEMP_FIC
WHERE FICTICIO='N' AND DFEMP_FIC.CIF_COOPERATIVA = CDEMPRE_REQ.CIF AND CIF_COOPERATIVA IS NOT NULL AND F_BAJA IS NULL;
CREATE OR REPLACE VIEW CDVCONTRATO_EMPRESA AS
SELECT
(case when DFEMP.CONTRATO_COOP='S' then ( SELECT CDEMPRE_REQ.NUMREQ FROM DFEMP DF, CDEMPRE_REQ WHERE DF.CIF_COOPERATIVA = CDEMPRE_REQ.CIF AND CDEMPRE_REQ.F_BAJA IS NULL AND DFEMP.CIF = DF.CIF) else CDEMPRE_REQ.NUMREQ end) as NUMREQ,
(case when DFEMP.CONTRATO_COOP='S' then ( SELECT CDEMPRE_REQ.NUMREQ FROM DFEMP DF, CDEMPRE_REQ WHERE DF.CIF_COOPERATIVA = CDEMPRE_REQ.CIF AND CDEMPRE_REQ.F_BAJA IS NULL AND DFEMP.CIF = DF.CIF) else CDEMPRE_REQ.NUMREQ end) as CG_CONTRATO,
CDEMPRE_REQ.F_CONTRATO,
DFEMP.CIF,
CDEMPRE_REQ.IDINSPECCION,
CDEMPRE_REQ.F_REQ,
CDEMPRE_REQ.USUARIO_ALTA,
CDEMPRE_REQ.F_ALTA,
CDEMPRE_REQ.F_ANULACION,
CDEMPRE_REQ.USUARIO_MODIF,
CDEMPRE_REQ.F_MODIF,
CDEMPRE_REQ.F_BAJA,
DFEMP.NOMB,
DFEMP.NOMB as NOMB_EMP,
TO_CHAR(CDEMPRE_REQ.FECINID,'DD/MM/YYYY')||' - '|| TO_CHAR(CDEMPRE_REQ.FECFIND,'DD/MM/YYYY') AS NOMBRECOMPLETO,
CDEMPRE_REQ.CG_ORGA,
CDEMPRE_REQ.AVISO_EXPIRACION,
CDEMPRE_REQ.FECINID AS FECINI,
CDEMPRE_REQ.FECFIND AS FECFIN,
CDEMPRE_REQ.MAX_COND,
CDEMPRE_REQ.MAX_VEH,
CDEMPRE_REQ.TERMDATEDEMO,
CDEMPRE_REQ.ENDDATEDEMO,
CDEMPRE_REQ.ESTADO,
CDEMPRE_REQ.DSCR,
CDEMPRE_REQ.AGENTE,
CDEMPRE_REQ.ZONA,
CDEMPRE_REQ.F_RENOVACION,
CDEMPRE_REQ.ESTADO_VALIDACION,
CDEMPRE_REQ.IDKIT,
CDEMPRE_REQ.DSCR_KIT,
CDEMPRE_REQ.OBSR_KIT,
CDEMPRE_REQ.MODALIDAD_DIGITAL,
CDEMPRE_REQ.Z_FECHA,
CDEMPRE_REQ.RENOV_CONTRATO,
CDEMPRE_REQ.RENUEVA,
CDEMPRE_REQ.Z_ERRORES,
CDEMPRE_REQ.Z_PROCESADO,
DFEMP.COND_AUTOM,
DFEMP.VEH_AUTOM,
CDEMPRE_REQ.FICTICIO,
CDEMPRE_REQ.U_NUM_MAXIMO,
CDEMPRE_REQ.DSCR_MODALIDAD_DIGITAL,
CDEMPRE_REQ.ESTADO_ACTIVIDAD,
CDEMPRE_REQ.F_FIN_CONTRATO,
CDEMPRE_REQ.TIPO_FACTURACION
FROM
DFEMP,
cdvempre_req_reales CDEMPRE_REQ
WHERE
DFEMP.CIF = CDEMPRE_REQ.CIF AND
CDEMPRE_REQ.F_BAJA IS NULL
UNION ALL
select
CDEMPRE_REQ.NUMREQ,
CDEMPRE_REQ.CG_CONTRATO,
CDEMPRE_REQ.F_CONTRATO,
CDEMPRE_REQ.CIF,
CDEMPRE_REQ.IDINSPECCION,
CDEMPRE_REQ.F_REQ,
CDEMPRE_REQ.USUARIO_ALTA,
CDEMPRE_REQ.F_ALTA,
CDEMPRE_REQ.F_ANULACION,
CDEMPRE_REQ.USUARIO_MODIF,
CDEMPRE_REQ.F_MODIF,
CDEMPRE_REQ.F_BAJA,
DFEMP.NOMB,
DFEMP.NOMB as NOMB_EMP,
TO_CHAR(CDEMPRE_REQ.FECINI,'DD/MM/YYYY')||' - '|| TO_CHAR(CDEMPRE_REQ.FECFIN,'DD/MM/YYYY') AS NOMBRECOMPLETO,
CDEMPRE_REQ.CG_ORGA,
CDEMPRE_REQ.AVISO_EXPIRACION,
CDEMPRE_REQ.FECINI,
CDEMPRE_REQ.FECFIN,
CDEMPRE_REQ.MAX_COND,
CDEMPRE_REQ.MAX_VEH,
CDEMPRE_REQ.TERMDATEDEMO,
CDEMPRE_REQ.ENDDATEDEMO,
CDEMPRE_REQ.ESTADO,
CDEMPRE_REQ.DSCR,
CDEMPRE_REQ.AGENTE,
CDEMPRE_REQ.ZONA,
CDEMPRE_REQ.F_RENOVACION,
CDEMPRE_REQ.ESTADO_VALIDACION,
CDEMPRE_REQ.IDKIT,
CDEMPRE_REQ.DSCR_KIT,
CDEMPRE_REQ.OBSR_KIT,
CDEMPRE_REQ.MODALIDAD_DIGITAL,
CDEMPRE_REQ.Z_FECHA,
CDEMPRE_REQ.RENOV_CONTRATO,
CDEMPRE_REQ.RENUEVA,
CDEMPRE_REQ.Z_ERRORES,
CDEMPRE_REQ.Z_PROCESADO,
DFEMP.COND_AUTOM,
DFEMP.VEH_AUTOM,
CDEMPRE_REQ.FICTICIO,
CDEMPRE_REQ.U_NUM_MAXIMO,
CDEMPRE_REQ.DSCR_MODALIDAD_DIGITAL,
CDEMPRE_REQ.ESTADO_ACTIVIDAD,
CDEMPRE_REQ.F_FIN_CONTRATO,
CDEMPRE_REQ.TIPO_FACTURACION
from
CDEMPRE_REQ,
DFEMP
where
CDEMPRE_REQ.CIF = DFEMP.CIF AND
CDEMPRE_REQ.F_BAJA IS NOT NULL AND
(CONTRATO_COOP IS NULL OR CONTRATO_COOP = 'N');
DROP VIEW CDVEMPRE_REQ;
CREATE OR REPLACE VIEW CDVFLOTA AS
select
dfemp.cif,dfemp.nomb, count(cdvehiculos_emp.matricula) as vehiculos
from dfemp, cdvehiculos_emp, cdvehiculo_cont, cdvempre_req_reales
where
cdvehiculos_emp.cif = dfemp.cif and
cdvempre_req_reales.cif = dfemp.cif and
cdvempre_req_reales.numreq = cdvehiculo_cont.cg_contrato and
cdvehiculos_emp.matricula = cdvehiculo_cont.matricula and
dfemp.COND_autom = 'S' and
dfemp.VEH_autom = 'S' and
cdvehiculo_cont.f_baja is null
group by dfemp.cif,dfemp.nomb;
| true |
ef5ea0c9fc9464ec11fcc8fdd4cbad7082ed8be2 | SQL | hoalangoc/ftf | /application/modules/Contactimporter/settings/my-upgrade-4.03p2-4.03p3.sql | UTF-8 | 334 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | DELETE FROM `engine4_contactimporter_providers`
WHERE `name` NOT IN
(SELECT b.`name` FROM
(SELECT * FROM `engine4_contactimporter_providers`) as b
WHERE
b.`name` like '%gmail%' or
b.`name` like '%yahoo%' or
b.`name` like '%linkedin%' or
b.`name` like '%hotmail%' or
b.`name` like '%facebook%' or
b.`name` like '%twitter%'); | true |
43ca99942a0835d80795689cbecae9cb1b79f87a | SQL | jasoncnsh/florence | /dev/sql/foreigners_counts.sql | UTF-8 | 865 | 4.09375 | 4 | [
"MIT"
] | permissive | -- This gives a frequency count of how many calls each customer makes. Useful for filtering additional queries.
create materialized view optourism.foreigners_counts as (
select cust_id,
country,
count(*) as calls,
count(distinct date_trunc('day', date_time_m) ) as days_active,
count(distinct to_char(lat,'99.999') || to_char(lon,'99.999')) as towers,
sum(case when in_florence then 1 else 0 end) as calls_in_florence,
sum(case when in_florence_comune then 1 else 0 end) as calls_in_florence_comune
from optourism.cdr_foreigners
where cust_id!=25304 /*this customer is an outlier with 490K records, 10x larger than the next-highest*/
group by cust_id, country
order by calls desc
);
-- Confirmed in a separate query that no custs_id have more than 1 country
select count(*) from optourism.foreigners_counts where calls_in_florence > 0; --confirm: 1,189,353
| true |
f252a201259c1b002ca765ef4288905bcc3cb6ba | SQL | mikz/zelena_kuchyne | /db/sql/zones_up.postgresql.sql | UTF-8 | 530 | 2.859375 | 3 | [] | no_license | CREATE TABLE zones (
id serial PRIMARY KEY,
name varchar(70) NOT NULL UNIQUE,
disabled boolean NOT NULL DEFAULT false,
hidden boolean NOT NULL DEFAULT false
);
ALTER TABLE delivery_methods ADD COLUMN zone_id integer REFERENCES zones (id);
ALTER TABLE delivery_methods ALTER COLUMN zone_id SET NOT NULL;
ALTER TABLE addresses ADD COLUMN zone_id integer REFERENCES zones (id);
ALTER TABLE addresses ADD COLUMN zone_reviewed boolean DEFAULT false;
| true |
843c5bddea07c75d96a3a5f2481a16e7ef7c5fb2 | SQL | appuntinformatica/rest-jwt-crud | /src/main/resources/data-dev.sql | UTF-8 | 706 | 2.59375 | 3 | [] | no_license | /* encoder("password") ---> $2a$10$Kk5XqRUxi8zsedOdhpBiI.b4t97kd7h44KwneegmvrwGKpYBE3gSy */
INSERT INTO user_role(id, role_name) VALUES (10001, 'ROLE_ADMIN');
INSERT INTO user_role(id, role_name) VALUES (10002, 'ROLE_USER');
INSERT INTO user_login(id, email, first_name, last_name, username, password) VALUES (10001, 'admin@company.com', 'Amministratore', 'Amministratore', 'admin', '$2a$10$Kk5XqRUxi8zsedOdhpBiI.b4t97kd7h44KwneegmvrwGKpYBE3gSy');
INSERT INTO user_login(id, email, first_name, last_name, username, password) VALUES (10002, 'user@company.com', 'Utente', 'Utente', 'user', '$2a$10$Kk5XqRUxi8zsedOdhpBiI.b4t97kd7h44KwneegmvrwGKpYBE3gSy');
INSERT INTO user_login_roles(user_id, role_id) VALUES (10001, 10001);
INSERT INTO user_login_roles(user_id, role_id) VALUES (10001, 10002);
INSERT INTO user_login_roles(user_id, role_id) VALUES (10002, 10002); | true |
1eb0f3af019cf9acda47a8ce4e96ef9e290756c3 | SQL | Stevensen77/Pemrograman_web | /web_dodol_haji/user_access_menu (1).sql | UTF-8 | 1,565 | 2.96875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 12, 2019 at 01:46 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.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: `web_ale`
--
-- --------------------------------------------------------
--
-- Table structure for table `user_access_menu`
--
CREATE TABLE `user_access_menu` (
`id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_access_menu`
--
INSERT INTO `user_access_menu` (`id`, `role_id`, `menu_id`) VALUES
(1, 1, 1),
(2, 1, 2),
(3, 2, 2),
(4, 1, 3),
(9, 1, 5),
(10, 1, 4);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user_access_menu`
--
ALTER TABLE `user_access_menu`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `user_access_menu`
--
ALTER TABLE `user_access_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
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 */;
| true |
d1ee2692de205100b1f0d77e5aa2c8a0f06accbd | SQL | vvkond/QGIS | /db/ZonationTarget.sql | UTF-8 | 3,031 | 4.34375 | 4 | [] | no_license | --- LAST INTERVAL POSITION(ORDER) FOR EACH WELL
--- @param well_id - well name
--- @param zonation_id - id of zonation
--- @param skeep_last_n_zone - number of intervals in zonation description for don't use.
with well_max_interval_pos as
(
SELECT
wh.TIG_LATEST_WELL_NAME AS well_name
, max(i.tig_interval_order) AS well_last_interval_order
, wh.DB_SLDNID AS tig_well_id
FROM tig_interval I
, TIG_ZONATION z
, tig_well_interval wi
, tig_well_history wh
WHERE
I.tig_zonation_sldnid = z.DB_SLDNID --------SET ZONATION ID
AND wh.DB_SLDNID = wi.TIG_WELL_SLDNID
AND wi.TIG_INTERVAL_SLDNID = i.DB_SLDNID
---VARIABLES
AND wh.TIG_LATEST_WELL_NAME = :well_id
AND z.DB_SLDNID = :zonation_id
AND (:skeep_last_n_zone IS NULL OR i.tig_interval_order< (
SELECT max(I_TMP.tig_interval_order)
from tig_interval I_TMP
, tig_zonation Z_TMP
where Z_TMP.DB_SLDNID= :zonation_id
AND
I_TMP.tig_zonation_sldnid = Z_TMP.DB_SLDNID --------SET ZONATION ID
)-:skeep_last_n_zone+1 ---if skeep last intervals
)
group by
wh.TIG_LATEST_WELL_NAME, wh.DB_SLDNID
)
---ALL INTERVALS FOR EACH WELL
,well_zon_intervals as
(
SELECT
wh.TIG_LATEST_WELL_NAME AS well_name
, TRIM(z.TIG_DESCRIPTION) AS zonation_name
, TRIM(i.TIG_INTERVAL_NAME) AS zone_name
, wi.TIG_TOP_POINT_DEPTH AS top_depth
, wi.TIG_BOT_POINT_DEPTH AS bottom_depth
, wh.DB_SLDNID AS tig_well_id
, z.DB_SLDNID AS zonation_id
, wi.DB_SLDNID AS well_zone_id
, i.DB_SLDNID AS zone_id
, wh.TIG_LONGITUDE
, wh.TIG_LATITUDE
, i.TIG_INTERVAL_NAME
, i.tig_interval_order
, i.tig_level
,z.TIG_ZONATION_PARAMS
FROM
tig_well_interval wi,
tig_well_history wh,
tig_interval i,
tig_zonation z
WHERE
wh.DB_SLDNID = wi.TIG_WELL_SLDNID
AND wi.TIG_INTERVAL_SLDNID = i.DB_SLDNID
AND i.TIG_ZONATION_SLDNID = z.DB_SLDNID
---VARIABLES
AND wh.TIG_LATEST_WELL_NAME = :well_id
AND z.DB_SLDNID = :zonation_id
)
---GET 1 INTERVAL FOR EACH WELL
SELECT
wzi.top_depth
, wzi.well_name
, wzi.zonation_name
, wzi.zone_name as target_zone
, wzi.zone_id AS target_zone_id
FROM
well_max_interval_pos wmip
, well_zon_intervals wzi
WHERE
wmip.tig_well_id= wzi.tig_well_id
AND
wzi.tig_interval_order=wmip.well_last_interval_order
| true |
ff61faf2132fc1870e97158e8c10fd4bea8e661a | SQL | edirlang/pgt | /pgt.sql | UTF-8 | 16,730 | 3.609375 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-06-2015 a las 15:50:13
-- Versión del servidor: 5.6.17
-- Versión de PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de datos: `pgt`
--
DELIMITER $$
--
-- Procedimientos
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `CalificarProyecto`(IN codigo varchar(10), In calificacion1 varchar(10), IN calificacion2 varchar(10))
BEGIN
IF calificacion1 = "Aprobado" && calificacion2 = "Aprobado" then
UPDATE proyecto
SET estado = "Aprobado", fecha_aprovacion = CURDATE()
WHERE cod_proyecto = codigo;
else
UPDATE proyecto
SET estado="Rechazado", fecha_aprovacion = CURDATE()
WHERE cod_proyecto=codigo ;
end IF;
end$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calificar_proyecto_director`(IN `var1` VARCHAR(10), IN `var2` VARCHAR(15), IN `var3` VARCHAR(12))
begin
UPDATE persona_proyecto SET calificacion = var3 WHERE cod_proyecto = var1 AND cod_persona = var2;
UPDATE proyecto SET estado = var3 WHERE cod_proyecto = var1;
end$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ConsultarProyectosEstado`()
begin
select proyecto.cod_proyecto, proyecto.titulo, estudiantes.estudiante, directores.director, proyecto.estado, linea.nom_linea as linea, programa.nom_programa as programa
from proyecto, estudiantes, directores, linea_proyecto, linea, programa
where proyecto.cod_proyecto = estudiantes.cod_proyecto and proyecto.cod_proyecto = directores.cod_proyecto and linea_proyecto.cod_proyecto = proyecto.cod_proyecto and linea_proyecto.cod_linea = linea.cod_linea and linea_proyecto.cod_programa = programa.cod_programa;
end$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ConsultarProyectosLinea`(IN `codigo` VARCHAR(10))
SELECT proyectos2.cod_proyecto, proyectos2.titulo, proyectos2.estudiante, proyectos2.director, proyectos.jurado FROM proyectos2 LEFT OUTER JOIN proyectos ON proyectos.cod_proyecto = proyectos2.cod_proyecto where proyectos2.linea=codigo$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ConsultarProyectosPrograma`(IN `codigo` VARCHAR(6))
SELECT proyectos2.cod_proyecto, proyectos2.titulo, proyectos2.estudiante, proyectos2.director, proyectos.jurado FROM proyectos2 LEFT OUTER JOIN proyectos ON proyectos.cod_proyecto = proyectos2.cod_proyecto where proyectos2.programa=codigo$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `profesor_proyecto`(IN id VARCHAR(10), IN rol varchar(8))
BEGIN
SELECT nom_persona,ape_persona from persona_proyecto,persona where persona_proyecto.cod_persona=persona.cedula AND persona_proyecto.cod_proyecto=id and persona_proyecto.rol=rol;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `directores`
--
CREATE TABLE IF NOT EXISTS `directores` (
`cedula` varchar(12)
,`director` varchar(21)
,`cod_proyecto` varchar(10)
);
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `estudiantes`
--
CREATE TABLE IF NOT EXISTS `estudiantes` (
`cedula` varchar(12)
,`estudiante` text
,`cod_proyecto` varchar(10)
);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `faculta`
--
CREATE TABLE IF NOT EXISTS `faculta` (
`cod_facultad` varchar(6) NOT NULL DEFAULT '',
`nom_facultad` varchar(255) DEFAULT NULL,
PRIMARY KEY (`cod_facultad`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `faculta`
--
INSERT INTO `faculta` (`cod_facultad`, `nom_facultad`) VALUES
('1', 'Facultad de Ingenieria');
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `jurados`
--
CREATE TABLE IF NOT EXISTS `jurados` (
`cedula` varchar(12)
,`jurado` text
,`cod_proyecto` varchar(10)
);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `linea`
--
CREATE TABLE IF NOT EXISTS `linea` (
`cod_linea` varchar(10) NOT NULL DEFAULT '',
`nom_linea` varchar(50) DEFAULT NULL,
`cod_programa` varchar(10) NOT NULL DEFAULT '',
PRIMARY KEY (`cod_linea`,`cod_programa`),
KEY `programa_linea` (`cod_programa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `linea`
--
INSERT INTO `linea` (`cod_linea`, `nom_linea`, `cod_programa`) VALUES
('1', 'Bases de datos', '1'),
('2', 'Ingenieria de Software', '1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `linea_proyecto`
--
CREATE TABLE IF NOT EXISTS `linea_proyecto` (
`cod_linea` varchar(10) NOT NULL DEFAULT '',
`cod_proyecto` varchar(10) NOT NULL DEFAULT '',
`cod_programa` varchar(10) DEFAULT NULL,
PRIMARY KEY (`cod_linea`,`cod_proyecto`),
KEY `proyecto_linea` (`cod_proyecto`),
KEY `linea_proyecto` (`cod_linea`,`cod_programa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `linea_proyecto`
--
INSERT INTO `linea_proyecto` (`cod_linea`, `cod_proyecto`, `cod_programa`) VALUES
('1', '20151.1', '1'),
('1', '20152.1', '1'),
('1', '20152.2', '1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `persona`
--
CREATE TABLE IF NOT EXISTS `persona` (
`cedula` varchar(12) NOT NULL DEFAULT 'not null',
`cod_persona` varchar(9) DEFAULT NULL,
`nom_persona` varchar(10) DEFAULT NULL,
`ape_persona` varchar(10) DEFAULT NULL,
`creditos` varchar(3) NOT NULL,
`programa` varchar(6) NOT NULL,
PRIMARY KEY (`cedula`),
KEY `programa` (`programa`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `persona`
--
INSERT INTO `persona` (`cedula`, `cod_persona`, `nom_persona`, `ape_persona`, `creditos`, `programa`) VALUES
('09877', 'kjkjkj', 'kjkjkj', 'kjkjkj', '', ''),
('12', 'doc', 'Fernando', 'Sotelo', '', ''),
('13', '123', 'edixon2', 'hernand3', '', ''),
('161212', '161212', 'die2g3o', 'f3r2anco', '', ''),
('232332', 'doc', 'Alejandro', 'Ruiz', '', ''),
('2332', 'fernando', 'sdds', 'dsdssd', '', ''),
('3223', '323', 'Fernando2', 'Ricaurte', '', ''),
('4344', '2131', 'fernado', 'ricaurte', '', ''),
('7845', 'doc', 'Fernando', 'Sotelo', '', ''),
('898989', '89898', 'jkjkjk', 'jkjkj', '', ''),
('9856', 'doc', 'Fernando', 'Sotelo', '', ''),
('kjkjkjkj', '898978', 'kjjkj', 'kjkj', '', '');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `persona_correo`
--
CREATE TABLE IF NOT EXISTS `persona_correo` (
`cod_persona` varchar(9) NOT NULL DEFAULT '',
`nom_correo` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`cod_persona`,`nom_correo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `persona_correo`
--
INSERT INTO `persona_correo` (`cod_persona`, `nom_correo`) VALUES
('12', '323'),
('12', 'dewwe'),
('161212', 'email3@uni'),
('2332', 'fdfdfd@fdgfdg'),
('3223', 'sdsd@ftttt'),
('3223', 'ttttt@eeeee'),
('4344', 'fernado@gmail.2com'),
('7845', 'botero@botero'),
('9856', 'esperanza@gmail.com'),
('kjkjkjkj', 'jkj@kkl');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `persona_proyecto`
--
CREATE TABLE IF NOT EXISTS `persona_proyecto` (
`cod_proyecto` varchar(10) NOT NULL DEFAULT '',
`cod_persona` varchar(15) NOT NULL DEFAULT '',
`rol` varchar(12) DEFAULT NULL,
`calificacion` varchar(12) DEFAULT NULL,
PRIMARY KEY (`cod_proyecto`,`cod_persona`),
KEY `cod_persona` (`cod_persona`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `persona_proyecto`
--
INSERT INTO `persona_proyecto` (`cod_proyecto`, `cod_persona`, `rol`, `calificacion`) VALUES
('20151.1', '12', 'director', 'finalizado'),
('20151.1', '13', 'estudiante', ''),
('20151.1', '232332', 'jurado', 'Aprovado'),
('20151.1', '3223', 'estudiante', ''),
('20151.1', '9856', 'jurado', 'Aprovado'),
('20152.1', '12', 'jurado', 'Aprovado'),
('20152.1', '161212', 'estudiante', ''),
('20152.1', '232332', 'director', 'finalizado'),
('20152.1', '3223', 'estudiante', ''),
('20152.1', '7845', 'jurado', 'Aprovado'),
('20152.2', '12', 'jurado', 'Aprovado'),
('20152.2', '13', 'estudiante', ''),
('20152.2', '232332', 'director', 'finalizado'),
('20152.2', '9856', 'jurado', 'Aprovado');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `persona_telefono`
--
CREATE TABLE IF NOT EXISTS `persona_telefono` (
`cod_persona` varchar(9) NOT NULL DEFAULT '',
`num_telefono` varchar(13) NOT NULL DEFAULT '',
PRIMARY KEY (`cod_persona`,`num_telefono`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `persona_telefono`
--
INSERT INTO `persona_telefono` (`cod_persona`, `num_telefono`) VALUES
('12', '22222'),
('12', '222222'),
('161212', '2222'),
('2332', '434343'),
('3223', '111111'),
('3223', '444444'),
('3223', '6666'),
('4344', '2222'),
('kjkjkjkj', '7878');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `programa`
--
CREATE TABLE IF NOT EXISTS `programa` (
`cod_programa` varchar(6) NOT NULL,
`nom_programa` varchar(30) DEFAULT NULL,
`creditos` varchar(3) NOT NULL,
`faculta` varchar(6) NOT NULL,
PRIMARY KEY (`cod_programa`),
KEY `faculta` (`faculta`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `programa`
--
INSERT INTO `programa` (`cod_programa`, `nom_programa`, `creditos`, `faculta`) VALUES
('1', 'Ingenieria de sistemas', '180', '1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `proyecto`
--
CREATE TABLE IF NOT EXISTS `proyecto` (
`cod_proyecto` varchar(10) NOT NULL,
`titulo` varchar(20) DEFAULT NULL,
`resumen` varchar(2500) DEFAULT NULL,
`estado` varchar(12) DEFAULT NULL,
`fecha_inicio` date DEFAULT NULL,
`fecha_aprovacion` date DEFAULT NULL,
`archivo` varchar(255) NOT NULL,
PRIMARY KEY (`cod_proyecto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `proyecto`
--
INSERT INTO `proyecto` (`cod_proyecto`, `titulo`, `resumen`, `estado`, `fecha_inicio`, `fecha_aprovacion`, `archivo`) VALUES
('20151.1', 'huella', 'huellapara captura emisiones de Co2e2', 'Aprobado', '2015-05-09', '2015-05-06', 'archivo/f-ci-120923120127-phpapp02.pdf'),
('20152.1', 'ffffffffffffffffffff', 'yyyyy', 'Aprobado', '2015-05-29', '2015-12-02', 'archivo/cc_20150503_184446.reg'),
('20152.2', 'iiii', 'iii', 'Rechazado', '2015-05-29', '2015-06-02', 'archivo/Nuevo Documento de Microsoft Word (2).docx');
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `proyectos`
--
CREATE TABLE IF NOT EXISTS `proyectos` (
`cod_proyecto` varchar(10)
,`titulo` varchar(20)
,`estudiante` text
,`director` varchar(21)
,`jurado` text
);
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `proyectos2`
--
CREATE TABLE IF NOT EXISTS `proyectos2` (
`cod_proyecto` varchar(10)
,`titulo` varchar(20)
,`estudiante` text
,`director` varchar(21)
,`estado` varchar(12)
,`linea` varchar(10)
,`programa` varchar(6)
);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuario`
--
CREATE TABLE IF NOT EXISTS `usuario` (
`cedula` varchar(20) NOT NULL,
`nombre` varchar(50) NOT NULL,
`contrasena` varchar(255) NOT NULL,
PRIMARY KEY (`cedula`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `usuario`
--
INSERT INTO `usuario` (`cedula`, `nombre`, `contrasena`) VALUES
('1', '1', '1');
-- --------------------------------------------------------
--
-- Estructura para la vista `directores`
--
DROP TABLE IF EXISTS `directores`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `directores` AS select `persona`.`cedula` AS `cedula`,concat(`persona`.`nom_persona`,' ',`persona`.`ape_persona`) AS `director`,`persona_proyecto`.`cod_proyecto` AS `cod_proyecto` from (`persona` join `persona_proyecto`) where ((`persona`.`cedula` = `persona_proyecto`.`cod_persona`) and (`persona_proyecto`.`rol` = 'director'));
-- --------------------------------------------------------
--
-- Estructura para la vista `estudiantes`
--
DROP TABLE IF EXISTS `estudiantes`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `estudiantes` AS select `persona`.`cedula` AS `cedula`,group_concat(`persona`.`nom_persona`,' ',`persona`.`ape_persona` separator ',') AS `estudiante`,`persona_proyecto`.`cod_proyecto` AS `cod_proyecto` from (`persona` join `persona_proyecto`) where ((`persona`.`cedula` = `persona_proyecto`.`cod_persona`) and (`persona_proyecto`.`rol` = 'estudiante')) group by `persona_proyecto`.`cod_proyecto`;
-- --------------------------------------------------------
--
-- Estructura para la vista `jurados`
--
DROP TABLE IF EXISTS `jurados`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `jurados` AS select `persona`.`cedula` AS `cedula`,group_concat(`persona`.`nom_persona`,' ',`persona`.`ape_persona` separator ',') AS `jurado`,`persona_proyecto`.`cod_proyecto` AS `cod_proyecto` from (`persona` join `persona_proyecto`) where ((`persona`.`cedula` = `persona_proyecto`.`cod_persona`) and (`persona_proyecto`.`rol` = 'jurado')) group by `persona_proyecto`.`cod_proyecto`;
-- --------------------------------------------------------
--
-- Estructura para la vista `proyectos`
--
DROP TABLE IF EXISTS `proyectos`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `proyectos` AS select `proyecto`.`cod_proyecto` AS `cod_proyecto`,`proyecto`.`titulo` AS `titulo`,`estudiantes`.`estudiante` AS `estudiante`,`directores`.`director` AS `director`,`jurados`.`jurado` AS `jurado` from (((`proyecto` join `estudiantes`) join `jurados`) join `directores`) where ((`proyecto`.`cod_proyecto` = `estudiantes`.`cod_proyecto`) and (`proyecto`.`cod_proyecto` = `jurados`.`cod_proyecto`) and (`proyecto`.`cod_proyecto` = `directores`.`cod_proyecto`)) group by `proyecto`.`cod_proyecto`;
-- --------------------------------------------------------
--
-- Estructura para la vista `proyectos2`
--
DROP TABLE IF EXISTS `proyectos2`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `proyectos2` AS select `proyecto`.`cod_proyecto` AS `cod_proyecto`,`proyecto`.`titulo` AS `titulo`,`estudiantes`.`estudiante` AS `estudiante`,`directores`.`director` AS `director`,`proyecto`.`estado` AS `estado`,`linea`.`cod_linea` AS `linea`,`programa`.`cod_programa` AS `programa` from (((((`proyecto` join `estudiantes`) join `directores`) join `linea_proyecto`) join `linea`) join `programa`) where ((`proyecto`.`cod_proyecto` = `estudiantes`.`cod_proyecto`) and (`proyecto`.`cod_proyecto` = `directores`.`cod_proyecto`) and (`linea_proyecto`.`cod_proyecto` = `proyecto`.`cod_proyecto`) and (`linea_proyecto`.`cod_linea` = `linea`.`cod_linea`) and (`linea_proyecto`.`cod_programa` = `programa`.`cod_programa`));
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `linea`
--
ALTER TABLE `linea`
ADD CONSTRAINT `programa_linea` FOREIGN KEY (`cod_programa`) REFERENCES `programa` (`cod_programa`);
--
-- Filtros para la tabla `linea_proyecto`
--
ALTER TABLE `linea_proyecto`
ADD CONSTRAINT `linea_proyecto` FOREIGN KEY (`cod_linea`, `cod_programa`) REFERENCES `linea` (`cod_linea`, `cod_programa`),
ADD CONSTRAINT `proyecto_linea` FOREIGN KEY (`cod_proyecto`) REFERENCES `proyecto` (`cod_proyecto`);
--
-- Filtros para la tabla `persona_correo`
--
ALTER TABLE `persona_correo`
ADD CONSTRAINT `correo_persona` FOREIGN KEY (`cod_persona`) REFERENCES `persona` (`cedula`);
--
-- Filtros para la tabla `persona_proyecto`
--
ALTER TABLE `persona_proyecto`
ADD CONSTRAINT `persona_proyecto_ibfk_1` FOREIGN KEY (`cod_persona`) REFERENCES `persona` (`cedula`),
ADD CONSTRAINT `persona_proyecto_ibfk_2` FOREIGN KEY (`cod_proyecto`) REFERENCES `proyecto` (`cod_proyecto`);
--
-- Filtros para la tabla `persona_telefono`
--
ALTER TABLE `persona_telefono`
ADD CONSTRAINT `persona_telefono` FOREIGN KEY (`cod_persona`) REFERENCES `persona` (`cedula`);
/*!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 */;
| true |
ad860433949228d9ded6cbc21ac748cbc4825434 | SQL | kumaran777/Faculty_Advisor | /Database & Table/bot.sql | UTF-8 | 13,504 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 23, 2021 at 08:18 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `bot`
--
-- --------------------------------------------------------
--
-- Table structure for table `chatbot`
--
CREATE TABLE `chatbot` (
`id` int(11) NOT NULL,
`queries` mediumtext NOT NULL,
`replies` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `chatbot`
--
INSERT INTO `chatbot` (`id`, `queries`, `replies`) VALUES
(1, 'hi|hello', 'Hello There..!'),
(2, 'college link|official link|clg link|website|website link', 'Click Here <a href=\'https://www.sonatech.ac.in/\'>https://www.sonatech.ac.in/</a> to go reach our official website..'),
(3, 'bye|Good night|gd ni8|Night|bye bye|see you later|talk to you later|text you later', 'Goodbye for now,Take care.'),
(4, 'Are you a robot?|are you robot|are u robot|are you a robot|r u robot', 'Yes I am a robot, but I’m a good one. Let me prove it. How can I help you?'),
(5, 'What’s up?', 'Not a lot, quiet day today.'),
(6, 'How are you?|How are you doing|How are you going?|how are you|how r u|how wa the day', 'My day is going fine thank you. Just working away.'),
(7, 'Good morning |Good evening | Good afternoon|Gm|Gn|mrng|evening|afternoon|Gd Mrng|Morning', 'Hello there'),
(8, 'How can you help me?|what will you do|about you|tell me about yourself', 'I\'m bot,I can answer questions about our College, our platform, and the industry.'),
(9, 'I have a question|can you help me?|i have a question|help me', 'Ask me your question,im here to help you'),
(10, 'Do you know a joke?|do you know joke|joke', 'Question: Why we are saying the letter \"T\" is like a Island <br>\r\nAnswer: Because it is in middle of waTer....!😂😁😆'),
(11, 'college name|College', 'Sona College of Technology'),
(12, 'College Address|address|college address', 'Address: Junction Main Rd, Salem, Tamil Nadu 636005'),
(13, 'location|College Location', '📎Junction Main Rd, Salem, Tamil Nadu 636005'),
(14, 'HOD\'s|list of HOD\'s|Dept HOD\'s', 'IT -Dr.J.Akilandeswari <br> \r\nME -Dr.D.Senthilkumar <br>\r\nCE -Dr.R.Malathy <br>\r\nEEE -Dr.S.Padma <br>\r\nECE -Dr.R.S.Sabeenian <br>\r\nCSE -Dr.B.Sathiyabhama <br>\r\nFT -Dr.D.Raja <br>\r\nMechatronics -Dr.P.Suresh <br>\r\nBio Medical Engineering -Dr.R.S.Sabeenian'),
(15, '|information technology|Information Technology', '<a href=\"https://www.sonatech.ac.in/it\" target=\"https://www.sonatech.ac.in/it\">Click here</a> to know more about Information Technology'),
(16, 'what are you doing|What are yoy Doing', 'I was made to handle busy. I love it. BRING ME MORE CONVERSATIONS.'),
(17, 'what\'s going on', 'Busier than the busiest bee on the busy bee day.'),
(18, 'fashion technology|Fashion Technology', '<a href=\"https://www.sonatech.ac.in/ft\" target=\"https://www.sonatech.ac.in/ft\">Click here</a> to know more about Fashion Technology'),
(19, 'Civil Engineering|civil engineering', '<a href=\"https://www.sonatech.ac.in/civil\" target=\"https://www.sonatech.ac.in/civil\">Click here</a> to know more about Civil Engineering\r\n'),
(20, 'Computer Science and Engineering|computer science and engineering', '<a href=\"https://www.sonatech.ac.in/cse\" target=\"https://www.sonatech.ac.in/cse\">Click here</a> to know more about Computer Science Engineering'),
(21, 'Electronics and Communication Engineering|electronics and communication engineering', '<a href=\"https://www.sonatech.ac.in/ece\" target=\"https://www.sonatech.ac.in/ece\">Click here</a> to know more about Electronics and Communication Engineering'),
(22, 'Electrical and Electronics Engineering|electrical and electronics engineering', '<a href=\"https://www.sonatech.ac.in/eee\" target=\"https://www.sonatech.ac.in/eee\">Click here</a> to know more about Electrical and Electronics Engineering'),
(23, 'mechanical engineering|Mechanical Engineering', '<a href=\"https://www.sonatech.ac.in/mech\" target=\"https://www.sonatech.ac.in/mech\">Click here</a> to know more about Mechanical Engineering'),
(24, 'Mechatronics Engineering|mechatronics engineering', '<a href=\"https://www.sonatech.ac.in/mechatronics\" target=\"https://www.sonatech.ac.in/mechatronics\">Click here</a> to know more about Mechatronics Engineering'),
(25, 'Bio Medical Engineering|bio medical engineering\r\n', '<a href=\"https://www.sonatech.ac.in/bio-medical/faculty-bio.php\" target=\"https://www.sonatech.ac.in/bio-medical/faculty-bio.php\">Click here</a> to know more about Bio Medical Engineering\r\n'),
(26, 'it placement|placement of it|IT Placement', '📌Various Training Programmes are organized to train the students in the areas of Aptitude, Quantitative Reasoning, Logical Reasoning and Verbal through the Reputed External Training centers and Alumni\'s.<br>\r\n📌Training in C, C++, DATA STRUCTURES, NETWORKS, JAVA and DBMS were conducted with the help of department faculty experts and through alumni.<br>\r\n📌\"Career Corner\" was created in our department library with books on GATE, GRE, TOFEL, CAT etc.<br>\r\n📌To see more info about placement and placed Student\'s<a href=\"https://www.sonatech.ac.in/it/sona-students-placement-it.php\" target=\"https://www.sonatech.ac.in/it/sona-students-placement-it.php\"> Click here</a>'),
(27, 'cse placement|placement of cse|CSE Placement', '📌The department has talented students with both technical and soft skill sets. <br>\r\n📌Their academic performance needs a special mention here. <br>\r\n📌More than 30 final year students have a track record of 8.5 and above CGPA and remaining 80 odd students with consistent academic performance. <br>\r\n📌To see more info<a href=\"https://www.sonatech.ac.in/cse/placement-computer-science-engineering.php\" target=\"https://www.sonatech.ac.in/cse/placement-computer-science-engineering.php\"> Click here</a>'),
(28, 'civil placement|Civil placement|placement of civil', '📌<a href=\"sonatech.ac.in/civil/sona-civil-placement.php\" target=\"sonatech.ac.in/civil/sona-civil-placement.php\">Click here </a>to see Placement related activities of Civil'),
(29, 'ft placement|placement of ft|FT Placement', '📌Excellent labs with industry-grade machinery for hands-on training in textile and garment skills.<br>\r\n📌A comprehensive education and training package that more than meets every learner’s and industry’s needs\r\nWell-qualified, dedicated faculty who constantly focus on student-centred development to bring out industry-specific graduates<br>\r\n📌<a href=\"https://www.sonatech.ac.in/ft/sona-textile-placement.php\" target=\"https://www.sonatech.ac.in/ft/sona-textile-placement.php\"> Click here</a> to know more feeds about FT Placements.'),
(30, 'ece placement|ECE Placement|placement of ece', '📌The placement training program is offering to students from the beginning of 3rd semester. It is the part of curriculum. Weekly 2 time table hours are allocated for this placement training program.<br>\r\n📌<a href=\"https://www.sonatech.ac.in/ece/placement-electronics-communication-engineering.php\" target=\"https://www.sonatech.ac.in/ece/placement-electronics-communication-engineering.php\">Click here</a> to know more about ECE Placements.'),
(31, 'eee placement|EEE placement|Placement of EEE', '📌Conducted technical seminars related to Electrical and Electronics Engineering department and recent trends by Industry Experts, Alumni every month.<br>\r\n📌Arranged a \"Career Corner\" in our department library with books on GATE, GRE, TOFEL, CAT etc.<br>\r\n📌<a href=\"https://www.sonatech.ac.in/eee/placement-electrical-engineering-sona-college.php\" target=\"https://www.sonatech.ac.in/eee/placement-electrical-engineering-sona-college.php\"> Click here</a> to know more about EEE Placements.'),
(32, 'mechanical placement|Mechanical Placement|mech placements', '📌Mechanical Engineering Department is NBA & NAAC accredited, and has an intake of 180 students. Present overall strength is around 600 and the current faculty strength is 32. A Department library has been set up with a lot of useful personality development books.<br>\r\n📌<a href=\"https://www.sonatech.ac.in/mech/mechanical-engineering-placement.php\" target=\"https://www.sonatech.ac.in/mech/mechanical-engineering-placement.php\"> Click here</a> to know more about Mechanical Placements.'),
(33, 'Contact|Details|Admission', '<b>Contact<b><br>\r\nAdmission Cell<br>\r\nSona College of Technology<br>\r\nSalem – 636 005<br>\r\nTamilnadu.<br>\r\n☎0427 - 4099998 /9442668758 / 9840447392,<br>\r\n+91 9442668758<br>\r\n📧admission[at]sonatech.ac.in<br>'),
(34, 'Curriculum|Syllabus', '<a href=\"https://www.sonatech.ac.in/academics/#\" target=\"https://www.sonatech.ac.in/academics/#\"> Click Here</a> to Know more details about the College Curriculum and Syllabus.'),
(35, 'NPTEL|nptel', '📢The National Programme on Technology Enhanced Learning (NPTEL) is a project funded by MHRD, Government of India. The project was initiated by seven Indian Institutes of Technology (Bombay, Delhi, Kanpur, Kharagpur, Madras, Guwahati and Roorkee) along with the Indian Institute of Science, Bangalore in 2003. The main objective of the project is to offer a high quality web based course on various engineering disciplines and core science for the students, faculties and industry persons <a href=\"\" target=\"\">Click here </a>to explore more...about NPTEL.'),
(36, 'rules|regulations|rules and regulations|Rules and Regulations ', '🖌Students should wear ID CARD inside the campus.<br>\r\n🖌Students should not disturb the classes by unnecessarily \r\nmaking noise, standing on the corridor, lounge, etc.<br>\r\n🖌Students are strictly forbidden from smoking anywhere in the campus.<br>\r\n🖌<a href=\"https://www.sonatech.ac.in/academics/rules-regulations.php\" target=\"https://www.sonatech.ac.in/academics/rules-regulations.php\"> Click here</a> to know more about College Rules & Regulations.'),
(37, 'timing|Timing|College Timing|college timing', '👨🏽💼👩🏽💼Students<br>\r\n-----------------------------<br>\r\n📣Morning 09.00 am - 12.55 pm<br>\r\n📣Lunch Interval 12.55 pm - 01.55 pm<br>\r\n📣Afternoon 01.55 pm - 04.50 pm<br>\r\n______________________\r\n👨🏽🏫👩🏽🏫Office<br>\r\n----------------------------<br>\r\n📣Morning 9.30 am - 01.30 pm<br>\r\n📣Lunch Interval 01.30 pm - 02.30 pm<br>\r\n📣Afternoon 02.30 pm - 06.30 pm<br>'),
(38, 'history|History', '✨The Sona Group is steeped in more than 100 years of success and tradition tracing back to pre-Independence. The group was founded by the doyen of textile industries of the early twentieth century, Karumuttu Thiagarajar Chettiar. He oozed passion and patriotism for his motherland and fought for Her freedom along with other great freedom fighters of this nation. Karumuttu Thiagarajar Chettiar’s prominence is etched in the tapestry of our nation by the role he played in the transformation of Mohandas Karamchand Gandhi to Gandhiji, The Father of our Nation. This defining moment played out in 1938, within the walls of Karumuttu Thiagarajar Chettiar’s home when Gandhiji visited Madurai. Gandhiji wore his trademark Loin cloth, vowing not to wear a shirt every again after seeing daily wage workers who could not afford one.✨'),
(39, 'blackboard|bb|BB|Blackboard', '<a href=\"https://www.sonalearn.org/\" target=\"https://www.sonalearn.org/\"> Click here</a> to Reach BlackBoard.'),
(40, 'sports|Sports', '🏆<br>\r\n🥇🥈🥉🏅<br>\r\nThe Department of Physical Education was established in the year 1997. The department is equipped with good infrastructure facilities and the students were given training in most of the Sports and Games which led to remarkable achievements by our students in Anna University Zone, Inter zone, District, state and National tournament.'),
(41, 'who is kumaran', 'avan oru paithiyakaaran');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `password`) VALUES
(9, 'kumaran', 'kumaranraja777@gmail.com', '827ccb0eea8a706c4c34a16891f84e7b'),
(12, 'varun', 'varn@gmail.com', '202cb962ac59075b964b07152d234b70');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `chatbot`
--
ALTER TABLE `chatbot`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `chatbot`
--
ALTER TABLE `chatbot`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
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 */;
| true |
e2c6b84f268de1ec1a320cbfc83045a1cc351c3d | SQL | science162/LO54_Maven_Project | /INSERT.sql | UTF-8 | 6,298 | 2.953125 | 3 | [] | no_license | /*insertion dans la table Course */
INSERT INTO course (TITLE,LIBELLE) Values ('Administrations des Bases de données','Apprendre la conception et l'/'administration des bases de données facilement');
INSERT INTO course (TITLE,LIBELLE) Values ('Java Enterprise Applications Architectures','Apprendre la conception des applications en langage Java');
INSERT INTO course (TITLE,LIBELLE) Values ('Business Intelligence and Data Warehouse','Apprendre l'/'informatique decisionnelle et ses outils ');
INSERT INTO course (TITLE,LIBELLE) Values ('Algorithmiques avancées','Apprendre a Acquérir les compétences sur les concepts en algorithmique avancée : structures de données, algorithmes de routage, algorithmes géométriques, algorithmes parallèles... ');
INSERT INTO course (TITLE,LIBELLE) Values ('Analyse des données multidimensionnelles et datamining','Apprendre a Analyser et exploiter efficacement des données');
INSERT INTO course (TITLE,LIBELLE) Values ('Génie logiciel','Apprendre a Acquérir les compétences sur les méthodologies, les langages et les environnements de développement de logiciels : cycle de vie et méthodes agiles (SCRUM), approches fonctionnelles, méthodes d'/'analyse et de conception orientées objet, spécifications formelles.');
INSERT INTO course (TITLE,LIBELLE) Values ('Intelligence artificielle : concepts fondamentaux et langages dédiés','Apprendre a Acquérir les compétences sur les principaux concepts et outils logiciels dédiés à l'/'intelligence artificielle dont l'/'objectif est de reproduire des processus élaborés tels la déduction, le raisonnement ou l'/'apprentissage.');
INSERT INTO course (TITLE,LIBELLE) Values ('Statistiques pour l'/'ingénieur','Apprendre a Développer des méthodes d'/'analyse d'/'une information aléatoire et d'/'aide à la décision face aux problèmes à plusieurs variables. ');
INSERT INTO course (TITLE,LIBELLE) Values ('Processus et qualité du logiciel','Apprendre a Acquérir les compétences sur les principes et les procédures d'/'assurance qualité, tout en les intégrant dans le suivi et l'/'organisation des projets informatiques. ');
INSERT INTO course (TITLE,LIBELLE) Values ('Vision et réalité virtuelle','Acquérir les compétences fondamentales pour la conception et la construction de scènes 3D et de mondes virtuels. ');
/*insertion dans la table Client */
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Sonia', 'MEIMOU','2 rue Enerst Duvillard','0716386578','meimousonia@yahoo.fr','Sonita01','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Albert', 'MOUAFFO','22 rue Adolphe tiers','0568385687','mouaffoalbert@yahoo.fr','Albert02','ADMIN');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Edwige', 'SAHA','25 rue de Lourcq','0768387811','edwigesaha@yahoo.fr','Edwige03','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('paola', 'Demgne','26 rue Thiers','0668350811','paolak@yahoo.fr','paola.kamdem','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Patrick', 'Tchepga','2 rue Enerst Duvillard','0716386578','patricktchepga@yahoo.fr','Patrick05','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Jesus', 'Christ','3 bis rue Michelet','0725435225','JChrist@yahoo.fr','Jesus06','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Larissa', 'Jacques','22 rue Carnot','0645528552','LJacques@yahoo.fr','Larissa07','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Sabrina', 'Manuella','22 rue Enerst Duvillard','0752425142','Sabrina@yahoo.fr','Sabrina08','ETUDIANT');
INSERT INTO client (LASTNAME,FIRSTNAME,ADDRESS,PHONE,EMAIL,PASSWORD,CLIENT_TYPE)
Values ('Serge', 'Vincent','8 rue Enerst Duvillard','0745289635','Serge@yahoo.fr','Serge09','ETUDIANT');
/*insertion dans la table Location */
INSERT INTO location (STREET, POSTAL_CODE, CITY,COUNTRY)
Values ('2 rue du général Strolz', '90000', 'BELFORT', 'FRANCE');
INSERT INTO location (STREET, POSTAL_CODE, CITY,COUNTRY)
Values ('23 rue de Lourcq', '75019', 'PARIS', 'FRANCE');
INSERT INTO location (STREET, POSTAL_CODE, CITY,COUNTRY)
Values ('59 rue de la Madeleine', '69007', 'LYON', 'FRANCE');
INSERT INTO location (STREET, POSTAL_CODE, CITY,COUNTRY)
Values ('6 rue Andre Richelieu', '95007', 'MARSEILLE', 'FRANCE');
INSERT INTO location (STREET, POSTAL_CODE, CITY,COUNTRY)
Values ('2 rue Adolphe Thiers', '90000', 'BELFORT', 'FRANCE');
/* insertion dans la table session*/
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (1, '2018-12-12','2018-12-17',20);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (2, '2018-12-26','2018-12-30',15);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (3, '2019-01-20','2019-02-20',30);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (4, '2019-01-20','2019-02-20',30);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (1, '2018-12-20','2019-02-20',60);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (3, '2019-01-20','2019-03-20',40);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (4, '2019-04-20','2019-08-20',50);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (2, '2019-01-20','2019-02-20',30);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (2, '2019-01-20','2019-04-20',25);
INSERT INTO session (ID_LOCATION,START_DATE,END_DATE,NBRE_PLACE)
Values (1, '2018-12-20','2019-02-20',60);
/*insertion dans la table inscrire*/
INSERT INTO inscrire (ID_CLT,ID_SESSION,DATE_INSCRIPTION)
Values (3,1,CURRENT_DATE);
INSERT INTO inscrire (ID_CLT,ID_SESSION,DATE_INSCRIPTION)
Values (2,1,CURRENT_DATE);
INSERT INTO inscrire (ID_CLT,ID_SESSION,DATE_INSCRIPTION)
Values (1,1,CURRENT_DATE);
INSERT INTO inscrire (ID_CLT,ID_SESSION,DATE_INSCRIPTION)
Values (4,1,CURRENT_DATE);
| true |
d98607c3e132b3074e66475467dd0377e07265ee | SQL | MikeMwambia-TrojanSystem/sql-syntax | /capstone/instagram_Clone.sql | UTF-8 | 1,828 | 4.3125 | 4 | [] | no_license | create database ig_clone;
use ig_clone;
create table users (
id int auto_increment primary key ,
user_name varchar(255) unique not null,
created_at timestamp default now()
);
create table photos (
id integer auto_increment primary key,
image_url varchar(255) not null,
user_id integer not null,
created_at timestamp default now(),
foreign key (user_id) references users(id)
);
create table comments (
id int auto_increment primary key,
comment_text varchar(255) not null,
user_id int not null,
photo_id int not null,
created_at timestamp default now(),
foreign key (user_id) references users(id),
foreign key (photo_id) references photos(id)
);
-- Sets two fields as primary key
-- user_id and photo_id
-- NB : - Notice no id since we will not use it
create table likes (
user_id int auto_increment not null,
photo_id int not null,
created_at timestamp default now(),
foreign key (user_id) references users(id),
foreign key (photo_id) references photos(id),
primary key(user_id,photo_id)
);
-- Creates table for follows
-- Notice the logic of follow and followee
-- implementation use primary key to ensure unique
-- NB : - Notice no need for id
create table follows (
follower_id int not null,
followee_id int not null,
created_at timestamp default now(),
foreign key (follower_id) references users(id),
foreign key (followee_id) references users(id),
primary key (followee_id,follower_id)
);
-- tags names
create table tag (
id integer auto_increment primary key,
tag_name varchar(255) unique not null,
created_at timestamp default now()
);
-- photo tags
create table photo_tag (
photo_id integer not null,
tag_id integer not null,
foreign key (photo_id) references photos(id),
foreign key (tag_id) references tag(id),
primary key (photo_id,tag_id)
);
| true |
8cb061ada7c71dc30d1aad177eb10b174316889f | SQL | anggundw/Dqlab- | /Fundamental SQL Using FUNCTION and GROUP BY/Fungsi Aggregate dan Group By/Tugas_Praktek4.sql | UTF-8 | 298 | 3.203125 | 3 | [] | no_license | SELECT month(order_date) AS order_month, sum(item_price) AS total_price,
CASE
WHEN sum(item_price) >= 30000000000 THEN 'Target Achieved'
WHEN sum(item_price) <= 25000000000 THEN 'Less performed'
ELSE 'Follow Up'
END as remark
FROM sales_retail_2019
GROUP BY month(order_date); | true |
d30b1eb86ada03c27c28024e39c5fd54e0399167 | SQL | EmilyLin8073/Divvy-Database-App | /SQLFiles/Project0505.sql | UTF-8 | 493 | 4.09375 | 4 | [] | no_license | -- Project0505.sql
-- 5. For each customer list the number of trips they have taken.
-- Restrict the results to the 10 users who have taken the most trips.
SELECT TOP 10 Trips.UserID, COUNT(TripID) AS NumTrips
FROM Trips
INNER JOIN Users
On Trips.UserID = Users.UserID
GROUP BY Trips.UserID
ORDER BY NumTrips DESC, UserID ASC
SELECT TOP 10 Users.UserID, COUNT(*) AS NumTrips
FROM Trips, Users
WHERE Trips.UserID = Users.UserID
GROUP BY Users.UserID
ORDER BY COUNT(*) DESC, Users.UserID ASC
| true |
94fad74c5cdb6328ffb1b59754752196c2d01405 | SQL | yoheionishi1/10_10_yoheionishi | /tinyhouse/tiny.sql | UTF-8 | 4,512 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2018 年 3 月 02 日 16:22
-- サーバのバージョン: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `tiny`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `admin_user`
--
CREATE TABLE IF NOT EXISTS `admin_user` (
`id` int(12) NOT NULL,
`admin_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`com_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`admin_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`admin_pass` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `admin_user`
--
INSERT INTO `admin_user` (`id`, `admin_name`, `com_name`, `admin_id`, `admin_pass`) VALUES
(1, '大西', 'リークス', 'admin', 'admin'),
(2, '大西', 'リーk数', 'admin', 'admin'),
(3, '大西', 'リークス', 'admin', 'admin'),
(4, '大西', 'リークス', 'admin', 'admin'),
(5, '大西洋平', 'admin', 'yoheionishi1@gmail.com', 'admin'),
(6, '大西洋平', 'admin', 'yoheionishi1@gmail.com', 'admin'),
(7, '大西洋平', 'admin', 'yoheionishi1@gmail.com', 'admin'),
(8, '大西洋平', 'admin', 'yoheionishi1@gmail.com', 'admin');
-- --------------------------------------------------------
--
-- テーブルの構造 `tiny_info`
--
CREATE TABLE IF NOT EXISTS `tiny_info` (
`id` int(12) NOT NULL,
`housename` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`introduction` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`area` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`price` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`person` int(12) NOT NULL,
`access` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tag1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tag2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tag3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tag4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tag5` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `tiny_info`
--
INSERT INTO `tiny_info` (`id`, `housename`, `introduction`, `area`, `address`, `tel`, `price`, `person`, `access`, `image1`, `tag1`, `tag2`, `tag3`, `tag4`, `tag5`) VALUES
(1, 'も守ろう', 'とても綺麗なお家です', '沖縄', '3-2-14 新槇町ビル別館第一2階', '09024837492', '1500円/人', 3, '渋谷駅から徒歩10分。', 'upload1/20180225060226a7b113a317a0bcfba6b530d6ac6cf83f.jpg', '', '', '', '', ''),
(2, 'テストハウス', 'とても綺麗なお家です', '北海道', '1-25-18', '09024837492', '1500円/人', 3, '渋谷駅から徒歩10分。', 'upload1/20180227152438bf4f90c12f1c7f298c538e0f642bbcb7.jpg', '', '', '', '', ''),
(3, 'パクチソン', 'いいい', '福島', '1-25-18', '09024837492', '1500円/人', 3, '渋谷駅から徒歩10分。', 'upload1/20180228070044f9f3ab6bab187e56261f237f32d723ee.jpg', '1500円/人', '3', '渋谷駅から徒歩10分。', '', ''),
(4, 'テスト', 'あああ', '福島', '瀬田 4-35-12', '09024837492', '1500円/人', 1, '渋谷駅から徒歩10分。', 'upload1/20180228070355cf4baf688965ac35d45db6231746c00d.jpg', '川', '共有', '茶釜', '', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin_user`
--
ALTER TABLE `admin_user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tiny_info`
--
ALTER TABLE `tiny_info`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin_user`
--
ALTER TABLE `admin_user`
MODIFY `id` int(12) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `tiny_info`
--
ALTER TABLE `tiny_info`
MODIFY `id` int(12) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
4536012e87554c2c90824bc0cd9fc3f227558640 | SQL | charles-wangkai/leetcode | /rising-temperature.sql | UTF-8 | 194 | 3.40625 | 3 | [] | no_license | SELECT
w.Id
FROM
Weather w
WHERE
EXISTS (
SELECT
1
FROM
Weather w1
WHERE
w1.recordDate = subdate(w.recordDate, 1)
AND w1.Temperature < w.Temperature
) | true |
d325a011d6749ddb9b491f312e3fa11e595e608e | SQL | alessandrojean/PRI-2015 | /classes/2015.08.27/exercises/Produtos27082015 20150827 1342.sql | UTF-8 | 4,520 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | -- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.6.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
--
-- Create schema produtos
--
CREATE DATABASE IF NOT EXISTS produtos;
USE produtos;
--
-- Temporary table structure for view `visualização1`
--
DROP TABLE IF EXISTS `visualização1`;
DROP VIEW IF EXISTS `visualização1`;
CREATE TABLE `visualização1` (
`CodProd` int(11),
`NomeProd` varchar(40),
`DescProd` varchar(100),
`Valor` double,
`CodFor` int(11)
);
--
-- Definition of table `tabfor`
--
DROP TABLE IF EXISTS `tabfor`;
CREATE TABLE `tabfor` (
`CodFor` int(11) NOT NULL,
`NomeFor` varchar(15) DEFAULT NULL,
`EndFor` varchar(25) DEFAULT NULL,
`CidadeFor` varchar(20) DEFAULT NULL,
`EstadoFor` varchar(2) DEFAULT NULL,
`FoneFor` varchar(13) DEFAULT NULL,
PRIMARY KEY (`CodFor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tabfor`
--
/*!40000 ALTER TABLE `tabfor` DISABLE KEYS */;
INSERT INTO `tabfor` (`CodFor`,`NomeFor`,`EndFor`,`CidadeFor`,`EstadoFor`,`FoneFor`) VALUES
(1,'Material S/A','Rua bonifácio Junior, 45','São Paulo','SP','(11)7564-4323'),
(2,'Expresso Ltda','Rua angra, 245','São Paulo','SP','(11)7234-5523'),
(3,'Futuro Escola','Rua dezembro, 245','São Paulo','SP','(11)8834-5514'),
(4,'Acedêmicos Ltda','Rua hangar 18, 245','São Paulo','SP','(11)8898-6614');
/*!40000 ALTER TABLE `tabfor` ENABLE KEYS */;
--
-- Definition of table `tabprod`
--
DROP TABLE IF EXISTS `tabprod`;
CREATE TABLE `tabprod` (
`CodProd` int(11) NOT NULL AUTO_INCREMENT,
`NomeProd` varchar(40) NOT NULL,
`DescProd` varchar(100) NOT NULL,
`Valor` double NOT NULL,
`CodFor` int(11) NOT NULL,
PRIMARY KEY (`CodProd`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tabprod`
--
/*!40000 ALTER TABLE `tabprod` DISABLE KEYS */;
INSERT INTO `tabprod` (`CodProd`,`NomeProd`,`DescProd`,`Valor`,`CodFor`) VALUES
(1,'Caneta Azul','Caneta Bic ponta grossa',1.5,1),
(2,'Caneta Vermelha','Caneta Bic ponta grossa',1.5,1),
(3,'Caneta Preta','Caneta Bic ponta grossa',1.5,1),
(4,'Caneta Verde','Caneta Bic ponta grossa',1.5,1),
(5,'Borracha - Brindex','Borracha Branca',2.5,2),
(6,'Borracha - Lusithania','Borracha - verde',2.5,2),
(7,'Régua','Régua 30 cm',3.55,2),
(8,'Sulfite','Pacote Sulfite A4',15.56,2),
(9,'Corretivo','Corretivo adesivo',3.5,3),
(10,'Corretivo','Corretivo Líquido',2.5,3),
(11,'Pincel Pilot preto','Pincel Pilot para quadro branco',4.5,3),
(12,'Pincel Pilot vermelho','Pincel Pilot para quadro branco',4.5,3),
(13,'Pincel Pilot azul','Pincel Pilot para quadro branco',4.5,4),
(14,'Pincel Pilot verde','Pincel Pilot para quadro branco',4.5,4),
(15,'Fichario','Bloco fichario com 50 folhas',5,4),
(16,'Fichario','Bloco fichario com 50 folhas em pacote c/10 unidades',50,4),
(17,'Marcador de Texto','Marcador de texto verde',2.8,5),
(18,'Marcador de Texto','Marcador de texto rosa',2.8,5),
(19,'Cartolina','Diversas cores',1.8,5),
(20,'Papel Almaço','Bloco com 10 folhas de almaço',11.8,5),
(21,'Pasta','Pasta',3.55,5),
(22,'FICHÁRIO','FICHÁRIO SIMPLES \r\nNA COR PRETO',23.49,2),
(23,'Tinta guache','Várias cores',7.55,4);
/*!40000 ALTER TABLE `tabprod` ENABLE KEYS */;
--
-- Definition of view `visualização1`
--
DROP TABLE IF EXISTS `visualização1`;
DROP VIEW IF EXISTS `visualização1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `visualização1` AS select `tabprod`.`CodProd` AS `CodProd`,`tabprod`.`NomeProd` AS `NomeProd`,`tabprod`.`DescProd` AS `DescProd`,`tabprod`.`Valor` AS `Valor`,`tabprod`.`CodFor` AS `CodFor` from `tabprod`;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
| true |
66b5288e99a54ab3d263d354d40804f8cf3beabf | SQL | ijuang/irene-cliqstudios | /Web/ben-ssrs-label.sql | UTF-8 | 598 | 3.75 | 4 | [] | no_license | --To get Web Order Total:
select order_number, order_id, update_date, order_total, order_status
from [order]
where order_status = 'OO'
and update_date >= GETDATE()
-- Get order branch - Join to Customer number and branch
-- Get order type
-- To select a list of orders to search for labels
select
o.order_number, o.order_id, o.update_date, o.order_total, o.order_status,
c.cabinet_order_id, c.branch_number,c.cabinet_count, c.create_date,c.order_type
from [order] o left join [cabinetorder_extension] c on o.order_id = c.cabinet_order_ID
where order_status = 'OO'
and update_date >= GETDATE()-1
| true |
a44b9a0bfe37986b4c2970e5fcb72437c599f02b | SQL | jpmmiranda/WeatherStation | /criacaoBD.sql | UTF-8 | 1,692 | 3.5 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema Leituras
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema Leituras
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `Leituras` DEFAULT CHARACTER SET utf8 ;
USE `Leituras` ;
-- -----------------------------------------------------
-- Table `Leituras`.`Local`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `Leituras`.`Local` (
`Longitude` DECIMAL(11,8) NOT NULL,
`Latitude` DECIMAL(10,8) NOT NULL,
PRIMARY KEY (`Longitude`, `Latitude`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `Leituras`.`Registos`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `Leituras`.`Registos` (
`Temperatura` INT NULL,
`Ruido` INT NULL,
`Data` VARCHAR(45) NOT NULL,
`Local_Longitude` DECIMAL(11,8) NOT NULL,
`Local_Latitude` DECIMAL(10,8) NOT NULL,
INDEX `fk_Registos_Local_idx` (`Local_Longitude` ASC, `Local_Latitude` ASC),
CONSTRAINT `fk_Registos_Local`
FOREIGN KEY (`Local_Longitude` , `Local_Latitude`)
REFERENCES `Leituras`.`Local` (`Longitude` , `Latitude`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
dcb84273608ea044b727d0b1643895fd5cd279da | SQL | masuramatin/laravel_example2 | /josh5.sql | UTF-8 | 5,801 | 2.984375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 26, 2018 at 02:41 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
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: `josh`
--
-- --------------------------------------------------------
--
-- Table structure for table `aboutuses`
--
CREATE TABLE `aboutuses` (
`id` int(10) UNSIGNED NOT NULL,
`content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `aboutuses`
--
INSERT INTO `aboutuses` (`id`, `content`, `created_at`, `updated_at`) VALUES
(1, 'rob valo vari', NULL, '2018-09-26 04:27:13');
-- --------------------------------------------------------
--
-- Table structure for table `blogs`
--
CREATE TABLE `blogs` (
`id` int(10) UNSIGNED NOT NULL,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `blogs`
--
INSERT INTO `blogs` (`id`, `subject`, `description`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Subject One', 'This is the Subject One Description', '1.jpg', '2018-09-20 03:38:42', '2018-09-20 03:38:42'),
(2, 'Subject Two', 'This is the Subject Two Description', '2.jpg', '2018-09-20 03:39:51', '2018-09-20 03:39:51'),
(4, 'abul', 'kader', '3.jpg', '2018-09-23 03:28:34', '2018-09-23 03:28:34'),
(5, 'zin ka kotha bashi bolta dawa jaba na', 'shun la moder hashi pay zin shatar kat ta chay', '1.jpg', '2018-09-23 03:29:20', '2018-09-23 03:29:20'),
(6, 'hoi hoi roi roi zin sahab galo koi', 'zin shab hi hi', '2.jpg', '2018-09-23 03:29:55', '2018-09-23 05:46:53'),
(7, 'hoi hoi roi roi zin sahab galo koi', 'zin shab hi hi', '3.jpg', '2018-09-23 05:45:35', '2018-09-23 05:45:35');
-- --------------------------------------------------------
--
-- Table structure for table `contacts`
--
CREATE TABLE `contacts` (
`id` int(10) UNSIGNED NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `contacts`
--
INSERT INTO `contacts` (`id`, `email`, `subject`, `description`, `created_at`, `updated_at`) VALUES
(3, 'faru@gmail.com', 'aaaa', 'contact', '2018-09-25 05:55:51', '2018-09-25 05:55:51');
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2018_09_19_113429_create_blogs_table', 1),
(2, '2018_09_24_102617_create_contacts_table', 2),
(3, '2018_09_25_123347_create_abouts_table', 3),
(4, '2018_09_25_123719_create_aboutuses_table', 4);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `aboutuses`
--
ALTER TABLE `aboutuses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `blogs`
--
ALTER TABLE `blogs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `aboutuses`
--
ALTER TABLE `aboutuses`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `blogs`
--
ALTER TABLE `blogs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED 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 */;
| true |
b6a7307071290568f2d6991ac7f3b969a7bbe6e1 | SQL | peterloron/Bunker | /sqlite.sql | UTF-8 | 704 | 2.734375 | 3 | [] | no_license | CREATE TABLE "secret"(
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"path" Text NOT NULL,
"value" Text NOT NULL, "desc" Text,
CONSTRAINT "unique_id" UNIQUE ( "id" ),
CONSTRAINT "unique_path" UNIQUE ( "path" ) )
CREATE TABLE "user"(
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"username" Text NOT NULL,
"pwhash" Text NOT NULL,
"email" Text NOT NULL,
"fullname" Text NOT NULL,
"groups" Text NOT NULL,
CONSTRAINT "unique_id" UNIQUE ( "id" ),
CONSTRAINT "unique_username" UNIQUE ( "username" ) )
CREATE TABLE "group"(
"id" Integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" Text NOT NULL,
CONSTRAINT "unique_id" UNIQUE ( "id" ),
CONSTRAINT "unique_name" UNIQUE ( "name" ) ) | true |
e7aa37b19670fba0797d92b7b8f11cc33c40bec1 | SQL | KavishkaRathnaweera/System-for-Departmnet-of-Motor-Traffic | /model/mysql/exampaper.sql | UTF-8 | 6,227 | 3.5625 | 4 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 13, 2020 at 06:46 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
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: `dmt`
--
-- --------------------------------------------------------
--
-- Table structure for table `exampaper`
--
CREATE TABLE `exampaper` (
`number` int(11) NOT NULL,
`question` varchar(500) NOT NULL,
`answere1` varchar(500) NOT NULL,
`answere2` varchar(500) NOT NULL,
`answere3` varchar(500) NOT NULL,
`answere4` varchar(500) NOT NULL,
`correct` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `exampaper`
--
INSERT INTO `exampaper` (`number`, `question`, `answere1`, `answere2`, `answere3`, `answere4`, `correct`) VALUES
(1, 'When you change houses, you must inform your nearest RTO about the change in your address within:', '30 Days', '90 Days', '1 Year', 'No need to inform', 'A1'),
(2, 'On a one-way road, you should not:', 'Drive in the reverse gear', 'Park on the way', 'Over-speed', 'Honk a lot', 'A1'),
(3, 'How do you know that a vehicle is a transport vehicle?', 'By seeing the number plate of the vehicle.', 'By the driver’s license.', 'By the make of the vehicle.', 'By the Board shown in vehicle.', 'A1'),
(4, 'Overtaking is allowed only?', 'From the right side', 'From the leftside', 'After honking 3 times', 'Because of headlight.', 'A1'),
(5, 'While travelling uphill, which vehicle has the right-of-way over others?', 'Any vehicle travelling uphill', 'The vehicle which came first', 'Longest vehicle', 'Largest vehicle', 'A1'),
(6, 'Your vehicle faces a railway station which is unguarded and you want to move, you must', 'Stop your motor vehicle on the road’s left side, move towards the track and check whether there are any trains coming before crossing', 'Keep honking and cross the station fast', 'Wait patiently till l the train pass', 'Go quickly', 'A1'),
(7, 'The driver of any vehicle is allowed to overtake', 'When the driver in front gives the right indication to overtake', 'When there is a broad road', 'Driving on a hilly road', 'When there is double line', 'A1'),
(8, 'Red signal in traffic implies', 'Please stop your vehicle', 'Move with caution', 'Please slow down your vehicle', 'Go along', 'A1'),
(9, 'Overtaking will be forbidden in case', 'All mentioned as below', 'Roads look greasy', 'Dangerous to approaching traffic', 'When you overtake from right side', 'A1'),
(10, 'When your car is halted on one side of the road at night, then', 'All as mentioned below', 'Parking signal must be used', 'The vehicle must be under lock and key', 'Parking should be in right place', 'A1'),
(11, 'You are approaching a fine bridge and you see there is one more vehicle is entering the bridge from the opposite side. What will be your action?', 'You need to wait till the other car pass the bridge before you move on', 'Switch on the headlight and start crossing the bridge', 'Drive fast so that you can first pass the bridge', 'Do not drive fast', 'A1'),
(12, 'Parking in front of a hospital is', 'Not correct', 'Correct', 'Depends on the situation', 'None of above', 'A1'),
(13, 'If a driver sees the sign for ‘slippery road ahead’, he/she must', 'Change gear and reduce speed', 'Apply brake but proceed in the same speed', 'Drive faster', 'None of above', 'A1'),
(14, 'Overtaking is prohibited when', 'Roads are slippery', 'Poses danger to oncoming traffic', 'All of the above', 'None of above', 'A1'),
(15, 'Overtaking when the vehicle approaches a bend is', 'Not allowed', 'Allowed', 'Allowed with caution', 'None of above', 'A1'),
(16, 'Drunken driving is', 'Prohibited at all times', 'Allowed during the day', 'Allowed at night', 'None of above', 'A1'),
(17, 'Honking is prohibited near', 'Hospitals, Court of Law', 'Places of religious worship such as Temple, Mosque and Churches', 'Near Police Stations', 'None of above', 'A1'),
(18, 'Rear view mirror is utilized for', 'Watching traffic that is approaching from behind', 'Watching back seat passengers', 'Car decor', 'None of above', 'A1'),
(19, 'Boarding in and alighting from vehicles when it is in motion is', 'Prohibited in all vehicles', 'Allowed in buses', 'Allowed in autos', 'None of above', 'A1'),
(20, 'Mobile phones should not be used', 'While driving a vehicle', 'In office', 'At home', 'None of above', 'A1'),
(21, 'Overtaking is not allowed when', 'When the road ahead is not visible clearly', 'When the road is wide enough', 'The road has no potholes', 'None of above', 'A1'),
(22, 'Pedestrians are not allowed to cross the road close to stopped vehicles or near sharp bends because', 'Drivers of approaching vehicles may not be able to see them', 'It is inconvenient to other pedestrians', 'It is an inconvenience to oncoming vehicles', 'None of above', 'A1'),
(23, 'Records needed for private vehicles are', 'Insurance Certificate, Registration Certificate, Driving License and Tax Token', 'G.C.R, Insurance Certificate, Registration Certificate', 'Permit, Trip Sheet, Registration Certificate', 'None of above', 'A1'),
(24, 'Validity of Pollution Under Control Certificate is', '6 months', '1 year', '2 years', 'None of above', 'A1'),
(25, 'Minimum age for availing a license to drive a motor vehicle without gear is', '16 years', '21 years', '18 years', 'None of above', 'A1');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `exampaper`
--
ALTER TABLE `exampaper`
ADD PRIMARY KEY (`number`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `exampaper`
--
ALTER TABLE `exampaper`
MODIFY `number` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
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 */;
| true |
531ca34121703bae2a91923479c8a97609aeab2b | SQL | BrenPatF/sql_demos | /shortest_path/Run_Queries_SP.sql | UTF-8 | 5,853 | 3.984375 | 4 | [] | no_license | /***************************************************************************************************
GitHub Project: sql_demos - Brendan's repo for interesting SQL
https://github.com/BrenPatF/sql_demos
Author: Brendan Furey, 4 May 2015
Description: Called by the driving scripts to run the SQL queries for the shortest_path schema.
This script implements ideas in the second post below, for the datasets mentioned
there. It takes two parameters, for the starting node and the maximum level
Further details: 'SQL for Shortest Path Problems', April 2015
http://aprogrammerwrites.eu/?p=1391
'SQL for Shortest Path Problems 2: A Branch and Bound Approach', May 2015
http://aprogrammerwrites.eu/?p=1415
***************************************************************************************************/
DEFINE SRC=&1
DEFINE LEVMAX=&2
BEGIN
Utils.Clear_Log;
Utils.g_debug_level := 0;
END;
/
COLUMN path FORMAT A80
COLUMN node FORMAT A30
COLUMN lp FORMAT A2
COLUMN lev FORMAT 990
COLUMN maxlev FORMAT 999990
COLUMN intnod FORMAT 999990
COLUMN intmax FORMAT 999990
SET TIMING ON
PROMPT BPF Approximate Solution - SP_RSFONE
WITH paths (node, path, lev, rn) AS (
SELECT a.dst, To_Char(a.dst), 1, 1
FROM arcs_v a
WHERE a.src = &SRC
UNION ALL
SELECT a.dst,
p.path || ',' || a.dst,
p.lev + 1,
Row_Number () OVER (PARTITION BY a.dst ORDER BY a.dst)
FROM paths p
JOIN arcs_v a
ON a.src = p.node
WHERE p.rn = 1
AND p.lev < &LEVMAX
) SEARCH DEPTH FIRST BY node SET line_no
CYCLE node SET lp TO '*' DEFAULT ' '
SELECT /*+ gather_plan_statistics SP_RSFONE */
Substr (LPad ('.', 1 + 2 * (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) - 1), '.') || node, 2) node,
Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) lev,
Max (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev)) OVER () maxlev,
Max (lev) intnod,
Max (Max (lev)) OVER () intmax,
Max (path) KEEP (DENSE_RANK FIRST ORDER BY lev) path,
Max (lp) KEEP (DENSE_RANK FIRST ORDER BY lev) lp
FROM paths
GROUP BY node
ORDER BY Max (line_no) KEEP (DENSE_RANK FIRST ORDER BY lev)
/
EXECUTE Utils.Write_Plan (p_sql_marker => 'SP_RSFONE');
PROMPT BPF Exact solution - SP_RSFTWO
WITH paths_0 (node, path, lev, rn) /* SP_RSFTWO */ AS (
SELECT a.dst, To_Char(a.dst), 1, 1
FROM arcs_v a
WHERE a.src = &SRC
UNION ALL
SELECT a.dst,
p.path || ',' || a.dst,
p.lev + 1,
Row_Number () OVER (PARTITION BY a.dst ORDER BY a.dst)
FROM paths_0 p
JOIN arcs_v a
ON a.src = p.node
WHERE p.rn = 1
AND p.lev < &LEVMAX
) CYCLE node SET lp TO '*' DEFAULT ' '
, approx_best_paths AS (
SELECT node,
Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) lev
FROM paths_0
GROUP BY node
), paths (node, path, lev, rn) AS (
SELECT a.dst, To_Char(a.dst), 1, 1
FROM arcs_v a
WHERE a.src = &SRC
UNION ALL
SELECT a.dst,
p.path || ',' || a.dst,
p.lev + 1,
Row_Number () OVER (PARTITION BY a.dst ORDER BY a.dst)
FROM paths p
JOIN arcs_v a
ON a.src = p.node
LEFT JOIN approx_best_paths b
ON b.node = a.dst
WHERE p.rn = 1
AND p.lev < Nvl (b.lev, 1000000)
) SEARCH DEPTH FIRST BY node SET line_no CYCLE node SET lp TO '*' DEFAULT ' '
SELECT /*+ gather_plan_statistics */
Substr (LPad ('.', 1 + 2 * (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) - 1), '.') || node, 2) node,
Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) lev,
Max (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev)) OVER () maxlev,
Max (lev) intnod,
Max (Max (lev)) OVER () intmax,
Max (path) KEEP (DENSE_RANK FIRST ORDER BY lev) path,
Max (lp) KEEP (DENSE_RANK FIRST ORDER BY lev) lp
FROM paths
GROUP BY node
ORDER BY Max (line_no) KEEP (DENSE_RANK FIRST ORDER BY lev)
/
EXECUTE Utils.Write_Plan (p_sql_marker => 'SP_RSFTWO');
PROMPT BPF Exact Solution - SP_GTTRSF_I - Insert approximate to GTT
INSERT INTO approx_min_levs
WITH paths_0 (node, path, lev, rn) /* SP_GTTRSF_I */ AS (
SELECT a.dst, To_Char(a.dst), 1, 1
FROM arcs_v a
WHERE a.src = &SRC
UNION ALL
SELECT a.dst,
p.path || ',' || a.dst,
p.lev + 1,
Row_Number () OVER (PARTITION BY a.dst ORDER BY a.dst)
FROM paths_0 p
JOIN arcs_v a
ON a.src = p.node
WHERE p.rn = 1
AND p.lev < &LEVMAX
) CYCLE node SET lp TO '*' DEFAULT ' '
SELECT /*+ gather_plan_statistics */
node,
Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) lev
FROM paths_0
GROUP BY node
/
EXECUTE Utils.Write_Plan (p_sql_marker => 'SP_GTTRSF_I');
PROMPT BPF Exact solution - SP_GTTRSF_Q - Query
WITH paths (node, path, lev, rn) AS /* SP_GTTRSF_Q */ (
SELECT a.dst, To_Char(a.dst), 1, 1
FROM arcs_v a
WHERE a.src = &SRC
UNION ALL
SELECT a.dst,
p.path || ',' || a.dst,
p.lev + 1,
Row_Number () OVER (PARTITION BY a.dst ORDER BY a.dst)
FROM paths p
JOIN arcs_v a
ON a.src = p.node
LEFT JOIN approx_min_levs b
ON b.node = a.dst
WHERE p.rn = 1
AND p.lev < Nvl (b.lev, 1000000)
) SEARCH DEPTH FIRST BY node SET line_no CYCLE node SET lp TO '*' DEFAULT ' '
SELECT /*+ gather_plan_statistics */
Substr (LPad ('.', 1 + 2 * (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) - 1), '.') || node, 2) node,
Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev) lev,
Max (Max (lev) KEEP (DENSE_RANK FIRST ORDER BY lev)) OVER () maxlev,
Max (lev) intnod,
Max (Max (lev)) OVER () intmax,
Max (path) KEEP (DENSE_RANK FIRST ORDER BY lev) path,
Max (lp) KEEP (DENSE_RANK FIRST ORDER BY lev) lp
FROM paths
GROUP BY node
ORDER BY Max (line_no) KEEP (DENSE_RANK FIRST ORDER BY lev)
/
EXECUTE Utils.Write_Plan (p_sql_marker => 'SP_GTTRSF_Q');
SET TIMING OFF
@..\bren\L_Log_Default
| true |
2a4a2f9893e07f9e11f3bde2da7305d62456aa77 | SQL | kalyashov/channel-autoposting-bot | /src/main/resources/db/scripts/release_1_0_0/03_create_table_bot_settings.sql | UTF-8 | 398 | 2.578125 | 3 | [] | no_license | --liquibase formatted sql
--changeset kalyashov:create_table_bot_settings rollbackSplitStatements:true
--comment: Создание таблицы с настройками бота
create table bot_settings
(
settings json,
);
comment on table bot_settings is 'Настройки бота';
insert into bot_settings values ('{ "status": "ACTIVE" }');
--rollback drop table bot_settings;
| true |
984bf4c78dfef8daddbc6657c52463af9e7c6db4 | SQL | rumen-delov/SoftUni-Courses | /02.2.1 MS SQL/02. CRUD/23. BiggestCountriesByPopulation.sql | UTF-8 | 149 | 2.8125 | 3 | [] | no_license | --USE [Geography]
SELECT TOP(30) [CountryName], [Population]
FROM [Countries]
WHERE [ContinentCode] = 'EU'
ORDER BY [Population] DESC, [CountryName] | true |
e75807b90488e8039aa17b8170a6ce59ff60a972 | SQL | phuongxinhgai8788/SE2_finalproject | /database/data.sql | UTF-8 | 3,182 | 2.84375 | 3 | [] | no_license | USE se22021;
insert into se22021.inventories (id, name, price, source, thumbnailUrl, tags)
values (1, 'Anchor fastener (plated) 4', 20, null, null, 'hiltop,qualified'),
(2, 'Pendant switch', 40, null, null, 'anchor,new'),
(3, 'Batten nail', 50, null, null, 'ck,qualified'),
(4, '6 sq mm 3 core Copper armoured cable', 24, null, null, 'ecko,new'),
(5, '6M Modular Plate', 53, null, null, 'anchor roma,new'),
(6, 'Pendant Bulb holder bakelite', 34, null, null, 'anchor,classic'),
(7, 'Lamp 150 W HPSV screw type', 88, null, null, 'crompton greaves,new,qualified');
insert into se22021.roles (id, name)
values (1, 'Director'),
(2, 'Manager'),
(3, 'Transporter');
insert into se22021.transportingUnits (id, name)
values (1, 'FastExpress'),
(2, 'J&T Express');
insert into se22021.labors (id, name, dateOfBirth, phoneNumber, roleId, transportingUnitId, password, email)
values (1, 'Karen Quinn', '1968-01-15', '01632 960506', 3, 2, '1', 'super@cannabisresoulution.net'),
(2, 'Rachel Turner', '1992-08-19', '202-555-0141', 1, 1, '1', '1gjenerali@oormi.com'),
(3, 'Irene Fisher', '1914-02-19', '202-555-0116', 2, 1, '1', 'babdelha@taluabushop.com'),
(4, 'Ella MacLeod', '1939-06-27', '202-555-0150', 3, 1, '1', '3atair@noisemails.com'),
(5, 'Carl Hudson', '1931-11-10', '202-555-0176', 2, 2, '1', 'vsoufain@betrallydk.com'),
(6, 'Wendy Clarkson', '1907-03-21', '202-555-0191', 3, 2, '1', '3welingtongoldboz@how2t.site');
insert into scm.orders (id, customerName, address, phoneNumber, transportingUnitId, transporterId, notes, createdDate, status)
values (1, 'Mr. Christopher F Swartz', '655 Poe Lane, Fort Worth, Kansas', '913-570-6050', 1, 6, 'Home-time: from 5.00pm', '2021-04-29 06:03:35', 'SHIPPING'),
(2, 'Ms. Margaret R Key', '4550 Fannie Street, Clute, Texas', '979-265-7112', 2, 1, 'Home-time: from 5.00pm', '2021-04-30 06:03:35', 'SHIPPING');
insert into se22021.orderDeliveryDetails (orderId, updatedDate, notes)
values (1, '2021-04-30 06:07:31', 'Goods packaged & prepared to deliver'),
(1, '2021-04-30 06:07:52', 'Package is on going'),
(2, '2021-04-30 06:07:57', 'Goods packaged & prepared to deliver'),
(2, '2021-04-30 06:22:52', 'Packaging is not qualified, returned to repack'),
(2, '2021-04-30 07:04:44', 'Package is on going, transporter confirmed');
insert into se22021.orderDetails (orderId, itemId, price, quantity)
values (1, 1, 20, 5),
(1, 4, 24, 6),
(1, 7, 88, 2),
(2, 3, 50, 1),
(2, 5, 53, 4);
insert into scm.warehouses (id, address, managerId)
values (4, '3687 Viking Drive, Dublin, Ohio
740-717-3284', 6),
(5, '1458 Ridge Road, Dodge City, Kansas
620-789-4485', 7);
delete from scm.warehouses where id=4;
update scm.inventories set thumbnailUrl='Pendant_switch.jpg' where id=2;
SELECT w.address, l.name AS managerName, wi.quantity AS
quantity
FROM warehouses w
LEFT JOIN labors l ON l.id = w.managerId
LEFT JOIN warehouseItems wi ON w.id = wI.warehouseId
WHERE wi.inventoryId = 2
GROUP BY wi.warehouseId
/**
Hello, it's me
*/ | true |
e47506de7a1a0e5535a2da3fa85d87dc17d0342b | SQL | jsanterre/BizView-Extensions | /SQL_Queries.sql | UTF-8 | 1,526 | 2.953125 | 3 | [] | no_license | -- BizView's Clients table queries
-- Creation of the table
CREATE TABLE %PREFIX%_bizview_clients (
id int(11) NOT NULL auto_increment,
name varchar(255),
address varchar(255),
city varchar(255),
province varchar(255),
postal_code varchar(255),
phone_number varchar(20),
email_address varchar(255),
video_id varchar(255),
facebook varchar(510),
twitter varchar(510),
email_friend varchar(255),
rss varchar(255),
site_url varchar(255),
template int(32),
sunday varchar(255),
monday varchar(255),
tuesday varchar(255),
wednesday varchar(255),
thursday varchar(255),
friday varchar(255),
saturday varchar(255),
PRIMARY KEY (id)
)
-- Adding entries into the table
INSERT INTO %PREFIX%_bizview_clients
(name, address, city, province, postal_code, phone_number, email_address, video_id)
VALUES ('Crock A Doodle', '519 Osborne Street', 'Winnipeg', 'Manitoba', 'R3L 2A9', '(204) 284 1736', 'AR4MPkxxrhg')
INSERT INTO %PREFIX%_bizview_clients
(name, address, city, province, postal_code, phone_number, email_address, video_id)
VALUES ('Fox and Hounds', '1719 Portage Avenue', 'Winnipeg', 'Manitoba', 'R3J 0E4', '(204) 888 2341', '6TpWmGhEzrk')
INSERT INTO %PREFIX%_bizview_clients
(name, address, city, province, postal_code, phone_number, email_address, video_id)
VALUES ('3 Fathoms', '163 Henderson Hwy', 'Winnipeg', 'Manitoba', 'R2L 1L5', '(204) 668 2816', 'u8qNru84pC4')
ALTER TABLE `sxi32_bizview_clients` ADD `video_id` VARCHAR( 255 ) NOT NULL | true |
74f53a632018f58b9456841d09326560101026d2 | SQL | michellehuh/netflix | /sql_files/queries.sql | UTF-8 | 3,322 | 4.03125 | 4 | [] | no_license | SELECT m.title, g.genre
from movie m, movieisofgenre g
where (m.id = g.movieid) AND (g.genre = 'COMEDY');
SELECT p.name, sum(w.TIMEIN) as totalwatchtime
from watches w, profile p
where w.ADMINID = '18139162' and p.name = w.profilename
GROUP BY p.name
order by sum(w.timein) DESC;
SELECT p.name, m.title
from profile p, movie m, agerestriction a
where p.name = 'Maggie' and m.agerestriction = a.name and p.age >= a.MINAGE;
SELECT m.id, m.title, count(movieid) as watches
from watches w, movie m
where m.id = w.movieid
group by m.id, m.title;
select m.title, numwatches
from movie m, (select m2.id, count(*) as numwatches
from movie m2, watches w
where m2.id = w.movieid
group by m2.id) watchcount
where m.id = watchcount.id and
numwatches = (select max(numwatches) from (select m2.id, count(*) as numwatches
from movie m2, watches w
where m2.id = w.movieid
group by m2.id));
select g.genre, m.title, numwatches
from movieisofgenre g, movie m, (select g2.genre, m2.id, count(*) as numwatches
from movie m2, watches w, movieisofgenre g2
where m2.id = w.movieid and m2.id = g2.movieid
group by m2.id, g2.GENRE) watchcount
WHERE m.id = watchcount.id and m.id = g.movieid and g.genre = watchcount.genre and
numwatches = (select max(numwatches) from (select g2.genre, m2.id, count(*) as numwatches
from movie m2, watches w, movieisofgenre g2
where m2.id = w.movieid and m2.id = g2.movieid
group by m2.id, g2.genre));
select genre, max(numwatches) from movie m, (select g2.genre, m2.id, count(*) as numwatches
from movie m2, watches w, movieisofgenre g2
where m2.id = w.movieid and m2.id = g2.movieid
group by m2.id, g2.genre) watchcount
WHERE watchcount.id = m.id
group by genre;
select g.genre, m.title, moviewatchcount.watches
from movieisofgenre g, movie m,(select genre, max(numwatches) as maxwatches from movie m, (select g2.genre, m2.id, count(*) as numwatches
from movie m2, watches w, movieisofgenre g2
where m2.id = w.movieid and m2.id = g2.movieid
group by m2.id, g2.genre) watchcount
WHERE watchcount.id = m.id
group by genre) genrewatchcount,
(SELECT m.id, m.title, count(movieid) as watches
from watches w, movie m
where m.id = w.movieid
group by m.id, m.title) moviewatchcount
WHERE m.id = g.MOVIEID and g.genre = genrewatchcount.genre and m.id = moviewatchcount.id
and genrewatchcount.maxwatches = moviewatchcount.watches;
SELECT profile.name
from admin, profile
where profile.adminid = admin.id and admin.email = 'patriciaye@email.com' and admin.password = 'pw123';
SELECT *
from admin
where email = 'michelle.huh@hotmail.com' and password = 'qwer';
| true |
1a05f922100a9e74c8ac34f3a12fe054854e2bee | SQL | s-e1/vacation-backend | /project3.sql | UTF-8 | 6,938 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 22, 2020 at 10:45 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.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: `project3`
--
-- --------------------------------------------------------
--
-- Table structure for table `follow`
--
CREATE TABLE `follow` (
`user_id` int(11) NOT NULL,
`trip_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `follow`
--
INSERT INTO `follow` (`user_id`, `trip_id`) VALUES
(1, 1),
(1, 2),
(2, 1),
(2, 2),
(2, 3),
(3, 3),
(3, 4),
(4, 4),
(4, 5),
(9, 3),
(32, 4),
(32, 32),
(32, 37);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`firstname` varchar(20) NOT NULL,
`lastname` varchar(20) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `firstname`, `lastname`, `username`, `password`) VALUES
(1, 'top', 'user', 'admin', '1234'),
(2, 'Leanne', 'Graham', 'Bret', '1234'),
(3, 'Ervin', 'Howell', 'Antonette', '1234'),
(4, 'Clementine', ' Bauch', 'Samantha', '1234'),
(5, 'Patricia', ' Lebsack', 'Karianne', '1234'),
(6, 'Chelsey ', 'Dietrich', 'Kamren', '1234'),
(7, 'Dennis ', 'Schulist', 'Leopoldo_Corkery', '1234'),
(8, 'Kurtis', 'Weissnat', 'Elwyn.Skiles', '1234'),
(9, 'Nicholas', 'Runolfsdottir', 'Maxime_Nienow', '1234'),
(10, 'Glenna', 'Reichert', 'Delphine', '1234'),
(32, 'a', 'a', 'a', 'a');
-- --------------------------------------------------------
--
-- Table structure for table `vacations`
--
CREATE TABLE `vacations` (
`id` int(11) NOT NULL,
`description` varchar(255) NOT NULL,
`location` varchar(30) NOT NULL,
`img` varchar(255) NOT NULL,
`begin` varchar(50) NOT NULL,
`end` varchar(50) NOT NULL,
`price` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `vacations`
--
INSERT INTO `vacations` (`id`, `description`, `location`, `img`, `begin`, `end`, `price`) VALUES
(1, 'The City of Light draws millions of visitors every year with its unforgettable ambiance.', 'Paris', 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Louvre_Museum_Wikimedia_Commons.jpg/1024px-Louvre_Museum_Wikimedia_Commons.jpg', 'Jan 01 2020', 'Jan 10 2020', 1000),
(2, 'For thousands of years, Rome has been the capital to some of the most important empires and nations in history.', 'Rome', 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Sant_Angelo_bridge.jpg/600px-Sant_Angelo_bridge.jpg', 'Jan 11 2020', 'Jan 20 2020', 1000),
(3, ' From the knockout volcanic landscape which shapes Moorea, to the mesmerising Tahiitan dancing, Tahiti and Her Islands are vibrant and diverse.', 'Tahiti', 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Plage.sable.noir.Tahiti.JPG/520px-Plage.sable.noir.Tahiti.JPG', 'Jan 21 2020', 'Jan 30 2020', 1000),
(4, 'London is a diverse and exciting city with some of the world\'s best sights, attractions and activities', 'London', 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Tower_Bridge_from_Shad_Thames.jpg/450px-Tower_Bridge_from_Shad_Thames.jpg', 'Feb 01 2020', 'Feb 10 2020', 1000),
(5, 'With its mix of perfect beaches, lush green valleys, volcanic landscapes, adventurous water sports, historic villages, rich culture and stellar restaurants, Maui always delivers the perfect vacation experience.', 'Maui', 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Waianapanapa_State_Park_Maui_Hawaii_Road_to_Hana_%2845690767052%29.jpg/440px-Waianapanapa_State_Park_Maui_Hawaii_Road_to_Hana_%2845690767052%29.jpg', 'Feb 11 2020', 'Feb 20 2020', 1000),
(32, 'Delhi is a unique place to every other city world over. First time travelers might get a sensory overload with the pollution, chaos, exotic cuisine, rich culture, colors, shopping marketplaces, history and architecture.', 'New Delhi', 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/New_Delhi_government_block_03-2016_img6.jpg/440px-New_Delhi_government_block_03-2016_img6.jpg', 'Feb 21 2020', 'Feb 29 2020', 1478),
(33, 'As one of the world’s leading metropolises for art, fashion, food and theater, New York is a city every traveler should visit.', 'New York', 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Statue_of_Liberty%2C_NY.jpg/440px-Statue_of_Liberty%2C_NY.jpg', 'Mar 01 2020', 'Mar 10 2020', 2000),
(34, 'From ancient walled capital to showpiece megacity in barely a century, Beijing, spins a breathless yarn of triumph, tragedy, endurance and innovation.', 'Beijing', 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/The_Great_Wall_of_China_at_Jinshanling-edit.jpg/440px-The_Great_Wall_of_China_at_Jinshanling-edit.jpg', 'Mar 11 2020', 'Mar 20 2020', 2555),
(37, 'From tropical penguins and blue-footed boars to Darwin finches, or male frigate birds that blow their wrinkled necks into impressive red balloons - the Galapagos Islands are an astonishing wildlife haven. ', 'Galápagos Islands', 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Common_Bottlenose_Dolphin_%28Tursiops_truncatus%29_-_Galapagos_%282225816313%29.jpg/440px-Common_Bottlenose_Dolphin_%28Tursiops_truncatus%29_-_Galapagos_%282225816313%29.jpg', 'Mar 21 2020', 'Mar 30 2020', 3000);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `follow`
--
ALTER TABLE `follow`
ADD PRIMARY KEY (`user_id`,`trip_id`),
ADD KEY `fk_trip_id` (`trip_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `vacations`
--
ALTER TABLE `vacations`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `vacations`
--
ALTER TABLE `vacations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `follow`
--
ALTER TABLE `follow`
ADD CONSTRAINT `fk_trip_id` FOREIGN KEY (`trip_id`) REFERENCES `vacations` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
e5e1eb119fae7ff65e36df6d0ec0685c53d050fd | SQL | shohanProgrammer/clippingpath_360 | /clippingpath_360/clippingpath_360.sql | UTF-8 | 13,330 | 3.09375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 06, 2021 at 05:27 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `clippingpath_360`
--
-- --------------------------------------------------------
--
-- Table structure for table `all_req`
--
CREATE TABLE `all_req` (
`id` int(10) NOT NULL,
`service_type` varchar(100) NOT NULL,
`job_title` varchar(100) NOT NULL,
`description` varchar(10000) NOT NULL,
`attachment` varchar(100) NOT NULL,
`budget` varchar(50) NOT NULL,
`posted` varchar(10) NOT NULL,
`duration` varchar(20) NOT NULL,
`status` varchar(50) NOT NULL,
`client_id` int(10) NOT NULL,
`extra_status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Dumping data for table `all_req`
--
INSERT INTO `all_req` (`id`, `service_type`, `job_title`, `description`, `attachment`, `budget`, `posted`, `duration`, `status`, `client_id`, `extra_status`) VALUES
(1, 'Background remove', 'Remove background of 200 images', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident.', '', '80', '0000-00-00', '12-05-2017', 'onapproval', 2, 'all'),
(2, 'Background remove', 'Remove background of 200 images', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident.', '', '80', '0000-00-00', '12-05-2017', 'completed', 2, 'completed'),
(3, 'Background remove', 'Remove background of 300 images', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident.', '', '80', '0000-00-00', '12-05-2017', 'rejected', 2, ''),
(4, 'Client', 'Remove background of 200 images', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident.', '', '80', '0000-00-00', '12-05-2017', 'rejected', 4, ''),
(5, 'Background remove', 'Remove background of 200 images', 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using \'Content here, content here\', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident.', '', '80', '0000-00-00', '12-05-2017', 'onapproval', 5, ''),
(6, 'Image Resize', 'Image resize korte hobe (100)', 'The ucfirst() function converts the first character of a string to uppercase. Related functions: lcfirst() - converts the first character of a string to lowercase. ucwords() - converts the first character of each word in a string to uppercase.', '19-21.jpg', '55', '0000-00-00', '07-06-2017', 'onapproval', 2, ''),
(11, 'Background Remove', 'sample11', 'sample descriptions', '2.jpg', '33', '0000-00-00', '05-07-2017', 'completed', 2, 'completed'),
(12, 'Background Remove', '44', 'dd', '13.jpg', '44', '0000-00-00', '04-07-2017', 'onapproval', 2, ''),
(13, 'Background Remove', 'dadad', 'gnfhtdg', 'a.jpg', '345', '0000-00-00', 'Category 1', 'onrevision', 2, 'onrevision'),
(14, 'Background Remove', 'good job', 'this is good', '1q.jpg', '40', '13-07-2017', 'Category 3', 'ongoing', 2, 'onapproval'),
(15, 'Background Remove', 'New job', 'This is the ultimate test before submitting the project', '170411_Benjamin_Banks.pdf', '34', '02-08-2017', 'Less than 24hours', 'pending', 2, ''),
(16, 'Background Remove', 'New job2', 'Test running', '127.jpg', '443', '02-08-2017', '1-3 weeks', 'pending', 2, ''),
(17, 'Background Remove', 'New job3', 'Test is still running', '128.jpg', '343', '02-08-2017', 'Less than 24hours', 'pending', 2, 'pending'),
(18, 'Background Remove', 'This is the last', 'This is the last', '23.jpg', '4545', '02-08-2017', 'Less than 24hours', 'pending', 2, ''),
(19, 'Image Resize', 'Sample 2017', 'casca', 'caxz.png', '34', '13-08-2017', 'Less than one week', 'pending', 2, 'pending');
-- --------------------------------------------------------
--
-- Table structure for table `feedback`
--
CREATE TABLE `feedback` (
`id` int(10) NOT NULL,
`star` int(10) NOT NULL,
`comment` varchar(100) NOT NULL,
`job_id` int(10) NOT NULL,
`client_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `feedback`
--
INSERT INTO `feedback` (`id`, `star`, `comment`, `job_id`, `client_id`) VALUES
(1, 5, 'Wow.. amazing', 2, 2),
(7, 4, 'four stars', 11, 2);
-- --------------------------------------------------------
--
-- Table structure for table `fund`
--
CREATE TABLE `fund` (
`id` int(10) NOT NULL,
`client_id` int(10) NOT NULL,
`permission` varchar(20) NOT NULL,
`amount` int(20) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `job_status`
--
CREATE TABLE `job_status` (
`id` int(10) NOT NULL,
`screenshot` varchar(50) NOT NULL,
`comment` varchar(200) NOT NULL,
`job_id` int(10) NOT NULL,
`revision_number` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `job_status`
--
INSERT INTO `job_status` (`id`, `screenshot`, `comment`, `job_id`, `revision_number`) VALUES
(2, '110.jpg', 'yufyrdtrd', 11, 0),
(3, '114.jpg', 'dadada', 11, 0),
(4, '211.jpg', 'efefsv', 11, 0),
(5, 'screenshot.jpg', 'dododod', 11, 0),
(6, 'screenshot1.jpg', 'some info', 13, 0),
(7, 'screenshot2.jpg', 'Onak kotha', 13, 0),
(39, 'screenshot32.jpg', 'dilam', 13, 2),
(40, 'screenshot36.jpg', 'ddededeedpop', 14, 0),
(41, 'screenshot37.jpg', 'popopop', 13, 2),
(42, 'screenshot.png', 'aaaa', 14, 0);
-- --------------------------------------------------------
--
-- Table structure for table `revision`
--
CREATE TABLE `revision` (
`id` int(10) NOT NULL,
`message` varchar(200) NOT NULL,
`attachment` varchar(100) NOT NULL,
`status` varchar(10) NOT NULL,
`job_id` varchar(10) NOT NULL,
`client_id` varchar(10) NOT NULL,
`posted` varchar(10) NOT NULL,
`revision_limit` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `revision`
--
INSERT INTO `revision` (`id`, `message`, `attachment`, `status`, `job_id`, `client_id`, `posted`, `revision_limit`) VALUES
(1, 'dadada', '113.jpg', 'new', '2', '2', '', 1),
(2, 'dadada', '113.jpg', 'new', '2', '2', '', 2),
(3, 'dead', 'aaq.jpg', 'new', '11', '2', '20-07-2017', 1),
(4, 'dsds', '4Cm6mWH.jpg', 'new', '2', '2', '20-07-2017', 3),
(5, 'ddd', '17309300_759013040914641_4710099656642834989_n.jpg', 'new', '11', '2', '24-07-2017', 2),
(6, 'sestsy', '2_(1)1.jpg', 'new', '11', '2', '31-07-2017', 3),
(7, 'qerwrw', '120.jpg', 'new', '13', '2', '31-07-2017', 1),
(8, 'agsrh', '19-21_(2).jpg', 'new', '13', '2', '31-07-2017', 2);
-- --------------------------------------------------------
--
-- Table structure for table `service_types`
--
CREATE TABLE `service_types` (
`id` int(10) NOT NULL,
`service_name` varchar(100) CHARACTER SET utf8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `service_types`
--
INSERT INTO `service_types` (`id`, `service_name`) VALUES
(1, 'Background Remove'),
(2, 'Image Resize'),
(3, 'Manipulation ');
-- --------------------------------------------------------
--
-- Table structure for table `ticket`
--
CREATE TABLE `ticket` (
`id` int(10) NOT NULL,
`category` varchar(50) NOT NULL,
`description` varchar(500) NOT NULL,
`status` varchar(10) NOT NULL,
`client_id` int(10) NOT NULL,
`subject` varchar(50) NOT NULL,
`posted` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `ticket`
--
INSERT INTO `ticket` (`id`, `category`, `description`, `status`, `client_id`, `subject`, `posted`) VALUES
(1, 'Payment', 'Taka nai', 'all', 2, 'Serious issue', ''),
(3, 'Technical', 'sdgdhdtjht', 'new', 2, 'sfshd', '01-08-2017'),
(4, 'Payment', 'nakljoiahfa', 'new', 2, 'xsdasda', '01-08-2017'),
(5, 'Others', 'afsgwsr', 'all', 2, 'dfsgsdh', '01-08-2017');
-- --------------------------------------------------------
--
-- Table structure for table `user_section`
--
CREATE TABLE `user_section` (
`user_id` int(10) NOT NULL,
`user_name` varchar(50) NOT NULL,
`user_pass` varchar(20) NOT NULL,
`user_type` varchar(20) NOT NULL,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`phone` varchar(20) NOT NULL,
`country` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_section`
--
INSERT INTO `user_section` (`user_id`, `user_name`, `user_pass`, `user_type`, `first_name`, `last_name`, `email`, `phone`, `country`) VALUES
(1, 'admin', 'admin', 'admin', 'MD', 'Nayem', 'azizmahmud2014@gmail.com', '01776554571', ''),
(2, 'client', '12345', 'client', 'MD', 'Nayem', 'azizmahmud2013@gmail.com', '01776554571', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `all_req`
--
ALTER TABLE `all_req`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `fund`
--
ALTER TABLE `fund`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `job_status`
--
ALTER TABLE `job_status`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `revision`
--
ALTER TABLE `revision`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `service_types`
--
ALTER TABLE `service_types`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `ticket`
--
ALTER TABLE `ticket`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_section`
--
ALTER TABLE `user_section`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `all_req`
--
ALTER TABLE `all_req`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `feedback`
--
ALTER TABLE `feedback`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `fund`
--
ALTER TABLE `fund`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `job_status`
--
ALTER TABLE `job_status`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;
--
-- AUTO_INCREMENT for table `revision`
--
ALTER TABLE `revision`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `service_types`
--
ALTER TABLE `service_types`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `ticket`
--
ALTER TABLE `ticket`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `user_section`
--
ALTER TABLE `user_section`
MODIFY `user_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
e11660c5ca4a3df080f082b2a418ada7104f373f | SQL | mistakenot/geonames | /schema.sql | UTF-8 | 2,312 | 3.671875 | 4 | [] | no_license | create schema if not exists geo;
CREATE EXTENSION cube;
CREATE EXTENSION earthdistance;
create table if not exists geo.geoname (
geonameid int primary key,
name varchar(200),
asciiname varchar(200),
alternatenames varchar(10000),
latitude float,
longitude float,
fclass char(1),
fcode varchar(10),
country varchar(2),
cc2 varchar(600),
admin1 varchar(20),
admin2 varchar(80),
admin3 varchar(20),
admin4 varchar(20),
population bigint,
elevation int,
gtopo30 int,
timezone varchar(40),
moddate date
);
create index if not exists geoname_name_lower_idx on geo.geoname(lower(name) text_pattern_ops);
create index if not exists geoname_country_ids on geo.geoname(country);
create table if not exists geo.alternatename (
alternatenameId int primary key,
geonameid int references geo.geoname(geonameId),
isoLanguage varchar(7),
alternateName varchar(200),
isPreferredName boolean,
isShortName boolean,
isColloquial boolean,
isHistoric boolean
);
create index if not exists alternateName_alternateName_lower_idx on geo.alternateName(lower(alternateName) text_pattern_ops);
create table if not exists geo.countryinfo (
iso_alpha2 char(2) unique,
iso_alpha3 char(3) unique,
iso_numeric integer unique,
fips_code varchar(3),
name varchar(200),
capital varchar(200),
areainsqkm double precision,
population integer,
continent varchar(2),
tld varchar(10),
currencycode varchar(3),
currencyname varchar(20),
phone varchar(20),
postalcode varchar(100),
postalcoderegex varchar(200),
languages varchar(200),
geonameId int primary key references geo.geoname(geonameid),
neighbors varchar(50),
equivfipscode varchar(3)
);
create table if not exists geo.heirarchy (
parentId int,
childId int,
type varchar(100)
);
-- This is used instead of a unique / foreign key as some
-- ids are missing.
create index if not exists heirarchy_parent_idx on geo.heirarchy(parentId);
create index if not exists heirarchy_child_idx on geo.heirarchy(childId);
create table if not exists geo.admincodes(
code varchar(100) unique,
name varchar(200),
nameAscii varchar(200),
geonameid int references geo.geoname(geonameid)
); | true |
74098ad8ecaee732436173dc7b0507b274171cc6 | SQL | dacalviz/Biblioteca | /base de datos llena.sql | UTF-8 | 22,706 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-06-2019 a las 07:39:12
-- Versión del servidor: 10.1.40-MariaDB
-- Versión de PHP: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `other`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `autor`
--
CREATE TABLE `autor` (
`AutorID` int(11) NOT NULL,
`Apellido` varchar(64) DEFAULT NULL,
`Nombre` varchar(64) DEFAULT NULL,
`Telefono` varchar(64) DEFAULT NULL,
`NacionalidadID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `autor`
--
INSERT INTO `autor` (`AutorID`, `Apellido`, `Nombre`, `Telefono`, `NacionalidadID`) VALUES
(1, ' De Cervantes ', ' Miguel ', ' 978564321 ', 348),
(2, ' Faulkner ', ' William ', ' 964688411 ', 143),
(3, ' SaintExupery ', ' Antoine ', ' 984245222 ', 103),
(4, ' John ', ' Hersey ', ' 934222422 ', 121),
(5, ' Kissinger ', ' Henry ', ' 923231312 ', 173),
(6, ' Kelley ', ' Kitty ', ' 942423265 ', 128),
(7, ' Kennedy ', ' Paul ', ' 987473472 ', 111),
(8, ' Pérez Galdós ', ' JUAN ', ' 972782378 ', 146),
(9, ' Clarke ', ' Arthur C. ', ' 937484872 ', 124),
(10, ' Bujold ', ' L. McMaster ', ' 982783272 ', 173),
(11, ' Preston ', ' Douglas ', ' 982728723 ', 117),
(12, ' Guedj ', ' Denis ', ' 927847842 ', 302),
(13, ' Abbott Abbott ', ' Edwin ', ' 949832983 ', 107);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `carrera`
--
CREATE TABLE `carrera` (
`CarreraID` int(11) NOT NULL,
`DescripcionCarrera` varchar(64) DEFAULT NULL,
`FechaCreacion` date DEFAULT NULL,
`FechaModificacion` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `carrera`
--
INSERT INTO `carrera` (`CarreraID`, `DescripcionCarrera`, `FechaCreacion`, `FechaModificacion`) VALUES
(1, ' Ingeniería Aeronáutica ', '0000-00-00', NULL),
(2, ' Ingeniería Automotriz ', '0000-00-00', NULL),
(3, ' Ingeniería Biomédica ', '0000-00-00', NULL),
(4, ' Ingeniería Civil ', '0000-00-00', NULL),
(5, ' Ingeniería de Diseño Gráfico ', '0000-00-00', NULL),
(6, ' Ingeniería de Redes y Comunicaciones ', '0000-00-00', NULL),
(7, ' Ingeniería en Seguridad Laboral y Ambiental ', '0000-00-00', NULL),
(8, ' Ingeniería de Seguridad y Auditoría Informática ', '0000-00-00', NULL),
(9, ' Ingeniería de Sistemas e Informática ', '0000-00-00', NULL),
(10, ' Ingeniería de Software ', '0000-00-00', NULL),
(11, ' Ingeniería de Telecomunicaciones ', '0000-00-00', NULL),
(12, ' Ingeniería Electrónica ', '0000-00-00', NULL),
(13, ' Ingeniería Empresarial ', '0000-00-00', NULL),
(14, ' Ingeniería Electromecánica ', '0000-00-00', NULL),
(15, ' Ingeniería Eléctrica y de Potencia ', '0000-00-00', NULL),
(16, ' Ingeniería Industrial ', '0000-00-00', NULL),
(17, ' Ingeniería Marítima ', '0000-00-00', NULL),
(18, ' Ingeniería Mecánica ', '0000-00-00', NULL),
(19, ' Ingeniería Mecatrónica ', '0000-00-00', NULL),
(20, ' Ingeniería Textil y de Confecciones ', '0000-00-00', NULL),
(21, ' Administración de Empresas ', '0000-00-00', NULL),
(22, ' Administración de Negocios Internacionales ', '0000-00-00', NULL),
(23, ' Administración y Marketing ', '0000-00-00', NULL),
(24, ' Administración Hotelera y de Turismo ', '0000-00-00', NULL),
(25, ' Administración de Banca y Finanzas ', '0000-00-00', NULL),
(26, ' Contabilidad ', '0000-00-00', NULL),
(27, ' Derecho ', '0000-00-00', NULL),
(28, ' Ciencias de la Comunicación ', '0000-00-00', NULL),
(29, ' Diseño Digital Publicitario ', '0000-00-00', NULL),
(30, ' Comunicación y Publicidad ', '0000-00-00', NULL),
(31, ' Psicología ', '0000-00-00', NULL),
(32, ' Enfermería ', '0000-00-00', NULL),
(33, ' Obstetricia ', '0000-00-00', NULL),
(34, ' Nutrición y Dietética ', '0000-00-00', NULL),
(35, ' Terapia Física ', '0000-00-00', NULL),
(36, ' Arquitectura ', '0000-00-00', NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categoriamaterial`
--
CREATE TABLE `categoriamaterial` (
`CategoriaID` int(11) NOT NULL,
`DescripcionCategoriaMaterial` varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `categoriamaterial`
--
INSERT INTO `categoriamaterial` (`CategoriaID`, `DescripcionCategoriaMaterial`) VALUES
(1, 'CIENCIAS'),
(2, 'MATEMATICAS'),
(3, 'HISTORIA'),
(4, 'COMUNICACION'),
(5, 'BASE DE DATOS'),
(6, 'PROGRAMACION'),
(7, 'SEGURIDAD INFORMATICA'),
(8, 'HTML'),
(9, 'JAVA'),
(10, 'INTELIGENCIA ARTIFICIAL'),
(11, 'SISTEMAS OPERATIVOS'),
(12, 'ARQUITECTURAS'),
(13, 'SOCIAL');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `editorial`
--
CREATE TABLE `editorial` (
`EditorialID` int(11) NOT NULL,
`DescripcionEditorial` varchar(64) DEFAULT NULL,
`Telefono` varchar(64) DEFAULT NULL,
`Direccion` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `editorial`
--
INSERT INTO `editorial` (`EditorialID`, `DescripcionEditorial`, `Telefono`, `Direccion`) VALUES
(1, ' CAJA NEGRA ', ' (511) 715 8897 / 961 100 307 ', ' Jr. Chongoyape 264, Maranga - San Miguel '),
(2, ' DIDÁCTICA ', ' (511) 221 5988 / 441 0473 ', ' Jr. Azángaro 776 '),
(3, ' PEISA ', ' (511) 273 1547 ', ' Av. Las Camelias 511, Of. 601 - San Isidro '),
(4, ' ESTRUENDOMUDO ', ' (511) 955 923 719 ', ' Psje. Perez Esquivel 385, Urb. Reducto – Surquillo '),
(5, ' NSTITUTO DE ESTUDIOS PERUANOS ', ' (511) 332 6194 Anexo 1201 ', ' Av. Horacio Urteaga 694 - Jesús María '),
(6, ' LA CASA DEL LIBRO VIEJO ', ' (511) 421 5922 ', ' Calle Percy Gibson 363 - Lince '),
(7, ' EDITORIAL MACRO ', ' (511) 748 0566 ', ' Av. Paseo de la Republica 5613 - Miraflores '),
(8, ' PALESTRA EDITORES ', ' (511) 637 8902 / 637 8903 ', ' Plaza de la Bandera 125 – Pueblo Libre '),
(9, ' PONTIFICIA UNIVERSIDAD CATÓLICA DEL PERÚ ', ' (511) 626 2660 / 980 123 376 ', ' Av. Universitaria 1801 San Miguel '),
(10, ' UNIVERSIDAD DE LIMA ', ' (511) 437 6767 Anexos 31225, 31224 ', ' Av. Javier Prado Este cdra. 4600 '),
(11, ' UNIVERSIDAD ALAS PERUANAS ', ' (511) 472 5595 ', ' Av. Paseo de la República 1773 - La Victoria '),
(12, ' UNIVERSIDAD CÉSAR VALLEJO ', ' (511) 202 4342 Anexo 2132 ', ' Av. Alfredo Mendiola 6232 - Los Olivos '),
(13, ' UNIVERSIDAD NACIONAL MAYOR DE SAN MARCOS ', ' (511) 6197000 Anexo 7529-7530-7531 ', ' Calle Germán Amézaga 375 '),
(14, ' UNIVERSIDAD RICARDO PALMA ', ' Av. Benavides 5440 - Surco ', ' Av. Benavides 5440 - Surco '),
(15, ' YACHAYPUCLLAYPACHA ', ' (511) 225 40542 / 999 173 235 ', ' Alameda Las Palmas 155, La Encantada ');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ejemplar`
--
CREATE TABLE `ejemplar` (
`EjemplarID` int(11) NOT NULL,
`DetalleEjemplar` varchar(264) DEFAULT NULL,
`EstadoPrestamo` tinyint(1) DEFAULT NULL,
`MaterialID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `ejemplar`
--
INSERT INTO `ejemplar` (`EjemplarID`, `DetalleEjemplar`, `EstadoPrestamo`, `MaterialID`) VALUES
(1, 'NUEVO', 0, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `facultad`
--
CREATE TABLE `facultad` (
`FacultadID` int(11) NOT NULL,
`DescripcionFacultad` varchar(64) DEFAULT NULL,
`FechaCreacion` date DEFAULT NULL,
`FechaModificacion` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `facultad`
--
INSERT INTO `facultad` (`FacultadID`, `DescripcionFacultad`, `FechaCreacion`, `FechaModificacion`) VALUES
(1, ' Facultad de Ciencias e Ingeniería ', '0000-00-00', NULL),
(2, ' Facultad de Gestión y Negocios ', '0000-00-00', NULL),
(3, ' Facultad de Humanidades ', '0000-00-00', NULL),
(4, ' Facultad de Ciencias de la Salud ', '0000-00-00', NULL),
(5, ' Facultad de Arquitectura ', '0000-00-00', NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `material`
--
CREATE TABLE `material` (
`MaterialID` int(11) NOT NULL,
`DescripcionMaterial` varchar(64) DEFAULT NULL,
`EditorialID` int(11) DEFAULT NULL,
`Edicion` varchar(64) DEFAULT NULL,
`CodigoISBN` varchar(128) DEFAULT NULL,
`Volumen` int(11) DEFAULT NULL,
`CantPaginas` int(11) DEFAULT NULL,
`StockMin` int(11) DEFAULT NULL,
`StockMax` int(11) DEFAULT NULL,
`StockActual` int(11) DEFAULT NULL,
`FechaPublicacion` date DEFAULT NULL,
`FechaCreacion` date DEFAULT NULL,
`FechaModificacion` date DEFAULT NULL,
`UbicacionID` int(11) DEFAULT NULL,
`TipoMaterialID` int(11) DEFAULT NULL,
`CategoriaID` int(11) DEFAULT NULL,
`AutorID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `material`
--
INSERT INTO `material` (`MaterialID`, `DescripcionMaterial`, `EditorialID`, `Edicion`, `CodigoISBN`, `Volumen`, `CantPaginas`, `StockMin`, `StockMax`, `StockActual`, `FechaPublicacion`, `FechaCreacion`, `FechaModificacion`, `UbicacionID`, `TipoMaterialID`, `CategoriaID`, `AutorID`) VALUES
(1, 'BASE DE DATOS', 9, '01', '23341', 2, 456, 2, 5, 4, '0000-00-00', '0000-00-00', NULL, 4, 1, 5, 5);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `nacionalidad`
--
CREATE TABLE `nacionalidad` (
`NacionalidadID` int(11) NOT NULL,
`DescripcionNacionalidad` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `nacionalidad`
--
INSERT INTO `nacionalidad` (`NacionalidadID`, `DescripcionNacionalidad`) VALUES
(101, ' ALBANIA '),
(102, ' AUSTRIA '),
(103, ' BELGICA '),
(104, ' BULGARIA '),
(106, ' CHIPRE '),
(107, ' DINAMARCA '),
(108, ' ESPAÑA '),
(109, ' FINLANDIA '),
(110, ' FRANCIA '),
(111, ' GRECIA '),
(112, ' HUNGRIA '),
(113, ' IRLANDA '),
(114, ' ISLANDIA '),
(115, ' ITALIA '),
(116, ' LIECHTENSTEIN '),
(117, ' LUXEMBURGO '),
(118, ' MALTA '),
(119, ' MONACO '),
(120, ' NORUEGA '),
(121, ' PAISES BAJOS '),
(122, ' POLONIA '),
(123, ' PORTUGAL '),
(124, ' ANDORRA '),
(125, ' REINO UNIDO '),
(126, ' ALEMANIA '),
(128, ' RUMANIA '),
(129, ' SAN MARINO '),
(130, ' SANTA SEDE '),
(131, ' SUECIA '),
(132, ' SUIZA '),
(135, ' UCRANIA '),
(136, ' LETONIA '),
(137, ' MOLDAVIA '),
(138, ' BELARUS '),
(139, ' GEORGIA '),
(141, ' ESTONIA '),
(142, ' LITUANIA '),
(143, ' REPUBLICA CHECA '),
(144, ' REPUBLICA ESLOVACA '),
(145, ' BOSNIA Y HERZEGOVINA '),
(146, ' CROACIA '),
(147, ' ESLOVENIA '),
(148, ' ARMENIA '),
(154, ' RUSIA '),
(156, ' MACEDONIA '),
(157, ' SERBIA '),
(173, ' ISLA DE MAN '),
(174, ' GIBRALTAR '),
(175, ' ISLAS DEL CANAL '),
(176, ' JERSEY '),
(177, ' ISLAS ALAND '),
(198, ' OTROS PAISES O TERRITORIOS DE LA UNION EUROPEA '),
(199, ' OTROS PAISES O TERRITORIOS DEL RESTO DE EUROPA '),
(201, ' BURKINA FASO '),
(202, ' ANGOLA '),
(203, ' ARGELIA '),
(204, ' BENIN '),
(205, ' BOTSWANA '),
(206, ' BURUNDI '),
(207, ' CABO VERDE '),
(208, ' CAMERUN '),
(209, ' COMORES '),
(210, ' CONGO '),
(211, ' COSTA DE MARFIL '),
(212, ' DJIBOUTI '),
(213, ' EGIPTO '),
(214, ' ETIOPIA '),
(215, ' GABON '),
(216, ' GAMBIA '),
(217, ' GHANA '),
(218, ' GUINEA '),
(219, ' GUINEA-BISSAU '),
(220, ' GUINEA ECUATORIAL '),
(221, ' KENIA '),
(222, ' LESOTHO '),
(223, ' LIBERIA '),
(224, ' LIBIA '),
(225, ' MADAGASCAR '),
(226, ' MALAWI '),
(227, ' MALI '),
(228, ' MARRUECOS '),
(229, ' MAURICIO '),
(230, ' MAURITANIA '),
(231, ' MOZAMBIQUE '),
(232, ' NAMIBIA '),
(233, ' NIGER '),
(234, ' NIGERIA '),
(235, ' REPUBLICA CENTROAFRICANA '),
(236, ' SUDAFRICA '),
(237, ' RUANDA '),
(238, ' SANTO TOME Y PRINCIPE '),
(239, ' SENEGAL '),
(240, ' SEYCHELLES '),
(241, ' SIERRA LEONA '),
(242, ' SOMALIA '),
(243, ' SUDAN '),
(244, ' SWAZILANDIA '),
(245, ' TANZANIA '),
(246, ' CHAD '),
(247, ' TOGO '),
(248, ' TUNEZ '),
(249, ' UGANDA '),
(250, ' REP.DEMOCRATICA DEL CONGO '),
(251, ' ZAMBIA '),
(252, ' ZIMBABWE '),
(253, ' ERITREA '),
(260, ' SANTA HELENA '),
(261, ' REUNION '),
(262, ' MAYOTTE '),
(263, ' SAHARA OCCIDENTAL '),
(299, ' OTROS PAISES O TERRITORIOS DE AFRICA '),
(301, ' CANADA '),
(302, ' ESTADOS UNIDOS DE AMERICA '),
(303, ' MEXICO '),
(310, ' ANTIGUA Y BARBUDA '),
(311, ' BAHAMAS '),
(312, ' BARBADOS '),
(313, ' BELICE '),
(314, ' COSTA RICA '),
(315, ' CUBA '),
(316, ' DOMINICA '),
(317, ' EL SALVADOR '),
(318, ' GRANADA '),
(319, ' GUATEMALA '),
(320, ' HAITI '),
(321, ' HONDURAS '),
(322, ' JAMAICA '),
(323, ' NICARAGUA '),
(324, ' PANAMA '),
(325, ' SAN VICENTE Y LAS GRANADINAS '),
(326, ' REPUBLICA DOMINICANA '),
(327, ' TRINIDAD Y TOBAGO '),
(328, ' SANTA LUCIA '),
(329, ' SAN CRISTOBAL Y NIEVES '),
(340, ' ARGENTINA '),
(341, ' BOLIVIA '),
(342, ' BRASIL '),
(343, ' COLOMBIA '),
(344, ' CHILE '),
(345, ' ECUADOR '),
(346, ' GUYANA '),
(347, ' PARAGUAY '),
(348, ' PERU '),
(349, ' SURINAM '),
(350, ' URUGUAY '),
(351, ' VENEZUELA '),
(370, ' SAN PEDRO Y MIQUELON '),
(371, ' GROENLANDIA '),
(380, ' ISLAS CAIMÁN '),
(381, ' ISLAS TURCAS Y CAICOS '),
(382, ' ISLAS VÍRGENES DE LOS ESTADOS UNIDOS '),
(383, ' GUADALUPE '),
(384, ' ANTILLAS HOLANDESAS '),
(385, ' SAN MARTIN (PARTE FRANCESA) '),
(386, ' ARUBA '),
(387, ' MONTSERRAT '),
(388, ' ANGUILLA '),
(389, ' SAN BARTOLOME '),
(390, ' MARTINICA '),
(391, ' PUERTO RICO '),
(392, ' BERMUDAS '),
(393, ' ISLAS VIRGENES BRITANICAS '),
(394, ' GUAYANA FRANCESA '),
(395, ' ISLAS MALVINAS '),
(396, ' OTROS PAISES O TERRITORIOS DE AMERICA DEL NORTE '),
(398, ' OTROS PAISES O TERRITORIOS DEL CARIBE Y AMERICA CENTRAL '),
(399, ' OTROS PAISES O TERRITORIOS DE SUDAMERICA '),
(401, ' AFGANISTAN '),
(402, ' ARABIA SAUDI '),
(403, ' BAHREIN '),
(404, ' BANGLADESH '),
(405, ' MYANMAR '),
(407, ' CHINA '),
(408, ' EMIRATOS ARABES UNIDOS '),
(409, ' FILIPINAS '),
(410, ' INDIA '),
(411, ' INDONESIA '),
(412, ' IRAQ '),
(413, ' IRAN '),
(414, ' ISRAEL '),
(415, ' JAPON '),
(416, ' JORDANIA '),
(417, ' CAMBOYA '),
(418, ' KUWAIT '),
(419, ' LAOS '),
(420, ' LIBANO '),
(421, ' MALASIA '),
(422, ' MALDIVAS '),
(423, ' MONGOLIA '),
(424, ' NEPAL '),
(425, ' OMAN '),
(426, ' PAKISTAN '),
(427, ' QATAR '),
(430, ' COREA '),
(431, ' COREA DEL NORTE '),
(432, ' SINGAPUR '),
(433, ' SIRIA '),
(434, ' SRI LANKA '),
(435, ' TAILANDIA '),
(436, ' TURQUIA '),
(437, ' VIETNAM '),
(439, ' BRUNEI '),
(440, ' ISLAS MARSHALL '),
(441, ' YEMEN '),
(442, ' AZERBAIYAN '),
(443, ' KAZAJSTAN '),
(444, ' KIRGUISTAN '),
(445, ' TADYIKISTAN '),
(446, ' TURKMENISTAN '),
(447, ' UZBEKISTAN '),
(448, ' ISLAS MARIANAS DEL NORTE '),
(449, ' PALESTINA '),
(450, ' HONG KONG '),
(453, ' BHUTÁN '),
(454, ' GUAM '),
(455, ' MACAO '),
(499, ' OTROS PAISES O TERRITORIOS DE ASIA '),
(501, ' AUSTRALIA '),
(502, ' FIJI '),
(504, ' NUEVA ZELANDA '),
(505, ' PAPUA NUEVA GUINEA '),
(506, ' ISLAS SALOMON '),
(507, ' SAMOA '),
(508, ' TONGA '),
(509, ' VANUATU '),
(511, ' MICRONESIA '),
(512, ' TUVALU '),
(513, ' ISLAS COOK '),
(515, ' NAURU '),
(516, ' PALAOS '),
(517, ' TIMOR ORIENTAL '),
(520, ' POLINESIA FRANCESA '),
(521, ' ISLA NORFOLK '),
(522, ' KIRIBATI '),
(523, ' NIUE '),
(524, ' ISLAS PITCAIRN '),
(525, ' TOKELAU '),
(526, ' NUEVA CALEDONIA '),
(527, ' WALLIS Y FORTUNA '),
(528, ' SAMOA AMERICANA ');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `solicitudcabesera`
--
CREATE TABLE `solicitudcabesera` (
`SolicitudID` int(11) NOT NULL,
`UsuarioID` int(11) DEFAULT NULL,
`FechaPrestamo` date DEFAULT NULL,
`FechaEntragas` date DEFAULT NULL,
`FechaDevolucion` date DEFAULT NULL,
`Estado` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `solicitudcabesera`
--
INSERT INTO `solicitudcabesera` (`SolicitudID`, `UsuarioID`, `FechaPrestamo`, `FechaEntragas`, `FechaDevolucion`, `Estado`) VALUES
(1, 1, '0000-00-00', '0000-00-00', '0000-00-00', 0);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `solicituddetalle`
--
CREATE TABLE `solicituddetalle` (
`EjemplarID` int(11) DEFAULT NULL,
`SolicitudID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipomaterial`
--
CREATE TABLE `tipomaterial` (
`TipoMaterialID` int(11) NOT NULL,
`DescripcionMaterial` varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `tipomaterial`
--
INSERT INTO `tipomaterial` (`TipoMaterialID`, `DescripcionMaterial`) VALUES
(1, 'LIBRO'),
(2, 'REVISTAS Y PERIODICOS'),
(3, 'TESIS'),
(4, 'MONOGRAFIA'),
(5, 'ARTICULOS'),
(6, 'DICCIONARIO'),
(7, 'COMICS'),
(8, 'MANUSCRITOS');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ubicacion`
--
CREATE TABLE `ubicacion` (
`UbicacionID` int(11) NOT NULL,
`nivel` varchar(64) DEFAULT NULL,
`estante` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `ubicacion`
--
INSERT INTO `ubicacion` (`UbicacionID`, `nivel`, `estante`) VALUES
(1, '1', '1'),
(2, '1', '2'),
(3, '1', '3'),
(4, '1', '4'),
(5, '1', '5'),
(6, '2', '1'),
(7, '2', '2'),
(8, '2', '3'),
(9, '2', '4'),
(10, '2', '5'),
(11, '3', '1'),
(12, '3', '2'),
(13, '3', '3'),
(14, '3', '4'),
(15, '3', '5'),
(16, '4', '1'),
(17, '4', '2'),
(18, '4', '3'),
(19, '4', '4'),
(20, '4', '5'),
(21, '5', '1'),
(22, '5', '2'),
(23, '5', '3'),
(24, '5', '4'),
(25, '5', '5');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuario`
--
CREATE TABLE `usuario` (
`UsuarioID` int(11) NOT NULL,
`Login` varchar(64) DEFAULT NULL,
`Password` varchar(64) DEFAULT NULL,
`Nombre` varchar(64) DEFAULT NULL,
`Apellido` varchar(64) DEFAULT NULL,
`Telefono` varchar(64) DEFAULT NULL,
`DocumentoIdentidad` varchar(16) DEFAULT NULL,
`NacionalidadID` int(11) DEFAULT NULL,
`Direccion` varchar(64) DEFAULT NULL,
`FechaNacimiento` date DEFAULT NULL,
`FechaCreacion` date DEFAULT NULL,
`FacultadID` int(11) DEFAULT NULL,
`CarreraID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `usuario`
--
INSERT INTO `usuario` (`UsuarioID`, `Login`, `Password`, `Nombre`, `Apellido`, `Telefono`, `DocumentoIdentidad`, `NacionalidadID`, `Direccion`, `FechaNacimiento`, `FechaCreacion`, `FacultadID`, `CarreraID`) VALUES
(1, 'DACALVIZ', '12345', 'DAVID', 'ALVIZ CUADROS', '987654321', '76543218', 348, 'SANTA CRUZ S-10 SOCABAYA', '0000-00-00', '0000-00-00', 1, 9),
(2, 'ALSARO', '12345', 'ALONSO', 'SANTA MARIA', '987654321', '73232218', 348, 'CHARACATO', '0000-00-00', '0000-00-00', 1, 9),
(3, 'ELMER_ADOLFO', '12345', 'ELMER', 'MAMANI', '997454321', '73243218', 348, 'VALLECITO', '0000-00-00', '0000-00-00', 1, 9);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `autor`
--
ALTER TABLE `autor`
ADD PRIMARY KEY (`AutorID`),
ADD KEY `NacionalidadID` (`NacionalidadID`);
--
-- Indices de la tabla `carrera`
--
ALTER TABLE `carrera`
ADD PRIMARY KEY (`CarreraID`);
--
-- Indices de la tabla `categoriamaterial`
--
ALTER TABLE `categoriamaterial`
ADD PRIMARY KEY (`CategoriaID`);
--
-- Indices de la tabla `editorial`
--
ALTER TABLE `editorial`
ADD PRIMARY KEY (`EditorialID`);
--
-- Indices de la tabla `ejemplar`
--
ALTER TABLE `ejemplar`
ADD PRIMARY KEY (`EjemplarID`),
ADD KEY `MaterialID` (`MaterialID`);
--
-- Indices de la tabla `facultad`
--
ALTER TABLE `facultad`
ADD PRIMARY KEY (`FacultadID`);
--
-- Indices de la tabla `material`
--
ALTER TABLE `material`
ADD PRIMARY KEY (`MaterialID`),
ADD KEY `EditorialID` (`EditorialID`),
ADD KEY `UbicacionID` (`UbicacionID`),
ADD KEY `TipoMaterialID` (`TipoMaterialID`),
ADD KEY `CategoriaID` (`CategoriaID`),
ADD KEY `AutorID` (`AutorID`);
--
-- Indices de la tabla `nacionalidad`
--
ALTER TABLE `nacionalidad`
ADD PRIMARY KEY (`NacionalidadID`);
--
-- Indices de la tabla `solicitudcabesera`
--
ALTER TABLE `solicitudcabesera`
ADD PRIMARY KEY (`SolicitudID`),
ADD KEY `UsuarioID` (`UsuarioID`);
--
-- Indices de la tabla `solicituddetalle`
--
ALTER TABLE `solicituddetalle`
ADD KEY `EjemplarID` (`EjemplarID`),
ADD KEY `SolicitudID` (`SolicitudID`);
--
-- Indices de la tabla `tipomaterial`
--
ALTER TABLE `tipomaterial`
ADD PRIMARY KEY (`TipoMaterialID`);
--
-- Indices de la tabla `ubicacion`
--
ALTER TABLE `ubicacion`
ADD PRIMARY KEY (`UbicacionID`);
--
-- Indices de la tabla `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`UsuarioID`),
ADD KEY `NacionalidadID` (`NacionalidadID`),
ADD KEY `FacultadID` (`FacultadID`),
ADD KEY `CarreraID` (`CarreraID`);
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `autor`
--
ALTER TABLE `autor`
ADD CONSTRAINT `autor_ibfk_1` FOREIGN KEY (`NacionalidadID`) REFERENCES `nacionalidad` (`NacionalidadID`);
--
-- Filtros para la tabla `ejemplar`
--
ALTER TABLE `ejemplar`
ADD CONSTRAINT `ejemplar_ibfk_1` FOREIGN KEY (`MaterialID`) REFERENCES `material` (`MaterialID`);
--
-- Filtros para la tabla `material`
--
ALTER TABLE `material`
ADD CONSTRAINT `material_ibfk_1` FOREIGN KEY (`EditorialID`) REFERENCES `editorial` (`EditorialID`),
ADD CONSTRAINT `material_ibfk_2` FOREIGN KEY (`UbicacionID`) REFERENCES `ubicacion` (`UbicacionID`),
ADD CONSTRAINT `material_ibfk_3` FOREIGN KEY (`TipoMaterialID`) REFERENCES `tipomaterial` (`TipoMaterialID`),
ADD CONSTRAINT `material_ibfk_4` FOREIGN KEY (`CategoriaID`) REFERENCES `categoriamaterial` (`CategoriaID`),
ADD CONSTRAINT `material_ibfk_5` FOREIGN KEY (`AutorID`) REFERENCES `autor` (`AutorID`);
--
-- Filtros para la tabla `solicitudcabesera`
--
ALTER TABLE `solicitudcabesera`
ADD CONSTRAINT `solicitudcabesera_ibfk_1` FOREIGN KEY (`UsuarioID`) REFERENCES `usuario` (`UsuarioID`);
--
-- Filtros para la tabla `solicituddetalle`
--
ALTER TABLE `solicituddetalle`
ADD CONSTRAINT `solicituddetalle_ibfk_1` FOREIGN KEY (`EjemplarID`) REFERENCES `ejemplar` (`EjemplarID`),
ADD CONSTRAINT `solicituddetalle_ibfk_2` FOREIGN KEY (`SolicitudID`) REFERENCES `solicitudcabesera` (`SolicitudID`);
--
-- Filtros para la tabla `usuario`
--
ALTER TABLE `usuario`
ADD CONSTRAINT `usuario_ibfk_1` FOREIGN KEY (`NacionalidadID`) REFERENCES `nacionalidad` (`NacionalidadID`),
ADD CONSTRAINT `usuario_ibfk_2` FOREIGN KEY (`FacultadID`) REFERENCES `facultad` (`FacultadID`),
ADD CONSTRAINT `usuario_ibfk_3` FOREIGN KEY (`CarreraID`) REFERENCES `carrera` (`CarreraID`);
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 */;
| true |
73be167a5072ec2334b779d05b2d81d50f5a1591 | SQL | haohao41285/dti | /database/update/08-2019/update_2019_09_18_create_main_team_type.sql | UTF-8 | 2,229 | 3.0625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 11, 2019 at 06:56 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `datae`
--
-- --------------------------------------------------------
--
-- Table structure for table `main_team_type`
--
CREATE TABLE `main_team_type` (
`id` int(11) NOT NULL,
`team_type_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`team_type_status` tinyint(1) NOT NULL DEFAULT '1',
`team_type_description` text COLLATE utf8_unicode_ci NOT NULL,
`created_by` int(11) DEFAULT NULL,
`updated_by` int(11) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `main_team_type`
--
INSERT INTO `main_team_type` (`id`, `team_type_name`, `team_type_status`, `team_type_description`, `created_by`, `updated_by`, `created_at`, `updated_at`) VALUES
(1, 'Sale', 1, 'test', 1, 1, '2019-09-04 03:25:37', '2019-09-09 02:56:37'),
(2, 'Website', 1, '', 1, 1, '2019-09-04 03:25:37', '2019-09-09 02:40:31'),
(3, 'Sale', 1, 'test', 1, NULL, '2019-09-09 09:55:45', '2019-09-09 09:55:45'),
(4, 'Website', 1, 'test', 1, NULL, '2019-09-09 09:55:58', '2019-09-09 09:55:58');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `main_team_type`
--
ALTER TABLE `main_team_type`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `main_team_type`
--
ALTER TABLE `main_team_type`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
030cc71c20ee1f7833472249001b0c5056039d50 | SQL | leqg/leqg | /sql/event-tasks.sql | UTF-8 | 441 | 2.9375 | 3 | [] | no_license | SELECT `tache_id` AS `id`,
`createur_id` AS `createur`,
`compte_id` AS `user`,
`historique_id` AS `event`,
`tache_description` AS `task`,
`tache_deadline` AS `deadline`,
`tache_creation` AS `time`,
`tache_terminee` AS `ended`
FROM `taches`
WHERE `historique_id` = :event
AND `tache_terminee` = 0
ORDER BY `tache_creation` DESC
| true |
e69a0c92f4bebfa2736eedc01219b9ea8a4ec1d7 | SQL | vlbpdasilva/HackIllinois | /person_table.sql | UTF-8 | 594 | 3.171875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `person_table` (
`person_name` varchar(30) NOT NULL,
`age` varchar(2) NOT NULL,
`zipcode` char(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO person_table VALUES ('Victor', 21, 66044);
INSERT IGNORE INTO person_table VALUES ('Blaine', 28, NULL);
INSERT IGNORE INTO person_table VALUES ('Quinton', 20, NULL);
-- example queries:
-- select * from person_table;
-- select person_name, age from person_table;
-- select person_name, age from person_table order by person_name;
-- select age from person_table where person_name like 'B%'; | true |
8e4676c9bc0d45b6a70fc7a9cfa3955e5159606d | SQL | Patpaz/Project_PBD | /Project.sql | UTF-8 | 2,285 | 3.484375 | 3 | [] | no_license | CREATE DATABASE project;
use project;
CREATE TABLE product (
product_id int not null auto_increment,
name varchar(255),
stock int,
price float,
category enum('SMARTPHONES','HOME','TOYS','FASHION','JEWELRY'),
description text,
created_date datetime,
modified_date datetime,
primary key (product_id)
);
CREATE TABLE client (
client_id int,
name varchar(255),
last_name varchar(255),
email varchar(255),
password varchar(255),
registered_at datetime,
primary key (client_id)
);
CREATE TABLE log_in (
email varchar(255),
password varchar(255)
);
CREATE TABLE cart_items (
client_id int not null,
product_id int not null,
foreign key (client_id) references client(client_id),
foreign key (product_id) references product(product_id)
);
CREATE TABLE contact_us (
name varchar(255) not null,
email varchar(255),
issue text not null
);
------------------------------------------------------------------------
insert into product (product_id, name, stock, price, category, description, created_date, modified_date)
values (1, 'Samsung Galaxy s10', 100, 500, 'SMARTPHONES', 'The Samsung Galaxy S10 has a 6.1-inch display. This display has QHD+ resolution. It also has an ultrasonic in-display fingerprint scanner. Powering the Galaxy S10 is the Samsung Exynos 9820 SoC this powerful SoC is paired with 8GB of RAM and 128GB of storage which makes it very easy for multitasking with this smartphone.', now(), now());
insert into product (name, stock, price, category, description, created_date, modified_date)
values ('Iphone 12 pro', 367, 600, 'SMARTPHONES', 'iPhone 12 Pro comes with a 6.10-inch touchscreen display with a resolution of 1170x2532 pixels at a pixel density of 460 pixels per inch (ppi). iPhone 12 Pro is powered by a hexa-core Apple A14 Bionic processor. The iPhone 12 Pro supports wireless charging.', now(), now());
insert into product (name, stock, price, category, description, created_date, modified_date)
values ('Superman Action Figure', 28, 20, 'TOYS', 'Incredibly detailed 7” scale figures based off the DC Multiverse, designed with Ultra Articulation with up to 22 moving parts for full range of posing and play. Superman is based on his look in the Justice League Movie and comes with flight stand and base', now(), now());
| true |
1150fd41da8505c681099b6a3af9a656a7d444cd | SQL | andresort28/docker-sinatra-postgres | /database/files/create_schema.sql | UTF-8 | 1,700 | 3.390625 | 3 | [
"MIT"
] | permissive | create user userandres with password 'passortiz';
alter role userandres with createdb;
create database db_docker owner userandres;
\connect db_docker
CREATE TABLE brands(
id integer NOT NULL PRIMARY KEY,
brand_name varchar(50) NOT NULL UNIQUE
);
CREATE TABLE devices(
id integer NOT NULL PRIMARY KEY,
device_name varchar(50) NOT NULL UNIQUE,
brand_id integer references brands(id)
);
grant all privileges on table devices to userandres;
grant all privileges on table brands to userandres;
INSERT INTO brands (id, brand_name) VALUES (1 , 'Samsung');
INSERT INTO brands (id, brand_name) VALUES (2 , 'HTC');
INSERT INTO brands (id, brand_name) VALUES (3 , 'Huawei');
INSERT INTO brands (id, brand_name) VALUES (4 , 'Sony');
INSERT INTO brands (id, brand_name) VALUES (5 , 'Xiaomi');
INSERT INTO brands (id, brand_name) VALUES (6 , 'Apple');
INSERT INTO devices (id, device_name, brand_id) VALUES (1 , 'Samsung Galaxy s7 edge', 1);
INSERT INTO devices (id, device_name, brand_id) VALUES (2 , 'Samsung Galaxy s7', 1);
INSERT INTO devices (id, device_name, brand_id) VALUES (3 , 'HTC 10', 2);
INSERT INTO devices (id, device_name, brand_id) VALUES (4 , 'Huawei P9', 3);
INSERT INTO devices (id, device_name, brand_id) VALUES (5 , 'Samsung Galaxy s6', 1);
INSERT INTO devices (id, device_name, brand_id) VALUES (6 , 'Sony Xperia Z5', 4);
INSERT INTO devices (id, device_name, brand_id) VALUES (7 , 'Xiaomi Mi 5', 5);
INSERT INTO devices (id, device_name, brand_id) VALUES (8 , 'Huawei Mate', 3);
INSERT INTO devices (id, device_name, brand_id) VALUES (9 , 'iPhone 6s plus', 6);
INSERT INTO devices (id, device_name, brand_id) VALUES (10 , 'iPhone 6s', 6); | true |
6ec6eab451ed3e66fd7432f5365489e7e9253244 | SQL | yinm/obenkyo-mysql | /kidokarano_mysql/select_join_using.sql | UTF-8 | 98 | 2.703125 | 3 | [] | no_license | select
sales.id
,employee_a.name
,sales.amount
from
sales
join
employee_a
using(id)
;
| true |
63e12abe906ce705663f33f43744f91eb6b02c00 | SQL | YaoChungLiang/Database | /quiz1/q1_6.sql | UTF-8 | 144 | 3.328125 | 3 | [] | no_license | SELECT M.name, M.year, E.name, P.time
FROM Meet as M, Event as E, Performance as P
WHERE P.time = MIN(P.time) AND P.eid = E.id
AND M.id = E.mid; | true |
2d5cb537ec80a75db94e81abb1607a8eb91668c2 | SQL | PanosPapazoglou/My_Java_Inventory | /JavaBasicsExamples/stuff/persons.sql | UTF-8 | 759 | 2.984375 | 3 | [] | no_license | /*
MySQL Backup
Source Host: localhost
Source Server Version: 5.6.12-log
Source Database: java_dbcon
Date: 2013/12/01 15:58:17
*/
SET FOREIGN_KEY_CHECKS=0;
use java_dbcon;
#----------------------------
# Table structure for persons
#----------------------------
CREATE TABLE `persons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) DEFAULT NULL,
`age` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
#----------------------------
# Records for table persons
#----------------------------
insert into persons values
(1, 'panos', '35'),
(2, 'nikos', '34'),
(3, 'petros', '33'),
(4, 'spyros', '35'),
(5, 'kostas', '32');
| true |
5bad4ec6d70909cba6de9c1460ac3b7d563cdd98 | SQL | intCCP/CCP | /Application/Viste/v_mcre0_app_rio_pos_da_lav.sql | UTF-8 | 2,787 | 2.8125 | 3 | [] | no_license | /* Formatted on 21/07/2014 18:35:55 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_APP_RIO_POS_DA_LAV
(
COD_SNDG,
COD_ABI_CARTOLARIZZATO,
COD_ABI_ISTITUTO,
DESC_ISTITUTO,
COD_NDG,
COD_COMPARTO,
COD_RAMO_CALCOLATO,
DESC_NOME_CONTROPARTE,
COD_GRUPPO_ECONOMICO,
VAL_ANA_GRE,
COD_STRUTTURA_COMPETENTE_DC,
DESC_STRUTTURA_COMPETENTE_DC,
COD_STRUTTURA_COMPETENTE_DV,
DESC_STRUTTURA_COMPETENTE_DV,
COD_STRUTTURA_COMPETENTE_RG,
DESC_STRUTTURA_COMPETENTE_RG,
COD_STRUTTURA_COMPETENTE_AR,
DESC_STRUTTURA_COMPETENTE_AR,
COD_STRUTTURA_COMPETENTE_FI,
DESC_STRUTTURA_COMPETENTE_FI,
COD_PROCESSO,
COD_STATO,
DTA_DECORRENZA_STATO,
DTA_SCADENZA_STATO,
COD_STATO_PRECEDENTE,
VAL_GG_IN_MACROSTATO,
ID_UTENTE,
DTA_UTENTE_ASSEGNATO,
DESC_NOME,
DESC_COGNOME,
SCSB_ACC_TOT,
SCSB_UTI_TOT,
ID_REFERENTE,
FLG_ABI_LAVORATO,
COD_ISTITUTO_SOA,
COD_LIVELLO,
COD_GRUPPO_SUPER
)
AS
SELECT -- VG 11-03-2011 COD_ISTITUTO_SOA
-- v1 17/06/2011 VG: New PCR
x.cod_sndg,
x.cod_abi_cartolarizzato,
x.cod_abi_istituto,
x.desc_istituto,
x.cod_ndg,
x.cod_comparto,
x.cod_ramo_calcolato,
x.desc_nome_controparte,
x.cod_gruppo_economico,
x.desc_gruppo_economico val_ana_gre,
x.cod_struttura_competente_dc,
x.desc_struttura_competente_dc,
x.cod_struttura_competente_dv,
x.desc_struttura_competente_dv,
x.cod_struttura_competente_rg,
x.desc_struttura_competente_rg,
x.cod_struttura_competente_ar,
x.desc_struttura_competente_ar,
x.cod_struttura_competente_fi,
x.desc_struttura_competente_fi,
x.cod_processo,
x.cod_stato,
x.dta_decorrenza_stato,
x.dta_scadenza_stato,
x.cod_stato_precedente,
TRUNC (SYSDATE) - TRUNC (x.dta_dec_macrostato) val_gg_in_macrostato,
NULLIF (x.id_utente, -1) id_utente,
x.dta_utente_assegnato,
x.nome desc_nome,
x.cognome desc_cognome,
x.scsb_acc_tot,
x.scsb_uti_tot,
x.id_referente,
i.flg_abi_lavorato,
I.COD_ISTITUTO_SOA,
X.COD_LIVELLO,
X.COD_GRUPPO_SUPER
FROM --T_MCRE0_APP_ANAGRAFICA_GRUPPO G,
v_mcre0_app_upd_fields x, mv_mcre0_app_istituti i
--T_MCRE0_APP_ANAGR_GRE GE,
--MV_MCRE0_DENORM_STR_ORG S,
--T_MCRE0_APP_UTENTI U,
--T_MCRE0_APP_PCR R
WHERE x.cod_macrostato = 'RIO'
AND NVL (x.flg_outsourcing, 'N') = 'Y'
AND x.cod_abi_cartolarizzato = i.cod_abi;
| true |
375ec84e63d4d7c4a0424bd18de67088709ee6a5 | SQL | Karabaev/EPAM_Ext_Lab_Q2_2018_Maxim_Karabaev | /Task8/Northwind/Scripts/Task8_10/Task 8_10_1.sql | UTF-8 | 190 | 3.65625 | 4 | [] | no_license | SELECT EmployeeID, (LastName + ' ' + FirstName) as Seller
FROM Northwind.Employees as emp
WHERE ( SELECT COUNT(OrderID)
FROM Northwind.Orders
WHERE emp.EmployeeID = EmployeeID) > 150 | true |
2060637407e98a45521dc3e7f40e241bf6f20d14 | SQL | JEonjinwon/Oracle | /01-27.sql | UHC | 6,683 | 3.578125 | 4 | [] | no_license | SELECT C.LEC_CODE
, B.SUB_NAME
,(SELECT A.MEM_NAME
FROM MEMBER A , LECTURE B
WHERE A.MEM_ID = B.MEM_ID
AND B.LEC_CODE = '1000702')
, C.LEC_FULL
, C.LEC_NMT
, C.LEC_GRD
, C.ROOM_CODE
, B.SUB_DETAIL
, B.SUB_CREDIT
FROM MEMBER A, SUBJECT B, LECTURE C, TAKE_LEC D
where D.mem_id = '1841010'
AND D.MEM_ID = A.MEM_ID
AND D.LEC_CODE = C.LEC_CODE
AND C.SUB_CODE = B.SUB_CODE
SELECT A.MEM_NAME
FROM MEMBER A , LECTURE B
WHERE A.MEM_ID = B.MEM_ID
AND B.LEC_CODE = '1000702'
SELECT D.TLEC_NO as ڵ
, B.SUB_NAME as
, (SELECT MEM_NAME FROM MEMBER WHERE MEM_ID = C.MEM_ID) as
, C.LEC_FULL as
, C.LEC_NMT as ̴
, C.LEC_GRD as г
, C.ROOM_CODE as ǽ
, B.SUB_DETAIL as ̼
, B.SUB_CREDIT as
FROM MEMBER A, SUBJECT B, LECTURE C, TAKE_LEC D
where D.mem_id = '1841010'
AND D.MEM_ID = A.MEM_ID
AND D.LEC_CODE = C.LEC_CODE
AND C.SUB_CODE = B.SUB_CODE;
SELECT Y.*
FROM(
SELECT ROWNUM RNUM,
X.*
FROM(
SELECT
A.LEC_CODE ,
B.SUB_NAME ,
C.MEM_NAME ,
A.LEC_FULL ,
A.LEC_NMT ,
A.LEC_GRD ,
A.ROOM_CODE ,
B.SUB_DETAIL ,
B.SUB_CREDIT
FROM LECTURE A , SUBJECT B, MEMBER C
WHERE 1=1
AND A.SUB_CODE = B.SUB_CODE
AND C.MEM_TYPE ='ROLE_PROFESSOR'
AND C.MEM_ID = A.MEM_ID
AND A.LEC_CODE IN(
SELECT LEC_CODE
FROM LECTURE
WHERE LEC_CODE
NOT IN (SELECT A.LEC_CODE
FROM LECTURE A , TAKE_LEC B
WHERE B.MEM_ID = '1841010'
AND A.LEC_CODE = B.LEC_CODE)
)
)X)Y
SELECT LEC_CODE
FROM LECTURE
WHERE LEC_CODE
NOT IN (SELECT A.LEC_CODE
FROM LECTURE A , TAKE_LEC B
WHERE B.MEM_ID = '1841010'
AND A.LEC_CODE = B.LEC_CODE)
SELECT
select CASE WHEN NULLABLE='N' AND (DATA_TYPE='VARCHAR2' OR DATA_TYPE='CHAR')
THEN '@NotBlank'
WHEN NULLABLE='N' AND DATA_TYPE = 'NUMBER' THEN '@NotNull @Min(0)'
ELSE '' END
|| DECODE(DATA_TYPE, 'NUMBER', '', '@Size(max='||DATA_LENGTH||')')
|| ' private '||
DECODE( DATA_TYPE , 'NUMBER', 'Integer ', 'String ' )||
LOWER(SUBSTR( REPLACE(initcap(COLUMN_NAME),'_'),1,1))||
SUBSTR( REPLACE(initcap(COLUMN_NAME),'_'),2)||
';'
||' //' || (SELECT comments FROM ALL_COL_COMMENTS
WHERE TABLE_NAME = 'INTEREST_LEC'
AND COLUMN_NAME = A.COLUMN_NAME
)
from cols A
WHERE TABLE_NAME = 'INTEREST_LEC'
ORDER BY COLUMN_ID;
INSERT INTO interest_lec (
lec_code,
mem_id
) VALUES (
:v0,
:v1
);
SELECT C.LEC_CODE
, B.SUB_NAME
, (SELECT MEM_NAME FROM MEMBER WHERE MEM_ID = C.MEM_ID) AS MEM_NAME
, C.LEC_FULL
, C.LEC_NMT
, C.LEC_GRD
, C.ROOM_CODE
, B.SUB_DETAIL
, B.SUB_CREDIT
FROM MEMBER A, SUBJECT B, LECTURE C
WHERE D.MEM_ID = '1841010'
AND D.MEM_ID = A.MEM_ID
AND D.LEC_CODE = C.LEC_CODE
AND C.SUB_CODE = B.SUB_CODE
SELECT * FROM INTEREST_LEC
WHERE MEM_ID ='1841010'
SELECT Y.*
FROM(
SELECT ROWNUM RNUM,
X.*
FROM(
SELECT
A.LEC_CODE ,
B.SUB_NAME ,
C.MEM_NAME ,
A.LEC_FULL ,
A.LEC_NMT ,
A.LEC_GRD ,
A.ROOM_CODE ,
B.SUB_DETAIL ,
B.SUB_CREDIT
FROM LECTURE A , SUBJECT B, MEMBER C, INTEREST_LEC D
WHERE 1=1
AND A.SUB_CODE = B.SUB_CODE
AND C.MEM_TYPE ='ROLE_PROFESSOR'
AND C.MEM_ID = A.MEM_ID
AND A.LEC_CODE IN(
SELECT LEC_CODE
FROM LECTURE
WHERE LEC_CODE
NOT IN (SELECT A.LEC_CODE
FROM LECTURE A , TAKE_LEC B
WHERE B.MEM_ID = '1841010'
AND A.LEC_CODE = B.LEC_CODE)
)
)X)Y
(SELECT LEC_CODE FROM INTEREST_LEC WHERE MEM_ID= '1841010')
SELECT Y.*
FROM(
SELECT ROWNUM RNUM,
X.*
FROM(
SELECT
D.LEC_CODE ,
B.SUB_NAME ,
C.MEM_NAME ,
A.LEC_FULL ,
A.LEC_NMT ,
A.LEC_GRD ,
A.ROOM_CODE ,
B.SUB_DETAIL ,
B.SUB_CREDIT
FROM LECTURE A , SUBJECT B, MEMBER C, INTEREST_LEC D
WHERE 1=1
AND A.SUB_CODE = B.SUB_CODE
AND C.MEM_TYPE ='ROLE_PROFESSOR'
AND C.MEM_ID = A.MEM_ID
AND A.LEC_CODE = D.LEC_CODE
AND D.MEM_ID ='1841010'
AND A.LEC_CODE IN(
SELECT LEC_CODE
FROM LECTURE
WHERE LEC_CODE NOT IN (SELECT A.LEC_CODE
FROM LECTURE A , TAKE_LEC B
WHERE B.MEM_ID = '1841010'
AND A.LEC_CODE = B.LEC_CODE)
)
)X)Y
| true |
abd27b3fae976571e019eb3adcc38a7cbbe7064b | SQL | bigdataconsult/Oracle | /utilityScripts/cv.sql | UTF-8 | 417 | 2.984375 | 3 | [] | no_license | set pages 200
col owner for a32
col owner_table for a48
col column_name for a32
break on owner skip 1
select c.owner, c.owner||'.'||table_name owner_table, column_name
from dba_tab_columns c, dba_objects o
where column_name like UPPER('%&1%')
and c.owner like DECODE('&&2',NULL,'%FCRM%',UPPER('%&&2%'))
AND table_name not like 'BIN$%'
AND table_name=object_name
AND object_type='VIEW'
ORDER BY 1, 2
/
define 2='' | true |
8e6859e7230f00a4ab0a33e84167b571ebbd578b | SQL | judsonc/gpweb | /gpweb/instalacao/sql/atualizar_bd_mysql_157.sql | ISO-8859-1 | 5,968 | 2.578125 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
UPDATE versao SET versao_codigo='8.3.6';
UPDATE versao SET ultima_atualizacao_bd='2013-03-31';
UPDATE versao SET ultima_atualizacao_codigo='2013-03-31';
UPDATE versao SET versao_bd=157;
UPDATE config SET config_valor=10 WHERE config_valor=11 AND config_nome='militar';
ALTER TABLE tarefa_log ADD COLUMN tarefa_log_reg_mudanca_status INTEGER(100) UNSIGNED DEFAULT 0;
ALTER TABLE baseline_tarefa_log ADD COLUMN tarefa_log_reg_mudanca_status INTEGER(100) UNSIGNED DEFAULT 0;
ALTER TABLE baseline_projetos ADD COLUMN projeto_plano_operativo INTEGER(1) DEFAULT '0';
ALTER TABLE projetos ADD COLUMN projeto_plano_operativo INTEGER(1) DEFAULT '0';
ALTER TABLE msg ADD msg_operativo INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE msg ADD KEY msg_operativo (msg_operativo);
ALTER TABLE msg ADD CONSTRAINT msg_fk13 FOREIGN KEY (msg_operativo) REFERENCES operativo (operativo_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE msg ADD msg_monitoramento INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE msg ADD KEY msg_monitoramento (msg_monitoramento);
ALTER TABLE msg ADD CONSTRAINT msg_fk12 FOREIGN KEY (msg_monitoramento) REFERENCES monitoramento (monitoramento_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE campos_customizados_estrutura ADD COLUMN campo_formula TEXT;
ALTER TABLE arquivo_pastas ADD COLUMN arquivo_pasta_ata INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE arquivo_pastas ADD KEY arquivo_pasta_ata (arquivo_pasta_ata);
ALTER TABLE arquivo_pastas ADD CONSTRAINT arquivo_pastas_fk15 FOREIGN KEY (arquivo_pasta_ata) REFERENCES ata (ata_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE arquivos ADD COLUMN arquivo_ata INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE arquivos ADD KEY arquivo_ata (arquivo_ata);
ALTER TABLE arquivos ADD CONSTRAINT arquivo_fk15 FOREIGN KEY (arquivo_ata) REFERENCES ata (ata_id) ON DELETE CASCADE ON UPDATE CASCADE;
INSERT INTO config (config_nome, config_valor, config_grupo, config_tipo) VALUES
('perspectiva','perspectiva estratgica','legenda','text'),
('perspectivas','perspectivas estratgicas','legenda','text'),
('genero_perspectiva','a','legenda','select'),
('portfolio','portflio','legenda','text'),
('portfolios','portflios','legenda','text'),
('genero_portfolio','o','legenda','select');
INSERT INTO config_lista (config_nome, config_lista_nome) VALUES
('genero_perspectiva','a'),
('genero_perspectiva','o'),
('genero_portfolio','a'),
('genero_portfolio','o');
ALTER TABLE ata ADD COLUMN ata_cia INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_pratica INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_acao INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_tema INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_objetivo INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_fator INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_estrategia INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_meta INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_indicador INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_calendario INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_monitoramento INTEGER(100) UNSIGNED DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_titulo VARCHAR(255) DEFAULT NULL;
ALTER TABLE ata ADD COLUMN ata_descricao TEXT;
ALTER TABLE ata ADD KEY ata_pratica (ata_pratica);
ALTER TABLE ata ADD KEY ata_indicador (ata_indicador);
ALTER TABLE ata ADD KEY ata_calendario (ata_calendario);
ALTER TABLE ata ADD KEY ata_acao (ata_acao);
ALTER TABLE ata ADD KEY ata_objetivo (ata_objetivo);
ALTER TABLE ata ADD KEY ata_fator (ata_fator);
ALTER TABLE ata ADD KEY ata_estrategia (ata_estrategia);
ALTER TABLE ata ADD KEY ata_meta (ata_meta);
ALTER TABLE ata ADD KEY ata_tema (ata_tema);
ALTER TABLE ata ADD KEY ata_cia (ata_cia);
ALTER TABLE ata ADD KEY ata_monitoramento (ata_monitoramento);
ALTER TABLE ata ADD CONSTRAINT ata_fk1 FOREIGN KEY (ata_calendario) REFERENCES calendario (calendario_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk3 FOREIGN KEY (ata_pratica) REFERENCES praticas (pratica_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk4 FOREIGN KEY (ata_acao) REFERENCES plano_acao (plano_acao_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk6 FOREIGN KEY (ata_indicador) REFERENCES pratica_indicador (pratica_indicador_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk7 FOREIGN KEY (ata_objetivo) REFERENCES objetivos_estrategicos (pg_objetivo_estrategico_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk8 FOREIGN KEY (ata_fator) REFERENCES fatores_criticos (pg_fator_critico_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk9 FOREIGN KEY (ata_estrategia) REFERENCES estrategias (pg_estrategia_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk10 FOREIGN KEY (ata_meta) REFERENCES metas (pg_meta_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk11 FOREIGN KEY (ata_tema) REFERENCES tema (tema_id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE ata ADD CONSTRAINT ata_fk12 FOREIGN KEY (ata_cia) REFERENCES cias (cia_id) ON DELETE CASCADE ON UPDATE CASCADE;
DROP TABLE IF EXISTS log;
CREATE TABLE log (
log_id INTEGER(100) NOT NULL AUTO_INCREMENT,
log_usuario INTEGER(100) UNSIGNED DEFAULT NULL,
log_cia INTEGER(100) UNSIGNED DEFAULT NULL,
log_m VARCHAR(30) DEFAULT NULL,
log_a VARCHAR(50) DEFAULT NULL,
log_u VARCHAR(30) DEFAULT NULL,
log_acao VARCHAR(10) DEFAULT NULL,
log_sql TEXT,
log_data DATETIME DEFAULT NULL,
log_ip VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (log_id)
)ENGINE=InnoDB
| true |
ba68ebd8d848377019c85402c25e53bd6c575b79 | SQL | alejotaliento/BD1 | /TP ARREGLADO/FINALIZAR ESTACION SIN CURSORES.sql | UTF-8 | 2,548 | 3.609375 | 4 | [] | no_license | delimiter $$
create procedure finalizarEstacionV2(patente int, out resultado int, out mensaje varchar(45))
BEGIN
-- MODELO DEL AUTO SEGUN SU PATENTE
SET @modeloProcedure:=(SELECT detalle_pedido_idModelo from vehiculo where idVehiculo=patente);
-- EL ORDEN ACTUAL DE LA ESTACION DEL AUTO
SET @ordenProcedure:=(select e.orden from estacion_x_vehiculo ev inner join estacion e
on ev.idEstacion=e.idEstacion inner join montaje m on e.idMontaje=m.idMontaje
where m.idModelo=@modeloProcedure and idVehiculo=patente and ev.fecha_ingreso IS NOT NULL AND ev.fecha_egreso IS NULL);
-- ID DE LA PROXIMA ESTACION EN LA CUAL TENDRIA QUE INGRESAR
SET @idEstacionProcedure:=(select e.idEstacion from estacion e inner join montaje m on e.idMontaje=m.idMontaje
where m.idModelo=@modeloProcedure and orden=@ordenProcedure+1);
-- PATENTE DEL VEHICULO
SET @idVehiculoProcedure:=(SELECT idVehiculo from vehiculo where idVehiculo=patente);
-- BUSCA LA CANTIDAD DE VEHICULOS QUE SE ENCUENTRAN EN LA PROXIMA ESTACION
SET @cantidad:=(select count(*) from estacion_x_vehiculo ev inner join estacion e on ev.idEstacion=e.idEstacion
inner join vehiculo v on ev.idVehiculo=v.idVehiculo where e.orden=@ordenProcedure+1 and ev.fecha_egreso IS NULL
and v.detalle_pedido_idModelo=(SELECT detalle_pedido_idModelo from vehiculo where idVehiculo=patente));
-- CONDICIONAL PARA VER SI INGRESA EL VEHICULO
IF @cantidad=0 and @idEstacionProcedure IS NOT NULL THEN
update estacion_x_vehiculo ev inner join estacion e on ev.idEstacion=e.idEstacion set fecha_egreso=now() where idVehiculo=patente and e.orden=@ordenProcedure;
INSERT INTO estacion_x_vehiculo (fecha_ingreso,idEstacion,idVehiculo,eliminado)
values (now(),@idEstacionProcedure,@idVehiculoProcedure,0);
select 0 into resultado;
select "-" into mensaje;
select @resultado,@mensaje,@idVehiculoProcedure as Patente;
ELSE IF @idEstacionProcedure IS NULL THEN
update estacion_x_vehiculo ev inner join estacion e on ev.idEstacion=e.idEstacion set fecha_egreso=now() where idVehiculo=patente and e.orden=@ordenProcedure;
update vehiculo set fechaFinalizacion=now() where idVehiculo=patente;
select "AUTOMOVIL FINALIZADO" into mensaje;
select @mensaje;
ELSE
select -1 into resultado;
select "NO SE PUEDE AVANZAR" into mensaje;
select @resultado,@mensaje,@idVehiculoProcedure as Patente;
END IF;
END IF;
END $$ | true |
3b254c4d81163bf5bcfc608fe4f621a4329f0bae | SQL | sarandford/databaseProject | /Sarah_Ford_Database_Project/Table DDL/kitchen_Cooks.sql | UTF-8 | 3,866 | 2.609375 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `kitchen` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `kitchen`;
-- MySQL dump 10.13 Distrib 5.6.19, for osx10.7 (i386)
--
-- Host: 23.229.206.34 Database: kitchen
-- ------------------------------------------------------
-- Server version 5.5.36-cll-lve
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `Cooks`
--
DROP TABLE IF EXISTS `Cooks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Cooks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(15) NOT NULL,
`password` varchar(15) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `password` (`password`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `Cooks`
--
LOCK TABLES `Cooks` WRITE;
/*!40000 ALTER TABLE `Cooks` DISABLE KEYS */;
INSERT INTO `Cooks` VALUES (3,'lkh','jhlk'),(4,'hkjkjhkj','gkjhkjhk'),(5,'khkj','kjhkjh'),(9,'testUser','pword'),(10,'newUser','new'),(19,'new ','ooo'),(21,'hkh','kjh'),(22,'kjhk','kjhkj'),(23,'kjkj','kjjk'),(34,'hi','there'),(52,'ihl','hjhkj'),(53,'',''),(56,'ioioioi','oooooo'),(59,'jllllll','poppppp'),(60,'hhhh','popooo'),(62,'bjk','HL'),(64,'unique','user'),(65,'ella','sam'),(66,'oj','ko'),(67,'old','password'),(68,'lol','ttyl'),(69,'lea','hammerhead'),(70,'panettama','daphne77'),(71,'sarah','tryme'),(72,'sarandford','newpword');
/*!40000 ALTER TABLE `Cooks` ENABLE KEYS */;
UNLOCK TABLES;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_general_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = '' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`sarandford`@`localhost`*/ /*!50003 trigger validateUser before insert on Cooks for each row
begin
IF exists(select username from Cooks where username=NEW.username) THEN
SIGNAL SQLSTATE VALUE '45000'
SET MESSAGE_TEXT = '[table:Cooks] - `username` column is not valid';
elseif exists(select password from Cooks where password=NEW.password) THEN
SIGNAL SQLSTATE VALUE '45000'
SET MESSAGE_TEXT = '[table:Cooks] - `password` column is not valid';
END IF;
end */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2014-11-24 11:28:53
| true |
e748cf21d75d01ebcbd88b7074eeefd7606b2ed8 | SQL | dhamotharang/SvnGit | /Core/Database/StoredProcedure/Create Scripts/InsertScript_ClientInformationTabConfigurations_Task#258N180.sql | UTF-8 | 539 | 3.078125 | 3 | [] | no_license | IF NOT EXISTS (SELECT * FROM ClientInformationTabConfigurations WHERE [TabName] = 'Timeliness' AND ScreenId=969)
BEGIN
INSERT INTO ClientInformationTabConfigurations(ScreenId,TabName,TabURL,TabType,TabOrder)
VALUES(969,'Timeliness','/Modules/ClientInformation/Client/Detail/ClientInformationTimelines.ascx','ASPX',17)
END
ELSE
BEGIN
UPDATE ClientInformationTabConfigurations SET TabURL='/Modules/ClientInformation/Client/Detail/ClientInformationTimelines.ascx',TabType='ASPX' WHERE [TabName] = 'Timeliness' AND ScreenId=969
END | true |
820db4493652be4427414746436ba2a30f44c1a7 | SQL | josephttran/csharp-code | /csharp-challenge/DatabaseDesignProject/SQLProjectChristmasShopping/dbo/Views/PersonGiftBudget.sql | UTF-8 | 280 | 3.40625 | 3 | [] | no_license | CREATE VIEW PersonGiftBudget
AS
SELECT FirstName, LastName, Budget AS InitialBudget, (Budget - ISNULL(SUM(Cost), 0)) AS BudgetLeft,
CASE WHEN SUM(Cost) IS NOT NULL THEN 'True' ELSE 'False' END AS HasGift
FROM dbo.FullPersonItem
GROUP BY PersonId, FirstName, LastName, Budget;
| true |
5690ef07c738f4b1bc47166d1a287cb4af991a78 | SQL | huxuan0307/mto10server | /db/student.sql | WINDOWS-1252 | 2,479 | 3.484375 | 3 | [] | no_license |
-- drop database if exists `hw-mto10-u1752877`;
-- create database `hw-mto10-u1752877`;
use `hw-mto10-u1752877`;
drop table if exists `student`;
create table `student`(
stu_no char(7) not null,
stu_name char(8) not null,
stu_password char(32) not null,
stu_common_password char(32) not null,
stu_enable char(1) not null,
primary key(stu_no)
);
delimiter $$
drop procedure if exists get_student;
create procedure get_student(in in_stu_no char(7))
begin
if in_stu_no is null then
select * from student;
else
select * from student where stu_no = in_stu_no;
end if;
end$$
drop procedure if exists get_pw;
create procedure get_pw(in in_stu_no char(7))
begin
select stu_password from student where stu_no = in_stu_no;
end$$
drop procedure if exists check_login_gtest;
create procedure check_login_gtest(in in_stu_no char(7), in in_stu_password char(32))
begin
declare res int;
select count(*) from student where stu_no = in_stu_no and stu_password = in_stu_password into @res;
if @res = 0 then
select 0;
else
set @grouptime = (unix_timestamp(current_timestamp()) div 1800) * 1800;
set @cnt = (select count(*) from gameinfo_gtest where grouptime = @grouptime and no = in_stu_no);
select @cnt+1;
end if;
end$$
drop procedure if exists check_login_stest;
create procedure check_login_stest(in in_stu_no char(7), in in_stu_password char(32))
begin
select count(*) from student
where stu_no = in_stu_no
and stu_password = in_stu_password;
end$$
drop procedure if exists check_login;
create procedure check_login(in in_stu_no char(7), in in_stu_password char(32), in in_test char(1))
begin
if in_test = 's' then
call check_login_stest(in_stu_no, in_stu_password);
elseif in_test = 'g' then
call check_login_gtest(in_stu_no, in_stu_password);
end if;
end$$
drop procedure if exists insert_student;
create procedure insert_student(
in in_stu_no char(7),
in in_stu_name char(8),
in in_stu_password char(32),
in in_stu_common_password char(32),
in in_stu_enable char(1)
)
begin
insert into `student` values(in_stu_no, in_stu_name,
in_stu_password, in_stu_common_password, '1');
end$$
delimiter ;
-- call insert_student(1752877, "", md5("xZx3aUL2%kt#-9+&"), 12345678, 1);
-- call get_student(1752877); | true |
4a7ce12f495a6a7a289f41e945930e87386c8634 | SQL | supremeking23/HHI_with_admin | /db/huntersdb.sql | UTF-8 | 41,358 | 2.734375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 21, 2019 at 05:37 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.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: `huntersdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_admin`
--
CREATE TABLE `tbl_admin` (
`admin_id` int(11) NOT NULL,
`admin_compo_id` varchar(45) NOT NULL,
`firstname` varchar(45) NOT NULL,
`middlename` varchar(45) NOT NULL,
`lastname` varchar(45) NOT NULL,
`username` varchar(45) NOT NULL,
`hash_password` text NOT NULL,
`password` varchar(45) NOT NULL,
`photo` text NOT NULL,
`contact` text NOT NULL,
`email` varchar(45) NOT NULL,
`admin_status` int(11) NOT NULL,
`admin_type` varchar(45) NOT NULL,
`date_added` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_admin`
--
INSERT INTO `tbl_admin` (`admin_id`, `admin_compo_id`, `firstname`, `middlename`, `lastname`, `username`, `hash_password`, `password`, `photo`, `contact`, `email`, `admin_status`, `admin_type`, `date_added`) VALUES
(1, 'HHIADMIN1903020950212', 'Juan', 'E', 'Dela Cruz', 'juan', '$2y$10$bHVj7.4i4v60.pecsINY2ux1s8xk9oVAj0zfqVm9/0j.UIxta6GjW', 'juan', 'avatar5.png', '11111', 'ivan@gmail.com', 1, 'SUPERADMIN', '0000-00-00 00:00:00'),
(6, 'HHIADMIN1903130215504', 'Bartholomew Henry', 'S', 'Allen', 'barry', '$2y$10$ubalkAE5QENPCz2hN63DwuUfKP6GDBO.HgAn7shHolNysXtYqEXJS', 'barry', '', '09479888749', 'barryallen@gmail,com', 1, 'ADMIN', '0000-00-00 00:00:00'),
(7, 'HHIADMIN1903130218540', 'Violet', 'E', 'Evargarden', 'violet', '$2y$10$QChIEUzMyTC1WyZJVCfEje5Cs68Ntv3sw0.pCh1zYa7k493a6/Yei', 'violet', '', '09479888749', 'violet@gmail.com', 1, 'ADMIN', '0000-00-00 00:00:00'),
(8, 'HHIADMIN1903130219285', 'Kyrieq', 'Drew', 'Irving', 'uncledrew', '$2y$10$SMWKvsbVP/laNgMEq9faq.4e7Fd8yOYA/mjUZuOechQ4qxUZ1kxmm', 'uncledrew', '', '09479888749', 'uncledrew@gmail.com', 1, 'ADMIN', '2019-03-13 14:20:58');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_clients`
--
CREATE TABLE `tbl_clients` (
`client_id` int(11) NOT NULL,
`client_compo_id` varchar(45) NOT NULL,
`firstname` varchar(45) NOT NULL,
`middlename` varchar(45) NOT NULL,
`lastname` varchar(45) NOT NULL,
`company` varchar(45) NOT NULL,
`position_in_company` varchar(45) NOT NULL,
`company_size` varchar(45) NOT NULL,
`industry` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`contact` text NOT NULL,
`zip_code` int(11) NOT NULL,
`message` text NOT NULL,
`man_power_file` text NOT NULL,
`qualification_description_file` text NOT NULL,
`date_send` datetime NOT NULL,
`data_status` int(11) NOT NULL,
`added_by` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_clients`
--
INSERT INTO `tbl_clients` (`client_id`, `client_compo_id`, `firstname`, `middlename`, `lastname`, `company`, `position_in_company`, `company_size`, `industry`, `email`, `contact`, `zip_code`, `message`, `man_power_file`, `qualification_description_file`, `date_send`, `data_status`, `added_by`) VALUES
(1, 'CLIENT1903041053336', 'Bartholomew Henry', 'S', 'Allen', 'STAR LABS', 'forensics', '3', 'HEROES', 'barryallen@gmail,com', '09479888749', 124, 'Nothing', 'Manpower Request Form.xlsm', 'JD and Q.docx', '2019-03-04 22:54:15', 1, ''),
(2, 'CLIENT1903041054599', 'Bartholomew Henry', 'S', 'Allen', 'STAR LABS', 'forensics', '8', 'HEROES', 'barryallen@gmail,com', '09479888749', 1234, 'sample', 'Manpower Request Form.xlsm', 'JD and Q.docx', '2019-03-04 22:56:31', 1, ''),
(3, 'CLIENT1903050838195', 'James', 'Lawrence', 'Reid', 'Isa Isaa', 'Center', '12', 'Canteen', 'jamesreid@gmail.com', '09479888749', 1222, 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.', 'Manpower Request Form.xlsm', 'JD and Q.docx', '2019-03-05 09:05:37', 1, ''),
(4, 'CLIENT1903091158176', 'Sansa', 'Howard', 'Stark', 'House of Stark', 'Center', '11', 'HEROES', 'sansastark', '09479888749', 1234, 'test test test', 'Man-Power-Request-Form.xlsm', '', '2019-03-09 11:59:31', 1, ''),
(5, 'CLIENT1903131045456', 'Joe', 'English', 'Ingles', 'STAR LABS', 'Forward', '', 'Stark', 'joenglish@gmail.com', '09479888749', 0, '', 'march.xlsx', '', '2019-03-13 22:46:08', 1, ''),
(6, 'CLIENT1903131056159', 'Bartholomew Henry', 'English', 'Allen', 'STAR LABS', 'Center', '', 'Stark', 'irishwestallen@gmail.com', '09479888749', 0, '', 'march.xlsx', '', '2019-03-13 22:56:36', 1, 'HHIADMIN1903020950212'),
(7, 'CLIENT1903131059128', 'Bartholomew Henry', 'English', 'Ingles', 'STAR LABS', 'Forward', '11', 'HEROES', 'irishwestallen@gmail.com', '09479888749', 1234, 'Based on the evaluation results, the following conclusion of evaluation result were drawn by the researchers. Results of four basic operations testing refers the behaviour output conducted on small query process up to huge data process with speed of internet. The results represented the objective of this study to known distinct difference when applied in a mobile environment on the basis of query process speed, accuracy and compatibility which can handle the big data and real-time database. The results have represented that there are many part which Firebase database is suitable for real-time database for its flexibility and is very easy to understand.', 'Ivan Christian Jay Funcion - DTR(December).xlsx', '', '2019-03-13 22:59:40', 1, ''),
(8, 'CLIENT1903131108412', 'dsdaddada', 'sdadad', 'dsdsdad', 'STAR LABS', 'Forward', '', 'Stark', 'irishwestallen@gmail.com', '09479888749', 0, '', 'Ivan Christian Jay Funcion - DTR(January).xlsx', '', '2019-03-13 23:09:00', 1, 'HHIADMIN1903020950212'),
(9, 'CLIENT1903131126407', 'sdad', 'English', 'Ingles', 'STAR LABS', 'Center', '', 'Stark', 'irishwestallen@gmail.com', '09479888749', 0, '', 'HHI -Ivan Christian Jay Funcion.xls', '', '2019-03-13 23:26:56', 0, 'HHIADMIN1903130215504'),
(10, 'CLIENT1903211200343', 'dasd', 'dasd', 'sdsd', 'STAR LABS', 'Forward', '', 'sd', 'irishwestallen@gmail.com', '09479888749', 0, '', 'Man-Power-Request-Form.xlsm', '', '2019-03-21 12:01:07', 1, 'HHIADMIN1903130215504');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_events`
--
CREATE TABLE `tbl_events` (
`event_id` int(11) NOT NULL,
`event_compo_id` varchar(45) NOT NULL,
`event_name` varchar(45) NOT NULL,
`event_description` text NOT NULL,
`event_datestart` date NOT NULL,
`event_dateend` date NOT NULL,
`event_timestart` time NOT NULL,
`event_timeend` time NOT NULL,
`event_type` varchar(45) NOT NULL,
`event_status` int(11) NOT NULL,
`created_by` varchar(45) NOT NULL,
`date_created` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_events`
--
INSERT INTO `tbl_events` (`event_id`, `event_compo_id`, `event_name`, `event_description`, `event_datestart`, `event_dateend`, `event_timestart`, `event_timeend`, `event_type`, `event_status`, `created_by`, `date_created`) VALUES
(2, 'EVENT1903070136435', 'Ivan', 'ahahaha', '2019-03-08', '0000-00-00', '13:30:00', '17:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(8, 'EVENT1903070147418', 'Event Test 5', 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32. ', '2019-03-07', '0000-00-00', '16:00:00', '18:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(9, 'EVENT1903070253531', 'Event Test 6', 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32. ', '2019-03-07', '0000-00-00', '17:00:00', '19:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(11, 'EVENT1903080728517', 'Half day', 'Hahalf day ako', '2019-03-08', '0000-00-00', '12:00:00', '19:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(12, 'EVENT1903091048585', 'Arcana South Expo', 'Arcana South North', '2019-03-22', '0000-00-00', '12:00:00', '21:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(15, 'EVENT1903120324223', 'Event mo to part 2', 'dasdasdd', '2019-03-14', '0000-00-00', '18:00:00', '21:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(17, 'EVENT1903130709134', 'Event 10', 'None', '2019-03-13', '0000-00-00', '09:00:00', '17:00:00', 'normal', 1, '', '0000-00-00 00:00:00'),
(18, 'EVENT1903130740126', 'march 28', 'sdadasdsadas', '2019-03-28', '0000-00-00', '14:00:00', '17:00:00', 'normal', 1, 'HHIADMIN1903020950212', '0000-00-00 00:00:00'),
(19, 'EVENT1903130743454', 'Expo', 'Expose', '2019-03-13', '0000-00-00', '08:00:00', '18:00:00', 'urgent', 1, 'HHIADMIN1903020950212', '0000-00-00 00:00:00'),
(26, 'EVENT1903211112055', 'long weekend', 'dsasda', '2019-04-01', '2019-04-04', '13:00:00', '17:00:00', '1', 1, 'HHIADMIN1903020950212', '2019-03-21 11:12:39'),
(28, 'EVENT1903211126031', 'Job Fair part 3', '', '2019-03-27', '0000-00-00', '08:00:00', '17:00:00', 'normal', 1, 'HHIADMIN1903020950212', '2019-03-21 11:26:43'),
(29, 'EVENT1903211216341', 'sdads', 'sdadasd', '2019-03-22', '0000-00-00', '17:00:00', '20:00:00', 'normal', 1, 'HHIADMIN1903020950212', '2019-03-21 12:20:46'),
(30, 'EVENT1903211220471', 'weekends', '', '2019-03-23', '2019-03-24', '05:00:00', '10:00:00', 'normal', 1, 'HHIADMIN1903020950212', '2019-03-21 12:21:37'),
(31, 'EVENT1903211226107', 'Job Fair part 2', '', '2019-03-26', '2019-03-27', '10:00:00', '17:00:00', 'normal', 1, 'HHIADMIN1903020950212', '2019-03-21 12:26:37');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_inquiries`
--
CREATE TABLE `tbl_inquiries` (
`inquiries_id` int(11) NOT NULL,
`inquiries_compo_id` varchar(45) NOT NULL,
`name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`message` text NOT NULL,
`date_send` datetime NOT NULL,
`data_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_inquiries`
--
INSERT INTO `tbl_inquiries` (`inquiries_id`, `inquiries_compo_id`, `name`, `email`, `message`, `date_send`, `data_status`) VALUES
(3, 'INQ1903040716597', 'iris west allen', 'irishwestallen@gmail.com', 'test 3', '2019-03-04 07:17:09', 1),
(4, 'INQ1903040727309', 'iris west allen', 'irishwestallen@gmail.com', 'blank message\r\n', '2019-03-04 07:41:00', 1),
(5, 'INQ1903040741001', 'iris west allen', 'irishwestallen@gmail.com', 'sige sige sige', '2019-03-04 07:41:17', 0),
(6, 'INQ1903040741179', 'iris west allen', 'irishwestallen@gmail.com', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', '2019-03-04 08:08:35', 1),
(7, 'INQ1903040906107', 'iris west allen', 'irishwestallen@gmail.com', 'badfinfg', '2019-03-04 09:06:22', 0),
(8, 'INQ1903050912279', 'Wallace West', 'kidflash@gmail.com', 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.', '2019-03-05 09:12:51', 0),
(9, 'INQ1903160717089', 'Joy to the world', 'irishwestallen@gmail.com', 'daddaddsdsdasd', '2019-03-16 19:17:24', 0);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_jobseekers`
--
CREATE TABLE `tbl_jobseekers` (
`jobseeker_id` int(11) NOT NULL,
`jobseeker_compo_id` varchar(45) NOT NULL,
`firstname` varchar(45) NOT NULL,
`middlename` varchar(45) NOT NULL,
`lastname` varchar(45) NOT NULL,
`gender` varchar(45) NOT NULL,
`contact` text NOT NULL,
`email` varchar(45) NOT NULL,
`subject` varchar(45) NOT NULL,
`message` text NOT NULL,
`file` text NOT NULL,
`date_send` datetime NOT NULL,
`data_status` int(11) NOT NULL,
`added_by` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_jobseekers`
--
INSERT INTO `tbl_jobseekers` (`jobseeker_id`, `jobseeker_compo_id`, `firstname`, `middlename`, `lastname`, `gender`, `contact`, `email`, `subject`, `message`, `file`, `date_send`, `data_status`, `added_by`) VALUES
(2, 'JOBSEEKER1903040203051', 'Nora', 'West', 'Allen', 'female', '0909002321', 'norawestallen@gmail.com', 'nothing', 'important', 'Abbr.docx', '2019-03-04 14:03:33', 1, ''),
(3, 'JOBSEEKER1903040303481', 'Nora', 'West', 'Allen', 'female', '09479888749', 'norawestallen@gmail.com', 'nothing', 'important', 'Abbr.docx', '2019-03-04 15:09:26', 1, ''),
(4, 'JOBSEEKER1903050905430', 'James Carlos', 'Y', 'Yap', 'male', '09479888749', 'jcy18@gmail.com', 'Applying for Java Developer', 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.', 'Abbr.docx', '2019-03-05 09:09:42', 0, ''),
(5, 'JOBSEEKER1903091138378', 'Francisco', 'Vibe', 'Ramon', 'male', '09479888749', 'vibecisco@gmail.com', 'Applying for Java Developer', 'test test test', '146-C00572-005.pdf', '2019-03-09 11:39:49', 1, ''),
(6, 'JOBSEEKER1903160222329', 'Violet', 'E', 'Evergarden', 'female', '09479888749', 'irishwestallen@gmail.com', 'Applying for Java Developer', '', 'FINAL_CHAPTER5.docx', '2019-03-16 14:22:59', 1, 'HHIADMIN1903020950212'),
(7, 'JOBSEEKER1903160223307', 'Mika', 'C', 'Kobayashi', 'female', '09479888749', 'irishwestallen@gmail.com', 'sdasdasdasddasds ivan', '', 'FINAL_CHAPTER2.docx', '2019-03-16 14:23:58', 1, 'HHIADMIN1903020950212'),
(8, 'JOBSEEKER1903160234583', 'Zeref', 'O', 'Endd', 'male', '09479888749', 'irishwestallen@gmail.com', 'Applying for Java Developer', '', 'FINAL_CHAPTER4.docx', '2019-03-16 14:35:23', 1, 'HHIADMIN1903020950212'),
(9, 'JOBSEEKER1903160236543', 'Hiroyuki', 'S', 'Sawano', 'male', '09479888749', 'irishwestallen@gmail.com', 'Applying for Java Developer', '', 'FINAL_CHAPTER3.docx', '2019-03-16 14:37:31', 0, 'HHIADMIN1903020950212'),
(10, 'JOBSEEKER1903211141127', 'James Carlos', 'L', 'Yab', 'male', '09479888749', 'irishwestallen@gmail.com', 'Applying for Java Developer', 'dsdasdasd', 'FINAL_CHAPTER3.docx', '2019-03-21 11:41:45', 1, ''),
(11, 'JOBSEEKER1903211157483', 'alsald', 'dasdasd', 'ssssss', 'male', '09479888749', 'irishwestallen@gmail.com', 'Applying for Java Developer', '', 'FINAL_CHAPTER5.docx', '2019-03-21 11:58:13', 1, 'HHIADMIN1903130215504');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_logs`
--
CREATE TABLE `tbl_logs` (
`log_id` int(11) NOT NULL,
`log_compo_id` varchar(45) NOT NULL,
`log_date` datetime NOT NULL,
`log_user` text NOT NULL,
`log_usertype` varchar(45) NOT NULL,
`log_action` text NOT NULL,
`log_userid` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_logs`
--
INSERT INTO `tbl_logs` (`log_id`, `log_compo_id`, `log_date`, `log_user`, `log_usertype`, `log_action`, `log_userid`) VALUES
(1, 'LOG1903110735108', '2019-03-11 07:35:10', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(2, 'LOG1903110737277', '2019-03-11 07:37:27', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(3, 'LOG1903110738050', '2019-03-11 07:38:05', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(4, 'LOG1903110741049', '2019-03-11 07:41:04', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(5, 'LOG1903110741087', '2019-03-11 07:41:08', 'scarlet_speedster', 'ADMIN', 'Login Successful', 'HHIADMIN1903030257008'),
(6, 'LOG1903110741312', '2019-03-11 07:41:31', 'scarlet_speedster', 'ADMIN', 'Logout Successful', 'HHIADMIN1903030257008'),
(7, 'LOG1903110741358', '2019-03-11 07:41:35', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(8, 'LOG1903110746097', '2019-03-11 07:46:09', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(9, 'LOG1903110746152', '2019-03-11 07:46:15', 'scarlet_speedster', 'ADMIN', 'Login Successful', 'HHIADMIN1903030257008'),
(10, 'LOG1903110750523', '2019-03-11 07:50:52', 'scarlet_speedster', 'ADMIN', 'Logout Successful', 'HHIADMIN1903030257008'),
(11, 'LOG1903110750597', '2019-03-11 07:50:59', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(12, 'LOG1903110751168', '2019-03-11 07:51:16', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(13, 'LOG1903110752440', '2019-03-11 07:52:44', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(14, 'LOG1903110752514', '2019-03-11 07:52:51', 'scarlet_speedster', 'ADMIN', 'Login Successful', 'HHIADMIN1903030257008'),
(15, 'LOG1903110819310', '2019-03-11 08:19:31', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(16, 'LOG1903110840584', '2019-03-11 08:40:58', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(17, 'LOG1903110844099', '2019-03-11 08:44:09', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(18, 'LOG1903110844498', '2019-03-11 08:44:49', 'scarlet_speedster', 'ADMIN', 'Login Successful', 'HHIADMIN1903030257008'),
(19, 'LOG1903110847321', '2019-03-11 08:47:32', 'scarlet_speedster', 'ADMIN', 'Logout Successful', 'HHIADMIN1903030257008'),
(20, 'LOG1903110847377', '2019-03-11 08:47:37', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(21, 'LOG1903110240129', '2019-03-11 14:40:12', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(22, 'LOG1903110907440', '2019-03-11 21:07:44', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(23, 'LOG1903111021023', '2019-03-11 22:21:02', 'railey', 'ADMIN', 'Add new user HHIADMIN1903111020208', 'HHIADMIN1903111020208'),
(24, 'LOG1903121144251', '2019-03-12 11:44:25', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(25, 'LOG1903120145472', '2019-03-12 13:45:47', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(26, 'LOG1903120155120', '2019-03-12 13:55:12', 'barry', 'ADMIN', 'Add new user HHIADMIN1903120154421', 'HHIADMIN1903020950212'),
(27, 'LOG1903120207012', '2019-03-12 14:07:01', 'barry', '', 'Update Information for user HHIADMIN190312015', 'HHIADMIN1903020950212'),
(28, 'LOG1903120324220', '2019-03-12 15:24:22', '', '', 'Add new event EVENT1903120315573', 'HHIADMIN1903020950212'),
(29, 'LOG1903120324565', '2019-03-12 15:24:56', '', '', 'Add new event EVENT1903120324223', 'HHIADMIN1903020950212'),
(30, 'LOG1903120341067', '2019-03-12 15:41:06', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(31, 'LOG1903120348541', '2019-03-12 15:48:54', '', '', 'Add new event EVENT1903120347332', 'HHIADMIN1903020950212'),
(32, 'LOG1903130708420', '2019-03-13 07:08:42', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(33, 'LOG1903130730122', '2019-03-13 07:30:12', '', '', 'Add new event EVENT1903130709134', 'HHIADMIN1903020950212'),
(34, 'LOG1903130740502', '2019-03-13 07:40:50', '', '', 'Add new event EVENT1903130740126', 'HHIADMIN1903020950212'),
(35, 'LOG1903130744383', '2019-03-13 07:44:38', '', '', 'Add new event EVENT1903130743454', 'HHIADMIN1903020950212'),
(36, 'LOG1903130836038', '2019-03-13 08:36:03', '', '', 'Add new event EVENT1903130835422', 'HHIADMIN1903020950212'),
(37, 'LOG1903130853136', '2019-03-13 08:53:13', '', '', 'Add new event EVENT1903130847054', 'HHIADMIN1903020950212'),
(38, 'LOG1903130922197', '2019-03-13 09:22:19', '', '', 'Event has been deleted 4', 'HHIADMIN1903020950212'),
(39, 'LOG1903130938018', '2019-03-13 09:38:01', '', '', 'Event has been deleted ', 'HHIADMIN1903020950212'),
(40, 'LOG1903130938054', '2019-03-13 09:38:05', '', '', 'Event has been deleted EVENT1903070144542', 'HHIADMIN1903020950212'),
(41, 'LOG1903130938091', '2019-03-13 09:38:09', '', '', 'Event has been deleted EVENT1903070146519', 'HHIADMIN1903020950212'),
(42, 'LOG1903130214497', '2019-03-13 14:14:49', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(43, 'LOG1903130215394', '2019-03-13 14:15:39', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(44, 'LOG1903130216116', '2019-03-13 14:16:11', 'barry', 'ADMIN', 'Add new user HHIADMIN1903130215504', 'HHIADMIN1903020950212'),
(45, 'LOG1903130216141', '2019-03-13 14:16:14', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(46, 'LOG1903130216192', '2019-03-13 14:16:19', 'barry', 'ADMIN', 'Login Successful', 'HHIADMIN1903130215504'),
(47, 'LOG1903130218339', '2019-03-13 14:18:33', 'barry', 'ADMIN', 'Logout Successful', 'HHIADMIN1903130215504'),
(48, 'LOG1903130218524', '2019-03-13 14:18:52', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(49, 'LOG1903130219276', '2019-03-13 14:19:27', 'violet', 'ADMIN', 'Add new user HHIADMIN1903130218540', 'HHIADMIN1903020950212'),
(50, 'LOG1903130220581', '2019-03-13 14:20:58', 'uncledrew', 'ADMIN', 'Add new user HHIADMIN1903130219285', 'HHIADMIN1903020950212'),
(51, 'LOG1903131009253', '2019-03-13 22:09:25', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(52, 'LOG1903131046084', '2019-03-13 22:46:08', 'ivan', 'SUPERADMIN', 'Add new client detail Client Id: CLIENT190313', 'HHIADMIN1903020950212'),
(53, 'LOG1903131056364', '2019-03-13 22:56:36', 'ivan', 'SUPERADMIN', 'Add new client detail Client Id: CLIENT190313', 'HHIADMIN1903020950212'),
(54, 'LOG1903131109006', '2019-03-13 23:09:00', 'ivan', 'SUPERADMIN', 'Add new client detail Client Id: CLIENT190313', 'HHIADMIN1903020950212'),
(55, 'LOG1903131126275', '2019-03-13 23:26:27', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(56, 'LOG1903131126339', '2019-03-13 23:26:33', 'barry', 'ADMIN', 'Login Successful', 'HHIADMIN1903130215504'),
(57, 'LOG1903131126563', '2019-03-13 23:26:56', 'barry', 'ADMIN', 'Add new client detail Client Id: CLIENT190313', 'HHIADMIN1903130215504'),
(58, 'LOG1903131142161', '2019-03-13 23:42:16', '', '', 'Event has been deleted EVENT1903070330386', 'HHIADMIN1903130215504'),
(59, 'LOG1903131144316', '2019-03-13 23:44:31', 'barry', 'ADMIN', 'Logout Successful', 'HHIADMIN1903130215504'),
(60, 'LOG1903131144406', '2019-03-13 23:44:40', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(61, 'LOG1903131146288', '2019-03-13 23:46:28', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(62, 'LOG1903131147012', '2019-03-13 23:47:01', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(63, 'LOG1903131153353', '2019-03-13 23:53:35', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(64, 'LOG1903141216457', '2019-03-14 00:16:45', '', '', 'Add new event EVENT1903141216091', 'HHIADMIN1903020950212'),
(65, 'LOG1903141224220', '2019-03-14 00:24:22', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(66, 'LOG1903141224286', '2019-03-14 00:24:28', 'barry', 'ADMIN', 'Login Successful', 'HHIADMIN1903130215504'),
(67, 'LOG1903140704580', '2019-03-14 07:04:58', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(68, 'LOG1903140714081', '2019-03-14 07:14:08', '', '', 'Event has been deleted EVENT1903071246301', 'HHIADMIN1903020950212'),
(69, 'LOG1903140932238', '2019-03-14 09:32:23', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(70, 'LOG1903140932340', '2019-03-14 09:32:34', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(71, 'LOG1903140934573', '2019-03-14 09:34:57', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(72, 'LOG1903140935046', '2019-03-14 09:35:04', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(73, 'LOG1903140936030', '2019-03-14 09:36:03', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(74, 'LOG1903140936097', '2019-03-14 09:36:09', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(75, 'LOG1903140936289', '2019-03-14 09:36:28', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(76, 'LOG1903140938310', '2019-03-14 09:38:31', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(77, 'LOG1903140942553', '2019-03-14 09:42:55', '', '', 'Update Event information for event: EVENT1903', 'HHIADMIN1903020950212'),
(78, 'LOG1903161111565', '2019-03-16 11:11:56', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(79, 'LOG1903160235231', '2019-03-16 14:35:23', 'ivan', 'SUPERADMIN', 'Add new jobseeker detail Jobseeker Id: JOBSEE', 'HHIADMIN1903020950212'),
(80, 'LOG1903160237311', '2019-03-16 14:37:31', 'ivan', 'SUPERADMIN', 'Add new jobseeker detail Jobseeker Id: JOBSEEKER1903160236543', 'HHIADMIN1903020950212'),
(81, 'LOG1903160502548', '2019-03-16 17:02:54', '', '', 'Update Event information for event: EVENT1903130847054', 'HHIADMIN1903020950212'),
(82, 'LOG1903160820163', '2019-03-16 20:20:16', 'ivan', 'SUPERADMIN', 'Archive an inquiry data. Inquiry Id:<br /><b>Warning</b>: urlencode() expects parameter 1 to be string, array given in <b>C:\\xampp\\htdocs\\HHI\\admin\\includes_admin\\functions.php</b> on line <b>21</b><br />', 'HHIADMIN1903020950212'),
(83, 'LOG1903160820373', '2019-03-16 20:20:37', 'ivan', 'SUPERADMIN', 'Archive an inquiry data. Inquiry Id:<br /><b>Warning</b>: urlencode() expects parameter 1 to be string, array given in <b>C:\\xampp\\htdocs\\HHI\\admin\\includes_admin\\functions.php</b> on line <b>21</b><br />', 'HHIADMIN1903020950212'),
(84, 'LOG1903160823528', '2019-03-16 20:23:52', 'ivan', 'SUPERADMIN', 'Archive an inquiry data. Inquiry Id:INQ1903040906107', 'HHIADMIN1903020950212'),
(85, 'LOG1903160825126', '2019-03-16 20:25:12', 'ivan', 'SUPERADMIN', 'Archive an inquiry data. Inquiry Id:INQ1903040741001', 'HHIADMIN1903020950212'),
(86, 'LOG1903160905141', '2019-03-16 21:05:14', 'ivan', 'SUPERADMIN', 'Archive jobseeker file data. Jobseeker Id:JOBSEEKER1903160236543', 'HHIADMIN1903020950212'),
(87, 'LOG1903160905243', '2019-03-16 21:05:24', 'ivan', 'SUPERADMIN', 'Archive jobseeker file data. Jobseeker Id:JOBSEEKER1903050905430', 'HHIADMIN1903020950212'),
(88, 'LOG1903160936200', '2019-03-16 21:36:20', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131108412', 'HHIADMIN1903020950212'),
(89, 'LOG1903160941076', '2019-03-16 21:41:07', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131126407', 'HHIADMIN1903020950212'),
(90, 'LOG1903160941359', '2019-03-16 21:41:35', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131126407', 'HHIADMIN1903020950212'),
(91, 'LOG1903160941594', '2019-03-16 21:41:59', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131126407', 'HHIADMIN1903020950212'),
(92, 'LOG1903160943078', '2019-03-16 21:43:07', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131126407', 'HHIADMIN1903020950212'),
(93, 'LOG1903160943530', '2019-03-16 21:43:53', 'ivan', 'SUPERADMIN', 'Archive client file data. Client Id:CLIENT1903131126407', 'HHIADMIN1903020950212'),
(94, 'LOG1903210730046', '2019-03-21 07:30:04', 'ivan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(95, 'LOG1903210730446', '2019-03-21 07:30:44', 'ivan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(96, 'LOG1903210730556', '2019-03-21 07:30:55', 'juan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(97, 'LOG1903211105409', '2019-03-21 11:05:40', '', '', 'Add new event EVENT1903211058584', 'HHIADMIN1903020950212'),
(98, 'LOG1903211107513', '2019-03-21 11:07:51', '', '', 'Update Event information for event: EVENT1903211058584', 'HHIADMIN1903020950212'),
(99, 'LOG1903211109498', '2019-03-21 11:09:49', '', '', 'Add new event EVENT1903211107548', 'HHIADMIN1903020950212'),
(100, 'LOG1903211110179', '2019-03-21 11:10:17', '', '', 'Update Event information for event: EVENT1903211107548', 'HHIADMIN1903020950212'),
(101, 'LOG1903211110389', '2019-03-21 11:10:38', '', '', 'Event has been deleted EVENT1903211107548', 'HHIADMIN1903020950212'),
(102, 'LOG1903211111072', '2019-03-21 11:11:07', '', '', 'Add new event EVENT1903211110386', 'HHIADMIN1903020950212'),
(103, 'LOG1903211111255', '2019-03-21 11:11:25', '', '', 'Event has been deleted EVENT1903120347332', 'HHIADMIN1903020950212'),
(104, 'LOG1903211112397', '2019-03-21 11:12:39', '', '', 'Add new event EVENT1903211112055', 'HHIADMIN1903020950212'),
(105, 'LOG1903211113186', '2019-03-21 11:13:18', '', '', 'Update Event information for event: EVENT1903211112055', 'HHIADMIN1903020950212'),
(106, 'LOG1903211113407', '2019-03-21 11:13:40', '', '', 'Update Event information for event: EVENT1903211110386', 'HHIADMIN1903020950212'),
(107, 'LOG1903211114128', '2019-03-21 11:14:12', '', '', 'Event has been deleted EVENT1903211058584', 'HHIADMIN1903020950212'),
(108, 'LOG1903211115386', '2019-03-21 11:15:38', '', '', 'Event has been deleted EVENT1903211110386', 'HHIADMIN1903020950212'),
(109, 'LOG1903211115580', '2019-03-21 11:15:58', '', '', 'Add new event EVENT1903211115387', 'HHIADMIN1903020950212'),
(110, 'LOG1903211116332', '2019-03-21 11:16:33', '', '', 'Event has been deleted EVENT1903141216091', 'HHIADMIN1903020950212'),
(111, 'LOG1903211116513', '2019-03-21 11:16:51', '', '', 'Event has been deleted EVENT1903130847054', 'HHIADMIN1903020950212'),
(112, 'LOG1903211116567', '2019-03-21 11:16:56', '', '', 'Event has been deleted EVENT1903130835422', 'HHIADMIN1903020950212'),
(113, 'LOG1903211117120', '2019-03-21 11:17:12', '', '', 'Event has been deleted EVENT1903120315573', 'HHIADMIN1903020950212'),
(114, 'LOG1903211117360', '2019-03-21 11:17:36', '', '', 'Update Event information for event: EVENT1903211115387', 'HHIADMIN1903020950212'),
(115, 'LOG1903211121135', '2019-03-21 11:21:13', 'juan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(116, 'LOG1903211126014', '2019-03-21 11:26:01', '', '', 'Update Event information for event: EVENT1903211115387', 'HHIADMIN1903020950212'),
(117, 'LOG1903211126437', '2019-03-21 11:26:43', '', '', 'Add new event EVENT1903211126031', 'HHIADMIN1903020950212'),
(118, 'LOG1903211155208', '2019-03-21 11:55:20', 'juan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(119, 'LOG1903211155563', '2019-03-21 11:55:56', 'juan', 'SUPERADMIN', 'Logout Successful', 'HHIADMIN1903020950212'),
(120, 'LOG1903211155595', '2019-03-21 11:55:59', 'barry', 'ADMIN', 'Login Successful', 'HHIADMIN1903130215504'),
(121, 'LOG1903211158137', '2019-03-21 11:58:13', 'barry', 'ADMIN', 'Add new jobseeker detail Jobseeker Id: JOBSEEKER1903211157483', 'HHIADMIN1903130215504'),
(122, 'LOG1903211201074', '2019-03-21 12:01:07', 'barry', 'ADMIN', 'Add new client detail Client Id: CLIENT1903211200343', 'HHIADMIN1903130215504'),
(123, 'LOG1903211216294', '2019-03-21 12:16:29', 'barry', 'ADMIN', 'Logout Successful', 'HHIADMIN1903130215504'),
(124, 'LOG1903211216347', '2019-03-21 12:16:34', 'juan', 'SUPERADMIN', 'Login Successful', 'HHIADMIN1903020950212'),
(125, 'LOG1903211220467', '2019-03-21 12:20:46', '', '', 'Add new event EVENT1903211216341', 'HHIADMIN1903020950212'),
(126, 'LOG1903211221379', '2019-03-21 12:21:37', '', '', 'Add new event EVENT1903211220471', 'HHIADMIN1903020950212'),
(127, 'LOG1903211226024', '2019-03-21 12:26:02', '', '', 'Update Event information for event: EVENT1903211115387', 'HHIADMIN1903020950212'),
(128, 'LOG1903211226100', '2019-03-21 12:26:10', '', '', 'Event has been deleted EVENT1903211115387', 'HHIADMIN1903020950212'),
(129, 'LOG1903211226375', '2019-03-21 12:26:37', '', '', 'Add new event EVENT1903211226107', 'HHIADMIN1903020950212');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_messages`
--
CREATE TABLE `tbl_messages` (
`message_id` int(11) NOT NULL,
`message_compo_id` varchar(45) NOT NULL,
`sender_id` varchar(45) NOT NULL,
`subject` varchar(45) NOT NULL,
`message_body` varchar(45) NOT NULL,
`date_send` varchar(45) NOT NULL,
`message_status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_messages`
--
INSERT INTO `tbl_messages` (`message_id`, `message_compo_id`, `sender_id`, `subject`, `message_body`, `date_send`, `message_status`) VALUES
(32, 'MSG1903110752370', 'HHIADMIN1903020950212', 'Applying for Java Developer', '<p>dadasdasdasddas<br></p>', '2019-03-11 07:52:37', 1),
(33, 'MSG1903110753268', 'HHIADMIN1903020950212', '2 people', '<p>s\r\nhere are many variations of passages of', '2019-03-11 07:53:26', 1),
(34, 'MSG1903110753263', 'HHIADMIN1903020950212', '2 people', '<p>s\r\nhere are many variations of passages of', '2019-03-11 07:53:26', 1),
(35, 'MSG1903110756057', 'HHIADMIN1903030257008', 'ivan', '<p>\r\nhere are many variations of passages of ', '2019-03-11 07:56:05', 1),
(36, 'MSG1903110756130', 'HHIADMIN1903020950212', '2 people', '<p>s\r\nhere are many variations of passages of', '2019-03-11 07:56:13', 1),
(37, 'MSG1903110844039', 'HHIADMIN1903020950212', 'sdfsdfsdfsdf', '<p>fsfdfsffsdfsdfsfsdfsdfsdfsdfsd</p>', '2019-03-11 08:44:03', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_message_files`
--
CREATE TABLE `tbl_message_files` (
`messagefile_id` int(11) NOT NULL,
`attachment` text NOT NULL,
`message_compo_id` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_message_files`
--
INSERT INTO `tbl_message_files` (`messagefile_id`, `attachment`, `message_compo_id`) VALUES
(41, 'FINAL_CHAPTER4.docx', 'MSG1903110752370'),
(42, 'FINAL_CHAPTER1.docx', 'MSG1903110753268'),
(43, 'FINAL_CHAPTER2.docx', 'MSG1903110753268'),
(44, 'FINAL_CHAPTER3.docx', 'MSG1903110753268'),
(45, 'FINAL_CHAPTER4.docx', 'MSG1903110753268'),
(46, 'FINAL_CHAPTER5.docx', 'MSG1903110753268'),
(47, 'FINAL_CHAPTER1.docx', 'MSG1903110753263'),
(48, 'FINAL_CHAPTER2.docx', 'MSG1903110753263'),
(49, 'FINAL_CHAPTER3.docx', 'MSG1903110753263'),
(50, 'FINAL_CHAPTER4.docx', 'MSG1903110753263'),
(51, 'FINAL_CHAPTER5.docx', 'MSG1903110753263'),
(52, 'FINAL_CHAPTER2.docx', 'MSG1903110756057'),
(53, 'FINAL_CHAPTER1.docx', 'MSG1903110756130'),
(54, 'FINAL_CHAPTER2.docx', 'MSG1903110756130'),
(55, 'FINAL_CHAPTER3.docx', 'MSG1903110756130'),
(56, 'FINAL_CHAPTER4.docx', 'MSG1903110756130'),
(57, 'FINAL_CHAPTER5.docx', 'MSG1903110756130'),
(58, 'CE - Angular JS.docx', 'MSG1903110844039'),
(59, 'JD and Q.docx', 'MSG1903110844039'),
(60, 'Manpower Request Form.xlsm', 'MSG1903110844039'),
(61, 'Man-Power-Request-Form.xlsm', 'MSG1903110844039');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_message_recipients`
--
CREATE TABLE `tbl_message_recipients` (
`messagerecipient_id` int(11) NOT NULL,
`recipient_id` varchar(45) NOT NULL,
`recipient_message_status` int(11) NOT NULL,
`message_compo_id` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_message_recipients`
--
INSERT INTO `tbl_message_recipients` (`messagerecipient_id`, `recipient_id`, `recipient_message_status`, `message_compo_id`) VALUES
(41, 'HHIADMIN1903030257008', 1, 'MSG1903110752370'),
(42, 'HHIADMIN1903030257008', 1, 'MSG1903110753268'),
(43, 'HHIADMIN1903050926412', 1, 'MSG1903110753268'),
(44, 'HHIADMIN1903030257008', 1, 'MSG1903110753263'),
(45, 'HHIADMIN1903050926412', 1, 'MSG1903110753263'),
(46, 'HHIADMIN1903020950212', 1, 'MSG1903110756057'),
(47, 'HHIADMIN1903030257008', 1, 'MSG1903110756130'),
(48, 'HHIADMIN1903050926412', 1, 'MSG1903110756130'),
(49, 'HHIADMIN1903030257008', 1, 'MSG1903110844039');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
ADD PRIMARY KEY (`admin_id`);
--
-- Indexes for table `tbl_clients`
--
ALTER TABLE `tbl_clients`
ADD PRIMARY KEY (`client_id`);
--
-- Indexes for table `tbl_events`
--
ALTER TABLE `tbl_events`
ADD PRIMARY KEY (`event_id`);
--
-- Indexes for table `tbl_inquiries`
--
ALTER TABLE `tbl_inquiries`
ADD PRIMARY KEY (`inquiries_id`);
--
-- Indexes for table `tbl_jobseekers`
--
ALTER TABLE `tbl_jobseekers`
ADD PRIMARY KEY (`jobseeker_id`);
--
-- Indexes for table `tbl_logs`
--
ALTER TABLE `tbl_logs`
ADD PRIMARY KEY (`log_id`);
--
-- Indexes for table `tbl_messages`
--
ALTER TABLE `tbl_messages`
ADD PRIMARY KEY (`message_id`);
--
-- Indexes for table `tbl_message_files`
--
ALTER TABLE `tbl_message_files`
ADD PRIMARY KEY (`messagefile_id`);
--
-- Indexes for table `tbl_message_recipients`
--
ALTER TABLE `tbl_message_recipients`
ADD PRIMARY KEY (`messagerecipient_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `tbl_clients`
--
ALTER TABLE `tbl_clients`
MODIFY `client_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `tbl_events`
--
ALTER TABLE `tbl_events`
MODIFY `event_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `tbl_inquiries`
--
ALTER TABLE `tbl_inquiries`
MODIFY `inquiries_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `tbl_jobseekers`
--
ALTER TABLE `tbl_jobseekers`
MODIFY `jobseeker_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_logs`
--
ALTER TABLE `tbl_logs`
MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=130;
--
-- AUTO_INCREMENT for table `tbl_messages`
--
ALTER TABLE `tbl_messages`
MODIFY `message_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
--
-- AUTO_INCREMENT for table `tbl_message_files`
--
ALTER TABLE `tbl_message_files`
MODIFY `messagefile_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;
--
-- AUTO_INCREMENT for table `tbl_message_recipients`
--
ALTER TABLE `tbl_message_recipients`
MODIFY `messagerecipient_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;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 */;
| true |
0c06bd6ef3865e2b9139622d534c6af0c39a13c0 | SQL | telmengedar/StreamRC | /RPG/Shops/fullshopitem.sql | UTF-8 | 247 | 2.953125 | 3 | [
"Unlicense"
] | permissive | CREATE VIEW fullshopitem AS
SELECT shopitem.itemid, shopitem.quantity, shopitem.discount, item.name, item.type, item.target, item.levelrequirement, item.armor, item.damage, item.countable
FROM shopitem
INNER JOIN item ON item.id=shopitem.itemid | true |
9886b3fe7b52eca44d44394e4c4d7140d96a0f94 | SQL | Beryl1020/SQL | /30link/data require/data require-微销数据 for永智.sql | UTF-8 | 6,113 | 3.703125 | 4 | [] | no_license | SELECT
f.fa_id 主站id,
f.crm_name 客户姓名,
f.fia_id 投顾id,
f.fname 投顾姓名,
f.submit_time 流转时间,
f.jhzj 激活资金,
f.net_in 后端净入金,
f.jye 后端交易额,
f.sxf 后端手续费,
f.sr + f.znj + f.sxf 后端收入,
g.net_assets 净资产
FROM
(
SELECT
e.*,
nvl(sum(CASE WHEN changetype = '8'
THEN -amount END), 0) znj,
nvl(sum(CASE WHEN changetype IN (9, 10)
THEN -amount END), 0) sr
FROM
(
SELECT
c.*,
sum(d.contqty) jye,
sum(d.contqty) * 0.00065 sxf
FROM
(
SELECT
a.fa_id,
a.firm_id,
a.crm_name,
a.fia_id,
a.fname,
a.submit_time,
a.PMEC_NET_VALUE_SUB + a.PMEC_NET_IN_SUB jhzj,
sum(CASE WHEN b.inorout = 'A'
THEN b.inoutmoney
ELSE -b.inoutmoney END) net_in
FROM info_silver.ods_crm_transfer_record a
LEFT JOIN silver_njs.history_transfer@silver_std b
ON a.firm_id = b.firmid AND b.realdate > a.submit_time
WHERE a.fgroup_id IN (112, 113, 114, 106) AND fia_id != 154 AND a.process IN (5, 6)
GROUP BY a.fa_id, a.firm_id, a.crm_name, a.fia_id, a.fname, a.submit_time,
a.PMEC_NET_VALUE_SUB + a.PMEC_NET_IN_SUB
) c
LEFT JOIN info_silver.ods_history_deal d ON c.firm_id = d.firmid AND d.trade_time > c.submit_time
GROUP BY c.fa_id, c.firm_id, c.crm_name, c.fia_id, c.fname, c.submit_time, c.jhzj, c.net_in
) e LEFT JOIN silver_njs.pmec_zj_flow@silver_std f ON e.firm_id = f.loginaccount AND f.createdate > e.submit_time
GROUP BY e.fa_id, e.firm_id, e.crm_name, e.fia_id, e.fname, e.submit_time, e.jhzj, e.net_in, e.jye, e.sxf
) f LEFT JOIN silver_njs.tb_silver_data_center@silver_std g ON f.firm_id = g.firmid
WHERE trunc(f.submit_time) <= sysdate - 1 AND g.hdate = to_char(sysdate - 1, 'yyyymmdd')
------------------------------------------------------------------------------------------------------------------------
SELECT
b.user_id AS 主站id,
b.real_name AS 客户姓名,
a.fia_id AS 前端投顾id,
c.name AS 前端投顾姓名,
c.group_id AS 前端投顾组别,
a.submit_time AS 流转时间,
a.hht_net_value_sub + a.hht_net_in_sub AS 激活资金,
aa.后端净入金,
bb.后端交易额,
cc.net_zcmoney AS 后端净资产,
dd.后端手续费,
nvl(ee.后端头寸加点差, 0) + nvl(ee.后端滞纳金, 0) + nvl(dd.后端手续费, 0) AS 后端收入
FROM silver_consult.tb_crm_transfer_record@consul_std a
JOIN info_silver.dw_user_account b
ON a.user_id = b.crm_user_id
AND b.partner_id = 'hht' AND a.partnerid = 'hht'
JOIN info_silver.tb_crm_ia c ON a.fia_id = c.id
AND c.group_id IN (112, 113, 114)
LEFT JOIN
(SELECT
a1.user_id,
sum(CASE WHEN a3.inorout = 'A'
THEN a3.inoutmoney
WHEN a3.inorout = 'B'
THEN -a3.inoutmoney END) AS 后端净入金
FROM silver_consult.tb_crm_transfer_record@consul_std a1
JOIN info_silver.dw_user_account a2
ON a1.user_id = a2.crm_user_id
AND a2.partner_id = 'hht' AND a1.partnerid = 'hht'
JOIN silver_njs.history_transfer@silver_std a3
ON a2.firm_id = a3.firmid
AND a3.realdate > a1.submit_time
WHERE a1.valid = 1 AND a1.process IN (5, 6)
GROUP BY a1.user_id) aa
ON a.user_id = aa.user_id
LEFT JOIN
(SELECT
a1.user_id,
sum(a3.contqty) AS 后端交易额
FROM silver_consult.tb_crm_transfer_record@consul_std a1
JOIN info_silver.dw_user_account a2
ON a1.user_id = a2.crm_user_id
AND a2.partner_id = 'hht' AND a1.partnerid = 'hht'
JOIN info_silver.ods_history_deal a3
ON a2.firm_id = a3.firmid
AND a3.trade_time > a1.submit_time
WHERE a1.valid = 1 AND a1.process IN (5, 6)
GROUP BY a1.user_id) bb
ON a.user_id = bb.user_id
LEFT JOIN
info_silver.ods_order_zcmoney cc
ON b.firm_id = cc.firm_id
AND cc.fdate = to_char(sysdate - 1, 'yyyymmdd')
LEFT JOIN
(SELECT
a1.user_id,
sum(a3.trade_price * a3.weight) * 0.00065 AS 后端手续费
FROM silver_consult.tb_crm_transfer_record@consul_std a1
JOIN info_silver.dw_user_account a2
ON a1.user_id = a2.crm_user_id
AND a2.partner_id = 'hht' AND a1.partnerid = 'hht'
JOIN info_silver.tb_nsip_t_filled_order a3
ON a2.firm_id = a3.trader_id
AND a3.trade_time > a1.submit_time
WHERE a1.valid = 1 AND a1.process IN (5, 6)
GROUP BY a1.user_id) dd
ON a.user_id = dd.user_id
LEFT JOIN
(SELECT
a1.user_id,
sum(CASE WHEN a3.type = 7
THEN a3.amount END) AS 后端滞纳金,
sum(CASE WHEN a3.type IN (5, 6)
THEN -a3.amount END) AS 后端头寸加点差
FROM silver_consult.tb_crm_transfer_record@consul_std a1
JOIN info_silver.dw_user_account a2
ON a1.user_id = a2.crm_user_id
AND a2.partner_id = 'hht' AND a1.partnerid = 'hht'
JOIN NSIP_ACCOUNT.tb_nsip_account_funds_bill@LINK_NSIP_ACCOUNT a3
ON a2.firm_id = a3.fund_id
AND a3.create_time > a1.submit_time
WHERE a1.valid = 1 AND a1.process IN (5, 6)
GROUP BY a1.user_id) ee
ON a.user_id = ee.user_id
WHERE to_char(a.submit_time, 'yyyymmdd') between '20170424' and to_char(sysdate-1,'yyyymmdd')
AND a.process IN (5, 6) AND a.valid = 1
SELECT *
FROM silver_consult.tb_crm_transfer_record@consul_std
WHERE to_char(submit_time, 'yyyymmdd') >= 20170424
| true |
aeb24b0e3515f9928fe4e75f40d15db737823ff1 | SQL | zack-001/Mirelda-Comitancillo | /dental (6).sql | UTF-8 | 17,365 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 24-02-2020 a las 08:23:38
-- Versión del servidor: 5.7.23
-- Versión de PHP: 5.6.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `dental`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `abono`
--
DROP TABLE IF EXISTS `abono`;
CREATE TABLE IF NOT EXISTS `abono` (
`idAbono` int(11) NOT NULL AUTO_INCREMENT,
`cantidad` double NOT NULL,
`idEdoCuenta` int(11) NOT NULL,
`idcliente` int(11) NOT NULL,
`fecha` varchar(20) NOT NULL,
`razon` varchar(100) DEFAULT NULL,
PRIMARY KEY (`idAbono`),
KEY `idEdoCuenta` (`idEdoCuenta`),
KEY `idcliente` (`idcliente`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `abono`
--
INSERT INTO `abono` (`idAbono`, `cantidad`, `idEdoCuenta`, `idcliente`, `fecha`, `razon`) VALUES
(18, 130, 34, 19, '07-02-2020', NULL),
(19, 200, 35, 14, '07-02-2020', NULL),
(20, 150, 36, 13, '07-02-2020', NULL),
(21, 77, 13, 12, '11-02-2020', NULL),
(22, 55, 13, 12, '11-02-2020', NULL),
(23, 11, 13, 12, '11-02-2020', NULL),
(24, 77, 13, 12, '11-02-2020', 'CITA_13'),
(25, 30000, 13, 12, '11-02-2020', '19'),
(26, 200, 13, 12, '11-02-2020', '19'),
(27, 155, 13, 12, '11-02-2020', 'CITA_12'),
(28, 45, 13, 12, '11-02-2020', 'CITA_12'),
(29, 60, 13, 12, '11-02-2020', '18'),
(30, 100, 39, 22, '17-02-2020', 'CITA_62'),
(31, 120, 39, 22, '17-02-2020', 'CITA_62'),
(32, 50, 39, 22, '17-02-2020', 'CITA_62'),
(33, 100, 39, 22, '17-02-2020', '43'),
(34, 120, 13, 12, '19-02-2020', 'CITA_13'),
(35, 3, 13, 12, '19-02-2020', 'CITA_13'),
(36, 77, 13, 12, '19-02-2020', 'CITA_14'),
(37, 53, 13, 12, '19-02-2020', 'CITA_14'),
(38, 70, 13, 12, '19-02-2020', 'CITA_14'),
(39, 270, 13, 12, '19-02-2020', '22');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cita`
--
DROP TABLE IF EXISTS `cita`;
CREATE TABLE IF NOT EXISTS `cita` (
`idcita` int(11) NOT NULL AUTO_INCREMENT,
`idCliente` int(11) NOT NULL,
`fecha` varchar(45) DEFAULT NULL,
`prox_cita` varchar(45) DEFAULT NULL,
`total_pagar` double NOT NULL,
`observaciones` blob NOT NULL,
`estado` varchar(20) NOT NULL,
PRIMARY KEY (`idcita`),
KEY `idCliente` (`idCliente`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `cita`
--
INSERT INTO `cita` (`idcita`, `idCliente`, `fecha`, `prox_cita`, `total_pagar`, `observaciones`, `estado`) VALUES
(12, 12, '2020-01-16', '', 200, 0x4e494e47554e41, ''),
(13, 12, '2020-01-16', '2020-02-12', 200, 0x4c494d5049455a41, ''),
(14, 12, '2020-01-16', '2020-01-24', 200, 0x67746e6666686a6e, ''),
(15, 12, '2020-01-16', '2020-01-21', 300, 0x6e6868756e75686e, ''),
(16, 13, '2020-01-20', '', 200, 0x5245414c49434520554e41204c494d5049455a4120424f43414c, ''),
(17, 13, '2020-01-22', '', 200, 0x2d2d2d, ''),
(18, 12, '2020-01-21', '', 200, 0x6672766564667664, ''),
(19, 14, '2020-01-21', '', 0, 0x6b6969696b696a6875757568, ''),
(20, 15, '2020-01-21', '', 0, 0x414c2050414349454e5445205345204c45205245414c495a41524120554e41204c494d5049455a4120424f43414c20594120515545204355454e544120434f4e20554e4120494e4645434349c3934e20454e204c415320454e43494153, ''),
(21, 13, '2020-01-21', '', 0, 0x414c2050414349454e5445204d4152494f205345204c452056412041205245414c495a415220554e41204c494d5049455a4120424f43414c, ''),
(22, 17, '2020-01-21', '', 0, 0x4c494d5049455a4120424f43414c, ''),
(23, 17, '2020-01-21', '2020-02-12', 300, 0x5345204c45205245414c495a4f20554e4120524144494f47524146c38d41205041524120494e49434941522054524154414d49454e544f, ''),
(24, 14, '2020-02-03', '2020-02-11', 200, 0x6e756e67756e61, 'ACTIVO'),
(25, 13, '2020-02-09', '', 200, 0x6e696e67756e61, 'ACTIVO'),
(26, 12, '2020-02-03', '', 200, 0x6e696e67756e61, 'ACTIVO'),
(27, 12, '2020-02-03', '', 100, 0x6e696e67756e6f, 'PENDIENTE'),
(28, 12, '2020-02-11', '', 200, 0x6c696d7069657a6120627563616c, 'ACTIVO'),
(29, 14, '2020-02-05', '', 200, 0x6c696d7069657a6120627563616c, 'TERMINADO'),
(30, 14, '2020-02-06', '', 100, 0x6c696d7069657a61, 'TERMINADO'),
(31, 17, '2020-02-06', '', 150, 0x7265766973696f6e, 'PENDIENTE'),
(32, 18, '2020-02-06', '', 77, 0x7265766973696f6e, 'PENDIENTE'),
(35, 19, '2020-02-06', '', 156, 0x4e494e47554e41, 'PENDIENTE'),
(36, 19, '2020-02-07', '', 130, 0x6e696e67756e61, 'ACTIVO'),
(37, 14, '2020-02-07', '', 200, 0x4e494e47554e50, 'PENDIENTE'),
(38, 13, '2020-02-07', '', 150, 0x6e696e67756e61, 'FINALIZADO'),
(39, 13, '2020-02-09', '', 200, 0x6e696e67756e61, 'PENDIENTE'),
(40, 15, '2020-02-09', '', 200, 0x4e494e47554e41, 'PENDIENTE'),
(41, 15, '2020-02-09', '', 200, 0x4e494e47554e41, 'PENDIENTE'),
(42, 20, '2020-02-09', '', 150, 0x4e494e47554e4f, 'PENDIENTE'),
(43, 20, '2020-02-09', '', 150, 0x4e494e47554e4f, 'PENDIENTE'),
(44, 20, '2020-02-13', '', 8, 0x6e696e67756e61, 'PENDIENTE'),
(45, 20, '2020-02-13', '', 8, 0x6e696e67756e61, 'PENDIENTE'),
(46, 18, '2020-02-09', '', 150, 0x6e696e67756e61, 'PENDIENTE'),
(47, 18, '2020-02-09', '', 150, 0x6e696e67756e61, 'PENDIENTE'),
(48, 12, '2020-02-13', '', 150, 0x4e494e47554e41, 'PENDIENTE'),
(51, 21, '2020-02-09', '', 123, 0x4e494e47554e41, 'ACTIVO'),
(52, 21, '2020-02-10', '', 300, 0x4e494e47554e41, 'PENDIENTE'),
(53, 21, '2020-02-10', '', 133, 0x6e696e67756e61, 'PENDIENTE'),
(54, 21, '2020-02-10', '', 133, 0x4e494e47554e41, 'PENDIENTE'),
(55, 21, '2020-02-10', '', 120, 0x4e494e47554e4f, 'PENDIENTE'),
(56, 21, '2020-02-10', '', 120, 0x4e494e47554e4f, 'PENDIENTE'),
(57, 21, '2020-02-10', '', 134, 0x4e494e47, 'PENDIENTE'),
(58, 21, '2020-02-10', '', 134, 0x4e494e47, 'PENDIENTE'),
(59, 21, '2020-02-10', '', 200, 0x4e494e, 'ACTIVO'),
(60, 12, '2020-02-12', '', 300, 0x4e494e47554e41, 'PENDIENTE'),
(61, 13, '2020-02-17', '', 200, 0x656c2070616369656e74652070726573656e7461206d6f6c6573746961732064656e74616c6573, 'PENDIENTE'),
(62, 22, '2020-02-17', '', 200, 0x455354452050414349454e54452050524553454e54412050524f424c454d415320454e204c415320454e43494153, 'ACTIVO'),
(63, 23, '2020-02-20', '', 100, 0x4e494e47554e41, 'ACTIVO'),
(64, 23, '2020-02-21', '', 150, 0x4e494e47554e41, 'ACTIVO'),
(65, 23, '2020-02-23', '', 200, 0x4e494e47554e41, 'ACTIVO');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cliente`
--
DROP TABLE IF EXISTS `cliente`;
CREATE TABLE IF NOT EXISTS `cliente` (
`idCliente` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(250) NOT NULL,
`nombreTutor` varchar(250) NOT NULL,
`fecha_ingreso` varchar(25) DEFAULT NULL,
`sexo` varchar(45) NOT NULL,
`direccion` varchar(300) NOT NULL,
`telefono` varchar(10) NOT NULL,
`alergias` text NOT NULL,
`tipoSangre` varchar(100) NOT NULL,
`telefonoTutor` varchar(10) NOT NULL,
`parentezco` varchar(100) NOT NULL,
`idUsuario` int(11) NOT NULL,
`edad` date DEFAULT NULL,
PRIMARY KEY (`idCliente`),
KEY `idUsuario` (`idUsuario`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `cliente`
--
INSERT INTO `cliente` (`idCliente`, `nombre`, `nombreTutor`, `fecha_ingreso`, `sexo`, `direccion`, `telefono`, `alergias`, `tipoSangre`, `telefonoTutor`, `parentezco`, `idUsuario`, `edad`) VALUES
(12, 'KARLA STEFANY CABRERA', 'ABRIL MONTES DE OCA OLIVERA', '2020-01-16', 'Femenino', 'AV.CENTENARIO #32', '9711570936', 'NAPROXENO', 'O positivo', '9716547687', 'MADRE', 13, NULL),
(13, 'ARIS DANILO LOPEZ', 'ISIDRO LOPEZ RUIZ', '2020-01-20', 'Masculino', 'AV. LA PAZ UNION HIDALGO', '9712345467', 'NAPROXENO', 'O positivo', '9712436578', 'PADRE', 14, NULL),
(14, 'PEPE PINEDA', 'OFELIA MTZ', '2020-01-21', 'Masculino', 'FRACC CRISTOBAL COLON', '9711234567', 'NINGUNA', 'O positivo', '9765432354', 'MADRE', 15, '1980-01-23'),
(15, 'CARLO MATINEZ', 'JOSE MORALEZ', '2020-01-21', 'Masculino', 'AV.LA PAZ JUCHITAN', '9714567645', 'NAPROXENO', 'O positivo', '9716547687', 'PADRE', 16, '2004-12-15'),
(17, 'MARIO MORALES RAMIREZ', 'MARIA JOSE RAMIREZ', '2020-01-21', 'Masculino', 'AV.LA PAZ JUCHITAN', '0', 'NINGUNA', 'A positivo', '971154679', 'MADRE', 18, '2008-01-08'),
(18, 'ENRIQUE LUIS MORALES', 'JOSEFA LUIS', '2020-01-21', 'Masculino', 'AV.PROGRESO', '0', 'NAPROXENO', 'B positivo', '9716547687', 'MADRE', 19, '2006-01-03'),
(19, 'PITA PEREZ', 'Karla Stefany Zapata Cabrera', '2020-02-06', 'Femenino', 'Prolongacion Allende, Colonia Lazaro Cardenas', '4531503830', 'NINGUNA', 'B negativo', '0000000000', 'MADRE', 20, '1998-07-08'),
(20, 'BENITA J.', 'Karla Stefany Zapata Cabrera', '2020-02-09', 'Femenino', 'Juchitan, Juchitan', '4531500000', '70000', 'B negativo', '0000000000', 'MADRE', 21, '2020-02-14'),
(21, 'Diana Cruz', 'Karla Stefany Zapata Cabrera', '2020-02-09', 'Femenino', 'Prolongacion Allende, Colonia Lazaro Cardenas', '4531509999', '70000', 'B positivo', '0000000000', 'HERMANA', 22, '1996-07-18'),
(22, 'MARIA PETRONILA ', 'PETRA', '2020-02-17', 'Femenino', 'AV.CENTENARIO #32', '0000000000', 'NINGUNA', 'A negativo', '9711235467', 'AMIGO', 23, '1997-01-06'),
(23, 'Ana Hernandez', 'Karla Stefany Zapata Cabrera', '2020-02-20', 'Femenino', 'AV.CENTENARIO #32', '9712020291', 'NINGUNA', 'B positivo', '9711235467', 'AMIGO', 24, '2020-02-13');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `edocuenta`
--
DROP TABLE IF EXISTS `edocuenta`;
CREATE TABLE IF NOT EXISTS `edocuenta` (
`idEdoCuenta` int(11) NOT NULL AUTO_INCREMENT,
`total_adecuado` double NOT NULL,
`cliente_idCliente` int(11) NOT NULL,
`tratamiento` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idEdoCuenta`),
KEY `cliente_idCliente` (`cliente_idCliente`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `edocuenta`
--
INSERT INTO `edocuenta` (`idEdoCuenta`, `total_adecuado`, `cliente_idCliente`, `tratamiento`) VALUES
(13, 6582, 12, 'LIMPIEZA'),
(21, 200, 14, 'LIMPIEZA'),
(22, 500, 14, 'LIMPIEZA'),
(23, 100, 15, 'LIMPIEZA'),
(24, 0, 17, 'LIMPIEZA'),
(25, 5150, 17, 'ORTODONCIA'),
(26, 400, 14, 'LIMPIEZA'),
(27, 350, 14, 'LIMPIEZA'),
(29, 400, 14, 'LIMPIEZA'),
(30, 40200, 14, 'LIMPIEZA'),
(33, 156, 19, 'CITA'),
(34, 0, 19, 'CITA'),
(35, 0, 14, 'CITA'),
(36, 200, 13, 'CITA'),
(38, 657, 21, NULL),
(39, 370, 22, NULL),
(40, 3110, 23, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `medico`
--
DROP TABLE IF EXISTS `medico`;
CREATE TABLE IF NOT EXISTS `medico` (
`idmedico` int(11) NOT NULL,
`nombre` varchar(250) NOT NULL,
`especialidad` varchar(250) NOT NULL,
PRIMARY KEY (`idmedico`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `medico`
--
INSERT INTO `medico` (`idmedico`, `nombre`, `especialidad`) VALUES
(1, 'MIRELDA OLIVERA', 'CIRUJANO');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `nota`
--
DROP TABLE IF EXISTS `nota`;
CREATE TABLE IF NOT EXISTS `nota` (
`idnota` int(11) NOT NULL AUTO_INCREMENT,
`fecha` date DEFAULT NULL,
`descripcion` text,
`idCliente` int(11) NOT NULL,
PRIMARY KEY (`idnota`),
KEY `idCliente` (`idCliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `receta`
--
DROP TABLE IF EXISTS `receta`;
CREATE TABLE IF NOT EXISTS `receta` (
`idReceta` int(11) NOT NULL AUTO_INCREMENT,
`medicamento` varchar(50) DEFAULT NULL,
`descripcion` tinytext,
`notas` tinytext,
`idValoracion` int(11) DEFAULT NULL,
PRIMARY KEY (`idReceta`),
KEY `fk_valoracion` (`idValoracion`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipotratamiento`
--
DROP TABLE IF EXISTS `tipotratamiento`;
CREATE TABLE IF NOT EXISTS `tipotratamiento` (
`idTipoTratamiento` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL,
`costo` double DEFAULT NULL,
`idmedico` int(11) NOT NULL,
PRIMARY KEY (`idTipoTratamiento`),
KEY `idmedico` (`idmedico`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `tipotratamiento`
--
INSERT INTO `tipotratamiento` (`idTipoTratamiento`, `descripcion`, `costo`, `idmedico`) VALUES
(4, 'LIMPIEZA', 200, 1),
(5, 'ORTODONCIA', 5000, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuario`
--
DROP TABLE IF EXISTS `usuario`;
CREATE TABLE IF NOT EXISTS `usuario` (
`idUsuario` int(11) NOT NULL AUTO_INCREMENT,
`nick` varchar(150) NOT NULL,
`pass` varchar(15) NOT NULL,
`nombre` varchar(200) NOT NULL,
`tipo` varchar(50) NOT NULL,
PRIMARY KEY (`idUsuario`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `usuario`
--
INSERT INTO `usuario` (`idUsuario`, `nick`, `pass`, `nombre`, `tipo`) VALUES
(1, 'mirelda12@hotmail.com', '12345', 'Mirelda', 'Administrador'),
(13, 'KARLA', '1234', 'KARLA STEFANY CABRERA', 'Usuario'),
(14, 'ARIS', '123', 'ARIS DANILO LOPEZ', 'Usuario'),
(15, 'pepe10', '1234', 'PEPE PINEDA', 'Usuario'),
(16, 'CARLO', '1234', 'CARLO MATINEZ', 'Usuario'),
(18, 'MARIO1', '123', 'MARIO MORALES RAMIREZ', 'Usuario'),
(19, 'ENRIQUE', '123', 'ENRIQUE LUIS MORALES', 'Usuario'),
(20, 'pita10', '1234', 'PITA PEREZ', 'Usuario'),
(21, 'benita', '12345', 'BENITA J.', 'Usuario'),
(22, 'diana', '12345', 'Diana Cruz', 'Usuario'),
(23, 'MARIA', '123', 'MARIA PETRONILA ', 'Usuario'),
(24, 'AN10', '1234', 'Ana Hernandez', 'Usuario');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `valoracion`
--
DROP TABLE IF EXISTS `valoracion`;
CREATE TABLE IF NOT EXISTS `valoracion` (
`idValoracion` int(11) NOT NULL AUTO_INCREMENT,
`idTipoTratamieto` int(11) NOT NULL,
`organosDentarios` text NOT NULL,
`cantidad` int(11) NOT NULL,
`total` double NOT NULL,
`idcita` int(11) NOT NULL,
`fecha` varchar(20) NOT NULL,
PRIMARY KEY (`idValoracion`),
KEY `idcita` (`idcita`),
KEY `idTipoTratamieto` (`idTipoTratamieto`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `valoracion`
--
INSERT INTO `valoracion` (`idValoracion`, `idTipoTratamieto`, `organosDentarios`, `cantidad`, `total`, `idcita`, `fecha`) VALUES
(18, 4, '', 1, 60, 13, '16-01-2020'),
(19, 4, '', 200, 32000, 13, '16-01-2020'),
(20, 4, '', 3, 600, 14, '16-01-2020'),
(21, 4, '', 3, 420, 14, '16-01-2020'),
(22, 4, '', 5, 500, 12, '16-01-2020'),
(23, 4, '', 1, 150, 15, '16-01-2020'),
(24, 4, '', 5, 1000, 14, '16-01-2020'),
(25, 4, '', 2, 300, 15, '16-01-2020'),
(26, 4, '', 2, 300, 18, '21-01-2020'),
(27, 4, 'TODOS', 1, 200, 19, '21-01-2020'),
(28, 4, 'TODOS', 2, 300, 19, '21-01-2020'),
(29, 4, 'TODOS', 1, 100, 20, '21-01-2020'),
(30, 4, 'TODOS', 1, 150, 22, '21-01-2020'),
(31, 5, 'TODOS', 1, 5000, 23, '21-01-2020'),
(32, 4, '1', 1, 200, 24, '02-02-2020'),
(33, 4, '1', 1, 150, 24, '03-02-2020'),
(34, 4, '1', 2, 300, 26, '03-02-2020'),
(35, 4, 'TODOS', 1, 200, 29, '05-02-2020'),
(36, 4, 'TODOS', 200, 40000, 29, '05-02-2020'),
(41, 4, 'TODOS', 1, 200, 59, '10-02-2020'),
(42, 4, 'TODOS', 1, 175, 28, '11-02-2020'),
(43, 4, 'TODOS', 1, 200, 62, '17-02-2020'),
(44, 5, 'TODOS', 1, 1050, 63, '20-02-2020'),
(45, 4, 'TODOS', 1, 200, 63, '20-02-2020'),
(48, 5, 'TODOS', 1, 1000, 17, '2020-02-03'),
(49, 4, 'TODOS', 1, 270, 64, '21-02-2020'),
(50, 4, 'TODOS', 1, 340, 65, '23-02-2020');
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `abono`
--
ALTER TABLE `abono`
ADD CONSTRAINT `abono_ibfk_1` FOREIGN KEY (`idEdoCuenta`) REFERENCES `edocuenta` (`idEdoCuenta`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `abono_ibfk_2` FOREIGN KEY (`idcliente`) REFERENCES `cliente` (`idCliente`);
--
-- Filtros para la tabla `cita`
--
ALTER TABLE `cita`
ADD CONSTRAINT `idCliente` FOREIGN KEY (`idCliente`) REFERENCES `cliente` (`idCliente`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `cliente`
--
ALTER TABLE `cliente`
ADD CONSTRAINT `idUsuario` FOREIGN KEY (`idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `edocuenta`
--
ALTER TABLE `edocuenta`
ADD CONSTRAINT `edocuenta_ibfk_1` FOREIGN KEY (`cliente_idCliente`) REFERENCES `cliente` (`idCliente`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `nota`
--
ALTER TABLE `nota`
ADD CONSTRAINT `nota_ibfk_1` FOREIGN KEY (`idCliente`) REFERENCES `cliente` (`idCliente`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `tipotratamiento`
--
ALTER TABLE `tipotratamiento`
ADD CONSTRAINT `tipotratamiento_ibfk_1` FOREIGN KEY (`idmedico`) REFERENCES `medico` (`idmedico`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Filtros para la tabla `valoracion`
--
ALTER TABLE `valoracion`
ADD CONSTRAINT `valoracion_ibfk_1` FOREIGN KEY (`idcita`) REFERENCES `cita` (`idcita`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `valoracion_ibfk_2` FOREIGN KEY (`idTipoTratamieto`) REFERENCES `tipotratamiento` (`idTipoTratamiento`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
3362bfa3b08166ade964da22d26ffa1af2108377 | SQL | babergma/module3 | /module-2/03_Joins/exercise-student/postgres/Exercises/13_directors_harry_potter.sql | UTF-8 | 278 | 3.765625 | 4 | [] | no_license | -- 13. The directors of the movies in the "Harry Potter Collection" (4 rows)
SELECT DISTINCT person_name
FROM movie m
JOIN collection c ON m.collection_id = c.collection_id
JOIN person p ON m.director_id = p.person_id
WHERE collection_name = 'Harry Potter Collection';
| true |
6d87cfd8cc2552a50ad6cf91075d49c9aab325d2 | SQL | YaleArchivesSpace/yams_data_auditing | /agents_and_subjects/linked_agent_resource_count.sql | UTF-8 | 1,557 | 3.34375 | 3 | [] | no_license | SELECT resource.title
, count(resource.title) as count
, 'person' as agent_type
FROM agent_person ap
LEFT JOIN linked_agents_rlshp lar on lar.agent_person_id = ap.id
LEFT JOIN resource on resource.id = lar.resource_id
LEFT JOIN user_defined ud on ud.resource_id = resource.id
WHERE lar.resource_id is not null
AND ud.string_2 is not null
GROUP BY resource.title
UNION ALL
SELECT resource.title
, count(resource.title) as count
, 'family' as agent_type
FROM agent_family af
LEFT JOIN linked_agents_rlshp lar on lar.agent_family_id = af.id
LEFT JOIN resource on resource.id = lar.resource_id
LEFT JOIN user_defined ud on ud.resource_id = resource.id
WHERE lar.resource_id is not null
AND ud.string_2 is not null
GROUP BY resource.title
UNION ALL
SELECT resource.title
, count(resource.title) as count
, 'corp' as agent_type
FROM agent_corporate_entity ace
LEFT JOIN linked_agents_rlshp lar on lar.agent_corporate_entity_id = ace.id
LEFT JOIN resource on resource.id = lar.resource_id
LEFT JOIN user_defined ud on ud.resource_id = resource.id
WHERE lar.resource_id is not null
AND ud.string_2 is not null
GROUP BY resource.title
UNION ALL
SELECT resource.title
, count(resource.title) as count
, 'software' as agent_type
FROM agent_software asw
LEFT JOIN linked_agents_rlshp lar on lar.agent_software_id = asw.id
LEFT JOIN resource on resource.id = lar.resource_id
LEFT JOIN user_defined ud on ud.resource_id = resource.id
WHERE lar.resource_id is not null
AND ud.string_2 is not null
GROUP BY resource.title
ORDER BY count desc | true |
14bd6ec2bdb2751e510482cb76d5f8d3510b896a | SQL | Anel13/Anel13project | /page.sql | UTF-8 | 3,828 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Май 21 2016 г., 12:42
-- Версия сервера: 10.1.13-MariaDB
-- Версия PHP: 5.5.34
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 */;
--
-- База данных: `page`
--
-- --------------------------------------------------------
--
-- Структура таблицы `image`
--
CREATE TABLE `image` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`title` text NOT NULL,
`text` text NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Дамп данных таблицы `image`
--
INSERT INTO `image` (`id`, `user_id`, `title`, `text`, `image`) VALUES
(9, 19, 'Aksu', 'lyalyalya', 'to.jpg'),
(10, 4, 'Rose', 'beautiful flower', 'rose.jpg');
-- --------------------------------------------------------
--
-- Структура таблицы `music`
--
CREATE TABLE `music` (
`id` int(11) DEFAULT NULL,
`name` text NOT NULL,
`music` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Дамп данных таблицы `music`
--
INSERT INTO `music` (`id`, `name`, `music`) VALUES
(NULL, 'jenn', '');
-- --------------------------------------------------------
--
-- Структура таблицы `posts`
--
CREATE TABLE `posts` (
`id` int(11) NOT NULL,
`title` text NOT NULL,
`text` text NOT NULL,
`img` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Дамп данных таблицы `posts`
--
INSERT INTO `posts` (`id`, `title`, `text`, `img`) VALUES
(12, 'sky', '..', 'sky.jpg'),
(13, 'dark', '...', 'three.jpg'),
(14, 'ggg', 'jjj', 'a.jpg');
-- --------------------------------------------------------
--
-- Структура таблицы `reg`
--
CREATE TABLE `reg` (
`id` int(11) NOT NULL,
`first_name` varchar(32) CHARACTER SET latin1 NOT NULL,
`last_name` varchar(32) CHARACTER SET latin1 NOT NULL,
`username` varchar(32) CHARACTER SET latin1 NOT NULL,
`password` varchar(32) CHARACTER SET latin1 NOT NULL,
`email` varchar(1024) CHARACTER SET latin1 NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Дамп данных таблицы `reg`
--
INSERT INTO `reg` (`id`, `first_name`, `last_name`, `username`, `password`, `email`, `status`) VALUES
(2, 'admin', 'admin', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@gmail.com', 0),
(4, 'Anel', 'Tt', 'Anel', '202cb962ac59075b964b07152d234b70', 'anel@gmail.com', 1),
(19, 'Dayana', 'T', 'Tezzy', '3546f4f788b7dae54f896f9a03ce6231', 'tezzy@gmail.com', 1);
--
-- Индексы сохранённых таблиц
--
--
-- Индексы таблицы `image`
--
ALTER TABLE `image`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `reg`
--
ALTER TABLE `reg`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `image`
--
ALTER TABLE `image`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT для таблицы `posts`
--
ALTER TABLE `posts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT для таблицы `reg`
--
ALTER TABLE `reg`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
/*!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 */;
| true |
65d6ec32a94cb5dd89fd2c17d9ee82c74fc6e0c9 | SQL | MayMeakes/hello-world | /shell/Tunning/OracleSQLTuningGuide.sql | UTF-8 | 1,575 | 3.671875 | 4 | [] | no_license | OracleSQLTuningGuide.sql
-------------------------------------
#SQLruningTimeOrder
set lines 200 pagesize 1000
col sql_id for a30
col child_number 99
col sql_text for a20
select sql_id,child_number,sql_text,elapsed_time/1000000/60 "execute_time(min)"
from (
select sql_id,child_number,sql_text,elapsed_time,cpu_time,disk_reads,
rank() over(order by elapsed_time desc) as elapsed_rank
from v$sql)
where elapsed_rank <= 10
/
#可以从使用绑定变量中获益的SQL语句
set lines 100 pagesize 1000
col sql_text for a30
with force_matches as
(select force_matching_signature,
count(*) matches,
max(sql_id ||child_number) max_sql_child,
dense_rank() over (order by count(*)desc) ranking
from v$sql
where force_matching_signature <> 0
and parsing_schema_name <> 'SYS'
group by force_matching_signature
having count(*)>5)
select sql_id,matches,parsing_schema_name schema,sql_text
from v$sql join force_matches
on (sql_id||child_number=max_sql_child)
where ranking<= 10
order by matches desc;
#使用存储过程减少应用与数据库的交互次数,减少响应时间
create function calc_discount (p_cust_id number)
RETURN number
is
select quantity_sold,amount_sold,prod_id
from sh.sales
where cust_id=p_cust_id;
v_total_discount NUMBER := 0;
BEGIN
FOR cust_row in cust_csr
loop
v_total_discount :=
v_total_discount
+ discountcalc (cust_row.quantity_sold,
cust_row.prod_id,
cust_row.amount_sold
);
END LOOP;
RETURN(v_total_discount);
END;
# | true |
a4313fb9dab2f6183a1152004b535ee63deb3bb4 | SQL | StarExec/StarExec | /sql/procedures/RunscriptErrors.sql | UTF-8 | 1,051 | 3.9375 | 4 | [
"MIT"
] | permissive | -- Description: This file contains all Runscript Error procedures
DROP PROCEDURE IF EXISTS RunscriptError //
CREATE PROCEDURE RunscriptError(IN node VARCHAR(32), IN jobPairId INT, IN stage INT)
BEGIN
SET @node_id := (
SELECT id
FROM nodes
WHERE name=node
);
INSERT INTO runscript_errors (node_id, job_pair_id)
VALUES (@node_id, jobPairId);
CALL UpdatePairStatus(jobPairId, 11);
CALL UpdateLaterStageStatuses(jobPairId, stage, 11);
CALL SetRunStatsForLaterStagesToZero(jobPairId, stage);
END //
DROP PROCEDURE IF EXISTS GetRunscriptErrorsCount //
CREATE PROCEDURE GetRunscriptErrorsCount(IN _begin TIMESTAMP, IN _end TIMESTAMP)
BEGIN
SELECT COUNT(*) as 'count'
FROM runscript_errors
WHERE time >= _begin
AND time <= _end;
END //
DROP PROCEDURE IF EXISTS GetRunscriptErrors //
CREATE PROCEDURE GetRunscriptErrors(IN _begin TIMESTAMP, IN _end TIMESTAMP)
BEGIN
SELECT name AS node, job_pair_id, time
FROM runscript_errors
JOIN nodes on nodes.id=node_id
WHERE time >= _begin
AND time <= _end;
END //
| true |
859b01f086f467aa77825b688f8ca0eb44ae7ad6 | SQL | thecmckenney/CSC301 | /sql/getProductId.sql | UTF-8 | 172 | 3.046875 | 3 | [] | no_license | SELECT productid FROM PRODUCTS
JOIN posts on products.title = posts.title and products.memberid = posts.memberid
WHERE posts.title = :title and posts.memberid = :memberid; | true |
09e7f8f1a7c7770028f23b0fecdaae239fc659a8 | SQL | MSR19/BDAD-FEUP-19 | /FEUP-BDAD-TRABALHO/Entrega3/int3.sql | UTF-8 | 277 | 3.21875 | 3 | [] | no_license | .mode columns
.headers on
.nullvalue NULL
SELECT Nome
FROM Pessoa,
Funcionario,
Horario
WHERE Pessoa.codigo = Funcionario.codigo AND
Funcionario.codigo = Horario.codigoFunc AND
Horario.dia = "20/01/2019"; | true |
52b873ab9a7a6aa7380eb27459498f9c0083b074 | SQL | jorgecocina/apimemoria | /sql/001 - estructura.sql | UTF-8 | 6,821 | 3.34375 | 3 | [] | no_license | --Se desactivan las llaves foraneas
set FOREIGN_KEY_CHECKS = 0;
--
-- Table structure for table `movements`
--
DROP TABLE IF EXISTS `movements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `movements` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`uri` varchar(255) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`method` varchar(15) DEFAULT NULL,
`date` date DEFAULT NULL,
`time` time DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `users_movements` (`user_id`),
CONSTRAINT `users_movements` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13423 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `price_ranges`
--
DROP TABLE IF EXISTS `price_ranges`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `price_ranges` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`service_type_id` int(11) DEFAULT NULL,
`price` varchar(100) DEFAULT NULL,
`level` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_price_ranges_service_types` (`service_type_id`),
CONSTRAINT `fk_price_ranges_service_types` FOREIGN KEY (`service_type_id`) REFERENCES `service_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `report_types`
--
DROP TABLE IF EXISTS `report_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(60) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `reports`
--
DROP TABLE IF EXISTS `reports`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `reports` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`report_types_id` int(11) NOT NULL,
`services_id` int(11) NOT NULL,
`x_position` double DEFAULT NULL,
`y_position` double DEFAULT NULL,
`price` int(11) DEFAULT NULL,
`quality` int(11) DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_reports_users1_idx` (`user_id`),
KEY `fk_reports_report_types1_idx` (`report_types_id`),
KEY `fk_reports_services1_idx` (`services_id`),
KEY `fk_reports_price_ranges` (`price`),
CONSTRAINT `fk_reports_price_ranges` FOREIGN KEY (`price`) REFERENCES `price_ranges` (`id`),
CONSTRAINT `fk_reports_report_types1` FOREIGN KEY (`report_types_id`) REFERENCES `report_types` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_reports_services1` FOREIGN KEY (`services_id`) REFERENCES `services` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_reports_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=12330 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `roles`
--
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `service_types`
--
DROP TABLE IF EXISTS `service_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `service_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(60) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `services`
--
DROP TABLE IF EXISTS `services`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `services` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`x_position` double DEFAULT NULL,
`y_position` double DEFAULT NULL,
`confirmed` tinyint(1) DEFAULT '0',
`price` int(11) DEFAULT NULL,
`quality` float DEFAULT NULL,
`confiability` float DEFAULT NULL,
`service_types_id` int(11) NOT NULL,
`created_at` datetime DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_services_service_types1_idx` (`service_types_id`),
KEY `fk_services_price_ranges` (`price`),
CONSTRAINT `fk_services_price_ranges` FOREIGN KEY (`price`) REFERENCES `price_ranges` (`id`),
CONSTRAINT `fk_services_service_types1` FOREIGN KEY (`service_types_id`) REFERENCES `service_types` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=12237 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_tracks`
--
DROP TABLE IF EXISTS `user_tracks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_tracks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`movement_id` int(11) DEFAULT NULL,
`pos_x` double DEFAULT NULL,
`pos_y` double DEFAULT NULL,
`classes` varchar(255) DEFAULT NULL,
`type` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `movement_id` (`movement_id`),
CONSTRAINT `user_tracks_ibfk_1` FOREIGN KEY (`movement_id`) REFERENCES `movements` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22438 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(60) DEFAULT NULL,
`email` varchar(60) DEFAULT NULL,
`public_name` varchar(120) DEFAULT NULL,
`confiability` int(11) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`roles_id` int(11) NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_users_roles1_idx` (`roles_id`),
CONSTRAINT `fk_users_roles1` FOREIGN KEY (`roles_id`) REFERENCES `roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
--Se activan las llaves foraneas
set FOREIGN_KEY_CHECKS = 1;
| true |
615f86c2540054e3f56cdd675e512bb1bd9911cb | SQL | FranciscoSepul/BDFerme | /Procedimientos Almacenados/Procedimientos Sucursal/Actualizar Telefono Sucursal.sql | UTF-8 | 267 | 2.6875 | 3 | [] | no_license | ----- ACTUALIZAR TELEFONO SUCURSAL -----
CREATE OR REPLACE PROCEDURE ACTUALIZAR_TELEFONO_SUCURSAL(P_ID IN NUMBER, P_TELEFONO IN NUMBER)
AS
BEGIN
UPDATE SUCURSAL
SET TELEFONO = P_TELEFONO
WHERE ID = P_ID;
END;
--EXECUTE ACTUALIZAR_TELEFONO_SUCURSAL(1, 77223388);
| true |
b41d01c01af46ffbf95571cdee96726f971860dc | SQL | 01vadim10/slot_automat | /slot-auto.sql | UTF-8 | 6,898 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 3.3.0
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Дек 25 2011 г., 23:56
-- Версия сервера: 5.1.40
-- Версия PHP: 5.2.12
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- База данных: `slot-auto`
--
-- --------------------------------------------------------
--
-- Структура таблицы `slt_bets`
--
CREATE TABLE IF NOT EXISTS `slt_bets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`game_id` int(10) unsigned NOT NULL,
`user_id` int(11) NOT NULL,
`denomination` decimal(12,4) NOT NULL,
`bet` int(10) unsigned DEFAULT NULL,
`lines_count` tinyint(3) unsigned NOT NULL,
`won` decimal(12,4) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
--
-- Дамп данных таблицы `slt_bets`
--
-- --------------------------------------------------------
--
-- Структура таблицы `slt_games`
--
CREATE TABLE IF NOT EXISTS `slt_games` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`description` text CHARACTER SET utf8,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=24 ;
--
-- Дамп данных таблицы `slt_games`
--
INSERT INTO `slt_games` (`id`, `name`, `description`) VALUES
(1, 'Book of Ra Deluxe', '1. ');
-- --------------------------------------------------------
--
-- Структура таблицы `slt_game_count`
--
CREATE TABLE IF NOT EXISTS `slt_game_count` (
`game_id` varchar(32) CHARACTER SET utf8 NOT NULL,
`count` int(11) NOT NULL,
UNIQUE KEY `game_id` (`game_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Дамп данных таблицы `slt_game_count`
--
-- --------------------------------------------------------
--
-- Структура таблицы `slt_lobby_users`
--
CREATE TABLE IF NOT EXISTS `slt_lobby_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(12) COLLATE utf8_bin NOT NULL,
`pass` varchar(12) COLLATE utf8_bin NOT NULL,
`cash` decimal(12,2) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `login` (`login`,`pass`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=4 ;
--
-- Дамп данных таблицы `slt_lobby_users`
--
INSERT INTO `slt_lobby_users` (`id`, `login`, `pass`, `cash`) VALUES
(1, 'varl', '12345', '3000.00'),
(2, 'dima', '12345', '0.00'),
(3, 'test', '12345', '85.00');
-- --------------------------------------------------------
--
-- Структура таблицы `slt_param_names`
--
CREATE TABLE IF NOT EXISTS `slt_param_names` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`game_id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
`value` varchar(255) CHARACTER SET utf8 NOT NULL,
`denomination` enum('0','1') COLLATE utf8_bin DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `game_id` (`game_id`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=29 ;
--
-- Дамп данных таблицы `slt_param_names`
--
INSERT INTO `slt_param_names` (`id`, `game_id`, `name`, `value`, `denomination`) VALUES
(14, 1, 'denomination_1', '0.01', '1'),
(25, 1, 'denomination_2', '0.03', '1'),
(26, 1, 'denomination_3', '0.05', '1'),
(27, 1, 'denomination_4', '0.1', '1'),
(28, 1, 'denomination_5', '0.25', '1');
-- --------------------------------------------------------
--
-- Структура таблицы `slt_roles`
--
CREATE TABLE IF NOT EXISTS `slt_roles` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`description` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Дамп данных таблицы `slt_roles`
--
INSERT INTO `slt_roles` (`id`, `name`, `description`) VALUES
(1, 'login', 'Login privileges, granted after account confirmation'),
(2, 'admin', 'Administrative user, has access to everything.');
-- --------------------------------------------------------
--
-- Структура таблицы `slt_roles_users`
--
CREATE TABLE IF NOT EXISTS `slt_roles_users` (
`user_id` int(10) unsigned NOT NULL,
`role_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`user_id`,`role_id`),
KEY `fk_role_id` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Дамп данных таблицы `slt_roles_users`
--
INSERT INTO `slt_roles_users` (`user_id`, `role_id`) VALUES
(3, 1),
(4, 1),
(2, 2);
-- --------------------------------------------------------
--
-- Структура таблицы `slt_success_count`
--
CREATE TABLE IF NOT EXISTS `slt_success_count` (
`game_id` varchar(32) CHARACTER SET utf8 NOT NULL,
`symbol_id` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '',
`combination` tinyint(3) unsigned NOT NULL DEFAULT '0',
`count` int(11) unsigned NOT NULL,
PRIMARY KEY (`game_id`,`symbol_id`,`combination`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Дамп данных таблицы `slt_success_count`
--
-- --------------------------------------------------------
--
-- Структура таблицы `slt_users`
--
CREATE TABLE IF NOT EXISTS `slt_users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(254) NOT NULL,
`username` varchar(32) NOT NULL DEFAULT '',
`password` varchar(64) NOT NULL,
`logins` int(10) unsigned NOT NULL DEFAULT '0',
`last_login` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_username` (`username`),
UNIQUE KEY `uniq_email` (`email`),
UNIQUE KEY `email` (`email`,`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Дамп данных таблицы `slt_users`
--
INSERT INTO `slt_users` (`id`, `email`, `username`, `password`, `logins`, `last_login`) VALUES
(2, 'admin@admin.com', 'admin', 'f3d05fb6548837f3aa9bdabf8a1f246962e89cd7ea45f80f09e6d35ff1bdf164', 74, 1324825255),
(3, 'test@test.com', 'test', 'd27b39b3d3625ea345570bd69c3e780d8842c71ae2fc7592c8d8c11eba365596', 7, 1322391537),
(4, 'testdf@test.com', 'dt', '2a1b7b2d9ff47fb4f5a18d286a95510bfe729c3dfacf84224d35bfb1b5c9aec8', 0, NULL);
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `slt_roles_users`
--
ALTER TABLE `slt_roles_users`
ADD CONSTRAINT `slt_roles_users_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `slt_users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `slt_roles_users_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `slt_roles` (`id`) ON DELETE CASCADE;
| true |
5d7ff890d68207a88ee452ef604aac4163a5f3bf | SQL | lidd978655924/FoodComment | /src/main/resources/common/sql/createDataBase.sql | UTF-8 | 6,486 | 3.015625 | 3 | [] | no_license |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `t_admin`
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
`userId` bigint(20) NOT NULL AUTO_INCREMENT,
`userName` varchar(50) DEFAULT NULL,
`userPw` varchar(50) DEFAULT NULL,
PRIMARY KEY (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert t_admin(userName,userPw) values ("admin","admin");
-- ----------------------------
-- Table structure for `t_liuyan`
-- ----------------------------
DROP TABLE IF EXISTS `t_liuyan`;
CREATE TABLE `t_liuyan` (
`liuyan_id` bigint(20) NOT NULL AUTO_INCREMENT,
`liuyan_title` varchar(50) DEFAULT NULL,
`liuyan_content` varchar(5000) DEFAULT NULL,
`liuyan_date` varchar(50) DEFAULT NULL,
`liuyan_user` varchar(50) DEFAULT NULL,
PRIMARY KEY (`liuyan_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_gonggao`
-- ----------------------------
DROP TABLE IF EXISTS `t_gonggao`;
CREATE TABLE `t_gonggao` (
`gonggao_id` bigint(20) NOT NULL AUTO_INCREMENT,
`gonggao_title` varchar(50) DEFAULT NULL,
`gonggao_content` varchar(8000) DEFAULT NULL,
`gonggao_data` varchar(50) DEFAULT NULL,
`gonggao_fabuzhe` varchar(255) DEFAULT NULL,
`gonggao_del` varchar(50) DEFAULT NULL,
`gonggao_one1` varchar(50) DEFAULT NULL,
`gonggao_one2` varchar(50) DEFAULT NULL,
`gonggao_one3` varchar(50) DEFAULT NULL,
`gonggao_one4` varchar(50) DEFAULT NULL,
`gonggao_one5` varchar(23) DEFAULT NULL,
`gonggao_one6` varchar(23) DEFAULT NULL,
`gonggao_one7` varchar(255) DEFAULT NULL,
`gonggao_one8` varchar(255) DEFAULT NULL,
PRIMARY KEY (`gonggao_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_user`
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_name` varchar(50) DEFAULT NULL,
`user_pw` varchar(8000) DEFAULT NULL,
`user_type` int DEFAULT NULL,
`user_realname` varchar(50) DEFAULT NULL,
`user_address` varchar(50) DEFAULT NULL,
`user_sex` varchar(50) DEFAULT NULL,
`user_tel` varchar(50) DEFAULT NULL,
`user_email` varchar(50) DEFAULT NULL,
`user_qq` varchar(50) DEFAULT NULL,
`user_man` varchar(50) DEFAULT NULL,
`user_age` varchar(50) DEFAULT NULL,
`user_birthday` varchar(50) DEFAULT NULL,
`user_xueli` varchar(50) DEFAULT NULL,
`user_del` varchar(50) DEFAULT NULL,
`user_one1` varchar(50) DEFAULT NULL,
`user_one2` varchar(50) DEFAULT NULL,
`user_one3` varchar(50) DEFAULT NULL,
`user_one4` varchar(50) DEFAULT NULL,
`user_one5` varchar(50) DEFAULT NULL,
`user_one6` varchar(255) DEFAULT NULL,
`user_one7` varchar(255) DEFAULT NULL,
`user_one8` varchar(50) DEFAULT NULL,
`user_one9` varchar(23) DEFAULT NULL,
`user_one10` varchar(23) DEFAULT NULL,
`user_one11` varchar(255) DEFAULT NULL,
`user_one12` varchar(255) DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_catelog`
-- ----------------------------
DROP TABLE IF EXISTS `t_catelog`;
CREATE TABLE `t_catelog` (
`catelog_id` bigint(20) NOT NULL AUTO_INCREMENT,
`catelog_name` varchar(50) DEFAULT NULL,
`catelog_miaoshu` varchar(5000) DEFAULT NULL,
`catelog_del` varchar(50) DEFAULT NULL,
PRIMARY KEY (`catelog_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_product`
-- ----------------------------
DROP TABLE IF EXISTS `t_product`;
CREATE TABLE `t_product` (
`product_id` bigint(20) NOT NULL AUTO_INCREMENT,
`product_name` varchar(50) DEFAULT NULL,
`product_miaoshu` varchar(5000) DEFAULT NULL,
`product_pic` varchar(50) DEFAULT NULL,
`product_yanse` varchar(50) DEFAULT NULL,
`product_shichangjia` int DEFAULT NULL,
`product_tejia` int DEFAULT NULL,
`product_isnottejia` varchar(50) DEFAULT NULL,
`product_isnottuijian` varchar(50) DEFAULT NULL,
`product_catelog_id` int DEFAULT NULL,
`product_kucun` int DEFAULT NULL,
`product_Del` varchar(50) DEFAULT NULL,
`product_shrq` varchar(50) DEFAULT NULL,
`product_haoping` int DEFAULT NULL,
`product_zhongping` int DEFAULT NULL,
`product_chaping` int DEFAULT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_pingjia`
-- ----------------------------
DROP TABLE IF EXISTS `t_pingjia`;
CREATE TABLE `t_pingjia` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`content` varchar(5000) DEFAULT NULL,
`shijian` varchar(50) DEFAULT NULL,
`productId` int DEFAULT NULL,
`userId` int DEFAULT NULL,
`del` varchar(50) DEFAULT NULL,
`haoping` int DEFAULT NULL,
`zhongping` int DEFAULT NULL,
`chaping` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_goods`
-- ----------------------------
DROP TABLE IF EXISTS `t_goods`;
CREATE TABLE `t_goods` (
`goods_id` bigint(20) NOT NULL AUTO_INCREMENT,
`goods_name` varchar(50) DEFAULT NULL,
`goods_miaoshu` varchar(5000) DEFAULT NULL,
`goods_pic` varchar(50) DEFAULT NULL,
`goods_yanse` varchar(50) DEFAULT NULL,
`goods_shichangjia` int DEFAULT NULL,
`goods_tejia` int DEFAULT NULL,
`goods_isnottejia` varchar(50) DEFAULT NULL,
`goods_isnottuijian` varchar(50) DEFAULT NULL,
`goods_catelog_id` int DEFAULT NULL,
`goods_Del` int DEFAULT NULL,
PRIMARY KEY (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `t_picNews`
-- ----------------------------
DROP TABLE IF EXISTS `t_picNews`;
CREATE TABLE `t_picNews` (
`picNews_id` bigint(20) NOT NULL AUTO_INCREMENT,
`picNews_title` varchar(50) DEFAULT NULL,
`picNews_content` varchar(8000) DEFAULT NULL,
`fujian` varchar(8000) DEFAULT NULL,
`fujian_yuanshiming` varchar(50) DEFAULT NULL,
`picNews_date` varchar(50) DEFAULT NULL,
`picNews_one1` varchar(50) DEFAULT NULL,
`picNews_one2` varchar(50) DEFAULT NULL,
`picNews_one4` varchar(50) DEFAULT NULL,
`picNews_one5` varchar(23) DEFAULT NULL,
`picNews_one6` varchar(23) DEFAULT NULL,
`picNews_one7` varchar(255) DEFAULT NULL,
`picNews_one8` varchar(255) DEFAULT NULL,
PRIMARY KEY (`picNews_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
2b85dde4491176529ec4c059be3e4227fc48fd6e | SQL | simonNozaki/parallel-api | /src/test/resources/com/tm/controller/framework/task_common_data.sql | UTF-8 | 1,053 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | -- タスク処理Controller共通データソースFile
-- Users、1ユーザデフォルトで作成
-- pass : stubstub
INSERT INTO public.users(user_id, user_name, email, password, used_flag)
VALUES ('TM00000001', 'test user', 'test@example.com', '$2a$10$x7HcJvFPjTkpxSvR0upo0e0RpmHDNQt1EM4Ybfsr/erGRC9JfkYqO', '0');
-- task
INSERT INTO public.task(task_id, task_title, task_label, start_date, deadline, completed_flag, user_id, task_note)
VALUES
('180101000a', 'sample title1', 'test label1', '2018-01-01 00:00:00', '2018-01-03 00:00:00', '0', 'TM00000001', 'test note'),
('180101000b', 'sample title2', 'test label2', '2018-01-01 00:00:00', '2018-01-03 00:00:00', '0', 'TM00000001', 'test note'),
('180101000c', 'sample title3', 'test label3', '2018-01-01 00:00:00', '2018-01-03 00:00:00', '0', 'TM00000001', 'test note');
-- task_label
INSERT INTO public.task_label(label_id, task_label, used_flag, user_id)
VALUES
('TL00000001', 'test label1', '0', 'TM00000001'),
('TL00000002', 'test label2', '0', 'TM00000001'),
('TL00000003', 'test label3', '0', 'TM00000001');
| true |
070c89047fbbbb1c1be9e79b6916770d7e1004a4 | SQL | CCI-MIT/XCoLab | /microservices/services/admin-service/src/main/resources/db/migration/V1__baseline.sql | UTF-8 | 894 | 2.890625 | 3 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS `xcolab_ContestEmailTemplate` (
`type_` varchar(75) NOT NULL PRIMARY KEY,
`subject` longtext,
`header` longtext,
`footer` longtext
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `xcolab_ConfigurationAttribute` (
`name` varchar(75) NOT NULL,
`additionalId` bigint(20) NOT NULL,
`locale` VARCHAR(5) DEFAULT '' NOT NULL,
`numericValue` bigint(20) DEFAULT NULL,
`stringValue` longtext,
`realValue` double DEFAULT NULL,
PRIMARY KEY (`name`, `additionalId`, `locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `admin_ContestTypeAttribute` (
name varchar(75) not null,
additionalId bigint not null,
locale varchar(5) default '' not null,
numericValue bigint null,
stringValue longtext null,
realValue double null,
primary key (name, additionalId, locale)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
| true |
1a0281dabf6f2e0fec502f481de1b2cc35ede28f | SQL | mfaishaldp/TubesWebpro | /kliniksunateuy.sql | UTF-8 | 3,379 | 3.25 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 24, 2020 at 03:41 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `kliniksunateuy`
--
-- --------------------------------------------------------
--
-- Table structure for table `dokter`
--
CREATE TABLE `dokter` (
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`nama` varchar(50) NOT NULL,
`tipeSunat` varchar(30) DEFAULT NULL,
`alamat` varchar(50) NOT NULL,
`saldo` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `ordersunat`
--
CREATE TABLE `ordersunat` (
`idOrder` int(11) NOT NULL,
`uPasien` varchar(20) NOT NULL,
`uDokter` varchar(20) NOT NULL,
`tglSunat` date NOT NULL,
`status` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `pasien`
--
CREATE TABLE `pasien` (
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`nama` varchar(50) NOT NULL,
`alamat` varchar(50) NOT NULL,
`saldo` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tipesunat`
--
CREATE TABLE `tipesunat` (
`tipeSunat` varchar(30) NOT NULL,
`harga` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tipesunat`
--
INSERT INTO `tipesunat` (`tipeSunat`, `harga`) VALUES
('clamp', 850000),
('Khusus Gendut', 1500000),
('Reguler', 600000);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `dokter`
--
ALTER TABLE `dokter`
ADD PRIMARY KEY (`username`),
ADD KEY `Fk_tipeSunat` (`tipeSunat`);
--
-- Indexes for table `ordersunat`
--
ALTER TABLE `ordersunat`
ADD PRIMARY KEY (`idOrder`),
ADD KEY `Fk_uPasien` (`uPasien`),
ADD KEY `Fk_uDokter` (`uDokter`);
--
-- Indexes for table `pasien`
--
ALTER TABLE `pasien`
ADD PRIMARY KEY (`username`);
--
-- Indexes for table `tipesunat`
--
ALTER TABLE `tipesunat`
ADD PRIMARY KEY (`tipeSunat`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ordersunat`
--
ALTER TABLE `ordersunat`
MODIFY `idOrder` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `dokter`
--
ALTER TABLE `dokter`
ADD CONSTRAINT `Fk_tipeSunat` FOREIGN KEY (`tipeSunat`) REFERENCES `tipesunat` (`tipeSunat`);
--
-- Constraints for table `ordersunat`
--
ALTER TABLE `ordersunat`
ADD CONSTRAINT `Fk_uDokter` FOREIGN KEY (`uDokter`) REFERENCES `dokter` (`username`),
ADD CONSTRAINT `Fk_uPasien` FOREIGN KEY (`uPasien`) REFERENCES `pasien` (`username`);
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 */;
| true |
ecc1aed80372ba880a06a66cdb16624764adfaf7 | SQL | mouldyjon/ra_dw_dbt | /ra_dw/snapshots/deals_snapshot.sql | UTF-8 | 7,540 | 3.46875 | 3 | [] | no_license | /*
This snapshot table will live in:
analytics.snapshots.deals_snapshot
*/
{% snapshot deals_snapshot %}
{{
config(
target_schema='snapshots',
strategy='check',
unique_key='deal_id',
check_cols='all'
)
}}
with deals as (
select * from (
select *,
MAX(_sdc_batched_at) OVER (PARTITION BY dealid ORDER BY _sdc_batched_at RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) latest_sdc_batched_at
from {{ source('hubspot', 'deals') }})
where latest_sdc_batched_at = _sdc_batched_at
),
new_deal as (
select
properties.hs_sales_email_last_replied.value AS sales_email_last_replied,
properties.closed_lost_reason.value AS closed_lost_reason,
properties.dealname.value AS dealname,
properties.hubspot_owner_id.value AS hubspot_owner_id,
properties.hubspot_owner_id.sourceid as hubspot_owner_email,
properties.hs_lastmodifieddate.value AS lastmodifieddate,
properties.notes_last_updated.value AS notes_last_updated,
properties.dealstage.value AS dealstage,
properties.dealstage.value as dealstage_id,
properties.dealstage.timestamp as dealstage_ts,
properties.pipeline.value AS pipeline,
properties.closedate.value AS closedate,
properties.createdate.value AS createdate,
properties.amount_in_home_currency.value AS amount,
properties.notes_last_contacted.value AS notes_last_contacted,
properties.amount_in_home_currency.value AS amount_in_home_currency,
properties.hubspot_owner_assigneddate.value AS hubspot_owner_assigneddate,
properties.num_notes.value AS num_notes,
properties.description.value AS description,
properties.dealstage.source as source, -- added 06/11/1
properties.dealstage.sourceid as salesperson_email, -- added 06/11/2019
case when properties.closedate.value is not null then true else false end AS is_closed, -- added 18/12/2019
properties.pricing_model.value AS pricing_model, -- added 18/12/2019
properties.source.value as deal_source,
properties.products_in_solution.value as products_in_solution,
properties.sprint_type.value as sprint_type,
properties.days_to_close.value as days_to_close,
properties.partner_referral.value as partner_referral_type,
properties.deal_components.value as deal_components,
properties.dealtype.value as deal_type,
properties.assigned_consultant.value as assigned_consultant,
properties.harvest_project_id.value as harvest_project_id,
case when timestamp_millis(safe_cast(properties.delivery_schedule_date.value as int64)) > timestamp_millis(safe_cast(properties.delivery_start_date.value as int64)) then timestamp_millis(safe_cast(properties.delivery_schedule_date.value as int64))
when timestamp_millis(safe_cast(properties.delivery_start_date.value as int64)) >= timestamp_millis(safe_cast(properties.delivery_schedule_date.value as int64)) then timestamp_millis(safe_cast(properties.delivery_start_date.value as int64))
when timestamp_millis(safe_cast(properties.delivery_start_date.value as int64)) is null then timestamp_millis(safe_cast(properties.delivery_schedule_date.value as int64))
when timestamp_millis(safe_cast(properties.delivery_schedule_date.value as int64)) is null then timestamp_millis(safe_cast(properties.delivery_start_date.value as int64))
end as start_date_ts,
case when properties.number_of_sprints.value is not null then properties.number_of_sprints.value * 14
when properties.number_of_sprints.value is null and properties.sprint_type.value like '%Data Analytics%' then (properties.amount_in_home_currency.value / 4000) * 14
when properties.number_of_sprints.value is null and properties.sprint_type.value like '%Data Engineering%' then (properties.amount_in_home_currency.value / 6000) * 14 end as duration_days,
case when properties.deal_components.value like '%Services%' then 1 else 0 end as count_services_deal_component,
case when properties.deal_components.value like '%Training%' then 1 else 0 end as count_support_deal_component,
case when properties.deal_components.value like '%License Referral%' then 1 else 0 end as count_license_referral_deal_component,
case when properties.deal_components.value like '%Managed Services%' then 1 else 0 end as count_managed_services_deal_component,
case when properties.sprint_type.value like '%Data Analytics%' then 1 else 0 end as count_data_analytics_sprint_type,
case when properties.sprint_type.value like '%Data Engineering%' then 1 else 0 end as count_data_engineering_sprint_type,
case when properties.sprint_type.value like '%Data Science%' then 1 else 0 end as count_data_science_sprint_type,
case when properties.sprint_type.value like '%Data Strategy%' then 1 else 0 end as count_data_strategy_sprint_type,
case when properties.sprint_type.value like '%Data Integration%' then 1 else 0 end as count_data_integration_sprint_type,
case when properties.sprint_type.value like '%Data Collection%' then 1 else 0 end as count_data_collection_sprint_type,
case when properties.products_in_solution.value like '%Looker%' then 1 else 0 end as count_looker_product_in_solution,
case when properties.products_in_solution.value like '%dbt%' then 1 else 0 end as count_dbt_product_in_solution,
case when properties.products_in_solution.value like '%Stitch%' then 1 else 0 end as count_stitch_product_in_solution,
case when properties.products_in_solution.value like '%Segment%' then 1 else 0 end as count_segment_product_in_solution,
case when properties.products_in_solution.value like '%GCP%' then 1 else 0 end as count_gcp_product_in_solution,
case when properties.products_in_solution.value like '%Snowflake%' then 1 else 0 end as count_snowflake_product_in_solution,
case when properties.products_in_solution.value like '%Fivetran%' then 1 else 0 end as count_fivetran_product_in_solution,
case when properties.products_in_solution.value like '%Qubit%' then 1 else 0 end as count_qubit_product_in_solution,
case when properties.source.value like '%Partner Referral%' then 1 else 0 end as count_partner_referral_source,
case when properties.source.value like '%CEO Network%' then 1 else 0 end as count_ceo_network_source,
case when properties.source.value like '%Staff Referral%' then 1 else 0 end as count_staff_referral_referral_source,
case when properties.source.value like '%Organic Search%' then 1 else 0 end as count_organic_search_source,
case when properties.source.value like '%Repeat Customer%' then 1 else 0 end as count_repeat_customer_source,
case when properties.source.value like '%Paid Search/Campaign%' then 1 else 0 end as count_paid_search_source,
associations.associatedcompanyids[offset(off)] as associatedcompanyids, -- added 18/12/2019
dealid AS deal_id,
_sdc_batched_at
from deals,
unnest(associations.associatedcompanyids) with offset off
)
select * from new_deal
{% endsnapshot %}
| true |
35eb7abdbf2b136c6d0ded7ca0e3218414b404ea | SQL | udayshanbhag/TodoEnterprise | /webapp/dbscripts/dbcreate.sql | UTF-8 | 942 | 3.6875 | 4 | [] | no_license | -- Database: todo
-- DROP DATABASE todo;
CREATE DATABASE todo
WITH
OWNER = todoowner
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.utf8'
LC_CTYPE = 'en_US.utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
-- Role: todoowner
-- DROP ROLE todoowner;
CREATE ROLE todoowner WITH
LOGIN
SUPERUSER
INHERIT
CREATEDB
CREATEROLE
NOREPLICATION
ENCRYPTED PASSWORD 'md54a2dea59390b7437d58cb747abda942e';
-- Table: public.todos
-- DROP TABLE public.todos;
CREATE TABLE public.todos
(
id integer NOT NULL,
name character varying(50)[] COLLATE pg_catalog."default" NOT NULL,
description character varying(300)[] COLLATE pg_catalog."default",
"targetDate" date NOT NULL,
completed boolean,
"user" character varying(50)[] COLLATE pg_catalog."default" NOT NULL,
"createdDate" date NOT NULL,
CONSTRAINT todos_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
ALTER TABLE public.todos
OWNER to todoowner; | true |
b8d864752d9dff0919c3abb590c998098527ffff | SQL | alex-cuellar/New_Pagina_Web | /Database/Proyecto_Tablas.sql | UTF-8 | 3,627 | 3.265625 | 3 | [] | no_license | CREATE TABLE `categoria` (
`ID` int NOT NULL AUTO_INCREMENT,
`RedSoc` varchar(100) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `uanonimo` (
`ID` int NOT NULL AUTO_INCREMENT,
`Nombre` varchar(100) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `usuario` (
`ID` int NOT NULL AUTO_INCREMENT,
`Nombre` varchar(100) DEFAULT NULL,
`Descrip` varchar(100) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL,
`Usr` varchar(100) DEFAULT NULL,
`Pass` varchar(100) DEFAULT NULL,
`RedSoc` varchar(300) DEFAULT NULL,
`Tipo` int DEFAULT NULL,
`Imagen` varchar(350) DEFAULT NULL,
`Status1` bit(1) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=1021 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `noticia` (
`ID` int NOT NULL AUTO_INCREMENT,
`Titulo` varchar(100) DEFAULT NULL,
`DescripcioncORTA` varchar(200) DEFAULT NULL,
`IdCategoria` int DEFAULT NULL,
`NoticiaParrafo1` longtext,
`Imagen1` varchar(350) DEFAULT NULL,
`Video` varchar(100) DEFAULT NULL,
`Calif` int DEFAULT NULL,
`Fecha` datetime DEFAULT NULL,
`IdUsuario` int DEFAULT NULL,
`NoticiaParrafo2` longtext,
`Imagen2` varchar(350) DEFAULT NULL,
`Imagen3` varchar(350) DEFAULT NULL,
`Aceptada` int DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `FK_CATEGORIA` (`IdCategoria`),
KEY `FK_USUARIO` (`IdUsuario`),
CONSTRAINT `FK_CATEGORIA` FOREIGN KEY (`IdCategoria`) REFERENCES `categoria` (`ID`),
CONSTRAINT `FK_USUARIO` FOREIGN KEY (`IdUsuario`) REFERENCES `usuario` (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `noticiafav` (
`ID` int NOT NULL AUTO_INCREMENT,
`IdNoticia` int DEFAULT NULL,
`IdUsr` int DEFAULT NULL,
`IsRegister` int DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `FK_NFNOTICIA` (`IdNoticia`),
KEY `FK_NFUSER` (`IdUsr`),
CONSTRAINT `FK_NFNOTICIA` FOREIGN KEY (`IdNoticia`) REFERENCES `noticia` (`ID`),
CONSTRAINT `FK_NFUSER` FOREIGN KEY (`IdUsr`) REFERENCES `usuario` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `comentarios` (
`ID` int NOT NULL AUTO_INCREMENT,
`IdNoticia` int DEFAULT NULL,
`IdUsr` int DEFAULT NULL,
`IsRegister` int DEFAULT NULL,
`Calif` float DEFAULT NULL,
`Texto` varchar(500) DEFAULT NULL,
`IsHidden` bit(1) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `FK_CNOTICIA` (`IdNoticia`),
KEY `FK_CUSER` (`IdUsr`),
KEY `FK_Anon` (`IsRegister`),
CONSTRAINT `FK_Anon` FOREIGN KEY (`IsRegister`) REFERENCES `uanonimo` (`ID`),
CONSTRAINT `FK_CNOTICIA` FOREIGN KEY (`IdNoticia`) REFERENCES `noticia` (`ID`),
CONSTRAINT `FK_CUSER` FOREIGN KEY (`IdUsr`) REFERENCES `usuario` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `respuestas` (
`ID` int NOT NULL AUTO_INCREMENT,
`IdNoticia` int DEFAULT NULL,
`IdUsr` int DEFAULT NULL,
`IsRegister` int DEFAULT NULL,
`IdComent` int DEFAULT NULL,
`Calif` float DEFAULT NULL,
`Texto` varchar(500) DEFAULT NULL,
`IsHidden` bit(1) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `FK_RNOTICIA` (`IdNoticia`),
KEY `FK_RUSER` (`IdUsr`),
KEY `FK_RCOMENT` (`IdComent`),
CONSTRAINT `FK_RCOMENT` FOREIGN KEY (`IdComent`) REFERENCES `comentarios` (`ID`),
CONSTRAINT `FK_RNOTICIA` FOREIGN KEY (`IdNoticia`) REFERENCES `noticia` (`ID`),
CONSTRAINT `FK_RUSER` FOREIGN KEY (`IdUsr`) REFERENCES `usuario` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
| true |
db72840fbe33eaf1f68c211cacf101a55fb2c441 | SQL | mukundkadlabal/DBMS-SalesAnalysis | /Phase 2/Queries.sql | UTF-8 | 360 | 3.234375 | 3 | [] | no_license | SELECT CName FROM COMPANY WHERE CId = 3;
SELECT PName FROM PRODUCT WHERE Price > 200 ORDER BY PName;
SELECT SUM(Income) FROM CONSUMER WHERE age > 30;
SELECT AVG(Price) FROM PRODUCT;
SELECT * FROM DISTRIBUTOR WHERE DId = 116;
SELECT PName FROM PRODUCT WHERE Price = (SELECT Max(Price) FROM PRODUCT);
SELECT * FROM PRODUCT WHERE Price BETWEEN 250 AND 750; | true |
0d715fe5d60a22164cfd3f7d049cabd54a4e4fa5 | SQL | RobertWSmith/TD_SQL | /On Time Delivery/OPEN_ORDER_FUTURE_FCDD REPORT.sql | UTF-8 | 8,137 | 3.46875 | 3 | [] | no_license | -- PROPORTIONS FOR ALL ORDERS
SELECT
OOF.PBU_NBR || ' - ' || OOF.PBU_NAME AS PBU,
OOF.EXT_MATL_GRP_ID AS "External Material Group ID",
OOF.OWN_CUST_ID || ' - ' || OOF.OWN_CUST_NAME AS "Common Owner",
OOF.MKT_AREA AS "Market Area",
OOF.MKT_GRP AS "Market Group",
OOF.PROD_GRP AS "Product Group",
OOF.PROD_LINE AS "Product Line",
OOF.DELIV_PRTY_ID AS "Delivery Priority ID",
OOF.CUST_GRP2_CD AS "Customer Group 2 Code",
OOF.MATL_NO_8 || ' - ' || OOF.DESCR AS "Material Description",
CAST( CAST( OOF.FCDD - CURRENT_DATE AS INTEGER ) / 7 AS INTEGER ) AS "Lead Time (Weeks)",
CAST( SUM( OOF.OPEN_CONFIRMED_QTY ) AS INTEGER) AS "Open Confirmed Qty",
CAST( SUM( CASE
WHEN OOF.PDD > OOF.FCDD
THEN OOF.OPEN_CONFIRMED_QTY
ELSE 0
END ) AS INTEGER ) AS "Open Confirmed Qty PDD > FCDD",
OOF.QTY_UNIT_MEAS_ID AS "Quantity UOM"
FROM (
SELECT
OOSL.ORDER_FISCAL_YR,
OOSL.ORDER_ID,
OOSL.ORDER_LINE_NBR,
OOSL.SCHED_LINE_NBR,
OOSL.CREDIT_HOLD_FLG,
ODC.SHIP_TO_CUST_ID ,
CUST.CUST_NAME AS SHIP_TO_CUST_NAME,
CUST.OWN_CUST_ID,
CUST.OWN_CUST_NAME,
ODC.SALES_ORG_CD,
ODC.DISTR_CHAN_CD,
ODC.CUST_GRP_ID,
NULLIF( ODC.PO_TYPE_ID, ' ' ) AS PO_TYPE_ID,
ODC.ORDER_CAT_ID,
ODC.ORDER_TYPE_ID,
CASE WHEN ODC.CANCEL_IND = 'Y' THEN 'Y' END AS CANCEL_IND,
CASE WHEN ODC.RETURN_IND = 'Y' THEN 'Y' END AS RETURN_IND,
NULLIF( ODC.DELIV_BLK_CD, ' ' ) AS DELIV_BLK_CD,
ODC.FACILITY_ID,
ODC.SHIP_PT_ID,
ODC.DELIV_PRTY_ID,
ODC.CUST_GRP2_CD,
ODC.SPCL_PROC_ID,
ODC.MATL_ID,
MATL.MATL_NO_8,
MATL.DESCR,
MATL.PBU_NBR,
MATL.PBU_NAME,
MATL.EXT_MATL_GRP_ID,
MATL.MKT_CTGY_MKT_AREA_NBR || ' - ' || MATL.MKT_CTGY_MKT_AREA_NAME AS MKT_AREA,
MATL.MKT_CTGY_MKT_GRP_NBR || ' - ' || MATL.MKT_CTGY_MKT_GRP_NAME AS MKT_GRP,
MATL.MKT_CTGY_PROD_GRP_NBR || ' - ' || MATL.MKT_CTGY_PROD_GRP_NAME AS PROD_GRP,
MATL.MKT_CTGY_PROD_LINE_NBR || ' - ' || MATL.MKT_CTGY_PROD_LINE_NAME AS PROD_LINE,
ODC.ITEM_CAT_ID,
ODC.ORDER_DT,
ODC.FRST_RDD AS FRDD,
ODC.FRST_PROM_DELIV_DT AS FCDD,
ODC.PLN_DELIV_DT AS PDD,
ODC.ORDER_QTY AS ORDER_QTY,
ODC.CNFRM_QTY AS TOTAL_CNFRM_QTY,
OOSL.OPEN_CNFRM_QTY AS OPEN_CONFIRMED_QTY,
OOSL.UNCNFRM_QTY AS UNCONFIRMED_QTY,
OOSL.BACK_ORDER_QTY AS BACK_ORDERED_QTY,
OOSL.DEFER_QTY AS DEFER_QTY,
OOSL.IN_PROC_QTY AS IN_PROC_QTY,
OOSL.WAIT_LIST_QTY AS WAIT_LIST_QTY,
OOSL.OTHR_ORDER_QTY AS OTHR_ORDER_QTY,
ODC.QTY_UNIT_MEAS_ID
FROM NA_VWS.OPEN_ORDER_SCHDLN OOSL
INNER JOIN NA_BI_VWS.ORDER_DETAIL_CURR ODC
ON ODC.ORDER_FISCAL_YR = OOSL.ORDER_FISCAL_YR
AND ODC.ORDER_ID = OOSL.ORDER_ID
AND ODC.ORDER_LINE_NBR = OOSL.ORDER_LINE_NBR
AND ODC.SCHED_LINE_NBR = OOSL.SCHED_LINE_NBR
AND ODC.CUST_GRP_ID <> '3R'
AND ODC.ORDER_TYPE_ID <> 'ZLZ'
AND ODC.RO_PO_TYPE_IND = 'N' -- AND ODC.PO_TYPE_ID <> 'RO'
INNER JOIN GDYR_BI_VWS.NAT_MATL_HIER_DESCR_EN_CURR MATL
ON MATL.MATL_ID = ODC.MATL_ID
INNER JOIN GDYR_BI_VWS.NAT_CUST_HIER_DESCR_EN_CURR CUST
ON CUST.SHIP_TO_CUST_ID = ODC.SHIP_TO_CUST_ID
AND CUST.CUST_GRP_ID <> '3R'
WHERE
OOSL.EXP_DT = DATE '5555-12-31'
AND FCDD > CURRENT_DATE
AND ( OPEN_CONFIRMED_QTY > 0
OR UNCONFIRMED_QTY > 0
OR BACK_ORDERED_QTY > 0 )
) OOF
GROUP BY
PBU,
OOF.MKT_AREA,
OOF.MKT_GRP,
OOF.PROD_GRP,
OOF.PROD_LINE,
OOF.DELIV_PRTY_ID,
OOF.CUST_GRP2_CD,
OOF.EXT_MATL_GRP_ID,
"Material Description",
"Common Owner",
"Lead Time (Weeks)",
OOF.QTY_UNIT_MEAS_ID
ORDER BY
PBU,
OOF.MKT_AREA,
OOF.MKT_GRP,
OOF.PROD_GRP,
OOF.PROD_LINE,
"Common Owner",
OOF.DELIV_PRTY_ID,
OOF.CUST_GRP2_CD
;
-- ORDERS WITH PDD > FCDD @ ORDER LINE LEVEL
SELECT
OOF.ORDER_ID AS "Order ID",
OOF.ORDER_LINE_NBR AS "Order Line Nbr",
OOF.SCHED_LINE_NBR AS "Schedule Line Nbr",
OOF.CREDIT_HOLD_FLG AS "Credit Hold Flag",
OOF.SHIP_TO_CUST_ID || ' - ' || OOF.SHIP_TO_CUST_NAME AS "Ship To Customer",
OOF.OWN_CUST_ID || ' - ' || OOF.OWN_CUST_NAME AS "Common Owner",
OOF.SALES_ORG_CD AS "Sales Organization Code",
OOF.DISTR_CHAN_CD AS "Distribution Channel Code",
OOF.CUST_GRP_ID AS "Customer Group ID",
OOF.PO_TYPE_ID AS "PO Type ID",
OOF.ORDER_CAT_ID AS "Order Category ID",
OOF.ORDER_TYPE_ID AS "Order Type ID",
OOF.DELIV_BLK_CD AS "Delivery Block Code",
OOF.FACILITY_ID AS "Facility ID",
OOF.SHIP_PT_ID AS "Ship Point ID",
OOF.DELIV_PRTY_ID AS "Delivery Priority ID",
OOF.CUST_GRP2_CD AS "Customer Group 2 Code",
OOF.MATL_NO_8 || ' - ' || OOF.DESCR AS "Material Description",
OOF.PBU_NBR || ' - ' || OOF.PBU_NAME AS PBU,
OOF.EXT_MATL_GRP_ID AS "External Material Group ID",
OOF.MKT_AREA AS "Market Area",
OOF.MKT_GRP AS "Market Group",
OOF.PROD_GRP AS "Product Group",
OOF.PROD_LINE AS "Product Line",
OOF.ITEM_CAT_ID AS "Item Category ID",
OOF.ORDER_DT AS "Order Date",
OOF.FRDD,
OOF.FCDD,
CAST( CAST( OOF.FCDD - CURRENT_DATE AS FORMAT '-9(3)' ) || ' Days between ' || CURRENT_DATE || ' and FCDD' AS VARCHAR(40) )AS "Days between Today and FCDD",
OOF.PDD AS "Planned Delivery Date",
CAST( CAST( OOF.PDD - OOF.FCDD AS FORMAT '-9(3)' ) || ' Days between FCDD and PDD' AS VARCHAR(40) ) AS "Days between FCDD and PDD",
OOF.OPEN_CONFIRMED_QTY AS "Open Confirmed Qty",
OOF.UNCONFIRMED_QTY AS "Unconfirmed Qty",
OOF.BACK_ORDERED_QTY AS "Back Ordered Qty",
OOF.QTY_UNIT_MEAS_ID AS "Quantity UOM"
FROM (
SELECT
OOSL.ORDER_ID,
OOSL.ORDER_LINE_NBR,
OOSL.SCHED_LINE_NBR,
OOSL.CREDIT_HOLD_FLG,
ODC.SHIP_TO_CUST_ID ,
CUST.CUST_NAME AS SHIP_TO_CUST_NAME,
CUST.OWN_CUST_ID,
CUST.OWN_CUST_NAME,
ODC.SALES_ORG_CD,
ODC.DISTR_CHAN_CD,
ODC.CUST_GRP_ID,
NULLIF( ODC.PO_TYPE_ID, ' ' ) AS PO_TYPE_ID,
ODC.ORDER_CAT_ID,
ODC.ORDER_TYPE_ID,
CASE WHEN ODC.CANCEL_IND = 'Y' THEN 'Y' END AS CANCEL_IND,
CASE WHEN ODC.RETURN_IND = 'Y' THEN 'Y' END AS RETURN_IND,
NULLIF( ODC.DELIV_BLK_CD, ' ' ) AS DELIV_BLK_CD,
ODC.FACILITY_ID,
ODC.SHIP_PT_ID,
ODC.DELIV_PRTY_ID,
ODC.CUST_GRP2_CD,
ODC.MATL_ID,
MATL.MATL_NO_8,
MATL.DESCR,
MATL.PBU_NBR,
MATL.PBU_NAME,
MATL.EXT_MATL_GRP_ID,
MATL.MKT_CTGY_MKT_AREA_NBR || ' - ' || MATL.MKT_CTGY_MKT_AREA_NAME AS MKT_AREA,
MATL.MKT_CTGY_MKT_GRP_NBR || ' - ' || MATL.MKT_CTGY_MKT_GRP_NAME AS MKT_GRP,
MATL.MKT_CTGY_PROD_GRP_NBR || ' - ' || MATL.MKT_CTGY_PROD_GRP_NAME AS PROD_GRP,
MATL.MKT_CTGY_PROD_LINE_NBR || ' - ' || MATL.MKT_CTGY_PROD_LINE_NAME AS PROD_LINE,
ODC.ITEM_CAT_ID,
ODC.ORDER_DT,
ODC.FRST_RDD AS FRDD,
ODC.FRST_PROM_DELIV_DT AS FCDD,
ODC.PLN_DELIV_DT AS PDD,
ODC.ORDER_QTY AS ORDER_QTY,
ODC.CNFRM_QTY AS TOTAL_CNFRM_QTY,
OOSL.OPEN_CNFRM_QTY AS OPEN_CONFIRMED_QTY,
OOSL.UNCNFRM_QTY AS UNCONFIRMED_QTY,
OOSL.BACK_ORDER_QTY AS BACK_ORDERED_QTY,
OOSL.DEFER_QTY AS DEFER_QTY,
OOSL.IN_PROC_QTY AS IN_PROC_QTY,
OOSL.WAIT_LIST_QTY AS WAIT_LIST_QTY,
OOSL.OTHR_ORDER_QTY AS OTHR_ORDER_QTY,
ODC.QTY_UNIT_MEAS_ID
FROM NA_BI_VWS.OPEN_ORDER_SCHDLN_CURR OOSL
INNER JOIN NA_BI_VWS.ORDER_DETAIL_CURR ODC
ON ODC.ORDER_ID = OOSL.ORDER_ID
AND ODC.ORDER_LINE_NBR = OOSL.ORDER_LINE_NBR
AND ODC.SCHED_LINE_NBR = OOSL.SCHED_LINE_NBR
AND ODC.CUST_GRP_ID <> '3R'
AND ODC.ORDER_TYPE_ID <> 'ZLZ'
AND ODC.RO_PO_TYPE_IND = 'N' -- AND ODC.PO_TYPE_ID <> 'RO'
INNER JOIN GDYR_BI_VWS.NAT_MATL_HIER_DESCR_EN_CURR MATL
ON MATL.MATL_ID = ODC.MATL_ID
INNER JOIN GDYR_BI_VWS.NAT_CUST_HIER_DESCR_EN_CURR CUST
ON CUST.SHIP_TO_CUST_ID = ODC.SHIP_TO_CUST_ID
AND CUST.CUST_GRP_ID <> '3R'
WHERE
FCDD > CURRENT_DATE
AND ( OPEN_CONFIRMED_QTY > 0
OR UNCONFIRMED_QTY > 0
OR BACK_ORDERED_QTY > 0 )
) OOF
WHERE
OOF.PDD > OOF.FCDD
ORDER BY
OOF.ORDER_ID,
OOF.ORDER_LINE_NBR
;
| true |
3ca9dda03d02e4d1fddf9ad660e1ddba3584bf4d | SQL | kocmoc1985/MCReplicator | /ProjectDocs/Hoogezand SAP/docs/doc_03.sql | UTF-8 | 472 | 2.984375 | 3 | [] | no_license | select * from RecipeMC1
inner join Recipe_Prop_Main
on Recipe_Prop_Main.CODE = RecipeMC1.code
where LASTUPDATE >= '2013-10-11'
and RecipeMC1.code = '00-L-3215'
//=============================================
select * from Recipe_Prop_Main
where CODE = '00-L-3215'
//=============================================
select * from RecipeMC1
inner join Recipe_Prop_Main
on Recipe_Prop_Main.CODE = RecipeMC1.code
where RecipeMC1.code = '00-L-3215'
order by RecipeMC1.material | true |
c92c666f794df160ba9e1d5e6d46f935a4cb232e | SQL | PeterG75/Win10-Research | /Notifications/Notifications_WPNdatabase.sql | UTF-8 | 903 | 3.265625 | 3 | [
"MIT"
] | permissive | select
Notification.Id,
Notification.HandlerId as 'H_Id',
NotificationHandler.PrimaryId as 'Application',
NotificationHandler.HandlerType,
Notification.Type as 'Type',
replace(replace(replace(Notification.Payload, char(13,10,32,32,32,32,32,32,32,32),''),char(32,32),''),char(32,32,32,32),'') as 'Payload',
Notification.PayloadType as 'PayloadType',
Notification.Tag as 'Tag',
datetime((Notification.ArrivalTime - 116444736000000000)/10000000, 'unixepoch') as ArrivalTime,
case when Notification.ExpiryTime = 0 then 'Expired' else datetime((Notification.ExpiryTime - 116444736000000000)/10000000, 'unixepoch') end as ExpiryTime,
NotificationHandler.CreatedTime as 'H_Created',
NotificationHandler.ModifiedTime as 'H_Modified',
hex(Notification.ActivityId) as 'ActivityId'
from Notification
Join NotificationHandler on NotificationHandler.RecordId = Notification.HandlerId
order by Id desc | true |
b6a2cb41154d20bc9f91441507e5bb35b7c68e07 | SQL | vargabrigitta/quiz-projekt | /eredmenyek.sql | UTF-8 | 377 | 2.671875 | 3 | [] | no_license | CREATE TABLE `eredmenyek` (
`id` int(11) NOT NULL,
`nev` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`pontszam` int(11) NOT NULL,
`datum` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
ALTER TABLE `eredmenyek`
ADD PRIMARY KEY (`id`);
ALTER TABLE `eredmenyek`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=0;
COMMIT;
| true |
ca42e165d510284f744c2ee41d7e1c43a9deaf53 | SQL | OumaDennisOmondi/Ticketify | /ticketify.sql | UTF-8 | 34,247 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 13, 2020 at 12:49 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ticketify`
--
-- --------------------------------------------------------
--
-- Table structure for table `accounts`
--
CREATE TABLE `accounts` (
`account_id` int(11) NOT NULL,
`title` varchar(5) DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(50) NOT NULL,
`country` varchar(5) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL,
`account_type` enum('webadmin','admin','supplier','customers','guest') NOT NULL,
`is_admin` tinyint(4) NOT NULL DEFAULT 0,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`status` tinyint(4) NOT NULL DEFAULT 0,
`last_login` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `accounts`
--
INSERT INTO `accounts` (`account_id`, `title`, `first_name`, `last_name`, `email`, `password`, `country`, `phone`, `account_type`, `is_admin`, `created_at`, `updated_at`, `status`, `last_login`) VALUES
(1, '', 'Super Admin', 'Admin', 'admin@ticketify.co.ke', '1d015534eb84160e80661633eec431c2b4fa1ca3', 'KE', '+254728979121', 'webadmin', 1, '1901-02-16 11:41:04', '2019-12-30 23:53:29', 1, 1591028768),
(14, '0', 'Ticketify', 'Admin', 'info@ticketify.co.ke', '4faf30542bd9b2ef6522d87f99ae827f4a54746c', 'AU', '123456', 'customers', 1, '2014-04-16 12:51:46', '2016-01-13 07:03:35', 1, 1589745725),
(27, '', 'Qasim', 'Hussain', 'compoxition@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', 'PK', '+923311442244', 'guest', 0, '2018-10-22 17:36:49', '2018-10-22 17:36:49', 0, NULL),
(28, '', 'Qasim', 'Hussain', 'info@ajubia.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', 'PK', '+923311442244', 'guest', 0, '2018-11-01 16:14:41', '2018-11-01 16:14:41', 0, NULL),
(29, '', 'Qasim', 'Hussain', 'info@ajubia.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', 'PK', '+923311442244', 'guest', 0, '2018-11-01 17:01:14', '2018-11-01 17:01:14', 0, NULL),
(30, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', 'KE', '715073891', 'guest', 0, '2018-11-06 12:50:49', '2018-11-06 12:50:49', 0, NULL),
(31, '', 'simon', 'wambua', 'simonwambua433@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0714980550', 'guest', 0, '2018-11-06 15:29:48', '2018-11-06 15:29:48', 0, NULL),
(32, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', 'KE', '700596279', 'guest', 0, '2018-11-06 17:26:13', '2018-11-06 17:26:13', 0, NULL),
(33, '', 'omar', 'Shark ', 'hiloxy1@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0728979121', 'guest', 0, '2018-11-06 17:53:15', '2018-11-06 17:53:15', 0, NULL),
(34, '', 'omar', 'adan ', 'hiloxy1@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0728979121', 'guest', 0, '2018-11-06 17:55:31', '2018-11-06 17:55:31', 0, NULL),
(35, '', 'omar', 'adan', 'hiloxy1@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0728979121', 'guest', 0, '2018-11-06 17:57:03', '2018-11-06 17:57:03', 0, NULL),
(36, '', 'omar', 'adan', 'hiloxy1@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0728979121', 'guest', 0, '2018-11-06 17:58:47', '2018-11-06 17:58:47', 0, NULL),
(37, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', 'KE', '700596279', 'guest', 0, '2018-11-06 18:19:33', '2018-11-06 18:19:33', 0, NULL),
(38, '', 'chripsus', 'onyono', 'chrispusonyono@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0700824555', 'guest', 0, '2018-11-07 06:17:28', '2018-11-07 06:17:28', 0, NULL),
(39, '', 'Omar', 'Adan', 'hiloxy@hotmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', 'BE', '0728979121', 'guest', 0, '2018-11-08 13:02:31', '2018-11-08 13:02:31', 0, NULL),
(40, '', 'sfff', 'rdty', 'simonwambua433@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '0755523', 'guest', 0, '2018-11-08 13:57:26', '2018-11-08 13:57:26', 0, NULL),
(41, '', 'sfff', 'rdty', 'simonwambua433@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '0755523', 'guest', 0, '2018-11-08 13:58:32', '2018-11-08 13:58:32', 0, NULL),
(42, '', 'sfff', 'rdty', 'simonwambua433@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0755523', 'guest', 0, '2018-11-08 13:59:20', '2018-11-08 13:59:20', 0, NULL),
(43, '', 'polooo', 'kavoo', 'pkavoo@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', NULL, '071500', 'guest', 0, '2018-11-08 17:35:57', '2018-11-08 17:35:57', 0, NULL),
(44, '', 'poiiiii', 'jultouyuiu', 'pkavoo@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '0715073891', 'guest', 0, '2018-11-08 17:47:30', '2018-11-08 17:47:30', 0, NULL),
(45, '', 'hello', 'hjkf', 'pkavoo4@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0728979121', 'guest', 0, '2018-11-08 17:53:22', '2018-11-08 17:53:22', 0, NULL),
(46, '', 'polycarpkavoo', 'kavoo', 'pkavoo@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0715073891', 'guest', 0, '2018-11-08 17:56:22', '2018-11-08 17:56:22', 0, NULL),
(47, '', 'ghj', 'gjugh', 'pkavoo4@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '07831884558', 'guest', 0, '2018-11-08 17:57:56', '2018-11-08 17:57:56', 0, NULL),
(48, '', 'simon', 'wambua', 'simonwambua433@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0714980450', 'guest', 0, '2018-11-08 18:00:37', '2018-11-08 18:00:37', 0, NULL),
(49, '', 'simon', 'wambua', 'simonwambua433@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', NULL, '2880866', 'guest', 0, '2018-11-08 18:02:47', '2018-11-08 18:02:47', 0, NULL),
(50, '', 'simon', 'wambua', 'simonwambua433@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '071425369855', 'guest', 0, '2018-11-08 18:05:03', '2018-11-08 18:05:03', 0, NULL),
(51, '', 'simon', 'wambua', 'simonwambua433@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', NULL, '071425369855', 'guest', 0, '2018-11-08 18:05:08', '2018-11-08 18:05:08', 0, NULL),
(52, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', 'KE', '700596279', 'guest', 0, '2018-11-08 20:03:55', '2018-11-08 20:03:55', 0, NULL),
(53, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0715073891', 'guest', 0, '2018-11-10 02:44:31', '2018-11-10 02:44:31', 0, NULL),
(54, '', 'polycarpkavoo', 'kavoo', 'pkavoo4@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0715073891', 'guest', 0, '2018-11-12 13:25:02', '2018-11-12 13:25:02', 0, NULL),
(55, '', 'ffhhfjfhfh', 'jngghh', 'pkavoo@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0755955555', 'guest', 0, '2018-11-12 13:41:58', '2018-11-12 13:41:58', 0, NULL),
(56, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '0715423948', 'guest', 0, '2018-11-12 18:14:32', '2018-11-12 18:14:32', 0, NULL),
(57, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0715423548', 'guest', 0, '2018-11-12 18:16:39', '2018-11-12 18:16:39', 0, NULL),
(58, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0715423948', 'guest', 0, '2018-11-12 18:16:57', '2018-11-12 18:16:57', 0, NULL),
(59, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', 'KE', '700596279', 'guest', 0, '2018-11-13 00:16:36', '2018-11-13 00:16:36', 0, NULL),
(60, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', 'KE', '700596279', 'guest', 0, '2018-11-13 01:30:13', '2018-11-13 01:30:13', 0, NULL),
(61, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', 'KE', '700596279', 'guest', 0, '2018-11-13 01:34:05', '2018-11-13 01:34:05', 0, NULL),
(62, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', NULL, '0715073891', 'guest', 0, '2018-11-13 12:44:46', '2018-11-13 12:44:46', 0, NULL),
(63, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', 'KE', '0715073891', 'guest', 0, '2018-11-13 12:49:13', '2018-11-13 12:49:13', 0, NULL),
(64, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', NULL, '0715073891', 'guest', 0, '2018-11-13 16:09:14', '2018-11-13 16:09:14', 0, NULL),
(65, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0715073891', 'guest', 0, '2018-11-13 16:14:58', '2018-11-13 16:14:58', 0, NULL),
(66, '', 'polycarp', 'hhahag', 'pkavoo4@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0728979121', 'guest', 0, '2018-11-13 16:18:59', '2018-11-13 16:18:59', 0, NULL),
(67, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', 'KE', '700596279', 'guest', 0, '2018-11-13 17:26:47', '2018-11-13 17:26:47', 0, NULL),
(68, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', 'KE', '0715073891', 'guest', 0, '2018-11-13 17:29:35', '2018-11-13 17:29:35', 0, NULL),
(69, '', 'simon', 'wambua', 'simonwambua433@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0714255477', 'guest', 0, '2018-11-13 20:09:55', '2018-11-13 20:09:55', 0, NULL),
(70, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', 'KE', '0715073891', 'guest', 0, '2018-11-13 20:35:07', '2018-11-13 20:35:07', 0, NULL),
(71, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', 'KE', '0715073891', 'guest', 0, '2018-11-13 20:38:23', '2018-11-13 20:38:23', 0, NULL),
(72, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', 'KE', '0715073891', 'guest', 0, '2018-11-13 20:41:06', '2018-11-13 20:41:06', 0, NULL),
(73, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', '', '0715073891', 'guest', 0, '2018-11-13 21:09:28', '2018-11-13 21:09:28', 0, NULL),
(74, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', 'KE', '715073891', 'guest', 0, '2018-11-14 16:43:43', '2018-11-14 16:43:43', 0, NULL),
(75, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', 'KE', '715073891', 'guest', 0, '2018-11-14 17:12:55', '2018-11-14 17:12:55', 0, NULL),
(76, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', 'KE', '700596279', 'guest', 0, '2018-11-14 17:30:56', '2018-11-14 17:30:56', 0, NULL),
(77, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', 'KE', '715073891', 'guest', 0, '2018-11-14 17:43:31', '2018-11-14 17:43:31', 0, NULL),
(78, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', 'KE', '700596279', 'guest', 0, '2018-11-14 17:47:01', '2018-11-14 17:47:01', 0, NULL),
(79, '', 'omar', 'adan ', 'hiloxy1@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', NULL, '0728979121', 'guest', 0, '2018-11-14 17:53:46', '2018-11-14 17:53:46', 0, NULL),
(80, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', 'KE', '700596279', 'guest', 0, '2018-11-14 18:06:07', '2018-11-14 18:06:07', 0, NULL),
(81, '', 'Omar', 'Hillowle', 'hiloxy1@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', 'KE', '0728979121', 'guest', 0, '2018-11-14 22:20:55', '2018-11-14 22:20:55', 0, NULL),
(82, '', 'HILLOW', 'ADAN', 'smartwaygtl@gmail.com', 'd596cf807df18b5afe31469e31dbbf9efa6fca69', 'KE', '700596279', 'supplier', 0, '2018-11-15 00:00:34', '2020-06-23 21:15:44', 1, NULL),
(83, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', 'KE', '715073891', 'guest', 0, '2018-11-15 09:59:31', '2018-11-15 09:59:31', 0, NULL),
(84, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'f1abd670358e036c31296e66b3b66c382ac00812', '', '0715073891', 'guest', 0, '2018-11-15 10:07:18', '2018-11-15 10:07:18', 0, NULL),
(85, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0715073891', 'guest', 0, '2018-11-15 14:46:30', '2018-11-15 14:46:30', 0, NULL),
(86, '', 'John', 'Smith', 'Johnsmith@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0712345543', 'guest', 0, '2018-11-15 14:54:26', '2018-11-15 14:54:26', 0, NULL),
(87, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '0715073891', 'guest', 0, '2018-11-16 12:01:21', '2018-11-16 12:01:21', 0, NULL),
(88, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', 'KE', '700596279', 'guest', 0, '2018-11-18 20:47:39', '2018-11-18 20:47:39', 0, NULL),
(89, '', 'Hillow', 'Omar', 'hiloxy1@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', 'KE', '254728979121', 'guest', 0, '2018-11-19 04:20:08', '2018-11-19 04:20:08', 0, NULL),
(90, '', 'polycarpkavoo', 'thanks', 'pkavoo@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0715073891', 'guest', 0, '2018-11-24 12:13:28', '2018-11-24 12:13:28', 0, NULL),
(91, '', 'kenya', 'gggg', 'pkavoo@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0700824555', 'guest', 0, '2018-11-25 07:16:51', '2018-11-25 07:16:51', 0, NULL),
(92, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '0715073891', 'guest', 0, '2018-11-25 07:18:49', '2018-11-25 07:18:49', 0, NULL),
(93, '', 'christest', 'test', 'chrispus@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0700824555', 'guest', 0, '2018-11-25 07:19:36', '2018-11-25 07:19:36', 0, NULL),
(94, '', 'HILLOW', 'ADAN', 'hiloxy1@gmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', 'KE', '700596279', 'guest', 0, '2018-11-26 18:08:49', '2018-11-26 18:08:49', 0, NULL),
(95, '', 'hillow', 'omar', 'hiloxy@hotmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '0728979121', 'guest', 0, '2018-11-27 22:48:04', '2018-11-27 22:48:04', 0, NULL),
(96, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '0715073891', 'guest', 0, '2018-11-28 08:16:17', '2018-11-28 08:16:17', 0, NULL),
(97, '', 'hillow ', 'omar ', 'hiloxy@Hotmail.com', '7b52009b64fd0a2a49e6d8a939753077792b0554', NULL, '0728979121', 'guest', 0, '2018-11-28 08:57:24', '2018-11-28 08:57:24', 0, NULL),
(98, '', 'hillow ', 'omar ', 'hiloxy@Hotmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0728979121', 'guest', 0, '2018-11-28 08:59:17', '2018-11-28 08:59:17', 0, NULL),
(99, '', 'hillow ', 'omar ', 'hiloxy@hotmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0728979121', 'guest', 0, '2018-11-28 09:01:04', '2018-11-28 09:01:04', 0, NULL),
(100, '', 'hillow ', 'omar ', 'hiloxy@Hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979121', 'guest', 0, '2018-11-28 09:02:15', '2018-11-28 09:02:15', 0, NULL),
(101, '', 'hillow', 'omar', 'hiloxy@Hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979121', 'guest', 0, '2018-11-28 09:04:45', '2018-11-28 09:04:45', 0, NULL),
(102, '', 'hillow ', 'omar ', 'hiloxy@Hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979121', 'guest', 0, '2018-11-28 09:06:37', '2018-11-28 09:06:37', 0, NULL),
(103, '', 'hillow', 'omar', 'hiloxy@Hotmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '0728979121', 'guest', 0, '2018-11-28 09:08:41', '2018-11-28 09:08:41', 0, NULL),
(104, '', 'hillow', 'omar', 'hiloxy@hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2018-11-28 09:17:10', '2018-11-28 09:17:10', 0, NULL),
(105, NULL, 'hillow ', 'omar ', 'sgtcompanylimited@gmail.com', '0a92452640f8ab32c5f23c6bcab9e69d212f3abb', NULL, '0728979121', 'customers', 0, '2018-11-28 13:34:20', '2018-11-28 13:34:20', 2, NULL),
(106, '', 'hillow ', 'omar ', 'hiloxy@Hotmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0728979121', 'guest', 0, '2018-11-28 13:40:20', '2018-11-28 13:40:20', 0, NULL),
(107, '', 'hillow ', 'omar', 'hiloxy@Hotmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0728949121', 'guest', 0, '2018-12-04 13:49:53', '2018-12-04 13:49:53', 0, NULL),
(108, '', 'polycarp', 'kavoo', 'pkavoo@gmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', NULL, '071599988', 'guest', 0, '2018-12-04 13:58:57', '2018-12-04 13:58:57', 0, NULL),
(109, '', 'omat', 'aran', 'hiloxy@hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979421', 'guest', 0, '2018-12-07 19:38:10', '2018-12-07 19:38:10', 0, NULL),
(110, '', 'hillo', 'omar', 'hiloxy@Hotmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0728979121', 'guest', 0, '2018-12-07 19:39:28', '2018-12-07 19:39:28', 0, NULL),
(111, '', 'hhguy', 'gfgh', 'hiloxy@hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2018-12-07 19:41:25', '2018-12-07 19:41:25', 0, NULL),
(112, '', 'hghug', 'ggdgc', 'hiloxy@hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2018-12-07 19:46:37', '2018-12-07 19:46:37', 0, NULL),
(113, '', 'hillow', 'omar', 'hiloxy@Hotmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0728979121', 'guest', 0, '2018-12-08 14:59:45', '2018-12-08 14:59:45', 0, NULL),
(114, '', 'hhfhh', 'hghfhh', 'hiloxy@hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2018-12-08 15:08:35', '2018-12-08 15:08:35', 0, NULL),
(115, '', 'high', 'cjgjhh', 'hiloxy@Hotmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0728979121', 'guest', 0, '2018-12-08 17:12:25', '2018-12-08 17:12:25', 0, NULL),
(116, '', 'ahmed', 'omar', 'hiloxy@Hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979121', 'guest', 0, '2018-12-09 20:51:37', '2018-12-09 20:51:37', 0, NULL),
(117, '', 'utter', 'rtyuy', 'xiishibrahim@Gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0713333333', 'guest', 0, '2018-12-16 15:41:35', '2018-12-16 15:41:35', 0, NULL),
(118, '', 'hhhhh', 'Bibb', 'hiloxy@hotmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', NULL, '0728979121', 'guest', 0, '2018-12-16 15:52:11', '2018-12-16 15:52:11', 0, NULL),
(119, '', 'Hussein ', 'Abdullahi ', 'xiishibrahim@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', NULL, '0713333318', 'guest', 0, '2019-01-02 17:14:20', '2019-01-02 17:14:20', 0, NULL),
(120, '', 'hhjv', 'ghjvh', 'hiloxy@Hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2019-01-02 18:07:32', '2019-01-02 18:07:32', 0, NULL),
(121, '', 'Hussein ', 'a badu llahi', 'xiishibrahim@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0713333318', 'guest', 0, '2019-01-02 18:31:19', '2019-01-02 18:31:19', 0, NULL),
(122, '', 'Hussein ', 'a badu llahi', 'xiishibrahim@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0713333318', 'guest', 0, '2019-01-02 18:36:05', '2019-01-02 18:36:05', 0, NULL),
(123, '', 'Polycarp', 'Kavoo', 'pkavoo@gmail.com', 'b1d5781111d84f7b3fe45a0852e59758cd7a87e5', 'KE', '715073891', 'guest', 0, '2019-01-03 09:24:20', '2019-01-03 09:24:20', 0, NULL),
(124, '', 'test', 'TEST', 'test@gmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', 'KE', '712345678', 'guest', 0, '2019-01-03 12:48:06', '2019-01-03 12:48:06', 0, NULL),
(125, '', 'foggy', 'cvgh', 'hiloxy@Hotmail.com', 'c1dfd96eea8cc2b62785275bca38ac261256e278', NULL, '0728979121', 'guest', 0, '2019-01-03 15:39:53', '2019-01-03 15:39:53', 0, NULL),
(126, '', 'test', 'test', 'alex.mathenge@paynow.io', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', 'KE', '+254700000000', 'guest', 0, '2019-01-04 10:19:23', '2019-01-04 10:19:23', 0, NULL),
(127, '', 'alvin', 'opiyo', 'a.musungu@wizag.biz', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', 'KE', '041-2229784/6', 'guest', 0, '2019-01-04 14:09:29', '2019-01-04 14:09:29', 0, NULL),
(128, '', 'Hussein', 'Abdullahi', 'xiishibrahim@gmail.com', '902ba3cda1883801594b6e1b452790cc53948fda', NULL, '0713333318', 'guest', 0, '2019-01-05 17:03:00', '2019-01-05 17:03:00', 0, NULL),
(129, '', 'Hussein', 'Abdullahi', 'xiishibrahim@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0713333318', 'guest', 0, '2019-01-05 17:03:48', '2019-01-05 17:03:48', 0, NULL),
(130, '', 'Hussein', 'Abdullahi ', 'xiishibrahim@Gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0713333318', 'guest', 0, '2019-01-12 12:32:24', '2019-01-12 12:32:24', 0, NULL),
(131, '', 'Hussein ', 'Abdullah ', 'xiishibrahim@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0713333318', 'guest', 0, '2019-01-12 12:36:44', '2019-01-12 12:36:44', 0, NULL),
(132, '', 'Hussein ', 'Abdullah ', 'xiishibrahim@gmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0713333318', 'guest', 0, '2019-01-12 12:38:12', '2019-01-12 12:38:12', 0, NULL),
(133, '', 'fatsys', 'dysydy', 'pkavoo@gmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0715073891', 'guest', 0, '2019-01-16 17:06:16', '2019-01-16 17:06:16', 0, NULL),
(134, '', 'fcb', 'Ben', 'hnvh@Hotmail.com', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0728979121', 'guest', 0, '2019-01-17 15:29:35', '2019-01-17 15:29:35', 0, NULL),
(135, '', 'xxxxx', 'xxxxx', 'xxxx@xxx.com', '17ba0791499db908433b80f37c5fbc89b870084b', 'KE', '715073891', 'guest', 0, '2019-01-28 11:55:53', '2019-01-28 11:55:53', 0, NULL),
(136, '', 'Hillow ', 'omar ', 'hiloxy@Hotmail.cm', 'fa35e192121eabf3dabf9f5ea6abdbcbc107ac3b', NULL, '0728979121', 'guest', 0, '2019-01-28 19:15:41', '2019-01-28 19:15:41', 0, NULL),
(137, '', 'Hussein ', 'Abdullahi ', 'xiishibrahim@gmail.com', 'bd307a3ec329e10a2cff8fb87480823da114f8f4', NULL, '0713333318', 'guest', 0, '2019-01-31 22:01:51', '2019-01-31 22:01:51', 0, NULL),
(138, '', 'Ваше поздравление ко Дню Рождения - https://www.ma', 'Ваше поздравление ко Дню Рождения - https://www.ma', 'mashapentagon@mail.ru', '12', 'FR', '+74958401438', 'supplier', 0, '2019-03-20 21:07:18', '2019-03-20 21:07:18', 2, NULL),
(139, '', 'Sarova', 'Sarova', 'sarova@sarova.com', '7c222fb2927d828af22f592134e8932480637c0d', 'KE', '0722222222', 'supplier', 0, '2019-04-20 11:01:37', '2019-04-20 11:07:55', 1, NULL),
(140, '', 'Hillow ', 'omar ', 'hiloxy@Hotmail.com', 'fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f', NULL, '0728979121', 'guest', 0, '2019-06-29 21:53:54', '2019-06-29 21:53:54', 0, NULL),
(141, '', 'Hillow ', 'omar ', 'hiloxy@Hotmail.com', '0ade7c2cf97f75d009975f4d720d1fa6c19f4897', NULL, '0728979121', 'guest', 0, '2019-06-29 21:54:56', '2019-06-29 21:54:56', 0, NULL),
(142, '', 'Polycarp', 'Kavoo', 'pkavoo4@gmail.com', '1d055acae2b2a1a666c8211b0c1f9312dbb4ca23', 'null', '0715073891', 'customers', 0, '2019-07-27 19:14:27', '2019-07-27 19:16:03', 1, NULL),
(143, '', 'najma ', 'Elmi ', 'najmaelmi@gmail.com', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', NULL, '07845555', 'guest', 0, '2019-07-27 19:56:54', '2019-07-27 19:56:54', 0, NULL),
(144, NULL, 'Gregarious Safaris-', 'Tanzania ', 'gregarioussafaris@gmail.com', '445dfb70f8e3898369a17d7441e770de4e722c0c', NULL, '0782937248', 'customers', 0, '2019-08-23 21:53:50', '2019-08-23 21:53:50', 2, NULL),
(145, '', 'zGyudfg', 'fhhf', 'korirmitchelle@gmail.com', '17ba0791499db908433b80f37c5fbc89b870084b', NULL, '0702935200', 'guest', 0, '2019-08-30 12:40:11', '2019-08-30 12:40:11', 0, NULL),
(146, '', 'Beaconuni', 'Beaconuni', 'jkcabinets@aol.com', '14', 'PA', '83764766875', 'supplier', 0, '2019-09-19 04:20:49', '2019-09-19 04:20:49', 2, NULL),
(147, '', 'Flashpaqhhp', 'Flashpaqhhp', 'allisha-s@hotmail.com', '13', 'SI', '84271181851', 'supplier', 0, '2019-10-02 23:34:06', '2019-10-02 23:34:06', 2, NULL),
(148, '', 'Incipiooxk', 'Incipiooxk', 'jeannette_freeman@yahoo.com', '11', 'VA', '83774728611', 'supplier', 0, '2019-10-03 11:29:02', '2019-10-03 11:29:02', 2, NULL),
(149, '', 'kislorodul', 'kislorodul', 'ewfewpkeofpkweop@mail.ru', '12', 'RU', '89523518694', 'supplier', 0, '2020-01-20 08:10:18', '2020-01-20 08:10:18', 2, NULL),
(150, '', 'Edelbrockzhc', 'Edelbrockzhc', 'a.carrillo0428@gmail.com', '6', 'ID', '85119572793', 'supplier', 0, '2020-01-20 17:53:04', '2020-01-20 17:53:04', 2, NULL),
(151, NULL, 'Francis', 'Muturi', 'francmut@gmail.com', '3c3253ad7bd155ff6482ad429ff6960fe785d7ae', NULL, NULL, 'webadmin', 0, NULL, NULL, 1, NULL),
(152, '', 'polycarp', 'kavoo', 'wambuasimon433@gmail.com', '7c222fb2927d828af22f592134e8932480637c0d', 'KE', '0715073891', 'customers', 0, '2020-05-17 13:41:11', '2020-05-17 13:43:12', 1, NULL),
(156, '', 'Test', 'User', 'test.user@email.com', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', NULL, '0722001001', 'customers', 0, '2020-05-18 00:30:14', '2020-05-18 00:30:14', 1, NULL),
(157, NULL, 'Zakaria', 'Hussein', 'samsunholdings11@gmail.com', 'be51f5f08ff584a14f608d69d36334cfe39f457b', NULL, NULL, 'webadmin', 0, NULL, NULL, 1, NULL),
(158, NULL, 'Zakaria', 'Hussein', 'info@samsunholdings.com', 'be51f5f08ff584a14f608d69d36334cfe39f457b', NULL, NULL, 'webadmin', 0, NULL, NULL, 1, NULL),
(159, NULL, 'Dennis', 'Omondi', 'oumadennisomondi@gmail.com', 'adb1136b8997eb01965fe6f03e98b7684302e8a6', NULL, NULL, 'webadmin', 0, NULL, NULL, 1, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `airports`
--
CREATE TABLE `airports` (
`id` int(11) NOT NULL,
`code` varchar(4) DEFAULT NULL,
`name` varchar(48) DEFAULT NULL,
`cityCode` varchar(8) DEFAULT NULL,
`cityName` varchar(32) DEFAULT NULL,
`countryName` varchar(36) DEFAULT NULL,
`countryCode` varchar(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `airports`
--
INSERT INTO `airports` (`id`, `code`, `name`, `cityCode`, `cityName`, `countryName`, `countryCode`) VALUES
(804, 'LAU', 'Lamu-Manda Airpott', 'LAU', 'Lamu', 'KENYA', 'KE'),
(879, 'LKG', 'Lokichoggio Arpt', 'LKG', 'Lokichoggio', 'KENYA', 'KE'),
(987, 'MBA', 'Mombasa-Moi International Airport', 'MBA', 'Mombasa', 'KENYA', 'KE'),
(1267, 'KIS', 'Kisumu-Kisumu International Airport', 'KIS', 'Kisumu', 'KENYA', 'KE'),
(1409, 'MRE', 'Mara Lodges Arpt', 'MRE', 'Mara Lodges', 'KENYA', 'KE'),
(2331, 'MYD', 'Malindi Arpt', 'MYD', 'Malindi', 'KENYA', 'KE'),
(2360, 'NBO', 'Nairobi-Jomo Kenyatta Int.Airport', 'NBO', 'Nairobi', 'KENYA', 'KE'),
(2434, 'NYK', 'Nanyuki Airport', 'NYK', 'Nanyuki', 'KENYA', 'KE'),
(2891, 'UAS', 'Samburu Airstrip', 'UAS', 'Samburu', 'KENYA', 'KE'),
(3524, 'LOK', 'Lodwar Airport', 'LOK', 'Lodwar', 'KENYA', 'KE'),
(3596, 'WJR', 'Wajir Airport', 'WJR', 'Wajir', 'KENYA', 'KE'),
(3975, 'GAS', 'Garissa Airport', 'GAS', 'Garissa', 'KENYA', 'KE'),
(3986, 'KLK', 'Kalokol Airport', 'KLK', 'Kalokol', 'KENYA', 'KE'),
(4020, 'LBK', 'Liboi Airport', 'LBK', 'Liboi', 'KENYA', 'KE'),
(4022, 'LBN', 'Lake Baringo Airport', 'LBN', 'Lake Baringo', 'KENYA', 'KE'),
(4493, 'NZO', 'Nzoia Airport', 'NZO', 'Nzoia', 'KENYA', 'KE'),
(4625, 'ILU', 'Kilaguni Airport', 'ILU', 'Kilaguni', 'KENYA', 'KE'),
(4884, 'NDE', 'Mandera Airport', 'NDE', 'Mandera', 'KENYA', 'KE'),
(5060, 'OYL', 'Moyale Airport', 'OYL', 'Moyale', 'KENYA', 'KE'),
(5137, 'RBT', 'Marsabit Airport', 'RBT', 'Marsabit', 'KENYA', 'KE'),
(5290, 'KRV', 'Kerio Valley Airport', 'KRV', 'Kerio Valley', 'KENYA', 'KE'),
(5308, 'KWY', 'Kiwayu Airport', 'KWY', 'Kiwayu', 'KENYA', 'KE'),
(5349, 'LKU', 'Lake Rudolf Airport', 'LKU', 'Lake Rudolf', 'KENYA', 'KE'),
(5353, 'LOY', 'Loyangalani Airport', 'LOY', 'Loyangalani', 'KENYA', 'KE'),
(5802, 'BMQ', 'Bamburi Airport', 'BMQ', 'Bamburi', 'KENYA', 'KE'),
(5917, 'HOA', 'Hola Airport', 'HOA', 'Hola', 'KENYA', 'KE'),
(6534, 'NUU', 'Nakuru Airport', 'NUU', 'Nakuru', 'KENYA', 'KE'),
(6873, 'EYS', 'Elive Springs Airport', 'EYS', 'Elive Springs', 'KENYA', 'KE'),
(7228, 'KTL', 'Kitale Airport', 'KTL', 'Kitale', 'KENYA', 'KE'),
(7260, 'KEY', 'Kericho Airport', 'KEY', 'Kericho', 'KENYA', 'KE'),
(7769, 'UKA', 'Ukunda Airport', 'UKA', 'Ukunda', 'KENYA', 'KE'),
(7778, 'KIU', 'Kiunga Airport', 'KIU', 'Kiunga', 'KENYA', 'KE'),
(7847, 'WIL', 'Nairobi-Wilson Airport', 'NBO', 'Nairobi', 'KENYA', 'KE'),
(8362, 'MUM', 'Mumias Airport', 'MUM', 'Mumias', 'KENYA', 'KE'),
(8577, 'EDL', 'Eldoret Arpt', 'EDL', 'Eldoret', 'KENYA', 'KE'),
(8653, 'NYE', 'Nyeri Arpt', 'NYE', 'Nyeri', 'KENYA', 'KE'),
(8654, 'ZNZ', 'Zanzibar- Zanzibar Airport,TZ', 'ZNZ', 'Zanzibar', 'Tanzania', '256'),
(8655, 'DAR', 'Dar es Salaam-Mwalimu Julius K.Nyerere Int.Airpt', '003', 'Dareesalam', 'Tanzania', '256'),
(8656, 'EBB', 'Entebbe International Airport,UG', 'EBB', 'Entebbe', 'Uganda', NULL),
(8657, 'JIN', 'Jinja-Jinja Airport,UG', 'JIN', 'Jinja', 'Uganda', 'UG'),
(8658, 'KSE', 'Kasese-Kasese Airport,UG', 'KSE', 'Kasese', 'Uganda', 'UG'),
(8659, 'KDPO', 'Kidpeo Airport', 'KIDPO', 'Kidepeo', 'Uganda', 'UG'),
(8660, 'KHX', 'Kihihi', 'KHX', 'Kihihi', 'Uganda', 'UG'),
(8661, 'KSRO', 'Kisoro Airport', 'KSRO', 'Kisoro', 'Uganda', 'UG'),
(8662, 'PAF', 'Pakuba Airport', 'PAF', 'Pakuba', 'Uganda', 'UG'),
(8663, 'SMKO', 'Semuliki Park', 'SMKO', 'Semuliki', 'Uganda', 'UG'),
(8664, 'ARK', 'Arusha-Arusha Airport', 'ARK', 'Arusha', 'Tanzania', 'TZ'),
(8665, 'BKZ', 'Bukoba-Bukoba Airport,TZ', 'BKZ', 'Bukoba', 'Tanzania', 'TZ'),
(8666, 'DOD', 'Dodoma-Dodoma Airport,TZ', 'DOD', 'Dodoma', 'Tanzania', 'TZ'),
(8667, 'DO10', 'Dolly for Kiligolf', 'DO10', 'Dolly for Kiligolf', 'Tanzania', 'TZ'),
(8668, 'DOL8', 'Dolly for Kiligolf', 'DOL8', 'Dolly for Kiligolf', 'Tanzania', 'TZ'),
(8669, 'IKO0', 'Fort Ikoma-Airport of Fort Ikoma,TZ', 'IKO0', 'Fort Ikoma', 'Tanzania', 'TZ'),
(8670, 'FPT1', 'Fort Portal', 'FPT18', 'Fort Portal', 'Tanzania', 'TZ'),
(8671, 'GTZ', 'Grumeti-Grumeti Airstrip Airpor', 'GTZ', 'Grumeti', 'Tanzania', 'TZ'),
(8672, 'IRI', 'Iringa-Iringa Airport', 'Iringa', 'IRI', 'Tanzania', 'TZ'),
(8673, 'TKQ', 'Kigoma-Kigoma Airport,TZ', 'TKQ', 'Kigoma', 'Tanzania', 'TZ'),
(8674, 'JRO', 'Kilimanjaro-Kilimanjaro Inter. Airport,TZ', 'JRO', 'Kilimanjaro', 'Tanzania', 'TZ'),
(8675, 'KIY', 'Kilwa Masoko,TZ', 'KIY', 'Kilwa Masoko', 'Tanzania', 'TZ'),
(8676, 'KUR0', 'Kuro Airstrip Tarangire - TZ', 'KUR0', 'Kuro', 'Tanzania', 'TZ'),
(8677, 'LKY', 'Lake Manyara Airport,TZ', 'LKY', 'Lake Manyara Park', 'Tanzania', 'TZ'),
(8678, 'LAM0', 'Lamai- Tanzania', 'LAM', 'Lamai', 'Tanzania', 'TZ'),
(8679, 'MFA', 'Mafia Island- Mafia Island Airport,TZ', 'MFA', 'Mafia Island', 'Tanzania', 'TZ'),
(8680, 'MBI', 'Mbeya-Mbeya Airport,TZ', 'MBI', 'Mbeya', 'Tanzania', 'TZ'),
(8681, 'MK10', 'Mkomazi- Tanzania', 'MK10', 'Mkomazi', 'Tanzania', 'TZ'),
(8682, 'MOG0', 'Morogoro- Morogoro airport,TZ', 'MOG0', 'Morogoro', 'Tanzania', 'TZ'),
(8683, 'QSI0', 'Moshi- Tanzania', 'QSI0', 'Moshi', 'Tanzania', 'TZ'),
(8684, 'TMP0', 'Mpanda-Mpanda Airport,TZ', 'TMP0', 'Mpanda', 'Tanzania', 'TZ'),
(8685, 'MUZ', 'Musoma- Tanzania', 'MUZ', 'Musoma', 'Tanzania', 'TZ'),
(8686, 'MWZ', 'Mwanza- Mwanza Airport,TZ', 'MWZ', 'Mwanza', 'Tanzania', 'TZ'),
(8687, 'MW10', 'Mwiba- Tanzania', 'MW10', 'Mwiba', 'Tanzania', 'TZ'),
(8688, 'PAN0', 'Pangani- Tanzania', 'PAN0', 'Pangani', 'Tanzania', 'TZ'),
(8689, 'PMA', 'Pemba-Pemba Airport,TZ', 'PMA', 'Pemba', 'Tanzania', 'TZ'),
(8690, 'RU10', 'Ruaha National Park- Airport Jongomero,TZ', 'RU10', 'Ruaha', 'Tanzania', 'TZ'),
(8691, 'KLE0', 'Serengeti - Kleins Camp-TZ', 'KLE0', 'Serengeti', 'Tanzania', 'TZ'),
(8692, 'LOB0', 'Serengeti - Lobo- Tanzania (LOB)', 'LOB0', 'Serengeti', 'Tanzania', 'TZ'),
(8693, 'SEU', 'Serengeti - Seronera- TZ', 'SEU', 'Serengeti', 'Tanzania', 'TZ'),
(8694, 'SGX', 'Songea- Songea Airport,TZ', 'SGX', 'Songea', 'Tanzania', 'TZ'),
(8695, 'SUT', 'Sumbawanga-Sumbawanga Airport,TZ', 'SUT', 'Sumbawanga', 'Tanzania', 'TZ'),
(8696, 'TBO', 'Tabora-Tabora Airport,TZ', 'TBO', 'Tabora', 'Tanzania', 'TZ'),
(8697, 'TGT', 'Tanga-Tanga Airport,TZ', 'TGT', 'Tanga', 'Tanzania', 'TZ'),
(8698, 'ANA', 'Masai Mara - Angama,Kenya', 'ANA', 'Masai Mara', 'KENYA', 'KE'),
(8699, 'KEU', 'Masai Mara - Keekoro,Kenya', NULL, NULL, NULL, NULL),
(8700, 'MDR', 'Masai Mara - Musiara-,Kenya', 'MDR', 'Masai Mara', 'KENYA', 'KE'),
(8701, 'KTJ', 'Masai Mara - Kichwa Tembo,Kenya', 'KTJ', 'Masai Mara', 'KENYA', 'KE'),
(8702, 'OLG', 'Masai Mara - Olare,Kenya', 'OLG', 'Masai Mara', 'Kenya', 'KE'),
(8703, 'OLX', 'Masai Mara - Olkiombo,Kenya', 'OLX', 'Masai Mara', 'KENYA', 'KE'),
(8704, 'OSJ', 'Masai Mara - Olseki,Kenya', 'OSJ', 'Masai Mara', 'KENYA', 'KE'),
(8705, 'MRE', 'Masai Mara - Serena,Kenya', 'MRE', 'Masai Mara', 'KENYA', 'KE'),
(8706, 'ASV', 'Amboseli Airport', 'ASV', 'Amboseli', 'Kenya', 'KE'),
(8707, 'HTSG', 'Stiegler\'s', 'HTSG', 'STIEGLER\'S', 'Tanzania', 'TZ'),
(8708, 'ILU', 'Tsavo', NULL, 'Tsavo', 'Kenya', 'KE');
-- --------------------------------------------------------
--
-- Table structure for table `bookings`
--
CREATE TABLE `bookings` (
`booking_id` int(11) NOT NULL,
`booking_ref_no` varchar(17) DEFAULT NULL,
`booking_type` varchar(50) NOT NULL,
`booking_date` bigint(20) NOT NULL,
`booking_user` int(11) NOT NULL,
`booking_status` varchar(10) NOT NULL,
`booking_payment_type` varchar(100) DEFAULT NULL,
`booking_total` double NOT NULL,
`booking_amount_paid` double NOT NULL DEFAULT 0,
`booking_adults` tinyint(4) DEFAULT 1,
`booking_child` tinyint(4) DEFAULT 0,
`booking_infant` tinyint(4) NOT NULL DEFAULT 0,
`booking_curr_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`booking_curr_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`booking_payment_date` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bookings`
--
INSERT INTO `bookings` (`booking_id`, `booking_ref_no`, `booking_type`, `booking_date`, `booking_user`, `booking_status`, `booking_payment_type`, `booking_total`, `booking_amount_paid`, `booking_adults`, `booking_child`, `booking_infant`, `booking_curr_code`, `booking_curr_symbol`, `booking_payment_date`) VALUES
(1, '6582', 'flights', 1547285544, 130, 'unpaid', NULL, 516, 0, 1, 0, 0, 'USD', '$', NULL),
(2, '4017', 'flights', 1547285804, 131, 'reserved', 'directpay3g', 306, 0, 1, 0, 0, 'USD', '$', NULL),
(3, '6754', 'flights', 1547285892, 132, 'reserved', 'payonarrival', 306, 0, 1, 0, 0, 'USD', '$', NULL),
(4, '7835', 'flights', 1547647576, 133, 'unpaid', NULL, 41100, 0, 1, 0, 0, 'KES', 'KES', NULL),
(5, '1785', 'flights', 1547728175, 134, 'unpaid', NULL, 50200, 0, 1, 0, 0, 'KES', 'KES', NULL),
(6, '3187', 'hotels', 1548665753, 135, 'unpaid', NULL, 3337.2, 0, 2, NULL, 0, 'USD', '$', NULL),
(7, '3251', 'flights', 1548692141, 136, 'unpaid', NULL, 424, 0, 1, 0, 0, 'USD', '$', NULL),
(8, '0692', 'flights', 1548961311, 137, 'unpaid', NULL, 440, 0, 1, 0, 0, 'USD', '$', NULL),
(9, '36626755', 'flights', 1583237199, 151, 'unpaid', 'card', 18600, 18414, 1, 0, 0, 'KES', 'KES', NULL),
(10, '36767440', 'flights', 1595070533, 157, 'unpaid', NULL, 12950, 0, 1, 0, 0, 'KES', 'KES', NULL),
(11, '36770733', 'flights', 1595235006, 32, 'unpaid', NULL, 5950, 0, 1, 0, 0, 'KES', 'KES', NULL),
(12, '36771670', 'flights', 1595255723, 158, 'unpaid', NULL, 4950, 0, 1, 0, 0, 'KES', 'KES', NULL),
(13, '36790574', 'flights', 1596115111, 157, 'unpaid', 'card', 6950, 6880.5, 1, 0, 0, 'KES', 'KES', NULL),
(14, '36790998', 'flights', 1596129149, 157, 'unpaid', 'card', 6950, 6880.5, 1, 0, 0, 'KES', 'KES', NULL),
(15, '36791875', 'flights', 1596185486, 159, 'unpaid', '', 4950, 0, 1, 0, 0, 'KES', 'KES', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `accounts`
--
ALTER TABLE `accounts`
ADD PRIMARY KEY (`account_id`);
--
-- Indexes for table `airports`
--
ALTER TABLE `airports`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
ADD PRIMARY KEY (`booking_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `accounts`
--
ALTER TABLE `accounts`
MODIFY `account_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=160;
--
-- AUTO_INCREMENT for table `airports`
--
ALTER TABLE `airports`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8709;
--
-- AUTO_INCREMENT for table `bookings`
--
ALTER TABLE `bookings`
MODIFY `booking_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
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 */;
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.