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
b7d22f731b7d010cb5d643736b09d2f20a9d4b42
SQL
zhilangtaosha/BBG
/SQL/2015-07-29_RA-购物篮平均购买商品SKU.sql
UTF-8
1,497
4
4
[]
no_license
--day,loc,sku SELECT TO_DATE(SUBSTR(C.DT_WID, 2, 8), 'YYYYMMDD') DAYS, O.ORG_NUM, ROUND(C.ITEM_COUNT / C.TRX_COUNT, 2) SI_SKU FROM RADM.W_INT_ORG_D O, (SELECT B.ORG_WID, B.DT_WID, COUNT(B.SLS_TRX_ID) TRX_COUNT, SUM(B.ITEM_COUNT) ITEM_COUNT FROM (SELECT A.ORG_WID, A.DT_WID, A.SLS_TRX_ID, COUNT(DISTINCT A.PROD_WID) ITEM_COUNT FROM RADM.W_RTL_SLS_TRX_IT_LC_DY_F A WHERE A.DT_WID BETWEEN 120160101000 AND 120160131000 GROUP BY A.ORG_WID, A.DT_WID, A.SLS_TRX_ID) B GROUP BY B.ORG_WID, B.DT_WID) C WHERE O.ROW_WID = C.ORG_WID ORDER BY C.DT_WID, O.ORG_NUM; --MONTH,SKU SELECT SUBSTR(C.DT_WID, 2, 6) MON, ROUND(SUM(C.ITEM_COUNT) / SUM(C.TRX_COUNT), 2) SI_SKU FROM RADM.W_INT_ORG_D O, (SELECT B.ORG_WID, B.DT_WID, COUNT(B.SLS_TRX_ID) TRX_COUNT, SUM(B.ITEM_COUNT) ITEM_COUNT FROM (SELECT A.ORG_WID, A.DT_WID, A.SLS_TRX_ID, COUNT(DISTINCT A.PROD_WID) ITEM_COUNT FROM RADM.W_RTL_SLS_TRX_IT_LC_DY_F A WHERE A.DT_WID BETWEEN 120160201000 AND 120160229000 GROUP BY A.ORG_WID, A.DT_WID, A.SLS_TRX_ID) B GROUP BY B.ORG_WID, B.DT_WID) C WHERE O.ROW_WID = C.ORG_WID GROUP BY SUBSTR(C.DT_WID, 2, 6);
true
66ba1101e2afbd6a1a7030b09740a3dfd50c6b94
SQL
jalvarova/microservice
/ms-currency/src/main/resources/init-data.sql
UTF-8
1,657
3.59375
4
[]
no_license
CREATE TABLE IF NOT EXISTS hta.currency_code_names ( currency_code_names_id BIGSERIAL NOT NULL, currency_code VARCHAR(4) NOT NULL, currency_name VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(), state BOOLEAN DEFAULT TRUE, CONSTRAINT currency_code_names_id_pkey PRIMARY KEY (currency_code_names_id), CONSTRAINT currency_name_unique UNIQUE (currency_name), CONSTRAINT currency_code_unique UNIQUE (currency_code) ); CREATE TABLE IF NOT EXISTS hta.currency_exchange ( currency_exchange_id BIGSERIAL NOT NULL, amount_exchange_rate DECIMAL(11,5), currency_exchange_destination VARCHAR(255) NOT NULL, currency_exchange_origin VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(), state BOOLEAN DEFAULT TRUE, CONSTRAINT currency_exchange_pkey PRIMARY KEY (currency_exchange_id) ); CREATE TABLE IF NOT EXISTS hta.currency_transaction ( currency_transaction_id BIGSERIAL NOT NULL, account_destination DECIMAL(19,2) NOT NULL, account_origin DECIMAL(19,2) NOT NULL, amount DECIMAL(11,5) NOT NULL, amount_exchange_rate DECIMAL(11,5) NOT NULL, amount_rate DECIMAL(11,5) NOT NULL, currency_destination VARCHAR(255) NOT NULL, currency_origin VARCHAR(255) NOT NULL, document_number VARCHAR(255) NOT NULL, operation_number VARCHAR(255) NOT NULL, username VARCHAR(255) NOT NULL, created_at TIMESTAMP DEFAULT NOW(), updated_at TIMESTAMP DEFAULT NOW(), state BOOLEAN DEFAULT TRUE, CONSTRAINT currency_transaction_pkey PRIMARY KEY (currency_transaction_id) );
true
5e06f36e1f9a0d720780986df5c545d0e7b6cfff
SQL
sncodeGit/University_Tasks
/DB/query_9.sql
UTF-8
688
4.1875
4
[]
no_license
WITH film_rental_count AS ( SELECT inventory.film_id AS film_id, COUNT(rental_id) AS film_count FROM rental, inventory WHERE rental.inventory_id = inventory.inventory_id GROUP BY inventory.film_id ) ,category_rental_count AS ( SELECT film_category.category_id, SUM(film_rental_count.film_count) AS category_count FROM film_rental_count, film, film_category WHERE film_rental_count.film_id = film.film_id AND film.film_id = film_category.film_id GROUP BY category_id ) SELECT name, category_count FROM category_rental_count, category WHERE category_count = (SELECT MAX(category_count) FROM category_rental_count) AND category_rental_count.category_id = category.category_id;
true
61de335d8669838255bd8d9a1d7a04722b5b6f2b
SQL
lzd13816471540/pinyou
/pinyou/pinyou-admin/src/main/resources/表结构.sql
UTF-8
428
3.109375
3
[]
no_license
-- 用户表 CREATE TABLE SYS_USER( ID INT PRIMARY KEY AUTO_INCREMENT COMMENT '用户ID', USER_NAME VARCHAR(30) DEFAULT NULL COMMENT '用户名称', USER_PWD VARCHAR(255) NOT NULL COMMENT '用户密码', MOBILE_NO VARCHAR(20) DEFAULT NULL COMMENT '手机号码', STATUS CHAR(1) NOT NULL COMMENT '用户状态:1 可用,0 冻结', DEPT_ID INT NOT NULL COMMENT '部门ID', REMARK VARCHAR(255) DEFAULT NULL COMMENT '描述' )
true
ccef047510d55e9b69770f130276e0de4e7e3f9a
SQL
collinksmith/active-record-lite
/cats.sql
UTF-8
1,979
3.859375
4
[]
no_license
CREATE TABLE cats ( id INTEGER PRIMARY KEY, name VARCHAR(255) NOT NULL, owner_id INTEGER, FOREIGN KEY(owner_id) REFERENCES human(id) ); CREATE TABLE humans ( id INTEGER PRIMARY KEY, fname VARCHAR(255) NOT NULL, lname VARCHAR(255) NOT NULL, house_id INTEGER, FOREIGN KEY(house_id) REFERENCES human(id) ); CREATE TABLE houses ( id INTEGER PRIMARY KEY, address VARCHAR(255) NOT NULL ); INSERT INTO houses (id, address) VALUES (1, "26th and Guerrero"), (2, "Dolores and Market"); INSERT INTO humans (id, fname, lname, house_id) VALUES (1, "Devon", "Watts", 1), (2, "Matt", "Rubens", 1), (3, "Ned", "Ruggeri", 2), (4, "Catless", "Human", NULL); INSERT INTO cats (id, name, owner_id) VALUES (1, "Breakfast", 1), (2, "Earl", 2), (3, "Haskell", 3), (4, "Markov", 3), (5, "Stray Cat", NULL); DROP TABLE IF EXISTS patients; CREATE TABLE patients( id INTEGER PRIMARY KEY, fname VARCHAR(255) NOT NULL, lname VARCHAR(255) NOT NULL ); DROP TABLE IF EXISTS appointments; CREATE TABLE appointments( id INTEGER PRIMARY KEY, patient_id INTEGER, doctor_id INTEGER, FOREIGN KEY(patient_id) REFERENCES patient(id), FOREIGN KEY(doctor_id) REFERENCES doctor(id) ); DROP TABLE IF EXISTS doctors; CREATE TABLE doctors( id INTEGER PRIMARY KEY, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL ); DROP TABLE IF EXISTS stethoscopes; CREATE TABLE stethoscopes( id INTEGER PRIMARY KEY, name VARCHAR(255) NOT NULL, doctor_id INTEGER, FOREIGN KEY(doctor_id) REFERENCES doctor(id) ); INSERT INTO patients (fname, lname) VALUES ("Joe", "Johnson"), ("Bob", "Builder"), ("Mary", "Jane"); INSERT INTO appointments (patient_id, doctor_id) VALUES (1, 2), (1, 1), (1, 3), (2, 3), (2, 1); INSERT INTO doctors (name, type) VALUES ("House", "Badass"), ("Turk", "Surgeon"), ("J.D.", "Resident"); INSERT INTO stethoscopes (name, doctor_id) VALUES ("Blue scope", 2), ("Red scope", 2);
true
2c91be9055aa827982cfd943a3e1219999319212
SQL
SelviPnm/6701190099_PraAssessment
/ci4.sql
UTF-8
2,725
3.28125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 24, 2021 at 02:19 AM -- Server version: 10.4.19-MariaDB -- PHP Version: 8.0.6 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: `ci4` -- -- -------------------------------------------------------- -- -- Table structure for table `karyawan` -- CREATE TABLE `karyawan` ( `nama` varchar(128) NOT NULL, `nip` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `paket` -- CREATE TABLE `paket` ( `id` int(11) NOT NULL, `tgl_dtg` date NOT NULL, `sasaran` varchar(128) NOT NULL, `penerima` varchar(128) NOT NULL, `isi` varchar(128) NOT NULL, `tgl_ambil` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `paket` -- INSERT INTO `paket` (`id`, `tgl_dtg`, `sasaran`, `penerima`, `isi`, `tgl_ambil`) VALUES (1, '2021-06-23', 'Muthia Dwirza', 'Iis Lamot', 'Baju Tidur', '2021-06-23'), (2, '2021-06-22', 'Selvi Septiara', 'Lani Santi', 'Lampu Tumblr', '2021-06-24'); -- -------------------------------------------------------- -- -- Table structure for table `penghuni` -- CREATE TABLE `penghuni` ( `id` int(11) NOT NULL, `nama` varchar(128) NOT NULL, `unit` int(3) NOT NULL, `ktp` int(15) NOT NULL, `foto` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `penghuni` -- INSERT INTO `penghuni` (`id`, `nama`, `unit`, `ktp`, `foto`) VALUES (1, 'Muthia Dwirza', 1, 121321242, 'muthia.jpg'), (2, 'Selvi Septiara', 9, 121928191, 'selvi.jpg'); -- -- Indexes for dumped tables -- -- -- Indexes for table `karyawan` -- ALTER TABLE `karyawan` ADD PRIMARY KEY (`nama`); -- -- Indexes for table `paket` -- ALTER TABLE `paket` ADD PRIMARY KEY (`id`); -- -- Indexes for table `penghuni` -- ALTER TABLE `penghuni` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `paket` -- ALTER TABLE `paket` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `penghuni` -- ALTER TABLE `penghuni` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
a2cf2b0628802ad0f80c62c55766e2dbae2b459c
SQL
yardfarmer/expressMgmt
/as/proj/DataBase/doc/Oracle+PLSQl/Chp12/ErrorHandle.sql
GB18030
19,193
3.46875
3
[]
no_license
--ʱĴ DECLARE v_count NUMBER; BEGIN --emp001ڣPL/SQL潫ʱ SELECT COUNT(*) INTO v_count FROM emp001; DBMS_OUTPUT.PUT_LINE('ԱΪ'||v_count); END; DECLARE x NUMBER:=&x; --ʹòֵ y NUMBER:=&y; z NUMBER; BEGIN z:=x+y; -- DBMS_OUTPUT.PUT_LINE('x+y='||z); z:=x/y; -- DBMS_OUTPUT.PUT_LINE('x/y='||z); END; DECLARE x NUMBER:=&x; --ʹòֵ y NUMBER:=&y; z NUMBER; BEGIN z:=x+y; -- DBMS_OUTPUT.PUT_LINE('x+y='||z); IF y<>0 THEN z:=x/y; -- DBMS_OUTPUT.PUT_LINE('x/y='||z); END IF; END; DECLARE x NUMBER:=&x; --ʹòֵ y NUMBER:=&y; z NUMBER; BEGIN z:=x+y; -- DBMS_OUTPUT.PUT_LINE('x+y='||z); z:=x/y; -- DBMS_OUTPUT.PUT_LINE('x/y='||z); EXCEPTION --쳣 WHEN ZERO_DIVIDE THEN --0쳣 DBMS_OUTPUT.PUT_LINE('Ϊ0'); END; SELECT * FROM emp; /* Formatted on 2011/10/09 18:15 (Formatter Plus v4.8.8) */ DECLARE e_duplicate_name EXCEPTION; --쳣 v_ename emp.ename%TYPE; --ı v_newname emp.ename%TYPE := 'ʷ˹'; --²Ա BEGIN --ѯԱΪ7369 SELECT ename INTO v_ename FROM emp WHERE empno = 7369; --ȷûظ IF v_ename = v_newname THEN RAISE e_duplicate_name; --쳣e_duplicate_name쳣 END IF; --û쳣ִв INSERT INTO emp VALUES (7881, v_newname, 'ְԱ', NULL, TRUNC (SYSDATE), 2000, 200, 20); EXCEPTION --쳣 WHEN e_duplicate_name --쳣 THEN DBMS_OUTPUT.put_line ('ܲظԱ'); END; DECLARE e_duplicate_name EXCEPTION; --쳣 v_ename emp.ename%TYPE; --ı v_newname emp.ename%TYPE := 'ʷ˹'; --²Ա BEGIN --ѯԱΪ7369 SELECT ename INTO v_ename FROM emp WHERE empno = 7369; --ȷûظ IF v_ename = v_newname THEN RAISE e_duplicate_name; --쳣e_duplicate_name쳣 END IF; --û쳣ִв INSERT INTO emp VALUES (7881, v_newname, 'ְԱ', NULL, TRUNC (SYSDATE), 2000, 200, 20); EXCEPTION --쳣 WHEN e_duplicate_name THEN DBMS_OUTPUT.put_line ('ܲظԱ'); WHEN OTHERS THEN DBMS_OUTPUT.put_line('쳣룺'||SQLCODE||' 쳣Ϣ'||SQLERRM); END; /* Formatted on 2011/10/10 00:09 (Formatter Plus v4.8.8) */ DECLARE v_tmpstr VARCHAR2 (10); --һַ BEGIN v_tmpstr := 'ʱ'; --һͳȵַ EXCEPTION WHEN VALUE_ERROR -- ׽VALUE_ERROR THEN DBMS_OUTPUT.put_line ( 'VALUE_ERROR' || ' ţ' || SQLCODE || ' ƣ' || SQLERRM ); --ʾźʹϢ END; DECLARE e_nodeptno EXCEPTION; --Զ쳣 BEGIN NULL; END; DECLARE e_userdefinedexception EXCEPTION; e_userdefinedexception EXCEPTION; BEGIN RAISE e_userdefinedexception; EXCEPTION WHEN OTHERS THEN NULL; END; DECLARE e_userdefinedexception EXCEPTION; --쳣 BEGIN DECLARE e_userdefinedexception EXCEPTION; --ڴжͬ쳣 BEGIN RAISE e_userdefinedexception; --ڴе쳣 END; RAISE e_userdefinedexception; --е쳣 EXCEPTION WHEN OTHERS THEN --񲢴е쳣 DBMS_OUTPUT.put_line ('˴' || ' ţ' || SQLCODE || ' ƣ' || SQLERRM ); --ʾźʹϢ END; DECLARE e_outerexception EXCEPTION; --쳣 BEGIN DECLARE e_innerexception EXCEPTION; --ڴжͬ쳣 BEGIN RAISE e_innerexception; --ڴе쳣 RAISE e_outerexception; --ڴдж쳣 END; RAISE e_outerexception; --е쳣 --RAISE e_innerexception; --дڴе쳣ǷǷ EXCEPTION WHEN OTHERS THEN --񲢴е쳣 DBMS_OUTPUT.put_line ('˴' || ' ţ' || SQLCODE || ' ƣ' || SQLERRM ); --ʾźʹϢ END; DECLARE e_userdefinedexception EXCEPTION; --쳣 BEGIN DECLARE e_userdefinedexception EXCEPTION; --е쳣 BEGIN RAISE e_userdefinedexception; --ڴе쳣 END; EXCEPTION WHEN e_userdefinedexception THEN --ʱܲȡ쳣 DBMS_OUTPUT.put_line ('˴' || ' ţ' || SQLCODE || ' ƣ' || SQLERRM ); --ʾźʹϢ WHEN OTHERS THEN --쳣 NULL; END; /* Formatted on 2011/10/10 11:44 (Formatter Plus v4.8.8) */ DECLARE e_missingnull EXCEPTION; --һ쳣 PRAGMA EXCEPTION_INIT (e_missingnull, -1400); --쳣-1400й BEGIN INSERT INTO emp(empno)VALUES (NULL); --empвΪյempnoNULLֵ COMMIT; --ִгɹʹCOMMITύ EXCEPTION WHEN e_missingnull THEN --ʧ׽쳣 DBMS_OUTPUT.put_line ('ORA-1400'||SQLERRM); ROLLBACK; END; / /* Formatted on 2011/10/10 14:52 (Formatter Plus v4.8.8) */ CREATE OR REPLACE PROCEDURE registeremployee ( p_empno IN emp.empno%TYPE, --Ա p_ename IN emp.ename%TYPE, --Ա p_sal IN emp.sal%TYPE, --Աн p_deptno IN emp.deptno%TYPE --ű ) AS v_empcount NUMBER; BEGIN IF p_empno IS NULL --ԱΪNULL򴥷 THEN raise_application_error (-20000, 'ԱŲΪ'); --Ӧó쳣 ELSE SELECT COUNT (*) INTO v_empcount FROM emp WHERE empno = p_empno; --жԱǷ IF v_empcount > 0 --ԱѴ THEN raise_application_error (-20001, 'ԱΪ' || p_empno || 'ԱѴڣ' ); --Ӧó쳣 END IF; END IF; IF p_deptno IS NULL --űΪNULL THEN raise_application_error (-20002, 'űŲΪ'); --Ӧó쳣 END IF; INSERT INTO emp --empвԱ¼ (empno, ename, sal, deptno ) VALUES (p_empno, p_ename, p_sal, p_deptno ); EXCEPTION WHEN OTHERS THEN --׽Ӧó쳣 raise_application_error (-20003, 'ʱִ쳣룺' || SQLCODE || ' 쳣 ' || SQLERRM ); END; BEGIN RegisterEmployee(7369,'',2000,NULL); END; /* Formatted on 2011/10/10 15:51 (Formatter Plus v4.8.8) */ DECLARE e_nocomm EXCEPTION; --Զ쳣 v_comm NUMBER (10, 2); --ʱݵı v_empno NUMBER (4) := &empno; --Ӱ󶨲лȡԱϢ BEGIN SELECT comm INTO v_comm FROM emp WHERE empno = v_empno; --ѯȡԱ IF v_comm IS NULL --û THEN RAISE e_nocomm; --쳣 END IF; EXCEPTION WHEN e_nocomm THEN --Զ쳣 DBMS_OUTPUT.put_line ('ѡԱûɣ'); WHEN NO_DATA_FOUND THEN --Ԥ쳣 DBMS_OUTPUT.put_line ('ûҵκ'); WHEN OTHERS THEN --Ԥ쳣 DBMS_OUTPUT.put_line ('κδ쳣'); END; DECLARE e_nocomm EXCEPTION; --Զ쳣 v_comm NUMBER (10, 2); --ʱݵı v_empno NUMBER (4) := &empno; --Ӱ󶨲лȡԱϢ BEGIN SELECT comm INTO v_comm FROM emp WHERE empno = v_empno; --ѯȡԱ IF v_comm IS NULL --û THEN RAISE e_nocomm; --쳣 END IF; EXCEPTION WHEN OTHERS THEN --OTHERS뵥 DBMS_OUTPUT.put_line ('룺'||SQLCODE||' Ϣ'||SQLERRM(100)); END; DECLARE e_outerexception EXCEPTION; e_innerexception EXCEPTION; e_threeexception EXCEPTION; BEGIN BEGIN RAISE e_innerexception; RAISE e_outerexception; RAISE e_threeexception; EXCEPTION WHEN e_innerexception THEN --쳣 END; EXCEPTION WHEN e_outerexception THEN --쳣 END; BEGIN DECLARE v_ename VARCHAR2(2):='ABC'; BEGIN DBMS_OUTPUT.PUT_LINE(v_ename); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('쳣'); END; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ţ' ||SQLCODE||' Ϣ' ||SQLERRM); END; DECLARE e_outerexception EXCEPTION; e_innerexception EXCEPTION; e_threeexception EXCEPTION; BEGIN BEGIN RAISE e_innerexception; RAISE e_outerexception; RAISE e_threeexception; EXCEPTION WHEN e_innerexception THEN RAISE e_outerexception; WHEN e_outerexception THEN --쳣 WHEN OTHERS THEN --쳣 END; EXCEPTION WHEN e_outerexception THEN --쳣 END; SELECT * FROM emp; DECLARE e_nocomm EXCEPTION; --Զ쳣 v_comm NUMBER (10, 2); --ʱݵı v_empno NUMBER (4) := &empno; --Ӱ󶨲лȡԱϢ BEGIN SELECT comm INTO v_comm FROM emp WHERE empno = v_empno; --ѯȡԱ IF v_comm IS NULL --û THEN RAISE e_nocomm; --쳣 END IF; EXCEPTION WHEN OTHERS THEN --OTHERS뵥 DBMS_OUTPUT.put_line ('룺'||SQLCODE||' Ϣ'||SQLERRM(100)); RAISE; --׳쳣 END; DECLARE e_duplicate_name EXCEPTION; --쳣 v_ename emp.ename%TYPE; --ı v_newname emp.ename%TYPE := 'ʷ˹'; --²Ա BEGIN BEGIN --Ƕ׿д쳣 SELECT ename INTO v_ename FROM emp WHERE empno = 7369; IF v_ename = v_newname THEN RAISE e_duplicate_name; --쳣e_duplicate_name쳣 END IF; EXCEPTION WHEN e_duplicate_name THEN v_newname:=''; END; --û쳣ִв INSERT INTO emp VALUES (7881, v_newname, 'ְԱ', NULL, TRUNC (SYSDATE), 2000, 200, 20); EXCEPTION --쳣 WHEN OTHERS THEN DBMS_OUTPUT.put_line('쳣룺'||SQLCODE||' 쳣Ϣ'||SQLERRM); END; DECLARE v_empno1 NUMBER(4):=&empno1; --Աѯ v_empno2 NUMBER(4):=&empno2; v_empno3 NUMBER(4):=&empno3; v_sal1 NUMBER(10,2); --屣Աнʵı v_sal2 NUMBER(10,2); v_sal3 NUMBER(10,2); v_selectcounter NUMBER := 1; --ѯ BEGIN SELECT sal INTO v_sal1 FROM emp WHERE empno=v_empno1; --ѯԱнϢ v_selectcounter:=2; SELECT sal INTO v_sal2 FROM emp WHERE empno=v_empno2; v_selectcounter:=3; SELECT sal INTO v_sal3 FROM emp WHERE empno=v_empno3; EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM ||' 쳣λǣ'||v_selectcounter); END; DECLARE v_empno1 NUMBER(4):=&empno1; --Աѯ v_empno2 NUMBER(4):=&empno2; v_empno3 NUMBER(4):=&empno3; v_sal1 NUMBER(10,2); --屣Աнʵı v_sal2 NUMBER(10,2); v_sal3 NUMBER(10,2); BEGIN BEGIN SELECT sal INTO v_sal1 FROM emp WHERE empno=v_empno1; --ѯԱнϢ EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM ||' 쳣λ 1'); END; BEGIN SELECT sal INTO v_sal2 FROM emp WHERE empno=v_empno2; EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM ||' 쳣λ 2'); END; BEGIN SELECT sal INTO v_sal3 FROM emp WHERE empno=v_empno3; EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM ||' 쳣λ 3'); END; EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM); END; DECLARE v_empno1 NUMBER(4):=&empno1; --Աѯ v_empno2 NUMBER(4):=&empno2; v_empno3 NUMBER(4):=&empno3; v_sal1 NUMBER(10,2); --屣Աнʵı v_sal2 NUMBER(10,2); v_sal3 NUMBER(10,2); v_str VARCHAR2(200); BEGIN SELECT sal INTO v_sal1 FROM emp WHERE empno=v_empno1; --ѯԱнϢ SELECT sal INTO v_sal2 FROM emp WHERE empno=v_empno2; SELECT sal INTO v_sal3 FROM emp WHERE empno=v_empno3; EXCEPTION WHEN NO_DATA_FOUND THEN --δҵݵ쳣 DBMS_OUTPUT.PUT_LINE('ţ'||SQLCODE||' Ϣ'||SQLERRM ||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE); END; SELECT * FROM emp WHERE empno=7881; DECLARE e_duplicate_name EXCEPTION; --쳣 v_ename emp.ename%TYPE; --ı v_newname emp.ename%TYPE := 'ʷ˹'; --²Ա BEGIN LOOP --ʼѭ BEGIN --Ƕ뵽ӿ SAVEPOINT ʼ; --һ SELECT ename INTO v_ename FROM emp WHERE empno = 7369; --ʼ IF v_ename = v_newname THEN RAISE e_duplicate_name; --ظe_duplicate_name쳣 END IF; INSERT INTO emp VALUES (7881, v_newname, 'ְԱ', NULL, TRUNC (SYSDATE), 2000, 200, 20); COMMIT; --ύ EXIT; --ύ˳ѭ EXCEPTION --쳣 WHEN e_duplicate_name THEN ROLLBACK TO ʼ; --ع񵽼λ v_newname:=''; --Ϊ쳣Ա¸ֵ¿ʼѭִ END; END LOOP; END;
true
e3943e1cafbd800d831b20bab8d452e9e47dcc05
SQL
SleepyyNet/musicbot-1
/schema/tables.sql
UTF-8
3,517
4.1875
4
[]
no_license
create table if not exists folders ( id serial primary key, name text unique not null, created_at timestamp default null, updated_at timestamp default null ); create table if not exists tags ( id serial primary key, name text unique not null, created_at timestamp default null, updated_at timestamp default null ); create table if not exists artists ( id serial primary key, name text unique not null, created_at timestamp default null, updated_at timestamp default null ); create table if not exists genres ( id serial primary key, name text unique not null, created_at timestamp default null, updated_at timestamp default null ); create table if not exists albums ( id serial primary key, artist_id integer not null, name text not null, youtube text default '', foreign key(artist_id) references artists (id), created_at timestamp default null, updated_at timestamp default null, unique(artist_id,name) ); create table if not exists musics ( id serial primary key, artist_id integer, album_id integer, genre_id integer, folder_id integer, youtube text default '', number integer not null, rating float, duration integer, size integer, title text, path text unique not null, created_at timestamp default null, updated_at timestamp default null, foreign key(artist_id) references artists (id), foreign key(album_id) references albums (id), foreign key(genre_id) references genres (id), foreign key(folder_id) references folders (id), constraint rating_range check (rating between 0.0 and 5.0) ); create table if not exists music_tags ( music_id integer not null, tag_id integer not null, created_at timestamp default null, updated_at timestamp default null, primary key (music_id, tag_id), foreign key(music_id) references musics (id) on delete cascade, foreign key(tag_id) references tags (id) ); drop aggregate if exists array_cat_agg(anyarray) cascade; create aggregate array_cat_agg(anyarray) ( SFUNC=array_cat, STYPE=anyarray ); create table if not exists stats ( id bigserial primary key, musics bigint not null default 0, albums bigint not null default 0, artists bigint not null default 0, genres bigint not null default 0, keywords bigint not null default 0, duration bigint not null default 0, size bigint not null default 0 ); create table if not exists filters ( id serial primary key, name text unique not null, min_duration integer default 0, max_duration integer default +2147483647, min_size integer default 0, max_size integer default +2147483647, min_rating float default 0.0, max_rating float default 5.0, artists text[] default '{}', no_artists text[] default '{}', albums text[] default '{}', no_albums text[] default '{}', titles text[] default '{}', no_titles text[] default '{}', genres text[] default '{}', no_genres text[] default '{}', formats text[] default '{}', no_formats text[] default '{}', keywords text[] default '{}', no_keywords text[] default '{}', shuffle boolean default 'false', relative boolean default 'false', "limit" integer default +2147483647, youtube text default null, constraint min_rating_range check (min_rating between 0.0 and 5.0), constraint max_rating_range check (max_rating between 0.0 and 5.0) );
true
0c52ff3a7db4c54ca81d6966004e5cf8f7333473
SQL
murari-goswami/bi
/ETL/DataVirtuality/views/datamart/datamart.dim_customer.sql
UTF-8
3,734
3.6875
4
[]
no_license
-- Name: datamart.dim_customer -- Created: 2015-09-21 17:22:35 -- Updated: 2015-09-21 17:22:35 /******************************************************************************** -- Author Hemanth -- Created 2015-07-01 -- Purpose This view joins tables from raw and datamart schema. -- Tables raw.dim_customer,datamart.dim_opportunity,datamart.dim_order,datamart.dim_case ----------------------------------------------------------------------------------- -- Modification History -- Date Author Description -- 2015-09-16 Hemanth 1) Added first_sales_channel_1 and first_sales_channel_2 2) Removed nb_orders,nb_case since it is already available in datamart.fact_customer -- 2015-09-21 Hemanth Renamed column names according to KPI bilble **********************************************************************************/ CREATE VIEW datamart.dim_customer AS SELECT a.customer_id, c.first_sales_channel_1 AS customer_acquisition_channel_1, /*first saleschannel of customer*/ c.first_sales_channel_2 AS customer_acquisition_channel_2, CASE WHEN d.cluster='CLUB' THEN 'Club' WHEN d.cluster='AC' THEN 'Loyal' WHEN d.cluster IN ('NOCALL0','CALL0') THEN 'New' WHEN d.cluster IN ('CLIM','NCLIM') THEN 'Young' WHEN d.cluster='P6' THEN 'Passive' WHEN d.cluster='P12' THEN 'Inactive' END AS customer_segment, a.date_created AS date_account_created, TIMESTAMPDIFF(SQL_TSI_YEAR, cast(a.date_of_birth AS date),CURDATE()) AS customer_age, c.status_last_case as customer_status, CASE WHEN a.phone_number IS NOT NULL THEN '1' ELSE '0' END AS has_phone_number, CASE WHEN a.email IS NOT NULL THEN '1' ELSE '0' END AS has_email, CASE WHEN a.providerid='facebook' THEN '1' ELSE '0' END AS has_facebook, CASE WHEN a.providerid='linkedin' THEN '1' ELSE '0' END AS has_linkedin, CASE WHEN a.providerid='xing' THEN '1' ELSE '0' END AS has_xing, CASE WHEN club_member=true THEN '0' WHEN club_member='Cancelled' THEN 'Cancelled' ELSE '0' END AS is_club_customer, a.domain_page, a.user_type FROM raw.dim_customer a LEFT JOIN ( SELECT b.customer_id, COUNT(DISTINCT b.opp_id) AS nb_orders, COUNT(DISTINCT b.case_no) AS nb_cases, MIN(CASE WHEN b.rank_first=1 THEN b.opp_sales_channel_1 ELSE NULL END) AS first_sales_channel_1, MIN(CASE WHEN b.rank_first=1 THEN b.opp_sales_channel_2 ELSE NULL END) AS first_sales_channel_2, MIN(CASE WHEN b.rank_first=1 THEN b.date_opp_created ELSE NULL END) AS first_date_opp_created, MIN(CASE WHEN b.rank_first=2 THEN b.date_opp_created ELSE NULL END) AS second_date_opp_created, MIN(CASE WHEN b.rank_last=1 THEN b.date_opp_created ELSE NULL END) AS last_date_opp_created, MIN(CASE WHEN b.rank_last=1 THEN b.case_status ELSE NULL END) AS status_last_case FROM ( SELECT ROW_NUMBER() over(partition by op.customer_id ORDER BY op.date_opp_created) AS rank_first, ROW_NUMBER() over(partition by op.customer_id ORDER BY op.date_opp_created DESC) AS rank_last, op.opp_id, op.customer_id, ca.case_no, ca.case_status, op.opp_sales_channel_1, op.opp_sales_channel_2, co.parent_order_id, op.date_opp_created, co.date_order_created FROM datamart.dim_opportunity op LEFT JOIN datamart.dim_order co ON co.order_id=op.opp_id LEFT JOIN datamart.dim_case ca ON ca.case_id=op.opp_id )b GROUP BY b.customer_id )c ON c.customer_id=a.customer_id LEFT JOIN raw.customer_cluster d ON a.customer_id=d.customer_id
true
d4cb53cd011e80aa32fb650b92d92f4ff8cf8843
SQL
AadityaDeshpande/JavaChattingApp
/chatusers.sql
UTF-8
5,296
2.796875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 29, 2019 at 01:52 PM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `chatusers` -- -- -------------------------------------------------------- -- -- Table structure for table `aaditya` -- CREATE TABLE `aaditya` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) NOT NULL, `message` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `aaditya` -- INSERT INTO `aaditya` (`id`, `msgfrom`, `message`) VALUES (1, 'saish', 'hello'); -- -------------------------------------------------------- -- -- Table structure for table `anand` -- CREATE TABLE `anand` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) NOT NULL, `message` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `anand` -- INSERT INTO `anand` (`id`, `msgfrom`, `message`) VALUES (1, 'aaditya', 'kai re bhai'), (2, 'saish', 'takala na bhai'), (3, 'saish', 'he;llo'), (4, 'anand', 'sup brohhh'); -- -------------------------------------------------------- -- -- Table structure for table `devashish` -- CREATE TABLE `devashish` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) NOT NULL, `message` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `devashish` -- INSERT INTO `devashish` (`id`, `msgfrom`, `message`) VALUES (1, 'saish', 'hello'); -- -------------------------------------------------------- -- -- Table structure for table `fd` -- CREATE TABLE `fd` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) DEFAULT NULL, `message` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `ijk` -- CREATE TABLE `ijk` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) DEFAULT NULL, `message` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `john` -- CREATE TABLE `john` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) DEFAULT NULL, `message` varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `saish` -- CREATE TABLE `saish` ( `id` int(11) NOT NULL, `msgfrom` varchar(10) NOT NULL, `message` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `saish` -- INSERT INTO `saish` (`id`, `msgfrom`, `message`) VALUES (1, 'aaditya', 'bro'), (2, 'devashish', 'hello'), (3, 'devashish', 'bye'), (11, 'aaditya', 'msg from aaditya'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `user` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`user`) VALUES ('aaditya'), ('saish'), ('devashish'), ('anand'), ('shri'), ('hite'), ('joshi'), ('josh'), ('jos'), ('jo'), ('sai'), ('aad'), ('mas'), ('abc'), ('kj'), ('name'), ('mas'), ('kj'), ('jh'), ('gf'), ('fd'), ('john'), ('ijk'); -- -- Indexes for dumped tables -- -- -- Indexes for table `aaditya` -- ALTER TABLE `aaditya` ADD PRIMARY KEY (`id`); -- -- Indexes for table `anand` -- ALTER TABLE `anand` ADD PRIMARY KEY (`id`); -- -- Indexes for table `devashish` -- ALTER TABLE `devashish` ADD PRIMARY KEY (`id`); -- -- Indexes for table `fd` -- ALTER TABLE `fd` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ijk` -- ALTER TABLE `ijk` ADD PRIMARY KEY (`id`); -- -- Indexes for table `john` -- ALTER TABLE `john` ADD PRIMARY KEY (`id`); -- -- Indexes for table `saish` -- ALTER TABLE `saish` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `aaditya` -- ALTER TABLE `aaditya` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `anand` -- ALTER TABLE `anand` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `devashish` -- ALTER TABLE `devashish` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `fd` -- ALTER TABLE `fd` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `ijk` -- ALTER TABLE `ijk` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `john` -- ALTER TABLE `john` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `saish` -- ALTER TABLE `saish` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
e70fd6facb28ffc44f231c096dbf6d71c7f88cb5
SQL
ayoubHam2000/fs_licence
/s6_repository/sql/plsqlcodes/30/ep10 Bind var.sql
UTF-8
451
2.65625
3
[]
no_license
SET SERVEROUTPUT ON; --Bind var --CREATE TABLE TEST_TAB(name VARCHAR(30), nbr INT); --insert into test_tab values('ayoub', 20); --insert into test_tab values('alae', 30); set AUTOPRINT ON; variable v_sal number; --Exec :v_sal := 50; begin select nbr into :v_sal from test_tab where name = 'alae'; end; / --print v_sal; -- ep 09 -- see variables types.png -- see at %type.png -- ep 10 -- LOB data types.png -- see composite data types.png
true
7b594524a77eb90d6c1ae08cdd8c0adad0ea1f91
SQL
abpwrs/ece-5995-fa20
/dbhw1/Q6.sql
UTF-8
491
3.796875
4
[]
no_license
-- Find the review count and averageRating per ageGroup for each product. -- Show productid, ageGroup, reviewCount, and averageRating. SELECT productid, ageGroup, SUM(reviewCount) AS review_count, AVG(score) AS avg_rating FROM reviews INNER JOIN user_stats ON (reviews.userid = user_stats.userid) WHERE productid = 'B004JRKEH4' OR productid = 'B004X3VRLG' OR productid = 'B0026RQTGE' OR productid = 'B001BM3C0Q' OR productid = 'B007K449CE' GROUP BY productid, ageGroup;
true
f78516618be6814a430b6793e48ce1881d38187e
SQL
evakung/MyWebsite
/evakun5_addresses.sql
UTF-8
3,876
2.796875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 23, 2017 at 02:52 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 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: `evakun5_addresses` -- -- -------------------------------------------------------- -- -- Table structure for table `evakun5_addresses` -- CREATE TABLE `evakun5_addresses` ( `Date` date DEFAULT NULL, `StreetNum` int(5) DEFAULT NULL, `StreetName` varchar(30) DEFAULT NULL, `StreetType` varchar(20) DEFAULT NULL, `Direction` varchar(2) DEFAULT NULL, `UnitNum` int(10) DEFAULT NULL, `City` varchar(20) DEFAULT NULL, `Province` varchar(2) DEFAULT NULL, `PostalCode` varchar(7) DEFAULT NULL, `Basic` int(11) DEFAULT NULL, `Listing` int(11) DEFAULT NULL, `Comps` int(11) DEFAULT NULL, `Total` int(10) DEFAULT NULL, `Paid` varchar(3) DEFAULT NULL, `AID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `evakun5_addresses` -- INSERT INTO `evakun5_addresses` (`Date`, `StreetNum`, `StreetName`, `StreetType`, `Direction`, `UnitNum`, `City`, `Province`, `PostalCode`, `Basic`, `Listing`, `Comps`, `Total`, `Paid`, `AID`) VALUES ('2017-06-18', 657, '65', 'Avenue', 'E', NULL, 'Vancouver', 'BC', 'V5X 2P7', 1, 1, 1, 30, 'x', 1), ('2017-06-23', 4750, 'Highlawn', 'Drive', NULL, NULL, 'Burnaby', 'BC', 'V5C 3T1', 1, 1, NULL, 20, 'x', 2), ('2017-06-24', 7878, 'Westminster ', 'Highway', NULL, 606, 'Richmond', 'BC', 'V6X 4A2', NULL, 1, 0, 10, 'x', 3), ('2017-06-24', 10391, 'Holleywell', 'Drive', NULL, NULL, 'Richmond', 'BC', 'V7E 5C8', NULL, NULL, 1, 10, 'x', 4), ('2017-06-27', 5288, 'Grimmer', 'Street', NULL, 216, 'Burnaby', 'BC', 'V5H 0C5', 1, 1, 1, 30, 'x', 5), ('2017-07-05', 3975, 'Mcgill', 'Street', NULL, NULL, 'Burnaby', 'BC', 'V5C 1M4', 1, 1, 1, 30, NULL, 6), ('2017-07-05', 220, 'Sandringham', 'Crescent', NULL, NULL, 'Vancouver', 'BC', 'V7N 2R6', 1, NULL, NULL, 10, NULL, 7), ('2017-07-06', 1238, 'Richards', 'Street', NULL, 1608, 'Vancouver', 'BC', 'V6B 6M6', NULL, NULL, 1, 10, NULL, 8), ('2017-07-06', 2023, '4', 'Ave', 'E', NULL, 'Vancouver', 'BC', 'V5N 1K5', 1, 1, NULL, 20, NULL, 9), ('2017-07-07', 408, '17', 'Ave', 'W', NULL, 'Vancouver', 'BC', 'V5Y 2A2', 1, 1, 1, 30, NULL, 10), ('2017-07-22', 7711, 'French ', 'Street', NULL, NULL, 'Vancouver', 'BC', 'V6P 4V5', 1, 1, 0, 20, NULL, 11), ('2017-07-22', 2609, 'St George', 'Street', NULL, NULL, 'Port Moody', 'BC', 'V6P 6G5', 1, 1, 1, 30, NULL, 12), ('2017-07-22', 7711, 'French ', 'Street', NULL, NULL, 'Vancouver', 'BC', 'V6P 4V5', 1, 1, NULL, 20, NULL, 13), ('2017-07-22', 2609, 'St George', 'Street', NULL, NULL, 'Port Moody', 'BC', 'V6P 6G5', 1, 1, 1, 30, NULL, 14), ('2017-07-17', 3851, 'Broadway', 'Street', NULL, NULL, 'Richmond', 'BC', 'V7E 2Y3', 1, 1, 1, 30, NULL, 15), ('2017-07-11', 832, 'York', 'Street', NULL, NULL, 'New Westminster', 'BC', 'V7E 2Y3', 1, 1, 1, 30, NULL, 16), ('2017-07-20', 5969, 'Granville', 'Street', NULL, NULL, 'Vancouver', 'BC', 'V6P 4V9', 1, 1, 1, 35, '', 17); -- -- Indexes for dumped tables -- -- -- Indexes for table `evakun5_addresses` -- ALTER TABLE `evakun5_addresses` ADD PRIMARY KEY (`AID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `evakun5_addresses` -- ALTER TABLE `evakun5_addresses` MODIFY `AID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
451bcf6bedb298acb1b4767320eaa4e828dc544d
SQL
AdelekeIO/bucket-api
/BucketList.sql
UTF-8
3,591
3.109375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Aug 15, 2019 at 01:24 AM -- Server version: 10.3.16-MariaDB -- PHP Version: 7.3.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `BucketList` -- -- -------------------------------------------------------- -- -- Table structure for table `bucket_list` -- CREATE TABLE `bucket_list` ( `id` int(5) NOT NULL, `name` varchar(251) NOT NULL, `date_created` varchar(51) NOT NULL, `date_modified` varchar(51) NOT NULL, `created_by` varchar(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `bucket_list` -- INSERT INTO `bucket_list` (`id`, `name`, `date_created`, `date_modified`, `created_by`) VALUES (5, 'Dollarlet', '08-14-2019 08:04:33', '08-14-2019 22:23:42', '1'), (7, 'Nullisis', '08-14-2019 08:05:18', '08-14-2019 22:15:27', '1'), (8, 'Love', '08-14-2019 09:30:40', '', '1'); -- -------------------------------------------------------- -- -- Table structure for table `items` -- CREATE TABLE `items` ( `id` int(5) NOT NULL, `bucket_id` int(5) NOT NULL, `name` varchar(251) NOT NULL, `date_created` varchar(251) NOT NULL, `date_modified` varchar(251) NOT NULL, `done` varchar(5) NOT NULL DEFAULT 'False' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `items` -- INSERT INTO `items` (`id`, `bucket_id`, `name`, `date_created`, `date_modified`, `done`) VALUES (2, 8, 'Dove', '08-10-2019 23:18:34', '08-10-2019 23:32:39', 'TRUE'), (3, 8, 'sohs', '08-14-2019 21:17:47', '', 'False'), (4, 2, 'odh', '08-14-2019 21:18:58', '', 'True'), (5, 2, 'kww', '08-14-2019 21:21:22', '', 'True'), (6, 2, 'haul', '08-14-2019 21:22:20', '', 'False'), (7, 2, 'ss', '08-14-2019 21:23:06', '', 'null'), (8, 2, 'sslsl', '08-14-2019 21:24:17', '', 'True'); -- -------------------------------------------------------- -- -- Table structure for table `login` -- CREATE TABLE `login` ( `id` int(5) NOT NULL, `username` varchar(251) NOT NULL, `password` varchar(251) NOT NULL, `date_added` varchar(251) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `login` -- INSERT INTO `login` (`id`, `username`, `password`, `date_added`, `status`) VALUES (1, 'devsegun', 'e2b4a430f466d188e9ad0e7b717e40494c9e216b', 'zigzag', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `bucket_list` -- ALTER TABLE `bucket_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `items` -- ALTER TABLE `items` ADD PRIMARY KEY (`id`); -- -- Indexes for table `login` -- ALTER TABLE `login` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `bucket_list` -- ALTER TABLE `bucket_list` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `items` -- ALTER TABLE `items` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `login` -- ALTER TABLE `login` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 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
5059eb281e121d360625202ea1096537c5494751
SQL
Hal-L/echo
/AD/day11_MySql基础/SQL语句/03表数据的查询/05_查询_排序查询.sql
UTF-8
587
4.0625
4
[]
no_license
/* 排序查询 标准语法: SELECT 列名 FROM 表名 [WHERE 条件] ORDER BY 列名1 排序方式1,列名2 排序方式2; */ -- 按照库存升序排序 SELECT * FROM product ORDER BY stock ASC; -- 查询名称中包含手机的商品信息。按照金额降序排序 SELECT * FROM product WHERE NAME LIKE '%手机%' ORDER BY price DESC; -- 按照金额升序排序,如果金额相同,按照库存降序排列 -- 多个排序条件时,如果前面的条件无法决定顺序的时候,才会按照后面条件排序 SELECT * FROM product ORDER BY price ASC,stock DESC;
true
0279ce66769dc03477ae107e0adfbb3a1cc12fa2
SQL
renzsanchez69/Crapi_admin
/sql/archived/crapi_JULY8_2019.sql
UTF-8
18,387
2.953125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 07, 2019 at 06:52 PM -- Server version: 10.1.28-MariaDB -- PHP Version: 5.6.32 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `crapi` -- -- -------------------------------------------------------- -- -- Table structure for table `admins` -- CREATE TABLE `admins` ( `id` int(10) UNSIGNED NOT NULL, `status` int(11) NOT NULL DEFAULT '1' COMMENT '1:active; 2:stop', `firstname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lastname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci, `contact_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female','others') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `display_photo` text COLLATE utf8mb4_unicode_ci, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `admins` -- INSERT INTO `admins` (`id`, `status`, `firstname`, `lastname`, `address`, `contact_number`, `gender`, `username`, `email`, `display_photo`, `password`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, 'Admin', 'Istrator', NULL, NULL, 'male', 'admin', 'admin@gmail.com', NULL, '$2y$10$OMSeK8Pe70nIHjkiTFLm8uX72fErkZKP6B4H6z7nZcakdPlMsayxe', NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `customers` -- CREATE TABLE `customers` ( `id` int(10) UNSIGNED NOT NULL, `login_token` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '1' COMMENT '1:active; 2:stop', `firstname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lastname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci, `contact_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `longitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `latitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `customers` -- INSERT INTO `customers` (`id`, `login_token`, `password`, `status`, `firstname`, `lastname`, `address`, `contact_number`, `gender`, `email`, `longitude`, `latitude`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, '681113087d030e01f41abfd0628e6b46e7dc9ad54de8', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'One', 'test\r\n', '09876543219', 'male', 'customer1@gmail.com', NULL, NULL, NULL, '2019-07-07 14:59:23', NULL), (2, 'abc123', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Two', 'test\r\n', '09876543219', 'male', 'customer2@gmail.com', NULL, NULL, NULL, NULL, NULL), (3, '0d1e1b6f4b7b8a571e763c693744fee75ca9ececce62', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Three', 'test\r\n', '09876543219', 'male', 'customer3@gmail.com', NULL, NULL, NULL, '2019-07-07 08:39:53', NULL), (4, 'abc123', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Four', 'test\r\n', '09876543219', 'male', 'customer4@gmail.com', NULL, NULL, NULL, NULL, NULL), (5, NULL, '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Five', 'test address', '09876543219', NULL, 'customer5@gmail.com,', NULL, NULL, '2019-04-14 11:27:06', '2019-04-14 11:27:06', NULL), (7, '996419605c5439c6e3ce2d00e1ba411c5a654f9de328', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Five', 'test address', '09876543219', NULL, 'customer5@gmail.com,', NULL, NULL, '2019-04-14 11:34:18', '2019-04-14 11:34:18', NULL), (8, '52a3ab02157cc7396a830c77e1f78d1159e2c169cc7c', '$2y$10$/W8.yDgs33C6yoVQFWZxyOSwWsNYbBBxdQPFN8HI/vZ6Seq6k129K', 1, 'Customer', 'Five', 'test address', '09876543219', NULL, 'customer5@gmail.com,', NULL, NULL, '2019-04-14 11:34:48', '2019-04-14 11:34:48', NULL); -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE `employees` ( `id` int(10) UNSIGNED NOT NULL, `login_token` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `owner_id` int(10) UNSIGNED NOT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '1' COMMENT '1:active; 2:stop', `firstname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lastname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci, `contact_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`id`, `login_token`, `owner_id`, `password`, `status`, `firstname`, `lastname`, `address`, `contact_number`, `gender`, `email`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, NULL, 1, '$2y$10$OMSeK8Pe70nIHjkiTFLm8uX72fErkZKP6B4H6z7nZcakdPlMsayxe', 1, 'Employee', 'One', 'test address emp 1', '09876542310', 'male', 'emp1@g.com', NULL, '2019-06-27 16:12:37', NULL), (2, NULL, 2, '$2y$10$OMSeK8Pe70nIHjkiTFLm8uX72fErkZKP6B4H6z7nZcakdPlMsayxe', 1, 'Employee', 'Two', '887 MJ Cuenco Ave., Cebu City', '9994092682', 'female', 'emp2@g.com', '2019-06-27 14:25:13', '2019-06-27 14:25:13', NULL), (3, NULL, 1, '$2y$10$aUjUTFN6oCi34upOH8/XLOfxN6AMi1Ds0auYpeK/bUU.Ior9dpwla', 1, 'Employee', 'Two', '234 VC Dalisay Ave., Kardo City', '09876542310', 'male', 'emp2@g.com', '2019-06-27 16:13:44', '2019-07-03 17:01:13', NULL), (4, NULL, 1, '$2y$10$8O1cvyW/rcqKJDdxW5eaFechHALxEupsjP1Qg/7tS4KvaECTFON9i', 1, 'Employee', 'Three', '887 MJ Cuenco Ave., Cebu City', '09876542310', 'male', 'emp3@g.com', '2019-07-03 17:01:47', '2019-07-03 17:01:56', NULL); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(10) UNSIGNED NOT NULL, `order_hash` varchar(100) NOT NULL, `customer_id` int(10) UNSIGNED NOT NULL, `resto_id` int(11) NOT NULL, `order_status` enum('pending','success','failed') NOT NULL DEFAULT 'pending', `is_paid` tinyint(2) NOT NULL DEFAULT '0', `is_delivered` tinyint(2) NOT NULL DEFAULT '0', `is_received` tinyint(2) NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `order_number` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `order_hash`, `customer_id`, `resto_id`, `order_status`, `is_paid`, `is_delivered`, `is_received`, `created_at`, `updated_at`, `order_number`) VALUES (2, '0', 1, 2, 'success', 0, 0, 0, '2019-07-02 13:12:47', '2019-07-03 17:04:49', '2147483647'), (3, '0', 1, 2, 'success', 1, 0, 0, '2019-07-04 14:04:49', '2019-07-07 16:08:19', '2147483647'), (4, '0', 1, 1, 'success', 1, 0, 0, '2019-07-04 14:08:45', '2019-07-07 16:25:53', '2147483647'), (5, '0', 3, 2, 'pending', 0, 0, 0, '2019-07-07 08:40:23', '2019-07-07 08:40:23', '2147483647'), (6, '0', 3, 1, 'success', 0, 0, 0, '2019-07-07 09:00:57', '2019-07-07 09:02:07', '2147483647'), (7, '0', 3, 1, 'pending', 0, 0, 0, '2019-07-07 09:05:48', '2019-07-07 09:05:48', '2147483647'), (8, '0', 1, 1, 'pending', 0, 0, 0, '2019-07-07 16:40:19', '2019-07-07 16:40:19', '2147483647'), (9, 'CRP_11562518080', 1, 2, 'success', 1, 0, 0, '2019-07-07 16:48:00', '2019-07-07 16:48:53', '11562518080'); -- -------------------------------------------------------- -- -- Table structure for table `order_details` -- CREATE TABLE `order_details` ( `id` int(10) UNSIGNED NOT NULL, `order_id` int(10) UNSIGNED NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `qty` int(10) UNSIGNED NOT NULL, `price` int(10) UNSIGNED NOT NULL, `sub_total` int(10) UNSIGNED NOT NULL, `description_request` text, `status` enum('pending','success','falied') NOT NULL DEFAULT 'pending', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `order_status` enum('pending','success','falied') NOT NULL, `resto_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order_details` -- INSERT INTO `order_details` (`id`, `order_id`, `product_id`, `qty`, `price`, `sub_total`, `description_request`, `status`, `created_at`, `updated_at`, `order_status`, `resto_id`) VALUES (1, 2, 4, 2, 30, 70, '', 'success', '2019-07-02 13:12:47', '2019-07-03 17:03:37', 'success', 2), (3, 2, 5, 1, 30, 30, '', 'success', '2019-07-02 13:31:48', '2019-07-03 17:03:44', 'success', 0), (17, 4, 9, 3, 50, 150, '', 'pending', '2019-07-06 16:14:47', '2019-07-06 16:14:47', 'pending', 0), (19, 4, 3, 2, 69, 138, '', 'pending', '2019-07-06 16:14:54', '2019-07-06 16:23:04', 'pending', 0), (20, 5, 9, 1, 50, 50, '', 'pending', '2019-07-07 08:40:23', '2019-07-07 08:40:23', 'pending', 2), (21, 6, 8, 7, 49, 343, '', 'pending', '2019-07-07 09:00:57', '2019-07-07 09:00:57', 'pending', 1), (22, 7, 6, 1, 50, 50, '', 'pending', '2019-07-07 09:05:48', '2019-07-07 09:05:48', 'pending', 1), (23, 7, 7, 5, 49, 245, '', 'pending', '2019-07-07 09:11:31', '2019-07-07 09:11:31', 'pending', 0), (24, 3, 9, 2, 50, 100, '', 'pending', '2019-07-07 13:52:52', '2019-07-07 13:52:52', 'pending', 0), (25, 3, 5, 3, 30, 90, '', 'pending', '2019-07-07 13:52:55', '2019-07-07 13:52:55', 'pending', 0), (26, 3, 4, 5, 40, 200, '', 'pending', '2019-07-07 13:53:05', '2019-07-07 13:53:05', 'pending', 0), (27, 8, 8, 2, 49, 98, '', 'pending', '2019-07-07 16:40:19', '2019-07-07 16:40:19', 'pending', 1), (28, 8, 7, 3, 49, 147, '', 'pending', '2019-07-07 16:40:21', '2019-07-07 16:40:21', 'pending', 0), (29, 8, 6, 4, 50, 200, '', 'pending', '2019-07-07 16:40:24', '2019-07-07 16:40:24', 'pending', 0), (30, 9, 9, 2, 50, 100, '', 'pending', '2019-07-07 16:48:00', '2019-07-07 16:48:00', 'pending', 2); -- -------------------------------------------------------- -- -- Table structure for table `owners` -- CREATE TABLE `owners` ( `id` int(10) UNSIGNED NOT NULL, `login_token` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `status` int(11) NOT NULL DEFAULT '1' COMMENT '1:active; 2:stop', `firstname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `lastname` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` text COLLATE utf8mb4_unicode_ci, `contact_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gender` enum('male','female') COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `owners` -- INSERT INTO `owners` (`id`, `login_token`, `password`, `status`, `firstname`, `lastname`, `address`, `contact_number`, `gender`, `email`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'abc123', '$2y$10$OMSeK8Pe70nIHjkiTFLm8uX72fErkZKP6B4H6z7nZcakdPlMsayxe', 1, 'Owner', 'One', 'addresss11 1 1 ', '09876543219', 'male', 'owner1@gmail.com', NULL, NULL, NULL), (2, 'abc123', '$2y$10$OMSeK8Pe70nIHjkiTFLm8uX72fErkZKP6B4H6z7nZcakdPlMsayxe', 1, 'Owner', 'Two', 'addresss11 1 1 ', '09876543219', 'male', 'owner2@gmail.com', NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` int(10) UNSIGNED NOT NULL, `resto_id` int(10) UNSIGNED NOT NULL, `name` varchar(50) NOT NULL, `details` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, `type` enum('appetizer','main','dessert','beverage') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price` int(10) UNSIGNED NOT NULL, `image_url` varchar(500) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `resto_id`, `name`, `details`, `type`, `price`, `image_url`, `created_at`, `updated_at`) VALUES (3, 1, 'Longsilog', 'longganisa itlog rice', 'main', 69, 'photos/photo_62_15374521345ba3a866e6fcf.jpg', NULL, '2019-07-01 16:41:19'), (4, 2, 'Beer na Beer', 'beer', 'main', 40, NULL, NULL, '2019-06-26 15:14:34'), (5, 2, 'RH Beer', 'beer', 'main', 30, NULL, NULL, '2019-06-27 14:26:48'), (6, 1, 'Tosilog', 'longganisa itlog rice', 'main', 50, NULL, NULL, '2019-07-01 15:58:40'), (7, 1, 'Kingsilog', 'longganisa itlog rice', 'main', 49, NULL, NULL, '2019-06-27 14:26:57'), (8, 1, 'Logsilog', 'longganisa itlog rice', 'main', 49, NULL, NULL, '2019-06-27 14:26:57'), (9, 2, 'Longsilog', 'longganisa itlog rice', 'main', 50, 'product_image/product_image_15620722405d1b54b055600.png', '2019-07-02 12:57:20', '2019-07-06 16:23:34'); -- -------------------------------------------------------- -- -- Table structure for table `restaurants` -- CREATE TABLE `restaurants` ( `id` int(10) UNSIGNED NOT NULL, `owner_id` int(10) UNSIGNED NOT NULL, `resto_name` varchar(50) NOT NULL, `address` text, `longitude` float(255,8) DEFAULT NULL, `latitude` float(255,8) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `restaurants` -- INSERT INTO `restaurants` (`id`, `owner_id`, `resto_name`, `address`, `longitude`, `latitude`, `created_at`, `updated_at`) VALUES (1, 1, 'ACT Restaurant', '123 ABC ', 123.64505005, 10.27353477, '2019-06-22 10:49:05', '2019-07-02 13:38:36'), (2, 2, 'Two Restaurant', '123 ABC ', 123.64505005, 10.27353477, '2019-06-22 10:49:05', '2019-07-02 13:43:27'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admins` -- ALTER TABLE `admins` ADD PRIMARY KEY (`id`); -- -- Indexes for table `customers` -- ALTER TABLE `customers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`id`), ADD KEY `employees_owner_id_foreign` (`owner_id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`), ADD KEY `orders_customer_id_foreign` (`customer_id`); -- -- Indexes for table `order_details` -- ALTER TABLE `order_details` ADD PRIMARY KEY (`id`), ADD KEY `order_details_order_id_foreign` (`order_id`), ADD KEY `order_details_product_id_foreign` (`product_id`); -- -- Indexes for table `owners` -- ALTER TABLE `owners` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD KEY `products_resto_id_foreign` (`resto_id`) USING BTREE; -- -- Indexes for table `restaurants` -- ALTER TABLE `restaurants` ADD PRIMARY KEY (`id`), ADD KEY `restaurants_owner_id_foreign` (`owner_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admins` -- ALTER TABLE `admins` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `customers` -- ALTER TABLE `customers` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `employees` -- ALTER TABLE `employees` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `order_details` -- ALTER TABLE `order_details` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; -- -- AUTO_INCREMENT for table `owners` -- ALTER TABLE `owners` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `restaurants` -- ALTER TABLE `restaurants` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `employees` -- ALTER TABLE `employees` ADD CONSTRAINT `employees_owner_id_foreign` FOREIGN KEY (`owner_id`) REFERENCES `owners` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `orders` -- ALTER TABLE `orders` ADD CONSTRAINT `orders_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_resto_id_foreign` FOREIGN KEY (`resto_id`) REFERENCES `restaurants` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `restaurants` -- ALTER TABLE `restaurants` ADD CONSTRAINT `restaurants_owner_id_foreign` FOREIGN KEY (`owner_id`) REFERENCES `owners` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
53c63b9666b16878ba49392a81efdc56cdb153a7
SQL
vitalyzaff/bootcampx
/4_queries/2_student_req.sql
UTF-8
233
3.640625
4
[]
no_license
-- the total number of assistance_requests for a student SELECT name, count(assistance_requests.*) AS total_assistances FROM students JOIN assistance_requests ON students.id = student_id WHERE name = 'Elliot Dickinson' GROUP BY students.name;
true
836a0eeddb7dce4d0dea8ac2e370b2e25264021f
SQL
vppolina/flights_project
/create_table_aggregation.sql
UTF-8
1,224
3.65625
4
[]
no_license
-- create all tables create table flights_all ( id serial ,icao24 varchar(20) ,callsign varchar(20) ,origin_country varchar(50) ,time_position bigint ,last_contact bigint ,longitude float ,latitude float ,baro_altitude float ,on_ground boolean ,velocity float ,true_track float ,vertical_rate float ,sensors integer ,geo_altitude float ,squawk varchar(20) ,spi boolean ,position_source integer ,retrieved_at timestamp ) create table airline_crashes ( id serial ,operator varchar(5) ,place varchar(100) ,country varchar(100) ) create table airline_codes ( id serial ,icao varchar(5) ,airline varchar(100) ,callsign varchar(100) ,country varchar(100) ) --data aggregation with crashes as ( select operator ,count(distinct id) as nr_crashes from airline_crashes group by 1 order by 2 DESC ) , codes as ( select f.id , f.callsign , f.longitude , f.latitude , f.geo_altitude , f.origin_country , ac.icao , ac.airline , ac.country from flights_all f inner join airline_codes ac on substring(f.callsign, 1, 3) ilike ac.icao ) select id ,callsign ,longitude ,latitude ,geo_altitude ,icao ,origin_country ,airline ,country ,nr_crashes from codes c left join crashes cr on c.airline ilike cr.operator
true
d8bb782f6ca013dd050a65420204e6fa5c90f1f7
SQL
NTXpro/NTXbases_de_datos
/DatabaseNTXpro/ERP/Stored Procedures/Procs1/Usp_Sel_Ubicacion_Restaurar.sql
UTF-8
424
3.53125
4
[]
no_license
CREATE PROC [ERP].[Usp_Sel_Ubicacion_Restaurar] @IdEntidad INT AS BEGIN SELECT U.ID, U.Codigo, U.Nombre, U.FechaRegistro, A.Nombre AS NombreAlmacen FROM ERP.Ubicacion U LEFT JOIN ERP.Almacen A ON U.IdAlmacen = A.ID WHERE U.Flag = 0 AND A.ID IN (SELECT DISTINCT A.ID from ERP.Almacen A LEFT JOIN ERP.Establecimiento E ON A.IdEstablecimiento = E.ID WHERE E.IdEntidad = @IdEntidad) END
true
a014f2f94be12e807c8c792596c7b106760528d4
SQL
SaylorTl/lumen
/client.sql
UTF-8
15,506
3.609375
4
[]
no_license
/* Navicat MySQL Data Transfer Source Server : 永红源test Source Server Type : MySQL Source Server Version : 50728 Source Host : 10.110.16.3:13306 Source Schema : client Target Server Type : MySQL Target Server Version : 50728 File Encoding : 65001 Date: 21/02/2020 09:55:23 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for yhy_certificate -- ---------------------------- DROP TABLE IF EXISTS `yhy_certificate`; CREATE TABLE `yhy_certificate` ( `certificate_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '证书id', `employee_id` char(25) NOT NULL COMMENT '员工id', `certificate_name` varchar(50) NOT NULL COMMENT '证书名称', `certificate_num` varchar(100) NOT NULL COMMENT '证件编号', `cert_begin_time` int(11) NOT NULL COMMENT '证书开始时间', `cert_end_time` int(11) NOT NULL COMMENT '证书结束时间', `cert_resource_id` char(25) NOT NULL COMMENT '证书图片', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`certificate_id`), KEY `idx_employee_is` (`employee_id`) USING BTREE COMMENT '员工id' ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_emergency -- ---------------------------- DROP TABLE IF EXISTS `yhy_emergency`; CREATE TABLE `yhy_emergency` ( `emergency_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '紧急联系人id', `employee_id` char(25) NOT NULL COMMENT '员工id', `emergency_name` varchar(20) NOT NULL COMMENT '紧急联系人', `relationship` varchar(20) NOT NULL COMMENT '关系', `emergency_phone` varchar(13) NOT NULL COMMENT '紧急联系人电话', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`emergency_id`), KEY `idx_employee_id` (`employee_id`) USING BTREE COMMENT '员工id' ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_employee -- ---------------------------- DROP TABLE IF EXISTS `yhy_employee`; CREATE TABLE `yhy_employee` ( `employee_id` char(25) NOT NULL COMMENT '用户自增id', `sex` int(11) NOT NULL COMMENT '性别', `user_type_tag_id` int(11) NOT NULL COMMENT '用户类型', `full_name` varchar(20) NOT NULL DEFAULT '' COMMENT '全名', `nick_name` varchar(20) NOT NULL DEFAULT '' COMMENT '昵称', `user_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名', `mobile` varchar(13) NOT NULL COMMENT '手机号', `status` enum('Y','N') NOT NULL DEFAULT 'Y' COMMENT '状态', `autolock` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT '是否锁定', `editor` char(25) NOT NULL COMMENT '修改者', `creator` char(25) NOT NULL COMMENT '创建者', `verify` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT '是否验证', `app_id` varchar(25) NOT NULL COMMENT '应用id', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`employee_id`) USING BTREE, UNIQUE KEY `eu_mobile` (`mobile`) USING BTREE, UNIQUE KEY `eu_username` (`user_name`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Table structure for yhy_employee_ext -- ---------------------------- DROP TABLE IF EXISTS `yhy_employee_ext`; CREATE TABLE `yhy_employee_ext` ( `epy_ext_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `employee_id` char(25) NOT NULL COMMENT '用户id', `nation_tag_id` int(11) NOT NULL COMMENT '民族', `email` varchar(30) NOT NULL COMMENT '电子邮箱', `address` varchar(255) NOT NULL COMMENT '地址', `leader` varchar(25) NOT NULL COMMENT '上级领导', `birth_day` date NOT NULL DEFAULT '1970-01-01' COMMENT '出生年月', `political_tag_id` int(11) NOT NULL COMMENT '政治面貌', `license_tag_id` int(11) NOT NULL COMMENT '证件类别', `license_num` varchar(50) NOT NULL COMMENT '证件号码', `employee_status_tag_id` int(11) NOT NULL COMMENT '员工状态', `education_tag_id` int(11) NOT NULL DEFAULT '0' COMMENT '学历', `frame_id` char(25) NOT NULL COMMENT '行政架构', `labor_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '合同结束时间', `labor_begin_time` int(11) NOT NULL DEFAULT '0' COMMENT '合同开始时间', `job_tag_id` int(11) NOT NULL COMMENT '职位', `project_id` char(25) NOT NULL COMMENT '项目id', `labor_type_tag_id` int(11) NOT NULL COMMENT '合同类型', `departure_time` int(11) NOT NULL COMMENT '离职时间', `entry_time` int(11) NOT NULL COMMENT '入职时间', `remark` varchar(300) NOT NULL COMMENT '备注', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`epy_ext_id`) USING BTREE, KEY `index_employee_id` (`employee_id`) USING BTREE COMMENT '员工id' ) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COMMENT='附加信息表'; -- ---------------------------- -- Table structure for yhy_member -- ---------------------------- DROP TABLE IF EXISTS `yhy_member`; CREATE TABLE `yhy_member` ( `member_id` int(11) NOT NULL AUTO_INCREMENT, `employee_id` char(25) NOT NULL DEFAULT '0' COMMENT '用户id', `type` enum('0','1','2','3','4') NOT NULL DEFAULT '1' COMMENT '登陆类型,1为oa登陆 2位账号密码登陆,4 自动登录', `login_max_num` int(11) NOT NULL COMMENT '最大登录数', `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码', `begin_time` int(11) NOT NULL COMMENT '有效期开始时间', `end_time` int(11) NOT NULL COMMENT '有效期结束时间', `oa` varchar(50) NOT NULL DEFAULT '' COMMENT 'oa账号', `is_lock` enum('0','1') NOT NULL DEFAULT '0' COMMENT '是否锁定 1为锁定', `last_login_project_id` char(25) DEFAULT '0', `last_login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '上次登陆时间', `last_login_ip` varchar(15) NOT NULL COMMENT '上次登陆ip', `app_id` varchar(25) NOT NULL COMMENT '应用id', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`member_id`), KEY `user_id` (`employee_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COMMENT='后台用户表'; -- ---------------------------- -- Table structure for yhy_tenement -- ---------------------------- DROP TABLE IF EXISTS `yhy_tenement`; CREATE TABLE `yhy_tenement` ( `tenement_id` char(25) NOT NULL COMMENT '自增id', `user_id` int(11) NOT NULL COMMENT '用户id', `license_tag_id` int(11) NOT NULL COMMENT '证件类别', `license_num` varchar(20) NOT NULL COMMENT '证件号码', `email` varchar(50) NOT NULL COMMENT '邮箱', `phone` varchar(15) NOT NULL COMMENT '联系电话', `project_id` char(25) NOT NULL COMMENT '项目id', `mobile` varchar(13) NOT NULL COMMENT '手机号', `tenement_type_tag_id` int(11) NOT NULL COMMENT '住户类型', `birth_day` date NOT NULL DEFAULT '1970-01-01' COMMENT '出生日期', `sex` int(11) NOT NULL COMMENT '性别', `contact_name` varchar(20) NOT NULL COMMENT '联系人', `real_name` varchar(20) NOT NULL COMMENT '真实姓名', `in_time` int(11) NOT NULL DEFAULT '0' COMMENT '入住时间', `out_time` int(11) NOT NULL DEFAULT '0' COMMENT '迁出时间', `out_reason_tag_id` int(11) NOT NULL COMMENT '迁出缘由', `rescue_type_tag_id` int(11) NOT NULL COMMENT '救援类型', `pet_type_tag_id` varchar(20) NOT NULL COMMENT '宠物类型', `face_resource_id` char(25) NOT NULL COMMENT '照片id', `pet_remark` varchar(300) NOT NULL COMMENT '宠物备注', `pet_num` int(5) NOT NULL COMMENT '宠物数量', `account_name` varchar(50) NOT NULL DEFAULT '' COMMENT '账户名称', `tax_number` varchar(25) NOT NULL COMMENT '纳税人识别号', `native_place` varchar(50) NOT NULL COMMENT '籍贯', `bank` varchar(50) NOT NULL COMMENT '银行', `back_account` varchar(50) NOT NULL COMMENT '银行账号', `back_name` varchar(50) NOT NULL COMMENT '开户行', `tax_address` varchar(100) NOT NULL COMMENT '纳税人地址', `corporation` varchar(50) NOT NULL COMMENT '工作单位', `creator` char(25) NOT NULL COMMENT '创建者', `editor` char(25) NOT NULL COMMENT '修改者', `customer_type_tag_id` int(11) NOT NULL COMMENT '客户类型', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`tenement_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附加信息表'; -- ---------------------------- -- Table structure for yhy_tenement_car -- ---------------------------- DROP TABLE IF EXISTS `yhy_tenement_car`; CREATE TABLE `yhy_tenement_car` ( `driver_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '车主自增id', `tenement_id` char(25) NOT NULL COMMENT '用户id', `space_name` varchar(50) NOT NULL COMMENT '车位编号', `plate` varchar(50) NOT NULL COMMENT '车牌号', `car_type_tag_id` int(11) NOT NULL COMMENT '车辆类型', `car_type` int(25) NOT NULL COMMENT '车辆型号', `car_type_name` varchar(25) NOT NULL COMMENT '车辆型号名称', `car_model` int(25) NOT NULL COMMENT '车型', `car_brand` int(25) NOT NULL COMMENT '车辆品牌', `car_brand_name` varchar(25) NOT NULL COMMENT '车辆品牌名称', `rule` varchar(100) NOT NULL COMMENT '月卡规则', `car_resource_id` char(25) NOT NULL COMMENT '资源id', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`driver_id`), UNIQUE KEY `UK_plate_space` (`tenement_id`,`space_name`,`plate`) USING BTREE COMMENT '唯一索引' ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_tenement_house -- ---------------------------- DROP TABLE IF EXISTS `yhy_tenement_house`; CREATE TABLE `yhy_tenement_house` ( `t_house_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `tenement_id` char(25) NOT NULL COMMENT '业主id', `cell_id` char(25) NOT NULL DEFAULT '0' COMMENT '室id', `house_id` char(25) NOT NULL COMMENT '房产id', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`t_house_id`), UNIQUE KEY `UK_tene_house` (`tenement_id`,`house_id`,`cell_id`) USING BTREE COMMENT '唯一索引' ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_tenement_label -- ---------------------------- DROP TABLE IF EXISTS `yhy_tenement_label`; CREATE TABLE `yhy_tenement_label` ( `label_id` int(11) NOT NULL AUTO_INCREMENT, `tenement_id` char(25) NOT NULL COMMENT '住户id', `tenement_tag_id` int(11) NOT NULL COMMENT '住户标签', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`label_id`) ) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_users -- ---------------------------- DROP TABLE IF EXISTS `yhy_users`; CREATE TABLE `yhy_users` ( `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户自增id', `project_id` char(25) NOT NULL COMMENT '项目id', `mobile` varchar(13) NOT NULL COMMENT '手机号', `app_id` varchar(32) NOT NULL COMMENT '应用id', `autolock` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT '是否锁定', `verify` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT '是否验证', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='用户表'; -- ---------------------------- -- Table structure for yhy_visitor -- ---------------------------- DROP TABLE IF EXISTS `yhy_visitor`; CREATE TABLE `yhy_visitor` ( `visit_id` char(25) NOT NULL COMMENT '访客id', `user_id` int(11) NOT NULL COMMENT '用户id', `sfz_number` varchar(25) NOT NULL COMMENT '身份证号码', `real_name` varchar(20) NOT NULL COMMENT '真实姓名', `sex` int(11) NOT NULL COMMENT '性别', `project_id` char(25) NOT NULL COMMENT '项目id', `mobile` varchar(13) NOT NULL COMMENT '手机号', `appoint_time` int(11) NOT NULL COMMENT '预约时间', `is_man_face` enum('Y','N') NOT NULL DEFAULT 'N' COMMENT '是否人脸,默认''N''', `appoint_status_tag_id` int(11) NOT NULL COMMENT '预约状态', `face_resource_id` char(25) NOT NULL COMMENT '人脸id', `in_time` int(11) NOT NULL DEFAULT '0' COMMENT '进入时间', `out_time` int(11) NOT NULL DEFAULT '0' COMMENT '出去时间', `authorizer` varchar(20) NOT NULL COMMENT '授权人', `creator` char(25) NOT NULL COMMENT '创建者', `editor` char(25) NOT NULL COMMENT '修改者', `destination` varchar(100) NOT NULL COMMENT '目的地', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`visit_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_visitor_car -- ---------------------------- DROP TABLE IF EXISTS `yhy_visitor_car`; CREATE TABLE `yhy_visitor_car` ( `visit_car_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '车主自增id', `visit_id` char(25) NOT NULL COMMENT '用户id', `plate` varchar(50) NOT NULL COMMENT '车牌号', `car_type_name` varchar(25) NOT NULL COMMENT '车辆型号名称', `car_type` int(11) NOT NULL COMMENT '车辆型号id', `car_brand` int(11) NOT NULL COMMENT '车辆品牌id', `car_brand_name` varchar(25) NOT NULL COMMENT '品牌名称', `car_model` varchar(25) NOT NULL COMMENT '车型', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`visit_car_id`) USING BTREE, UNIQUE KEY `UK_visitor_plate` (`visit_id`,`plate`) USING BTREE COMMENT '唯一id' ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- ---------------------------- -- Table structure for yhy_visitor_follow -- ---------------------------- DROP TABLE IF EXISTS `yhy_visitor_follow`; CREATE TABLE `yhy_visitor_follow` ( `follow_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '到访人员id', `visit_id` char(25) NOT NULL COMMENT '访客id', `follow_name` varchar(20) NOT NULL COMMENT '到访人员姓名', `follow_mobile` varchar(13) NOT NULL COMMENT '到访人员手机号', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`follow_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; SET FOREIGN_KEY_CHECKS = 1;
true
d505fc38d6f8a057bce2f90920b816dcbb216f25
SQL
ClickHouse/ClickHouse
/tests/queries/0_stateless/00837_minmax_index_replicated_zookeeper_long.sql
UTF-8
2,760
3.625
4
[ "Apache-2.0", "BSL-1.0" ]
permissive
-- Tags: long, replica DROP TABLE IF EXISTS minmax_idx1; DROP TABLE IF EXISTS minmax_idx2; CREATE TABLE minmax_idx1 ( u64 UInt64, i32 Int32, f64 Float64, d Decimal(10, 2), s String, e Enum8('a' = 1, 'b' = 2, 'c' = 3), dt Date, INDEX idx_all (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 1, INDEX idx_2 (u64 + toYear(dt), substring(s, 2, 4)) TYPE minmax GRANULARITY 3 ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/test_00837/minmax', 'r1') ORDER BY u64 SETTINGS index_granularity = 2, index_granularity_bytes = '10Mi'; CREATE TABLE minmax_idx2 ( u64 UInt64, i32 Int32, f64 Float64, d Decimal(10, 2), s String, e Enum8('a' = 1, 'b' = 2, 'c' = 3), dt Date, INDEX idx_all (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 1, INDEX idx_2 (u64 + toYear(dt), substring(s, 2, 4)) TYPE minmax GRANULARITY 3 ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/test_00837/minmax', 'r2') ORDER BY u64 SETTINGS index_granularity = 2, index_granularity_bytes = '10Mi'; /* many small inserts => table will make merges */ INSERT INTO minmax_idx1 VALUES (2, 2, 4.5, 2.5, 'abc', 'a', '2014-01-01'); INSERT INTO minmax_idx1 VALUES (0, 5, 4.7, 6.5, 'cba', 'b', '2014-01-04'); INSERT INTO minmax_idx2 VALUES (3, 5, 6.9, 1.57, 'bac', 'c', '2017-01-01'); INSERT INTO minmax_idx2 VALUES (4, 2, 4.5, 2.5, 'abc', 'a', '2016-01-01'); INSERT INTO minmax_idx2 VALUES (13, 5, 4.7, 6.5, 'cba', 'b', '2015-01-01'); INSERT INTO minmax_idx1 VALUES (5, 5, 6.9, 1.57, 'bac', 'c', '2014-11-11'); SYSTEM SYNC REPLICA minmax_idx1; SYSTEM SYNC REPLICA minmax_idx2; INSERT INTO minmax_idx1 VALUES (6, 2, 4.5, 2.5, 'abc', 'a', '2014-02-11'); INSERT INTO minmax_idx1 VALUES (1, 5, 4.7, 6.5, 'cba', 'b', '2014-03-11'); INSERT INTO minmax_idx1 VALUES (7, 5, 6.9, 1.57, 'bac', 'c', '2014-04-11'); INSERT INTO minmax_idx1 VALUES (8, 2, 4.5, 2.5, 'abc', 'a', '2014-05-11'); INSERT INTO minmax_idx2 VALUES (12, 5, 4.7, 6.5, 'cba', 'b', '2014-06-11'); INSERT INTO minmax_idx2 VALUES (9, 5, 6.9, 1.57, 'bac', 'c', '2014-07-11'); SYSTEM SYNC REPLICA minmax_idx1; SYSTEM SYNC REPLICA minmax_idx2; OPTIMIZE TABLE minmax_idx1; OPTIMIZE TABLE minmax_idx2; /* simple select */ SELECT * FROM minmax_idx1 WHERE i32 = 5 AND i32 + f64 < 12 AND 3 < d AND d < 7 AND (s = 'bac' OR s = 'cba') ORDER BY dt; SELECT * FROM minmax_idx2 WHERE i32 = 5 AND i32 + f64 < 12 AND 3 < d AND d < 7 AND (s = 'bac' OR s = 'cba') ORDER BY dt; /* select with hole made by primary key */ SELECT * FROM minmax_idx1 WHERE (u64 < 2 OR u64 > 10) AND e != 'b' ORDER BY dt; SELECT * FROM minmax_idx2 WHERE (u64 < 2 OR u64 > 10) AND e != 'b' ORDER BY dt; DROP TABLE minmax_idx1; DROP TABLE minmax_idx2;
true
883fad9220f2273d1b8e6d024a0f05fae7bf5172
SQL
santanupatra/blehx
/petizen.sql
UTF-8
68,512
3.015625
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.6.6deb4 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Sep 07, 2017 at 09:58 AM -- Server version: 5.7.19-0ubuntu0.17.04.1 -- PHP Version: 7.0.22-0ubuntu0.17.04.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `petizen` -- -- -------------------------------------------------------- -- -- Table structure for table `backups` -- CREATE TABLE `backups` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `file_name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `backup_size` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `breeds` -- CREATE TABLE `breeds` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `species_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `pets_count` int(10) UNSIGNED NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `breeds` -- INSERT INTO `breeds` (`id`, `deleted_at`, `created_at`, `updated_at`, `species_id`, `name`, `pets_count`) VALUES (1, NULL, '2017-07-28 05:02:58', '2017-07-28 05:02:58', 1, 'German Shepherd', 0), (2, NULL, '2017-07-28 05:03:45', '2017-07-28 05:03:45', 1, 'Poodle', 0), (3, NULL, '2017-07-28 05:04:14', '2017-07-28 05:04:14', 1, 'Labrador Retriever', 0), (4, NULL, '2017-07-28 05:04:54', '2017-07-28 05:04:54', 1, 'Pug', 0), (5, NULL, '2017-07-28 05:05:24', '2017-07-28 05:05:24', 1, 'Bulldog', 0); -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `description` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `deleted_at`, `created_at`, `updated_at`, `name`, `description`) VALUES (1, NULL, '2017-07-28 06:37:27', '2017-07-28 06:39:35', 'Doctor', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore'), (2, NULL, '2017-07-28 06:39:06', '2017-07-28 06:39:06', 'Shop Keeper', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod'), (3, '2017-07-30 23:56:23', '2017-07-28 07:45:05', '2017-07-30 23:56:23', 'Doctor1', 'asasasasas'); -- -------------------------------------------------------- -- -- Table structure for table `comments` -- CREATE TABLE `comments` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `post_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `content` text COLLATE utf8_unicode_ci NOT NULL, `is_blocked` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `post_id`, `content`, `is_blocked`) VALUES (1, NULL, '2017-08-29 06:37:34', '2017-08-29 06:37:34', 3, 1, 'com hii', 0), (2, NULL, '2017-08-31 05:06:49', '2017-08-31 05:06:49', 3, 1, 'com hiiyg', 0), (14, NULL, '2017-08-31 06:50:22', '2017-08-31 06:50:22', 3, 10, 'hello', 0), (15, NULL, '2017-08-31 06:55:51', '2017-08-31 06:55:51', 3, 10, 'hii', 0), (16, NULL, '2017-08-31 07:04:45', '2017-08-31 07:04:45', 3, 1, 'yggh', 0), (17, NULL, '2017-08-31 07:41:28', '2017-08-31 07:41:28', 3, 11, 'hii', 0), (26, NULL, '2017-09-04 06:59:21', '2017-09-04 06:59:21', 3, 11, 'hello', 0); -- -------------------------------------------------------- -- -- Table structure for table `departments` -- CREATE TABLE `departments` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `tags` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '[]', `color` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `departments` -- INSERT INTO `departments` (`id`, `name`, `tags`, `color`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'Administration', '[]', '#000', NULL, '2017-07-27 06:42:55', '2017-07-27 06:42:55'); -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE `employees` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `designation` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `gender` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Male', `mobile` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `mobile2` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `dept` int(10) UNSIGNED NOT NULL DEFAULT '1', `city` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `address` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, `about` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `date_birth` date NOT NULL DEFAULT '1990-01-01', `date_hire` date NOT NULL, `date_left` date NOT NULL DEFAULT '1990-01-01', `salary_cur` decimal(15,3) NOT NULL DEFAULT '0.000', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`id`, `name`, `designation`, `gender`, `mobile`, `mobile2`, `email`, `dept`, `city`, `address`, `about`, `date_birth`, `date_hire`, `date_left`, `salary_cur`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'Super Admin', 'Super Admin', 'Male', '8972925825', '', 'nits.ravis@gmail.com', 1, 'Kolkata', 'AE 106 Rabindra palli, Keshtopur', 'About user / biography', '1983-02-20', '2017-07-27', '2017-07-27', '0.000', NULL, '2017-07-27 06:43:19', '2017-07-27 06:50:58'); -- -------------------------------------------------------- -- -- Table structure for table `events` -- CREATE TABLE `events` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `description` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `start_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `end_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `is_full_day` tinyint(1) NOT NULL DEFAULT '0', `subscribers_count` int(10) UNSIGNED NOT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT '0', `is_blocked` tinyint(1) NOT NULL DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `events` -- INSERT INTO `events` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `description`, `start_time`, `end_time`, `is_full_day`, `subscribers_count`, `is_deleted`, `is_blocked`, `title`) VALUES (1, NULL, '2017-09-06 01:47:09', '2017-09-06 05:11:06', 3, 'test description updated_new', '2017-09-05 18:30:00', '2017-09-05 18:30:00', 0, 0, 0, 0, 'abc'), (2, NULL, '2017-09-06 03:54:46', '2017-09-06 04:58:01', 3, 'test description updated', '2017-09-05 18:30:00', '2017-09-05 18:30:00', 0, 0, 0, 0, ''); -- -------------------------------------------------------- -- -- Table structure for table `la_configs` -- CREATE TABLE `la_configs` ( `id` int(10) UNSIGNED NOT NULL, `key` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `section` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `la_configs` -- INSERT INTO `la_configs` (`id`, `key`, `section`, `value`, `created_at`, `updated_at`) VALUES (1, 'sitename', '', 'Petizen Admin', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (2, 'sitename_part1', '', 'Petizen', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (3, 'sitename_part2', '', 'Admin', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (4, 'sitename_short', '', 'PA', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (5, 'site_description', '', '', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (6, 'sidebar_search', '', '0', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (7, 'show_messages', '', '0', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (8, 'show_notifications', '', '1', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (9, 'show_tasks', '', '0', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (10, 'show_rightsidebar', '', '0', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (11, 'skin', '', 'skin-white', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (12, 'layout', '', 'fixed', '2017-07-27 06:42:57', '2017-07-28 04:51:00'), (13, 'default_email', '', 'test@example.com', '2017-07-27 06:42:57', '2017-07-28 04:51:00'); -- -------------------------------------------------------- -- -- Table structure for table `la_menus` -- CREATE TABLE `la_menus` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `url` varchar(256) COLLATE utf8_unicode_ci NOT NULL, `icon` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'fa-cube', `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'module', `parent` int(10) UNSIGNED NOT NULL DEFAULT '0', `hierarchy` int(10) UNSIGNED NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `la_menus` -- INSERT INTO `la_menus` (`id`, `name`, `url`, `icon`, `type`, `parent`, `hierarchy`, `created_at`, `updated_at`) VALUES (1, 'Team', '#', 'fa-group', 'custom', 0, 12, '2017-07-27 06:42:54', '2017-09-04 04:23:07'), (2, 'Users', 'users', 'fa-group', 'module', 1, 1, '2017-07-27 06:42:54', '2017-08-08 04:16:36'), (3, 'Uploads', 'uploads', 'fa-files-o', 'module', 0, 6, '2017-07-27 06:42:54', '2017-09-04 04:23:06'), (4, 'Departments', 'departments', 'fa-tags', 'module', 1, 2, '2017-07-27 06:42:55', '2017-08-08 04:16:36'), (5, 'Employees', 'employees', 'fa-group', 'module', 1, 3, '2017-07-27 06:42:55', '2017-08-08 04:16:36'), (6, 'Roles', 'roles', 'fa-user-plus', 'module', 1, 4, '2017-07-27 06:42:55', '2017-08-08 04:16:36'), (8, 'Permissions', 'permissions', 'fa-magic', 'module', 1, 5, '2017-07-27 06:42:55', '2017-08-08 04:16:36'), (9, 'Species', 'species', 'fa fa-cube', 'module', 0, 7, '2017-07-28 04:54:58', '2017-09-04 04:23:06'), (10, 'Breeds', 'breeds', 'fa fa-cube', 'module', 0, 8, '2017-07-28 05:00:08', '2017-09-04 04:23:06'), (11, 'Pets', 'pets', 'fa fa-cube', 'module', 0, 9, '2017-07-28 05:23:52', '2017-09-04 04:23:06'), (12, 'Categories', 'categories', 'fa fa-cube', 'module', 0, 10, '2017-07-28 06:35:14', '2017-09-04 04:23:06'), (13, 'Organizations', 'organizations', 'fa fa-cube', 'module', 0, 11, '2017-07-28 07:06:25', '2017-09-04 04:23:06'), (14, 'Posts', 'posts', 'fa fa-cube', 'module', 0, 2, '2017-08-24 07:18:24', '2017-09-04 04:23:06'), (15, 'Likes', 'likes', 'fa fa-cube', 'module', 0, 3, '2017-08-25 06:41:12', '2017-09-04 04:23:06'), (16, 'Comments', 'comments', 'fa fa-cube', 'module', 0, 4, '2017-08-29 03:33:32', '2017-09-04 04:23:06'), (17, 'Reports', 'reports', 'fa fa-cube', 'module', 0, 5, '2017-08-29 07:31:34', '2017-09-04 04:23:06'), (20, 'Users', 'users', 'fa-group', 'module', 0, 1, '2017-09-04 04:22:12', '2017-09-04 04:23:06'), (21, 'Events', 'events', 'fa fa-cube', 'module', 0, 0, '2017-09-06 01:43:25', '2017-09-06 01:43:25'); -- -------------------------------------------------------- -- -- Table structure for table `likes` -- CREATE TABLE `likes` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `post_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `is_deleted` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `likes` -- INSERT INTO `likes` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `post_id`, `is_deleted`) VALUES (61, NULL, '2017-08-31 02:22:10', '2017-08-31 02:22:10', 3, 11, 0), (65, NULL, '2017-08-31 05:02:51', '2017-08-31 05:02:51', 3, 1, 0), (67, NULL, '2017-09-04 07:00:30', '2017-09-04 07:00:30', 3, 10, 0), (68, NULL, '2017-09-04 09:38:11', '2017-09-04 09:38:11', 48, 11, 0); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`migration`, `batch`) VALUES ('2014_05_26_050000_create_modules_table', 1), ('2014_05_26_055000_create_module_field_types_table', 1), ('2014_05_26_060000_create_module_fields_table', 1), ('2014_10_12_000000_create_users_table', 1), ('2014_10_12_100000_create_password_resets_table', 1), ('2014_12_01_000000_create_uploads_table', 1), ('2016_05_26_064006_create_departments_table', 1), ('2016_05_26_064007_create_employees_table', 1), ('2016_05_26_064446_create_roles_table', 1), ('2016_07_05_115343_create_role_user_table', 1), ('2016_07_06_140637_create_organizations_table', 1), ('2016_07_07_134058_create_backups_table', 1), ('2016_07_07_134058_create_menus_table', 1), ('2016_09_10_163337_create_permissions_table', 1), ('2016_09_10_163520_create_permission_role_table', 1), ('2016_09_22_105958_role_module_fields_table', 1), ('2016_09_22_110008_role_module_table', 1), ('2016_10_06_115413_create_la_configs_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `modules` -- CREATE TABLE `modules` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `label` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `name_db` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `view_col` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `model` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `controller` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `fa_icon` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'fa-cube', `is_gen` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `modules` -- INSERT INTO `modules` (`id`, `name`, `label`, `name_db`, `view_col`, `model`, `controller`, `fa_icon`, `is_gen`, `created_at`, `updated_at`) VALUES (1, 'Users', 'Users', 'users', 'name', 'User', 'UsersController', 'fa-group', 1, '2017-07-27 06:42:38', '2017-07-27 06:42:57'), (2, 'Uploads', 'Uploads', 'uploads', 'name', 'Upload', 'UploadsController', 'fa-files-o', 1, '2017-07-27 06:42:39', '2017-07-27 06:42:57'), (3, 'Departments', 'Departments', 'departments', 'name', 'Department', 'DepartmentsController', 'fa-tags', 1, '2017-07-27 06:42:40', '2017-07-27 06:42:57'), (4, 'Employees', 'Employees', 'employees', 'name', 'Employee', 'EmployeesController', 'fa-group', 1, '2017-07-27 06:42:40', '2017-07-27 06:42:57'), (5, 'Roles', 'Roles', 'roles', 'name', 'Role', 'RolesController', 'fa-user-plus', 1, '2017-07-27 06:42:42', '2017-07-27 06:42:57'), (7, 'Backups', 'Backups', 'backups', 'name', 'Backup', 'BackupsController', 'fa-hdd-o', 1, '2017-07-27 06:42:48', '2017-07-27 06:42:57'), (8, 'Permissions', 'Permissions', 'permissions', 'name', 'Permission', 'PermissionsController', 'fa-magic', 1, '2017-07-27 06:42:48', '2017-07-27 06:42:57'), (9, 'Species', 'Species', 'species', 'name', 'Species', 'SpeciesController', 'fa-cube', 1, '2017-07-28 04:53:08', '2017-07-28 04:54:59'), (10, 'Breeds', 'Breeds', 'breeds', 'name', 'Breed', 'BreedsController', 'fa-cube', 1, '2017-07-28 04:57:28', '2017-09-01 04:07:48'), (11, 'Pets', 'Pets', 'pets', 'breed_id', 'Pet', 'PetsController', 'fa-cube', 1, '2017-07-28 05:12:47', '2017-07-28 05:23:52'), (12, 'Categories', 'Categories', 'categories', 'name', 'Category', 'CategoriesController', 'fa-cube', 1, '2017-07-28 06:33:14', '2017-07-28 06:35:14'), (13, 'Organizations', 'Organizations', 'organizations', 'user_id', 'Organization', 'OrganizationsController', 'fa-cube', 1, '2017-07-28 06:56:23', '2017-07-28 07:06:25'), (15, 'Posts', 'Posts', 'posts', 'content', 'Post', 'PostsController', 'fa-cube', 1, '2017-08-24 04:58:01', '2017-09-01 04:07:24'), (16, 'Likes', 'Likes', 'likes', 'post_id', 'Like', 'LikesController', 'fa-cube', 1, '2017-08-25 06:39:11', '2017-08-25 06:41:12'), (17, 'Comments', 'Comments', 'comments', 'is_blocked', 'Comment', 'CommentsController', 'fa-cube', 1, '2017-08-29 03:27:31', '2017-08-29 03:33:32'), (18, 'Reports', 'Reports', 'reports', 'user_id', 'Report', 'ReportsController', 'fa-cube', 1, '2017-08-29 07:29:58', '2017-08-29 07:31:34'), (19, 'Events', 'Events', 'events', 'title', 'Event', 'EventsController', 'fa-cube', 1, '2017-09-06 01:23:44', '2017-09-06 05:27:11'); -- -------------------------------------------------------- -- -- Table structure for table `module_fields` -- CREATE TABLE `module_fields` ( `id` int(10) UNSIGNED NOT NULL, `colname` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `label` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `module` int(10) UNSIGNED NOT NULL, `field_type` int(10) UNSIGNED NOT NULL, `unique` tinyint(1) NOT NULL DEFAULT '0', `defaultvalue` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `minlength` int(10) UNSIGNED NOT NULL DEFAULT '0', `maxlength` int(10) UNSIGNED NOT NULL DEFAULT '0', `required` tinyint(1) NOT NULL DEFAULT '0', `popup_vals` text COLLATE utf8_unicode_ci NOT NULL, `sort` int(10) UNSIGNED NOT NULL DEFAULT '0', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `module_fields` -- INSERT INTO `module_fields` (`id`, `colname`, `label`, `module`, `field_type`, `unique`, `defaultvalue`, `minlength`, `maxlength`, `required`, `popup_vals`, `sort`, `created_at`, `updated_at`) VALUES (1, 'name', 'Name', 1, 16, 0, '', 5, 250, 1, '', 0, '2017-07-27 06:42:38', '2017-07-27 06:42:38'), (2, 'context_id', 'Context', 1, 13, 0, '0', 0, 0, 0, '', 0, '2017-07-27 06:42:38', '2017-07-27 06:42:38'), (3, 'email', 'Email', 1, 8, 1, '', 0, 250, 0, '', 0, '2017-07-27 06:42:38', '2017-07-27 06:42:38'), (4, 'password', 'Password', 1, 17, 0, '', 6, 250, 1, '', 0, '2017-07-27 06:42:38', '2017-07-27 06:42:38'), (5, 'type', 'User Type', 1, 7, 0, 'Employee', 0, 0, 0, '[\"Employee\",\"Client\"]', 0, '2017-07-27 06:42:38', '2017-07-27 06:42:38'), (6, 'name', 'Name', 2, 16, 0, '', 5, 250, 1, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (7, 'path', 'Path', 2, 19, 0, '', 0, 250, 0, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (8, 'extension', 'Extension', 2, 19, 0, '', 0, 20, 0, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (9, 'caption', 'Caption', 2, 19, 0, '', 0, 250, 0, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (10, 'user_id', 'Owner', 2, 7, 0, '1', 0, 0, 0, '@users', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (11, 'hash', 'Hash', 2, 19, 0, '', 0, 250, 0, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (12, 'public', 'Is Public', 2, 2, 0, '0', 0, 0, 0, '', 0, '2017-07-27 06:42:39', '2017-07-27 06:42:39'), (13, 'name', 'Name', 3, 16, 1, '', 1, 250, 1, '', 0, '2017-07-27 06:42:40', '2017-07-27 06:42:40'), (14, 'tags', 'Tags', 3, 20, 0, '[]', 0, 0, 0, '', 0, '2017-07-27 06:42:40', '2017-07-27 06:42:40'), (15, 'color', 'Color', 3, 19, 0, '', 0, 50, 1, '', 0, '2017-07-27 06:42:40', '2017-07-27 06:42:40'), (16, 'name', 'Name', 4, 16, 0, '', 5, 250, 1, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (17, 'designation', 'Designation', 4, 19, 0, '', 0, 50, 1, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (18, 'gender', 'Gender', 4, 18, 0, 'Male', 0, 0, 1, '[\"Male\",\"Female\"]', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (19, 'mobile', 'Mobile', 4, 14, 0, '', 10, 20, 1, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (20, 'mobile2', 'Alternative Mobile', 4, 14, 0, '', 10, 20, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (21, 'email', 'Email', 4, 8, 1, '', 5, 250, 1, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (22, 'dept', 'Department', 4, 7, 0, '0', 0, 0, 1, '@departments', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (23, 'city', 'City', 4, 19, 0, '', 0, 50, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (24, 'address', 'Address', 4, 1, 0, '', 0, 1000, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (25, 'about', 'About', 4, 19, 0, '', 0, 0, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (26, 'date_birth', 'Date of Birth', 4, 4, 0, '1990-01-01', 0, 0, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (27, 'date_hire', 'Hiring Date', 4, 4, 0, 'date(\'Y-m-d\')', 0, 0, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (28, 'date_left', 'Resignation Date', 4, 4, 0, '1990-01-01', 0, 0, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (29, 'salary_cur', 'Current Salary', 4, 6, 0, '0.0', 0, 2, 0, '', 0, '2017-07-27 06:42:41', '2017-07-27 06:42:41'), (30, 'name', 'Name', 5, 16, 1, '', 1, 250, 1, '', 0, '2017-07-27 06:42:42', '2017-07-27 06:42:42'), (31, 'display_name', 'Display Name', 5, 19, 0, '', 0, 250, 1, '', 0, '2017-07-27 06:42:42', '2017-07-27 06:42:42'), (32, 'description', 'Description', 5, 21, 0, '', 0, 1000, 0, '', 0, '2017-07-27 06:42:42', '2017-07-27 06:42:42'), (33, 'parent', 'Parent Role', 5, 7, 0, '1', 0, 0, 0, '@roles', 0, '2017-07-27 06:42:42', '2017-07-27 06:42:42'), (34, 'dept', 'Department', 5, 7, 0, '1', 0, 0, 0, '@departments', 0, '2017-07-27 06:42:42', '2017-07-27 06:42:42'), (46, 'name', 'Name', 7, 16, 1, '', 0, 250, 1, '', 0, '2017-07-27 06:42:48', '2017-07-27 06:42:48'), (47, 'file_name', 'File Name', 7, 19, 1, '', 0, 250, 1, '', 0, '2017-07-27 06:42:48', '2017-07-27 06:42:48'), (48, 'backup_size', 'File Size', 7, 19, 0, '0', 0, 10, 1, '', 0, '2017-07-27 06:42:48', '2017-07-27 06:42:48'), (49, 'name', 'Name', 8, 16, 1, '', 1, 250, 1, '', 0, '2017-07-27 06:42:49', '2017-07-27 06:42:49'), (50, 'display_name', 'Display Name', 8, 19, 0, '', 0, 250, 1, '', 0, '2017-07-27 06:42:49', '2017-07-27 06:42:49'), (51, 'description', 'Description', 8, 21, 0, '', 0, 1000, 0, '', 0, '2017-07-27 06:42:49', '2017-07-27 06:42:49'), (52, 'name', 'Name', 9, 22, 1, '', 0, 256, 1, '', 0, '2017-07-28 04:54:08', '2017-07-28 04:54:08'), (53, 'pets_count', 'Pets Count', 9, 13, 0, '', 0, 11, 0, '', 0, '2017-07-28 04:54:38', '2017-07-28 04:54:38'), (54, 'species_id', 'Species', 10, 7, 0, '', 0, 0, 1, '@species', 0, '2017-07-28 04:58:59', '2017-07-28 04:59:18'), (55, 'name', 'Name', 10, 22, 1, '', 0, 256, 1, '', 0, '2017-07-28 04:59:48', '2017-07-28 04:59:48'), (56, 'pets_count', 'Pets Count', 10, 13, 0, '0', 0, 11, 0, '', 0, '2017-07-28 05:01:20', '2017-07-28 05:01:20'), (57, 'user_id', 'User', 11, 7, 0, '', 0, 0, 1, '@users', 0, '2017-07-28 05:13:47', '2017-07-28 05:13:47'), (58, 'species_id', 'Species', 11, 7, 0, '', 0, 0, 1, '@species', 0, '2017-07-28 05:14:56', '2017-07-28 05:16:33'), (59, 'breed_id', 'Breed', 11, 7, 0, '', 0, 0, 1, '@breeds', 0, '2017-07-28 05:16:20', '2017-07-28 06:12:19'), (60, 'name', 'Name', 11, 22, 0, '', 0, 256, 1, '', 0, '2017-07-28 05:17:09', '2017-07-28 05:17:09'), (61, 'profile_pic', 'Profile Image', 11, 9, 0, '', 0, 0, 0, '', 0, '2017-07-28 05:18:08', '2017-07-28 05:18:08'), (62, 'date_of_birth', 'DOB', 11, 4, 0, '', 0, 0, 0, '', 0, '2017-07-28 05:20:05', '2017-07-28 05:20:05'), (63, 'gender', 'Gender', 11, 18, 0, '', 0, 0, 1, '[\"Male\",\"Female\"]', 0, '2017-07-28 05:23:25', '2017-07-28 05:23:37'), (64, 'name', 'Name', 12, 22, 1, '', 0, 256, 1, '', 0, '2017-07-28 06:33:51', '2017-07-28 06:33:51'), (65, 'description', 'Description', 12, 21, 0, '', 0, 0, 1, '', 0, '2017-07-28 06:34:22', '2017-07-28 06:34:22'), (67, 'user_id', 'User', 13, 7, 0, '', 0, 0, 1, '@users', 0, '2017-07-28 06:57:03', '2017-07-28 06:58:57'), (68, 'category_id', 'Category', 13, 7, 0, '', 0, 0, 1, '@categories', 0, '2017-07-28 06:57:51', '2017-07-28 06:57:51'), (69, 'name', 'Name', 13, 22, 1, '', 0, 256, 1, '', 0, '2017-07-28 06:58:46', '2017-07-28 06:58:46'), (70, 'description', 'Description', 13, 21, 0, '', 0, 0, 1, '', 0, '2017-07-28 06:59:49', '2017-07-28 06:59:49'), (71, 'phone_no', 'Contact No', 13, 22, 0, '', 10, 256, 1, '', 0, '2017-07-28 07:00:45', '2017-07-28 07:00:45'), (72, 'email', 'Email', 13, 8, 1, '', 0, 256, 1, '', 0, '2017-07-28 07:01:14', '2017-07-28 07:01:14'), (73, 'website', 'Website', 13, 23, 0, '', 0, 256, 0, '', 0, '2017-07-28 07:01:43', '2017-07-28 07:01:43'), (74, 'address', 'Address', 13, 1, 0, '', 0, 256, 1, '', 0, '2017-07-28 07:03:01', '2017-07-28 07:08:15'), (76, 'user_id', 'User', 15, 7, 0, '0', 0, 0, 1, '@users', 0, '2017-08-24 07:15:22', '2017-08-24 07:15:22'), (77, 'content', 'Content', 15, 21, 0, '', 0, 0, 0, '', 0, '2017-08-24 07:16:04', '2017-08-24 07:16:04'), (78, 'comments_count', 'Comment Count', 15, 13, 0, '0', 0, 11, 0, '', 0, '2017-08-24 07:16:49', '2017-08-24 07:16:49'), (79, 'likes_count', 'Likes Count', 15, 13, 0, '0', 0, 11, 0, '', 0, '2017-08-24 07:17:28', '2017-08-24 07:17:28'), (80, 'shares_count', 'Shares Count', 15, 13, 0, '0', 0, 11, 0, '', 0, '2017-08-24 07:18:08', '2017-08-24 07:19:26'), (81, 'user_id', 'User Id', 16, 7, 0, '0', 0, 0, 0, '@users', 0, '2017-08-25 06:40:08', '2017-08-25 06:40:08'), (82, 'post_id', 'Post Id', 16, 7, 0, '0', 0, 0, 0, '@posts', 0, '2017-08-25 06:40:51', '2017-08-25 06:40:51'), (83, 'is_deleted', 'Is Deleted', 16, 2, 0, '0', 0, 0, 0, '', 0, '2017-08-25 06:48:09', '2017-08-25 06:48:09'), (84, 'user_id', 'User', 17, 7, 0, '0', 0, 0, 0, '@users', 0, '2017-08-29 03:29:20', '2017-08-29 03:29:20'), (85, 'post_id', 'Post', 17, 7, 0, '0', 0, 0, 0, '@posts', 0, '2017-08-29 03:29:55', '2017-08-29 03:35:59'), (86, 'content', 'Content', 17, 21, 0, '', 0, 0, 0, '', 0, '2017-08-29 03:32:05', '2017-08-29 03:32:05'), (87, 'is_blocked', 'Is Blocked', 17, 2, 0, '0', 0, 0, 0, '', 0, '2017-08-29 03:33:18', '2017-08-29 03:33:18'), (88, 'post_id', 'Post', 18, 7, 0, '0', 0, 0, 0, '@posts', 0, '2017-08-29 07:31:02', '2017-09-01 01:26:45'), (89, 'user_id', 'User', 18, 7, 0, '', 0, 0, 0, '@users', 0, '2017-08-29 07:31:23', '2017-08-29 07:31:23'), (90, 'status', 'Status', 15, 18, 0, 'Active', 0, 0, 0, '[\"Active\",\"Inactive\"]', 0, '2017-09-01 05:55:42', '2017-09-01 05:55:42'), (91, 'user_id', 'User', 19, 7, 0, '', 0, 0, 1, '@users', 0, '2017-09-06 01:28:26', '2017-09-06 01:28:26'), (92, 'description', 'Description', 19, 21, 0, '', 0, 256, 0, '', 0, '2017-09-06 01:35:17', '2017-09-06 01:42:19'), (93, 'start_time', 'Start Time', 19, 5, 0, '', 0, 0, 0, '', 0, '2017-09-06 01:35:54', '2017-09-06 01:35:54'), (94, 'end_time', 'End Time', 19, 5, 0, '', 0, 0, 0, '', 0, '2017-09-06 01:36:35', '2017-09-06 01:36:35'), (95, 'is_full_day', 'Is Full Day', 19, 2, 0, '', 0, 0, 0, '', 0, '2017-09-06 01:37:46', '2017-09-06 01:37:46'), (96, 'subscribers_count', 'Subscribers Count', 19, 13, 0, '', 0, 256, 0, '', 0, '2017-09-06 01:40:00', '2017-09-06 01:40:00'), (97, 'is_deleted', 'Is Deleted', 19, 2, 0, '', 0, 0, 0, '', 0, '2017-09-06 01:40:46', '2017-09-06 01:40:46'), (98, 'is_blocked', 'Is Blocked', 19, 2, 0, '', 0, 256, 0, '', 0, '2017-09-06 01:41:06', '2017-09-06 01:41:24'), (99, 'title', 'Title', 19, 22, 0, '', 0, 255, 0, '', 0, '2017-09-06 05:27:05', '2017-09-06 05:27:05'); -- -------------------------------------------------------- -- -- Table structure for table `module_field_types` -- CREATE TABLE `module_field_types` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `module_field_types` -- INSERT INTO `module_field_types` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'Address', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (2, 'Checkbox', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (3, 'Currency', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (4, 'Date', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (5, 'Datetime', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (6, 'Decimal', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (7, 'Dropdown', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (8, 'Email', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (9, 'File', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (10, 'Float', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (11, 'HTML', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (12, 'Image', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (13, 'Integer', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (14, 'Mobile', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (15, 'Multiselect', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (16, 'Name', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (17, 'Password', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (18, 'Radio', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (19, 'String', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (20, 'Taginput', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (21, 'Textarea', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (22, 'TextField', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (23, 'URL', '2017-07-27 06:42:36', '2017-07-27 06:42:36'), (24, 'Files', '2017-07-27 06:42:36', '2017-07-27 06:42:36'); -- -------------------------------------------------------- -- -- Table structure for table `organizations` -- CREATE TABLE `organizations` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `category_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `description` text COLLATE utf8_unicode_ci NOT NULL, `phone_no` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `email` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `website` varchar(256) COLLATE utf8_unicode_ci NOT NULL, `address` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `lat` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `lang` varchar(50) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `organizations` -- INSERT INTO `organizations` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `category_id`, `name`, `description`, `phone_no`, `email`, `website`, `address`, `lat`, `lang`) VALUES (1, NULL, '2017-07-28 07:10:30', '2017-07-28 07:10:30', 1, 1, 'test organization', 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,', '54545454545454545', 'test@test.com', '', 'Sodepur Kolkata-110', '', ''), (3, NULL, '2017-08-21 01:38:44', '2017-08-21 01:38:44', 3, 2, 'ttg', 'fghh', '45555', 'vvgg', 'hgg.com', 'kolkata', '', ''), (4, NULL, '2017-08-28 10:37:55', '2017-08-28 10:37:55', 48, 1, 'Zamer', 'samurai dog parties', '00962787980824', 'zamernas@hotmail.com', 'khalidzamer.com', 'Amman', '', ''), (6, NULL, '2017-09-06 00:24:01', '2017-09-06 00:24:01', 1, 1, 'abc', 'hello', '1234567890', 'abc@gmail.com', 'www.info.com', 'Sodepur Kolkata-110', '', ''), (7, NULL, '2017-09-06 00:50:47', '2017-09-06 00:50:47', 1, 1, 'abc', 'hello', '1234567890', 'abc@gmail.com', 'www.info.com', 'Sodepur Kolkata-110', '22.7038233', '88.382927'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `display_name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `description` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `permissions` -- INSERT INTO `permissions` (`id`, `name`, `display_name`, `description`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'ADMIN_PANEL', 'Admin Panel', 'Admin Panel Permission', NULL, '2017-07-27 06:42:57', '2017-07-27 06:42:57'); -- -------------------------------------------------------- -- -- Table structure for table `permission_role` -- CREATE TABLE `permission_role` ( `permission_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `permission_role` -- INSERT INTO `permission_role` (`permission_id`, `role_id`) VALUES (1, 1); -- -------------------------------------------------------- -- -- Table structure for table `pets` -- CREATE TABLE `pets` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `species_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `breed_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `profile_pic` int(11) NOT NULL, `date_of_birth` date NOT NULL, `gender` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `pets` -- INSERT INTO `pets` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `species_id`, `breed_id`, `name`, `profile_pic`, `date_of_birth`, `gender`) VALUES (1, NULL, '2017-08-18 07:13:05', '2017-08-18 07:13:05', 3, 1, 1, 'aa', 0, '2017-02-15', 'male'), (6, NULL, '2017-08-19 02:52:27', '2017-08-19 02:52:27', 3, 1, 4, 'test', 0, '2012-08-31', 'male'), (7, NULL, '2017-09-04 02:16:06', '2017-09-04 02:16:06', 54, 1, 1, 'new prt', 0, '2017-08-16', 'male'); -- -------------------------------------------------------- -- -- Table structure for table `posts` -- CREATE TABLE `posts` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `content` text COLLATE utf8_unicode_ci NOT NULL, `comments_count` int(10) UNSIGNED NOT NULL DEFAULT '0', `likes_count` int(10) UNSIGNED NOT NULL DEFAULT '0', `shares_count` int(10) UNSIGNED NOT NULL DEFAULT '0', `parent_id` int(11) NOT NULL DEFAULT '0', `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Active' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `posts` -- INSERT INTO `posts` (`id`, `deleted_at`, `created_at`, `updated_at`, `user_id`, `content`, `comments_count`, `likes_count`, `shares_count`, `parent_id`, `status`) VALUES (1, NULL, '2017-08-24 07:18:51', '2017-08-24 07:18:51', 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', 3, 1, 0, 0, 'Inactive'), (10, NULL, '2017-08-25 06:01:08', '2017-08-25 06:01:08', 3, 'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout', 2, 1, 0, 0, 'Active'), (11, NULL, '2017-08-25 06:09:50', '2017-08-25 06:09:50', 3, 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don\'t look even slightly believable', 2, 2, 0, 0, 'Active'), (36, NULL, '2017-09-04 09:39:38', '2017-09-04 09:39:38', 48, 'go to market evening', 0, 0, 0, 0, 'Active'); -- -------------------------------------------------------- -- -- Table structure for table `reports` -- CREATE TABLE `reports` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `post_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `reports` -- INSERT INTO `reports` (`id`, `deleted_at`, `created_at`, `updated_at`, `post_id`, `user_id`) VALUES (1, NULL, '2017-08-31 07:18:41', '2017-08-31 07:18:41', 1, 3), (2, NULL, '2017-08-31 07:25:52', '2017-08-31 07:25:52', 11, 3), (3, NULL, '2017-08-31 07:26:03', '2017-08-31 07:26:03', 11, 3); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `display_name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `description` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, `parent` int(10) UNSIGNED NOT NULL DEFAULT '1', `dept` int(10) UNSIGNED NOT NULL DEFAULT '1', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `name`, `display_name`, `description`, `parent`, `dept`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'SUPER_ADMIN', 'Super Admin', 'Full Access Role', 1, 1, NULL, '2017-07-27 06:42:55', '2017-07-27 06:42:55'); -- -------------------------------------------------------- -- -- Table structure for table `role_module` -- CREATE TABLE `role_module` ( `id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL, `module_id` int(10) UNSIGNED NOT NULL, `acc_view` tinyint(1) NOT NULL, `acc_create` tinyint(1) NOT NULL, `acc_edit` tinyint(1) NOT NULL, `acc_delete` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `role_module` -- INSERT INTO `role_module` (`id`, `role_id`, `module_id`, `acc_view`, `acc_create`, `acc_edit`, `acc_delete`, `created_at`, `updated_at`) VALUES (1, 1, 1, 1, 1, 1, 1, '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (2, 1, 2, 1, 1, 1, 1, '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (3, 1, 3, 1, 1, 1, 1, '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (4, 1, 4, 1, 1, 1, 1, '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (5, 1, 5, 1, 1, 1, 1, '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (7, 1, 7, 1, 1, 1, 1, '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (8, 1, 8, 1, 1, 1, 1, '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (9, 1, 9, 1, 1, 1, 1, '2017-07-28 04:54:59', '2017-07-28 04:54:59'), (10, 1, 10, 1, 1, 1, 1, '2017-07-28 05:00:08', '2017-07-28 05:00:08'), (11, 1, 11, 1, 1, 1, 1, '2017-07-28 05:23:52', '2017-07-28 05:23:52'), (12, 1, 12, 1, 1, 1, 1, '2017-07-28 06:35:14', '2017-07-28 06:35:14'), (13, 1, 13, 1, 1, 1, 1, '2017-07-28 07:06:25', '2017-07-28 07:06:25'), (14, 1, 15, 1, 1, 1, 1, '2017-08-24 07:18:24', '2017-08-24 07:18:24'), (15, 1, 16, 1, 1, 1, 1, '2017-08-25 06:41:12', '2017-08-25 06:41:12'), (16, 1, 17, 1, 1, 1, 1, '2017-08-29 03:33:32', '2017-08-29 03:33:32'), (17, 1, 18, 1, 1, 1, 1, '2017-08-29 07:31:34', '2017-08-29 07:31:34'), (18, 1, 19, 1, 1, 1, 1, '2017-09-04 01:15:55', '2017-09-04 01:15:55'), (19, 1, 20, 1, 1, 1, 1, '2017-09-04 02:10:26', '2017-09-04 02:10:26'); -- -------------------------------------------------------- -- -- Table structure for table `role_module_fields` -- CREATE TABLE `role_module_fields` ( `id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL, `field_id` int(10) UNSIGNED NOT NULL, `access` enum('invisible','readonly','write') COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `role_module_fields` -- INSERT INTO `role_module_fields` (`id`, `role_id`, `field_id`, `access`, `created_at`, `updated_at`) VALUES (1, 1, 1, 'write', '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (2, 1, 2, 'write', '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (3, 1, 3, 'write', '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (4, 1, 4, 'write', '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (5, 1, 5, 'write', '2017-07-27 06:42:55', '2017-07-27 06:42:55'), (6, 1, 6, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (7, 1, 7, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (8, 1, 8, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (9, 1, 9, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (10, 1, 10, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (11, 1, 11, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (12, 1, 12, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (13, 1, 13, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (14, 1, 14, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (15, 1, 15, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (16, 1, 16, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (17, 1, 17, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (18, 1, 18, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (19, 1, 19, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (20, 1, 20, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (21, 1, 21, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (22, 1, 22, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (23, 1, 23, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (24, 1, 24, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (25, 1, 25, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (26, 1, 26, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (27, 1, 27, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (28, 1, 28, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (29, 1, 29, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (30, 1, 30, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (31, 1, 31, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (32, 1, 32, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (33, 1, 33, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (34, 1, 34, 'write', '2017-07-27 06:42:56', '2017-07-27 06:42:56'), (46, 1, 46, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (47, 1, 47, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (48, 1, 48, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (49, 1, 49, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (50, 1, 50, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (51, 1, 51, 'write', '2017-07-27 06:42:57', '2017-07-27 06:42:57'), (52, 1, 52, 'write', '2017-07-28 04:54:09', '2017-07-28 04:54:09'), (53, 1, 53, 'write', '2017-07-28 04:54:39', '2017-07-28 04:54:39'), (54, 1, 54, 'write', '2017-07-28 04:59:01', '2017-07-28 04:59:01'), (55, 1, 55, 'write', '2017-07-28 04:59:48', '2017-07-28 04:59:48'), (56, 1, 56, 'write', '2017-07-28 05:01:21', '2017-07-28 05:01:21'), (57, 1, 57, 'write', '2017-07-28 05:13:49', '2017-07-28 05:13:49'), (58, 1, 58, 'write', '2017-07-28 05:14:58', '2017-07-28 05:14:58'), (59, 1, 59, 'write', '2017-07-28 05:16:22', '2017-07-28 05:16:22'), (60, 1, 60, 'write', '2017-07-28 05:17:10', '2017-07-28 05:17:10'), (61, 1, 61, 'write', '2017-07-28 05:18:09', '2017-07-28 05:18:09'), (62, 1, 62, 'write', '2017-07-28 05:20:06', '2017-07-28 05:20:06'), (63, 1, 63, 'write', '2017-07-28 05:23:26', '2017-07-28 05:23:26'), (64, 1, 64, 'write', '2017-07-28 06:33:52', '2017-07-28 06:33:52'), (65, 1, 65, 'write', '2017-07-28 06:34:23', '2017-07-28 06:34:23'), (67, 1, 67, 'write', '2017-07-28 06:57:05', '2017-07-28 06:57:05'), (68, 1, 68, 'write', '2017-07-28 06:57:53', '2017-07-28 06:57:53'), (69, 1, 69, 'write', '2017-07-28 06:58:47', '2017-07-28 06:58:47'), (70, 1, 70, 'write', '2017-07-28 06:59:50', '2017-07-28 06:59:50'), (71, 1, 71, 'write', '2017-07-28 07:00:46', '2017-07-28 07:00:46'), (72, 1, 72, 'write', '2017-07-28 07:01:15', '2017-07-28 07:01:15'), (73, 1, 73, 'write', '2017-07-28 07:01:44', '2017-07-28 07:01:44'), (74, 1, 74, 'write', '2017-07-28 07:03:02', '2017-07-28 07:03:02'), (75, 1, 76, 'write', '2017-08-24 07:15:23', '2017-08-24 07:15:23'), (76, 1, 77, 'write', '2017-08-24 07:16:04', '2017-08-24 07:16:04'), (77, 1, 78, 'write', '2017-08-24 07:16:50', '2017-08-24 07:16:50'), (78, 1, 79, 'write', '2017-08-24 07:17:29', '2017-08-24 07:17:29'), (79, 1, 80, 'write', '2017-08-24 07:18:09', '2017-08-24 07:18:09'), (80, 1, 81, 'write', '2017-08-25 06:40:10', '2017-08-25 06:40:10'), (81, 1, 82, 'write', '2017-08-25 06:40:52', '2017-08-25 06:40:52'), (82, 1, 83, 'write', '2017-08-25 06:48:10', '2017-08-25 06:48:10'), (83, 1, 84, 'write', '2017-08-29 03:29:21', '2017-08-29 03:29:21'), (84, 1, 85, 'write', '2017-08-29 03:29:55', '2017-08-29 03:29:55'), (85, 1, 86, 'write', '2017-08-29 03:32:06', '2017-08-29 03:32:06'), (86, 1, 87, 'write', '2017-08-29 03:33:19', '2017-08-29 03:33:19'), (87, 1, 88, 'write', '2017-08-29 07:31:03', '2017-08-29 07:31:03'), (88, 1, 89, 'write', '2017-08-29 07:31:24', '2017-08-29 07:31:24'), (89, 1, 90, 'write', '2017-09-01 05:55:43', '2017-09-01 05:55:43'), (90, 1, 91, 'write', '2017-09-04 01:14:54', '2017-09-04 01:14:54'), (91, 1, 92, 'write', '2017-09-04 01:15:32', '2017-09-04 01:15:32'), (92, 1, 93, 'write', '2017-09-04 02:06:26', '2017-09-04 02:06:26'), (93, 1, 94, 'write', '2017-09-04 03:47:10', '2017-09-04 03:47:10'), (94, 1, 95, 'write', '2017-09-06 01:37:47', '2017-09-06 01:37:47'), (95, 1, 96, 'write', '2017-09-06 01:40:01', '2017-09-06 01:40:01'), (96, 1, 97, 'write', '2017-09-06 01:40:47', '2017-09-06 01:40:47'), (97, 1, 98, 'write', '2017-09-06 01:41:07', '2017-09-06 01:41:07'), (98, 1, 99, 'write', '2017-09-06 05:27:06', '2017-09-06 05:27:06'); -- -------------------------------------------------------- -- -- Table structure for table `role_user` -- CREATE TABLE `role_user` ( `id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `role_user` -- INSERT INTO `role_user` (`id`, `role_id`, `user_id`, `created_at`, `updated_at`) VALUES (2, 1, 1, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `species` -- CREATE TABLE `species` ( `id` int(10) UNSIGNED NOT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `pets_count` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `species` -- INSERT INTO `species` (`id`, `deleted_at`, `created_at`, `updated_at`, `name`, `pets_count`) VALUES (1, NULL, '2017-07-28 04:55:17', '2017-07-28 04:55:17', 'Dog', 0), (2, NULL, '2017-07-28 04:55:49', '2017-07-28 04:55:49', 'Cat', 0), (3, NULL, '2017-09-03 01:41:47', '2017-09-03 01:41:47', 'Bird', 0), (4, NULL, '2017-09-03 01:42:01', '2017-09-03 01:42:01', 'Fish', 0), (5, NULL, '2017-09-03 01:42:13', '2017-09-03 01:42:13', 'Reptile', 0), (6, NULL, '2017-09-03 01:42:33', '2017-09-03 01:42:33', 'Equine', 0), (7, NULL, '2017-09-03 01:42:48', '2017-09-03 01:42:48', 'Rodent', 0), (8, NULL, '2017-09-03 01:45:16', '2017-09-03 01:45:16', 'Arthropod', 0), (9, NULL, '2017-09-03 01:45:53', '2017-09-03 01:45:53', 'Exotic', 0), (10, NULL, '2017-09-03 01:46:20', '2017-09-03 01:46:20', 'Other Species', 0); -- -------------------------------------------------------- -- -- Table structure for table `uploads` -- CREATE TABLE `uploads` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `path` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `extension` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `caption` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `user_id` int(10) UNSIGNED NOT NULL DEFAULT '1', `hash` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `public` tinyint(1) NOT NULL DEFAULT '0', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `uploads` -- INSERT INTO `uploads` (`id`, `name`, `path`, `extension`, `caption`, `user_id`, `hash`, `public`, `deleted_at`, `created_at`, `updated_at`) VALUES (1, 'data model diagram - Relations v1.jpg', '/opt/lampp/htdocs/la1/storage/uploads/2017-07-27-121529-data model diagram - Relations v1.jpg', 'jpg', '', 1, 'ktyo6bhdwwfjfch2zdyk', 0, '2017-07-31 03:22:44', '2017-07-27 06:45:29', '2017-07-31 03:22:44'), (2, 'data model diagram - Relations v1.jpg', '/var/www/html/team3/petiZen/storage/uploads/2017-07-31-085305-data model diagram - Relations v1.jpg', 'jpg', '', 1, '2t3ozrwiwphrqfnse7un', 0, NULL, '2017-07-31 03:23:05', '2017-07-31 03:23:05'), (3, 'data model diagram - Hierarchic v1.jpg', '/var/www/html/team3/petiZen/storage/uploads/2017-07-31-085315-data model diagram - Hierarchic v1.jpg', 'jpg', '', 1, 'hetymglxcco8rozg2hbf', 0, NULL, '2017-07-31 03:23:15', '2017-07-31 03:23:15'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `context_id` int(10) UNSIGNED NOT NULL DEFAULT '0', `email` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Employee', `remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `api_token` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL, `dob` date DEFAULT NULL, `gender` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `context_id`, `email`, `password`, `type`, `remember_token`, `deleted_at`, `created_at`, `updated_at`, `api_token`, `dob`, `gender`) VALUES (1, 'Super Admin', 1, 'nits.ravis@gmail.com', '$2y$10$lc275VjjcmyPeYe.i0t1fO/bJreBagJdoyqCcbgzBAmyrO/YMg9c.', 'Employee', 'QfubOCAxy0RZqFIua2IAZndzFNbtFry1weTprWH1Iwe20OZmyKhMBKhEWOJo', NULL, '2017-07-27 06:43:19', '2017-09-06 06:11:53', 'CUzYGbGiXe5yFJBXox3UVyflz0pOVpdLws4SzbM8k1R0ak6MRQMyEJ5LPrGD', NULL, NULL), (3, 'anup chakraborty', 2, 'nits.anup@gmail.com', '$2y$10$Y7H23T.K50/NxaO9hKHUrOr6VDR0SHZjg/JQvcBTwJM0V2Q2u2E6u', 'pet_owner', NULL, NULL, '2017-08-14 03:59:48', '2017-08-14 03:59:48', 'tdsiUzrbkMWy3HcVoB4UPaTxgDdxTpXeJduwkWKpiOX6XtZKYPBvJAsTXv9M', '2000-01-14', 'male'), (12, 'suman samanta', 2, 'nits.suman@gmail.com', '$2y$10$weINYmcyUGJedYU53PqfFu5ZHuT3Dx6/19l1yy.yx5v9arkmyCAQ.', 'pet_owner', NULL, NULL, '2017-08-18 08:12:24', '2017-08-18 08:12:24', 'vEMUrwlkejDRJ2h8up2UeVjepX7qp4GIm5yrJfaM6y4b0Gerv8208aSzR3X9', '2017-08-09', 'male'), (27, 'ravi', 2, 'nits.rav3is@gmail.com', '$2y$10$VTlrusqrvemHCA4busl/V.DI35SKIGuxMCYH5fiBfvEyEsWwXGW/q', 'service_provider', NULL, NULL, '2017-08-21 06:01:09', '2017-08-21 06:01:09', 'wjKYRKTj4rb9FM7NdPZS5g9OlPGtauqCUyEhV7IiRcrZ2O7qP3w8jxhplsTK', '2005-08-08', 'male'), (30, 'redux', 2, 'nitttyy@yopmail.com', '$2y$10$SmUG1fAX0qUNaYuRY2DS1ewEkpgcO7lj0rC3f/ZRB2O6KYgqoxLZW', 'pet_owner', NULL, NULL, '2017-08-21 08:26:02', '2017-08-21 08:26:02', 'jUSOP6DRBpQvlZa4lZc1FNXyqgFLi8EdFPC9b1NKyIrna1UzZkZ8HgKpp1OZ', '2017-08-02', 'male'), (44, 'hello', 2, 'nits.anc@gmail.com', '$2y$10$5N2Dbrs27rWnbV6K3UCo6O/zGjDN0SNbkExhU4IqtRIuAZNi//NZO', 'service_provider', NULL, NULL, '2017-08-22 08:01:36', '2017-08-22 08:01:36', '8XF4NuEnGMzVZFE57u1Uf1VKY1uosSC1wviL9m2yPzaIrvg3ft6SFTjemy5r', '2017-08-03', 'male'), (46, 'KZ', 2, 'Kzamer88@gmail.com', '$2y$10$w6o39J1Piffqr2YxHVy84OX234zxTC4H4fc9.3MqIiNICEcq5zM.S', 'pet_owner', NULL, NULL, '2017-08-23 16:46:51', '2017-08-23 16:46:51', 'NelCR1tqsLkCNIbBFfvRfojJGFiiv6Oj6Jj2dACsXDgMItaITkv7mzOtmorF', '1988-08-29', 'male'), (48, 'kz', 2, 'petizenapp@gmail.com', '$2y$10$oaVR0kiqts63p9xnvC3ZEudY1KEkbasVJhlfo.i1SIandIDe.ar.K', 'service_provider', NULL, NULL, '2017-08-28 10:34:53', '2017-08-28 10:34:53', 'zBeUb03arKH4FHH92vzM6gaJi1RbVF5mICRkYU5OS6A4BuD3VU9l8dpKx825', '1988-08-30', 'male'), (52, 'abc', 2, 'abc@gmail.com', '$2y$10$1jWI4kULLv5drkyV8Rm5FeFjLcJh.5MDpAaGL56HwRAgBChvI5jOa', 'pet_owner', NULL, NULL, '2017-09-04 01:57:03', '2017-09-04 01:57:03', 'GikyvcjYD4OpJqMKN6Y5jq7idFxUgvj4Uq51huqfRnx8ITwjR36ioSkwxL7T', '2016-09-01', 'male'), (53, 'aa', 2, 'aa@gmail.com', '$2y$10$4qqbKXAwIRk/G.fIr70IRe.oXioonSbUGD5f.leoXWqzwrTG3VScW', 'service_provider', NULL, NULL, '2017-09-04 02:01:32', '2017-09-04 02:01:32', 'LfGULGOVsKPduwKs0sTx4j1ZZkYIT6XX10O4RTxQJcx5B0ygzlfOM9JNK47x', '2016-08-29', 'male'), (54, 'abc', 2, 'ab@gmail.vom', '$2y$10$haYMkRjIj4RDV9sKZT4mPehm.y4ULfLs.7J/ycl7KK1UP2874.6rO', 'pet_owner', NULL, NULL, '2017-09-04 02:09:02', '2017-09-04 02:09:02', 'Fd94M0rchFESj0TpU4UafQHckOxMTeMujPnTUelZiDFDCJV2QvKr44A1oW1H', '2015-09-01', 'male'), (55, 'dfg', 2, 'ff@gmail.com', '$2y$10$nmV2qgnhIUCVKIt8DwgHQuFmEUZDtc1nIbmX/VUK7.8/r.Fq8wZGi', 'service_provider', NULL, NULL, '2017-09-04 02:18:20', '2017-09-04 02:18:20', 'LCtKkmXAOQtrO1TwqT9AlSdnsiYEb5oRKPNl0KraOISPMDu0KOWAPupTrQmI', '2012-09-01', 'male'), (56, 'dgg', 2, 'ads@gmail.com', '$2y$10$raZx7ohcYRbUu7uA0Ip0n.dDEsDovzMJXjPpPQK1N2rMfq6go2vse', 'service_provider', NULL, NULL, '2017-09-04 02:28:38', '2017-09-04 02:28:38', 'lQHx7wkUu3KN5SftFgQPtMeORmsSER2T1psb9TKZlBzILsfKyLWuagx0FTdP', '2013-09-01', 'female'), (58, 'hgty', 2, 'a@gmail.com', '$2y$10$sbsqisCNVBKVoqDmUj8fw.p.EbszaDkEZOVECDJPXP7OsQ5NdPOWi', 'service_provider', NULL, NULL, '2017-09-04 03:18:53', '2017-09-04 03:18:53', 'gcIDkrKLiD5Jy6c5VcocIOOhXO1ThAnOFLX7G2DLVB7HfGWw1wdo499dSy5F', '2010-09-01', 'male'), (59, 'fgg', 2, 'avc@gmail.com', '$2y$10$O4lrbZOxg6XTLE4CJoaZleXGNFoKdx3BBADznJ23kvXDcAjCOXZUG', 'service_provider', NULL, NULL, '2017-09-04 03:34:47', '2017-09-04 03:34:47', 'XB2nxHX7Y3DIVgAicLBcaPML0D9Fb4xmEfqdtGFnLTefeO14y3O6WkuZm9dZ', '2013-09-01', 'male'), (60, 'hghh', 2, 'adf@gmail.com', '$2y$10$yHNE7vGsnyvXtCX3ygkAv.2S2A7lN9bN7QNYkeVJc.ba9jJuJmDGe', 'service_provider', NULL, NULL, '2017-09-04 03:37:32', '2017-09-04 03:37:32', 'bL1TPmsQlDr9cGWmbpKH55svzxgaBfQ9fBnYmEfCmVfnP2RycmQ8srjYVqU0', '2012-09-01', 'male'), (61, 'gfgg', 2, 'asd@gmail.com', '$2y$10$81UXGAzuAvkgbh1SnHwFE.kbCr9sNROkKF7LXlvfkZiVzYyKruINK', 'service_provider', NULL, NULL, '2017-09-04 04:08:24', '2017-09-04 04:08:24', 'LGhOlLkAkFYm5RlU6jY1xZevAZk7GCMCbh8zRy5Ul7JMxCaz2lObaGQiVWL9', '2009-09-01', 'male'), (62, 'chandralina paul', 2, 'nits.chandralina@gmail.com', '$2y$10$lfbczW/Lt1QiN7.FRL.8Xeas7cvJlHSdBOozMvAeAf7m4vL.iyRP6', 'pet_owner', NULL, NULL, '2017-09-04 04:46:04', '2017-09-04 04:46:04', 'Gltx9lUS4YeV9N3P84njN4g4ycRoxF19MhJSEzh6Nemlxea2NY8BYykteIj6', '1992-07-20', 'female'), (69, 'fgh', 2, 'b@gmail.com', '$2y$10$MJmWZ3rSEbRJoCmh.H3QzeD1o.55CTGFB7wGeXb1kQJvuPfRfFD86', 'service_provider', NULL, NULL, '2017-09-04 05:05:05', '2017-09-04 05:05:05', 'wINLYMdWQkul1Icuve9rjsfCcW5vbXPIn2LS6uhmxmLYtGv6y3Sph7NDXmmr', '2013-09-01', 'male'), (71, 'hgfg', 2, 'ahh@gmail.com', '$2y$10$nBLvztFjG8HE9MxGZjJIlubPSREN6d9yrpfvscCrhbvEA7CPZSnwS', 'service_provider', NULL, NULL, '2017-09-04 05:15:12', '2017-09-04 05:15:12', 'PJGzX3lfmx1Rc0t9bc2zw7HADbdBx29ofJ7IUZH3EIdOMKYnNmDL9QZ7GiLH', '2014-09-01', 'male'), (74, 'hgg', 2, 'fg@g.com', '$2y$10$zW48zKM2jfxHZU65UXosXOD7i5oj9Bz2fampE0Ldp96dSr7B/2tTe', 'pet_owner', NULL, NULL, '2017-09-04 05:23:30', '2017-09-04 05:23:30', '89dtwQRAs5wN29VqEbiclNzXTRkpHudEZMY3nrMRjVcJAzObRfrgtm2aiXDC', '2010-09-01', 'male'); -- -- Indexes for dumped tables -- -- -- Indexes for table `backups` -- ALTER TABLE `backups` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `backups_name_unique` (`name`), ADD UNIQUE KEY `backups_file_name_unique` (`file_name`); -- -- Indexes for table `breeds` -- ALTER TABLE `breeds` ADD PRIMARY KEY (`id`), ADD KEY `breeds_species_id_foreign` (`species_id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`), ADD KEY `comments_user_id_foreign` (`user_id`), ADD KEY `comments_post_id_foreign` (`post_id`); -- -- Indexes for table `departments` -- ALTER TABLE `departments` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `departments_name_unique` (`name`); -- -- Indexes for table `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `employees_email_unique` (`email`), ADD KEY `employees_dept_foreign` (`dept`); -- -- Indexes for table `events` -- ALTER TABLE `events` ADD PRIMARY KEY (`id`), ADD KEY `events_user_id_foreign` (`user_id`); -- -- Indexes for table `la_configs` -- ALTER TABLE `la_configs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `la_menus` -- ALTER TABLE `la_menus` ADD PRIMARY KEY (`id`); -- -- Indexes for table `likes` -- ALTER TABLE `likes` ADD PRIMARY KEY (`id`), ADD KEY `likes_user_id_foreign` (`user_id`), ADD KEY `likes_post_id_foreign` (`post_id`); -- -- Indexes for table `modules` -- ALTER TABLE `modules` ADD PRIMARY KEY (`id`); -- -- Indexes for table `module_fields` -- ALTER TABLE `module_fields` ADD PRIMARY KEY (`id`), ADD KEY `module_fields_module_foreign` (`module`), ADD KEY `module_fields_field_type_foreign` (`field_type`); -- -- Indexes for table `module_field_types` -- ALTER TABLE `module_field_types` ADD PRIMARY KEY (`id`); -- -- Indexes for table `organizations` -- ALTER TABLE `organizations` ADD PRIMARY KEY (`id`), ADD KEY `organizations_category_id_foreign` (`category_id`), ADD KEY `organizations_user_id_foreign` (`user_id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`), ADD KEY `password_resets_token_index` (`token`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permissions_name_unique` (`name`); -- -- Indexes for table `permission_role` -- ALTER TABLE `permission_role` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `permission_role_role_id_foreign` (`role_id`); -- -- Indexes for table `pets` -- ALTER TABLE `pets` ADD PRIMARY KEY (`id`), ADD KEY `pets_user_id_foreign` (`user_id`), ADD KEY `pets_species_id_foreign` (`species_id`), ADD KEY `pets_breed_id_foreign` (`breed_id`); -- -- Indexes for table `posts` -- ALTER TABLE `posts` ADD PRIMARY KEY (`id`), ADD KEY `posts_user_id_foreign` (`user_id`); -- -- Indexes for table `reports` -- ALTER TABLE `reports` ADD PRIMARY KEY (`id`), ADD KEY `reports_user_id_foreign` (`user_id`), ADD KEY `reports_post_id_foreign` (`post_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `roles_name_unique` (`name`), ADD KEY `roles_parent_foreign` (`parent`), ADD KEY `roles_dept_foreign` (`dept`); -- -- Indexes for table `role_module` -- ALTER TABLE `role_module` ADD PRIMARY KEY (`id`), ADD KEY `role_module_role_id_foreign` (`role_id`), ADD KEY `role_module_module_id_foreign` (`module_id`); -- -- Indexes for table `role_module_fields` -- ALTER TABLE `role_module_fields` ADD PRIMARY KEY (`id`), ADD KEY `role_module_fields_role_id_foreign` (`role_id`), ADD KEY `role_module_fields_field_id_foreign` (`field_id`); -- -- Indexes for table `role_user` -- ALTER TABLE `role_user` ADD PRIMARY KEY (`id`), ADD KEY `role_user_role_id_foreign` (`role_id`), ADD KEY `role_user_user_id_foreign` (`user_id`); -- -- Indexes for table `species` -- ALTER TABLE `species` ADD PRIMARY KEY (`id`); -- -- Indexes for table `uploads` -- ALTER TABLE `uploads` ADD PRIMARY KEY (`id`), ADD KEY `uploads_user_id_foreign` (`user_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `backups` -- ALTER TABLE `backups` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `breeds` -- ALTER TABLE `breeds` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `comments` -- ALTER TABLE `comments` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27; -- -- AUTO_INCREMENT for table `departments` -- ALTER TABLE `departments` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `employees` -- ALTER TABLE `employees` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `events` -- ALTER TABLE `events` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `la_configs` -- ALTER TABLE `la_configs` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `la_menus` -- ALTER TABLE `la_menus` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `likes` -- ALTER TABLE `likes` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=69; -- -- AUTO_INCREMENT for table `modules` -- ALTER TABLE `modules` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `module_fields` -- ALTER TABLE `module_fields` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100; -- -- AUTO_INCREMENT for table `module_field_types` -- ALTER TABLE `module_field_types` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `organizations` -- ALTER TABLE `organizations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `pets` -- ALTER TABLE `pets` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `posts` -- ALTER TABLE `posts` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; -- -- AUTO_INCREMENT for table `reports` -- ALTER TABLE `reports` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `role_module` -- ALTER TABLE `role_module` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `role_module_fields` -- ALTER TABLE `role_module_fields` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=99; -- -- AUTO_INCREMENT for table `role_user` -- ALTER TABLE `role_user` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `species` -- ALTER TABLE `species` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `uploads` -- ALTER TABLE `uploads` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=75; -- -- Constraints for dumped tables -- -- -- Constraints for table `breeds` -- ALTER TABLE `breeds` ADD CONSTRAINT `breeds_species_id_foreign` FOREIGN KEY (`species_id`) REFERENCES `species` (`id`); -- -- Constraints for table `comments` -- ALTER TABLE `comments` ADD CONSTRAINT `comments_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`), ADD CONSTRAINT `comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `employees` -- ALTER TABLE `employees` ADD CONSTRAINT `employees_dept_foreign` FOREIGN KEY (`dept`) REFERENCES `departments` (`id`); -- -- Constraints for table `events` -- ALTER TABLE `events` ADD CONSTRAINT `events_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `likes` -- ALTER TABLE `likes` ADD CONSTRAINT `likes_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`), ADD CONSTRAINT `likes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `module_fields` -- ALTER TABLE `module_fields` ADD CONSTRAINT `module_fields_field_type_foreign` FOREIGN KEY (`field_type`) REFERENCES `module_field_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `module_fields_module_foreign` FOREIGN KEY (`module`) REFERENCES `modules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `organizations` -- ALTER TABLE `organizations` ADD CONSTRAINT `organizations_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`), ADD CONSTRAINT `organizations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `permission_role` -- ALTER TABLE `permission_role` ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `pets` -- ALTER TABLE `pets` ADD CONSTRAINT `pets_breed_id_foreign` FOREIGN KEY (`breed_id`) REFERENCES `breeds` (`id`), ADD CONSTRAINT `pets_species_id_foreign` FOREIGN KEY (`species_id`) REFERENCES `species` (`id`), ADD CONSTRAINT `pets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `posts` -- ALTER TABLE `posts` ADD CONSTRAINT `posts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `reports` -- ALTER TABLE `reports` ADD CONSTRAINT `reports_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`), ADD CONSTRAINT `reports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); -- -- Constraints for table `roles` -- ALTER TABLE `roles` ADD CONSTRAINT `roles_dept_foreign` FOREIGN KEY (`dept`) REFERENCES `departments` (`id`), ADD CONSTRAINT `roles_parent_foreign` FOREIGN KEY (`parent`) REFERENCES `roles` (`id`); /*!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
988be71e8b11136405240bd2d060574692501876
SQL
JiaBaron/Linuxfile
/shell_study/backup/20200221120002/test.sql
UTF-8
2,184
3.078125
3
[]
no_license
-- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64) -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.5.60-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 `student` -- DROP TABLE IF EXISTS `student`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(12) NOT NULL, `sex` varchar(4) DEFAULT NULL, `age` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `student` -- LOCK TABLES `student` WRITE; /*!40000 ALTER TABLE `student` DISABLE KEYS */; INSERT INTO `student` VALUES (1,'jiabaoyu','man',26),(2,'libai','man',30),(3,'liqingzhao','woma',28),(4,'zhuzi','man',23),(5,'peijuyi','man',22),(6,'weibai','man',56),(7,'zhangzi','wman',37),(8,'peixin','wman',28),(9,'anzi','wman',25),(10,'lizi','wman',19); /*!40000 ALTER TABLE `student` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-02-21 12:00:03
true
014358fc1af27bd5376346cfc2b0383ce4a79e34
SQL
vincentRoussel06/Projet_Slam1
/projet_slam1.sql
UTF-8
3,021
3.09375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : lun. 17 mai 2021 à 08:02 -- Version du serveur : 5.7.31 -- Version de PHP : 7.3.21 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 */; -- -- Base de données : `projet_slam1` -- -- -------------------------------------------------------- -- -- Structure de la table `score` -- DROP TABLE IF EXISTS `score`; CREATE TABLE IF NOT EXISTS `score` ( `idJoueur` varchar(250) COLLATE latin1_bin NOT NULL, `idPartie` int(11) NOT NULL AUTO_INCREMENT, `nbTour` int(4) NOT NULL, `datePartie` date NOT NULL, `resultat` tinyint(1) NOT NULL, PRIMARY KEY (`idPartie`), KEY `idJoueur` (`idJoueur`) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COLLATE=latin1_bin; -- -- Déchargement des données de la table `score` -- INSERT INTO `score` (`idJoueur`, `idPartie`, `nbTour`, `datePartie`, `resultat`) VALUES ('test2', 2, 10, '2005-11-21', 1), ('test2', 3, 10, '2005-11-21', 1), ('test2', 4, 10, '2005-11-21', 1), ('test2', 5, 10, '2005-11-21', 1), ('test2', 6, 20, '2005-11-21', 1), ('test2', 7, 5, '2005-11-21', 1), ('test2', 8, 3, '2005-11-21', 1), ('okok', 9, 20, '2005-11-21', 1), ('hacker', 10, 1, '2005-11-21', 1); -- -------------------------------------------------------- -- -- Structure de la table `user` -- DROP TABLE IF EXISTS `user`; CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Nom` varchar(250) COLLATE latin1_bin NOT NULL, `Mdp` varchar(250) COLLATE latin1_bin NOT NULL, `Partie` tinyint(1) NOT NULL, `NbTour` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 COLLATE=latin1_bin; -- -- Déchargement des données de la table `user` -- INSERT INTO `user` (`id`, `Nom`, `Mdp`, `Partie`, `NbTour`) VALUES (1, 'az', 'az', 0, 0), (2, 'ae', '$2y$10$OPZ6rNcNxR4wERXx4f.q5.58Nz7SdtWQxs0U6zaoAwvxQjFEpG6WW', 0, 0), (3, 'ae', '$2y$10$.guDU5Z2f8Mniah/JU8zReUY9IjNE0c8cm.kCJqNGwvkeoHfRUgYe', 0, 0), (4, 'test', '$2y$10$C.6RXRf1hUgRfBylaCKbCO7EflibyhkPwyG0CPZs3C3on7LGU5XF2', 0, 0), (5, 'test', '$2y$10$3XzVAo5CqXOXXd.PsU54VukRiNnbtfWpgU1l0hbmNPS1BFTIuqMt6', 0, 0), (6, 'toi', '$2y$10$k6RpPzmdxtwtDqRN.Jp20OsQwypmG/Yxpk9FU0WvwB9RnfFNFLYf6', 0, 0), (7, 'toi', '$2y$10$gejaQ6H5pN4S.3ngEccteuerIqmWIEsfh3BE4SA2miVD5qA.CHd3q', 0, 0), (8, 'toi', '$2y$10$nDc0crWBIYbNiu/kvWzayO0D7jKrg4u6hfsrHJgMG6L/Jb.az4LQi', 0, 0), (9, 'Vince', '$2y$10$Oi/VzBvQ2r0gexpOvpSjc.koz9/uh6oMFVQXkhPCBNg0GHUdrEkeC', 0, 0), (10, 'test2', '0', 0, 0); 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
b2dff0d776d017b694ba1155fd58590f25efef36
SQL
montreuillois/PA_GarbageRoyale
/SourcesTierces/PA_BR_website/sql/gr_prod.sql
UTF-8
5,631
2.875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.6deb4 -- https://www.phpmyadmin.net/ -- -- Client : localhost:3306 -- Généré le : Jeu 04 Juillet 2019 à 16:48 -- Version du serveur : 10.1.26-MariaDB-0+deb9u1 -- Version de PHP : 7.0.30-0+deb9u1 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 */; -- -- Base de données : `gr_prod` -- -- -------------------------------------------------------- -- -- Structure de la table `account` -- CREATE TABLE `account` ( `id` int(11) NOT NULL, `name` varchar(14) NOT NULL, `email` varchar(50) NOT NULL, `password` char(60) NOT NULL, `token` char(32) DEFAULT NULL, `userid` char(36) NOT NULL, `role` int(11) NOT NULL DEFAULT '0', `isActive` tinyint(1) NOT NULL DEFAULT '1', `score` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Contenu de la table `account` -- INSERT INTO `account` (`id`, `name`, `email`, `password`, `token`, `userid`, `role`, `isActive`, `score`) VALUES (1, 'Kazetheroth', 'medhi.foulgoc@gmail.com', '$2y$10$BgnIEKDdFQlQn3kfjdDbIegzfahSJasM/N5SJYOwVCH/0.iewwesG', NULL, 'avykapcw-a60i-q0pg-5z4g-qspg0l7ydtun', 3, 0, 105), (4, 'Medhi2703', 'med__27@hotmail.fr', '$2y$10$Qr.OtB5pIKoR45WWLXlN5esIQYY2kTAbEy/l.dH2F9BVLjQte46Ue', NULL, 'bcunp3uc-v3wh-laxs-s22v-5znntqv4qro1', 3, 0, 0), (5, 'medhif', 'medhi@heolia.eu', '$2y$10$oBuemI2/AnquO11XXzNOe.s4ruZtrsC5ofqMG/2YikOKG0uZpmbM.', NULL, '65qvw5d8-zc4w-hbbi-t8s0-xzzhsadh3bsa', 0, 0, 0), (6, 'pim', 'pim103@hotmail.fr', '$2y$10$n0xeo53PgA6TTc4AZ8ez0e2iDOqPAWiSIydCbM1v62cGrbFlWZxw.', NULL, '0ga1hh5c-rfvp-zkus-98g1-q2hrydtfcubc', 0, 0, 0), (7, 'lastuck', 'test@test.fr', '$2y$10$P8HLVSJB.31p9rSTBxvc7OVIcpwB7CzhJP6akUVhxROF/ED/p1ymu', NULL, '8w8v0hka-1c3q-ezw9-msfk-vj6c1cc7cpil', 0, 0, 0), (8, 'lastuck2', 'test2@test.fr', '$2y$10$CHKzI/FyaPONFcajWfla6OSIOU2OHCl9sPWdVJDhCbL/PF1WEX/PW', NULL, '62vi7888-pr48-44bq-ol66-ousiun8p4mca', 0, 0, 0), (9, 'pim2', 'pim@hotmail.fr', '$2y$10$jm9nOihNGPBh.WaiI98nLeKhY/AWPfqY7isRQw1ydUCyrD96QQD2q', NULL, 'mrgm80wa-dz0s-zx2l-ph6l-1dy2pba21tnn', 0, 0, 0), (10, 'test22', 'test2@test2.fr', '$2y$10$xEbcXuKXg9xG1sJ66i3AYObpNa49uXLSQK8tXaiRT0ziGPoj8enkm', NULL, 'mx1dvh7t-q4om-2bft-jipr-ennoy2q7defz', 0, 0, 0), (11, 'pimpim', 'pimpim@hotmail.fr', '$2y$10$lLzMIXK4TWYTw7zPmbwbfuUtTnZtKWoag7ZFAx9YtrG5o4wonAp4u', NULL, '6d8ixebj-w8ds-6o7g-qyo9-mx7zx0e0k1yq', 0, 1, 0), (12, 'marcher', 'marcher.pro@gmail.com', '$2y$10$fvksQVAk3WT8p3fsdKbBoeNmIuCtqGht84iN9fv7F.vWiVvGZVWaC', NULL, '8zhzif1e-ydmz-snz3-j8ia-9c7rxt81m1nv', 0, 1, 0), (13, 'cread', 'mickaelberthelot@outlook.fr', '$2y$10$t3Hm9CccSCJhoBnL3eM1PeHxivevpYif3tin6wt1csj/iZ/k1Yhqy', NULL, 'givf2tsm-i6ko-yq7n-kui5-tj4fsp9rlxu2', 0, 1, 0), (14, 'Nicky Larcin', 'ruppel.remi@gmail.com', '$2y$10$lQdx5Ut/LyoeyvEQLFUrcumnI1bHEch73Li.d9InfmjUUJidiRrdW', NULL, 'cho3c5wa-7hly-b1s5-ej2u-qo4yssd6ijhu', 0, 1, 0), (15, 'medhitest', 'admin@heolia.eu', '$2y$10$U9VzwXEllEdjrqBn1O7iIuv/CBlAIxLnaWEHcik55RkzfmIjmMZUK', NULL, 'vqezjvyw-nxki-4rsu-artq-kj0zy3pumvoi', 0, 1, 0), (16, 'toto', 'toto@titi.com', '$2y$10$mI6LXP67yD.QxYcroNUrC.L5uSFIDvFNhbxnxLR6T5hYis5Da5b8O', NULL, 'zw3wf7w2-8gia-ymmj-vw71-3k3he9pbh8og', 0, 1, 0), (17, 'tata', 'tata@tata.com', '$2y$10$0ZOMzrRQcpMpQNrH8smmkOtFUXb1mKJMXgNMf1gXND0PxTF2XEgv2', NULL, 'akp4wqf5-umyi-4400-tanz-7lzlbq7l677h', 0, 1, 0); -- -------------------------------------------------------- -- -- Structure de la table `room_list` -- CREATE TABLE `room_list` ( `id` int(11) NOT NULL, `name` varchar(20) DEFAULT NULL, `current_players` int(11) DEFAULT NULL, `max_players` int(11) DEFAULT NULL, `creator_user_id` char(36) CHARACTER SET utf8mb4 DEFAULT NULL, `list_players_room` int(11) NOT NULL, `statement` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Structure de la table `room_list_players` -- CREATE TABLE `room_list_players` ( `id` int(11) NOT NULL, `room_list` int(11) NOT NULL, `player_id` int(11) DEFAULT NULL, `isConnected` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Index pour les tables exportées -- -- -- Index pour la table `account` -- ALTER TABLE `account` ADD PRIMARY KEY (`id`,`name`,`email`,`password`,`userid`), ADD UNIQUE KEY `name` (`name`), ADD UNIQUE KEY `id` (`id`), ADD UNIQUE KEY `email` (`email`), ADD UNIQUE KEY `userid` (`userid`), ADD KEY `userid_2` (`userid`); -- -- Index pour la table `room_list` -- ALTER TABLE `room_list` ADD PRIMARY KEY (`id`), ADD KEY `list_players_room` (`list_players_room`), ADD KEY `creator_user_id` (`creator_user_id`); -- -- Index pour la table `room_list_players` -- ALTER TABLE `room_list_players` ADD PRIMARY KEY (`id`), ADD KEY `room_list` (`room_list`), ADD KEY `player_id` (`player_id`); -- -- AUTO_INCREMENT pour les tables exportées -- -- -- AUTO_INCREMENT pour la table `account` -- ALTER TABLE `account` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT pour la table `room_list` -- ALTER TABLE `room_list` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT pour la table `room_list_players` -- ALTER TABLE `room_list_players` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- Contraintes pour les tables exportées -- -- -- Contraintes pour la table `room_list` -- ALTER TABLE `room_list` ADD CONSTRAINT `creator_user_id` FOREIGN KEY (`creator_user_id`) REFERENCES `account` (`userid`), ADD CONSTRAINT `room_list_ibfk_1` FOREIGN KEY (`list_players_room`) REFERENCES `room_list_players` (`room_list`); -- -- Contraintes pour la table `room_list_players` -- ALTER TABLE `room_list_players` ADD CONSTRAINT `room_list_players_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `account` (`id`); /*!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
1882b8b45e407abe0329cbf3452439864e482d23
SQL
saagie/technologies
/technologies/app/saagie-usage-monitoring/saagie-usage-monitoring-3.0/infra.sql
UTF-8
2,293
2.9375
3
[ "Apache-2.0" ]
permissive
create TABLE IF NOT EXISTS supervision_saagie ( supervision_timestamp TIMESTAMP, project_id VARCHAR(60), project_name VARCHAR(250), orchestration_type VARCHAR(10), orchestration_id VARCHAR(60), orchestration_name VARCHAR(250), instance_id VARCHAR(60), instance_start_time TIMESTAMP, instance_end_time TIMESTAMP, instance_status VARCHAR(30), instance_duration BIGINT, instance_saagie_url VARCHAR(250), PRIMARY KEY (project_id,orchestration_id, instance_id) ); create TABLE IF NOT EXISTS supervision_saagie_jobs ( project_id VARCHAR(60), project_name VARCHAR(250), creation_date TIMESTAMP, orchestration_type VARCHAR(10), orchestration_category VARCHAR(60), orchestration_id VARCHAR(60), orchestration_name VARCHAR(250), instance_count INT, technology VARCHAR(60), PRIMARY KEY (project_id, orchestration_id) ); create TABLE IF NOT EXISTS supervision_saagie_apps ( project_id VARCHAR(60), project_name VARCHAR(250), orchestration_type VARCHAR(10), orchestration_id VARCHAR(60), orchestration_name VARCHAR(250), creation_date TIMESTAMP, current_status VARCHAR(20), start_time TIMESTAMP, stop_time TIMESTAMP, technology VARCHAR(60), PRIMARY KEY (project_id, orchestration_id) ); create TABLE IF NOT EXISTS supervision_saagie_jobs_snapshot ( project_id VARCHAR(60), project_name VARCHAR(250), snapshot_date DATE, job_count INT, PRIMARY KEY (snapshot_date, project_id) ); create TABLE IF NOT EXISTS supervision_datalake ( supervision_date DATE, supervision_label VARCHAR(60), supervision_value NUMERIC(20, 2), PRIMARY KEY (supervision_date, supervision_label) ); create TABLE IF NOT EXISTS supervision_s3 ( supervision_date DATE, supervision_label VARCHAR(120), supervision_namespace VARCHAR(120), supervision_value NUMERIC(20, 2), PRIMARY KEY (supervision_date, supervision_label,supervision_namespace) );
true
98fbf070bb46a614a5047b8d44d36cb3eefd6842
SQL
Egor18032019/GeekbrainsVTB
/less16/less16_dz/src/main/resources/db/migration/V2__add_product.sql
UTF-8
553
2.640625
3
[]
no_license
CREATE TABLE products ( id serial PRIMARY KEY, title VARCHAR(100), price NUMERIC(8, 2) ); INSERT INTO products (title, price) VALUES ('Bread', 45), ('Bread', 47), ('Bread', 50), ('Bread', 55), ('Bread', 52), ('Milk', 60), ('Milk', 70), ('Milk', 50), ('Milk', 45), ('Milk', 55), ('Meat', 260), ('Meat', 270), ('Meat', 290), ('Meat', 275), ('Meat', 265), ('Cheese', 640), ('Cheese', 650), ('Cheese', 440), ('Cheese', 590), ('Cheese', 750), ('Tea', 130), ('Tea', 160), ('Tea', 140), ('Tea', 145), ('Tea', 170);
true
ee1b6b6f8434fb5cbeba0c80580cbba45a3685d3
SQL
weiivy/wxjifen
/jifen_2018-06-10.sql
UTF-8
10,123
3.0625
3
[]
no_license
# ************************************************************ # Sequel Pro SQL dump # Version 4096 # # http://www.sequelpro.com/ # http://code.google.com/p/sequel-pro/ # # Host: 127.0.0.1 (MySQL 5.7.19) # Database: jifen # Generation Time: 2018-06-10 02:33:16 +0000 # ************************************************************ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_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 */; # Dump of table pay_back_result # ------------------------------------------------------------ CREATE TABLE `pay_back_result` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mch_id` varchar(100) DEFAULT '' COMMENT '微信支付商户号', `mch_appid` varchar(100) DEFAULT '' COMMENT '公众账号ID', `partner_trade_no` varchar(100) DEFAULT '' COMMENT '商户订单号', `payment_no` varchar(255) NOT NULL DEFAULT '' COMMENT '微信订单号', `payment_time` varchar(50) NOT NULL DEFAULT '0' COMMENT '企业付款成功时间', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '录入时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table pay_wxpay # ------------------------------------------------------------ CREATE TABLE `pay_wxpay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mch_id` varchar(50) NOT NULL DEFAULT '' COMMENT '微信支付商户号', `appid` varchar(100) NOT NULL DEFAULT '' COMMENT '公众号APPID', `key` varchar(100) NOT NULL DEFAULT '' COMMENT 'api key', `status` int(11) NOT NULL DEFAULT '2' COMMENT '状态', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '录入时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table pay_wxpay_result # ------------------------------------------------------------ CREATE TABLE `pay_wxpay_result` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mch_id` varchar(100) DEFAULT '' COMMENT '微信支付商户号', `appid` varchar(100) DEFAULT '' COMMENT '公众账号ID', `out_trade_no` varchar(100) DEFAULT '' COMMENT '订单号', `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '用户唯一标识', `transaction_id` varchar(255) NOT NULL DEFAULT '' COMMENT '微信支付交易号', `total_fee` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '付款金额', `time_end` varchar(50) NOT NULL DEFAULT '0' COMMENT '支付时间', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '录入时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; # Dump of table pre_bank # ------------------------------------------------------------ CREATE TABLE `pre_bank` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bank` varchar(20) NOT NULL DEFAULT '' COMMENT '银行缩写', `bank_name` varchar(100) NOT NULL DEFAULT '' COMMENT '银行名称', `status` tinyint(2) NOT NULL DEFAULT '10' COMMENT '状态 10 正常 20 删除', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_bank` (`bank`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='银行'; # Dump of table pre_bank_config # ------------------------------------------------------------ CREATE TABLE `pre_bank_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bank_id` int(10) NOT NULL COMMENT '银行id', `type` tinyint(2) NOT NULL DEFAULT '10' COMMENT '类型 10 合伙人 20 代理 30 股东', `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额', `score` int(11) NOT NULL DEFAULT '0' COMMENT '积分', `status` tinyint(2) NOT NULL DEFAULT '10' COMMENT '状态 10 正常 20 删除', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `index_bank_id` (`bank_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='银行兑换比例'; # Dump of table pre_capital_details # ------------------------------------------------------------ CREATE TABLE `pre_capital_details` ( `id` int(11) NOT NULL AUTO_INCREMENT, `member_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员ID', `type` varchar(2) NOT NULL DEFAULT '+' COMMENT '符号', `kind` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '交易类别:10 充值、20 提成、30 升级返现、40 提现', `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额', `status` int(11) NOT NULL DEFAULT '2' COMMENT '状态', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_member_id` (`member_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='资金明细表'; # Dump of table pre_contact # ------------------------------------------------------------ CREATE TABLE `pre_contact` ( `id` int(11) NOT NULL AUTO_INCREMENT, `openid` varchar(50) NOT NULL DEFAULT '' COMMENT '用户标识', `nickname` varchar(500) NOT NULL DEFAULT '' COMMENT '昵称', `sex` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '性别', `province` varchar(64) DEFAULT NULL COMMENT '用户个人资料填写的省份', `country` varchar(32) DEFAULT NULL COMMENT '国家,如中国为CN', `city` varchar(64) DEFAULT NULL COMMENT '普通用户个人资料填写的城市', `head_image` varchar(255) NOT NULL DEFAULT '' COMMENT '头像', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_openid_id` (`openid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公众号粉丝'; # Dump of table pre_member # ------------------------------------------------------------ CREATE TABLE `pre_member` ( `id` int(11) NOT NULL AUTO_INCREMENT, `password_hash` varchar(255) NOT NULL DEFAULT '' COMMENT '密码', `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '用户唯一标识', `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称', `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像', `mobile` varchar(255) NOT NULL DEFAULT '' COMMENT '手机', `password_salt` varchar(13) NOT NULL DEFAULT '' COMMENT 'Auth Key', `password_reset_token` varchar(255) NOT NULL DEFAULT '' COMMENT '重置密码Token', `mobile_check_token` varchar(255) NOT NULL DEFAULT '' COMMENT '手机验证Token', `status` tinyint(3) unsigned NOT NULL DEFAULT '10' COMMENT '状态', `grade` int(1) NOT NULL DEFAULT '1' COMMENT '会员等级 1 会员 2 代理 3 股东', `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额', `pid` int(11) NOT NULL DEFAULT '0' COMMENT '父级', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), UNIQUE KEY `openid` (`openid`), KEY `ind_nickname` (`nickname`), KEY `ind_mobile` (`mobile`), KEY `ind_openid` (`openid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员表'; # Dump of table pre_order # ------------------------------------------------------------ CREATE TABLE `pre_order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `out_trade_no` varchar(32) DEFAULT '' COMMENT '订单号', `member_id` int(11) NOT NULL DEFAULT '0' COMMENT '下单人', `bank_id` int(10) NOT NULL COMMENT '银行id', `integral` int(11) NOT NULL DEFAULT '0' COMMENT '使用积分', `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '兑换金额', `exchange_code` varchar(255) DEFAULT '' COMMENT '兑换码', `valid_time` date DEFAULT NULL COMMENT '有效日期', `remark` text COMMENT '备注', `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_out_trade_no` (`out_trade_no`), KEY `ind_member_id` (`created_at`,`member_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='报单订单表'; # Dump of table pre_order_photo # ------------------------------------------------------------ CREATE TABLE `pre_order_photo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID', `image` varchar(255) NOT NULL DEFAULT '' COMMENT '图片地址', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_order_id` (`order_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='报单图片'; # Dump of table pre_user # ------------------------------------------------------------ CREATE TABLE `pre_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL DEFAULT '', `password_hash` varchar(255) NOT NULL DEFAULT '', `password_reset_token` varchar(255) NOT NULL DEFAULT '', `email` varchar(255) NOT NULL DEFAULT '', `status` tinyint(3) unsigned NOT NULL DEFAULT '0', `login_at` int(11) NOT NULL DEFAULT '0' COMMENT '登录时间', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '新增时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `ind_username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_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 */;
true
fb1281f26702f3c232186c4cdc125c15e515eaf2
SQL
moravianlibrary/RecordManager2
/cz.mzk.recordmanager.server/src/main/resources/job/dedupRecordsJob/UniqueRecordsDedup.sql
UTF-8
539
3.875
4
[]
no_license
WITH records AS ( SELECT id harvested_record_id, nextval('dedup_record_seq_id') dedup_record_id, NOW() updated FROM harvested_record WHERE dedup_record_id IS NULL AND id > ? ORDER BY id LIMIT 2000 ), ins AS (INSERT INTO dedup_record(id, updated) SELECT dedup_record_id, updated FROM records), upd AS (UPDATE harvested_record SET dedup_record_id = (SELECT dedup_record_id FROM records WHERE records.harvested_record_id = id) WHERE id IN (SELECT harvested_record_id FROM records)) SELECT MAX(harvested_record_id) FROM records;
true
09a0f9a81d19d49ae6f710c7a480274497cbc13b
SQL
AlexVilla92/Proyecto-SQL-
/sql/distinct_top.sql
UTF-8
817
3.640625
4
[]
no_license
/* compute: un buen ejemplo seria, tener una base de datos de productos de un supermercado y abajo de todo ver el precio minimo y la suma de todos los productos comprados*/ select *from usuarios select min(nombre), sum(edad) from usuarios where (sexo = 'f') group by rollup(nombre) /* distinct eleimina de la consulta las repeticiones*/ select *from usuarios select distinct nombre from usuarios order by nombre /*no repite las edades*/ select distinct edad from usuarios order by edad select count(edad) from usuarios /* hay 31 edades*/ select count(distinct edad) from usuarios /* solo hay 9 tipos de edades*/ /* top */ select top 10 * from usuarios order by edad desc /*dame el registro del empleado mas joven*/ select top 2 *from usuarios order by edad asc
true
e11265e9df78c550dfd6d6de0cbfd46f04f3475d
SQL
LakePeterson/CS_340
/Program_2/queryThree.sql
UTF-8
902
4.21875
4
[]
no_license
-- Find the first_name, last_name and total_combined_film_length of Sci-Fi films for every actor. -- That is the result should list the names of all of the actors(even if an actor has not been in any Sci-Fi films) and the total length of Sci-Fi films they have been in. -- Look at the category table to figure out how to filter data for Sci-Fi films. -- Order your results by the actor_id in descending order. -- Put query for Q3 here SELECT actor.actor_id, actor.first_name, actor.last_name, SUM(IFNULL(film.length, 0)) as total_combined_film_length FROM actor JOIN film_actor ON actor.actor_id = film_actor.actor_id JOIN film_category ON film_actor.film_id = film_category.film_id JOIN category ON film_category.category_id = category.category_id LEFT JOIN film ON film_actor.film_id = film.film_id AND category.category_id = 14 #can be replaced with a subquery GROUP BY actor.actor_id DESC
true
fab1425efc5618d6ec876d7ce0baa1279ef83e8f
SQL
MetadataResearchCenter/HiveFoundationRebuild
/database/concepts.sql
UTF-8
942
3.546875
4
[]
no_license
DROP TABLE IF EXISTS CONCEPT; DROP TABLE IF EXISTS BROADERS; DROP TABLE IF EXISTS RELATED; CREATE TABLE CONCEPT (ConceptURI VARCHAR(100) NOT NULL, PrefLabel VARCHAR(100) NOT NULL, AltLabel VARCHAR(100), ScopeNotes VARCHAR(500), TopConcept INTEGER DEFAULT '0', PRIMARY KEY (ConceptURI)); CREATE TABLE BROADERS (ConceptURI VARCHAR(100) NOT NULL, BroaderThanURI VARCHAR(100) NOT NULL, PRIMARY KEY (ConceptURI, BroaderThanURI), FOREIGN KEY (ConceptURI) REFERENCES CONCEPT(ConceptURI), FOREIGN KEY (BroaderThanURI) REFERENCES CONCEPT(ConceptURI)); CREATE TABLE RELATED (ConceptURI VARCHAR(100) NOT NULL, RelatedURI VARCHAR(100) NOT NULL, PRIMARY KEY (ConceptURI, RelatedURI), FOREIGN KEY (ConceptURI) REFERENCES CONCEPT(ConceptURI), FOREIGN KEY (RelatedURI) REFERENCES CONCEPT(ConceptURI));
true
c70bb09acdb5021c3fd9c378737ded0c4583df9d
SQL
jankney2/pitchvivid
/db/adminNotesCtrl/getAll.sql
UTF-8
552
3.5625
4
[]
no_license
select job_users.job_id, admin_notes.notes, users.first_name as firstName, users.last_name as lastName, job_users.video_url, admin_notes.liked, admin_notes.disliked, job_users.user_id as userId, users.email, users.resume from job_users left join admin_notes on admin_notes.user_id = job_users.user_id left join users on users.id = job_users.user_id where job_users.job_id = ${job_id} and job_users.user_id not in (select user_id from blocked_users) and job_users.user_id not in (select user_id from annoying_users where admin_id = ${admin_id});
true
5e13b885744497c04e0484582f2db34cfc7b462a
SQL
neostreet/poker_session_data
/count_ge_1000000c_by_year.sql
UTF-8
316
3.015625
3
[]
no_license
use poker select left(poker_session_date,4),sum(delta >= 1000000) count1,sum(delta * (delta >= 1000000)) sum1, sum(delta < 1000000) count2,sum(delta * (delta < 1000000)) sum2, count(*) count3,sum(delta) sum3 from poker_sessions_summary group by left(poker_session_date,4) order by left(poker_session_date,4); quit
true
5e104d992e27d1c16e69f5e60d412197c189583f
SQL
wangxw2008168/DynamicConfigCenter
/sql/schema.sql
UTF-8
3,411
3.5
4
[ "Apache-2.0" ]
permissive
CREATE DATABASE IF NOT EXISTS dcc DEFAULT CHARSET utf8mb4; CREATE TABLE dcc_group ( id bigint(20) unsigned AUTO_INCREMENT NOT NULL COMMENT '主键id', created_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', modified_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', version smallint(6) NOT NULL DEFAULT 1 COMMENT '版本号', name varchar(255) NOT NULL COMMENT '组名', `desc` varchar(255) NOT NULL COMMENT '描述', PRIMARY KEY pk_id(id), INDEX idx_name(name) ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '配置组,可以以应用作为组'; CREATE TABLE dcc_env ( id bigint(20) unsigned AUTO_INCREMENT NOT NULL COMMENT '主键id', created_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', modified_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', version smallint(6) NOT NULL DEFAULT 1 COMMENT '版本号', name varchar(255) NOT NULL COMMENT 'env名', `desc` varchar(255) NOT NULL COMMENT '描述', PRIMARY KEY pk_id(id), INDEX idx_name(name) ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '环境,区分开发、测试等环境'; CREATE TABLE dcc_config ( id bigint(20) unsigned AUTO_INCREMENT NOT NULL COMMENT '主键id', created_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', modified_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', version smallint(6) NOT NULL DEFAULT 1 COMMENT '版本号', `key` varchar(255) NOT NULL COMMENT '配置key', type smallint(6) NOT NULL COMMENT '类型 1-String 2-Number 3-Json', `desc` varchar(255) NOT NULL COMMENT '描述', group_id bigint(20) NOT NULL COMMENT '所属组id', PRIMARY KEY pk_id(id), INDEX idx_key(`key`), INDEX idx_group_id(group_id) ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '配置'; CREATE TABLE dcc_config_inst ( id bigint(20) unsigned AUTO_INCREMENT NOT NULL COMMENT '主键id', created_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', modified_time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', version smallint(6) NOT NULL DEFAULT 1 COMMENT '版本号', config_id bigint(20) NOT NULL COMMENT '配置id', env_id bigint(20) NOT NULL COMMENT '环境id', value varchar(255) NOT NULL COMMENT '配置值', PRIMARY KEY pk_id(id), INDEX idx_config_env_id(config_id, env_id) ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = '配置实例,不同环境的配置值';
true
94d504eeb48d942515c2bc1e87080f6fe9af08ea
SQL
uma5958/MySQL-Workbench
/CC/CC1.sql
UTF-8
25,354
4.09375
4
[]
no_license
use cc; -- To select required database show databases; -- To verify all databases available create database Test; -- To create a new database drop database Test; -- To drop database show tables; -- To see list of tables of database select user(); -- To see user information select database(); -- To see current database information commit; -- To update the databse -- Datatypes -- Integer values => INT, BRIGHT, LONG -- Floating Values => FLOAT, DOUBLE -- Alphanumeric => CHAR(N), VARCHAR(N), TEXT -- Date => DATE (YYYY-MM-DD) -- Large Documents => CLOB -- Binary Files(mp3, images, video clips) => BLOB, LONG BLOB -- Curd Operation -- C - Creating the records(insert) -- U - Updating the records(update) -- R - Reading the records(select) -- D - Deleting the records(delete) -- Creating tables create table Students( sid int, sname varchar(15), email varchar(30), phone long, fee float, dob date ); select * from Students; -- To see crated table describe Students; -- To see all table fields information -- or desc Students; commit; -- To update database -- Inserting Data into tables insert into Students values(101, 'Srinivas', 'sri@jlc.com', 8737837487, 99999.99, '1990-03-12'); insert into Students values(102, 'Dande', 'vas@jlc.com', 8737837487, 500, '1999-01-12'); -- If you want to insert data into some of the columns only or in different order then we have to follow this format insert into Students(sid, sname) values(102, 'Srinivas'); insert into Students(sname, email, phone) values('Sri', 'Sri@jlc.com', 878787); select * from Students; -- Updating records of Table update Students set phone=999999 where email='sri@jlc.com'; select * from Students; update Students set fee=20000.0, dob='1988-01-12' where sid=101; select * from Students; update Students set fee=20000.0 where email is null; select * from Students; update Students set fee=15000.0 where email is not null; select * from Students; update Students set fee=15000.0; -- Update all records without condition(without where) select * from Students; -- Deleting records of Table delete from Students where email='sri@jlc.com'; select * from Students; delete from Students where phone=657999 and fee=18000; select * from Students; delete from Students where email is null; select * from Students; delete from Students where email is not null; select * from Students; delete from Students; -- All records will be deleted(if we don't write condition) select * from Students; -- SQL Operators drop table Students; -- Deleting table create table Student( sid varchar(20), sname varchar(15), email varchar(30), fee float, city varchar(30) ); select * from student; insert into student values('JLC-b1-001','sri','sri@gmail.com',15000,'blore'); insert into student values('JLC-b1-002','Nivas','nivas@gmail.com',12000,'hyd'); insert into student values('JLC-b1-003','Dande','dande@gmail.com',20000,'chennai'); insert into student values('JLC-b1-004','Raj','raj@gmail.com',30000,'blore'); insert into student values('JLC-b1-005','Kofel','kofel@gmail.com',40000,'pune'); select * from student; -- IN Operator => To match one value from collection of values select * from Student where city='Blore' or city='Pune' or city='Chennai'; select * from Student where city in ('Blore', 'Pune', 'Chennai'); -- BETWEEN Operator => To match values in specified range select * from Student where fee>=10000 and fee<=12000; select * from Student where fee between 10000 and 12000; -- LIKE Operator => To match value with specified pattern -- % (Occurance of zero or more characters) -- - (Occurance of only one character) select * from Student where sname='Sri'; select * from Student where sname like 'S%'; select * from Student where sname like '%s'; select * from Student where sname like '_i%'; select * from Student where sname like '%a_'; -- IS NULL Operator => To verify whether the column contain null value or not select * from student where email is null; select * from student where fee is not null; -- ============ Assignment 1 =========== create table book( bid varchar(30), bname varchar(30), author varchar(30), cost float, edi int, pub varchar(30), yop bigint, isbn varchar(20) ); insert into book values('B-002', 'Learn Java', 'Srinivas', 950, 2, 'PS', 2014, 'AB45DV41'); insert into book values('B-003', 'Learn ejb', 'dande', 1000, 2, 'tata', 2015, 'BB45DV41'); insert into book values('B-004', 'Learn c++', 'srini', 750, 2, 'jlc', 2016, 'CC45DV41'); insert into book values('B-005', 'master in Java', 'dk', 600, 2, 'CC', 2017, 'DD45DV41'); -- Display the complete info of books select * from book; -- Display the bookid, bookname, cost of all books select bid, bname, cost from book; -- Display the books published by jlc select * from book where pub='jlc'; -- Display the books written by the author whose name starts with 'Sri' select * from book where author like 'Sri%'; -- Display the books published in 2014 and written by author whose name ends with 'vas' select * from book where yop='2014' and author like '%vas'; -- Diplay the books published between 2014 and 2016 select * from book where yop between 2014 and 2016; -- Display the books published by 'jlc' in ascending order of cost select * from book where pub='jlc' order by cost; -- Diplay the books published in year 2014 in descending order of cost select * from book where yop='2014' order by cost desc; -- Display the books published by 'jlc', 'TATA' or 'PS' select * from book where pub in ('jlc','tata','ps'); -- Display the books written by author whose name 2nd character is 'r' select * from book where author like '_r%'; -- ===================================================================== -- Built-in Functions -- 1) Arithmetic Functions -- 2) String Functions -- 3) Conversion Functions -- 4) Date Functions -- 5) Aggregate Functions: SUM, MIN, MAX, AVG, COUNT create table emp( eid int, ename varchar(30), salary float ); insert into emp values(1, 'sri', 7000.0); insert into emp (eid, ename) values(2, 'vas'); insert into emp (eid, ename) values (3, 'srini'); insert into emp (eid, ename) values(4, 'mahi'); select * from emp; -- Total no.of records for specified column which contains value select count(eid) from emp; select count(salary) from emp; -- Total no.of records valailable in table irrespective of data select count(*) from emp; -- Total no.of unique records select count(distinct ename) from emp; -- Group by and Having Clause -- Group clause is used to devide the table into multiple groups based on soecified column -- Having clause is used to specify the condition on group create table studentstable( sid int, sname varchar(30), course varchar(30), totfee int, feepaid int, feebal int, branch varchar(30), city varchar(20) ); insert into studentstable values(1, 'Srinivas', 'FC', 18000, 10000, 8000, 'MKR', 'Blore'); insert into studentstable values(2, 'Dande', 'Core Java', 5000, 5000, 0, 'BTM', 'Pune'); insert into studentstable values(3, 'Manish', 'Android', 8000, 4000, 4000, 'MHA', 'Delhi'); insert into studentstable values(4, 'DK', 'Hadoop', 18000, 9000, 9000, 'MKR', 'Blore'); insert into studentstable values(5, 'Rajbeer', 'Android', 8000, 5000, 3000, 'BTM', 'Pune'); insert into studentstable values(6, 'Firoj', 'Hadoop', 20000, 15000, 5000, 'MKR', 'Blore'); insert into studentstable values(7, 'Kofel', 'Android', 8000, 2000, 6000, 'BTM', 'Delhi'); select * from studentstable; -- Display the branch wise fee collection, display branch as 'Branch Name' and sum of feepaid as 'Total Collection' select branch as 'Branch Name', sum(feepaid) from studentstable group by branch; -- Display city wise fee balance, display city as 'City Name' and totbal as 'Total Balance' select city as 'City Name', sum(feebal) as 'Total Balance' from studentstable group by city; -- Display city wise fee collection, display city as 'City Name' and sum of fee paid as 'Total Collection' for the cities Pune & Blore select city as 'City Name', sum(feepaid) as 'Total Collection' from studentstable where city in ('Pune', 'Blore') group by city; -- Display the total no.of students joined for the individual courses select course as 'Course', count(sid) from studentstable group by course; -- Constraints => Rules will be applied on the column of the table -- 1) NOT NULL Coinstraint -- 2) UNIQUE Constraint -- 3) PRIMARY KEY Constraint -- 4) FOREIGN KEY Contraint -- 5) DEFAULT Constraint -- 6) CHECK Constraint -- 1) NOT NULL Contraint => If you don't want NULL value for any column, you can use NOT NULL Constraint on that column create table emp1( eid int, ename varchar(15) not null, email varchar(25) not null ); insert into emp1(eid) values(1); -- 2) UNIQUE Constraint => By default you insert duplicate value in any column, -- if you applied UNIQUE constarint you can't insert duplicate value but you can insert NULL value -- UNIQUE constraint acn be used in combination with NOT NULL also create table emp2( eid int, ename varchar(15), phone long, salary float ); insert into emp2 values(1, 'A', 983274983, 9000.0); insert into emp2 values(1, 'A', 983274983, 9000.0); create table emp3( eid int unique not null, ename varchar(15) unique, phone int unique, -- Key column cann't be of LONG datatype i.e phone long unique email varchar(30) unique ); -- 3) PRIMARY KEY Constraint => Conbination of UNIQUE and NOT NULL constraint are called as Primary key -- Table should contain only one Primary Key -- Primary key is used to identify the records uniquely in a table -- When you apply primary key both unique and not null constraint will be applied on the column -- Type of Primary Key: -- a) Simple Primary Key => When you specify one column of a table as Primary Key then it is called as Simple Primary Key -- b) Composite Primary Key => When you specify more than one column of a table as Primary Key then it is called as Simple Primary Key create table PK_Simple( oid int primary key, itemname varchar(10) not null, qty int, price int, total int ); create table PK_Composite( bcode int, atype int, acno int, bal float, primary key(bcode, atype, acno) ); -- 4) FOREIGN KEY Contraint => Used to establish the relationship between two or more tables -- The table which contains the main informatio is called master table -- The table which contains the related information is called child table -- When inserting data in child table, will be verified by DBMS in parent table -- When deleting data from parent table, related information from child table also will be updated -- You can manually delete the from child table first then from parent table or you can instruct the DBMS to do it automatically -- by using following option: ON DELETE <option> -- a) ON DELETE <CASCADE> -- This will deletes the child table information automatically when you are deleting information from parent table -- Ex: ACCOUNTS TABLE -- b) ON DELETE <SET NULL> -- This will set the NULL value in child table when you are deleting the information from parent table -- Ex: TRANSACTIONS TABLE create table customers( cid int primary key, cname varchar(10), email varchar(15), phone int ); create table accounts( cid int, bcode int, atype int, acno int, bal float, primary key(bcode, atype, acno), foreign key(cid) references customers(cid) on delete cascade ); create table transactions( bcode int, atype int, acno int, tx_date date, tx_type char(2), amt float, tx_id int primary key, foreign key(bcode, atype, acno) references accounts(bcode, atype, acno) on delete set null ); insert into customers values(101, 'uma', 'uma@gmail.com', 5958); insert into customers values(102, 'sri', 'sri@gmail.com', 5957); insert into customers values(103, 'dande', 'dande@gmail.com', 5956); insert into customers values(104, 'hello', 'hello@gmail.com', 5951); insert into customers values(105, 'krish', 'krish@gmail.com', 5954); select * from customers; insert into accounts values(101, 111, 1, 1122, 10000); insert into accounts values(102, 112, 2, 1122, 15000); insert into accounts values(103, 113, 3, 1122, 1000); insert into accounts values(104, 114, 4, 1122, 900); insert into accounts values(105, 115, 5, 1122, 500); select * from accounts; insert into transactions values(111, 1, 1122, '2017-08-01', 'c', 1000, 123); insert into transactions values(112, 2, 1122, '2017-08-02', 'c', 1000, 124); insert into transactions values(113, 3, 1122, '2017-08-02', 'w', 500, 125); insert into transactions values(114, 4, 1122, '2017-08-03', 'n', 200, 126); insert into transactions values(115, 5, 1122, '2017-08-03', 'w', 500, 127); select * from transactions; delete from customers where cid=105; -- Deleting row from customers, deletes row from accounts and deletes, replace data with NULL in transactions select * from customers; select * from accounts; select * from transactions; -- 5) DEFAULT Constraint -- By default NULL will be the default value for all the columns -- Default constraint can be used to supply other than NULL value as default value -- If you supply value for all columns then your value will be inserted otherwise default value will be inserted create table emp4( eid int, ename varchar(10), salary float, city varchar(15) default 'Bangalore', country varchar(15) default 'India', age int default 99 ); insert into emp4 values(1, 'A', '8000.0', 'Patna', 'Srilanka', 77); insert into emp4(eid, ename, salary, age) values(1, 'A', '8000.0', 77); select * from emp4; -- 6) CHECK Constraint -- Check constarint used to design user defined rules -- When you are developing any web application then you will get the requirements to design your own constraints like, -- * Student ID must starts with JLC- -- * Age of student must be greater than 18 -- * Email ID of student must be from yahoo domain only -- * For saving account customer bal should not be less than 500. etc. -- NOTE: Only Oracle supports check constarint (MySQL doesn't supports check constraint) -- Syntax: <COL_NAME> CHECK(<CONDITION>); create table emp4( sid varchar(20) check(sid like 'JLC-%'), sname varchar(20) not null, email varchar(20) check(email like '%@jlc.com'), age int check(age >= 20), fee float check(fee >= 2000) ); insert into emp4 values('JLC-123', 'Dharmedra', 'dk@facebook.com', 99, 2000); -- MySQL doesn't supports check constraint -- JOINS: -- If you want to access data from more than one table at a time then you can use join -- While you are joining tables there should be some common columns available to specify join condition -- Types of JOIN: -- 1) Inner Join -- 2) Outer Join -- a) Left Outer Join -- b) Right Outer Join -- c) Full Outer Join -- 3) Self Join -- 4) Cross Join create table jlcstud( sid int primary key, name varchar(12), email varchar(50) ); insert into jlcstud values(101, 'sri', 'sri@gmail.com'); insert into jlcstud values(102, 'nivas', 'nivas@gmail.com'); insert into jlcstud values(103, 'dande', 'dande@gmail.com'); insert into jlcstud values(104, 'vas', 'vas@gmail.com'); create table jlcfee( fid int primary key, fee float, sid int ); insert into jlcfee values(1, 13500, 101); insert into jlcfee values(2, 12000, 102); insert into jlcfee values(3, 15000, 103); insert into jlcfee values(4, 15000, 104); create table jlcadd( aid int primary key, location varchar(15), sid int ); insert into jlcadd values(11, 'hyd', 101); insert into jlcadd values(22, 'bng', 102); insert into jlcadd values(33, 'mum', 103); insert into jlcadd values(44, 'chn', 104); -- Inner Join: -- Inner join is also called as Equi Join -- Inner join will give you the matching records from joined table select * from jlcstud; select * from jlcfee; select * from jlcadd; select * from jlcstud, jlcfee where jlcstud.sid = jlcfee.sid; -- To display all column as per the given condition select st.sid, st.name, st.email, fe.fee from jlcstud st, jlcfee fe where st.sid = fe.sid; -- To display selected columns as per the given condition select * from jlcstud, jlcfee, jlcadd where jlcstud.sid = jlcfee.sid and jlcstud.sid = jlcadd.sid; -- To display all columns from all(3) tables select st.sid, st.name, st.email, fe.fee, ad.location from jlcstud st, jlcfee fe, jlcadd ad where st.sid = fe.sid and st.sid = ad.sid; -- To display selected columns from 3 days select * from jlcstud inner join jlcfee on jlcstud.sid = jlcfee.sid; -- Joins all columns select * from jlcstud inner join jlcfee using(sid); -- Same column will not repeat select * from jlcstud natural join jlcfee; -- Same as above(Same column will not repeat) -- Left Outer Join: -- Left Outer Join gives matching records from joined table + rceords remains in the left side table select * from jlcstud left join jlcfee on jlcstud.sid = jlcfee.sid; -- matching + remaining from left(1st table) select * from jlcstud left outer join jlcfee on jlcstud.sid = jlcfee.sid; -- Same result as above select * from jlcstud left outer join jlcfee using(sid); -- Common column will not repeat(Remaining is same as above) -- Right Outer Join -- Right Outer Join will give matching records from joined table + records remains in the Right side table -- Matching + Remaining in right(2nd table) select * from jlcstud right join jlcfee on jlcstud.sid = jlcfee.sid; -- Joins Matching + Remaining in right(2nd table) select * from jlcstud right outer join jlcfee on jlcstud.sid = jlcfee.sid; -- Same as above result select * from jlcstud right outer join jlcfee using(sid); -- Common column will not repeat -- Full Outer Join -- It will gives matching recirds from joined tables + records remaining in the left side table + records remaining in the right side table -- Matching + remaining from left(1st table) + remaining from right(2nd table) select * from jlcstud left join jlcfee on jlcstud.sid = jlcfee.sid union select * from jlcstud right join jlcfee on jlcstud.sid = jlcfee.sid; -- Self Join -- Joining the table to itself is called as self join -- Slef join is same as any other join, but in this join multiple instances of same table will participate in the join query create table emp5( eid int, ename varchar(12), mgrid int ); insert into emp5 values(101, 'Sri', 103); insert into emp5 values(102, 'Nivas', 103); insert into emp5 values(103, 'Dande', 104); insert into emp5 values(104, 'Vas', 101); select emp.ename as "Employee Name", mgr.ename as "Manager Name" from emp5 emp, emp5 mgr where emp.eid = mgr.mgrid; -- Cross Join: -- When you are not providing condition in join query then it will gives the cartiasian product of joined table called as cross join -- Self Join without condition = Cross Join select emp.ename as "Employee Name", mgr.ename as "Manager Name" from emp5 emp, emp5 mgr; -- NOTE: -- OUTER: -- Left Outer = Matching + Remaining from left(1st table) -- Right Outer = Matching + remaining from right(2nd table) -- Full Outer = Matching + Remaining from left(1st table) + Remaining from right(2nd table) -- Self Join without condition = Cross Join -- A NATURAL JOIN is one where the column names are the same. The data type need not be the same. -- The fields used for an INNER JOIN need not have the same name. -- NATURAL JOIN: natural join, where -- INNER JOIN: inner join, on -- ================ Joins Assignment ================= create table customers1( cid int primary key, cname varchar(15), email varchar(15), phone long, status varchar(15) ); insert into customers1 values(101, 'sri', 'sri@jlc.com', 6579999, 'Active'); insert into customers1 values(102, 'vas', 'vas@jlc.com', 31903290, 'Active'); insert into customers1 values(103, 'Manish', 'manish@jlc.com', 98745856, 'Inactive'); create table accounts1( cid int primary key, acno int, atype varchar(15), bal int ); insert into accounts1 values(101, 123, 'Savings', 9000); insert into accounts1 values(102, 124, 'Current', 9700); insert into accounts1 values(103, 125, 'Fixed', 8500); create table address( cid int primary key, street varchar(50), city varchar(30), country varchar(30) ); insert into address values(101, 'HMT Main', 'Bangalore', 'India'); insert into address values(102, 'ACR Green', 'Pune', 'India'); -- 1) Display the cname, email, acno, bal of all the customers select cname, email, acno, bal from customers1, accounts1 where customers1.cid = accounts1.cid; -- where -- or select cname, email, acno, bal from customers1 inner join accounts1 on customers1.cid = accounts1.cid; -- inner join, on -- or select cname, email, acno, bal from customers1 inner join accounts1 using(cid); -- inner join, using -- or select cname, email, acno, bal from customers1 natural join accounts1; -- natural join: natural join avoids repeated columns -- 2) Display cname, email, status, city, country of all the customers select cname, email, status, city, country from customers1 left join address on customers1.cid = address.cid; -- left join, on -- or select cname, email, status, city, country from customers1 left join address using(cid); -- left join, using -- or select cname, email, status, city, country from customers1 natural left join address; -- natural left join -- 3) Display cname, email, acno, bal of all customers who are having savings account select cname, email, acno, bal from customers1 natural join accounts1 where atype='savings'; -- natural join, where -- or select cname, email, acno, bal from customers1 inner join accounts1 on customers1.cid = accounts1.cid and atype='savings'; -- inner join, on -- 4) Display cname, status, city, country of customers who is staying in Bangalore and are active select cname, status, city, country from customers1 natural join address where city='Bangalore' and status='Active'; -- natural join, where -- 5) Display acno, atype, bal city of the customers who have current a/c and bal between 8000 & 50000 and staying in Bangalore and Pune select acno, atype, bal, city from accounts1 natural left join address where atype='Current' and bal between 8000 and 50000 and city in ('Bangalore', 'Pune'); -- natural left join, where, between, in -- 6) Display cname, status, acno, bal, city and country of all customers select cname, status, acno, bal, city, country from customers1 natural join accounts1 natural left join address; -- natural join, natural left join -- 7) Display cname, status, acno, bal, city and country of customers who are deactivated and bal < 1000 and not staying in india select cname, status, acno, bal, city, country from customers1 natural join accounts1 natural left join address where status='inactive' and bal <1000 and country not in ('india'); -- natural join, natural left join, where, not in -- Sub Queries: -- When you include one query as a part of another query tehn it is called as subquery -- First sub query will be evaluated and depending on the result returned by subquery main query will be executed -- Depending on the condition provided in subquery it may retured zero or more results -- When subquery is returning exactly one record then you can use = oprerator to assign the results of subquery to main query -- When subquery is returning more than one records then you can use IN operator to assign the results of subquery to main query -- ======= Assignment 3 ======== create table student1( sid int primary key, sname varchar(20), email varchar(20), phone long ); insert into student1 values(101, 'Sri', 'sri@jlc.com', 9999); insert into student1 values(102, 'Manish', 'manish@jlc.com', 8989); insert into student1 values(103, 'Dande', 'dande@jlc.com', 9898); insert into student1 values(104, 'Nivas', 'nivas@jlc.com', 9988); create table address1( sid int primary key, street varchar(20), city varchar(20) ); insert into address1 values(101, 'Street1', 'Blore'); insert into address1 values(102, 'Street2', 'Pune'); insert into address1 values(103, 'Street3', 'Delhi'); insert into address1 values(104, 'Street4', 'Goa'); create table fee( sid int primary key, feepaid varchar(20), dop date ); insert into fee values(101, 10000, '2000-02-12'); insert into fee values(102, 15000, '1995-03-20'); insert into fee values(103, 20000, '2014-10-20'); insert into fee values(104, 25000, '2018-08-25'); select * from student1; select * from address1; select * from fee; -- 1) Diplay the name of student whose email is 'sri@jlc.com' select sname from student1 where email='sri@jlc.com'; -- 2) Display the name of the student whose phone is 9999 select sname from student1 where phone=9999; -- 3) Display the student information who is from Blore city select * from student1 where sid=(select sid from address1 where city='Blore'); -- or select * from student1 where sid in (select sid from address1 where city='Blore'); -- 4) Display the city of the student whose email is 'manish@jlc.com' select city from address1 where sid=(select sid from student1 where email='manish@jlc.com'); -- 5) Display the student information who has paid fee on 2014-10-20 select * from student1 where sid=(select sid from fee where dop='2014-10-20'); -- 6) Display the student information whose fee is between 15000 20000 select * from student1 where sid in(select sid from fee where feepaid between 15000 and 20000); -- 7) Display the fee details whose name is 'Sri' select * from fee where sid=(select sid from student1 where sname='Sri');
true
59f2f882a4aa58357d9592922909d8ca65ba0287
SQL
MiguelRJ/MRJBADA3T
/Ejercicio/E3esPalindromo.sql
UTF-8
748
3.203125
3
[]
no_license
delimiter // drop function if exists esPalindromo// create function esPalindromo(cadena varchar(255)) returns bool comment 'comprueba si una cadena es palindromo 0 falso 1 true' DETERMINISTIC begin declare cadena2 varchar(255) default ''; declare contador int default 0; declare caracter char(1) default ' '; declare caracterInvalido char(1) default ' '; declare lenght int default 0; set lenght = CHAR_LENGTH(cadena); WHILE contador <= lenght DO set caracter = (select substr(cadena,lenght,1)); IF caracter <> caracterInvalido THEN set cadena2 = concat(cadena2,caracter); END IF; set lenght = lenght-1; END WHILE; IF replace(cadena," ","") = cadena2 THEN return true; ELSE return false; END IF; end// delimiter ;
true
611cc9f96e41d8c598dc2772f6407e91a9c98a05
SQL
nicolasmns/assessment_sirena
/SirenaExercises/Exercise1/exercise1.3.sql
UTF-8
775
4.4375
4
[]
no_license
-- The sum(amount_exc_tax) works when there are two registers with the same account_id on the same month, this will give the -- total amount of the MRR for that month, preventing duplicates with different amounts. SELECT to_char(date(created_at),'YYYY-MM-01') AS month, mrr.account_id, sum(amount_exc_tax) AS amount FROM revenue_mrr mrr JOIN (SELECT * FROM (SELECT max(to_char(date(created_at),'YYYY-MM-01')) AS month, account_id FROM revenue_mrr GROUP BY account_id) temp_mrr WHERE month NOT IN (SELECT max(to_char(date(created_at),'YYYY-MM-01')) FROM revenue_mrr) ) rlast ON to_char(date(created_at),'YYYY-MM-01') = rlast.month and mrr.account_id = rlast.account_id GROUP BY to_char(date(created_at),'YYYY-MM-01'), mrr.account_id
true
ce2d3b7666e8c8200233f666d82fb62a156aca98
SQL
with-sahan/jentest
/database/CreateDatabase/SP/psm/getunwatchedissuelist.sql
UTF-8
586
2.90625
3
[]
no_license
DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `getunwatchedissuelist`(token varchar(255)) BEGIN declare spcode varchar(45); declare username varchar(45); declare orgcode varchar(45); set username=security.SPLIT_STR(token,'|',1); set orgcode=security.SPLIT_STR(token,'|',2); set spcode = 'getunwatchedissuelist'; if (security.fn_validate_token(token)=1) then SELECT id,description FROM psm.issue where watched=0; else select null as id, null as description, 'unauthorized' as response; end if; END$$ DELIMITER ;
true
91fb66b793f7f85a804117d7e8064d7079d69ff3
SQL
evrimulgen/Oracle-DBA-Life
/INFO/Books Codes/Oracle Database 10g PLSQL/Code/Chapter11/register_interest.sql
UTF-8
559
2.671875
3
[ "MIT" ]
permissive
/* * register_interest.sql * Chapter 11, Oracle10g PL/SQL Programming * by Ron Hardman, Michael McLaughlin and Scott Urman * * This script registers interest in a DBMS_ALERT * to the MESSAGES table. */ -- Remove your registered interest in a DBMS_ALERT. BEGIN -- Remove/deregister interest from an alert. DBMS_ALERT.REMOVE('EVENT_MESSAGE_QUEUE'); END; / -- Call signal trigger, which also builds the table. @create_signal_trigger.sql -- Register interest in an alert. BEGIN -- Register interest in an alert. DBMS_ALERT.REGISTER('EVENT_MESSAGE_QUEUE'); END; /
true
eaad8157533b0f49586f71379dfe08f208eec7c8
SQL
sierra073/gsheet-service-layer
/scripts/2019/id3035_districts_on_fiber_from_2017_2018sots.sql
UTF-8
629
3.953125
4
[]
no_license
select SUM(CASE WHEN d.funding_year = 2018 AND dff.fiber_target_status = 'Target' THEN 1 ELSE 0 END) - SUM(CASE WHEN d.funding_year = 2019 AND df.fiber_target_status = 'Target' THEN 1 ELSE 0 END) AS upgraded_to_fiber FROM ps.districts d JOIN ps.districts_fiber df ON d.district_id = df.district_id AND d.funding_year = df.funding_year LEFT JOIN ps.districts_fiber_frozen_sots dff ON df.district_id = dff.district_id AND df.funding_year = dff.funding_year WHERE d.in_universe = True AND d.district_type = 'Traditional'
true
05c8fb25f68ebbd78ef2a321a19b255db26e8804
SQL
omeryounus/Oracle-SQL-Queries
/HCM/4-ListasDeOnboarding/4.1-Queries/Tareas.sql
UTF-8
3,898
3.71875
4
[]
no_license
SELECT TAREAS.TASK_NAME, TAREAS.EJECUTOR, TAREAS.RESPONSABILIDAD, TAREAS.INICIO, --Estas 2 fechas (INICIO Y FIN) son las fechas cuando el empleado comenzó y finalizó el checklista/tareas de la lista. TAREAS.FIN, TAREAS.ESTADO, to_char(EMPLEADO.ALLOCATION_DATE,'DD/MM/YYYY') as ALLOCATION_DATE, --Filtramos por :pFechaInicio y :pFechaFin: Esta es la Fecha que --se le ASIGNÓ al empleado el checklist/tareas de la lista a resolver. EMPLEADO.PACHECK_TL_CHECKLIST_NAME, --Por esta lista de comprobacion filtramos en :pListas. EMPLEADO.PERSON_ID FROM (SELECT PACHECK.ALLOCATED_CHECKLIST_ID ,PACHECK_TL.CHECKLIST_NAME PACHECK_TL_CHECKLIST_NAME ,PACHECK_TL.DESCRIPTION ,PACHECK_TL.MESSAGE_TITLE ,PACHECK_TL.MESSAGE_TEXT ,PACHECK_TL.CHECKLIST_DETAILS ,PACHECK.LEGISLATION_CODE ,PACHECK.CHECKLIST_ID ,PACHECK.PERSON_ID ,PAPF.PERSON_NUMBER ,PACHECK.CHECKLIST_NAME ,PACHECK.DESCRIPTION BASE0_DESCRIPTION ,PACHECK.CHECKLIST_STATUS ,PACHECK.ALLOCATION_DATE ,PACHECK.COMPLETED_ON ,PACHECK.ALLOCATION_DETAILS FROM PER_ALLOCATED_CHECKLISTS PACHECK ,PER_ALLOCATED_CHECKLISTS_TL PACHECK_TL ,PER_ALL_PEOPLE_F PAPF WHERE PACHECK.ALLOCATED_CHECKLIST_ID = PACHECK_TL.ALLOCATED_CHECKLIST_ID AND PACHECK_TL.LANGUAGE = USERENV ('LANG') AND PAPF.PERSON_ID = PACHECK.PERSON_ID AND SYSDATE BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE AND (PACHECK.ALLOCATION_DATE BETWEEN :pFechaInicio AND :pFechaFin) --Fecha qe se le asigno al empleado el checklist de la lista a resolver. AND ((COALESCE(null, :pListas) is null) OR (PACHECK_TL.CHECKLIST_NAME IN (:pListas))) ) EMPLEADO, (SELECT -- PACHECK_TL.TASK_NAME TAREAS ( SELECT MAX(PACHECK_TL.TASK_NAME) FROM PER_ALLOCATED_TASKS_TL PACHECK_TL WHERE PACHECK_TL.ALLOCATED_TASK_ID = PATASKS.ALLOCATED_TASK_ID AND PACHECK_TL.LANGUAGE = USERENV ('LANG') ) TASK_NAME ,PATASKS.ALLOCATED_CHECKLIST_ID ,CASE WHEN PATASKS.STATUS = 'COM' THEN 'Completo' WHEN PATASKS.STATUS = 'INI' THEN 'Pendiente' WHEN PATASKS.STATUS = 'INP' THEN 'En Progreso' WHEN PATASKS.STATUS = 'OUT' THEN 'Excepcional' WHEN PATASKS.STATUS = 'REJ' THEN 'Rechazada' WHEN PATASKS.STATUS = 'SUS' THEN 'Suspendida' WHEN PATASKS.STATUS = 'WIT' THEN 'Retirada' WHEN PATASKS.STATUS = 'WAI' THEN 'Diferido hasta la fecha' WHEN PATASKS.STATUS = 'DEP' THEN 'Depende de otras tareas' ELSE 'No Informa' END ESTADO ,CASE WHEN PATASKS.RESPONSIBILITY_TYPE = 'ORA_WORKER' THEN 'Empleado' ELSE 'Área de responsabilidad' END EJECUTOR --Quien tiene que realizar la tarea. ,CASE WHEN PATASKS.RESPONSIBILITY_TYPE = 'ORA_WORKER' THEN ' ' WHEN PATASKS.RESPONSIBILITY_TYPE = 'USTA_TIC' THEN 'TIC' WHEN PATASKS.RESPONSIBILITY_TYPE = 'ORA_NL_CASE_MANAGER' THEN 'Manager' WHEN PATASKS.RESPONSIBILITY_TYPE = 'USTA_CONTRATACION' THEN 'Contratación' ELSE 'Área de responsabilidad' END RESPONSABILIDAD ,TO_CHAR(PATASKS.TARGET_START_DATE, 'DD/MM/YYYY') INICIO ,TO_CHAR(PATASKS.TARGET_END_DATE, 'DD/MM/YYYY') FIN FROM PER_ALLOCATED_TASKS PATASKS -- ,PER_ALLOCATED_TASKS_TL PACHECK_TL WHERE -- PACHECK_TL.ALLOCATED_TASK_ID = PATASKS.ALLOCATED_TASK_ID -- AND PACHECK_TL.LANGUAGE = USERENV ('LANG') --Parametro Estado: ((COALESCE(null, :pEstado) is null) OR (PATASKS.STATUS IN (:pEstado))) --Parametro Tareas: AND ((COALESCE(null, :pTareas) is null) OR ( ( SELECT MAX(PACHECK_TL.TASK_NAME) FROM PER_ALLOCATED_TASKS_TL PACHECK_TL WHERE PACHECK_TL.ALLOCATED_TASK_ID = PATASKS.ALLOCATED_TASK_ID AND PACHECK_TL.LANGUAGE = USERENV ('LANG') ) IN (:pTareas))) ) TAREAS WHERE EMPLEADO.ALLOCATED_CHECKLIST_ID = TAREAS.ALLOCATED_CHECKLIST_ID AND TAREAS.TASK_NAME NOT IN ('Antes del primer día', 'Actividades del primer día')
true
51747a3a4b8e5b6b929a9dbe5df59da6e43dc2f9
SQL
vctrmarques/interno-rh-sistema
/rhServer/src/main/resources/db/migration/sprint_1-10/V1_2018_12_04_17_12__CREATE_TABLE_TIPO_CONTRATO.sql
UTF-8
433
3.453125
3
[]
no_license
--Criação da tabela tipo_contrato --Marconi Motta IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'tipo_contrato') CREATE TABLE tipo_contrato ( id bigint NOT NULL IDENTITY(1,1), created_at datetime2(7) NOT NULL, updated_at datetime2(7) NOT NULL, created_by bigint, updated_by bigint, nome varchar(255) NOT NULL, CONSTRAINT pk_tipo_contrato PRIMARY KEY (id) ) CREATE UNIQUE INDEX uk_tipo_contrato_nome ON tipo_contrato (nome);
true
25af779b9475e2a50450118104d19c1a441fe8c2
SQL
dataplat/AlwaysEncryptedSample
/appveyor/schema_verification.sql
UTF-8
202
3.609375
4
[ "MIT" ]
permissive
PRINT 'Tables in database:' SELECT QUOTENAME(s.name) + '.' + QUOTENAME(t.name) AS [Table Name] FROM sys.tables t INNER JOIN sys.schemas s ON s.schema_id = t.schema_id;
true
fb9ed84a7e91f69a644f4c200df3a64cf79fd580
SQL
noorulameen/Bookappliction-mysql
/database/book.sql
UTF-8
1,848
2.90625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 18, 2016 at 06:17 PM -- Server version: 5.5.50-0ubuntu0.14.04.1 -- PHP Version: 5.5.9-1ubuntu4.19 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: `book` -- -- -------------------------------------------------------- -- -- Table structure for table `books` -- CREATE TABLE IF NOT EXISTS `books` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bname` varchar(255) NOT NULL, `ctuserid` int(11) NOT NULL, `isbncode` varchar(255) NOT NULL, `catalogue` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `password` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `organization` varchar(100) NOT NULL, `img` varchar(1000) NOT NULL, `oauthID` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `password`, `email`, `organization`, `img`, `oauthID`, `name`) VALUES (1, 'admin', 'password', 'tes@g.com', '', '', 0, ''); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
39726b651bdd16f6ee738d2ec6bf76923caf6f1a
SQL
code-42/c-sharp_WebScraperProjects
/Cookbook/SQLQuery1.sql
UTF-8
209
3.1875
3
[]
no_license
SELECT * FROM Recipe SELECT * FROM Ingredient SELECT a.Name FROM Ingredient a INNER JOIN RecipeIngredient b ON a.Id = b.IngredientId WHERE b.RecipeId = 1; UPDATE Recipe SET Name = 'Salad Deluxe' WHERE Id = 1;
true
2c47e22a6c69abc0eb7a61536853c082b8ef7360
SQL
legokichi/rust-sandbox
/scylla-sandbox/o.cql
UTF-8
375
3.1875
3
[]
no_license
-- https://docs.datastax.com/ja/cql-jajp/3.1/cql/cql_reference/create_keyspace_r.html CREATE KEYSPACE IF NOT EXISTS myapp; -- https://docs.datastax.com/ja/cql-jajp/3.1/cql/cql_reference/create_table_r.html CREATE TABLE IF NOT EXISTS myapp.users ( username text, insertion_time timestamp, PRIMARY KEY (username) ) WITH CLUSTERING ORDER BY (insertion_time DESC);
true
8f6cc99048a02965a43d263c06f8fd0b2f591b53
SQL
RarePepeCode/Food-sensors
/backup.sql
UTF-8
1,872
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 29, 2019 at 07:32 AM -- Server version: 10.1.40-MariaDB -- PHP Version: 7.1.29 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: `courses` -- -- -------------------------------------------------------- -- -- Table structure for table `recipe` -- CREATE TABLE `recipe` ( `id` int(11) NOT NULL, `aprasymas` varchar(255) DEFAULT NULL, `busena` int(11) DEFAULT NULL, `max_patirties_tasku` int(11) DEFAULT NULL, `patvirtintas` bit(1) NOT NULL, `pavadinimas` varchar(255) DEFAULT NULL, `sudetingumas` int(11) DEFAULT NULL, `fk_course_id` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -- Dumping data for table `recipe` -- INSERT INTO `recipe` (`id`, `aprasymas`, `busena`, `max_patirties_tasku`, `patvirtintas`, `pavadinimas`, `sudetingumas`, `fk_course_id`) VALUES (1, 'Duonike', 2, 10, b'1', 'Duona su cesnakiniu', 4, 1), (2, 'Gardu', 2, 10, b'1', 'Tiesiog ryziai', 2, 1), (3, 'sdfsd', 0, 5, b'0', 'MAKEERA', 3, 0), (23, 'FUN', 0, 0, b'0', 'SMAGU', 0, NULL), (24, 'lengi', 0, 0, b'0', 'OPA', 0, NULL), (25, 'px', 0, 0, b'0', 'Lengvi Pinigeliai', 0, 26); -- -- Indexes for dumped tables -- -- -- Indexes for table `recipe` -- ALTER TABLE `recipe` ADD PRIMARY KEY (`id`), ADD KEY `FKif5usgyxl51od3k5c4y2gw53v` (`fk_course_id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d4aa60a7ea52aa72bc7fb17cbc3b5ca702835818
SQL
stephenguedea/database-exercises
/update_exercises.sql
UTF-8
608
3.203125
3
[]
no_license
USE codeup_test_db; SELECT name AS 'All albums in this table' FROM albums; SELECT name AS 'All albums released before 1980' FROM albums WHERE release_date < 1980; SELECT name AS 'All albums by Michael Jackson' FROM albums WHERE artist = 'MICHAEL JACKSON'; UPDATE albums SET sales = sales * 10; select * from albums; UPDATE albums SET release_date = 1800 WHERE release_date < 1980; SELECT release_date, name AS 'All albums released before 1980' FROM albums WHERE release_date < 1980; UPDATE albums SET artist = 'Peter Jackson' WHERE artist = 'michael jackson'; SELECT name AS 'All albums by Michael Jackson' FROM albums WHERE artist = 'peter JACKSON';
true
c91b8a3d80afcec348324e05e25842d94261539f
SQL
in2code-de/gb_events
/ext_tables.sql
UTF-8
2,643
2.8125
3
[]
no_license
# # Table structure for table 'tx_gbevents_domain_model_event' # CREATE TABLE tx_gbevents_domain_model_event ( uid int(11) unsigned default '0' NOT NULL auto_increment, pid int(11) default '0' NOT NULL, title varchar(255) default '' NOT NULL, teaser text NOT NULL, description text NOT NULL, location varchar(255) default '' NOT NULL, event_date int(11) default '0' NOT NULL, event_time varchar(255) default '' NOT NULL, images text, downloads text, recurring_weeks int(11) default '0' NOT NULL, recurring_days int(11) default '0' NOT NULL, recurring_stop int(11) default '0' NOT NULL, recurring_exclude_holidays tinyint(4) default '0' NOT NULL, recurring_exclude_dates text, path_segment varchar(2048), event_stop_date int(11) default '0' NOT NULL, tstamp int(11) unsigned default '0' NOT NULL, crdate int(11) unsigned default '0' NOT NULL, deleted tinyint(4) unsigned default '0' NOT NULL, hidden tinyint(4) unsigned default '0' NOT NULL, starttime int(11) unsigned default '0' NOT NULL, endtime int(11) unsigned default '0' NOT NULL, t3ver_oid int(11) default '0' NOT NULL, t3ver_id int(11) default '0' NOT NULL, t3ver_wsid int(11) default '0' NOT NULL, t3ver_label varchar(30) default '' NOT NULL, t3ver_state tinyint(4) default '0' NOT NULL, t3ver_stage tinyint(4) default '0' NOT NULL, t3ver_count int(11) default '0' NOT NULL, t3ver_tstamp int(11) default '0' NOT NULL, t3_origuid int(11) default '0' NOT NULL, sys_language_uid int(11) default '0' NOT NULL, l10n_parent int(11) default '0' NOT NULL, l10n_diffsource mediumblob NOT NULL, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid, t3ver_wsid) );
true
5e7ccc14bbbd65cb07037b28862ce29e1e0f81af
SQL
bramarin/test_task
/testtaskdump.sql
UTF-8
4,227
3.09375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.31, for Linux (x86_64) -- -- Host: mysql.krasalp.myjino.ru Database: krasalp_test-task-db -- ------------------------------------------------------ -- Server version 5.5.62-38.14-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!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 `element` -- DROP TABLE IF EXISTS `element`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `element` ( `id_element` int(11) NOT NULL AUTO_INCREMENT, `id_parent` int(11) DEFAULT NULL, `name` varchar(255) NOT NULL, `type` varchar(100) DEFAULT NULL, `creation_date` date NOT NULL, `modification_date` date NOT NULL, `additional_data` mediumblob, PRIMARY KEY (`id_element`), KEY `id_parent` (`id_parent`), CONSTRAINT `element_ibfk_1` FOREIGN KEY (`id_parent`) REFERENCES `section` (`id_section`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `element` -- LOCK TABLES `element` WRITE; /*!40000 ALTER TABLE `element` DISABLE KEYS */; INSERT INTO `element` VALUES (1,2,'first_element','Комментарий','2020-09-07','2020-09-09',NULL),(2,2,'second_element','Новость','2020-09-07','2020-09-09',NULL),(3,1,'third_element','Комментарий','2020-09-02','2020-09-09',NULL),(4,5,'fourth_el_in_fifth_cec','Новость','2020-09-08','2020-09-09',NULL),(5,5,'sixth_el_in_fifth_cec','Статья','2020-09-08','2020-09-09',NULL),(9,2,'new_one','Статья','2020-09-09','2020-09-09',NULL); /*!40000 ALTER TABLE `element` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `section` -- DROP TABLE IF EXISTS `section`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `section` ( `id_section` int(11) NOT NULL AUTO_INCREMENT, `id_parent` int(11) DEFAULT NULL, `name` varchar(255) NOT NULL, `description` varchar(255) DEFAULT NULL, `creation_date` date NOT NULL, `modification_date` date NOT NULL, PRIMARY KEY (`id_section`), KEY `id_parent` (`id_parent`), CONSTRAINT `section_ibfk_1` FOREIGN KEY (`id_parent`) REFERENCES `section` (`id_section`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `section` -- LOCK TABLES `section` WRITE; /*!40000 ALTER TABLE `section` DISABLE KEYS */; INSERT INTO `section` VALUES (1,NULL,'home','this is home section','2020-09-07','2020-09-07'),(2,1,'section_two','this is second section','2020-09-07','2020-09-07'),(3,1,'section_three','this is third section','2020-09-08','2020-09-08'),(4,2,'section_four','this is fourth section','2020-09-08','2020-09-08'),(5,4,'section_vive','this section in the fourth section','2020-09-08','2020-09-08'),(14,2,'section_seven','','2020-09-08','2020-09-08'),(18,4,'section_six','this is sixth section','2020-09-09','2020-09-09'); /*!40000 ALTER TABLE `section` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-09 13:53:17
true
4c5cb414efdc1e5c38fd327de612583ff6753445
SQL
BrunoLV/agenda-spring-mvc
/script-criacao-banco.sql
UTF-8
2,552
2.96875
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `agenda` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `agenda`; -- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64) -- -- Host: localhost Database: agenda -- ------------------------------------------------------ -- Server version 5.7.22-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `contato` -- DROP TABLE IF EXISTS `contato`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `contato` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `nome` varchar(150) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `nome` (`nome`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `telefone` -- DROP TABLE IF EXISTS `telefone`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `telefone` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `ddd` varchar(3) NOT NULL, `numero` varchar(15) NOT NULL, `tipo` varchar(20) NOT NULL, `id_contato` bigint(20) NOT NULL, PRIMARY KEY (`id`), KEY `id_contato` (`id_contato`), CONSTRAINT `telefone_ibfk_1` FOREIGN KEY (`id_contato`) REFERENCES `contato` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping events for database 'agenda' -- -- -- Dumping routines for database 'agenda' -- /*!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 13:04:04
true
ec5241d74111994f7de037401ab03e15b2d9d6ba
SQL
leon230/UTMSReporting
/SQL/SQL/SQL/X dock shipments download.sql
UTF-8
2,188
2.984375
3
[]
no_license
SELECT SH.SHIPMENT_GID, sh.servprov_gid, (select loc.location_name from location loc where loc.location_gid = sh.servprov_gid ) servprov_name, (SELECT SH_STAT.STATUS_VALUE_GID FROM SHIPMENT_STATUS SH_STAT WHERE SH_STAT.SHIPMENT_GID = SH.SHIPMENT_GID AND SH_STAT.STATUS_TYPE_GID = 'ULE/PR.ENROUTE' ) ENROUTE_STATUS, (SELECT SH_STAT.STATUS_VALUE_GID FROM SHIPMENT_STATUS SH_STAT WHERE SH_STAT.SHIPMENT_GID = SH.SHIPMENT_GID AND SH_STAT.STATUS_TYPE_GID = 'ULE/PR.FINANCE' ) FINANCE_STATUS, (SELECT SH_STAT.STATUS_VALUE_GID FROM SHIPMENT_STATUS SH_STAT WHERE SH_STAT.SHIPMENT_GID = SH.SHIPMENT_GID AND SH_STAT.STATUS_TYPE_GID = 'ULE/PR.INVOICE_READY' ) INVOICE_STATUS, (SELECT SH_STAT.STATUS_VALUE_GID FROM SHIPMENT_STATUS SH_STAT WHERE SH_STAT.SHIPMENT_GID = SH.SHIPMENT_GID AND SH_STAT.STATUS_TYPE_GID = 'ULE/PR.SHIPMENT_COST' ) SH_COST_STATUS /* orls.order_release_gid, */ /* CASE WHEN (SELECT SH_TEMP.SHIPMENT_GID FROM SHIPMENT SH_TEMP, VIEW_SHIPMENT_ORDER_RELEASE VORLS_TEMP, ORDER_RELEASE ORLS_TEMP WHERE 1=1 AND SH_TEMP.SHIPMENT_GID = VORLS_TEMP.SHIPMENT_GID AND ORLS_TEMP.ORDER_RELEASE_GID = VORLS_TEMP.ORDER_RELEASE_GID AND ORLS_TEMP.ORDER_RELEASE_GID = ORLS.ORDER_RELEASE_GID AND SH_TEMP.SHIPMENT_TYPE_GID = 'HANDLING' ) IS NOT NULL THEN 'Y' ELSE 'N' END AS X_DOCK */ FROM SHIPMENT SH, VIEW_SHIPMENT_ORDER_RELEASE VORLS, ORDER_RELEASE ORLS WHERE 1=1 AND SH.SHIPMENT_GID = VORLS.SHIPMENT_GID AND ORLS.ORDER_RELEASE_GID = VORLS.ORDER_RELEASE_GID /* AND SH.SHIPMENT_GID IN () */ and EXISTS (SELECT SH_TEMP.SHIPMENT_GID FROM SHIPMENT SH_TEMP, VIEW_SHIPMENT_ORDER_RELEASE VORLS_TEMP, ORDER_RELEASE ORLS_TEMP WHERE 1=1 AND SH_TEMP.SHIPMENT_GID = VORLS_TEMP.SHIPMENT_GID AND ORLS_TEMP.ORDER_RELEASE_GID = VORLS_TEMP.ORDER_RELEASE_GID AND ORLS_TEMP.ORDER_RELEASE_GID = ORLS.ORDER_RELEASE_GID AND SH_TEMP.SHIPMENT_TYPE_GID = 'HANDLING' ) /* and (SELECT SH_STAT.STATUS_VALUE_GID FROM SHIPMENT_STATUS SH_STAT WHERE SH_STAT.SHIPMENT_GID = SH.SHIPMENT_GID AND SH_STAT.STATUS_TYPE_GID = 'ULE/PR.SHIPMENT_COST' ) <> 'ULE/PR.SC_NO CHANGES ALLOWED' */
true
9fde9b57f5807a97771be447b96d9a99757983be
SQL
djihaaane/E-learning
/scolariteDB/scolaritedatabase_Blog.sql
UTF-8
2,174
2.9375
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.18, for Linux (x86_64) -- -- Host: localhost Database: scolaritedatabase -- ------------------------------------------------------ -- Server version 8.0.18 /*!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 `Blog` -- DROP TABLE IF EXISTS `Blog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `Blog` ( `NomBlog` varchar(45) DEFAULT NULL, `descBlog` longtext, `NumBlog` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`NumBlog`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Blog` -- LOCK TABLES `Blog` WRITE; /*!40000 ALTER TABLE `Blog` DISABLE KEYS */; INSERT INTO `Blog` VALUES ('sfsdrgrtgf','ddf',1),('fdgr','qqq',2),('ddd','dfgh',3),('haahaha','ddd',4),('xdv','ddd',5),('xdv','ddd',6),('dddq','sfhdsgfskfdgj',7),('dhucdvhu','dflsi\'bjiotsbhrtji',8),('interface','it is kda mena melhih',9),('manell','dfjykuv',10); /*!40000 ALTER TABLE `Blog` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-08-01 14:21:44
true
7ed916fbcaaeb3b261374990ead01a03100009a6
SQL
tianiachan/Healthcare_Fraud
/joining_tables.sql
UTF-8
1,094
3.84375
4
[]
no_license
-- join prescriber table and exclusion table together on NPI using inner join --select all columns as we need all the data and do an inner join on NPI CREATE TABLE drug_and_exclusion AS SELECT pd.npi, e.is_fraud, pd.total_claims, pd.total_drug_cost, pd.provider_last_name, pd.provider_first_name, pd.provider_city, pd.provider_state FROM prescriber_drugs AS pd LEFT JOIN exclusion_list AS e ON pd.npi = e.npi; -- test there are null values so that it shows we pulled all providers SELECT npi FROM drug_and_exclusion WHERE is_fraud IS NULL; --join drug and exclusion table with provider table to get final table needed to do some ML - need to work on CREATE TABLE final_table AS SELECT de.is_fraud, de.total_claims, de.total_drug_cost, de.provider_last_name, de.provider_first_name, de.provider_city, de.provider_state, ppi.physician_first_name, ppi.physician_last_name, ppi.recipient_city, ppi.recipient_state, ppi.total_payment FROM drug_and_exclusion AS de LEFT JOIN provider_payment_info AS ppi ON de.provider_last_name = ppi.physician_first_name; SELECT COUNT(*) FROM final_table;
true
a740986921fd0f7e99f0379591508bfe4303b399
SQL
sandoelio/E-Chamados
/u641666397_chama.sql
UTF-8
4,761
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Tempo de geração: 13/09/2019 às 01:19 -- Versão do servidor: 10.2.25-MariaDB -- Versão do PHP: 7.2.20 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 */; -- -- Banco de dados: `u641666397_chama` -- -- -------------------------------------------------------- -- -- Estrutura para tabela `chamados1` -- CREATE TABLE `chamados1` ( `contador` int(255) NOT NULL, `Local` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `DataHora` varchar(150) COLLATE utf8_unicode_ci NOT NULL, `Técnico` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `Status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `servico` varchar(600) COLLATE utf8_unicode_ci DEFAULT NULL, `serviexecu` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `DataHoraAber` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `DataHoraFim` varchar(20) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Despejando dados para a tabela `chamados1` -- INSERT INTO `chamados1` (`contador`, `Local`, `DataHora`, `Técnico`, `Status`, `servico`, `serviexecu`, `DataHoraAber`, `DataHoraFim`) VALUES (2, 'Miller Indep', '18/02/2018 17:38', 'Tecnico1teste', 'Aberto', 'teste2', '', '', ''), (3, 'Miller Centro', '18/02/2018 17:38', 'Tecnico1teste', 'Aberto', 'teste3', '', '', ''), (8, 'Miller Indep', '10/10/2018 14:37', 'Gean novato', 'Aberto', 'nada', '', '', ''), (5, 'Miller café', '19/02/2018 09:11', 'José', 'Feito', 'Fazer cabo de rede no açougue ', 'Usado 5m de cabo de rede, deixado ponteira por conta sa CSinformatica', '19/02/2018 09:14', '19/02/2018 09:15'), (6, 'matriz', '19/02/2018 09:28', 'Josué', 'Aberto', 'teste\r\n', '', '', ''), (7, 'Miller Centro', '20/02/2018 10:48', 'Josué', 'Aberto', 'Teste', '', '', ''); -- -------------------------------------------------------- -- -- Estrutura para tabela `tecnicos` -- CREATE TABLE `tecnicos` ( `nome` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `NomeCompleto` varchar(300) COLLATE utf8_unicode_ci NOT NULL, `id` int(80) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Despejando dados para a tabela `tecnicos` -- INSERT INTO `tecnicos` (`nome`, `NomeCompleto`, `id`) VALUES ('Lisiane', 'José', 44), ('Tecnico1teste', 'Tecnico1Teste', 36), ('Josué', 'Josué', 43), ('Testetecnico2', 'testetecnico2', 37), ('Gean novato', 'Gean', 42); -- -------------------------------------------------------- -- -- Estrutura para tabela `usuarios` -- CREATE TABLE `usuarios` ( `id` int(11) UNSIGNED NOT NULL, `nome` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `username` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `role` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Despejando dados para a tabela `usuarios` -- INSERT INTO `usuarios` (`id`, `nome`, `username`, `password`, `role`) VALUES (28, 'José', 'José', 'jose', 'tecnico'), (29, 'Josué', 'Josué', 'josu', 'tecnico'), (22, 'gean', 'gean', 'gean', 'tecnico'), (23, 'testetecnico2', 'Testetecnico2', 'Testetecnico2', 'tecnico'), (21, 'Sub-Administrador', 'SubAdminteste', 'SubAdminteste', 'subadim'), (16, 'gean', 'Testeadmin', 'testeadmin', 'admin'); -- -- Índices de tabelas apagadas -- -- -- Índices de tabela `chamados1` -- ALTER TABLE `chamados1` ADD PRIMARY KEY (`contador`); -- -- Índices de tabela `tecnicos` -- ALTER TABLE `tecnicos` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `Nome` (`nome`), ADD UNIQUE KEY `NomeCompleto` (`NomeCompleto`); -- -- Índices de tabela `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `usuario` (`username`), ADD KEY `nivel` (`role`); -- -- AUTO_INCREMENT de tabelas apagadas -- -- -- AUTO_INCREMENT de tabela `chamados1` -- ALTER TABLE `chamados1` MODIFY `contador` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT de tabela `tecnicos` -- ALTER TABLE `tecnicos` MODIFY `id` int(80) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45; -- -- AUTO_INCREMENT de tabela `usuarios` -- ALTER TABLE `usuarios` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31; 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
b044d1e93b764d8c54b18ebaab8d28540b5b0c24
SQL
DaDaMrX/cluster-server
/others/tables.sql
UTF-8
1,953
3.28125
3
[]
no_license
-- create database BOOSTDB; -- use BOOSTDB; CREATE TABLE CLUSTERRING_TASKS( BOT_ID VARCHAR(32) PRIMARY KEY, IS_COMPLETED INT DEFAULT 0, PROGRESS DECIMAL(20, 10) NULL, CH DECIMAL(20, 10) NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_HISTORY( BOT_ID VARCHAR(32) NOT NULL, MAX_DF DECIMAL(11, 10) NOT NULL, MIN_DF INT NOT NULL, STOPWORDS VARCHAR(10240), N_CLUSTERS INT NOT NULL, METHOD VARCHAR(32), TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_STOPWORDS( ID INT PRIMARY KEY AUTO_INCREMENT, BOT_ID VARCHAR(32) NOT NULL, WORD VARCHAR(128), TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_UTTERANCES ( UTTERANCE_ID INT PRIMARY KEY AUTO_INCREMENT, BOT_ID VARCHAR(32) NOT NULL, CONV_ID INT NOT NULL, SPEAKER_ID INT NOT NULL, UTTERANCE VARCHAR(10240) NOT NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_CONVS ( CONV_ID INT PRIMARY KEY, BOT_ID VARCHAR(32) NOT NULL, CLUSTER_ID INT NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_WORDS ( WORD_ID INT PRIMARY KEY, BOT_ID VARCHAR(32) NOT NULL, WORD VARCHAR(128) NOT NULL, DF DECIMAL(20, 10) NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_CLUSTERS( CLUSTER_ID INT PRIMARY KEY, BOT_ID VARCHAR(32) NOT NULL, VOLUME INT NOT NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE CLUSTERRING_CLUSTERKEYWORDS( ID INT PRIMARY KEY AUTO_INCREMENT, BOT_ID VARCHAR(32) NOT NULL, CLUSTER_ID INT NOT NULL, WORD_ID INT NOT NULL, TFIDF DECIMAL(20, 10) NOT NULL, TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP );
true
29e378c3d8e123302af8badce953334b817840bf
SQL
jonamuen/sql-reduce
/test/sqlsmith/sqlite/8671.sql
UTF-8
771
3.546875
4
[ "MIT" ]
permissive
select ref_0.name as c0, ref_0.name as c1, ref_0.id as c2, ref_0.id as c3 from main.t0 as ref_0 where (ref_0.id is not NULL) or (((1) or (ref_0.id is NULL)) or (EXISTS ( select ref_1.name as c0, ref_1.id as c1 from main.t0 as ref_1 left join main.t0 as ref_2 on (ref_1.id = ref_2.id ) left join main.t0 as ref_3 on ((EXISTS ( select ref_1.name as c0, ref_2.name as c1 from main.t0 as ref_4 where 0)) or (ref_0.id is not NULL)) where (0) or (0) limit 140))) limit 187;
true
630d2f1ac9d46bff920ee3ae627426b02a17dcaf
SQL
MiguelRJ/MRJBADA3T
/Eventos/evento.sql
UTF-8
605
2.9375
3
[]
no_license
delimiter // drop event if exists copiaSeguridadPartidos// create event if not exists copiaSeguridadPartidos on schedule EVERY 1 week STARTS '2017-09-03 22:00' ENDS '2018-06-30 22:00' comment 'Volcado de seguridad de partidos jugados cada domingo a las 22:00h' do begin declare ultimaFecha date; create table if not exists PartidoTmp ( elocal smallint(6), evisitante smallint(6), resultado char(7), fecha date, arbitro smallint(6) ); insert into PartidoTmp select elocal,evisitante,resultado,fecha,arbiro from partido where fecha > (select max(fecha) from PartidoTmb); end// delimiter ;
true
b7a703420147f0ad8e6e3f5862a7d360e2d4dee8
SQL
HendricksK/PHP
/dvd_shop.sql
UTF-8
4,560
3.21875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 13, 2016 at 11:12 AM -- Server version: 5.6.12-log -- PHP Version: 5.4.16 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: `dvd_shop` -- CREATE DATABASE IF NOT EXISTS `dvd_shop` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `dvd_shop`; -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE IF NOT EXISTS `category` ( `Category_ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `category_name` varchar(255) NOT NULL, PRIMARY KEY (`Category_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `category` -- INSERT INTO `category` (`Category_ID`, `category_name`) VALUES (1, 'comedy'), (2, 'action'); -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE IF NOT EXISTS `customer` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `surname` varchar(255) NOT NULL, `contact_number` varchar(20) NOT NULL, `sa_id_number` varchar(20) NOT NULL, `address` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`ID`, `name`, `surname`, `contact_number`, `sa_id_number`, `address`, `email`) VALUES (1, 'Bob', 'Marley', '1234567890', '1234567890123', '2 Kingston way, kingston island', 'bob@thewailersband.com'), (2, 'Peter', 'Tosh', '0987654321', '098765432123', '12 legalize it way, kingson, a landmasss ', 'peter@thewailersband.com'), (4, 'Amber', 'Toshj', '8723812387127', '0987654321', '12 flemming road, jurrasic street, london town, 4567', 'dfhdsbbfha@sjhfdj.com'); -- -------------------------------------------------------- -- -- Table structure for table `dvd` -- CREATE TABLE IF NOT EXISTS `dvd` ( `ID` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT '0', `description` varchar(255) DEFAULT '0', `release_date` varchar(20) DEFAULT '0', `category_id` int(11) DEFAULT '0', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `dvd` -- INSERT INTO `dvd` (`ID`, `name`, `description`, `release_date`, `category_id`) VALUES (1, 'Inception', 'A thief who steals corporate secrets through use of the dream-sharing technology is given the inverse task of planting an idea into the mind of a CEO.', '2012', 1), (2, 'The Dark Knight', 'When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, the caped crusader must come to terms with one of the greatest psychological tests of his ability to fight injustice.', '2012', 2); -- -------------------------------------------------------- -- -- Table structure for table `dvd_orders` -- CREATE TABLE IF NOT EXISTS `dvd_orders` ( `dvd_orders_ID` int(50) unsigned NOT NULL, `order_id` int(50) unsigned NOT NULL, `dvd_id` int(50) NOT NULL, PRIMARY KEY (`dvd_orders_ID`), KEY `order_id` (`order_id`), KEY `dvd_id` (`dvd_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `dvd_orders` -- INSERT INTO `dvd_orders` (`dvd_orders_ID`, `order_id`, `dvd_id`) VALUES (0, 0, 2), (1, 1, 1), (2, 2, 2); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE IF NOT EXISTS `orders` ( `orders_ID` int(11) NOT NULL AUTO_INCREMENT, `customer_id` int(11) DEFAULT NULL, `rent_date` varchar(50) DEFAULT NULL, `due_date` varchar(50) DEFAULT NULL, `actual_return_date` varchar(50) DEFAULT NULL, PRIMARY KEY (`orders_ID`), KEY `customer_id` (`customer_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`orders_ID`, `customer_id`, `rent_date`, `due_date`, `actual_return_date`) VALUES (1, 1, '13-01-2016', '15-01-2016', NULL), (2, 1, '13-01-2016', '15-01-2016', NULL), (3, 2, '2016-01-13', '2016-01-15', '2016-01-14'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
1be669a1d1207fd613a55d6ca4553f79371e26ae
SQL
itroulli/HackerRank
/SQL/Basic_Select/015-weather_observation_station_10.sql
UTF-8
239
3.078125
3
[]
no_license
/* Name: Weather Observation Station 10 Problem: https://www.hackerrank.com/challenges/weather-observation-station-10/problem Score: 10 Language: MySQL */ SELECT DISTINCT CITY FROM STATION WHERE RIGHT(CITY,1) NOT IN ('a','i','e','o','u');
true
c89aee64dcaf6ab22bc8c1f5425a8eeeef994b33
SQL
altus-ace/ACDW_CLMS_SHCN_MSSP
/ACDW_CLMS_SHCN_MSSP/adw/Functions/2020_tvf_Get_ERToIPAdmit.sql
UTF-8
2,349
3.9375
4
[]
no_license
 CREATE FUNCTION [adw].[2020_tvf_Get_ERToIPAdmit] ( @PrimSvcDate_Start VARCHAR(20), @PrimSvcDate_End VARCHAR(20) ) RETURNS @ErToIpAdmit TABLE ( ClientMemberKey VARCHAR(50) ,ClaimID_ER VARCHAR(50) ,ClaimID_IP VARCHAR(50) ,PrimSvcDate_ER DATE ,SvcToDate_ER DATE ,PrimSvcDate_IP DATE ,SvcToDate_IP DATE ,SvcDateDiff INT ) AS BEGIN WITH cte AS ( SELECT SEQ_CLAIM_ID,SUBSCRIBER_ID,SVC_TO_DATE,PRIMARY_SVC_DATE, row_number()over(partition BY SUBSCRIBER_ID ORDER BY PRIMARY_SVC_DATE) AS r FROM (SELECT b.* FROM [adw].[2020_tvf_Get_ERVisits] (@PrimSvcDate_Start,@PrimSvcDate_End) b ) vw_tmp ) INSERT INTO @ErToIpAdmit ( ClientMemberKey ,ClaimID_ER ,ClaimID_IP ,PrimSvcDate_ER ,SvcToDate_ER ,PrimSvcDate_IP ,SvcToDate_IP ,SvcDateDiff ) SELECT DISTINCT -- ER Rev Code found in different claim, but are 0,1 days apart from IP c1.SUBSCRIBER_ID AS ClientMemberKey, c1.SEQ_CLAIM_ID AS SeqClaimID_ER, c2.SEQ_CLAIM_ID AS SeqClaimID_IP, c1.PRIMARY_SVC_DATE as PrimSvcDate_ER, c1.SVC_TO_DATE as [SvcToDate_ER], c2.PRIMARY_SVC_DATE as [PrimSvcDate_IP], c2.SVC_TO_DATE as [SvcToDate_IP], DATEDIFF(dd,c1.PRIMARY_SVC_DATE,c2.PRIMARY_SVC_DATE) FROM CTE c1 INNER JOIN [adw].[2020_tvf_Get_IPVisits] (@PrimSvcDate_Start,@PrimSvcDate_End) c2 ON c1.SUBSCRIBER_ID=c2.SUBSCRIBER_ID WHERE c1.SEQ_CLAIM_ID<>c2.SEQ_CLAIM_ID --AND c1.PRIMARY_SVC_DATE BETWEEN c2.PRIMARY_SVC_DATE AND c2.SVC_TO_DATE AND DATEDIFF(dd,c1.PRIMARY_SVC_DATE,c2.PRIMARY_SVC_DATE) in (0,1) AND c2.CLAIM_TYPE IN ('60') union SELECT DISTINCT -- ER Rev Code found in same claim as IP c1.SUBSCRIBER_ID AS ClientMemberKey, c1.SEQ_CLAIM_ID AS SeqClaimID_ER, c2.SEQ_CLAIM_ID AS SeqClaimID_IP, c1.PRIMARY_SVC_DATE as PrimSvcDate_ER, c1.SVC_TO_DATE as [SvcToDate_ER], c2.PRIMARY_SVC_DATE as [PrimSvcDate_IP], c2.SVC_TO_DATE as [SvcToDate_IP], DATEDIFF(dd,c1.PRIMARY_SVC_DATE,c2.PRIMARY_SVC_DATE) FROM CTE c1 INNER JOIN [adw].[2020_tvf_Get_IPVisits] (@PrimSvcDate_Start,@PrimSvcDate_End) c2 ON c1.SUBSCRIBER_ID=c2.SUBSCRIBER_ID WHERE c1.SEQ_CLAIM_ID=c2.SEQ_CLAIM_ID AND c2.CLAIM_TYPE IN ('60') RETURN; END /*** Usage: SELECT * FROM adw.[2020_tvf_Get_ERToIPAdmit] ('01/01/2020','12/31/2020') WHERE ClientMemberKey = '1AH9TX1MR00' ***/
true
37f6fdfaa4bb620fb68b6004783155727c1715e1
SQL
gadfly4ever/Tournament
/tournament.sql
UTF-8
1,767
4.40625
4
[]
no_license
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. -- -- You can write comments in this file by starting them with two dashes, like -- these lines here. CREATE DATABASE tournament; \c tournament; CREATE TABLE Players (name text, idn serial PRIMARY KEY); CREATE TABLE Matches (p1id serial REFERENCES Players(idn), p2id serial REFERENCES Players(idn), winner serial REFERENCES Players(idn), idn serial PRIMARY KEY); -- Due to the issue with POSTGRESQL when using COUNT() and LEFT JOIN together, the VIEW was splitted in two: CREATE VIEW MatchesPlayed AS SELECT Players.idn AS playerId, Matches.idn AS matchId FROM Players LEFT JOIN Matches ON Players.idn = Matches.p1id OR Players.idn = Matches.p2id; CREATE VIEW MatchesPlayedNum AS SELECT playerId, COUNT(matchId) AS matchNum FROM MatchesPlayed GROUP BY playerId; -- Same as above: CREATE VIEW MatchesWon AS SELECT Players.idn AS playerId, Matches.idn AS matchId FROM Players LEFT JOIN Matches ON Players.idn = Matches.winner; CREATE VIEW MatchesWonNum AS SELECT PlayerId, COUNT(matchId) AS winNum FROM MatchesWon GROUP BY PlayerId; -- View for Player Standings: CREATE VIEW Standings AS SELECT Players.idn, Players.name, MatchesWonNum.winNum, MatchesPlayedNum.matchNum FROM Players, MatchesPlayedNum, MatchesWonNum WHERE Players.idn = MatchesPlayedNum.PlayerId AND Players.idn = MatchesWonNum.PlayerId ORDER BY MatchesWonNum.winNum DESC; -- View for Swiss Pairings CREATE VIEW Pairings AS SELECT p1.idn AS p1id, p1.name AS p1name, p2.idn AS p2id, p2.name AS p2name FROM Standings AS p1, Standings AS p2 WHERE p1.idn < p2.idn AND p1.winNum = p2.winNum AND p1.matchNum = p2.matchNum;
true
ad58067464970da72784ba4eca997aa3c82ccb15
SQL
daiarn/Tarpplanetines-keliones
/conf/evolutions/default/db.sql
UTF-8
9,408
3.5
4
[ "CC0-1.0" ]
permissive
create table allergen ( id integer auto_increment not null, name varchar(255), constraint pk_allergen primary key (id) ); create table entertainment ( id integer auto_increment not null, name varchar(255), description varchar(255), price double, constraint pk_entertainment primary key (id) ); create table flight_class ( id integer auto_increment not null, type varchar(255), seat_count integer, vechile_id integer, constraint pk_flight_class primary key (id) ); create table hotel ( id integer auto_increment not null, name varchar(255), address varchar(255), constraint pk_hotel primary key (id) ); create table luggage ( id integer auto_increment not null, dimensions varchar(255), weight integer, contents varchar(255), vechile_id integer, constraint pk_luggage primary key (id) ); create table meal ( id integer auto_increment not null, name varchar(255), description varchar(255), price double, day_of_the_week datetime(6), constraint pk_meal primary key (id) ); create table mealallergen ( meal_id integer not null, allergen_id integer not null, constraint pk_mealallergen primary key (meal_id,allergen_id) ); create table my_reservation ( id integer auto_increment not null, email varchar(255), constraint pk_my_reservation primary key (id) ); create table reservation ( id integer auto_increment not null, nr varchar(255), date datetime(6), take_off_place varchar(255), final_price double, payment_date datetime(6), take_off_date datetime(6), arriving_date datetime(6), come_back_date datetime(6), state_id integer, hotel_id integer, vechile_id integer, my_reservation_id integer, constraint pk_reservation primary key (id) ); create table reservation_state ( id integer auto_increment not null, state_name varchar(255), constraint pk_reservation_state primary key (id) ); create table room ( id integer auto_increment not null, floor integer, room_number integer, beds_count integer, bed_type varchar(255), hotel_id integer, constraint pk_room primary key (id) ); create table seat ( id integer auto_increment not null, row integer, col integer, reservation_id integer, flight_class_id integer, constraint pk_seat primary key (id) ); create table seatentertainment ( seat_id integer not null, entertainment_id integer not null, constraint pk_seatentertainment primary key (seat_id,entertainment_id) ); create table seatmeal ( seat_id integer not null, meal_id integer not null, constraint pk_seatmeal primary key (seat_id,meal_id) ); create table tour ( id integer auto_increment not null, name varchar(255), description varchar(255), price double, seat_count integer, hotel_id integer, constraint pk_tour primary key (id) ); create table vechile ( id integer auto_increment not null, name varchar(255), fuel_id integer, constraint pk_vechile primary key (id) ); create table vechile_fuel ( id integer auto_increment not null, name varchar(255), constraint pk_vechile_fuel primary key (id) ); create table vechile_speed ( id integer auto_increment not null, name varchar(255), constraint pk_vechile_speed primary key (id) ); create table voyage_price ( id integer auto_increment not null, calculation_date datetime(6), distance_from_earth double, speed_id integer, reservation_id integer, constraint pk_voyage_price primary key (id) ); create index ix_flight_class_vechile_id on flight_class (vechile_id); alter table flight_class add constraint fk_flight_class_vechile_id foreign key (vechile_id) references vechile (id) on delete restrict on update restrict; create index ix_luggage_vechile_id on luggage (vechile_id); alter table luggage add constraint fk_luggage_vechile_id foreign key (vechile_id) references vechile (id) on delete restrict on update restrict; create index ix_mealallergen_meal on mealallergen (meal_id); alter table mealallergen add constraint fk_mealallergen_meal foreign key (meal_id) references meal (id) on delete restrict on update restrict; create index ix_mealallergen_allergen on mealallergen (allergen_id); alter table mealallergen add constraint fk_mealallergen_allergen foreign key (allergen_id) references allergen (id) on delete restrict on update restrict; create index ix_reservation_state_id on reservation (state_id); alter table reservation add constraint fk_reservation_state_id foreign key (state_id) references reservation_state (id) on delete restrict on update restrict; create index ix_reservation_hotel_id on reservation (hotel_id); alter table reservation add constraint fk_reservation_hotel_id foreign key (hotel_id) references hotel (id) on delete restrict on update restrict; create index ix_reservation_vechile_id on reservation (vechile_id); alter table reservation add constraint fk_reservation_vechile_id foreign key (vechile_id) references vechile (id) on delete restrict on update restrict; create index ix_reservation_my_reservation_id on reservation (my_reservation_id); alter table reservation add constraint fk_reservation_my_reservation_id foreign key (my_reservation_id) references my_reservation (id) on delete restrict on update restrict; create index ix_room_hotel_id on room (hotel_id); alter table room add constraint fk_room_hotel_id foreign key (hotel_id) references hotel (id) on delete restrict on update restrict; create index ix_seat_reservation_id on seat (reservation_id); alter table seat add constraint fk_seat_reservation_id foreign key (reservation_id) references reservation (id) on delete restrict on update restrict; create index ix_seat_flight_class_id on seat (flight_class_id); alter table seat add constraint fk_seat_flight_class_id foreign key (flight_class_id) references flight_class (id) on delete restrict on update restrict; create index ix_seatentertainment_seat on seatentertainment (seat_id); alter table seatentertainment add constraint fk_seatentertainment_seat foreign key (seat_id) references seat (id) on delete restrict on update restrict; create index ix_seatentertainment_entertainment on seatentertainment (entertainment_id); alter table seatentertainment add constraint fk_seatentertainment_entertainment foreign key (entertainment_id) references entertainment (id) on delete restrict on update restrict; create index ix_seatmeal_seat on seatmeal (seat_id); alter table seatmeal add constraint fk_seatmeal_seat foreign key (seat_id) references seat (id) on delete restrict on update restrict; create index ix_seatmeal_meal on seatmeal (meal_id); alter table seatmeal add constraint fk_seatmeal_meal foreign key (meal_id) references meal (id) on delete restrict on update restrict; create index ix_tour_hotel_id on tour (hotel_id); alter table tour add constraint fk_tour_hotel_id foreign key (hotel_id) references hotel (id) on delete restrict on update restrict; create index ix_vechile_fuel_id on vechile (fuel_id); alter table vechile add constraint fk_vechile_fuel_id foreign key (fuel_id) references vechile_fuel (id) on delete restrict on update restrict; create index ix_voyage_price_speed_id on voyage_price (speed_id); alter table voyage_price add constraint fk_voyage_price_speed_id foreign key (speed_id) references vechile_speed (id) on delete restrict on update restrict; create index ix_voyage_price_reservation_id on voyage_price (reservation_id); alter table voyage_price add constraint fk_voyage_price_reservation_id foreign key (reservation_id) references reservation (id) on delete restrict on update restrict;
true
e74eb79f82cb344f2587b3341e03101dc598dc62
SQL
rloaeza/JavaFX-MGM
/server-side/sql/mgm_8_abril.sql
UTF-8
24,448
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1:3306 -- Tiempo de generación: 08-04-2019 a las 16:05:44 -- Versión del servidor: 10.2.17-MariaDB -- Versión de PHP: 7.2.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `u281511508_mgm` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `almacen` -- CREATE TABLE `almacen` ( `idAlmacen` int(11) NOT NULL, `cantidad` double DEFAULT NULL, `fecha` datetime DEFAULT NULL, `autorizado` tinyint(4) DEFAULT NULL, `idProducto` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `caja` -- CREATE TABLE `caja` ( `idCaja` int(11) NOT NULL, `descripcion` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL, `monto` double DEFAULT NULL, `abierto` tinyint(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cajaCorte` -- CREATE TABLE `cajaCorte` ( `idCajaCorte` int(11) NOT NULL, `idCaja` int(11) DEFAULT NULL, `idPersonal` int(11) DEFAULT NULL, `tipo` int(11) DEFAULT NULL, `monto` double DEFAULT NULL, `fecha` date DEFAULT NULL, `hora` time DEFAULT NULL, `idPersonalAut` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `citas` -- CREATE TABLE `citas` ( `idCita` int(11) NOT NULL, `idPaciente` int(11) DEFAULT NULL, `fecha` datetime DEFAULT NULL, `efectuada` tinyint(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `clinicas` -- CREATE TABLE `clinicas` ( `idClinica` int(11) NOT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `calle` text COLLATE utf8_unicode_ci DEFAULT NULL, `colonia` text COLLATE utf8_unicode_ci DEFAULT NULL, `cp` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `telefono` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `estado` text COLLATE utf8_unicode_ci DEFAULT NULL, `pais` text COLLATE utf8_unicode_ci DEFAULT NULL, `titulo` text COLLATE utf8_unicode_ci NOT NULL, `descripcion` text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `cobrosPendientes` -- CREATE TABLE `cobrosPendientes` ( `idCobroPendiente` int(11) NOT NULL, `cantidad` double DEFAULT NULL, `fecha` datetime DEFAULT NULL, `idTratamientoRecetado` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `costoTratamientos` -- CREATE TABLE `costoTratamientos` ( `idCostoTratamiento` int(11) NOT NULL, `costo` double DEFAULT NULL, `fecha` datetime DEFAULT NULL, `idTratamiento` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detallesTratamientos` -- CREATE TABLE `detallesTratamientos` ( `idDetalleTratamiento` int(11) NOT NULL, `idTratamiento` int(11) NOT NULL, `idProducto` int(11) NOT NULL, `cantidad` double DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `fotos` -- CREATE TABLE `fotos` ( `idFoto` int(11) NOT NULL, `archivo` text COLLATE utf8_unicode_ci DEFAULT NULL, `idHistorial` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `historial` -- CREATE TABLE `historial` ( `idHistorial` int(11) NOT NULL, `fecha` datetime DEFAULT NULL, `descripcion` text COLLATE utf8_unicode_ci DEFAULT NULL, `idPaciente` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `horarios` -- CREATE TABLE `horarios` ( `idHorarios` int(11) NOT NULL, `lunes` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `martes` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `miercoles` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `jueves` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `viernes` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `sabado` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `domingo` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `toleranciaEntrada` int(11) DEFAULT NULL, `toleranciaSalida` int(11) DEFAULT NULL, `idPersonal` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pacientes` -- CREATE TABLE `pacientes` ( `idPaciente` int(11) NOT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `apellidos` text COLLATE utf8_unicode_ci DEFAULT NULL, `email` text COLLATE utf8_unicode_ci DEFAULT NULL, `telefono` text COLLATE utf8_unicode_ci DEFAULT NULL, `movil` text COLLATE utf8_unicode_ci DEFAULT NULL, `clave` text COLLATE utf8_unicode_ci DEFAULT NULL, `idClinica` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pagosTratamientos` -- CREATE TABLE `pagosTratamientos` ( `idPagoTratamiento` int(11) NOT NULL, `cantidad` double DEFAULT NULL, `fecha` datetime DEFAULT NULL, `idTratamientoRecetado` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `personal` -- CREATE TABLE `personal` ( `idPersonal` int(11) NOT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `apellidos` text COLLATE utf8_unicode_ci DEFAULT NULL, `email` text COLLATE utf8_unicode_ci DEFAULT NULL, `telefono` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `movil` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `usuario` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `clave` tinytext COLLATE utf8_unicode_ci DEFAULT NULL, `codigo` text COLLATE utf8_unicode_ci NOT NULL, `idClinica` int(11) NOT NULL, `tipo` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `precioProductos` -- CREATE TABLE `precioProductos` ( `idPrecioProducto` int(11) NOT NULL, `precio` double DEFAULT NULL, `fecha` datetime DEFAULT NULL, `idProducto` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- CREATE TABLE `productos` ( `idProducto` int(11) NOT NULL, `clave` text COLLATE utf8_unicode_ci DEFAULT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `descripcion` text COLLATE utf8_unicode_ci DEFAULT NULL, `cantidadMinima` int(11) NOT NULL, `barCode` text COLLATE utf8_unicode_ci DEFAULT NULL, `idTipoProducto` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `relojChecador` -- CREATE TABLE `relojChecador` ( `idRelojChecador` int(11) NOT NULL, `idPersonal` int(11) DEFAULT NULL, `entrada` datetime DEFAULT NULL, `salida` datetime DEFAULT NULL, `toleranciaEntrada` int(11) DEFAULT NULL, `toleranciaSalida` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `servicios` -- CREATE TABLE `servicios` ( `idServicio` int(11) NOT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `descripcion` text COLLATE utf8_unicode_ci DEFAULT NULL, `costo` double DEFAULT NULL, `idClinica` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tiposProductos` -- CREATE TABLE `tiposProductos` ( `idTipoProducto` int(11) NOT NULL, `clave` text COLLATE utf8_unicode_ci DEFAULT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `descripcion` text COLLATE utf8_unicode_ci DEFAULT NULL, `idClinica` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tratamientos` -- CREATE TABLE `tratamientos` ( `idTratamiento` int(11) NOT NULL, `nombre` text COLLATE utf8_unicode_ci DEFAULT NULL, `descripcion` text COLLATE utf8_unicode_ci DEFAULT NULL, `sesiones` int(11) DEFAULT NULL, `caducidad` int(11) DEFAULT NULL, `idClinica` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `tratamientosRecetados` -- CREATE TABLE `tratamientosRecetados` ( `idTratamientoRecetado` int(11) NOT NULL, `sesiones` int(11) DEFAULT NULL, `sesionesTotales` int(11) DEFAULT NULL, `caducidad` datetime DEFAULT NULL, `costo` double NOT NULL, `idTratamiento` int(11) DEFAULT NULL, `idHistorial` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventasProductos` -- CREATE TABLE `ventasProductos` ( `idVentaProductos` int(11) NOT NULL, `fecha` datetime DEFAULT NULL, `cantidadProductos` int(11) DEFAULT NULL, `subtotal` double DEFAULT NULL, `iva` double DEFAULT NULL, `total` double DEFAULT NULL, `idPersonal` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventasProductosDetalles` -- CREATE TABLE `ventasProductosDetalles` ( `idVentaProductosDetalle` int(11) NOT NULL, `cantidad` int(11) DEFAULT NULL, `costo` double DEFAULT NULL, `total` double DEFAULT NULL, `idProducto` int(11) DEFAULT NULL, `idVentasProductos` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `almacen` -- ALTER TABLE `almacen` ADD PRIMARY KEY (`idAlmacen`), ADD KEY `fk_almacen_productos1` (`idProducto`); -- -- Indices de la tabla `caja` -- ALTER TABLE `caja` ADD PRIMARY KEY (`idCaja`); -- -- Indices de la tabla `cajaCorte` -- ALTER TABLE `cajaCorte` ADD PRIMARY KEY (`idCajaCorte`), ADD KEY `fk_cajaCorte_personal1` (`idPersonal`), ADD KEY `fk_cajaCorte_caja1` (`idCaja`), ADD KEY `fk_cajaCorte_personal2` (`idPersonalAut`); -- -- Indices de la tabla `citas` -- ALTER TABLE `citas` ADD PRIMARY KEY (`idCita`), ADD KEY `fk_citas_pacientes1` (`idPaciente`); -- -- Indices de la tabla `clinicas` -- ALTER TABLE `clinicas` ADD PRIMARY KEY (`idClinica`); -- -- Indices de la tabla `cobrosPendientes` -- ALTER TABLE `cobrosPendientes` ADD PRIMARY KEY (`idCobroPendiente`), ADD KEY `fk_cobrosPendientes_tratamientosRecetados1` (`idTratamientoRecetado`); -- -- Indices de la tabla `costoTratamientos` -- ALTER TABLE `costoTratamientos` ADD PRIMARY KEY (`idCostoTratamiento`), ADD KEY `fk_precioTratamientos_tratamientos1` (`idTratamiento`); -- -- Indices de la tabla `detallesTratamientos` -- ALTER TABLE `detallesTratamientos` ADD PRIMARY KEY (`idDetalleTratamiento`), ADD KEY `fk_detallesTratamientos_tratamientos1` (`idTratamiento`), ADD KEY `fk_detallesTratamientos_productos1` (`idProducto`); -- -- Indices de la tabla `fotos` -- ALTER TABLE `fotos` ADD PRIMARY KEY (`idFoto`), ADD KEY `fk_fotos_historial1` (`idHistorial`); -- -- Indices de la tabla `historial` -- ALTER TABLE `historial` ADD PRIMARY KEY (`idHistorial`), ADD KEY `fk_historial_pacientes1` (`idPaciente`); -- -- Indices de la tabla `horarios` -- ALTER TABLE `horarios` ADD PRIMARY KEY (`idHorarios`), ADD UNIQUE KEY `idPersonal` (`idPersonal`); -- -- Indices de la tabla `pacientes` -- ALTER TABLE `pacientes` ADD PRIMARY KEY (`idPaciente`), ADD KEY `fk_pacientes_clinicas1` (`idClinica`); -- -- Indices de la tabla `pagosTratamientos` -- ALTER TABLE `pagosTratamientos` ADD PRIMARY KEY (`idPagoTratamiento`), ADD KEY `fk_pagosTratamientos_tratamientosRecetados1` (`idTratamientoRecetado`); -- -- Indices de la tabla `personal` -- ALTER TABLE `personal` ADD PRIMARY KEY (`idPersonal`), ADD KEY `fk_personal_clinicas1` (`idClinica`); -- -- Indices de la tabla `precioProductos` -- ALTER TABLE `precioProductos` ADD PRIMARY KEY (`idPrecioProducto`), ADD KEY `fk_precios_productos1` (`idProducto`); -- -- Indices de la tabla `productos` -- ALTER TABLE `productos` ADD PRIMARY KEY (`idProducto`), ADD KEY `fk_productos_tiposProductos1` (`idTipoProducto`); -- -- Indices de la tabla `relojChecador` -- ALTER TABLE `relojChecador` ADD PRIMARY KEY (`idRelojChecador`), ADD KEY `fk_relojChecador_personal1` (`idPersonal`); -- -- Indices de la tabla `servicios` -- ALTER TABLE `servicios` ADD PRIMARY KEY (`idServicio`), ADD KEY `fk_servicios_clinicas1` (`idClinica`); -- -- Indices de la tabla `tiposProductos` -- ALTER TABLE `tiposProductos` ADD PRIMARY KEY (`idTipoProducto`), ADD KEY `fk_tiposProductos_clinicas1` (`idClinica`); -- -- Indices de la tabla `tratamientos` -- ALTER TABLE `tratamientos` ADD PRIMARY KEY (`idTratamiento`), ADD KEY `fk_tratamientos_clinicas1` (`idClinica`); -- -- Indices de la tabla `tratamientosRecetados` -- ALTER TABLE `tratamientosRecetados` ADD PRIMARY KEY (`idTratamientoRecetado`), ADD KEY `fk_tratamientosRecetados_historial1` (`idHistorial`), ADD KEY `fk_tratamientosRecetados_tratamientos1` (`idTratamiento`); -- -- Indices de la tabla `ventasProductos` -- ALTER TABLE `ventasProductos` ADD PRIMARY KEY (`idVentaProductos`), ADD KEY `fk_ventasProductos_personal1` (`idPersonal`); -- -- Indices de la tabla `ventasProductosDetalles` -- ALTER TABLE `ventasProductosDetalles` ADD PRIMARY KEY (`idVentaProductosDetalle`), ADD KEY `fk_ventasProductosDetalles_productos1` (`idProducto`), ADD KEY `fk_ventasProductosDetalles_ventasProductos1` (`idVentasProductos`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `almacen` -- ALTER TABLE `almacen` MODIFY `idAlmacen` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `caja` -- ALTER TABLE `caja` MODIFY `idCaja` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `cajaCorte` -- ALTER TABLE `cajaCorte` MODIFY `idCajaCorte` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `citas` -- ALTER TABLE `citas` MODIFY `idCita` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `clinicas` -- ALTER TABLE `clinicas` MODIFY `idClinica` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `cobrosPendientes` -- ALTER TABLE `cobrosPendientes` MODIFY `idCobroPendiente` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `costoTratamientos` -- ALTER TABLE `costoTratamientos` MODIFY `idCostoTratamiento` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detallesTratamientos` -- ALTER TABLE `detallesTratamientos` MODIFY `idDetalleTratamiento` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `fotos` -- ALTER TABLE `fotos` MODIFY `idFoto` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `historial` -- ALTER TABLE `historial` MODIFY `idHistorial` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `horarios` -- ALTER TABLE `horarios` MODIFY `idHorarios` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `pacientes` -- ALTER TABLE `pacientes` MODIFY `idPaciente` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `pagosTratamientos` -- ALTER TABLE `pagosTratamientos` MODIFY `idPagoTratamiento` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `personal` -- ALTER TABLE `personal` MODIFY `idPersonal` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `precioProductos` -- ALTER TABLE `precioProductos` MODIFY `idPrecioProducto` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `productos` -- ALTER TABLE `productos` MODIFY `idProducto` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `relojChecador` -- ALTER TABLE `relojChecador` MODIFY `idRelojChecador` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `servicios` -- ALTER TABLE `servicios` MODIFY `idServicio` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `tiposProductos` -- ALTER TABLE `tiposProductos` MODIFY `idTipoProducto` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `tratamientos` -- ALTER TABLE `tratamientos` MODIFY `idTratamiento` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `tratamientosRecetados` -- ALTER TABLE `tratamientosRecetados` MODIFY `idTratamientoRecetado` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `ventasProductos` -- ALTER TABLE `ventasProductos` MODIFY `idVentaProductos` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `ventasProductosDetalles` -- ALTER TABLE `ventasProductosDetalles` MODIFY `idVentaProductosDetalle` int(11) NOT NULL AUTO_INCREMENT; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `almacen` -- ALTER TABLE `almacen` ADD CONSTRAINT `fk_almacen_productos1` FOREIGN KEY (`idProducto`) REFERENCES `productos` (`idProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `cajaCorte` -- ALTER TABLE `cajaCorte` ADD CONSTRAINT `fk_cajaCorte_caja1` FOREIGN KEY (`idCaja`) REFERENCES `caja` (`idCaja`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_cajaCorte_personal1` FOREIGN KEY (`idPersonal`) REFERENCES `personal` (`idPersonal`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_cajaCorte_personal2` FOREIGN KEY (`idPersonalAut`) REFERENCES `personal` (`idPersonal`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `citas` -- ALTER TABLE `citas` ADD CONSTRAINT `fk_citas_pacientes1` FOREIGN KEY (`idPaciente`) REFERENCES `pacientes` (`idPaciente`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `cobrosPendientes` -- ALTER TABLE `cobrosPendientes` ADD CONSTRAINT `fk_cobrosPendientes_tratamientosRecetados1` FOREIGN KEY (`idTratamientoRecetado`) REFERENCES `tratamientosRecetados` (`idTratamientoRecetado`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `costoTratamientos` -- ALTER TABLE `costoTratamientos` ADD CONSTRAINT `fk_precioTratamientos_tratamientos1` FOREIGN KEY (`idTratamiento`) REFERENCES `tratamientos` (`idTratamiento`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `detallesTratamientos` -- ALTER TABLE `detallesTratamientos` ADD CONSTRAINT `fk_detallesTratamientos_productos1` FOREIGN KEY (`idProducto`) REFERENCES `productos` (`idProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_detallesTratamientos_tratamientos1` FOREIGN KEY (`idTratamiento`) REFERENCES `tratamientos` (`idTratamiento`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `fotos` -- ALTER TABLE `fotos` ADD CONSTRAINT `fk_fotos_historial1` FOREIGN KEY (`idHistorial`) REFERENCES `historial` (`idHistorial`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `historial` -- ALTER TABLE `historial` ADD CONSTRAINT `fk_historial_pacientes1` FOREIGN KEY (`idPaciente`) REFERENCES `pacientes` (`idPaciente`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `horarios` -- ALTER TABLE `horarios` ADD CONSTRAINT `fk_horarios_personal1` FOREIGN KEY (`idPersonal`) REFERENCES `personal` (`idPersonal`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `pacientes` -- ALTER TABLE `pacientes` ADD CONSTRAINT `fk_pacientes_clinicas1` FOREIGN KEY (`idClinica`) REFERENCES `clinicas` (`idClinica`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `pagosTratamientos` -- ALTER TABLE `pagosTratamientos` ADD CONSTRAINT `fk_pagosTratamientos_tratamientosRecetados1` FOREIGN KEY (`idTratamientoRecetado`) REFERENCES `tratamientosRecetados` (`idTratamientoRecetado`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `personal` -- ALTER TABLE `personal` ADD CONSTRAINT `fk_personal_clinicas1` FOREIGN KEY (`idClinica`) REFERENCES `clinicas` (`idClinica`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `precioProductos` -- ALTER TABLE `precioProductos` ADD CONSTRAINT `fk_precios_productos1` FOREIGN KEY (`idProducto`) REFERENCES `productos` (`idProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `productos` -- ALTER TABLE `productos` ADD CONSTRAINT `fk_productos_tiposProductos1` FOREIGN KEY (`idTipoProducto`) REFERENCES `tiposProductos` (`idTipoProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `relojChecador` -- ALTER TABLE `relojChecador` ADD CONSTRAINT `fk_relojChecador_personal1` FOREIGN KEY (`idPersonal`) REFERENCES `personal` (`idPersonal`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `servicios` -- ALTER TABLE `servicios` ADD CONSTRAINT `fk_servicios_clinicas1` FOREIGN KEY (`idClinica`) REFERENCES `clinicas` (`idClinica`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `tiposProductos` -- ALTER TABLE `tiposProductos` ADD CONSTRAINT `fk_tiposProductos_clinicas1` FOREIGN KEY (`idClinica`) REFERENCES `clinicas` (`idClinica`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `tratamientos` -- ALTER TABLE `tratamientos` ADD CONSTRAINT `fk_tratamientos_clinicas1` FOREIGN KEY (`idClinica`) REFERENCES `clinicas` (`idClinica`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `tratamientosRecetados` -- ALTER TABLE `tratamientosRecetados` ADD CONSTRAINT `fk_tratamientosRecetados_historial1` FOREIGN KEY (`idHistorial`) REFERENCES `historial` (`idHistorial`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_tratamientosRecetados_tratamientos1` FOREIGN KEY (`idTratamiento`) REFERENCES `tratamientos` (`idTratamiento`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `ventasProductos` -- ALTER TABLE `ventasProductos` ADD CONSTRAINT `fk_ventasProductos_personal1` FOREIGN KEY (`idPersonal`) REFERENCES `personal` (`idPersonal`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `ventasProductosDetalles` -- ALTER TABLE `ventasProductosDetalles` ADD CONSTRAINT `fk_ventasProductosDetalles_productos1` FOREIGN KEY (`idProducto`) REFERENCES `productos` (`idProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_ventasProductosDetalles_ventasProductos1` FOREIGN KEY (`idVentasProductos`) REFERENCES `ventasProductos` (`idVentaProductos`) ON DELETE NO ACTION ON UPDATE NO ACTION; 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
72c9226e9f6dabda8a32858d04244cb9d869646f
SQL
MichaelGuerfi9/michael.guerfi.dev2018-my_blog
/bdd/pokemaniac.sql
UTF-8
4,127
3.515625
4
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Client : 127.0.0.1 -- Généré le : Jeu 03 Mars 2016 à 19:47 -- Version du serveur : 5.6.17 -- Version de PHP : 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de données : `pokemaniac` -- -- -------------------------------------------------------- -- -- Structure de la table `article` -- CREATE TABLE IF NOT EXISTS `article` ( `art_id` int(11) NOT NULL AUTO_INCREMENT, `art_title` tinytext NOT NULL, `art_content` longtext NOT NULL, `art_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `art_use_id` int(11) NOT NULL, PRIMARY KEY (`art_id`), KEY `id` (`art_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Contenu de la table `article` -- INSERT INTO `article` (`art_id`, `art_title`, `art_content`, `art_date`, `art_use_id`) VALUES (1, 'Ouverture du site', 'Bonjour et Bienvenue sur le site de PokéManiac.', '2016-02-08 16:52:13', 3), (2, 'Test', 'Test', '2016-02-08 16:53:46', 2); -- -------------------------------------------------------- -- -- Structure de la table `commentary` -- CREATE TABLE IF NOT EXISTS `commentary` ( `com_id` int(11) NOT NULL AUTO_INCREMENT, `com_content` text NOT NULL, `com_use_id` int(11) NOT NULL, `com_art_id` int(11) NOT NULL, PRIMARY KEY (`com_id`), KEY `id` (`com_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Contenu de la table `commentary` -- INSERT INTO `commentary` (`com_id`, `com_content`, `com_use_id`, `com_art_id`) VALUES (1, 'First', 2, 1), (2, 'Second', 1, 1), (3, 'Bonjour les amis !', 1, 1), (6, 'OKAYYYY', 6, 2), (7, 'Mange Groslard', 2, 2); -- -------------------------------------------------------- -- -- Structure de la table `picture` -- CREATE TABLE IF NOT EXISTS `picture` ( `pic_id` int(11) NOT NULL AUTO_INCREMENT, `pic_url` varchar(255) NOT NULL, `pic_art_id` int(11) NOT NULL, PRIMARY KEY (`pic_id`), KEY `id` (`pic_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Structure de la table `role` -- CREATE TABLE IF NOT EXISTS `role` ( `rol_id` int(11) NOT NULL AUTO_INCREMENT, `rol_designation` varchar(255) NOT NULL, PRIMARY KEY (`rol_id`), KEY `id` (`rol_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Contenu de la table `role` -- INSERT INTO `role` (`rol_id`, `rol_designation`) VALUES (1, 'User'), (2, 'Blogger'), (3, 'SuperAdmin'); -- -------------------------------------------------------- -- -- Structure de la table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `use_id` int(11) NOT NULL AUTO_INCREMENT, `use_login` varchar(255) NOT NULL, `use_password` varchar(255) NOT NULL, `use_email` varchar(255) NOT NULL, `use_rol_id` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`use_id`), KEY `id` (`use_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; -- -- Contenu de la table `user` -- INSERT INTO `user` (`use_id`, `use_login`, `use_password`, `use_email`, `use_rol_id`) VALUES (1, 'Jean-Guy', '7c4a8d09ca3762af61e59520943dc26494f8941b', 'jeanguy@gmail.com', 1), (2, 'Darky', '9cf95dacd226dcf43da376cdb6cbba7035218921', 'darky99@hotmail.fr', 1), (3, 'Roger11', 'b1b3773a05c0ed0176787a4f1574ff0075f7521e', 'roger11@hotmail.fr', 2), (4, 'Gladuis91', '209dcec5dd77ecfe2d66247ff1d66db31063b1bf', 'glad91@gmail.com', 2), (5, 'Bernard', '61ddf0cbcfa30e54c3bcd765bd4390140b1a64f1', 'bernard.lemaitre@yahoo.com', 1), (6, 'GodArceus', '153d4e08d617daec5ae3410758aaa3e2213fe279', 'godarceus@outlook.fr', 3), (7, '', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', '', 1), (8, '', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', '', 1), (9, '', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', '', 1), (10, '', 'da39a3ee5e6b4b0d3255bfef95601890afd80709', '', 1), (11, 'Zard', 'b1b3773a05c0ed0176787a4f1574ff0075f7521e', 'zard@hotmail.fr', 1), (12, 'DoWan', '439551bbb04c79f6b71ff9fc71752c562f954dfb', 'dowan@gmail.com', 1); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
7bac243b8dbe5f39bbbdc56ac0ed1b05a4604b5b
SQL
Zielzor/BiqQuery
/AA_2.0/Untitled-1a.sql
UTF-8
1,382
3.09375
3
[]
no_license
CREATE OR REPLACE TABLE `ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL_done` as SELECT a.Order_number, a.Sales_Organization, b.productNo_key FROM `ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL` as a LEFT JOIN `conrad-cbdp-prod-core.de_conrad_dwh1000_dwh_FactSales.FactSales` as b on cast(a.Order_number as STRING) = b.orderNo WHERE PARTITIONDATE >= "2019-12-29" AND b.date_key>=20191229; --------------- CREATE OR REPLACE TABLE `ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL_done` as SELECT a.Order_number, a.Sales_Organization, a.productNo_key, matClass_key, matClassDescEng, ordinate_key, ordinateDescEng, category_key, categoryDescEng FROM`ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL_done` as a LEFT JOIN `conrad-cbdp-prod-core.de_conrad_dwh1000_dwh_DimProductHierarchy.DimProductHierarchy` as b on a.productNo_key = b.productNo_key WHERE flagActive != 0 AND a.productNo_key != "$$$$$$"; ------------------------------------ CREATE OR REPLACE TABLE `ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL_done2` as SELECT DISTINCT a.Order_number, a.Sales_Organization, a.productNo_key, productDescEng , a.matClass_key, matClassDescEng, ordinate_key, ordinateDescEng, category_key, categoryDescEng FROM `ceeregion-prod.AA_OpenOrders.OpenOrders_CEPL_done`as a LEFT JOIN `conrad-cbdp-prod-core.de_conrad_dwh1000_dwh_DimProduct.DimProduct` as b ON a.productNo_key = b.productNo_key
true
f4fa1e384236b9500bef0726ab2a46e68b33d0e5
SQL
takooya/dynamic_base
/src/test/java/com/dynamic/springboot/sql/test_table_ddl.sql
UTF-8
389
2.953125
3
[]
no_license
drop table if exists users; create table users ( id bigint auto_increment, name varchar(255), create_time timestamp, primary key (id) ); drop table if exists goods; create table goods ( id bigint auto_increment, name varchar(255), price bigint, create_time timestamp, update_time timestamp, primary key (id) );
true
fe56a26ee9cd25ce6b255102ac322b52c242cde4
SQL
kapeeshs/demoipl-database-management
/SQL File/demoipl.sql
UTF-8
38,182
2.78125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 01, 2017 at 06:58 PM -- Server version: 5.5.16 -- PHP Version: 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 */; -- -- Database: `demoipl` -- -- -------------------------------------------------------- -- -- Table structure for table `auctions` -- CREATE TABLE IF NOT EXISTS `auctions` ( `player_id` int(10) unsigned NOT NULL, `team_id` int(10) unsigned NOT NULL DEFAULT '11', `bid_amt` int(10) unsigned NOT NULL DEFAULT '12000000', PRIMARY KEY (`player_id`,`team_id`), KEY `team_id` (`team_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `auctions` -- INSERT INTO `auctions` (`player_id`, `team_id`, `bid_amt`) VALUES (2, 1, 12000000), (3, 1, 12000000), (4, 1, 12000000), (5, 1, 12000000), (6, 1, 12000000), (7, 1, 12000000), (8, 1, 12000000), (9, 1, 12000000), (10, 1, 12000000), (11, 1, 12000000), (12, 1, 12000000), (13, 1, 12000000), (14, 1, 12000000), (15, 1, 12000000), (16, 1, 12000000), (17, 1, 38000000), (18, 1, 25000000), (19, 1, 12000000), (20, 1, 20000000), (21, 1, 12000000), (22, 9, 12000000), (23, 9, 12000000), (24, 9, 12000000), (25, 9, 12000000), (26, 9, 12000000), (27, 9, 12000000), (28, 9, 12000000), (29, 9, 12000000), (30, 9, 12000000), (31, 9, 12000000), (32, 9, 12000000), (33, 9, 95000000), (34, 9, 20000000), (35, 9, 12000000), (36, 9, 5000000), (37, 9, 1000000), (38, 9, 12000000), (39, 9, 12000000), (40, 9, 12000000), (41, 9, 12000000), (42, 2, 12000000), (43, 2, 12000000), (44, 2, 12000000), (45, 2, 12000000), (46, 2, 12000000), (47, 2, 12000000), (48, 2, 12000000), (49, 2, 12000000), (50, 2, 12000000), (51, 2, 12000000), (52, 2, 12000000), (53, 2, 12000000), (54, 2, 12000000), (55, 2, 12000000), (56, 10, 12000000), (57, 10, 12000000), (58, 10, 12000000), (59, 10, 12000000), (60, 10, 12000000), (61, 10, 12000000), (62, 10, 12000000), (63, 10, 12000000), (64, 10, 12000000), (65, 10, 12000000), (66, 10, 42000000), (67, 10, 70000000), (68, 10, 42000000), (69, 10, 40000000), (70, 10, 19000000), (71, 10, 12000000), (72, 10, 12000000), (73, 10, 12000000), (74, 8, 12000000), (75, 8, 12000000), (76, 8, 12000000), (77, 8, 12000000), (78, 8, 12000000), (79, 8, 12000000), (80, 8, 12000000), (81, 8, 12000000), (82, 8, 12000000), (83, 8, 12000000), (84, 8, 12000000), (85, 8, 12000000), (86, 8, 65000000), (87, 8, 12000000), (88, 8, 12000000), (89, 8, 12000000), (90, 8, 12000000), (91, 8, 12000000), (92, 8, 12000000), (93, 13, 12000000), (94, 13, 12000000), (95, 13, 12000000), (96, 13, 12000000), (97, 13, 12000000), (98, 13, 12000000), (99, 13, 12000000), (100, 13, 12000000), (101, 13, 12000000), (102, 13, 55000000), (103, 13, 70000000), (104, 13, 12000000), (105, 13, 12000000), (106, 13, 14000000), (107, 13, 12000000), (108, 13, 42000000), (109, 13, 3500000), (110, 12, 12000000), (111, 12, 12000000), (112, 12, 12000000), (113, 12, 12000000), (114, 12, 12000000), (115, 12, 48000000), (116, 12, 12000000), (117, 12, 12000000), (118, 12, 12000000), (119, 12, 12000000), (120, 12, 12000000), (121, 12, 12000000), (122, 12, 12000000), (123, 12, 12000000), (124, 12, 12000000), (125, 12, 12000000), (126, 11, 12000000), (127, 11, 12000000), (128, 11, 12000000), (129, 11, 12000000), (130, 11, 12000000), (131, 11, 12000000), (132, 11, 23000000), (133, 11, 23000000), (134, 11, 20000000), (135, 11, 35000000), (136, 11, 12000000), (137, 11, 12000000), (138, 11, 12000000), (139, 11, 12000000), (140, 11, 12000000), (141, 11, 12000000), (142, 11, 12000000); -- -------------------------------------------------------- -- -- Table structure for table `coaches` -- CREATE TABLE IF NOT EXISTS `coaches` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `person_id` int(10) unsigned NOT NULL, `experience` tinyint(4) NOT NULL DEFAULT '20', PRIMARY KEY (`id`), KEY `person_id` (`person_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `coaches` -- INSERT INTO `coaches` (`id`, `person_id`, `experience`) VALUES (1, 154, 20), (2, 155, 20), (3, 156, 20), (4, 157, 20), (5, 158, 20), (6, 159, 20), (7, 160, 20), (8, 161, 20); -- -------------------------------------------------------- -- -- Table structure for table `fixtures` -- CREATE TABLE IF NOT EXISTS `fixtures` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `date_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `team1_id` int(10) unsigned NOT NULL, `team2_id` int(10) unsigned NOT NULL, `venue_id` int(10) unsigned NOT NULL, `umpire_id` int(10) unsigned NOT NULL, `completed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `team1_id` (`team1_id`), KEY `team2_id` (`team2_id`), KEY `venue_id` (`venue_id`), KEY `umpire_id` (`umpire_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=66 ; -- -- Dumping data for table `fixtures` -- INSERT INTO `fixtures` (`id`, `date_time`, `team1_id`, `team2_id`, `venue_id`, `umpire_id`, `completed`) VALUES (5, '2017-04-05 14:30:00', 9, 13, 8, 2, 0), (6, '2017-04-06 02:30:00', 1, 12, 7, 3, 0), (7, '2017-04-07 02:30:00', 2, 11, 6, 4, 0), (8, '2017-04-08 10:30:00', 8, 12, 9, 5, 0), (9, '2017-04-08 14:30:00', 9, 10, 4, 2, 0), (10, '2017-04-09 10:30:00', 11, 13, 8, 1, 0), (11, '2017-04-09 14:30:00', 1, 2, 1, 2, 0), (12, '2017-04-10 14:30:00', 8, 9, 9, 3, 0), (13, '2017-04-11 14:30:00', 10, 12, 7, 4, 0), (14, '2017-04-12 14:30:00', 1, 13, 1, 2, 0), (15, '2017-04-13 14:30:00', 2, 8, 2, 1, 0), (16, '2017-04-14 10:30:00', 1, 9, 4, 2, 0), (17, '2017-04-14 14:30:00', 11, 12, 6, 2, 0), (18, '2017-04-15 10:30:00', 2, 13, 2, 3, 0), (19, '2017-04-15 14:30:00', 8, 10, 5, 3, 0), (20, '2017-04-16 10:30:00', 1, 11, 1, 4, 0), (21, '2017-04-16 14:30:00', 9, 12, 4, 3, 0), (22, '2017-04-17 10:30:00', 2, 10, 5, 2, 0), (23, '2017-04-17 14:30:00', 8, 13, 8, 2, 0), (24, '2017-04-18 14:30:00', 9, 11, 6, 2, 0), (25, '2017-04-19 14:30:00', 10, 13, 8, 1, 0), (26, '2017-04-20 14:30:00', 1, 8, 8, 5, 0), (27, '2017-04-21 14:30:00', 2, 11, 2, 4, 0), (28, '2017-04-22 10:30:00', 1, 10, 5, 1, 0), (29, '2017-04-22 14:30:00', 12, 13, 7, 4, 0), (32, '2017-04-23 10:30:00', 8, 11, 6, 2, 0), (33, '2017-04-23 14:30:00', 2, 9, 2, 4, 0), (34, '2017-04-24 14:30:00', 1, 12, 1, 1, 0), (35, '2017-04-25 14:30:00', 9, 13, 4, 3, 0), (36, '2017-04-26 14:30:00', 2, 12, 7, 1, 0), (37, '2017-04-27 14:30:00', 11, 9, 4, 3, 0), (39, '2017-04-28 10:30:00', 2, 10, 2, 2, 0), (40, '2017-04-28 14:30:00', 8, 12, 3, 2, 0), (41, '2017-04-29 10:30:00', 9, 12, 7, 4, 0), (42, '2017-04-29 14:30:00', 1, 11, 6, 5, 0), (43, '2017-04-30 10:30:00', 8, 10, 3, 4, 0), (44, '2017-04-30 14:30:00', 2, 13, 8, 4, 0), (45, '2017-05-01 10:30:00', 1, 9, 1, 3, 0), (46, '2017-05-01 14:30:00', 11, 12, 7, 4, 0), (47, '2017-05-02 14:30:00', 10, 13, 5, 4, 0), (48, '2017-05-03 14:30:00', 2, 12, 2, 2, 0), (49, '2017-05-04 14:30:00', 10, 11, 5, 2, 0), (50, '2017-04-05 14:30:00', 8, 9, 4, 2, 0), (51, '2017-05-06 10:30:00', 12, 13, 8, 2, 0), (52, '2017-05-06 14:30:00', 1, 10, 1, 2, 0), (53, '2017-05-07 10:30:00', 2, 9, 4, 3, 0), (54, '2017-05-07 14:30:00', 8, 11, 3, 2, 0), (55, '2017-05-08 14:30:00', 1, 13, 8, 3, 0), (58, '2017-05-09 14:30:00', 2, 8, 3, 2, 0), (59, '2017-05-10 14:30:00', 10, 11, 10, 3, 0), (60, '2017-05-11 14:30:00', 1, 8, 1, 2, 0), (61, '2017-05-12 14:30:00', 10, 12, 5, 3, 0), (62, '2017-05-13 10:30:00', 11, 13, 10, 4, 0), (63, '2017-05-13 14:30:00', 1, 2, 2, 3, 0), (64, '2017-05-14 10:30:00', 12, 8, 7, 3, 0), (65, '2017-05-14 14:30:00', 9, 10, 5, 2, 0); -- -------------------------------------------------------- -- -- Table structure for table `matches` -- CREATE TABLE IF NOT EXISTS `matches` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `fixture_id` int(10) unsigned NOT NULL, `winning_team_id` int(10) unsigned DEFAULT NULL, `man_of_match_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `fixture_id` (`fixture_id`), KEY `winning_team_id` (`winning_team_id`), KEY `man_of_match_id` (`man_of_match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -- -- Dumping data for table `matches` -- INSERT INTO `matches` (`id`, `fixture_id`, `winning_team_id`, `man_of_match_id`) VALUES (1, 5, 13, 103), (2, 6, 12, 113), (3, 7, 2, 51), (4, 8, 8, 77), (5, 9, 9, 32), (6, 10, 13, 95), (7, 11, 1, 13), (8, 12, 8, 76), (9, 13, 10, 66), (10, 14, 1, 7); -- -------------------------------------------------------- -- -- Table structure for table `owners` -- CREATE TABLE IF NOT EXISTS `owners` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `person_id` int(10) unsigned NOT NULL, `profession` varchar(50) NOT NULL, PRIMARY KEY (`id`), KEY `person_id` (`person_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `owners` -- INSERT INTO `owners` (`id`, `person_id`, `profession`) VALUES (1, 146, 'Businessman'), (2, 147, 'Bollywood Actor'), (3, 148, 'Bollywood Actress'), (4, 149, 'Businessman'), (5, 150, 'Businessman'), (6, 151, 'Businessman'), (7, 152, 'Businessman'), (8, 153, 'Businessman'); -- -------------------------------------------------------- -- -- Table structure for table `persons` -- CREATE TABLE IF NOT EXISTS `persons` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `F_name` varchar(200) NOT NULL DEFAULT 'Sample', `L_name` varchar(200) NOT NULL DEFAULT 'Player', `nationality` varchar(20) NOT NULL, `dob` date DEFAULT '1980-01-01', `photo_url` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=167 ; -- -- Dumping data for table `persons` -- INSERT INTO `persons` (`id`, `F_name`, `L_name`, `nationality`, `dob`, `photo_url`) VALUES (5, 'Rohit', 'Sharma', 'Indian', '1981-01-01', 'NA'), (6, 'Kieron', 'Pollard', 'West Indies', '1981-01-01', 'NA'), (7, 'Lasith', 'Malinga', 'SRI LANKA', '1981-01-01', 'NA'), (8, 'Harbhajan', 'Singh', 'Indian', '1981-01-01', 'NA'), (9, 'Ambati', 'Rayudu', 'Indian', '1981-01-01', 'NA'), (10, 'Jasprit', 'Bumrah', 'Indian', '1981-01-01', 'NA'), (11, 'Shreyas', 'Gopal', 'Indian', '1981-01-01', 'NA'), (12, 'Lendl', 'Simmons', 'West Indies', '1981-01-01', 'NA'), (13, 'Ranganath Vinay', 'Kumar', 'Indian', '1981-01-01', 'NA'), (14, 'Parthiv', 'Patel', 'Indian', '1981-01-01', 'NA'), (15, 'Mitchell', 'McClenaghan', 'Newzealand', '1981-01-01', 'NA'), (16, 'Nitish', 'Rana', 'Indian', '1981-01-01', 'NA'), (17, 'Siddhesh Dinesh', 'Lad', 'Indian', '1981-01-01', 'NA'), (18, 'J', 'Suchith', 'Indian', '1981-01-01', 'NA'), (19, 'Hardik', 'Pandya', 'Indian', '1981-01-01', 'NA'), (20, 'Jos', 'Buttler', 'England', '1981-01-01', 'NA'), (21, 'Tim', 'Southee', 'Newzealand', '1981-01-01', 'NA'), (22, 'Jitesh', 'Sharma', 'Indian', '1981-01-01', 'NA'), (23, 'Krunal', 'Pandya', 'Indian', '1981-01-01', 'NA'), (24, 'Deepak', 'Punia', 'Indian', '1981-01-01', 'NA'), (25, 'Virat', 'Kohli', 'Indian', '1981-01-01', 'NA'), (26, 'AB de', 'Villiers', 'SouthAfrica', '1981-01-01', 'NA'), (27, 'Chris', 'Gayle', 'West Indies', '1981-01-01', 'NA'), (28, 'Mitchell', 'Starc', 'Australia', '1981-01-01', 'NA'), (29, 'Yuzvendra Singh', 'Chahal', 'Indian', '1981-01-01', 'NA'), (30, 'Harshal', 'Patel', 'Indian', '1981-01-01', 'NA'), (31, 'Mandeep Hardev', 'Singh', 'Indian', '1981-01-01', 'NA'), (32, 'Adam', 'Milne', 'Newzealand', '1981-01-01', 'NA'), (33, 'Sarfaraz Naushad', 'Khan', 'Indian', '1981-01-01', 'NA'), (34, 'Sreenath', 'Arvind', 'Indian', '1981-01-01', 'NA'), (35, 'Kedar', 'Jadhav', 'Indian', '1981-01-01', 'NA'), (36, 'Shane', 'Watson', 'Australia', '1981-01-01', 'NA'), (37, 'Stuart', 'Binny', 'Indian', '1981-01-01', 'NA'), (38, 'Samuel', 'Badree', 'West Indies', '1981-01-01', 'NA'), (39, 'Travis', 'Head', 'Australia', '1981-01-01', 'NA'), (40, 'Sachin', 'Baby', 'Indian', '1981-01-01', 'NA'), (41, 'Iqbal', 'Abdullah', 'Indian', '1981-01-01', 'NA'), (42, 'KL', 'Rahul', 'Indian', '1981-01-01', 'NA'), (43, 'Avesh', 'Khan', 'Indian', '1981-01-01', 'NA'), (44, 'Tabraiz', 'Shamsi', 'SouthAfrica', '1981-01-01', 'NA'), (45, 'Gautam', 'Gambhir', 'Indian', '1981-01-01', 'NA'), (46, 'Sunil', 'Narine', 'West Indies', '1981-01-01', 'NA'), (47, 'Andre', 'Russell', 'West Indies', '1981-01-01', 'NA'), (48, 'Kuldeep Singh', 'Yadav', 'Indian', '1981-01-01', 'NA'), (49, 'Manish', 'Pandey', 'Indian', '1981-01-01', 'NA'), (50, 'Suryakumar', 'Yadav', 'Indian', '1981-01-01', 'NA'), (51, 'Piyush', 'Chawla', 'Indian', '1981-01-01', 'NA'), (52, 'Robin', 'Uthappa', 'Indian', '1981-01-01', 'NA'), (53, 'Shakib Al', 'Hasan', 'Bangladesh', '1981-01-01', 'NA'), (54, 'Chris', 'Lynn', 'Australia', '1981-01-01', 'NA'), (55, 'Umesh', 'Yadav', 'Indian', '1981-01-01', 'NA'), (56, 'Yusuf', 'Pathan', 'Indian', '1981-01-01', 'NA'), (57, 'Sheldon', 'Jackson', 'Indian', '1981-01-01', 'NA'), (58, 'Ankit Singh', 'Rajpoot', 'Indian', '1981-01-01', 'NA'), (59, 'Jean-Paul', 'Duminy', 'SouthAfrica', '1981-01-01', 'NA'), (60, 'Mohammad', 'Shami', 'Indian', '1981-01-01', 'NA'), (61, 'Quinton de', 'Kock', 'SouthAfrica', '1981-01-01', 'NA'), (62, 'Shahbaz', 'Nadeem', 'Indian', '1981-01-01', 'NA'), (63, 'Mayank', 'Agarwal', 'Indian', '1981-01-01', 'NA'), (64, 'Jayant', 'Yadav', 'Indian', '1981-01-01', 'NA'), (65, 'Amit', 'Mishra', 'Indian', '1981-01-01', 'NA'), (66, 'Shreyas', 'Iyer', 'Indian', '1981-01-01', 'NA'), (67, 'Zaheer', 'Khan', 'Indian', '1981-01-01', 'NA'), (68, 'Sam', 'Billings', 'England', '1981-01-01', 'NA'), (69, 'Sanju', 'Samson', 'Indian', '1981-01-01', 'NA'), (70, 'Christopher', 'Morris', 'SouthAfrica', '1981-01-01', 'NA'), (71, 'Carlos', 'Brathwaite', 'West Indies', '1981-01-01', 'NA'), (72, 'Karun', 'Nair', 'Indian', '1981-01-01', 'NA'), (73, 'Rishabh', 'Pant', 'Indian', '1981-01-01', 'NA'), (74, 'C.V.', 'Milind', 'Indian', '1981-01-01', 'NA'), (75, 'Syed Khaleel', 'Ahmed', 'Indian', '1981-01-01', 'NA'), (76, 'Pratyush', 'Singh', 'Indian', '1981-01-01', 'NA'), (77, 'David', 'Miller', 'SouthAfrica', '1981-01-01', 'NA'), (78, 'Manan', 'Vohra', 'Indian', '1981-01-01', 'NA'), (79, 'Akshar Rajesh', 'Patel', 'Indian', '1981-01-01', 'NA'), (80, 'Glenn', 'Maxwell', 'Australia', '1981-01-01', 'NA'), (81, 'Gurkeerat Mann', 'Singh', 'Indian', '1981-01-01', 'NA'), (82, 'Anureet', 'Singh', 'Indian', '1981-01-01', 'NA'), (83, 'Sandeep', 'Sharma', 'Indian', '1981-01-01', 'NA'), (84, 'Shardul Narendra', 'Thakur', 'Indian', '1981-01-01', 'NA'), (85, 'Shaun', 'Marsh', 'Australia', '1981-01-01', 'NA'), (86, 'Wriddhiman', 'Saha', 'Indian', '1981-01-01', 'NA'), (87, 'Murali', 'Vijay', 'Indian', '1981-01-01', 'NA'), (88, 'Nikhil Shankar', 'Naik', 'Indian', '1981-01-01', 'NA'), (89, 'Mohit', 'Sharma', 'Indian', '1981-01-01', 'NA'), (90, 'Marcus', 'Stoinis', 'Australia', '1981-01-01', 'NA'), (91, 'K.C.', 'Cariappa', 'Indian', '1981-01-01', 'NA'), (92, 'Armaan', 'Jaffer', 'Indian', '1981-01-01', 'NA'), (93, 'Pardeep', 'Sahu', 'Indian', '1981-01-01', 'NA'), (94, 'Swapnil', 'Singh', 'Indian', '1981-01-01', 'NA'), (95, 'Hashim', 'Amla', 'SouthAfrica', '1981-01-01', 'NA'), (96, 'Shikhar', 'Dhawan', 'Indian', '1981-01-01', 'NA'), (97, 'Bhuvneshwar', 'Kumar', 'Indian', '1981-01-01', 'NA'), (98, 'David', 'Warner', 'Australia', '1981-01-01', 'NA'), (99, 'Moises', 'Henriques', 'Australia', '1981-01-01', 'NA'), (100, 'Naman', 'Ojha', 'Indian', '1981-01-01', 'NA'), (101, 'Ricky', 'Bhui', 'Indian', '1981-01-01', 'NA'), (102, 'Kane', 'Williamson', 'Newzealand', '1981-01-01', 'NA'), (103, 'Siddarth', 'Kaul', 'Indian', '1981-01-01', 'NA'), (104, 'Bipul', 'Sharma', 'Indian', '1981-01-01', 'NA'), (105, 'Ashish', 'Nehra', 'Indian', '1981-01-01', 'NA'), (106, 'Yuvraj', 'Singh', 'Indian', '1981-01-01', 'NA'), (107, 'Ben', 'Cutting', 'Australia', '1981-01-01', 'NA'), (108, 'Abhimanyu', 'Mithun', 'Indian', '1981-01-01', 'NA'), (109, 'Mustafizur', 'Rahman', 'Bangladesh', '1981-01-01', 'NA'), (110, 'Barinder Singh', 'Sran', 'Indian', '1981-01-01', 'NA'), (111, 'Deepak', 'Hooda', 'Indian', '1981-01-01', 'NA'), (112, 'Vijay', 'Shankar', 'Indian', '1981-01-01', 'NA'), (113, 'MS', 'Dhoni', 'Indian', '1981-01-01', 'NA'), (114, 'Ajinkya', 'Rahane', 'Indian', '1981-01-01', 'NA'), (115, 'R', 'Ashwin', 'Indian', '1981-01-01', 'NA'), (116, 'Steven', 'Smith', 'Australia', '1981-01-01', 'NA'), (117, 'Faf Du', 'Plessis', 'SouthAfrica', '1981-01-01', 'NA'), (118, 'Mitchell', 'Marsh', 'Australia', '1981-01-01', 'NA'), (119, 'Ashok', 'Dinda', 'Indian', '1981-01-01', 'NA'), (120, 'Ankush', 'Bains', 'Indian', '1981-01-01', 'NA'), (121, 'Rajat', 'Bhatia', 'Indian', '1981-01-01', 'NA'), (122, 'Ankit', 'Sharma', 'Indian', '1981-01-01', 'NA'), (123, 'Ishwar', 'Pandey', 'Indian', '1981-01-01', 'NA'), (124, 'Adam', 'Zampa', 'Australia', '1981-01-01', 'NA'), (125, 'Jaskaran', 'Singh', 'Indian', '1981-01-01', 'NA'), (126, 'Baba', 'Aparajith', 'Indian', '1981-01-01', 'NA'), (127, 'Deepak', 'Chahar', 'Indian', '1981-01-01', 'NA'), (128, 'Usman', 'Khwaja', 'Indian', '1981-01-01', 'NA'), (129, 'Suresh', 'Raina', 'Indian', '1981-01-01', 'NA'), (130, 'Ravindra', 'Jadeja', 'Indian', '1981-01-01', 'NA'), (131, 'James', 'Faulkner', 'Australia', '1981-01-01', 'NA'), (132, 'Brendon', 'McCullum', 'Newzealand', '1981-01-01', 'NA'), (133, 'Dwayne', 'Bravo', 'West Indies', '1981-01-01', 'NA'), (134, 'Aaron', 'Finch', 'Australia', '1981-01-01', 'NA'), (135, 'Dwayne', 'Smith', 'West Indies', '1981-01-01', 'NA'), (136, 'Dinesh', 'Karthik', 'Indian', '1981-01-01', 'NA'), (137, 'Dhawal', 'Kulkarni', 'Indian', '1981-01-01', 'NA'), (138, 'Praveen', 'Kumar', 'Indian', '1981-01-01', 'NA'), (139, 'Andrew', 'Tye', 'Australia', '1981-01-01', 'NA'), (140, 'Ishan', 'Kishan', 'Indian', '1981-01-01', 'NA'), (141, 'Pradeep', 'Sangwan', 'Indian', '1981-01-01', 'NA'), (142, 'Shivil', 'Kaushik', 'Indian', '1981-01-01', 'NA'), (143, 'Shadab', 'Jakati', 'Indian', '1981-01-01', 'NA'), (144, 'Ben', 'Stokes', 'England', '1981-01-01', 'NA'), (145, 'Jaydev', 'Shah', 'Indian', '1981-01-01', 'NA'), (146, 'Nita', 'Ambani', 'Indian', '1963-11-01', 'NA'), (147, 'Shahrukh', 'Khan', 'Indian', '1981-01-01', 'NA'), (148, 'Preity', 'Zinta', 'Indian', '1981-01-01', 'NA'), (149, 'Keshav', 'Bansal', 'Indian', '1981-01-01', 'NA'), (150, 'Kalanithi', 'Maran', 'Indian', '1981-01-01', 'NA'), (151, 'Vijay', 'Mallya', 'Indian', '1981-01-01', 'NA'), (152, 'G.M.', 'Rao', 'Indian', '1981-01-01', 'NA'), (153, 'Sanjiv', 'Goenka', 'Indian', '1981-01-01', 'NA'), (154, 'Ricky', 'Ponting', 'Australia', '1981-01-01', 'NA'), (155, 'Jacques', 'Kallis', 'SouthAfrica', '1981-01-01', 'NA'), (156, 'Paddy', 'Upton', 'SouthAfrica', '1981-01-01', 'NA'), (157, 'Sanjay', 'Bangar', 'Indian', '1981-01-01', 'NA'), (158, 'Daniel', 'Vettori', 'Newzealand', '1981-01-01', 'NA'), (159, 'Tom', 'Moody', 'Australia', '1981-01-01', 'NA'), (160, 'Stephen', 'Fleming', 'Newzealand', '1981-01-01', 'NA'), (161, 'Brad', 'Hodge', 'Australia', '1981-01-01', 'NA'), (162, 'Simon', 'Taufel', 'Australia', '1971-01-21', NULL), (163, 'Billy', 'Bowden', 'Newzealand', '1963-04-11', NULL), (164, 'Kumar', 'Dharmasena', 'SRI LANKA', '1971-04-24', NULL), (165, 'Ian', 'Gould', 'England', '1957-08-19', NULL), (166, 'Anil', 'Chaudhary', 'Indian', '1965-03-12', NULL); -- -------------------------------------------------------- -- -- Table structure for table `players` -- CREATE TABLE IF NOT EXISTS `players` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `person_id` int(10) unsigned NOT NULL, `matches_played` smallint(5) unsigned DEFAULT '0', `total_runs` smallint(5) unsigned DEFAULT '0', `total_wickets` smallint(5) unsigned DEFAULT '0', `ducks` smallint(5) unsigned DEFAULT '0', PRIMARY KEY (`id`), KEY `person_id` (`person_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=143 ; -- -- Dumping data for table `players` -- INSERT INTO `players` (`id`, `person_id`, `matches_played`, `total_runs`, `total_wickets`, `ducks`) VALUES (2, 5, 1, 3, 0, 0), (3, 6, 1, 27, 0, 0), (4, 7, 0, 0, 0, 0), (5, 8, 0, 0, 0, 0), (6, 9, 1, 10, 0, 0), (7, 10, 0, 0, 0, 0), (8, 11, 0, 0, 0, 0), (9, 12, 0, 0, 0, 0), (10, 13, 0, 0, 0, 0), (11, 14, 0, 0, 0, 0), (12, 15, 1, 0, 2, 0), (13, 16, 1, 34, 0, 0), (14, 17, 0, 0, 0, 0), (15, 18, 0, 0, 0, 0), (16, 19, 0, 0, 0, 0), (17, 20, 0, 0, 0, 0), (18, 21, 0, 0, 0, 0), (19, 22, 0, 0, 0, 0), (20, 23, 0, 0, 0, 0), (21, 24, 0, 0, 0, 0), (22, 25, 0, 0, 0, 0), (23, 26, 0, 0, 0, 0), (24, 27, 2, 38, 0, 0), (25, 28, 0, 0, 0, 0), (26, 29, 2, 3, 2, 0), (27, 30, 0, 0, 0, 0), (28, 31, 0, 0, 0, 0), (29, 32, 0, 0, 0, 0), (30, 33, 0, 0, 0, 0), (31, 34, 0, 0, 0, 0), (32, 35, 0, 0, 0, 0), (33, 36, 0, 0, 0, 0), (34, 37, 0, 0, 0, 0), (35, 38, 0, 0, 0, 0), (36, 39, 0, 0, 0, 0), (37, 40, 0, 0, 0, 0), (38, 41, 0, 0, 0, 0), (39, 42, 0, 0, 0, 0), (40, 43, 0, 0, 0, 0), (41, 44, 0, 0, 0, 0), (42, 45, 0, 0, 0, 0), (43, 46, 0, 0, 0, 0), (44, 47, 0, 0, 0, 0), (45, 48, 0, 0, 0, 0), (46, 49, 0, 0, 0, 0), (47, 50, 0, 0, 0, 0), (48, 51, 0, 0, 0, 0), (49, 52, 0, 0, 0, 0), (50, 53, 0, 0, 0, 0), (51, 54, 0, 0, 0, 0), (52, 55, 0, 0, 0, 0), (53, 56, 0, 0, 0, 0), (54, 57, 0, 0, 0, 0), (55, 58, 0, 0, 0, 0), (56, 59, 0, 0, 0, 0), (57, 60, 0, 0, 0, 0), (58, 61, 0, 0, 0, 0), (59, 62, 0, 0, 0, 0), (60, 63, 0, 0, 0, 0), (61, 64, 0, 0, 0, 0), (62, 65, 0, 0, 0, 0), (63, 66, 0, 0, 0, 0), (64, 67, 0, 0, 0, 0), (65, 68, 0, 0, 0, 0), (66, 69, 0, 0, 0, 0), (67, 70, 0, 0, 0, 0), (68, 71, 0, 0, 0, 0), (69, 72, 0, 0, 0, 0), (70, 73, 0, 0, 0, 0), (71, 74, 0, 0, 0, 0), (72, 75, 0, 0, 0, 0), (73, 76, 0, 0, 0, 0), (74, 77, 0, 0, 0, 0), (75, 78, 0, 0, 0, 0), (76, 79, 0, 0, 0, 0), (77, 80, 0, 0, 0, 0), (78, 81, 0, 0, 0, 0), (79, 82, 0, 0, 0, 0), (80, 83, 0, 0, 0, 0), (81, 84, 0, 0, 0, 0), (82, 85, 0, 0, 0, 0), (83, 86, 0, 0, 0, 0), (84, 87, 0, 0, 0, 0), (85, 88, 0, 0, 0, 0), (86, 89, 0, 0, 0, 0), (87, 90, 0, 0, 0, 0), (88, 91, 0, 0, 0, 0), (89, 92, 0, 0, 0, 0), (90, 93, 0, 0, 0, 0), (91, 94, 0, 0, 0, 0), (92, 95, 0, 0, 0, 0), (93, 96, 0, 0, 0, 0), (94, 97, 0, 0, 0, 0), (95, 98, 0, 0, 0, 0), (96, 99, 0, 0, 0, 0), (97, 100, 0, 0, 0, 0), (98, 101, 0, 0, 0, 0), (99, 102, 0, 0, 0, 0), (100, 103, 0, 0, 0, 0), (101, 104, 0, 0, 0, 0), (102, 105, 0, 0, 0, 0), (103, 106, 0, 0, 0, 0), (104, 107, 0, 0, 0, 0), (105, 108, 0, 0, 0, 0), (106, 109, 0, 0, 0, 0), (107, 110, 0, 0, 0, 0), (108, 111, 0, 0, 0, 0), (109, 112, 0, 0, 0, 0), (110, 113, 0, 0, 0, 0), (111, 114, 0, 0, 0, 0), (112, 115, 0, 0, 0, 0), (113, 116, 0, 0, 0, 0), (114, 117, 0, 0, 0, 0), (115, 118, 0, 0, 0, 0), (116, 119, 0, 0, 0, 0), (117, 120, 0, 0, 0, 0), (118, 121, 0, 0, 0, 0), (119, 122, 0, 0, 0, 0), (120, 123, 0, 0, 0, 0), (121, 124, 0, 0, 0, 0), (122, 125, 0, 0, 0, 0), (123, 126, 0, 0, 0, 0), (124, 127, 0, 0, 0, 0), (125, 128, 0, 0, 0, 0), (126, 129, 0, 0, 0, 0), (127, 130, 0, 0, 0, 0), (128, 131, 0, 0, 0, 0), (129, 132, 0, 0, 0, 0), (130, 133, 0, 0, 0, 0), (131, 134, 0, 0, 0, 0), (132, 135, 0, 0, 0, 0), (133, 136, 0, 0, 0, 0), (134, 137, 0, 0, 0, 0), (135, 138, 0, 0, 0, 0), (136, 139, 0, 0, 0, 0), (137, 140, 0, 0, 0, 0), (138, 141, 0, 0, 0, 0), (139, 142, 0, 0, 0, 0), (140, 143, 0, 0, 0, 0), (141, 144, 0, 0, 0, 0), (142, 145, 0, 0, 0, 0); -- -------------------------------------------------------- -- -- Table structure for table `player_50s` -- CREATE TABLE IF NOT EXISTS `player_50s` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `balls` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`player_id`,`match_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_50s` -- INSERT INTO `player_50s` (`player_id`, `match_id`, `balls`) VALUES (13, 7, 29), (23, 8, 37), (32, 5, 26), (42, 3, 38), (46, 7, 43), (51, 3, 19), (70, 5, 33), (92, 8, 36), (95, 6, 34), (96, 1, 37), (96, 6, 33), (103, 1, 27), (113, 2, 34), (141, 4, 34); -- -------------------------------------------------------- -- -- Table structure for table `player_100s` -- CREATE TABLE IF NOT EXISTS `player_100s` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `balls` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`player_id`,`match_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_100s` -- INSERT INTO `player_100s` (`player_id`, `match_id`, `balls`) VALUES (66, 9, 63); -- -------------------------------------------------------- -- -- Table structure for table `player_batting_stats` -- CREATE TABLE IF NOT EXISTS `player_batting_stats` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `runs` tinyint(3) unsigned DEFAULT '0', `balls_played` tinyint(3) unsigned DEFAULT '0', `strike_rate` float DEFAULT NULL, PRIMARY KEY (`player_id`,`match_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_batting_stats` -- INSERT INTO `player_batting_stats` (`player_id`, `match_id`, `runs`, `balls_played`, `strike_rate`) VALUES (32, 5, 67, 27, 248.14), (42, 3, 62, 38, 163.15), (51, 3, 93, 43, 216.27), (77, 4, 44, 20, 220), (96, 1, 52, 37, 140.54), (103, 1, 62, 27, 229.62), (113, 2, 84, 54, 155.55); -- -------------------------------------------------------- -- -- Table structure for table `player_bowling_stats` -- CREATE TABLE IF NOT EXISTS `player_bowling_stats` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `balls_delivered` tinyint(3) unsigned DEFAULT '0', `runs` int(11) NOT NULL, `wickets` tinyint(3) unsigned DEFAULT '0', PRIMARY KEY (`player_id`,`match_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_bowling_stats` -- INSERT INTO `player_bowling_stats` (`player_id`, `match_id`, `balls_delivered`, `runs`, `wickets`) VALUES (16, 2, 24, 36, 1), (18, 2, 24, 34, 1), (45, 3, 24, 25, 2), (80, 4, 24, 33, 2), (94, 1, 24, 27, 2), (102, 1, 24, 42, 2), (118, 2, 18, 14, 2); -- -------------------------------------------------------- -- -- Table structure for table `player_fielding_stats` -- CREATE TABLE IF NOT EXISTS `player_fielding_stats` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `catches` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`player_id`,`match_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_fielding_stats` -- INSERT INTO `player_fielding_stats` (`player_id`, `match_id`, `catches`) VALUES (2, 2, 1), (18, 2, 1), (28, 1, 1), (37, 1, 2), (47, 3, 2), (77, 4, 1), (95, 1, 2), (96, 1, 2), (118, 2, 2); -- -------------------------------------------------------- -- -- Table structure for table `player_roles` -- CREATE TABLE IF NOT EXISTS `player_roles` ( `player_id` int(10) unsigned NOT NULL, `role` enum('bowler','batsman','all rounder') DEFAULT NULL, `bats` enum('left','right') DEFAULT NULL, `bowls` varchar(30) DEFAULT NULL, KEY `player_id` (`player_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `player_roles` -- INSERT INTO `player_roles` (`player_id`, `role`, `bats`, `bowls`) VALUES (2, 'batsman', 'right', NULL), (77, 'all rounder', 'right', NULL), (32, 'batsman', 'right', NULL), (94, 'bowler', 'right', NULL), (33, 'all rounder', 'right', NULL), (42, 'batsman', 'left', NULL), (23, 'batsman', '', NULL), (57, 'bowler', 'right', NULL), (22, 'batsman', 'right', NULL), (126, 'batsman', 'left', NULL); -- -------------------------------------------------------- -- -- Table structure for table `sixes` -- CREATE TABLE IF NOT EXISTS `sixes` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `nunber of sixes` tinyint(3) unsigned NOT NULL, KEY `player_id` (`player_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `sixes` -- INSERT INTO `sixes` (`player_id`, `match_id`, `nunber of sixes`) VALUES (51, 3, 8), (77, 4, 4), (103, 1, 3), (113, 2, 3), (111, 2, 3); -- -------------------------------------------------------- -- -- Table structure for table `sponsors` -- CREATE TABLE IF NOT EXISTS `sponsors` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Dumping data for table `sponsors` -- INSERT INTO `sponsors` (`id`, `name`) VALUES (1, 'Amazon'), (2, 'Vodafone'), (3, 'Vivo'), (4, 'Sony Entertainment'), (5, 'Yes Bank'), (6, 'Maruti Suzuki'), (7, 'Hotstar'); -- -------------------------------------------------------- -- -- Table structure for table `teams` -- CREATE TABLE IF NOT EXISTS `teams` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `home_ground` varchar(50) DEFAULT NULL, `owner_id` int(10) unsigned NOT NULL, `coach_id` int(10) unsigned NOT NULL, `captain_id` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `owner_id` (`owner_id`), KEY `coach_id` (`coach_id`), KEY `captain_id` (`captain_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ; -- -- Dumping data for table `teams` -- INSERT INTO `teams` (`id`, `name`, `home_ground`, `owner_id`, `coach_id`, `captain_id`) VALUES (1, 'Mumbai Indians', 'Wankhede Stadium,Mumbai', 1, 1, 2), (2, 'Kolkata Knight Riders', 'Eden Garden, Kolkata', 2, 2, 42), (8, 'Kings XI Punjab', 'PCA Stadium,Mohali', 3, 4, 77), (9, 'Royal Challengers Bangalore', 'M. Chinnaswamy Stadium,Bangalore', 6, 5, 22), (10, 'Delhi Daredevils', 'Feroz Shah Kotla Ground,New Delhi', 7, 3, 64), (11, 'Guajrat Lions', 'Saurashtra Cricket Association Stadium, Rajkot', 4, 8, 126), (12, 'Rising Pune Supergiants', 'Maharashtra Cricket Association Stadium,Pune', 8, 7, 113), (13, 'Sunrisers Hyderabad', 'Rajiv Gandhi International Cricket Stadium,Hyderab', 5, 6, 95); -- -------------------------------------------------------- -- -- Table structure for table `team_stats` -- CREATE TABLE IF NOT EXISTS `team_stats` ( `team_id` int(10) unsigned NOT NULL, `total_matches` mediumint(8) unsigned DEFAULT '0', `matches_won` mediumint(8) unsigned DEFAULT '0', `matches_lost` mediumint(8) unsigned DEFAULT '0', `points` smallint(5) unsigned DEFAULT '0', `net_run_rate` float DEFAULT '0', KEY `team_id` (`team_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `team_stats` -- INSERT INTO `team_stats` (`team_id`, `total_matches`, `matches_won`, `matches_lost`, `points`, `net_run_rate`) VALUES (1, 3, 2, 1, 4, 0.199), (2, 2, 1, 2, 2, 1.279), (8, 2, 2, 0, 4, 1.598), (9, 3, 1, 2, 2, -1.206), (10, 2, 2, 1, 2, 2.05), (11, 2, 0, 2, 0, -2.731), (12, 3, 1, 2, 2, -1.718), (13, 3, 3, 3, 4, 1.156); -- -------------------------------------------------------- -- -- Table structure for table `umpires` -- CREATE TABLE IF NOT EXISTS `umpires` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `person_id` int(10) unsigned NOT NULL, `experience` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `person_id` (`person_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Dumping data for table `umpires` -- INSERT INTO `umpires` (`id`, `person_id`, `experience`) VALUES (1, 162, 20), (2, 163, 15), (3, 164, 15), (4, 165, 15), (5, 166, 12); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `f_name` varchar(30) NOT NULL, `l_name` varchar(30) NOT NULL, `email` varchar(50) NOT NULL, `user_name` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `f_name`, `l_name`, `email`, `user_name`, `password`) VALUES (1, 'KAPEESH', 'SHARMA', 'kapeeshsharma554@gmail.com', 'kpsh', '1234'), (2, 'vikas', 'choudhary', 'vkc11097@gmail.com', 'vks', 'vikas'), (3, 'Dheer', 'JAREDA', 'dheersingh1233@gmail.com', 'Dheer4552', '12345678'), (4, 'Aditya', 'Sharma', 'being.adityasharma@gmail.com', 'being_aditya', 'aditya'), (5, 'ghnshyam', 'kheenchi', 'ghanshyamkheenchi05@gmail.com', 'ghnshyamk', 'ghan8290'), (6, 'Raj', 'kumar', 'yioh', 'rajk', 'rajk'), (7, 'arpan', 'shaarma', 'arpan.purohit.786@gmail.com', 'arpan sharma', 'arpan123'), (8, 'vijay', 'sharma', 'aarush0554@gmail.com', 'vijay', 'vijay'); -- -------------------------------------------------------- -- -- Table structure for table `venues` -- CREATE TABLE IF NOT EXISTS `venues` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `location` varchar(255) NOT NULL, `capacity` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; -- -- Dumping data for table `venues` -- INSERT INTO `venues` (`id`, `name`, `location`, `capacity`) VALUES (1, 'Wankhede stadium', 'mumbai', 50000), (2, 'Eden Garden', 'kolkata', 52000), (3, 'PCA stadium', 'Mohali', 50000), (4, 'M. Chinnaswamy Stadium', 'Banglore', 60000), (5, 'Feroz Shah Kotla Ground', 'New Dehli', 52000), (6, 'Saurashtra Cricket Association Stadium', 'Rajkot', 50000), (7, 'Maharashtra Cricket Association Stadium', 'Pune', 54000), (8, 'Rajiv Gandhi International Cricket Stadium ', 'hydrabad', 45000), (9, 'Holkar cricket stadium', 'Indore', 54000), (10, 'Green Park', 'Kanpur', 50000); -- -------------------------------------------------------- -- -- Table structure for table `wicketkeepers` -- CREATE TABLE IF NOT EXISTS `wicketkeepers` ( `player_id` int(10) unsigned NOT NULL, `match_id` int(10) unsigned NOT NULL, `stumps` tinyint(3) unsigned DEFAULT NULL, KEY `player_id` (`player_id`), KEY `match_id` (`match_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `wicketkeepers` -- INSERT INTO `wicketkeepers` (`player_id`, `match_id`, `stumps`) VALUES (32, 1, 0), (97, 1, 0), (110, 2, 1), (11, 2, 0), (133, 3, 0); -- -- Constraints for dumped tables -- -- -- Constraints for table `auctions` -- ALTER TABLE `auctions` ADD CONSTRAINT `auctions_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `auctions_ibfk_2` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`); -- -- Constraints for table `coaches` -- ALTER TABLE `coaches` ADD CONSTRAINT `coaches_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`); -- -- Constraints for table `fixtures` -- ALTER TABLE `fixtures` ADD CONSTRAINT `fixtures_ibfk_1` FOREIGN KEY (`team1_id`) REFERENCES `teams` (`id`), ADD CONSTRAINT `fixtures_ibfk_2` FOREIGN KEY (`team2_id`) REFERENCES `teams` (`id`), ADD CONSTRAINT `fixtures_ibfk_3` FOREIGN KEY (`venue_id`) REFERENCES `venues` (`id`), ADD CONSTRAINT `fixtures_ibfk_4` FOREIGN KEY (`umpire_id`) REFERENCES `umpires` (`id`); -- -- Constraints for table `matches` -- ALTER TABLE `matches` ADD CONSTRAINT `matches_ibfk_1` FOREIGN KEY (`fixture_id`) REFERENCES `fixtures` (`id`), ADD CONSTRAINT `matches_ibfk_2` FOREIGN KEY (`winning_team_id`) REFERENCES `teams` (`id`), ADD CONSTRAINT `matches_ibfk_3` FOREIGN KEY (`man_of_match_id`) REFERENCES `players` (`id`); -- -- Constraints for table `owners` -- ALTER TABLE `owners` ADD CONSTRAINT `owners_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`); -- -- Constraints for table `players` -- ALTER TABLE `players` ADD CONSTRAINT `players_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`); -- -- Constraints for table `player_50s` -- ALTER TABLE `player_50s` ADD CONSTRAINT `player_50s_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `player_50s_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `player_100s` -- ALTER TABLE `player_100s` ADD CONSTRAINT `player_100s_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `player_100s_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `player_batting_stats` -- ALTER TABLE `player_batting_stats` ADD CONSTRAINT `player_batting_stats_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `player_batting_stats_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `player_bowling_stats` -- ALTER TABLE `player_bowling_stats` ADD CONSTRAINT `player_bowling_stats_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `player_bowling_stats_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `player_fielding_stats` -- ALTER TABLE `player_fielding_stats` ADD CONSTRAINT `player_fielding_stats_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `player_fielding_stats_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `player_roles` -- ALTER TABLE `player_roles` ADD CONSTRAINT `player_roles_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`); -- -- Constraints for table `sixes` -- ALTER TABLE `sixes` ADD CONSTRAINT `sixes_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `sixes_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); -- -- Constraints for table `teams` -- ALTER TABLE `teams` ADD CONSTRAINT `teams_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `owners` (`id`), ADD CONSTRAINT `teams_ibfk_2` FOREIGN KEY (`coach_id`) REFERENCES `coaches` (`id`), ADD CONSTRAINT `teams_ibfk_3` FOREIGN KEY (`captain_id`) REFERENCES `players` (`id`); -- -- Constraints for table `team_stats` -- ALTER TABLE `team_stats` ADD CONSTRAINT `team_stats_ibfk_1` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`); -- -- Constraints for table `umpires` -- ALTER TABLE `umpires` ADD CONSTRAINT `umpires_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`); -- -- Constraints for table `wicketkeepers` -- ALTER TABLE `wicketkeepers` ADD CONSTRAINT `wicketkeepers_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`), ADD CONSTRAINT `wicketkeepers_ibfk_2` FOREIGN KEY (`match_id`) REFERENCES `matches` (`id`); /*!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
55ad08d1aa73d57236fa1deb2b0b49c867a7a555
SQL
kimkunha/ORACLE
/PL1101/test_elseif2.sql
UHC
731
3.390625
3
[]
no_license
-- Է¹޾ 0 ~ 100 ϶ , 0 ~ 100̰ ƴ϶ -- Է -- 0~100 ϶ 0~40 ̶ '' 41 ~ 60 - ٸ -- 61~100 - հ set serveroutput on set verify off accept score promt 'Է :' declare score number := &score; begin if score between 0 and 100 then if score <=40 then dbms_output.put_line(' OTL'); elsif score <=60 then dbms_output.put_line('ٸ '); else dbms_output.put_line('ڰ '); end if; else dbms_output.put_line(' 0 ~ 100̸ Է ּ.'); end if; end; /
true
924bc49d62e35a49e02c67d51fb9c8a92717cc46
SQL
kipliko/airflow
/example_dags/dbt/macros/expect_check_duplicates_perc.sql
UTF-8
538
3.3125
3
[]
no_license
{% test expect_check_duplicates_perc(model, group_by_cols, thresholds) %} {% set total_rows %} select count( 1 ) total_rows from {{ model }} {% endset %} with validation_error as ( select ((sum(a.ciccio)*1.0 / ( {{total_rows}} ) ) * 100) perc from (SELECT {{ group_by_cols }}, COUNT(*)-1 ciccio FROM {{ model }} GROUP BY {{ group_by_cols }} HAVING count(*) > 1) a ) select * from validation_error where perc > {{ thresholds }} {% endtest %}
true
c02d90ea3d62442cfbb07fc8ed32d4e116f6f1ea
SQL
ccarson/EarlyHeart
/EhlersDM/Schema Objects/Conversion/Views/Conversion.vw_LegacyAddress.view.sql
UTF-8
5,045
2.984375
3
[]
no_license
CREATE VIEW Conversion.vw_LegacyAddress AS /* ************************************************************************************************************************************ View: Conversion.vw_LegacyAddress Author: Chris Carson Purpose: shows "scrubbed" version of legacy Address data revisor date description --------- ----------- ---------------------------- ccarson 2013-01-24 created Notes: ************************************************************************************************************************************ */ WITH firmsData AS ( SELECT LegacyID = f.FirmID , LegacyTableName = 'Firms' , AddressID = ISNULL( la.AddressID, 0 ) , Address1 = ISNULL( f.Address1, '' ) , Address2 = ISNULL( f.Address2, '' ) , City = ISNULL( f.City, '' ) , [State] = ISNULL( f.[State], '' ) , Zip = ISNULL( f.Zip, '' ) , ChangeDate = ISNULL( f.ChangeDate, GETDATE() ) , ChangeBy = ISNULL( NULLIF ( f.ChangeBy, '' ), 'processAddresses') FROM edata.dbo.Firms AS f LEFT JOIN Conversion.LegacyAddresses AS la ON la.LegacyID = f.FirmID AND la.LegacyTableName = 'Firms' ) , clientsData AS ( SELECT LegacyID = c.ClientID , LegacyTableName = 'Clients' , AddressID = ISNULL( la.AddressID, 0 ) , Address1 = ISNULL( c.Address1, '' ) , Address2 = ISNULL( c.Address2, '' ) , City = ISNULL( c.City, '' ) , [State] = ISNULL( c.[State], '' ) , Zip = ISNULL( c.Zip, '' ) , ChangeDate = ISNULL( c.ChangeDate, GETDATE() ) , ChangeBy = ISNULL( NULLIF ( c.ChangeBy, '' ), 'processAddresses') FROM edata.dbo.Clients AS c LEFT JOIN Conversion.LegacyAddresses AS la ON la.LegacyID = c.ClientID AND la.LegacyTableName = 'Clients' ) , firmContactsData AS ( SELECT LegacyID = fc.ContactID , LegacyTableName = 'FirmContacts' , AddressID = ISNULL( la.AddressID, 0 ) , Address1 = ISNULL( fc.Address1, '' ) , Address2 = ISNULL( fc.Address2, '' ) , City = ISNULL( fc.City, '' ) , [State] = ISNULL( fc.[State], '' ) , Zip = ISNULL( fc.Zip, '' ) , ChangeDate = ISNULL( fc.ChangeDate, GETDATE() ) , ChangeBy = ISNULL( NULLIF ( fc.ChangeBy, '' ), 'processAddresses') FROM edata.dbo.FirmContacts AS fc LEFT JOIN Conversion.LegacyAddresses AS la ON la.LegacyID = fc.ContactID AND la.LegacyTableName = 'FirmContacts' ) , clientContactsData AS ( SELECT LegacyID = cc.ContactID , LegacyTableName = 'ClientContacts' , AddressID = ISNULL( la.AddressID, 0 ) , Address1 = ISNULL( cc.Address1, '' ) , Address2 = ISNULL( cc.Address2, '' ) , City = ISNULL( cc.City, '' ) , [State] = ISNULL( cc.[State], '' ) , Zip = ISNULL( cc.Zip, '' ) , ChangeDate = ISNULL( cc.ChangeDate, GETDATE() ) , ChangeBy = ISNULL( NULLIF ( cc.ChangeBy, '' ), 'processAddresses') FROM edata.dbo.ClientContacts AS cc LEFT JOIN Conversion.LegacyAddresses AS la ON la.LegacyID = cc.ContactID AND la.LegacyTableName = 'ClientContacts' ) , inputData AS ( SELECT LegacyID, LegacyTableName, AddressID , Address1, Address2, City, [State], Zip , ChangeDate, ChangeBy FROM firmsData UNION ALL SELECT LegacyID, LegacyTableName, AddressID , Address1, Address2, City, [State], Zip , ChangeDate, ChangeBy FROM clientsData UNION ALL SELECT LegacyID, LegacyTableName, AddressID , Address1, Address2, City, [State], Zip , ChangeDate, ChangeBy FROM firmContactsData UNION ALL SELECT LegacyID, LegacyTableName, AddressID , Address1, Address2, City, [State], Zip , ChangeDate, ChangeBy FROM clientContactsData ) SELECT LegacyID, LegacyTableName, AddressID , Address1, Address2, City, [State], Zip , ChangeDate, ChangeBy FROM inputData AS a WHERE LEN(Address1) + LEN(Address2) + LEN(City) + LEN([State]) + LEN(Zip) > 0 ;
true
e066735195b597e783948576a69e0f08a170f6bd
SQL
kdsimmons/InsightProject
/sql_practice.sql
UTF-8
2,436
4.625
5
[]
no_license
USE employees; /* Extra testing */ SELECT emp_no, salary FROM salaries WHERE salary IS NULL /*SELECT first_name, last_name, emp_no, (SELECT SUM(salary) FROM salaries WHERE salaries.emp_no = employees.emp_no) AS tot_sal FROM employees ORDER BY tot_sal DESC LIMIT 10 */ /* SELECT SUM(salary) AS tot_salary, emp_no FROM salaries GROUP BY emp_no HAVING tot_salary > 100000 LIMIT 10 */ /* 1. Extract all employees from the sales department. */ /*SELECT DISTINCT emp_no, dept_name FROM dept_emp JOIN departments ON departments.dept_no = dept_emp.dept_no AND dept_name LIKE 'sales' LIMIT 20; */ /* 2. Extract all employees from the engineering department with salaies ranging from 100K to 200K. */ /*SELECT employees.emp_no, employees.first_name, employees.last_name, titles.title, salaries.salary, salaries.to_date AS salary_to_date FROM titles LEFT JOIN employees ON employees.emp_no = titles.emp_no INNER JOIN salaries ON titles.emp_no = salaries.emp_no AND salaries.salary BETWEEN 100000 AND 200000 WHERE titles.title LIKE '%engineer%' GROUP BY employees.emp_no HAVING salary_to_date = MAX(salary_to_date) ORDER BY salary DESC LIMIT 10; */ /* 3. Find all employees whose salary is higher than their managers. */ /*SELECT DISTINCT emp.emp_no FROM dept_emp AS emp JOIN salaries AS sal_emp ON emp.emp_no = sal_emp.emp_no JOIN dept_manager AS mgr ON emp.dept_no = mgr.dept_no JOIN salaries AS sal_mgr ON mgr.emp_no = sal_mgr.emp_no WHERE sal_emp.salary > sal_mgr.salary LIMIT 20; */ /* 4. Find all employees who currently work in the IT department for 1-3 years. */ /* Changed to Research department b/c I don't see an IT dept anywhere. */ /*SELECT cur_title.emp_no, cur_title.title, cur_title.from_date FROM (SELECT emp_no, title, from_date, to_date FROM titles WHERE to_date = '9999-01-01' HAVING DATEDIFF(CURDATE(), from_date) BETWEEN 4380 AND 5475 ) cur_title INNER JOIN (SELECT dept_emp.emp_no FROM departments AS dept LEFT JOIN dept_emp ON dept.dept_no = dept_emp.dept_no WHERE dept.dept_name LIKE '%research%') research ON cur_title.emp_no = research.emp_no ORDER BY from_date DESC LIMIT 30; */
true
7f30b61df68bd221fa5837f72df446dea964751f
SQL
Wooooohh/DDL-DML-Base-english-2019-10-12-6-26-56-365
/dml.sql
UTF-8
273
2.703125
3
[]
no_license
-- Insert record insert into students values('001','Jack','22','male'),('002','Edward','21','male'); -- Revise record update students set age = 23 where id = '002'; -- Delete record delete from student where id = '001'; -- Search record select * from student(where xxxx);
true
0f236180e8d44fd53f12a7bf05f99658da655483
SQL
emreaknci/Kodlama.io-Calismalarim
/SQLDenemeSorgu.sql
UTF-8
3,243
4.125
4
[]
no_license
-- * tüm kolonları ifade eder --select * from Customers --customers daki tüm kolonlar gelir --select ContactName,CompanyName, City from Customers -- customersdaki 3 kolon gelir --select ContactName Adi,CompanyName SirketAdi, City Sehir from Customers -- customersdaki kolonlari istediğimiz isimle getirir --select * from Customers where City='London' -- where ile koşul koyduk, şehri london olanları çektik , metinler tek tırnak unutma --sElEcT * fRoM ProDuctS where CategoryID=1 or (CategoryID=4 and SupplierID=5)-- case insensitive yani büyük küçük harf farketmez --select * from Products where UnitPrice>20 --select * from Products order by ProductName --*********order by sırala demek(artan sıraya göre) --select * from Products order by UnitPrice desc -- desc çoktan aza sıralar (default u asc) --select * from Products order by CategoryID,ProductName --önce categoryID ye göre sonra ürün adına göre sıralar --select * from Products where UnitPrice>25 and UnitPrice<60 order by ProductName --select count(*) Adet from Products -- ürünlerin satırlarının sayısı count(*) ile bulunur , adet yazarak gelen satıra isim verdik --select count(*) from Products where CategoryID=2 -- categoryID si 2 olan ürün satır sayısı --select CategoryID,count(*) Adet from Products where UnitPrice>20 group by CategoryID -- select X from Products group by X şeklinde olmalı , ilk X yerine * denmez --select CategoryID,ProductName,count(*) Adet from Products group by CategoryID, ProductName order by ProductName --select CategoryID,count(*) Adet from Products group by CategoryID having count(*)<10 --select Products.ProductID,Products.ProductName,Products.UnitPrice,Categories.CategoryNamefrom products inner join Categories on Products.CategoryID=Categories.CategoryID --select * from Products p left join [Order Details] od on p.ProductID=od.ProductID --select * from customers c left join orders o on c.CustomerID=o.CustomerID where o.OrderID is null --insert into Customers(CustomerID,ContactName,CompanyName,City) values('asdf','emre','akinci a.ş','sakarya') --update Customers set city='bERLİN' where CustomerID='ALFKİ' --select ContactName AD,city SEHIR,Address ADRES,Phone TEL from Customers where City='México D.F.' order by AD --customersdan México D.F. da yaşayanları adlarına göre sıralama --delete from Customers where CustomerID='ANATR' --delete from Orders where CustomerID='ANATR' --delete from [Order Details] where OrderID='ANATR' --select * from Customers c left join Orders o on c.CustomerID=o.CustomerID where o.OrderID is null --select CustomerID,ContactName AD,city SEHIR,Address ADRES,Phone TEL from Customers where City='México D.F.' order by AD --select AVG(UnitPrice) ortalamaFiyat,AVG(UnitsOnOrder) ortSatis from Products --SELECT * FROM Customers WHERE Country IN ('Germany', 'France', 'UK'); --SELECT * INTO CustomersBackup2017 FROM Customers --SELECT * INTO CustomersGermany FROM Customers WHERE Country = 'Germany'; select p.ProductName UrunAdi, SUM(od.Quantity*od.UnitPrice) Kazanc from Products p inner join [Order Details] od on p.ProductID=od.ProductID inner join Orders o on od.OrderID=o.OrderID group by p.ProductName order by Kazanc
true
9463aa8a3ef672e4360b377bebb82104634a9b49
SQL
cyobero/portfolio
/mysql/create_tables.sql
UTF-8
462
3.390625
3
[]
no_license
CREATE DATABASE jennys_db; CREATE TABLE Categories ( category_id INT PRIMARY KEY, category VARCHAR(128) ); CREATE TABLE Products ( product_id INT PRIMARY KEY, name VARCHAR(128) NOT NULL, category_id INT NOT NULL, FOREIGN KEY (category_id) REFERENCES Categories (category_id) ON DELETE CASCADE ); CREATE TABLE Customers ( customer_id INT(10) PRIMARY KEY, first_name VARCHAR(256) NOT NULL, last_name VARCHAR(256) NOT NULL );
true
5240e0bd76600d199c36e74188b0b32af97b8e03
SQL
luisrdz5/querys-sql
/encontrar ids faltantes en det_amortizacion.sql
ISO-8859-10
415
3
3
[]
no_license
Select d.solicitudscc, d.pagare, AoMes = Convert(varchar(6),d.fecha,112), d.fecha, d.IDRegistroSicom, Importe = (d.ImporteOpFin + d.InteresOpFin + d.IVAOpFin) From dbo.det_amortizacion d With(Nolock) Inner Join dbo.creditos c On c.NumCredito = d.solicitudscc And c.TipoCredito In ('PA','CV') Where ISNULL(d.IDRegistroSicom,0) = 0 And d.estatus = 14
true
775f3227439e3b95a291997ee857f8e10691ba6a
SQL
aftersound/weave
/service/service-runtime/src/main/resources/runtime-management.hsql.sql
UTF-8
3,911
3.453125
3
[ "Apache-2.0" ]
permissive
SET DATABASE SQL SYNTAX MYS TRUE; CREATE TABLE IF NOT EXISTS namespace ( name VARCHAR(255) NOT NULL, owner VARCHAR(255), owner_email VARCHAR(255), description VARCHAR(4096), attributes VARCHAR(4096), created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255), PRIMARY KEY (name) ); CREATE INDEX IF NOT EXISTS idx_ns_owner ON namespace (owner); CREATE INDEX IF NOT EXISTS inx_ns_owner_email ON namespace (owner_email); CREATE TABLE IF NOT EXISTS namespace_history ( id INTEGER IDENTITY PRIMARY KEY, name VARCHAR(255) NOT NULL, owner VARCHAR(255), owner_email VARCHAR(255), description VARCHAR(4096), attributes VARCHAR(4096), created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255) ); CREATE INDEX IF NOT EXISTS idx_nsh_name ON namespace_history (name); CREATE INDEX IF NOT EXISTS idx_nsh_owner ON namespace_history (owner); CREATE INDEX IF NOT EXISTS inx_nsh_owner_email ON namespace_history (owner_email); CREATE TABLE IF NOT EXISTS application ( namespace VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, owner VARCHAR(255), owner_email VARCHAR(255), description VARCHAR(4096), attributes VARCHAR(4096), created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255), PRIMARY KEY (namespace,name) ); CREATE INDEX IF NOT EXISTS idx_app_owner ON application (owner); CREATE INDEX IF NOT EXISTS inx_app_owner_email ON application (owner_email); CREATE TABLE IF NOT EXISTS application_history ( id INTEGER IDENTITY PRIMARY KEY, namespace VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, owner VARCHAR(255), owner_email VARCHAR(255), description VARCHAR(4096), attributes VARCHAR(4096), created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255), ); CREATE INDEX IF NOT EXISTS idx_ah_namespace ON application_history (namespace); CREATE INDEX IF NOT EXISTS idx_ah_name ON application_history (name); CREATE INDEX IF NOT EXISTS idx_ah_owner ON application_history (owner); CREATE INDEX IF NOT EXISTS inx_ah_owner_email ON application_history (owner_email); CREATE TABLE IF NOT EXISTS runtime_spec ( k VARCHAR(512) PRIMARY KEY, v LONGVARBINARY, created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255) ); CREATE TABLE IF NOT EXISTS runtime_spec_history ( id INTEGER IDENTITY PRIMARY KEY, k VARCHAR(512) NOT NULL, v LONGVARBINARY, created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255) ); CREATE INDEX IF NOT EXISTS idx_rsh_k ON runtime_spec_history (k); CREATE TABLE IF NOT EXISTS openapi_spec ( k VARCHAR(512) PRIMARY KEY, v LONGVARBINARY, created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255) ); CREATE TABLE IF NOT EXISTS openapi_spec_history ( id INTEGER IDENTITY PRIMARY KEY, k VARCHAR(512) NOT NULL, v LONGVARBINARY, created TIMESTAMP(3) NOT NULL, updated TIMESTAMP(3) NOT NULL, trace VARCHAR(255) ); CREATE INDEX IF NOT EXISTS idx_osh_k ON openapi_spec_history (k); CREATE TABLE IF NOT EXISTS instance ( iid VARCHAR(127) NOT NULL, namespace VARCHAR(255) NOT NULL, application VARCHAR(255) NOT NULL, environment VARCHAR(255), host VARCHAR(255) NOT NULL, port INTEGER NOT NULL, ipv4_address VARCHAR(255), ipv6_address VARCHAR(255), status VARCHAR(31) NOT NULL, updated TIMESTAMP(3) NOT NULL, PRIMARY KEY (iid), ); CREATE INDEX IF NOT EXISTS idx_ai_namespace ON instance (namespace); CREATE INDEX IF NOT EXISTS idx_ai_application ON instance (application); CREATE INDEX IF NOT EXISTS idx_ai_environment ON instance (environment); CREATE INDEX IF NOT EXISTS idx_ai_host ON instance (host); CREATE INDEX IF NOT EXISTS idx_ai_status ON instance (status);
true
b62c7c525cbf223e5bd0f3509b27777ca7c29f46
SQL
PNNL-Comp-Mass-Spec/DBSchema_PgSQL_DMS
/dms/mc/mc.v_mgr_work_dir.sql
UTF-8
1,119
3.5
4
[ "Apache-2.0" ]
permissive
-- -- Name: v_mgr_work_dir; Type: VIEW; Schema: mc; Owner: d3l243 -- CREATE VIEW mc.v_mgr_work_dir AS SELECT v_param_value.mgr_name, CASE WHEN (v_param_value.value OPERATOR(public.~~) '\\%'::public.citext) THEN (v_param_value.value)::text ELSE ('\\ServerName\'::text || public.replace(v_param_value.value, ':\'::public.citext, '$\'::public.citext)) END AS work_dir_admin_share FROM mc.v_param_value WHERE (v_param_value.param_name OPERATOR(public.=) 'workdir'::public.citext); ALTER TABLE mc.v_mgr_work_dir OWNER TO d3l243; -- -- Name: VIEW v_mgr_work_dir; Type: COMMENT; Schema: mc; Owner: d3l243 -- COMMENT ON VIEW mc.v_mgr_work_dir IS 'This database does not keep track of the server name that a given manager is running on. Thus, this query includes the generic text ServerName for the WorkDir path, unless the WorkDir is itself a network share'; -- -- Name: TABLE v_mgr_work_dir; Type: ACL; Schema: mc; Owner: d3l243 -- GRANT SELECT ON TABLE mc.v_mgr_work_dir TO readaccess; GRANT SELECT ON TABLE mc.v_mgr_work_dir TO writeaccess;
true
e81f11b484cd1f59b0ddb42ca38033d4dd88a494
SQL
wwjiang007/yugabyte-db
/src/yb/yql/pgwrapper/ysql_migrations/V37__17491__yb_fix_catalog_version_table.sql
UTF-8
1,676
2.71875
3
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "OpenSSL" ]
permissive
SET LOCAL yb_non_ddl_txn_for_sys_tables_allowed TO true; INSERT INTO pg_catalog.pg_proc ( oid, proname, pronamespace, proowner, prolang, procost, prorows, provariadic, protransform, prokind, prosecdef, proleakproof, proisstrict, proretset, provolatile, proparallel, pronargs, pronargdefaults, prorettype, proargtypes, proallargtypes, proargmodes, proargnames, proargdefaults, protrftypes, prosrc, probin, proconfig, proacl ) VALUES (8060, 'yb_fix_catalog_version_table', 11, 10, 14, 1000, 0, 0, '-', 'f', false, false, true, false, 'v', 'u', 1, 0, 2278, '16', NULL, NULL, '{per_database_mode}', NULL, NULL, 'insert into pg_catalog.pg_yb_catalog_version select oid, 1, 1 from pg_catalog.pg_database where per_database_mode and (oid not in (select db_oid from pg_catalog.pg_yb_catalog_version)); delete from pg_catalog.pg_yb_catalog_version where (not per_database_mode and db_oid != 1) or (per_database_mode and db_oid not in (select oid from pg_catalog.pg_database))', NULL, NULL, '{postgres=X/postgres}') ON CONFLICT DO NOTHING; INSERT INTO pg_catalog.pg_init_privs ( objoid, classoid, objsubid, privtype, initprivs ) VALUES (8060, 1255, 0, 'i', '{postgres=X/postgres}') ON CONFLICT DO NOTHING; -- Create dependency records for everything we (possibly) created. -- Since pg_depend has no OID or unique constraint, using PL/pgSQL instead. DO $$ BEGIN IF NOT EXISTS ( SELECT FROM pg_catalog.pg_depend WHERE refclassid = 1255 AND refobjid = 8060 ) THEN INSERT INTO pg_catalog.pg_depend ( classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype ) VALUES (0, 0, 0, 1255, 8060, 0, 'p'); END IF; END $$;
true
03f002b59876c05d225feff060a59e2067d50dbe
SQL
peterlegrand/StudentUnion0105
/StudentUnion0105/MasterDataScripts/StoredProcedures/FrontPageGetPage.sql
UTF-8
547
3.09375
3
[]
no_license
CREATE PROCEDURE FrontPageGetPage (@LanguageId int) AS SELECT dbPage.Id OId , dbPage.ShowTitleName , dbPage.ShowTitleDescription , dbPageLanguage.Id LId , dbPageLanguage.Name , dbPageLanguage.Description , dbPageLanguage.MouseOver , dbPageLanguage.MenuName , dbPageLanguage.TitleName , dbPageLanguage.TitleDescription FROM dbPage JOIN dbPageLanguage ON dbPage.Id = dbPageLanguage.PageId JOIN dbSetting ON dbsetting.IntValue = dbPage.Id WHERE dbSetting.Id = 2 AND dbPageLanguage.LanguageId = @LanguageId AND dbPage.PageStatusId = 1
true
858099e7535b51a0d9ddb94aeb2e17957bb3e9fd
SQL
KDamir/demo-test
/src/main/resources/data.sql
UTF-8
162
2.59375
3
[]
no_license
DROP TABLE IF EXISTS book; CREATE TABLE book ( id INT AUTO_INCREMENT PRIMARY KEY, book_name VARCHAR(1024) NOT NULL, description VARCHAR(1024) NOT NULL );
true
9625d68e97ec9a8d3537ee8eeccf0dce2bbd4f16
SQL
briand16/tarea
/tienda_db.sql
UTF-8
3,883
3.3125
3
[]
no_license
/* SQLyog Community v13.1.2 (64 bit) MySQL - 10.1.33-MariaDB : Database - yeth_db ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/`yeth_db` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `yeth_db`; /*Table structure for table `categoria` */ DROP TABLE IF EXISTS `categoria`; CREATE TABLE `categoria` ( `id_categoria` INT(11) NOT NULL AUTO_INCREMENT, `nombre_c` VARCHAR(50) DEFAULT NULL, `descripcion` VARCHAR(50) DEFAULT NULL, PRIMARY KEY (`id_categoria`) ) ENGINE=INNODB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; /*Data for the table `categoria` */ INSERT INTO `categoria`(`id_categoria`,`nombre_c`,`descripcion`) VALUES (12,'dasd','sda'); /*Table structure for table `detalle` */ DROP TABLE IF EXISTS `detalle`; CREATE TABLE `detalle` ( `num_detalle` INT(11) NOT NULL AUTO_INCREMENT, `id_producto` INT(11) DEFAULT NULL, `cantidad` INT(11) DEFAULT NULL, `precio` INT(11) DEFAULT NULL, PRIMARY KEY (`num_detalle`), KEY `id_producto` (`id_producto`), CONSTRAINT `detalle_ibfk_1` FOREIGN KEY (`id_producto`) REFERENCES `producto` (`id_producto`) ) ENGINE=INNODB AUTO_INCREMENT=124 DEFAULT CHARSET=latin1; /*Data for the table `detalle` */ INSERT INTO `detalle`(`num_detalle`,`id_producto`,`cantidad`,`precio`) VALUES (23,12,23,12), (123,12,23,12); /*Table structure for table `producto` */ DROP TABLE IF EXISTS `producto`; CREATE TABLE `producto` ( `id_producto` INT(11) NOT NULL AUTO_INCREMENT, `nombre_p` VARCHAR(50) DEFAULT NULL, `precio` INT(11) DEFAULT NULL, `stock` INT(11) DEFAULT NULL, `id_categoria` INT(11) DEFAULT NULL, PRIMARY KEY (`id_producto`), KEY `id_categoria` (`id_categoria`), CONSTRAINT `producto_ibfk_1` FOREIGN KEY (`id_categoria`) REFERENCES `categoria` (`id_categoria`) ) ENGINE=INNODB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; /*Data for the table `producto` */ INSERT INTO `producto`(`id_producto`,`nombre_p`,`precio`,`stock`,`id_categoria`) VALUES (12,'wdad',12,231,12); /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; CREATE TABLE USUARIOS( id_usuario INT PRIMARY KEY AUTO_INCREMENT, nombre VARCHAR(50), PASSWORD VARCHAR(50) ); CREATE TABLE CLIENTE( NOMBRE VARCHAR(25), APELLIDO VARCHAR(25), DIRECCION VARCHAR(25), FECHA_NACIMIENTO VARCHAR(25), TELEFONO VARCHAR(25), EMAIL VARCHAR(25), ID_CLIENTE INT AUTO_INCREMENT PRIMARY KEY ); CREATE TABLE MODO_PAGO( NUM_PAGO INT AUTO_INCREMENT PRIMARY KEY, NOMBRE VARCHAR(25), OTROS_DETALLES VARCHAR(25) ); CREATE TABLE FACTURA( NUM_FACTURA INT AUTO_INCREMENT PRIMARY KEY, ID_CLIENTE INT, FECHA VARCHAR(25), NUM_PAGO INT, FOREIGN KEY(ID_CLIENTE) REFERENCES CLIENTE(ID_CLIENTE), FOREIGN KEY(NUM_PAGO) REFERENCES MODO_PAGO(NUM_PAGO) ); CREATE TABLE PRODUCTO ( id_producto INT PRIMARY KEY AUTO_INCREMENT, nombre_p VARCHAR(50), precio INT, stock INT, id_categoria INT, FOREIGN KEY (id_categoria) REFERENCES categoria(id_categoria) ); CREATE TABLE DETALLE ( num_detalle INT PRIMARY KEY AUTO_INCREMENT, id_producto INT, FOREIGN KEY (id_producto) REFERENCES producto(id_producto), cantidad INT, precio INT ); CREATE TABLE CATEGORIA ( id_categoria INT PRIMARY KEY AUTO_INCREMENT, nombre_c VARCHAR(50), descripcion VARCHAR(50) );
true
78774716c1439be701197f8c24116411d0f35678
SQL
HryChg/WineWarehouse
/SQL-Strings/SMQueries.sql
UTF-8
3,475
4.1875
4
[]
no_license
--------------------- -- Special Queries -- --------------------- -- find the top 5 ordered wine to be backOrdered // COUNT SELECT wineID, count(wineID) as backOrderedWineCount FROM OrderReceived WHERE backorder = 'Y' GROUP by wineID ORDER by backOrderedWineCount DESC LIMIT 5; -- find the top 10 most repeatedly ordered Wine // COUNT SELECT wineID, count(wineID) as repeatWineCount FROM OrderReceived GROUP BY wineID ORDER BY repeatWineCount DESC LIMIT 10; -- identify top 3 wine where every retailer has ordered // DIVISION w/ NOT IN SELECT wineID FROM WineB WHERE wineID NOT IN ( SELECT w.wineID FROM WineB w, OrderReceived o WHERE (w.wineID, o.retailer) NOT IN ( SELECT wineID, retailer FROM OrderReceived )) LIMIT 3; -- identify top 3 wine where every retailer has ordered // DIVISION w/ NOT EXISTS SELECT w1.wineID FROM WineB w1 WHERE NOT EXISTS( SELECT w.wineID FROM WineB w, OrderReceived o1 WHERE NOT EXISTS ( SELECT o.wineID, o.retailer FROM OrderReceived o WHERE w.wineID = o.wineID AND o1.retailer = o.retailer ) AND w1.wineID=w.wineID ) LIMIT 3; --figure out best transportation mode by comparing actual and expected delivery dates CREATE VIEW difference_view AS SELECT TIMESTAMPDIFF(SECOND, expectedDeliveryDate, actualDeliveryDate) AS difference FROM SHIPMENT; SELECT x.* FROM Shipment s WHERE s.transportationMode = (SELECT MAX(d.difference) FROM difference_view d); --------------------- -- Order Received --- --------------------- -- View the Order SELECT * FROM OrderReceived; -- Add Order INSERT INTO OrderReceived VALUES('$orderID', '$employeeID', '$quantity', '$address', '$backOrder', TIMESTAMP('$orderReceivedDate')); -- Update Order UPDATE OrderReceived SET employeeID = $employeeID, quantity = $quantity, address = $address, backorder = $backOrder, orderReceivedDate = $orderReceivedDate WHERE orderID = $orderID; -- delete order DELETE FROM OrderReceived WHERE orderID = $orderID; -- find all the backOrder SELECT * FROM OrderReceived WHERE backorder = 'Y'; -- find the quantity of each wine being ordered SELECT wineID, SUM(quantity) as totalQuantity FROM OrderReceived GROUP BY wineID; -- find the top clients (retailer who order most frequently) SELECT retailer, COUNT(orderID) AS orderCount FROM OrderReceived GROUP BY retailer; --------------------- -- OrderForWine --- --------------------- -- add: INSERT INTO OrderForWine VALUES('$orderID', '$wineID', '$locationID'); -- view: SELECT * FROM OrderForWine; -- delete: DELETE FROM OrderForWine WHERE orderID='$orderID' AND wineID='$wineID' AND locationID='$locationID'; --------------------- -- Shipment --- --------------------- -- add: INSERT INTO Shipment VALUES('$shipmentID', '$transportationMode', '$expectedDeliveryDate','$actualDeliveryDate','$orderID', '$employeeID'); -- view: SELECT * FROM Shipment; -- update: UPDATE Shipment SET <condition> WHERE shipmentID='$shipmentID'; -- delete: DELETE FROM Shipment WHERE shipmentID='$shipmentID'; ------------------------- -- Returned Shipment --- ------------------------- -- add: INSERT INTO ReturnedShipment VALUES('$shipmentID', '$returnID', '$returnedQuantity'); -- view: SELECT * FROM ReturnedShipment; -- update: UPDATE ReturnShipment SET <condition> WHERE shipmentID='$shipmentID' AND returnID='$returnID'; -- delete: DELETE FROM ReturnedShipment WHERE shipmentID='$shipmentID' AND returnID='$returnID';
true
f37d5747acc28026f697b9c903f762f99afc64ba
SQL
bseries/base_tag
/data/upgrade/V1529657712__init.sql
UTF-8
331
2.546875
3
[]
no_license
CREATE TABLE `tags` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(250) NOT NULL DEFAULT '', `title` varchar(250) DEFAULT '', `description` text, `is_published` tinyint(1) unsigned NOT NULL DEFAULT '0', `created` datetime NOT NULL, `modified` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB;
true
9b55661561e6e93659cfb2588c0df1e423adb65d
SQL
hello413/WechatCanteen
/school_canteen.sql
UTF-8
7,867
3.96875
4
[]
no_license
drop database school_canteen; CREATE SCHEMA `school_canteen` DEFAULT CHARACTER SET utf8mb4 ; use school_canteen; -- 窗口表 create table windows ( `window_id` int not null auto_increment primary key, `window_name` varchar(64) not null comment '窗口名字', `window_canteen` enum('新食堂','旧食堂') not null comment '食堂选择', `window_tier` enum('一楼','二楼','三楼') not null comment '楼层', `window_num` int not null, `window_picture` varchar(64) not null comment '窗口封面路径' )comment "窗口表"; -- 食物表 create table `foods` ( `food_id` int not null auto_increment primary key, `food_name` varchar(32) not null, `food_type` varchar(32) not null comment '食物类型' ); -- 菜单表 create table menu ( `window_id` int not null, `food_id` int not null, `food_picture` varchar(50) not null comment '窗口食物封面', `food_price` decimal(10,2) not null comment '价格', `food_style` enum('0','1') not null default '0' comment '0:有货,1:缺货', foreign key(window_id) references windows(window_id), foreign key(food_id) references foods(food_id) ); -- 用户表 create table user( `user_id` int not null auto_increment primary key, `user_name` varchar(64) not null, `user_password` varchar(20) not null, `user_telephone` bigint(20) not null comment '忘记密码时' ); -- 管理员 create table admini ( `admini_id` int not null auto_increment primary key, `admini_name` varchar(64) not null comment '管理员姓名', `admini_password` varchar(20) not null, `admini_telephone` varchar(20) not null comment '微信号', `admini_window` int not null comment '所属窗口' ); -- 订单表 create table `orderlist` ( `order_id` int not null auto_increment primary key, `user_id` int not null, `window_id` int not null comment '购物车', `order_price` decimal(10,2) not null default '0' comment '价格', `style` enum('0','1') not null default '0' comment '0:未完成,1:完成', `create_time` timestamp not null default now(), `finish_time` timestamp not null default '0000-00-00 00:00:00', `about` varchar(200) comment '备注', `time_id` int ) comment '订单'; create table goods( good_id int not null primary key auto_increment, good_food_id int not null comment '食物编号', good_type varchar(20) comment '微辣', good_num int comment '数量', good_order_id int comment '购物车' ); -- 时间段表 create table `time` ( `time_id` int auto_increment not null primary key, `canteen` enum('新食堂','旧食堂') not null comment '食堂选择', `tier` enum('一楼','二楼','三楼') not null comment '楼层', `style` varchar(5), `start_time` timestamp not null default now(), `finish_time` timestamp default '0000-00-00 00:00:00', `upperlimit` int not null default '500' comment '上限', `nownum` int not null ); create table word( `word` varchar(200) ); -- 给windows窗口插数据 INSERT INTO `windows`(`window_id`, `window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('1', '赵氏卤肉饭', '新食堂','一楼', '1', '/Images/new/one/1.jpg'); INSERT INTO `windows`(`window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('马氏炒饭', '新食堂','一楼', '2', '/Images/new/one/2.jpg'); INSERT INTO `windows`(`window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('李氏面馆', '旧食堂', '一楼', '1', '/Images/odd/one/1.jpg'); INSERT INTO `windows`(`window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('雷氏饺子馆', '旧食堂', '一楼', '2', '/Images/odd/one/2.jpg'); INSERT INTO `windows`(`window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('宝鸭面馆', '新食堂', '二楼', '1', '/Images/new/two/1.jpg'); INSERT INTO `windows`(`window_name`, `window_canteen`, `window_tier`, `window_num`, `window_picture`) VALUES ('麻辣烫', '旧食堂', '三楼', '1', '/Images/odd/three/1.jpg'); -- 给食物插数据 INSERT INTO `foods` (`food_id`, `food_name`,`food_type`) VALUES ('1', '刀削面','面食'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('猪肉大葱饺子','饺子'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('土豆','素菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('炒鸡蛋','荤菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('油泼面','面食'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('米饭','米类'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('鸡腿','荤菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('豆浆','饮品'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('可口可乐','饮品'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('炒米','米类'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('汽水','饮品'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('豆腐','素菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('菠菜','素菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('黄瓜','素菜'); INSERT INTO `foods` (`food_name`,`food_type`) VALUES ('腰子','荤菜'); -- 给菜单查数据 INSERT INTO `menu` VALUES ('1','3','/Images/new/one/one/potato.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','4','/Images/new/one/one/fryegg.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','6','/Images/new/one/one/rich.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','7','/Images/new/one/one/drumstick.jpg','3.0','0'); INSERT INTO `menu` VALUES ('1','9','/Images/new/one/one/coca.jpg','4.0','0'); INSERT INTO `menu` VALUES ('1','11','/Images/new/one/one/codewater.jpg','4.0','0'); INSERT INTO `menu` VALUES ('1','12','/Images/new/one/one/doufu.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','13','/Images/new/one/one/spinach.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','14','/Images/new/one/one/cuke.jpg','1.0','0'); INSERT INTO `menu` VALUES ('1','15','/Images/new/one/one/kidney.jpg','3.0','0'); INSERT INTO `menu` VALUES ('2','6','/Images/new/one/two/rich.jpg','1.0','0'); INSERT INTO `menu` VALUES ('2','7','/Images/new/one/two/drumstick.jpg','4.0','0'); INSERT INTO `menu` VALUES ('3','1','/Images/odd/one/one/daonoodles.jpg','6.0','0'); INSERT INTO `menu` VALUES ('3','5','/Images/odd/one/one/younoodles.jpg','7.0','0'); INSERT INTO `menu` VALUES ('4','2','/Images/odd/one/two/dumplings.jpg','10.0','0'); -- 给时间段表插数据 INSERT INTO `time` VALUES ('1','新食堂','一楼','1','2020-05-25 11:30:00','2020-05-25 12:00:00',500,498); INSERT INTO `time` VALUES ('2','新食堂','一楼','2','2020-05-25 12:00:00','2020-05-25 12:30:00',500,200); INSERT INTO `time` VALUES ('3','新食堂','一楼','3','2020-05-25 12:30:00','2020-05-25 13:00:00',500,498); INSERT INTO `time` VALUES ('4','新食堂','一楼','4','2020-05-25 13:00:00','2020-05-25 13:30:00',500,499); INSERT INTO `time` VALUES ('5','新食堂','一楼','5','2020-05-25 13:30:00','2020-05-25 14:00:00',500,300); INSERT INTO `time` VALUES ('6','新食堂','二楼','1','2020-05-25 11:30:00','2020-05-25 12:00:00',500,497); -- 给管理员插数据 INSERT INTO `admini` VALUES ('1', '赵总', '123456', '13045628520', '1'); INSERT INTO `admini` VALUES ('2','赵云', '123456', '13045678956', '1'); INSERT INTO `admini` VALUES ('3','马董', '123123', '13096385274', '2'); INSERT INTO `admini` VALUES ('4','马超', '123123', '13074185296', '2'); INSERT INTO `admini` VALUES ('5','李帅', '123123', '13012341234', '3'); INSERT INTO `admini` VALUES ('6','李存孝', '123123', '13067896789', '3'); INSERT INTO `admini` VALUES ('7','雷开心', '123456', '13093944163', '4'); INSERT INTO `admini` VALUES ('8','雷军', '123456', '13045674567', '4');
true
9b7e91e01b4256f773ee86b3f0329340b964c50a
SQL
YoannBalcon/AFPATunes2k16
/db/pouetv2.sql
UTF-8
1,564
2.953125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 28, 2016 at 08:36 AM -- Server version: 5.7.16-0ubuntu0.16.04.1 -- PHP Version: 7.0.8-0ubuntu0.16.04.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `pouetv2` -- -- -------------------------------------------------------- -- -- Table structure for table `track` -- CREATE TABLE `track` ( `id` int(11) NOT NULL, `title` varchar(120) NOT NULL, `artist` varchar(120) NOT NULL, `duration` int(11) NOT NULL, `year` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `track` -- INSERT INTO `track` (`id`, `title`, `artist`, `duration`, `year`) VALUES (2, 'cosmic girl', 'jamiroquai', 214, 1994), (3, 'toto fait caca', 'toto', 700, 2015); -- -- Indexes for dumped tables -- -- -- Indexes for table `track` -- ALTER TABLE `track` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `track` -- ALTER TABLE `track` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; /*!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
0f75da39325be1e2dd9042532043144acf8e7ddb
SQL
saurabhlomte143/novopay-training-projects
/spring-framework/spring-testing/module08-question04/src/main/resources/manual-schema.sql
UTF-8
633
3.15625
3
[]
no_license
drop database if exists `spring-tutorial`; drop database if exists `spring-tutorial`; drop user if exists `spring-tutorial`@'localhost'; create database `spring-tutorial`; create user `spring-tutorial`@'localhost' identified by 'spring-tutorial'; grant all privileges on `spring-tutorial`.* TO `spring-tutorial`@'localhost'; create table `spring-tutorial`.`guests` ( id int auto_increment, first_name varchar(32), last_name varchar(32), primary key (id) ); create table `spring-tutorial`.`rooms` ( id int auto_increment, name varchar(32), section varchar(32), primary key (id) );
true
434beeca3692fd377567547548d534e58474fcc0
SQL
KyleGoertzen1/Week08Lab
/src/java/database/NotesDB.sql
UTF-8
314
2.75
3
[]
no_license
DROP DATABASE if exists NotesDB; CREATE DATABASE NotesDB; USE NotesDB; DROP TABLE Note; CREATE TABLE Note( noteId INT(11) NOT NULL AUTO_INCREMENT, dateCreated DATE NOT NULL, contents VARCHAR(10000) NOT NULL, PRIMARY KEY (noteId) ); INSERT INTO Note values(default, "1988/05/01", 'Hello World!');
true
e5350e8683ced714c0a6e8f0709b8101af351103
SQL
AnnaBia/turma30generation
/Mysql/ExerciciosAula/Atividade1/db_registroEscolar.sql
UTF-8
1,711
3.65625
4
[]
no_license
-- cria banco de dados create database db_registroEscolar -- puxa banco de dados p/criar tabela use db_registroEscolar; -- cria tabela Create table tb_estudantes( id bigint(10) auto_increment, Matrícula int(10) not null, Nome varchar(50) not null, Turma varchar(10) not null, Nota int(5) not null, Situação varchar(50) not null, primary key(id) ); -- cria dados tabela insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(111,"Angélica","1ªsérie",8,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(112,"Gabriel","1ªsérie",8,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(113,"Angela","1ªsérie",8,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(114,"Gerson","1ªsérie",8,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(115,"Ana Beatriz","1ªsérie",5,"Reprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(116,"Alejandro","1ªsérie",9,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(117,"Henry","1ªsérie",9,"Aprovado"); insert into tb_estudantes(Matrícula,Nome,Turma,Nota,Situação) values(118,"Leticia","1ªsérie",9,"Aprovado"); -- apresenta tabela select * from tb_estudantes -- seleciona dados c/nota > 7; select * from tb_estudantes where nota > 7 -- seleciona dados c/nota < 7; select * from tb_estudantes where nota < 7 -- atualizando situação Ana update tb_estudantes set Matrícula = "115", Nome = "Ana Beatriz", Turma = "1ªsérie", Nota = 10, Situação = "Aprovado" where id = 5; -- apresenta tabela select * from tb_estudantes
true
f9cfe2f85e83890e9ea7b43bb32b0b7f949186ba
SQL
shushiej/leet_code_problems
/SQL/leetcode/duplicate_emails/solution_distinctjoin.sql
UTF-8
107
2.796875
3
[]
no_license
#210ms Select DISTINCT a.Email from Person AS a JOIN Person AS b WHERE a.Email = b.Email AND a.ID != b.Id
true
96c1ba8c60ffb92125a549e74b10d40ed4b876c9
SQL
keyber/Licence
/old/2I009/tme10/PROCmoyprime.sql
UTF-8
462
3.1875
3
[]
no_license
CREATE or REPLACE PROCEDURE PROCmoyprime(P_lieutournoi GAIN.lieutournoi%TYPE, P_annee GAIN.annee%TYPE ) IS V_moyenne GAIN.prime%TYPE; FIN exception; BEGIN select AVG(prime) into V_moyenne from GAIN where lieutournoi=P_lieutournoi and annee=P_annee; if V_moyenne is null then raise FIN; end if; dbms_output.put_line(P_lieutournoi||' '||to_char(P_annee)||': ' ||to_char(V_moyenne)); EXCEPTION when FIN then dbms_output.put_line('Tournoi non répertorié'); END; /
true
e1d60c4021cd21f514a59230aa434c90dd25bb5e
SQL
cadeparkhurst/DnDatabase
/Stored Proc Scripts/unlearnSpell.sql
UTF-8
741
3.515625
4
[]
no_license
CREATE PROCEDURE unlearnSpell @CharacterID int, @SpellID int AS BEGIN IF(@CharacterID IS NULL OR NOT EXISTS (SELECT * FROM [Character] WHERE CharacterID = @CharacterID)) BEGIN RAISERROR('Character must not be null and must exist in the Character table', 14, 1); RETURN 1; END IF(@SpellID IS NULL OR NOT EXISTS (SELECT * FROM Spell WHERE [Name] = @SpellID)) BEGIN RAISERROR('Spell must not be null and must exist in the Spell table', 14, 2); RETURN 2; END IF(NOT EXISTS (SELECT * FROM KnowsSpell WHERE CharacterID = @CharacterID AND SpellID = @SpellID)) BEGIN RAISERROR('The character does not know that spell', 14, 3); RETURN 3; END DELETE FROM KnowsSpell WHERE CharacterID = @CharacterID AND SpellID = @SpellID; END
true
3172d17ffad60e5e9dfd28b9f6200ce275c56f9f
SQL
fasoncho/Stored-Procedures-and-Functions
/Stored Procedures and Functions/2. Employees with Salary Above Number.sql
UTF-8
211
3.109375
3
[]
no_license
CREATE OR ALTER PROC usp_GetEmployeesSalaryAboveNumber @Treshold DECIMAL(18,4) AS BEGIN SELECT FirstName, LastName FROM Employees WHERE Salary >= @Treshold END EXEC usp_GetEmployeesSalaryAboveNumber 50000
true
05a1c304af1871f93e9ee9a8e02f75ea23257e54
SQL
AscEmu/AEweb
/sql/updates/20180723-00_news.sql
UTF-8
817
2.78125
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : local Source Server Version : 50714 Source Host : localhost:3306 Source Database : asc_web Target Server Type : MYSQL Target Server Version : 50714 File Encoding : 65001 Date: 2018-07-23 22:03:33 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `news` -- ---------------------------- DROP TABLE IF EXISTS `news`; CREATE TABLE `news` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userId` int(10) unsigned NOT NULL DEFAULT '1', `title` varchar(200) NOT NULL DEFAULT '', `time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, `text` longtext, `image` varchar(300) DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
true
5d20a2f24f25a28a3cc25cc83f9dd617bdd015ae
SQL
Lina2803/test
/proekt/1600-2503.sql
UTF-8
2,701
4.0625
4
[]
no_license
create database if not exists myBD25032016; use myBD25032016; create table if not exists teacher ( id_teacher int not null auto_increment primary key, name varchar(50), surname varchar(50), salary int ); create table if not exists lesson ( id_lesson int not null auto_increment primary key, title varchar(50) ); create table if not exists ref ( id_of_teacher int , id_of_lesson int ); alter table ref add constraint x1 foreign key (id_of_teacher) references teacher(id_teacher); alter table ref add constraint x2 foreign key (id_of_lesson) references lesson(id_lesson); insert into teacher (name,surname, salary) values ('roman','zherebetskiy',1000), ('petro','zhuk',1200), ('mykola','shorubura',900), ('sergiy','zhuravlyov',1500), ('sergiy','sokol',1400); insert into lesson (title) values ('java core'), ('java advance'), ('javascript'), ('html'), ('mysql'); insert into ref (id_of_teacher, id_of_lesson) values (1,1), (1,2), (1,3), (2,3), (2,4), (3,1), (4,1), (4,2), (4,4), (4,5), (5,1), (5,2), (5,5); select id_teacher,name,surname,salary,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson; select id_teacher,name,surname,salary,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson order by title; select distinct name,surname from teacher; select id_teacher,name,surname,salary,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson group by title; select sum(salary) from teacher; select avg(salary) from teacher; select min(salary) from teacher; select max(salary) from teacher; select count(name) from teacher; select count(id_teacher)from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson; select count(title),title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson group by title; select id_teacher,name,surname,salary,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson order by title; select count(name),name from teacher group by name; select id_teacher,name,surname,salary,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson where salary > 1000 having name = 'sergiy'; select max(salary)as max,title from teacher join ref on id_of_teacher = id_teacher join lesson on id_of_lesson = id_lesson group by title order by max;
true
1bd6362cd41ac4aef52587f8014048ecf1cef51f
SQL
pfmiller/Group-Informatics
/R-Code/MyLyn/SQL/research_distances_comm.sql
UTF-8
276
3.03125
3
[]
no_license
create table research_distances_comm as select author_id, reporter_id, releaseId, count(*) as bug_comm from research_comment_by_release where releaseId >=2 group by author_id, reporter_id, releaseId order by releaseId select * from research_distances_comm order by releaseId
true
34641184834a7aedce434c2910f2179bf0f506de
SQL
DennisCheung/nxft
/dbscript/fxp/dbms/tables/04_任务待办/1000010_p_todo_待办任务项表.sql
GB18030
3,687
3.296875
3
[]
no_license
-- -- -- -- v1.0 2015.11.03 -- authorwing -- -- һ˵ -- 1ҵνãΪһҵ֮乵ͨ -- 2֪ͨһڣΪһڿʼڡ -- 3͡һڵ -- 4˱¼ɾ -- -- ʣ -- 1fnote_type ǷΪҵ͡ -- 2fnode_id жڵҵΪڣֻһڵҵǷΪ ҵͣ طò֡ -- 3طǷֻһڣ -- -- -- ޸ʷ -- -- -- Drop Table fxp.p_todo; Create Table fxp.p_todo ( -- +-----------------------------+--------------+-----------+ ftodo_id varchar2(32) not null, -- id -- -- 񵥾 -- fnote_type_id varchar2(30) not null, -- ID ͷ fnote_id varchar2(150) not null, -- Ҫĵ,öŷָ -- -- ˵ -- ftodo_content varchar2(300) not null, -- Ҫڹ ʽ ftodo_remark varchar2(300), -- ע fcreate_time date not null, -- ʱ fnode_id varchar2(30) not null, -- ID fnote_tag varchar2(128) not null, -- tag ʱ 'DEFAULT' ficon_file varchar2(30) not null, -- ͼļ abc.jpg ͼ·ͬɳͳһ fblock_no varchar2(10) not null, -- fordernum number(6,2) not null, -- -- -- -- fis_grabbed char(1) not null, -- Ƿ Y/N fgrab_time date, -- ʱ fgrab_circle_id varchar2(32), -- Ȧid fgrab_team_id varchar2(32), -- id fgrab_user_id varchar2(32), -- Աid fgrab_user_name varchar2(40), -- Ա -- -- ͻϢ -- fperson_id varchar2(32), -- ID fperson_name varchar2(50), -- ffamily_id varchar2(32), -- ͥid fcircle_id varchar2(32), -- Ȧid -- +-----------------------------+--------------+-----------+ -- -- ־ -- fversion number(6) -- 汾 default 0 not null, flogcby varchar2(32) not null, -- flogcdate date not null, -- ʱ flogluby varchar2(32) not null, -- ޸ flogludate date not null, -- ޸ʱ floglaby varchar2(32) not null, -- flogladate date not null, -- ʱ -- -- Ψһ -- constraint pk_p_todo primary key (ftodo_id), constraint uk_p_todo unique (fnote_type_id,fnote_id) ); -- -- ͬ -- -- -- Ȩ -- -- -- -- -- -- ޸䣺 --
true
6ffc1c77c90850f2b43c3f7d5652ea561faf01b1
SQL
dsenicero/MySQL
/SeniceroCoffeeGrindModify.sql
UTF-8
4,599
3.8125
4
[]
no_license
-- Identifier -- D'Angelo Senicero 20/FA ITSE-2309-10X1 -- ----------------------------------------------------- -- Verifies use of my database -- THE USE STATEMENT IS USED TO SELECT MY DATABASE -- ----------------------------------------------------- use senicero; -- ----------------------------------------------------- -- 4A Write select statements to list all records and all fields from each table -- QUERIES USED TO DISPLAY ALL DATA OF TABLES, DRAP AND SELECT ALL QUERIES AND PRESS CRL+SHIFT+ENTER TO DISPLAY ALL AT ONCE -- ----------------------------------------------------- select * from customers; select * from order_details; select * from orders; select * from product_suppliers; select * from products; select * from suppliers; -- ----------------------------------------------------- -- 4B The following statement displays supplier names and the description of the product(s) they supply. -- Only suppliers that provide a product are displayed. Results are ordered by supplier name. -- QUERY DISPLAYS THE SUPPLIERS THAT SUPPLIES PRODUCTS. DISPLAYS SUPPLIER_NAME AND PRODUCT_DESCRIPTION -- ----------------------------------------------------- SELECT supplier_name, product_description FROM product_suppliers JOIN products USING (product_id) JOIN suppliers USING (supplier_id) ORDER BY supplier_name; -- ----------------------------------------------------- -- 4C Write a statement that displays the product id and description of products, along with the -- vendor(s) that supply them -- QUERY DISPLAYS LISTS ALL OF THE PRODUCTS THAT HAVE SUPPLIERS WITH THE ADDITION OF THEIR PRODUCT_ID, PRODUCT_DESCRIPTION, AND SUPPLIER_NAME -- ----------------------------------------------------- SELECT product_id, product_description, supplier_name FROM products JOIN product_suppliers USING (product_id) JOIN suppliers USING (supplier_id) ORDER BY product_id; -- ----------------------------------------------------- -- 4D Write a statement that displays the full name of all customers. -- QUERY DISPLAYS CUSTOMER'S FULL NAME -- ----------------------------------------------------- SELECT CONCAT_WS(', ', customer_last_name, customer_first_name) AS 'Full Name' FROM customers; -- ----------------------------------------------------- -- 4E Write a statement that displays the full name of customers who placed orders, the order id, the -- dates they placed the order, and the product ID, quantity, and description of what they ordered -- QUERY DISPLAYS CUSTOMER'S FULL NAME, ORDER_ID, ORDER_DATE, PRODUCT_ID, ORDER_QTY, AND PRODUCT DESCRIPTION. -- ORDER BY FULL NAME, ORDER_DATE, AND THEN PRODUCT_ID -- ----------------------------------------------------- SELECT CONCAT_WS(', ', customer_last_name, customer_first_name) AS 'Full Name', order_id, order_date, product_id, order_qty, product_description FROM orders JOIN order_details USING (order_id) JOIN products USING (product_id) JOIN customers USING (customer_id) ORDER BY CONCAT_WS(', ',customer_last_name, customer_first_name), order_date, product_id; -- ----------------------------------------------------- -- 4F Write a statement to add a record to a table using an auto increment column -- 'INSERTS' NEW SUPPLIER INTO SUPPLIERS TABLE -- ----------------------------------------------------- INSERT INTO suppliers VALUES (DEFAULT, 'Function(x) Inc.', '4 Aberg Way', 'Indianapolis', 'IN', '46278', '317-924-5958', '3146524880', 'Benjy', 'Manterfield'); select * from suppliers; -- ----------------------------------------------------- -- 4G Write a statement to edit at least one record in a table -- EDITS PREVIOUSLY ADDED SUPPLIER TO DIFFERENT SUPPLIER BY IDENTIFYING SUPPLIER_ID -- ----------------------------------------------------- UPDATE suppliers SET supplier_name = 'Plastic Coffee', supplier_address = '0 Plastic Way', supplier_city = 'Waco', supplier_state = 'TX', supplier_zip_code = '76711', supplier_fax = NULL, supplier_contact_first_name = 'Plastic', supplier_contact_last_name = 'Man' WHERE supplier_id = 6; select * from suppliers; -- ----------------------------------------------------- -- 4H Write a statement to delete at least one record in a table -- DELETES PLASTIC COFFEE FROM THE SUPPLIERS TABLE BY IDENTIFYING SUPPLIER_ID -- ----------------------------------------------------- DELETE FROM suppliers WHERE supplier_id = 6; SELECT * FROM suppliers;
true
34727db58e47846f28bac262ecccdee724327c0b
SQL
hohuypn/project_intern2020
/project_intern.sql
UTF-8
71,890
3.109375
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 05, 2020 at 10:24 AM -- Server version: 10.4.13-MariaDB -- PHP Version: 7.4.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `project_intern` -- -- -------------------------------------------------------- -- -- Table structure for table `cart_items` -- CREATE TABLE `cart_items` ( `id` int(10) UNSIGNED NOT NULL, `user_id` int(10) UNSIGNED NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `quantity` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`, `image`, `created_at`, `updated_at`) VALUES (1, 'Thời Trang Nữ', 'image\\category\\0.04064200 1596169446-022512-female-fashion.png', '2020-07-20 19:24:58', '2020-07-31 04:24:06'), (2, 'Thời Trang Nam', 'image\\category\\0.63376700 1596166532-030835-man_style.png', '2020-07-20 20:08:12', '2020-07-31 03:35:32'), (3, 'Giày Nam', 'image\\category\\0.04399800 1598927365-giaynam.png', '2020-07-20 20:08:19', '2020-09-01 02:29:25'), (4, 'Phụ kiện & Điện thoại', 'image\\category\\0.54239700 1596166741-dienthoai&phukien.png', '2020-07-21 01:24:58', '2020-07-31 03:39:01'), (5, 'Máy tính & Laptop', 'image\\category\\0.97145000 1596166779-maytinh&laptop.png', '2020-07-21 01:26:06', '2020-07-31 03:39:39'), (6, 'Thể thao & Du lịch', 'image\\category\\0.73936100 1596169398-thethao&dulich.png', '2020-07-21 01:26:52', '2020-07-31 04:23:18'), (7, 'Đồng Hồ', 'image\\category\\0.48305100 1598927288-dongho.png', '2020-07-30 13:46:18', '2020-09-01 02:28:08'); -- -------------------------------------------------------- -- -- Table structure for table `contacts` -- CREATE TABLE `contacts` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `message` text COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `contacts` -- INSERT INTO `contacts` (`id`, `name`, `email`, `title`, `message`, `created_at`, `updated_at`) VALUES (1, 'RaNghi Van Huy', 'ranghivanhuy@gmail.com', 'Support', 'Nothing to support', '2020-07-30 01:38:34', '2020-07-31 01:56:04'), (2, 'Hồ Văn Huy', 'huy.ho@gmail.com', 'Support about profile', 'I need you support me about profile', '2020-07-30 08:42:34', '2020-07-30 08:42:34'), (3, 'Nguyen Van A', 'a.nguyen@gmail.com', 'Support', 'Nothing to support', '2020-07-31 01:46:03', '2020-07-31 01:46:03'); -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED 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() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_08_19_000000_create_failed_jobs_table', 1), (4, '2020_07_20_082808_laratrust_setup_tables', 1), (5, '2020_07_20_093500_create_categories_table', 2), (6, '2020_07_21_063041_create_products_table', 3), (7, '2016_06_01_000001_create_oauth_auth_codes_table', 4), (8, '2016_06_01_000002_create_oauth_access_tokens_table', 4), (9, '2016_06_01_000003_create_oauth_refresh_tokens_table', 4), (10, '2016_06_01_000004_create_oauth_clients_table', 4), (11, '2016_06_01_000005_create_oauth_personal_access_clients_table', 4), (12, '2020_07_23_013136_create_contacts_table', 4), (13, '2020_07_30_154522_create_stores_table', 5), (14, '2020_07_30_155631_create_orders_table', 6), (15, '2020_07_30_160424_create_order_details_table', 7), (16, '2020_07_31_104426_create_slides_table', 8), (17, '2020_08_21_111048_create_cart_items_table', 9), (18, '2020_07_30_155633_create_orders_table', 10), (19, '2020_07_30_160425_create_order_details_table', 11), (20, '2020_08_29_085005_add_attribute_quantity_into_order_details_table', 12), (21, '2020_08_29_090648_delete_column_into_orders_table', 13), (22, '2020_08_29_164753_update_column_quantity_and_delete_column_status', 14), (23, '2020_08_30_184937_modified_column_in_order_details', 15), (24, '2020_08_30_185307_add_new_columns_in_orders_table', 16), (25, '2020_08_31_080032_modified_column_into_order_details_table', 17), (26, '2020_08_31_080554_modified_column_into_products_table', 18), (27, '2020_08_31_080715_add_foreign_column_into_order_details_table', 19), (28, '2020_08_31_081221_modified_column_into_users_table', 20), (29, '2020_08_31_081402_add_foreign_key_column_into_orders_table', 21), (30, '2020_08_31_084842_modified_column_into_categories_table', 22), (31, '2020_08_31_085036_modify_column_into_products_table', 23), (32, '2020_08_31_223820_add_name_column_into_order_table', 24); -- -------------------------------------------------------- -- -- Table structure for table `oauth_access_tokens` -- CREATE TABLE `oauth_access_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) UNSIGNED DEFAULT NULL, `client_id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_access_tokens` -- INSERT INTO `oauth_access_tokens` (`id`, `user_id`, `client_id`, `name`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) VALUES ('02b4b183f3240840077b6e74bc446d054aedda845b1b70e0a4b8fcd4a4f2fd8332447fe48bef0aeb', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:54:32', '2020-08-24 13:54:32', '2021-08-24 20:54:32'), ('07af86887f6a548e01aa11ecf61a048935b62224bddac55f95aa5ea528c486a53b0ea735a94d061c', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:33:08', '2020-08-24 13:33:08', '2021-08-24 20:33:08'), ('0d4282c9fba64b7eac53a78461dea95398226d588ad9f3a5cc8918b5734662df17eefdef55759bae', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:08:42', '2020-08-24 03:08:42', '2021-08-24 10:08:42'), ('18a9d34af4288e824045048cecf103fa685636807f10ee0150dfe14af9fe1cd87ffef4266c91e15c', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:07:06', '2020-08-24 03:07:06', '2021-08-24 10:07:06'), ('29c4a334d07634e5c9a723bf9bc28daca6b3f5b6ff747e4b72e834f581485df85764133d2f6bf2a8', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:06:57', '2020-08-24 03:06:57', '2021-08-24 10:06:57'), ('310f7c052b2f7a61433a7f9d2212acee1daf26eccd9ff94d109a9695d319ef87b40f9d93fbeaf1e8', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:06:57', '2020-08-24 03:06:57', '2021-08-24 10:06:57'), ('50edbc87ca717f6822d70e174b45e9f9e9d0b518d46cff869f3a41ccddf2e056e5720c5c68234f5c', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:03:38', '2020-08-24 03:03:38', '2021-08-24 10:03:38'), ('6789bfe25cf551d479ab0dcf05fdc5e223bd840d29bc232a548ad86beea3cf130491e47d8117c961', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:06:43', '2020-08-24 03:06:43', '2021-08-24 10:06:43'), ('718b8755fd161886bf8761b8032aae2bc3c24e5afacc70b7bbe7dcf4bf24ace72b70ba21c0dd378c', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:02:01', '2020-08-24 03:02:01', '2021-08-24 10:02:01'), ('8a2fb54d805d351f1f4ce47d20e388ccfe05f335b7b83868fce0298f578a480f0cce84826cf2d64e', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:43:35', '2020-08-24 13:43:35', '2021-08-24 20:43:35'), ('8a4fdbb962d061f02e0f0303db7eb8a31090445c4245d660e074edaa22764248d35ac22f103f10a0', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:52:30', '2020-08-24 13:52:30', '2021-08-24 20:52:30'), ('9820863cc680c931cf6254e7e52c016793316770e54836631ace3e07f2fe29e8aed1def16763e0c6', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:07:05', '2020-08-24 03:07:05', '2021-08-24 10:07:05'), ('9bb84b841989e8201ee69b53fc064feb12f0a38e3925a2ad6f3a98cd8bad4e6ccf0192c785006d60', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:47:16', '2020-08-24 13:47:16', '2021-08-24 20:47:16'), ('b4cbd590a779f296b23c135195af4d569db080fe02be0b775b15230eda5d4bb5194ca93626b98973', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:08:07', '2020-08-24 03:08:07', '2021-08-24 10:08:07'), ('ce5ab947523b1af2c8b44e947de7e665ae62a7fa346140a663d6f2fbf1a48418fe4810480d3aa3db', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:01:27', '2020-08-24 03:01:27', '2021-08-24 10:01:27'), ('d7279706643718e898139fad0db151dcf63517c527357ff3d84ac800c3c3d4158ded03aa56f55682', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:06:59', '2020-08-24 03:06:59', '2021-08-24 10:06:59'), ('e13dd6ff4df83a01b1e91742f2305000c2cb25245cea908e37c8b545757ae0c0410b1e727eb95917', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 13:50:50', '2020-08-24 13:50:50', '2021-08-24 20:50:50'), ('f809f63aa26856ccff5c94410b1bb249dc11bcce6d691d279cde5f44bf61815bcf28ae2401af0199', 1, 1, 'Personal Access Token', '[]', 0, '2020-08-24 03:07:46', '2020-08-24 03:07:46', '2021-08-24 10:07:46'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_auth_codes` -- CREATE TABLE `oauth_auth_codes` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `client_id` bigint(20) UNSIGNED NOT NULL, `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `oauth_clients` -- CREATE TABLE `oauth_clients` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL, `personal_access_client` tinyint(1) NOT NULL, `password_client` tinyint(1) NOT NULL, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_clients` -- INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES (1, NULL, 'Laravel Personal Access Client', '98W8Bd0HzclD7Fobr4RihvU7nPihYZLEuG3kuYMk', NULL, 'http://localhost', 1, 0, 0, '2020-07-30 01:24:08', '2020-07-30 01:24:08'), (2, NULL, 'Laravel Password Grant Client', 'Ocayl8eSvZG0IB2G9SMFK9pO5hGoCWMiTl0qBZoO', 'users', 'http://localhost', 0, 1, 0, '2020-07-30 01:24:08', '2020-07-30 01:24:08'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_personal_access_clients` -- CREATE TABLE `oauth_personal_access_clients` ( `id` bigint(20) UNSIGNED NOT NULL, `client_id` bigint(20) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_personal_access_clients` -- INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES (1, 1, '2020-07-30 01:24:08', '2020-07-30 01:24:08'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_refresh_tokens` -- CREATE TABLE `oauth_refresh_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `phone` int(11) DEFAULT NULL, `shipment_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `notes` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `user_id`, `name`, `email`, `phone`, `shipment_address`, `notes`, `status`, `created_at`, `updated_at`) VALUES (125, 1, NULL, 'ranghivanhuy@gmail.com', 334133327, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Giao hàng sớm cho tôi, cảm ơn!', 1, '2020-08-31 09:28:02', '2020-08-31 09:28:02'), (126, 1, NULL, 'ranghivanhuy@gmail.com', 334133327, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Giao hàng sớm cho tôi, cảm ơn!', 1, '2020-08-31 09:35:21', '2020-08-31 09:35:21'), (127, 1, NULL, 'ranghivanhuy@gmail.com', 334133327, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Giao hàng sớm cho tôi, cảm ơn!', 1, '2020-08-31 09:36:19', '2020-08-31 09:36:19'), (128, 1, NULL, 'ranghivanhuy@gmail.com', 334133327, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Giao hàng sớm cho tôi, cảm ơn!', 1, '2020-08-31 09:37:27', '2020-08-31 09:37:27'), (129, 1, NULL, 'ranghivanhuy@gmail.com', 334133327, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Giao hàng sớm cho tôi, cảm ơn!', 1, '2020-08-31 09:38:15', '2020-08-31 09:38:15'), (138, 1, NULL, 'ngoctai.dev@gmail.com', 915981110, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', NULL, 1, '2020-08-31 14:57:29', '2020-08-31 14:57:29'), (143, 1, NULL, 'ngoctai.dev@gmail.com', 915981110, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', NULL, 1, '2020-08-31 15:09:41', '2020-08-31 15:09:41'), (145, 1, NULL, 'ngoctai.dev@gmail.com', 915981110, '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', NULL, 1, '2020-08-31 15:10:58', '2020-08-31 15:10:58'); -- -------------------------------------------------------- -- -- Table structure for table `order_details` -- CREATE TABLE `order_details` ( `id` bigint(20) UNSIGNED NOT NULL, `order_id` bigint(20) UNSIGNED NOT NULL, `product_id` bigint(20) UNSIGNED NOT NULL, `order_quantity` int(11) NOT NULL, `unit_price` double NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `order_details` -- INSERT INTO `order_details` (`id`, `order_id`, `product_id`, `order_quantity`, `unit_price`, `created_at`, `updated_at`) VALUES (8, 125, 6, 2, 199000, '2020-08-31 09:28:02', '2020-08-31 09:28:02'), (9, 125, 7, 3, 140, '2020-08-31 09:28:02', '2020-08-31 09:28:02'), (10, 127, 7, 3, 140, '2020-08-31 09:36:19', '2020-08-31 09:36:19'), (11, 128, 6, 1, 199000, '2020-08-31 09:37:27', '2020-08-31 09:37:27'), (12, 129, 6, 1, 199000, '2020-08-31 09:38:15', '2020-08-31 09:38:15'), (13, 129, 7, 2, 140, '2020-08-31 09:38:15', '2020-08-31 09:38:15'), (14, 138, 7, 5, 140, '2020-08-31 14:57:29', '2020-08-31 14:57:29'), (17, 143, 7, 5, 140, '2020-08-31 15:09:41', '2020-08-31 15:09:41'), (18, 143, 6, 5, 199000, '2020-08-31 15:09:41', '2020-08-31 15:09:41'), (20, 145, 7, 5, 140, '2020-08-31 15:10:58', '2020-08-31 15:10:58'), (21, 145, 6, 4, 199000, '2020-08-31 15:10:58', '2020-08-31 15:10:58'); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `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 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `permissions` -- INSERT INTO `permissions` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES (1, 'create-product', 'Create product', 'create-product can create new product', '2020-07-20 02:00:41', '2020-07-20 02:00:41'), (2, 'edit-product', 'Edit product', 'edit-product can edit product', '2020-07-20 02:01:25', '2020-07-20 02:01:25'), (3, 'list-product', 'List product', 'list-product can list all products', '2020-07-20 02:01:56', '2020-07-20 02:01:56'), (4, 'delete-product', 'Delete product', 'delete-product can delete product', '2020-07-20 02:03:22', '2020-07-20 02:03:22'), (6, 'edit-user', 'Edit user', 'edit-user can edit user', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `permission_roles` -- CREATE TABLE `permission_roles` ( `permission_id` bigint(20) UNSIGNED NOT NULL, `role_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `permission_roles` -- INSERT INTO `permission_roles` (`permission_id`, `role_id`) VALUES (1, 2), (2, 2), (3, 2), (3, 3), (6, 2); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `sku` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `price` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `instock` int(11) DEFAULT NULL, `description` varchar(555) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `categories_id` bigint(20) UNSIGNED NOT NULL, `displayed` tinyint(1) NOT NULL DEFAULT 1, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `name`, `sku`, `price`, `instock`, `description`, `image`, `categories_id`, `displayed`, `created_at`, `updated_at`) VALUES (1, 'Quần shorts nữ, quần đùi đũi cạp chun - QDD - SLIKY', 'QSN-01', '55000.00', 15, 'Quần sooc váy ống rộng chất liệu đũi sước thân thiện môi trường. QUẦN SHORT NỮ, CHUN SLIKY CỰC THOẢI MÁI THOÁNG MÁ. Màu sắc: Đen - Be - Nâu - Rêu -Đỏ-Hồng. Mát mẻ lại còn lịch sự', 'C:\\xampp\\tmp\\phpF9C1.tmp', 1, 1, '2020-07-21 00:39:54', '2020-07-21 00:39:54'), (2, 'Sản phẩm mới', 'M-01', '13000.00', 10, 'Hàng chất lượng cao', 'C:\\xampp\\tmp\\phpABC9.tmp', 2, 1, '2020-07-30 13:57:41', '2020-07-30 13:57:41'), (3, 'Sản phẩm mới', 'M-01', '13000.00', 10, 'Hàng chất lượng cao', 'public\\product\\0.25949500 1596118428-030835-man_style.png', 1, 1, '2020-07-30 14:13:48', '2020-07-30 14:13:48'), (4, 'Sản phẩm mới', 'SP-M01', '13000.00', 10, 'Hàng chất lượng cao', 'image\\product\\0.60418000 1596171577-074150-quanshort.jpg', 1, 1, '2020-07-30 14:17:28', '2020-07-31 04:59:37'), (5, 'Sản phẩm 1', 'SP-01', '13000.00', 10, 'Hàng chất lượng cao', 'image\\product\\0.74541900 1596116050-074322-quanshort3.jpg', 1, 1, '2020-07-30 13:34:10', '2020-07-30 13:34:10'), (6, 'Mũ Lưỡi Chai Chạy Bộ Chống Nắng AONIJIE E4106', 'M-01', '199000.00', 1, 'Hiện tại trên thị trường có rất nhiều sản phẩm AONIJIE là hàng không chính hãng (hàng xách tay, nhập tiểu ngạch phiên bản nội địa Trung Quốc)', 'image\\product\\0.65955300 1596186400-mu4.jfif', 2, 1, '2020-07-31 09:04:27', '2020-07-31 09:06:40'), (7, 'Đồng hồ nữ Casio Anh Khuê LA680WA-1BDF', 'DH-001', '140.00', 10, 'Chất lượng cao, chóng thấm', 'image\\product\\0.76193800 1598478067-mu4.jfif', 7, 1, '2020-08-26 21:32:57', '2020-08-28 08:14:09'), (8, 'Đồng hồ nữ Casio Anh Khuê LA680WA-1BDF', 'DH-001', '130.00', 20, 'Vật liệu vỏ / vành bezel: Nhựa / Mạ crôm, Dây đeo bằng thép không gỉ', 'image\\product\\0.13239100 1598478055-mu2.jfif', 7, 0, '2020-08-26 21:40:55', '2020-08-26 21:40:55'), (9, 'Váy Ngắn Nữ', 'VN-001', '130000.00', 15, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.54578100 1599125232-1.jpg', 1, 1, '2020-09-03 09:27:12', '2020-09-03 09:27:12'), (10, 'Quần Ngắn Nữ - Quần Jean', 'QNN-001', '150000.00', 15, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.36967600 1599125321-2.jpg', 1, 1, '2020-09-03 09:28:41', '2020-09-03 09:28:41'), (11, 'Áo Đôi Mẹ Con', 'AD-001', '100000.00', 20, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.10863600 1599125396-3.jpg', 1, 1, '2020-09-03 09:29:56', '2020-09-03 09:29:56'), (12, 'Áo Croptop tay dài đen chữ đỏ hót( kèm ảnh chụp)', 'AC-001', '120000.00', 25, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.90348800 1599125441-4.jpg', 1, 1, '2020-09-03 09:30:41', '2020-09-03 09:30:41'), (13, 'Áo Croptop tay dài trắng chữ đỏ hót( kèm ảnh chụp)', 'AC-001', '120000.00', 12, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.22292900 1599125497-5.jpg', 1, 1, '2020-09-03 09:31:37', '2020-09-03 09:31:37'), (14, 'Áo Croptop tay dài đỏ chữ trắng hót( kèm ảnh chụp)', 'AC-001', '120000.00', 10, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.66165500 1599125524-6.jpg', 1, 1, '2020-09-03 09:32:04', '2020-09-03 09:32:04'), (15, 'Áo Croptop tay dài đenchữ trắng hót( kèm ảnh chụp)', 'AC-001', '120000.00', 30, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.62605200 1599125564-7.jpg', 1, 1, '2020-09-03 09:32:44', '2020-09-03 09:32:44'), (16, 'Áo croptop body ôm eo tay bồng hở rốn, màu đen VST', 'AC-001', '120000.00', 50, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.24023600 1599125646-8.jpg', 1, 1, '2020-09-03 09:34:06', '2020-09-03 09:34:06'), (17, 'Áo croptop body ôm eo tay bồng hở rốn, màu trắng VST', 'AC-001', '120000.00', 55, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.85735800 1599125658-9.jpg', 1, 1, '2020-09-03 09:34:18', '2020-09-03 09:34:18'), (18, 'Quần kẻ karo ống suông mẫu mới hot VST', 'QK-001', '110000.00', 35, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.42166000 1599125707-10.jpg', 1, 1, '2020-09-03 09:35:07', '2020-09-03 09:35:07'), (19, 'Áo thun nam polo bo dệt phong cách Pigofashion chuẩn xuất khẩu AHT16', 'QK-001', '150000.00', 20, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.00107900 1599125848-1.jpg', 2, 1, '2020-09-03 09:37:28', '2020-09-03 09:37:28'), (20, 'Áo khoác nam phong cách Pigofashion chuẩn xuất khẩu', 'AKN-001', '250000.00', 25, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.57815500 1599125887-2.jpg', 2, 1, '2020-09-03 09:38:07', '2020-09-03 09:38:07'), (21, 'Áo khoác nam màu đen phong cách Pigofashion chuẩn xuất khẩu', 'AKN-001', '250000.00', 10, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.89497100 1599125908-3.jpg', 2, 1, '2020-09-03 09:38:28', '2020-09-03 09:38:28'), (22, 'Áo khoác nam màu xanh đen phong cách Pigofashion chuẩn xuất khẩu', 'AKN-001', '250000.00', 14, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.19582800 1599125924-4.jpg', 2, 1, '2020-09-03 09:38:44', '2020-09-03 09:38:44'), (23, 'Áo khoác nam màu xanh đen phong cách', 'AKN-001', '250000.00', 30, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.39196500 1599125948-5.jpg', 2, 1, '2020-09-03 09:39:08', '2020-09-03 09:39:08'), (24, 'Áo thun nam', 'ATN-001', '160000.00', 32, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.26121900 1599126000-6.jpg', 2, 1, '2020-09-03 09:40:00', '2020-09-03 09:40:00'), (25, 'Áo thun nam trắng', 'ATN-001', '160000.00', 40, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.97656700 1599126018-7.jpg', 2, 1, '2020-09-03 09:40:18', '2020-09-03 09:40:18'), (26, 'Áo thun nam màu các kiểu', 'ATN-001', '160000.00', 60, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.87171900 1599126035-8.jpg', 2, 1, '2020-09-03 09:40:35', '2020-09-03 09:40:35'), (27, 'Quần short nam', 'QSN-001', '170000.00', 70, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.62390800 1599126069-9.jpg', 2, 1, '2020-09-03 09:41:09', '2020-09-03 09:41:09'), (28, 'Áo thun nam', 'QSN-001', '150000.00', 55, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.99108600 1599126141-10.jpg', 2, 1, '2020-09-03 09:42:22', '2020-09-03 09:42:22'), (29, 'Áo thun nam màu trắng', 'ATN-002', '150000.00', 65, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.98413800 1599126176-11.jpg', 2, 1, '2020-09-03 09:42:57', '2020-09-03 09:42:57'), (30, 'Áo thun nam màu xanh da trời', 'ATN-002', '150000.00', 35, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.99465300 1599126197-12.jpg', 2, 1, '2020-09-03 09:43:18', '2020-09-03 09:43:18'), (31, 'Áo thun nam màu xanh da trời 2', 'ATN-002', '150000.00', 35, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.98266800 1599126216-13.jpg', 2, 1, '2020-09-03 09:43:37', '2020-09-03 09:43:37'), (32, 'Áo thun nam màu xanh đen trời 2', 'ATN-002', '150000.00', 20, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.83279100 1599126235-14.jpg', 2, 1, '2020-09-03 09:43:55', '2020-09-03 09:43:55'), (33, 'Áo thun nam đủ màu các loại', 'ATN-002', '150000.00', 30, 'Vui lòng đọc hồ sơ shop để tránh đánh giá shop 1*. Sp bên shop hàng giá rẻ hàng sinh viên .hàng học sinh ko phải hàng shop', 'image\\product\\0.21921900 1599126257-15.jpg', 2, 1, '2020-09-03 09:44:17', '2020-09-03 09:44:17'), (34, 'Giày Nam Thời Trang Thể Thao SODOHA F22', 'GN-001', '134000.00', 25, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài.', 'image\\product\\0.67151000 1599126437-1.jpg', 3, 1, '2020-09-03 09:47:17', '2020-09-03 09:47:17'), (35, 'Giày Nam Thời Trang Thể Thao SODOHA F22 cổ đen', 'GN-001', '134000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.01769700 1599126517-2.jpg', 3, 1, '2020-09-03 09:48:37', '2020-09-03 09:48:37'), (36, 'Giày Nam Thời Trang Thể Thao SODOHA F22 màu đen', 'GN-001', '165000.00', 10, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.72115800 1599126560-3.jpg', 3, 1, '2020-09-03 09:49:20', '2020-09-03 09:49:20'), (37, 'Giày Nam Thời Trang Thể Thao SODOHA màu đen', 'GN-001', '175000.00', 25, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.40511000 1599126589-4.jpg', 3, 1, '2020-09-03 09:49:49', '2020-09-03 09:49:49'), (38, 'Giày Nam Thời Trang Thể Thao SODOHA cổ đỏ', 'GN-001', '160000.00', 30, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.27889800 1599126613-5.jpg', 3, 1, '2020-09-03 09:50:13', '2020-09-03 09:50:13'), (39, 'Giày Nam Thời Trang Thể Thao SODOHA màu đỏ', 'GN-001', '160000.00', 40, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.16710900 1599126644-6.jpg', 3, 1, '2020-09-03 09:50:44', '2020-09-03 09:50:44'), (40, 'Giày Nam Thời Trang Thể Thao', 'GN-001', '200000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.56035000 1599126907-9.jpg', 3, 1, '2020-09-03 09:55:07', '2020-09-03 09:55:07'), (41, 'Giày Nam Thời Trang Thể Thao Đen', 'GN-001', '200000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.00818800 1599126944-10.jpg', 3, 1, '2020-09-03 09:55:44', '2020-09-03 09:55:44'), (42, 'Giày Nam Thời Trang Thể Thao Đen Các Loại', 'GN-001', '200000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.47566500 1599126965-11.jpg', 3, 1, '2020-09-03 09:56:05', '2020-09-03 09:56:05'), (43, 'Giày Nam Thời Trang Thể Thao Xám', 'GN-001', '200000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.38049800 1599126982-12.jpg', 3, 1, '2020-09-03 09:56:22', '2020-09-03 09:56:22'), (44, 'Giày Nam Thời Trang Thể Thao Xám Các Loại', 'GN-001', '190000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.53370900 1599127014-13.jpg', 3, 1, '2020-09-03 09:56:54', '2020-09-03 09:56:54'), (45, 'Giày Nam Thời Trang Thể Thao Đen Siêu Đẹp', 'GN-001', '250000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.18173100 1599127042-14.jpg', 3, 1, '2020-09-03 09:57:22', '2020-09-03 09:57:22'), (46, 'Giày Nam Thời Trang Thể Thao Xám Siêu Đẹp', 'GN-001', '250000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.55287400 1599127058-15.jpg', 3, 1, '2020-09-03 09:57:38', '2020-09-03 09:57:38'), (47, 'Giày Nam Thời Trang Thể Thao Đen Đẹp Đẻ', 'GN-001', '250000.00', 15, 'Để thể hiện mình là người lịch sự, các bạn nam đều phải để ý để vẻ ngoài của mình mỗi khi đi ra ngoài. Đặc biệt, kết hợp trang phục với cá phụ kiện thời trang là vô cùng quan trong. .', 'image\\product\\0.60314300 1599127076-16.jpg', 3, 1, '2020-09-03 09:57:56', '2020-09-03 09:57:56'), (48, 'Ốp Lưng Iphone Trơn Dẻo', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.04560800 1599127192-1.jpg', 4, 1, '2020-09-03 09:59:52', '2020-09-03 09:59:52'), (49, 'Ốp Lưng Iphone Trơn Dẻo Vàng Trọn Bộ', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.56088600 1599127214-2.jpg', 4, 1, '2020-09-03 10:00:14', '2020-09-03 10:00:14'), (50, 'Ốp Lưng Iphone Trơn Dẻo Đen Toàn Tập', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.59514500 1599127229-3.jpg', 4, 1, '2020-09-03 10:00:29', '2020-09-03 10:00:29'), (51, 'Ốp Lưng Iphone Trơn Dẻo Màu Xanh Dương', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.99265000 1599127250-4.jpg', 4, 1, '2020-09-03 10:00:51', '2020-09-03 10:00:51'), (52, 'Ốp Lưng Iphone Trơn Dẻo Màu Hồng', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.79543000 1599127265-5.jpg', 4, 1, '2020-09-03 10:01:05', '2020-09-03 10:01:05'), (53, 'Ốp Lưng Iphone Trơn Dẻo Màu Nâu', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.95952400 1599127276-7.jpg', 4, 1, '2020-09-03 10:01:16', '2020-09-03 10:01:16'), (54, 'Ốp Lưng Iphone Trơn Dẻo Màu Xanh Đen', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.20989100 1599127295-8.jpg', 4, 1, '2020-09-03 10:01:35', '2020-09-03 10:01:35'), (55, 'Ốp Lưng Iphone Trơn Dẻo Màu Các Loại', 'OL-001', '30000.00', 15, 'Nếu quý khách không hài lòng với bất kì lí do gì. Shin Case sẽ hoàn tiền hoặc gửi lại sản mới thay thế cho quý khách.', 'image\\product\\0.52832700 1599127323-9.jpg', 4, 1, '2020-09-03 10:02:03', '2020-09-03 10:02:03'), (56, 'Điện Thoại Chính Hãng', 'ĐT-001', '979000.00', 15, 'Camera trước 32 MP (IMX616) + Cảm biến thông minh AI, Khẩu độ F/2.4', 'image\\product\\0.95298700 1599127797-10.jpg', 4, 1, '2020-09-03 10:09:57', '2020-09-03 10:09:57'), (57, 'Điện Thoại Chính Hãng', 'ĐT-001', '4979000', 15, 'Camera trước 32 MP (IMX616) + Cảm biến thông minh AI, Khẩu độ F/2.4', 'image\\product\\0.68475700 1599127924-11.jpg', 4, 1, '2020-09-03 10:12:04', '2020-09-03 10:12:04'), (58, 'Điện Thoại Chính Hãng Đẹp', 'ĐT-001', '4979000', 15, 'Camera trước 32 MP (IMX616) + Cảm biến thông minh AI, Khẩu độ F/2.4', 'image\\product\\0.51707800 1599127949-12.jpg', 4, 1, '2020-09-03 10:12:29', '2020-09-03 10:12:29'), (59, 'Điện Thoại Chính Hãng Vivo', 'ĐT-001', '4979000', 15, 'Camera trước 32 MP (IMX616) + Cảm biến thông minh AI, Khẩu độ F/2.4', 'image\\product\\0.12805100 1599127965-13.jpg', 4, 1, '2020-09-03 10:12:45', '2020-09-03 10:12:45'), (60, 'Iphone 11 Pro Max', 'ĐT-001', '24000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế', 'image\\product\\0.78156000 1599128017-14.jpg', 4, 1, '2020-09-03 10:13:37', '2020-09-03 10:13:37'), (61, 'Iphone 11 Pro Max 1', 'ĐT-001', '24000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế', 'image\\product\\0.48900600 1599128029-15.jpg', 4, 1, '2020-09-03 10:13:49', '2020-09-03 10:13:49'), (62, 'Iphone 11 Pro Max 1', 'ĐT-001', '24000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế 3 camera', 'image\\product\\0.00897100 1599128042-16.jpg', 4, 1, '2020-09-03 10:14:02', '2020-09-03 10:14:02'), (63, 'Iphone 11 Pro', 'ĐT-001', '24000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế 3 camera', 'image\\product\\0.87985300 1599128060-17.jpg', 4, 1, '2020-09-03 10:14:20', '2020-09-03 10:14:20'), (64, 'Samsung S10', 'ĐT-001', '8000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế 3 camera', 'image\\product\\0.81552200 1599128086-18.jpg', 4, 1, '2020-09-03 10:14:46', '2020-09-03 10:14:46'), (65, 'Vivo 10s', 'ĐT-001', '8000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế 3 camera', 'image\\product\\0.63756700 1599128107-19.jpg', 4, 1, '2020-09-03 10:15:07', '2020-09-03 10:15:07'), (66, 'Vivo 10s 1', 'ĐT-001', '9000000', 15, 'Hàng Chính Hãng - Giá bán quốc tế 3 camera', 'image\\product\\0.93294100 1599128122-20.jpg', 4, 1, '2020-09-03 10:15:22', '2020-09-03 10:15:22'), (67, 'Màn hình HP 22fw (21.5 Inch/FULLHD/60Hz/5Ms/IPS/3KS61AA) - Hàng Chính Hãng', 'MH-001', '3000000', 15, 'Bảo hành tận nhà miến phí Giao & Nhận (quý khách liên hệ tổng đài để được tư vấn chi tiết).', 'image\\product\\0.88735800 1599187647-1.jpg', 5, 1, '2020-09-04 02:47:27', '2020-09-04 02:47:27'), (68, 'Màn hình HP 23FW (21.5 Inch/FULLHD/60Hz/5Ms/IPS/3KS61AA) - Hàng Chính Hãng', 'MH-001', '3000000', 15, 'Bảo hành tận nhà miến phí Giao & Nhận (quý khách liên hệ tổng đài để được tư vấn chi tiết).', 'image\\product\\0.13504800 1599187689-2.jpg', 5, 1, '2020-09-04 02:48:09', '2020-09-04 02:48:09'), (69, 'Màn hình HP 22FW - Hàng Chính Hãng', 'MH-001', '3000000', 15, 'Bảo hành tận nhà miến phí Giao & Nhận (quý khách liên hệ tổng đài để được tư vấn chi tiết).', 'image\\product\\0.51630900 1599187719-3.jpg', 5, 1, '2020-09-04 02:48:39', '2020-09-04 02:48:39'), (70, 'Màn hình HP 22FW - Hàng Chính Hãng 1', 'MH-001', '3000000', 15, 'Bảo hành tận nhà miến phí Giao & Nhận (quý khách liên hệ tổng đài để được tư vấn chi tiết).', 'image\\product\\0.72862300 1599187730-4.jpg', 5, 1, '2020-09-04 02:48:50', '2020-09-04 02:48:50'), (71, 'Màn hình HP 22FW - Hàng Chính Hãng siêu mỏng, siêu cong', 'MH-001', '3000000', 15, 'Bảo hành tận nhà miến phí Giao & Nhận (quý khách liên hệ tổng đài để được tư vấn chi tiết).', 'image\\product\\0.41356600 1599187754-5.jpg', 5, 1, '2020-09-04 02:49:14', '2020-09-04 02:49:14'), (72, 'Laptop ASUS ZenBook UX534FTC-AA189T i7-10510U|16GB|1TB|GTX 1650 4GB|15.6\"FHD|Win 10', 'MH-001', '34990000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.29180200 1599187953-6.jpg', 5, 1, '2020-09-04 02:52:33', '2020-09-04 02:52:33'), (73, 'Laptop ASUS ZenBook UX534FTC-AA189T i7-10510U|16GB|1TB|GTX 1650 4GB|15.6\"FHD|Win 10 1', 'MH-001', '34990000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.30363600 1599187988-7.jpg', 5, 1, '2020-09-04 02:53:08', '2020-09-04 02:53:08'), (74, 'Laptop ASUS ZenBook UX534FTC-AA189T i7-10510U|16GB|1TB|GTX 1650 4GB|15.6\"FHD|Win 10 2', 'MH-001', '34990000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.57589900 1599188007-8.jpg', 5, 1, '2020-09-04 02:53:27', '2020-09-04 02:53:27'), (75, 'Laptop ASUS ZenBook', 'LT-001', '23000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.70482100 1599188047-9.jpg', 5, 1, '2020-09-04 02:54:07', '2020-09-04 02:54:07'), (76, 'Laptop ASUS ZenBook 1', 'LT-001', '23000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.26535900 1599188060-10.jpg', 5, 1, '2020-09-04 02:54:20', '2020-09-04 02:54:20'), (77, 'Laptop ASUS ZenBook 2', 'LT-001', '23000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.63670600 1599188072-11.jpg', 5, 1, '2020-09-04 02:54:32', '2020-09-04 02:54:32'), (78, 'Laptop DELL ZenBook 2', 'LT-001', '7000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.27031900 1599188119-12.jpg', 5, 1, '2020-09-04 02:55:19', '2020-09-04 02:55:19'), (79, 'Laptop DELL ZenBook 3', 'LT-001', '7000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.94546700 1599188168-13.jpg', 5, 1, '2020-09-04 02:56:08', '2020-09-04 02:56:08'), (80, 'Laptop for game 1', 'LT-001', '20000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.31092000 1599188202-14.jpg', 5, 1, '2020-09-04 02:56:42', '2020-09-04 02:56:42'), (81, 'Laptop for game 2', 'LT-001', '20000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.89890300 1599188210-15.jpg', 5, 1, '2020-09-04 02:56:50', '2020-09-04 02:56:50'), (82, 'Laptop for game 3', 'LT-001', '20000000', 15, 'Card đồ họa NVIDIA GeForce GTX 1650 4GB GDDR5 with Max-Q + Intel UHD Graphics. Màn hình 15.6\" FHD (1920 x 1080) IPS, NanoEdge, 100% sRGB, 178° wide-view, 350nits', 'image\\product\\0.42817000 1599188219-16.jpg', 5, 1, '2020-09-04 02:56:59', '2020-09-04 02:56:59'), (83, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.25979100 1599188363-1.jpg', 6, 1, '2020-09-04 02:59:23', '2020-09-04 02:59:23'), (84, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS 1', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.60261200 1599188447-2.jpg', 6, 1, '2020-09-04 03:00:47', '2020-09-04 03:00:47'), (85, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS màu đen', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.63563800 1599188926-3.jpg', 6, 1, '2020-09-04 03:08:46', '2020-09-04 03:08:46'), (86, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS màu đen 1', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.12661800 1599189069-4.jpg', 6, 1, '2020-09-04 03:11:09', '2020-09-04 03:11:09'), (87, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS màu đen 2', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.37193400 1599189079-5.jpg', 6, 1, '2020-09-04 03:11:19', '2020-09-04 03:11:19'), (88, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS màu xanh dương', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.96806700 1599189094-6.jpg', 6, 1, '2020-09-04 03:11:34', '2020-09-04 03:11:34'), (89, 'Đai lưng tập gym, gánh tạ GoodFit GF721WS cho nam nữ', 'DL-001', '249000', 15, 'Đai lưng tập gym GoodFit GF721WS đặc biệt hữu hiệu trong các trường hợp bạn gánh tạ hay tập tạ mà cột sống của bạn chịu áp lực, sử dụng đai sẽ hạn chế được vấn đề chấn thương, mức gánh tạ của bạn sẽ đảm bảo được tăng lên.', 'image\\product\\0.73171500 1599189111-7.jpg', 6, 1, '2020-09-04 03:11:51', '2020-09-04 03:11:51'), (90, 'Bó gối thể thao GoodFit 2 trong 1 GF511K', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.28681600 1599189308-8.jpg', 6, 1, '2020-09-04 03:15:08', '2020-09-04 03:15:08'), (91, 'Bó gối thể thao GoodFit 2 trong 1 GF511K 1', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.23274300 1599189330-9.jpg', 6, 1, '2020-09-04 03:15:30', '2020-09-04 03:15:30'), (92, 'Bó gối thể thao GoodFit 2 trong 1 GF511K nam', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.79131200 1599189339-10.jpg', 6, 1, '2020-09-04 03:15:39', '2020-09-04 03:15:39'), (93, 'Bó gối thể thao GoodFit 2 trong 1 GF511K nam tiêu chuẩn', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.46866500 1599189355-11.jpg', 6, 1, '2020-09-04 03:15:55', '2020-09-04 03:15:55'), (94, 'Bó gối thể thao GoodFit 2 trong 1 GF511K thể thao', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.28769300 1599189374-12.jpg', 6, 1, '2020-09-04 03:16:14', '2020-09-04 03:16:14'), (95, 'Bó gối thể thao GoodFit 2 trong 1 GF511K cho dân bóng chuyền', 'BG-001', '98000', 15, 'Bó gối thể thao GoodFit GF511K có 2 chức năng chính đó là chức năng hỗ trợ và bảo vệ. Hỗ trợ đầu gối khi gặp chấn thương, bảo vệ đầu. gối khỏi những lực tác động không mong muốn khiến chấn thương nặng hơn, đau hơn. Còn chức năng bảo vệ cần thiết khi cơ thể bạn cảm thấy uể oải.', 'image\\product\\0.54905200 1599189393-13.jpg', 6, 1, '2020-09-04 03:16:33', '2020-09-04 03:16:33'), (96, 'Balo Chạy Bộ AONIJIE E913S 5L Tặng Kèm Vest Nước 1.5L', 'BL-001', '499000', 15, 'NHIỀU NGĂN CHỨA ĐỒ: Thiết Kế với 9 túi nhỏ bên ngoài balo, bạn có thể lưu trữ tất cả nhỏ các vật dụng như chìa khóa, điện thoại và tiền mặt v. v.', 'image\\product\\0.53465700 1599189698-14.jpg', 6, 1, '2020-09-04 03:21:38', '2020-09-04 03:21:38'), (97, 'Balo Chạy Bộ AONIJIE E913S 5L Tặng Kèm Vest Nước 1.5L nam nữ', 'BL-001', '499000', 15, 'NHIỀU NGĂN CHỨA ĐỒ: Thiết Kế với 9 túi nhỏ bên ngoài balo, bạn có thể lưu trữ tất cả nhỏ các vật dụng như chìa khóa, điện thoại và tiền mặt v. v.', 'image\\product\\0.33720100 1599189712-15.jpg', 6, 1, '2020-09-04 03:21:52', '2020-09-04 03:21:52'), (98, 'Balo Chạy Bộ AONIJIE E913S 5L Tặng Kèm Vest Nước 1.5L tiện lợi', 'BL-001', '499000', 15, 'NHIỀU NGĂN CHỨA ĐỒ: Thiết Kế với 9 túi nhỏ bên ngoài balo, bạn có thể lưu trữ tất cả nhỏ các vật dụng như chìa khóa, điện thoại và tiền mặt v. v.', 'image\\product\\0.17264900 1599189730-16.jpg', 6, 1, '2020-09-04 03:22:10', '2020-09-04 03:22:10'), (99, 'Balo Chạy Bộ AONIJIE E913S 5L Tặng Kèm Vest Nước 1.5L 1', 'BL-001', '499000', 15, 'NHIỀU NGĂN CHỨA ĐỒ: Thiết Kế với 9 túi nhỏ bên ngoài balo, bạn có thể lưu trữ tất cả nhỏ các vật dụng như chìa khóa, điện thoại và tiền mặt v. v.', 'image\\product\\0.01629700 1599189743-17.jpg', 6, 1, '2020-09-04 03:22:23', '2020-09-04 03:22:23'), (100, 'Vest Nước 1.5L', 'VN-001', '20000', 15, 'Thuận tiện khi đi du lịch, chạy bộ, tập thể thao', 'image\\product\\0.93115800 1599189800-18.jpg', 6, 1, '2020-09-04 03:23:20', '2020-09-04 03:23:20'), (101, 'ĐỒNG HỒ NAM NIBOSI 2309(1985) CHẠY 6 KIM, DÂY DA CAO CẤP, SIÊU CHỐNG NƯỚC CHỐNG XƯỚC', 'DH-001', '325000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.66688800 1599190244-1.jpg', 7, 1, '2020-09-04 03:30:44', '2020-09-04 03:30:44'), (102, 'ĐỒNG HỒ NAM DÂY DA CAO CẤP, SIÊU CHỐNG NƯỚC CHỐNG XƯỚC', 'DH-001', '325000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.95960600 1599190278-2.jpg', 7, 1, '2020-09-04 03:31:18', '2020-09-04 03:31:18'), (103, 'ĐỒNG HỒ NAM DÂY DA CAO CẤP, SIÊU CHỐNG NƯỚC CHỐNG XƯỚC ĐEN', 'DH-001', '325000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.64423300 1599190298-3.jpg', 7, 1, '2020-09-04 03:31:38', '2020-09-04 03:31:38'), (104, 'ĐỒNG HỒ CASIO', 'DH-001', '125000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.32445500 1599190317-3.jpg', 7, 1, '2020-09-04 03:31:57', '2020-09-04 03:31:57'), (105, 'ĐỒNG HỒ CASIO', 'DH-001', '125000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.40737700 1599190323-4.jpg', 7, 1, '2020-09-04 03:32:03', '2020-09-04 03:32:03'), (106, 'ĐỒNG HỒ CASIO cao cấp', 'DH-001', '125000', 15, 'Đồng hồ NIBOSI 1985L sở hữu thiết kế sang trọng với các chi tiết được chế tác tinh xảo, góp phần nâng tầm phong cách của người đeo. Bên cạnh đó, phần kim và số được thể hiện rõ ràng nhưng cũng không kém phần tinh tế, vừa đáp ứng nhu cầu quản lý thời gian vừa tô điểm thêm cho set trang phục của bạn. Với đồng hồ NIBOSI 1985L, bạn nam có thể sử dụng trong mọi dịp, từ đi làm, đi chơi hay tham dự những buổi tiệc.', 'image\\product\\0.52382800 1599190339-11.jpg', 7, 1, '2020-09-04 03:32:19', '2020-09-04 03:32:19'); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES (1, 'user', 'User', 'user can buy, search, view for product and view, update profile', '2020-07-20 01:56:11', '2020-07-20 01:56:11'), (2, 'admin', 'Administrator', 'admin can do everything in application', NULL, NULL), (3, 'seller', 'Seller', 'Seller can sell product in this application', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `role_users` -- CREATE TABLE `role_users` ( `role_id` bigint(20) UNSIGNED NOT NULL, `user_id` bigint(20) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `role_users` -- INSERT INTO `role_users` (`role_id`, `user_id`) VALUES (1, 1), (2, 2), (1, 3); -- -------------------------------------------------------- -- -- Table structure for table `slides` -- CREATE TABLE `slides` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `slides` -- INSERT INTO `slides` (`id`, `name`, `image`, `created_at`, `updated_at`) VALUES (1, 'Slide 1', 'image\\slide\\0.45404800 1596169612-slide1.jfif', '2020-07-31 03:50:42', '2020-07-31 04:26:52'), (2, 'Slide 2', 'image\\slide\\0.74403500 1596167461-slide2.jfif', '2020-07-31 03:51:01', '2020-07-31 03:51:01'), (3, 'Slide 3', 'image\\slide\\0.14169100 1596167476-slide3.jfif', '2020-07-31 03:51:16', '2020-07-31 03:51:16'), (4, 'Slide 4', 'image\\slide\\0.42532500 1596167483-slide4.jfif', '2020-07-31 03:51:23', '2020-07-31 03:51:23'); -- -------------------------------------------------------- -- -- Table structure for table `stores` -- CREATE TABLE `stores` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` int(11) NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `product_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `stores` -- INSERT INTO `stores` (`id`, `name`, `phone`, `email`, `address`, `description`, `image`, `product_id`, `created_at`, `updated_at`) VALUES (1, 'Cửa hàng Thủy Vũ', 334565615, 'thuyvu.store@gmail.com', '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 'Khách hàng là thượng đế', 'image\\store\\0.22466300 1596185060-store1.jpg', 1, '2020-07-31 08:44:20', '2020-07-31 08:44:20'), (2, 'Cửa hàng LIBÉ', 334565651, 'libe.store@gmail.com', '99 Tô Hiến Thành, Sơn Trà, Đà Nẵng', 'Luôn luôn lắng nghe. Luôn luôn thấy hiểu', 'image\\store\\0.42348700 1596185707-store2.jpg', 4, '2020-07-31 08:49:12', '2020-07-31 08:55:07'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` int(11) NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `status` tinyint(1) NOT NULL DEFAULT 1, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `address`, `phone`, `password`, `status`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Hồ Văn Huy', 'ranghivanhuy@gmail.com', '101B Lê Hữu Trác, Sơn Trà, Đà Nẵng', 334133327, '$2y$10$3ZqQKMMbNy/S.iU2oIXlxOsF9mU6SBt3xIoVvR7T3rZbtxWWKNIP.', 1, NULL, '2020-07-20 02:29:16', '2020-08-28 07:48:54'), (2, 'Nguyễn Văn A', 'admin@gmail.com', '99 Tô Hiến Thành', 389651504, '$2y$10$tuwRnRjMNLMIv1MXU0ZqBOBQWfS3WNb.o5dqRswtHelTK2yG.tK/q', 1, NULL, '2020-08-28 03:22:17', '2020-08-28 03:22:17'), (3, 'Chinh La Toi', 'chinhlatoi@gmail.com', '99 Tô Hiến Thành', 389541504, '$2y$10$sxieFmCA5P5ZpNrskxKDDec1hJYMalQVW8i3kldkoW6Mvw/.PvJFa', 0, NULL, '2020-08-28 07:53:11', '2020-08-28 08:01:16'); -- -- Indexes for dumped tables -- -- -- Indexes for table `cart_items` -- ALTER TABLE `cart_items` ADD PRIMARY KEY (`id`), ADD KEY `cart_items_user_id_index` (`user_id`), ADD KEY `cart_items_product_id_index` (`product_id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `contacts` -- ALTER TABLE `contacts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `oauth_access_tokens` -- ALTER TABLE `oauth_access_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_access_tokens_user_id_index` (`user_id`); -- -- Indexes for table `oauth_auth_codes` -- ALTER TABLE `oauth_auth_codes` ADD PRIMARY KEY (`id`), ADD KEY `oauth_auth_codes_user_id_index` (`user_id`); -- -- Indexes for table `oauth_clients` -- ALTER TABLE `oauth_clients` ADD PRIMARY KEY (`id`), ADD KEY `oauth_clients_user_id_index` (`user_id`); -- -- Indexes for table `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` ADD PRIMARY KEY (`id`); -- -- Indexes for table `oauth_refresh_tokens` -- ALTER TABLE `oauth_refresh_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`), ADD KEY `orders_user_id_foreign` (`user_id`); -- -- Indexes for table `order_details` -- ALTER TABLE `order_details` ADD PRIMARY KEY (`id`), ADD KEY `order_details_order_id_foreign` (`order_id`), ADD KEY `order_details_product_id_foreign` (`product_id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permissions_name_unique` (`name`); -- -- Indexes for table `permission_roles` -- ALTER TABLE `permission_roles` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `permission_roles_role_id_foreign` (`role_id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`id`), ADD KEY `products_categories_id_index` (`categories_id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `roles_name_unique` (`name`); -- -- Indexes for table `role_users` -- ALTER TABLE `role_users` ADD PRIMARY KEY (`user_id`,`role_id`), ADD KEY `role_users_role_id_foreign` (`role_id`); -- -- Indexes for table `slides` -- ALTER TABLE `slides` ADD PRIMARY KEY (`id`); -- -- Indexes for table `stores` -- ALTER TABLE `stores` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `stores_email_unique` (`email`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `cart_items` -- ALTER TABLE `cart_items` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `contacts` -- ALTER TABLE `contacts` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33; -- -- AUTO_INCREMENT for table `oauth_clients` -- ALTER TABLE `oauth_clients` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=146; -- -- AUTO_INCREMENT for table `order_details` -- ALTER TABLE `order_details` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=107; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38; -- -- AUTO_INCREMENT for table `slides` -- ALTER TABLE `slides` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `stores` -- ALTER TABLE `stores` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `orders` -- ALTER TABLE `orders` ADD CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `order_details` -- ALTER TABLE `order_details` ADD CONSTRAINT `order_details_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `order_details_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `permission_roles` -- ALTER TABLE `permission_roles` ADD CONSTRAINT `permission_roles_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `permission_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `products` -- ALTER TABLE `products` ADD CONSTRAINT `products_categories_id_foreign` FOREIGN KEY (`categories_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `role_users` -- ALTER TABLE `role_users` ADD CONSTRAINT `role_users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true