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
9949a99778ae70fa448a075d0690fab81d86f4b3
SQL
tatstepprive/learning-latin
/src/main/resources/sql/05-create-student-input.sql
UTF-8
720
2.90625
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `learning_latin` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `learning_latin`; -- MySQL dump 10.13 Distrib 5.6.13, for osx10.6 (i386) -- -- Host: 127.0.0.1 Database: learning_latin -- ------------------------------------------------------ -- Server version 5.6.16 -- -- Table structure for table `test` -- SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS `student_input`; CREATE TABLE `student_input` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_column_lat` varchar(45) DEFAULT NULL, `second_column_lat` varchar(45) DEFAULT NULL, `gender` varchar(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; SET FOREIGN_KEY_CHECKS = 1;
true
51aff2ac8ac1bb0b80a3d753b04ddeb922f8463b
SQL
Valashu/Lahaina_Framework
/libraries/security/_doc/tables.sql
UTF-8
1,300
3.921875
4
[]
no_license
-- -- Table structure for table `role` -- CREATE TABLE `role` ( `role_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) CHARACTER SET utf8 NOT NULL, `role_type` varchar(45) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`role_id`), UNIQUE KEY `role_type_UNIQUE` (`role_type`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Role table of security library'; -- -- Dumping data for table `role` -- INSERT INTO `role` VALUES (1, 'Administrator', 'ADMIN'), (2, 'Verwalter', 'MANAGER'); -- -- Table structure for table `user` -- CREATE TABLE `user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(45) CHARACTER SET utf8 NOT NULL, `email` varchar(45) CHARACTER SET utf8 DEFAULT NULL, `password` varchar(255) NOT NULL, `role_id` int(11) NOT NULL, PRIMARY KEY (`user_id`), KEY `fk_role_id_idx` (`user_id`), KEY `role_id` (`role_id`), CONSTRAINT `FK_user_role` FOREIGN KEY (`role_id`) REFERENCES `role` (`role_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='User table of security library'; -- -- Dumping data for table `user` -- INSERT INTO `user` VALUES (1,'admin','admin@lahaina.ch','7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 1), (2,'manager','manager@lahaina.ch','7110eda4d09e062aa5e4a390b0a572ac0d2c0220', 2);
true
2413a381e099c6038b5c931fa08a44433ff54945
SQL
wadzapi/learnWeldCdi
/src/main/resources/sql/user_roles.sql
UTF-8
1,047
3.203125
3
[ "Apache-2.0" ]
permissive
-- Создание таблиц с данными аутентификации -- create table users ( user_name varchar(15) not null primary key, user_pass varchar(15) not null ); create table roles ( role_name varchar(15) not null primary key ); create table user_roles ( user_name varchar(15) not null, role_name varchar(15) not null, primary key(user_name, role_name ) ); -- TODO Связать таблицы, запилить в настройки аутентификации jdbcRealm -- Создание таблиц с данными аутентификации -- INSERT INTO users (user_name, user_pass) VALUES ('wadzapi', 'changeit'); INSERT INTO roles (role_name) VALUES ('manager'); INSERT INTO roles (role_name) VALUES ('admin'); INSERT INTO roles (role_name) VALUES ('user'); INSERT INTO user_roles (user_name, role_name) VALUES ('wadzapi', 'manager'); INSERT INTO user_roles (user_name, role_name) VALUES ('wadzapi', 'admin'); INSERT INTO user_roles (user_name, role_name) VALUES ('wadzapi', 'user');
true
7f716355337002084d5cb744af24da5f71ae98e5
SQL
dlmbg/AppRadio
/db_radio.sql
UTF-8
10,977
2.765625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Waktu pembuatan: 25. Juli 2013 jam 04:53 -- Versi Server: 5.1.44 -- Versi PHP: 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: `db_radio` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_acara` -- CREATE TABLE IF NOT EXISTS `dlmbg_acara` ( `id_acara` int(5) NOT NULL AUTO_INCREMENT, `acara` varchar(100) NOT NULL, PRIMARY KEY (`id_acara`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data untuk tabel `dlmbg_acara` -- INSERT INTO `dlmbg_acara` (`id_acara`, `acara`) VALUES (2, 'Koplo'), (3, 'Dangdut'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_detail_transaksi_jadwal` -- CREATE TABLE IF NOT EXISTS `dlmbg_detail_transaksi_jadwal` ( `id_detail_transaksi_jadwal` int(11) NOT NULL AUTO_INCREMENT, `id_transaksi_jadwal` int(11) NOT NULL, `id_hari` int(5) NOT NULL, `id_waktu` int(10) NOT NULL, `tanggal` varchar(100) NOT NULL, `acara` varchar(100) NOT NULL, PRIMARY KEY (`id_detail_transaksi_jadwal`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ; -- -- Dumping data untuk tabel `dlmbg_detail_transaksi_jadwal` -- INSERT INTO `dlmbg_detail_transaksi_jadwal` (`id_detail_transaksi_jadwal`, `id_transaksi_jadwal`, `id_hari`, `id_waktu`, `tanggal`, `acara`) VALUES (1, 1, 5, 2, '2013-07-10', 'aselole'), (2, 1, 4, 2, '2013-07-16', 'inoex'), (3, 1, 6, 2, '2013-07-18', 'joss'), (4, 1, 3, 2, '2013-07-19', 'naskeleng'), (5, 1, 9, 2, '2013-07-26', 'bojong'), (6, 1, 8, 2, '2013-07-29', 'brengkengan'), (11, 2, 7, 2, '2013-07-19', 'Single Life'), (10, 2, 8, 2, '2013-07-20', 'Production Life'), (12, 3, 0, 0, '', ''), (13, 3, 0, 0, '', ''), (14, 3, 0, 0, '', ''), (15, 4, 3, 2, '2013-07-13', 'aselole'), (16, 4, 4, 3, '2013-07-15', 'Single Life'), (17, 4, 5, 2, '2013-07-17', 'Single Life Pro'), (18, 5, 3, 2, '2013-07-15', '2'), (19, 5, 4, 2, '2013-07-16', '2'), (20, 5, 5, 2, '2013-07-17', '2'), (21, 9, 3, 2, '2013-07-22', 'Kosmic Flow'), (22, 9, 4, 3, '2013-07-23', 'Janger'), (23, 9, 6, 4, '2013-07-25', 'Senandung Galau'), (34, 10, 3, 2, '2013-07-31', '2'), (33, 10, 3, 2, '', '2'), (32, 10, 3, 2, '', '2'), (31, 10, 3, 2, '', '2'), (35, 10, 3, 2, '', '2'), (36, 11, 0, 0, '', ''), (37, 11, 0, 0, '', ''), (38, 11, 0, 0, '', ''), (39, 11, 0, 0, '', ''), (40, 11, 0, 0, '', ''), (41, 11, 0, 0, '', ''), (42, 11, 0, 0, '', ''), (43, 11, 0, 0, '', ''), (44, 11, 0, 0, '', ''), (45, 11, 0, 0, '', ''), (57, 12, 5, 2, '2013-07-25', '3'), (56, 12, 3, 4, '2013-07-26', '2'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_hari` -- CREATE TABLE IF NOT EXISTS `dlmbg_hari` ( `id_hari` int(11) NOT NULL AUTO_INCREMENT, `hari` varchar(100) NOT NULL, PRIMARY KEY (`id_hari`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; -- -- Dumping data untuk tabel `dlmbg_hari` -- INSERT INTO `dlmbg_hari` (`id_hari`, `hari`) VALUES (3, 'Senin'), (4, 'Selasa'), (5, 'Rabu'), (6, 'Kamis'), (7, 'Jumat'), (8, 'Sabtu'), (9, 'Minggu'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_jadwal` -- CREATE TABLE IF NOT EXISTS `dlmbg_jadwal` ( `id_jadwal` int(11) NOT NULL AUTO_INCREMENT, `id_waktu` int(11) NOT NULL, `id_hari` int(11) NOT NULL, `id_penyiar` int(11) NOT NULL, `id_acara` int(5) NOT NULL, PRIMARY KEY (`id_jadwal`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data untuk tabel `dlmbg_jadwal` -- INSERT INTO `dlmbg_jadwal` (`id_jadwal`, `id_waktu`, `id_hari`, `id_penyiar`, `id_acara`) VALUES (1, 2, 5, 1, 3), (2, 4, 3, 1, 2); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_pelanggan` -- CREATE TABLE IF NOT EXISTS `dlmbg_pelanggan` ( `kode_pelanggan` int(5) NOT NULL AUTO_INCREMENT, `nama_pelanggan` varchar(100) NOT NULL, `telepon` varchar(50) NOT NULL, `alamat_pelanggan` text NOT NULL, `jenis` varchar(50) NOT NULL, PRIMARY KEY (`kode_pelanggan`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ; -- -- Dumping data untuk tabel `dlmbg_pelanggan` -- INSERT INTO `dlmbg_pelanggan` (`kode_pelanggan`, `nama_pelanggan`, `telepon`, `alamat_pelanggan`, `jenis`) VALUES (35, 'Dian Permana', '434343', 'bali', 'Umum'), (33, 'Dedek', 'Perusahaan', 'fdfdfdf', 'Perusahaan'), (36, 's', 'ss', 'ssss', 'Umum'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_pembayaran` -- CREATE TABLE IF NOT EXISTS `dlmbg_pembayaran` ( `id_pembayaran` int(11) NOT NULL AUTO_INCREMENT, `id_transaksi_pemasangan` varchar(50) NOT NULL, `tanggal_bayar` varchar(30) NOT NULL, `dibayar` int(11) NOT NULL, PRIMARY KEY (`id_pembayaran`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; -- -- Dumping data untuk tabel `dlmbg_pembayaran` -- INSERT INTO `dlmbg_pembayaran` (`id_pembayaran`, `id_transaksi_pemasangan`, `tanggal_bayar`, `dibayar`) VALUES (2, 'PS00000001', '', 60000), (7, 'PS00000003', '', 0), (6, 'PS00000002', '2013-07-20', 400000), (8, 'PS00000004', '', 0), (9, 'PS00000005', '', 0); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_penyiar` -- CREATE TABLE IF NOT EXISTS `dlmbg_penyiar` ( `id_penyiar` int(5) NOT NULL AUTO_INCREMENT, `penyiar` varchar(100) NOT NULL, PRIMARY KEY (`id_penyiar`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data untuk tabel `dlmbg_penyiar` -- INSERT INTO `dlmbg_penyiar` (`id_penyiar`, `penyiar`) VALUES (1, 'Ika Kartika Rahayu Ngabekti'), (3, 'Gede Suma Wijaya'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_setting` -- CREATE TABLE IF NOT EXISTS `dlmbg_setting` ( `id_setting` int(10) NOT NULL AUTO_INCREMENT, `tipe` varchar(50) NOT NULL, `title` varchar(100) NOT NULL, `content_setting` text NOT NULL, PRIMARY KEY (`id_setting`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Dumping data untuk tabel `dlmbg_setting` -- INSERT INTO `dlmbg_setting` (`id_setting`, `tipe`, `title`, `content_setting`) VALUES (1, 'site_title', 'Nama Situs', 'Aplikasi Radio | DLMBG'), (2, 'site_quotes', 'Quotes Situs', 'Okelah Kalo Begitu'), (3, 'site_footer', 'Teks Footer', 'Gede Lumbung - 2013 <br>Aplikasi Radio | DLMBG'), (4, 'key_login', 'Hash Key MD5', 'AppRadio32'), (5, 'site_theme', 'Theme Folder', 'black-inverse'), (6, 'site_limit_small', 'Limit Data Small', '5'), (7, 'site_limit_medium', 'Limit Data Medium', '10'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_tarif_iklan` -- CREATE TABLE IF NOT EXISTS `dlmbg_tarif_iklan` ( `id_tarif_iklan` int(5) NOT NULL AUTO_INCREMENT, `promo` varchar(100) NOT NULL, `kategori` varchar(100) NOT NULL, `biaya` varchar(100) NOT NULL, `keterangan` text NOT NULL, PRIMARY KEY (`id_tarif_iklan`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data untuk tabel `dlmbg_tarif_iklan` -- INSERT INTO `dlmbg_tarif_iklan` (`id_tarif_iklan`, `promo`, `kategori`, `biaya`, `keterangan`) VALUES (1, 'Loose Spot', 'Regular Time', '50000', 'Sehari 3 kali'), (3, 'Ape Kaden', 'Prime Time', '45000', 'jossss'), (4, 'Kosmos Horizon', 'Regular Time', '20000', 'Ok'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_transaksi_jadwal` -- CREATE TABLE IF NOT EXISTS `dlmbg_transaksi_jadwal` ( `id_transaksi_jadwal` int(10) NOT NULL AUTO_INCREMENT, `id_transaksi_pemasangan` varchar(30) NOT NULL, `id_penyiar` int(11) NOT NULL, PRIMARY KEY (`id_transaksi_jadwal`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; -- -- Dumping data untuk tabel `dlmbg_transaksi_jadwal` -- INSERT INTO `dlmbg_transaksi_jadwal` (`id_transaksi_jadwal`, `id_transaksi_pemasangan`, `id_penyiar`) VALUES (5, 'PS00000001', 1), (10, 'PS00000003', 1), (9, 'PS00000002', 1), (11, 'PS00000004', 0), (12, 'PS00000005', 1); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_transaksi_pemasangan` -- CREATE TABLE IF NOT EXISTS `dlmbg_transaksi_pemasangan` ( `id_transaksi_pemasangan` varchar(30) NOT NULL, `tanggal` varchar(30) NOT NULL, `kode_pelanggan` int(11) NOT NULL, `id_tarif_iklan` int(11) NOT NULL, `durasi_iklan` varchar(20) NOT NULL, `volume_tayang` varchar(20) NOT NULL, `jumlah_biaya` int(11) NOT NULL, `uang_muka` int(11) NOT NULL, `jenis_iklan` varchar(50) NOT NULL, `stts` varchar(50) NOT NULL, `harga_lain` int(10) NOT NULL, `pajak` varchar(10) NOT NULL, `hit_pajak` int(20) NOT NULL, PRIMARY KEY (`id_transaksi_pemasangan`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `dlmbg_transaksi_pemasangan` -- INSERT INTO `dlmbg_transaksi_pemasangan` (`id_transaksi_pemasangan`, `tanggal`, `kode_pelanggan`, `id_tarif_iklan`, `durasi_iklan`, `volume_tayang`, `jumlah_biaya`, `uang_muka`, `jenis_iklan`, `stts`, `harga_lain`, `pajak`, `hit_pajak`) VALUES ('PS00000001', '2013-07-13', 35, 1, '23', '3', 100000, 40000, '', '', 0, '', 0), ('PS00000002', '2013-07-14', 35, 3, '23', '3', 483000, 93000, 'kontrak', 'Lunas', 7000, '', 0), ('PS00000003', '2013-07-20', 33, 3, '45', '5', 1125000, 400000, 'kontrak', 'Belum Lunas', 5000, '', 0), ('PS00000004', '', 33, 3, '20', '10', 9900000, 1000000, '0', 'Belum Lunas', 45000, '10', 0), ('PS00000005', '', 33, 4, '10', '2', 440000, 4000000, '0', 'Lunas', 20000, '10', 40000); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_user` -- CREATE TABLE IF NOT EXISTS `dlmbg_user` ( `kode_user` int(5) NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `level` varchar(10) NOT NULL, `nama_user` varchar(100) NOT NULL, PRIMARY KEY (`kode_user`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data untuk tabel `dlmbg_user` -- INSERT INTO `dlmbg_user` (`kode_user`, `username`, `password`, `level`, `nama_user`) VALUES (1, 'admin', 'febe1e308d81e63cbe88e81920aa95ed', 'admin', 'Gede Lumbung'), (3, 'kasir', 'a399badbf2cff1439824e6f143d0339a', 'kasir', 'Dedek Haryanto'); -- -------------------------------------------------------- -- -- Struktur dari tabel `dlmbg_waktu` -- CREATE TABLE IF NOT EXISTS `dlmbg_waktu` ( `id_waktu` int(11) NOT NULL AUTO_INCREMENT, `waktu` varchar(100) NOT NULL, PRIMARY KEY (`id_waktu`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ; -- -- Dumping data untuk tabel `dlmbg_waktu` -- INSERT INTO `dlmbg_waktu` (`id_waktu`, `waktu`) VALUES (2, '06.00-07.00'), (3, '07.00-08.00'), (4, '08.00-09.00'), (5, '09.00-10.00'), (6, '10.00-11.00');
true
67daf92358638c379f0bc9233483149eb71d8d7e
SQL
luiz-lombardi/projeto-hcn
/copia_encomenda.sql
ISO-8859-1
3,838
2.921875
3
[]
no_license
--************************************************************** --* Copia pedidos de encomenda pagos --************************************************************** accept NEW_ID_EMP prompt 'Informe a Loja Nova: ' accept LOJA_ORIGEM prompt 'Informe a Loja Origem: ' insert into PEDIDO_VENDA select ID_UNN, &NEW_ID_EMP, ID_PVD, ID_VEN, ID_TRANSP, ID_CDI, ID_UNN_NF, --ID_EMP_NF, &NEW_ID_EMP, ID_CLI, CD_TIPO_END, ID_END, ID_CLI_PRE, CD_TIPO_END_PRE, ID_END_PRE, CD_TIPO_END_COB, ID_END_COB, VL_MERCAD, VL_DESC_TOT_IT, VL_DESCONTO, VL_DESPESAS, VL_FRETE, VL_DESP_FINANC, VL_ENTRADA, VL_JUROS, VL_FINANC, VL_TOTAL, DT_PEDIDO, DT_ENTREGA, DT_PAGTO, OB_OBSERV, ST_SIT_PED, CD_TIPO_PED, CD_MODAL_ENT, CD_ENCOMENDA, CD_SIT_CARGA, CD_SITUACAO, ID_LOTE, NM_CLI_ORC, NR_FONE_ORC, DT_CANCELA, VL_DESCONTO_SUP, NR_PDV, NR_CUPOM, ID_SUP, CD_CRED_LIB, CD_SIT_UTIL, ID_ORDEM, CD_BLOQUEADO, NM_RUA, NM_BAIRRO, NM_CIDADE, ID_EST, ID_CEP, DT_MANUTENCAO, ID_TP_LOC, ID_PROMOTOR, CD_TIPO_MOV, CD_TIPO_ORC from PEDIDO_VENDA where id_unn = 1 and id_emp = &LOJA_ORIGEM and dt_pedido > '01/01/2007' and cd_encomenda = 'S' and st_sit_ped not in (40,99); --************************************************************** --* Copia itens dos pedidos de encomenda pagos --************************************************************** insert into ITEM_PEDIDO_VENDA select ID_UNN, &NEW_ID_EMP, ID_PVD, ID_IPR, ID_EMB, ID_PRO, ID_GRCDI, ID_TP_LOC, ID_LOCAL, CD_SITUACAO, VL_PRECO, QT_VENDIDA, QT_RESERVA, QT_RESFUT, QT_RESTRANS, QT_FATUR, QT_ENT_RET, DT_ENT_RET, PC_DESC, PC_IPI, VL_IPI, VL_LIQ_IT, VL_TOTAL, NM_COMPL_IPR, ST_SIT_PED, SQ_ITEM, ID_LOT_EST, VL_CUSTO, CD_IMP, PC_ALIQ_ICMS from ITEM_PEDIDO_VENDA where id_unn = 1 and id_emp = &LOJA_ORIGEM and id_pvd in (select id_pvd from pedido_venda where id_unn = 1 and id_emp = &LOJA_ORIGEM and dt_pedido > '01/01/2007' and cd_encomenda = 'S' and st_sit_ped not in (40,99)); --************************************************************** --* Copia condio pagto. pedidos de encomenda --************************************************************** insert into PEDIDO_VENDA_COND_PAGTO select ID_UNN, &NEW_ID_EMP, ID_PVD, ID_CPG, VL_TOTAL, CD_SITUACAO from PEDIDO_VENDA_COND_PAGTO where id_unn = 1 and id_emp = &LOJA_ORIGEM and id_pvd in (select id_pvd from pedido_venda where id_unn = 1 and id_emp = &LOJA_ORIGEM and dt_pedido > '01/01/2007' and cd_encomenda = 'S' and st_sit_ped not in (40,99)); --************************************************************** --* Copia motivo desconto pedidos de encomenda --************************************************************** insert into PEDIDO_VENDA_COMPLEMENTO select ID_UNN, &NEW_ID_EMP, ID_PVD, ID_TDM, ID_USU, ID_OUTM, CD_VENDA_TERCEIRO, VL_MARKUP, PC_ACRESC, VL_CUSTO, VL_TOTAL_LIQ, VL_TOTAL, OB_OBSERV, TP_ACRESC, NM_CONTATO, LIMITE_CRED_EXCEDE, CD_MENS_NOTA, ALTERA_DT, ID_PROF, CIF_FOB, CD_BLQ_COND_PGTO, CD_BLQ_QT_VEND, CD_ORGAO_PUBLICO, CD_REC_LOCAL, ID_TMD, CD_CALC_PROM, QT_PRAZO_MEDIO from PEDIDO_VENDA_COMPLEMENTO where id_unn = 1 and id_emp = &LOJA_ORIGEM and id_pvd in (select id_pvd from pedido_venda where id_unn = 1 and id_emp = &LOJA_ORIGEM and dt_pedido > '01/01/2007' and cd_encomenda = 'S' and st_sit_ped not in (40,99)); --************************************************************** --* Lista pedidos interestaduais pagos no pdv --************************************************************** select * from PEDIDO_VENDA where id_unn = 1 and id_emp = &LOJA_ORIGEM and dt_pedido > '01/01/2007' and cd_situacao = 2 and st_sit_ped = 12 /
true
ccf7accbbed442f349c645a3330ec3ec4ac41be9
SQL
ebussiere/GigFinder
/express-back-end/docs/archive/Saved_Companies (6).sql
UTF-8
1,239
2.875
3
[]
no_license
create table Saved_Companies ( id SERIAL PRIMARY KEY NOT NULL, worker_id INTEGER REFERENCES workers(id), employer_id INTEGER REFERENCES employers(id), favourite BOOLEAN DEFAULT FALSE, rating INT ); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (1, 5, 2, false, 5); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (2, 2, 7, true, 2); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (3, 3, 9, false, 2); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (4, 8, 9, true, 1); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (5, 7, 6, true, 4); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (6, 3, 9, false, 3); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (7, 9, 3, true, 4); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (8, 3, 8, false, 3); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (9, 9, 10, true, 4); insert into Saved_Companies (id, worker_id, employer_id, favourite, rating) values (10, 6, 4, true, 3);
true
52a375541d41955d8e8af723061804ba0ff58a23
SQL
liuneng1994/HDispatch
/core-db/src/main/java/hdispatch/core/db/data/mysql/tables/hdispatch_layer.sql
UTF-8
1,569
2.9375
3
[]
no_license
-- ---------------------------- -- Table structure for hdispatch_layer -- ---------------------------- DROP TABLE IF EXISTS `hdispatch_layer`; CREATE TABLE `hdispatch_layer` ( `layer_id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(32) DEFAULT NULL, `description` varchar(256) DEFAULT NULL, `active` tinyint(4) DEFAULT '1', `display_sequence` int(11) DEFAULT '0', `theme_id` bigint(20) DEFAULT NULL, `OBJECT_VERSION_NUMBER` decimal(20,0) DEFAULT '1', `REQUEST_ID` bigint(20) DEFAULT '-1', `PROGRAM_ID` bigint(20) DEFAULT '-1', `CREATION_DATE` datetime DEFAULT CURRENT_TIMESTAMP, `CREATED_BY` decimal(20,0) DEFAULT '-1', `LAST_UPDATED_BY` decimal(20,0) DEFAULT '-1', `LAST_UPDATE_DATE` datetime DEFAULT CURRENT_TIMESTAMP, `LAST_UPDATE_LOGIN` decimal(20,0) DEFAULT NULL, `ATTRIBUTE_CATEGORY` varchar(30) DEFAULT NULL, `ATTRIBUTE1` varchar(240) DEFAULT NULL, `ATTRIBUTE2` varchar(240) DEFAULT NULL, `ATTRIBUTE3` varchar(240) DEFAULT NULL, `ATTRIBUTE4` varchar(240) DEFAULT NULL, `ATTRIBUTE5` varchar(240) DEFAULT NULL, `ATTRIBUTE6` varchar(240) DEFAULT NULL, `ATTRIBUTE7` varchar(240) DEFAULT NULL, `ATTRIBUTE8` varchar(240) DEFAULT NULL, `ATTRIBUTE9` varchar(240) DEFAULT NULL, `ATTRIBUTE10` varchar(240) DEFAULT NULL, `ATTRIBUTE11` varchar(240) DEFAULT NULL, `ATTRIBUTE12` varchar(240) DEFAULT NULL, `ATTRIBUTE13` varchar(240) DEFAULT NULL, `ATTRIBUTE14` varchar(240) DEFAULT NULL, `ATTRIBUTE15` varchar(240) DEFAULT NULL, PRIMARY KEY (`layer_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
true
619565a1b7c60420edfe2b06cb77108b436fd093
SQL
Zhangchangxin/System20
/system/schema/grade_2_data.sql
UTF-8
994
3.109375
3
[]
no_license
DELETE FROM course_grade; DELETE FROM course; DELETE FROM student; INSERT INTO student (sn, no, name) VALUES (101, 'S001', '张三'), (102, 'S002', '李四'), (103, 'S003', '王五'), (104, 'S004', '马六'); INSERT INTO course (sn, term, no, name, place, time) VALUES (101,'2020秋季学期', 'C01', '高数','第一公教A210','周二第一大节'), (102,'2020秋季学期', 'C02', '外语','第一公教A308','周一第二大节'), (103,'2020秋季学期', 'C03', '线代','第一公教C211','周五第一大节'); INSERT INTO course_grade (stu_sn, cou_sn,term,grade) VALUES (101, 101,'2020秋季学期', 91), (102, 101,'2020秋季学期', 89), (103, 101,'2020秋季学期', 90), (101, 102,'2020秋季学期', 89); INSERT INTO course_choose (stu_sn, cou_sn,term,course_name) VALUES (101, 101,'2020秋季学期', '高数'), (102, 101,'2020秋季学期','外语'), (103, 101,'2020秋季学期', '线代');
true
ce7405e151f1be5d4f331b4ed2e109554985c551
SQL
eduardo-amorim7/newvideo
/updatedb/updateDb.v6.3.sql
UTF-8
634
3.09375
3
[ "MIT" ]
permissive
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'; ALTER TABLE `videos_statistics` ADD COLUMN `created` DATETIME NULL DEFAULT NULL AFTER `videos_id`, ADD COLUMN `modified` DATETIME NULL DEFAULT NULL AFTER `created`, ADD COLUMN `lastVideoTime` INT(11) NULL DEFAULT NULL AFTER `modified`; UPDATE configurations SET version = '6.3', modified = now() WHERE id = 1; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
cc1a12df3d441d1394b7a8470ab824901ff17b39
SQL
malam84/banking-microservice-demo
/account-service/src/main/resources/db/table.sql
UTF-8
269
2.546875
3
[]
no_license
/***************************Create Table******************************/ CREATE TABLE account( id int NOT NULL AUTO_INCREMENT, accno int NOT NULL, acctype varchar(55), amt float, createdDate Date, status boolean, custId int, PRIMARY KEY (id) );
true
70f7206ca7e15780f0cb9bdcf07b83711a48c390
SQL
AndreyProtas/API
/DB/students.sql
UTF-8
238
2.8125
3
[]
no_license
CREATE TABLE IF NOT EXISTS `students` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=6 ;
true
03cce33acddff066a83c82cd511ca714b182668f
SQL
Cody-Coleman/ENTSM
/db/schema.sql
UTF-8
527
2.53125
3
[]
no_license
drop table if exists users; create table users ( id integer primary key autoincrement, username string not null, password string not null, first_name string not null, last_name string not null, email_address string not null, use_email integer, authorized integer, auth_token string, shard_id string, notebook_ids string, is_admin integer, lead_id sring ); insert into users (username, password, first_name, last_name, email_address, is_admin) values ('Admin', 'Admin', 'Admin', 'Admin', 'Admin', 1);
true
885637c7fd8094be1e75455c5173f5823652add6
SQL
earth774/kdm_backend
/database/mysql/update_investor_table/investor_interest_type.sql
UTF-8
1,972
3.203125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 31, 2018 at 12:02 PM -- Server version: 10.1.25-MariaDB -- PHP Version: 7.0.21 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: `kdm_db` -- -- -------------------------------------------------------- -- -- Table structure for table `investor_interest_type` -- CREATE TABLE `investor_interest_type` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `status_id` tinyint(4) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `investor_interest_type` -- INSERT INTO `investor_interest_type` (`id`, `name`, `created_at`, `updated_at`, `status_id`) VALUES (1, 'เกษตรกรรม', '2018-01-27 07:09:23', NULL, 1), (2, 'ปศุสัตว์', '2018-01-27 07:09:23', NULL, 1), (3, 'ประมง', '2018-01-27 07:10:00', NULL, 1), (4, 'บ้านพัก/รีสอร์ท/โฮมสเตย์', '2018-01-27 07:10:00', NULL, 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `investor_interest_type` -- ALTER TABLE `investor_interest_type` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `investor_interest_type` -- ALTER TABLE `investor_interest_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
ad9642e4466929d5d2f22a84724e4eda32cca440
SQL
subhajyotidey/MyProject
/Api/Controller/school_db.sql
UTF-8
3,563
3.375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Jan 05, 2018 at 06:51 AM -- Server version: 5.7.19 -- PHP Version: 7.0.23 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: `knack_users` -- -- -------------------------------------------------------- -- -- Table structure for table `Students` -- DROP TABLE IF EXISTS `Students`; CREATE TABLE IF NOT EXISTS `Students` ( `StudentsId` varchar(200) NOT NULL COMMENT 'Students ID', `StudentsRegistrationNo` varchar(200) NOT NULL COMMENT 'Students Registration No', `StudentsName` varchar(200) DEFAULT NULL COMMENT 'Students Name', `StudentsRoll` varchar(200) DEFAULT NULL COMMENT 'Students Roll', `DateOfBirth` varchar(50) DEFAULT NULL COMMENT 'Date of Birth', `GurdianName` varchar(200) DEFAULT NULL COMMENT 'Gurdian Name', `GurdianPhoneNo` varchar(200) DEFAULT NULL COMMENT 'Gurdian PhNo', `PhotoURL` varchar(100) NOT NULL COMMENT 'Photo URL', `status` int(2) NOT NULL COMMENT 'statsu 0 for active , 1 for inactive', `Address` varchar(200) DEFAULT NULL COMMENT 'Address', `Pin` varchar(10) DEFAULT NULL COMMENT 'pin', `createDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Date Time', `updateDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Update Date and Time', PRIMARY KEY (`StudentsId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `Teachers` -- DROP TABLE IF EXISTS `Teachers`; CREATE TABLE IF NOT EXISTS `Teachers` ( `TeacherId` varchar(200) NOT NULL COMMENT 'Teachers ID', `TeacherName` varchar(200) DEFAULT NULL COMMENT 'Teacher Name', `TeacherPhoneNo` varchar(200) DEFAULT NULL COMMENT 'Teacher PhNo', `DateOfBirth` varchar(50) DEFAULT NULL COMMENT 'Date of Birth', `Address` varchar(200) DEFAULT NULL COMMENT 'Address', `Pin` varchar(10) DEFAULT NULL COMMENT 'pin', `PhotoURL` varchar(100) NOT NULL COMMENT 'Photo URL', `status` int(2) NOT NULL COMMENT 'status 0 for active , 1 for inactive', `createDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Date Time', `updateDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Update Date and Time', PRIMARY KEY (`TeacherId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `Staff` -- DROP TABLE IF EXISTS `Staff`; CREATE TABLE IF NOT EXISTS `Staff` ( `StaffId` varchar(200) NOT NULL COMMENT 'Staff ID', `StaffName` varchar(200) DEFAULT NULL COMMENT 'Staff Name', `StaffPhoneNo` varchar(200) DEFAULT NULL COMMENT 'Staff PhNo', `DateOfBirth` varchar(50) DEFAULT NULL COMMENT 'Date of Birth', `Address` varchar(200) DEFAULT NULL COMMENT 'Address', `Pin` varchar(10) DEFAULT NULL COMMENT 'pin', `PhotoURL` varchar(100) NOT NULL COMMENT 'Photo URL', `status` int(2) NOT NULL COMMENT 'status 0 for active , 1 for inactive', `createDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Create Date Time', `updateDateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Update Date and Time', PRIMARY KEY (`StaffId`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
true
e18489afaef57a2a7947c8ebded1d62deaf93077
SQL
daviddobrijevic/carolina
/carolina.sql
UTF-8
7,172
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 19, 2020 at 11:44 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.2.29 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: `carolina` -- -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(11) NOT NULL, `name` varchar(30) NOT NULL, `image_full` varchar(30) NOT NULL, `image_thumb` varchar(30) NOT NULL, `price` varchar(5) NOT NULL, `description` longtext NOT NULL, `short_description` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `image_full`, `image_thumb`, `price`, `description`, `short_description`) VALUES (1, 'Home Kit', 'product_large_01.jpg', 'product_thumb_01.jpg', '25', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Short Description of the Home Kit'), (2, 'Aromatherapy and Essential Oil', 'product_large_02.jpg', 'product_thumb_02.jpg', '30', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Aromatherapy and Essential Oil Short Description '), (3, 'Spa Soap with 2 pieces', 'product_large_03.jpg', 'product_thumb_03.jpg', '15', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Spa Soap with 2 pieces Short Description '), (4, 'Home Kit', 'product_large_04.jpg', 'product_thumb_04.jpg', '20', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Home Kit 2 Short Description'), (5, 'Aromatic Candies', 'product_large_05.jpg', 'product_thumb_05.jpg', '35', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Aromatic Candies Short Description '), (6, 'Rose Water', 'product_large_06.jpg', 'product_thumb_06.jpg', '3', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Rose Water Short Description'), (7, 'Hot Rocks', 'product_large_07.jpg', 'product_thumb_07.jpg', '10', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Hot Rocks Short Description '), (8, 'Towels', 'product_large_08.jpg', 'product_thumb_08.jpg', '12', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'Towels Short Description'); -- -- Indexes for dumped tables -- -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
0890988392951d9f460d4d35e52fd0b3e0296894
SQL
uakp98/SQL-for-Data_Science-
/dataScientistRolePlay.sql
UTF-8
49,255
3.765625
4
[]
no_license
By: Apurba kumar Pramanik Date: Jun-25-2020 Data Scientist Role Play: Profiling and Analyzing the Yelp Dataset Coursera Worksheet This is a 2-part assignment. In the first part, you are asked a series of questions that will help you profile and understand the data just like a data scientist would. For this first part of the assignment, you will be assessed both on the correctness of your findings, as well as the code you used to arrive at your answer. You will be graded on how easy your code is to read, so remember to use proper formatting and comments where necessary. In the second part of the assignment, you are asked to come up with your own inferences and analysis of the data for a particular research question you want to answer. You will be required to prepare the dataset for the analysis you choose to do. As with the first part, you will be graded, in part, on how easy your code is to read, so use proper formatting and comments to illustrate and communicate your intent as required. For both parts of this assignment, use this "worksheet." It provides all the questions you are being asked, and your job will be to transfer your answers and SQL coding where indicated into this worksheet so that your peers can review your work. You should be able to use any Text Editor (Windows Notepad, Apple TextEdit, Notepad ++, Sublime Text, etc.) to copy and paste your answers. If you are going to use Word or some other page layout application, just be careful to make sure your answers and code are lined appropriately. In this case, you may want to save as a PDF to ensure your formatting remains intact for you reviewer. Part 1: Yelp Dataset Profiling and Understanding 1. Profile the data by finding the total number of records for each of the tables below: SELECT COUNT(*) FROM table i. Attribute table = 10000 ii. Business table = 10000 iii. Category table = 10000 iv. Checkin table = 10000 v. elite_years table = 10000 vi. friend table = 10000 vii. hours table = 10000 viii. photo table = 10000 ix. review table = 10000 x. tip table = 10000 xi. user table = 10000 2. Find the total number of distinct records for each of the keys listed below: SELECT COUNT(DISTINCT(key)) FROM table i. Business = id: 10000 ii. Hours = business_id: 1562 iii. Category = business_id: 2643 iv. Attribute = business_id: 1115 v. Review = id:10000, business_id: 8090, user_id: 9581 vi. Checkin = business_id: 493 vii. Photo = id: 10000, business_id: 6493 viii. Tip = user_id: 537, business_id: 3979 ix. User = id: 10000 x. Friend = user_id: 11 xi. Elite_years = user_id: 2780 3. Are there any columns with null values in the Users table? Indicate "yes," or "no." Answer: "no" SQL code used to arrive at answer: SELECT COUNT(*) FROM user WHERE id IS NULL OR name IS NULL OR review_count IS NULL OR yelping_since IS NULL OR useful IS NULL OR funny IS NULL OR cool IS NULL OR fans IS NULL OR average_stars IS NULL OR compliment_hot IS NULL OR compliment_more IS NULL OR compliment_profile IS NULL OR compliment_cute IS NULL OR compliment_list IS NULL OR compliment_note IS NULL OR compliment_plain IS NULL OR compliment_cool IS NULL OR compliment_funny IS NULL OR compliment_writer IS NULL OR compliment_photos IS NULL 4. Find the minimum, maximum, and average value for the following fields: SELECT AVG(column) FROM table i. Table: Review, Column: Stars min: 1 max: 5 avg: 3.7082 ii. Table: Business, Column: Stars min: 1 max: 5 avg: 3.6549 iii. Table: Tip, Column: Likes min: 0 max: 2 avg: 0.0144 iv. Table: Checkin, Column: Count min: 1 max: 53 avg: 1.9414 v. Table: User, Column: Review_count min: 0 max: 2000 avg: 24.2995 5. List the cities with the most reviews in descending order: SQL code used to arrive at answer: SELECT city, SUM(review_count) AS reviews FROM business GROUP BY city ORDER BY reviews DESC Copy and Paste the Result Below: +-----------------+---------+ | city | reviews | +-----------------+---------+ | Las Vegas | 82854 | | Phoenix | 34503 | | Toronto | 24113 | | Scottsdale | 20614 | | Charlotte | 12523 | | Henderson | 10871 | | Tempe | 10504 | | Pittsburgh | 9798 | | Montréal | 9448 | | Chandler | 8112 | | Mesa | 6875 | | Gilbert | 6380 | | Cleveland | 5593 | | Madison | 5265 | | Glendale | 4406 | | Mississauga | 3814 | | Edinburgh | 2792 | | Peoria | 2624 | | North Las Vegas | 2438 | | Markham | 2352 | | Champaign | 2029 | | Stuttgart | 1849 | | Surprise | 1520 | | Lakewood | 1465 | | Goodyear | 1155 | +-----------------+---------+ 6. Find the distribution of star ratings to the business in the following cities: i. Avon SQL code used to arrive at answer: Select count(id) as count ,stars from business where city = 'Avon' group by stars order by stars desc; Copy and Paste the Resulting Table Below (2 columns - star rating and count): +-------+-------+ | count | stars | +-------+-------+ | 1 | 5.0 | | 1 | 4.5 | | 2 | 4.0 | | 3 | 3.5 | | 2 | 2.5 | | 1 | 1.5 | +-------+-------+ ii. Beachwood SQL code used to arrive at answer: Select count(id) as count ,stars from business where city = 'Beachwood' group by stars order by stars desc; Copy and Paste the Resulting Table Below (2 columns - star rating and count): +-------+-------+ | count | stars | +-------+-------+ | 5 | 5.0 | | 2 | 4.5 | | 1 | 4.0 | | 2 | 3.5 | | 2 | 3.0 | | 1 | 2.5 | | 1 | 2.0 | +-------+-------+ 7. Find the top 3 users based on their total number of reviews: SQL code used to arrive at answer: SELECT id, name, review_count FROM user ORDER BY review_count DESC LIMIT 3 Copy and Paste the Result Below: +------------------------+--------+--------------+ | id | name | review_count | +------------------------+--------+--------------+ | -G7Zkl1wIWBBmD0KRy_sCw | Gerald | 2000 | | -3s52C4zL_DHRK0ULG6qtg | Sara | 1629 | | -8lbUNlXVSoXqaRRiHiSNg | Yuri | 1339 | +------------------------+--------+--------------+ 8. Does posing more reviews correlate with more fans? Yes, but also the amount of time that they have been yelping. The longer they have been yelping and the more reviews they give has a higher fan count. Please explain your findings and interpretation of the results: SELECT id, name, review_count, fans, yelping_since FROM user ORDER BY fans DESC +------------------------+-----------+--------------+------+---------------------+ | id | name | review_count | fans | yelping_since | +------------------------+-----------+--------------+------+---------------------+ | -9I98YbNQnLdAmcYfb324Q | Amy | 609 | 503 | 2007-07-19 00:00:00 | | -8EnCioUmDygAbsYZmTeRQ | Mimi | 968 | 497 | 2011-03-30 00:00:00 | | --2vR0DIsmQ6WfcSzKWigw | Harald | 1153 | 311 | 2012-11-27 00:00:00 | | -G7Zkl1wIWBBmD0KRy_sCw | Gerald | 2000 | 253 | 2012-12-16 00:00:00 | | -0IiMAZI2SsQ7VmyzJjokQ | Christine | 930 | 173 | 2009-07-08 00:00:00 | | -g3XIcCb2b-BD0QBCcq2Sw | Lisa | 813 | 159 | 2009-10-05 00:00:00 | | -9bbDysuiWeo2VShFJJtcw | Cat | 377 | 133 | 2009-02-05 00:00:00 | | -FZBTkAZEXoP7CYvRV2ZwQ | William | 1215 | 126 | 2015-02-19 00:00:00 | | -9da1xk7zgnnfO1uTVYGkA | Fran | 862 | 124 | 2012-04-05 00:00:00 | | -lh59ko3dxChBSZ9U7LfUw | Lissa | 834 | 120 | 2007-08-14 00:00:00 | | -B-QEUESGWHPE_889WJaeg | Mark | 861 | 115 | 2009-05-31 00:00:00 | | -DmqnhW4Omr3YhmnigaqHg | Tiffany | 408 | 111 | 2008-10-28 00:00:00 | | -cv9PPT7IHux7XUc9dOpkg | bernice | 255 | 105 | 2007-08-29 00:00:00 | | -DFCC64NXgqrxlO8aLU5rg | Roanna | 1039 | 104 | 2006-03-28 00:00:00 | | -IgKkE8JvYNWeGu8ze4P8Q | Angela | 694 | 101 | 2010-10-01 00:00:00 | | -K2Tcgh2EKX6e6HqqIrBIQ | .Hon | 1246 | 101 | 2006-07-19 00:00:00 | | -4viTt9UC44lWCFJwleMNQ | Ben | 307 | 96 | 2007-03-10 00:00:00 | | -3i9bhfvrM3F1wsC9XIB8g | Linda | 584 | 89 | 2005-08-07 00:00:00 | | -kLVfaJytOJY2-QdQoCcNQ | Christina | 842 | 85 | 2012-10-08 00:00:00 | | -ePh4Prox7ZXnEBNGKyUEA | Jessica | 220 | 84 | 2009-01-12 00:00:00 | | -4BEUkLvHQntN6qPfKJP2w | Greg | 408 | 81 | 2008-02-16 00:00:00 | | -C-l8EHSLXtZZVfUAUhsPA | Nieves | 178 | 80 | 2013-07-08 00:00:00 | | -dw8f7FLaUmWR7bfJ_Yf0w | Sui | 754 | 78 | 2009-09-07 00:00:00 | | -8lbUNlXVSoXqaRRiHiSNg | Yuri | 1339 | 76 | 2008-01-03 00:00:00 | | -0zEEaDFIjABtPQni0XlHA | Nicole | 161 | 73 | 2009-04-30 00:00:00 | +------------------------+-----------+--------------+------+---------------------+ 9. Are there more reviews with the word "love" or with the word "hate" in them? Answer: love has 1780, while hate only has 232 :) 'love prevails' SQL code used to arrive at answer: SELECT COUNT(*) SELECT COUNT(*) FROM review FROM review WHERE text LIKE "%love%" WHERE text LIKE "%hate%" = 1780 = 232 10. Find the top 10 users with the most fans: SQL code used to arrive at answer: SELECT id, name, fans FROM user ORDER BY fans DESC LIMIT 10 Copy and Paste the Result Below: +------------------------+-----------+------+ | id | name | fans | +------------------------+-----------+------+ | -9I98YbNQnLdAmcYfb324Q | Amy | 503 | | -8EnCioUmDygAbsYZmTeRQ | Mimi | 497 | | --2vR0DIsmQ6WfcSzKWigw | Harald | 311 | | -G7Zkl1wIWBBmD0KRy_sCw | Gerald | 253 | | -0IiMAZI2SsQ7VmyzJjokQ | Christine | 173 | | -g3XIcCb2b-BD0QBCcq2Sw | Lisa | 159 | | -9bbDysuiWeo2VShFJJtcw | Cat | 133 | | -FZBTkAZEXoP7CYvRV2ZwQ | William | 126 | | -9da1xk7zgnnfO1uTVYGkA | Fran | 124 | | -lh59ko3dxChBSZ9U7LfUw | Lissa | 120 | +------------------------+-----------+------+ 11. Is there a strong correlation between having a high number of fans and being listed as "useful" or "funny?" Yes, see interpretation. SQL code used to arrive at answer: SELECT name, fans, useful, funny, review_count, yelping_since FROM user ORDER BY fans DESC Copy and Paste the Result Below: +-----------+------+--------+--------+--------------+---------------------+ | name | fans | useful | funny | review_count | yelping_since | +-----------+------+--------+--------+--------------+---------------------+ | Amy | 503 | 3226 | 2554 | 609 | 2007-07-19 00:00:00 | | Mimi | 497 | 257 | 138 | 968 | 2011-03-30 00:00:00 | | Harald | 311 | 122921 | 122419 | 1153 | 2012-11-27 00:00:00 | | Gerald | 253 | 17524 | 2324 | 2000 | 2012-12-16 00:00:00 | | Christine | 173 | 4834 | 6646 | 930 | 2009-07-08 00:00:00 | | Lisa | 159 | 48 | 13 | 813 | 2009-10-05 00:00:00 | | Cat | 133 | 1062 | 672 | 377 | 2009-02-05 00:00:00 | | William | 126 | 9363 | 9361 | 1215 | 2015-02-19 00:00:00 | | Fran | 124 | 9851 | 7606 | 862 | 2012-04-05 00:00:00 | | Lissa | 120 | 455 | 150 | 834 | 2007-08-14 00:00:00 | | Mark | 115 | 4008 | 570 | 861 | 2009-05-31 00:00:00 | | Tiffany | 111 | 1366 | 984 | 408 | 2008-10-28 00:00:00 | | bernice | 105 | 120 | 112 | 255 | 2007-08-29 00:00:00 | | Roanna | 104 | 2995 | 1188 | 1039 | 2006-03-28 00:00:00 | | Angela | 101 | 158 | 164 | 694 | 2010-10-01 00:00:00 | | .Hon | 101 | 7850 | 5851 | 1246 | 2006-07-19 00:00:00 | | Ben | 96 | 1180 | 1155 | 307 | 2007-03-10 00:00:00 | | Linda | 89 | 3177 | 2736 | 584 | 2005-08-07 00:00:00 | | Christina | 85 | 158 | 34 | 842 | 2012-10-08 00:00:00 | | Jessica | 84 | 2161 | 2091 | 220 | 2009-01-12 00:00:00 | | Greg | 81 | 820 | 753 | 408 | 2008-02-16 00:00:00 | | Nieves | 80 | 1091 | 774 | 178 | 2013-07-08 00:00:00 | | Sui | 78 | 9 | 18 | 754 | 2009-09-07 00:00:00 | | Yuri | 76 | 1166 | 220 | 1339 | 2008-01-03 00:00:00 | | Nicole | 73 | 13 | 10 | 161 | 2009-04-30 00:00:00 | +-----------+------+--------+--------+--------------+---------------------+ Please explain your findings and interpretation of the results: Yes, but there does seem to be one major outlier, number three Harald. The other users seem to have a correlation with more `useful` and `funny` results in more fans, but also in conjunction with review_count and time they have been yelping. Part 2: Inferences and Analysis 1. Pick one city and category of your choice and group the businesses in that city or category by their overall star rating. Compare the businesses with 2-3 stars to the businesses with 4-5 stars and answer the following questions. Include your code. i. Do the two groups you chose to analyze have a different distribution of hours? The 4-5 star group seems to have shorter hours then the 2-3 star group. Please note the query returned only three businesses so not a great sample size. ii. Do the two groups you chose to analyze have a different number of reviews? Yes and no, one of the 4-5 star group has a lot more reviews but then the other 4-5 star group has close to the same number of reviews as the 2-3 star group iii. Are you able to infer anything from the location data provided between these two groups? Explain. No, every business is in a different zip-code. SQL code used for analysis: SELECT B.name, B.review_count, H.hours, postal_code, CASE WHEN hours LIKE "%monday%" THEN 1 WHEN hours LIKE "%tuesday%" THEN 2 WHEN hours LIKE "%wednesday%" THEN 3 WHEN hours LIKE "%thursday%" THEN 4 WHEN hours LIKE "%friday%" THEN 5 WHEN hours LIKE "%saturday%" THEN 6 WHEN hours LIKE "%sunday%" THEN 7 END AS ord, CASE WHEN B.stars BETWEEN 2 AND 3 THEN '2-3 stars' WHEN B.stars BETWEEN 4 AND 5 THEN '4-5 stars' END AS star_rating FROM business B INNER JOIN hours H ON B.id = H.business_id INNER JOIN category C ON C.business_id = B.id WHERE (B.city == 'Las Vegas' AND C.category LIKE 'shopping') AND (B.stars BETWEEN 2 AND 3 OR B.stars BETWEEN 4 AND 5) GROUP BY stars,ord ORDER BY ord,star_rating ASC 2. Group business based on the ones that are open and the ones that are closed. What differences can you find between the ones that are still open and the ones that are closed? List at least two differences and the SQL code you used to arrive at your answer. i. Difference 1: The businesses that are open tend to have more reviews than ones that are closed on average. Open: AVG(review_count) = 31.757 Closed: AVG(review_count0 = 23.198 ii. Difference 2: The average star rating is higher for businesses that are open than businesses that are closed. Open: AVG(stars) = 3.679 Closed: AVG(stars) = 3.520 SQL code used for analysis: SELECT COUNT(DISTINCT(id)), AVG(review_count), SUM(review_count), AVG(stars), is_open FROM business GROUP BY is_open 3. For this last part of your analysis, you are going to choose the type of analysis you want to conduct on the Yelp dataset and are going to prepare the data for analysis. Ideas for analysis include: Parsing out keywords and business attributes for sentiment analysis, clustering businesses to find commonalities or anomalies between them, predicting the overall star rating for a business, predicting the number of fans a user will have, and so on. These are just a few examples to get you started, so feel free to be creative and come up with your own problem you want to solve. Provide answers, in-line, to all of the following: i. Indicate the type of analysis you chose to do: Predicting whether a business will stay open or close. We wish not to explicitly examine the text of the reviews, but this would be an interesting analysis. ii. Write 1-2 brief paragraphs on the type of data you will need for your analysis and why you chose that data: To better help businesses understand the importance of different factors which will help their business stay open. Some data that may be important; number of reviews, star rating of business, hours open, and of course location location location. We will gather the latitude and longitude as well as city, state, postal_code, and address to make processing easier later on. Categories and attributes will be used to better distinguish between different types of businesses. `is_open` will determine which business is open and which business have closed (not hours) but permanently. iii. Output of your finished dataset: +------------------------+--------------------------------+-----------------------------+---------------+-------+-------------+----------+-----------+--------------+-------+--------------+---------------+-----------------+----------------+--------------+----------------+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+ | id | name | address | city | state | postal_code | latitude | longitude | review_count | stars | monday_hours | tuesday_hours | wednesday_hours | thursday_hours | friday_hours | saturday_hours | sunday_hours | categories | attributes | is_open | +------------------------+--------------------------------+-----------------------------+---------------+-------+-------------+----------+-----------+--------------+-------+--------------+---------------+-----------------+----------------+--------------+----------------+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+ | -0DET7VdEQOJVJ_v6klEug | Flaming Kitchen | 3235 York Regional Road 7 | Markham | ON | L3R 3P9 | 43.8484 | -79.3487 | 25 | 3.0 | 12:00-23:00 | 12:00-23:00 | 12:00-23:00 | 12:00-23:00 | 12:00-23:00 | 12:00-23:00 | 12:00-23:00 | Asian Fusion,Restaurants | RestaurantsTableService,GoodForMeal,Alcohol,Caters,HasTV,RestaurantsGoodForGroups,NoiseLevel,WiFi,RestaurantsAttire,RestaurantsReservations,OutdoorSeating,RestaurantsPriceRange2,BikeParking,RestaurantsDelivery,Ambience,RestaurantsTakeOut,GoodForKids,BusinessParking | 1 | | -2HjuT4yjLZ3b5f_abD87Q | Freeman's Car Stereo | 4821 South Blvd | Charlotte | NC | 28217 | 35.1727 | -80.8755 | 8 | 3.5 | 9:00-19:00 | 9:00-19:00 | 9:00-19:00 | 9:00-19:00 | 9:00-19:00 | 9:00-17:00 | None | Electronics,Shopping,Automotive,Car Stereo Installation | BusinessAcceptsCreditCards,RestaurantsPriceRange2,BusinessParking,WheelchairAccessible | 1 | | -CdstAUdEvci8GeJG8owpQ | Motors & More | 2315 Highland Dr | Las Vegas | NV | 89102 | 36.1465 | -115.167 | 7 | 5.0 | 7:00-17:00 | 7:00-17:00 | 7:00-17:00 | 7:00-17:00 | 7:00-17:00 | 8:00-12:00 | None | Home Services,Solar Installation,Heating & Air Conditioning/HVAC | BusinessAcceptsCreditCards,BusinessAcceptsBitcoin,ByAppointmentOnly | 1 | | -K4gAv8_vjx8-2BxkVeRkA | Baby Cakes | 4145 Erie St | Willoughby | OH | 44094 | 41.6399 | -81.4064 | 5 | 3.5 | None | 11:00-17:00 | 11:00-17:00 | 11:00-20:00 | 11:00-17:00 | 10:00-17:00 | None | Bakeries,Food | BusinessAcceptsCreditCards,RestaurantsTakeOut,WheelchairAccessible,RestaurantsDelivery | 1 | | -PtTGvWsckUL8tTutHr6Ew | Snip-its Rocky River | 21609 Center Ridge Rd | Rocky River | OH | 44116 | 41.4595 | -81.8587 | 18 | 2.5 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 9:00-17:30 | 10:00-16:00 | Beauty & Spas,Hair Salons | BusinessAcceptsCreditCards,RestaurantsPriceRange2,GoodForKids,BusinessParking,ByAppointmentOnly | 1 | | -ayZoW_iNDsunYXX_0x1YQ | Standard Restaurant Supply | 2922 E McDowell Rd | Phoenix | AZ | 85008 | 33.4664 | -112.018 | 15 | 3.5 | 8:00-18:00 | 8:00-18:00 | 8:00-18:00 | 8:00-18:00 | 8:00-18:00 | 9:00-17:00 | None | Shopping,Wholesalers,Restaurant Supplies,Professional Services,Wholesale Stores | BusinessAcceptsCreditCards,RestaurantsPriceRange2,BusinessParking,BikeParking,WheelchairAccessible | 1 | | -d9qyfNhLMQwVVg_raBKeg | What A Bagel | 973 Eglinton Avenue W | York | ON | M6C 2C4 | 43.6999 | -79.4295 | 8 | 3.0 | 6:00-15:30 | 6:00-15:30 | 6:00-15:30 | 6:00-15:30 | 6:00-15:30 | 6:00-15:30 | None | Restaurants,Bagels,Breakfast & Brunch,Food | NoiseLevel,RestaurantsAttire,RestaurantsTableService,OutdoorSeating | 1 | | -hjbcaxaU9yYXY2iI-49sw | Pinnacle Fencing Solutions | | Phoenix | AZ | 85060 | 33.4805 | -111.997 | 13 | 4.0 | 8:00-16:00 | 8:00-16:00 | 8:00-16:00 | 8:00-16:00 | 8:00-16:00 | None | None | Home Services,Contractors,Fences & Gates | BusinessAcceptsCreditCards,ByAppointmentOnly | 1 | | -iu4FxdfxN4rU4Fu9BjiFw | Alterations Express | 17240 Royalton Rd | Strongsville | OH | 44136 | 41.3141 | -81.8207 | 3 | 4.0 | 8:00-19:00 | 8:00-19:00 | 8:00-19:00 | 8:00-19:00 | 8:00-19:00 | 8:00-18:00 | None | Shopping,Bridal,Dry Cleaning & Laundry,Local Services,Sewing & Alterations | BusinessParking,BusinessAcceptsCreditCards,RestaurantsPriceRange2,BusinessAcceptsBitcoin,BikeParking,ByAppointmentOnly,WheelchairAccessible | 1 | | -j4NsiRzSMrMk2N_bGH_SA | Extra Space Storage | 2880 W Elliot Rd | Chandler | AZ | 85224 | 33.3496 | -111.892 | 5 | 4.0 | 8:00-17:30 | 8:00-17:30 | 8:00-17:30 | 8:00-17:30 | 8:00-17:30 | 8:00-17:30 | 10:00-14:00 | Home Services,Self Storage,Movers,Shopping,Local Services,Home Decor,Home & Garden | BusinessAcceptsCreditCards | 1 | | -uiBBVWI6tMDm2JFbZFrOw | Gussied Up | 1090 Bathurst St | Toronto | ON | M5R 1W5 | 43.6727 | -79.4142 | 6 | 4.5 | None | 11:00-19:00 | 11:00-19:00 | 11:00-19:00 | 11:00-19:00 | 11:00-17:00 | 12:00-16:00 | Women's Clothing,Shopping,Fashion | BusinessAcceptsCreditCards,RestaurantsPriceRange2,BusinessParking,BikeParking | 1 | | 0-aPEeNc2zVb5Gp-i7Ckqg | Buddy's Muffler & Exhaust | 1509 Hickory Grove Rd | Gastonia | NC | 28056 | 35.2772 | -81.06 | 4 | 5.0 | 8:30-17:00 | 8:30-17:00 | 8:30-17:00 | 8:30-17:00 | 8:30-17:00 | 9:00-15:00 | None | Automotive,Auto Repair | BusinessAcceptsCreditCards | 1 | | 01xXe2m_z048W5gcBFpoJA | Five Guys | 2641 N 44th St, Ste 100 | Phoenix | AZ | 85008 | 33.478 | -111.986 | 63 | 3.5 | 10:00-22:00 | 10:00-22:00 | 10:00-22:00 | 10:00-22:00 | 10:00-22:00 | 10:00-22:00 | 10:00-22:00 | American (New),Burgers,Fast Food,Restaurants | RestaurantsTableService,GoodForMeal,Alcohol,Caters,HasTV,RestaurantsGoodForGroups,NoiseLevel,WiFi,RestaurantsAttire,RestaurantsReservations,OutdoorSeating,BusinessAcceptsCreditCards,RestaurantsPriceRange2,BikeParking,RestaurantsDelivery,Ambience,RestaurantsTakeOut,GoodForKids,DriveThru,BusinessParking | 1 | | 06I2r8S3tHP_LwGnnkk6Uw | All Storage - Anthem | 2620 W Horizon Ridge Pkwy | Henderson | NV | 89052 | 36.0021 | -115.102 | 3 | 3.5 | 9:00-16:30 | 9:00-16:30 | 9:00-16:30 | 9:00-16:30 | 9:00-16:30 | 9:00-16:30 | None | Truck Rental,Local Services,Self Storage,Parking,Automotive | BusinessAcceptsCreditCards,BusinessAcceptsBitcoin | 1 | | 07h3mGtTovPJE660nX6E-A | Mood | 1 Greenside Place | Edinburgh | EDH | EH1 3AA | 55.957 | -3.18502 | 11 | 2.0 | None | None | None | 22:30-3:00 | 22:00-3:00 | 22:00-3:00 | 22:30-3:00 | Dance Clubs,Nightlife | Alcohol,OutdoorSeating,BusinessAcceptsCreditCards,RestaurantsPriceRange2,AgesAllowed,Music,Smoking,RestaurantsGoodForGroups,WheelchairAccessible | 0 | | 0AJF-USLN6K5T4caooDdjw | Starbucks | 4605 E Chandler Blvd, Ste A | Phoenix | AZ | 85048 | 33.3044 | -111.984 | 52 | 3.0 | 5:00-20:00 | 5:00-20:00 | 5:00-20:00 | 5:00-20:30 | 5:00-20:00 | 5:00-20:00 | 5:00-20:00 | Coffee & Tea,Food | BusinessParking,Caters,WiFi,OutdoorSeating,BusinessAcceptsCreditCards,RestaurantsPriceRange2,BikeParking,RestaurantsTakeOut | 1 | | 0B3W6KxkD3o4W4l6cq735w | Big Smoke Burger | 260 Yonge Street | Toronto | ON | M4B 2L9 | 43.6546 | -79.3805 | 47 | 3.0 | 10:30-21:00 | 10:30-21:00 | 10:30-21:00 | 10:30-21:00 | 10:30-21:00 | 10:30-21:00 | 11:00-19:00 | Poutineries,Burgers,Restaurants | RestaurantsTableService,GoodForMeal,Alcohol,Caters,HasTV,RestaurantsGoodForGroups,NoiseLevel,WiFi,RestaurantsAttire,RestaurantsReservations,OutdoorSeating,BusinessAcceptsCreditCards,RestaurantsPriceRange2,WheelchairAccessible,BikeParking,RestaurantsDelivery,Ambience,RestaurantsTakeOut,GoodForKids,DriveThru,BusinessParking | 1 | | 0IySwcfqwJjpHPsYwjpAkg | Subway | 2904 Yorkmont Rd | Charlotte | NC | 28208 | 35.1903 | -80.9288 | 7 | 3.5 | 6:00-22:00 | 6:00-22:00 | 6:00-22:00 | 6:00-22:00 | 6:00-22:00 | 10:00-21:00 | None | Fast Food,Restaurants,Sandwiches | Ambience,RestaurantsPriceRange2,GoodForKids | 1 | | 0K2rKvqdBmiOAUTebcUohQ | Red Rock Canyon Visitor Center | 1000 Scenic Loop Dr | Las Vegas | NV | 89161 | 36.1357 | -115.428 | 32 | 4.5 | 8:00-16:30 | 8:00-16:30 | 8:00-16:30 | 8:00-16:30 | 8:00-16:30 | 8:00-16:30 | 8:00-16:30 | Education,Visitor Centers,Professional Services,Special Education,Local Services,Community Service/Non-Profit,Hotels & Travel,Travel Services,Gift Shops,Shopping,Parks,Hiking,Flowers & Gifts,Active Life | BusinessAcceptsCreditCards,GoodForKids | 1 | | 0Ni7Stqt4RFWDGjOYRi2Bw | Scent From Above Company | 2501 W Behrend Dr, Ste 67 | Scottsdale | AZ | 85027 | 33.6656 | -112.111 | 14 | 4.5 | 6:00-16:00 | 6:00-16:00 | 6:00-16:00 | 6:00-16:00 | 6:00-16:00 | None | None | Home Cleaning,Local Services,Professional Services,Carpet Cleaning,Home Services,Office Cleaning,Window Washing | BusinessAcceptsCreditCards,ByAppointmentOnly | 1 | | 0WBMEfqXQnEOAIkV-uCW6w | The Charlotte Room | 19 Charlotte Street | Toronto | ON | M5V 2H5 | 43.6466 | -79.3938 | 10 | 3.5 | 15:00-1:00 | 15:00-1:00 | 15:00-1:00 | 15:00-1:00 | 15:00-2:00 | 18:00-2:00 | None | Event Planning & Services,Bars,Nightlife,Lounges,Pool Halls,Venues & Event Spaces | BusinessParking,HasTV,CoatCheck,NoiseLevel,OutdoorSeating,BusinessAcceptsCreditCards,RestaurantsPriceRange2,Music,WheelchairAccessible,Smoking,Ambience,BestNights,RestaurantsGoodForGroups,HappyHour,GoodForDancing,Alcohol | 0 | | 0Y3lHyqRHfWOBuQlS1bM0g | PC Savants | 11966 W Candelaria Ct | Sun City | AZ | 85373 | 33.6901 | -112.319 | 11 | 5.0 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 11:00-18:00 | 11:00-18:00 | IT Services & Computer Repair,Electronics Repair,Local Services,Mobile Phone Repair | BusinessAcceptsCreditCards,BusinessAcceptsBitcoin | 1 | | 0aKsGxx7XP2TMs_fn_9xVw | Sweet Ruby Jane Confections | 8975 S Eastern Ave, Ste 3-B | Las Vegas | NV | 89123 | 36.015 | -115.118 | 30 | 4.0 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | 10:00-19:00 | None | Food,Chocolatiers & Shops,Bakeries,Specialty Food,Desserts | BusinessAcceptsCreditCards,RestaurantsPriceRange2,BusinessParking,WheelchairAccessible | 0 | | 0cxO1Lx2Pi7u6ftWX3Wksg | Oinky's Pork Chop Heaven | 22483 Emery Rd | North Randall | OH | 44128 | 41.4352 | -81.5214 | 3 | 3.0 | 6:00-23:00 | 6:00-23:00 | 6:00-23:00 | 6:00-23:00 | 6:00-23:00 | 6:00-23:00 | 6:00-23:00 | Soul Food,Restaurants | RestaurantsAttire,RestaurantsGoodForGroups,GoodForKids,RestaurantsReservations,RestaurantsTakeOut | 1 | | 0e-j5VcEn54EZT-FKCUZdw | Sushi Osaka | 5084 Dundas Street W | Toronto | ON | M9A 1C2 | 43.6452 | -79.5324 | 8 | 4.5 | 11:00-23:00 | 11:00-23:00 | 11:00-23:00 | 11:00-23:00 | 11:00-23:00 | 11:00-23:00 | 14:00-23:00 | Sushi Bars,Restaurants,Japanese,Korean | RestaurantsTakeOut,WiFi,RestaurantsGoodForGroups,RestaurantsReservations | 1 | +------------------------+--------------------------------+-----------------------------+---------------+-------+-------------+----------+-----------+--------------+-------+--------------+---------------+-----------------+----------------+--------------+----------------+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+ iv. Provide the SQL code you used to create your final dataset: SELECT B.id, B.name, B.address, B.city, B.state, B.postal_code, B.latitude, B.longitude, B.review_count, B.stars, MAX(CASE WHEN H.hours LIKE "%monday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS monday_hours, MAX(CASE WHEN H.hours LIKE "%tuesday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS tuesday_hours, MAX(CASE WHEN H.hours LIKE "%wednesday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS wednesday_hours, MAX(CASE WHEN H.hours LIKE "%thursday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS thursday_hours, MAX(CASE WHEN H.hours LIKE "%friday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS friday_hours, MAX(CASE WHEN H.hours LIKE "%saturday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS saturday_hours, MAX(CASE WHEN H.hours LIKE "%sunday%" THEN TRIM(H.hours,'%MondayTuesWednesThursFriSatSun|%') END) AS sunday_hours, GROUP_CONCAT(DISTINCT(C.category)) AS categories, GROUP_CONCAT(DISTINCT(A.name)) AS attributes, B.is_open FROM business B INNER JOIN hours H ON B.id = H.business_id INNER JOIN category C ON B.id = C.business_id INNER JOIN attribute A ON B.id = A.business_id GROUP BY B.id --or,, another answer-- 3. For this last part of your analysis, you are going to choose the type of analysis you want to conduct on the Yelp dataset and are going to prepare the data for analysis. i. Indicate the type of analysis you chose to do: I tried to find the factors on which writing(compliment_writer) of a yelp reviewer was judged. ii. Write 1-2 brief paragraphs on the type of data you will need for your analysis and why you chose that data: The data I needed required details of the yelp reviewers and the quality of review itself. This means that I needed the yelper' name, the date of yelp first review, number of reviews, compliment_writer. With that I also required taking yelp data of usefulness and text itself. Text was taken to determine the kind of writing used. iii. Output of your finished dataset: The numerical results were fairly easy to get from the code. The results I found were as follows: The yelp reviewer's who started earlier were more likely to be complimented as writers than those who satarted late. The data also showed that writing had nothing to do with the number of reviews, but the way a review is framed. Harsher critiques and softer critiques were usually not complimented, the scrutiny with average number of stars were most complimented. It was not possible to group styles of writing and understand the schematics of the review written from the dataset at less viewings and would take harsher approach. Sample output of review by getting compliment_writer desc way: +------------------------+------------+--------------+---------------------+---------------+-------------------+--------+ | id | name | review_count | yelping_since | average_stars | compliment_writer | useful | +------------------------+------------+--------------+---------------------+---------------+-------------------+--------+ | -C-l8EHSLXtZZVfUAUhsPA | Nieves | 178 | 2013-07-08 00:00:00 | 3.64 | 77 | 2 | | -fQPzH-e-ubDIiLQhybEjQ | Dottsy | 196 | 2008-04-14 00:00:00 | 3.42 | 62 | 9 | | -ARdx8hOcEWlMDjzwLYZ_g | AJA | 257 | 2011-04-04 00:00:00 | 3.86 | 35 | 2 | | --Qh8yKWAvIP4V4K8ZPfHA | Dixie | 503 | 2011-01-19 00:00:00 | 3.19 | 34 | 6 | | -aq0KKWyMbhugu183UGj7Q | Annie | 279 | 2011-02-02 00:00:00 | 4.0 | 33 | 2 | | -k5yFUChotBMGQgHdFZvLQ | Pinky | 449 | 2008-03-02 00:00:00 | 3.75 | 26 | 1 | | -hxUwfo3cMnLTv-CAaP69A | Crissy | 676 | 2008-07-31 00:00:00 | 3.31 | 16 | 0 | | -CLMUyt1G88DHYytsuPebQ | Dave | 345 | 2010-12-13 00:00:00 | 3.69 | 11 | 1 | | -KpEgEen1tj-jdjIS7uVOw | Isabelle | 167 | 2013-10-27 00:00:00 | 3.83 | 10 | 0 | | -8nmj3B-tfY_vFiimtBOsw | Sanaz | 71 | 2014-11-23 00:00:00 | 3.77 | 10 | 1 | | -K8IQoaXwzxBCGx1IU86aw | Christophe | 90 | 2013-10-15 00:00:00 | 4.01 | 8 | 0 | | -fUARDNuXAfrOn4WLSZLgA | Ed | 904 | 2009-08-10 00:00:00 | 3.6 | 5 | 0 | | -7bM_DeL2Kj2CuYuVDsLNg | Jade | 109 | 2010-07-17 00:00:00 | 3.36 | 5 | 1 | | -CxzWyvRj3b3tvFdelf38w | Jean | 259 | 2008-03-08 00:00:00 | 3.91 | 5 | 1 | | -FFqZupwGHf-vrsUHMr_vw | Mark | 418 | 2015-10-13 00:00:00 | 4.0 | 5 | 0 | | -594af_E7Z9VVjQc9pJK3g | Andrea | 174 | 2012-10-30 00:00:00 | 3.87 | 4 | 2 | | -C0suJCZXOM93IuqIBaOew | Jarrod | 67 | 2011-05-14 00:00:00 | 3.77 | 4 | 0 | | -fEe8XBeJ6pGLIeAyAWzfw | Char | 122 | 2011-02-24 00:00:00 | 3.82 | 3 | 1 | | -d4NT5rjIpZEz07f5rYtlg | Danny | 564 | 2009-07-07 00:00:00 | 3.46 | 3 | 1 | | -hzflbbqcKxDTLfDcjQEzA | Kyle | 240 | 2011-05-23 00:00:00 | 3.82 | 3 | 0 | | -Biq3Dt8YhkRJEO_ITrvww | Christina | 86 | 2013-04-01 00:00:00 | 4.69 | 2 | 2 | | -l4iRZ2wYow39RTevk21Dg | Craig | 83 | 2008-07-04 00:00:00 | 3.29 | 2 | 2 | | -0udWcFQEt2M8kM3xcIofw | Kaitlan | 235 | 2015-05-01 00:00:00 | 3.92 | 2 | 0 | | -jL7hLAAwOnCAWKQlL9Wew | Alaina | 44 | 2014-02-28 00:00:00 | 4.0 | 1 | 0 | | -AkZkFH_md2-2kaSsvgrkg | Alan | 117 | 2012-02-15 00:00:00 | 2.76 | 1 | 0 | +------------------------+------------+--------------+---------------------+---------------+-------------------+--------+ (Output limit exceeded, 25 of 66 total rows shown) iv. Provide the SQL code you used to create your final dataset: Tables review and user were joined for my task as follows: Select u.id, u.name, u.review_count, u.yelping_since, u.average_stars ,u.compliment_writer --,r.text ,r.useful from review r inner join user u on u.id = r.user_id group by u.name order by u.compliment_writer desc --order by u.yelping_since asc --Use as required --order by u.average_stars asc
true
5075b55ba4f1e7fb4cc7c5416ab5167b084e8516
SQL
gabmor38/Resource_Wall
/db/seeds/DB_seeds.sql
UTF-8
3,867
3.015625
3
[]
no_license
-- Users table seeds here (Example) INSERT INTO users (name, email, password) VALUES ('Alice','Alice@gmail.com', 'password123'); INSERT INTO users (name, email, password) VALUES ('Kira','Kira@yahoo.com','password12'); INSERT INTO users (name, email, password) VALUES ('Leila','Leila@hotmail.com', 'password'); -- resources posted by alice@gmail.com INSERT INTO resources (user_id, url, title, description, category, date) VALUES (1,'https://jquery.com', 'Jquery', 'Jquery documentation', 'technology', '2021-09-10'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (1,'https://www.khanacademy.org/math', 'Math', 'Math article and exercises', 'math', '2021-09-25'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (1,'https://brainyball.blogspot.com', 'Learn Math', 'Math blog', 'math', '2021-02-05'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (1,'https://science4fun.info','Learn Science', 'Informative article', 'science', '2021-02-05'); -- resources posted by kira@yahoo,com INSERT INTO resources (user_id, url, title, description, category, date) VALUES (2,'https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging','Git Branching', 'git article', 'technology','2021-02-05'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (2,'https://www.science.org/','science.org', 'Contains lots of information', 'science','2021-02-05'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (2,'https://www.mathplayground.com/','Math kids games', 'Contains tons of math games for kids', 'math', '2021-02-05'); -- resources posted by Leila@hotmail.com INSERT INTO resources (user_id, url, title, description, category, date) VALUES (3,'https://www.quantamagazine.org/','Math Magazine', 'Contains intersting math articles', 'math','2021-02-05'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (3,'https://techcrunch.com/','Startup news', 'The latest in startup and technology news', 'technology', '2021-02-05'); INSERT INTO resources (user_id, url, title, description, category, date) VALUES (3,'https://www.newscientist.com/subject/technology/','The latest in technology', 'this website has the latest in technology', 'technology','2021-02-05'); -- reviews posted by alice@gmail.com INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('9','1','2','2021-09-14'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('8','1','3','2021-09-01'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('7','1','4','2021-09-01'); -- reviews posted by keira@gmail.com INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('1','2','3','2021-12-12'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('2','2','3','2021-08-12'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('3','2','3','2021-09-01'); -- resources posted by Leila@hotmail.com INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('4','3','1','2021-09-12'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('5','3','2','2021-09-23'); INSERT INTO reviews (resource_id, user_id, rating, date) VALUES ('6','3','2','2021-09-14'); -- saved posts by alice@gmail.com INSERT INTO liked (user_id, resource_id) VALUES ('1','3'); INSERT INTO liked (user_id, resource_id) VALUES ('1','4'); INSERT INTO liked (user_id, resource_id) VALUES ('1','5'); -- resources posted by kira@yahoo,com INSERT INTO liked (user_id, resource_id) VALUES ('2','2'); INSERT INTO liked (user_id, resource_id) VALUES ('2','3'); INSERT INTO liked (user_id, resource_id) VALUES ('2','9'); -- resources posted by Leila@hotmail.com INSERT INTO liked (user_id, resource_id) VALUES ('3','1'); INSERT INTO liked (user_id, resource_id) VALUES ('3','1'); INSERT INTO liked (user_id, resource_id) VALUES ('3','3');
true
62810cc5d6c8762a7e3ec2fc040ec7a8ac4036e5
SQL
OrionJoshi/SQL
/Sorting_and_Filtering_HR/problem5.sql
UTF-8
870
3.40625
3
[]
no_license
-- 5. Write a query in SQL to display all the information about the department Marketing. -- Sample table: departments -- +---------------+----------------------+------------+-------------+ -- | DEPARTMENT_ID | DEPARTMENT_NAME | MANAGER_ID | LOCATION_ID | -- +---------------+----------------------+------------+-------------+ -- | 10 | Administration | 200 | 1700 | -- | 20 | Marketing | 201 | 1800 | -- | 30 | Purchasing | 114 | 1700 | -- Solutions -- Method-1 SELECT * FROM departments WHERE department_name = 'Marketing'; -- Output -- department_id | department_name | manager_id | location_id -- ---------------+-----------------+------------+------------- -- 20 | Marketing | 201 | 1800
true
8f99cce9fcf4960b965a9c847ff3a05f3539e09f
SQL
JakaJenko/IEPS_Seminarska_WebCrawler
/implementation-indexing/database_creation.sql
UTF-8
287
3.03125
3
[]
no_license
CREATE TABLE ieps3.IndexWord ( word TEXT PRIMARY KEY ); CREATE TABLE ieps3.Posting ( word TEXT NOT NULL, documentName TEXT NOT NULL, frequency INTEGER NOT NULL, indexes TEXT NOT NULL, PRIMARY KEY(word, documentName), FOREIGN KEY (word) REFERENCES ieps3.IndexWord(word) );
true
9b7845d4c9896e92d4f1eb4e4001844243cd66ff
SQL
guimsmendes/hackerrank-resolutions
/Sql/BasicJoin/Challenges.sql
UTF-8
884
4.1875
4
[]
no_license
SELECT b.hacker_id, a.name, COUNT(b.challenge_id) AS count_challenge FROM hackers a INNER JOIN challenges b ON a.hacker_id = b.hacker_id GROUP BY b.hacker_id, a.name HAVING /* output anyone with a count that is equal to... */ count_challenge = /* the max count that anyone has */ (SELECT MAX(temp1.cnt) from (SELECT COUNT(hacker_id) as cnt from Challenges group by hacker_id order by hacker_id) temp1) /* or anyone who's count is in... */ or count_challenge in /* the set of counts... */ (select t.cnt from (select count(*) as cnt from challenges group by hacker_id) t /* who's group of counts... */ group by t.cnt /* has only one element */ having count(t.cnt) = 1) ORDER BY count_challenge DESC, b.hacker_id ;
true
8a394be41a7c3b0a32f548bf19b45da818cb8096
SQL
Juandavid9909/masterPHPCourse
/aprendiendo-sql/06-subconsultas/consultas.sql
UTF-8
1,692
4.09375
4
[]
no_license
/* SUBCONSULTAS: - Son consultas que se ejecutan dentro de otras. - Consiste en utilizar los resultados de la subconsulta para operar en la consulta principal. - Jugando con las claves ajenas / foraneas. */ INSERT INTO usuarios VALUES(NULL, "Admin", "Admin", "admin@admin.com", "admin", CURDATE()); -- Sacar usuarios con entradas SELECT * FROM usuarios WHERE id IN ( SELECT usuario_id FROM entradas ); -- Sacar usuarios sin entradas SELECT * FROM usuarios WHERE id NOT IN ( SELECT usuario_id FROM entradas ); INSERT INTO entradas VALUES(NULL, 3, 1, "Guia de GTA Vice City", "GTA", CURDATE()); -- Sacar los usuarios que tengan alguna entrada que en su titulo hable de GTA SELECT nombre, apellidos FROM usuarios WHERE id IN( SELECT usuario_id FROM entradas WHERE titulo LIKE "%GTA%" ); -- Sacar todas las entradas de la categoria acción utilizando su nombre SELECT * FROM entradas WHERE categoria_id IN( SELECT id FROM categorias WHERE nombre = 'Acción' ); -- Mostrar las categorías con 3 o más entradas SELECT nombre FROM categorias WHERE id IN ( SELECT categoria_id FROM entradas GROUP BY categoria_id HAVING COUNT(categoria_id) >= 3 ); -- Mostrar los usuarios que crearon una entrada un martes SELECT * FROM usuarios WHERE id IN ( SELECT usuario_id FROM entradas WHERE DAYOFWEEK(fecha) = 3 ); -- Mostrar el nombre del usuario que tenga más entradas SELECT CONCAT(nombre, " ", apellidos) AS "El usuario con mas entradas" FROM usuarios WHERE id = ( SELECT COUNT(id) FROM entradas GROUP BY usuario_id ORDER BY COUNT(id) DESC LIMIT 1 ); -- Mostrar las categorías sin entradas SELECT * FROM categorias WHERE id NOT IN ( SELECT categoria_id FROM entradas );
true
a3834e8f9c9efcd7ac7389f589c3a4849162fb7e
SQL
mooncs/TIL
/5_db/00_DB/SQL/04_select.sql
UTF-8
712
4.15625
4
[]
no_license
-- 전체 조회 SELECT * FROM classmates; -- 컬럼 지정 조회 SELECT rowid, name FROM classmates; -- 개수 제한, linit SELECT id, name FROM classmates LIMIT 2; -- OFFSET 같이 사용 가능, OFFSET뒤 자료부터 가져온다. SELECT id, name FROM classmates LIMIT 2 OFFSET 2; -- 데이터베이스에 존재하는 도시의 이름을 중복 없이 가져와 SELECT DISTINCT address from classmates; -- users 테이블에서 age가 30 이상인 유저의 모든 컬럼 정보를 조회 SELECT * FROM users WHERE age >= 30; -- users 테이블에서 age가 30 이상이고 성이 ‘김’인 사람의 나이와 성만 조회 SELECT age, last_name FROM users WHERE age >= 30 AND last_name='김';
true
62a444c0abfb787f20f3f8c3d7aed3e1bca47ada
SQL
afinello/collabtive-task-comments
/tasks_comments.sql
UTF-8
880
2.671875
3
[ "Unlicense" ]
permissive
-- phpMyAdmin SQL Dump -- version 3.3.7deb7 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 10, 2013 at 02:42 PM -- Server version: 5.1.66 -- PHP Version: 5.3.3-7+squeeze17 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 */; CREATE TABLE IF NOT EXISTS `tasks_comments` ( `ID` int(10) NOT NULL AUTO_INCREMENT, `task` int(10) NOT NULL DEFAULT '0', `project` int(10) NOT NULL DEFAULT '0', `text` text NOT NULL, `tags` varchar(255) NOT NULL, `posted` varchar(255) NOT NULL, `user` int(10) NOT NULL DEFAULT '0', `username` varchar(255) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
true
ca520aa9773b72d1dcde9c2e7ee3675f1da2e111
SQL
vimleshtech/mssql-tutorial
/CTE Pivot and Unpivot.sql
MacCentralEurope
3,546
4.21875
4
[]
no_license
use hrms --CTE : Common Type Expression -------------------------- CTE ------------------------------------------- use hrms DROP TABLE CTEMaster CREATE TABLE [CTEMaster]( [Id] [int] , [City] [varchar](50) NULL, [State] [varchar](50) NULL ) insert into [CTEMaster] Select 1,'Aurangabad','BIHAR' union all Select 2,'Aurangabad','MAHARASHTRA' union all Select 3,'Bijapur','KARNATAKA' union all Select 4,'Bijapur','CHHATTISGARH' union all Select 5,'Bilaspur','CHHATTISGARH' union all Select 6,'Bilaspur','HIMACHAL PRADESH' union all Select 7,'Jamui','BIHAR' union all Select 8,'Kullu','HIMACHAL PRADESH' union all Select 9,'Pune','MAHARASHTRA' union all Select 10,'Mumbai','MAHARASHTRA' union all Select 11,'Kolhapur','MAHARASHTRA' union all Select 12,'Nashik','MAHARASHTRA' union all Select 13,'Mysore','KARNATAKA' union all Select 14,'Raigarh','CHHATTISGARH' UNION ALL Select 15,'Aurangabad','BIHAR' union all Select 16,'Bilaspur','CHHATTISGARH' union all Select 17,'Bijapur','KARNATAKA' select * from CTEMaster select city,count(*) from CTEMaster group by city --Row_Number() select * from CTEMaster select *,row_number() over (partition by [state] order by state) from CTEMaster --remove duplicate row from table With temp as ( Select Id,city,state,row_number() over (partition by City,[state] order by City) as CityNumber from [CTEMaster] ) --Select * from temp order by city,[state] --Select * from temp where citynumber > 1 delete from temp where citynumber > 1 --DELETE DUPLICATE ROWS With CTE as ( Select Id,city,[state],row_number() over (partition by City,[state] order by City) as CityNumber from [CTEMaster] ) delete from CTE where CityNumber >1 ----------------pivot table ---unpivot table--------------- select * from PEmployee CREATE TABLE PEmployee ( Name [nvarchar](max), [Year] [int] , Sales [int] ) INSERT INTO PEmployee SELECT 'Pankaj',2010,72500 UNION ALL SELECT 'Rahul',2010,60500 UNION ALL SELECT 'Sandeep',2010,52000 UNION ALL SELECT 'Pankaj',2011,45000 UNION ALL SELECT 'Sandeep',2011,82500 UNION ALL SELECT 'Rahul',2011,35600 UNION ALL SELECT 'Pankaj',2012,32500 UNION ALL SELECT 'Pankaj',2010,20500 UNION ALL SELECT 'Rahul',2011,200500 UNION ALL SELECT 'Sandeep',2010,32000 --When we execute above query, SQL Server throws an error because we cant provide integer value as a column name directly. SELECT [Year], Pankaj,Rahul,Sandeep FROM (SELECT Name, [Year] , Sales FROM PEmployee ) Tab1 PIVOT ( SUM(Sales) FOR Name IN (Pankaj,Rahul,Sandeep) ) AS Tab2 ORDER BY [Tab2].[Year] -- select * from (SELECT Name, [Year] , Sales FROM PEmployee )Tab1 /* --ERROR: SELECT Name, 2010,2011,2012 FROM (SELECT Name, [Year] , Sales FROM Employee )Tab1 PIVOT ( SUM(Sales) FOR [Year] IN (2010,2011,2012)) AS Tab2 ORDER BY Tab2.Name */ -- SELECT Name, [2010],[2011],[2012] FROM (SELECT Name, [Year] , Sales FROM PEmployee )Tab1 PIVOT ( SUM(Sales) FOR [Year] IN ([2010],[2011],[2012])) AS Tab2 ORDER BY Tab2.Name --UNPIVOT CREATE TABLE #Tab ( [Year] int, Pankaj int, Rahul int, Sandeep int ) INSERT INTO #Tab SELECT [Year], Pankaj,Rahul,Sandeep FROM (SELECT Name, [Year] , Sales FROM PEmployee )Tab1 PIVOT ( SUM(Sales) FOR Name IN (Pankaj,Rahul,Sandeep)) AS Tab2 ORDER BY [Tab2].[Year] SELECT Name,[Year] , Sales FROM #Tab t UNPIVOT ( Sales FOR Name IN (Pankaj,Rahul,Sandeep) ) AS TAb2
true
2f82893713f89ba2146ab51f2d9ee3225a70681d
SQL
qiong-coder/MyCar2.0
/src/test/resources/db/schema.sql
UTF-8
2,901
3.203125
3
[]
no_license
CREATE TABLE Account ( `id` INT AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(20) UNIQUE NOT NULL, `password` VARCHAR(20) NOT NULL, `name` VARCHAR(20) NOT NULL, `phone` VARCHAR(20) NOT NULL, `sid` INT(10) NOT NULL, `role` INT(10) NOT NULL DEFAULT 2, `status` INT(10) NOT NULL DEFAULT 0, `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE Store ( `id` INT AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(100) NOT NULL, `address` VARCHAR(255) NOT NULL, `phone` VARCHAR(255) NOT NULL, `status` INT NOT NULL DEFAULT 0, `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, ); CREATE TABLE MyCarOrder ( `id` INT AUTO_INCREMENT PRIMARY KEY, `oid` VARCHAR(50) UNIQUE NOT NULL, `viid` INT(10) NOT NULL, `vid` INT(10) DEFAULT NULL, `begin` DATETIME DEFAULT NULL, `end` DATETIME DEFAULT NULL, `rent_sid` INT(10) NOT NULL, `return_sid` INT(10) NOT NULL, `name` VARCHAR(50) NOT NULL, `drivers` TEXT NOT NULL, `identity` VARCHAR(20) NOT NULL, `phone` VARCHAR(20) NOT NULL, `bill` TEXT DEFAULT NULL, `insurance` VARCHAR(100) DEFAULT NULL, `pre_cost` TEXT DEFAULT NULL, `pay_info` TEXT, `rbegin` DATETIME DEFAULT NULL, `rend` DATETIME DEFAULT NULL, `rrent_sid` INT(10) DEFAULT NULL, `rreturn_sid` INT(10) DEFAULT NULL, `distance` INT(10) DEFAULT NULL, `cost_info` TEXT, `status` INT(10) NOT NULL DEFAULT 0, `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, ); CREATE TABLE Vehicle ( `id` INT(10) AUTO_INCREMENT PRIMARY KEY, `viid` INT(10) NOT NULL, `number` VARCHAR(20) NOT NULL UNIQUE, `description` TEXT NOT NULL, `status` INT(10) NOT NULL DEFAULT 0, `begin` DATETIME DEFAULT NULL, `end` DATETIME DEFAULT NULL, `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `sid` INT(4) NOT NULL, ); CREATE TABLE VehicleInfo ( `id` INT(10) AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR(50) NOT NULL, `displacement` VARCHAR(50) NOT NULL, `gearbox` VARCHAR(50) NOT NULL, `boxes` VARCHAR(50) NOT NULL, `manned` VARCHAR(50) NOT NULL, `oil` VARCHAR(50) NOT NULL, `spare` INT(10) NOT NULL DEFAULT 0, `description` TEXT NOT NULL, `type` VARCHAR(50) NOT NULL, `picture` VARCHAR(100) NOT NULL, `cost` TEXT NOT NULL, `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` INT NOT NULL DEFAULT 0, );
true
09421f19b6f427704633b74b500d0017752db567
SQL
Cloud-Software-Development/trabalho_3
/backend/prisma/migrations/20210222214957_init/migration.sql
UTF-8
1,247
3.875
4
[]
no_license
-- CreateTable CREATE TABLE "User" ( "id" SERIAL NOT NULL, "identification" TEXT NOT NULL, "email" TEXT NOT NULL, "password" TEXT NOT NULL, "name" TEXT NOT NULL, "nickname" TEXT NOT NULL, "admin" BOOLEAN NOT NULL DEFAULT false, PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "Telephone" ( "id" SERIAL NOT NULL, "phone" TEXT NOT NULL, "userId" INTEGER NOT NULL, PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "Document" ( "id" SERIAL NOT NULL, "userId" INTEGER NOT NULL, "hash" TEXT NOT NULL, "filename" TEXT NOT NULL, "selfLink" TEXT NOT NULL, "mediaLink" TEXT NOT NULL, "storageName" TEXT NOT NULL, "storageId" TEXT NOT NULL, "contentType" TEXT NOT NULL, "timeCreated" TIMESTAMP(3) NOT NULL, PRIMARY KEY ("id") ); -- CreateIndex CREATE UNIQUE INDEX "User.identification_unique" ON "User"("identification"); -- CreateIndex CREATE UNIQUE INDEX "User.email_unique" ON "User"("email"); -- AddForeignKey ALTER TABLE "Telephone" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey ALTER TABLE "Document" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
true
e90915029680127fc987c54f418ac8d20b629e7a
SQL
akheel-s/CSE-111-Database_Systems
/Lab 5/lab-5/test/5.sql
UTF-8
474
3.78125
4
[]
no_license
SELECT supplier.s_name, part.p_size, MIN(partsupp.ps_supplycost) FROM supplier INNER JOIN partsupp on partsupp.ps_suppkey = supplier.s_suppkey INNER JOIN nation on supplier.s_nationkey = nation.n_nationkey INNER JOIN region on nation.n_regionkey = region.r_regionkey INNER JOIN part on part.p_partkey = partsupp.ps_partkey WHERE (region.r_name = 'ASIA' AND part.p_type LIKE '%STEEL%') GROUP BY part.p_size ORDER BY supplier.s_name, part.p_size; -- Done with the help of TA
true
2870f9ff0d538cde359c8ffa7e016e95a2356ec2
SQL
BOYER5303/Lawn-and-Order
/db/products/delete_product.sql
UTF-8
199
2.953125
3
[]
no_license
DELETE FROM products WHERE product_id = $1; SELECT p.product_id, p.category, p.product, p.img, p.note FROM products p; --JOIN users u ON t.employee = u.user_id -- WHERE u.company_id = ${company_id};
true
3c1dfdab7b3c76f0f3f2af061fb44713d69e233e
SQL
Aleks-Ya/yaal_examples
/Database+/Postgres+/PostgresSyntax/Scripts/ddl/constraint/check.sql
UTF-8
1,614
4.21875
4
[]
no_license
drop schema if exists check_constraint cascade; create schema if not exists check_constraint; -- List constraints select * from information_schema.table_constraints where table_schema = 'check_constraint'; -- Add constraint without name (name is generated) CREATE TABLE check_constraint.products ( product_no integer, name text, price numeric CHECK (price > 0) ); -- Violate the constraint insert into check_constraint.products (product_no, name, price) values (1, 'car', -100); -- Add constraint with name CREATE TABLE check_constraint.products2 ( product_no integer, name text, price numeric CONSTRAINT positive_price CHECK (price > 0) ); -- Violate the constraint insert into check_constraint.products2 (product_no, name, price) values (1, 'car', -100); -- Add a multi column constraint CREATE TABLE check_constraint.products3 ( product_no integer, name text, price numeric CHECK (price > 0), discounted_price numeric CHECK (discounted_price > 0), CHECK (price > discounted_price) ); -- Violate the constraint insert into check_constraint.products3 (product_no, name, price, discounted_price) values (1, 'car', 100, 200); -- Add a multi column constraint (with name) CREATE TABLE check_constraint.products4 ( product_no integer, name text, price numeric CHECK (price > 0), discounted_price numeric CHECK (discounted_price > 0), constraint discount_price_less_price CHECK (price > discounted_price) ); -- Violate the constraint insert into check_constraint.products4 (product_no, name, price, discounted_price) values (1, 'car', 100, 200);
true
255722c05a2382c18439fbbd4f796bd8dd807629
SQL
Jafet6/Jafet6.github.io
/back-end/my-sql/exercises/21_2/exercises3.sql
UTF-8
734
3.5625
4
[]
no_license
SELECT first_name, last_name FROM sakila.actor UNION SELECT UCASE(first_name), UCASE(last_name) FROM sakila.staff; SELECT first_name, last_name FROM sakila.customer WHERE first_name LIKE '%tracy%' UNION SELECT first_name, last_name FROM sakila.actor WHERE first_name LIKE '%je%'; (SELECT first_name FROM sakila.actor ORDER BY actor_id DESC LIMIT 5) UNION (SELECT first_name FROM sakila.staff ORDER BY staff_id ASC LIMIT 1) UNION (SELECT first_name FROM sakila.customer ORDER BY customer_id ASC LIMIT 5 OFFSET 15) ORDER BY first_name ASC; (SELECT first_name, last_name FROM sakila.customer LIMIT 15 OFFSET 45) UNION (SELECT first_name, last_name FROM sakila.actor LIMIT 15 OFFSET 45) ORDER BY first_name ASC, last_name DESC;
true
468c9329ec2a1fd6060f31c7587fb5808bdda143
SQL
ygchan/SQL
/Ch_06_Sets.sql
UTF-8
5,619
4.1875
4
[]
no_license
-- How to sign back onto the SQL server. /* export PATH=$PATH:/Applications/MySQLWorkbench.app/Contents/MacOS mysql -u Study -p bank; */ -- SQL set operators -- Both data sets must have the same number of columns -- The data type must be the same -- 01: Compound query, "adding them vertically." -- combines multiple but otherwise independent queries. select 1 num, 'george' name union select 5 num, 'vivian' name; -- 02: Union and Union all -- Union takes the two dataset, sort them and select the uniquely new rows -- from second dataset and append together as a new dataset. -- Union all does not sort of account for duplicates that might be added. -- Book's definition: -- Union - sorts the combined set and removes duplicates, -- whereas union all does not. -- Union all's final dataset set will always equal the sum of the number of rows -- of the set being combined. -- 03: Union all - does not sort or remove duplicates select 'IND' type_cd, cust_id, lname name from individual union all select 'BUS' type_cd, cust_id, name from business union all /* Prove to you that it does not remove duplicates */ select 'BUS' type_cd, cust_id, name from business; /* Output: +---------+---------+------------------------+ | type_cd | cust_id | name | +---------+---------+------------------------+ | IND | 1 | Hadley | | IND | 2 | Tingley | | IND | 3 | Tucker | | IND | 4 | Hayward | | IND | 5 | Frasier | | IND | 6 | Spencer | | IND | 7 | Young | | IND | 8 | Blake | | IND | 9 | Farley | | BUS | 10 | Chilton Engineering | | BUS | 11 | Northeast Cooling Inc. | | BUS | 12 | Superior Auto Body | | BUS | 13 | AAA Insurance Inc. | | BUS | 10 | Chilton Engineering | | BUS | 11 | Northeast Cooling Inc. | | BUS | 12 | Superior Auto Body | | BUS | 13 | AAA Insurance Inc. | +---------+---------+------------------------+ */ -- 04: Combine table and exclude duplicate rows select emp_id from employee where assigned_branch_id = 2 and (title = 'Teller' or title = 'Head Teller') union select distinct open_emp_id from account where open_branch_id = 2; -- 05: Intersect and except operator -- Not in MySQL. Intersect returns overlap as result set -- Except returns first table minus the second table -- Except remove all occurrence of duplicates -- Except all only removed matched occurence of duplicates -- 06: Set operation rule -- Usually the column names are the same, but it doesn't have to be the case select emp_id, assigned_branch_id from employee where title = 'Teller' union select open_emp_id, open_branch_id from account where product_cd = 'SAV' order by emp_id; -- But if you are ordering by the column name in the SECOND dataset, you will -- get an error. /* Output: mysql> select emp_id, assigned_branch_id -> from employee -> where title = 'Teller' -> union -> select open_emp_id, open_branch_id -> from account -> where product_cd = 'SAV' -> order by open_emp_id; ERROR 1054 (42S22): Unknown column 'open_emp_id' in 'order clause' */ -- 07: Set Operation Precedence /* First union returns all, but second union sort and remove duplicates */ select cust_id from account where product_cd in ('SAV', 'MM') union all select a.cust_id from account a inner join branch b on (a.open_branch_id = b.branch_id) where b.name = 'Woburn Branch' union select cust_id from account where avail_balance between 500 and 2500; -- When you are using DIFFERENT set operators, then the orders that the query -- are arranged ARE different. -- WARNING! In general they are evaluated from top to bottom. -- In ANSI (American National Standard Institute) SQL calls for -- intersection to have precedence over the other set of operators -- You may dictate the order by enclosing multiple queries in parentheses. -- In MySQL, neither was implemented, so make sure to use parentheses! -- Example -- The order is being dictated by programmer. (select cust_id from account where product_cd in ('SAV', 'MM') union all select a.cust_id from account a inner join branch b on (a.open_branch_id = b.branch_id) where b.name = 'Woburn Branch') intersect (select cust_id from account where avail_balance between 500 and 2500 except select cust_id from account where product_cd = 'CD' and avail_balance < 1000) -- Test your knowledge!! -- 6.1 If set A = {L M N O P} and set B = {P Q R S T} -- What sets are generated by the following operations? -- A union B = {L M N O P Q R S T} -- Combine the set A and B -- The result set is sorted and duplicate removed. -- A union all B = {L M N O P P Q R S T} -- The result set is not sorted, and duplicates not removed. -- A intersect B = {P} -- The result set contains only overlap from A and B. -- A except B = {L M N O} -- The result set contains everything in A not in B. -- 6.2 Write a compound query that finds the first and last name of all -- individual customers along with the first and last name of all employees. select fname, lname from individual /* Used union all because in case there are individual and employee with the same name, still want to see them */ union select fname, lname from employee; -- 6.3 Sort the result by lname select fname, lname from individual union all select fname, lname from employee order by lname;
true
d6b983f243cf1ab490b598a76fca060143dd03c4
SQL
tectronics/dreamdb
/WoWEmuf.org/Teleporter_NPC_TrinityCore2(Gossip)/Teleporter_with_Gossip.sql
ISO-8859-2
7,339
3.140625
3
[]
no_license
#NPC: Alliance SET @entryA :=50000; SET @factionA :=1733; -- Ez megy az allis npc-nek (Alliance=Friendly, Horde=Hated) SET @factionB :=1735; -- Ez megy a hords npc-nek (Alliance=Hated, Horde=Friendly) DELETE FROM `creature_template` WHERE `entry`=@entryA; INSERT INTO `creature_template` VALUES (@entryA, 0, -- difficulty_entry_1 0, -- difficulty_entry_2 0, -- difficulty_entry_3 0, -- KillCredit1 0, -- KillCredit2 21277, -- modelid1 0, -- modelid2 0, -- modelid3 0, -- modelid4 'Teleport', -- name 'Teleport', -- subname '', -- IconName 0, -- gossip_menu_id 80, -- minlevel 80, -- maxlevel 0, -- exp @factionA, -- faction_A @factionA, -- Faction_H 3, -- npcflag 1, -- speed_walk 1, -- speed_run 1, -- scale 2, -- rank 0, -- mindmg 0, -- maxdmg 0, -- dmgschool 102, -- attackpower 1, -- dmg_multiplier 2000, -- baseattacktime 0, -- rangeattacktime 1, -- unit_class 512, -- unit_flags 0, -- dynamicflags 0, -- family 0, -- trainer_type 0, -- trainer_spell 0, -- trainer_class 0, -- trainer_race 29, -- minrangedmg 42, -- maxrangedmg 9, -- rangedattackpower 7, -- type 0, -- type_flags 0, -- lootid 0, -- pickpocketloot 0, -- skinloot 0, -- resistance1 0, -- resistance2 0, -- resistance3 0, -- resistance4 0, -- resistance5 0, -- resistance6 0, -- spell1 0, -- spell2 0, -- spell3 0, -- spell4 0, -- spell5 0, -- spell6 0, -- spell7 0, -- spell8 0, -- PetSpellDataId 0, -- VehicleId 0, -- mingold 0, -- maxgold '', -- AIName 0, -- MovementType 3, -- InhabitType 1.05, -- Health_mod 1, -- Mana_mod 1, -- Armor_mod 0, -- RacialLeader 0, -- QuestItem1 0, -- QuestItem2 0, -- QuestItem3 0, -- QuestItem4 0, -- QuestItem5 0, -- QuestItem6 0, -- movementID 1, -- RegenHealth 0, -- equipment_id 0, -- mechanic_immune_mask 2, -- flags_extra '', -- ScriptName 0); -- WDBVerified #NPC: Horde SET @entryH :=@entryA+1; DELETE FROM `creature_template` WHERE `entry`=@entryH; INSERT INTO `creature_template` VALUES (@entryH, 0, -- difficulty_entry_1 0, -- difficulty_entry_2 0, -- difficulty_entry_3 0, -- KillCredit1 0, -- KillCredit2 21277, -- modelid1 0, -- modelid2 0, -- modelid3 0, -- modelid4 'Teleport', -- name 'Teleport', -- subname '', -- IconName 0, -- gossip_menu_id 80, -- minlevel 80, -- maxlevel 0, -- exp @factionB, -- faction_A @factionB, -- Faction_H 3, -- npcflag 1, -- speed_walk 1, -- speed_run 1, -- scale 2, -- rank 0, -- mindmg 0, -- maxdmg 0, -- dmgschool 102, -- attackpower 1, -- dmg_multiplier 2000, -- baseattacktime 0, -- rangeattacktime 1, -- unit_class 512, -- unit_flags 0, -- dynamicflags 0, -- family 0, -- trainer_type 0, -- trainer_spell 0, -- trainer_class 0, -- trainer_race 29, -- minrangedmg 42, -- maxrangedmg 9, -- rangedattackpower 7, -- type 0, -- type_flags 0, -- lootid 0, -- pickpocketloot 0, -- skinloot 0, -- resistance1 0, -- resistance2 0, -- resistance3 0, -- resistance4 0, -- resistance5 0, -- resistance6 0, -- spell1 0, -- spell2 0, -- spell3 0, -- spell4 0, -- spell5 0, -- spell6 0, -- spell7 0, -- spell8 0, -- PetSpellDataId 0, -- VehicleId 0, -- mingold 0, -- maxgold '', -- AIName 0, -- MovementType 3, -- InhabitType 1.05, -- Health_mod 1, -- Mana_mod 1, -- Armor_mod 0, -- RacialLeader 0, -- QuestItem1 0, -- QuestItem2 0, -- QuestItem3 0, -- QuestItem4 0, -- QuestItem5 0, -- QuestItem6 0, -- movementID 1, -- RegenHealth 0, -- equipment_id 0, -- mechanic_immune_mask 2, -- flags_extra '', -- ScriptName 0); -- WDBVerified SET @id :=60000; SET @id2 :=@id+1; SET @id3 :=@id2+1; SET @id4 :=@id3+1; SET @id5 :=@id4+1; SET @id6 :=@id5+1; SET @id7 :=@id6+1; SET @id8 :=@id7+1; SET @id9 :=@id8+1; SET @id10 :=@id9+1; SET @id11 :=@id10+1; SET @id12 :=@id11+1; DELETE FROM `gossip_scripts` WHERE `id` IN (@id,@id2,@id3,@id4,@id5,@id6,@id7,@id8,@id9,@id10,@id11); INSERT INTO `gossip_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES # Stormwind, Ironforge, Darnassus, Exodar (@id,0,6,0,0,0,-8833.164063,479.762543,112.095619,0.587327), (@id2,0,6,0,0,0,-4821.613281,-1155.579468,502.212250,3.335226), (@id3,0,6,1,0,0,9947.525391,2604.150879,1316.187988,4.223004), (@id4,0,6,530,0,0,-4054.751709,-11793.398438,11.113947,1.515031), # Orgrimmar, Thunder Bluff, Undercity, Silvermoon City (@id5,0,6,1,0,0,1677.910400,-4314.788574,62.500027,2.669688), (@id6,0,6,1,0,0,-1197.183716,29.270617,179.754837,2.966604), (@id7,0,6,0,0,0,1568.478760,268.519928,-42.138416,1.697186), (@id8,0,6,530,0,0,9373.077148,-7166.074219,11.476312,5.386526), # Shattrath, Dalaran, Gurubashi Arena (@id9,0,6,530,0,0,-1879.500977,5409.461426,-12.427713,1.033202), (@id10,0,6,571,0,0,5813.643555,651.078247,647.396973,3.982841), (@id11,0,6,0,0,0,-13234.119141,217.386627,31.675938,1.068150); DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@id,@id2); INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`action_script_id`,`box_coded`,`box_money`,`box_text`) VALUES # Stormwind, Ironforge, Darnassus, Exodar (Alliance NPC) (@id,@id2,4,'Teleport to Stormwind',1,1,0,0,@id,0,0,'Are you sure, you\'re ready to teleport?'), (@id,@id3,4,'Teleport to Ironforge',1,1,0,0,@id2,0,0,'Are you sure, you\'re ready to teleport?'), (@id,@id4,4,'Teleport to Darnassus',1,1,0,0,@id3,0,0,'Are you sure, you\'re ready to teleport?'), (@id,@id5,4,'Teleport to Exodar',1,1,0,0,@id4,0,0,'Are you sure, you\'re ready to teleport?'), # Orgrimmar, Thunder Bluff, Undercity, Silvermoon City (Horde NPC) (@id2,@id6,4,'Teleport to Orgrimmar',1,1,0,0,@id5,0,0,'Are you sure, you\'re ready to teleport?'), (@id2,@id7,4,'Teleport to Thunder Bluff',1,1,0,0,@id6,0,0,'Are you sure, you\'re ready to teleport?'), (@id2,@id8,4,'Teleport to Undercity',1,1,0,0,@id7,0,0,'Are you sure, you\'re ready to teleport?'), (@id2,@id9,4,'Teleport to Silvermoon',1,1,0,0,@id8,0,0,'Are you sure, you\'re ready to teleport?'), # Shattrath, Dalaran, Gurubashi Arena (Alliance NPC) (@id,@id10,4,'Teleport to Shattrath',1,1,0,0,@id9,0,0,'Are you sure, you\'re ready to teleport?'), (@id,@id11,4,'Teleport to Dalaran',1,1,0,0,@id10,0,0,'Are you sure, you\'re ready to teleport?'), (@id,@id12,4,'Teleport to Gurubashi Arena',1,1,0,0,@id11,0,0,'Are you sure, you\'re ready to teleport?'), # Shattrath, Dalaran, Gurubashi Arena (Horde NPC) (@id2,@id10,4,'Teleport to Shattrath',1,1,0,0,@id9,0,0,'Are you sure, you\'re ready to teleport?'), (@id2,@id11,4,'Teleport to Dalaran',1,1,0,0,@id10,0,0,'Are you sure, you\'re ready to teleport?'), (@id2,@id12,4,'Teleport to Gurubashi Arena',1,1,0,0,@id11,0,0,'Are you sure, you\'re ready to teleport?'); # Megjelen szveg tallkozsnl DELETE FROM `npc_text` WHERE `id` IN (@id,@id2); DELETE FROM `gossip_menu` WHERE `entry` IN (@id,@id2); INSERT INTO `npc_text` (`ID`,`text0_0`) VALUES (@id,'dvzllek $N! Teleportra fel!'),(@id2,'dvzllek $N! Teleportra fel!'); INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@id,@id),(@id2,@id2); # s, hogy ezt az npc hasznlja a gossipot UPDATE `creature_template` SET `gossip_menu_id`=@id WHERE `entry`=@entryA; UPDATE `creature_template` SET `gossip_menu_id`=@id2 WHERE `entry`=@entryH;
true
94f756bfce330e5302d037cba5cefad1afd3f662
SQL
DavidHaynesHasGitHub/navy_schemaV2
/navy.sql
UTF-8
1,001
3.46875
3
[]
no_license
SELECT 'hello, PG'; DROP TABLE IF EXISTS ships CASCADE; DROP TABLE IF EXISTS fleet CASCADE; DROP TABLE IF EXISTS sailors CASCADE; DROP TABLE IF EXISTS duties CASCADE; DROP TABLE IF EXISTS ranks CASCADE; DROP TABLE IF EXISTS assignments CASCADE; CREATE TABLE ships ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(255) NOT NULL, date_built DATE, fleet_id INTEGER NOT NULL ); CREATE TABLE fleet ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(255) NOT NULL ); CREATE TABLE sailors ( id SERIAL PRIMARY KEY NOT NULL, fullname VARCHAR(255) NOT NULL, dob DATE NOT NULL ); CREATE TABLE duties ( id SERIAL PRIMARY KEY NOT NULL, title VARCHAR(255) NOT NULL ); CREATE TABLE ranks ( id SERIAL PRIMARY KEY NOT NULL, ranking VARCHAR(80) NOT NULL ); CREATE TABLE assignments ( assignment_id SERIAL PRIMARY KEY NOT NULL, sailor_id INTEGER NOT NULL, ship_id INTEGER NOT NULL, rank_assigned INTEGER NOT NULL, duty_assigned INTEGER NOT NULL, start_duty DATE, end_duty DATE );
true
c15474cdc45bfee3b938fa371a6daa8bf89d1c3b
SQL
dlu7/cpsc408-assignment2
/assignment2.sql
UTF-8
1,613
3.953125
4
[]
no_license
-- CPSC 408: Assignment 2 -- 1. CREATE TABLE Player ( pID SMALLINT UNSIGNED, name VARCHAR (20) NOT NULL, teamName VARCHAR(20), PRIMARY KEY (pID) ); -- 2. ALTER TABLE Player ADD age TINYINT UNSIGNED; -- 3. INSERT INTO Player VALUES (1, 'Player 1', 'Team A', 23), (3, 'Player 3', 'Team B', 28); INSERT INTO Player (pID, name, teamName) VALUES (2, 'Player 2', 'Team A'), (4, 'Player 4', 'Team B'); -- 4. DELETE FROM Player WHERE pID = 2; -- 5. UPDATE Player SET age = 25 WHERE age IS NULL; -- 6. SELECT COUNT(*), AVG(age) FROM Player; -- 7. DROP TABLE Player; -- Chinook database -- 8. SELECT AVG(Total) FROM Invoice WHERE BillingCountry = 'Brazil'; -- 9. SELECT BillingCity, AVG(Total) FROM Invoice WHERE BillingCountry = 'Brazil' GROUP BY BillingCity; -- 10. SELECT Album.Title, COUNT(*) FROM Track, Album WHERE Track.AlbumId = Album.AlbumId GROUP BY Album.Title HAVING COUNT(*) > 20; -- 11. SELECT COUNT(InvoiceDate) FROM Invoice WHERE InvoiceDate LIKE '2010%'; -- 12. SELECT BillingCountry, COUNT(DISTINCT BillingCity) FROM Invoice GROUP BY BillingCountry; -- 13. SELECT Album.Title, Track.Name, MediaType.Name FROM Album, Track, MediaType WHERE Track.MediaTypeId = MediaType.MediaTypeId AND Album.AlbumId = Track.AlbumId GROUP BY Album.Title; -- 14. SELECT COUNT(Invoice.InvoiceId) FROM Invoice, Customer WHERE Invoice.CustomerId = Customer.CustomerId AND Customer.SupportRepId = (SELECT EmployeeId FROM Employee WHERE FirstName = 'Jane' AND LastName = 'Peacock');
true
df28bb3d606a8b2f079cf336bd0c3b6e654775f0
SQL
prodersu/Planet-of-Java
/kids.sql
UTF-8
1,693
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1 -- Время создания: Дек 09 2019 г., 10:42 -- Версия сервера: 10.1.35-MariaDB -- Версия PHP: 7.2.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- База данных: `dance_school` -- -- -------------------------------------------------------- -- -- Структура таблицы `kids` -- CREATE TABLE `kids` ( `id` int(250) NOT NULL, `title` varchar(500) CHARACTER SET utf8 NOT NULL, `master` varchar(500) CHARACTER SET utf8 NOT NULL, `schedule` varchar(500) CHARACTER SET utf8 NOT NULL, `price` bigint(255) NOT NULL, `sold` bigint(255) NOT NULL, `count` int(255) NOT NULL, `age` int(100) NOT NULL, `tour` varchar(200) CHARACTER SET utf8 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Индексы сохранённых таблиц -- -- -- Индексы таблицы `kids` -- ALTER TABLE `kids` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT для сохранённых таблиц -- -- -- AUTO_INCREMENT для таблицы `kids` -- ALTER TABLE `kids` MODIFY `id` int(250) 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
f5f9b5345427b0366a30ac416223098f76053377
SQL
ruihuangdev/reveal
/sql/rui.sql
UTF-8
2,483
3.90625
4
[ "MIT" ]
permissive
################################ ## QUERIES ## ################################ # get information of all orders for a single customer select O.Customer_id, OD.Product_ID, OD.Order_quantity, P.Selling_Price, (OD.Order_quantity * P.Selling_Price) as Order_Amount from Orders O, Order_Details OD, Product P where O.Order_Number = OD.Order_number and OD.Product_ID = P.Product_ID and O.Customer_id = 1 group by P.Product_id, OD.Order_Quantity; ################################ ## PROCEDURES ## ################################ # calculate the total amount of all orders of a single customer drop procedure if exists calcAmount; delimiter // create procedure calcAmount(x int) Begin Declare Total decimal(20, 2); select SUM(q1.Item_Amount) as Total_Amount into Total from ( select OD.Order_quantity * P.Selling_Price as Item_Amount from Orders O, Order_Details OD, Product P where O.Order_Number = OD.Order_number and OD.Product_ID = P.Product_ID and O.Customer_id = x group by P.Product_id, OD.Order_Quantity ) as q1; Select Total as amountSpent; end// delimiter ; call calcAmount(1); ################################ ## FUNCTIONS ## ################################ # calculate the points earned by a single customer SET GLOBAL log_bin_trust_function_creators=1; drop function if exists calcPoints; delimiter // create function calcPoints(x int) returns int Begin Declare pt int; Declare total decimal(20, 2); select SUM(q1.Item_Amount) as Total_Amount into total from ( select OD.Order_quantity * P.Selling_Price as Item_Amount from Orders O, Order_Details OD, Product P where O.Order_Number = OD.Order_number and OD.Product_ID = P.Product_ID and O.Customer_id = x group by P.Product_id, OD.Order_Quantity ) as q1; set pt = total; Return(pt); end// delimiter ; select calcPoints(1) as pointsEarned; ################################ ## TRIGGERS ## ################################ # Clear the points of a customer before the next order drop trigger if exists clearPointsBeforeOrder; delimiter // create trigger clearPointsBeforeOrder before insert on Orders for each row Begin If exists(select customer_ID from customers where customer_ID = new.Customer_ID) then update customers set points = 0 where customers.customer_id = new.customer_id; end if; end// delimiter ; # TEST insert into Orders values (9,1,date('2020-5-30'),date('2020-06-02')); select * from customers where customer_ID = 1;
true
99211eb54aeb314868b21d9b617be020cfb7d0a7
SQL
totallytot/sql-snippets-for-atlassian-products
/mysql-variables-and-useful-snippets.sql
UTF-8
622
3.109375
3
[]
no_license
select @@innodb_buffer_pool_size; select @@innodb_log_file_size; select @@innodb_lock_wait_timeout; select @@max_connections; -- this should deliver you which Tables have references to the table you want to drop, -- once you drop these references, or the datasets which reference datasets in this table you will be able to drop the table SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME = 'YourTable'; SELECT table_name FROM information_schema.tables WHERE table_name ='Database Name'; -- data folders SHOW VARIABLES WHERE Variable_name LIKE '%dir'; -- show connections SHOW PROCESSLIST;
true
ca494bd1ef9a78cae6beac59ed473e364e6b7649
SQL
mgoldsmith-mdsol/prs_scripts
/One Time Executions/WR207315_novonordisk.clinicalforce.com_UpdateCostsWithNullSpendPurpose_2012.1.0.1/WR207315_novonordisk.clinicalforce.com_UpdateCostsWithNullSpendPurpose_2012.1.0.1.sql
WINDOWS-1252
2,538
3.65625
4
[]
no_license
/* * Author: Michael Goldsmith * Date: 2013-FEB-27 * * Site: Novonordisk PROD * URL: novonordisk.clinicalforce.com * AR#: 1-434662348 * WR#: 207315 * */ /* > select tag, value, display from dropdown_lookup where (tag='accountingSubCode' and display='Investigator Fee-Ongoing') or (tag='spendPurpose' and display='Bona Fide Clinical Trial - Gross Compensation') or (tag='spendPurposeOther' and display='Clinical Trial Visit Fees') or (tag='natureOfPayment' and display='Compensation for Research Project') + ----------------- + ---------- + ------------------------------------------------ + | tag | value | display | + ----------------- + ---------- + ------------------------------------------------ + | accountingSubCode | 3 | Investigator Fee-Ongoing | | natureOfPayment | 40 | Compensation for Research Project | | spendPurpose | 5 | Bona Fide Clinical Trial - Gross Compensation | | spendPurposeOther | 20 | Clinical Trial Visit Fees | + ----------------- + ---------- + ------------------------------------------------ + 4 rows Per Alice Cheung (PM): Novo has gotten back to me on the list of cost records with missing SPEND_PURPOSE and what the fields should be populated with. Account Sub-Code Investigator Fees-Ongoing [accountingSubCode, 3 -> "Investigator Fee-Ongoing"] Spend Purpose: Bonafide Clinical Trial-Gross Compensation [spendPurpose, 5 -> "Bona Fide Clinical Trial - Gross Compensation"] Spend Secondary Purpose: Clinical Trial Visit Fees [spendPurposeOther, 20 -> "Clinical Trial Visit Fees"] Nature of Payment: Compensation for Research Project [natureOfPayment, 40 -> "Compensation for Research Project"] */ UPDATE cost c INNER JOIN activity a ON c.assoc_obj='activity' AND a.id=c.assoc_obj_id INNER JOIN subject_def s ON a.assoc_obj='subject_def' AND s.id=a.assoc_obj_id SET c.accounting_sub_code=3 , c.nature_of_payment=40 , c.spend_purpose=5 , c.spend_purpose_other=20 WHERE c.spend_purpose IS NULL /* * Expected results: 312 record(s) affected */ /* * FOR TESTER: * * The below query should yield 0 results when executed after UPDATE script above * SELECT * FROM cost c INNER JOIN activity a ON c.assoc_obj='activity' AND a.id=c.assoc_obj_id INNER JOIN subject_def s ON a.assoc_obj='subject_def' AND s.id=a.assoc_obj_id WHERE c.spend_purpose IS NULL */
true
a652a9812a9546a4c24fc6b616d4fee05070f299
SQL
JoaoVinezof/api.simple-blog
/engineering/vl_joaovinezof1.sql
UTF-8
23,552
3.21875
3
[ "MIT" ]
permissive
/* Navicat Premium Data Transfer Source Server : Localhost Source Server Type : MySQL Source Server Version : 100411 Source Host : localhost:3306 Source Schema : vl_joaovinezof Target Server Type : MySQL Target Server Version : 100411 File Encoding : 65001 Date: 28/05/2020 22:45:06 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for alerts -- ---------------------------- DROP TABLE IF EXISTS `alerts`; CREATE TABLE `alerts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'modal', `is_active` tinyint(1) NOT NULL DEFAULT 1, `order` int(11) NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for api_keys -- ---------------------------- DROP TABLE IF EXISTS `api_keys`; CREATE TABLE `api_keys` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `user_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `public_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `private_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `site_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for briefings -- ---------------------------- DROP TABLE IF EXISTS `briefings`; CREATE TABLE `briefings` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `visit_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `contractor_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `contractor_phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `contractor_email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `contractor_city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `contractor_state` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `product_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `product_name` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `product_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `product_term` date NOT NULL, `has_answer` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for comments -- ---------------------------- DROP TABLE IF EXISTS `comments`; CREATE TABLE `comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `user_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `visitor_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `is_active` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for config -- ---------------------------- DROP TABLE IF EXISTS `config`; CREATE TABLE `config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `brand_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `banner_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `site_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `slogan` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `created_at` timestamp(0) NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for custom_html -- ---------------------------- DROP TABLE IF EXISTS `custom_html`; CREATE TABLE `custom_html` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `slug` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `html` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for images -- ---------------------------- DROP TABLE IF EXISTS `images`; CREATE TABLE `images` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `owner_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `original_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `full_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `relative_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `order` int(11) NOT NULL DEFAULT 0, `is_active` tinyint(1) NOT NULL DEFAULT 1, `is_public` tinyint(1) NOT NULL, `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `description` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `alt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for labels -- ---------------------------- DROP TABLE IF EXISTS `labels`; CREATE TABLE `labels` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `cover_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `slug` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `color` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for messages -- ---------------------------- DROP TABLE IF EXISTS `messages`; CREATE TABLE `messages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `visit_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for portifolio -- ---------------------------- DROP TABLE IF EXISTS `portifolio`; CREATE TABLE `portifolio` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `cover_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `thumbnail_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `order` int(11) NOT NULL DEFAULT 0, `color` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `is_active` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for post_config -- ---------------------------- DROP TABLE IF EXISTS `post_config`; CREATE TABLE `post_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `allow_comments` tinyint(1) NOT NULL DEFAULT 1, `allow_likes` tinyint(1) NOT NULL DEFAULT 1, `permanent_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for post_label_rel -- ---------------------------- DROP TABLE IF EXISTS `post_label_rel`; CREATE TABLE `post_label_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `id_post` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `id_label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for post_likes -- ---------------------------- DROP TABLE IF EXISTS `post_likes`; CREATE TABLE `post_likes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `post_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `user_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `visitor_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `vote` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for posts -- ---------------------------- DROP TABLE IF EXISTS `posts`; CREATE TABLE `posts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `user_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `cover_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `thumbnail_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `color` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `category` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `slug` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `published` tinyint(4) NOT NULL, `published_at` datetime(0) NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for seo -- ---------------------------- DROP TABLE IF EXISTS `seo`; CREATE TABLE `seo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `owner_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `thumbnail_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `charset` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'UF-8', `author` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `copyright` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `keywoods` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `robots` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'index, follow', `dc_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for services -- ---------------------------- DROP TABLE IF EXISTS `services`; CREATE TABLE `services` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `order` int(11) NOT NULL DEFAULT 0, `is_active` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for skills -- ---------------------------- DROP TABLE IF EXISTS `skills`; CREATE TABLE `skills` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `level` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `order` int(11) NOT NULL DEFAULT 0, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for smtp_config -- ---------------------------- DROP TABLE IF EXISTS `smtp_config`; CREATE TABLE `smtp_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `host` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `port` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `copy_to` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for social_media -- ---------------------------- DROP TABLE IF EXISTS `social_media`; CREATE TABLE `social_media` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `owner_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `image_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `slug` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `user` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `private_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `public_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `avatar_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `cover_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `slug` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `created_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for visitor_routes -- ---------------------------- DROP TABLE IF EXISTS `visitor_routes`; CREATE TABLE `visitor_routes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `visit_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `url` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `uri` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `was_converted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(0) NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for visitors -- ---------------------------- DROP TABLE IF EXISTS `visitors`; CREATE TABLE `visitors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `uri` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `was_converted` tinyint(1) NOT NULL DEFAULT 0, `cretead_at` timestamp(0) NOT NULL DEFAULT current_timestamp(), `updated_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0), PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
true
53542bf34d6f7be989ca611933d37d43ede1f04b
SQL
MrLeanage/SalesBuddyServer
/src/lib/sql/salesbuddy.sql
UTF-8
7,570
3.1875
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.23, for Win64 (x86_64) -- -- Host: localhost Database: salesbuddy -- ------------------------------------------------------ -- Server version 8.0.23 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES 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 `about` -- DROP TABLE IF EXISTS `about`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `about` ( `aInfoID` int NOT NULL AUTO_INCREMENT, `aBookshopName` varchar(45) NOT NULL, `aBookshopAddress` varchar(400) DEFAULT NULL, `aContactPerson` varchar(45) DEFAULT NULL, `aContactDesignation` varchar(45) DEFAULT NULL, `aContactEmail` varchar(45) DEFAULT NULL, `aBookshopNumber` varchar(20) DEFAULT NULL, PRIMARY KEY (`aInfoID`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `about` -- LOCK TABLES `about` WRITE; /*!40000 ALTER TABLE `about` DISABLE KEYS */; INSERT INTO `about` VALUES (1,'Sarasavi BookShop','104/75, Main Street, Gampaha, Sri Lanka','U D Liyanage','Manager','ud@yahoo.com','+94 33 222 2901'); /*!40000 ALTER TABLE `about` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `book` -- DROP TABLE IF EXISTS `book`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `book` ( `bID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT, `bISBN` varchar(45) DEFAULT NULL, `bTitle` varchar(45) DEFAULT NULL, `bAuthor` varchar(45) DEFAULT NULL, `bDescription` varchar(400) DEFAULT NULL, `bLanguage` varchar(45) DEFAULT NULL, `bPublishYear` varchar(45) DEFAULT NULL, `bAvailability` varchar(45) DEFAULT NULL, PRIMARY KEY (`bID`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `book` -- LOCK TABLES `book` WRITE; /*!40000 ALTER TABLE `book` DISABLE KEYS */; INSERT INTO `book` VALUES (00001,'135464321','Sample Title','Sample Author','Sample Description','English','Sample Publisher - 2021','Available'),(00002,'654451v6ss','Sample Title 4','Sample Author 2','Sample Description 2','Sinhala','Sample Publisher - 2021','Not Available'),(00004,'654451v6ss','Sample Title 1','Sample Author 2','Sample Description 2','Sinhala','Sample Publisher - 2021','Not Available'),(00005,'1236691431','Oliver Twist','Charles Dickens','English literature','English','Melhoramentos - 1995','Not Available'); /*!40000 ALTER TABLE `book` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `bookview` -- DROP TABLE IF EXISTS `bookview`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `bookview` ( `vID` int NOT NULL AUTO_INCREMENT, `vBID` int DEFAULT NULL, `vDate` varchar(20) DEFAULT NULL, PRIMARY KEY (`vID`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `bookview` -- LOCK TABLES `bookview` WRITE; /*!40000 ALTER TABLE `bookview` DISABLE KEYS */; INSERT INTO `bookview` VALUES (1,1,'2021-04-24'),(2,1,'2021-04-28'),(3,4,'2021-05-04'),(4,1,'2021-05-04'),(5,4,'2021-05-04'),(6,4,'2021-05-04'),(7,4,'2021-05-04'),(8,4,'2021-05-04'),(9,4,'2021-05-04'),(10,4,'2021-05-04'),(11,5,'2021-05-04'),(12,5,'2021-05-04'),(13,5,'2021-05-04'),(14,5,'2021-05-04'); /*!40000 ALTER TABLE `bookview` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `feedback` -- DROP TABLE IF EXISTS `feedback`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `feedback` ( `fID` int(5) unsigned zerofill NOT NULL AUTO_INCREMENT, `fCategory` varchar(20) DEFAULT NULL, `fTitle` varchar(45) DEFAULT NULL, `fDescription` varchar(500) DEFAULT NULL, `fDate` varchar(20) DEFAULT NULL, `fTime` varchar(20) DEFAULT NULL, `fStatus` varchar(20) DEFAULT NULL, PRIMARY KEY (`fID`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `feedback` -- LOCK TABLES `feedback` WRITE; /*!40000 ALTER TABLE `feedback` DISABLE KEYS */; INSERT INTO `feedback` VALUES (00001,'Service Appreciation','vsdvsdv','sdsvsdvsvs','2021-05-03','23:03:14','Pending'),(00002,'Service Appreciation','Nice Service','Thanks for the service','2021-05-04','15:48:58','Pending'); /*!40000 ALTER TABLE `feedback` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `request` -- DROP TABLE IF EXISTS `request`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `request` ( `rID` int NOT NULL AUTO_INCREMENT, `rBName` varchar(45) DEFAULT NULL, `rDescription` varchar(400) DEFAULT NULL, `rBAuthor` varchar(45) DEFAULT NULL, `rBEdition` varchar(45) DEFAULT NULL, `rBPublisher` varchar(45) DEFAULT NULL, `rDate` varchar(20) DEFAULT NULL, `rStatus` varchar(20) DEFAULT NULL, PRIMARY KEY (`rID`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `request` -- LOCK TABLES `request` WRITE; /*!40000 ALTER TABLE `request` DISABLE KEYS */; INSERT INTO `request` VALUES (1,'gerbeb','ebbfbg','nfgnfgn','gnfgnf','fgnfgnf','2021-05-03','Pending'); /*!40000 ALTER TABLE `request` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `user` ( `uEmail` varchar(45) NOT NULL, `uName` varchar(45) NOT NULL, `uPassword` varchar(200) NOT NULL, `uType` varchar(10) NOT NULL, PRIMARY KEY (`uEmail`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` VALUES ('guest@yahoo.com','GUEST ','e10adc3949ba59abbe56e057f20f883e','Guest'),('ud@yahoo.com','Uthpala Liyanage','e10adc3949ba59abbe56e057f20f883e','Admin'),('uthpala@yahoo.com','Uthpala Liyanage','e10adc3949ba59abbe56e057f20f883e','Admin'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2021-05-04 15:56:28
true
17aba21ebaf1af9ceb8d76b7461aa0b6050e0548
SQL
loury/SAU-IMS-HTML-master
/SAU-IMS/数据库导出文件文件/sauims.sql
UTF-8
9,715
2.90625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50714 Source Host : localhost:3306 Source Database : sauims Target Server Type : MYSQL Target Server Version : 50714 File Encoding : 65001 Date: 2016-12-01 11:34:23 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for activity_check -- ---------------------------- DROP TABLE IF EXISTS `activity_check`; CREATE TABLE `activity_check` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(60) NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `state` tinyint(4) NOT NULL DEFAULT '0', `admin_id` int(11) NOT NULL, `respond` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of activity_check -- ---------------------------- INSERT INTO `activity_check` VALUES ('1', 'ee', '2016-10-03 21:46:23', '0', '3', 'e'); -- ---------------------------- -- Table structure for clubinfo -- ---------------------------- DROP TABLE IF EXISTS `clubinfo`; CREATE TABLE `clubinfo` ( `club_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`club_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of clubinfo -- ---------------------------- INSERT INTO `clubinfo` VALUES ('1', '校社联'); INSERT INTO `clubinfo` VALUES ('2', '出云音乐协会'); -- ---------------------------- -- Table structure for club_log -- ---------------------------- DROP TABLE IF EXISTS `club_log`; CREATE TABLE `club_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(60) NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `title` varchar(60) NOT NULL, `admin_id` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of club_log -- ---------------------------- -- ---------------------------- -- Table structure for club_register -- ---------------------------- DROP TABLE IF EXISTS `club_register`; CREATE TABLE `club_register` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(60) NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `state` tinyint(4) NOT NULL DEFAULT '0', `admin_id` int(11) NOT NULL, `respond` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of club_register -- ---------------------------- -- ---------------------------- -- Table structure for notice -- ---------------------------- DROP TABLE IF EXISTS `notice`; CREATE TABLE `notice` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `text` text NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `title` varchar(60) NOT NULL, `right` int(11) NOT NULL DEFAULT '0', `club_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of notice -- ---------------------------- INSERT INTO `notice` VALUES ('3', '啊第三方反反复复反反复复反反复复吩咐', '2016-11-27 12:03:47', '厄尔', '0', '1'); INSERT INTO `notice` VALUES ('4', '搜索', '2016-11-27 12:03:51', '嗖嗖嗖', '0', '2'); INSERT INTO `notice` VALUES ('5', '鹅鹅鹅', '2016-11-27 12:03:48', '轻轻巧巧', '0', '1'); INSERT INTO `notice` VALUES ('6', '333', '2016-11-27 12:03:52', '二万人', '0', '1'); INSERT INTO `notice` VALUES ('7', '\r\n$admin = ModelFactory::factory(\"SauAdmin\");//获取管理员身份\r\n$a =$admin->noticeList();\r\nprint_r( $a );', '2016-11-27 12:03:53', '代码', '0', '1'); INSERT INTO `notice` VALUES ('8', '<?php\r\n\r\nrequire \"../framework/ModelFactory.php\";\r\n<?php\r\n\r\nrequire \"../framework/ModelFactory.php\";\r\n<?php\r\n\r\nrequire \"../framework/ModelFactory.php\";\r\n<?php\r\n\r\nrequire \"../framework/ModelFactory.php\";\r\n<?php\r\n\r\nrequire \"../framework/ModelFactory.php\";\r\n', '2016-11-27 12:03:53', '大妈', '0', '1'); INSERT INTO `notice` VALUES ('9', '22', '2016-11-27 12:03:55', '2', '0', '2'); INSERT INTO `notice` VALUES ('10', 'we', '2016-11-27 12:03:56', '2e', '0', '2'); INSERT INTO `notice` VALUES ('11', '23', '2016-11-27 12:03:58', '2', '0', '2'); INSERT INTO `notice` VALUES ('12', '33', '2016-11-27 12:04:01', '2', '0', '1'); INSERT INTO `notice` VALUES ('14', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('15', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('16', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('17', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('18', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('19', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('20', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('21', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('22', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('23', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('24', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('25', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('26', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('27', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('28', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('29', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('30', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('31', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('32', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('33', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('34', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); INSERT INTO `notice` VALUES ('35', 'text', '2016-11-11 11:11:11', 'title', '0', '1'); -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(20) NOT NULL, `password` varchar(32) NOT NULL, `right` int(11) NOT NULL DEFAULT '0', `club_id` int(11) NOT NULL DEFAULT '0', `salt` varchar(32) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('1', '1', '28c8edde3d61a0411511d3b1866f0636', '2', '1', '1'); INSERT INTO `user` VALUES ('2', '2', '2', '1', '2', '1'); -- ---------------------------- -- Table structure for user_club -- ---------------------------- DROP TABLE IF EXISTS `user_club`; CREATE TABLE `user_club` ( `user_id` int(11) NOT NULL, `club_id` int(11) NOT NULL, PRIMARY KEY (`user_id`,`club_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user_club -- ---------------------------- INSERT INTO `user_club` VALUES ('1', '1'); INSERT INTO `user_club` VALUES ('1', '2'); INSERT INTO `user_club` VALUES ('2', '2'); -- ---------------------------- -- Table structure for user_notice -- ---------------------------- DROP TABLE IF EXISTS `user_notice`; CREATE TABLE `user_notice` ( `user_id` int(11) NOT NULL, `notice_id` int(11) NOT NULL, `delete` tinyint(4) NOT NULL DEFAULT '0', `read` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`,`notice_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user_notice -- ---------------------------- INSERT INTO `user_notice` VALUES ('1', '3', '1', '0'); INSERT INTO `user_notice` VALUES ('1', '4', '1', '1'); INSERT INTO `user_notice` VALUES ('1', '29', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '30', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '31', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '32', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '33', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '34', '0', '0'); INSERT INTO `user_notice` VALUES ('1', '35', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '29', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '30', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '31', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '32', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '33', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '34', '0', '0'); INSERT INTO `user_notice` VALUES ('2', '35', '0', '0'); -- ---------------------------- -- Table structure for year_check -- ---------------------------- DROP TABLE IF EXISTS `year_check`; CREATE TABLE `year_check` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(60) NOT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `state` tinyint(4) NOT NULL DEFAULT '0', `admin_id` int(11) NOT NULL, `respond` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `url` (`url`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of year_check -- ---------------------------- SET FOREIGN_KEY_CHECKS=1;
true
ad916b6bc61be5e2448f3766fa6ece07f6673e0c
SQL
AjinkyaBangale2/Leetcode-SQL-Solutions
/1076 Project Employees II.sql
UTF-8
275
3.96875
4
[ "MIT" ]
permissive
#https://leetcode.com/problems/project-employees-ii/ SELECT project_id from Project GROUP BY project_id HAVING count(employee_id) = (SELECT count(employee_id) as num FROM Project p GROUP BY project_id ORDER BY count(employee_id) desc LIMIT 1)
true
d1f5a4c7f0e47951db095cc271d7de62adc31302
SQL
Goodkatt/351DB
/queries.sql
UTF-8
319
2.734375
3
[]
no_license
UPDATE Submission SET sub_date = CURRENT_TIMESTAMP - INTERVAL FLOOR(RAND() * 14) DAY WHERE sub_date IS NULL; UPDATE Submission SET bonus = 10 WHERE bonus IS NULL; UPDATE Submission SET sub_deadline = '2017-12-01' WHERE sub_deadline IS NULL; UPDATE Submission SET submission_grade = 10 WHERE sub_deadline > sub_date;
true
16ed0ad38e9df254545d330c7c9aa7a43130f41a
SQL
ArMANIAK/CodeIgniter_practice
/db.sql
UTF-8
3,107
3.5
4
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
-- -------------------------------------------------------- -- Хост: localhost -- Версия сервера: 5.7.24 - MySQL Community Server (GPL) -- Операционная система: Win64 -- HeidiSQL Версия: 10.2.0.5599 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- Дамп структуры базы данных blog CREATE DATABASE IF NOT EXISTS `blog` /*!40100 DEFAULT CHARACTER SET utf16 */; USE `blog`; -- Дамп структуры для таблица blog.authors CREATE TABLE IF NOT EXISTS `authors` ( `authorId` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '0', `avatar` varchar(255) NOT NULL DEFAULT '0', `socialNetworks` varchar(1023) NOT NULL DEFAULT '0', `profileViews` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`authorId`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf16; -- Экспортируемые данные не выделены. -- Дамп структуры для таблица blog.posts CREATE TABLE IF NOT EXISTS `posts` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(50) NOT NULL, `body` varchar(1023) NOT NULL, `preview` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, `author` int(10) unsigned NOT NULL, `date` date NOT NULL, `newsViews` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `author` (`author`), CONSTRAINT `author` FOREIGN KEY (`author`) REFERENCES `authors` (`authorId`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf16; -- Экспортируемые данные не выделены. -- Дамп структуры для таблица blog.posts_tags CREATE TABLE IF NOT EXISTS `posts_tags` ( `relationId` int(10) unsigned NOT NULL AUTO_INCREMENT, `post_id` int(10) unsigned NOT NULL, `tag_id` int(10) unsigned NOT NULL, PRIMARY KEY (`relationId`), KEY `tag_id` (`tag_id`), KEY `post_id` (`post_id`), CONSTRAINT `post_id` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`), CONSTRAINT `tag_id` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf16; -- Экспортируемые данные не выделены. -- Дамп структуры для таблица blog.tags CREATE TABLE IF NOT EXISTS `tags` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `tag` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf16; -- Экспортируемые данные не выделены. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
23a408c0f6c9c1e16a485ebdf2bb9aed26e9e83c
SQL
mariadb-JonahHarris/pg_fdw_mv_rewrite
/sql/test-103-complex-mv1.sql
UTF-8
424
2.75
3
[]
no_license
-- Anticipate no rewrite explain (VERBOSE, COSTS OFF) select key, COUNT (value) from test where hidden = 'hidden2' group by key; select key, COUNT (value) from test where hidden = 'hidden2' group by key; -- Anticipate rewrite explain (VERBOSE, COSTS OFF) select key, COUNT (value) from test where hidden = 'hidden2' group by key, hidden; select key, COUNT (value) from test where hidden = 'hidden2' group by key, hidden;
true
3eaf9c9690356933dcbc0d34a36dee876f3f429c
SQL
raduitache/Orcus
/db.sql
UTF-8
12,349
3.328125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 07, 2019 at 06:10 PM -- 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: `orcus` -- -- -------------------------------------------------------- -- -- Table structure for table `customers` -- CREATE TABLE `customers` ( `id` int(11) UNSIGNED NOT NULL, `name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `phone_number` varchar(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `customers` -- INSERT INTO `customers` (`id`, `name`, `address`, `phone_number`) VALUES (1, 'Andrei', 'Loc. Andrei, Str. Andrei, nr. Andrei', 'Andrei'); -- -------------------------------------------------------- -- -- Table structure for table `order` -- CREATE TABLE `order` ( `id` int(11) UNSIGNED NOT NULL, `order_details` varchar(255) NOT NULL, `total` int(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order` -- INSERT INTO `order` (`id`, `order_details`, `total`) VALUES (1, 'Some order for Andrei', 100); -- -------------------------------------------------------- -- -- Table structure for table `order_details` -- CREATE TABLE `order_details` ( `id` int(11) UNSIGNED NOT NULL, `product_id` int(11) UNSIGNED NOT NULL, `price_each` int(11) UNSIGNED NOT NULL, `quantity` int(11) UNSIGNED NOT NULL, `order_id` int(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order_details` -- INSERT INTO `order_details` (`id`, `product_id`, `price_each`, `quantity`, `order_id`) VALUES (1, 1, 100, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `prices` -- CREATE TABLE `prices` ( `id` int(11) UNSIGNED NOT NULL, `product_id` int(11) UNSIGNED NOT NULL, `value` int(11) UNSIGNED NOT NULL, `start_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `end_date` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `prices` -- INSERT INTO `prices` (`id`, `product_id`, `value`, `start_date`, `end_date`) VALUES (1, 1, 100, '2019-05-07 16:03:30', NULL); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE `product` ( `id` int(11) UNSIGNED NOT NULL, `name` varchar(255) NOT NULL, `specs` varchar(255) NOT NULL, `staff_id` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product` -- INSERT INTO `product` (`id`, `name`, `specs`, `staff_id`) VALUES (1, 'Product for Andrei', 'Perfectly suited for Andrei\'s needs', NULL); -- -------------------------------------------------------- -- -- Table structure for table `provision_of_services` -- CREATE TABLE `provision_of_services` ( `id` int(11) UNSIGNED NOT NULL, `service_type` varchar(255) NOT NULL, `customer_id` int(11) UNSIGNED NOT NULL, `staff_id` int(11) UNSIGNED NOT NULL, `address` varchar(255) NOT NULL, `material` varchar(255) NOT NULL, `workmanship` varchar(255) NOT NULL, `tools` varchar(255) NOT NULL, `shipping` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `provision_of_services` -- INSERT INTO `provision_of_services` (`id`, `service_type`, `customer_id`, `staff_id`, `address`, `material`, `workmanship`, `tools`, `shipping`) VALUES (1, 'The exact service Andrei needs', 1, 2, 'Loc. Andrei, Str. Andrei, nr. Andrei', 'Andrei\'s favourite material', 'Just enough for Andrei to be satisfied', 'Andrei\'s favourite kind of hammer', 'Andrei\'s budget-friendly deal.'); -- -------------------------------------------------------- -- -- Table structure for table `quantity_in_stock` -- CREATE TABLE `quantity_in_stock` ( `id` int(11) UNSIGNED NOT NULL, `product_id` int(11) UNSIGNED NOT NULL, `amount` int(11) UNSIGNED NOT NULL, `last_change` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `quantity_in_stock` -- INSERT INTO `quantity_in_stock` (`id`, `product_id`, `amount`, `last_change`) VALUES (1, 1, 13, '2019-05-07 16:05:12'); -- -------------------------------------------------------- -- -- Table structure for table `schedule` -- CREATE TABLE `schedule` ( `id` int(11) UNSIGNED NOT NULL, `start_hours` int(11) UNSIGNED NOT NULL, `end_hours` int(11) UNSIGNED NOT NULL, `free_days` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `schedule` -- INSERT INTO `schedule` (`id`, `start_hours`, `end_hours`, `free_days`) VALUES (1, 8, 16, 'Andrei\'s favourite holidays, during which he wouldn\'t like to work'); -- -------------------------------------------------------- -- -- Table structure for table `service` -- CREATE TABLE `service` ( `id` int(11) UNSIGNED NOT NULL, `customer_id` int(11) UNSIGNED NOT NULL, `staff_id` int(11) UNSIGNED NOT NULL, `product_name` varchar(255) NOT NULL, `product_brand` varchar(255) NOT NULL, `product_defects` varchar(255) NOT NULL, `parts_replaced` varchar(255) NOT NULL, `man-hours_spent` int(11) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `service` -- INSERT INTO `service` (`id`, `customer_id`, `staff_id`, `product_name`, `product_brand`, `product_defects`, `parts_replaced`, `man-hours_spent`) VALUES (1, 1, 1, 'Andrei\'s Thinkpad', 'Andrei\'s Lenovo', 'Andrei\'s Thinkpad\'s fingerprint scanner seems not to work as well as Andrei likes..', 'Replaced the fingerprint scanner with Andrei\'s favourite kind', 69); -- -------------------------------------------------------- -- -- Table structure for table `staff` -- CREATE TABLE `staff` ( `id` int(11) UNSIGNED NOT NULL, `cnp` varchar(13) NOT NULL, `name` varchar(255) NOT NULL, `position` varchar(255) NOT NULL, `phone_number` varchar(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `staff` -- INSERT INTO `staff` (`id`, `cnp`, `name`, `position`, `phone_number`) VALUES (1, '5000602375447', 'Tache Radu Ioan', 'Founder', '+40748069496'), (2, '5001119375432', 'Spiridon Stefan', 'Founder, CEO', '+40745309423'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `name` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `is_admin` tinyint(1) DEFAULT NULL, `staff_id` int(11) UNSIGNED DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `password`, `is_admin`, `staff_id`) VALUES (1, 'radutache', 'rootpassword', 1, 1), (2, 'stefanspiridon', 'rootpassword', 1, 2), (3, 'andrei', 'andrei', 0, NULL), (5, 'root', 'rootpassword', 1, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `customers` -- ALTER TABLE `customers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order` -- ALTER TABLE `order` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_details` -- ALTER TABLE `order_details` ADD PRIMARY KEY (`id`), ADD KEY `order_details_order_id` (`order_id`), ADD KEY `order_details_product_id` (`product_id`); -- -- Indexes for table `prices` -- ALTER TABLE `prices` ADD PRIMARY KEY (`id`), ADD KEY `prices_product_id` (`product_id`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`id`), ADD KEY `product_staff_id` (`staff_id`); -- -- Indexes for table `provision_of_services` -- ALTER TABLE `provision_of_services` ADD PRIMARY KEY (`id`), ADD KEY `provision_of_services_customer_id` (`customer_id`), ADD KEY `provision_of_services_staff_id` (`staff_id`); -- -- Indexes for table `quantity_in_stock` -- ALTER TABLE `quantity_in_stock` ADD PRIMARY KEY (`id`), ADD KEY `quantity_in_stock_product_id` (`product_id`); -- -- Indexes for table `schedule` -- ALTER TABLE `schedule` ADD PRIMARY KEY (`id`); -- -- Indexes for table `service` -- ALTER TABLE `service` ADD PRIMARY KEY (`id`), ADD KEY `service_customer_id` (`customer_id`), ADD KEY `service_staff_id` (`staff_id`); -- -- Indexes for table `staff` -- ALTER TABLE `staff` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `cnp` (`cnp`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD KEY `users_staff_id` (`staff_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `customers` -- ALTER TABLE `customers` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `order` -- ALTER TABLE `order` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `order_details` -- ALTER TABLE `order_details` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `prices` -- ALTER TABLE `prices` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `product` -- ALTER TABLE `product` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `provision_of_services` -- ALTER TABLE `provision_of_services` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `quantity_in_stock` -- ALTER TABLE `quantity_in_stock` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `schedule` -- ALTER TABLE `schedule` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `service` -- ALTER TABLE `service` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `staff` -- ALTER TABLE `staff` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- Constraints for dumped tables -- -- -- Constraints for table `order_details` -- ALTER TABLE `order_details` ADD CONSTRAINT `order_details_order_id` FOREIGN KEY (`order_id`) REFERENCES `order` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `order_details_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `prices` -- ALTER TABLE `prices` ADD CONSTRAINT `prices_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `product` -- ALTER TABLE `product` ADD CONSTRAINT `product_staff_id` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `provision_of_services` -- ALTER TABLE `provision_of_services` ADD CONSTRAINT `provision_of_services_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `provision_of_services_staff_id` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `quantity_in_stock` -- ALTER TABLE `quantity_in_stock` ADD CONSTRAINT `quantity_in_stock_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `service` -- ALTER TABLE `service` ADD CONSTRAINT `service_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON UPDATE CASCADE, ADD CONSTRAINT `service_staff_id` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`) ON UPDATE CASCADE; -- -- Constraints for table `users` -- ALTER TABLE `users` ADD CONSTRAINT `users_staff_id` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`id`) 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
ec5da202ee3a2219110e75a461d0fb79612f3c6b
SQL
mohamed-hohoud/contact-formulier
/eigenaren.sql
UTF-8
1,979
2.890625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Gegenereerd op: 23 jun 2017 om 15:12 -- Serverversie: 10.1.21-MariaDB -- PHP-versie: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `project_taak4` -- -- -------------------------------------------------------- -- -- Tabelstructuur voor tabel `eigenaren` -- CREATE TABLE `eigenaren` ( `Eigenaar_id` int(11) NOT NULL, `Eigenaar_naam` varchar(100) NOT NULL, `Adres` varchar(100) NOT NULL, `Huisnummer` varchar(7) NOT NULL, `Postcode` varchar(6) NOT NULL, `Woonplaats` varchar(37) NOT NULL, `Telefoonnummer` varchar(10) DEFAULT NULL, `Opmerking` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Gegevens worden geëxporteerd voor tabel `eigenaren` -- INSERT INTO `eigenaren` (`Eigenaar_id`, `Eigenaar_naam`, `Adres`, `Huisnummer`, `Postcode`, `Woonplaats`, `Telefoonnummer`, `Opmerking`) VALUES (2, 'Mohamed', 'Raoul wallenberglaan', '16', '3527wl', 'Utrecht', '0684442489', ''), (6, 'h', 'h', 'h', 'h', 'h', 'h', ''), (7, '', '', '', '', '', '', ''), (8, '', '', '', '', '', '', ''), (9, '', '', '', '', '', '', ''); -- -- Indexen voor geëxporteerde tabellen -- -- -- Indexen voor tabel `eigenaren` -- ALTER TABLE `eigenaren` ADD UNIQUE KEY `Eigenaar_id` (`Eigenaar_id`); -- -- AUTO_INCREMENT voor geëxporteerde tabellen -- -- -- AUTO_INCREMENT voor een tabel `eigenaren` -- ALTER TABLE `eigenaren` MODIFY `Eigenaar_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; /*!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
b04bb973d2cb34cdf6454926dc4a5eb90359faf9
SQL
dbs889/sql
/hr20200703.sql
UTF-8
1,550
3.28125
3
[]
no_license
SELECT * FROM DBA_USERS; ALTER USER hr IDENTIFIED BY java; ALTER USER hr ACCOUNT UNLOCK; 과제8 SELECT r.region_id,r.region_name,c.country_name FROM countries c,regions r WHERE c.region_id = r.region_id AND r.region_name ='Europe'; 과제9 SELECT r.region_id,r.region_name,c.country_name,city FROM countries c,regions r,locations l WHERE c.region_id = r.region_id AND c.country_id = l.country_id AND r.region_name ='Europe'; 과제10 SELECT r.region_id,r.region_name,c.country_name,city,department_name FROM countries c,regions r,locations l,departments d WHERE c.region_id = r.region_id AND c.country_id = l.country_id AND l.location_id = d.location_id AND r.region_name ='Europe'; 과제11 SELECT r.region_id,r.region_name,c.country_name,city,department_name,CONCAT(e.first_name,last_name) name FROM countries c,regions r,locations l,departments d,employees e WHERE c.region_id = r.region_id AND c.country_id = l.country_id AND l.location_id = d.location_id AND d.department_id = e.department_id AND r.region_name ='Europe'; 과제12 SELECT e.employee_id,CONCAT(e.first_name,last_name) name,j.job_id,j.job_title FROM employees e, jobs j WHERE e.job_id = j.job_id; 과제13 SELECT m.employee_id mgr_id, CONCAT(m.first_name,m.last_name) mgr_name, e.employee_id,CONCAT(e.first_name,e.last_name) name,j.job_id,j.job_title FROM employees e,employees m,jobs j WHERE e.job_id = j.job_id AND e.manager_id = m.employee_id;
true
91cb77fa9b14c4199e091813062bae973b7ab1d6
SQL
lucaburatti7/A00-Training-plan
/讲义_旧版/ZLJPj/SQL文样本/LTRSHT.SQL
SHIFT_JIS
4,528
2.734375
3
[]
no_license
CREATE TABLE LTRSHT ( o CHAR(9) NOT NULL, } NUMBER(1,0) NOT NULL, tOQo^폜 CHAR(1) NOT NULL, tOQx CHAR(1) NOT NULL, _~[OOP CHAR(2) NOT NULL, ƖR[h CHAR(3) NOT NULL, ͔ CHAR(1) NOT NULL, xʔ CHAR(10) NOT NULL, ͎ NUMBER(6,0) NOT NULL, [ԍ CHAR(8) NOT NULL, ʔԍ CHAR(4) NOT NULL, S҃R[h CHAR(4) NOT NULL, Ə NUMBER(4,0) NOT NULL, Ji CHAR(10) NOT NULL, ͓I CHAR(1) NOT NULL, ͓N NUMBER(6,0) NOT NULL, o^I CHAR(1) NOT NULL, o^N NUMBER(6,0) NOT NULL, I CHAR(1) NOT NULL, N NUMBER(6,0) NOT NULL, I CHAR(1) NOT NULL, N NUMBER(6,0) NOT NULL, 敪 CHAR(1) NOT NULL, ʔ CHAR(9) NOT NULL, _~[OOQ CHAR(3) NOT NULL, Ə CHAR(4) NOT NULL, x@ CHAR(1) NOT NULL, ׋敪R[h CHAR(1) NOT NULL, xQI NUMBER(1,0) NOT NULL, xQN CHAR(6) NOT NULL, xz NUMBER(13,0) NOT NULL, dsR[h NUMBER(4,0) NOT NULL, dxXR[h NUMBER(3,0) NOT NULL, da NUMBER(1,0) NOT NULL, dԍ NUMBER(7,0) NOT NULL, sR[h NUMBER(4,0) NOT NULL, xXR[h NUMBER(3,0) NOT NULL, a NUMBER(1,0) NOT NULL, ԍ NUMBER(7,0) NOT NULL, `l CHAR(30) NOT NULL, `QI NUMBER(1,0) NOT NULL, `QN CHAR(6) NOT NULL, nR[h CHAR(1) NOT NULL, R[h CHAR(1) NOT NULL, R[h CHAR(1) NOT NULL, X֔ԍQe NUMBER(3,0) NOT NULL, X֔ԍQq NUMBER(4,0) NOT NULL, XZP VARCHAR2(34) NOT NULL, XZQ VARCHAR2(32) NOT NULL, XZR VARCHAR2(32) NOT NULL, X於P VARCHAR2(28) NOT NULL, XQ VARCHAR2(28) NOT NULL, gr CHAR(46) NOT NULL, 於 VARCHAR2(56) NOT NULL, o^ԍ CHAR(4) NOT NULL, 萔S CHAR(1) NOT NULL, xR[h CHAR(4) NOT NULL, _~[OOR CHAR(83) NOT NULL, ʏ CHAR(35) NOT NULL, CONSTRAINT PK_LTRSHT PRIMARY KEY ( o, }));
true
dbdd50279ba11e68023dfaff1009d85c65ca7306
SQL
kyc90/JD-prediction
/signal_generation/MASTER_creation_v1.sql
UTF-8
777
3.046875
3
[]
no_license
/* * @Author: han.jiang * @Date: 2017-04-28 21:38:44 * @Last Modified by: han.jiang * @Last Modified time: 2017-05-09 11:48:15 */ SELECT COUNT() FROM JDATA_USER_TBL; -- 105321 SELECT COUNT() FROM JDATA_PRODUCT_TBL; -- 24187 SELECT COUNT() FROM JDATA_COMMENT_TBL; -- 558552 SELECT COUNT() FROM JDATA_ACTION_TBL; -- 50601736 -- master table for model building drop table if exists MASTER_0201_0408; create table MASTER_0201_0408 as select A.* ,B.* ,C.* from LABEL_0409_0413 as A left join SKU_MASTER_0201_0408 AS B ON A.SKU_ID = B.SKU_ID left join USER_ACTION_0201_0408 as C ON A.SKU_ID = C.SKU_ID left join ; select count() from SKU_MASTER_0201_0410; -- 27907 -- master table for model scoring drop table if exists MASTER_0201_0415; create table MASTER_0201_0415 as
true
104711b5c87378f9572cbf10791dd60d5a4f25d7
SQL
ivandeex/ivasql
/stepik-db97/xactions-homeworks.sql
UTF-8
3,867
4.125
4
[]
no_license
---------------------------------------------------- -- HOMEWORK #1 ROLLBACK; DROP TABLE IF EXISTS T CASCADE; DROP TABLE IF EXISTS R CASCADE; CREATE TABLE T(id int, value int); CREATE TABLE R(id int, value int); INSERT INTO T VALUES (1,10), (2,20); INSERT INTO R VALUES (1,100), (2,200); COMMIT; BEGIN ISOLATION LEVEL REPEATABLE READ; -- T2 BEGIN ISOLATION LEVEL READ COMMITTED; -- T1 SELECT SUM(value) INTO _t2_sum FROM R; -- T2 _t2_sum := 300 BEGIN ISOLATION LEVEL READ COMMITTED; -- T3 SELECT value INTO _t1_value FROM T WHERE id=1; -- T1 _t1_value := 10 SELECT MAX(value) INTO _t3_max FROM T; -- T3 _t3_max := 20 UPDATE T SET value = _t1_value + 50 WHERE id=1; -- T1 T(1) := 10+50 COMMIT; -- T1 UPDATE T SET value = _t2_sum WHERE id=1; -- T2 T(1) := 300 (ERROR) COMMIT; -- T2 ROLLBACK UPDATE R SET value = _t3_max + (SELECT MAX(value) FROM T) WHERE id=2; -- T3 R(2) := 20+60 COMMIT; -- T3 OK, R(2) == 80 ---------------------------------------------------- -- HOMEWORK #2 ROLLBACK; DROP TABLE IF EXISTS T; CREATE TABLE T(id int, group_id int, value int); INSERT INTO T VALUES (1,1,500),(2,2,500),(3,1,500),(4,2,500); COMMIT; -- T (before) T (after) -- id group_id value id group_id value -- 1 1 500 1 1 300 -- 2 2 500 2 2 1000 -- 3 1 500 3 1 600 -- 4 2 500 4 2 500 BEGIN ISOLATION LEVEL REPEATABLE READ; -- T3 BEGIN BEGIN ISOLATION LEVEL READ COMMITTED; -- T2 BEGIN BEGIN ISOLATION LEVEL REPEATABLE READ; -- T1 BEGIN SELECT * FROM T WHERE group_id=1; -- T1 UPDATE T SET value=value+100 WHERE group_id=1; -- T1 UPDATE T SET value=value*2 WHERE id=2; -- T2 COMMIT; -- T1 END UPDATE T SET value=value/2 WHERE id=1; -- T2 UPDATE T SET value=value-50 WHERE group_id=2; -- T3 COMMIT; -- T2 END COMMIT; -- T3 END ---------------------------------------------------- -- HOMEWORK #3 -- -- see: https://stepik.org/lesson/50202/step/4 -- Alice RC BEGIN ISOLATION LEVEL READ COMMITTED; SELECT value FROM T WHERE id = 2 FOR UPDATE; -- 0(2) SELECT value FROM T WHERE id = 3 FOR UPDATE; -- 2(2) SELECT value FROM T WHERE id = 4 FOR UPDATE; -- 4(2) SELECT value FROM T WHERE id = 1 FOR UPDATE; -- 6(2) / 13(2) (pends on H's UPDATE) UPDATE T SET value = value + 10 WHERE id BETWEEN 1 AND 4; -- 8(10) / 15(10) COMMIT; -- 18 / 25 -- M_rc = 18(1-p)+25p -- Alice RR (1st attempt) BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT value FROM T WHERE id = 2; -- 0(1) SELECT value FROM T WHERE id = 3; -- 1(1) SELECT value FROM T WHERE id = 4; -- 2(1) SELECT value FROM T WHERE id = 1; -- 3(1) UPDATE T SET value = value + 10 WHERE id BETWEEN 1 AND 4; -- 4(10) / 4(...) COMMIT; -- 14(OK) / 13(ROLLBACK) -- (2nd attempt, only after ROLLBACK) BEGIN ISOLATION LEVEL REPEATABLE READ; SELECT value FROM T WHERE id = 2; -- 13(1) SELECT value FROM T WHERE id = 3; -- 14(1) SELECT value FROM T WHERE id = 4; -- 15(1) SELECT value FROM T WHERE id = 1; -- 16(1) UPDATE T SET value = value + 10 WHERE id BETWEEN 1 AND 4; -- 17(10) COMMIT; -- x / 27 (only after ROLLBACK) -- M_rr = 14(1-p)+27p -- Alice II is better than Alice I: -- M_rr < M_rc -- 14(1-p)+27p < 18(1-p)+25p -- p in [0,2/3) <-- answer -- Hatter BEGIN ISOLATION LEVEL READ COMMITTED; SELECT value FROM T WHERE id = 1 FOR UPDATE; -- 0(2) SELECT id /*inc INTO _inc*/ FROM R WHERE id = 1; -- 2(1) UPDATE T SET value = value + 1/*_inc*/ WHERE id=1; -- 3(10) COMMIT; -- 13(2+1+10=13) <-- Alice-RC wakes up / Alice-RR rolls back -- END --
true
c4aae439cb18175dba9649eff4ce13da328a66b6
SQL
madoed/UNC-2018
/src/main/resources/sql/005_user.sql
UTF-8
1,520
2.8125
3
[]
no_license
insert into Obj_types (object_type_id, name) values (1, 'user'); insert into Attributes (attr_id, attr_name) values (1001, 'first_name'), (1002, 'last_name'), (1003, 'username'), (1004, 'email'), (1006, 'friend'), (1036, 'avatar_url'), (1037, 'about_me'); insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'first_name'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'last_name'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'username'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'email'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'friend'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'avatar_url'; insert into Obj_attributes (object_type_id, attr_id) select object_type_id, attr_id from Obj_types, Attributes where Obj_types.name like 'user' and attr_name like 'about_me';
true
6d3e1be558b441a1850011478278d9524b45786d
SQL
webpoin/swaa
/win8.sql
UTF-8
1,856
3.140625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- 主机: localhost -- 生成日期: 2014 年 03 月 30 日 18:14 -- 服务器版本: 5.5.16 -- PHP 版本: 5.3.8 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 */; -- -- 数据库: `win8` -- -- -------------------------------------------------------- -- -- 表的结构 `layout` -- CREATE TABLE IF NOT EXISTS `layout` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '模块id', `title` varchar(80) NOT NULL, `parent` int(11) NOT NULL COMMENT '父级id', `position` int(2) NOT NULL COMMENT '位置', `size` int(2) NOT NULL COMMENT '大小', `show` varchar(16) NOT NULL COMMENT '显示类型', `content` varchar(256) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- 转存表中的数据 `layout` -- INSERT INTO `layout` (`id`, `title`, `parent`, `position`, `size`, `show`, `content`) VALUES (1, '我们的伟筑', 0, 1, 0, 'menu', ''), (2, '', 1, 1, 42, 'menu', '我们的伟筑'), (3, '', 1, 2, 42, 'menu', '我们的项目'), (4, '', 1, 3, 42, 'menu', '我们的团队'), (5, '', 1, 4, 42, 'menu', '新闻发布'), (6, '', 1, 5, 42, 'null', 'logo'), (7, '', 1, 6, 42, 'menu', '苏伟专栏'), (8, '', 1, 7, 42, 'menu', '招聘发布'), (9, '', 1, 8, 42, 'menu', '我们的资源'), (10, '', 1, 9, 42, 'menu', '联系我们'), (11, '二级', 2, 1, 42, 'menu', '二级栏目'); /*!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
08de8c2c21a42e52020c2fc79a6c43850869d5e8
SQL
JenLHarris/open-data-app
/museums.sql
UTF-8
2,026
2.890625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Apr 27, 2012 at 04:55 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 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: `harr0475` -- -- -------------------------------------------------------- -- -- Table structure for table `museums` -- CREATE TABLE IF NOT EXISTS `museums` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(80) COLLATE utf8_unicode_ci NOT NULL, `longitude` double NOT NULL, `latitude` double NOT NULL, `rate_count` int(11) NOT NULL DEFAULT '0', `rate_total` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=14 ; -- -- Dumping data for table `museums` -- INSERT INTO `museums` (`id`, `name`, `longitude`, `latitude`, `rate_count`, `rate_total`) VALUES (2, 'Billings Estate National Historic Site', -75.6727346881424, 45.3896895443035, 0, 0), (3, 'Bytown Museum', -75.6976704406878, 45.4258403509525, 0, 0), (4, 'Cumberland Heritage Village Museum', -75.3903524268591, 45.5164637694132, 0, 0), (5, 'Diefenbunker: Canada''s Cold War Museum', -76.0477363805347, 45.351653839198, 0, 0), (6, 'Goulbourn Museum', -75.9059743325697, 45.2345487721525, 0, 0), (7, 'Muséoparc Vanier Museopark', -75.6596309695265, 45.4438907889497, 0, 0), (8, 'Nepean Museum', -75.7414738970196, 45.3491336771731, 0, 0), (9, 'Osgoode Township Historical Society and Museum', -75.4624889953521, 45.159965768618, 0, 0), (10, 'Ottawa Jewish Archives', -75.7519873345627, 45.3761498300788, 0, 0), (11, 'Ottawa Room', -75.6955319434698, 45.4202457646201, 0, 0), (12, 'Pinhey''s Point Historic Site', -75.953270548815, 45.4404227729787, 0, 0), (13, 'Watson''s Mill', -75.6828052084775, 45.2269992476022, 0, 0);
true
428f6c99bf5945f07882683f2ccf6f9ddb882d96
SQL
hav79/service
/src/main/resources/db/migration/V1__Init_DB.sql
UTF-8
1,044
3.421875
3
[]
no_license
create sequence hibernate_sequence start 1 increment 1; create table device ( id int8 not null, device_model varchar(255), serial_number varchar(255) not null, place varchar(255), primary key (id) ); create table repair_card ( id int8 not null, end_date date, problem varchar(255), solution varchar(255), closed boolean not null, printed boolean not null, sent boolean not null, signed boolean not null, start_date date not null, device_id int8, primary key (id) ); create table user_role ( user_id int8 not null, roles varchar(255) ); create table usr ( id int8 not null, activation_code varchar(255), active boolean not null, email varchar(255), password varchar(255) not null, username varchar(255) not null, primary key (id) ); alter table repair_card add constraint repair_card_device_fk foreign key (device_id) references device; alter table user_role add constraint user_role_user_fk foreign key (user_id) references usr;
true
6157ab0759c627b7cd049915d5b517fd140d97b7
SQL
noseka1/openstack-cloud-report
/network_report.sql
UTF-8
336
3.140625
3
[]
no_license
USE ovs_neutron; SELECT keystone.project.name AS project, networks.id, networks.name, subnets.name AS subnet, subnets.cidr, networks.status FROM networks INNER JOIN keystone.project ON networks.tenant_id COLLATE utf8_unicode_ci = keystone.project.id INNER JOIN subnets ON networks.id=subnets.network_id ORDER BY project, networks.name;
true
104062daa628037649d05559d6d204fbd792ea57
SQL
tectronics/shakti
/db/shakti.sql
UTF-8
9,938
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.7 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Mar 05, 2013 at 08:43 PM -- Server version: 5.0.67-community-nt -- PHP Version: 5.2.8 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: `shakti` -- -- -------------------------------------------------------- -- -- Table structure for table `incoming` -- CREATE TABLE IF NOT EXISTS `incoming` ( `incomingId` int(11) NOT NULL auto_increment, `partyId` int(11) default NULL, `IncomingDate` date default NULL, `qty` double default '0', `challan` int(50) default NULL, `weight` double default '0', `processId1` int(11) default NULL, `processId2` int(11) default NULL, `processId3` int(11) default NULL, `materialId` int(11) default NULL, `hardne` varchar(500) character set utf8 default NULL, `column1` varchar(60) character set utf8 default NULL, `column2` varchar(60) character set utf8 default NULL, `column3` varchar(60) character set utf8 default NULL, `column4` varchar(60) character set utf8 default NULL, `column5` varchar(60) character set utf8 default NULL, `column6` varchar(60) character set utf8 default NULL, `status` varchar(100) character set utf8 NOT NULL default 'planning', `outgoingDone` char(1) character set utf8 NOT NULL default '0', `outQuantity` double default '0', `outWeight` double default '0', PRIMARY KEY (`incomingId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `incoming` -- INSERT INTO `incoming` (`incomingId`, `partyId`, `IncomingDate`, `qty`, `challan`, `weight`, `processId1`, `processId2`, `processId3`, `materialId`, `hardne`, `column1`, `column2`, `column3`, `column4`, `column5`, `column6`, `status`, `outgoingDone`, `outQuantity`, `outWeight`) VALUES (1, 43, '2013-03-06', 500, 1001, 400, 9, 4, 1, 1, '50', 'H11', 'H12', '', '', '', '', 'inlogsheet', '0', 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `incomingdetail` -- CREATE TABLE IF NOT EXISTS `incomingdetail` ( `IncomingDetailId` int(11) NOT NULL auto_increment, `IncomingId` int(11) default NULL, `columns1` varchar(100) character set utf8 default NULL, `columns2` varchar(100) character set utf8 default NULL, `columns3` varchar(100) character set utf8 default NULL, `columns4` double default NULL, `columns5` double default NULL, `columns6` varchar(100) character set utf8 default NULL, PRIMARY KEY (`IncomingDetailId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `incomingdetail` -- INSERT INTO `incomingdetail` (`IncomingDetailId`, `IncomingId`, `columns1`, `columns2`, `columns3`, `columns4`, `columns5`, `columns6`) VALUES (1, 1, '1', '2', '', 0, 0, ''); -- -------------------------------------------------------- -- -- Table structure for table `logsheet` -- CREATE TABLE IF NOT EXISTS `logsheet` ( `logSheetId` int(11) NOT NULL auto_increment, `incomingId` int(11) default NULL, `processId` int(11) default NULL, `processNo` tinyint(1) NOT NULL default '1', `planningId` int(6) default NULL, `logsheetNo` varchar(50) character set utf8 default NULL, `logsheetDate` date default NULL, `startTime` datetime default NULL, `startTemperature` varchar(30) character set utf8 default NULL, `soakingStartTime` datetime default NULL, `endTime` datetime default NULL, `endTemperature` varchar(30) character set utf8 default NULL, `quenchingMedia` varchar(50) character set utf8 default NULL, `quenchingTime` datetime default NULL, `tempBforQue` varchar(30) character set utf8 default NULL, `tempAfterQue` varchar(30) character set utf8 default NULL, `status` varchar(30) character set utf8 NOT NULL default '-1', `notOkReason` varchar(25) character set utf8 default NULL, PRIMARY KEY (`logSheetId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `material` -- CREATE TABLE IF NOT EXISTS `material` ( `materialId` int(11) NOT NULL auto_increment, `material` varchar(500) character set utf8 default NULL, PRIMARY KEY (`materialId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `material` -- INSERT INTO `material` (`materialId`, `material`) VALUES (1, 'A'), (2, 'B'); -- -------------------------------------------------------- -- -- Table structure for table `outgoing` -- CREATE TABLE IF NOT EXISTS `outgoing` ( `outgoingId` int(11) NOT NULL auto_increment, `outgoingDate` date NOT NULL, `partyId` int(11) default NULL, `incomingId` int(6) default NULL, `challan` varchar(100) character set utf8 default NULL, `outgoingChallan` varchar(50) character set utf8 default NULL, `outQuantity` double default NULL, `outWeight` double default NULL, `pendingQnty` double default NULL, `pendingWght` double default NULL, PRIMARY KEY (`outgoingId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `outgoingmaster` -- CREATE TABLE IF NOT EXISTS `outgoingmaster` ( `outgoingMasterId` int(6) NOT NULL auto_increment, `date` date NOT NULL, `incomingId` int(6) NOT NULL, `planningId` varchar(100) default NULL, `outChallenNo` varchar(20) default NULL, `incomingQuantity` double default NULL, `dispatchQuantity` double default NULL, `remainQuantity` double default NULL, `incomingWeight` double default NULL, `dispatchWeight` double default NULL, `remainWeight` double default NULL, PRIMARY KEY (`outgoingMasterId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `party` -- CREATE TABLE IF NOT EXISTS `party` ( `partyId` int(11) NOT NULL auto_increment, `partyName` varchar(500) default NULL, PRIMARY KEY (`partyId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ; -- -- Dumping data for table `party` -- INSERT INTO `party` (`partyId`, `partyName`) VALUES (33, 'Car'), (34, 'Bike'), (35, 'Computer'), (36, 'Hotel'), (37, 'IT Company'), (39, 'Abc'), (43, '8888888'); -- -------------------------------------------------------- -- -- Table structure for table `planning` -- CREATE TABLE IF NOT EXISTS `planning` ( `planningId` int(6) NOT NULL auto_increment, `incomingId` int(6) NOT NULL, `partyId` int(6) NOT NULL, `date` date default NULL, `quantity` double NOT NULL default '0', `weight` double NOT NULL default '0', `processId1` int(6) NOT NULL default '0', `processId2` int(6) NOT NULL default '0', `processId3` int(6) NOT NULL default '0', `noOfProcess` int(6) default NULL, `temp1` varchar(30) default NULL, `soaking1` varchar(30) default NULL, `furnace1` varchar(30) default NULL, `temp2` varchar(30) default NULL, `soaking2` varchar(30) default NULL, `furnace2` varchar(30) default NULL, `temp3` varchar(30) default NULL, `soaking3` varchar(30) default NULL, `furnace3` varchar(30) default NULL, `logSheet1` int(6) NOT NULL default '0', `logSheet2` int(6) NOT NULL default '0', `logSheet3` int(6) NOT NULL default '0', `okNotOk1` smallint(2) NOT NULL default '-1', `okNotOk2` smallint(2) NOT NULL default '-1', `okNotOk3` smallint(2) NOT NULL default '-1', `status` varchar(15) NOT NULL default 'inplanning', `parentPlanningId` int(6) NOT NULL default '0', PRIMARY KEY (`planningId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `planning` -- INSERT INTO `planning` (`planningId`, `incomingId`, `partyId`, `date`, `quantity`, `weight`, `processId1`, `processId2`, `processId3`, `noOfProcess`, `temp1`, `soaking1`, `furnace1`, `temp2`, `soaking2`, `furnace2`, `temp3`, `soaking3`, `furnace3`, `logSheet1`, `logSheet2`, `logSheet3`, `okNotOk1`, `okNotOk2`, `okNotOk3`, `status`, `parentPlanningId`) VALUES (1, 1, 43, NULL, 500, 400, 9, 4, 1, 3, '88', '88', '88', '89', '89', '89', '87', '87', '87', 0, 0, 0, 1, -1, -1, 'inlogsheet', 0); -- -------------------------------------------------------- -- -- Table structure for table `process` -- CREATE TABLE IF NOT EXISTS `process` ( `processId` int(11) NOT NULL auto_increment, `processName` varchar(500) character set utf8 default NULL, PRIMARY KEY (`processId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ; -- -- Dumping data for table `process` -- INSERT INTO `process` (`processId`, `processName`) VALUES (1, 'Computer'), (2, 'C.P.U'), (3, 'Mouse'), (4, 'Zen'), (5, 'I 20'), (6, 'Verna'), (7, 'Swift'), (8, 'Splendor'), (9, 'Cd-Down'), (10, 'Shine'), (12, 'Software'), (13, 'repairing'), (14, 'Website'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `userId` int(6) NOT NULL auto_increment, `userName` varchar(100) character set utf8 default NULL, `password` varchar(100) character set utf8 default NULL, `userType` varchar(15) character set utf8 default NULL, PRIMARY KEY (`userId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`userId`, `userName`, `password`, `userType`) VALUES (3, 'om', 'd58da82289939d8c4ec4f40689c2847e', 'admin'), (4, 'uday', '64cdce3a9cbb8e3a4209bd3b6c1add09', NULL), (5, 'm', '6f8f57715090da2632453988d9a1501b', 'admin'); /*!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
882f6284e2de24dbc25874a46ec4aa91ebd74b14
SQL
mtikoian/km-all-projects
/ECN/ECN_Database/KMPlatform/dbo/Stored Procedures/e_ClientGroup_SelectForAMS.sql
UTF-8
264
3.125
3
[]
no_license
CREATE procedure e_ClientGroup_SelectForAMS as select distinct cg.* from ClientGroup cg with(nolock) join ClientGroupClientMap m with(nolock) on cg.ClientGroupID = m.ClientGroupID join Client c with(nolock) on m.ClientID = c.ClientID where c.IsAMS = 'true'
true
4e9a332047f8e0685af0d73315f971ca05abdc0b
SQL
inctoolsproject/CBT-hse-Simple
/hse.sql
UTF-8
37,051
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jun 07, 2021 at 12:37 PM -- Server version: 8.0.17 -- 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: `hse` -- -- -------------------------------------------------------- -- -- Table structure for table `tb_absen` -- CREATE TABLE `tb_absen` ( `absen_id` int(11) NOT NULL, `absen_user` int(11) DEFAULT NULL, `absen_jenis` int(11) DEFAULT NULL, `absen_keterangan` text, `absen_waktu` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_absen` -- INSERT INTO `tb_absen` (`absen_id`, `absen_user`, `absen_jenis`, `absen_keterangan`, `absen_waktu`) VALUES (1, 5, 1, NULL, '2021-05-23 22:25:31'), (2, 2, 1, NULL, '2021-05-23 22:31:29'), (3, 7, 1, NULL, '2021-05-23 22:34:43'), (4, 8, 1, NULL, '2021-05-23 22:47:41'); -- -------------------------------------------------------- -- -- Table structure for table `tb_guru` -- CREATE TABLE `tb_guru` ( `guru_id` int(11) NOT NULL, `guru_nip` varchar(255) DEFAULT NULL, `guru_nama` varchar(255) DEFAULT NULL, `guru_tmp_lahir` varchar(255) DEFAULT NULL, `guru_tgl_lahir` date DEFAULT NULL, `guru_jenis_kelamin` int(11) DEFAULT NULL, `guru_agama` varchar(255) DEFAULT NULL, `guru_alamat` text, `guru_nohp` varchar(255) DEFAULT NULL, `guru_foto` varchar(255) DEFAULT NULL, `guru_jenjang` int(11) DEFAULT NULL, `guru_jenjang_pendidikan` varchar(128) DEFAULT NULL, `guru_tgl_bergabung` date DEFAULT NULL, `guru_status_peg` int(11) DEFAULT '1' COMMENT '1 = honorer - 2 = guru tetap', `guru_tgs_mengajar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `guru_tgs_tambahan` int(11) DEFAULT NULL COMMENT '1 = kordinator - 2 = wali kelas - 3 = staff mngmnt - 4 = dll', `guru_riwayat_pend_sd` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `guru_riwayat_pend_smp` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `guru_riwayat_pend_sma` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `guru_riwayat_pend_pt` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `guru_uid` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_guru` -- INSERT INTO `tb_guru` (`guru_id`, `guru_nip`, `guru_nama`, `guru_tmp_lahir`, `guru_tgl_lahir`, `guru_jenis_kelamin`, `guru_agama`, `guru_alamat`, `guru_nohp`, `guru_foto`, `guru_jenjang`, `guru_jenjang_pendidikan`, `guru_tgl_bergabung`, `guru_status_peg`, `guru_tgs_mengajar`, `guru_tgs_tambahan`, `guru_riwayat_pend_sd`, `guru_riwayat_pend_smp`, `guru_riwayat_pend_sma`, `guru_riwayat_pend_pt`, `guru_uid`) VALUES (1, '32012', 'Ariana Gultom', 'Jakarta', '1991-03-03', 2, 'Katolik', '.', '+62', NULL, 1, 'S1', '2012-04-04', 2, 'Iya', 2, 'SD 1 Ambon', 'SMP 1 Ambon', 'SMA 1 Ambon', 'Harvard Univ', 2), (2, '31029', 'Nicolas Flamel', 'Bali', '1991-01-01', 1, 'Katolik', '.', '0', 'user-default.png', 2, 'S1', NULL, NULL, NULL, NULL, '-', '-', '-', '-', 3), (3, '320159', 'Dolores Umbridge', 'Jepara', '1975-01-04', 2, 'Katolik', '.', '0', 'user-default.png', 3, 'S1', NULL, NULL, NULL, NULL, '-', '-', '-', '-', 4); -- -------------------------------------------------------- -- -- Table structure for table `tb_jadwal` -- CREATE TABLE `tb_jadwal` ( `jadwal_id` int(11) NOT NULL, `jadwal_hari` int(11) DEFAULT NULL, `jadwal_mulai` varchar(32) DEFAULT NULL, `jadwal_akhir` varchar(32) DEFAULT NULL, `jadwal_kelas` int(11) DEFAULT NULL, `jadwal_mapel` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_jadwal` -- INSERT INTO `tb_jadwal` (`jadwal_id`, `jadwal_hari`, `jadwal_mulai`, `jadwal_akhir`, `jadwal_kelas`, `jadwal_mapel`) VALUES (1, 1, '07:30', '08:20', 1, 1), (2, 1, '09:10', '10:50', 7, 5), (3, 1, '08:30', '09:30', 10, 3), (4, 1, '10:10', '11:30', 13, 6); -- -------------------------------------------------------- -- -- Table structure for table `tb_jawaban` -- CREATE TABLE `tb_jawaban` ( `jawaban_id` int(11) NOT NULL, `jawaban_soal` int(11) DEFAULT NULL, `jawaban_detail` text, `jawaban_benar` int(11) DEFAULT NULL, `jawaban_pembuat` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_jawaban` -- INSERT INTO `tb_jawaban` (`jawaban_id`, `jawaban_soal`, `jawaban_detail`, `jawaban_benar`, `jawaban_pembuat`) VALUES (1, 1, '20', 0, 2), (2, 1, '30', 1, 2), (3, 1, '40', 0, 2), (4, 1, '50', 0, 2), (5, 1, '60', 0, 2), (6, 2, '40', 0, 2), (7, 2, '50', 0, 2), (8, 2, '60', 0, 2), (9, 2, '70', 1, 2), (10, 2, '80', 0, 2), (11, 3, '10', 0, 2), (12, 3, '15', 1, 2), (13, 3, '20', 0, 2), (14, 3, '25', 0, 2), (15, 3, '30', 0, 2), (16, 4, '3', 0, 2), (17, 4, '2', 0, 2), (18, 4, '4', 1, 2), (19, 4, '5', 0, 2), (20, 7, '20', 0, 2), (21, 7, '30', 1, 2), (22, 7, '40', 0, 2), (23, 7, '50', 0, 2), (24, 7, '60', 0, 2), (25, 8, '40', 0, 2), (26, 8, '50', 0, 2), (27, 8, '60', 0, 2), (28, 8, '70', 1, 2), (29, 8, '80', 0, 2), (30, 9, '10', 0, 2), (31, 9, '15', 1, 2), (32, 9, '20', 0, 2), (33, 9, '25', 0, 2), (34, 9, '30', 0, 2); -- -------------------------------------------------------- -- -- Table structure for table `tb_jenjang` -- CREATE TABLE `tb_jenjang` ( `jenjang_id` int(11) NOT NULL, `jenjang_nama` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_jenjang` -- INSERT INTO `tb_jenjang` (`jenjang_id`, `jenjang_nama`) VALUES (1, 'SD'), (3, 'SMA'), (2, 'SMP'); -- -------------------------------------------------------- -- -- Table structure for table `tb_jurusan` -- CREATE TABLE `tb_jurusan` ( `jurusan_id` int(11) NOT NULL, `jurusan_nama` varchar(255) DEFAULT NULL, `jurusan_jenjang` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_jurusan` -- INSERT INTO `tb_jurusan` (`jurusan_id`, `jurusan_nama`, `jurusan_jenjang`) VALUES (1, 'IPA', 3), (2, 'IPS', 3); -- -------------------------------------------------------- -- -- Table structure for table `tb_kelas` -- CREATE TABLE `tb_kelas` ( `kelas_id` int(11) NOT NULL, `kelas_jenjang` int(11) DEFAULT NULL, `kelas_tingkat` int(11) DEFAULT NULL, `kelas_jurusan` int(11) DEFAULT NULL, `kelas_nama` varchar(128) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_kelas` -- INSERT INTO `tb_kelas` (`kelas_id`, `kelas_jenjang`, `kelas_tingkat`, `kelas_jurusan`, `kelas_nama`) VALUES (1, 1, 1, NULL, '1 SD'), (2, 1, 2, NULL, '2 SD'), (3, 1, 3, NULL, '3 SD'), (4, 1, 4, NULL, '4 SD'), (5, 1, 5, NULL, '5 SD'), (6, 1, 6, NULL, '6 SD'), (7, 2, 1, NULL, '1 SMP'), (8, 2, 2, NULL, '2 SMP'), (9, 2, 3, NULL, '3 SMP'), (10, 3, 1, 1, '1 SMA IPA'), (11, 3, 2, 1, '2 SMA IPA'), (12, 3, 3, 1, '3 SMA IPA'), (13, 3, 1, 2, '1 SMA IPS'), (14, 3, 2, 2, '2 SMA IPS'), (15, 3, 3, 2, '3 SMA IPS'); -- -------------------------------------------------------- -- -- Table structure for table `tb_mapel` -- CREATE TABLE `tb_mapel` ( `mapel_id` int(11) NOT NULL, `mapel_kode` varchar(255) DEFAULT NULL, `mapel_nama` varchar(255) DEFAULT NULL, `mapel_guru` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_mapel` -- INSERT INTO `tb_mapel` (`mapel_id`, `mapel_kode`, `mapel_nama`, `mapel_guru`) VALUES (1, 'K0011', 'Bahasa Indonesia', 1), (2, 'K0021', 'Matematika', 1), (3, 'K0030', 'Biologi', 1), (5, 'K0022', 'Bahasa Inggris', 1), (6, 'K0027', 'Sejarah', 3); -- -------------------------------------------------------- -- -- Table structure for table `tb_pembayaran` -- CREATE TABLE `tb_pembayaran` ( `pembayaran_id` int(11) NOT NULL, `pembayaran_jenis` int(11) DEFAULT NULL, `pembayaran_keterangan` varchar(255) DEFAULT NULL, `pembayaran_bukti` varchar(255) DEFAULT NULL, `pembayaran_status` int(11) DEFAULT NULL, `pembayaran_siswa` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_pembayaran` -- INSERT INTO `tb_pembayaran` (`pembayaran_id`, `pembayaran_jenis`, `pembayaran_keterangan`, `pembayaran_bukti`, `pembayaran_status`, `pembayaran_siswa`) VALUES (1, 1, 'Biaya untuk pendaftaran.', 'bukti.png', 1, 1), (2, 1, 'Biaya untuk pendaftaran.', 'checklist.png', 0, 4); -- -------------------------------------------------------- -- -- Table structure for table `tb_pengumuman` -- CREATE TABLE `tb_pengumuman` ( `pengumuman_id` int(11) NOT NULL, `pengumuman_jenjang` int(11) DEFAULT NULL, `pengumuman_isi` text, `pengumuman_waktu` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_pengumuman` -- INSERT INTO `tb_pengumuman` (`pengumuman_id`, `pengumuman_jenjang`, `pengumuman_isi`, `pengumuman_waktu`) VALUES (1, 1, '<h2 style=\"font-style:italic;\">Pengumuman Untuk Jenjang SD</h2>\r\n\r\n<p>&#39;m baby roof party you probably haven&#39;t heard of them lyft tumeric cronut health goth messenger bag dreamcatcher hexagon. Kickstarter +1 health goth poutine. Before they sold out VHS selfies, swag ugh asymmetrical neutra four dollar toast godard letterpress salvia retro prism flexitarian. Humblebrag fashion axe glossier fanny pack. Venmo biodiesel vexillologist, post-ironic fam <strong><em>YOLO keytar.</em></strong></p>\r\n\r\n<ol>\r\n <li>Satu</li>\r\n <li>Dua</li>\r\n <li>Tiga</li>\r\n</ol>\r\n', '2021-05-23 22:04:51'), (10, 2, '<h2><em>Pengumuman tentang Hari Sumpah Pemuda</em></h2>\r\n\r\n<p>I&#39;m baby roof party you probably haven&#39;t heard of them lyft tumeric cronut health goth messenger bag dreamcatcher hexagon. Kickstarter +1 health goth poutine. Before they sold out VHS selfies.</p>\r\n\r\n<p><em>Hari: Senin</em></p>\r\n\r\n<p>Swag ugh asymmetrical neutra four dollar toast godard letterpress salvia retro prism flexitarian. Humblebrag fashion axe glossier fanny pack. Venmo biodiesel vexillologist, post-ironic fam YOLO keytar.</p>\r\n', '2021-05-23 22:16:28'), (11, 3, '<h2 style=\"font-style:italic;\"><strong>Pengumuman SMA</strong></h2>\r\n\r\n<p>Godard brooklyn vaporware hella meggings. Polaroid kombucha direct trade knausgaard mixtape fingerstache truffaut lo-fi ugh small batch. Sriracha hella bushwick pickled health goth lomo. Keffiyeh glossier air plant bespoke VHS YOLO</p>\r\n', '2021-05-23 22:36:37'); -- -------------------------------------------------------- -- -- Table structure for table `tb_rapor` -- CREATE TABLE `tb_rapor` ( `rapor_id` int(11) NOT NULL, `rapor_semester` int(11) DEFAULT NULL, `rapor_file` varchar(255) DEFAULT NULL, `rapor_siswa` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_rapor` -- INSERT INTO `tb_rapor` (`rapor_id`, `rapor_semester`, `rapor_file`, `rapor_siswa`) VALUES (1, 1, 'rapor.png', 1); -- -------------------------------------------------------- -- -- Table structure for table `tb_siswa` -- CREATE TABLE `tb_siswa` ( `siswa_id` int(11) NOT NULL, `siswa_nis` varchar(255) DEFAULT NULL, `siswa_nama` varchar(255) DEFAULT NULL, `siswa_nama_panggilan` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_tmp_lahir` varchar(255) DEFAULT NULL, `siswa_tgl_lahir` date DEFAULT NULL, `siswa_jenis_kelamin` int(11) DEFAULT NULL, `siswa_agama` varchar(255) DEFAULT NULL, `siswa_anak_ke` int(11) DEFAULT NULL, `siswa_alamat` text, `siswa_nohp` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_jenjang_terakhir` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_gol_darah` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_hobi` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_nama_ayah` varchar(255) DEFAULT NULL, `siswa_nama_ibu` varchar(255) DEFAULT NULL, `siswa_alamat_ortu` text, `siswa_nohp_ortu` varchar(255) DEFAULT NULL, `siswa_pekerjaan_ayah` varchar(255) DEFAULT NULL, `siswa_pekerjaan_ibu` varchar(255) DEFAULT NULL, `siswa_pend_terakhir_ayah` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_pend_terakhir_ibu` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_nohp_ayah` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_nohp_ibu` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_email_ayah` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_email_ibu` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '-', `siswa_penghasilan_ayah` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0', `siswa_penghasilan_ibu` varchar(125) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0', `siswa_nama_wali` varchar(255) DEFAULT NULL, `siswa_nohp_wali` varchar(255) DEFAULT NULL, `siswa_alamat_wali` text, `siswa_pekerjaan_wali` varchar(255) DEFAULT NULL, `siswa_jenjang` int(11) DEFAULT NULL, `siswa_kelas` int(11) DEFAULT NULL, `siswa_semester` varchar(255) DEFAULT NULL, `siswa_foto` varchar(255) DEFAULT NULL, `siswa_uid` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_siswa` -- INSERT INTO `tb_siswa` (`siswa_id`, `siswa_nis`, `siswa_nama`, `siswa_nama_panggilan`, `siswa_tmp_lahir`, `siswa_tgl_lahir`, `siswa_jenis_kelamin`, `siswa_agama`, `siswa_anak_ke`, `siswa_alamat`, `siswa_nohp`, `siswa_jenjang_terakhir`, `siswa_gol_darah`, `siswa_hobi`, `siswa_nama_ayah`, `siswa_nama_ibu`, `siswa_alamat_ortu`, `siswa_nohp_ortu`, `siswa_pekerjaan_ayah`, `siswa_pekerjaan_ibu`, `siswa_pend_terakhir_ayah`, `siswa_pend_terakhir_ibu`, `siswa_nohp_ayah`, `siswa_nohp_ibu`, `siswa_email_ayah`, `siswa_email_ibu`, `siswa_penghasilan_ayah`, `siswa_penghasilan_ibu`, `siswa_nama_wali`, `siswa_nohp_wali`, `siswa_alamat_wali`, `siswa_pekerjaan_wali`, `siswa_jenjang`, `siswa_kelas`, `siswa_semester`, `siswa_foto`, `siswa_uid`) VALUES (1, '14002113', 'Yusuf Kamma', 'Ucup', 'Makassar', '2004-03-19', 1, 'Islam', 3, '.', '0812', 'TK', 'AB', 'Main Epep', 'Arsi', 'Irma', '.', NULL, 'Seniman', 'Ibu Rumah Tangga', 'D3', 'SMA', '0812', '0812', '-', '-', '9.000.000', '0', '-', '0', '.', '-', 1, 1, '1', 'user-default.png', 5), (2, '1400239193', 'Susan Bones', '-', 'Pontianak', '2005-03-21', 2, 'Islam', 3, '.', '-', '-', '-', '-', '-', '-', '.', '0', '-', '-', '-', '-', '-', '-', '-', '-', '0', '0', '-', '0', '.', '-', 2, 7, '1', 'user-default.png', 6), (3, '0', 'Lazardi Amar', '-', 'Jakarta', '2010-03-21', 1, 'Islam', 3, '.', '-', '-', '-', '-', '-', '-', '.', '0', '-', '-', '-', '-', '-', '-', '-', '-', '0', '0', '-', '0', '.', '-', 3, 10, '1', 'user-default.png', 7), (4, '14002311', 'Aldo MA', '-', 'Jakarta', '2007-03-21', 1, 'Islam', 3, '.', '-', '-', '-', '-', '-', '-', '.', '0', '-', '-', '-', '-', '-', '-', '-', '-', '0', '0', '-', '0', '.', '-', 1, 1, '1', 'user-default.png', 8); -- -------------------------------------------------------- -- -- Table structure for table `tb_soal` -- CREATE TABLE `tb_soal` ( `soal_id` int(11) NOT NULL, `soal_topik` int(11) DEFAULT NULL, `soal_detail` text, `soal_tipe` int(11) DEFAULT NULL, `soal_pembuat` int(11) DEFAULT NULL, `soal_gambar` varchar(200) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_soal` -- INSERT INTO `tb_soal` (`soal_id`, `soal_topik`, `soal_detail`, `soal_tipe`, `soal_pembuat`, `soal_gambar`) VALUES (1, 1, '10 + 20 = ?', 1, 2, NULL), (2, 1, '20 + 50 = ?', 1, 2, NULL), (3, 1, '30 / 2 = ?', 1, 2, NULL), (4, 1, 'Ada berapa bendera di foto berikut ?', 1, 2, 'nwss.jpg'), (5, 1, 'Apa nama ibu kota Indonesia?', 2, 2, NULL), (6, 1, 'Gambar apakah berikut ini?', 2, 2, 'checklist.png'), (7, 2, '10 + 20 = ?', 1, 2, NULL), (8, 2, '20 + 50 = ?', 1, 2, NULL), (9, 2, '30 / 2 = ?', 1, 2, NULL), (10, 3, 'Sebutkan nama hewan yang hidup di air?', 2, 2, NULL), (11, 3, 'Berapa kaki dari hewan ayam?', 2, 2, NULL), (12, 3, 'Ibu membeli 2 buah telur, saat di jalan telur pecah 1, tinggal berapa telur ibu?', 2, 2, NULL); -- -------------------------------------------------------- -- -- Table structure for table `tb_tingkat` -- CREATE TABLE `tb_tingkat` ( `tingkat_id` int(11) NOT NULL, `tingkat_nama` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_tingkat` -- INSERT INTO `tb_tingkat` (`tingkat_id`, `tingkat_nama`) VALUES (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'); -- -------------------------------------------------------- -- -- Table structure for table `tb_topik` -- CREATE TABLE `tb_topik` ( `topik_id` int(11) NOT NULL, `topik_judul` varchar(255) DEFAULT NULL, `topik_deskripsi` text, `topik_status` int(11) DEFAULT NULL, `topik_pembuat` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_topik` -- INSERT INTO `tb_topik` (`topik_id`, `topik_judul`, `topik_deskripsi`, `topik_status`, `topik_pembuat`) VALUES (1, 'Ujian SD 1', 'Ujian mingguan SD 1', 1, 2), (2, 'Ujian Semester 1', 'ujian semster', 1, 2), (3, 'Ujian Harian SD 1', 'harian', 1, 2); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian` -- CREATE TABLE `tb_ujian` ( `ujian_id` int(11) NOT NULL, `ujian_judul` varchar(255) DEFAULT NULL, `ujian_deskripsi` text, `ujian_waktu_mulai` datetime DEFAULT NULL, `ujian_waktu_akhir` datetime DEFAULT NULL, `ujian_durasi` smallint(6) DEFAULT NULL COMMENT 'menit', `ujian_hasil_siswa` int(11) DEFAULT NULL, `ujian_detail_siswa` int(11) DEFAULT NULL, `ujian_nilai_benar` decimal(10,0) DEFAULT '1', `ujian_nilai_salah` decimal(10,2) DEFAULT '0.00', `ujian_nilai_kosong` decimal(10,2) DEFAULT '0.00', `ujian_nilai_maks` decimal(10,2) DEFAULT '0.00', `ujian_status` int(11) DEFAULT NULL, `ujian_pembuat` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian` -- INSERT INTO `tb_ujian` (`ujian_id`, `ujian_judul`, `ujian_deskripsi`, `ujian_waktu_mulai`, `ujian_waktu_akhir`, `ujian_durasi`, `ujian_hasil_siswa`, `ujian_detail_siswa`, `ujian_nilai_benar`, `ujian_nilai_salah`, `ujian_nilai_kosong`, `ujian_nilai_maks`, `ujian_status`, `ujian_pembuat`) VALUES (1, 'Ujian SD 1', 'Ujian testing 1', '2021-05-23 08:00:00', '2021-05-27 08:00:00', 30, 1, 1, '1', '0.00', '0.00', '6.00', 1, 2), (2, 'Ujian Semester 1', 'Ujian semeser', '2021-06-01 01:00:00', '2021-06-09 09:00:00', 30, 1, 1, '1', '0.00', '0.00', '3.00', 1, 2), (3, 'Ujian Harian SD 1', 'Ujian Harian SD 1', '2021-06-10 01:00:00', '2021-06-25 09:00:00', 30, 1, 1, '1', '0.00', '0.00', '3.00', 1, 2); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian_group` -- CREATE TABLE `tb_ujian_group` ( `group_ujian` int(11) DEFAULT NULL, `group_kelas` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian_group` -- INSERT INTO `tb_ujian_group` (`group_ujian`, `group_kelas`) VALUES (1, 1), (2, 1), (3, 1); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian_jawaban` -- CREATE TABLE `tb_ujian_jawaban` ( `uj_soal` int(11) NOT NULL, `uj_jawaban` int(11) NOT NULL, `uj_selected` int(11) DEFAULT NULL, `uj_order` int(11) DEFAULT NULL, `uj_posisi` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian_jawaban` -- INSERT INTO `tb_ujian_jawaban` (`uj_soal`, `uj_jawaban`, `uj_selected`, `uj_order`, `uj_posisi`) VALUES (3, 16, 0, 4, 0), (3, 17, 0, 3, 0), (3, 18, 1, 2, 1), (3, 19, 0, 1, 0), (4, 11, 0, 5, 0), (4, 12, 1, 4, 1), (4, 13, 0, 3, 0), (4, 14, 0, 2, 0), (4, 15, 0, 1, 0), (5, 6, 0, 5, 0), (5, 7, 0, 4, 0), (5, 8, 0, 3, 0), (5, 9, 1, 2, 1), (5, 10, 0, 1, 0), (6, 1, 0, 5, 0), (6, 2, 1, 4, 1), (6, 3, 0, 3, 0), (6, 4, 0, 2, 0), (6, 5, 0, 1, 0), (7, 30, 0, 5, 0), (7, 31, 1, 4, 1), (7, 32, 0, 3, 0), (7, 33, 0, 2, 0), (7, 34, 0, 1, 0), (8, 25, 0, 5, 0), (8, 26, 0, 4, 0), (8, 27, 0, 3, 0), (8, 28, 1, 2, 1), (8, 29, 0, 1, 0), (9, 20, 0, 5, 0), (9, 21, 1, 4, 1), (9, 22, 0, 3, 0), (9, 23, 0, 2, 0), (9, 24, 0, 1, 0); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian_soal` -- CREATE TABLE `tb_ujian_soal` ( `us_id` int(11) NOT NULL, `us_users` int(11) DEFAULT NULL, `us_soal` int(11) DEFAULT NULL, `us_jawaban_teks` text, `us_nilai` decimal(10,0) DEFAULT NULL, `us_order` tinyint(4) DEFAULT NULL, `us_waktu_diubah` datetime DEFAULT NULL, `us_ragu` tinyint(4) DEFAULT NULL, `us_komentar` varchar(150) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian_soal` -- INSERT INTO `tb_ujian_soal` (`us_id`, `us_users`, `us_soal`, `us_jawaban_teks`, `us_nilai`, `us_order`, `us_waktu_diubah`, `us_ragu`, `us_komentar`) VALUES (1, 1, 6, 'gambar ceklis', '1', 1, '2021-05-23 22:46:27', 0, 'sudah dikoreksi'), (2, 1, 5, 'Jakarta', '1', 2, '2021-05-23 22:46:35', 0, 'sudah dikoreksi'), (3, 1, 4, NULL, '1', 3, '2021-05-23 22:46:42', 0, NULL), (4, 1, 3, NULL, '1', 4, '2021-05-23 22:46:45', 0, NULL), (5, 1, 2, NULL, '1', 5, '2021-05-23 22:46:48', 0, NULL), (6, 1, 1, NULL, '1', 6, '2021-05-23 22:46:51', 0, NULL), (7, 2, 9, NULL, '1', 1, '2021-06-01 01:07:03', 0, NULL), (8, 2, 8, NULL, '1', 2, '2021-06-01 01:07:06', 0, NULL), (9, 2, 7, NULL, '1', 3, '2021-06-01 01:07:08', 0, NULL); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian_topik` -- CREATE TABLE `tb_ujian_topik` ( `ut_id` int(11) NOT NULL, `ut_ujian` int(11) DEFAULT NULL, `ut_topik` int(11) DEFAULT NULL, `ut_tipe` int(11) DEFAULT '0' COMMENT '0 = semua, 1 = pilihan ganda, 2 = essai', `ut_total_soal` int(11) DEFAULT NULL, `ut_total_jawaban` int(11) DEFAULT NULL, `ut_jawaban_acak` int(11) DEFAULT NULL, `ut_soal_acak` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian_topik` -- INSERT INTO `tb_ujian_topik` (`ut_id`, `ut_ujian`, `ut_topik`, `ut_tipe`, `ut_total_soal`, `ut_total_jawaban`, `ut_jawaban_acak`, `ut_soal_acak`) VALUES (1, 1, 1, 0, 6, 19, 1, 1), (2, 2, 2, 0, 3, 15, 1, 1), (3, 3, 3, 0, 3, 3, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `tb_ujian_users` -- CREATE TABLE `tb_ujian_users` ( `users_id` int(11) NOT NULL, `users_ujian` int(11) DEFAULT NULL, `users_siswa` int(11) DEFAULT NULL, `users_status` int(11) DEFAULT NULL COMMENT '1 = sedang dikerjakan, 3 = waktu habis, 4 = selesai', `users_tgl_pengerjaan` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_ujian_users` -- INSERT INTO `tb_ujian_users` (`users_id`, `users_ujian`, `users_siswa`, `users_status`, `users_tgl_pengerjaan`) VALUES (1, 1, 4, 4, '2021-05-23 22:46:19'), (2, 2, 4, 4, '2021-06-01 01:07:00'); -- -------------------------------------------------------- -- -- Table structure for table `tb_user` -- CREATE TABLE `tb_user` ( `id` int(11) NOT NULL, `username` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `password` varchar(255) DEFAULT NULL, `role` int(11) DEFAULT '0' COMMENT '1 = admin, 2 = guru, 3 = siswa' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Dumping data for table `tb_user` -- INSERT INTO `tb_user` (`id`, `username`, `email`, `password`, `role`) VALUES (1, 'admin', 'admin@hse.com', '$2y$10$5rGIKVdbLy.c6m59qVUhB.3IjA1igME3TqQujrROovRQYq9u0mZI6', 1), (2, 'gurusd', 'gurusd@hse.com', '$2y$10$d9IxbhxgRd9t5sCgRCvyq.5lG9XHWKRjui51hn6l0s9bSDAjnMWH6', 2), (3, 'gurusmp', 'gurusmp@hse.com', '$2y$10$cUFyvt97h3fdksXfXRzYQeQ5EOG4LCNN3MvrjomelFz8Uj1PCRGgW', 2), (4, 'gurusma', 'gurusma@hse.com', '$2y$10$HhwNNkRAIjO8oXgu67V5PuppojneSw0Iui0W.aKe8SoS0SmIEjjy2', 2), (5, 'siswasd', 'siswasd@hse.com', '$2y$10$Frk1PrnjpcIs8JgpOD/eyOzOOjnTqliKTgPTDQgHSrdx8pVJE/Udq', 3), (6, 'siswasmp', 'siswasmp@hse.com', '$2y$10$Uw2mXCcuSVa7HvBBag/Us.lm5QVLuoyIDFyIU9Aiy/8gXYwS0JNjy', 3), (7, 'siswasma', 'siswasma@hse.com', '$2y$10$5riHUTcO496xyXIinlBF6.5sj0UStQ1Zrzq3auINayk6nYqZC6I7a', 3), (8, 'aldo', 'aldo@hse.com', '$2y$10$y/N8tUgULldYze84089tRewI/3tLH07XBukKr9hhf83B1HaYa3kLC', 3), (9, 'staffsma', 'staffsma@hse.com', '$2y$10$8FbrtwI2dfSSdTvDkML2gOJuXVdSF0C7nZlfAo55narbWJWuM3A.S', 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `tb_absen` -- ALTER TABLE `tb_absen` ADD PRIMARY KEY (`absen_id`), ADD KEY `absen_user` (`absen_user`); -- -- Indexes for table `tb_guru` -- ALTER TABLE `tb_guru` ADD PRIMARY KEY (`guru_id`), ADD KEY `guru_jenjang` (`guru_jenjang`), ADD KEY `guru_uid` (`guru_uid`); -- -- Indexes for table `tb_jadwal` -- ALTER TABLE `tb_jadwal` ADD PRIMARY KEY (`jadwal_id`), ADD KEY `jadwal_kelas` (`jadwal_kelas`), ADD KEY `jadwal_mapel` (`jadwal_mapel`); -- -- Indexes for table `tb_jawaban` -- ALTER TABLE `tb_jawaban` ADD PRIMARY KEY (`jawaban_id`), ADD KEY `jawaban_soal` (`jawaban_soal`); -- -- Indexes for table `tb_jenjang` -- ALTER TABLE `tb_jenjang` ADD PRIMARY KEY (`jenjang_id`), ADD UNIQUE KEY `jenjang_nama` (`jenjang_nama`); -- -- Indexes for table `tb_jurusan` -- ALTER TABLE `tb_jurusan` ADD PRIMARY KEY (`jurusan_id`), ADD UNIQUE KEY `jurusan_nama` (`jurusan_nama`); -- -- Indexes for table `tb_kelas` -- ALTER TABLE `tb_kelas` ADD PRIMARY KEY (`kelas_id`), ADD UNIQUE KEY `kelas_nama` (`kelas_nama`), ADD KEY `kelas_jenjang` (`kelas_jenjang`), ADD KEY `kelas_tingkat` (`kelas_tingkat`), ADD KEY `kelas_jurusan` (`kelas_jurusan`); -- -- Indexes for table `tb_mapel` -- ALTER TABLE `tb_mapel` ADD PRIMARY KEY (`mapel_id`), ADD UNIQUE KEY `mapel_kode` (`mapel_kode`), ADD KEY `mapel_guru` (`mapel_guru`); -- -- Indexes for table `tb_pembayaran` -- ALTER TABLE `tb_pembayaran` ADD PRIMARY KEY (`pembayaran_id`), ADD KEY `pembayaran_siswa` (`pembayaran_siswa`); -- -- Indexes for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` ADD PRIMARY KEY (`pengumuman_id`), ADD KEY `pengumuman_jenjang` (`pengumuman_jenjang`); -- -- Indexes for table `tb_rapor` -- ALTER TABLE `tb_rapor` ADD PRIMARY KEY (`rapor_id`), ADD KEY `rapor_siswa` (`rapor_siswa`); -- -- Indexes for table `tb_siswa` -- ALTER TABLE `tb_siswa` ADD PRIMARY KEY (`siswa_id`), ADD KEY `siswa_jenjang_pendidikan` (`siswa_jenjang`), ADD KEY `siswa_kelas` (`siswa_kelas`), ADD KEY `siswa_uid` (`siswa_uid`); -- -- Indexes for table `tb_soal` -- ALTER TABLE `tb_soal` ADD PRIMARY KEY (`soal_id`), ADD KEY `soal_pembuat` (`soal_pembuat`), ADD KEY `soal_topik` (`soal_topik`); -- -- Indexes for table `tb_tingkat` -- ALTER TABLE `tb_tingkat` ADD PRIMARY KEY (`tingkat_id`), ADD UNIQUE KEY `tingkat_nama` (`tingkat_nama`); -- -- Indexes for table `tb_topik` -- ALTER TABLE `tb_topik` ADD PRIMARY KEY (`topik_id`), ADD KEY `topik_pembuat` (`topik_pembuat`); -- -- Indexes for table `tb_ujian` -- ALTER TABLE `tb_ujian` ADD PRIMARY KEY (`ujian_id`), ADD KEY `ujian_pembuat` (`ujian_pembuat`); -- -- Indexes for table `tb_ujian_group` -- ALTER TABLE `tb_ujian_group` ADD KEY `group_ujian` (`group_ujian`), ADD KEY `group_kelas` (`group_kelas`); -- -- Indexes for table `tb_ujian_jawaban` -- ALTER TABLE `tb_ujian_jawaban` ADD PRIMARY KEY (`uj_soal`,`uj_jawaban`), ADD KEY `uj_jawaban` (`uj_jawaban`), ADD KEY `uj_soal` (`uj_soal`); -- -- Indexes for table `tb_ujian_soal` -- ALTER TABLE `tb_ujian_soal` ADD PRIMARY KEY (`us_id`), ADD UNIQUE KEY `us_users_us_soal` (`us_users`,`us_soal`), ADD KEY `us_soal` (`us_soal`), ADD KEY `us_users` (`us_users`); -- -- Indexes for table `tb_ujian_topik` -- ALTER TABLE `tb_ujian_topik` ADD PRIMARY KEY (`ut_id`), ADD KEY `ut_ujian` (`ut_ujian`), ADD KEY `ut_topik` (`ut_topik`); -- -- Indexes for table `tb_ujian_users` -- ALTER TABLE `tb_ujian_users` ADD PRIMARY KEY (`users_id`), ADD UNIQUE KEY `users_ujian_users_siswa_users_status` (`users_ujian`,`users_siswa`,`users_status`), ADD KEY `users_siswa` (`users_siswa`), ADD KEY `users_ujian` (`users_ujian`); -- -- Indexes for table `tb_user` -- ALTER TABLE `tb_user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tb_absen` -- ALTER TABLE `tb_absen` MODIFY `absen_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tb_guru` -- ALTER TABLE `tb_guru` MODIFY `guru_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_jadwal` -- ALTER TABLE `tb_jadwal` MODIFY `jadwal_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tb_jawaban` -- ALTER TABLE `tb_jawaban` MODIFY `jawaban_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35; -- -- AUTO_INCREMENT for table `tb_jenjang` -- ALTER TABLE `tb_jenjang` MODIFY `jenjang_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_jurusan` -- ALTER TABLE `tb_jurusan` MODIFY `jurusan_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tb_kelas` -- ALTER TABLE `tb_kelas` MODIFY `kelas_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `tb_mapel` -- ALTER TABLE `tb_mapel` MODIFY `mapel_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tb_pembayaran` -- ALTER TABLE `tb_pembayaran` MODIFY `pembayaran_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` MODIFY `pengumuman_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `tb_rapor` -- ALTER TABLE `tb_rapor` MODIFY `rapor_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `tb_siswa` -- ALTER TABLE `tb_siswa` MODIFY `siswa_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tb_soal` -- ALTER TABLE `tb_soal` MODIFY `soal_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `tb_tingkat` -- ALTER TABLE `tb_tingkat` MODIFY `tingkat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tb_topik` -- ALTER TABLE `tb_topik` MODIFY `topik_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_ujian` -- ALTER TABLE `tb_ujian` MODIFY `ujian_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_ujian_soal` -- ALTER TABLE `tb_ujian_soal` MODIFY `us_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `tb_ujian_topik` -- ALTER TABLE `tb_ujian_topik` MODIFY `ut_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `tb_ujian_users` -- ALTER TABLE `tb_ujian_users` MODIFY `users_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `tb_user` -- ALTER TABLE `tb_user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Constraints for dumped tables -- -- -- Constraints for table `tb_absen` -- ALTER TABLE `tb_absen` ADD CONSTRAINT `tb_absen_ibfk_2` FOREIGN KEY (`absen_user`) REFERENCES `tb_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_guru` -- ALTER TABLE `tb_guru` ADD CONSTRAINT `tb_guru_ibfk_3` FOREIGN KEY (`guru_jenjang`) REFERENCES `tb_jenjang` (`jenjang_id`) ON DELETE RESTRICT ON UPDATE RESTRICT, ADD CONSTRAINT `tb_guru_ibfk_4` FOREIGN KEY (`guru_uid`) REFERENCES `tb_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_jadwal` -- ALTER TABLE `tb_jadwal` ADD CONSTRAINT `tb_jadwal_ibfk_1` FOREIGN KEY (`jadwal_kelas`) REFERENCES `tb_kelas` (`kelas_id`), ADD CONSTRAINT `tb_jadwal_ibfk_3` FOREIGN KEY (`jadwal_mapel`) REFERENCES `tb_mapel` (`mapel_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_jawaban` -- ALTER TABLE `tb_jawaban` ADD CONSTRAINT `tb_jawaban_ibfk_2` FOREIGN KEY (`jawaban_soal`) REFERENCES `tb_soal` (`soal_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_kelas` -- ALTER TABLE `tb_kelas` ADD CONSTRAINT `tb_kelas_ibfk_1` FOREIGN KEY (`kelas_jenjang`) REFERENCES `tb_jenjang` (`jenjang_id`), ADD CONSTRAINT `tb_kelas_ibfk_2` FOREIGN KEY (`kelas_tingkat`) REFERENCES `tb_tingkat` (`tingkat_id`), ADD CONSTRAINT `tb_kelas_ibfk_3` FOREIGN KEY (`kelas_jurusan`) REFERENCES `tb_jurusan` (`jurusan_id`); -- -- Constraints for table `tb_mapel` -- ALTER TABLE `tb_mapel` ADD CONSTRAINT `tb_mapel_ibfk_2` FOREIGN KEY (`mapel_guru`) REFERENCES `tb_guru` (`guru_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_pembayaran` -- ALTER TABLE `tb_pembayaran` ADD CONSTRAINT `tb_pembayaran_ibfk_2` FOREIGN KEY (`pembayaran_siswa`) REFERENCES `tb_siswa` (`siswa_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_pengumuman` -- ALTER TABLE `tb_pengumuman` ADD CONSTRAINT `tb_pengumuman_ibfk_1` FOREIGN KEY (`pengumuman_jenjang`) REFERENCES `tb_jenjang` (`jenjang_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_rapor` -- ALTER TABLE `tb_rapor` ADD CONSTRAINT `tb_rapor_ibfk_2` FOREIGN KEY (`rapor_siswa`) REFERENCES `tb_siswa` (`siswa_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_siswa` -- ALTER TABLE `tb_siswa` ADD CONSTRAINT `tb_siswa_ibfk_1` FOREIGN KEY (`siswa_jenjang`) REFERENCES `tb_jenjang` (`jenjang_id`), ADD CONSTRAINT `tb_siswa_ibfk_2` FOREIGN KEY (`siswa_kelas`) REFERENCES `tb_kelas` (`kelas_id`), ADD CONSTRAINT `tb_siswa_ibfk_4` FOREIGN KEY (`siswa_uid`) REFERENCES `tb_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_soal` -- ALTER TABLE `tb_soal` ADD CONSTRAINT `tb_soal_ibfk_2` FOREIGN KEY (`soal_topik`) REFERENCES `tb_topik` (`topik_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_topik` -- ALTER TABLE `tb_topik` ADD CONSTRAINT `tb_topik_ibfk_2` FOREIGN KEY (`topik_pembuat`) REFERENCES `tb_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_ujian_group` -- ALTER TABLE `tb_ujian_group` ADD CONSTRAINT `tb_ujian_group_ibfk_7` FOREIGN KEY (`group_ujian`) REFERENCES `tb_ujian` (`ujian_id`) ON DELETE CASCADE ON UPDATE RESTRICT, ADD CONSTRAINT `tb_ujian_group_ibfk_8` FOREIGN KEY (`group_kelas`) REFERENCES `tb_kelas` (`kelas_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_ujian_jawaban` -- ALTER TABLE `tb_ujian_jawaban` ADD CONSTRAINT `tb_ujian_jawaban_ibfk_3` FOREIGN KEY (`uj_soal`) REFERENCES `tb_ujian_soal` (`us_id`) ON DELETE CASCADE ON UPDATE RESTRICT, ADD CONSTRAINT `tb_ujian_jawaban_ibfk_4` FOREIGN KEY (`uj_jawaban`) REFERENCES `tb_jawaban` (`jawaban_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_ujian_soal` -- ALTER TABLE `tb_ujian_soal` ADD CONSTRAINT `tb_ujian_soal_ibfk_3` FOREIGN KEY (`us_users`) REFERENCES `tb_ujian_users` (`users_id`) ON DELETE CASCADE ON UPDATE RESTRICT, ADD CONSTRAINT `tb_ujian_soal_ibfk_4` FOREIGN KEY (`us_soal`) REFERENCES `tb_soal` (`soal_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_ujian_topik` -- ALTER TABLE `tb_ujian_topik` ADD CONSTRAINT `tb_ujian_topik_ibfk_3` FOREIGN KEY (`ut_ujian`) REFERENCES `tb_ujian` (`ujian_id`) ON DELETE CASCADE ON UPDATE RESTRICT, ADD CONSTRAINT `tb_ujian_topik_ibfk_5` FOREIGN KEY (`ut_topik`) REFERENCES `tb_topik` (`topik_id`) ON DELETE CASCADE ON UPDATE RESTRICT; -- -- Constraints for table `tb_ujian_users` -- ALTER TABLE `tb_ujian_users` ADD CONSTRAINT `tb_ujian_users_ibfk_3` FOREIGN KEY (`users_siswa`) REFERENCES `tb_siswa` (`siswa_id`) ON DELETE CASCADE ON UPDATE RESTRICT, ADD CONSTRAINT `tb_ujian_users_ibfk_5` FOREIGN KEY (`users_ujian`) REFERENCES `tb_ujian` (`ujian_id`) ON DELETE CASCADE ON UPDATE RESTRICT; 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
ca9c50ffd005cb0171e90274404ac4a746172fac
SQL
Adeynack/finances_experiments
/backend/go-gin/docs/database_evolution/000002_create_table_books.up.sql
UTF-8
170
3.0625
3
[ "MIT" ]
permissive
CREATE TABLE books ( "id" BIGSERIAL PRIMARY KEY, "name" TEXT NOT NULL, "owner_id" BIGINT NOT NULL REFERENCES "users" ("id"), -- UNIQUE ("name", "owner_id") );
true
4d4bcbbb26cda0761c1b3db20fd5b696babdfaea
SQL
18918090402/MZJF_Work
/MZJF_Work/0002 Git.nonobank.com/archive_20180806/bi-etl.git/03_DW_HADOOP/06_DMT_RM/01_TABLE/FACT_USER_STAT_DAILY.sql
UTF-8
1,999
2.921875
3
[]
no_license
DROP TABLE IF EXISTS DMT_RM.FACT_USER_STAT_DAILY; CREATE TABLE IF NOT EXISTS DMT_RM.FACT_USER_STAT_DAILY ( USER_ID bigint comment '用户ID', USER_NAME string comment '用户名', REAL_NAME string comment '真实姓名', IN_REPAYMENT_CNT int comment '还款中笔数', ALREADY_REPAYMENT_CNT int comment '已结清笔数', REJECT_CNT int comment '被拒绝次数', LAST_REJECT_TIME string comment '最近一次拒绝时间', OVERDUE_LESS_7_DAY_CNT int comment '逾期7天以内的次数', OVERDUE_LESS_30_DAY_CNT int comment '逾期30天以内的次数', OVERDUE_LESS_60_DAY_CNT int comment '逾期60天以内的次数', OVERDUE_MORE_60_DAY_CNT int comment '逾期60天以上的次数', MAX_BO_BRICE decimal(38,10) comment '历史借款最高金额', LOAN_MXD_BKB_CNT int comment '成功借名校贷(本科包)的次数', LOAN_MXD_ZKB_CNT int comment '成功借专科包的次数', LOAN_MXD_YJB_CNT int comment '成功借应急包的次数', LOAN_MXD_BLB_CNT int comment '成功借白领包的次数', LOAN_MYFQ_CNT int comment '成功借麦芽分期的次数', LOAN_USA_MXD_CNT int comment '成功借美国名校贷的次数', LOAN_UNIFI_XED_CNT int comment '成功借unifi小额贷的次数', DW_CREATE_BY string comment '系统字段-创建者', DW_CREATE_TIME string comment '系统字段-创建时间', DW_UPDATE_BY string comment '系统字段-修改者', DW_UPDATE_TIME string comment '系统字段-修改时间', MLD_CREDIT_APPLY_CNT bigint comment '麦粒贷申请授信次数', MLD_BO_SUCCESS_CNT bigint comment '成功借麦粒贷的次数', REGISTER_TIME string comment '注册时间') COMMENT '用户表' PARTITIONED BY (STAT_DATE int COMMENT '统计日期 年月日') ROW FORMAT DELIMITED NULL DEFINED AS '' STORED AS PARQUET TBLPROPERTIES ("parquet.compression"="SNAPPY");
true
7804a201cb5886238ebcba810f2fcb89f57fd524
SQL
Jim-flores/proyectoTDS
/backend/farmaciadb.sql
UTF-8
1,590
3.171875
3
[]
no_license
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; -- -------------------------------------------------------- DROP TABLE IF EXISTS `productos`; CREATE TABLE IF NOT EXISTS `productos` ( `id` int(255) NOT NULL AUTO_INCREMENT, `nombre` varchar(255) DEFAULT NULL, `precio` double(10,2) DEFAULT NULL, `stock` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `empleados`; CREATE TABLE IF NOT EXISTS `empleados` ( `id` int(255) NOT NULL AUTO_INCREMENT, `nombre` varchar(55) DEFAULT NULL, `apellido` varchar(55) DEFAULT NULL, `edad` varchar(3) DEFAULT NULL, `dni` varchar(8) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; -- -- Volcado de datos -- INSERT INTO `productos` (`id`, `nombre`, `precio`, `stock`) VALUES (1, 'VICK Vaporub', 29.60, 50), (2, 'Alcohol medicinal', 7.90, 60), (3, 'Losartan Caja 30u ', 7.30, 42), (4, 'Aspirina 100mg caja', 48.00, 80), (6, 'NOtil NF crema', 14.00, 36), (7, 'Panadol Antigripal', 2.20, 50), (8, 'Shampoo Medicasp', 28.30, 60); COMMIT; INSERT INTO `empleados` (`id`, `nombre`, `apellido`, `edad`, `dni`) VALUES (1, 'Leticia', 'Taboada Solis', '46', '75965983'), (2, 'Gabriel', 'Ruano Cornejo', '43', '70343092'), (3, 'Eduardo', 'Dueñas Lopez', '47', '01133773'), (4, 'David', 'Hernandez Cerdan', '26', '69927376'), (5, 'Patricio', 'Sanches Pobeda', '29', '73519183'), (6, 'Paola', 'Aragon Rocha', '25', '71137043'), (7, 'Zaida', 'Diaz Campos', '39', '01058854'), (8, 'Ismael', 'Gomez Parra', '41', '72159905'); COMMIT;
true
a78b3ed30c6d9b1d6e4955cfbabd29df8cc0c7d2
SQL
JonathanRH07/Control-de-versiones
/DB ICAAVweb/Suite_mig_demo/Tables/sat_bancos.sql
UTF-8
496
2.53125
3
[]
no_license
CREATE TABLE `sat_bancos` ( `id_sat_bancos` int(11) NOT NULL AUTO_INCREMENT, `id_pais` int(11) DEFAULT NULL, `clave_sat` char(5) DEFAULT NULL, `nombre` varchar(50) DEFAULT NULL, `razon_social` varchar(300) DEFAULT NULL, `nacional` varchar(45) DEFAULT NULL, `rfc` char(15) DEFAULT NULL, `estatus` enum('ACTIVO','INACTIVO') DEFAULT NULL, `fecha_mod` timestamp NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id_sat_bancos`) ) ENGINE=InnoDB AUTO_INCREMENT=93 DEFAULT CHARSET=utf8;
true
450a5b791946fd1577d53284fcc7fb6d7824aa6d
SQL
Carcophan/Jabit
/repositories/src/main/resources/db/migration/V3.3__Create_table_node.sql
UTF-8
261
2.546875
3
[ "Apache-2.0" ]
permissive
CREATE TABLE Node ( stream BIGINT NOT NULL, address VARBINARY(32) NOT NULL, port INT NOT NULL, services BIGINT NOT NULL, time BIGINT NOT NULL, PRIMARY KEY (stream, address, port) ); CREATE INDEX idx_time on Node(time);
true
fe57e6646b1c4e1c698b255d9687e196e53ad553
SQL
vitalspirit/MySQL-homeworks-repo
/Итоговый проект/Процедуры и триггеры.sql
UTF-8
2,824
3.859375
4
[]
no_license
#Процедура выводит 10 пользователей с наибольшей продолжительностью всех видео на их каналах, либо с наибольшим размером видеофайлов на их каналах DELIMITER // CREATE PROCEDURE proc_1 (IN param1 VARCHAR(20)) BEGIN IF param1 = 'length' THEN SELECT ui.nickname, SUM(v.video_length) AS Total_length FROM user_info ui INNER JOIN channel_profiles cp ON ui.id = cp.user_id INNER JOIN videos v ON cp.id = v.channel_id GROUP BY nickname ORDER BY Total_length DESC LIMIT 10 ; ELSE SELECT ui.nickname, SUM(v.file_size) AS Total_size FROM user_info ui INNER JOIN channel_profiles cp ON ui.id = cp.user_id INNER JOIN videos v ON cp.id = v.channel_id GROUP BY nickname ORDER BY Total_size DESC LIMIT 10; END IF; END // CALL proc_1('length') CALL proc_1('abracadabra') #Триггер на добавление записи в таблицу Channel_profiles CREATE TABLE channel_profiles_inserts ( id INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, msg VARCHAR( 255 ) NOT NULL, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, row_id INT( 11 ) NOT NULL ) ENGINE = MYISAM; DELIMITER // CREATE TRIGGER inserts_of_channel_profiles AFTER INSERT ON channel_profiles FOR EACH ROW BEGIN INSERT INTO channel_profiles_inserts SET msg = 'new row added', row_id = NEW.id; END// DELIMITER ; INSERT INTO `channel_profiles` (`user_id`, `photo_id`, `channel_status`, `created_at`, `monetization`, `channel_type`, `subscribers`) VALUES (18, 0, 3, '2021-01-08 13:17:54', '2', '2', 10); INSERT INTO `channel_profiles` (`user_id`, `photo_id`, `channel_status`, `created_at`, `monetization`, `channel_type`, `subscribers`) VALUES (22, 0, 3, '2021-01-08 13:17:55', '2', '2', 20); INSERT INTO `channel_profiles` (`user_id`, `photo_id`, `channel_status`, `created_at`, `monetization`, `channel_type`, `subscribers`) VALUES (36, 0, 3, '2021-01-08 13:17:56', '2', '2', 333); SELECT * FROM channel_profiles_inserts; #Триггер на изменение статуса пользователя user_status из таблицы user_info CREATE TABLE user_info_updates ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id INT(11) NOT NULL, new_user_status INT UNSIGNED NOT NULL, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE = MYISAM; DELIMITER // CREATE TRIGGER user_info_updates after update ON `user_info` FOR EACH ROW BEGIN INSERT INTO user_info_updates SET user_id = NEW.id, new_user_status = NEW.user_status; END// DELIMITER ; UPDATE user_info SET user_status = 3 WHERE id = 1; SELECT * FROM user_info_updates;
true
becb22f26178aa97f4378d82fc9e8552a5dc1100
SQL
ikeven94/SQL_repo
/Select.sql
UTF-8
734
4.03125
4
[]
no_license
- SELECT - [모든 레코드 조회하기] SELECT * FROM ANIMAL_INS ORDER BY ANIMAL_ID; [역순 정렬하기] SELECT NAME, DATETIME FROM ANIMAL_INS ORDER BY ANIMAL_ID DESC; [아픈 동물 찾기] SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION = 'Sick' ORDER BY ANIMAL_ID ASC; [어린 동물 찾기] SELECT ANIMAL_ID, NAME FROM ANIMAL_INS WHERE INTAKE_CONDITION <> 'Aged'; [동물의 아이디와 이름] SELECT ANIMAL_ID,NAME FROM ANIMAL_INS ORDER BY ANIMAL_ID; [여러 기준으로 정렬하기] SELECT ANIMAL_ID, NAME, DATETIME FROM ANIMAL_INS ORDER BY NAME,DATETIME DESC; [상위 n개 레코드] SELECT NAME FROM (SELECT * FROM ANIMAL_INS ORDER BY DATETIME) WHERE ROWNUM = 1;
true
35686bb2e146a62229f74a5d25c22a8104876d7f
SQL
wilflores/Proyecto_Mosaikus
/mosaikus/melvin.sql
UTF-8
62,587
2.765625
3
[]
no_license
ALTER TABLE `mos_registro` DROP COLUMN `correlativo`, DROP INDEX `ind01` , ADD UNIQUE INDEX `ind01` (`idRegistro`, `IDDoc`, `identificacion`, `version`) USING BTREE ; ALTER TABLE `mos_registro_formulario` DROP COLUMN `IDCodigoCate`; ALTER TABLE `mos_registro_formulario` MODIFY COLUMN `tipo` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' AFTER `Nombre`; -- deris roles INSERT INTO `mos_nombres_campos` VALUES ('242', 'cod_perfil', 'Codigo Perfil', '19', 'cod_perfil'); INSERT INTO `mos_nombres_campos` VALUES ('243', 'descripcion_perfil', 'Descripcion Perfil', '19', 'descripcion_perfil'); INSERT INTO `mos_nombres_campos` VALUES ('244', 'nuevo', 'Acceso a Nuevo', '19', 'nuevo'); INSERT INTO `mos_nombres_campos` VALUES ('245', 'modificar', 'Acceso a Modificar', '19', 'modificar'); INSERT INTO `mos_nombres_campos` VALUES ('246', 'eliminar', 'Acceso a Eliminar', '19', 'eliminar'); INSERT INTO `mos_nombres_campos` VALUES ('247', 'recordatorio', 'Acceso a Recordatorio', '19', 'recordatorio'); INSERT INTO `mos_nombres_campos` VALUES ('248', 'modificar_terceros', 'Nombres', '19', 'modificar_terceros'); INSERT INTO `mos_nombres_campos` VALUES ('249', 'visualizar_terceros', 'Visualizar de Terceros', '19', 'visualizar_terceros'); INSERT INTO `mos_nombres_campos` VALUES ('250', 'cod_perfil', 'Codigo Perfil', '21', 'cod_perfil'); INSERT INTO `mos_nombres_campos` VALUES ('251', 'descripcion_perfil', 'Descripcion Perfil', '21', 'descripcion_perfil'); INSERT INTO `mos_nombres_campos` VALUES ('252', 'visualizar_terceros', 'Visualizar de Terceros', '21', 'visualizar_terceros'); INSERT INTO `mos_nombres_campos` VALUES ('253', 'visualizar_terceros', 'Visualizar de Terceros', '21', 'visualizar_terceros'); INSERT INTO `mos_nombres_campos` VALUES ('254', 'id_usuario', 'id_usuario', '21', 'id_usuario'); INSERT INTO `mos_nombres_campos` VALUES ('255', 'nombres', 'Nombres', '21', 'nombres'); INSERT INTO `mos_nombres_campos` VALUES ('256', 'apellido_paterno', 'Apellido Paterno', '21', 'apellido_paterno'); INSERT INTO `mos_nombres_campos` VALUES ('257', 'apellido_materno', 'Apellido Materno', '21', 'apellido_materno'); INSERT INTO `mos_nombres_campos` VALUES ('258', 'telefono', 'Telefono', '21', 'telefono'); INSERT INTO `mos_nombres_campos` VALUES ('259', 'fecha_expi', 'Fecha de Expiracion', '21', 'fecha_expi'); INSERT INTO `mos_nombres_campos` VALUES ('260', 'vigencia', 'Vigencia', '21', 'vigencia'); INSERT INTO `mos_nombres_campos` VALUES ('261', 'super_usuario', 'Super Usuario', '21', 'super_usuario'); INSERT INTO `mos_nombres_campos` VALUES ('262', 'email', 'email', '21', 'email'); INSERT INTO `mos_nombres_campos` VALUES ('263', 'password_1', 'Password', '21', 'password_1'); INSERT INTO `mos_nombres_campos` VALUES ('264', 'cedula', 'Cedula', '21', 'cedula'); -- melvin items temporales INSERT INTO `mos_nombres_campos` VALUES ('265', 'id', 'id', '22', 'id'); INSERT INTO `mos_nombres_campos` VALUES ('266', 'fk_id_unico', 'fk_id_unico', '22', 'fk_id_unico'); INSERT INTO `mos_nombres_campos` VALUES ('267', 'descripcion', 'Descripción', '22', 'descripcion'); INSERT INTO `mos_nombres_campos` VALUES ('268', 'vigencia', 'Vigencia', '22', 'vigencia'); INSERT INTO `mos_nombres_campos` VALUES ('269', 'tipo', 'tipo', '22', 'tipo'); DROP TABLE IF EXISTS `mos_documentos_formulario_items`; CREATE TABLE `mos_documentos_formulario_items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fk_id_unico` int(11) DEFAULT NULL, `descripcion` varchar(250) DEFAULT NULL, `vigencia` varchar(2) DEFAULT 'S', `tipo` int(11) DEFAULT NULL COMMENT '7 => Seleccion Simple\r\n8 => Seleccion Multiple\r\n9 => Combo', PRIMARY KEY (`id`), KEY `fk_id_unico` (`fk_id_unico`), CONSTRAINT `mos_documentos_formulario_items_ibfk_1` FOREIGN KEY (`fk_id_unico`) REFERENCES `mos_documentos_datos_formulario` (`id_unico`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `mos_documentos_formulario_items_temp`; CREATE TABLE `mos_documentos_formulario_items_temp` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fk_id_unico` int(11) DEFAULT NULL, `descripcion` varchar(250) DEFAULT NULL, `vigencia` varchar(2) DEFAULT 'S', `tipo` int(11) DEFAULT NULL COMMENT '7 => Seleccion Simple\r\n8 => Seleccion Multiple\r\n9 => Combo', `fk_id_item` int(11) DEFAULT NULL, `estado` int(11) DEFAULT NULL COMMENT '0 => Sin Cambios\r\n1 => Nuevo\r\n2 => Editar\r\n3 => Eliminar', `fecha` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `id_usuario` int(11) DEFAULT NULL, `tok` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_id_unico` (`fk_id_unico`) ) ENGINE=InnoDB AUTO_INCREMENT=200 DEFAULT CHARSET=latin1; -- campo publico documento 07/03/2016 ALTER TABLE `mos_documentos` ADD COLUMN `publico` char(1) NULL DEFAULT 'N' AFTER `aprobo`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('publico', 'Público', '6'); -- cambio en mos_roganizacon ALTER TABLE `mos_organizacion` CHANGE COLUMN `left` `left_a` bigint(20) UNSIGNED NOT NULL AFTER `position`; ALTER TABLE `mos_organizacion` CHANGE COLUMN `right` `right_a` bigint(20) UNSIGNED NOT NULL AFTER `left_a`; delete from mos_cargo_estrorg_arbolproc where id not in (select id from mos_organizacion); ALTER TABLE `mos_cargo_estrorg_arbolproc` DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci; ALTER TABLE `mos_organizacion` MODIFY COLUMN `id` int(9) UNSIGNED NOT NULL AUTO_INCREMENT FIRST , MODIFY COLUMN `parent_id` int(9) UNSIGNED NOT NULL AFTER `id`; ALTER TABLE `mos_organizacion` ADD UNIQUE INDEX (`id`) ; ALTER TABLE `mos_organizacion` MODIFY COLUMN `id` int(9) NOT NULL AUTO_INCREMENT FIRST ; ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD FOREIGN KEY (`id`) REFERENCES `mos_organizacion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `mos_documentos_estrorg_arbolproc` ADD FOREIGN KEY (`id_organizacion_proceso`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_personal` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_acciones_correctivas` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_correcciones` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_cargo_estrorg_arbolproc` DROP FOREIGN KEY `FK_REFERENCE_18`; ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD CONSTRAINT `FK_REFERENCE_18` FOREIGN KEY (`cod_cargo`) REFERENCES `mos_cargo` (`cod_cargo`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_arbol_procesos` CHANGE COLUMN `left` `left_a` bigint(20) UNSIGNED NOT NULL AFTER `position`, CHANGE COLUMN `right` `right_a` bigint(20) UNSIGNED NOT NULL AFTER `left_a`; ALTER TABLE `mos_arbol_procesos` ADD COLUMN `id_organizacion` int NULL AFTER `type`; ALTER TABLE `mos_arbol_procesos` MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT FIRST ; ALTER TABLE `mos_arbol_procesos` MODIFY COLUMN `id` int(20) NOT NULL AUTO_INCREMENT FIRST , MODIFY COLUMN `parent_id` int(20) UNSIGNED NOT NULL AFTER `id`; ALTER TABLE `mos_arbol_procesos` ENGINE=InnoDB; ALTER TABLE `mos_arbol_procesos` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_acciones_correctivas` ADD FOREIGN KEY (`id_proceso`) REFERENCES `mos_arbol_procesos` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_correcciones` ADD CONSTRAINT `mos_correcciones_ibfk_2` FOREIGN KEY (`id_proceso`) REFERENCES `mos_arbol_procesos` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; DROP TABLE IF EXISTS `mos_arbol_procesos_nombres`; CREATE TABLE `mos_arbol_procesos_nombres` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; insert into mos_arbol_procesos_nombres (id,title) select id, title from mos_arbol_procesos; DROP TABLE IF EXISTS `mos_organizacion_nombres`; CREATE TABLE `mos_organizacion_nombres` ( `id` int(20) unsigned NOT NULL AUTO_INCREMENT, `title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; insert into mos_organizacion_nombres (id,title) select id, title from mos_organizacion; DROP TRIGGER IF EXISTS `actualiza_nombre_proceso_ins`; DELIMITER ;; CREATE TRIGGER `actualiza_nombre_proceso_ins` BEFORE INSERT ON `mos_arbol_procesos_nombres` FOR EACH ROW UPDATE mos_arbol_procesos SET title = NEW.title WHERE id = NEW.id ;; DELIMITER ; DROP TRIGGER IF EXISTS `actualiza_nombre_proceso`; DELIMITER ;; CREATE TRIGGER `actualiza_nombre_proceso` BEFORE UPDATE ON `mos_arbol_procesos_nombres` FOR EACH ROW UPDATE mos_arbol_procesos SET title = NEW.title WHERE id = NEW.id ;; DELIMITER ; DROP TRIGGER IF EXISTS `actualizar_nombre_area_ins`; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area_ins` BEFORE INSERT ON `mos_organizacion_nombres` FOR EACH ROW UPDATE mos_organizacion SET title = NEW.title WHERE id = NEW.id ;; DELIMITER ; DROP TRIGGER IF EXISTS `actualizar_nombre_area`; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area` BEFORE UPDATE ON `mos_organizacion_nombres` FOR EACH ROW UPDATE mos_organizacion SET title = NEW.title WHERE id = NEW.id ;; DELIMITER ; -- cambios en documentos ALTER TABLE `mos_documentos_estrorg_arbolproc` DROP INDEX `ind02`; ALTER TABLE `mos_documentos_estrorg_arbolproc` DROP FOREIGN KEY `mos_documentos_estrorg_arbolproc_ibfk_1`; ALTER TABLE `mos_documentos_estrorg_arbolproc` ADD FOREIGN KEY (`id_organizacion_proceso`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_personal` DROP INDEX `ind02`, DROP INDEX `ind03`, DROP INDEX `ind04`, DROP INDEX `Ind05`; ALTER TABLE `mos_personal` DROP FOREIGN KEY `mos_personal_ibfk_1`; ALTER TABLE `mos_personal` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_cargo_estrorg_arbolproc` DROP FOREIGN KEY `FK_REFERENCE_18`; ALTER TABLE `mos_cargo_estrorg_arbolproc` DROP FOREIGN KEY `mos_cargo_estrorg_arbolproc_ibfk_1`; ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD FOREIGN KEY (`cod_cargo`) REFERENCES `mos_cargo` (`cod_cargo`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD FOREIGN KEY (`id`) REFERENCES `mos_organizacion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `mos_arbol_procesos` DROP FOREIGN KEY `mos_arbol_procesos_ibfk_1`; ALTER TABLE `mos_arbol_procesos` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_acciones_correctivas` ADD FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_acciones_correctivas` ADD FOREIGN KEY (`id_proceso`) REFERENCES `mos_arbol_procesos` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_correcciones` DROP FOREIGN KEY `mos_correcciones_ibfk_1`; ALTER TABLE `mos_correcciones` DROP FOREIGN KEY `mos_correcciones_ibfk_2`; DROP TRIGGER IF EXISTS `libera_areas`; DELIMITER ;; CREATE TRIGGER `libera_areas` BEFORE UPDATE ON `mos_arbol_procesos` FOR EACH ROW BEGIN IF (NEW.level > 2) THEN SET new.id_organizacion = NULL; END IF; END; ;; DELIMITER ; -- ajustes en personal 14/04/2016 update mos_personal set email = NULL where email = ''; ALTER TABLE `mos_personal` ADD UNIQUE INDEX (`email`) ; INSERT INTO `mos_parametro_categoria` (`cod_categoria`, `descripcion`, `nombre_div`, `activo`) VALUES ('14', 'Inspecciones', 'Inspecciones', 'S'); INSERT INTO `mos_link` (`nombre_link`, `dependencia`, `tipo`, `orden`) VALUES ('Inspecciones', '0', '1', '10'); UPDATE `mos_link` SET `cod_link`='83' WHERE (`cod_link`='0'); INSERT INTO `mos_link` (`cod_link`, `nombre_link`, `dependencia`, `tipo`, `orden`) VALUES ('84', 'Plantillas de Inspecciones', '83', '3', '2'); -- INSERT INTO `mos_link_por_perfil` (`cod_perfil`, `cod_link`) VALUES ('1', '83'); -- INSERT INTO `mos_link_por_perfil` (`cod_perfil`, `cod_link`) VALUES ('1', '84'); UPDATE `mos_link` SET `imagen`='planesp' WHERE (`cod_link`='83'); UPDATE `mos_link` SET `descripcion`='PlantilaInspecciones-indexPlantilaInspecciones-clases.plantilla_inspecciones.PlantilaInspecciones' WHERE (`cod_link`='84'); -- ALTER TABLE `mos_tipo_inspecciones` ADD COLUMN `codigo` varchar(50) NULL AFTER `id`; ALTER TABLE `mos_log` ADD COLUMN `id_registro` int NULL AFTER `id`; ALTER TABLE `mos_log` MODIFY COLUMN `accion` text NULL AFTER `fecha_hora`, MODIFY COLUMN `anterior` text NULL AFTER `accion`; ALTER TABLE `mos_documentos_formulario_items_temp` ADD COLUMN `descripcion_larga` text NULL AFTER `tok`, ADD COLUMN `peso` int NULL DEFAULT 0 AFTER `descripcion_larga`; ALTER TABLE `mos_documentos_formulario_items_temp` ADD COLUMN `orden` int NULL AFTER `peso`; -- nuevo 22-04-2016 ALTER TABLE `mos_historico_wf_documentos` MODIFY COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST ; ALTER TABLE `mos_historico_wf_documentos` MODIFY COLUMN `fecha_registro` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `IDDoc`; update mos_documentos set mos_documentos.etapa_workflow='estado_aprobado', mos_documentos.estado_workflow='OK', mos_documentos.fecha_estado_workflow=CURRENT_TIMESTAMP(), mos_documentos.id_usuario_workflow= elaboro; -- correo unico ALTER TABLE `mos_usuario` DROP INDEX `ind05` , ADD UNIQUE INDEX `ind05` (`email`) USING BTREE ; UPDATE `mos_link` SET `nombre_link`='Administrador de Perfiles' WHERE (`cod_link`='66'); UPDATE `mos_link` SET `nombre_link`='Perfiles Especialistas' WHERE (`cod_link`='80'); UPDATE `mos_link` SET `nombre_link`='Perfiles Portal' WHERE (`cod_link`='81'); ALTER TABLE `mos_documentos` MODIFY COLUMN `observacion` text NULL AFTER `id_usuario`; /*atributo responsable area*/ ALTER TABLE `mos_personal` ADD COLUMN `responsable_area` varchar(2) NULL DEFAULT 'N' AFTER `cod_contratista`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('responsable_area', 'Responsable de Área', '1'); UPDATE `mos_nombres_campos` SET `texto`='ID', `placeholder`='Nº Documento de Identidad' WHERE (`id`='1'); /*Dar permiso a un area a un usuario segun perfil */ CREATE TRIGGER `permisos_perfil_usuarios` AFTER INSERT ON `mos_organizacion` FOR EACH ROW INSERT into mos_usuario_estructura(id_usuario_filial,id_estructura, id_usuario,cod_perfil,portal) select id_usuario_filial,NEW.id,id_usuario,cod_perfil,portal from mos_usuario_estructura where id_estructura = NEW.parent_id;; /**/ /* CAMBIOS WF DOCUMENTOS*/ DROP TRIGGER `registra_mos_historico_wf_documentos`; DROP TRIGGER `registra_mos_historico_wf_documentos_cambio`; DELIMITER ;; CREATE TRIGGER `registra_mos_historico_wf_documentos` AFTER INSERT ON `mos_documentos` FOR EACH ROW BEGIN /*guarda historico al insertar un doc*/ DECLARE etapa text; IF(NEW.id_workflow_documento is not null)THEN set etapa= (SELECT IFNULL(mos_nombres_campos.texto,'') FROM mos_nombres_campos WHERE mos_nombres_campos.modulo = 6 AND mos_nombres_campos.nombre_campo = NEW.etapa_workflow); INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('CREADO: ',IFNULL(NEW.estado_workflow,''),' ',etapa ),NEW.id_usuario_workflow); END IF; END; ;; DELIMITER ; DELIMITER ;; CREATE TRIGGER `registra_mos_historico_wf_documentos_cambio` BEFORE UPDATE ON `mos_documentos` FOR EACH ROW BEGIN /*guarda historico al modificar un doc si cambian los datos del wf*/ DECLARE etapa text; set etapa= (SELECT IFNULL(mos_nombres_campos.texto,'') FROM mos_nombres_campos WHERE mos_nombres_campos.modulo = 6 AND mos_nombres_campos.nombre_campo = NEW.etapa_workflow); IF((NEW.etapa_workflow<>OLD.etapa_workflow) or (NEW.estado_workflow<>OLD.estado_workflow)) THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; IF(OLD.etapa_workflow is Null and NEW.etapa_workflow<>'') THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; END; ;; DELIMITER ; /*FIN CAMBIOS*/ /*AJuste en menu documentos*/ INSERT INTO `mos_link` (`cod_link`, `nombre_link`) VALUES ('89', 'Configuración'); UPDATE `mos_link` SET `dependencia`='3', `tipo`='2', `orden`='18' WHERE (`cod_link`='89'); UPDATE `mos_link` SET `dependencia`='89' WHERE (`cod_link`='88'); UPDATE `mos_link` SET `dependencia`='89' WHERE (`cod_link`='75'); UPDATE `mos_link` SET `orden`='60' WHERE (`cod_link`='89'); /*FIN AJUSTE DOCUMENTO*/ /*Codigo Documentos*/ INSERT INTO `mos_link` (`cod_link`, `descripcion`, `nombre_link`, `dependencia`) VALUES ('90', 'DocumentoCodigos-indexDocumentoCodigos-clases.documento_codigos.DocumentoCodigos', 'Códigos de Areas', '3'); UPDATE `mos_link` SET `orden`='59' WHERE (`cod_link`='90'); ALTER TABLE `mos_organizacion_nombres` MODIFY COLUMN `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST ; ALTER TABLE `mos_organizacion_nombres` MODIFY COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST ; ALTER TABLE `mos_acciones_correctivas` DROP FOREIGN KEY `mos_acciones_correctivas_ibfk_1`; ALTER TABLE `mos_acciones_correctivas` ADD CONSTRAINT `mos_acciones_correctivas_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_correcciones` DROP FOREIGN KEY `mos_correcciones_ibfk_1`; ALTER TABLE `mos_correcciones` ADD CONSTRAINT `mos_correcciones_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_personal` DROP FOREIGN KEY `mos_personal_ibfk_1`; ALTER TABLE `mos_personal` ADD CONSTRAINT `mos_personal_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_documentos_estrorg_arbolproc` DROP FOREIGN KEY `mos_documentos_estrorg_arbolproc_ibfk_1`; ALTER TABLE `mos_documentos_estrorg_arbolproc` ADD CONSTRAINT `mos_documentos_estrorg_arbolproc_ibfk_1` FOREIGN KEY (`id_organizacion_proceso`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_arbol_procesos` DROP FOREIGN KEY `mos_arbol_procesos_ibfk_1`; ALTER TABLE `mos_arbol_procesos` ADD CONSTRAINT `mos_arbol_procesos_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `mos_cargo_estrorg_arbolproc` DROP FOREIGN KEY `mos_cargo_estrorg_arbolproc_ibfk_2`; ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD CONSTRAINT `mos_cargo_estrorg_arbolproc_ibfk_2` FOREIGN KEY (`id`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `mos_organizacion` ADD COLUMN `area_espejo` int NULL AFTER `type`; ALTER TABLE `mos_organizacion_nombres` ADD COLUMN `area_espejo` int NULL AFTER `title`; DROP TRIGGER `actualizar_nombre_area_ins`; DROP TRIGGER `actualizar_nombre_area`; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area_ins` AFTER INSERT ON `mos_organizacion_nombres` FOR EACH ROW begin DECLARE padre INT; UPDATE mos_organizacion SET title = NEW.title WHERE id = NEW.id; SET padre = (SELECT parent_id FROM mos_organizacion WHERE id = NEW.id); insert into mos_documentos_codigo (id_organizacion, codigo) select NEW.id, codigo from mos_documentos_codigo where id_organizacion =padre; end; ;; DELIMITER ; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area` BEFORE UPDATE ON `mos_organizacion_nombres` FOR EACH ROW begin UPDATE mos_organizacion SET title = NEW.title, area_espejo = NEW.area_espejo WHERE id = NEW.id; IF (NEW.title <> OLD.title) AND OLD.title = 'New Node' THEN UPDATE mos_documentos_codigo SET codigo = CONCAT(codigo,'_', UPPER(SUBSTR(NEW.title, 1, 3))) WHERE id_organizacion = NEW.id; END IF; end; ;; DELIMITER ; DROP TRIGGER `permisos_perfil_usuarios`; DELIMITER ;; CREATE TRIGGER `permisos_perfil_usuarios` BEFORE INSERT ON `mos_organizacion` FOR EACH ROW Begin SET NEW.title = (SELECT title FROM mos_organizacion_nombres WHERE id = NEW.ID); INSERT into mos_usuario_estructura(id_usuario_filial,id_estructura, id_usuario,cod_perfil,portal) select id_usuario_filial,NEW.id,id_usuario,cod_perfil,portal from mos_usuario_estructura where id_estructura = NEW.parent_id; END; ;; DELIMITER ; UPDATE `mos_link_portal` SET `descripcion`='Documentos-indexDocumentosFormulario-clases.documentos.Documentos-formulario' WHERE (`cod_link`='16'); UPDATE `mos_link` SET `dependencia`='89' WHERE (`cod_link`='90'); UPDATE `mos_link` SET `dependencia`='89' WHERE (`cod_link`='82'); DROP TABLE IF EXISTS `mos_documentos_codigo`; CREATE TABLE `mos_documentos_codigo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_organizacion` int(11) DEFAULT NULL, `codigo` varchar(50) CHARACTER SET latin1 DEFAULT NULL, `bloqueo_codigo` varchar(2) CHARACTER SET latin1 DEFAULT 'S', `bloqueo_version` varchar(2) CHARACTER SET latin1 DEFAULT 'S', `correlativo` int(11) DEFAULT '1', PRIMARY KEY (`id`), KEY `id_organizacion` (`id_organizacion`), CONSTRAINT `mos_documentos_codigo_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion_nombres` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; insert into mos_documentos_codigo(id_organizacion,codigo,bloqueo_codigo,bloqueo_version,correlativo) select o.id, concat( IFNULL(concat(UPPER(SUBSTR(p4.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p3.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p2.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p1.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(padre.title, 1, 3)),'_'),''), UPPER(SUBSTR(o.title, 1, 3)) ) codigo, 'S', 'S', IFNULL(d.total+1,1) from mos_organizacion o inner join mos_organizacion padre on padre.id = o.parent_id left join mos_organizacion p1 on p1.id = padre.parent_id left join mos_organizacion p2 on p2.id = p1.parent_id left join mos_organizacion p3 on p3.id = p2.parent_id left join mos_organizacion p4 on p4.id = p3.parent_id left join ( select da.id_organizacion_proceso, COUNT(DISTINCT d.IDDoc) total from mos_documentos_estrorg_arbolproc da INNER JOIN mos_documentos d on d.IDDoc = da.IDDoc GROUP BY da.id_organizacion_proceso ) as d on d.id_organizacion_proceso = o.id; INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id', 'id', '26', 'id'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id_organizacion', 'Árbol Organizacional', '26', 'id_organizacion'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('codigo', 'Código', '26', 'codigo'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('bloqueo_codigo', 'Bloqueo Código', '26', 'bloqueo_codigo'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('bloqueo_version', 'Bloqueo Versión', '26', 'bloqueo_version'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('correlativo', 'correlativo', '26', 'correlativo'); /**/ /* ERROR ARBOL**/ delete from mos_usuario_estructura where id_estructura not in (select id from mos_organizacion); DROP TABLE IF EXISTS `mos_usuario_estructura_temp`; CREATE TABLE `mos_usuario_estructura_temp` ( `id_usuario_filial` int(11) NOT NULL, `id_estructura` int(11) NOT NULL, `id_usuario` int(11) NOT NULL, `cod_perfil` int(11) NOT NULL, `portal` char(1) DEFAULT NULL ); INSERT into mos_usuario_estructura_temp select id_usuario_filial, id_estructura, id_usuario, cod_perfil, portal from mos_usuario_estructura where id_estructura in (select id from mos_organizacion) GROUP BY id_estructura, id_usuario_filial, id_usuario, cod_perfil, portal; DELETE from mos_usuario_estructura; ALTER TABLE `mos_usuario_estructura` AUTO_INCREMENT=1; INSERT into mos_usuario_estructura(id_usuario_filial, id_estructura, id_usuario, cod_perfil, portal) select id_usuario_filial, id_estructura, id_usuario, cod_perfil, portal from mos_usuario_estructura_temp; DROP TABLE IF EXISTS `mos_usuario_estructura_temp`; ALTER TABLE `mos_organizacion_nombres` MODIFY COLUMN `id` int(11) NOT NULL FIRST ; ALTER TABLE `mos_acciones_correctivas` DROP FOREIGN KEY `mos_acciones_correctivas_ibfk_1`; -- ALTER TABLE `mos_acciones_correctivas` ADD CONSTRAINT `mos_acciones_correctivas_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_correcciones` DROP FOREIGN KEY `mos_correcciones_ibfk_1`; -- ALTER TABLE `mos_correcciones` ADD CONSTRAINT `mos_correcciones_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_personal` DROP FOREIGN KEY `mos_personal_ibfk_1`; -- ALTER TABLE `mos_personal` ADD CONSTRAINT `mos_personal_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_documentos_estrorg_arbolproc` DROP FOREIGN KEY `mos_documentos_estrorg_arbolproc_ibfk_1`; -- ALTER TABLE `mos_documentos_estrorg_arbolproc` ADD CONSTRAINT `mos_documentos_estrorg_arbolproc_ibfk_1` FOREIGN KEY (`id_organizacion_proceso`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_arbol_procesos` DROP FOREIGN KEY `mos_arbol_procesos_ibfk_1`; -- ALTER TABLE `mos_arbol_procesos` ADD CONSTRAINT `mos_arbol_procesos_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_cargo_estrorg_arbolproc` DROP FOREIGN KEY `mos_cargo_estrorg_arbolproc_ibfk_2`; -- ALTER TABLE `mos_cargo_estrorg_arbolproc` ADD CONSTRAINT `mos_cargo_estrorg_arbolproc_ibfk_2` FOREIGN KEY (`id`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; ALTER TABLE `mos_documentos_codigo` DROP FOREIGN KEY `mos_documentos_codigo_ibfk_1`; -- ALTER TABLE `mos_documentos_codigo` ADD CONSTRAINT `mos_documentos_codigo_ibfk_1` FOREIGN KEY (`id_organizacion`) REFERENCES `mos_organizacion` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; DELETE from mos_documentos_codigo; -- WHERE id_organizacion not IN (select id from mos_organizacion); ALTER TABLE `mos_documentos_codigo` AUTO_INCREMENT=1; insert into mos_documentos_codigo(id_organizacion,codigo,bloqueo_codigo,bloqueo_version,correlativo) select o.id, concat( IFNULL(concat(UPPER(SUBSTR(p4.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p3.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p2.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(p1.title, 1, 3)),'_'),''), IFNULL(concat(UPPER(SUBSTR(padre.title, 1, 3)),'_'),''), UPPER(SUBSTR(o.title, 1, 3)) ) codigo, 'S', 'S', IFNULL(d.total+1,1) from mos_organizacion o inner join mos_organizacion padre on padre.id = o.parent_id left join mos_organizacion p1 on p1.id = padre.parent_id left join mos_organizacion p2 on p2.id = p1.parent_id left join mos_organizacion p3 on p3.id = p2.parent_id left join mos_organizacion p4 on p4.id = p3.parent_id left join ( select da.id_organizacion_proceso, COUNT(DISTINCT d.IDDoc) total from mos_documentos_estrorg_arbolproc da INNER JOIN mos_documentos d on d.IDDoc = da.IDDoc GROUP BY da.id_organizacion_proceso ) as d on d.id_organizacion_proceso = o.id; DROP TRIGGER IF EXISTS `actualizar_nombre_area_ao`; DROP TRIGGER IF EXISTS `permisos_perfil_usuarios`; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area_ao` BEFORE INSERT ON `mos_organizacion` FOR EACH ROW Begin SET NEW.title = (SELECT title FROM mos_organizacion_nombres WHERE id = NEW.ID); /*SET padre = (SELECT parent_id FROM mos_organizacion WHERE id = NEW.id) insert into mos_documentos_codigo (id_organizacion, codigo) select NEW.id, codigo from mos_documentos_codigo where id_organizacion =NEW.parent_id; */ END; ;; DELIMITER ; DELIMITER ;; CREATE TRIGGER `permisos_perfil_usuarios` AFTER INSERT ON `mos_organizacion` FOR EACH ROW begin IF NEW.id NOT IN ( SELECT id_estructura FROM mos_usuario_estructura WHERE id_estructura = NEW.id) THEN INSERT into mos_usuario_estructura(id_usuario_filial,id_estructura, id_usuario,cod_perfil,portal) select id_usuario_filial,NEW.id,id_usuario,cod_perfil,portal from mos_usuario_estructura where id_estructura = NEW.parent_id; END IF; end; ;; DELIMITER ; DROP TRIGGER `actualizar_nombre_area_ins`; DROP TRIGGER `actualizar_nombre_area`; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area_ins` AFTER INSERT ON `mos_organizacion_nombres` FOR EACH ROW begin DECLARE padre INT; UPDATE mos_organizacion SET title = NEW.title WHERE id = NEW.id; IF NEW.id NOT IN ( SELECT id_organizacion FROM mos_documentos_codigo WHERE id_organizacion = NEW.id) THEN SET padre = (SELECT parent_id FROM mos_organizacion WHERE id = NEW.id); insert into mos_documentos_codigo (id_organizacion, codigo) select NEW.id, codigo from mos_documentos_codigo where id_organizacion =padre; END IF; end; ;; DELIMITER ; DELIMITER ;; CREATE TRIGGER `actualizar_nombre_area` BEFORE UPDATE ON `mos_organizacion_nombres` FOR EACH ROW begin UPDATE mos_organizacion SET title = NEW.title, area_espejo = NEW.area_espejo WHERE id = NEW.id; IF (NEW.title <> OLD.title) AND OLD.title = 'New Node' THEN UPDATE mos_documentos_codigo SET codigo = CONCAT(codigo,'_', UPPER(SUBSTR(NEW.title, 1, 3))) WHERE id_organizacion = NEW.id; END IF; end; ;; /*FIN ERROR*/ /*Ejecutar solo en mosaikus_admin*/ DROP VIEW IF EXISTS `mos_admin_usuarios`; CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `mos_admin_usuarios` AS select `santateresa`.`mos_usuario`.`email` AS `email`,`santateresa`.`mos_usuario`.`password_1` AS `password_1`,concat(`santateresa`.`mos_usuario`.`nombres`,' ',`santateresa`.`mos_usuario`.`apellido_paterno`) AS `nombres`,11 AS `id_empresa`,`santateresa`.`mos_usuario`.`id_usuario` AS `id_usuario` from `santateresa`.`mos_usuario`; /* fin */ /*ejecutado en BD desarrollo*/ INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id', 'id', '25', 'id'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('descripcion', 'Descripción', '25', 'descripcion'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ( 'tipo_inspeccion', 'Plantilla de Inspección', '25', 'tipo_inspeccion'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ( 'fecha', 'Fecha', '25', 'fecha'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ( 'id_responsable', 'Responsable', '25', 'id_responsable'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ( 'id_organizacion', 'Árbol Organizacional', '25', 'id_organizacion'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ( 'id_proceso', 'Árbol de Procesos', '25', 'id_proceso'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('ubicacion', 'Ubicación', '25', 'ubicacion'); INSERT INTO `mos_link` (`descripcion`, `nombre_link`) VALUES ('Parametros-indexParametrosInspecciones-clases.parametros.Parametros', 'Parametros de Inspecciones'); UPDATE `mos_link` SET `dependencia`='83' WHERE (`cod_link`='0'); UPDATE `mos_link` SET `cod_link`='86' WHERE (`cod_link`='0'); /*FIN EJECUTADO BD Desarrollo*/ /* LISTA de Distribucion 07/06/2016*/ INSERT INTO `mos_link` (`cod_link`, `nombre_link`, `dependencia`, `tipo`, `orden`) VALUES ('91', 'Lista de Distribución', '3', '2', '59'); UPDATE `mos_link` SET `descripcion`='ListaDistribucionDoc-indexListaDistribucionDoc-clases.lista_distribucion_doc.ListaDistribucionDoc' WHERE (`cod_link`='91'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id', 'id', '27', 'id'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('estado', 'Estado Lista de Distribución', '27', 'estado'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id_documento', 'Documento', '27', 'id_documento'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('fecha_notificacion', 'fecha_notificacion', '27', 'fecha_notificacion'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('fecha_ejecutada', 'Fecha de Ejecución', '27', 'dd/mm/yyyy'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id_responsable', 'Responsable', '27', 'id_responsable'); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('evidencias', 'Evidencias', '27', null); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id_area', 'Árbol Organizacional', '27', null); INSERT INTO `mos_nombres_campos`(`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('id_cargo', 'Cargos', '27', null); DROP TABLE IF EXISTS `mos_documentos_distribucion`; CREATE TABLE `mos_documentos_distribucion` ( `id` int(11) NOT NULL AUTO_INCREMENT, `estado` varchar(50) DEFAULT 'Pendiente' COMMENT 'Pendiente\r\nCompletado', `id_documento` int(11) DEFAULT NULL, `fecha_notificacion` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `fecha_ejecutada` date DEFAULT NULL, `id_responsable` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_documento` (`id_documento`), KEY `id_responsable` (`id_responsable`), CONSTRAINT `mos_documentos_distribucion_ibfk_1` FOREIGN KEY (`id_documento`) REFERENCES `mos_documentos` (`IDDoc`) ON UPDATE CASCADE, CONSTRAINT `mos_documentos_distribucion_ibfk_2` FOREIGN KEY (`id_responsable`) REFERENCES `mos_personal` (`cod_emp`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of mos_documentos_distribucion -- ---------------------------- -- ---------------------------- -- Table structure for `mos_documentos_distribucion_area` -- ---------------------------- DROP TABLE IF EXISTS `mos_documentos_distribucion_area`; CREATE TABLE `mos_documentos_distribucion_area` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_doc_distribucion` int(11) DEFAULT NULL, `id_cargo` int(11) DEFAULT NULL, `id_area` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_doc_distribucion` (`id_doc_distribucion`), KEY `id_cargo` (`id_cargo`), KEY `id_area` (`id_area`), CONSTRAINT `mos_documentos_distribucion_area_ibfk_1` FOREIGN KEY (`id_doc_distribucion`) REFERENCES `mos_documentos_distribucion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `mos_documentos_distribucion_area_ibfk_3` FOREIGN KEY (`id_cargo`) REFERENCES `mos_cargo` (`cod_cargo`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of mos_documentos_distribucion_area -- ---------------------------- -- ---------------------------- -- Table structure for `mos_documentos_distribucion_evi` -- ---------------------------- DROP TABLE IF EXISTS `mos_documentos_distribucion_evi`; CREATE TABLE `mos_documentos_distribucion_evi` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fk_id_doc_distribucion` int(11) DEFAULT NULL, `nomb_archivo` varchar(250) DEFAULT NULL, `archivo` longblob, `contenttype` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_id_trazabilidad` (`fk_id_doc_distribucion`), CONSTRAINT `mos_documentos_distribucion_evi_ibfk_1` FOREIGN KEY (`fk_id_doc_distribucion`) REFERENCES `mos_documentos_distribucion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of mos_documentos_distribucion_evi -- ---------------------------- -- ---------------------------- -- Table structure for `mos_documentos_distribucion_per` -- ---------------------------- DROP TABLE IF EXISTS `mos_documentos_distribucion_per`; CREATE TABLE `mos_documentos_distribucion_per` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_doc_distribucion` int(11) DEFAULT NULL, `id_persona` int(11) DEFAULT NULL, `id_cargo` int(11) DEFAULT NULL, `id_area` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_doc_distribucion` (`id_doc_distribucion`), KEY `id_persona` (`id_persona`), KEY `id_cargo` (`id_cargo`), KEY `id_area` (`id_area`), CONSTRAINT `mos_documentos_distribucion_per_ibfk_1` FOREIGN KEY (`id_doc_distribucion`) REFERENCES `mos_documentos_distribucion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `mos_documentos_distribucion_per_ibfk_2` FOREIGN KEY (`id_persona`) REFERENCES `mos_personal` (`cod_emp`) ON UPDATE CASCADE, CONSTRAINT `mos_documentos_distribucion_per_ibfk_3` FOREIGN KEY (`id_cargo`) REFERENCES `mos_cargo` (`cod_cargo`) ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; delete from mos_historico_wf_documentos where IDDoc not in (select IDDoc from mos_documentos); ALTER TABLE `mos_historico_wf_documentos` ADD FOREIGN KEY (`IDDoc`) REFERENCES `mos_documentos` (`IDDoc`) ON DELETE CASCADE ON UPDATE CASCADE; DROP TRIGGER IF EXISTS `registra_mos_historico_wf_documentos`; DELIMITER ;; CREATE TRIGGER `registra_mos_historico_wf_documentos` AFTER INSERT ON `mos_documentos` FOR EACH ROW BEGIN /*guarda historico al insertar un doc*/ DECLARE etapa text; IF(NEW.id_workflow_documento is not null)THEN set etapa= (SELECT IFNULL(mos_nombres_campos.texto,'') FROM mos_nombres_campos WHERE mos_nombres_campos.modulo = 6 AND mos_nombres_campos.nombre_campo = NEW.etapa_workflow); INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,'Documento Creado',NEW.id_usuario_workflow); IF (NEW.estado_workflow is NOT NULL) THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; ELSE INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,'Documento Creado',NEW.id_usuario_workflow); END IF; END; ;; DELIMITER ; DROP TABLE IF EXISTS `mos_evidencias_temp`; CREATE TABLE `mos_evidencias_temp` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_md5` varchar(250) DEFAULT NULL, `nomb_archivo` varchar(250) DEFAULT NULL, `contenttype` varchar(50) DEFAULT NULL, `fecha` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `tok` int(11) DEFAULT NULL, `id_usuario` int(11) DEFAULT NULL, `estado` int(11) DEFAULT NULL COMMENT '0 => Sin Cambios\r\n1 => Nuevo\r\n2 => Editar\r\n3 => Eliminar', `clave_foranea` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; /*FIN LISTA DISTRIBUCION*/ /*TAMAÑO CONTENTTYPE*/ ALTER TABLE `mos_documentos_anexos` MODIFY COLUMN `contenttype` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `archivo`; ALTER TABLE `mos_evidencias_temp` MODIFY COLUMN `contenttype` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `nomb_archivo`; ALTER TABLE `mos_documentos_distribucion_evi` MODIFY COLUMN `contenttype` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `archivo`; /*FIN TAMAÑO*/ ALTER TABLE `mos_cargo` MODIFY COLUMN `cod_cargo` int(9) NOT NULL AUTO_INCREMENT FIRST ; /* CAMBIO 12/07/2016*/ ALTER TABLE `mos_registro` ADD PRIMARY KEY (`idRegistro`); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('tipo_documento', 'Tipo de Documento', '6'); ALTER TABLE `mos_documentos` ADD COLUMN `tipo_documento` int NULL DEFAULT 6 AFTER `requiere_lista_distribucion`; DROP TABLE IF EXISTS `mos_documentos_codigo_correlativo`; CREATE TABLE `mos_documentos_codigo_correlativo` ( `id_organizacion` int(11) DEFAULT NULL, `tipo` int(11) DEFAULT NULL, `correlativo` int(11) DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of mos_documentos_codigo_correlativo -- ---------------------------- -- ---------------------------- -- Table structure for `mos_documentos_tipos` -- ---------------------------- DROP TABLE IF EXISTS `mos_documentos_tipos`; CREATE TABLE `mos_documentos_tipos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `codigo` varchar(50) DEFAULT NULL, `descripcion` varchar(250) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; INSERT INTO `mos_documentos_tipos` VALUES ('1', 'FOR', 'Formularios'); INSERT INTO `mos_documentos_tipos` VALUES ('2', 'POL', 'Políticas '); INSERT INTO `mos_documentos_tipos` VALUES ('3', 'INT', 'Instructivos'); INSERT INTO `mos_documentos_tipos` VALUES ('4', 'MAN', 'Manual'); INSERT INTO `mos_documentos_tipos` VALUES ('5', 'HDS', 'Hojas de Seguridad'); INSERT INTO `mos_documentos_tipos` VALUES ('6', 'PRO', 'Procedimientos'); INSERT INTO `mos_documentos_tipos` VALUES ('7', 'STW', 'Standard Work'); INSERT INTO `mos_documentos_tipos` VALUES ('8', 'PAP', 'Paso a Paso'); -- Cambios nuevos para inspecciones INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('descripcion_larga', 'Descripción Larga', '22', 'Descripción Larga'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('responsable_desvio', 'Responsable de Ocurrencia', '15', 'Responsable de Ocurrencia'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('reportado_por', 'Reportado Pór', '15', 'Reportado Pór'); ALTER TABLE `mos_parametro_det` DROP PRIMARY KEY, ADD PRIMARY KEY (`cod_parametro_det`); ALTER TABLE `mos_parametro_det` DROP FOREIGN KEY `mos_parametro_det_ibfk_1`; ALTER TABLE `mos_parametro_det` DROP INDEX `Ind04`, DROP INDEX `Ind02`, DROP INDEX `Ind03`, DROP INDEX `Ind01`, DROP INDEX `Ind05`; ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `responsable_desvio` int NULL AFTER `fecha_cambia_estado`; ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `reportado_por` int NULL AFTER `responsable_desvio`; rename table mos_acciones_evidencia TO mos_acciones_trazabilidad; DROP TABLE IF EXISTS `mos_acciones_evidencia`; CREATE TABLE `mos_acciones_evidencia` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fk_id_trazabilidad` int(11) DEFAULT NULL, `nomb_archivo` varchar(250) DEFAULT NULL, `archivo` longblob, `contenttype` varchar(50) DEFAULT NULL, `fk_id_accion_c` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_id_trazabilidad` (`fk_id_trazabilidad`), KEY `fk_id_accion_c` (`fk_id_accion_c`), CONSTRAINT `mos_acciones_evidencia_ibfk_1` FOREIGN KEY (`fk_id_trazabilidad`) REFERENCES `mos_acciones_trazabilidad` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `mos_acciones_evidencia_ibfk_2` FOREIGN KEY (`fk_id_accion_c`) REFERENCES `mos_acciones_correctivas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; insert into mos_acciones_evidencia(fk_id_trazabilidad, nomb_archivo,archivo,contenttype) select id, nomb_archivo, archivo, contenttype from mos_acciones_trazabilidad where LENGTH(archivo) > 0; /* DROP TABLE IF EXISTS `mos_evidencias_temp`; CREATE TABLE `mos_evidencias_temp` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_md5` varchar(250) DEFAULT NULL, `nomb_archivo` varchar(250) DEFAULT NULL, `contenttype` varchar(50) DEFAULT NULL, `fecha` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `tok` int(11) DEFAULT NULL, `id_usuario` int(11) DEFAULT NULL, `estado` int(11) DEFAULT NULL COMMENT '0 => Sin Cambios\r\n1 => Nuevo\r\n2 => Editar\r\n3 => Eliminar', `clave_foranea` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; */ ALTER TABLE `mos_acciones_ac_co` ADD COLUMN `orden` int NULL AFTER `fecha_cambia_estado`; ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `estatus` varchar(100) NULL AFTER `reportado_por`; ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `id_usuario` int NULL AFTER `estatus`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('en_elaboracion', 'Borrador', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('en_buzon', 'En Buzón', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('sin_responsable_analisis', 'Sin Responsable de Analisis', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('sin_plan_accion', 'Sin Plan de Acción', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('implementacion_acciones', 'Implementación de Acciones', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('verificacion_eficacia', 'Verificación de Eficacia', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('cerrada_verificada', 'Cerrada y Verificada', '15'); INSERT INTO `mos_link` (`descripcion`, `nombre_link`, `dependencia`, `tipo`, `orden`) VALUES ('AccionesCorrectivas-indexAccionesCorrectivas-clases.acciones_correctivas.AccionesCorrectivas', 'Seguimiento de Acciones y Correcciones', '8', '2', '51'); UPDATE `mos_link` SET `cod_link`='93' WHERE (`cod_link`='0'); UPDATE `mos_link` SET `descripcion`='AccionesAC-indexAccionesAC-clases.acciones_ac.AccionesAC' WHERE (`cod_link`='93'); ALTER TABLE `mos_acciones_ac_co` ADD COLUMN `fecha_realizada_temp` date NULL COMMENT 'Guarda la fecha ejecutada de una accion de manera temporal, hasta que la misma sea aprobada' AFTER `orden`, ADD COLUMN `estatus_wf` varchar(50) NULL DEFAULT 'en_ejecucion' COMMENT 'borrador\r\nen_ejecucion\r\ncerrada_verificar\r\ncerrada_verificada' AFTER `fecha_realizada_temp`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('estatus_wf', 'Flujo de Trabajo', '16'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('en_ejecucion', 'En Ejecución', '16'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('cerrada_verificar', 'Cerrada por Verificar', '16'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('cerrada_verificada', 'Cerrada y Verificada', '16'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('accion_ejecutada', 'Acción Ejecutada', '16'); ALTER TABLE `mos_acciones_trazabilidad` DROP COLUMN `archivo`, DROP COLUMN `contenttype`, MODIFY COLUMN `fecha_evi` timestamp NULL DEFAULT NULL AFTER `id_accion`; ALTER TABLE `mos_acciones_trazabilidad` DROP COLUMN `nomb_archivo`, ADD COLUMN `tipo` varchar(25) NULL COMMENT 'Avance\r\nCierre' AFTER `id_accion`; update mos_acciones_trazabilidad set tipo = 'Avance'; DELETE from mos_nombres_campos where modulo = 17; UPDATE `mos_link` SET `nombre_link`='Ocurrencias' WHERE (`cod_link`='8'); UPDATE `mos_link` SET `nombre_link`='Administrador de Ocurrencias con Plan de Acción' WHERE (`cod_link`='50'); UPDATE `mos_link` SET `nombre_link`='Administrador de Ocurrencias con Correcciones' WHERE (`cod_link`='77'); UPDATE `mos_link` SET `nombre_link`='Seguimiento de Acciones Correctivas' WHERE (`cod_link`='93'); UPDATE `mos_nombres_campos` SET `texto`='Fecha Comprometida' WHERE (`nombre_campo`='fecha_acordada' and modulo = 16); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('anexos', 'Anexos', '15'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('validador_accion', 'Validador', '16'); UPDATE `mos_link` SET `orden`='50' WHERE (`cod_link`='77'); UPDATE `mos_link` SET `nombre_link`='Reportes de Ocurrencias con Plan de Acción', `orden`='52' WHERE (`cod_link`='52'); UPDATE `mos_link` SET `nombre_link`='Configuración', `orden`='53' WHERE (`cod_link`='51'); UPDATE `mos_link` SET `dependencia`='51' WHERE (`cod_link`='78'); UPDATE `mos_link` SET `dependencia`='51' WHERE (`cod_link`='79'); DROP TRIGGER IF EXISTS `colocar_estatus_de_ac`; DELIMITER ;; CREATE TRIGGER `colocar_estatus_de_ac` BEFORE INSERT ON `mos_acciones_correctivas` FOR EACH ROW BEGIN IF (NEW.estatus IS NULL) THEN IF NOT (NEW.responsable_analisis IS NULL) THEN SET NEW.estatus = 'sin_plan_accion'; ELSEIF NOT (NEW.responsable_desvio IS NULL) THEN SET NEW.estatus = 'sin_responsable_analisis'; ELSE SET NEW.estatus = 'en_buzon'; END IF; END IF; END ;; DELIMITER ; DROP TRIGGER IF EXISTS `validar_verificacion_acciones`; DELIMITER ;; CREATE TRIGGER `validar_verificacion_acciones` BEFORE UPDATE ON `mos_acciones_correctivas` FOR EACH ROW BEGIN DECLARE contador INT; DECLARE edo varchar(30); IF NOT (NEW.fecha_acordada IS NULL) THEN SET contador = (select count(*) from mos_acciones_ac_co where id_ac = NEW.id and fecha_realizada is null); IF (contador > 0) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '- Existen acciones por cerrar, no se puede planificar la verificacion mientras esten acciones abiertas'; END IF; /*VALIDAMOS QUE LA FECHA REALIZADA SEA MENOR O IGUAL AL DIA DE HOY*/ IF (NEW.fecha_realizada is not null)THEN IF (DATEDIFF(NEW.fecha_realizada,NOW())<=0)THEN /*CALCULAMOS EL ESTADO DE LA ACCION CUANDO TIENE FECHA REALIZADA*/ SET edo = (case when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)<0 then 3 when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)>=0 then 4 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); SET NEW.estatus = 'cerrada_verificada'; ELSE set edo=-1; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '- La fecha realizada no puede ser mayor a la fecha de hoy'; END IF; ELSE SET edo = (case when DATEDIFF(NEW.fecha_acordada,NOW())<0 then 1 else 2 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); SET NEW.estatus = 'verificacion_eficacia'; END IF; ELSE SET NEW.fecha_realizada = NULL; SET NEW.id_responsable_segui = NULL; IF (NEW.estatus IS NULL) THEN IF NOT (NEW.responsable_analisis IS NULL) THEN SET NEW.estatus = 'sin_plan_accion'; ELSEIF NOT (NEW.responsable_desvio IS NULL) THEN SET NEW.estatus = 'sin_responsable_analisis'; ELSE SET NEW.estatus = 'en_buzon'; END IF; -- ELSE -- SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = NEW.estatus; END IF; END IF; END ;; DELIMITER ; DROP TRIGGER IF EXISTS `modifica_estado_acciones_ins`; DELIMITER ;; CREATE TRIGGER `modifica_estado_acciones_ins` BEFORE INSERT ON `mos_acciones_ac_co` FOR EACH ROW BEGIN DECLARE edo varchar(30); DECLARE peso int; /*VALIDAMOS QUE LA FECHA REALIZADA SEA MENOR O IGUAL AL DIA DE HOY*/ IF (NEW.fecha_realizada is not null)THEN IF (DATEDIFF(NEW.fecha_realizada,NOW())<=0)THEN /*CALCULAMOS EL ESTADO DE LA ACCION CUANDO TIENE FECHA REALIZADA*/ SET edo = (case when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)<0 then 3 when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)>=0 then 4 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); ELSE set edo=-1; SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '- La fecha realizada no puede ser mayor a la fecha de hoy'; END IF; ELSE SET edo = (case when DATEDIFF(NEW.fecha_acordada,NOW())<0 then 1 else 2 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); END IF; end ;; DELIMITER ; DROP TRIGGER IF EXISTS `modificar_estado_ac_ins`; DELIMITER ;; CREATE TRIGGER `modificar_estado_ac_ins` AFTER INSERT ON `mos_acciones_ac_co` FOR EACH ROW BEGIN DECLARE contador INT; /*PARA ACCIONES CORRECTIVAS*/ IF(NEW.id_ac is not null)THEN SET contador = (select MIN(estado) from mos_acciones_ac_co where id_ac = NEW.id_ac); UPDATE mos_acciones_correctivas SET estado = contador,fecha_cambia_estado= now() WHERE id = NEW.id_ac and mos_acciones_correctivas.fecha_realizada is null; END IF; /*PARA CORRECCIONES*/ IF(NEW.id_correcion is not null) THEN SET contador = (select MIN(estado) from mos_acciones_ac_co where id_correcion = NEW.id_correcion); UPDATE mos_correcciones SET estado = contador, fecha_cambia_estado= now() WHERE id = NEW.id_correcion; END IF; END ;; DELIMITER ; DROP TRIGGER IF EXISTS `modifica_estado_acciones_upd`; DELIMITER ;; CREATE TRIGGER `modifica_estado_acciones_upd` BEFORE UPDATE ON `mos_acciones_ac_co` FOR EACH ROW BEGIN DECLARE edo varchar(30); DECLARE edo_correcion_ant varchar(30); DECLARE id_accion_correctiva int; DECLARE peso int; DECLARE peso2 int; set peso=0; /*VALIDAMOS QUE LA FECHA REALIZADA SEA MENOR O IGUAL AL DIA DE HOY*/ IF (NEW.fecha_realizada is not null)THEN IF (DATEDIFF(NEW.fecha_realizada,NOW())<=0)THEN /*CALCULAMOS EL ESTADO DE LA ACCION CUANDO TIENE FECHA REALIZADA*/ SET edo = (case when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)<0 then 3 when DATEDIFF(NEW.fecha_acordada,NEW.fecha_realizada)>=0 then 4 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); ELSE SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = '- La fecha realizada no puede ser mayor a la fecha de hoy'; END IF; ELSE SET edo = (case when DATEDIFF(NEW.fecha_acordada,NOW())<0 then 1 else 2 end); SET NEW.estado= edo; SET NEW.fecha_cambia_estado= now(); END IF; end ;; DELIMITER ; DROP TRIGGER IF EXISTS `modificar_estado_ac`; DELIMITER ;; CREATE TRIGGER `modificar_estado_ac` AFTER UPDATE ON `mos_acciones_ac_co` FOR EACH ROW BEGIN DECLARE contador INT; IF(NEW.id_ac is not null)THEN SET contador = (select MIN(estado) from mos_acciones_ac_co where id_ac = NEW.id_ac); UPDATE mos_acciones_correctivas SET estado = contador, fecha_cambia_estado= now() WHERE id = NEW.id_ac and mos_acciones_correctivas.fecha_realizada is null; END IF; /*PARA CORRECCIONES*/ IF(NEW.id_correcion is not null) THEN SET contador = (select MIN(estado) from mos_acciones_ac_co where id_correcion = NEW.id_correcion); UPDATE mos_correcciones SET estado = contador , fecha_cambia_estado= now() WHERE id = NEW.id_correcion; END IF; END ;; DELIMITER ; /*NUEVOS AJUSTES ACCIONES CORRECTIVAS*/ ALTER TABLE `mos_acciones_correctivas` MODIFY COLUMN `estado` int(11) NULL DEFAULT 2 AFTER `alto_potencial`; ALTER TABLE `mos_acciones_ac_co` ADD COLUMN `id_validador` int NULL AFTER `fecha_realizada_temp`; ALTER TABLE `mos_acciones_ac_co` ADD COLUMN `id_usuario_wf` int NULL AFTER `estatus_wf`, ADD COLUMN `fecha_estado_wf` datetime NULL AFTER `id_usuario_wf`; ALTER TABLE `mos_acciones_ac_co` ADD COLUMN `observacion_rechazo` text NULL AFTER `estatus_wf`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`) VALUES ('rechazado', 'Rechazado', '16'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `id_idioma`) VALUES ('rechazado', 'Rejeitados', '16', '2'); ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `desc_verificacion` text NULL AFTER `id_usuario`; ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `fecha_realizada_temp` date NULL COMMENT 'Guarda la fecha ejecutada de verifiacion de forma temporal' AFTER `fecha_realizada`; ALTER TABLE `mos_acciones_evidencia` ADD COLUMN `fk_id_accion_c_ver` int NULL AFTER `fk_id_accion_c`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('desc_verificacion', 'Observación', '15', 'Observación'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`, `id_idioma`) VALUES ('desc_verificacion', 'Observação', '15', 'Observação', '2'); ALTER TABLE `mos_acciones_correctivas` ADD COLUMN `descripcion_val` text NULL COMMENT 'Descripcion Final de La Ocurrencia' AFTER `descripcion`, ADD COLUMN `alto_potencial_val` varchar(2) NULL COMMENT 'Validación de Alto Potencial' AFTER `alto_potencial`; INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('descripcion_val', 'Descripción Final', '15', 'Descripción Final'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`, `id_idioma`) VALUES ('descripcion_val', 'Descrição Final', '15', 'Descrição Final',2); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`) VALUES ('alto_potencial_val', 'Verificación de Alto Potencial', '15', 'Alto Potencial'); INSERT INTO `mos_nombres_campos` (`nombre_campo`, `texto`, `modulo`, `placeholder`, `id_idioma`) VALUES ('alto_potencial_val', 'Verificación de Alto Potencial', '15', 'Alto Potencial',2); /*CAMBIO EN TRIGGER CREAR/MODIFICAR DOCUMENTO PARA CORREGIR ERROR DE IDIOMA*/ DELIMITER ; DROP TRIGGER IF EXISTS `registra_mos_historico_wf_documentos`; DELIMITER ;; CREATE TRIGGER `registra_mos_historico_wf_documentos` AFTER INSERT ON `mos_documentos` FOR EACH ROW BEGIN /*guarda historico al insertar un doc*/ DECLARE etapa text; IF(NEW.id_workflow_documento is not null)THEN set etapa= (SELECT IFNULL(mos_nombres_campos.texto,'') FROM mos_nombres_campos WHERE mos_nombres_campos.modulo = 6 AND mos_nombres_campos.nombre_campo = NEW.etapa_workflow AND mos_nombres_campos.id_idioma = (select id_idioma from mos_usuario where id_usuario = NEW.id_usuario_workflow)); INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,'Documento Creado',NEW.id_usuario_workflow); IF (NEW.estado_workflow is NOT NULL) THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; ELSE INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,'Documento Creado',NEW.id_usuario_workflow); END IF; END ;; DELIMITER ; DROP TRIGGER IF EXISTS `registra_mos_historico_wf_documentos_cambio`; DELIMITER ;; CREATE TRIGGER `registra_mos_historico_wf_documentos_cambio` BEFORE UPDATE ON `mos_documentos` FOR EACH ROW BEGIN /*guarda historico al modificar un doc si cambian los datos del wf*/ DECLARE etapa text; set etapa= (SELECT IFNULL(mos_nombres_campos.texto,'') FROM mos_nombres_campos WHERE mos_nombres_campos.modulo = 6 AND mos_nombres_campos.nombre_campo = NEW.etapa_workflow AND mos_nombres_campos.id_idioma = (select id_idioma from mos_usuario where id_usuario = NEW.id_usuario_workflow)); IF((NEW.etapa_workflow<>OLD.etapa_workflow) or (NEW.estado_workflow<>OLD.estado_workflow)) THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; IF(OLD.etapa_workflow is Null and NEW.etapa_workflow<>'') THEN INSERT into mos_historico_wf_documentos (IDDoc,descripcion_operacion,id_usuario) VALUES (NEW.IDDoc,CONCAT('ESTADO:',NEW.estado_workflow,' ',IFNULL(NEW.observacion_rechazo,''),',cambió a ',etapa),NEW.id_usuario_workflow); END IF; END ;; DELIMITER ; /*FIN*/ /**/ -- 30-08-2016 Ajuste en codigos sugerido por el Sistema ALTER TABLE `mos_documentos_codigo` ADD COLUMN `activo` varchar(1) NULL DEFAULT 'N' AFTER `correlativo`; INSERT INTO mos_nombres_campos (nombre_campo,texto,modulo,placeholder,id_idioma) VALUES ( 'activo', 'Vigente', '26','Vigente',1); INSERT INTO mos_nombres_campos (nombre_campo,texto,modulo,placeholder,id_idioma) VALUES ( 'activo', 'Validade', '26','Validade',2); UPDATE `mos_nombres_campos` SET `texto`='Se' WHERE (`modulo`='100' and nombre_campo = 'si'); UPDATE `mos_nombres_campos` SET `texto`='Não' WHERE (`modulo`='100' and nombre_campo = 'no'); UPDATE `mos_nombres_campos` SET `texto`='Recibe Notificaciones de Correo Electrónico' WHERE (`modulo`='21' and nombre_campo = 'recibe_notificaciones'); UPDATE `mos_nombres_campos` SET `texto`='Email', `placeholder`='Email' WHERE (`modulo`='21' and nombre_campo = 'email'); UPDATE `mos_nombres_link_idiomas` SET `nombre_link`='Gestor de Formulários' WHERE (`cod_link`='87') AND (`id_idioma`='2'); UPDATE `mos_nombres_link_portal_idiomas` SET `nombre_link`='Mestre de Documentos' WHERE (`cod_link`='14') AND (`id_idioma`='2'); UPDATE `mos_nombres_link_portal_idiomas` SET `nombre_link`='Mestre de Registros' WHERE (`cod_link`='16') AND (`id_idioma`='2');
true
4be10fe75c9ad92a54dfa649ba1dfeac8f848dc4
SQL
KizatovArman/Databases2018
/finalprep.sql
UTF-8
4,002
4.71875
5
[]
no_license
--qiuz 1 CREATE TABLE manufacturers( code SERIAL PRIMARY KEY, name VARCHAR(255) ); CREATE TABLE products( code SERIAL PRIMARY KEY, name VARCHAR(255), price NUMERIC, manufacturer integer REFERENCES manufacturers ); SELECT name FROM products; SELECT name,price FROM products; SELECT name FROM products WHERE price<=200; SELECT * FROM products WHERE price >=60 AND price <=120; SELECT name,price FROM products WHERE price >180 ORDER BY price DESC, name ASC; SELECT avg(price), manufacturer FROM products GROUP BY manufacturer; SELECT manufacturer,avg(price) FROM products GROUP BY manufacturer HAVING avg(price)>=150; SELECT name,price FROM products ORDER BY price ASC LIMIT 1 NULLS LAST; INSERT INTO products (name,price,manufacturer) VALUES('loudspeakes',70,2); UPDATE products SET name = 'Laser Printer' WHERE code = 8; UPDATE products SET price = 0.9*price; UPDATE products SET price = 0.9*price WHERE price >=120; --quiz 1.2 CREATE IS THE SAME SELECT DISTINCT ON(manufacturer) name FROM products; SELECT code, manufacturer FROM products LIMIT 3; SAME SELECT * FROM products WHERE manufacturer IN (SELECT code FROM manufacturers WHERE name = 'Sony'); SELECT name, price FROM products WHERE price >=110 ORDER BY price ASC, manufacturer DESC NULLS LAST; SELECT count(price), manufacturer FROM products GROUP BY manufacturer; DELETE FROM manufacturers WHERE code IN(SELECT manufacturer FROM products GROUP BY manufacturer HAVING count(*)<1); UPDATE products SET price = price +10 WHERE code IN(SELECT code FROM products ORDER BY price ASC LIMIT 1 OFFSET 2); ALTER TABLE products ALTER COLUMN price SET DEFAULT 0; UPDATE products SET price = 0.8*price WHERE manufacturer IN(SELECT code FROM manufacturers WHERE name = 'Fujitsu'); -- mid1 --creatE tableS SELECT DISTINCT ON(genre) name FROM Movies; SELECT name FROM Movies ORDER BY rating DESC NULLS LAST LIMIT 3; SELECT * from theaters ORDER BY size DESC LIMIT 1 OFFSET 2; SELECT * FROM Movies WHERE rating IS NULL; SELECT * FROM theaters WHERE (city = 'ALmaty' OR city = 'Shymkent') AND size >7; SELECT id as MovieId,format('The genre of %s is %s', genre,title) AS MovieInfo; --CREATE TABLE SELECT name FROM theaters WHERE id NOT IN (SELECT theater_id FROM movietheaters); SELECT name,rating CASE WHEN rating>0 and rating <3 then 'Low Rating' WHEN rating >3 and rating<7 then 'Medium Rating' WHEN rating >7 and rating <8 then 'High Rating' else 'No Rating' END FROM Movies; DELETE from Movies WHERE id NOT IN(SELECT movie_id FROM movietheaters); SELECT * FROM Movies WHERE name LIKE 'T_e&n'; SELECT avg(rating),genre FROM Movies GROUP BY genre; select * from theaters WHERE id IN (SELECT theater_id from movietheaters GROUP BY theater_id HAVING count(*)>1); --MID 2 --SAME TABLE AS PREVIOUS SELECT DISTINCT ON(city)name FROM theaters; SELECT id as MovieId, CASE WHEN rating>0 and rating<=3 then format('The rating of %s is low', title) WHEN rating>3 and rating<=7 then format('The rating of %s is medium', title) WHEN rating>7 and rating<=10 then format('The rating of %s is high', title) else format('The %s has no rating', genre) END AS MoviesInfo FROM Movies; SELECT upper(title) from Movies; SELECT substring(title from 4 for char_length(title)-3) from Movies; SELECT char_length(title) FROM Movies; --quiz 2.1.1 --theory --we can create indexes to last 2 queries and not recommended to create for first SELECT h.name FROM highschooler h INNER JOIN friends f on h.id= f.id1 INNER JOIN highschooler h1 ON h1.id = f.id2 WHERE h.name = 'Gabriel' or h1.name = 'Gabriel'; SELECT h1.name,h1.grade,h2.namem h2.grade FROM highschooler h1 INNER JOIN Likes ON h1.id = Likes.id1 INNER JOIN highschooler h2 on h2.id = Likes.id2 WHERE (h1.grade - h2.grade)>=2; SELECT name,grade FROM highschooler WHERE ID IN(SELECT ID2 FROM Likes GROUP BY ID2 HAVING count(ID2)>=2); SELECT h.name FROM highschooler hkjasf
true
3a06e4e502fedd7c7fb0f151a90be684c4ee44d7
SQL
HThanhLam/Database-assignment
/Testing_Exam 1.sql
UTF-8
4,654
4.28125
4
[]
no_license
CREATE DATABASE db; use db; CREATE TABLE CUSTOMER ( CustomerID INT(8) PRIMARY KEY AUTO_INCREMENT, Name VARCHAR(30) NOT NULL, Phone INT(10) NOT NULL, Email VARCHAR(30) NOT NULL, Address VARCHAR(100) NOT NULL, Note VARCHAR(200) NOT NULL ); CREATE TABLE CAR( CarID INT(8) PRIMARY KEY AUTO_INCREMENT, Maker VARCHAR(10) NOT NULL, Model VARCHAR(30) NOT NULL, Year YEAR NOT NULL, Color VARCHAR (10) NOT NULL, Note VARCHAR(200) NOT NULL, CHECK (Maker='HONDA' OR Maker='TOYOTA' OR Maker='NISSAN') ); CREATE TABLE CAR_ORDER( OrderID INT(8) PRIMARY KEY AUTO_INCREMENT, CustomerID INT(8) NOT NULL, CarID INT(8) NOT NULL, Amount INT DEFAULT 1, SalePrice INT NOT NULL, OrderDate DATE NOT NULL, DeliveryDate DATE , DeliveryAddress VARCHAR(100) NOT NULL, Status TINYINT DEFAULT 0, Note VARCHAR(200) NOT NULL, CHECK (Status=0 OR Status=1 OR Status=2), CONSTRAINT CUSTI FOREIGN KEY (CustomerID) REFERENCES CUSTOMER(CustomerID), CONSTRAINT CAR_COS FOREIGN KEY (CarID) REFERENCES CAR(CarID) ); /*Viết lệnh lấy ra thông tin của khách hàng: tên, số lượng oto khách hàng đã mua và sắp sếp tăng dần theo số lượng oto đã mua.*/ SELECT cu.CustomerID,Name, Amount FROM CAR_ORDER co INNER JOIN CUSTOMER cu ON cu.CustomerID=co.CustomerID GROUP BY cu.CustomerID ORDER BY Amount ASC; /*Viết hàm (không có parameter) trả về tên hãng sản xuất đã bán được nhiều oto nhất trong năm nay.*/ DELIMITER // CREATE PROCEDURE B_BRAND (OUT B_NAME VARCHAR(10)) BEGIN SELECT Maker ## INTO B_NAME FROM CAR c INNER JOIN (SELECT * FROM CAR_ORDER a GROUP BY OrderID HAVING YEAR(OrderDate)=YEAR(CURRENT_DATE()) ORDER BY amount DESC LIMIT 1 ) co ON co.CarID=c.CarID; END; // DELIMITER ; DROP PROCEDURE B_BRAND; CALL B_BRAND (@B_NAME); /*Viết 1 thủ tục (không có parameter) để xóa các đơn hàng đã bị hủy của những năm trước. In ra số lượng bản ghi đã bị xóa.*/ DELIMITER // CREATE PROCEDURE DEL_CANCEL() BEGIN SELECT COUNT(OrderID) FROM CAR_ORDER WHERE status=2 AND YEAR(OrderDate)<YEAR(current_date()); DELETE FROM CAR_ORDER WHERE status=2 AND YEAR(OrderDate)<YEAR(current_date()); END; // DELIMITER ; DROP PROCEDURE DEL_CANCEL; SET SQL_SAFE_UPDATES = 0; CALL DEL_CANCEL; SELECT * FROM CAR_ORDER; /*Viết 1 thủ tục (có CustomerID parameter) để in ra thông tin của các đơn hàng đã đặt hàng bao gồm: tên của khách hàng, mã đơn hàng, số lượng oto và tên hãng sản xuất.*/ DELIMITER // CREATE PROCEDURE CUS_INFO (IN CUS_ID INT(8)) BEGIN SELECT NAME,OrderID,Maker,Amount FROM CAR_ORDER co INNER JOIN CUSTOMER cu ON cu.CustomerID=co.CustomerID AND cu.CustomerID=CUS_ID INNER JOIN CAR ca ON ca.CarID= co.CarID; END; // DELIMITER ; CALL CUS_INFO(2); /*Viết trigger để tránh trường hợp người dụng nhập thông tin không hợp lệ vào database (DeliveryDate < OrderDate + 15).*/ DELIMITER // CREATE TRIGGER VALID_DATE BEFORE INSERT ON CAR_ORDER FOR EACH ROW BEGIN WHILE (SELECT CarID FROM CAR_ORDER WHERE DeliveryDate < ADDDATE(OrderDate,15) LIMIT 1) IS NOT NULL DO DELETE FROM CAR_ORDER WHERE DeliveryDate < ADDDATE(OrderDate,15); END WHILE; END; // DELIMITER ; DROP TRIGGER VALID_DATE; INSERT INTO CUSTOMER (Name,Phone,Email,Address,Note) VALUES ('HAYONGYA',12032131,'HAYONGYANET@gmail.com','203 STREET 1023 ROAD 533','VALUES'), ('sakdjalw',04912965,'sakdjalw@gmail.com','513 STREET 125 ROAD 213','UNK'), ('1srha2',1235272,'1srha2@gmail.com','24214 STREET 521 ROAD 421','421'), ('y2regeq',12032131,'y2regeq@gmail.com','203 STREET 1023 ROAD 533','533'), ('srtrthr54',12032131,'srtrthr54@gmail.com','203 STREET 1023 ROAD 533','1023'); INSERT INTO CAR(Maker,Model,Year,Color,Note) VALUES ('NISSAN','20ek3',2020,'RED','GOOD'), ('HONDA','@%!@G',2019,'BLUE','GOOD'), ('TOYOTA','GSDNOE',2008,'BLACK','GOOD'), ('NISSAN','t13t',2010,'YELLOW','GOOD'), ('TOYOTA','gwagw43',2015,'WHITE','GOOD'); INSERT INTO CAR_ORDER(CustomerID,CarID,Amount,SalePrice,OrderDate,DeliveryDate,DeliveryAddress,Status,Note) VALUES (1,1,3,20000,'2020/12/20','2020/10/10','203 STREET 1023 ROAD 533',1,'NONE'), (2,2,1,15000,'2019/12/20','2020/10/10','513 STREET 125 ROAD 213',0,'NONE'), (3,5,2,20506,'2018/12/20','2020/10/10','203 STREET 1023 ROAD 533',2,'NONE'), (4,4,4,20012,'2019/12/20','2020/10/10','203 STREET 1023 ROAD 533',1,'NONE'), (5,2,2,10000,'2010/12/20','2020/10/10','203 STREET 1023 ROAD 533',2,'NONE')
true
2d8aacc8bc439099ef30728621e7f4deb25ff627
SQL
songzhilian/nbjj-internet
/sql/xgt_ydjw_sysuser.sql
GB18030
2,102
3.109375
3
[]
no_license
----------------------------------------------------- -- Export file for user YDJW_XGT -- -- Created by Administrator on 2021/02/03, 9:50:36 -- ----------------------------------------------------- spool xgt_ydjw_sysuser.log prompt prompt Creating table SYS_USER prompt ======================= prompt create table YDJW_XGT.SYS_USER ( YHDM VARCHAR2(32) not null, XM VARCHAR2(32), BMDM VARCHAR2(12) not null, SFZMHM VARCHAR2(18), MM VARCHAR2(40) not null, QSIP VARCHAR2(15), ZZIP VARCHAR2(15), SFMJ CHAR(1), SSMJ VARCHAR2(32), SFBD CHAR(1), ZT CHAR(1) not null, GXSJ DATE ) tablespace YDJW_DATA pctfree 10 initrans 1 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); comment on table YDJW_XGT.SYS_USER is 'ûϢ'; comment on column YDJW_XGT.SYS_USER.YHDM is 'ûPK'; comment on column YDJW_XGT.SYS_USER.XM is ''; comment on column YDJW_XGT.SYS_USER.BMDM is 'Ŵ'; comment on column YDJW_XGT.SYS_USER.SFZMHM is '֤ '; comment on column YDJW_XGT.SYS_USER.MM is ''; comment on column YDJW_XGT.SYS_USER.QSIP is 'ʼIP'; comment on column YDJW_XGT.SYS_USER.ZZIP is 'ֹIP'; comment on column YDJW_XGT.SYS_USER.SFMJ is 'Ƿ񾯣1-0-'; comment on column YDJW_XGT.SYS_USER.SSMJ is ''; comment on column YDJW_XGT.SYS_USER.SFBD is 'Ƿ'; comment on column YDJW_XGT.SYS_USER.ZT is '״̬0-Ч;1-Ч;2-'; comment on column YDJW_XGT.SYS_USER.GXSJ is 'ʱ'; alter table YDJW_XGT.SYS_USER add constraint PK_SYS_USER primary key (YHDM) using index tablespace YDJW_DATA pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); create index YDJW_XGT.I_SYS_USER_BMDM on YDJW_XGT.SYS_USER (BMDM) tablespace YDJW_DATA pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); spool off
true
9fa07a0a528cda4ef421f823f28e7ed4e1f15bf2
SQL
nizarrk/datamax
/query nomor 1.sql
UTF-8
6,408
3.015625
3
[ "MIT" ]
permissive
-- MySQL dump 10.13 Distrib 5.5.62, for Win64 (AMD64) -- -- Host: localhost Database: datamax -- ------------------------------------------------------ -- Server version 5.5.5-10.1.38-MariaDB /*!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 `categories` -- DROP TABLE IF EXISTS `categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `categories` ( `name` varchar(100) DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `categories` -- LOCK TABLES `categories` WRITE; /*!40000 ALTER TABLE `categories` DISABLE KEYS */; INSERT INTO `categories` VALUES ('Umum',NULL,1),('Handphone dan Aksesoris',NULL,2),('Baju dan Aksesoris',NULL,3),('Makanan dan Minuman',NULL,4),('Motor',NULL,5),('Aksesories',2,6),('Casing',2,7),('Samsung',2,8),('Kering',4,9),('Basah',4,10),('Honda',5,11),('Yamaha',5,12),('Suzuki',5,13),('Fashion Pria',3,14),('Fashion Wanita',3,15); /*!40000 ALTER TABLE `categories` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `product_images` -- DROP TABLE IF EXISTS `product_images`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `product_images` ( `id` int(11) NOT NULL AUTO_INCREMENT, `product_id` int(11) NOT NULL, `image` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `product_images` -- LOCK TABLES `product_images` WRITE; /*!40000 ALTER TABLE `product_images` DISABLE KEYS */; INSERT INTO `product_images` VALUES (1,1,'https://picsum.photos/200/300'),(2,1,'https://picsum.photos/200/300'),(3,1,'https://picsum.photos/200/300'),(4,2,'https://picsum.photos/200/300'),(5,2,'https://picsum.photos/200/300'),(6,3,'https://picsum.photos/200/300'),(7,4,'https://picsum.photos/200/300'),(8,4,'https://picsum.photos/200/300'),(9,5,'https://picsum.photos/200/300'),(10,5,'https://picsum.photos/200/300'),(11,5,'https://picsum.photos/200/300'),(12,6,'https://picsum.photos/200/300'),(13,6,'https://picsum.photos/200/300'),(14,7,'https://picsum.photos/200/300'),(15,8,'https://picsum.photos/200/300'),(16,8,'https://picsum.photos/200/300'),(17,8,'https://picsum.photos/200/300'),(18,8,'https://picsum.photos/200/300'),(19,8,'https://picsum.photos/200/300'),(20,12,'https://picsum.photos/200/300'),(21,12,'https://picsum.photos/200/300'); /*!40000 ALTER TABLE `product_images` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `products` -- DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `products` ( `name` varchar(100) DEFAULT NULL, `harga` int(11) DEFAULT NULL, `image` varchar(100) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `category_id` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `products` -- LOCK TABLES `products` WRITE; /*!40000 ALTER TABLE `products` DISABLE KEYS */; INSERT INTO `products` VALUES ('Bakso aci telur puyuh',95000,NULL,1,1,'10'),('Es Teler',34000,NULL,2,1,'10'),('Rice bowl ayam suwir scrambled eggs',12000,NULL,3,3,'9'),('Puding Strawberry',19000,NULL,4,4,'10'),('roti korea',50000,NULL,5,5,'9'),('RED Jelly',13000,NULL,6,6,'10'),('Biji Salak',35000,NULL,7,7,'9'),('Huawei',23000,NULL,8,8,'2'),('soto',15000,NULL,9,9,'10'),('Ciki',25000,NULL,10,10,'9'),('Donken frozen',24000,NULL,11,11,'9'),('Bebek goreng',35000,NULL,12,12,'9'),('Pudding Strawberry',55000,NULL,13,13,'10'),('Iphone 7',60000,NULL,14,14,'2'),('Seprei Home Made Anti Luntur ',85000,NULL,15,15,'1'); /*!40000 ALTER TABLE `products` ENABLE KEYS */; UNLOCK TABLES; -- -- 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` ( `uid` varchar(100) NOT NULL, `name` varchar(100) DEFAULT NULL, `id` int(11) NOT NULL AUTO_INCREMENT, `Column4` varchar(1024) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `users` -- LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES ('USEM000000001','John Stone',1,''),('USEM000000002','Ponnappa Priya',2,''),('USEM000000003','Mia Wong',3,''),('USEM000000004','Peter Stanbridge',4,''),('USEM000000005','Natalie Lee-Walsh',5,''),('USEM000000006','Ang Li',6,''),('USEM000000007','Nguta Ithya',7,''),('USEM000000008','Tamzyn French',8,''),('USEM000000009','Salome Simoes',9,''),('USEM000000010','Trevor Virtue',10,''),('USEM000000011','Tarryn Campbell-Gillies',11,''),('USEM000000012','Eugenia Anders',12,''),('USEM000000013','Andrew Kazantzis',13,''),('USEM000000014','Verona Blair',14,''),('USEM000000015','Jane Meldrum',15,''); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; -- -- Dumping routines for database 'datamax' -- /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-12-24 14:50:59
true
ec4cd02cf0991a542b610acaeeacc81fc270d1f0
SQL
applekey/LeetBros
/db/procs/uspIfUserExists.sql
UTF-8
385
3.390625
3
[]
no_license
DELIMITER $$ DROP PROCEDURE IF EXISTS uspIfUserExists; CREATE PROCEDURE uspIfUserExists ( IN pLogin NVARCHAR(50), IN pPassword NVARCHAR(50), OUT userExist BOOL) BEGIN IF EXISTS(select FirstName,LastName from user_tbl where LoginName = pLogin and PasswordHash = SHA1(pPassword) LIMIT 1) THEN SET userExist = 1; ELSE SET userExist = 0; END IF; END$$ DELIMITER ;
true
165812e5a0de949384186ce5d6712af915e66310
SQL
DavidBenko/gateway
/src/gateway/sql/static/ansi/proxy_endpoint_channels/insert.sql
UTF-8
555
2.765625
3
[ "Apache-2.0" ]
permissive
INSERT INTO proxy_endpoint_channels ( proxy_endpoint_id, remote_endpoint_id, name, created_at ) VALUES ( (SELECT proxy_endpoints.id FROM proxy_endpoints, apis WHERE proxy_endpoints.id = ? AND proxy_endpoints.api_id = ? AND proxy_endpoints.api_id = apis.id AND apis.account_id = ?), (SELECT remote_endpoints.id FROM remote_endpoints, apis WHERE remote_endpoints.id = ? AND remote_endpoints.api_id = ? AND remote_endpoints.api_id = apis.id AND apis.account_id = ?), ?, CURRENT_TIMESTAMP )
true
6723c56ecfff229086cc734d6310bebe8348b276
SQL
kuan0904/WabMaker
/WebMaker.Entity/SQL/View_CompetitionMember.sql
UTF-8
661
3.640625
4
[]
no_license
-- -- select * from View_CompetitionMember -- where ClientID='524dde74-fdef-481a-b9ed-49bab41f7964' and ItemID='16fae3b3-c1b8-46d8-bb81-14237aef232e' -- order by Unit -- SELECT u.TempNo, u.NickName AS Name, u.Gender, u.IdentityCard, u.Birthday, u.Unit, u.HouseholdAddress, (SELECT COUNT(*) AS Expr1 FROM dbo.erp_OrderDetailTeam AS dt WHERE (UserProfileID = u.ID)) AS ItemCount, o.ClientID, m.ID AS ItemID, u.ID AS UserProfileID, o.ID AS OrderID FROM dbo.mgt_UserProfile AS u INNER JOIN dbo.erp_Order AS o ON u.OrderID = o.ID INNER JOIN dbo.cms_Item AS m ON m.ID = o.ItemID WHERE (o.OrderStatus = 100)
true
c15a106e0ccc77a7ef5cb64476fa2a3a8809fc28
SQL
rudiiistarrr/swe2
/constraints.sql
UTF-8
1,224
2.84375
3
[]
no_license
ALTER TABLE Angebote ADD FOREIGN KEY (fk_KundenID) REFERENCES Kunden(ID); ALTER TABLE Ausgangsrechnung_Zeilen ADD FOREIGN KEY (fk_AusgangsrechnungID) REFERENCES Ausgangsrechnung(ID); ALTER TABLE Ausgangsrechnung_Zeilen ADD FOREIGN KEY (fk_AngebotID) REFERENCES Angebote(ID); ALTER TABLE Ausgangsrechnung ADD FOREIGN KEY (fk_KundenID) REFERENCES Kunden(ID); ALTER TABLE Eingangsrechnung ADD FOREIGN KEY (fk_KontaktID) REFERENCES Kontakte(ID); ALTER TABLE ProjekteAngebote ADD FOREIGN KEY (AngebotID) REFERENCES Angebote(ID); ALTER TABLE ProjekteAngebote ADD FOREIGN KEY (ProjektID) REFERENCES Projekte(ID); ALTER TABLE AusgangsrechnungBankkonto ADD FOREIGN KEY (BankkontoID) REFERENCES Bankkonto(ID); ALTER TABLE AusgangsrechnungBankkonto ADD FOREIGN KEY (AusgangsrechnungID) REFERENCES Ausgangsrechnung(ID); ALTER TABLE EingangsrechnungBankkonto ADD FOREIGN KEY (BankkontoID) REFERENCES Bankkonto(ID); ALTER TABLE EingangsrechnungBankkonto ADD FOREIGN KEY (EingangsrechnungID) REFERENCES Eingangsrechnung(ID); ALTER TABLE KategorieBankkonto ADD FOREIGN KEY (BankkontoID) REFERENCES Bankkonto(ID); ALTER TABLE KategorieBankkonto ADD FOREIGN KEY (KategorieID) REFERENCES Kategorie(ID);
true
2fa2231cd0862151f2edb4ca743255a063a7e353
SQL
shifuxiang/store-procedure
/order_error.sql
UTF-8
18,317
3.109375
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : 172.23.142.45 Source Server Version : 50173 Source Host : 172.23.142.45:3306 Source Database : AdInspect Target Server Type : MYSQL Target Server Version : 50173 File Encoding : 65001 Date: 2017-06-12 11:11:30 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `cinemainfo` -- ---------------------------- CREATE TABLE `cinemainfo` ( `id` int(11) NOT NULL AUTO_INCREMENT , `city` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `cinema_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `cinema_addr` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=2 ; -- ---------------------------- -- Table structure for `correct_show` -- ---------------------------- CREATE TABLE `correct_show` ( `id` int(11) NOT NULL AUTO_INCREMENT , `hallno` int(2) NULL DEFAULT NULL , `advert_id` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `create_time` datetime NULL DEFAULT NULL , `ad_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `inspect_order` int(11) NULL DEFAULT NULL , `imglen` int(11) NULL DEFAULT NULL , `Relative_starttime` int(11) NULL DEFAULT NULL , `inspect_start_time` datetime NULL DEFAULT NULL , `cinema_city` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `cinema_name` varchar(36) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `advert_back` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `advert_previous` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=230 ; -- ---------------------------- -- Table structure for `dragon` -- ---------------------------- CREATE TABLE `dragon` ( `id` int(5) NOT NULL AUTO_INCREMENT , `hallno` int(2) NULL DEFAULT NULL , `taskid` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `time` datetime NULL DEFAULT NULL , `status` int(2) NULL DEFAULT NULL , `creattime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=63 ; -- ---------------------------- -- Table structure for `features` -- ---------------------------- CREATE TABLE `features` ( `id` int(50) NOT NULL AUTO_INCREMENT , `uuid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `ad_fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `bmp_fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `filePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `fullFilePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `bmp_fullFilePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `picture_order` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `quantity` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `bmp_quantity` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=2474 ; -- ---------------------------- -- Table structure for `matchitem` -- ---------------------------- CREATE TABLE `matchitem` ( `id` int(10) NOT NULL AUTO_INCREMENT , `task_id` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `templet_uuid` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `inspect_order` int(4) NULL DEFAULT NULL , `inspect_ts` int(20) NULL DEFAULT NULL , `inspect_time` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `templet_order` int(4) NULL DEFAULT NULL , `templet_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `weight` float NULL DEFAULT NULL , `time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP , `inspect_featrue` int(10) NOT NULL DEFAULT 0 , `templet_featrue` int(10) NOT NULL DEFAULT 0 , `match_count` int(10) NOT NULL DEFAULT 0 , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=58723 ; -- ---------------------------- -- Table structure for `readymark` -- ---------------------------- CREATE TABLE `readymark` ( `id` int(11) NOT NULL AUTO_INCREMENT , `taskid` char(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `hallid` int(3) NOT NULL , `cpos` int(1) NOT NULL , `start` datetime NOT NULL , `end` datetime NOT NULL , `filefullpath` varchar(1024) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL , `status` int(2) UNSIGNED ZEROFILL NULL DEFAULT NULL , `isresult` int(1) NULL DEFAULT NULL , `existlongbiao` int(1) NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=2646 ; -- ---------------------------- -- Table structure for `suspicious_show` -- ---------------------------- CREATE TABLE `suspicious_show` ( `id` int(20) NOT NULL AUTO_INCREMENT , `task_id` varchar(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `adback` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `adprev` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `start` datetime NULL DEFAULT NULL , `end` datetime NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=93 ; -- ---------------------------- -- Table structure for `tasks` -- ---------------------------- CREATE TABLE `tasks` ( `id` int(50) NOT NULL AUTO_INCREMENT , `uuid` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `orig_fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `fileName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `filePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `fullFilePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `startDateTime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `endDateTime` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `hall_id` int(50) NULL DEFAULT NULL , `frameRate` int(50) NULL DEFAULT NULL , `frequency` int(50) NOT NULL , `type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `videoWidth` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `videoHeight` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `dstVideoWidth` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `dstVideoHeight` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , `realDuration` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `featureFilePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `ad_order` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , `description` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=299 ; -- ---------------------------- -- Table structure for `test` -- ---------------------------- CREATE TABLE `test` ( `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' , `advert_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `create_time` datetime NULL DEFAULT NULL , `displayName` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `modify_time` datetime NULL DEFAULT NULL , `sortIdx` bigint(20) NULL DEFAULT NULL , `status` int(11) NULL DEFAULT NULL , `version` int(11) NULL DEFAULT NULL , `allowIndex` int(11) NULL DEFAULT NULL , `everyOne` int(11) NULL DEFAULT NULL , `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `sec_lev` varchar(16) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `advert_back` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `advert_previous` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `cinema_city` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `cinema_name` varchar(36) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `videopath` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `compare_imgpath` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `hall_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `inspect_end_time` datetime NULL DEFAULT NULL , `inspect_order` int(11) NULL DEFAULT NULL , `inspect_start_time` datetime NULL DEFAULT NULL , `monitor_status` int(11) NULL DEFAULT NULL , `dwnstatus` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL , `imglen` int(11) NULL DEFAULT NULL , `playStatus` int(11) NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci ; -- ---------------------------- -- Table structure for `test2` -- ---------------------------- CREATE TABLE `test2` ( `id` int(11) NOT NULL AUTO_INCREMENT , `hallno` int(2) NULL DEFAULT NULL , `advert_id` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `crerate_time` datetime NULL DEFAULT NULL , `ad_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL , `inspect_order` int(11) NULL DEFAULT NULL , `inspect_start_time` datetime NULL DEFAULT NULL , `imglen` int(11) NULL DEFAULT NULL , PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci AUTO_INCREMENT=1 ; -- ---------------------------- -- Procedure structure for `order_error` -- ---------------------------- DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `order_error`(IN `duration` int) BEGIN #Routine body goes here... DECLARE correct_order INT DEFAULT 0; DECLARE correct_hallno INT DEFAULT 0; DECLARE correct_uuid VARCHAR(36); DECLARE correct_adprevious VARCHAR(64); DECLARE correct_adback VARCHAR(64); DECLARE correct_count INT DEFAULT 0; DECLARE correct_imglen INT DEFAULT 0; DECLARE correct_imgcount INT DEFAULT 0; DECLARE monitor_order INT DEFAULT 0; DECLARE monitor_hallno INT DEFAULT 0; DECLARE monitor_starttime DATETIME DEFAULT '0000-00-00 00:00:00'; DECLARE monitor_endtime DATETIME DEFAULT '0000-00-00 00:00:00'; DECLARE monitor_statu INT DEFAULT 0; DECLARE monitor_city VARCHAR(32); DECLARE monitor_cinemaname VARCHAR(36); DECLARE monitor_count INT DEFAULT 0; DECLARE monitor_ids VARCHAR(36); DECLARE monitor_id1 VARCHAR(255); DECLARE monitor_adid1 VARCHAR(36); DECLARE monitor_starttime1 DATETIME DEFAULT '0000-00-00 00:00:00'; DECLARE monitor_endtime1 DATETIME DEFAULT '0000-00-00 00:00:00'; DECLARE monitor_order1 INT DEFAULT 0; DECLARE dragon_hallno INT DEFAULT 0; DECLARE dragon_time DATETIME DEFAULT '0000-00-00 00:00:00'; DECLARE dragon_status INT DEFAULT 0; DECLARE cur1 CURSOR FOR SELECT inspect_order,inspect_start_time,inspect_end_time,hall_no,monitor_status,cinema_city,cinema_name,advert_id FROM oristarmr.app_monitor WHERE UNIX_TIMESTAMP(inspect_start_time) < UNIX_TIMESTAMP(dragon_time) AND UNIX_TIMESTAMP(inspect_start_time)>(UNIX_TIMESTAMP(dragon_time)-duration) AND hall_no=dragon_hallno AND monitor_status = 2; #DECLARE cur2 CURSOR FOR SELECT hallno,advert_id,inspect_order,advert_back,advert_previous FROM correct_show WHERE inspect_order = monitor_order #AND DATE_FORMAT(inspect_start_time, '%y-%m-%d') = DATE_FORMAT(dragon_time,'%y-%m-%d') AND hallno = dragon_hallno AND inspect_order = monitor_order; #DECLARE cur3 CURSOR FOR SELECT hallno,time FROM dragon ORDER BY id DESC LIMIT 1; SELECT hallno,time INTO dragon_hallno,dragon_time FROM dragon ORDER BY id DESC LIMIT 1; #SELECT * FROM dragon ORDER BY id DESC LIMIT 1; #OPEN cur3; #FETCH cur3 INTO dragon_hallno,dragon_time; OPEN cur1; /* SELECT COUNT(id) INTO monitor_count FROM oristarmr.app_monitor WHERE monitor_status = 2 AND UNIX_TIMESTAMP(inspect_start_time) > (UNIX_TIMESTAMP(dragon_time)-duration ); AND UNIX_TIMESTAMP(inspect_end_time) < UNIX_TIMESTAMP(dragon_time) AND hall_no = dragon_hallno;*/ SELECT COUNT(id) INTO monitor_count FROM oristarmr.app_monitor WHERE UNIX_TIMESTAMP(inspect_start_time) < UNIX_TIMESTAMP(dragon_time) AND UNIX_TIMESTAMP(inspect_start_time)>(UNIX_TIMESTAMP(dragon_time)-duration) AND hall_no=dragon_hallno AND monitor_status = 2; WHILE monitor_count != 0 DO FETCH cur1 INTO monitor_order,monitor_starttime,monitor_endtime,monitor_hallno,monitor_statu,monitor_city,monitor_cinemaname,monitor_ids; IF monitor_statu = 2 THEN #OPEN cur2; #在存储过程中使用触发器调用的话,绝对不能有返回结果的语句。否则再出发起调用存储过程时,存储过程无法执行 #SELECT * FROM correct_show WHERE advert_id = monitor_id AND DATE_FORMAT(inspect_start_time,'%y-%m-%d') = DATE_FORMAT(monitor_starttime,'%y-%m-%d'); SELECT hallno,advert_id,inspect_order,advert_back,advert_previous ,imglen INTO correct_hallno,correct_uuid,correct_order,correct_adback,correct_adprevious,correct_imglen FROM correct_show WHERE DATE_FORMAT(inspect_start_time, '%y-%m-%d') = DATE_FORMAT(dragon_time,'%y-%m-%d') AND hallno = dragon_hallno AND advert_id = monitor_ids; IF correct_order != 0 THEN SELECT id,advert_id,inspect_start_time, inspect_end_time INTO monitor_id1,monitor_adid1,monitor_starttime1,monitor_endtime1 FROM oristarmr.app_monitor WHERE UNIX_TIMESTAMP(inspect_start_time) < UNIX_TIMESTAMP(dragon_time) AND UNIX_TIMESTAMP(inspect_start_time)>(UNIX_TIMESTAMP(dragon_time)-duration) AND hall_no=dragon_hallno AND advert_id = correct_uuid;#AND inspect_order = correct_order; #SELECT inspect_start_time INTO monitor_starttime1 FROM oristarmr.app_monitor WHERE UNIX_TIMESTAMP(inspect_start_time) < UNIX_TIMESTAMP(dragon_time) #AND UNIX_TIMESTAMP(inspect_start_time)>(UNIX_TIMESTAMP(dragon_time)-duration) AND hall_no=dragon_hallno AND inspect_order = correct_order; #SELECT * FROM oristarmr.app_monitor WHERE UNIX_TIMESTAMP(inspect_start_time) < UNIX_TIMESTAMP(dragon_time) #AND UNIX_TIMESTAMP(inspect_start_time)>(UNIX_TIMESTAMP(dragon_time)-duration) AND hall_no=dragon_hallno AND inspect_order = correct_order; #INSERT INTO oristarmr.app_monitor (id,advert_id,create_time,advert_back,advert_previous,cinema_city,cinema_name,hall_no,inspect_end_time,inspect_order,inspect_start_time,monitor_status,data_division) #VALUES (REPLACE(UUID(),'-',''),correct_uuid,NOW(),correct_adback,correct_adprevious,monitor_city,monitor_cinemaname,correct_hallno,monitor_endtime1,correct_order,monitor_starttime1,1,1); #INSERT INTO oristarmr.app_monitor_rank(id,monitor_id,advert_id,create_time,advert_back,advert_previous,cinema_city,cinema_name,hall_no,inspect_end_time, #inspect_order,inspect_start_time,monitor_status,data_division) VALUES(REPLACE(UUID(),'-',''),monitor_id1,monitor_adid1,NOW(),correct_adback, #correct_adprevious,monitor_city,monitor_cinemaname,correct_hallno,monitor_endtime1,correct_order,monitor_starttime1,1,1); SELECT SUM(imglen) INTO correct_imgcount FROM correct_show WHERE hallno = correct_hallno AND inspect_order<= correct_order AND DATE_FORMAT(inspect_start_time,'%y-%m-%d') = DATE_FORMAT(dragon_time,'%y-%m-%d'); INSERT INTO oristarmr.app_monitor_rank(id,monitor_id,advert_id,create_time,advert_back,advert_previous,cinema_city,cinema_name,hall_no,inspect_end_time,inspect_start_time, inspect_order,monitor_status,data_division)VALUES(REPLACE(UUID(),'-',''),monitor_id1,correct_uuid,NOW(),correct_adback,correct_adprevious,monitor_city,monitor_cinemaname, correct_hallno,FROM_UNIXTIME((UNIX_TIMESTAMP(dragon_time)-correct_imgcount+correct_imglen),'%Y-%m-%d %H:%i:%s'),FROM_UNIXTIME((UNIX_TIMESTAMP(dragon_time)-correct_imgcount),'%Y-%m-%d %H:%i:%s'),correct_order,1,1); END IF; #CLOSE cur2 ; END IF; SET monitor_count = monitor_count-1; END WHILE; CLOSE cur1; #CLOSE cur3; END ;; DELIMITER ; -- ---------------------------- -- Auto increment value for `cinemainfo` -- ---------------------------- ALTER TABLE `cinemainfo` AUTO_INCREMENT=2; -- ---------------------------- -- Auto increment value for `correct_show` -- ---------------------------- ALTER TABLE `correct_show` AUTO_INCREMENT=230; DELIMITER ;; CREATE TRIGGER `test` AFTER INSERT ON `dragon` FOR EACH ROW begin call Into_creectshow(480,10); call AbnormalPlay1(480); call multicast(480); call order_error(480); end ;; DELIMITER ; -- ---------------------------- -- Auto increment value for `dragon` -- ---------------------------- ALTER TABLE `dragon` AUTO_INCREMENT=63; -- ---------------------------- -- Auto increment value for `features` -- ---------------------------- ALTER TABLE `features` AUTO_INCREMENT=2474; -- ---------------------------- -- Auto increment value for `matchitem` -- ---------------------------- ALTER TABLE `matchitem` AUTO_INCREMENT=58723; -- ---------------------------- -- Auto increment value for `readymark` -- ---------------------------- ALTER TABLE `readymark` AUTO_INCREMENT=2646; -- ---------------------------- -- Auto increment value for `suspicious_show` -- ---------------------------- ALTER TABLE `suspicious_show` AUTO_INCREMENT=93; -- ---------------------------- -- Auto increment value for `tasks` -- ---------------------------- ALTER TABLE `tasks` AUTO_INCREMENT=299; -- ---------------------------- -- Auto increment value for `test2` -- ---------------------------- ALTER TABLE `test2` AUTO_INCREMENT=1;
true
60717b540d29602d06b9dab4b193914a2366f06e
SQL
JustATest314/Masterarbeit
/krautquiz/conf/evolutions/default/1.sql
UTF-8
1,728
3.109375
3
[ "Apache-2.0" ]
permissive
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups create table answer ( answer_id varchar(255) not null, question_id varchar(255), answer_text varchar(255), vote_score integer, owner_id varchar(255), page integer, constraint pk_answer primary key (answer_id)) ; create table nutzer ( email varchar(255) not null, name varchar(255), password varchar(255), constraint pk_nutzer primary key (email)) ; create table question ( question_id varchar(255) not null, question_text varchar(255), vote_score integer, owner_id varchar(255), page integer, constraint pk_question primary key (question_id)) ; create table quiz ( entry_id varchar(255) not null, user_id varchar(255), question_id varchar(255), answer_id varchar(255), time bigint, interval bigint, constraint pk_quiz primary key (entry_id)) ; create sequence answer_seq; create sequence nutzer_seq; create sequence question_seq; create sequence quiz_seq; # --- !Downs SET REFERENTIAL_INTEGRITY FALSE; drop table if exists answer; drop table if exists nutzer; drop table if exists question; drop table if exists quiz; SET REFERENTIAL_INTEGRITY TRUE; drop sequence if exists answer_seq; drop sequence if exists nutzer_seq; drop sequence if exists question_seq; drop sequence if exists quiz_seq;
true
a3a43a20779e401a568b0379126f5dc21d854161
SQL
qjb1991/Code
/wx/wx_user.sql
UTF-8
409
3.15625
3
[]
no_license
create table wx_user( id int unsigned primary key auto_increment comment '主键', nickname varchar(50) default null comment '昵称', openId varchar(200) not null comment 'openId', createTime int unsigned default 0 not null comment '创建时间', city varchar(20) default '' not null comment '所在城市' )engine=innodb charset=utf8 comment='微信用户表'; create unique index oid on wx_user (openId);
true
08eb4b826755f738d928230c0e81ab5ddce2bbcb
SQL
sambit-mhptr/practical
/database/data.sql
UTF-8
30,607
3.53125
4
[]
no_license
-- -------------------------------------------------------- -- Host: localhost -- Server version: 5.7.24 - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL Version: 10.2.0.5599 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8 */; /*!50503 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- Dumping structure for table practical.categories CREATE TABLE IF NOT EXISTS `categories` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `icon` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `categories_user_id_foreign` (`user_id`), CONSTRAINT `categories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.categories: ~4 rows (approximately) /*!40000 ALTER TABLE `categories` DISABLE KEYS */; INSERT INTO `categories` (`id`, `name`, `icon`, `user_id`, `created_at`, `updated_at`) VALUES (2, 'qqq', 'qqq', 1, NULL, NULL), (3, 'tttt', 'tttt', 1, '2021-06-11 14:56:39', '2021-06-11 14:56:39'), (4, 'yy', 'oooooooooooooo', 1, '2021-06-11 15:13:46', '2021-06-11 15:41:37'), (5, 'icon', 'fab fa-accessible-icon', 1, '2021-06-11 17:50:49', '2021-06-11 17:50:49'), (6, 'bookgggii', 'fas fa-address-book', 1, '2021-06-11 17:55:37', '2021-06-12 15:05:11'), (7, 'up', 'fas fa-address-book', NULL, '2021-06-12 15:12:38', '2021-06-12 15:27:51'); /*!40000 ALTER TABLE `categories` ENABLE KEYS */; -- Dumping structure for table practical.category_product CREATE TABLE IF NOT EXISTS `category_product` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `category_id` bigint(20) unsigned NOT NULL, `product_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `category_product_category_id_foreign` (`category_id`), KEY `category_product_product_id_foreign` (`product_id`), CONSTRAINT `category_product_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE, CONSTRAINT `category_product_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.category_product: ~2 rows (approximately) /*!40000 ALTER TABLE `category_product` DISABLE KEYS */; INSERT INTO `category_product` (`id`, `category_id`, `product_id`, `created_at`, `updated_at`) VALUES (28, 5, 26, '2021-06-12 15:40:03', '2021-06-12 15:40:03'), (29, 6, 26, '2021-06-12 15:40:03', '2021-06-12 15:40:03'); /*!40000 ALTER TABLE `category_product` ENABLE KEYS */; -- Dumping structure for table practical.data_rows CREATE TABLE IF NOT EXISTS `data_rows` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data_type_id` int(10) unsigned NOT NULL, `field` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `required` tinyint(1) NOT NULL DEFAULT '0', `browse` tinyint(1) NOT NULL DEFAULT '1', `read` tinyint(1) NOT NULL DEFAULT '1', `edit` tinyint(1) NOT NULL DEFAULT '1', `add` tinyint(1) NOT NULL DEFAULT '1', `delete` tinyint(1) NOT NULL DEFAULT '1', `details` text COLLATE utf8mb4_unicode_ci, `order` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `data_rows_data_type_id_foreign` (`data_type_id`), CONSTRAINT `data_rows_data_type_id_foreign` FOREIGN KEY (`data_type_id`) REFERENCES `data_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.data_rows: ~36 rows (approximately) /*!40000 ALTER TABLE `data_rows` DISABLE KEYS */; INSERT INTO `data_rows` (`id`, `data_type_id`, `field`, `type`, `display_name`, `required`, `browse`, `read`, `edit`, `add`, `delete`, `details`, `order`) VALUES (1, 1, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, NULL, 1), (2, 1, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, NULL, 2), (3, 1, 'email', 'text', 'Email', 1, 1, 1, 1, 1, 1, NULL, 3), (4, 1, 'password', 'password', 'Password', 1, 0, 0, 1, 1, 0, NULL, 4), (5, 1, 'remember_token', 'text', 'Remember Token', 0, 0, 0, 0, 0, 0, NULL, 5), (6, 1, 'created_at', 'timestamp', 'Created At', 0, 1, 1, 0, 0, 0, NULL, 6), (7, 1, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, NULL, 7), (8, 1, 'avatar', 'image', 'Avatar', 0, 1, 1, 1, 1, 1, NULL, 8), (9, 1, 'user_belongsto_role_relationship', 'relationship', 'Role', 0, 1, 1, 1, 1, 0, '{"model":"TCG\\\\Voyager\\\\Models\\\\Role","table":"roles","type":"belongsTo","column":"role_id","key":"id","label":"display_name","pivot_table":"roles","pivot":0}', 10), (10, 1, 'user_belongstomany_role_relationship', 'relationship', 'Roles', 0, 1, 1, 1, 1, 0, '{"model":"TCG\\\\Voyager\\\\Models\\\\Role","table":"roles","type":"belongsToMany","column":"id","key":"id","label":"display_name","pivot_table":"user_roles","pivot":"1","taggable":"0"}', 11), (11, 1, 'settings', 'hidden', 'Settings', 0, 0, 0, 0, 0, 0, NULL, 12), (12, 2, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, NULL, 1), (13, 2, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, NULL, 2), (14, 2, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, NULL, 3), (15, 2, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, NULL, 4), (16, 3, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, NULL, 1), (17, 3, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, NULL, 2), (18, 3, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, NULL, 3), (19, 3, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, NULL, 4), (20, 3, 'display_name', 'text', 'Display Name', 1, 1, 1, 1, 1, 1, NULL, 5), (21, 1, 'role_id', 'text', 'Role', 1, 1, 1, 1, 1, 1, NULL, 9), (22, 4, 'id', 'hidden', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1), (23, 4, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, 'null', 3), (24, 4, 'icon', 'text', 'Icon', 1, 1, 1, 1, 1, 1, 'null', 4), (25, 4, 'user_id', 'text', 'User Id', 0, 0, 0, 0, 0, 0, '{}', 2), (26, 4, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, '{}', 5), (27, 4, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, '{}', 6), (28, 6, 'id', 'hidden', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1), (29, 6, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 3), (30, 6, 'description', 'rich_text_box', 'Description', 1, 0, 1, 1, 1, 1, '{}', 4), (31, 6, 'price', 'text', 'Price', 0, 1, 1, 1, 1, 1, '{}', 5), (32, 6, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 6), (33, 6, 'user_id', 'text', 'User Id', 0, 0, 0, 0, 0, 0, '{}', 2), (34, 6, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, '{}', 7), (35, 6, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, '{}', 8); /*!40000 ALTER TABLE `data_rows` ENABLE KEYS */; -- Dumping structure for table practical.data_types CREATE TABLE IF NOT EXISTS `data_types` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name_singular` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name_plural` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `model_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `policy_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `controller` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `generate_permissions` tinyint(1) NOT NULL DEFAULT '0', `server_side` tinyint(4) NOT NULL DEFAULT '0', `details` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `data_types_name_unique` (`name`), UNIQUE KEY `data_types_slug_unique` (`slug`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.data_types: ~5 rows (approximately) /*!40000 ALTER TABLE `data_types` DISABLE KEYS */; INSERT INTO `data_types` (`id`, `name`, `slug`, `display_name_singular`, `display_name_plural`, `icon`, `model_name`, `policy_name`, `controller`, `description`, `generate_permissions`, `server_side`, `details`, `created_at`, `updated_at`) VALUES (1, 'users', 'users', 'User', 'Users', 'voyager-person', 'TCG\\Voyager\\Models\\User', 'TCG\\Voyager\\Policies\\UserPolicy', 'TCG\\Voyager\\Http\\Controllers\\VoyagerUserController', '', 1, 0, NULL, '2021-06-10 15:13:13', '2021-06-10 15:13:13'), (2, 'menus', 'menus', 'Menu', 'Menus', 'voyager-list', 'TCG\\Voyager\\Models\\Menu', NULL, '', '', 1, 0, NULL, '2021-06-10 15:13:13', '2021-06-10 15:13:13'), (3, 'roles', 'roles', 'Role', 'Roles', 'voyager-lock', 'TCG\\Voyager\\Models\\Role', NULL, 'TCG\\Voyager\\Http\\Controllers\\VoyagerRoleController', '', 1, 0, NULL, '2021-06-10 15:13:14', '2021-06-10 15:13:14'), (4, 'categories', 'categories', 'Category', 'Categories', 'voyager-categories', 'App\\Models\\Category', NULL, 'App\\Http\\Controllers\\Voyager\\CategoryController', NULL, 1, 0, '{"order_column":null,"order_display_column":null,"order_direction":"asc","default_search_key":null,"scope":null}', '2021-06-10 16:08:46', '2021-06-12 15:14:21'), (6, 'products', 'products', 'Product', 'Products', 'voyager-basket', 'App\\Models\\Product', NULL, 'App\\Http\\Controllers\\Voyager\\ProductController', NULL, 1, 0, '{"order_column":null,"order_display_column":null,"order_direction":"asc","default_search_key":null,"scope":null}', '2021-06-12 08:21:45', '2021-06-12 10:42:58'); /*!40000 ALTER TABLE `data_types` ENABLE KEYS */; -- Dumping structure for table practical.failed_jobs CREATE TABLE IF NOT EXISTS `failed_jobs` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.failed_jobs: ~0 rows (approximately) /*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */; /*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */; -- Dumping structure for table practical.menus CREATE TABLE IF NOT EXISTS `menus` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `menus_name_unique` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.menus: ~0 rows (approximately) /*!40000 ALTER TABLE `menus` DISABLE KEYS */; INSERT INTO `menus` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'admin', '2021-06-10 15:13:14', '2021-06-10 15:13:14'); /*!40000 ALTER TABLE `menus` ENABLE KEYS */; -- Dumping structure for table practical.menu_items CREATE TABLE IF NOT EXISTS `menu_items` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `menu_id` int(10) unsigned DEFAULT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `target` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '_self', `icon_class` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `order` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `route` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `parameters` text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`id`), KEY `menu_items_menu_id_foreign` (`menu_id`), CONSTRAINT `menu_items_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.menu_items: ~10 rows (approximately) /*!40000 ALTER TABLE `menu_items` DISABLE KEYS */; INSERT INTO `menu_items` (`id`, `menu_id`, `title`, `url`, `target`, `icon_class`, `color`, `parent_id`, `order`, `created_at`, `updated_at`, `route`, `parameters`) VALUES (1, 1, 'Dashboard', '', '_self', 'voyager-boat', NULL, NULL, 1, '2021-06-10 15:13:14', '2021-06-10 15:13:14', 'voyager.dashboard', NULL), (2, 1, 'Media', '', '_self', 'voyager-images', NULL, NULL, 4, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.media.index', NULL), (3, 1, 'Users', '', '_self', 'voyager-person', NULL, NULL, 3, '2021-06-10 15:13:15', '2021-06-10 15:13:15', 'voyager.users.index', NULL), (4, 1, 'Roles', '', '_self', 'voyager-lock', NULL, NULL, 2, '2021-06-10 15:13:15', '2021-06-10 15:13:15', 'voyager.roles.index', NULL), (5, 1, 'Tools', '', '_self', 'voyager-tools', NULL, NULL, 5, '2021-06-10 15:13:15', '2021-06-12 15:51:57', NULL, NULL), (6, 1, 'Menu Builder', '', '_self', 'voyager-list', NULL, 5, 1, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.menus.index', NULL), (7, 1, 'Database', '', '_self', 'voyager-data', NULL, 5, 2, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.database.index', NULL), (8, 1, 'Compass', '', '_self', 'voyager-compass', NULL, 5, 3, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.compass.index', NULL), (9, 1, 'BREAD', '', '_self', 'voyager-bread', NULL, 5, 4, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.bread.index', NULL), (10, 1, 'Settings', '', '_self', 'voyager-settings', NULL, NULL, 6, '2021-06-10 15:13:15', '2021-06-12 15:51:57', 'voyager.settings.index', NULL), (11, 1, 'Hooks', '', '_self', 'voyager-hook', NULL, 5, 5, '2021-06-10 15:13:17', '2021-06-12 15:51:57', 'voyager.hooks', NULL), (12, 1, 'Categories', '', '_self', 'voyager-categories', NULL, NULL, 8, '2021-06-10 16:08:46', '2021-06-12 15:51:57', 'voyager.categories.index', NULL), (13, 1, 'Products', '', '_self', 'voyager-basket', NULL, NULL, 7, '2021-06-12 08:21:45', '2021-06-12 15:51:57', 'voyager.products.index', NULL); /*!40000 ALTER TABLE `menu_items` ENABLE KEYS */; -- Dumping structure for table practical.migrations CREATE TABLE IF NOT EXISTS `migrations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.migrations: ~23 rows (approximately) /*!40000 ALTER TABLE `migrations` DISABLE KEYS */; INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2016_01_01_000000_add_voyager_user_fields', 1), (4, '2016_01_01_000000_create_data_types_table', 1), (5, '2016_05_19_173453_create_menu_table', 1), (6, '2016_10_21_190000_create_roles_table', 1), (7, '2016_10_21_190000_create_settings_table', 1), (8, '2016_11_30_135954_create_permission_table', 1), (9, '2016_11_30_141208_create_permission_role_table', 1), (10, '2016_12_26_201236_data_types__add__server_side', 1), (11, '2017_01_13_000000_add_route_to_menu_items_table', 1), (12, '2017_01_14_005015_create_translations_table', 1), (13, '2017_01_15_000000_make_table_name_nullable_in_permissions_table', 1), (14, '2017_03_06_000000_add_controller_to_data_types_table', 1), (15, '2017_04_21_000000_add_order_to_data_rows_table', 1), (16, '2017_07_05_210000_add_policyname_to_data_types_table', 1), (17, '2017_08_05_000000_add_group_to_settings_table', 1), (18, '2017_11_26_013050_add_user_role_relationship', 1), (19, '2017_11_26_015000_create_user_roles_table', 1), (20, '2018_03_11_000000_add_user_settings', 1), (21, '2018_03_14_000000_add_details_to_data_types_table', 1), (22, '2018_03_16_000000_make_settings_value_nullable', 1), (23, '2019_08_19_000000_create_failed_jobs_table', 1), (24, '2021_06_10_154028_create_products_table', 2), (25, '2021_06_10_154848_create_categories_table', 2), (26, '2021_06_11_101640_category_product', 3); /*!40000 ALTER TABLE `migrations` ENABLE KEYS */; -- Dumping structure for table practical.password_resets CREATE TABLE IF NOT EXISTS `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.password_resets: ~0 rows (approximately) /*!40000 ALTER TABLE `password_resets` DISABLE KEYS */; /*!40000 ALTER TABLE `password_resets` ENABLE KEYS */; -- Dumping structure for table practical.permissions CREATE TABLE IF NOT EXISTS `permissions` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `table_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `permissions_key_index` (`key`) ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.permissions: ~36 rows (approximately) /*!40000 ALTER TABLE `permissions` DISABLE KEYS */; INSERT INTO `permissions` (`id`, `key`, `table_name`, `created_at`, `updated_at`) VALUES (1, 'browse_admin', NULL, '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (2, 'browse_bread', NULL, '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (3, 'browse_database', NULL, '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (4, 'browse_media', NULL, '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (5, 'browse_compass', NULL, '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (6, 'browse_menus', 'menus', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (7, 'read_menus', 'menus', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (8, 'edit_menus', 'menus', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (9, 'add_menus', 'menus', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (10, 'delete_menus', 'menus', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (11, 'browse_roles', 'roles', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (12, 'read_roles', 'roles', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (13, 'edit_roles', 'roles', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (14, 'add_roles', 'roles', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (15, 'delete_roles', 'roles', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (16, 'browse_users', 'users', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (17, 'read_users', 'users', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (18, 'edit_users', 'users', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (19, 'add_users', 'users', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (20, 'delete_users', 'users', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (21, 'browse_settings', 'settings', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (22, 'read_settings', 'settings', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (23, 'edit_settings', 'settings', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (24, 'add_settings', 'settings', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (25, 'delete_settings', 'settings', '2021-06-10 15:13:16', '2021-06-10 15:13:16'), (26, 'browse_hooks', NULL, '2021-06-10 15:13:18', '2021-06-10 15:13:18'), (27, 'browse_categories', 'categories', '2021-06-10 16:08:46', '2021-06-10 16:08:46'), (28, 'read_categories', 'categories', '2021-06-10 16:08:46', '2021-06-10 16:08:46'), (29, 'edit_categories', 'categories', '2021-06-10 16:08:46', '2021-06-10 16:08:46'), (30, 'add_categories', 'categories', '2021-06-10 16:08:46', '2021-06-10 16:08:46'), (31, 'delete_categories', 'categories', '2021-06-10 16:08:46', '2021-06-10 16:08:46'), (32, 'browse_products', 'products', '2021-06-12 08:21:45', '2021-06-12 08:21:45'), (33, 'read_products', 'products', '2021-06-12 08:21:45', '2021-06-12 08:21:45'), (34, 'edit_products', 'products', '2021-06-12 08:21:45', '2021-06-12 08:21:45'), (35, 'add_products', 'products', '2021-06-12 08:21:45', '2021-06-12 08:21:45'), (36, 'delete_products', 'products', '2021-06-12 08:21:45', '2021-06-12 08:21:45'); /*!40000 ALTER TABLE `permissions` ENABLE KEYS */; -- Dumping structure for table practical.permission_role CREATE TABLE IF NOT EXISTS `permission_role` ( `permission_id` bigint(20) unsigned NOT NULL, `role_id` bigint(20) unsigned NOT NULL, PRIMARY KEY (`permission_id`,`role_id`), KEY `permission_role_permission_id_index` (`permission_id`), KEY `permission_role_role_id_index` (`role_id`), CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE, CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.permission_role: ~47 rows (approximately) /*!40000 ALTER TABLE `permission_role` DISABLE KEYS */; INSERT INTO `permission_role` (`permission_id`, `role_id`) VALUES (1, 1), (1, 3), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1), (8, 1), (9, 1), (10, 1), (11, 1), (12, 1), (13, 1), (14, 1), (15, 1), (16, 1), (17, 1), (18, 1), (19, 1), (20, 1), (21, 1), (22, 1), (23, 1), (24, 1), (25, 1), (26, 1), (27, 1), (27, 3), (28, 1), (28, 3), (29, 1), (29, 3), (30, 1), (30, 3), (31, 1), (31, 3), (32, 1), (32, 3), (33, 1), (33, 3), (34, 1), (34, 3), (35, 1), (35, 3), (36, 1), (36, 3); /*!40000 ALTER TABLE `permission_role` ENABLE KEYS */; -- Dumping structure for table practical.products CREATE TABLE IF NOT EXISTS `products` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `price` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `products_user_id_foreign` (`user_id`), CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.products: ~1 rows (approximately) /*!40000 ALTER TABLE `products` DISABLE KEYS */; INSERT INTO `products` (`id`, `name`, `description`, `price`, `image`, `user_id`, `created_at`, `updated_at`) VALUES (26, 'watch', '<p>watch description</p>', '100', '/0lWj2kgPPuPkqiAnFTz5N22B5XrdOAu3A9wYHUKI.png', 1, '2021-06-12 15:40:03', '2021-06-12 15:40:03'); /*!40000 ALTER TABLE `products` ENABLE KEYS */; -- Dumping structure for table practical.roles CREATE TABLE IF NOT EXISTS `roles` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `roles_name_unique` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.roles: ~3 rows (approximately) /*!40000 ALTER TABLE `roles` DISABLE KEYS */; INSERT INTO `roles` (`id`, `name`, `display_name`, `created_at`, `updated_at`) VALUES (1, 'super admin', 'Super Administrator', '2021-06-10 15:13:15', '2021-06-10 15:57:04'), (2, 'user', 'Normal User', '2021-06-10 15:13:15', '2021-06-10 15:13:15'), (3, 'admin', 'Administrator', '2021-06-10 15:58:35', '2021-06-10 15:58:35'); /*!40000 ALTER TABLE `roles` ENABLE KEYS */; -- Dumping structure for table practical.settings CREATE TABLE IF NOT EXISTS `settings` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` text COLLATE utf8mb4_unicode_ci, `details` text COLLATE utf8mb4_unicode_ci, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `order` int(11) NOT NULL DEFAULT '1', `group` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `settings_key_unique` (`key`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.settings: ~10 rows (approximately) /*!40000 ALTER TABLE `settings` DISABLE KEYS */; INSERT INTO `settings` (`id`, `key`, `display_name`, `value`, `details`, `type`, `order`, `group`) VALUES (1, 'site.title', 'Site Title', 'Site Title', '', 'text', 1, 'Site'), (2, 'site.description', 'Site Description', 'Site Description', '', 'text', 2, 'Site'), (3, 'site.logo', 'Site Logo', '', '', 'image', 3, 'Site'), (4, 'site.google_analytics_tracking_id', 'Google Analytics Tracking ID', NULL, '', 'text', 4, 'Site'), (5, 'admin.bg_image', 'Admin Background Image', '', '', 'image', 5, 'Admin'), (6, 'admin.title', 'Admin Title', 'Admin Panel', '', 'text', 1, 'Admin'), (7, 'admin.description', 'Admin Description', 'Welcome to Voyager. The Missing Admin for Laravel', '', 'text', 2, 'Admin'), (8, 'admin.loader', 'Admin Loader', '', '', 'image', 3, 'Admin'), (9, 'admin.icon_image', 'Admin Icon Image', '', '', 'image', 4, 'Admin'), (10, 'admin.google_analytics_client_id', 'Google Analytics Client ID (used for admin dashboard)', NULL, '', 'text', 1, 'Admin'); /*!40000 ALTER TABLE `settings` ENABLE KEYS */; -- Dumping structure for table practical.translations CREATE TABLE IF NOT EXISTS `translations` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `table_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `column_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `foreign_key` int(10) unsigned NOT NULL, `locale` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `value` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `translations_table_name_column_name_foreign_key_locale_unique` (`table_name`,`column_name`,`foreign_key`,`locale`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.translations: ~0 rows (approximately) /*!40000 ALTER TABLE `translations` DISABLE KEYS */; /*!40000 ALTER TABLE `translations` ENABLE KEYS */; -- Dumping structure for table practical.users CREATE TABLE IF NOT EXISTS `users` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `role_id` bigint(20) unsigned DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'users/default.png', `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `settings` text COLLATE utf8mb4_unicode_ci, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), KEY `users_role_id_foreign` (`role_id`), CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.users: ~3 rows (approximately) /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` (`id`, `role_id`, `name`, `email`, `avatar`, `email_verified_at`, `password`, `remember_token`, `settings`, `created_at`, `updated_at`) VALUES (1, 1, 'super admin', 'superadmin@admin.com', 'users/default.png', NULL, '$2y$10$upKNipN1.tHRtNsXlQ/2ue8KT/AuhEkd6MHv0UZXLDIFWcrSrnNrW', 'ZYn8Pu5izGPY8MNRXBH83XuBPweiDQn8OnJuWKjYedAlvyNyHINLyahR4KxC', NULL, '2021-06-10 15:14:00', '2021-06-10 15:14:00'), (2, 2, 'Sambit Mohapatra', 'sambit.m212@gmail.com', 'users/default.png', NULL, '$2y$10$OSyH4aw2hbfE1V4QIOohKuB3lnz.hNRlMFA5Zk2TrtJFfJXZMI5CS', NULL, NULL, '2021-06-10 15:20:41', '2021-06-10 15:20:41'), (3, 3, 'admin', 'admin@admin.com', 'users/default.png', NULL, '$2y$10$WNjKk1dZ.K3Gg5Rb32pdHOMo8BdJQ7SVIFUoWu.GRocIOqhIItWo2', 'MVJ1fzwheKMkzM3j3CjgNJbjKq9wFQ4qHq36MAlC8CnCs3XIwfwiyvfcPp0t', '{"locale":"en"}', '2021-06-10 15:59:40', '2021-06-10 15:59:40'); /*!40000 ALTER TABLE `users` ENABLE KEYS */; -- Dumping structure for table practical.user_roles CREATE TABLE IF NOT EXISTS `user_roles` ( `user_id` bigint(20) unsigned NOT NULL, `role_id` bigint(20) unsigned NOT NULL, PRIMARY KEY (`user_id`,`role_id`), KEY `user_roles_user_id_index` (`user_id`), KEY `user_roles_role_id_index` (`role_id`), CONSTRAINT `user_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE, CONSTRAINT `user_roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- Dumping data for table practical.user_roles: ~0 rows (approximately) /*!40000 ALTER TABLE `user_roles` DISABLE KEYS */; /*!40000 ALTER TABLE `user_roles` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
true
02707c13d60ba31817ad641b82e52974bc3a0da6
SQL
stoyantodorovbg/Trail_sharing_project
/trail_sharing_project_dump.sql
UTF-8
10,668
3.3125
3
[ "MIT" ]
permissive
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for Win32 (AMD64) -- -- Host: localhost Database: trail_sharing_project -- ------------------------------------------------------ -- Server version 10.1.26-MariaDB /*!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 `albums` -- DROP TABLE IF EXISTS `albums`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `albums` ( `album_id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(50) NOT NULL, `author_id` int(11) NOT NULL, `discription` varchar(50) NOT NULL, `pictures` set('Value A','Value B') NOT NULL, `likes` int(11) NOT NULL DEFAULT '0', `dislikes` int(11) NOT NULL DEFAULT '0', `loves` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`album_id`), KEY `author_album_FK1` (`author_id`), CONSTRAINT `author_album_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `albums` -- LOCK TABLES `albums` WRITE; /*!40000 ALTER TABLE `albums` DISABLE KEYS */; /*!40000 ALTER TABLE `albums` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `articles` -- DROP TABLE IF EXISTS `articles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `articles` ( `article_id` int(11) NOT NULL AUTO_INCREMENT, `author_id` int(11) NOT NULL, `title` varchar(250) NOT NULL, `subject` varchar(250) NOT NULL, `short_content` tinytext NOT NULL, `content` mediumtext NOT NULL, `create_date` set('Value A','Value B') NOT NULL, `pictures` set('Value A','Value B') DEFAULT NULL, `comments` set('Value A','Value B') DEFAULT NULL, `likes` int(10) NOT NULL DEFAULT '0', `dislakes` int(10) NOT NULL DEFAULT '0', `loves` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`article_id`), KEY `article_author_FK1` (`author_id`), CONSTRAINT `article_author_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `articles` -- LOCK TABLES `articles` WRITE; /*!40000 ALTER TABLE `articles` DISABLE KEYS */; /*!40000 ALTER TABLE `articles` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `comment` -- DROP TABLE IF EXISTS `comment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `comment` ( `comment_id` int(11) NOT NULL AUTO_INCREMENT, `author_id` int(11) NOT NULL, `about` varchar(20) NOT NULL, `about_id` int(11) NOT NULL, `likes` int(11) NOT NULL DEFAULT '0', `dislakes` int(11) NOT NULL DEFAULT '0', `loves` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`comment_id`), KEY `author_comment_FK1` (`author_id`), CONSTRAINT `author_comment_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `comment` -- LOCK TABLES `comment` WRITE; /*!40000 ALTER TABLE `comment` DISABLE KEYS */; /*!40000 ALTER TABLE `comment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `forum` -- DROP TABLE IF EXISTS `forum`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `forum` ( `subject_id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(50) NOT NULL, `discription` varchar(50) NOT NULL, `posts` set('Value A','Value B') NOT NULL, `likes` int(11) NOT NULL DEFAULT '0', `dislakes` int(11) NOT NULL DEFAULT '0', `loves` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`subject_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `forum` -- LOCK TABLES `forum` WRITE; /*!40000 ALTER TABLE `forum` DISABLE KEYS */; /*!40000 ALTER TABLE `forum` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `picture` -- DROP TABLE IF EXISTS `picture`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `picture` ( `picture_id` int(11) NOT NULL AUTO_INCREMENT, `author_id` int(11) NOT NULL, `path` varchar(250) NOT NULL, `about` varchar(30) NOT NULL, `about_id` int(11) NOT NULL, `likes` int(11) NOT NULL DEFAULT '0', `dislikes` int(11) NOT NULL DEFAULT '0', `loves` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`picture_id`), KEY `author_picture_FK1` (`author_id`), CONSTRAINT `author_picture_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `picture` -- LOCK TABLES `picture` WRITE; /*!40000 ALTER TABLE `picture` DISABLE KEYS */; /*!40000 ALTER TABLE `picture` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `posts` -- DROP TABLE IF EXISTS `posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `posts` ( `post_id` int(11) NOT NULL AUTO_INCREMENT, `subject_name` varchar(50) NOT NULL, `subject_id` int(11) NOT NULL, `title` varchar(250) NOT NULL, `content` mediumtext NOT NULL, `author_id` int(11) NOT NULL, `comments` set('Value A','Value B') NOT NULL, `likes` int(10) NOT NULL DEFAULT '0', `dislakes` int(10) NOT NULL DEFAULT '0', `loves` int(10) NOT NULL DEFAULT '0', PRIMARY KEY (`post_id`), KEY `post_author_FK1` (`author_id`), KEY `post_subject_FK2` (`subject_id`), CONSTRAINT `post_author_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`), CONSTRAINT `post_subject_FK2` FOREIGN KEY (`subject_id`) REFERENCES `forum` (`subject_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `posts` -- LOCK TABLES `posts` WRITE; /*!40000 ALTER TABLE `posts` DISABLE KEYS */; /*!40000 ALTER TABLE `posts` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `trails` -- DROP TABLE IF EXISTS `trails`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `trails` ( `trail_id` int(11) NOT NULL AUTO_INCREMENT, `trail_name` varchar(50) DEFAULT NULL, `coutry` varchar(50) NOT NULL, `author_id` int(11) NOT NULL, `region` varchar(50) NOT NULL, `location` varchar(250) NOT NULL, `approaches` text NOT NULL, `difficulty` varchar(50) NOT NULL, `discription` text NOT NULL, `pictures` set('Value A','Value B') DEFAULT NULL, `likes` int(10) NOT NULL DEFAULT '0', `dislakes` int(10) NOT NULL DEFAULT '0', `loves` int(10) NOT NULL DEFAULT '0', `comments` set('Value A','Value B') NOT NULL, PRIMARY KEY (`trail_id`), KEY `author_trail_FK1` (`author_id`), CONSTRAINT `author_trail_FK1` FOREIGN KEY (`author_id`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `trails` -- LOCK TABLES `trails` WRITE; /*!40000 ALTER TABLE `trails` DISABLE KEYS */; /*!40000 ALTER TABLE `trails` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_roles` -- DROP TABLE IF EXISTS `user_roles`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_roles` ( `role_id` int(11) NOT NULL, `name` varchar(20) NOT NULL, PRIMARY KEY (`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_roles` -- LOCK TABLES `user_roles` WRITE; /*!40000 ALTER TABLE `user_roles` DISABLE KEYS */; /*!40000 ALTER TABLE `user_roles` ENABLE KEYS */; UNLOCK TABLES; -- -- 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` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `password` varchar(50) NOT NULL, `role_id` int(11) NOT NULL, `likes` int(11) NOT NULL DEFAULT '0', `dislikes` int(11) NOT NULL DEFAULT '0', `loves` int(11) NOT NULL DEFAULT '0', `user_name` varchar(20) NOT NULL, `photo_path` varchar(50) DEFAULT NULL, `first_name` varchar(20) DEFAULT NULL, `last_name` varchar(20) DEFAULT NULL, `create_date` datetime DEFAULT CURRENT_TIMESTAMP, `age` int(11) DEFAULT NULL, `gender` enum('Y','N') DEFAULT NULL, `birth_date` datetime DEFAULT NULL, `country` varchar(25) DEFAULT NULL, `town` varchar(25) DEFAULT NULL, `favorite_styles` tinytext, `participations` text, `records` text, `about_me` text, `articles_id` set('Value A','Value B') DEFAULT NULL, `forum_posts_id` set('Value A','Value B') DEFAULT NULL, `trails_id` set('Value A','Value B') DEFAULT NULL, `comments` set('Value A','Value B') DEFAULT NULL, `albums` set('Value A','Value B') DEFAULT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `user_id` (`user_id`), UNIQUE KEY `user_name` (`user_name`), KEY `role_id_FK1` (`role_id`), CONSTRAINT `role_id_FK1` FOREIGN KEY (`role_id`) REFERENCES `user_roles` (`role_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `users` -- LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-10-23 18:00:35
true
60e56306bc697abef2cba84692ce254b57a3d6c0
SQL
Julio-0417/exercicios-MySQL
/join/exerciciojoin4.sql
UTF-8
3,011
4.375
4
[]
no_license
/*Crie um banco de dados para um serviço de um açougue ou uma quitanda, o nome do banco deverá ter o seguinte nome db_cidade_das_carnes ou db_cidade_das_frutas, onde o sistema trabalhará com as informações dos produtos desta empresa. O sistema trabalhará com 2 tabelas tb_produto e tb_categoria. siga exatamente esse passo a passo: Crie uma tabela de categorias utilizando a habilidade de abstração e determine 3 atributos relevantes do tb_categoria para se trabalhar com o serviço desse açougue. Crie uma tabela de tb_produto e utilize a habilidade de abstração e determine 5 atributos relevantes dos tb_produto para se trabalhar com o serviço desse açougue(não esqueça de criar a foreign key de tb_categoria nesta tabela). Popule esta tabela Categoria com até 5 dados. Popule esta tabela Produto com até 8 dados. Faça um select que retorne os Produtos com o valor maior do que 50 reais. Faça um select trazendo os Produtos com valor entre 3 e 60 reais. Faça um select utilizando LIKE buscando os Produtos com a letra C. Faça um um select com Inner join entre tabela categoria e produto. Faça um select onde traga todos os Produtos de uma categoria específica (exemplo todos os produtos que são aves ou legumes). Salve as querys para cada uma dos requisitos do exercício em um arquivo .SQL ou texto e coloque no seu GitHuB pessoal e compartilhe esta atividade.*/ CREATE DATABASE db_cidade_das_frutas; USE db_cidade_das_frutas; CREATE TABLE tb_categoria( id_categoria INT NOT NULL AUTO_INCREMENT, nome_categoria VARCHAR(255), corredor INT, referencia VARCHAR(255), PRIMARY KEY (id_categoria) ); CREATE TABLE tb_produto( id_produto INT NOT NULL auto_increment, nome_produto VARCHAR(255), produtore VARCHAR(255), estoque VARCHAR(255), preco FLOAT, fk_categoria INT, PRIMARY KEY (id_produto), FOREIGN KEY (fk_categoria) REFERENCES tb_categoria(id_categoria) ); INSERT INTO tb_categoria (nome_categoria, corredor, referencia) VALUES ('Frutas','2','quilograma'), ('Legumes','2','quilograma'), ('Hortaliças','3','unidade'), ('Tubérculos','1','quilograma'), ('Grãos','1','quilograma'); INSERT INTO tb_produto (nome_produto, produtore, estoque, preco, fk_categoria) VALUES ('Abacaxi Pérola','Campo Azul','caixa',6.99,1), ('Alface Crespa','Minha Horta','caixa',2.50,3), ('Feijão Carioca','Magna Grãos','sacada',7.50,5), ('Mexerica Cravo','Rosa Flor','caixa',4.30,1), ('Abacate','Abacate Legal','caixa', 5.90,1), ('Abobrinha','Bloom Alimentos','caixa', 3.20, 2), ('Cenoura','Cooperativa Almeida','caixa', 6.90, 4), ('Batata Asterix','Cooperativa do Vale','caixa', 9.99, 4); SELECT * FROM tb_produto WHERE preco > 50.0; SELECT * FROM tb_produto WHERE preco BETWEEN 3.0 AND 60.0; SELECT * FROM tb_produto WHERE nome_produto LIKE '%c%'; SELECT * FROM tb_categoria INNER JOIN tb_produto ON tb_categoria.id_categoria = tb_produto.fk_categoria; SELECT * FROM tb_categoria INNER JOIN tb_produto ON tb_categoria.id_categoria = tb_produto.fk_categoria WHERE nome_categoria = 'Frutas';
true
c9a12e56783e431a1efb72a89e0d5d4a31957528
SQL
bartschs/sql_admin
/dba_job_queue.sql
UTF-8
1,373
3.21875
3
[]
no_license
/* ** ** NAME ** jobqueue.sql ** FUNCTION ** check DB-Jobs queued via DBMS_JOB package ** NOTE ** PL/SQL V2.1 ** MODIFIED ** 04.06.99 sb - made it ** */ accept job_no char prompt 'Job No : [] '; accept what char prompt 'Action : [] '; set verify off; set heading on; clear columns clear breaks clear computes ttitle off btitle off column job format 999999 column priv_user format a10 column last_date format a10 heading 'LAST_DATE' column last_sec format a10 heading 'LAST_SEC' column this_date format a10 heading 'THIS_DATE' column this_sec format a10 heading 'THIS_SEC' column next_date format a10 heading 'NEXT_DATE' column next_sec format a10 heading 'NEXT_SEC' column what format a20 column interval format a20 column failures format 9999 heading 'FAIL' column now format a20 heading 'Check Date ->' spool &TMPDIR.jobqueue set feedback off; select to_char(sysdate, 'DD.MM.YYYY HH24:MI:SS') now from dual; set feedback on; select job ,priv_user ,last_date -- ,last_sec ,this_date -- ,this_sec ,next_date -- ,next_sec ,what ,interval ,failures from dba_jobs where job = NVL(to_number('&&job_no'), job) and what like nvl('&&what.%','%') / undefine job_no undefine what
true
a4d432e80f7002403117a777369e8a61031b2636
SQL
zdergatchev/Database-Basic
/04 Basic CRUD Operation Exercises/14. Find All Employees Except Marketing.sql
UTF-8
122
2.578125
3
[ "MIT" ]
permissive
USE soft_uni; SELECT first_name, last_name FROM employees WHERE department_id NOT LIKE 4; /* WHERE department_id !=4; */
true
ec711a693aafa52b5bd9fcaa74ecef0f6ec9cff9
SQL
aaronrotman/etl-project
/schema.sql
UTF-8
1,016
3.1875
3
[]
no_license
drop table if exists confirmed_cases; create table confirmed_cases ( id int primary key, positive_cases int, age varchar(20), sex varchar(20), province varchar(25), date date, travel_yn varchar(50), travel_history_country varchar(50), locally_acquired varchar(50) ); drop table if exists mortality; create table mortality ( id int primary key, province varchar(25), date date, age varchar(20), sex varchar(20) ); drop table if exists recovered; create table recovered ( id int primary key, date date, province varchar(25), cumulative_recovered int ); drop table if exists testcases; create table testcases ( id int primary key, date date, province varchar(25), cumulative_testing int ); drop table if exists summary_data; create table summary_data ( id int primary key, weekno int, province varchar(25), positive_cases int, recovered int, test_cases int, death_cases int );
true
bd18c497a758f5902b13055c6f2d2789a4ee0b8d
SQL
afzamorag/DinaeWebSIGACII
/DinaWebMaven/db/scripts/40_SIEDU_EVALUACION.sql
UTF-8
2,606
3.484375
3
[]
no_license
CREATE TABLE SIEDU_EVALUACION ( eval_eval NUMBER (8) NOT NULL , eval_pae NUMBER (6) NOT NULL , eval_descri VARCHAR2 (100) NOT NULL , eval_even NUMBER (8) NOT NULL , eval_dom_proce NUMBER (4) NOT NULL , eval_dom_modal NUMBER (4) NOT NULL , eval_nro_preg NUMBER (2) NOT NULL , eval_fecha DATE NOT NULL , eval_estado VARCHAR2 (1) NOT NULL, eval_aplicada VARCHAR2 (1) DEFAULT 'N', eval_usu_crea VARCHAR2 (30) NOT NULL , eval_fecha_crea DATE NOT NULL , eval_maquina_crea VARCHAR2 (100) NOT NULL, eval_ip_crea VARCHAR2 (100) NOT NULL, eval_usu_mod VARCHAR2 (30), eval_fecha_mod DATE, eval_maquina_mod VARCHAR2 (100), eval_ip_mod VARCHAR2 (100) ) ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_ESTADO_CK CHECK (eval_estado IN ( 'P', 'A', 'I' )) ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_APLICADA_CK CHECK (eval_aplicada IN ('S', 'N')); COMMENT ON TABLE SIEDU_EVALUACION IS 'Tabla de Evaluaciones en Vigencia - PAE' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_eval IS 'Secuencial identificador único del registro de Evaluación' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_pae IS 'Identificador del PAE' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_descri IS 'Descripción de la Evaluación' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_even IS 'Identificador del Evento' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_dom_proce IS 'Proceso ( DOMINIO PROCESO )' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_dom_modal IS 'Modalidad ( DOMINIO METODOLOGIA )' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_nro_preg IS 'Número de Preguntas que componen la Evaluación. ' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_fecha IS 'Fecha de la versión de la Evaluación' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_estado IS 'Estado de la Evaluación P-Pendiente, A-Activa, I-Inactiva' ; COMMENT ON COLUMN SIEDU_EVALUACION.eval_aplicada IS 'Indica si para la Evaluación ya hay o ha habido participantes.' ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_PK PRIMARY KEY ( eval_eval ) ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_EVEN_UK UNIQUE ( eval_even , eval_estado ) ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_EVENTO_FK FOREIGN KEY ( eval_even ) REFERENCES SIEDU_EVENTO ( even_even ) ; ALTER TABLE SIEDU_EVALUACION ADD CONSTRAINT SIEDU_EVALUACION_PAE_FK FOREIGN KEY ( eval_pae ) REFERENCES SIEDU_PAE ( pae_pae ) ; create sequence siedu_evaluacion_seq;
true
38661a9dfda4e96f10220d6d7986b42b42100f53
SQL
WareTech/TuEnsalada
/DB/waretech_TuEnsalada.sql
UTF-8
33,049
2.734375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 2.11.9.6 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: Nov 22, 2012 at 07:58 PM -- Server version: 5.0.51 -- PHP Version: 5.2.6 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: `waretech_TuEnsalada` -- -- -------------------------------------------------------- -- -- Table structure for table `access` -- CREATE TABLE IF NOT EXISTS `access` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `value` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ; -- -- Dumping data for table `access` -- INSERT INTO `access` (`id`, `version`, `value`, `description`) VALUES (1, 0, 'UserEdit.jsp!update', 'UserEdit.jsp!update'), (2, 0, 'Admin.jsp', 'Admin.jsp'), (3, 0, 'PurchaseList.jsp', 'PurchaseList.jsp'), (4, 0, 'PurchaseEdit.jsp', 'PurchaseEdit.jsp'), (5, 0, 'UserEdit.jsp', 'UserEdit.jsp'), (6, 0, 'UserList.jsp', 'UserList.jsp'), (7, 0, 'ProductList.jsp', 'ProductList.jsp'), (8, 0, 'UserEnableTest.jsp', 'UserEnableTest.jsp'), (9, 0, 'log.jsp', 'log.jsp'), (10, 0, 'ParameterList.jsp', 'ParameterList.jsp'), (11, 0, 'Home.jsp', 'Home.jsp'); -- -------------------------------------------------------- -- -- Table structure for table `address` -- CREATE TABLE IF NOT EXISTS `address` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `customer` bigint(20) NOT NULL, `street` varchar(255) NOT NULL, `number` varchar(255) NOT NULL, `floor` varchar(255) default NULL, `office` varchar(255) default NULL, `comment` varchar(255) default NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`), KEY `FK_Address_customer` (`customer`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; -- -- Dumping data for table `address` -- INSERT INTO `address` (`id`, `version`, `customer`, `street`, `number`, `floor`, `office`, `comment`, `created`) VALUES (15, 0, 2, 'Calle 528 Bis', '1650', '', '', NULL, '2012-11-21 19:51:30'), (16, 0, 20, 'Viamonte', '524', '2', 'derecha', NULL, '2012-11-22 10:51:17'), (17, 0, 21, 'lincoln', '12', '1', '33', NULL, '2012-11-22 13:08:35'); -- -------------------------------------------------------- -- -- Table structure for table `giftcard` -- CREATE TABLE IF NOT EXISTS `giftcard` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `code` varchar(255) NOT NULL, `crc` varchar(255) NOT NULL, `amount` double NOT NULL, `type` int(1) NOT NULL, `created` datetime NOT NULL, `user` bigint(20) default NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_GiftCard_code` (`code`), KEY `FK_GiftCard_user` (`user`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=175 ; -- -- Dumping data for table `giftcard` -- INSERT INTO `giftcard` (`id`, `version`, `code`, `crc`, `amount`, `type`, `created`, `user`) VALUES (75, 0, '629711456628', 'NjI5NzExNDU2NjI4', -100, 1, '2012-11-14 05:41:39', NULL), (76, 0, '236288115307', 'MjM2Mjg4MTE1MzA3', -100, 1, '2012-11-14 05:41:39', NULL), (77, 0, '367776705200', 'MzY3Nzc2NzA1MjAw', -100, 1, '2012-11-14 05:41:39', NULL), (78, 0, '683460750908', 'NjgzNDYwNzUwOTA4', -100, 1, '2012-11-14 05:41:39', NULL), (79, 0, '509842952245', 'NTA5ODQyOTUyMjQ1', -100, 1, '2012-11-14 05:41:39', NULL), (80, 0, '672253866271', 'NjcyMjUzODY2Mjcx', -100, 1, '2012-11-14 05:41:39', NULL), (81, 0, '362112412078', 'MzYyMTEyNDEyMDc4', -100, 1, '2012-11-14 05:41:39', NULL), (82, 0, '269995054047', 'MjY5OTk1MDU0MDQ3', -100, 1, '2012-11-14 05:41:39', NULL), (83, 0, '987119874951', 'OTg3MTE5ODc0OTUx', -100, 1, '2012-11-14 05:41:39', NULL), (84, 0, '190421620855', 'MTkwNDIxNjIwODU1', -100, 1, '2012-11-14 05:41:39', NULL), (85, 0, '711112670796', 'NzExMTEyNjcwNzk2', -100, 1, '2012-11-14 05:41:39', NULL), (86, 0, '403995643010', 'NDAzOTk1NjQzMDEw', -100, 1, '2012-11-14 05:41:39', NULL), (87, 0, '850297493601', 'ODUwMjk3NDkzNjAx', -100, 1, '2012-11-14 05:41:39', NULL), (88, 0, '405119433159', 'NDA1MTE5NDMzMTU5', -100, 1, '2012-11-14 05:41:39', NULL), (89, 0, '754698877668', 'NzU0Njk4ODc3NjY4', -100, 1, '2012-11-14 05:41:39', NULL), (90, 0, '542820101545', 'NTQyODIwMTAxNTQ1', -100, 1, '2012-11-14 05:41:39', NULL), (91, 0, '129408655294', 'MTI5NDA4NjU1Mjk0', -100, 1, '2012-11-14 05:41:39', NULL), (92, 0, '021546415716', 'MDIxNTQ2NDE1NzE2', -100, 1, '2012-11-14 05:41:39', NULL), (93, 0, '510034253882', 'NTEwMDM0MjUzODgy', -100, 1, '2012-11-14 05:41:39', NULL), (94, 0, '363206754575', 'MzYzMjA2NzU0NTc1', -100, 1, '2012-11-14 05:41:39', NULL), (95, 0, '250487896065', 'MjUwNDg3ODk2MDY1', -100, 1, '2012-11-14 05:41:39', NULL), (96, 0, '559517956079', 'NTU5NTE3OTU2MDc5', -100, 1, '2012-11-14 05:41:39', NULL), (97, 0, '464168266973', 'NDY0MTY4MjY2OTcz', -100, 1, '2012-11-14 05:41:39', NULL), (98, 0, '202579005997', 'MjAyNTc5MDA1OTk3', -100, 1, '2012-11-14 05:41:39', NULL), (99, 0, '228720294907', 'MjI4NzIwMjk0OTA3', -100, 1, '2012-11-14 05:41:39', NULL), (100, 0, '669378222293', 'NjY5Mzc4MjIyMjkz', -100, 1, '2012-11-14 05:41:39', NULL), (101, 0, '868321641318', 'ODY4MzIxNjQxMzE4', -100, 1, '2012-11-14 05:41:39', NULL), (102, 0, '732343368459', 'NzMyMzQzMzY4NDU5', -100, 1, '2012-11-14 05:41:39', NULL), (103, 0, '215121821923', 'MjE1MTIxODIxOTIz', -100, 1, '2012-11-14 05:41:39', NULL), (104, 0, '943079214441', 'OTQzMDc5MjE0NDQx', -100, 1, '2012-11-14 05:41:39', NULL), (105, 0, '425980426806', 'NDI1OTgwNDI2ODA2', -100, 1, '2012-11-14 05:41:39', NULL), (106, 0, '224934448303', 'MjI0OTM0NDQ4MzAz', -100, 1, '2012-11-14 05:41:39', NULL), (107, 0, '252660509448', 'MjUyNjYwNTA5NDQ4', -100, 1, '2012-11-14 05:41:39', NULL), (108, 0, '649063219710', 'NjQ5MDYzMjE5NzEw', -100, 1, '2012-11-14 05:41:39', NULL), (109, 0, '193038466235', 'MTkzMDM4NDY2MjM1', -100, 1, '2012-11-14 05:41:39', NULL), (110, 0, '325539638064', 'MzI1NTM5NjM4MDY0', -100, 1, '2012-11-14 05:41:39', NULL), (111, 0, '377055366629', 'Mzc3MDU1MzY2NjI5', -100, 1, '2012-11-14 05:41:39', NULL), (112, 0, '440489557152', 'NDQwNDg5NTU3MTUy', -100, 1, '2012-11-14 05:41:39', NULL), (113, 0, '243509580122', 'MjQzNTA5NTgwMTIy', -100, 1, '2012-11-14 05:41:39', NULL), (114, 0, '161648979423', 'MTYxNjQ4OTc5NDIz', -100, 1, '2012-11-14 05:41:39', NULL), (115, 0, '681260085152', 'NjgxMjYwMDg1MTUy', -100, 1, '2012-11-14 05:41:39', NULL), (116, 0, '231073577380', 'MjMxMDczNTc3Mzgw', -100, 1, '2012-11-14 05:41:39', NULL), (117, 0, '058775440674', 'MDU4Nzc1NDQwNjc0', -100, 1, '2012-11-14 05:41:39', NULL), (118, 0, '852432780174', 'ODUyNDMyNzgwMTc0', -100, 1, '2012-11-14 05:41:39', NULL), (119, 0, '380411462128', 'MzgwNDExNDYyMTI4', -100, 1, '2012-11-14 05:41:39', NULL), (120, 0, '389047789938', 'Mzg5MDQ3Nzg5OTM4', -100, 1, '2012-11-14 05:41:39', NULL), (121, 0, '173954659449', 'MTczOTU0NjU5NDQ5', -100, 1, '2012-11-14 05:41:39', NULL), (122, 0, '784793847727', 'Nzg0NzkzODQ3NzI3', -100, 1, '2012-11-14 05:41:39', NULL), (123, 0, '612859694517', 'NjEyODU5Njk0NTE3', -100, 1, '2012-11-14 05:41:39', NULL), (124, 0, '416025083555', 'NDE2MDI1MDgzNTU1', -100, 1, '2012-11-14 05:41:39', NULL), (125, 0, '592667383216', 'NTkyNjY3MzgzMjE2', -100, 1, '2012-11-14 05:41:39', NULL), (126, 0, '698400883736', 'Njk4NDAwODgzNzM2', -100, 1, '2012-11-14 05:41:39', NULL), (127, 0, '088101983683', 'MDg4MTAxOTgzNjgz', -100, 1, '2012-11-14 05:41:39', NULL), (128, 0, '177877234755', 'MTc3ODc3MjM0NzU1', -100, 1, '2012-11-14 05:41:39', NULL), (129, 0, '095255672344', 'MDk1MjU1NjcyMzQ0', -100, 1, '2012-11-14 05:41:39', NULL), (130, 0, '638984482462', 'NjM4OTg0NDgyNDYy', -100, 1, '2012-11-14 05:41:39', NULL), (131, 0, '863758892546', 'ODYzNzU4ODkyNTQ2', -100, 1, '2012-11-14 05:41:39', NULL), (132, 0, '412668582819', 'NDEyNjY4NTgyODE5', -100, 1, '2012-11-14 05:41:39', NULL), (133, 0, '715763135178', 'NzE1NzYzMTM1MTc4', -100, 1, '2012-11-14 05:41:39', NULL), (134, 0, '100937971248', 'MTAwOTM3OTcxMjQ4', -100, 1, '2012-11-14 05:41:39', NULL), (135, 0, '731082307968', 'NzMxMDgyMzA3OTY4', -100, 1, '2012-11-14 05:41:39', NULL), (136, 0, '545520963215', 'NTQ1NTIwOTYzMjE1', -100, 1, '2012-11-14 05:41:39', NULL), (137, 0, '087067858866', 'MDg3MDY3ODU4ODY2', -100, 1, '2012-11-14 05:41:39', NULL), (138, 0, '286593151404', 'Mjg2NTkzMTUxNDA0', -100, 1, '2012-11-14 05:41:39', NULL), (139, 0, '217813940444', 'MjE3ODEzOTQwNDQ0', -100, 1, '2012-11-14 05:41:39', NULL), (140, 0, '662625104688', 'NjYyNjI1MTA0Njg4', -100, 1, '2012-11-14 05:41:39', NULL), (141, 0, '290778759370', 'MjkwNzc4NzU5Mzcw', -100, 1, '2012-11-14 05:41:39', NULL), (142, 0, '453790439422', 'NDUzNzkwNDM5NDIy', -100, 1, '2012-11-14 05:41:39', NULL), (143, 0, '869254261465', 'ODY5MjU0MjYxNDY1', -100, 1, '2012-11-14 05:41:39', NULL), (144, 0, '598164084782', 'NTk4MTY0MDg0Nzgy', -100, 1, '2012-11-14 05:41:39', NULL), (145, 0, '066557352804', 'MDY2NTU3MzUyODA0', -100, 1, '2012-11-14 05:41:39', NULL), (146, 0, '989636962217', 'OTg5NjM2OTYyMjE3', -100, 1, '2012-11-14 05:41:39', NULL), (147, 0, '140120402834', 'MTQwMTIwNDAyODM0', -100, 1, '2012-11-14 05:41:39', NULL), (148, 0, '247441893064', 'MjQ3NDQxODkzMDY0', -100, 1, '2012-11-14 05:41:39', NULL), (149, 0, '751068189595', 'NzUxMDY4MTg5NTk1', -100, 1, '2012-11-14 05:41:39', NULL), (150, 0, '473420946580', 'NDczNDIwOTQ2NTgw', -100, 1, '2012-11-14 05:41:39', NULL), (151, 0, '776569938284', 'Nzc2NTY5OTM4Mjg0', -100, 1, '2012-11-14 05:41:39', NULL), (152, 0, '329257840943', 'MzI5MjU3ODQwOTQz', -100, 1, '2012-11-14 05:41:39', NULL), (153, 0, '950758601949', 'OTUwNzU4NjAxOTQ5', -100, 1, '2012-11-14 05:41:39', NULL), (154, 0, '618623635820', 'NjE4NjIzNjM1ODIw', -100, 1, '2012-11-14 05:41:39', NULL), (155, 0, '864565036939', 'ODY0NTY1MDM2OTM5', -100, 1, '2012-11-14 05:41:39', NULL), (156, 0, '304827833760', 'MzA0ODI3ODMzNzYw', -100, 1, '2012-11-14 05:41:39', NULL), (157, 0, '482343419818', 'NDgyMzQzNDE5ODE4', -100, 1, '2012-11-14 05:41:39', NULL), (158, 0, '247444094924', 'MjQ3NDQ0MDk0OTI0', -100, 1, '2012-11-14 05:41:39', NULL), (159, 0, '505336494532', 'NTA1MzM2NDk0NTMy', -100, 1, '2012-11-14 05:41:39', NULL), (160, 0, '225532714262', 'MjI1NTMyNzE0MjYy', -100, 1, '2012-11-14 05:41:39', NULL), (161, 0, '004586184504', 'MDA0NTg2MTg0NTA0', -100, 1, '2012-11-14 05:41:39', NULL), (162, 0, '419634426562', 'NDE5NjM0NDI2NTYy', -100, 1, '2012-11-14 05:41:39', NULL), (163, 0, '145146841551', 'MTQ1MTQ2ODQxNTUx', -100, 1, '2012-11-14 05:41:39', NULL), (164, 0, '371166942298', 'MzcxMTY2OTQyMjk4', -100, 1, '2012-11-14 05:41:39', NULL), (165, 0, '956703258210', 'OTU2NzAzMjU4MjEw', -100, 1, '2012-11-14 05:41:39', NULL), (166, 0, '411400748011', 'NDExNDAwNzQ4MDEx', -100, 1, '2012-11-14 05:41:39', NULL), (167, 0, '190978497616', 'MTkwOTc4NDk3NjE2', -100, 1, '2012-11-14 05:41:39', NULL), (168, 0, '332895322424', 'MzMyODk1MzIyNDI0', -100, 1, '2012-11-14 05:41:39', NULL), (169, 0, '897318467581', 'ODk3MzE4NDY3NTgx', -100, 1, '2012-11-14 05:41:39', NULL), (170, 0, '559856799609', 'NTU5ODU2Nzk5NjA5', -100, 1, '2012-11-14 05:41:39', NULL), (171, 0, '166265198731', 'MTY2MjY1MTk4NzMx', -100, 1, '2012-11-14 05:41:39', NULL), (172, 0, '118336748370', 'MTE4MzM2NzQ4Mzcw', -100, 1, '2012-11-14 05:41:39', NULL), (173, 0, '715709803198', 'NzE1NzA5ODAzMTk4', -100, 1, '2012-11-14 05:41:39', NULL), (174, 0, '852011248449', 'ODUyMDExMjQ4NDQ5', -100, 1, '2012-11-14 05:41:39', NULL); -- -------------------------------------------------------- -- -- Table structure for table `log` -- CREATE TABLE IF NOT EXISTS `log` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `description` varchar(255) NOT NULL, `date_` datetime NOT NULL, `user` bigint(20) NOT NULL, PRIMARY KEY (`id`), KEY `FK_Log_user` (`user`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `log` -- -- -------------------------------------------------------- -- -- Table structure for table `parameter` -- CREATE TABLE IF NOT EXISTS `parameter` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `key_` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=252 ; -- -- Dumping data for table `parameter` -- INSERT INTO `parameter` (`id`, `version`, `key_`, `value`) VALUES (10, 0, 'E_Comercio', '1012746'), (205, 0, 'mailto', 'info@tuensalada.com.ar'), (206, 0, 'telefono', '(+54) 11-4328-4275'), (207, 0, 'direccion', 'calle Maipu #429'), (208, 0, 'ciudad', 'Buenos Aires'), (209, 0, 'lo ultimo en facebook', 'Esta semana, comprando dos &oacute; m&aacute;s ensaladas te llev&aacute;s de regalo una coca o sprite de litro y medio. Qu&eacute; est&aacute;s esperando?'), (210, 0, 'lo ultimo en twitter', 'Esta semana, comprando dos &oacute; m&aacute;s ensaladas te llev&aacute;s de regalo una coca o sprite de litro y medio. Qu&eacute; est&aacute;s esperando?'), (211, 2, 'lo ultimo en twitter (tiempo)', 'Hace 5hs.'), (213, 0, 'lo ultimo en facebook (tiempo)', 'Hace 2hs.'), (216, 1, 'Hora de Entrega', '12.00, 12.15, 12.30, 12.45, 13.00, 13.15, 13.30, 13.45, 14.00, 14.15, 14.30, 14.45'), (217, 0, 'DineroMail_URL', 'https://argentina.dineromail.com/Shop/Shop_Ingreso.asp'), (218, 5, 'DineroMail_NombreItem', 'Compra #{0}'), (219, 0, 'DineroMail_TipoMoneda', '1'), (220, 1, 'DineroMail_E_Comercio_Augusto', '1012746'), (221, 0, 'DineroMail_NroItem', 'CVD22'), (222, 1, 'DineroMail_image_url', 'http://www.tuensalada.com.ar/s/img/tE-logo.png'), (223, 0, 'DineroMail_DireccionEnvio', '0'), (224, 1, 'DineroMail_DireccionExito', 'http://www.tuensalada.com.ar/s/PaymentSuccess.jsp'), (225, 1, 'DineroMail_DireccionFracaso', 'http://www.tuensalada.com.ar/s/PaymentFail.jsp'), (226, 0, 'DineroMail_Mensaje', 'Mensaje de Prueba'), (227, 0, 'Purchase_mail_subject', 'TuEnsalada compra #{0}'), (228, 1, 'Purchase_mail_body', 'Felicitaciones! Para revisar su pedido, acceda a http://www.tuensalada.com.ar/s/PurchaseView.jsp?{0}'), (229, 0, 'PurchaseDineroMail_enabled', 'true'), (230, 2, 'PurchaseChash_enabled', 'true'), (231, 0, 'DineroMail_E_Comercio_Omar', '1535494'), (232, 0, 'DineroMail_E_Comercio', '1535494'), (233, 0, 'PURCHASE_STATUS_DEFAULT', '3,4'), (234, 4, 'LoadBalancer', '/s1,/s2,/s3'), (235, 0, 'MAIL_SUBJECT_FORGOT_PASSWORD', 'TuEnsalada - Nueva Clave'), (236, 1, 'MAIL_TEXT_FORGOT_PASSWORD', 'EMail: {0}\\n Clave: {1}\\n \\n http://www.tuensalada.com.ar'), (237, 0, 'MAIL_SUBJECT_USER_ACTIVATE', 'Tu Ensalada - Bienvenido!'), (238, 0, 'MAIL_TEXT_USER_ACTIVATE', 'Tu usuario de Tu Ensalada ha sido creado! Para activarlo, por favor acceda a <http://www.tuensalada.com.ar/s/UserEnable.jsp?{0}> dentro de las proximas 24hs'), (239, 0, 'USER_REGISTRATION_VALIDATION_FAIL', 'Validaci&oacute;n incorrecta'), (240, 0, 'USER_REGISTRATION_VALIDATION_OUTDATED', 'El tiempo de validaci&oacute;n ha expirado'), (241, 0, 'USER_REGISTRATION_VALIDATION_OK', 'Bienvenido!'), (242, 0, 'USER_REGISTRATION_VALIDATION_ERROR', 'Error al intentar validar el usuario'), (243, 0, 'USER_STATUS_0', 'Aprobado'), (244, 0, 'USER_STATUS_1', 'Borrador'), (245, 0, 'USER_STATUS_2', 'Pendiente'), (246, 0, 'USER_STATUS_3', 'Rechazado'), (247, 0, 'USER_STATUS_4', 'Eliminado'), (248, 3, 'HOME_QUIERO', '103'), (249, 1, 'PurchaseDineroMail_min', '25'), (250, 0, 'PurchaseCash_max', '200'), (251, 0, 'DineroMail_button_image', 'https://argentina.dineromail.com/imagenes/vender/boton/comprar-gris.gif'); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE IF NOT EXISTS `product` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `name` varchar(255) NOT NULL, `description` varchar(255) default NULL, `price` double NOT NULL, `calories` double default NULL, `status` int(1) NOT NULL, `type` int(1) NOT NULL, `created` datetime NOT NULL, `user` bigint(20) default NULL, PRIMARY KEY (`id`), KEY `FK_Product_user` (`user`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=121 ; -- -- Dumping data for table `product` -- INSERT INTO `product` (`id`, `version`, `name`, `description`, `price`, `calories`, `status`, `type`, `created`, `user`) VALUES (1, 4, 'Coca Cola Zero', '', 6.5, 0, 0, 6, '2012-11-12 22:20:00', NULL), (2, 0, 'Coca Cola Light', '', 6.5, 0, 0, 6, '2012-11-12 22:21:29', NULL), (3, 1, 'Coca Cola', '', 6.5, 80, 0, 6, '2012-11-12 22:25:35', NULL), (4, 1, 'Sprite Zero', '', 6.5, 0, 0, 6, '2012-11-12 22:26:06', NULL), (5, 0, 'Sprite', '', 6.5, 80, 0, 6, '2012-11-12 22:33:51', NULL), (6, 0, 'Fanta', '', 6.5, 80, 0, 6, '2012-11-12 22:34:13', NULL), (7, 0, 'Fanta Pomelo', '', 6.5, 80, 0, 6, '2012-11-12 22:34:39', NULL), (8, 0, 'Ser Citrus', '', 6, 0, 0, 6, '2012-11-12 22:35:05', NULL), (9, 0, 'Ser Durazno', '', 6, 0, 0, 6, '2012-11-12 22:35:40', NULL), (10, 0, 'Levite Manzana', '', 6, 45, 0, 6, '2012-11-12 22:35:56', NULL), (11, 0, 'Levite Pomelo', '', 6, 45, 0, 6, '2012-11-12 22:36:12', NULL), (12, 0, 'Levite Naranja', '', 6, 45, 0, 6, '2012-11-12 22:39:25', NULL), (13, 1, 'Ser Lima', '', 6, 0, 0, 6, '2012-11-12 22:39:39', NULL), (14, 2, 'Pollo', '', 7.5, 170, 0, 3, '2012-11-12 22:41:04', NULL), (15, 1, 'Atun Rojo', '', 15, 127, 0, 3, '2012-11-12 22:41:46', NULL), (16, 1, 'Carne Vacuna (tiras)', '', 6, 158, 2, 3, '2012-11-12 22:42:45', NULL), (17, 0, 'Huevo', '', 3, 100, 0, 3, '2012-11-12 22:43:18', NULL), (18, 0, 'Queso Romano', '', 8, 390, 0, 3, '2012-11-12 22:44:12', NULL), (19, 0, 'Queso Azul', '', 8, 376, 0, 3, '2012-11-12 22:44:36', NULL), (20, 0, 'Queso Fresco', '', 8, 250, 0, 3, '2012-11-12 22:45:03', NULL), (21, 1, 'Jamón Cocido', '', 4, 126, 0, 3, '2012-11-12 22:45:40', NULL), (22, 0, 'Atun (Lomos)', '', 8, 288, 0, 3, '2012-11-12 22:46:16', NULL), (23, 0, 'Caballa', '', 6, 165, 0, 3, '2012-11-12 22:46:45', NULL), (24, 0, 'Sardina', '', 6, 238, 0, 3, '2012-11-12 22:47:09', NULL), (25, 1, 'Salmón', '', 15, 99, 0, 3, '2012-11-12 22:47:45', NULL), (26, 0, 'Kanicama', '', 11, 80, 0, 3, '2012-11-12 22:48:02', NULL), (27, 0, 'Mejjillones', '', 8, 95, 0, 3, '2012-11-12 22:48:19', NULL), (28, 0, 'Camarones', '', 9, 45, 0, 3, '2012-11-12 22:48:36', NULL), (32, 0, 'Tomate Cherry', '', 5, 22, 0, 4, '2012-11-13 17:29:52', NULL), (33, 0, 'Rucula', '', 8, 37, 0, 4, '2012-11-13 17:30:14', NULL), (34, 0, 'Cebolla Verdeo', '', 4, 38, 0, 4, '2012-11-13 17:30:40', NULL), (35, 0, 'Cebolla', '', 3, 38, 0, 4, '2012-11-13 17:33:49', NULL), (36, 0, 'Espinaca', '', 7, 26, 0, 4, '2012-11-13 17:34:14', NULL), (37, 0, 'Morrones Verdes', '', 7, 24, 0, 4, '2012-11-13 17:34:35', NULL), (38, 0, 'Morrones Rojos', '', 8, 24, 0, 4, '2012-11-13 17:35:31', NULL), (39, 1, 'Achicoria', '', 5, 20, 2, 4, '2012-11-13 17:35:51', NULL), (40, 0, 'Repollo Blanco', '', 4, 24, 0, 4, '2012-11-13 17:36:53', NULL), (41, 0, 'Repollo Colorado', '', 4, 31, 0, 4, '2012-11-13 17:37:12', NULL), (42, 0, 'Apio', '', 5, 21, 0, 4, '2012-11-13 17:40:17', NULL), (43, 0, 'Zanahoria', '', 2, 42, 0, 4, '2012-11-13 17:45:56', NULL), (44, 0, 'Radicheta', '', 8, 16, 0, 4, '2012-11-13 17:46:23', NULL), (45, 0, 'Albahaca', '', 3, 27, 0, 4, '2012-11-13 17:49:52', NULL), (46, 0, 'Esparragos', '', 4, 26, 0, 4, '2012-11-13 19:05:50', NULL), (47, 0, 'Pepino', '', 4, 15, 0, 4, '2012-11-13 19:06:23', NULL), (48, 0, 'Palta', '', 6, 162, 0, 4, '2012-11-13 19:06:49', NULL), (49, 1, 'Repollitos de Bruselas', '', 5, 45, 2, 4, '2012-11-13 19:07:27', NULL), (50, 1, 'Chaucha', '', 5, 32, 2, 4, '2012-11-13 20:03:07', NULL), (51, 0, 'Brocoli', '', 5, 32, 0, 4, '2012-11-13 20:03:59', NULL), (52, 1, 'Zucchini', '', 5, 32, 2, 4, '2012-11-13 20:04:30', NULL), (53, 0, 'Remolacha', '', 3, 44, 0, 4, '2012-11-13 20:05:00', NULL), (54, 0, 'Rabanito', '', 7, 16, 0, 4, '2012-11-13 20:05:23', NULL), (55, 0, 'Manzana', '', 4, 58, 0, 4, '2012-11-13 20:06:00', NULL), (56, 0, 'Naranja', '', 2, 42, 0, 4, '2012-11-13 20:06:29', NULL), (57, 0, 'Hinojo', '', 3, 28, 0, 4, '2012-11-13 20:06:54', NULL), (58, 0, 'Lino', '', 0, 0, 0, 10, '2012-11-13 20:07:31', NULL), (59, 0, 'Amapola', '', 0, 0, 0, 10, '2012-11-13 20:08:33', NULL), (60, 0, 'Sesamo', '', 0, 0, 0, 10, '2012-11-13 20:08:52', NULL), (61, 0, 'Girasol', '', 0, 0, 0, 10, '2012-11-13 20:09:18', NULL), (62, 0, 'Chia', '', 0, 0, 0, 10, '2012-11-13 20:09:52', NULL), (63, 0, 'Quinoa', '', 0, 0, 0, 10, '2012-11-13 20:10:49', NULL), (64, 1, 'Germen de Trigo', '', 0, 0, 0, 10, '2012-11-13 20:11:10', NULL), (65, 0, 'Avena', '', 0, 0, 0, 10, '2012-11-13 20:12:02', NULL), (66, 0, 'Nueces', '', 0, 0, 0, 10, '2012-11-13 20:12:20', NULL), (67, 0, 'Almendras', '', 0, 0, 0, 10, '2012-11-13 20:13:01', NULL), (68, 0, 'All Green', 'Rucula, espinaca, olivas verdes y albahaca.', 26, 310, 0, 2, '2012-11-15 16:22:43', NULL), (69, 0, 'Aderezo Cesar', '', 0, 40, 0, 7, '2012-11-15 16:43:29', NULL), (70, 0, 'Vinagreta Ensalada', '', 0, 40, 0, 7, '2012-11-15 16:43:57', NULL), (71, 1, 'Aceite de Maíz', '', 0, 15, 0, 7, '2012-11-15 16:44:20', NULL), (72, 0, 'Vinagre de alcohol', '', 0, 0, 0, 7, '2012-11-15 16:44:39', NULL), (73, 0, 'Vinagre de Manzana', '', 0, 0, 0, 7, '2012-11-15 16:44:59', NULL), (74, 0, 'Sal', '', 0, 0, 0, 7, '2012-11-15 16:45:35', NULL), (75, 0, 'Pimienta', '', 0, 0, 0, 7, '2012-11-15 16:45:53', NULL), (76, 0, 'Aceto', '', 0, 0, 0, 7, '2012-11-15 16:46:10', NULL), (77, 0, 'Aceite de Oliva', '', 0, 50, 0, 7, '2012-11-15 16:46:31', NULL), (78, 0, 'Salsa de Soja', '', 0, 0, 0, 7, '2012-11-15 16:51:19', NULL), (79, 0, 'Jugo de Limon', '', 0, 0, 0, 7, '2012-11-15 16:51:48', NULL), (80, 0, 'Mayonesa', '', 0, 25, 0, 7, '2012-11-15 16:52:24', NULL), (81, 0, 'Mostaza', '', 0, 0, 0, 7, '2012-11-15 16:52:43', NULL), (82, 0, 'Ketchup', '', 0, 0, 0, 7, '2012-11-15 16:53:02', NULL), (83, 0, 'Salsa Golf', '', 0, 15, 0, 7, '2012-11-15 16:53:25', NULL), (84, 0, 'Grisines', '', 0, 25, 0, 7, '2012-11-15 16:54:00', NULL), (85, 0, 'Tostadas', '', 0, 15, 0, 7, '2012-11-15 16:54:24', NULL), (86, 0, 'Manzana Cortada', '', 5, 50, 0, 8, '2012-11-15 16:56:16', NULL), (87, 1, 'Gelatina con Fruta', '', 6, 35, 2, 8, '2012-11-15 16:56:51', NULL), (88, 0, 'Ensalada Frutos Rojos', '', 10, 80, 0, 8, '2012-11-15 16:57:24', NULL), (89, 0, 'Ensalada de Frutas', '', 10, 65, 0, 8, '2012-11-15 16:57:49', NULL), (90, 1, 'Olivas Verdes', '', 5, 132, 0, 4, '2012-11-15 16:59:30', NULL), (91, 0, 'Olivas Negras', '', 5, 320, 0, 4, '2012-11-15 17:00:16', NULL), (103, 4, 'Combo del Caesar Light', 'Enslada Caesar (sin crutones), con bebida y postre', 35, 11, 0, 1, '2012-11-21 03:57:48', NULL), (105, 0, 'Bebida', 'Bebida', 0, 0, 1, 6, '2012-11-21 04:54:09', NULL), (106, 0, 'Postre', 'Postre', 0, 0, 1, 8, '2012-11-21 04:54:21', NULL), (107, 0, 'Orange Bird', 'Zanahoria Rayada,Huevo duro y Pollo a la plancha.', 32, 0, 0, 1, '2012-11-22 09:39:07', NULL), (108, 0, 'Capresse', 'Oliva verde y negra, Queso, Tomate Cherry y Albahaca', 28, 0, 0, 2, '2012-11-22 10:17:24', NULL), (109, 0, 'Mediterranea', 'Mix de Hojas Verdes, Queso Romano, Tomate Cherry y Palmitos', 28, 0, 0, 2, '2012-11-22 10:26:55', NULL), (110, 0, 'Lechuga Mantecosa', '', 2, 0, 0, 4, '2012-11-22 10:28:06', NULL), (111, 0, 'Lechuga Morada', '', 2, 0, 0, 4, '2012-11-22 10:28:23', NULL), (112, 0, 'Lechuga Francesa', '', 2, 0, 0, 4, '2012-11-22 10:28:36', NULL), (113, 0, 'Palmito', '', 6, 0, 0, 4, '2012-11-22 10:30:17', NULL), (114, 0, 'Fresh Tuna', 'Atun rojo, Repollo blanco, Repollo Colorado, Lechuga francesa y Tomates Cherry', 40, 0, 0, 1, '2012-11-22 10:35:01', NULL), (115, 0, 'Querandy Azul', 'Hojas Verdes, Tomates Cherry, Queso Roquefort, Huevo Rayado, Crutons.', 26, 0, 0, 2, '2012-11-22 10:49:32', NULL), (116, 0, 'Nombre', NULL, 35, NULL, 0, 2, '2012-11-22 10:45:36', 20), (117, 0, 'Nombre', NULL, 28, NULL, 0, 2, '2012-11-22 10:48:19', 20), (118, 0, 'Nombre', NULL, 6.5, NULL, 0, 2, '2012-11-22 10:48:51', 20), (119, 0, 'Nombre', NULL, 32, NULL, 0, 2, '2012-11-22 10:49:53', 20), (120, 0, 'Nombre', NULL, 61, NULL, 0, 2, '2012-11-22 13:04:08', 21); -- -------------------------------------------------------- -- -- Table structure for table `productproduct` -- CREATE TABLE IF NOT EXISTS `productproduct` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `parent` bigint(20) NOT NULL, `child` bigint(20) NOT NULL, `count` double NOT NULL, `unit` int(1) NOT NULL, PRIMARY KEY (`id`), KEY `FK_ProductProduct_parent` (`parent`), KEY `FK_ProductProduct_child` (`parent`), KEY `FK_ProductProduct_chiuld` (`child`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=64 ; -- -- Dumping data for table `productproduct` -- INSERT INTO `productproduct` (`id`, `version`, `parent`, `child`, `count`, `unit`) VALUES (26, 0, 103, 105, 1, 1), (28, 0, 103, 106, 1, 1), (29, 0, 107, 105, 1, 1), (30, 0, 107, 106, 1, 1), (31, 0, 107, 43, 1, 1), (32, 0, 107, 14, 1, 1), (33, 0, 107, 17, 2, 1), (34, 0, 108, 32, 2, 1), (35, 0, 108, 90, 1, 1), (36, 0, 108, 91, 1, 1), (37, 0, 108, 20, 1, 1), (38, 0, 108, 45, 1, 1), (39, 0, 109, 110, 1, 1), (40, 0, 109, 112, 1, 1), (41, 0, 109, 33, 1, 1), (42, 0, 109, 18, 1, 1), (43, 0, 109, 32, 1, 1), (44, 0, 109, 113, 1, 1), (45, 0, 114, 15, 1, 1), (46, 0, 114, 40, 1, 1), (48, 0, 114, 112, 1, 1), (49, 0, 114, 32, 2, 1), (50, 0, 114, 41, 1, 1), (51, 0, 114, 105, 1, 1), (52, 0, 114, 106, 1, 1), (53, 0, 115, 33, 1, 1), (54, 0, 115, 111, 1, 1), (55, 0, 115, 32, 1, 1), (56, 0, 115, 17, 1, 1), (57, 0, 116, 103, 1, 1), (58, 0, 117, 109, 1, 1), (59, 0, 118, 7, 1, 1), (60, 0, 119, 107, 1, 1), (61, 0, 115, 19, 1, 1), (62, 0, 120, 103, 1, 1), (63, 0, 120, 68, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `productproducttype` -- CREATE TABLE IF NOT EXISTS `productproducttype` ( `productId` bigint(20) NOT NULL, `productTypeId` bigint(20) NOT NULL, PRIMARY KEY (`productId`,`productTypeId`), UNIQUE KEY `UK_PPT_productProductType` (`productId`,`productTypeId`), KEY `FK_PPT_product` (`productId`), KEY `FK_PPT_productType` (`productTypeId`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `productproducttype` -- -- -------------------------------------------------------- -- -- Table structure for table `producttype` -- CREATE TABLE IF NOT EXISTS `producttype` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `name` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_ProductType_name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -- -- Dumping data for table `producttype` -- -- -------------------------------------------------------- -- -- Table structure for table `purchase` -- CREATE TABLE IF NOT EXISTS `purchase` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `customer` bigint(20) NOT NULL, `status` int(1) NOT NULL, `created` datetime NOT NULL, `total` double NOT NULL, `paymentType` int(1) NOT NULL, `address` bigint(20) NOT NULL, `deliveryTime` varchar(255) NOT NULL, `comment` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `FK_Purchase_user` (`customer`), KEY `FK_Purchase_address` (`address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; -- -- Dumping data for table `purchase` -- INSERT INTO `purchase` (`id`, `version`, `customer`, `status`, `created`, `total`, `paymentType`, `address`, `deliveryTime`, `comment`) VALUES (8, 2, 20, 0, '2012-11-22 10:51:24', 1.5, 1, 16, '14.00', 'Oficina saliendo del ascensor a la derecha. Empresa VMN+'), (9, 1, 21, 0, '2012-11-22 13:08:42', -39, 1, 17, '14.45', ''); -- -------------------------------------------------------- -- -- Table structure for table `purchaseitem` -- CREATE TABLE IF NOT EXISTS `purchaseitem` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `purchase` bigint(20) NOT NULL, `position` int(2) NOT NULL, `product` bigint(20) NOT NULL, `description` varchar(255) NOT NULL, `count` int(2) NOT NULL, `price` double NOT NULL, PRIMARY KEY (`id`), KEY `FK_PurchaseItem_purchase` (`purchase`), KEY `FK_PurchaseItem_product` (`product`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; -- -- Dumping data for table `purchaseitem` -- INSERT INTO `purchaseitem` (`id`, `version`, `purchase`, `position`, `product`, `description`, `count`, `price`) VALUES (9, 0, 8, 1, 116, 'Nombre (Combo del Caesar Light (Bebida (1), Postre (1)) (1))', 0, 35), (10, 0, 8, 2, 117, 'Nombre (Mediterranea (Lechuga Mantecosa (1), Lechuga Francesa (1), Rucula (1), Queso Romano (1), Tomate Cherry (1), Palmito (1)) (1))', 0, 28), (11, 0, 8, 3, 118, 'Nombre (Fanta Pomelo (1))', 0, 6.5), (12, 0, 8, 4, 119, 'Nombre (Orange Bird (Bebida (1), Postre (1), Zanahoria (1), Pollo (1), Huevo (2)) (1))', 0, 32), (13, 0, 9, 1, 120, 'Nombre (Combo del Caesar Light (Bebida (1), Postre (1)) (1), All Green (1))', 0, 61); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `status` int(1) NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_User_email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `version`, `firstname`, `lastname`, `email`, `password`, `status`, `created`) VALUES (2, 5, 'Augusto', 'Soncini', 'augustosoncini@hotmail.com', 'dHVlbkdFTFA=', 0, '2012-09-09 00:00:00'), (9, 0, 'Omar', 'Bianchimano', 'obianchimano@gmail.com', 'ZGFsZUxPQk8=', 0, '2012-11-18 22:47:41'), (10, 4, 'Magdalena', 'Del val', 'magdadelval@hotmail.com', 'bG9jdXJhMDE=', 0, '2012-11-19 10:54:45'), (11, 0, 'Graciana', 'Fornetti', 'gracianafornetti@hotmail.com', 'bG9jdXJhMDE=', 1, '2012-11-19 10:57:09'), (12, 4, 'Valentino', 'Soncini', 'valentinosoncini@gmail.com', 'dHVlbkdFTFA=', 0, '2012-11-19 15:20:56'), (14, 0, 'Federico', 'Bianchimano', 'fbianchimano@hotmail.com', 'bG9jdXJhMDI=', 0, '2012-11-19 20:05:09'), (19, 0, 'Augusto', 'Soncini', 'augustosoncini@gmail.com', 'dHVlbkdFTFA=', 0, '2012-11-21 01:08:24'), (20, 0, 'Fabio', 'Sottile', 'fabiocsottile@gmail.com', 'MjIwMzIwMDM=', 0, '2012-11-22 10:37:47'), (21, 0, 'magda', 'del val', 'magdadelval@gmail.com', 'bWFnZGExOTc5', 0, '2012-11-22 12:56:51'), (22, 0, 'JUAN CARLOS', 'FERRARA', 'juancarlosferrara@gmail.com', 'MTFTVU1BMjA=', 0, '2012-11-22 13:59:17'); -- -------------------------------------------------------- -- -- Table structure for table `useraccess` -- CREATE TABLE IF NOT EXISTS `useraccess` ( `id` bigint(20) NOT NULL auto_increment, `version` bigint(20) NOT NULL default '0', `user` bigint(20) NOT NULL, `access` bigint(20) NOT NULL, PRIMARY KEY (`id`), KEY `FK_UserAccess_user` (`user`), KEY `FK_UserAccess_access` (`access`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ; -- -- Dumping data for table `useraccess` -- INSERT INTO `useraccess` (`id`, `version`, `user`, `access`) VALUES (1, 0, 2, 2), (4, 0, 2, 1), (5, 0, 2, 3), (6, 0, 2, 4), (7, 0, 2, 5), (8, 0, 2, 6), (9, 0, 9, 1), (10, 0, 9, 2), (11, 0, 9, 3), (12, 0, 9, 4), (13, 0, 9, 5), (14, 0, 9, 6), (15, 0, 2, 7), (16, 0, 2, 8), (17, 0, 9, 7), (18, 0, 9, 8), (19, 0, 2, 9), (20, 0, 2, 10), (21, 0, 9, 9), (22, 0, 9, 10); -- -- Constraints for dumped tables -- -- -- Constraints for table `address` -- ALTER TABLE `address` ADD CONSTRAINT `FK_Address_customer` FOREIGN KEY (`customer`) REFERENCES `user` (`id`); -- -- Constraints for table `giftcard` -- ALTER TABLE `giftcard` ADD CONSTRAINT `FK_GiftCard_user` FOREIGN KEY (`user`) REFERENCES `user` (`id`); -- -- Constraints for table `log` -- ALTER TABLE `log` ADD CONSTRAINT `FK_Log_user` FOREIGN KEY (`user`) REFERENCES `user` (`id`); -- -- Constraints for table `product` -- ALTER TABLE `product` ADD CONSTRAINT `FK_Product_user` FOREIGN KEY (`user`) REFERENCES `user` (`id`); -- -- Constraints for table `productproduct` -- ALTER TABLE `productproduct` ADD CONSTRAINT `FK_ProductProduct_chiuld` FOREIGN KEY (`child`) REFERENCES `product` (`id`), ADD CONSTRAINT `FK_ProductProduct_parent` FOREIGN KEY (`parent`) REFERENCES `product` (`id`); -- -- Constraints for table `productproducttype` -- ALTER TABLE `productproducttype` ADD CONSTRAINT `FK_PPT_product` FOREIGN KEY (`productId`) REFERENCES `product` (`id`), ADD CONSTRAINT `FK_PPT_productType` FOREIGN KEY (`productTypeId`) REFERENCES `producttype` (`id`); -- -- Constraints for table `purchase` -- ALTER TABLE `purchase` ADD CONSTRAINT `FK_Purchase_address` FOREIGN KEY (`address`) REFERENCES `address` (`id`), ADD CONSTRAINT `FK_Purchase_user` FOREIGN KEY (`customer`) REFERENCES `user` (`id`); -- -- Constraints for table `purchaseitem` -- ALTER TABLE `purchaseitem` ADD CONSTRAINT `FK_PurchaseItem_product` FOREIGN KEY (`product`) REFERENCES `product` (`id`), ADD CONSTRAINT `FK_PurchaseItem_purchaser` FOREIGN KEY (`purchase`) REFERENCES `purchase` (`id`); -- -- Constraints for table `useraccess` -- ALTER TABLE `useraccess` ADD CONSTRAINT `FK_UserAccess_access` FOREIGN KEY (`access`) REFERENCES `access` (`id`), ADD CONSTRAINT `FK_UserAccess_user` FOREIGN KEY (`user`) REFERENCES `user` (`id`);
true
9ac7bf0e66ac5bd9282893689617be302acb7fbf
SQL
macctown/DataProtector
/DB/data_protector_USER_PROFILE.sql
UTF-8
2,012
2.84375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.6.19, for osx10.7 (i386) -- -- Host: 127.0.0.1 Database: data_protector -- ------------------------------------------------------ -- Server version 5.6.15 /*!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 `USER_PROFILE` -- DROP TABLE IF EXISTS `USER_PROFILE`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `USER_PROFILE` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `type` varchar(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `type` (`type`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `USER_PROFILE` -- LOCK TABLES `USER_PROFILE` WRITE; /*!40000 ALTER TABLE `USER_PROFILE` DISABLE KEYS */; INSERT INTO `USER_PROFILE` VALUES (4,'Admin'),(3,'Advanced'),(1,'Basic'),(2,'Premium'); /*!40000 ALTER TABLE `USER_PROFILE` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2016-10-24 14:46:00
true
de37fc712ad525674301bac179c1b134f3ea76cb
SQL
jmausolf/OpenFEC
/fec_download/sql_clean/create_schedule_a_company_qc.sql
UTF-8
1,855
3.421875
3
[ "Apache-2.0" ]
permissive
--create new table with desired specs DROP TABLE if exists schedule_a_cleaned; CREATE TABLE schedule_a_cleaned ( --info about individual contributor contributor_name TEXT, contributor_employer TEXT, contributor_occupation TEXT, contributor_city TEXT, contributor_state TEXT, contributor_zip_code TEXT, contributor_cycle TEXT, --individual about cmte cmte_id TEXT NOT NULL, cmte_nm TEXT, cmte_pty_affiliation TEXT, cmte_dsgn TEXT, cmte_type TEXT, cmte_filing_freq TEXT, cmte_org_tp TEXT, cmte_connected_org_nm TEXT, --info about cmte parties party_id TEXT, partisan_score NUMERIC, cmte_cycle TEXT, --info about candidates cand_id TEXT, cand_name TEXT, cand_pty_affiliation TEXT, cand_election_yr NUMERIC, cand_office TEXT, cand_pcc TEXT, --info about contribution contributor_transaction_dt TEXT, contributor_transaction_amt TEXT, contributor_transaction_pgi TEXT, contributor_transaction_tp TEXT, --other info about contribution contributor_amndt_ind TEXT, contributor_rpt_tp TEXT, contributor_image_num TEXT, contributor_entity_tp TEXT, contributor_other_id TEXT, contributor_tran_id TEXT, contributor_file_num NUMERIC, contributor_memo_cd TEXT, contributor_memo_text TEXT, sub_id TEXT NOT NULL, --requested company --added to tmp after its creation cid TEXT, --qc cleaning cols cid_master TEXT, contributor_employer_clean TEXT, contributor_occupation_clean TEXT, emp_count NUMERIC, occ_count NUMERIC, cid_valid TEXT, executive_emp TEXT, executive_occ TEXT, director_emp TEXT, director_occ TEXT, manager_emp TEXT, manager_occ TEXT, rank_emp NUMERIC, rank_occ NUMERIC ); CREATE UNIQUE INDEX idx_schedule_a_cleaned ON schedule_a_cleaned (sub_id);
true
0ec142bd674e8620d40bbba43547661672ff0024
SQL
CUBRID/cubrid-testcases
/sql/_13_issues/_10_1h/cases/bug_3024.sql
UTF-8
423
3.40625
3
[ "BSD-3-Clause" ]
permissive
create table tbisnull (a int); insert into tbisnull values (null), (0), (1); select isnull (null), isnull (0), isnull (1); prepare s from 'select isnull( ? ), isnull ( ? ), isnull ( ? )'; execute s using null, 0, 1; deallocate prepare s; select a, isnull (a) from tbisnull order by 1; select a, isnull (a + 1) from tbisnull order by 1; select a from tbisnull where isnull (a) <> 1 order by 1; drop table tbisnull;
true
80288886d1425ee5b294c4dc037829c7be390727
SQL
yefc/CBOE
/subprojects/Classic/ChemInv/config/oracle_install_scripts/Create_blank_ChemInv_DB/sql/Patches/Patch 12.3.0/Alter/Alter_Inv_requests.sql
UTF-8
501
2.90625
3
[]
no_license
Alter table INV_REQUESTS add( "PROOF_APPROVAL" BLOB, "PROOF_APPROVAL_FILENAME" VARCHAR2(100 BYTE), "PROOF_APPROVAL_FILETYPE" VARCHAR2(10 BYTE), "PROOF_APPROVAL_FILESIZE" NUMBER(10,0), "SPECIAL_INSTRUCTIONS" VARCHAR2(1000 BYTE), "BATCH_TYPE_ID_FK" Number, CONSTRAINT "INV_REQUEST_BATCH_TYPE_ID_FK" FOREIGN KEY ("BATCH_TYPE_ID_FK") REFERENCES "INV_BATCH_TYPE" ("ID") ENABLE ); ALTER TABLE INV_REQUESTS MODIFY (DELIVERED_BY_ID_FK VARCHAR2(30)); ALTER TABLE INV_REQUESTS MODIFY BATCH_ID_FK number;
true
71ae025280eb104b514dde38c16bcdb058537bf1
SQL
nebocco/MyGiri-backend
/sql-client/config/init.sql
UTF-8
3,974
3.625
4
[]
no_license
DROP TABLE IF EXISTS users; CREATE TABLE users ( user_id VARCHAR(30) NOT NULL, display_name VARCHAR(40), hash VARCHAR(128) NOT NULL, login_session VARCHAR(128) NOT NULL, PRIMARY KEY (user_id) ); CREATE INDEX ON users (LOWER(user_id)); DROP TABLE IF EXISTS themes; CREATE TABLE themes ( id SERIAL NOT NULL, user_id VARCHAR(30) NOT NULL, epoch_open TIMESTAMPTZ NOT NULL, theme_text VARCHAR(128) NOT NULL, updated BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (id) ); CREATE INDEX ON themes (user_id); CREATE INDEX ON themes (epoch_open); DROP TABLE IF EXISTS answers; CREATE TABLE answers ( id SERIAL UNIQUE, user_id VARCHAR(30) NOT NULL, theme_id INTEGER NOT NULL, epoch_submit TIMESTAMPTZ NOT NULL, answer_text VARCHAR(128) NOT NULL, score INTEGER NOT NULL, voted BOOLEAN NOT NULL, PRIMARY KEY (user_id, theme_id) ); CREATE INDEX ON answers (id); CREATE INDEX ON answers (user_id); CREATE INDEX ON answers (theme_id); DROP TABLE IF EXISTS login_history; CREATE TABLE login_history ( user_id VARCHAR(30) NOT NULL, epoch_login TIMESTAMPTZ NOT NULL, PRIMARY KEY (user_id) ); DROP TABLE IF EXISTS votes; CREATE TABLE votes ( user_id VARCHAR(30) NOT NULL, theme_id INTEGER NOT NULL, answer_id INTEGER NOT NULL, score INTEGER NOT NULL, PRIMARY KEY (user_id, theme_id, answer_id) ); CREATE INDEX ON votes (user_id, theme_id); CREATE INDEX ON votes (theme_id); DROP TABLE IF EXISTS profiles; CREATE TABLE profiles ( user_id VARCHAR(30) NOT NULL, heart INTEGER, star INTEGER, answer INTEGER, theme INTEGER, self_vote INTEGER, top_count INTEGER, PRIMARY KEY (user_id) ); -- for debugging -- INSERT INTO users (user_id, display_name, hash, login_session) VALUES ('$user1', 'USER 1', '', ''), ('$user2', NULL, '', ''), ('$user3', 'USER 3', '', ''), ('$user4', 'USER 4', '', ''); INSERT INTO themes (user_id, epoch_open, theme_text) VALUES ('admin', CURRENT_TIMESTAMP - interval '2 days 16 hours', 'theme1'), ('admin', CURRENT_TIMESTAMP - interval '2 days 8 hours', 'theme2'), ('admin', CURRENT_TIMESTAMP - interval '2 days 0 hours', 'theme3'), ('admin', CURRENT_TIMESTAMP - interval '1 days 16 hours', '日本一安い旅館、どんなの?'), ('admin', CURRENT_TIMESTAMP - interval '1 days 8 hours', '「この忍者、センスないな」どうしてそう思った?'), ('admin', CURRENT_TIMESTAMP - interval '1 days 0 hours', 'ランチ5000円のサイゼリヤ、普通と何が違う?'), ('admin', CURRENT_TIMESTAMP - interval '0 days 16 hours', '「あ、このお坊さん偽物だな」なぜ分かった?'), ('admin', CURRENT_TIMESTAMP - interval '0 days 8 hours', '引っ越しの達人の特徴を教えてください'), ('admin', CURRENT_TIMESTAMP - interval '0 days 0 hours', '卒業式のしおりに書かれていた驚きのプログラムとは?'); INSERT INTO answers (user_id, theme_id, epoch_submit, answer_text, score, voted) VALUES ('$user1', 4, CURRENT_TIMESTAMP, 'user1_answer', 0, FALSE), ('$user2', 4, CURRENT_TIMESTAMP, 'user2_answer', 0, FALSE), ('$user3', 4, CURRENT_TIMESTAMP, 'user3_answer', 0, TRUE), ('$user1', 5, CURRENT_TIMESTAMP, 'user1_answer', 0, FALSE), ('$user2', 5, CURRENT_TIMESTAMP, 'user2_answer', 0, FALSE), ('$user3', 5, CURRENT_TIMESTAMP, 'user3_answer', 0, FALSE), ('$user1', 6, CURRENT_TIMESTAMP, 'user1_answer', 0, FALSE), ('$user2', 6, CURRENT_TIMESTAMP, 'user2_answer', 0, FALSE), ('$user3', 6, CURRENT_TIMESTAMP, 'user3_answer', 0, FALSE); INSERT INTO votes (user_id, theme_id, answer_id, score) VALUES ('$user3', 4, 1, 100000), ('$user3', 4, 2, 1), ('$user2', 4, 1, 100000), ('$user2', 4, 3, 1), ('$user3', 5, 4, 100000), ('$user3', 5, 5, 1), ('$user2', 5, 4, 100000), ('$user2', 5, 6, 1), ('$user3', 6, 7, 100000), ('$user3', 6, 8, 1), ('$user2', 6, 7, 100000), ('$user2', 6, 9, 1);
true
c2f323565c359ffdd076dd4791e46791e3f8492d
SQL
jewellwk/sample-code
/MySQL/Women in Tech Project/womentech/womentech_women_csc.sql
UTF-8
2,401
3.0625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64) -- -- Host: localhost Database: womentech -- ------------------------------------------------------ -- Server version 5.7.20 /*!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 `women_csc` -- DROP TABLE IF EXISTS `women_csc`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `women_csc` ( `Occupation` text, `Women` double DEFAULT NULL, `Men` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `women_csc` -- LOCK TABLES `women_csc` WRITE; /*!40000 ALTER TABLE `women_csc` DISABLE KEYS */; INSERT INTO `women_csc` VALUES ('All occupations',0.47,0.53),('Computer and information systems managers',0.27,0.73),('Computer systems analysts',0.34,0.66),('Information security analysts',0.18,0.82),('Computer programmers',0.21,0.79),('Software developers, applications and systems software',0.2,0.8),('Web developers',0.35,0.65),('Computer support specialists',0.27,0.73),('Database administrators',0.28,0.72),('Network and computer systems administrators',0.19,0.81),('Computer network architects',0.12,0.88),('Computer occupations, all other',0.23,0.77); /*!40000 ALTER TABLE `women_csc` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2018-05-01 11:01:49
true
0e6e890f35095460ba7dfb9e0e75a9c07ec49edf
SQL
MaiconFiuza/Atividades-Generation
/Módulo 2/MySql/Exercícios 22-04 E 23-04/Exercício 1/DML.sql
UTF-8
1,129
2.640625
3
[]
no_license
INSERT INTO tb_classe(class_tipo,class_habilidadeEspecial) VALUES("Mago","Fazer sair rainho da mão"); INSERT INTO tb_classe(class_tipo,class_habilidadeEspecial) VALUES("Arqueiro","Atirar coisa de longe"); INSERT INTO tb_classe(class_tipo,class_habilidadeEspecial) VALUES("Metaleiro","Fazer bate cabeça"); INSERT INTO tb_classe(class_tipo,class_habilidadeEspecial) VALUES("Forrozeiro","Dançar agarradinho"); INSERT INTO tb_classe(class_tipo,class_habilidadeEspecial) VALUES("Guerreiro","Dar machadada nos outros"); INSERT INTO tb_personagem(character_nome,tb_classe_class_id,ataque,defesa) VALUES("Maicon",4,3000,2300) , ("Maicon",4,3000,2300), ("Euclides",3,1000,4300), ("Arrow",2,1000,2000), ("Kratos",5,9000,1600), ("Gandolf",1,8000,8000), ("Harry Potter",1,5000,3300), ("Arrow cópia barata",2,500,1000); SELECT * FROM tb_personagem WHERE ataque>2000; SELECT * FROM tb_personagem WHERE defesa BETWEEN 1000 AND 2000; SELECT * FROM tb_personagem WHERE character_nome LIKE '%C'; SELECT * FROM tb_personagem p INNER JOIN tb_classe c ON p.tb_classe_class_id = c.class_id; SELECT * FROM tb_personagem WHERE tb_classe_class_id=2;
true
cedfdaec5790d19b681aa012c1d01077cb483378
SQL
sangamnishad/IQTest
/test.sql
UTF-8
36,361
2.84375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 20, 2021 at 05:56 AM -- Server version: 10.4.10-MariaDB -- PHP Version: 7.3.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `test` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(100) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `username`, `password`) VALUES (1, 'admin', 'Test@123'); -- -------------------------------------------------------- -- -- Table structure for table `answer` -- CREATE TABLE `answer` ( `id` int(100) NOT NULL, `qid` text NOT NULL, `ansid` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `answer` -- INSERT INTO `answer` (`id`, `qid`, `ansid`) VALUES (7, '5e2170d8b576c', '5e2170d8cb1f3'), (8, '5e2170d950238', '5e2170d9718ee'), (9, '5e241cbd9e138', '5e241cbdcce63'), (10, '5e241cbe6c227', '5e241cbe84360'), (11, '5e241cbee00b7', '5e241cbf01889'), (12, '5e241cbf5048d', '5e241cbf5e9c0'), (13, '5e241cbfd5a1e', '5e241cbfe5aa8'), (14, '5e241cc04d898', '5e241cc083e7b'), (15, '5e241cc0eae7a', '5e241cc109cf5'), (16, '5e241cc1530f8', '5e241cc161677'), (17, '5e241cc1eeeec', '5e241cc21faba'), (18, '5e241cc26e2e7', '5e241cc278f08'), (19, '5e241cc2d7e4e', '5e241cc3ad6b9'), (20, '5e241cc41cde6', '5e241cc42a542'), (21, '5e241cc48edb9', '5e241cc4b3d3b'), (22, '5e241cc52fe55', '5e241cc53e2b3'), (23, '5e241cc5c24ad', '5e241cc5e0351'), (24, '5e241cc63abf5', '5e241cc6484dc'), (25, '5e241cc6bd04a', '5e241cc717455'), (26, '5e241cc775cc3', '5e241cc787a25'), (27, '5e241cc7bf7cc', '5e241cc7ca75d'), (28, '5e241cc8d7f26', '5e241cc8e6862'), (29, '5e241cc948567', '5e241cc95315c'), (30, '5e241cc98ee42', '5e241cc999a7d'), (31, '5e241cc9cff63', '5e241cc9de829'), (32, '5e241cca357e3', '5e241cca42e9d'), (33, '5e241ccabce23', '5e241ccac7fcd'), (34, '5e2459ac2847b', '5e2459ac85550'), (35, '5e2459ace5f74', '5e2459ad04ec2'), (36, '5e2459ad7a71e', '5e2459ad8abe1'), (37, '5e2459ae17d4c', '5e2459ae2aee3'), (38, '5e2459ae64c42', '5e2459aed3234'), (39, '5e2459b0071d4', '5e2459b04f247'), (40, '5e2459b09749d', '5e2459b0ae130'), (41, '5e2459b10fc8b', '5e2459b11a86b'), (42, '5e2459b16ede1', '5e2459b17c2ea'), (43, '5e2459b1bd487', '5e2459b1c88da'), (44, '5e2459b21ff43', '5e2459b22af0f'), (45, '5e2459b27c38f', '5e2459b2872a1'), (46, '5e2459b2d5bab', '5e2459b2e0b53'), (47, '5e2459b33307f', '5e2459b33dff8'), (48, '5e2459b3845d1', '5e2459b394cca'), (49, '5e2459b3ee5fd', '5e2459b404ef6'), (50, '5e2459b43b538', '5e2459b44b79a'), (51, '5e2459b481daf', '5e2459b48c911'), (52, '5e2459b4c2f4b', '5e2459b4ce679'), (53, '5e2459b520106', '5e2459b52b07a'), (54, '5e2459b5668b7', '5e2459b579a65'), (55, '5e2459b6f3b51', '5e2459b72827c'), (56, '5e2459b8859a0', '5e2459b894b88'), (57, '5e2459b926af6', '5e2459b9510be'), (58, '5e2459ba5bca8', '5e2459ba67bd5'), (66, '5e2fb34a13bfe', '5e2fb34a236f7'), (67, '5e2fb34a6bea6', '5e2fb34a79796'), (68, '5e2fb34b0791d', '5e2fb34b1b260'), (69, '5e2fb34b54498', '5e2fb34b5ef86'), (70, '5e2fb34ba80b1', '5e2fb34bc5c69'); -- -------------------------------------------------------- -- -- Table structure for table `feedback` -- CREATE TABLE `feedback` ( `id` text NOT NULL, `name` varchar(50) NOT NULL, `username` varchar(50) NOT NULL, `subject` varchar(500) NOT NULL, `feedback` varchar(500) NOT NULL, `date` date NOT NULL, `time` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Table structure for table `history` -- CREATE TABLE `history` ( `id` int(100) NOT NULL, `username` varchar(50) NOT NULL, `eid` text NOT NULL, `score` int(11) NOT NULL, `level` int(11) NOT NULL, `correct` int(11) NOT NULL, `wrong` int(11) NOT NULL, `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `timestamp` bigint(50) NOT NULL, `status` varchar(40) NOT NULL, `score_updated` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `history` -- INSERT INTO `history` (`id`, `username`, `eid`, `score`, `level`, `correct`, `wrong`, `date`, `timestamp`, `status`, `score_updated`) VALUES (19, ' ', '5e241883a5f97', 6, 13, 6, 5, '2020-01-21 06:34:58', 1579588331, 'finished', 'true'), (25, 'user1313', '5e2fb270f1792', 0, 0, 0, 0, '2020-02-23 05:16:43', 1582435002, 'finished', 'true'); -- -------------------------------------------------------- -- -- Table structure for table `options` -- CREATE TABLE `options` ( `id` int(100) NOT NULL, `qid` varchar(50) NOT NULL, `option` varchar(5000) NOT NULL, `optionid` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `options` -- INSERT INTO `options` (`id`, `qid`, `option`, `optionid`) VALUES (33, '5e241cbd9e138', '10', '5e241cbdcce63'), (34, '5e241cbd9e138', '20', '5e241cbdcce6e'), (35, '5e241cbd9e138', '30', '5e241cbdcce6f'), (36, '5e241cbd9e138', '40', '5e241cbdcce70'), (37, '5e241cbe6c227', '100', '5e241cbe84356'), (38, '5e241cbe6c227', '200', '5e241cbe8435f'), (39, '5e241cbe6c227', '1', '5e241cbe84360'), (40, '5e241cbe6c227', '0', '5e241cbe84362'), (41, '5e241cbee00b7', ' ∞', '5e241cbf01882'), (42, '5e241cbee00b7', 'googol', '5e241cbf01887'), (43, '5e241cbee00b7', 'googolplex', '5e241cbf01889'), (44, '5e241cbee00b7', 'gram', '5e241cbf0188a'), (45, '5e241cbf5048d', '1 followed by hundred zeros', '5e241cbf5e9c0'), (46, '5e241cbf5048d', '1 followed by thousand zeros', '5e241cbf5e9d5'), (47, '5e241cbf5048d', '1 followed by ten thousand zeros', '5e241cbf5e9d6'), (48, '5e241cbf5048d', '1 followed by 1 lakh zeros', '5e241cbf5e9d7'), (49, '5e241cbfd5a1e', '-1', '5e241cbfe5aa2'), (50, '5e241cbfd5a1e', '0', '5e241cbfe5aa8'), (51, '5e241cbfd5a1e', '1', '5e241cbfe5aaa'), (52, '5e241cbfd5a1e', 'e', '5e241cbfe5aab'), (53, '5e241cc04d898', 'Natural', '5e241cc083e7b'), (54, '5e241cc04d898', 'Whole', '5e241cc083e82'), (55, '5e241cc04d898', 'Rational', '5e241cc083e84'), (56, '5e241cc04d898', 'Odd', '5e241cc083e89'), (57, '5e241cc0eae7a', 'Even number', '5e241cc109cf5'), (58, '5e241cc0eae7a', 'Natural number', '5e241cc109cfe'), (59, '5e241cc0eae7a', 'Odd number', '5e241cc109d01'), (60, '5e241cc0eae7a', 'Whole number', '5e241cc109d04'), (61, '5e241cc1530f8', 'Hindu Arabic system', '5e241cc161672'), (62, '5e241cc1530f8', 'Roman', '5e241cc161677'), (63, '5e241cc1530f8', 'Egyptian', '5e241cc161678'), (64, '5e241cc1530f8', 'Mesopotamia', '5e241cc161679'), (65, '5e241cc1eeeec', '10,000', '5e241cc21fab1'), (66, '5e241cc1eeeec', '50,000', '5e241cc21fab8'), (67, '5e241cc1eeeec', '10,00,000', '5e241cc21faba'), (68, '5e241cc1eeeec', '500', '5e241cc21fabb'), (69, '5e241cc26e2e7', '100', '5e241cc278f03'), (70, '5e241cc26e2e7', '500', '5e241cc278f08'), (71, '5e241cc26e2e7', '1,000', '5e241cc278f09'), (72, '5e241cc26e2e7', '50', '5e241cc278f0a'), (73, '5e241cc2d7e4e', 'VM', '5e241cc3ad6b1'), (74, '5e241cc2d7e4e', 'V', '5e241cc3ad6b9'), (75, '5e241cc2d7e4e', 'MMMMM', '5e241cc3ad6bc'), (76, '5e241cc2d7e4e', 'MX', '5e241cc3ad6be'), (77, '5e241cc41cde6', 'N', '5e241cc42a53d'), (78, '5e241cc41cde6', 'R', '5e241cc42a541'), (79, '5e241cc41cde6', 'W', '5e241cc42a542'), (80, '5e241cc41cde6', 'Q', '5e241cc42a543'), (81, '5e241cc48edb9', 'N', '5e241cc4b3d33'), (82, '5e241cc48edb9', 'Z', '5e241cc4b3d3a'), (83, '5e241cc48edb9', 'R', '5e241cc4b3d3b'), (84, '5e241cc48edb9', 'Q', '5e241cc4b3d3d'), (85, '5e241cc52fe55', 'W', '5e241cc53e2ab'), (86, '5e241cc52fe55', 'Z', '5e241cc53e2b3'), (87, '5e241cc52fe55', 'N', '5e241cc53e2b6'), (88, '5e241cc52fe55', 'Q', '5e241cc53e2b9'), (89, '5e241cc5c24ad', 'Whole number', '5e241cc5e0349'), (90, '5e241cc5c24ad', 'Real number', '5e241cc5e034f'), (91, '5e241cc5c24ad', 'Integers', '5e241cc5e0351'), (92, '5e241cc5c24ad', 'Odd number', '5e241cc5e0353'), (93, '5e241cc63abf5', 'Rational number', '5e241cc6484d6'), (94, '5e241cc63abf5', 'Irrational number', '5e241cc6484db'), (95, '5e241cc63abf5', 'Complex number', '5e241cc6484dc'), (96, '5e241cc63abf5', 'Real number', '5e241cc6484dd'), (97, '5e241cc6bd04a', 'Rational number', '5e241cc71744a'), (98, '5e241cc6bd04a', 'Perfect number', '5e241cc717452'), (99, '5e241cc6bd04a', 'Prime number', '5e241cc717455'), (100, '5e241cc6bd04a', 'Complex number', '5e241cc717456'), (101, '5e241cc775cc3', 'Pythagorean Triplet', '5e241cc787a1e'), (102, '5e241cc775cc3', 'Prime Triplet', '5e241cc787a25'), (103, '5e241cc775cc3', 'Lucas number', '5e241cc787a27'), (104, '5e241cc775cc3', 'Fermat number', '5e241cc787a28'), (105, '5e241cc7bf7cc', 'The Three Degrees', '5e241cc7ca75d'), (106, '5e241cc7bf7cc', 'The Square', '5e241cc7ca763'), (107, '5e241cc7bf7cc', 'The Rule of Three', '5e241cc7ca764'), (108, '5e241cc7bf7cc', 'Quadrilateral', '5e241cc7ca766'), (109, '5e241cc8d7f26', 'Prime Target', '5e241cc8e6862'), (110, '5e241cc8d7f26', 'The Perfect Ten', '5e241cc8e686b'), (111, '5e241cc8d7f26', 'The Amicable', '5e241cc8e686c'), (112, '5e241cc8d7f26', 'The Pythagoras', '5e241cc8e686e'), (113, '5e241cc948567', 'The Tangents', '5e241cc953155'), (114, '5e241cc948567', 'John of Arc', '5e241cc95315a'), (115, '5e241cc948567', 'In search of last chord', '5e241cc95315b'), (116, '5e241cc948567', 'The width of a circle', '5e241cc95315c'), (117, '5e241cc98ee42', '2', '5e241cc999a7d'), (118, '5e241cc98ee42', '3', '5e241cc999a82'), (119, '5e241cc98ee42', '5', '5e241cc999a83'), (120, '5e241cc98ee42', '7', '5e241cc999a84'), (121, '5e241cc9cff63', 'Dual Prime', '5e241cc9de822'), (122, '5e241cc9cff63', 'Goldbach Prime', '5e241cc9de828'), (123, '5e241cc9cff63', 'Mersenne Prime', '5e241cc9de829'), (124, '5e241cc9cff63', 'Golden Number', '5e241cc9de82b'), (125, '5e241cca357e3', '666', '5e241cca42e9d'), (126, '5e241cca357e3', '484', '5e241cca42ea5'), (127, '5e241cca357e3', '1089', '5e241cca42ea8'), (128, '5e241cca357e3', '6178', '5e241cca42eac'), (129, '5e241ccabce23', '18', '5e241ccac7fcd'), (130, '5e241ccabce23', '27', '5e241ccac7fe0'), (131, '5e241ccabce23', '45', '5e241ccac7fe7'), (132, '5e241ccabce23', '40', '5e241ccac7fe8'), (133, '5e2459ac2847b', '160', '5e2459ac8554a'), (134, '5e2459ac2847b', '2370', '5e2459ac8554f'), (135, '5e2459ac2847b', '77', '5e2459ac85550'), (136, '5e2459ac2847b', '240', '5e2459ac85551'), (137, '5e2459ace5f74', '35', '5e2459ad04eb6'), (138, '5e2459ace5f74', '72', '5e2459ad04ec1'), (139, '5e2459ace5f74', '44', '5e2459ad04ec2'), (140, '5e2459ace5f74', '55', '5e2459ad04ec4'), (141, '5e2459ad7a71e', '15', '5e2459ad8abdb'), (142, '5e2459ad7a71e', '33', '5e2459ad8abe1'), (143, '5e2459ad7a71e', '17', '5e2459ad8abe3'), (144, '5e2459ad7a71e', '11', '5e2459ad8abe4'), (145, '5e2459ae17d4c', '74', '5e2459ae2aee3'), (146, '5e2459ae17d4c', '72', '5e2459ae2aeeb'), (147, '5e2459ae17d4c', '80', '5e2459ae2aef0'), (148, '5e2459ae17d4c', '85', '5e2459ae2aef2'), (149, '5e2459ae64c42', '142', '5e2459aed322e'), (150, '5e2459ae64c42', '138', '5e2459aed3234'), (151, '5e2459ae64c42', '19', '5e2459aed3235'), (152, '5e2459ae64c42', '6', '5e2459aed3237'), (153, '5e2459b0071d4', '115', '5e2459b04f23a'), (154, '5e2459b0071d4', '25', '5e2459b04f244'), (155, '5e2459b0071d4', '55', '5e2459b04f247'), (156, '5e2459b0071d4', '52', '5e2459b04f24a'), (157, '5e2459b09749d', '3', '5e2459b0ae129'), (158, '5e2459b09749d', '6', '5e2459b0ae130'), (159, '5e2459b09749d', '8', '5e2459b0ae132'), (160, '5e2459b09749d', '7', '5e2459b0ae133'), (161, '5e2459b10fc8b', '17', '5e2459b11a866'), (162, '5e2459b10fc8b', '32', '5e2459b11a86b'), (163, '5e2459b10fc8b', '28', '5e2459b11a86c'), (164, '5e2459b10fc8b', '6', '5e2459b11a86d'), (165, '5e2459b16ede1', '15 = 2 + 3', '5e2459b17c2e2'), (166, '5e2459b16ede1', '5 ÷ 15 = 3', '5e2459b17c2ea'), (167, '5e2459b16ede1', '2 = 15 ÷ 3', '5e2459b17c2ec'), (168, '5e2459b16ede1', '3 = 2 ÷ 15', '5e2459b17c2ed'), (169, '5e2459b1bd487', '(60÷16) × 14 = 70', '5e2459b1c88d0'), (170, '5e2459b1bd487', '(55-12) + 3 = 42', '5e2459b1c88d7'), (171, '5e2459b1bd487', '(40 × 8) – 12 = 36', '5e2459b1c88d8'), (172, '5e2459b1bd487', '(36 + 10) ÷ 16 = 30', '5e2459b1c88da'), (173, '5e2459b21ff43', ' x + =', '5e2459b22af04'), (174, '5e2459b21ff43', '= x +', '5e2459b22af0f'), (175, '5e2459b21ff43', '+ x =', '5e2459b22af11'), (176, '5e2459b21ff43', '=+x', '5e2459b22af12'), (177, '5e2459b27c38f', ' x, =, -, +', '5e2459b2872a1'), (178, '5e2459b27c38f', '–, =, x, +', '5e2459b2872aa'), (179, '5e2459b27c38f', 'x, =, +, -', '5e2459b2872ad'), (180, '5e2459b27c38f', '+, -, =, x', '5e2459b2872b1'), (181, '5e2459b2d5bab', '16', '5e2459b2e0b4c'), (182, '5e2459b2d5bab', '19', '5e2459b2e0b51'), (183, '5e2459b2d5bab', '18', '5e2459b2e0b52'), (184, '5e2459b2d5bab', '12', '5e2459b2e0b53'), (185, '5e2459b33307f', '63', '5e2459b33dfee'), (186, '5e2459b33307f', '254', '5e2459b33dff8'), (187, '5e2459b33307f', '288', '5e2459b33dff9'), (188, '5e2459b33307f', '1208', '5e2459b33dffa'), (189, '5e2459b3845d1', '15', '5e2459b394cc1'), (190, '5e2459b3845d1', '25', '5e2459b394cc8'), (191, '5e2459b3845d1', '30', '5e2459b394cc9'), (192, '5e2459b3845d1', '20', '5e2459b394cca'), (193, '5e2459b3ee5fd', '28', '5e2459b404ef0'), (194, '5e2459b3ee5fd', '32', '5e2459b404ef5'), (195, '5e2459b3ee5fd', '34', '5e2459b404ef6'), (196, '5e2459b3ee5fd', '36', '5e2459b404ef7'), (197, '5e2459b43b538', '6', '5e2459b44b794'), (198, '5e2459b43b538', '8', '5e2459b44b799'), (199, '5e2459b43b538', '11', '5e2459b44b79a'), (200, '5e2459b43b538', '17', '5e2459b44b79b'), (201, '5e2459b481daf', '16', '5e2459b48c911'), (202, '5e2459b481daf', '20', '5e2459b48c91a'), (203, '5e2459b481daf', '18', '5e2459b48c91c'), (204, '5e2459b481daf', '31', '5e2459b48c91d'), (205, '5e2459b4c2f4b', '35', '5e2459b4ce66a'), (206, '5e2459b4c2f4b', '57', '5e2459b4ce676'), (207, '5e2459b4c2f4b', '42', '5e2459b4ce678'), (208, '5e2459b4c2f4b', '15', '5e2459b4ce679'), (209, '5e2459b520106', '60', '5e2459b52b06d'), (210, '5e2459b520106', '20', '5e2459b52b075'), (211, '5e2459b520106', '80', '5e2459b52b07a'), (212, '5e2459b520106', '10', '5e2459b52b07b'), (213, '5e2459b5668b7', 'x और - ', '5e2459b579a5b'), (214, '5e2459b5668b7', '+ और x ', '5e2459b579a64'), (215, '5e2459b5668b7', '÷ और +', '5e2459b579a65'), (216, '5e2459b5668b7', '– और ÷ ', '5e2459b579a67'), (217, '5e2459b6f3b51', '+ एवं x ', '5e2459b728272'), (218, '5e2459b6f3b51', '6 एवं 7', '5e2459b72827a'), (219, '5e2459b6f3b51', '÷ एवं +', '5e2459b72827c'), (220, '5e2459b6f3b51', '12 एवं 3', '5e2459b72827d'), (221, '5e2459b8859a0', '(90×18)+18=60', '5e2459b894b7a'), (222, '5e2459b8859a0', '(18+6) ÷ 12 = 2', '5e2459b894b81'), (223, '5e2459b8859a0', '(72÷18) × 18 = 72', '5e2459b894b84'), (224, '5e2459b8859a0', '(12 + 6) × 18 = 36', '5e2459b894b88'), (225, '5e2459b926af6', ' x, –, x, +', '5e2459b9510be'), (226, '5e2459b926af6', ' +, –, x, +', '5e2459b9510c3'), (227, '5e2459b926af6', 'x, +, x, –', '5e2459b9510c4'), (228, '5e2459b926af6', 'x, +, +, x', '5e2459b9510c5'), (229, '5e2459ba5bca8', 'x = –', '5e2459ba67bca'), (230, '5e2459ba5bca8', ' x – =', '5e2459ba67bd5'), (231, '5e2459ba5bca8', '= – x ', '5e2459ba67bd7'), (232, '5e2459ba5bca8', ' – x =', '5e2459ba67bd8'), (261, '5e2fb34a13bfe', '4', '5e2fb34a236f7'), (262, '5e2fb34a13bfe', '3', '5e2fb34a236ff'), (263, '5e2fb34a13bfe', '2', '5e2fb34a23701'), (264, '5e2fb34a13bfe', '1', '5e2fb34a23702'), (265, '5e2fb34a6bea6', '5', '5e2fb34a7978e'), (266, '5e2fb34a6bea6', '20', '5e2fb34a79796'), (267, '5e2fb34a6bea6', '25', '5e2fb34a79797'), (268, '5e2fb34a6bea6', '56', '5e2fb34a79798'), (269, '5e2fb34b0791d', '25', '5e2fb34b1b256'), (270, '5e2fb34b0791d', '5', '5e2fb34b1b260'), (271, '5e2fb34b0791d', '20', '5e2fb34b1b262'), (272, '5e2fb34b0791d', '15', '5e2fb34b1b263'), (273, '5e2fb34b54498', '1', '5e2fb34b5ef86'), (274, '5e2fb34b54498', '2', '5e2fb34b5ef8c'), (275, '5e2fb34b54498', '3', '5e2fb34b5ef8e'), (276, '5e2fb34b54498', '4', '5e2fb34b5ef8f'), (277, '5e2fb34ba80b1', '1', '5e2fb34bc5c44'), (278, '5e2fb34ba80b1', '2', '5e2fb34bc5c60'), (279, '5e2fb34ba80b1', '3', '5e2fb34bc5c64'), (280, '5e2fb34ba80b1', '4', '5e2fb34bc5c69'); -- -------------------------------------------------------- -- -- Table structure for table `questions` -- CREATE TABLE `questions` ( `id` int(100) NOT NULL, `eid` text NOT NULL, `qid` text NOT NULL, `qns` text NOT NULL, `choice` int(10) NOT NULL, `sn` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `questions` -- INSERT INTO `questions` (`id`, `eid`, `qid`, `qns`, `choice`, `sn`) VALUES (9, '5e241883a5f97', '5e241cbd9e138', 'How many digits are there in Hindu-Arabic System?', 4, 1), (10, '5e241883a5f97', '5e241cbe6c227', 'Among the following which natural number has no predecessor?', 4, 2), (11, '5e241883a5f97', '5e241cbee00b7', 'Which among the following is the largest known number in the world?', 4, 3), (12, '5e241883a5f97', '5e241cbf5048d', 'What does 1 googol means?', 4, 4), (13, '5e241883a5f97', '5e241cbfd5a1e', 'Among the following which whole number has no predecessor?', 4, 5), (14, '5e241883a5f97', '5e241cc04d898', 'Counting numbers are kept under ________ number.', 4, 6), (15, '5e241883a5f97', '5e241cc0eae7a', ' An integer that is divisible by 2 is called:', 4, 7), (16, '5e241883a5f97', '5e241cc1530f8', 'In which number system, there is no symbol for zero?', 4, 8), (17, '5e241883a5f97', '5e241cc1eeeec', 'In Roman numerals M represents 1000, what does M represent?', 4, 9), (18, '5e241883a5f97', '5e241cc26e2e7', 'What does D represent in Roman numeral system?', 4, 10), (19, '5e241883a5f97', '5e241cc2d7e4e', 'If 5 = V, How does 5,000 written in roman numeral system?', 4, 11), (20, '5e241883a5f97', '5e241cc41cde6', 'The whole number is denoted by __________.', 4, 12), (21, '5e241883a5f97', '5e241cc48edb9', 'Rational number is represented by __________.', 4, 13), (22, '5e241883a5f97', '5e241cc52fe55', 'Integers are represented by __________.', 4, 14), (23, '5e241883a5f97', '5e241cc5c24ad', 'All counting numbers, together with their negatives and zeros constitute the set of __________.', 4, 15), (24, '5e241883a5f97', '5e241cc63abf5', 'A number which is expressed as a + ib, where a and b are real are called:', 4, 16), (25, '5e241883a5f97', '5e241cc6bd04a', 'An integer p which is not 0 or ±1 and is divisible by no integer except ±1 and itself is called:', 4, 17), (26, '5e241883a5f97', '5e241cc775cc3', ' p, p + 2, p + 4 are called __________ if all numbers are primes.', 4, 18), (27, '5e241883a5f97', '5e241cc7bf7cc', 'The cube root of 27 connected with units of angle measurement will produce __________ musical act?', 4, 19), (28, '5e241883a5f97', '5e241cc8d7f26', 'A number only divisible by itself and one has inspired Joe Mac Anthony to title one of his works. What was the title of his work?', 4, 20), (29, '5e241883a5f97', '5e241cc948567', 'Which of these could be either a circumference divided by π or a song written and recorded by David Bouie?', 4, 21), (30, '5e241883a5f97', '5e241cc98ee42', 'This number’s irrationality property was first discovered by Pythagoras. What is its value?', 4, 22), (31, '5e241883a5f97', '5e241cc9cff63', 'Any number in the form of 2p – 1, where p is a prime is known as:', 4, 23), (32, '5e241883a5f97', '5e241cca357e3', 'The sum of squares of first 7 prime number also satisfy the Lagrange’s Four Square theorem which states that “Every positive integer can be expressed as the sum of four squares”. What is the number I am talking about?', 4, 24), (33, '5e241883a5f97', '5e241ccabce23', 'There are only 2 numbers that are twice the sum of their individual digits; one of them is zero (0). What is the other one?', 4, 25), (34, '5e244ace8abb6', '5e2459ac2847b', 'यदि + का अर्थ ×, × का अर्थ -, ÷ का अर्थ + और - का अर्थ ÷ हो तो 175 – 25 ÷ 5 + 20 × 3 + 10 = ?', 4, 1), (35, '5e244ace8abb6', '5e2459ace5f74', 'यदि + का अर्थ -, - का अर्थ × हो, × का अर्थ ÷ और ÷ का अर्थ + हो, तो 26 - 18 × 9 ÷ 3 + 11 = ?', 4, 2), (36, '5e244ace8abb6', '5e2459ad7a71e', ' यदि + का अर्थ ×, - का अर्थ ÷ हो, × का अर्थ – और ÷ का अर्थ + हो, तो \r\n8 + 4 ÷ 3 × 18 – 9 होगा ?', 4, 3), (37, '5e244ace8abb6', '5e2459ae17d4c', 'यदि – भाग के लिए, + गुना के लिए, ÷ घटाने के लिए और × जोड़ने के लिए, हो तो 36 + 6 – 3 × 5 ÷ 3 = ?', 4, 4), (38, '5e244ace8abb6', '5e2459ae64c42', 'निम्नलिखित प्रश्न में आपको निम्नलिखित प्रतिको के अनुसार दिए गए विकल्पों में से सही उत्तर चुनना है यदि – का अर्थ × है, × का अर्थ + है, + का अर्थ ÷ है, और ÷ का अर्थ – है, तो \r\n14 -10 ÷ 4 × 16 + 8 = ?', 4, 5), (39, '5e244ace8abb6', '5e2459b0071d4', 'यदि P, + को, Q, - को, R, ÷ को और S, × को व्यक्त करे तो 18 S 36 R 12 Q 6 P 7 =?', 4, 6), (40, '5e244ace8abb6', '5e2459b09749d', 'यदि P = %, A = -, B = +, C = ×, D = ÷ हो तो (100 का 5PB53A4)D9= ?', 4, 7), (41, '5e244ace8abb6', '5e2459b10fc8b', 'यदि ‘P’ का अर्थ है ‘-‘ Q का अर्थ है ‘x’, ‘R’ का अर्थ है ÷ और S का अर्थ है +, तो दिए गए समीकरण का मान क्या होगा ?\r\n14 Q 3 P 12 S 4 R 2 = ?', 4, 8), (42, '5e244ace8abb6', '5e2459b16ede1', ' ÷ तथा =, 2 तथा 3 का स्थान परस्पर बदलने पर निम्नलिखित में से कोनसा सही है?', 4, 9), (43, '5e244ace8abb6', '5e2459b1bd487', 'नीचे दिए अनुसार, गणितीय क्रियांओं(चिन्हों) तथा संख्याओ में अदला-बदली करने के बाद सही समीकरण को चुनिए | x और +; 12 और 16 ', 4, 10), (44, '5e244ace8abb6', '5e2459b21ff43', 'निम्नलिखित प्रश्न में विभिन्न स्थानों पर @ चिन्ह विभिन्न गणितीयो चिन्हों के लिए है जो विकल्पों के रूप में दिए गये है| चिन्हों के सही क्रम वाले विकल्प के रूप में दिए गए है| चिन्हों के सही क्रम वाले विकल्प को चुनिए जिसे प्रतिस्थापित करने पर प्रश्न समीकरण सही हो जाए|\r\n24@4@5@4 ', 4, 11), (45, '5e244ace8abb6', '5e2459b27c38f', 'निम्नलिखित विकल्पों में से कोनसा सही है ?\r\n8*5*27*3*16', 4, 12), (46, '5e244ace8abb6', '5e2459b2d5bab', 'यदि + का अर्थ ÷, × का अर्थ - हो, - का अर्थ × और ÷ का अर्थ + हो, तो 38+19-16×17÷3=?', 4, 13), (47, '5e244ace8abb6', '5e2459b33307f', 'यदि a का अर्थ +, b का अर्थ -, c का अर्थ × और d का अर्थ ÷, तो 18 c 14 a 6 b 16 d 4 = ?', 4, 14), (48, '5e244ace8abb6', '5e2459b3845d1', 'यदि a का अर्थ +, b का अर्थ -, c का अर्थ × और d का अर्थ ÷, तो 18 c 14 a 6 b 16 d 4 = ?', 4, 15), (49, '5e244ace8abb6', '5e2459b3ee5fd', 'यदि ÷ का अर्थ × है, - का अर्थ + है, × का अर्थ – है तथा + का अर्थ ÷ है तो निम्नलिखित का मान क्या होगा?', 4, 16), (50, '5e244ace8abb6', '5e2459b43b538', 'यदि + का अर्थ × हो, – का अर्थ ÷ हो, × का अर्थ – हो और ÷ का अर्थ + हो तो \r\n6 ÷ 36 – 4 x 2 + 2 = ? ', 4, 17), (51, '5e244ace8abb6', '5e2459b481daf', 'यदि + का अर्थ ×, × का अर्थ ÷, - का अर्थ +, ÷ का अर्थ - हो तो \r\n20-8×4÷3+2=?', 4, 18), (52, '5e244ace8abb6', '5e2459b4c2f4b', 'यदि ‘P’ का अर्थ ×, Q का अर्थ ÷, R का अर्थ +, और S का अर्थ – हो तो 154 Q 14 S 7 P 3 R 25 का मान क्या होगा ?', 4, 19), (53, '5e244ace8abb6', '5e2459b520106', ' P $ Q, का अर्थ है में भाग दे \r\nP # Q, का अर्थ है में घटाये \r\nP % Q, का अर्थ है में जोड़े \r\nP @ Q, का अर्थ है में गुणा करे \r\n70 # 30 % 80 $ 20 @ 10 = ?', 4, 20), (54, '5e244ace8abb6', '5e2459b5668b7', 'चिन्हों के किस अदल-बदल से निम्न समीकरण सही हो जाएगा| \r\n35 + 7 × 5 ÷ 5 – 6 = 24', 4, 21), (55, '5e244ace8abb6', '5e2459b6f3b51', 'नीचे दिए गए विकल्पों में से कौन से चिन्हों को अदल-बदल कर देने से समीकरण को सही कर देगा ? \r\n(12÷6) + 3 × 7 = 42 ', 4, 22), (56, '5e244ace8abb6', '5e2459b8859a0', 'निचे दिए गए समीकरणों में ÷ और +, 12 और 18 को एक-दुसरे के स्थान पर रखने के पश्चात् निम्नलिखित में से कोनसा समीकरण सही हो जायेगा?', 4, 23), (57, '5e244ace8abb6', '5e2459b926af6', 'निम्नलिखित में प्रतिको में किस सेट को * के स्थान पर रखा जा सकता है?\r\n25*2*6=4*11*0', 4, 24), (58, '5e244ace8abb6', '5e2459ba5bca8', 'गणितीय चिन्हों के सही क्रम को चुनिए जिसमे * चिन्ह के स्थान पर पुनर्स्थापित करने से संतुलित समीकरण बन जाएगा|\r\n9*4*22*14', 4, 25), (66, '5e2fb270f1792', '5e2fb34a13bfe', '1+3=?', 4, 1), (67, '5e2fb270f1792', '5e2fb34a6bea6', '4x5=?', 4, 2), (68, '5e2fb270f1792', '5e2fb34b0791d', '25/5=?', 4, 3), (69, '5e2fb270f1792', '5e2fb34b54498', '5-4=?', 4, 4), (70, '5e2fb270f1792', '5e2fb34ba80b1', '5+1*2-6/2=?', 4, 5); -- -------------------------------------------------------- -- -- Table structure for table `quiz` -- CREATE TABLE `quiz` ( `id` int(100) NOT NULL, `eid` text NOT NULL, `title` varchar(100) NOT NULL, `correct` int(11) NOT NULL, `wrong` int(11) NOT NULL, `total` int(11) NOT NULL, `time` bigint(20) NOT NULL, `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `status` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `quiz` -- INSERT INTO `quiz` (`id`, `eid`, `title`, `correct`, `wrong`, `total`, `time`, `date`, `status`) VALUES (6, '5e241883a5f97', 'Mathematical Test', 1, 0, 25, 30, '2020-02-23 05:15:11', 'enabled'), (7, '5e244ace8abb6', 'Hindi Mathematical Test', 1, 0, 25, 30, '2020-02-23 05:15:09', 'enabled'), (11, '5e2fb270f1792', 'Test', 0, 0, 5, 5, '2020-09-21 01:42:35', 'disabled'), (12, '5ed37a902d1db', 'Mathematical Test', 0, 0, 4, 5, '0000-00-00 00:00:00', 'disabled'); -- -------------------------------------------------------- -- -- Table structure for table `rank` -- CREATE TABLE `rank` ( `id` int(100) NOT NULL, `username` varchar(50) NOT NULL, `score` int(11) NOT NULL, `time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `rank` -- INSERT INTO `rank` (`id`, `username`, `score`, `time`) VALUES (12, 'user1313', 0, '2020-02-23 05:16:43'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(100) NOT NULL, `name` varchar(50) NOT NULL, `age` int(3) NOT NULL, `gender` varchar(5) NOT NULL, `username` varchar(50) NOT NULL, `phno` bigint(20) NOT NULL, `password` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `name`, `age`, `gender`, `username`, `phno`, `password`) VALUES (16, 'User1313', 12, 'F', 'user1313', 9911111111, '12345'); -- -------------------------------------------------------- -- -- Table structure for table `user_answer` -- CREATE TABLE `user_answer` ( `id` int(100) NOT NULL, `qid` varchar(50) NOT NULL, `ans` varchar(50) NOT NULL, `correctans` varchar(50) NOT NULL, `eid` varchar(50) NOT NULL, `username` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_answer` -- INSERT INTO `user_answer` (`id`, `qid`, `ans`, `correctans`, `eid`, `username`) VALUES (49, '5e25e395869a0', '5e25e395a332a', '5e25e395a332a', '5e25e342830ab', 'sangam1313'), (50, '5e25e3960b185', '5e25e39618d98', '5e25e39618d98', '5e25e342830ab', 'sangam1313'), (51, '5e25e396a319b', '5e25e396b8ef5', '5e25e396b8ef5', '5e25e342830ab', 'sangam1313'), (52, '5e25e3974e13a', '5e25e397572cc', '5e25e397572cc', '5e25e342830ab', 'sangam1313'), (53, '5e25e397bb900', '5e25e397c8194', '5e25e397c8194', '5e25e342830ab', 'sangam1313'), (54, '5e241cbd9e138', '5e241cbdcce63', '5e241cbdcce63', '5e241883a5f97', 'DarkxDevil'), (55, '5e241cbe6c227', '5e241cbe84356', '5e241cbe84360', '5e241883a5f97', 'DarkxDevil'), (56, '5e241cbee00b7', '5e241cbf01887', '5e241cbf01889', '5e241883a5f97', 'DarkxDevil'), (57, '5e241cbf5048d', '5e241cbf5e9d6', '5e241cbf5e9c0', '5e241883a5f97', 'DarkxDevil'), (58, '5e241cbfd5a1e', '5e241cbfe5aa2', '5e241cbfe5aa8', '5e241883a5f97', 'DarkxDevil'), (59, '5e241cc04d898', '5e241cc083e7b', '5e241cc083e7b', '5e241883a5f97', 'DarkxDevil'), (60, '5e241cc0eae7a', '5e241cc109d01', '5e241cc109cf5', '5e241883a5f97', 'DarkxDevil'), (61, '5e241cc1530f8', '5e241cc161678', '5e241cc161677', '5e241883a5f97', 'DarkxDevil'), (62, '5e241cc1eeeec', '5e241cc21fab8', '5e241cc21faba', '5e241883a5f97', 'DarkxDevil'), (63, '5e241cc26e2e7', '5e241cc278f08', '5e241cc278f08', '5e241883a5f97', 'DarkxDevil'), (64, '5e241cc2d7e4e', '5e241cc3ad6bc', '5e241cc3ad6b9', '5e241883a5f97', 'DarkxDevil'), (65, '5e241cc41cde6', '5e241cc42a542', '5e241cc42a542', '5e241883a5f97', 'DarkxDevil'), (66, '5e241cc48edb9', '5e241cc4b3d3b', '5e241cc4b3d3b', '5e241883a5f97', 'DarkxDevil'), (67, '5e241cc52fe55', '5e241cc53e2b9', '5e241cc53e2b3', '5e241883a5f97', 'DarkxDevil'), (68, '5e241cc5c24ad', '5e241cc5e0351', '5e241cc5e0351', '5e241883a5f97', 'DarkxDevil'), (69, '5e241cc63abf5', '5e241cc6484dd', '5e241cc6484dc', '5e241883a5f97', 'DarkxDevil'), (70, '5e241cc6bd04a', '5e241cc717455', '5e241cc717455', '5e241883a5f97', 'DarkxDevil'), (71, '5e241cc775cc3', '5e241cc787a27', '5e241cc787a25', '5e241883a5f97', 'DarkxDevil'), (72, '5e241cc7bf7cc', '5e241cc7ca764', '5e241cc7ca75d', '5e241883a5f97', 'DarkxDevil'), (73, '5e241cc8d7f26', '5e241cc8e686c', '5e241cc8e6862', '5e241883a5f97', 'DarkxDevil'), (74, '5e241cc948567', '5e241cc95315a', '5e241cc95315c', '5e241883a5f97', 'DarkxDevil'), (75, '5e241cc98ee42', '5e241cc999a82', '5e241cc999a7d', '5e241883a5f97', 'DarkxDevil'), (76, '5e241cc9cff63', '5e241cc9de822', '5e241cc9de829', '5e241883a5f97', 'DarkxDevil'), (77, '5e241cca357e3', '5e241cca42e9d', '5e241cca42e9d', '5e241883a5f97', 'DarkxDevil'), (78, '5e241ccabce23', '5e241ccac7fcd', '5e241ccac7fcd', '5e241883a5f97', 'DarkxDevil'), (79, '5e241cbe6c227', '5e241cbe8435f', '5e241cbe84360', '5e241883a5f97', ' '), (80, '5e241cbee00b7', '5e241cbf01889', '5e241cbf01889', '5e241883a5f97', ' '), (81, '5e241cbf5048d', '5e241cbf5e9d5', '5e241cbf5e9c0', '5e241883a5f97', ' '), (82, '5e241cbfd5a1e', '5e241cbfe5aa8', '5e241cbfe5aa8', '5e241883a5f97', ' '), (83, '5e241cc0eae7a', '5e241cc109cfe', '5e241cc109cf5', '5e241883a5f97', ' '), (84, '5e241cc1530f8', '5e241cc161677', '5e241cc161677', '5e241883a5f97', ' '), (85, '5e241cc1eeeec', '5e241cc21faba', '5e241cc21faba', '5e241883a5f97', ' '), (86, '5e241cc26e2e7', '5e241cc278f09', '5e241cc278f08', '5e241883a5f97', ' '), (87, '5e241cc2d7e4e', '5e241cc3ad6bc', '5e241cc3ad6b9', '5e241883a5f97', ' '), (88, '5e241cc41cde6', '5e241cc42a542', '5e241cc42a542', '5e241883a5f97', ' '), (89, '5e241cc48edb9', '5e241cc4b3d3b', '5e241cc4b3d3b', '5e241883a5f97', ' '), (90, '5e2459ac2847b', '5e2459ac8554a', '5e2459ac85550', '5e244ace8abb6', 'user'), (91, '5e2459ace5f74', '5e2459ad04eb6', '5e2459ad04ec2', '5e244ace8abb6', 'user'), (92, '5e2459ad7a71e', '5e2459ad8abdb', '5e2459ad8abe1', '5e244ace8abb6', 'user'), (93, '5e2fb34a13bfe', '5e2fb34a236f7', '5e2fb34a236f7', '5e2fb270f1792', 'user'), (94, '5e2fb34a6bea6', '5e2fb34a79796', '5e2fb34a79796', '5e2fb270f1792', 'user'), (95, '5e2fb34b0791d', '5e2fb34b1b260', '5e2fb34b1b260', '5e2fb270f1792', 'user'), (96, '5e2fb34b54498', '5e2fb34b5ef86', '5e2fb34b5ef86', '5e2fb270f1792', 'user'), (97, '5e2fb34ba80b1', '5e2fb34bc5c60', '5e2fb34bc5c69', '5e2fb270f1792', 'user'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `answer` -- ALTER TABLE `answer` ADD PRIMARY KEY (`id`); -- -- Indexes for table `history` -- ALTER TABLE `history` ADD PRIMARY KEY (`id`); -- -- Indexes for table `options` -- ALTER TABLE `options` ADD PRIMARY KEY (`id`); -- -- Indexes for table `questions` -- ALTER TABLE `questions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `quiz` -- ALTER TABLE `quiz` ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `rank` -- ALTER TABLE `rank` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`username`), ADD UNIQUE KEY `username` (`username`), ADD UNIQUE KEY `id` (`id`); -- -- Indexes for table `user_answer` -- ALTER TABLE `user_answer` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `answer` -- ALTER TABLE `answer` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=71; -- -- AUTO_INCREMENT for table `history` -- ALTER TABLE `history` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26; -- -- AUTO_INCREMENT for table `options` -- ALTER TABLE `options` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=281; -- -- AUTO_INCREMENT for table `questions` -- ALTER TABLE `questions` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=71; -- -- AUTO_INCREMENT for table `quiz` -- ALTER TABLE `quiz` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `rank` -- ALTER TABLE `rank` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; -- -- AUTO_INCREMENT for table `user_answer` -- ALTER TABLE `user_answer` MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98; 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
3c096a9addb39d8d268264f9ac5f5e7c3715b100
SQL
liwc0329/spring-boot-mybatis-generator
/src/main/resources/sql/user.sql
UTF-8
749
2.671875
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost (mysql) Source Server Version : 50721 Source Host : localhost:3306 Source Database : test Target Server Type : MYSQL Target Server Version : 50721 File Encoding : 65001 Date: 2018-12-04 14:36:01 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `age` int(11) DEFAULT NULL, `sal` double(255,0) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user -- ----------------------------
true
42f79ef00c8f3edcd8e980d6ce64a90f8ab14c89
SQL
Amit006/coding
/plsqlassingment/empno_display.sql
UTF-8
738
3.140625
3
[]
no_license
create table emp10(emp_no number(10),emp_name varchar2(10),emp_salary number(20)); insert into emp10 values(1,'amit',5000); insert into emp10 values(2,'sunanda',6000); insert into emp10 values(3,'subham',5000); insert into emp10 values(4,'anupama',60000); declare empno emp10.emp_no%type; emp_rec1 emp10.emp_name%type; emp_rec2 emp10.emp_salary% type; begin empno:=&empno; select emp_name,emp_salary into emp_rec1,emp_rec2 from emp10 where empno=emp_no; dbms_output.put_line('empno:-'||empno); dbms_output.put_line('emp_name:- '|| emp_rec1); dbms_output.put_line('emp_salary:-'|| emp_rec2); exception when no_data_found then dbms_output.put_line('no data found'); end; /
true
31ff278582cc96e38dec409836e506c04c1c1c2a
SQL
WangStar1031/ApartmentProject
/fixallph_buildings.sql
UTF-8
3,033
2.984375
3
[]
no_license
# Host: localhost (Version 5.5.5-10.1.26-MariaDB) # Date: 2019-03-18 04:22:29 # Generator: MySQL-Front 6.0 (Build 2.20) # # Structure for table "apartmentinfo" # DROP TABLE IF EXISTS `apartmentinfo`; CREATE TABLE `apartmentinfo` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `ProjectId` int(11) DEFAULT NULL, `ApartmentName` varchar(255) DEFAULT NULL, `SectionCount` int(11) DEFAULT NULL, `PictureCount` int(11) DEFAULT NULL, `PartInfos` text, `SectionInfos` text, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb4; # # Structure for table "defect_reparation" # DROP TABLE IF EXISTS `defect_reparation`; CREATE TABLE `defect_reparation` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `ProjectId` int(11) DEFAULT NULL, `ApartmentNumber` int(11) DEFAULT NULL, `PhotoIdx` int(11) DEFAULT NULL, `PhotoCat` varchar(255) DEFAULT NULL, `idxGroup` int(11) DEFAULT NULL, `Type` varchar(255) DEFAULT NULL, `OriginalFilePath` varchar(255) DEFAULT NULL, `SmallFilePath` varchar(255) DEFAULT NULL, `PosRect` varchar(255) DEFAULT NULL, `Infos` text, `Description` text, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4; # # Structure for table "note" # DROP TABLE IF EXISTS `note`; CREATE TABLE `note` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `ProjectId` int(11) DEFAULT NULL, `ApartmentNumber` int(11) DEFAULT NULL, `PhotoIdx` int(11) DEFAULT NULL, `Notes` text, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; # # Structure for table "parts" # DROP TABLE IF EXISTS `parts`; CREATE TABLE `parts` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `ProjectId` int(11) DEFAULT NULL, `PartName` varchar(255) DEFAULT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; # # Structure for table "projectinfo" # DROP TABLE IF EXISTS `projectinfo`; CREATE TABLE `projectinfo` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `ProjectPath` varchar(255) DEFAULT NULL, `ProjectName` varchar(255) DEFAULT NULL, `ProjectNumber` varchar(255) DEFAULT NULL, `ProjectType` varchar(255) DEFAULT NULL, `Zone` varchar(255) DEFAULT NULL, `City` varchar(255) DEFAULT NULL, `Street` varchar(255) DEFAULT NULL, `No` varchar(255) DEFAULT NULL, `Constructor` varchar(255) DEFAULT NULL, `ProjectManager` varchar(255) DEFAULT NULL, `WorksManager` varchar(255) DEFAULT NULL, `Photography` varchar(255) DEFAULT NULL, `DocumentDate` date DEFAULT NULL, `BuildingNumber` varchar(255) DEFAULT NULL, `EntranceNumber` varchar(255) DEFAULT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; # # Structure for table "user" # DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `UserEmail` varchar(255) DEFAULT NULL, `UserName` varchar(255) DEFAULT NULL, `Password` varchar(255) DEFAULT NULL, `InviteUrl` varchar(255) DEFAULT '', PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
true
3c278a5fc96631f8eba5ae0185a910ae2f3f161f
SQL
hsavran/SqlDevScript
/Graph DB 3 Match.sql
UTF-8
727
3.875
4
[]
no_license
use Graphs --Find Alike products SELECT p1.Brand, p1.ProductName, p1.RetailPrice, p2.Brand as AlikeBrand, p2.ProductName as AlikeProduct, p2.RetailPrice as AlikePrice FROM Products as p1, AlikeProduct as ap, Products p2 WHERE MATCH(p1-(ap)->p2) AND p1.ProductId = 1 --Find Anna's wishlist and alike products select u1.Name, w1.CreatedDt as WishedDt, p1.ProductName as WishedProduct,p2.ProductName as AlikeProduct FROM Users as u1, Wished w1, Products p1, AlikeProduct a1, Products as p2 WHERE MATCH(u1-(w1)->p1<-(a1)-p2) --WHERE MATCH(u1-(w1)->p1 AND p1<-(a1)-p2) AND u1.UserId = 1 /*select * from sys.all_objects where name = 'Products' select * from sys.columns where object_id = 779149821 select * from Products */
true
09003f649ed1bc20eab93522415253f29eb178f8
SQL
adrielsales/alura
/php/php_e_mysql/bkp-loja.sql
UTF-8
3,261
3.234375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.6.30, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: loja -- ------------------------------------------------------ -- Server version 5.6.30-0ubuntu0.15.10.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `categorias` -- DROP TABLE IF EXISTS `categorias`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `categorias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `categorias` -- LOCK TABLES `categorias` WRITE; /*!40000 ALTER TABLE `categorias` DISABLE KEYS */; INSERT INTO `categorias` VALUES (1,'esporte'),(2,'escolar'),(3,'mobilidade'),(4,'tecnologia'); /*!40000 ALTER TABLE `categorias` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `produtos` -- DROP TABLE IF EXISTS `produtos`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `produtos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) DEFAULT NULL, `preco` decimal(10,2) DEFAULT NULL, `descricao` text, `categoria_id` int(11) DEFAULT NULL, `usado` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `produtos` -- LOCK TABLES `produtos` WRITE; /*!40000 ALTER TABLE `produtos` DISABLE KEYS */; INSERT INTO `produtos` VALUES (15,'Luz infravermelha',999.00,'Uma super luz infravermelha do futuro.',4,0),(16,'Teclado do Futuro',100.00,'Um teclado com muitos recursos futuristas.',4,0),(17,'Carro',25000.00,'Um carro do futuro',3,0),(18,'Motocicleta',3500.00,'Moto da Honda',3,0),(19,'Lápis',2.00,'Um lápis usado pelo Sílvio Santos',2,0),(20,'Bola de Futebol',150.00,'Bola do Zico e do Pelé.',1,1),(21,'Patins ',350.00,'Patins do campeão mundial',1,1),(22,'Bicicleta',2500.00,'Monark Barra Circular',3,1); /*!40000 ALTER TABLE `produtos` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2016-07-17 16:47:46
true
ab90332c874b6907dd2877e5fc1ef2dd94419157
SQL
djiworks/NR_newsletter
/data.sql
UTF-8
3,102
2.921875
3
[]
no_license
INSERT INTO `university` (`id_university`, `name`, `address`, `country`, `subscription`, `checking_state`, `comment`) VALUES (1, 'ESIROI', 'La reunion', 'France', NULL, 0, NULL), (2, 'Université de Paris III', 'Paris', 'France', NULL, 1, NULL), (3, 'Université de Bordeaux II', 'Bordeaux', 'France', NULL, 2, NULL), (4, 'Universidad de Cristobal', 'Madrid', 'Spain', NULL, 3, NULL), (5, 'Universidad de PortoPaga', 'Millan', 'Italy', NULL, 0, NULL); INSERT INTO `newsletter` (`id_newsletter`, `type`, `name`, `description`, `path`, `creation_date`, `cover`, `checking_state`, `content`, `comment`) VALUES (1, 0, 'First Newsletter', 'First newsletter to send to universities', '/92data/marketing/newsletter', '2013-07-22', '/img/toto/cover.jpg', 0, '/92data/marketing/newsletter', NULL), (2, 0, 'July Newsletter', 'July news', '/92data/marketing/newsletter', '2013-07-22', '/img/toto/cover.jpg', 1, '/92data/marketing/newsletter', NULL), (3, 1, 'First Intern Newsletter', 'First Intern Newsletter', '/92data/marketing/newsletter', '2013-07-25', '/img/toto/cover.jpg', 0, '/92data/marketing/newsletter', NULL); INSERT INTO `person` (`id_person`, `first_name`, `last_name`, `phone`, `mail`, `country`, `worked_until`) VALUES (1, 'Djothi', 'Grondin', '0634859671', 'djothi.grondin@outlook.com', 'France', '2013-08-09'), (2, 'Bazire', 'Houssin', '0352169800', 'enVoitureSimone@gmail.com', 'France', NULL), (3, 'Alexis', 'De Marinis', '0635982145', 'alex@terieur.com', 'Spain', '2013-08-27'), (4, 'Isabelle', 'Touchefeu', '0655321484', 'ducks@couack.co', 'Greece', '2013-10-31'); INSERT INTO `user` (`id_user`, `login`, `password`, `id_role`) VALUES (6, 'alexis', '$1$IZ2.x1..$pgJ.lDkEay/66ZTZCPCZx.', 2), (2, 'bazire', '$1$IZ2.x1..$pgJ.lDkEay/66ZTZCPCZx.', 1), (3, 'djothi', '$1$IZ2.x1..$pgJ.lDkEay/66ZTZCPCZx.', 3), (4, 'oumnia', '$1$IZ2.x1..$pgJ.lDkEay/66ZTZCPCZx.', 4), (5, 'vittorio', '$1$IZ2.x1..$pgJ.lDkEay/66ZTZCPCZx.', 5); INSERT INTO `contact` (`id_contact`, `information`, `id_university`) VALUES (1, 'International Partnership Manager', 1), (2, 'International Partnership Manager', 3), (3, 'International Partnership Manager', 4), (4, 'Internship Manager', 1), (5, 'Standard', 2), (6, 'Standard', 1), (7, 'Standard', 5); INSERT INTO `mail` (`id_mail`, `mail`, `id_contact`) VALUES (1, 'contact6@mail1.com', 6), (2, 'contact7@mail1.com', 7), (3, 'contact6@mail2.com', 6), (4, 'contact2@mail1.com', 2), (5, 'contact4@mail1.com', 4), (6, 'contact4@mail2.com', 4); INSERT INTO `phone` (`id_phone`, `number`, `type`, `id_contact`) VALUES (1, '1000000301', 0, 3), (2, '2010000501', 1, 5), (3, '3000000401', 0, 4), (4, '4010000101', 1, 1), (5, '5010000302', 1, 3), (6, '6000000502', 0, 5); INSERT INTO `recommended_by` (`id_person`, `id_university`, `is_student`) VALUES (1, 1, 1), (1, 2, 0), (2, 4, 0), (3, 4, 1), (3, 5, 0), (4, 3, 1); INSERT INTO `sent_newsletter_person` (`id_newsletter`, `id_person`, `sending_date`) VALUES (3, 2, '2013-07-27 11:33:04'), (3, 3, '2013-07-19 11:33:01'); INSERT INTO `sent_newsletter_university` (`id_university`, `id_newsletter`, `sending_date`) VALUES (1, 1, '2013-07-24 11:26:51'), (1, 2, '2013-07-31 11:27:30'), (3, 1, '2013-07-10 11:27:54'), (4, 1, '2013-07-20 11:27:47');
true