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
cfa93616dc2df7148f0026a8f39b9974459d803d
SQL
Shirl16/Shirley_DA_Homework
/09_SQL/09_SQL_Shirley_Quintana_4.sql
UTF-8
943
4.09375
4
[]
no_license
-- 4a. list last names of actors as well as how many actors have that last name use sakila; select last_name, count(last_name) from sakila.actor group by last_name; -- 4b. list last names of actors and number of actors who have that last name, but only -- for names that are shared by at least 2 actors select last_name, count(last_name) from sakila.actor group by last_name having count(last_name) >=2; -- 4c. the actor 'harpo williams' was accidentally entered in 'actor' as 'groucho williams' - write query to fix select * from sakila.actor where first_name= 'groucho' and last_name = 'williams'; -- actor id is 172 fro groucho williams update actor set first_name = 'HARPO' where actor_id = 172; select * from actor; -- 4d. in a single query, if the first name of the actor is 'harpo' change it to 'groucho' select first_name from sakila.actor; update actor set first_name = 'GROUCHO' where actor_id = 172; select * from actor where actor_id = 172;
true
8d989fc8d519c8abcb0d3207b3665a60e902abb0
SQL
naztar0/UcodeWebSprint
/sprint08/t03/join.sql
UTF-8
540
2.96875
3
[]
no_license
USE ucode_web; SELECT `heroes`.`name`, `teams`.`name` FROM `heroes` LEFT JOIN `teams` ON `heroes`.`id`=`teams`.`hero_id`; SELECT `heroes`.`name`, `powers`.`name` FROM `heroes` LEFT JOIN `powers` ON `heroes`.`id`=`powers`.`hero_id` UNION ALL SELECT `heroes`.`name`, `powers`.`name` FROM `heroes` RIGHT JOIN `powers` ON `heroes`.`id`=`powers`.`hero_id`; SELECT `heroes`.`name`, `powers`.`name`, `teams`.`name` FROM `heroes` INNER JOIN `powers` ON `heroes`.`id`=`powers`.`hero_id` INNER JOIN `teams` ON `heroes`.`id`=`teams`.`hero_id`;
true
4d9c550517dd8af7d448b6f34bed1c15bc1b2f84
SQL
Gaston-Paz/Lab3
/EJERICIO 2.1/consultas.sql
UTF-8
5,124
3.953125
4
[]
no_license
Use Blueprint -- 1) Listado de todos los clientes. SELECT * FROM Clientes -- 2) Listado de todos los proyectos. SELECT * FROM Proyectos -- 3) Listado con nombre, descripción, costo, fecha de inicio y de fin de todos los proyectos SELECT Nombre, Descripcion, Costo, FechaInicio, FechaFin FROM Proyectos -- 4) Listado con nombre, descripción, costo y fecha de inicio de todos los proyectos con costo mayor a cien mil pesos. SELECT Nombre, Descripcion, Costo, FechaInicio FROM Proyectos WHERE Costo > 100000 -- 5) Listado con nombre, descripción, costo y fecha de inicio de todos los proyectos con costo menor a cincuenta mil pesos . SELECT Nombre, Descripcion, Costo, FechaInicio FROM Proyectos WHERE Costo < 50000 -- 6) Listado con todos los datos de todos los proyectos que comiencen en el año 2020. SELECT * FROM Proyectos WHERE YEAR(FechaInicio) = 2020 -- 7) Listado con nombre, descripción y costo de los proyectos que comiencen en el año 2020 y cuesten más de cien mil pesos. SELECT Nombre, Descripcion, Costo FROM Proyectos WHERE YEAR(FechaInicio) = 2020 AND Costo > 100000 -- 8) Listado con nombre del proyecto, costo y año de inicio del proyecto. SELECT Nombre, Costo, YEAR(FechaInicio) FROM Proyectos -- 9) Listado con nombre del proyecto, costo, fecha de inicio, fecha de fin y días de duración de los proyectos. SELECT Nombre, Costo, FechaInicio AS 'Fecha de inicio', FechaFin AS 'Fecha de fin', isnull(DATEDIFF(DAY, FechaInicio, FechaFin), '0') AS 'Días de duración' FROM Proyectos -- 10) Listado con razón social, cuit y teléfono de todos los clientes cuyo IDTipo sea 1, 3, 5 o 6. SELECT RazonSocial, Cuit, TelefonoFijo, TelefonoMovil FROM Clientes WHERE IDTipoCliente = 1 OR IDTipoCliente = 3 OR IDTipoCliente = 5 OR IDTipoCliente = 6 -- 11) Listado con nombre del proyecto, costo, fecha de inicio y fin de todos los proyectos que no pertenezcan a los clientes 1, 5 ni 10. SELECT Nombre, Costo, FechaInicio, FechaFin FROM Proyectos WHERE IDCliente NOT IN (1,5,10) -- 12) Listado con nombre del proyecto, costo y descripción de aquellos proyectos que hayan comenzado entre el 1/1/2018 y el 24/6/2018. SELECT nombre, costo, Descripcion FROM Proyectos WHERE FechaInicio BETWEEN '1/1/2018' AND '24/6/2018' -- 13) Listado con nombre del proyecto, costo y descripción de aquellos proyectos que hayan finalizado entre el 1/1/2019 y el 12/12/2019. SELECT nombre, costo, Descripcion FROM Proyectos WHERE FechaFin BETWEEN '1/1/2019' AND '12/12/2019' -- 14) Listado con nombre de proyecto y descripción de aquellos proyectos que aún no hayan finalizado. SELECT nombre, Descripcion FROM Proyectos WHERE FechaFin IS NULL -- 15) Listado con nombre de proyecto y descripción de aquellos proyectos que aún no hayan comenzado. SELECT nombre, Descripcion FROM Proyectos WHERE FechaInicio IS NULL -- 16) Listado de clientes cuya razón social comience con letra vocal. SELECT * FROM Clientes WHERE RazonSocial LIKE '[A,E,I,O,U]%' -- 17) Listado de clientes cuya razón social finalice con vocal. SELECT * FROM Clientes WHERE RazonSocial LIKE '%[A,E,I,O,U]' -- 18) Listado de clientes cuya razón social finalice con la palabra 'Inc' SELECT * FROM Clientes WHERE RazonSocial LIKE '%Inc' -- 19) Listado de clientes cuya razón social no finalice con vocal. SELECT * FROM Clientes WHERE RazonSocial NOT LIKE '%[A,E,I,O,U]' -- 20) Listado de clientes cuya razón social no contenga espacios. SELECT * FROM Clientes WHERE RazonSocial NOT LIKE '% %' -- 21) Listado de clientes cuya razón social contenga más de un espacio. SELECT * FROM Clientes WHERE RazonSocial LIKE '% % %' -- 22) Listado de razón social, cuit, email y celular de aquellos clientes que tengan mail pero no teléfono. SELECT RazonSocial, Cuit, Email, TelefonoMovil FROM Clientes WHERE Email IS NOT NULL AND TelefonoFijo IS NULL -- 23) Listado de razón social, cuit, email y celular de aquellos clientes que no tengan mail pero sí teléfono. SELECT RazonSocial, Cuit, Email, TelefonoMovil FROM Clientes WHERE Email IS NULL AND TelefonoFijo IS NOT NULL -- 24) Listado de razón social, cuit, email, teléfono o celular de aquellos clientes que tengan mail o teléfono o celular . SELECT RazonSocial, Cuit, email, TelefonoFijo, TelefonoMovil FROM Clientes WHERE Email IS NOT NULL OR TelefonoFijo IS NOT NULL OR TelefonoMovil IS NOT NULL -- 25) Listado de razón social, cuit y mail. Si no dispone de mail debe aparecer el texto "Sin mail". SELECT RazonSocial, Cuit, CASE WHEN Email IS NULL THEN 'Sin mail' ELSE Email END AS Email FROM Clientes -- 26) Listado de razón social, cuit y una columna llamada Contacto con el mail, si no posee mail, con el número de celular y si no posee número de celular con un texto que diga "Incontactable". SELECT RazonSocial, cuit, CASE WHEN Email IS NOT NULL THEN Email WHEN Email IS NULL AND TelefonoMovil IS NOT NULL THEN TelefonoMovil WHEN Email IS NULL AND TelefonoMovil IS NULL AND TelefonoFijo IS NOT NULL THEN TelefonoFijo WHEN Email IS NULL AND TelefonoMovil IS NULL AND TelefonoFijo IS NULL THEN 'Incontactable' END AS 'Contacto' FROM Clientes
true
cef9731aca9f98b48242d6ccd1e89be4b57fd595
SQL
alexurumov/MySql
/ExamRetake/9.sql
UTF-8
202
3.8125
4
[]
no_license
SELECT CONCAT(LEFT(c.comment, 20), "...") AS 'summary' FROM comments c WHERE id NOT IN ( SELECT c.id FROM comments c JOIN likes l ON c.id = l.comment_id ) ORDER BY c.id DESC;
true
ff3068352931c7f419034516ac682fa82dbcbe04
SQL
Rage-cmd/Hospital-DBMS
/functions.sql
UTF-8
1,964
4.28125
4
[]
no_license
-- Create an appointment by the consultant DELIMITER # CREATE OR REPLACE FUNCTION create_appointment (doctor int, patient_id int, start_datetime datetime) RETURNS int BEGIN DECLARE created int; IF (SELECT start_time FROM Appointment WHERE `date` = DATE(start_datetime) AND doctor_id = doctor AND start_time BETWEEN (SELECT subtime(TIME(start_datetime),'00:29:59')) AND (SELECT subtime(TIME(start_datetime),'-00:29:59'))) THEN SET created = 0; ELSE INSERT INTO Appointment VALUES (doctor, patient_id, DATE(start_datetime), TIME(start_datetime)); SET created = 1; END IF; RETURN created; END# DELIMITER ; -- Check if the patient exists DELIMITER # CREATE OR REPLACE PROCEDURE patient_exists(IN pat_id int, IN contact_number varchar(15), OUT exist int) BEGIN IF contact_number IS NOT NULL THEN SELECT IF(COUNT(*) >0,1,0) INTO exist FROM `Patient` WHERE contact_no = contact_number; ELSE SELECT IF(COUNT(*) >0,1,0) INTO exist FROM `Patient` WHERE patient_id = pat_id; END IF; END# DELIMITER ; -- Adding a new registration DELIMITER # CREATE OR REPLACE PROCEDURE new_registration(IN pat_id int,IN f_name varchar(30), IN l_name varchar(30), IN contact_number varchar(15), IN addr varchar(100)) BEGIN DECLARE t int; CALL patient_exists(pat_id,contact_number,t); IF t > 0 THEN SELECT "Already Registered"; ELSE INSERT INTO `Patient` VALUES (pat_id, f_name, l_name, contact_number, addr); END IF; END# DELIMITER ; -- Patient Log entry check DELIMITER # CREATE OR REPLACE PROCEDURE checkin_out(IN pat_id int, IN val DATETIME, IN chkin int) BEGIN IF chkin = 1 THEN INSERT INTO `Patient_Log` VALUES (pat_id, val, NULL); ELSE UPDATE `Patient_Log` SET checkout = val WHERE patient_id = pat_id AND checkout IS NULL ; END IF; END# DELIMITER ; -- Create Diagnosis Report Function -- Create Treatment
true
34dfe34aec445e5630f6a318953c8bfd759fb980
SQL
goodsong/ApiManager
/db.sql
UTF-8
2,792
3.46875
3
[]
no_license
SET NAMES utf8; SET foreign_key_checks = 0; SET time_zone = 'SYSTEM'; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; DROP TABLE IF EXISTS `api`; CREATE TABLE `api` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '接口编号', `aid` int(11) DEFAULT '0' COMMENT '接口分类id', `num` varchar(100) DEFAULT NULL COMMENT '接口编号', `url` varchar(240) DEFAULT NULL COMMENT '请求地址', `name` varchar(100) DEFAULT NULL COMMENT '接口名', `des` varchar(300) DEFAULT NULL COMMENT '接口描述', `parameter` text COMMENT '请求参数{所有的主求参数,以json格式在此存放}', `return_des` text COMMENT '返回值说明', `return_example` text COMMENT '返回值样例', `lasttime` int(11) unsigned DEFAULT NULL COMMENT '提后操作时间', `lastuid` int(11) unsigned DEFAULT NULL COMMENT '最后修改uid', `status` int(11) unsigned NOT NULL DEFAULT '1', `isdel` tinyint(4) unsigned DEFAULT '0' COMMENT '{0:正常,1:删除}', `type` char(11) DEFAULT NULL COMMENT '请求方式', `ord` int(11) DEFAULT '0' COMMENT '排序(值越大,越靠前)', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='接口明细表'; DROP TABLE IF EXISTS `auth`; CREATE TABLE `auth` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `uid` int(11) DEFAULT NULL COMMENT '用户', `aid` int(11) DEFAULT NULL COMMENT '接口分类权限', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='权限表 - 若用户为普通管理员时,读此表获取权限'; DROP TABLE IF EXISTS `cate`; CREATE TABLE `cate` ( `aid` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类id', `cname` varchar(200) NOT NULL DEFAULT '' COMMENT '分类名称', `cdesc` varchar(200) NOT NULL DEFAULT '' COMMENT '分类描述', `isdel` int(11) DEFAULT '0' COMMENT '是否删除{0:正常,1删除}', `addtime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', PRIMARY KEY (`aid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='接口分类表'; DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `nice_name` char(20) DEFAULT NULL COMMENT '昵称', `login_name` char(20) DEFAULT NULL COMMENT '登录名', `last_time` int(11) DEFAULT '0' COMMENT '最近登录时间', `login_pwd` varchar(32) DEFAULT NULL COMMENT '登录密码', `isdel` int(11) DEFAULT '0' COMMENT '{0正常,1:删除}', `issuper` int(11) DEFAULT '0' COMMENT '{0:普通管理员,1超级管理员}', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户表'; INSERT INTO `user` (`id`, `nice_name`, `login_name`, `last_time`, `login_pwd`, `isdel`, `issuper`) VALUES (1, 'admin', 'admin', 1445573696, '654321', 0, 1), (2, 'root', 'root', 1435575693, '123456', 0, 1); -- 2015-10-24 11:39:28
true
6ac0eea25a96ec109b0e6aa66186fe41dc2e59eb
SQL
christianselig/apollo-backend
/migrations/000001_create_accounts.up.sql
UTF-8
694
2.734375
3
[]
no_license
-- Table Definition ---------------------------------------------- CREATE TABLE accounts ( id SERIAL PRIMARY KEY, reddit_account_id character varying(32) DEFAULT ''::character varying, username character varying(20) DEFAULT ''::character varying UNIQUE, access_token character varying(64) DEFAULT ''::character varying, refresh_token character varying(64) DEFAULT ''::character varying, token_expires_at timestamp without time zone, last_message_id character varying(32) DEFAULT ''::character varying, next_notification_check_at timestamp without time zone, next_stuck_notification_check_at timestamp without time zone, check_count integer DEFAULT 0 );
true
7b895c9379e5408abcd6d69e9f0c8c7df95e26af
SQL
zhixingheyi666/isbnSpider
/fc/s0216.sql
UTF-8
361
3.03125
3
[]
no_license
use spider; create table if not exists originurl ( url_id int not null auto_increment, url char(255) not null, stars int default 0, primary key ( url_id ) ) engine = myisam; insert into originurl( url ) values( 'test http' ); delete from originurl where url_id != 1; select count(url) , count( distinct url) from originurl; select * from originurl;
true
9e8c5ea58a2f01ac9f30a63ec3eed609ef662d2a
SQL
autumnalkitty/web_work
/Step17_MyBatis_My/WebContent/WEB-INF/table.sql
UTF-8
876
3.859375
4
[]
no_license
CREATE TABLE board_cafe( num NUMBER PRIMARY KEY, writer VARCHAR2(100) NOT NULL, title VARCHAR2(100) NOT NULL, content CLOB, viewCount NUMBER, regdate DATE ); CREATE SEQUENCE board_cafe_seq; SELECT result1.* FROM (SELECT num, writer, title LAG(num, 1, 0) OVER(ORDER BY num DESC) prevNum, LEAD(num, 1, 0) OVER(ORDER BY num DESC) nextNum FROM board_cafe ORDER BY num DESC) result1 WHERE num=5; CREATE TABLE board_cafe_comment( num NUMBER PRIMARY KEY, -- 댓글의 글번호 writer VARCHAR2(100), -- 댓글 작성자 content VARCHAR2(500), -- 댓글 내용 target_id VARCHAR2(100), -- 댓글의 대상이 되는 아이디(글작성자) ref_group NUMBER, -- 댓글 그룹번호 comment_group NUMBER, -- 원글에 달린 댓글 내에서의 그룹번호 deleted CHAR(1) NOT NULL, regdate DATE -- 댓글 등록일 );
true
851122b213b44235e32780264229126264045f87
SQL
amitpriyasingh/Boutiqaat
/boutiqaat-etl-master/firebase/queries/bigquery/firebase_impressions_trends.sql
UTF-8
356
2.9375
3
[]
no_license
SELECT PARSE_DATE('%Y%m%d',event_date) as event_date, store, store_id, country, platform, app_version, event_name, catalog_page_type, catalog_page_id, catalog_page_name, sku, count(1) as impressions FROM `boutiqaat-online-shopping.firebase.fact_impressions` WHERE DATE(_PARTITIONTIME) = PARSE_DATE('%Y%m%d','{{DATE}}') group by 1,2,3,4,5,6,7,8,9,10,11
true
65df05c061dfb84989c965c7eece7e2d6551cd56
SQL
J-Russell329/experimental_JS
/sql-ddl-design/soccer-schema.sql
UTF-8
2,651
3.75
4
[]
no_license
-- Exported from QuickDBD: https://www.quickdatabasediagrams.com/ -- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here. -- Modify this code to update the DB schema diagram. -- To reset the sample schema, replace everything with -- two dots ('..' - without quotes). CREATE TABLE "Teams" ( "ID" int SERIAL PRIMARY KEY, "Name" String NOT NULL, "Ranking" intger NOT NULL, "League" String NOT NULL, CONSTRAINT "pk_Teams" PRIMARY KEY ( "ID" ), CONSTRAINT "uc_Teams_Ranking" UNIQUE ( "Ranking" ) ); CREATE TABLE "Players" ( "ID" int SERIAL PRIMARY KEY, "First_name" STRING NULL, "Last_name" STRING NULL, "TEAM" INT NULL, CONSTRAINT "pk_Players" PRIMARY KEY ( "ID" ) ); CREATE TABLE "Referees" ( "ID" int SERIAL PRIMARY KEY, "First_name" STRING NULL, "Last_name" STRING NULL, CONSTRAINT "pk_Referees" PRIMARY KEY ( "ID" ) ); CREATE TABLE "Matches" ( "ID" int SERIAL PRIMARY KEY, "Home_team" INT NOT NULL, "Away_team" INT NOT NULL, "Referee_1" INT NOT NULL, "Referee_2" INT NOT NULL, "Referee_3" INT NOT NULL, CONSTRAINT "pk_Matches" PRIMARY KEY ( "ID" ) ); CREATE TABLE "Goals" ( "ID" int SERIAL PRIMARY KEY, "Match_ID" INT NULL, "Player_ID" INT NULL, CONSTRAINT "pk_Goals" PRIMARY KEY ( "ID" ) ); CREATE TABLE "Calander" ( "ID" int SERIAL PRIMARY KEY, "Year" INT NULL, "Start_date" DATE NULL, "End_date" DATE NULL, CONSTRAINT "pk_Calander" PRIMARY KEY ( "ID" ) ); ALTER TABLE "Players" ADD CONSTRAINT "fk_Players_TEAM" FOREIGN KEY("TEAM") REFERENCES "Teams" ("ID"); ALTER TABLE "Matches" ADD CONSTRAINT "fk_Matches_Home_team" FOREIGN KEY("Home_team") REFERENCES "Teams" ("ID"); ALTER TABLE "Matches" ADD CONSTRAINT "fk_Matches_Away_team" FOREIGN KEY("Away_team") REFERENCES "Teams" ("ID"); ALTER TABLE "Matches" ADD CONSTRAINT "fk_Matches_Referee_1" FOREIGN KEY("Referee_1") REFERENCES "Referees" ("ID"); ALTER TABLE "Matches" ADD CONSTRAINT "fk_Matches_Referee_2" FOREIGN KEY("Referee_2") REFERENCES "Referees" ("ID"); ALTER TABLE "Matches" ADD CONSTRAINT "fk_Matches_Referee_3" FOREIGN KEY("Referee_3") REFERENCES "Referees" ("ID"); ALTER TABLE "Goals" ADD CONSTRAINT "fk_Goals_Match_ID" FOREIGN KEY("Match_ID") REFERENCES "Matches" ("ID"); ALTER TABLE "Goals" ADD CONSTRAINT "fk_Goals_Player_ID" FOREIGN KEY("Player_ID") REFERENCES "Players" ("ID");
true
d757cc7116aa2721700962931f5e870d01578289
SQL
oagbeja/ecounsel
/db.sql
UTF-8
12,671
2.953125
3
[]
no_license
/* SQLyog - Free MySQL GUI v5.02 Host - 5.0.51b-community-nt : Database - ecounsel ********************************************************************* Server version : 5.0.51b-community-nt */ create database if not exists `ecounsel`; USE `ecounsel`; /*Table structure for table `conversation` */ DROP TABLE IF EXISTS `conversation`; CREATE TABLE `conversation` ( `cid` int(10) NOT NULL auto_increment, `ctext` varchar(1000) default NULL, `id` int(10) default NULL, `vdate` datetime default NULL, `status` char(1) default 'S' COMMENT 'S for student C for Counsellor', `coun` int(10) default '1' COMMENT 'counsellor identity default should be 1 since we are having one counsellor', `newmsg` char(1) default NULL COMMENT 'Y or N ', PRIMARY KEY (`cid`) ) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=latin1; /*Data for the table `conversation` */ insert into `conversation` values (1,'hhhhh',1,'0000-00-00 00:00:00','S',1,''), (2,'hhhhh',1,'0000-00-00 00:00:00','C',1,''), (3,'msmmfmfs',1,'0000-00-00 00:00:00','S',1,''), (4,',dldlsldld',1,'0000-00-00 00:00:00','S',1,''), (5,'dldldl',1,'0000-00-00 00:00:00','S',1,''), (6,'cccccc',1,'0000-00-00 00:00:00','S',1,''), (7,'cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc',1,'0000-00-00 00:00:00','C',1,''), (8,'cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc cccccc',1,'0000-00-00 00:00:00','S',1,''), (9,'hello',1,'2015-07-22 23:39:26','C',1,NULL), (10,'hi',1,'2015-07-23 00:13:46','C',1,NULL), (11,'nnnmn',1,'2015-07-23 00:14:07','C',1,NULL), (12,'nnnnnn',1,'2015-07-23 00:14:25','C',1,NULL), (13,'kkvkvzkvkcvkv ckkckzklczk',1,'2015-07-23 00:18:01','C',1,NULL), (14,',,c,c,c,c,c,c,c,',1,'2015-07-23 00:18:12','C',1,NULL), (15,',x,x,x,x,x',1,'2015-07-23 00:19:15','C',1,NULL), (16,'hoos',2,'2015-07-23 00:25:40','C',1,NULL), (17,'how are you',1,'2015-07-23 00:26:30','S',1,NULL), (18,'fn',1,'2015-07-23 00:26:49','C',1,NULL), (19,'are you sure',1,'2015-07-23 00:27:08','S',1,NULL), (20,'bros',1,'2015-07-23 00:30:50','S',1,NULL), (21,'how u dey',1,'2015-07-23 00:33:05','S',1,NULL), (22,'fn bro',1,'2015-07-23 00:33:25','C',1,NULL), (23,'hello',1,'2015-07-23 00:36:03','C',1,NULL), (24,'ho',1,'2015-07-23 00:36:51','S',1,NULL), (25,'how u dey',1,'2015-07-23 00:37:05','C',1,NULL), (26,'fn',1,'2015-07-23 00:37:36','S',1,NULL), (27,'hi',1,'2015-07-23 00:40:30','S',1,NULL), (28,'fn',1,'2015-07-23 00:40:40','C',1,NULL), (29,'thank u',1,'2015-07-23 00:40:55','S',1,NULL), (30,'hi',1,'2015-07-23 00:55:22','C',1,NULL), (31,'hi',1,'2015-07-23 00:55:42','C',1,NULL), (32,'nnnmn',1,'2015-07-23 00:56:10','C',1,NULL), (33,'I want to study computer science but don\'t have physic as requirement',4,'2015-07-23 12:46:45','S',1,NULL), (34,'You can go for Access Programme',4,'2015-07-23 12:47:29','S',1,NULL), (35,'What is Access programme?',4,'2015-07-23 12:49:55','S',1,NULL), (36,'Gudday sir',4,'2015-07-24 15:14:51','C',1,NULL), (37,'Gudday sir',4,'2015-07-24 15:18:56','S',1,NULL), (38,'Gudday sir',4,'2015-07-24 15:19:12','S',1,NULL), (39,'Guddday sir',4,'2015-07-24 15:19:47','S',1,NULL), (40,'Hw do u do?',4,'2015-07-24 15:21:37','S',1,NULL), (41,'ok and u?',4,'2015-07-24 15:21:53','C',1,NULL), (42,'hw may i help u?',4,'2015-07-24 15:24:21','S',1,NULL), (43,'i want to know abt noun',4,'2015-07-24 15:24:48','C',1,NULL), (44,'Gudday sir, hw is work?',4,'2015-07-24 15:30:12','S',1,NULL), (45,'fine and ur?',4,'2015-07-24 15:30:23','C',1,NULL), (46,'ok',4,'2015-07-24 15:30:31','S',1,NULL), (47,'hw may i help u?',4,'2015-07-24 15:30:45','C',1,NULL), (48,'sir, i am a prospective students, i want to be a student in noun to study computer science but i dnt hv physics as prt of d requirement',4,'2015-07-24 15:31:54','S',1,NULL), (49,'ok, u can still be admitted but hv to undergo a prg in noun call Access Proramme',4,'2015-07-24 15:32:43','C',1,NULL), (50,'sir, pls explain more to me',4,'2015-07-24 15:32:58','S',1,NULL), (51,'Access prg is a prg u run for a yr bcos u are deficient in a required subject',4,'2015-07-24 15:34:06','C',1,NULL); /*Table structure for table `criteria` */ DROP TABLE IF EXISTS `criteria`; CREATE TABLE `criteria` ( `critid` int(5) NOT NULL auto_increment, `critdesc` varchar(100) default NULL, `progid` int(5) default NULL, PRIMARY KEY (`critid`) ) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=latin1; /*Data for the table `criteria` */ insert into `criteria` values (1,'Comp1',1), (2,'comp2',1), (9,'2. B.Sc. Communication Tech',4), (10,'3. B. Sc. Computer Sc',4), (15,'Bsc. Maths/ Comp Sc',10), (25,'',4), (24,'comp3',1); /*Table structure for table `criteriasubject` */ DROP TABLE IF EXISTS `criteriasubject`; CREATE TABLE `criteriasubject` ( `critsubid` int(5) NOT NULL auto_increment, `critid` int(2) default NULL, `subjid` int(5) default NULL, `gradeid` int(2) default NULL, `mandate` char(1) default NULL, PRIMARY KEY (`critsubid`) ) ENGINE=MyISAM AUTO_INCREMENT=210 DEFAULT CHARSET=latin1; /*Data for the table `criteriasubject` */ insert into `criteriasubject` values (1,1,1,6,'C'), (2,1,2,6,'C'), (3,1,3,6,'E'), (4,1,4,6,'C'), (5,1,5,6,'C'), (6,1,6,6,'E'), (7,1,7,6,'E'), (8,1,9,6,'E'), (9,1,11,6,'E'), (10,2,1,6,'C'), (11,2,2,8,'C'), (12,2,3,6,'E'), (13,2,4,6,'C'), (14,2,5,6,'C'), (15,2,6,6,'E'), (16,2,7,6,'E'), (17,2,9,6,'E'), (18,2,11,6,'E'), (19,3,1,8,'C'), (20,3,2,6,'C'), (21,3,7,6,'E'), (22,3,8,6,'E'), (23,3,12,6,'C'), (24,3,14,6,'E'), (25,3,16,6,'E'), (26,3,17,6,'E'), (27,4,1,8,'C'), (28,4,16,5,'E'), (29,4,2,6,'C'), (30,4,7,6,'C'), (31,4,12,6,'C'), (32,4,17,6,'E'), (33,5,2,6,'C'), (34,5,1,6,'C'), (35,5,13,6,'E'), (36,5,6,6,'E'), (37,5,8,6,'E'), (38,6,2,6,'C'), (39,6,1,6,'C'), (40,6,13,6,'E'), (41,6,6,6,'E'), (42,6,8,6,'E'), (43,7,1,6,'C'), (44,7,3,9,'E'), (45,7,11,9,'E'), (46,7,6,9,'E'), (47,7,2,9,'E'), (48,7,4,9,'E'), (49,7,5,9,'E'), (50,7,9,9,'E'), (51,7,7,9,'E'), (52,8,2,6,'C'), (53,8,1,6,'C'), (54,8,3,6,'E'), (55,8,11,6,'E'), (56,8,4,6,'E'), (57,8,5,7,'C'), (58,8,7,6,'E'), (59,8,6,6,'E'), (60,8,9,4,'E'), (61,9,2,6,'C'), (62,9,1,6,'C'), (63,9,3,6,'E'), (64,9,11,6,'E'), (65,9,4,6,'E'), (66,9,5,6,'C'), (67,9,7,6,'E'), (68,9,6,6,'E'), (69,9,8,6,'E'), (70,10,2,6,'C'), (71,10,1,6,'C'), (72,10,3,6,'E'), (73,10,11,6,'E'), (74,10,4,6,'E'), (75,10,5,6,'C'), (76,10,7,6,'E'), (77,10,6,6,'E'), (78,10,8,6,'E'), (79,11,12,6,'C'), (80,11,6,6,'E'), (81,11,2,6,'C'), (82,11,13,6,'E'), (83,11,1,8,'C'), (84,11,8,6,'E'), (85,11,16,6,'E'), (86,11,3,6,'E'), (87,11,7,6,'E'), (88,12,12,6,'C'), (89,12,6,6,'E'), (90,12,2,6,'C'), (91,12,13,6,'E'), (92,12,1,6,'E'), (93,12,8,6,'E'), (94,12,16,6,'E'), (95,12,3,6,'E'), (96,12,7,6,'E'), (97,13,2,6,'C'), (98,13,1,6,'C'), (99,13,5,6,'E'), (100,13,7,6,'E'), (101,13,11,6,'E'), (102,13,4,6,'E'), (103,13,3,6,'E'), (104,13,6,6,'E'), (105,13,9,6,'E'), (106,14,2,6,'C'), (107,14,1,6,'C'), (108,14,5,6,'E'), (109,14,7,6,'E'), (110,14,11,6,'E'), (111,14,4,6,'C'), (112,14,3,6,'C'), (113,14,6,6,'E'), (114,14,9,6,'E'), (115,15,2,6,'C'), (116,15,1,6,'C'), (117,15,5,6,'C'), (118,15,7,6,'E'), (119,15,11,6,'E'), (120,15,4,6,'C'), (121,15,3,6,'C'), (122,15,6,6,'E'), (123,15,8,6,'E'), (124,16,2,6,'C'), (125,16,1,6,'C'), (126,16,5,6,'C'), (127,16,7,6,'E'), (128,16,11,6,'E'), (129,16,4,6,'E'), (130,16,3,6,'E'), (131,16,6,6,'E'), (132,16,9,6,'E'), (133,17,2,6,'C'), (134,17,12,6,'C'), (135,17,17,6,'E'), (136,17,16,6,'E'), (137,17,8,6,'E'), (138,17,14,6,'E'), (139,17,3,6,'E'), (140,17,6,6,'E'), (141,17,13,6,'E'), (142,18,2,6,'C'), (143,18,12,6,'C'), (144,18,1,8,'C'), (145,18,16,6,'E'), (146,18,8,6,'E'), (147,18,14,6,'E'), (148,18,3,6,'E'), (149,18,6,6,'E'), (150,18,13,6,'E'), (151,19,2,6,'C'), (152,19,12,6,'E'), (153,19,1,8,'C'), (154,19,16,6,'E'), (155,19,8,6,'C'), (156,19,14,6,'E'), (157,19,3,6,'E'), (158,19,6,6,'E'), (159,19,13,6,'E'), (160,20,2,6,'C'), (161,20,12,6,'E'), (162,20,1,8,'C'), (163,20,16,6,'E'), (164,20,8,6,'E'), (165,20,14,6,'E'), (166,20,3,6,'E'), (167,20,6,6,'E'), (168,20,13,6,'E'), (169,21,2,6,'C'), (170,21,12,6,'E'), (171,21,1,8,'C'), (172,21,16,6,'E'), (173,21,8,6,'E'), (174,21,14,6,'E'), (175,21,3,6,'E'), (176,21,6,6,'E'), (177,21,13,6,'E'), (178,22,2,6,'C'), (179,22,12,6,'E'), (180,22,1,8,'C'), (181,22,16,6,'E'), (182,22,8,6,'E'), (183,22,14,6,'E'), (184,22,3,6,'E'), (185,22,6,6,'E'), (186,22,13,6,'E'), (187,23,2,6,'C'), (188,23,12,6,'E'), (189,23,1,8,'C'), (190,23,17,6,'C'), (191,23,8,6,'E'), (192,23,14,6,'E'), (193,23,3,6,'E'), (194,23,6,6,'E'), (195,23,13,6,'E'), (196,24,1,6,'C'), (197,24,5,6,'C'), (198,24,2,6,'C'), (199,24,22,6,'E'), (200,24,18,6,'E'), (201,24,20,6,'E'), (202,24,23,6,'E'), (203,25,1,6,'C'), (204,25,5,6,'C'), (205,25,2,6,'C'), (206,25,22,6,'E'), (207,25,18,6,'E'), (208,25,20,6,'E'), (209,25,23,6,'E'); /*Table structure for table `grade` */ DROP TABLE IF EXISTS `grade`; CREATE TABLE `grade` ( `gradeid` int(1) NOT NULL auto_increment, `gradedesc` varchar(3) default NULL, PRIMARY KEY (`gradeid`) ) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; /*Data for the table `grade` */ insert into `grade` values (1,'A1'), (2,'B2'), (3,'B3'), (4,'C4'), (5,'C5'), (6,'C6'), (7,'D7'), (8,'E8'), (9,'F9'); /*Table structure for table `profile` */ DROP TABLE IF EXISTS `profile`; CREATE TABLE `profile` ( `id` bigint(10) NOT NULL auto_increment, `username` varchar(100) default NULL, `pwd` varchar(100) default NULL, `chatting_now` char(1) default 'N' COMMENT 'Y or N', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; /*Data for the table `profile` */ insert into `profile` values (1,'agbe','123456','N'), (2,'janer','love','N'), (3,'jane1','123456','N'), (4,'ada','jesus','N'); /*Table structure for table `programme` */ DROP TABLE IF EXISTS `programme`; CREATE TABLE `programme` ( `progid` int(5) NOT NULL auto_increment, `progdesc` varchar(100) default NULL, `maxsitting` int(5) default NULL, `minsubjects` int(5) default NULL, PRIMARY KEY (`progid`) ) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=latin1; /*Data for the table `programme` */ insert into `programme` values (1,'B.Sc. Computer Science ',2,5), (2,'Law',2,5), (3,'B.Sc. Agric Ext & Mgt ',2,5), (4,'B.Sc. Communication Technology ',2,5), (5,'B.Sc. Env. Sciences and Res. Management',2,5), (6,'B.Sc. Community Health ',2,5), (7,'B.Sc. Chemistry',2,5), (8,'B.Sc. Biology',2,5), (9,'B.Sc. Mathematics',2,5), (10,'B.Sc. Mathematics/Computer Science',2,5), (11,'B.sc. PHYSICS Programme',2,5), (12,'B.A. English ',2,5), (13,'BSc. Mass Communication ',2,5), (14,'BSc. Political Science ',2,5), (15,'BSc. Criminology and Security Studies',2,5), (16,'BSc. Peace Studies and Conflict ',2,5), (17,'BA. Christian Theology ',2,5), (18,'BA. Islamic Studies ',2,5), (19,'Accounting',2,5), (20,'Banking and Finance ',2,5), (21,'Business Administration',2,5), (22,'Cooperatives Management ',2,5), (23,'Entrepreneurship Development ',2,5), (24,'Hospitality Management ',2,5), (25,'Marketing',2,5), (26,'Public Administration',2,5); /*Table structure for table `subject` */ DROP TABLE IF EXISTS `subject`; CREATE TABLE `subject` ( `subjid` int(4) NOT NULL auto_increment, `subjdesc` varchar(100) default NULL, PRIMARY KEY (`subjid`) ) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=latin1; /*Data for the table `subject` */ insert into `subject` values (1,'Mathematics'), (2,'English'), (3,'Biology'), (4,'Chemistry'), (5,'Physics'), (6,'Economics'), (7,'Geography'), (8,'Government'), (9,'Furthermaths'), (10,'Food and Nutrition'), (11,'Agric Science'), (12,'Literature in English'), (13,'Commerce'), (14,'History'), (15,'Accounting'), (16,'C.R.K'), (17,'I.R.K'), (18,'Building Eng. Drawing '), (19,'Basic Electricity '), (20,'Information & Communication Technology '), (21,'Electrical Science '), (22,'Arithmetic'), (23,'Social Science');
true
9d6855e3e38236c23d00645ac89b8f345d9a3f75
SQL
AndrewPonyk/StudyDB
/MySQL/MySQL_Usage_and_Administration/chap5_UsingTransactions/transactions1.sql
UTF-8
841
3.25
3
[]
no_license
drop table test.usingtransactions; create table test.usingtransactions (id int primary key, name varchar(20)); truncate table test.usingtransactions; -- for testing transactions open two instances of MySQL workbench =) start transaction; insert into test.usingtransactions values (1, '1'); insert into test.usingtransactions values (2, '1'); commit ; rollback; select * from test.usingtransactions; -- Nested transcations are not supported, BUT Savepoints support is available : drop table test.usingtransactions; create table test.usingtransactions (id int primary key, name varchar(20)); truncate table test.usingtransactions; start transaction; insert into test.usingtransactions values (100, '100'); savepoint p1; insert into test.usingtransactions values (200, '100'); rollback to p1; -- or -- release savepoint p1; commit;
true
33e49923a2f55e129f63e61eb2317b89aecc61e3
SQL
jeganad/pastehub
/restricted/database_scripts/generate_db.sql
UTF-8
1,396
3.359375
3
[]
no_license
-- Adminer 4.6.2 MySQL dump SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; CREATE DATABASE `tip_db` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; USE `tip_db`; CREATE TABLE `DB_FILES` ( `id` varchar(10) COLLATE utf8_bin NOT NULL, `location` varchar(1024) COLLATE utf8_bin NOT NULL, `created_on` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, `expire_on` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `DB_RELATIONS` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_email` varchar(50) COLLATE utf8_bin NOT NULL, `file_id` varchar(10) COLLATE utf8_bin NOT NULL, `code` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `user_email` (`user_email`), KEY `file_id` (`file_id`), CONSTRAINT `DB_RELATIONS_ibfk_1` FOREIGN KEY (`user_email`) REFERENCES `DB_USERS` (`email`), CONSTRAINT `DB_RELATIONS_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `DB_FILES` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE `DB_USERS` ( `email` varchar(50) COLLATE utf8_bin NOT NULL, `name` varchar(50) COLLATE utf8_bin NOT NULL, `password` varchar(65) COLLATE utf8_bin NOT NULL, PRIMARY KEY (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- 2018-04-30 07:57:30
true
f3818a0e7a4fadae635212b4e25d4bbb26666790
SQL
dhanani94/crypto-coin-counter
/init.sql
UTF-8
661
3.140625
3
[]
no_license
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE SCHEMA crypto_counter; CREATE TABLE IF NOT EXISTS crypto_counter.cc_current_price ( id uuid PRIMARY KEY DEFAULT uuid_generate_v1(), currency varchar(25) NOT NULL, price numeric NOT NULL, created_at timestamp DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS crypto_counter.cc_wallet_balance ( id uuid PRIMARY KEY DEFAULT uuid_generate_v1(), balance money NOT NULL, created_at timestamp DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS crypto_counter.holdings ( symbol varchar(10) PRIMARY KEY, name varchar(25), holding numeric NOT NULL );
true
6067d54f2773c5ad5efd90d4c7794bcf9cb8863e
SQL
lanfengof/myShop
/my-shop-web-admin/src/main/resources/SQL/a.sql
UTF-8
2,458
4.6875
5
[]
no_license
-- 查询“001”课程比“002”课程成绩高的所有学生的学号; SELECT a.S_ID FROM ( SELECT s_id, c_id, score FROM STU_SCORE ) a INNER JOIN ( SELECT s_id, c_id, score FROM stu_score ) b ON a.s_id = b.s_id WHERE a.c_id = 1 AND b.c_id = 2 AND a.score > b.score; -- 查询平均成绩大于60分的同学的学号和平均成绩; select s_id,avg(score) from stu_score group by s_id having avg(score)>50; -- 查询所有同学的学号、姓名、选课数、总成绩; select a.s_id,a.s_name,count(c_id),sum(score)from student a left join stu_score b on a.s_id=b.s_id group by a.s_id,a.s_name; -- 查询姓“j”的老师的个数; select count(*) from course where T_name like 'j%'; -- 学过j老师课程的学生 select s_name from student where s_id in (select s_id from stu_score a join course on a.c_id in(select c_id from course where t_name='j老师' group by c_id) group by s_id); -- 查询没学过j老师课的同学的学号、姓名 select s_id,s_name from student where s_id not in (select s_id from stu_score a join course on a.c_id in(select c_id from course where t_name='j老师' group by c_id) group by s_id); -- 查询学过“c语言”并且也学过“java”课程的同学的学号、姓名 select a.s_id,a.s_name from student a left join stu_score b on a.s_id =b.s_id where b.c_id in(select c_id from course where c_name in ('c语言','java')) group by a.s_id; -- select a.S_ID,a.S_name from Student a, STU_SCORE b where a.S_ID=b.S_ID and b.C_ID= 1 and exists(Select * from STU_SCORE as c where c.S_ID=b.S_ID and c.C_ID= 2 ); -- 查询学过“叶平”老师所教的所有课的同学的学号、姓名; select S_ID,S_name from Student where S_ID in (select S_ID from STU_SCORE ,Course ,Teacher where STU_SCORE.C_ID=Course.C_ID and Teacher.T_NAME=Course.T_NAME and Teacher.Tname='叶平' group by S_ID having count(STU_SCORE.C_ID)=(select count(C_ID) from Course,Teacher where Teacher.T_NAME=Course.T_NAME and Tname='叶平')); -- 查询课程编号“002”的成绩比课程编号“001”课程低的所有同学的学号、姓名; select s_id,s_name from student where s_id in (select b.s_id from stu_score b inner join stu_score c on c.s_id=b.s_id where b.c_id=2 and c.c_id=1 and b.score<c.score) ; -- 查询'所有课程'成绩都小于60分的同学的学号、姓名; select s_id,s_name from student where s_id not in (select s_id from stu_score where score > 60 group by s_id);
true
d41f5290e9ef44bc523e66a8bc80593e047550a5
SQL
avaretto/trivia
/trivia.sql
UTF-8
1,690
2.65625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 25-03-2021 a las 01:12:33 -- Versión del servidor: 10.4.17-MariaDB -- Versión de PHP: 8.0.2 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 datos: `trivia` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rankinghistoria` -- CREATE TABLE `rankinghistoria` ( `nombre` varchar(15) NOT NULL, `puntos` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rankingmusica` -- CREATE TABLE `rankingmusica` ( `nombre` varchar(15) NOT NULL, `puntos` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rankingnaturaleza` -- CREATE TABLE `rankingnaturaleza` ( `nombre` varchar(15) NOT NULL, `puntos` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `rankingnaturaleza` -- INSERT INTO `rankingnaturaleza` (`nombre`, `puntos`) VALUES ('ariel', 5); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
9d74b7f5396729183b18e244dbf444a5040f676c
SQL
robertopostma/SQL
/test.sql
UTF-8
238
3.15625
3
[]
no_license
--non compliant example (missing PK) CREATE TABLE employee ( employee_id INTEGER NOT NULL, first_name VARCHAR(42) NOT NULL, last_name VARCHAR(42) NOT NULL ); --select from mthis table select * FROM myTable where nonExistingCol=1;
true
8954b1c53cce0f4b61bd073312d9cdb16ca6a7c9
SQL
dearcode2018/database
/oracle/src/test/java/com/hua/test/sql/ProcedureTest.sql
UTF-8
5,046
3.59375
4
[]
no_license
/** * @filename ProcedureTest.sql * @description Sql 存储过程- 测试 * @author qye.zheng * @version 1.0 */ /* ==================== ==================== */ dbms_output.put_line(''); /* 存储过程创建 - 例子 */ /* 无参 存储过程 */ CREATE OR REPLACE PROCEDURE testProcedure01 is begin null; end; /* 有参 存储过程 */ CREATE OR REPLACE PROCEDURE testProcedure02(name IN varchar, age IN number) is v1 varchar2(50) default 'a'; v2 number(3) default 0; begin null; end; /* IN 参数 */ CREATE OR REPLACE PROCEDURE testProcedureIn(v_name IN varchar) is v varchar2(64) default 'a'; a number(3) default 0; begin select a.name into v from custom a where a.name like '%' || v_name || '%'; end; /* OUT 参数 */ CREATE OR REPLACE PROCEDURE testProcedureOut(vID IN number, vName OUT varchar) is v varchar2(64) default 'a'; a number(3) default 0; begin select a.name into vName from custom a where a.oid = vID; dbms_output.put_line(vName); end; /* 调用 */ declare vID number default 1; vName varchar2(64); begin testProcedureOut(vID, vName); dbms_output.put_line('getValue: ' || vName); end; /* IN OUT 参数 */ CREATE OR REPLACE PROCEDURE testProcedureInOut(vID IN number, vName IN OUT varchar) is v varchar2(64) default 'a'; a number(3) default 0; begin select a.name into vName from custom a where a.oid = vID and a.name = vName; dbms_output.put_line(vName); end; /* 调用 */ declare vID number default 1; vName varchar2(128) default '徐明'; begin vName := '徐明'; testProcedureInOut(vID, vName); dbms_output.put_line('getValue: ' || vName); end; /* 调用其他过程 */ CREATE OR REPLACE PROCEDURE testCallOtherProcedure(vID IN number, vName IN OUT varchar) is v varchar2(64) default 'a'; a number(3) default 0; begin /* 调用其他过程 */ testProcedureInOut(vID, vName); dbms_output.put_line(vName); end; /* 调用 */ declare vID number default 1; vName varchar2(128) default '徐明'; begin vName := '徐明'; testCallOtherProcedure(vID, vName); dbms_output.put_line('getValue: ' || vName); end; /* ==================== 语句测试 ==================== */ /* if 语句测试 */ create or replace procedure testProcedureIf(vCount IN number) is msg varchar2(64) default ''; v number(3) default 0; begin if vCount > 1 then dbms_output.put_line('大于1'); elsif vCount = 1 then dbms_output.put_line('等于1'); else dbms_output.put_line('小于1'); end if; end; /* 调用 */ declare vCount number default 1; begin testProcedureIf(vCount); end; /* for 循环测试 */ create or replace procedure testProcedureFor01(vCount IN number) is msg varchar2(64) default ''; v number(3) default 0; begin for v in 1..5 loop dbms_output.put_line(v); end loop; end; /* 调用 */ declare vCount number default 1; begin testProcedureFor01(vCount); end; /* while 循环测试 */ create or replace procedure testProcedureWhile01(vCount IN number) is msg varchar2(64) default ''; v number(3) default 0; begin v := vCount; while v < 10 loop dbms_output.put_line(v); -- 自增 v := v + 1; end loop; end; /* 调用 */ declare vCount number default 5; begin testProcedureWhile01(vCount); end; /* for 循环 - 游标测试 */ create or replace procedure testProcedureCursor(vCount IN number) is msg varchar2(64) default ''; v number(3) default 0; /* 定义游标 */ cursor cursorVar is (select a.oid, a.name, a.balance, a.address, a.status from custom a); begin for cur in cursorVar loop dbms_output.put_line(cur.oid || ', ' || cur.name || ', ' || cur.address); end loop; end; /* 调用 */ declare vCount number default 5; begin testProcedureCursor(vCount); end; /* 循环 - 数组 测试 */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* */ /* ==================== ==================== */ /* ==================== ==================== */ /* */
true
6bba9065bea405d6f9f4545bdb386523633bff4a
SQL
xiaotian1991/actual-10-homework
/05/yangruiyou/reboot10.sql
UTF-8
810
3.375
3
[]
no_license
create database reboot10 default charset=utf8; use reboot10; drop table users; create table users( id int AUTO_INCREMENT primary key comment '用户id' ,name varchar(20) not null comment '用户名' ,name_cn varchar(50) not null comment '中文名' ,password varchar(50) not null comment '用户密码' ,email varchar(50) comment '电子邮件' ,mobile varchar(11) not null comment '手机号码' ,role varchar(10) not null comment '1:sa;2:php;3:ios;4:test' ,status tinyint ,create_time datetime comment '创建时间' ,last_time datetime comment '最后登录时间' ,unique key uni_username (name) ) engine=innodb default charset=utf8 comment '用户表'; #查询表创建 show create table users\G; import MySQL as mysql
true
8c75c71029ecec242f283fddab0d8651095ae3b7
SQL
china-university-mooc/mysql-basics-atguigu
/03-ddl/resources/demo/constraint.sql
UTF-8
4,429
4.21875
4
[]
no_license
SHOW DATABASES ; CREATE DATABASE IF NOT EXISTS students; USE students; DROP TABLE IF EXISTS stuinfo; CREATE TABLE stuinfo( id INT PRIMARY KEY, # 主键 name VARCHAR(20) NOT NULL, # 非空 gender CHAR(1) CHECK(gender = '男' OR gender = '女'), # 检查 seat INT UNIQUE, # 唯一 age INT DEFAULT 18, # 默认 majorId INT REFERENCES major(id) # 外键 ); DESC stuinfo; SHOW INDEX FROM stuinfo; CREATE TABLE major( id INT PRIMARY KEY , name VARCHAR(20) NOT NULL ); DROP TABLE IF EXISTS stuinfo; CREATE TABLE stuinfo ( id INT, name VARCHAR(20), gender CHAR(1), seat INT, age INT, majorId INT, CONSTRAINT pk PRIMARY KEY (id), # 主键 CONSTRAINT uk UNIQUE (seat), # 唯一键 CONSTRAINT ck CHECK ( gender = '男' OR gender = '女'), # 检查 CONSTRAINT fk_suinfo_major FOREIGN KEY (majorId) REFERENCES major (id) # 外键 ); DESC stuinfo; SHOW INDEX FROM stuinfo; CREATE TABLE stuinfo ( id INT, name VARCHAR(20), gender CHAR(1), seat INT, age INT, majorId INT, PRIMARY KEY (id), # 主键 UNIQUE (seat), # 唯一键 CHECK ( gender = '男' OR gender = '女'), # 检查 FOREIGN KEY (majorId) REFERENCES major (id) # 外键 ); CREATE TABLE stuinfo( id INT PRIMARY KEY, name VARCHAR(20) NOT NULL, gender CHAR(1), seat INT UNIQUE, age INT DEFAULT 18, majorId INT, CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id) ); INSERT INTO major VALUES (1, 'Java'); INSERT INTO major VALUES (2, 'H5'); INSERT INTO stuinfo VALUES (1, 'john', '男', null, 19, 1); INSERT INTO stuinfo VALUES (2, 'lily', '女', null, 19, 2); SELECT * FROM students.stuinfo; DROP TABLE IF EXISTS students.stuinfo; CREATE TABLE stuinfo( id INT PRIMARY KEY, name VARCHAR(20) NOT NULL, gender CHAR(1), seat INT UNIQUE, seat2 INT PRIMARY KEY, age INT DEFAULT 18, majorId INT, CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id) ); DESC students.stuinfo; DROP TABLE IF EXISTS students.stuinfo; CREATE TABLE stuinfo( id INT, name VARCHAR(20) NOT NULL, gender CHAR(1), seat INT, seat2 INT, age INT DEFAULT 18, majorId INT, PRIMARY KEY (id, name), UNIQUE (seat, seat2), CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id) ); DESC students.stuinfo; SHOW INDEX FROM students.stuinfo; DROP TABLE IF EXISTS students.major; CREATE TABLE major( id INT UNIQUE , name VARCHAR(20) NOT NULL ); DROP TABLE IF EXISTS students.stuinfo; CREATE TABLE stuinfo( id INT PRIMARY KEY, name VARCHAR(20) NOT NULL, gender CHAR(1), seat INT UNIQUE, age INT DEFAULT 18, majorId DOUBLE, CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id) ); DESC students.stuinfo; DROP TABLE IF EXISTS students.stuinfo; CREATE TABLE stuinfo( id INT PRIMARY KEY, name VARCHAR(20) NOT NULL UNIQUE DEFAULT 'Jhon', gender CHAR(1), seat INT UNIQUE, age INT DEFAULT 18, majorId INT, CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id) ); DESC students.stuinfo; # 修改表时添加约束 DROP TABLE IF EXISTS students.stuinfo; CREATE TABLE stuinfo( id INT, name VARCHAR(20), gender CHAR(1), seat INT, age INT, majorId INT ); DESC students.stuinfo; SHOW INDEX FROM students.stuinfo; ALTER TABLE stuinfo MODIFY COLUMN name VARCHAR(20) NOT NULL; ALTER TABLE stuinfo MODIFY COLUMN age INT DEFAULT 18; ALTER TABLE stuinfo MODIFY COLUMN id INT PRIMARY KEY; ALTER TABLE stuinfo MODIFY COLUMN seat INT UNIQUE; ALTER TABLE stuinfo MODIFY COLUMN name VARCHAR(20); ALTER TABLE stuinfo MODIFY COLUMN id INT; ALTER TABLE stuinfo MODIFY COLUMN seat INT; ALTER TABLE stuinfo ADD PRIMARY KEY(id); ALTER TABLE stuinfo ADD UNIQUE(seat); ALTER TABLE stuinfo ADD CONSTRAINT fk_stuinfo_major FOREIGN KEY(majorId) REFERENCES major(id); # 删除约束 ALTER TABLE stuinfo MODIFY COLUMN name VARCHAR(20); ALTER TABLE stuinfo MODIFY COLUMN age INT; ALTER TABLE students.stuinfo DROP PRIMARY KEY; ALTER TABLE students.stuinfo DROP INDEX seat; ALTER TABLE students.stuinfo DROP FOREIGN KEY fk_stuinfo_major;
true
2934a9556e6d1843a97b3cfbab698388f74b9a2c
SQL
fzwhdira/TStore.io
/Simulation of Transaction.sql
UTF-8
769
3.265625
3
[]
no_license
USE TStore --Ketika seorang customer dengan ID CU004 --Membeli Produk TStore dengan ID CL003 --Dilayani oleh staff dengan ID ST005 --Pada tanggal 1 Desember 2020 INSERT INTO SalesTransaction VALUES('SA016', 'ST005', 'CU004', '2020-12-1') INSERT INTO DetailSalesTransaction VALUES('SA016', 'CL003', 1) UPDATE Cloth SET Stock -= 1 WHERE ClothID = 'CL003' --Ketika toko ingin menambah stock melalui staff dengan ID ST003 --Menambah 50 produk dengan ID CL001 --mengambil baju dari vendor dengan ID VE008 --Pada tanggal 2 Desember 2020 INSERT INTO PurchaseTransaction VALUES('PU016', 'ST003', 'VE008', '2020-12-2') INSERT INTO DetailPurchaseTransaction VALUES('PU016', 'CL001', 50) UPDATE Cloth SET Stock += 50 WHERE ClothID = 'CL001'
true
6f060fb6478c6a1534dadc0417bad4be3f3e320d
SQL
ReportsAdmin/MissLEgypt
/models/Missl_Egypt/Tables/fUAInsights.sql
UTF-8
670
2.8125
3
[]
no_license
select parse_date("%Y%m%d",D_ga_date) date_start, cast(a.M_ga_sessions as float64) sessions, cast(a.M_ga_impressions as float64) Impressions, cast(a.M_ga_adClicks as float64) Adclickss, cast(a.M_ga_productAddsToCart as float64) Addtocarts, cast(a.M_ga_avgPageLoadTime as float64) avgPageLoadTime , cast(a.M_ga_bounceRate as float64) bounceRate, b.ad_cat_id,b.Paid_NonPaid,b.is_ad_order, 'MissLEgypt' Halo_Country from `noted-computing-279322.halo_1_1_Egypt.fGABaseCosts` a, `noted-computing-279322.halo_1_1_Egypt.refKeywords` b where a.D_ga_keyword=b.keyword and a.D_ga_adContent=b.ad_content and a.D_ga_campaign= b. campaign_name and a.D_ga_sourceMedium=b.source_medium
true
58e5d89746807cfa7a5154f5f583d41810bc3446
SQL
Apisajan/ITP
/DB Script/HR Management/HRDBSCRIPTS.sql
UTF-8
3,571
4.15625
4
[]
no_license
--Creating tables for HRManagement CREATE TABLE `employee` ( `EmpId` int(11) NOT NULL AUTO_INCREMENT, `FirstName` varchar(45) DEFAULT NULL, `LastName` varchar(45) DEFAULT NULL, `Gender` char(1) DEFAULT NULL, `Address` varchar(45) DEFAULT NULL, `NIC` char(10) DEFAULT NULL, `DOB` tinytext, `Nationality` varchar(20) DEFAULT NULL, `Email` varchar(45) DEFAULT NULL, `MobileNo` char(15) DEFAULT NULL, `UserName` varchar(50) DEFAULT NULL, `Password` varchar(45) DEFAULT NULL, `DepId` varchar(45) DEFAULT NULL, `Position` varchar(45) DEFAULT NULL, `BasicSalary` double DEFAULT NULL, PRIMARY KEY (`EmpId`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; CREATE TABLE `leave` ( `LeaveId` int(11) NOT NULL AUTO_INCREMENT, `EmpId` int(11) DEFAULT NULL, `RequestedDate` date DEFAULT NULL, `StartDate` date DEFAULT NULL, `EndDate` date DEFAULT NULL, `Type` varchar(45) DEFAULT NULL, `Reason` varchar(75) DEFAULT NULL, `Status` varchar(20) DEFAULT NULL, PRIMARY KEY (`LeaveId`), KEY `foreign_leave_idx` (`EmpId`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; CREATE TABLE `salary` ( `EmpId` int(11) NOT NULL, `NetSalary` double DEFAULT NULL, `GivenDate` date DEFAULT NULL, `Month` varchar(45) NOT NULL, PRIMARY KEY (`EmpId`,`Month`), KEY `EmpId_idx` (`EmpId`), CONSTRAINT `sal-EmpId` FOREIGN KEY (`EmpId`) REFERENCES `employee` (`EmpId`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `ot` ( `EmpId` int(11) NOT NULL, `OTHours` float DEFAULT NULL, `Month` varchar(45) NOT NULL, PRIMARY KEY (`EmpId`,`Month`), CONSTRAINT `ot-empid` FOREIGN KEY (`EmpId`) REFERENCES `employee` (`EmpId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ---------leave view----------- CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `leave_view` AS select `leave`.`LeaveId` AS `LeaveId`,`leave`.`EmpId` AS `EmpId`,`leave`.`RequestedDate` AS `RequestedDate`,`leave`.`StartDate` AS `StartDate`,`leave`.`EndDate` AS `EndDate`,(to_days(`leave`.`EndDate`) - to_days(`leave`.`StartDate`)) AS `NoOfDays`,`leave`.`Type` AS `Type`,`leave`.`Reason` AS `Reason`,`leave`.`Status` AS `Status` from `leave`; -----STORED PROCEDURE------ DELIMITER $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `calcSalary`(IN _month varchar(30) ) BEGIN DECLARE v_finished INTEGER DEFAULT 0; declare eid int; declare ot float; declare bSal double; declare etf double; declare epf double; declare otTot double; declare net double; declare mon varchar(30); declare cur1 cursor for select EmpId,OTHours,Month from ot; DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_finished = 1; open cur1; read_loop: LOOP FETCH cur1 INTO eid,ot,mon; IF v_finished = 1 THEN LEAVE read_loop; END IF; if mon = _month then select BasicSalary into bSal from employee where EmpId = eid; set otTot = (bSal / 240) * ot * 1.5; set etf = bSal * 0.03; set epf = bSal * 0.08; set net = (bSal + otTot) - (etf + epf); insert into salary(EmpId,NetSalary,GivenDate,Month) Values (eid,net,CURDATE(),mon); end if; end loop; close cur1; END$$ DELIMITER ; --------Report View query-------- CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `advancesalary` AS select `salary`.`Month` AS `Month`,sum(`salary`.`NetSalary`) AS `NetSalary` from `salary` group by `salary`.`Month`;
true
638255386552605edcd1380b942028d948df796b
SQL
DonaldOkwuone/pictureUploader
/myblog.sql
UTF-8
22,106
2.921875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Dec 16, 2016 at 04:36 AM -- Server version: 10.1.13-MariaDB -- PHP Version: 7.0.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `myblog` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(100) COLLATE utf8_unicode_ci 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 `categories` -- INSERT INTO `categories` (`id`, `title`, `description`, `created_at`, `updated_at`) VALUES (2, 'Category 1', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (3, 'Category 2', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (4, 'Category 3', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (5, 'Category 4', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (6, 'Category 5', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (7, 'Category 6', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (8, 'Category 7', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (9, 'Category 8', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (10, 'Category 9', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (11, 'An Awesome Blog 10', 'This is actually category 11.', '2016-10-26 22:53:41', '2016-10-26 22:53:41'), (12, 'An Awesome Blog 11', 'This is actually category 12.', '2016-10-26 22:56:25', '2016-10-26 22:56:25'); -- -------------------------------------------------------- -- -- Table structure for table `comments` -- CREATE TABLE `comments` ( `id` int(11) NOT NULL, `post_id` int(11) NOT NULL, `created` datetime NOT NULL, `author` varchar(255) NOT NULL, `body` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `comments` -- INSERT INTO `comments` (`id`, `post_id`, `created`, `author`, `body`) VALUES (6, 2, '2016-12-06 13:25:29', 'Admin', 'Be the first to leave a comment'), (7, 3, '2016-12-06 13:25:38', 'Donald', 'I love these figurins'), (15, 2, '2016-12-06 15:58:49', 'Donald', 'This is a message'), (18, 5, '2016-12-06 16:15:54', 'Donald', 'Nice Picture'), (21, 8, '2016-12-08 13:21:02', 'Donald', 'i LOVE THIS'), (22, 8, '2016-12-08 13:21:09', 'Donald', 'i LOVE THIS'), (23, 8, '2016-12-08 13:21:14', 'Donald', 'i LOVE THIS'), (24, 8, '2016-12-08 13:21:20', 'Donald', 'i LOVE THIS'), (25, 8, '2016-12-08 13:21:26', 'Donald', 'i LOVE THIS'), (26, 8, '2016-12-08 13:21:32', 'Donald', 'i LOVE THIS'), (27, 1, '2016-12-13 11:21:24', 'dddd', 'ddddd'); -- -------------------------------------------------------- -- -- Table structure for table `copy_categories` -- CREATE TABLE `copy_categories` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(100) COLLATE utf8_unicode_ci 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 `copy_categories` -- INSERT INTO `copy_categories` (`id`, `title`, `description`, `created_at`, `updated_at`) VALUES (2, 'Category 1', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (3, 'Category 2', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (4, 'Category 3', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (5, 'Category 4', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (6, 'Category 5', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (7, 'Category 6', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (8, 'Category 7', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (9, 'Category 8', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (10, 'Category 9', ' Suspendisse commodo nibh odio, vel elementum nulla luctus sit amet.', '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (11, 'An Awesome Blog 10', 'This is actually category 11.', '2016-10-26 22:53:41', '2016-10-26 22:53:41'), (12, 'An Awesome Blog 11', 'This is actually category 12.', '2016-10-26 22:56:25', '2016-10-26 22:56:25'); -- -------------------------------------------------------- -- -- Table structure for table `copy_migrations` -- CREATE TABLE `copy_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 `copy_migrations` -- INSERT INTO `copy_migrations` (`migration`, `batch`) VALUES ('2014_10_12_000000_create_users_table', 1), ('2014_10_12_100000_create_password_resets_table', 1), ('2016_10_18_194046_create_post_table', 1), ('2016_10_18_205724_create_categories_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `copy_password_resets` -- CREATE TABLE `copy_password_resets` ( `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `copy_posts` -- CREATE TABLE `copy_posts` ( `id` int(10) UNSIGNED NOT NULL, `category` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `body` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `author` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `hits` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', `added_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `published` tinyint(4) 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 `copy_posts` -- INSERT INTO `copy_posts` (`id`, `category`, `title`, `body`, `author`, `image`, `hits`, `added_on`, `published`, `created_at`, `updated_at`) VALUES (1, 2, 'An awesome arsenal blog 0', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 0', 'image 0', '0', '2016-11-16 01:03:01', 1, '2016-10-22 22:28:54', '2016-11-16 01:03:01'), (2, 1, 'An awesome arsenal blog 1', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 1', 'image 1', '1', '2016-10-22 22:28:54', 1, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (3, 2, 'An awesome arsenal blog 2', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 2', 'image 2', '2', '2016-10-22 22:28:54', 2, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (4, 3, 'An awesome arsenal blog 3', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 3', 'image 3', '3', '2016-10-22 22:28:54', 3, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (5, 4, 'An awesome arsenal blog 4', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 4', 'image 4', '6', '2016-10-23 10:35:28', 4, '2016-10-22 22:28:55', '2016-10-23 10:35:28'), (6, 5, 'An awesome arsenal blog 5', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 5', 'image 5', '5', '2016-10-22 22:28:55', 5, '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (7, 6, 'An awesome arsenal blog 6', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 6', 'image 6', '10', '2016-10-23 10:35:11', 6, '2016-10-22 22:28:55', '2016-10-23 10:35:11'), (8, 7, 'An awesome arsenal blog 7', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 7', 'image 7', '19', '2016-10-23 10:31:42', 7, '2016-10-22 22:28:55', '2016-10-23 10:31:42'), (11, 2, 'Champions League Hangover Costs Us Points', 'The beginning of something great always starts with a <a href="">few steps.</a> ', 'Admin', 'Desert.jpg', '5', '2016-10-24 21:37:24', 1, '2016-10-24 21:25:59', '2016-10-24 21:37:24'); -- -------------------------------------------------------- -- -- Table structure for table `copy_users` -- CREATE TABLE `copy_users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci 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 `copy_users` -- INSERT INTO `copy_users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Nkem', 'kemtin2010@gmail.com', '$2y$10$/w127yZyk0nOMWvLgxPUbutjtmX8Jhhg3/1FVS7Ml27u8jTB2RIkm', 'sYtdJ1EW0loXXVPoG3duo6qnfqnQGj5EDyb93BTmweS9ebBiHUe2Us5ueTWg', '2016-10-23 21:09:04', '2016-11-16 15:57:53'); -- -------------------------------------------------------- -- -- 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_10_12_000000_create_users_table', 1), ('2014_10_12_100000_create_password_resets_table', 1), ('2016_10_18_194046_create_post_table', 1), ('2016_10_18_205724_create_categories_table', 1); -- -------------------------------------------------------- -- -- 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 NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `photographs` -- CREATE TABLE `photographs` ( `id` int(11) NOT NULL, `filename` varchar(255) NOT NULL, `type` varchar(100) NOT NULL, `size` int(11) NOT NULL, `caption` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `photographs` -- INSERT INTO `photographs` (`id`, `filename`, `type`, `size`, `caption`) VALUES (4, 'flowers.jpg', 'image/jpeg', 664947, 'Flowers'), (5, 'wood.jpg', 'image/jpeg', 564389, 'Wood'), (6, 'bamboo.jpg', 'image/jpeg', 455568, 'Bamboos'), (7, 'buddhas.jpg', 'image/jpeg', 456234, 'Buddhas'), (8, 'wall.jpg', 'image/jpeg', 607118, 'Wall'), (9, 'roof.jpg', 'image/jpeg', 524574, 'Roof'), (16, 'silkgirl.jpg', 'image/jpeg', 471346, ''), (17, 'silkgirl.jpg', 'image/jpeg', 471346, ''), (18, 'silkgirl.jpg', 'image/jpeg', 471346, ''), (19, 'silkgirl.jpg', 'image/jpeg', 471346, ''), (20, 'silkgirl.jpg', 'image/jpeg', 471346, ''), (21, 'donaldJo.jpg', 'image/jpeg', 129841, ''); -- -------------------------------------------------------- -- -- Table structure for table `posts` -- CREATE TABLE `posts` ( `id` int(10) UNSIGNED NOT NULL, `category` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `body` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `author` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `hits` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', `added_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `published` tinyint(4) NOT NULL, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `posts` -- INSERT INTO `posts` (`id`, `category`, `title`, `body`, `author`, `image`, `hits`, `added_on`, `published`, `created_at`, `updated_at`) VALUES (1, 2, 'An awesome arsenal blog 0', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 0', 'redCannon.jpg', '0', '2016-11-19 03:49:28', 1, '2016-10-22 22:28:54', '2016-11-19 03:49:28'), (2, 1, 'An awesome arsenal blog 1', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 1', 'redCannon.jpg', '1', '1980-01-01 00:21:07', 1, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (3, 2, 'An awesome arsenal blog 2', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 2', 'redCannon.jpg', '2', '1980-01-01 00:21:07', 2, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (4, 3, 'An awesome arsenal blog 3', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 3', 'redCannon.jpg', '3', '1980-01-01 00:21:07', 3, '2016-10-22 22:28:54', '2016-10-22 22:28:54'), (5, 4, 'An awesome arsenal blog 4', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 4', 'redCannon.jpg', '6', '1980-01-01 00:21:07', 4, '2016-10-22 22:28:55', '2016-10-23 10:35:28'), (6, 5, 'An awesome arsenal blog 5', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 5', 'redCannon.jpg', '5', '1980-01-01 00:21:07', 5, '2016-10-22 22:28:55', '2016-10-22 22:28:55'), (7, 6, 'An awesome arsenal blog 6', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 6', 'redCannon.jpg', '10', '1980-01-01 00:21:07', 6, '2016-10-22 22:28:55', '2016-10-23 10:35:11'), (8, 7, 'An awesome arsenal blog 7', 'Vivamus interdum diam diam, non faucibus tortor consequat vitae. Proin sit amet augue sed massa pellentesque viverra. Suspendisse iaculis purus eget est pretium aliquam ut sed diam. Nullam non magna lobortis, faucibus erat eu, consequat justo. Suspendisse', 'author 7', 'redCannon.jpg', '19', '1980-01-01 00:21:07', 7, '2016-10-22 22:28:55', '2016-10-23 10:31:42'), (11, 2, 'Champions League Hangover Costs Us Points', 'The beginning of something great always starts with a <a href="">few steps.</a> ', 'Admin', 'redCannon.jpg', '5', '1980-01-01 00:21:07', 1, '2016-10-24 21:25:59', '2016-10-24 21:37:24'), (19, 2, 'donald', 'hits', 'Donald', 'silkgirl.jpg', '1', '2016-12-16 02:22:50', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), (20, 2, 'donald', 'HHH', 'Donald', 'donaldJo.jpg', '1', '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8_unicode_ci 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 `users` -- INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Nkem', 'kemtin2010@gmail.com', '$2y$10$/w127yZyk0nOMWvLgxPUbutjtmX8Jhhg3/1FVS7Ml27u8jTB2RIkm', 'sYtdJ1EW0loXXVPoG3duo6qnfqnQGj5EDyb93BTmweS9ebBiHUe2Us5ueTWg', '2016-10-23 21:09:04', '2016-11-16 15:57:53'); -- -- Indexes for dumped tables -- -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `comments` -- ALTER TABLE `comments` ADD PRIMARY KEY (`id`), ADD KEY `photograph_id` (`post_id`); -- -- Indexes for table `copy_categories` -- ALTER TABLE `copy_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `copy_password_resets` -- ALTER TABLE `copy_password_resets` ADD KEY `password_resets_email_index` (`email`), ADD KEY `password_resets_token_index` (`token`); -- -- Indexes for table `copy_posts` -- ALTER TABLE `copy_posts` ADD PRIMARY KEY (`id`); -- -- Indexes for table `copy_users` -- ALTER TABLE `copy_users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- 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 `photographs` -- ALTER TABLE `photographs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `posts` -- ALTER TABLE `posts` ADD PRIMARY KEY (`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 `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `comments` -- ALTER TABLE `comments` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `copy_categories` -- ALTER TABLE `copy_categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `copy_posts` -- ALTER TABLE `copy_posts` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `copy_users` -- ALTER TABLE `copy_users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `photographs` -- ALTER TABLE `photographs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `posts` -- ALTER TABLE `posts` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; /*!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
e0c2af966708c9fc5da2d3ec34d017fbf9f1d89f
SQL
darionmh/intelligent-employee-scheduling
/sql/create-employee-table.sql
UTF-8
1,487
3.625
4
[]
no_license
DROP TABLE IF EXISTS EMPLOYEE_SHIFT_CORRELATION; DROP TABLE IF EXISTS EMPLOYEE_AVAILABILITY; DROP TABLE IF EXISTS SHIFTS; DROP TABLE IF EXISTS EMPLOYEES; DROP TABLE IF EXISTS SCHEDULES; CREATE TABLE EMPLOYEES ( EMPLOYEE_ID int not null PRIMARY KEY, LAST_NAME varchar(255) not null, FIRST_NAME varchar(255) not null ); CREATE TABLE SCHEDULES ( SCHEDULE_ID int AUTO_INCREMENT PRIMARY KEY, BEGINNING_DATE DATETIME not null, END_DATE DATETIME not null, SCHEDULE_DESC VARCHAR(255) ); CREATE TABLE SHIFTS ( SHIFT_ID int AUTO_INCREMENT PRIMARY KEY, SCHEDULE_ID int not null, START_TIME DATETIME not null, END_TIME DATETIME not null, SHIFT_DESC VARCHAR(255), EMPLOYEES_REQ int not null, CONSTRAINT FK_SCHEDULE_ID FOREIGN KEY (SCHEDULE_ID) REFERENCES SCHEDULES(SCHEDULE_ID) ON DELETE CASCADE ); CREATE TABLE EMPLOYEE_AVAILABILITY ( ID int AUTO_INCREMENT PRIMARY KEY, EMPLOYEE_ID int not null, START_TIME DATETIME not null, END_TIME DATETIME not null, CONSTRAINT FK_EMPLOYEE_ID_AVAILABILITY FOREIGN KEY (EMPLOYEE_ID) REFERENCES EMPLOYEES(EMPLOYEE_ID) ON DELETE CASCADE ); CREATE TABLE EMPLOYEE_SHIFT_CORRELATION ( EMPLOYEE_ID int not null, SHIFT_ID int not null, CONSTRAINT FK_SHIFT_ID FOREIGN KEY (SHIFT_ID) REFERENCES SHIFTS(SHIFT_ID) ON DELETE CASCADE, CONSTRAINT FK_EMPLOYEE_ID_SHIFT FOREIGN KEY (EMPLOYEE_ID) REFERENCES EMPLOYEES(EMPLOYEE_ID) ON DELETE CASCADE );
true
df3c39c999364d3a2adef2df70640bb5ae1ff3c0
SQL
with-sahan/jentest
/database/CreateDatabase/Functions/psm/getactivationdate.sql
UTF-8
291
2.765625
3
[]
no_license
DELIMITER $$ CREATE DEFINER=`root`@`%` FUNCTION `getactivationdate`(orgid int) RETURNS date BEGIN DECLARE response date; select activationday into response from subscription.organization where id=orgid; /* select '2016-06-08' into response; */ RETURN response; END$$ DELIMITER ;
true
28d8204ebb602bc1707d2d910a127509bc99680f
SQL
rsanttos/bancodedados-sql
/DUVIDAS/Questão_03-2-DUVIDA.sql
UTF-8
200
3.078125
3
[]
no_license
SELECT s.sid FROM gradebook.students s JOIN gradebook.enrolls e ON e.students_sid = s.sid JOIN gradebook.courses c ON e.courses_secno = c.secno AND e.courses_term = c.term AND c.cno = 'csc226';
true
613823de2be3a676ae4bdc0a6ae5e968cf03df06
SQL
cmooreitrs/monitor-ninja
/sql/mysql/ninja_db_v13_to_v14.sql
UTF-8
744
3.34375
3
[ "BSD-3-Clause" ]
permissive
CREATE TABLE saved_reports ( id int(11) NOT NULL auto_increment, type varchar(255) NOT NULL, report_name varchar(255) NOT NULL, created_by varchar(255) NOT NULL, created_at int NOT NULL DEFAULT 0, updated_by varchar(255) NOT NULL, updated_at int NOT NULL DEFAULT 0, PRIMARY KEY (id) ) ENGINE=InnoDB; CREATE TABLE saved_reports_options ( report_id int(11) NOT NULL, name varchar(255) NOT NULL, value text NOT NULL, PRIMARY KEY (report_id, name), FOREIGN KEY (report_id) REFERENCES saved_reports (id) ) ENGINE=InnoDB; CREATE TABLE saved_reports_objects ( report_id int(11) NOT NULL, object_name varchar(255) NOT NULL, PRIMARY KEY (report_id, object_name), FOREIGN KEY (report_id) REFERENCES saved_reports (id) ) ENGINE=InnoDB;
true
b2ed9076d0285989f26d6cc2e552751949920f56
SQL
fandashtic/arc_chennai
/Sivabalan-SQL/SQL_STORED_PROCEDURE/spr_Vendor_Rating_Items.sql
UTF-8
1,127
3.734375
4
[]
no_license
CREATE Procedure spr_Vendor_Rating_Items (@Vendor nvarchar(20), @FromDate Datetime, @ToDate Datetime) As Select Distinct GRNDetail.Product_Code, "Item Code" = GRNDetail.Product_Code, "Item Name" = Items.ProductName, "Quantity Supplied" = Isnull(sum(case Batch_Products.Free when 0 then IsNull(Batch_Products.QuantityReceived,0) End),0), "Free Quantity" = Isnull(sum(case Batch_Products.Free when 1 then IsNull(Batch_Products.QuantityReceived,0) End),0), "Value" = IsNull(sum(case Batch_Products.Free when 0 then IsNull((Batch_Products.QuantityReceived),0) End * Batch_Products.PurchasePrice),0) From GRNDetail, GRNAbstract, Items,Batch_Products Where GRNAbstract.VendorID = @Vendor And GRNDetail.GRNID = GRNAbstract.GRNID And IsNull(GRNAbstract.GRNStatus, 0) & 128 = 0 And IsNull(GRNAbstract.GRNStatus, 0) & 32 = 0 And GRNAbstract.GRNDate Between @FromDate And @ToDate And GRNDetail.Product_Code = Items.Product_Code And Batch_Products.Product_Code = Items.Product_Code And GRNAbstract.GRNID = Batch_Products.GRN_ID group by GRNDetail.Product_Code,Items.ProductName
true
a6800d51e65c96f8d7bf5c2a8d1e4317805c3b10
SQL
woodroof/babcom
/db/data/attribute_values_idx_oi_ai_voi.sql
UTF-8
207
2.6875
3
[]
no_license
-- drop index data.attribute_values_idx_oi_ai_voi; create unique index attribute_values_idx_oi_ai_voi on data.attribute_values(object_id, attribute_id, value_object_id) where (value_object_id is not null);
true
ef4548676f16540861d7bf3504e34654985a9bcf
SQL
alumnoIdat/openack
/openack.sql
UTF-8
5,904
3.03125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Servidor: localhost -- Tiempo de generación: 04-12-2014 a las 09:29:14 -- Versión del servidor: 5.5.40-0ubuntu0.14.04.1 -- Versión de PHP: 5.5.9-1ubuntu4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Base de datos: `openack` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Aporte` -- CREATE TABLE IF NOT EXISTS `Aporte` ( `idAporte` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `Categoria` varchar(45) DEFAULT NULL, `tipoDeAporte` varchar(45) DEFAULT NULL, `Puntuacion` int(11) DEFAULT NULL, `Comentarios` varchar(45) DEFAULT NULL, PRIMARY KEY (`idAporte`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `BolsaDeTrabajo` -- CREATE TABLE IF NOT EXISTS `BolsaDeTrabajo` ( `idBolsaDeTrabajo` int(11) NOT NULL AUTO_INCREMENT, `ListaDeEmpresas` varchar(45) DEFAULT NULL, `Rubro` varchar(45) DEFAULT NULL, `Requerimientos` varchar(45) DEFAULT NULL, `Puntuacion` varchar(45) DEFAULT NULL, PRIMARY KEY (`idBolsaDeTrabajo`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Carrera` -- CREATE TABLE IF NOT EXISTS `Carrera` ( `idCarrera` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `Categoria` varchar(45) DEFAULT NULL, `Comentarios` varchar(45) DEFAULT NULL, `MallaCurricular` varchar(45) DEFAULT NULL, PRIMARY KEY (`idCarrera`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Ciclo` -- CREATE TABLE IF NOT EXISTS `Ciclo` ( `idCiclo` int(11) NOT NULL AUTO_INCREMENT, `NumeroDeCiclo` int(11) NOT NULL, PRIMARY KEY (`idCiclo`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Comentario` -- CREATE TABLE IF NOT EXISTS `Comentario` ( `idComentario` int(11) NOT NULL AUTO_INCREMENT, `Usuario` varchar(45) NOT NULL, `Texto` varchar(45) DEFAULT NULL, `Puntuacion` varchar(45) DEFAULT NULL, PRIMARY KEY (`idComentario`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Curso` -- CREATE TABLE IF NOT EXISTS `Curso` ( `idCurso` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `Categoria` varchar(45) DEFAULT NULL, `Puntuacion` varchar(45) DEFAULT NULL, `Sylabus` varchar(45) DEFAULT NULL, `Aportes` varchar(45) DEFAULT NULL, PRIMARY KEY (`idCurso`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Empresa` -- CREATE TABLE IF NOT EXISTS `Empresa` ( `idEmpresa` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `Direccion` varchar(45) DEFAULT NULL, `Rubro` varchar(45) DEFAULT NULL, `Puntuacion` int(11) DEFAULT NULL, `Comentarios` varchar(45) DEFAULT NULL, PRIMARY KEY (`idEmpresa`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Facultad` -- CREATE TABLE IF NOT EXISTS `Facultad` ( `idFacultad` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `NumeroDeAportes` int(11) DEFAULT NULL, PRIMARY KEY (`idFacultad`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Historial` -- CREATE TABLE IF NOT EXISTS `Historial` ( `idHistorial` int(11) NOT NULL AUTO_INCREMENT, `NumeroDeAportes` int(11) DEFAULT NULL, `Aportes` varchar(45) DEFAULT NULL, PRIMARY KEY (`idHistorial`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Tema` -- CREATE TABLE IF NOT EXISTS `Tema` ( `idTema` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `NumeroDeAportes` int(11) DEFAULT NULL, PRIMARY KEY (`idTema`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Universidad` -- CREATE TABLE IF NOT EXISTS `Universidad` ( `idUniversidad` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) DEFAULT NULL, `Direccion` varchar(45) DEFAULT NULL, `Telefono` varchar(45) DEFAULT NULL, `NumeroDeAportes` int(11) DEFAULT NULL, PRIMARY KEY (`idUniversidad`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Usuario` -- CREATE TABLE IF NOT EXISTS `Usuario` ( `idUsuario` int(11) NOT NULL AUTO_INCREMENT, `Nombre` varchar(45) NOT NULL, `Apellidos` varchar(45) NOT NULL, `Puntuacion` int(11) DEFAULT NULL, `NivelEducativo` varchar(45) NOT NULL, `Carrera` varchar(45) DEFAULT NULL, PRIMARY KEY (`idUsuario`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d7e447f24d78047f2528cc545d954f0f927a2fa6
SQL
biocore/microsetta-private-api
/microsetta_private_api/db/patches/0114.sql
UTF-8
34,630
3.578125
4
[ "BSD-3-Clause" ]
permissive
-- Add sleep-related questions to the end of the General Lifestyle and Hygiene Information section -- Create the questions INSERT INTO ag.survey_question (survey_question_id, american, question_shortname, retired, spanish, spain_spanish, japanese) VALUES (344, 'On days you have school or work, what time do you get up in the morning?', 'WEEKDAY_WAKE_TIME', FALSE, 'En los días que tiene escuela o trabajo, ¿a qué hora se levanta por la mañana?', 'En los días que tiene escuela o trabajo, ¿a qué hora se levanta por la mañana?', '学校や仕事がある日は、朝何時に起きますか?'), (345, 'On nights before you have school or work, what time do you go to bed?', 'WEEKDAY_SLEEP_TIME', FALSE, 'En las noches antes de ir a la escuela o al trabajo, ¿a qué hora se acuesta?', 'En las noches antes de ir a la escuela o al trabajo, ¿a qué hora se acuesta?', '学校や仕事がある前の夜は、何時に寝ますか?'), (346, 'On your off days (days when you do not have school or work), what time do you get up in the morning?', 'WEEKEND_WAKE_TIME', FALSE, 'En sus días libres (cuando no tiene escuela ni trabajo), ¿a qué hora se levanta por la mañana?', 'En sus días libres (cuando no tiene escuela ni trabajo), ¿a qué hora se levanta por la mañana?', '休みの日(学校や仕事がない日)は、朝何時に起きますか?'), (347, 'On nights before your off days (days when you do not have school or work), what time do you go to bed?', 'WEEKEND_SLEEP_TIME', FALSE, 'En sus días libres (cuando no tiene escuela ni trabajo), ¿a qué hora se acuesta?', 'En sus días libres (cuando no tiene escuela ni trabajo), ¿a qué hora se acuesta?', '休みの日(学校や仕事がない日)の前の夜は、何時に寝ますか?'), (348, 'Do you have a job or some other situation that requires you to work and sleep during atypical hours (e.g. work between 10pm-6am and sleep between 9am-5pm)?', 'ATYPICAL_SLEEP_TIME', FALSE, '¿Tiene un trabajo o alguna otra situación que requiera que trabaje y duerma en horarios atípicos (por ejemplo, trabaje entre las 10 pm y las 6 am y duerma entre las 9 am y las 5 pm)?', '¿Tiene un trabajo o alguna otra situación que requiera que trabaje y duerma en horarios atípicos (por ejemplo, trabaje entre las 10 pm y las 6 am y duerma entre las 9 am y las 5 pm)?', '不規則な時間帯に仕事や睡眠を必要とする仕事やその他の状況がありますか(午後10時~午前6時に仕事して、午前9時~午後5時に睡眠をとるなど)?'), (349, 'If you use light emitting electronic devices such as a phone or laptop right before bed, do you use it in night or dark mode?', 'DARK_MODE_ON', FALSE, 'Si usa dispositivos electrónicos que emiten luz, como un teléfono o una computadora portátil, justo antes de acostarse, ¿los usa en modo nocturno u oscuro?', 'Si usa dispositivos electrónicos que emiten luz, como un teléfono o una computadora portátil, justo antes de acostarse, ¿los usa en modo nocturno u oscuro?', '電話やノートパソコンなどの発光電子機器を寝る直前に使用する場合、ナイトモードまたはダークモードで使用していますか?'), (350, 'Over the past week, how would you rate your sleep quality?', 'SLEEP_QUALITY', FALSE, 'Durante la última semana, ¿cómo calificaría la calidad de su sueño?', 'Durante la última semana, ¿cómo calificaría la calidad de su sueño?', '過去1週間の睡眠の質はどんなでしたか?'); -- Set the question types INSERT INTO ag.survey_question_response_type (survey_question_id, survey_response_type) VALUES (344, 'SINGLE'), (345, 'SINGLE'), (346, 'SINGLE'), (347, 'SINGLE'), (348, 'SINGLE'), (349, 'SINGLE'), (350, 'SINGLE'); -- Associate them with the group INSERT INTO ag.group_questions (survey_group, survey_question_id, display_index) VALUES (2, 344, 13), (2, 345, 14), (2, 346, 15), (2, 347, 16), (2, 348, 17), (2, 349, 18), (2, 350, 19); -- Create the responses we'll need for the questions INSERT INTO ag.survey_response (american, spanish, spain_spanish, japanese) VALUES ('10:00AM', '10:00AM', '10:00AM', '10:00午前'), ('10:00PM', '10:00PM', '10:00PM', '10:00午後'), ('10:30AM', '10:30AM', '10:30AM', '10:30午前'), ('10:30PM', '10:30PM', '10:30PM', '10:30午後'), ('11:00AM', '11:00AM', '11:00AM', '11:00午前'), ('11:00PM', '11:00PM', '11:00PM', '11:00午後'), ('11:30AM', '11:30AM', '11:30AM', '11:30午前'), ('11:30PM', '11:30PM', '11:30PM', '11:30午後'), ('12:00AM', '12:00AM', '12:00AM', '12:00午前'), ('12:00PM', '12:00PM', '12:00PM', '12:00午後'), ('12:30AM', '12:30AM', '12:30AM', '12:30午前'), ('12:30PM', '12:30PM', '12:30PM', '12:30午後'), ('1:00AM', '1:00AM', '1:00AM', '1:00午前'), ('1:00PM', '1:00PM', '1:00PM', '1:00午後'), ('1:30AM', '1:30AM', '1:30AM', '1:30午前'), ('1:30PM', '1:30PM', '1:30PM', '1:30午後'), ('2:00AM', '2:00AM', '2:00AM', '2:00午前'), ('2:00PM', '2:00PM', '2:00PM', '2:00午後'), ('2:30AM', '2:30AM', '2:30AM', '2:30午前'), ('2:30PM', '2:30PM', '2:30PM', '2:30午後'), ('3:00AM', '3:00AM', '3:00AM', '3:00午前'), ('3:00PM', '3:00PM', '3:00PM', '3:00午後'), ('3:30AM', '3:30AM', '3:30AM', '3:30午前'), ('3:30PM', '3:30PM', '3:30PM', '3:30午後'), ('4:00AM', '4:00AM', '4:00AM', '4:00午前'), ('4:00PM', '4:00PM', '4:00PM', '4:00午後'), ('4:30AM', '4:30AM', '4:30AM', '4:30午前'), ('4:30PM', '4:30PM', '4:30PM', '4:30午後'), ('5:00AM', '5:00AM', '5:00AM', '5:00午前'), ('5:00PM', '5:00PM', '5:00PM', '5:00午後'), ('5:30AM', '5:30AM', '5:30AM', '5:30午前'), ('5:30PM', '5:30PM', '5:30PM', '5:30午後'), ('6:00AM', '6:00AM', '6:00AM', '6:00午前'), ('6:00PM', '6:00PM', '6:00PM', '6:00午後'), ('6:30AM', '6:30AM', '6:30AM', '6:30午前'), ('6:30PM', '6:30PM', '6:30PM', '6:30午後'), ('7:00AM', '7:00AM', '7:00AM', '7:00午前'), ('7:00PM', '7:00PM', '7:00PM', '7:00午後'), ('7:30AM', '7:30AM', '7:30AM', '7:30午前'), ('7:30PM', '7:30PM', '7:30PM', '7:30午後'), ('8:00AM', '8:00AM', '8:00AM', '8:00午前'), ('8:00PM', '8:00PM', '8:00PM', '8:00午後'), ('8:30AM', '8:30AM', '8:30AM', '8:30午前'), ('8:30PM', '8:30PM', '8:30PM', '8:30午後'), ('9:00AM', '9:00AM', '9:00AM', '9:00午前'), ('9:00PM', '9:00PM', '9:00PM', '9:00午後'), ('9:30AM', '9:30AM', '9:30AM', '9:30午前'), ('9:30PM', '9:30PM', '9:30PM', '9:30午後'), ('I do not use these devices before bed', 'No uso estos dispositivos antes de acostarme.', 'No uso estos dispositivos antes de acostarme.', '寝る直前にこれらの機器は使用していません。'); -- Associate responses with questions INSERT INTO ag.survey_question_response (survey_question_id, response, display_index) VALUES (344, 'Unspecified', 0), (344, '12:00AM', 1), (344, '12:30AM', 2), (344, '1:00AM', 3), (344, '1:30AM', 4), (344, '2:00AM', 5), (344, '2:30AM', 6), (344, '3:00AM', 7), (344, '3:30AM', 8), (344, '4:00AM', 9), (344, '4:30AM', 10), (344, '5:00AM', 11), (344, '5:30AM', 12), (344, '6:00AM', 13), (344, '6:30AM', 14), (344, '7:00AM', 15), (344, '7:30AM', 16), (344, '8:00AM', 17), (344, '8:30AM', 18), (344, '9:00AM', 19), (344, '9:30AM', 20), (344, '10:00AM', 21), (344, '10:30AM', 22), (344, '11:00AM', 23), (344, '11:30AM', 24), (344, '12:00PM', 25), (344, '12:30PM', 26), (344, '1:00PM', 27), (344, '1:30PM', 28), (344, '2:00PM', 29), (344, '2:30PM', 30), (344, '3:00PM', 31), (344, '3:30PM', 32), (344, '4:00PM', 33), (344, '4:30PM', 34), (344, '5:00PM', 35), (344, '5:30PM', 36), (344, '6:00PM', 37), (344, '6:30PM', 38), (344, '7:00PM', 39), (344, '7:30PM', 40), (344, '8:00PM', 41), (344, '8:30PM', 42), (344, '9:00PM', 43), (344, '9:30PM', 44), (344, '10:00PM', 45), (344, '10:30PM', 46), (344, '11:00PM', 47), (344, '11:30PM', 48), (345, 'Unspecified', 0), (345, '12:00AM', 1), (345, '12:30AM', 2), (345, '1:00AM', 3), (345, '1:30AM', 4), (345, '2:00AM', 5), (345, '2:30AM', 6), (345, '3:00AM', 7), (345, '3:30AM', 8), (345, '4:00AM', 9), (345, '4:30AM', 10), (345, '5:00AM', 11), (345, '5:30AM', 12), (345, '6:00AM', 13), (345, '6:30AM', 14), (345, '7:00AM', 15), (345, '7:30AM', 16), (345, '8:00AM', 17), (345, '8:30AM', 18), (345, '9:00AM', 19), (345, '9:30AM', 20), (345, '10:00AM', 21), (345, '10:30AM', 22), (345, '11:00AM', 23), (345, '11:30AM', 24), (345, '12:00PM', 25), (345, '12:30PM', 26), (345, '1:00PM', 27), (345, '1:30PM', 28), (345, '2:00PM', 29), (345, '2:30PM', 30), (345, '3:00PM', 31), (345, '3:30PM', 32), (345, '4:00PM', 33), (345, '4:30PM', 34), (345, '5:00PM', 35), (345, '5:30PM', 36), (345, '6:00PM', 37), (345, '6:30PM', 38), (345, '7:00PM', 39), (345, '7:30PM', 40), (345, '8:00PM', 41), (345, '8:30PM', 42), (345, '9:00PM', 43), (345, '9:30PM', 44), (345, '10:00PM', 45), (345, '10:30PM', 46), (345, '11:00PM', 47), (345, '11:30PM', 48), (346, 'Unspecified', 0), (346, '12:00AM', 1), (346, '12:30AM', 2), (346, '1:00AM', 3), (346, '1:30AM', 4), (346, '2:00AM', 5), (346, '2:30AM', 6), (346, '3:00AM', 7), (346, '3:30AM', 8), (346, '4:00AM', 9), (346, '4:30AM', 10), (346, '5:00AM', 11), (346, '5:30AM', 12), (346, '6:00AM', 13), (346, '6:30AM', 14), (346, '7:00AM', 15), (346, '7:30AM', 16), (346, '8:00AM', 17), (346, '8:30AM', 18), (346, '9:00AM', 19), (346, '9:30AM', 20), (346, '10:00AM', 21), (346, '10:30AM', 22), (346, '11:00AM', 23), (346, '11:30AM', 24), (346, '12:00PM', 25), (346, '12:30PM', 26), (346, '1:00PM', 27), (346, '1:30PM', 28), (346, '2:00PM', 29), (346, '2:30PM', 30), (346, '3:00PM', 31), (346, '3:30PM', 32), (346, '4:00PM', 33), (346, '4:30PM', 34), (346, '5:00PM', 35), (346, '5:30PM', 36), (346, '6:00PM', 37), (346, '6:30PM', 38), (346, '7:00PM', 39), (346, '7:30PM', 40), (346, '8:00PM', 41), (346, '8:30PM', 42), (346, '9:00PM', 43), (346, '9:30PM', 44), (346, '10:00PM', 45), (346, '10:30PM', 46), (346, '11:00PM', 47), (346, '11:30PM', 48), (347, 'Unspecified', 0), (347, '12:00AM', 1), (347, '12:30AM', 2), (347, '1:00AM', 3), (347, '1:30AM', 4), (347, '2:00AM', 5), (347, '2:30AM', 6), (347, '3:00AM', 7), (347, '3:30AM', 8), (347, '4:00AM', 9), (347, '4:30AM', 10), (347, '5:00AM', 11), (347, '5:30AM', 12), (347, '6:00AM', 13), (347, '6:30AM', 14), (347, '7:00AM', 15), (347, '7:30AM', 16), (347, '8:00AM', 17), (347, '8:30AM', 18), (347, '9:00AM', 19), (347, '9:30AM', 20), (347, '10:00AM', 21), (347, '10:30AM', 22), (347, '11:00AM', 23), (347, '11:30AM', 24), (347, '12:00PM', 25), (347, '12:30PM', 26), (347, '1:00PM', 27), (347, '1:30PM', 28), (347, '2:00PM', 29), (347, '2:30PM', 30), (347, '3:00PM', 31), (347, '3:30PM', 32), (347, '4:00PM', 33), (347, '4:30PM', 34), (347, '5:00PM', 35), (347, '5:30PM', 36), (347, '6:00PM', 37), (347, '6:30PM', 38), (347, '7:00PM', 39), (347, '7:30PM', 40), (347, '8:00PM', 41), (347, '8:30PM', 42), (347, '9:00PM', 43), (347, '9:30PM', 44), (347, '10:00PM', 45), (347, '10:30PM', 46), (347, '11:00PM', 47), (347, '11:30PM', 48), (348, 'Unspecified', 0), (348, 'Yes', 1), (348, 'No', 2), (349, 'Unspecified', 0), (349, 'Yes', 1), (349, 'No', 2), (349, 'I do not use these devices before bed', 3), (350, 'Unspecified', 0), (350, 'Very poor', 1), (350, 'Poor', 2), (350, 'Fair', 3), (350, 'Good', 4), (350, 'Very good', 5); -- Add artificial sweetener questions to Detailed Dietary Information section -- Create the questions INSERT INTO ag.survey_question (survey_question_id, american, question_shortname, retired, spanish, spain_spanish, japanese) VALUES (463, 'How often do you consume foods containing non-nutritive or low-calorie sweeteners?', 'ARTIFICIAL_SWEETENERS_FOOD', FALSE, '¿Con qué frecuencia consume alimentos que contienen edulcorantes no nutritivos o bajos en calorías?', '¿Con qué frecuencia consume alimentos que contienen edulcorantes no nutritivos o bajos en calorías?', 'ノンカロリーまたは低カロリーの甘味料を含む食品はどれくらい摂取していますか?'), (465, 'When you consume foods or beverages containing non-nutritive or low-calorie sweeteners, do you tend to experience gastrointestinal disorders afterwards, such as gas, bloating, and/or diarrhea?', 'ARTIFICIAL_GI_DISORDERS', FALSE, 'Cuando consume alimentos o bebidas que contienen edulcorantes no nutritivos o bajos en calorías, ¿tiende a experimentar sintomas gastrointestinales posteriores, como gases, inflamación y/o diarrea?', 'Cuando consume alimentos o bebidas que contienen edulcorantes no nutritivos o bajos en calorías, ¿tiende a experimentar sintomas gastrointestinales posteriores, como gases, inflamación y/o diarrea?', 'ノンカロリーまたは低カロリーの甘味料を含む食品や飲料を摂取した場合、その後、ガス、膨張、下痢などの消化器の不具合が起きることがよくありますか?'), (466, 'If you answered "yes", to the previous question, what are the symptoms? Select all that apply.', 'ARTIFICIAL_GI_DISORDER_TYPES', FALSE, 'Si respondió "sí" a la pregunta anterior, ¿cuáles son los síntomas? Seleccione todas las que correspondan.', 'Si respondió "sí" a la pregunta anterior, ¿cuáles son los síntomas? Seleccione todas las que correspondan.', '前の質問への回答が「はい」の場合、症状は何ですか?該当するものをすべて選択してください。'); -- Set the question types INSERT INTO ag.survey_question_response_type (survey_question_id, survey_response_type) VALUES (463, 'SINGLE'), (465, 'SINGLE'), (466, 'MULTIPLE'); -- Associate them with the group. We need to make space for them, so we'll re-index a few existing questions first. UPDATE ag.group_questions SET display_index = 28 WHERE survey_group = 4 AND display_index = 25; UPDATE ag.group_questions SET display_index = 27 WHERE survey_group = 4 AND display_index = 24; UPDATE ag.group_questions SET display_index = 26 WHERE survey_group = 4 AND display_index = 23; INSERT INTO ag.group_questions (survey_group, survey_question_id, display_index) VALUES (4, 463, 23), (4, 465, 24), (4, 466, 25); -- Create the responses we'll need for the questions INSERT INTO ag.survey_response (american, spanish, spain_spanish, japanese) VALUES ('Stomachache', 'Dolor de estómago', 'Dolor de estómago', '腹痛'), ('Soft stools', 'Heces blandas', 'Heces blandas', '軟便'), ('Constipation', 'Estriñimiento', 'Estriñimiento', '便秘'); -- Associate responses with questions INSERT INTO ag.survey_question_response (survey_question_id, response, display_index) VALUES (463, 'Unspecified', 0), (463, 'Never', 1), (463, 'Rarely (a few times/month)', 2), (463, 'Occasionally (1-2 times/week)', 3), (463, 'Regularly (3-5 times/week)', 4), (463, 'Daily', 5), (465, 'Unspecified', 0), (465, 'Yes', 1), (465, 'No', 2), (466, 'Unspecified', 0), (466, 'Stomachache', 1), (466, 'Diarrhea', 2), (466, 'Soft stools', 3), (466, 'Constipation', 4), (466, 'Other', 5); -- Set up the triggers INSERT INTO ag.survey_question_triggers (survey_question_id, triggering_response, triggered_question) VALUES (157, 'Rarely (a few times/month)', 465), (157, 'Occasionally (1-2 times/week)', 465), (157, 'Regularly (3-5 times/week)', 465), (157, 'Daily', 465), (463, 'Rarely (a few times/month)', 465), (463, 'Occasionally (1-2 times/week)', 465), (463, 'Regularly (3-5 times/week)', 465), (463, 'Daily', 465), (465, 'Yes', 466); -- Update translations for survey groups UPDATE ag.survey_group SET japanese = '調理用油とシュウ酸が豊富な食品' WHERE group_order = -7; -- Cooing Oils & Oxalate-rich Foods UPDATE ag.survey_group SET japanese = '新型コロナウイルス感染症調査票' WHERE group_order = -6; -- COVID-19 UPDATE ag.survey_group SET japanese = '発酵食品調査票' WHERE group_order = -3; -- Fermented Foods UPDATE ag.survey_group SET japanese = 'Microsetta Initiative(マイクロセッタ・イニシアチブ)' WHERE group_order = -1; -- Microsetta Initative UPDATE ag.survey_group SET japanese = '一般的な食事に関する情報' WHERE group_order = 0; -- General Diet UPDATE ag.survey_group SET japanese = '一般情報' WHERE group_order = 1; -- General Information UPDATE ag.survey_group SET japanese = '一般的な生活習慣と衛生に関する情報' WHERE group_order = 2; -- General Lifestyle and Hygiene Information UPDATE ag.survey_group SET japanese = '一般的な健康情報' WHERE group_order = 3; -- General Health UPDATE ag.survey_group SET japanese = '詳しい食事情報' WHERE group_order = 4; -- Detailed Diet UPDATE ag.survey_group SET japanese = 'その他' WHERE group_order = 5; -- Anything else? -- Update translations for survey questions UPDATE ag.survey_question SET japanese = 'どれくらいの頻度でプロバイオティクスや乳酸菌を服用していますか?' WHERE american = 'How frequently do you take a probiotic?'; UPDATE ag.survey_question SET japanese = 'どれくらいの頻度でビタミンB複合体、葉酸塩または葉酸を服用していますか?' WHERE american = 'How frequently do you take Vitamin B complex, folate or folic acid?'; UPDATE ag.survey_question SET japanese = '抗生物質を投与した動物の肉や乳製品を食べますか?' WHERE american = 'Do you eat meat/dairy products from animals treated with antibiotics?'; UPDATE ag.survey_question SET japanese = '過去_以内に海外旅行をしたことがある。' WHERE american = 'I have traveled outside of my country of residence in the past _________.'; UPDATE ag.survey_question SET japanese = 'あなたの同居人でこの研究に参加している人はいますか?' WHERE american = 'Are any of your roommates participating in this study?'; UPDATE ag.survey_question SET japanese = 'スイミングプール/銭湯/スパはどれくらいの頻度で使用していますか?' WHERE american = 'How often do you use a swimming pool/hot tub?'; UPDATE ag.survey_question SET japanese = '私は過去___の間に抗生物質を服用しました。' WHERE american = 'I have taken antibiotics in the last ____________.'; UPDATE ag.survey_question SET japanese = '私は過去___の間にインフルエンザのワクチンを接種しました。' WHERE american = 'I have received a flu vaccine in the last ____________.'; UPDATE ag.survey_question SET japanese = '怖い夢や悪夢を見ることがありますか?' WHERE american = 'Do you have vivid and/or frightening dreams?'; UPDATE ag.survey_question SET japanese = '1週間のうち、1日に全粒粉を2食分以上を摂取する頻度はどのくらいですか? (1食分=100%全粒粉パン1枚、高繊維シリアル、オートミールなどの全粒シリアル1カップ、全粒クラッカー3~4枚、玄米や全粒パスタ1/2カップ)' WHERE american = 'In an average week, how often do you eat at least 2 servings of whole grains in a day?'; UPDATE ag.survey_question SET japanese = '1週間のうち、1日に2-3食分以上のでんぷん質野菜と非でんぷん質野菜を摂取する頻度はどのくらいですか?でんぷん質野菜の例としては、白イモ、トウモロコシ、エンドウ豆、キャベツなどが挙げられます。非でんぷん質野菜の例としては、生の葉野菜、キュウリ、トマト、ピーマン、ブロッコリー、ケールなどがあります。( 1食分=野菜/じゃがいも1/2カップ、生の葉野菜1カップ)' WHERE american = 'In an average week, how often do you consume at least 2-3 servings of starchy and non-starchy vegetables. Examples of starchy vegetables include white potatoes, corn, peas and cabbage. Examples of non-starchy vegetables include raw leafy greens, cucumbers, tomatoes, peppers, broccoli, and kale. (1 serving = ½ cup vegetables/potatoes; 1 cup leafy raw vegetables)'; UPDATE ag.survey_question SET japanese = '1 週間に何種類の植物(野菜、果物、穀物)を食べますか?例えばにんじん、じゃがいも、玉ねぎが入ったスープを消費した場合、 3 種類の野菜とみなします。多穀物パンを消費した場合、それぞれの穀物を数えてください。' WHERE american = 'In an average week, how many different plant species do you eat? e.g. If you consume a can of soup that contains carrots, potatoes, and onion, you can count this as 3 different plants; If you consume multi-grain bread, each different grain counts as a plant.'; UPDATE ag.survey_question SET japanese = '1週間のうち、1日に2食分以上の牛乳やチーズを摂取する頻度はどのくらいですか?( 1食分=牛乳またはヨーグルト1カップ、チーズ43〜57グラム))' WHERE american = 'In an average week, how often do you consume at least 2 servings of milk or cheese a day? (1 serving = 1 cup milk or yogurt; 1 1/2 - 2 ounces cheese)'; UPDATE ag.survey_question SET japanese = 'あなたの微生物に関連する食習慣や生活習慣があれば記入してください。' WHERE american = 'Please write anything else about yourself that you think could affect your personal microorganisms.'; UPDATE ag.survey_question SET japanese = '発酵食品を摂取する頻度または量は、過去____以内に2倍以上に増加しましたか?(ビール、ワイン、アルコールを除く)' WHERE american = 'Excluding beer, wine, and alcohol, I have significantly increased (i.e. more than doubled) my intake of fermented foods in frequency or quantity within the last ____.'; UPDATE ag.survey_question SET japanese = '発酵食品/飲料を自宅で個人消費用に製造していますか?該当するものをすべて選択してください。' WHERE american = 'Do you produce any of the following fermented foods/beverages at home for personal consumption? Check all that apply.'; UPDATE ag.survey_question SET japanese = 'その他この項に関する詳しい情報がありましたらご記入ください。ご協力ありがとうございます。' WHERE american = 'Volunteer more information about this activity.'; UPDATE ag.survey_question SET japanese = '1週間のうち、ラード、バター、ギーはどれくらいの頻度で使用・調理していますか?' WHERE american = 'In a given week, how often do you use or cook with lard, butter or ghee?'; UPDATE ag.survey_question SET japanese = '1週間のうち、ココナッツオイル、パームオイル、パームカーネルオイルをどれくらいの頻度で使用していますか?' WHERE american = 'In a given week, how often do you use or cook with coconut, palm or palm kernel oil?'; UPDATE ag.survey_question SET japanese = '1週間のうち、マーガリンや植物性ショートニングをどれくらいの頻度で使用していますか?' WHERE american = 'In a given week, how often do you use or cook with margarine or (vegetable) shortening?'; UPDATE ag.survey_question SET japanese = 'ほうれん草、ふだん草、ビーツまたはビーツの葉、オクラ、キノア、アマランス、蕎麦、小麦ふすままたは胚芽、ふすまシリアル、チアシード、ルバーブ、ダークチョコレートやココア粉末(> 70%)、又はナッツ(アーモンド、ピーナッツ、ピーカン、カシュー、ヘーゼルナッツ)などのシュウ酸塩が豊富な食品を平均してどれくらいの頻度で摂取していますか? ' WHERE american = 'On average, how often do you consume oxalate-rich foods, such as spinach, Swiss chard, beetroot or beet greens, okra, quinoa, amaranth, buckwheat, wheat bran or germ, Bran cereal, chia seeds, rhubarb, dark chocolate or cocoa powder (>70%), and nuts such as almonds, peanuts, pecans, cashews, and hazelnuts?'; UPDATE ag.survey_question SET japanese = 'あなたは毎日マルチビタミンサプリメントを服用していますか?' WHERE american = 'Are you taking a daily multivitamin?'; UPDATE ag.survey_question SET japanese = '現在の居住地にいつ越して来ましたか?' WHERE american = 'When did you move to current state of residence?'; UPDATE ag.survey_question SET japanese = '渡航先:' WHERE american = 'Travel:'; UPDATE ag.survey_question SET japanese = 'ペットの種類を記入してください。' WHERE american = 'Please list pets'; UPDATE ag.survey_question SET japanese = '歯磨きはどの程度しますか?' WHERE american = 'How often do you brush your teeth?'; UPDATE ag.survey_question SET japanese = '顔用化粧品はどの程度使用していますか?' WHERE american = 'How often do you wear facial cosmetics?'; UPDATE ag.survey_question SET japanese = '「アルミニウム入りの」デオドラントまたは制汗剤は使用していますか?' WHERE american = 'Do you use deodorant or antiperspirant (antiperspirants generally contain aluminum)?'; UPDATE ag.survey_question SET japanese = '出産予定日:' WHERE american = 'Pregnancy due date:'; UPDATE ag.survey_question SET japanese = '水ぼうそうにかかったことがありますか?' WHERE american = 'Have you had chickenpox?'; UPDATE ag.survey_question SET japanese = '今までに腸カンジダ症や腸内真菌異常増殖症(SIFO)と診断されたことはありますか?' WHERE american = 'Have you ever been diagnosed with Candida or fungal overgrowth in the gut?'; UPDATE ag.survey_question SET japanese = '今までに小腸内細菌異常増殖症と診断されたことがありますか?' WHERE american = 'Have you ever been diagnosed with small intestinal bacterial overgrowth (SIBO)?'; UPDATE ag.survey_question SET japanese = '胃酸逆流やGERD(胃食道逆流症)と診断されたことがありますか?' WHERE american = 'Have you ever been diagnosed with acid reflux or GERD (gastro-esophageal reflux disease)?'; UPDATE ag.survey_question SET japanese = 'あなたは1 日のカロリーの 75%以上を栄養剤(経腸栄養剤など)から摂取していますか?' WHERE american = 'Are you an infant who receives most of their nutrition from breast milk or formula, or an adult who receives most (more than 75% of daily calories) of their nutrition from adult nutritional shakes (i.e. Ensure)?'; UPDATE ag.survey_question SET japanese = '1週間のうち、1食分以上の発酵野菜または植物製品をどのくらいの頻度で摂取していますか?(1食分=ザワークラウト、キムチまたは発酵野菜1/2カップ、コンブチャ1カップ)' WHERE american = 'How often do you consume one or more servings of fermented vegetables in or plant products a day in an average week? (1 serving = 1/2 cup sauerkraut, kimchi or fermented vegetable or 1 cup of kombucha)'; UPDATE ag.survey_question SET japanese = '約450ミリリットル以上のダイエット用ではないソーダやフルーツドリンク/パンチ(100%果汁は含まない)等の清涼飲料水を1日にどのくらい摂取していますか?' WHERE american = 'Drink 16 ounces or more of a sugar sweetened beverage such as non-diet soda or fruit drink/punch (however, not including 100 % fruit juice) in a day? (1 can of soda = 12 ounces)'; UPDATE ag.survey_question SET japanese = '現在の幸福度についてお答えください。あなたの心身の健康や、直面している問題、人間関係、得られるチャンスの数や挑戦のための望ましい環境を得られているかを総合的に考えて、現在の幸福状態を言い表すと?' WHERE american = 'Please think about your current level of well-being. When you think about well-being, think about your physical health, your emotional health, any challenges you are experiencing, the people in your life, and the opportunities or resources you have available to you. How would you describe your current level of well-being?'; UPDATE ag.survey_question SET japanese = 'それはいつ頃ですか?' WHERE american = 'Please provide date'; UPDATE ag.survey_question SET japanese = '期間中、何らかの理由で外出した(例えば、出勤、店や公園などに行くために外出)回数は何回でしたか?' WHERE american = 'How many times have you gone outside of your home for any reason including work (e.g., left your property to go to stores, parks, etc.)?'; UPDATE ag.survey_question SET japanese = '相乗りタクシーを使用したことがありますか?' WHERE american = 'Have you used shared ride services including Lyft, Uber or alternative forms of taxi?'; UPDATE ag.survey_question SET japanese = '発酵食品/飲料のうち、週一回以上摂取しているものをすべて選択してください。記載がないものは「その他」を選択してください。' WHERE american = 'Which of the following fermented foods/beverages do you consume more than once a week? Check all that apply.'; UPDATE ag.survey_question SET japanese = '発酵食品/飲料を商用目的に製造していますか?該当するものをすべて選択してください。' WHERE american = 'Do you produce any of the following fermented foods/beverages for commercial purposes? Check all that apply.'; UPDATE ag.survey_question SET japanese = '1日に2~3食分以上の果物を摂取する頻度はどのくらいですか? (1食分 = 果物1/2カップ、中くらいの大きさの果物1個、100% フルーツ ジュース約 120 ミリリットル)。' WHERE american = 'In an average week, how often to you consume at least 2-3 servings of fruit in a day? (1 serving = 1/2 cup fruit; 1 medium sized fruit; 4 oz. 100% fruit juice.)'; -- Update translations for survey responses UPDATE ag.survey_response SET japanese = '不明' WHERE american = 'Unspecified'; UPDATE ag.survey_response SET japanese = '肉と野菜両方食べる' WHERE american = 'Omnivore'; UPDATE ag.survey_response SET japanese = '肉と野菜両方食べるが、赤身肉は食べない' WHERE american = 'Omnivore but do not eat red meat'; UPDATE ag.survey_response SET japanese = 'ベジタリアン(菜食主義)' WHERE american = 'Vegetarian'; UPDATE ag.survey_response SET japanese = 'ビーガン(完全菜食主義)' WHERE american = 'Vegan'; UPDATE ag.survey_response SET japanese = 'ペットボトル・ミネラルウォーター' WHERE american = 'Bottled'; UPDATE ag.survey_response SET japanese = 'ろ過水' WHERE american = 'Filtered'; UPDATE ag.survey_response SET japanese = '分からない' WHERE american = 'Not sure'; UPDATE ag.survey_response SET japanese = '1年以上前から住んでいる' WHERE american = 'I have lived in my current state of residence for more than a year.'; UPDATE ag.survey_response SET japanese = '1回未満' WHERE american = 'Less than one'; UPDATE ag.survey_response SET japanese = '1回' WHERE american = 'One'; UPDATE ag.survey_response SET japanese = '2回' WHERE american = 'Two'; UPDATE ag.survey_response SET japanese = '3回' WHERE american = 'Three'; UPDATE ag.survey_response SET japanese = '4回' WHERE american = 'Four'; UPDATE ag.survey_response SET japanese = '5回以上' WHERE american = 'Five or more'; UPDATE ag.survey_response SET japanese = '分からない' WHERE american = 'I don''t know, I do not have a point of reference'; UPDATE ag.survey_response SET japanese = '医療従事者(医師、医師助手)に診断されたことがある' WHERE american = 'Diagnosed by a medical professional (doctor, physician assistant)'; UPDATE ag.survey_response SET japanese = '代替医療の医師に診断されたことがある' WHERE american = 'Diagnosed by an alternative medicine practitioner'; UPDATE ag.survey_response SET japanese = '自己診断したことがある' WHERE american = 'Self-diagnosed'; UPDATE ag.survey_response SET japanese = '固形食と粉ミルク/母乳の両方を食べている' WHERE american = 'I eat both solid food and formula/breast milk'; UPDATE ag.survey_response SET japanese = '水道水' WHERE american = 'City'; UPDATE ag.survey_response SET japanese = 'まれに (数回/月)' WHERE american = 'Rarely (a few times/month)'; UPDATE ag.survey_response SET japanese = '4.5キロ以上増加' WHERE american = 'Increased more than 10 pounds'; UPDATE ag.survey_response SET japanese = '4.5キロ以上減少' WHERE american = 'Decreased more than 10 pounds'; UPDATE ag.survey_response SET japanese = '主に粉ミルク' WHERE american = 'Primarily infant formula'; UPDATE ag.survey_response SET japanese = '母乳と粉ミルクの両方' WHERE american = 'A mixture of breast milk and formula'; UPDATE ag.survey_response SET japanese = 'ウルシ科の植物' WHERE american = 'Poison ivy/oak'; UPDATE ag.survey_response SET japanese = 'うつ病' WHERE american = 'Depression'; UPDATE ag.survey_response SET japanese = 'ほとんどない(1回/週未満)' WHERE american = 'Rarely (less than once/week)'; UPDATE ag.survey_response SET japanese = '5種以下' WHERE american = 'Less than 5'; UPDATE ag.survey_response SET japanese = '30種以上' WHERE american = 'More than 30'; UPDATE ag.survey_response SET japanese = 'はい、注射式の避妊薬を使用しています' WHERE american = 'Yes, I use an injected contraceptive (DMPA)'; UPDATE ag.survey_response SET japanese = 'はい、ホルモン性IUD/インプラント(ミレーナ)を使用しています' WHERE american = 'Yes, I use a hormonal IUD (Mirena)'; UPDATE ag.survey_response SET japanese = '全くない' WHERE american = 'None';
true
c7670fe50836937e60cb8f9d028bfc1dc1f620c5
SQL
thepricetoday/thesisgithub
/pricetoday (2).sql
UTF-8
18,269
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jan 16, 2016 at 05:36 PM -- Server version: 5.6.17 -- PHP Version: 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 */; -- -- Database: `pricetoday` -- -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE IF NOT EXISTS `category` ( `categoryID` int(11) NOT NULL AUTO_INCREMENT, `categoryNAME` varchar(50) NOT NULL, PRIMARY KEY (`categoryID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=19 ; -- -- Dumping data for table `category` -- INSERT INTO `category` (`categoryID`, `categoryNAME`) VALUES (13, 'RICE'), (14, 'CORN'), (15, 'MEAT & POULTRY'), (16, 'FISH'), (17, 'VEGETABLE'), (18, 'FRUITS'); -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE IF NOT EXISTS `employee` ( `employeeID` int(11) NOT NULL AUTO_INCREMENT, `employeeFIRSTNAME` varchar(50) NOT NULL, `employeeLASTNAME` varchar(50) NOT NULL, `employeeMIDDLENAME` varchar(50) NOT NULL, `Address` varchar(50) NOT NULL, `Birthdate` date NOT NULL, `ContactNUMBER` int(11) NOT NULL, PRIMARY KEY (`employeeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=2 ; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`employeeID`, `employeeFIRSTNAME`, `employeeLASTNAME`, `employeeMIDDLENAME`, `Address`, `Birthdate`, `ContactNUMBER`) VALUES (1, 'Vallecera', 'Chejei', 'Denoso', 'CDO', '1994-01-26', 2147483647); -- -------------------------------------------------------- -- -- Stand-in structure for view `latestupdates_view` -- CREATE TABLE IF NOT EXISTS `latestupdates_view` ( `latest` int(11) ); -- -------------------------------------------------------- -- -- Table structure for table `market` -- CREATE TABLE IF NOT EXISTS `market` ( `marketID` int(11) NOT NULL AUTO_INCREMENT, `marketNAME` varchar(50) NOT NULL, `Address` varchar(50) NOT NULL, `latitude` varchar(50) NOT NULL, `longitude` varchar(50) NOT NULL, `placeID` int(11) NOT NULL, PRIMARY KEY (`marketID`), KEY `FK__city/province` (`placeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Stand-in structure for view `market_view` -- CREATE TABLE IF NOT EXISTS `market_view` ( `marketID` int(11) ,`marketNAME` varchar(50) ,`Address` varchar(50) ,`latitude` varchar(50) ,`longitude` varchar(50) ,`ID` int(11) ,`placeName` varchar(50) ); -- -------------------------------------------------------- -- -- Table structure for table `place` -- CREATE TABLE IF NOT EXISTS `place` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `placeNAME` varchar(50) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=10 ; -- -- Dumping data for table `place` -- INSERT INTO `place` (`ID`, `placeNAME`) VALUES (5, 'Bukidnon'), (6, 'Camiguin'), (7, 'Iligan City'), (8, 'Ozamis City'), (9, 'Cagayan de Oro City'); -- -------------------------------------------------------- -- -- Table structure for table `price_update` -- CREATE TABLE IF NOT EXISTS `price_update` ( `price_updateID` int(11) NOT NULL AUTO_INCREMENT, `date_start` date NOT NULL, `date_end` date NOT NULL, PRIMARY KEY (`price_updateID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=2 ; -- -- Dumping data for table `price_update` -- INSERT INTO `price_update` (`price_updateID`, `date_start`, `date_end`) VALUES (1, '2016-01-18', '2016-01-24'); -- -------------------------------------------------------- -- -- Stand-in structure for view `price_update_view` -- CREATE TABLE IF NOT EXISTS `price_update_view` ( `province_updateID` int(11) ,`productID` int(11) ,`name` char(50) ,`imageURL` varchar(100) ,`price` int(11) ,`unitofmeasure` varchar(50) ); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE IF NOT EXISTS `product` ( `productID` int(11) NOT NULL AUTO_INCREMENT, `name` char(50) NOT NULL, `description` varchar(50) NOT NULL, `imageURL` varchar(100) DEFAULT NULL, `categoryID` int(11) NOT NULL, PRIMARY KEY (`productID`), KEY `FK_product_category` (`categoryID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=24 ; -- -- Dumping data for table `product` -- INSERT INTO `product` (`productID`, `name`, `description`, `imageURL`, `categoryID`) VALUES (7, 'Rice, Well-milled', 'Bugas', 'http://leofamilyfarm.weebly.com/uploads/1/4/1/5/14150624/s672462095468863756_p14_i1_w782.jpeg', 13), (8, 'Rice, Regular-milled', 'Bugas', 'http://www.pk.all.biz/img/pk/catalog/8845.jpeg', 13), (9, 'Rice, Premium', 'Bugas', 'http://www.phoenixcommodities.com/Images/preminu-rice.jpg', 13), (10, 'NFA Rice', 'Bugas', 'http://metrocebu.com.ph/wp-content/uploads/2015/07/Rice.jpg', 13), (11, 'Yellow Corngrits', 'Mais', 'https://nuts.com/images/auto/801x534/assets/b062d815e404934c.jpg', 14), (12, 'White Corngrits', 'Mais', 'http://xawaash.com/wp-content/uploads/2012/01/Soor-furfur-3.jpg', 14), (13, 'Pork, Liempo', 'Liempo', 'http://www.maangchi.com/wp-content/uploads/2009/09/grilled-porkbelly_precut.jpg', 15), (14, 'Pork Lean Meat', 'Lean Meat', 'http://appforhealth.com/wp-content/uploads/2012/02/leanrawmeat-350x350.jpg', 14), (15, 'Beef Lean Meat', 'Baka', 'http://hcgnaturalweightloss.com/wp-content/uploads/2011/08/meats-that-make-you-thin.jpg', 15), (16, 'Dressed Chicken, Broiler', 'Manok', 'http://g03.s.alicdn.com/kf/UT8zhroXsXXXXagOFbXl/whole-dressed-frozen-chicken-direct-Suppliers-From.j', 15), (17, 'Chicken Egg', 'Itlog', 'http://www.freeimageslive.co.uk/image/view/8477/_original', 15), (18, 'Bangus', 'Bangus', 'http://filipinotimes.ae/wp-content/uploads/2014/04/185_bangus1.jpg', 16), (19, 'Galunggong', 'Galunggong', 'http://www.interaksyon.com/assets/images/articles/interphoto_1328324551.jpg', 16), (20, 'Tilapia', 'Tilapia', 'http://www.athifishfarmandhatchery.com/wp-content/uploads/2012/11/tilapia_feat.jpg', 16), (21, 'Alumahan', 'Alumahan', 'http://1.bp.blogspot.com/-fRRiTdLxMd0/Tox71PPS5HI/AAAAAAAAAFU/lcD5iFUPt5Y/s1600/Hasa-hasa+Kabayas.jp', 16), (22, 'Matangbaka', 'Matangbaka', 'http://www.marketmanila.com/images/aaafish4.JPG', 16), (23, 'Tamban', 'Tamban', 'http://cebudailynews.inquirer.net/files/2015/04/tamban-300x184.jpg', 16); -- -------------------------------------------------------- -- -- Stand-in structure for view `product_category_place_view` -- CREATE TABLE IF NOT EXISTS `product_category_place_view` ( `name` char(50) ,`description` varchar(50) ,`categoryNAME` varchar(50) ,`placeName` varchar(50) ); -- -------------------------------------------------------- -- -- Stand-in structure for view `product_view_category` -- CREATE TABLE IF NOT EXISTS `product_view_category` ( `categoryNAME` varchar(50) ,`productID` int(11) ,`name` char(50) ,`description` varchar(50) ,`imageURL` varchar(100) ); -- -------------------------------------------------------- -- -- Stand-in structure for view `province_market_view` -- CREATE TABLE IF NOT EXISTS `province_market_view` ( `marketNAME` varchar(50) ,`Address` varchar(50) ,`latitude` varchar(50) ,`longitude` varchar(50) ,`placeName` varchar(50) ); -- -------------------------------------------------------- -- -- Table structure for table `province_price_update` -- CREATE TABLE IF NOT EXISTS `province_price_update` ( `province_price_updateID` int(11) NOT NULL AUTO_INCREMENT, `province_updateID` int(11) DEFAULT NULL, `productID` int(11) NOT NULL, `price` int(11) NOT NULL, `unitofmeasure` int(11) NOT NULL, PRIMARY KEY (`province_price_updateID`), KEY `FK__province_update` (`province_updateID`), KEY `FK__product` (`productID`), KEY `FK__unitofmeasure` (`unitofmeasure`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=18 ; -- -- Dumping data for table `province_price_update` -- INSERT INTO `province_price_update` (`province_price_updateID`, `province_updateID`, `productID`, `price`, `unitofmeasure`) VALUES (1, 1, 7, 42, 2), (2, 1, 8, 40, 2), (3, 1, 9, 45, 2), (4, 1, 10, 32, 2), (5, 2, 11, 30, 2), (6, 2, 12, 31, 2), (7, 3, 13, 180, 2), (8, 3, 14, 190, 2), (9, 3, 15, 240, 2), (10, 3, 16, 130, 2), (11, 4, 17, 5, 3), (12, 5, 18, 130, 2), (13, 5, 19, 140, 2), (14, 5, 20, 100, 2), (15, 5, 21, 160, 2), (16, 5, 22, 160, 2), (17, 5, 23, 40, 2); -- -------------------------------------------------------- -- -- Stand-in structure for view `province_price_update_view` -- CREATE TABLE IF NOT EXISTS `province_price_update_view` ( `province_price_updateID` int(11) ,`name` char(50) ,`productID` int(11) ,`price` int(11) ,`unitofmeasure` varchar(50) ,`unitofmeasureID` int(11) ,`province_updateID` int(11) ); -- -------------------------------------------------------- -- -- Table structure for table `province_update` -- CREATE TABLE IF NOT EXISTS `province_update` ( `province_updateID` int(11) NOT NULL AUTO_INCREMENT, `date` date DEFAULT NULL, `status` varchar(50) NOT NULL DEFAULT 'Pending', `placeID` int(11) NOT NULL, `userID` int(11) DEFAULT NULL, PRIMARY KEY (`province_updateID`), KEY `FK__place` (`placeID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=6 ; -- -- Dumping data for table `province_update` -- INSERT INTO `province_update` (`province_updateID`, `date`, `status`, `placeID`, `userID`) VALUES (1, '2016-01-16', 'Uploaded', 5, NULL), (2, '2016-01-16', 'Uploaded', 6, NULL), (3, '2016-01-16', 'Uploaded', 7, NULL), (4, '2016-01-16', 'Uploaded', 8, NULL), (5, '2016-01-16', 'Uploaded', 9, NULL); -- -------------------------------------------------------- -- -- Stand-in structure for view `province_update_view` -- CREATE TABLE IF NOT EXISTS `province_update_view` ( `province_updateID` int(11) ,`date` date ,`status` varchar(50) ,`placeName` varchar(50) ); -- -------------------------------------------------------- -- -- Table structure for table `unitofmeasure` -- CREATE TABLE IF NOT EXISTS `unitofmeasure` ( `unitofmeasureID` int(11) NOT NULL AUTO_INCREMENT, `unitofmeasure` varchar(50) NOT NULL, PRIMARY KEY (`unitofmeasureID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=4 ; -- -- Dumping data for table `unitofmeasure` -- INSERT INTO `unitofmeasure` (`unitofmeasureID`, `unitofmeasure`) VALUES (2, 'Kilo'), (3, 'Piece'); -- -------------------------------------------------------- -- -- Table structure for table `upload_updates` -- CREATE TABLE IF NOT EXISTS `upload_updates` ( `upload_updatesID` int(11) NOT NULL AUTO_INCREMENT, `price_updateID` int(11) NOT NULL, `province_updateID` int(11) NOT NULL, PRIMARY KEY (`upload_updatesID`), KEY `FK_upload_updates_price_update` (`price_updateID`), KEY `FK_upload_updates_province_update` (`province_updateID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=6 ; -- -- Dumping data for table `upload_updates` -- INSERT INTO `upload_updates` (`upload_updatesID`, `price_updateID`, `province_updateID`) VALUES (1, 1, 1), (2, 1, 2), (3, 1, 3), (4, 1, 4), (5, 1, 5); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE IF NOT EXISTS `user` ( `userID` int(11) NOT NULL AUTO_INCREMENT, `userNAME` varchar(50) NOT NULL, `userPASSWORD` varchar(150) NOT NULL, `employeeName` varchar(50) NOT NULL, PRIMARY KEY (`userID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin2 AUTO_INCREMENT=10 ; -- -- Dumping data for table `user` -- INSERT INTO `user` (`userID`, `userNAME`, `userPASSWORD`, `employeeName`) VALUES (3, 'admin', '123456', '1'), (9, 'Chejei', 'oZtVRzRzeuo3udJ7+6YLdQA3pU/MT55U0CXUwD28zYpLuW42Z2FhEnt0vcKzu+9gFt5aw1ZvLUASrMfIXPMplw==', 'Chejei Vallecera'); -- -------------------------------------------------------- -- -- Structure for view `latestupdates_view` -- DROP TABLE IF EXISTS `latestupdates_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `latestupdates_view` AS select max(`upload_updates`.`upload_updatesID`) AS `latest` from `upload_updates`; -- -------------------------------------------------------- -- -- Structure for view `market_view` -- DROP TABLE IF EXISTS `market_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `market_view` AS select `market`.`marketID` AS `marketID`,`market`.`marketNAME` AS `marketNAME`,`market`.`Address` AS `Address`,`market`.`latitude` AS `latitude`,`market`.`longitude` AS `longitude`,`place`.`ID` AS `ID`,`place`.`placeNAME` AS `placeName` from (`place` join `market` on((`place`.`ID` = `market`.`placeID`))); -- -------------------------------------------------------- -- -- Structure for view `price_update_view` -- DROP TABLE IF EXISTS `price_update_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `price_update_view` AS select `province_update`.`province_updateID` AS `province_updateID`,`province_price_update`.`productID` AS `productID`,`product`.`name` AS `name`,`product`.`imageURL` AS `imageURL`,`province_price_update`.`price` AS `price`,`unitofmeasure`.`unitofmeasure` AS `unitofmeasure` from (`unitofmeasure` join (`province_update` join (`product` join `province_price_update` on((`product`.`productID` = `province_price_update`.`productID`))) on((`province_update`.`province_updateID` = `province_price_update`.`province_updateID`))) on((`unitofmeasure`.`unitofmeasureID` = `province_price_update`.`unitofmeasure`))); -- -------------------------------------------------------- -- -- Structure for view `product_category_place_view` -- DROP TABLE IF EXISTS `product_category_place_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `product_category_place_view` AS select `product`.`name` AS `name`,`product`.`description` AS `description`,`category`.`categoryNAME` AS `categoryNAME`,`place`.`placeNAME` AS `placeName` from (`place` join (`category` join `product` on((`category`.`categoryID` = `product`.`categoryID`)))); -- -------------------------------------------------------- -- -- Structure for view `product_view_category` -- DROP TABLE IF EXISTS `product_view_category`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `product_view_category` AS select `category`.`categoryNAME` AS `categoryNAME`,`product`.`productID` AS `productID`,`product`.`name` AS `name`,`product`.`description` AS `description`,`product`.`imageURL` AS `imageURL` from (`category` join `product` on((`category`.`categoryID` = `product`.`categoryID`))); -- -------------------------------------------------------- -- -- Structure for view `province_market_view` -- DROP TABLE IF EXISTS `province_market_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `province_market_view` AS select `market`.`marketNAME` AS `marketNAME`,`market`.`Address` AS `Address`,`market`.`latitude` AS `latitude`,`market`.`longitude` AS `longitude`,`place`.`placeNAME` AS `placeName` from (`place` join `market` on((`place`.`ID` = `market`.`placeID`))); -- -------------------------------------------------------- -- -- Structure for view `province_price_update_view` -- DROP TABLE IF EXISTS `province_price_update_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `province_price_update_view` AS select `province_price_update`.`province_price_updateID` AS `province_price_updateID`,`product`.`name` AS `name`,`product`.`productID` AS `productID`,`province_price_update`.`price` AS `price`,`unitofmeasure`.`unitofmeasure` AS `unitofmeasure`,`unitofmeasure`.`unitofmeasureID` AS `unitofmeasureID`,`province_price_update`.`province_updateID` AS `province_updateID` from (`unitofmeasure` join (`product` join `province_price_update` on((`product`.`productID` = `province_price_update`.`productID`))) on((`unitofmeasure`.`unitofmeasureID` = `province_price_update`.`unitofmeasure`))); -- -------------------------------------------------------- -- -- Structure for view `province_update_view` -- DROP TABLE IF EXISTS `province_update_view`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `province_update_view` AS select `province_update`.`province_updateID` AS `province_updateID`,`province_update`.`date` AS `date`,`province_update`.`status` AS `status`,`place`.`placeNAME` AS `placeName` from (`place` join `province_update` on((`place`.`ID` = `province_update`.`placeID`))); -- -- Constraints for dumped tables -- -- -- Constraints for table `market` -- ALTER TABLE `market` ADD CONSTRAINT `FK__city/province` FOREIGN KEY (`placeID`) REFERENCES `place` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `product` -- ALTER TABLE `product` ADD CONSTRAINT `FK_product_category` FOREIGN KEY (`categoryID`) REFERENCES `category` (`categoryID`) ON UPDATE CASCADE; -- -- Constraints for table `province_price_update` -- ALTER TABLE `province_price_update` ADD CONSTRAINT `FK__product` FOREIGN KEY (`productID`) REFERENCES `product` (`productID`), ADD CONSTRAINT `FK__province_update` FOREIGN KEY (`province_updateID`) REFERENCES `province_update` (`province_updateID`), ADD CONSTRAINT `FK__unitofmeasure` FOREIGN KEY (`unitofmeasure`) REFERENCES `unitofmeasure` (`unitofmeasureID`); -- -- Constraints for table `province_update` -- ALTER TABLE `province_update` ADD CONSTRAINT `FK__place` FOREIGN KEY (`placeID`) REFERENCES `place` (`ID`); -- -- Constraints for table `upload_updates` -- ALTER TABLE `upload_updates` ADD CONSTRAINT `FK_upload_updates_price_update` FOREIGN KEY (`price_updateID`) REFERENCES `price_update` (`price_updateID`), ADD CONSTRAINT `FK_upload_updates_province_update` FOREIGN KEY (`province_updateID`) REFERENCES `province_update` (`province_updateID`); /*!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
fc6090f1642c8d91f7fdfe2ce270219fd9972f33
SQL
jetmc/express-admin-examples
/fixtures/examples/insert.sql
UTF-8
9,610
2.90625
3
[ "MIT" ]
permissive
SET FOREIGN_KEY_CHECKS=0; -- One to Many truncate table `user`; truncate table `item`; truncate table `purchase`; insert into `user` set `firstname` = 'Jeff', `lastname` = 'Cox'; insert into `user` set `firstname` = 'Ann', `lastname` = 'Hart'; insert into `user` set `firstname` = 'Jack', `lastname` = 'Dean'; insert into `item` set `name` = 'coffee', `description` = ''; insert into `item` set `name` = 'tea', `description` = ''; insert into `item` set `name` = 'energy', `description` = ''; insert into `item` set `name` = 'cherries', `description` = ''; insert into `item` set `name` = 'chocolate', `description` = ''; insert into `purchase` set `item_id` = 1, `user_id` = 3, `cache` = 17.5, `date` = '2012-01-01'; insert into `purchase` set `item_id` = 2, `user_id` = 1, `cache` = 37.5, `date` = '2012-01-12'; insert into `purchase` set `item_id` = 1, `user_id` = 2, `cache` = 66.0, `date` = '2012-01-15'; insert into `purchase` set `item_id` = 4, `user_id` = 3, `cache` = 15.0, `date` = '2012-01-27'; insert into `purchase` set `item_id` = 1, `user_id` = 2, `cache` = 18.9, `date` = '2012-02-07'; insert into `purchase` set `item_id` = 2, `user_id` = 1, `cache` = 100, `date` = '2012-02-19'; insert into `purchase` set `item_id` = 4, `user_id` = 3, `cache` = 20.0, `date` = '2012-02-20'; insert into `purchase` set `item_id` = 2, `user_id` = 3, `cache` = 50.0, `date` = '2012-03-08'; insert into `purchase` set `item_id` = 3, `user_id` = 1, `cache` = 18.0, `date` = '2012-03-16'; insert into `purchase` set `item_id` = 5, `user_id` = 2, `cache` = 9.00, `date` = '2012-03-18'; insert into `purchase` set `item_id` = 2, `user_id` = 3, `cache` = 3.50, `date` = '2012-03-29'; insert into `purchase` set `item_id` = 5, `user_id` = 1, `cache` = 19.0, `date` = '2012-04-09'; insert into `purchase` set `item_id` = 4, `user_id` = 2, `cache` = 22.7, `date` = '2012-04-13'; insert into `purchase` set `item_id` = 3, `user_id` = 3, `cache` = 44.5, `date` = '2012-04-21'; insert into `purchase` set `item_id` = 1, `user_id` = 2, `cache` = 12.6, `date` = '2012-04-26'; insert into `purchase` set `item_id` = 2, `user_id` = 2, `cache` = 16.0, `date` = '2012-04-26'; insert into `purchase` set `item_id` = 2, `user_id` = 1, `cache` = 40.0, `date` = '2012-05-06'; insert into `purchase` set `item_id` = 3, `user_id` = 2, `cache` = 16.8, `date` = '2012-05-15'; insert into `purchase` set `item_id` = 4, `user_id` = 3, `cache` = 9.0, `date` = '2012-05-22'; insert into `purchase` set `item_id` = 2, `user_id` = 1, `cache` = 40.0, `date` = '2012-06-06'; insert into `purchase` set `item_id` = 3, `user_id` = 2, `cache` = 16.0, `date` = '2012-06-15'; insert into `purchase` set `item_id` = 5, `user_id` = 3, `cache` = 19.0, `date` = '2012-06-22'; insert into `purchase` set `item_id` = 3, `user_id` = 3, `cache` = 40.0, `date` = '2012-06-24'; insert into `purchase` set `item_id` = 1, `user_id` = 3, `cache` = 70.0, `date` = '2012-06-27'; -- Many to Many truncate table `recipe_type`; truncate table `recipe_method`; truncate table `recipe`; truncate table `recipe_has_recipe_types`; truncate table `recipe_has_recipe_methods`; insert into `recipe_type` set `title` = 'type1'; insert into `recipe_type` set `title` = 'type2'; insert into `recipe_type` set `title` = 'type3'; insert into `recipe_type` set `title` = 'type4'; insert into `recipe_type` set `title` = 'type5'; insert into `recipe_method` set `title` = 'method1'; insert into `recipe_method` set `title` = 'method2'; insert into `recipe_method` set `title` = 'method3'; insert into `recipe_method` set `title` = 'method4'; insert into `recipe_method` set `title` = 'method5'; insert into `recipe` set `name` = 'recipe 1'; insert into `recipe` set `name` = 'recipe 2'; insert into `recipe` set `name` = 'recipe 3'; insert into `recipe` set `name` = 'recipe 4'; insert into `recipe` set `name` = 'recipe 5'; insert into `recipe` set `name` = 'recipe 6'; insert into `recipe` set `name` = 'recipe 7'; insert into `recipe` set `name` = 'recipe 8'; insert into `recipe` set `name` = 'recipe 9'; insert into `recipe_has_recipe_types` set `recipe_id` = 1, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 1, `recipe_type_id` = 4; insert into `recipe_has_recipe_types` set `recipe_id` = 1, `recipe_type_id` = 5; insert into `recipe_has_recipe_types` set `recipe_id` = 2, `recipe_type_id` = 3; insert into `recipe_has_recipe_types` set `recipe_id` = 2, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 2, `recipe_type_id` = 1; insert into `recipe_has_recipe_types` set `recipe_id` = 3, `recipe_type_id` = 1; insert into `recipe_has_recipe_types` set `recipe_id` = 3, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 5, `recipe_type_id` = 4; insert into `recipe_has_recipe_types` set `recipe_id` = 6, `recipe_type_id` = 5; insert into `recipe_has_recipe_types` set `recipe_id` = 6, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 7, `recipe_type_id` = 4; insert into `recipe_has_recipe_types` set `recipe_id` = 7, `recipe_type_id` = 1; insert into `recipe_has_recipe_types` set `recipe_id` = 7, `recipe_type_id` = 3; insert into `recipe_has_recipe_types` set `recipe_id` = 8, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 9, `recipe_type_id` = 2; insert into `recipe_has_recipe_types` set `recipe_id` = 9, `recipe_type_id` = 4; insert into `recipe_has_recipe_methods` set `recipe_id` = 1, `recipe_method_id` = 2; insert into `recipe_has_recipe_methods` set `recipe_id` = 1, `recipe_method_id` = 4; insert into `recipe_has_recipe_methods` set `recipe_id` = 2, `recipe_method_id` = 5; insert into `recipe_has_recipe_methods` set `recipe_id` = 4, `recipe_method_id` = 3; insert into `recipe_has_recipe_methods` set `recipe_id` = 5, `recipe_method_id` = 1; insert into `recipe_has_recipe_methods` set `recipe_id` = 5, `recipe_method_id` = 3; insert into `recipe_has_recipe_methods` set `recipe_id` = 5, `recipe_method_id` = 5; insert into `recipe_has_recipe_methods` set `recipe_id` = 6, `recipe_method_id` = 3; insert into `recipe_has_recipe_methods` set `recipe_id` = 6, `recipe_method_id` = 4; insert into `recipe_has_recipe_methods` set `recipe_id` = 7, `recipe_method_id` = 4; insert into `recipe_has_recipe_methods` set `recipe_id` = 8, `recipe_method_id` = 1; insert into `recipe_has_recipe_methods` set `recipe_id` = 8, `recipe_method_id` = 2; insert into `recipe_has_recipe_methods` set `recipe_id` = 8, `recipe_method_id` = 3; insert into `recipe_has_recipe_methods` set `recipe_id` = 9, `recipe_method_id` = 1; insert into `recipe_has_recipe_methods` set `recipe_id` = 9, `recipe_method_id` = 2; insert into `recipe_has_recipe_methods` set `recipe_id` = 9, `recipe_method_id` = 4; insert into `recipe_has_recipe_methods` set `recipe_id` = 9, `recipe_method_id` = 5; -- One to One truncate table `address`; truncate table `phone`; insert into `address` set `user_id` = 1, `street` = 'South Lake'; insert into `address` set `user_id` = 2, `street` = 'Steep Hill'; insert into `address` set `user_id` = 3, `street` = 'Pine Woods'; insert into `phone` set `user_id` = 2, `mobile` = '123-555-5555'; insert into `phone` set `user_id` = 3, `mobile` = '456-555-5555'; -- Many to One truncate table `car`; truncate table `repair`; truncate table `driver`; insert into `car` set `model` = 'Lamborghini Diablo'; insert into `car` set `model` = 'Subaru Impreza'; insert into `car` set `model` = 'Trabant'; insert into `repair` set `car_id` = 1, `date` = '2013-01-13'; insert into `repair` set `car_id` = 1, `date` = '2013-04-07'; insert into `repair` set `car_id` = 2, `date` = '2013-02-15'; insert into `repair` set `car_id` = 2, `date` = '2013-05-18'; insert into `repair` set `car_id` = 3, `date` = '2013-03-12'; insert into `repair` set `car_id` = 3, `date` = '2013-01-02'; insert into `driver` set `car_id` = 1, `name` = 'John'; insert into `driver` set `car_id` = 1, `name` = 'Ross'; insert into `driver` set `car_id` = 2, `name` = 'Ann'; insert into `driver` set `car_id` = 2, `name` = 'Patrick'; insert into `driver` set `car_id` = 3, `name` = 'David'; insert into `driver` set `car_id` = 3, `name` = 'Rossie'; -- Controls truncate table `controls_list`; truncate table `controls_has_controls_group`; truncate table `controls`; truncate table `controls_choice`; truncate table `controls_group`; insert into `controls_choice` set `name` = 'choice1'; insert into `controls_choice` set `name` = 'choice2'; insert into `controls_choice` set `name` = 'choice3'; insert into `controls_group` set `name` = 'group1'; insert into `controls_group` set `name` = 'group2'; insert into `controls_group` set `name` = 'group3'; insert into `controls_list` set `title` = 'title1'; insert into `controls_list` set `title` = 'title2'; insert into `controls_list` set `title` = 'title3'; insert into `controls` (`controls_list_id`,`controls_choice_id`) values (1,2); insert into `controls` (`controls_list_id`,`controls_choice_id`) values (2,1); insert into `controls` (`controls_list_id`,`controls_choice_id`) values (3,3); insert into `controls_has_controls_group` (`controls_id`,`controls_group_id`) values (1,2); insert into `controls_has_controls_group` (`controls_id`,`controls_group_id`) values (1,3); insert into `controls_has_controls_group` (`controls_id`,`controls_group_id`) values (2,3); insert into `controls_has_controls_group` (`controls_id`,`controls_group_id`) values (3,1); insert into `controls_has_controls_group` (`controls_id`,`controls_group_id`) values (3,3); SET FOREIGN_KEY_CHECKS=1;
true
2b93761aa13376381c4d0a3b261f32a2fcaee8c5
SQL
Joe123123/BootcampX
/2_queries_joins/1_students_total_assignment_duration.sql
UTF-8
143
3.09375
3
[]
no_license
SELECT SUM(duration) AS total_duration FROM students JOIN assignment_submissions ON students.id = student_id WHERE students.name = 'Ibrahim Schimmel'
true
5988fdc03973525ff3e5af1db7a38a635e4a9642
SQL
Menziesprf/codeclan_homework_PeterM
/week_03/day_03/hw_lab_day3.sql
UTF-8
3,678
4.34375
4
[]
no_license
--MVP --Q1 SELECT local_account_no, iban FROM pay_details WHERE local_account_no IS NULL AND iban IS NULL; -- NO! --Q2 SELECT first_name, last_name, country FROM employees ORDER BY country NULLS LAST, last_name NULLS LAST; --Q3 SELECT * FROM employees ORDER BY salary DESC NULLS LAST LIMIT 10; --Q4 SELECT first_name, last_name, salary FROM employees WHERE country = 'Hungary' ORDER BY salary ASC NULLS LAST LIMIT 1; --Q5 SELECT * FROM employees WHERE email LIKE '%@yahoo%'; --Q6 SELECT COUNT(id), pension_enrol FROM employees GROUP BY pension_enrol; --Q7 SELECT id, first_name, last_name, salary FROM employees WHERE department = 'Engineering' AND fte_hours = 1.0 ORDER BY salary DESC NULLS LAST LIMIT 1; -- or SELECT MAX(salary) FROM employees WHERE department = 'Engineering' AND fte_hours = 1.0; -- Q8 SELECT country, Count(id) AS number_employees, AVG(salary) FROM employees GROUP BY country HAVING COUNT(id) > 30 ORDER BY AVG(salary)DESC; -- Q9 SELECT id, first_name, last_name, fte_hours, salary, (fte_hours * salary) AS effective_salary FROM employees; -- Q10 SELECT e.first_name, e.last_name FROM employees AS e LEFT JOIN pay_details AS pd ON e.pay_detail_id = pd.id WHERE local_tax_code IS NULL; -- Q11 SELECT e.id, e.department, (48 * 35 * CAST(charge_cost AS INT) - salary) * fte_hours AS expected_profit FROM employees AS e LEFT JOIN teams AS t ON e.team_id = t.id ORDER BY expected_profit DESC NULLS LAST; -- Q12 WITH blobs(department, avg_salary, avg_fte_hours) AS ( SELECT department, AVG(salary) AS avg_salary, AVG(fte_hours) AS avg_fte_hours FROM employees GROUP BY department ORDER BY COUNT(id) DESC NULLS LAST LIMIT 1 ) SELECT e.id, e.first_name, e.last_name, e.salary, e.fte_hours, (e.salary / b.avg_salary) AS salary_ratio, (e.fte_hours / b.avg_fte_hours) AS hours_ratio FROM employees AS e CROSS JOIN blobs AS b WHERE e.department = b.department; ----- alternate way w/ INNER JOIN WITH biggest_dept(name, avg_salary, avg_fte_hours) AS ( SELECT department, AVG(salary), AVG(fte_hours) FROM employees GROUP BY department ORDER BY COUNT(id) DESC NULLS LAST LIMIT 1 ) SELECT * FROM employees AS e INNER JOIN biggest_dept AS db ON e.department = db.name; ------- Alternate way w/ sub queries SELECT id, first_name, last_name, salary, fte_hours, department, salary/AVG(salary) OVER () AS ratio_avg_salary, fte_hours/AVG(fte_hours) OVER () AS ratio_fte_hours FROM employees WHERE department = ( SELECT department FROM employees GROUP BY department ORDER BY COUNT(id) DESC LIMIT 1); --Extension --Q1 SELECT first_name, COUNT(id) AS num_with_name FROM employees WHERE first_name IS NOT NULL GROUP BY first_name HAVING COUNT(id) > 1 ORDER BY COUNT(id) DESC, first_name ASC; --Q2 SELECT COUNT(id), COALESCE(CAST(pension_enrol AS VARCHAR), NULL, 'unknown') AS enrolement_status FROM employees GROUP BY pension_enrol -- Q3 SELECT e.first_name, e.last_name, e.email, e.start_date, c.name AS committee_name FROM (employees_committees AS ec LEFT JOIN committees AS c ON ec.committee_id = c.id) LEFT JOIN employees AS e ON ec.employee_id = e.id WHERE c.name = 'Equality and Diversity'; -- Q4 WITH blobs(id, salary_class) AS ( SELECT id, CASE WHEN salary < 40000 THEN 'low' WHEN salary >= 40000 THEN 'high' WHEN salary IS NULL THEN 'none' END AS salary_class FROM employees ) SELECT COUNT(DISTINCT(e.id)), b.salary_class FROM (employees AS e LEFT JOIN blobs AS b ON e.id = b.id) RIGHT JOIN employees_committees AS ec ON e.id = ec.employee_id GROUP BY b.salary_class;
true
32f050be45a0c3392a17d84cb8a0b502edc16e42
SQL
asyraf795/legacy-movieaddits
/SQLDump/movieaddicts_bookings.sql
UTF-8
2,515
2.765625
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64) -- -- Host: 127.0.0.1 Database: movieaddicts -- ------------------------------------------------------ -- Server version 5.7.15-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 `bookings` -- DROP TABLE IF EXISTS `bookings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `bookings` ( `bookingid` int(11) NOT NULL AUTO_INCREMENT, `userid` varchar(45) DEFAULT NULL, `movieid` int(11) DEFAULT NULL, `bookingdate` date DEFAULT NULL, `bookingflag` varchar(45) DEFAULT NULL, `moviename` varchar(45) DEFAULT NULL, PRIMARY KEY (`bookingid`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `bookings` -- LOCK TABLES `bookings` WRITE; /*!40000 ALTER TABLE `bookings` DISABLE KEYS */; INSERT INTO `bookings` VALUES (1,'beta.asyraf95@gmail.com',2,'2017-07-07','Pick Up','Dont Breathe'),(2,'beta.asyraf95@gmail.com',5,'2018-01-23','pick up','The Flash'),(3,'beta.asyraf95@gmail.com',1,'2019-01-23','pick up','Avatar'),(5,'beta.asyraf95@gmail.com',1,'2019-01-23','pick up','Petes Dragon'),(6,'beta.asyraf95@gmail.com',2,'2020-01-23','Overdue','Dont Breathe'),(7,'',3,NULL,'pick up','Snowden'),(8,'beta.asyraf95@gmail.com',1,'2018-01-23','pick up','Pete\'s Dragon'),(9,'juliette',2,NULL,'pick up','Don\'t Breathe'); /*!40000 ALTER TABLE `bookings` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-03-05 13:19:47
true
107bf04dba65454644e7135b6d50f5f7ca9d630b
SQL
CRISTIANLOPEZ16/Documentacion
/latinscorts2.sql
UTF-8
19,111
3.390625
3
[]
no_license
CREATE TABLE `pais` ( `id_pais` int NOT NULL AUTO_INCREMENT COMMENT 'Es la llave que identifica el pais ', `Nombre` varchar(70) NOT NULL COMMENT 'Este es el nombre del pais ', PRIMARY KEY (`id_pais`) ); CREATE TABLE `departamento` ( `id_departamento` int NOT NULL AUTO_INCREMENT, `id_pais` int NOT NULL, `nombre` varchar(250) CHARACTER SET utf8 COLLATE utf8_spanish2_ci NULL DEFAULT NULL COMMENT 'Nombre del departamento', PRIMARY KEY (`id_departamento`, `id_pais`) ); CREATE TABLE `ciudad` ( `id_ciudad` int NOT NULL AUTO_INCREMENT, `id_departamento` int NOT NULL, `id_pais` int NOT NULL, PRIMARY KEY (`id_ciudad`, `id_departamento`, `id_pais`) ); CREATE TABLE `usuario` ( `id_usuario` int NOT NULL AUTO_INCREMENT, `nickname` varchar(150) NOT NULL, `correo` varchar(150) NOT NULL, `fecha_registro` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, `id_ciudad` int NULL, `tipo` varchar(100) NOT NULL, `ip_usuario` varchar(250) NULL, PRIMARY KEY (`id_usuario`) ); CREATE TABLE `catador` ( `id_usuario_catador` int NOT NULL, `cantidad_catadas` int(100) NULL, PRIMARY KEY (`id_usuario_catador`) ); CREATE TABLE `tipo_usuario` ( `nombre` varchar(255) NOT NULL COMMENT 'Nombre del tipo de usuario al que corresponde', `descripcion` varchar(255) NOT NULL, PRIMARY KEY (`nombre`) ); CREATE TABLE `anunciante` ( `id_usuario_anunciante` int NOT NULL, `telefono` numeric(10,0) NOT NULL, `edad` int(4) NULL, `descriptcion_perfil` longtext NULL COMMENT 'descripcion del perfil', `foto_perfil` varchar(250) CHARACTER SET utf8 NULL COMMENT 'Esta sera la foto que tomaremos como perfil', `sexo` int NULL, `verificado` binary(1) NULL DEFAULT 0, `valoracion` double(5,2) NULL, PRIMARY KEY (`id_usuario_anunciante`) ); CREATE TABLE `hotel` ( `id_hotel_usuario` int NOT NULL, `nombre` varchar(200) NOT NULL, `direccion` varchar(200) CHARACTER SET utf8 NOT NULL, `telefono` numeric(11,0) NOT NULL, PRIMARY KEY (`id_hotel_usuario`) ); CREATE TABLE `moderador` ( `id_moderador_usuario` int NOT NULL, `nombre` varchar(100) NULL, `nivel` int NOT NULL, `telefono` int(11) NOT NULL, `documento` int(20) NOT NULL, `direccion` varchar(200) NOT NULL, PRIMARY KEY (`id_moderador_usuario`) ); CREATE TABLE `sexo` ( `id_sexo` int NOT NULL AUTO_INCREMENT, `descripcion` varchar(50) NOT NULL COMMENT 'Aqui se indicara el nombre del sexo', PRIMARY KEY (`id_sexo`) ); CREATE TABLE `categoria` ( `id_categoria` int NOT NULL AUTO_INCREMENT, `descripcion` varchar(200) NOT NULL, PRIMARY KEY (`id_categoria`) ); CREATE TABLE `nivel` ( `id_nivel` int NOT NULL AUTO_INCREMENT, `descripcion` varchar(50) NOT NULL, PRIMARY KEY (`id_nivel`) ); CREATE TABLE `galeria` ( `id_galeria_usuario` int NOT NULL, `id_galeria` int NOT NULL AUTO_INCREMENT, `url_carpeta` varchar(0) NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id_galeria`) ); CREATE TABLE `anuncio` ( `id_anuncio` int NOT NULL AUTO_INCREMENT, `id_anuncio_usuario` int NOT NULL, `telefono` numeric(11,0) NOT NULL, `titulo` varchar(80) NOT NULL, `descripcion` varchar(100) NULL, `texto` longtext NULL, `fecha_creacion` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `fecha_actualizacion` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `estado` int NOT NULL, `tipo_anuncio` int NOT NULL, `url_marco` varchar(250) NULL, `categoria` int NULL, `packete_descripcion` int NULL, `url_web` varchar(200) NULL, PRIMARY KEY (`id_anuncio`, `id_anuncio_usuario`) ); CREATE TABLE `foto` ( `id_foto` int NOT NULL AUTO_INCREMENT, `id_foto_anuncio` int NULL, `url` varchar(250) NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id_foto`) ); CREATE TABLE `paquete_descripcion` ( `id_paquete` int NOT NULL AUTO_INCREMENT, `titulo` varchar(80) NOT NULL, `descripcion` varchar(100) NULL, `texto` longtext NOT NULL, PRIMARY KEY (`id_paquete`) ); CREATE TABLE `factura` ( `id_facura` int NOT NULL AUTO_INCREMENT, `id_factura_anuncio` int NOT NULL, `id_factura_usuario` int NOT NULL, `fecha_facturacion` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `pago_verificado` binary(0) NULL, `tipo_tipoanuncio_factura` int NOT NULL, PRIMARY KEY (`id_facura`) ); CREATE TABLE `tipo_anuncioTOP` ( `id_tipo` int NOT NULL AUTO_INCREMENT, `nombre` varchar(100) NOT NULL, `descripcion` varchar(250) NOT NULL, PRIMARY KEY (`id_tipo`) ); CREATE TABLE `estadisticas` ( `id_estadistica` int NOT NULL AUTO_INCREMENT, `id_anuncio` int NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `numero_listada` int(100) NOT NULL, `numero_llamado_lista` int(100) NULL, `numero_llamado_expandidas` int(100) NULL, `numero_expandidas` int(100) NULL, `numero_whatsapp1` int(100) NULL, `numero_whatsapp2` int NULL, PRIMARY KEY (`id_estadistica`) ); CREATE TABLE `historico_estadistica` ( `id_estadistica` int NOT NULL, `id_anuncio` int NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `numero_listada` int(100) NOT NULL, `numero_llamado_lista` int(100) NULL, `numero_llamado_expandidas` int(100) NULL, `numero_expandidas` int(100) NULL, `numero_whatsapp1` int(100) NULL, `numero_whatsapp2` int NULL, PRIMARY KEY (`id_estadistica`) ); CREATE TABLE `estado` ( `id` int NOT NULL AUTO_INCREMENT, `nombre` varchar(0) NOT NULL, `descripcion` varchar(0) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `blacklist` ( `ip` varchar(250) NULL, `telefono` varchar(250) NULL, `correo` varchar(250) NULL, `usuario` int NOT NULL, PRIMARY KEY (`usuario`) ); CREATE TABLE `redes_sociales` ( `id` int NOT NULL AUTO_INCREMENT, `id_redesociales_usuario` int NOT NULL, `nombre` varchar(100) NOT NULL, `url` varchar(250) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `resenas` ( `id_articulo` int NOT NULL AUTO_INCREMENT, `id_articulo_usuario` int NOT NULL, `id_articulo_digido` int NOT NULL, `descripcion` longtext NOT NULL, `fecha_realizada` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `estado` int NOT NULL, PRIMARY KEY (`id_articulo`) ); CREATE TABLE `comentario` ( `id_comentario` int NOT NULL AUTO_INCREMENT, `texto` longtext NOT NULL, `id_comentario_escritor` int NOT NULL, `id_comentario_anuncio` int NULL, `id_comentario_habitacion` int NULL, `id_comentario_resena` int NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `estado` int NOT NULL, PRIMARY KEY (`id_comentario`) ); CREATE TABLE `respuesta` ( `id_comentario` int NOT NULL, `id_comentario_respuesta` int NOT NULL, `id_escritor` int NOT NULL, PRIMARY KEY (`id_comentario`) ); CREATE TABLE `habitacion` ( `id_hotel` int NOT NULL, `id_habitacion` int NOT NULL AUTO_INCREMENT, `nombre` varchar(100) NOT NULL, `descripcion` varchar(200) NOT NULL, `cupo_max` int NOT NULL, `precio` int NOT NULL, `estado` int NULL, PRIMARY KEY (`id_habitacion`, `id_hotel`) ); CREATE TABLE `servicio_adicional` ( `id_servicio` int NOT NULL AUTO_INCREMENT, `nombre` varchar(100) NOT NULL, `descripcion` varchar(250) NULL, `precio` int(100) NULL, PRIMARY KEY (`id_servicio`) ); CREATE TABLE `reservacion` ( `id_reservacion` int NOT NULL AUTO_INCREMENT, `id_habitacion` int NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `fecha_reserva` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `pago` int NOT NULL DEFAULT 0, PRIMARY KEY (`id_reservacion`, `id_habitacion`) ); CREATE TABLE `factura_hotel` ( `id_hotel` int NOT NULL, `id_factura` int NOT NULL AUTO_INCREMENT, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `pago` int NULL, PRIMARY KEY (`id_factura`) ); CREATE TABLE `tags` ( `id_tag` int NOT NULL AUTO_INCREMENT, `nombre` varchar(100) NOT NULL, `descipcion` varchar(200) NOT NULL, `tipo` varchar(255) NOT NULL, PRIMARY KEY (`id_tag`) ); CREATE TABLE `anuncio_vs_tag` ( `id_referencia` int NOT NULL, `id_anuncio` int NOT NULL, `id_tag` int NOT NULL, PRIMARY KEY (`id_referencia`, `id_anuncio`, `id_tag`) ); CREATE TABLE `habitacion_vs_tag` ( `id_referencia` int NOT NULL, `id_habitacion` int NOT NULL, `id_tag` int NOT NULL, PRIMARY KEY (`id_referencia`, `id_habitacion`, `id_tag`) ); CREATE TABLE `habitacion_vs_servicio` ( `id_servicio` int NOT NULL, `id_habitacion` int NOT NULL, PRIMARY KEY (`id_servicio`, `id_habitacion`) ); CREATE TABLE `estado_habitacion` ( `id_estado` int NOT NULL AUTO_INCREMENT, `nombre` varchar(100) NOT NULL, PRIMARY KEY (`id_estado`) ); CREATE TABLE `cambo_nivel` ( `id_moderador_cambio` int NOT NULL, `id_moderado_nivel-cambio` int NOT NULL, `descripcion` varchar(200) NOT NULL, `fecha_realizacion` datetime NULL ON UPDATE CURRENT_TIMESTAMP, `nivel_nuevo` int NOT NULL, `nivel_anterior` int NOT NULL, PRIMARY KEY (`id_moderador_cambio`, `id_moderado_nivel-cambio`) ); CREATE TABLE `tipo_moderacion` ( `id_moderacion` int NOT NULL, `descripcion` varchar(100) NOT NULL, `fecha` datetime NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id_moderacion`) ); CREATE TABLE `moderacion` ( `id_moderador` int NOT NULL, `fecha` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP, `tipo_moderacion` int NOT NULL, `descripcion` varchar(200) NOT NULL, `moderacion_id-anuncio` int NULL, `moderacion_id-comentario` int NULL, `moderacion_id-resena` int NULL ); ALTER TABLE `departamento` ADD CONSTRAINT `id_pais` FOREIGN KEY (`id_pais`) REFERENCES `pais` (`id_pais`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `ciudad` ADD CONSTRAINT `fk_departamento` FOREIGN KEY (`id_departamento`) REFERENCES `departamento` (`id_departamento`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `usuario` ADD CONSTRAINT `fk_usuario_ciudad` FOREIGN KEY (`id_ciudad`) REFERENCES `ciudad` (`id_ciudad`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `usuario` ADD CONSTRAINT `fk_usuario_tipo` FOREIGN KEY (`tipo`) REFERENCES `tipo_usuario` (`nombre`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `catador` ADD CONSTRAINT `fk_catador_usuario` FOREIGN KEY (`id_usuario_catador`) REFERENCES `usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `anunciante` ADD CONSTRAINT `fk_anunciante_usuario` FOREIGN KEY (`id_usuario_anunciante`) REFERENCES `usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `hotel` ADD CONSTRAINT `fk_hotel_usuario` FOREIGN KEY (`id_hotel_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `moderador` ADD CONSTRAINT `fk_moderado_usuario` FOREIGN KEY (`id_moderador_usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `anunciante` ADD CONSTRAINT `fk_anunciante_sexo` FOREIGN KEY (`sexo`) REFERENCES `sexo` (`id_sexo`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `moderador` ADD CONSTRAINT `fk_moderador_nivel` FOREIGN KEY (`nivel`) REFERENCES `nivel` (`id_nivel`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `galeria` ADD CONSTRAINT `fk_galeria_usuario` FOREIGN KEY (`id_galeria_usuario`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `anuncio` ADD CONSTRAINT `fk_anuncio_anunciante` FOREIGN KEY (`id_anuncio_usuario`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `anuncio` ADD CONSTRAINT `fk_anuncio_categori` FOREIGN KEY (`categoria`) REFERENCES `categoria` (`id_categoria`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `foto` ADD CONSTRAINT `fk_foto_anuncio` FOREIGN KEY (`id_foto_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `factura` ADD CONSTRAINT `fk_factura_id-usuario` FOREIGN KEY (`id_factura_usuario`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `factura` ADD CONSTRAINT `fk_factura_anuncio` FOREIGN KEY (`id_factura_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `anuncio` ADD CONSTRAINT `fk_anuncio_tipoanuncio` FOREIGN KEY (`tipo_anuncio`) REFERENCES `tipo_anuncioTOP` (`id_tipo`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `factura` ADD CONSTRAINT `fk_factura_tipoanuncio` FOREIGN KEY (`tipo_tipoanuncio_factura`) REFERENCES `tipo_anuncioTOP` (`id_tipo`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `estadisticas` ADD CONSTRAINT `fk_estadistica_anuncio` FOREIGN KEY (`id_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `historico_estadistica` ADD CONSTRAINT `fk_historicoestadisticas_anuncio` FOREIGN KEY (`id_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `anuncio` ADD CONSTRAINT `fk_anuncio_paquete` FOREIGN KEY (`packete_descripcion`) REFERENCES `paquete_descripcion` (`id_paquete`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `anuncio` ADD CONSTRAINT `fk_anuncio_estado` FOREIGN KEY (`estado`) REFERENCES `estado` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `redes_sociales` ADD CONSTRAINT `fk_redessociales_usuario` FOREIGN KEY (`id_redesociales_usuario`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE NO ACTION ON UPDATE CASCADE; ALTER TABLE `resenas` ADD CONSTRAINT `fk_articulo_usuario` FOREIGN KEY (`id_articulo_usuario`) REFERENCES `catador` (`id_usuario_catador`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `resenas` ADD CONSTRAINT `fk_articulo_anunciante` FOREIGN KEY (`id_articulo_digido`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_anunciante` FOREIGN KEY (`id_comentario_escritor`) REFERENCES `anunciante` (`id_usuario_anunciante`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_catador` FOREIGN KEY (`id_comentario_escritor`) REFERENCES `catador` (`id_usuario_catador`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_anuncio` FOREIGN KEY (`id_comentario_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `resenas` ADD CONSTRAINT `fk_articulo_hotel` FOREIGN KEY (`id_articulo_digido`) REFERENCES `hotel` (`id_hotel_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_resena` FOREIGN KEY (`id_comentario_resena`) REFERENCES `resenas` (`id_articulo`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_estado` FOREIGN KEY (`estado`) REFERENCES `estado` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `resenas` ADD CONSTRAINT `fk_articulo_estado` FOREIGN KEY (`estado`) REFERENCES `estado` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion` ADD CONSTRAINT `fk_hatibacion_hotel` FOREIGN KEY (`id_hotel`) REFERENCES `hotel` (`id_hotel_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `tags` ADD CONSTRAINT `fk_tag_tipo` FOREIGN KEY (`tipo`) REFERENCES `tipo_usuario` (`nombre`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `anuncio_vs_tag` ADD CONSTRAINT `fk_anuncio-vs-tag_anuncio` FOREIGN KEY (`id_anuncio`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `anuncio_vs_tag` ADD CONSTRAINT `fk_anuncio-vs-tag_tag` FOREIGN KEY (`id_tag`) REFERENCES `tags` (`id_tag`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion_vs_tag` ADD CONSTRAINT `fk_habitacion-vs-tag_habitacion` FOREIGN KEY (`id_habitacion`) REFERENCES `habitacion` (`id_hotel`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion_vs_tag` ADD CONSTRAINT `fk_habitacion-vs-tag_tag` FOREIGN KEY (`id_tag`) REFERENCES `tags` (`id_tag`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `reservacion` ADD CONSTRAINT `fk_reserva_habitacion` FOREIGN KEY (`id_habitacion`) REFERENCES `habitacion` (`id_habitacion`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion_vs_servicio` ADD CONSTRAINT `fk_habitacion` FOREIGN KEY (`id_habitacion`) REFERENCES `habitacion` (`id_habitacion`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion_vs_servicio` ADD CONSTRAINT `fk_servicio` FOREIGN KEY (`id_servicio`) REFERENCES `servicio_adicional` (`id_servicio`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `habitacion` ADD CONSTRAINT `fk_habitacion_estado` FOREIGN KEY (`estado`) REFERENCES `estado_habitacion` (`id_estado`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `factura_hotel` ADD CONSTRAINT `fk_hotel` FOREIGN KEY (`id_hotel`) REFERENCES `hotel` (`id_hotel_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `respuesta` ADD CONSTRAINT `fk_respuesta_comentario` FOREIGN KEY (`id_comentario`) REFERENCES `comentario` (`id_comentario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `respuesta` ADD CONSTRAINT `fk_respuesta_id-escritor` FOREIGN KEY (`id_escritor`) REFERENCES `comentario` (`id_comentario_escritor`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `comentario` ADD CONSTRAINT `fk_comentario_habitacion` FOREIGN KEY (`id_comentario_habitacion`) REFERENCES `habitacion` (`id_habitacion`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `cambo_nivel` ADD CONSTRAINT `fk_cambio-nivel_cambio` FOREIGN KEY (`nivel_nuevo`) REFERENCES `nivel` (`id_nivel`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `cambo_nivel` ADD CONSTRAINT `fk_cambio-nivel_anterior` FOREIGN KEY (`nivel_anterior`) REFERENCES `nivel` (`id_nivel`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `cambo_nivel` ADD CONSTRAINT `fl_cambio-nivel_moderado-hizo-cambio` FOREIGN KEY (`id_moderador_cambio`) REFERENCES `moderador` (`id_moderador_usuario`) ON DELETE RESTRICT ON UPDATE RESTRICT; ALTER TABLE `cambo_nivel` ADD CONSTRAINT `fk_cambio-nivel_moderador_cambiado` FOREIGN KEY (`id_moderado_nivel-cambio`) REFERENCES `moderador` (`id_moderador_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `blacklist` ADD CONSTRAINT `fk_ip_usuario` FOREIGN KEY (`usuario`) REFERENCES `usuario` (`id_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `moderacion` ADD CONSTRAINT `fk_moderacion_moderador` FOREIGN KEY (`id_moderador`) REFERENCES `moderador` (`id_moderador_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `moderacion` ADD CONSTRAINT `fk_moderacion_tipo` FOREIGN KEY (`tipo_moderacion`) REFERENCES `tipo_moderacion` (`id_moderacion`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `moderacion` ADD CONSTRAINT `fk_moderacion_id-resena` FOREIGN KEY (`moderacion_id-resena`) REFERENCES `resenas` (`id_articulo`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `moderacion` ADD CONSTRAINT `fk_moderacion_id-comentario` FOREIGN KEY (`moderacion_id-comentario`) REFERENCES `comentario` (`id_comentario`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `moderacion` ADD CONSTRAINT `fk_moderacion_id-anuncio` FOREIGN KEY (`id_moderador`) REFERENCES `anuncio` (`id_anuncio`) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `galeria` ADD CONSTRAINT `fk_galeria_hotel` FOREIGN KEY (`id_galeria_usuario`) REFERENCES `hotel` (`id_hotel_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE;
true
cedfe2fdb4d8b3e7ac0173bcea203361d4f72fad
SQL
hattallipuneet/hibernate-basics
/sql_scripts/value_type_mapping_script/hb_learning_tracker.sql
UTF-8
2,976
3.609375
4
[]
no_license
CREATE DATABASE IF NOT EXISTS `hb_learning_tracker`; USE `hb_learning_tracker`; -- -- Used for mapping Set collection -- Table structure for tables `student` and `image` -- DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `image`; CREATE TABLE `image` ( `student_id` int(11) NOT NULL, `file_name` varchar(45) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Used for mapping List collection -- Table structure for tables `professor` and `course` -- DROP TABLE IF EXISTS `professor`; CREATE TABLE `professor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `course`; CREATE TABLE `course` ( `professor_id` int(11) NOT NULL, `course_name` varchar(45) DEFAULT NULL, `courses_order` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Used for mapping Map collection -- Table structure for tables `stockerholder` and `stocks` -- DROP TABLE IF EXISTS `stockholder`; CREATE TABLE `stockholder` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `stocks`; CREATE TABLE `stocks` ( `stockholder_id` int(11) NOT NULL, `company_code` varchar(45) DEFAULT NULL, `company_name` varchar(45) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Use for mapping SortedSet collection -- Table structure for tables `employee` and `salaries` -- DROP TABLE IF EXISTS `employee`; CREATE TABLE `employee` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `salaries`; CREATE TABLE `salaries` ( `employee_id` int(11) NOT NULL, `salary` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Used for mapping SortedMap collection -- Table structure for tables `tourist` and `places` -- DROP TABLE IF EXISTS `tourist`; CREATE TABLE `tourist` ( `id` int(11) NOT NULL AUTO_INCREMENT, `first_name` varchar(45) DEFAULT NULL, `last_name` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `places`; CREATE TABLE `places` ( `tourist_id` int(11) NOT NULL, `description` varchar(45) DEFAULT NULL, `name` varchar(45) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
true
60a81f4e07a39832d717d5e00020716cf537b318
SQL
sjtu-se-3dprint/3dprint
/doc/数据库/2015-07-19.sql
UTF-8
2,203
3.546875
4
[]
no_license
use 3dprint3; drop table if exists floor_comment; drop table if exists article_comment; drop table if exists article; create table article( article_id int unsigned not null auto_increment, article_name varchar(128) not null, article_content varchar(20000) not null, article_type varchar(128) not null, user_id int unsigned not null, addtime datetime default now(), updatetime datetime default now(), status varchar(128) default 'normal', primary key(article_id), foreign key(user_id) references user(user_id) ); create table article_comment( article_comment_id int unsigned not null auto_increment, article_comment_floor int unsigned not null, article_comment_content varchar(20000) not null, article_id int unsigned not null, user_id int unsigned not null, addtime datetime default now(), updatetime datetime default now(), status varchar(128) default 'normal', primary key(article_comment_id), foreign key(article_id) references article(article_id), foreign key(user_id) references user(user_id), unique key(article_id, article_comment_floor) ); create table floor_comment( floor_comment_id int unsigned not null auto_increment, floor_comment_floor int unsigned not null, floor_comment_content varchar(200) not null, article_comment_id int unsigned not null, user_id int unsigned not null, addtime datetime default now(), updatetime datetime default now(), status varchar(128) default 'normal', primary key(floor_comment_id), foreign key(article_comment_id) references article_comment(article_comment_id), foreign key(user_id) references user(user_id), unique key(article_comment_id, floor_comment_floor) ); drop table if exists article_type; create table article_type( article_type_id int unsigned not null auto_increment, article_type varchar(128) not null, addtime datetime default now(), updatetime datetime default now(), status varchar(128) default 'normal', primary key(article_type_id) ); insert into article_type(article_type) values('3D打印机'); insert into article_type(article_type) values('3D模型设计'); insert into article_type(article_type) values('3D产品服务'); insert into article_type(article_type) values('综合讨论区');
true
6993b7d9eaf69adc23686f2bc64ab9436a98dc50
SQL
KatrineTY/rehabilitationClinic
/src/main/resources/db/migration/V1_2__fill_in_tables.sql
UTF-8
9,075
2.9375
3
[]
no_license
-- ------------------------------- -- INSERT INTO prescription_times (prescription, time) -- VALUES (1, '2012-10-11'); -- INSERT INTO prescription_times (prescription, time) -- VALUES (2, '2012-10-12'); -- INSERT INTO prescription_times (prescription, time) -- VALUES (1, '2012-10-13'); -- INSERT INTO prescription_times (prescription, time) -- VALUES (1, '2012-10-14'); -- ------------------------------- -- INSERT INTO events (patient, date, status, type, nurse) -- VALUES (1, '2012-10-11', 'Planned', 1, 1); -- INSERT INTO events (patient, date, status, type, nurse) -- VALUES (1, '2012-10-12', 'In progress', 1, 1); -- INSERT INTO events (patient, date, status, type, nurse, comment) -- VALUES (1, '2012-10-13', 'Rejected', 2, 1, 'Some comment'); -- INSERT INTO events (patient, date, status, type, nurse) -- VALUES (1, '2012-10-14', 'Planned', 1, 1); -- -- INSERT INTO employees_roles (employee, role) -- VALUES (1, 1); INSERT INTO "patients" (name, insurance) VALUES ('Anne Beck', '99532443'), ('Unity Mccullough', '71449712'), ('Bernard Maldonado', '52535505'), ('Noble Sawyer', '54864812'), ('Deacon Fox', '83037978'), ('Chester Shields', '55096367'), ('Murphy Cooley', '19506853'), ('Jaquelyn Howard', '22730869'), ('Steven Pollard', '72023967'), ('Blossom Dominguez', '40184068'); INSERT INTO working_times (start_hours, end_hours, mon, tue, wen, thu, fri, sat, sun) VALUES ('08:00:00', '16:00:00', true, true, true, true, true, false, false), -- doctors ('06:00:00', '14:00:00', true, true, true, true, true, false, false), -- nurses ('14:00:00', '22:00:00', true, true, true, true, true, false, false), ('22:00:00', '06:00:00', true, true, true, true, true, false, false), ('08:00:00', '20:00:00', false, false, false, false, false, true, true), ('20:00:00', '08:00:00', false, false, false, false, false, true, true); -- ('08:00:00', '16:00:00', false, false, false, true, true, false, false), -- nurses, --nurse1 -- ('16:00:00', '00:00:00', true, false, false, false, false, false, false), -- ('00:00:00', '08:00:00', false, true, true, false, false, false, false), -- -- ('08:00:00', '16:00:00', false, false, false, false, true, true, false), -- nurse2 -- ('16:00:00', '00:00:00', false, true, false, false, false, false, false), -- ('00:00:00', '08:00:00', false, false, true, true, false, false, false), -- -- ('08:00:00', '16:00:00', false, false, false, false, false, true, true), --nurse3 -- ('16:00:00', '00:00:00', false, false, true, false, false, false, false), -- ('00:00:00', '08:00:00', false, false, false, true, true, false, false), -- -- ('08:00:00', '16:00:00', true, false, false, false, false, false, true), --nurse4 -- ('16:00:00', '00:00:00', false, false, false, true, false, false, false), -- ('00:00:00', '08:00:00', false, false, false, false, true, true, false), -- -- ('08:00:00', '16:00:00', true, true, false, false, false, false, false), --nurse5 -- ('16:00:00', '00:00:00', false, false, false, false, true, false, false), -- ('00:00:00', '08:00:00', false, false, false, false, false, true, true), -- -- ('08:00:00', '16:00:00', false, true, true, false, false, false, false), --nurse6 -- ('16:00:00', '00:00:00', false, false, false, false, false, true, false), -- ('00:00:00', '08:00:00', true, false, false, false, false, false, true), -- -- ('08:00:00', '16:00:00', false, false, true, true, false, false, false), --nurse7 -- ('16:00:00', '00:00:00', false, false, false, false, false, false, true), -- ('00:00:00', '08:00:00', true, true, false, false, false, false, false); INSERT INTO roles (name) VALUES ('ROLE_MAIN_DOCTOR'), ('ROLE_NURSE'), ('ROLE_ADMINISTRATOR'), ('ROLE_DOCTOR'); INSERT INTO "employees" (name, position, login, password, phone, email, working_time, role) VALUES ('Zahir Durham', 'attending doctor', 'zahir.durham', '$2a$11$58tVkEfWNoigOmFI/5CxPOMaj6UU4W17VhlxfcJ1AyHuQJWGV4tW2', '1-174-699-7045', 'mauris@arcuNunc.edu', 1, 1), ('Berk Estrada', 'attending doctor', 'berk.estrada', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-159-671-7913', 'auctor.nunc.nulla@estvitae.edu', 1, 1), ('Kelsey Fulton', ' nurse', 'kelsey.fulton', '$2a$11$vua77rQXEvcKoIXa8Kmw0.C.YRxH.UKL6xK09jzrtY9ij/mOKl/qO', '1-460-421-3616', 'nunc@eleifendCras.co.uk', 2, 2), ('Cathleen Bailey', 'nurse', 'cathleen.bailey', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-181-662-0346', 'Integer@auguemalesuada.org', 2, 2), ('Trevor Holman', 'nurse', 'trevor.holman', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-793-933-1304', 'nisi@vulputatenisi.co.uk', 3, 2), ('Russell Blackburn', ' nurse', 'russell.blackburn', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-593-892-9513', 'suscipit.est@faucibus.edu', 3, 2), ('Orli Hooper', 'nurse', 'orli.hooper', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-631-482-6233', 'euismod.est@luctusfelispurus.org', 4, 2), ('Louis Holt', 'nurse', 'louis.holt', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-380-330-0080', 'Maecenas.ornare.egestas@at.org', 5, 2), ('Chandler Hester', 'nurse', 'chandler.hester', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-384-153-2692', 'laoreet.lectus@eterosProin.edu', 6, 2), ('Skyler Pope', ' doctor', 'skyler.rope', '$2a$11$mDJXVc3db46nnWeaVE.dVOpAQwE7lSnteuqniowtuW0VdY05ljdqO', '1-400-129-4351', 'facilisis.non.bibendum@nislMaecenasmalesuada.org', 1, 4), ('Tana Hebert', ' doctor', 'iana.hobert', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-857-866-2914', 'mattis.Cras.eget@elitafeugiat.edu', 1, 4), ('Troy Garcia', ' doctor', 'troy.garcia', '$2a$11$XuqE7HbYvTsfY2PayDXhN.0VXNzD9dbHkrdBozqdiYuMUCawU2Lym', '1-554-148-3166', 'elit.elit.fermentum@inhendrerit.co.uk', 1, 4), ('Katrine F.', ' administrator', 'login', '$2a$10$ftSAE5IBQHG6P8c9HBnNPOZJX1EP/80/MtboQiB7sn7JoIh.bt4AK', '1-554-148-3966', 'katrine@gmail.com', 1, 3); INSERT INTO "patient_cards" (patient, building, ward, attending_doctor) VALUES (1, 'A', 5, 2), (2, 'B', 3, 1), (3, 'C', 1, 1), (4, 'A', 6, 2), (5, 'B', 1, 2), (6, 'C', 7, 1), (7, 'A', 6, 1), (8, 'B', 3, 2), (9, 'C', 6, 2), (10, 'A', 1, 1); INSERT INTO proceds_and_medics (name, kind) VALUES ('Physiotherapy', 'Procedure'), ('Massage', 'Procedure'), ('Mechanotherapy', 'Procedure'), ('Aromatherapy', 'Procedure'), ('Music therapy', 'Procedure'), ('Reflexology', 'Procedure'), ('Diet therapy', 'Procedure'), ('Occupational therapy', 'Procedure'); INSERT INTO proceds_and_medics (name, kind, count) VALUES ('Adrenalin', 'Medicament', 100), ('Analgesic', 'Medicament', 100), ('Muscle relaxant', 'Medicament', 100), ('Corticosteroid', 'Medicament', 100), ('Antidepressant', 'Medicament', 100), ('Tranquilizer', 'Medicament', 100), ('Vitamins', 'Medicament', 10); -- INSERT INTO employees_roles (employee, role) -- VALUES (1, 1), -- (2, 1), -- (3, 2), -- (4, 2), -- (5, 2), -- (6, 2), -- (7, 2), -- (8, 2), -- (9, 2), -- (10, 4), -- (11, 4), -- (12, 4), -- (13, 3); INSERT INTO diagnoses (name, patient_card, comment) VALUES ('diag1', 1, 'some comment'), ('diag2', 1, 'some comment2'); INSERT INTO diagnoses (name, patient_card) VALUES ('diag4', 1), ('diag3', 2), ('diag5', 3), ('diag5', 4); INSERT INTO "prescriptions" (patient, type, start_date, end_date, responsible_doctor) VALUES (2, 2, '2018-08-31', '2019-08-14', 10), (2, 2, '2019-06-20', '2019-11-11', 10), (3, 2, '2019-05-29', '2020-02-27', 11), (4, 2, '2019-05-15', '2020-03-14', 11), (1, 2, '2019-05-22', '2019-09-08', 12); INSERT INTO "prescriptions" (patient, type, start_date, end_date, responsible_doctor, dose) VALUES (2, 1, '2019-01-29', '2019-08-02', 10, '2mg'), (1, 1, '2019-01-27', '2020-06-16', 11, '3mg'), (1, 1, '2019-07-06', '2020-03-22', 12, '4mg'); INSERT INTO "prescription_times" (prescription, time) VALUES ('1', '08:11'), ('1', '20:33'), ('2', '18:31'), ('2', '10:11'), ('3', '03:25'), ('3', '14:01'), ('4', '08:39'), ('4', '05:20'), ('5', '17:34'), ('5', '04:48'), ('6', '00:53'), ('6', '13:22'), ('7', '01:23'), ('7', '07:29'), ('8', '18:55'), ('8', '16:32'), ('1', '16:50'), ('1', '17:27'), ('2', '20:31'), ('2', '12:09'); INSERT INTO events (patient, type, date, dose, building, ward) SELECT prescriptions.patient, type, (date(start_date) || ' ' || time)::timestamp, dose, building, ward FROM prescriptions INNER JOIN prescription_times ON prescriptions.prescription_id = prescription_times.prescription INNER JOIN patient_cards ON prescriptions.patient = patient_cards.patient;
true
ee07498142a4a517c2c62fbc830587f6b08154fd
SQL
John-Ryan-Johnson/Northwind
/Northwind_answer4.sql
UTF-8
443
4.3125
4
[]
no_license
--4. I need a list of sales figures broken down by category name. Include the total $ amount sold over all time and the total number of items sold. select c.CategoryName as [Category Name], sum(od.quantity) as [Total Items Sold], sum(od.quantity * od.unitprice) as [Total Sales] from Categories c join Products p on p.CategoryID = c.CategoryID join [Order Details] od on od.ProductID = p.ProductID group by c.CategoryName
true
9798ed6eda9b50345009c71fadcb2d0fb069c1a2
SQL
silverorange/Chiara_PEAR_Server
/data/upgrade-0.12.0_0.13.0.sql
UTF-8
1,198
3.21875
3
[]
no_license
# # Table structure for table `categories` # CREATE TABLE categories ( id int(6) NOT NULL default '0', channel varchar(255) NOT NULL default '0', name varchar(255) NOT NULL default '', description text NOT NULL, alias varchar(50) default NULL, PRIMARY KEY (id) ); # -------------------------------------------------------- # # Table structure for table `categories_seq` # CREATE TABLE categories_seq ( id int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (id) ); # -------------------------------------------------------- # # Table structure for table `package_extras` # CREATE TABLE package_extras ( channel varchar(255) NOT NULL default '', package varchar(80) default NULL, cvs_uri varchar(255) NOT NULL default '', bugs_uri varchar(255) NOT NULL default '', docs_uri varchar(255) NOT NULL default '' ) TYPE=MyISAM; # -------------------------------------------------------- # Table alterations ALTER TABLE handles ADD uri VARCHAR( 255 ); ALTER TABLE maintainers CHANGE active active TINYINT( 4 ) DEFAULT '1' NOT NULL; ALTER TABLE packages ADD category_id INT( 6 ) DEFAULT '0' NOT NULL ; ALTER TABLE releases CHANGE packagexml packagexml LONGTEXT NOT NULL;
true
824756f28ffdbb199a68921d14b7b049d58f6f5c
SQL
mseong123/protocount-nodejs-mysql
/mysql_files/STORED PROCEDURES/DEBTOR/INSERT_DEBTOR.sql
UTF-8
733
2.828125
3
[]
no_license
DELIMITER // CREATE PROCEDURE INSERT_DEBTOR (IN DEBTOR_NUM_PARAM VARCHAR(20),IN DEBTOR_NAME_PARAM VARCHAR(255), IN DEBTOR_ADDRESS_PARAM VARCHAR(255), IN DEBTOR_POSTCODE_PARAM VARCHAR(5), IN DEBTOR_PHONE_PARAM VARCHAR(15),IN DEBTOR_FAX_PARAM VARCHAR(15),IN DEBTOR_OTHER_DESC_PARAM VARCHAR(255),IN DEBTOR_CREDIT_TERM_PARAM ENUM('COD', '30', '45', '60', '90'),IN GL_ACC_NUM_PARAM INT,IN DEBTOR_NUM_OLD_PARAM VARCHAR(20)) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN ROLLBACK; RESIGNAL; END; START TRANSACTION; INSERT INTO debtor VALUES(DEBTOR_NUM_PARAM,DEBTOR_NAME_PARAM,DEBTOR_ADDRESS_PARAM,DEBTOR_POSTCODE_PARAM,DEBTOR_PHONE_PARAM,DEBTOR_FAX_PARAM,DEBTOR_OTHER_DESC_PARAM,DEBTOR_CREDIT_TERM_PARAM,DEFAULT); COMMIT; END
true
58f950b9c15ffa443d33e8874d99a9828ff3c5d0
SQL
Mattw46/CPT375-A2
/init_db/tables.sql
UTF-8
3,022
3.578125
4
[]
no_license
-- Table bids CREATE TABLE bids ( bid_id int NOT NULL AUTO_INCREMENT, listing_id int NOT NULL , bid_user_id int NOT NULL , bid_tmstmp timestamp NOT NULL , bid_amnt decimal(15,2) NOT NULL , CONSTRAINT bids_pk PRIMARY KEY (bid_id) ); -- Table feedback CREATE TABLE feedback ( feedback_id int NOT NULL AUTO_INCREMENT, list_user_id int NOT NULL , pro_user_id int NOT NULL , listing_id int NOT NULL , rating int NOT NULL , feedback text NOT NULL , CONSTRAINT feedback_pk PRIMARY KEY (feedback_id) ); -- Table list_addr CREATE TABLE list_addr ( list_addr_id int NOT NULL AUTO_INCREMENT, address1 varchar(50) NOT NULL , address2 varchar(50) NOT NULL , city varchar(20) NOT NULL , state varchar(3) NOT NULL , postcode int NOT NULL , CONSTRAINT list_addr_pk PRIMARY KEY (list_addr_id) ); -- Table listing CREATE TABLE listing ( listing_id int NOT NULL AUTO_INCREMENT, list_user_id int NOT NULL , list_strt_tmstmp timestamp NOT NULL , list_end_tmstmp timestamp NOT NULL , list_typ_cd int NOT NULL , list_addr_id int , shrt_descn varchar(50) NOT NULL , lng_descn text NOT NULL , job_len int NOT NULL , strt_bid int NOT NULL , photo_url varchar(20) , visible bool NOT NULL , CONSTRAINT listing_pk PRIMARY KEY (listing_id) ); CREATE INDEX Listing_idx_1 ON listing (list_user_id); -- Table listing_typ CREATE TABLE listing_typ ( list_typ_cd int NOT NULL AUTO_INCREMENT, list_typ varchar(20) NOT NULL , CONSTRAINT listing_typ_pk PRIMARY KEY (list_typ_cd) ); -- Table Professional_info CREATE TABLE Professional_info ( user_id int NOT NULL , bio text NOT NULL , CONSTRAINT Professional_info_pk PRIMARY KEY (user_id) ); -- Table pword CREATE TABLE pword ( user_id int NOT NULL , pword varchar(32) NOT NULL , CONSTRAINT pword_pk PRIMARY KEY (user_id) ); -- Table trade_typ CREATE TABLE trade_typ ( trade_typ varchar(60) NOT NULL , trade_typ_cd int NOT NULL , CONSTRAINT trade_typ_pk PRIMARY KEY (trade_typ_cd) ); -- Table trade_typ_lnk CREATE TABLE trade_typ_lnk ( user_id int NOT NULL , trade_typ_cd int NOT NULL , CONSTRAINT trade_typ_lnk_pk PRIMARY KEY (user_id,trade_typ_cd) ); -- Table user CREATE TABLE user ( user_id int NOT NULL AUTO_INCREMENT, username varchar(30) NOT NULL , first_name varchar(30) NOT NULL , last_name varchar(30) NOT NULL , address1 varchar(50) NOT NULL , address2 varchar(50) NULL , city varchar(30) NOT NULL , state varchar(3) NOT NULL , postcode int NOT NULL , email varchar(50) NOT NULL , signup_tmstmp timestamp NOT NULL , user_typ_cd int NOT NULL , CONSTRAINT user_pk PRIMARY KEY (user_id) ); -- Table user_typ CREATE TABLE user_typ ( user_typ varchar(12) NOT NULL , user_typ_cd int NOT NULL , CONSTRAINT user_typ_pk PRIMARY KEY (user_typ_cd) );
true
1fd954340766a53a3c0f75f5708ec0f57567bf99
SQL
supervermiceau/Pimp
/Projet/BDD2/CreationBase.sql
WINDOWS-1252
8,266
3.421875
3
[]
no_license
#------------------------------------------------------------w # Creation Gestion recette #------------------------------------------------------------ #------------------------------------------------------------ # Table: Recette #------------------------------------------------------------ CREATE TABLE Recette( id_Recette Int NOT NULL , Descriptif Varchar (25) , difficulte Int , nb_personne Int default 0, Image Varchar (25) , videos Varchar (25) , prix Int , duree Int , id_utilisateur Int NOT NULL, PRIMARY KEY (id_Recette ) ); #------------------------------------------------------------ # Table: Etape #------------------------------------------------------------ CREATE TABLE Etape( id_Recette Int NOT NULL , ordre int; descriptif Varchar (500) , duree Int , PRIMARY KEY (id_recette,ordre ) ); #------------------------------------------------------------ # Table: Ingredient #------------------------------------------------------------ CREATE TABLE Ingredient( id_ingredient Int NOT NULL , nom Varchar (25) , calorie Int , glucide Int , lipide Int , protide Int , id_categorie int not null, PRIMARY KEY (id_ingredient ) ); #------------------------------------------------------------ # Table: Categorie #------------------------------------------------------------ CREATE TABLE Categorie( id_categorie Int NOT NULL , Nom Varchar (25) , PRIMARY KEY (id_categorie ) ); #------------------------------------------------------------ # Table: Regime #------------------------------------------------------------ CREATE TABLE Regime( id_regime Int NOT NULL , nom_regime Varchar (25) , PRIMARY KEY (id_regime ) ); #------------------------------------------------------------ # Table: utilisateur #------------------------------------------------------------ CREATE TABLE utilisateur( id_utilisateur Int NOT NULL , Nom Varchar (20) , Prenom Varchar (20) , email Varchar (30) , Login Varchar (25) , PRIMARY KEY (id_utilisateur ) ); #------------------------------------------------------------ # Table: Login #------------------------------------------------------------ CREATE TABLE Login( Login Varchar (25) NOT NULL , mdp Varchar (25) , PRIMARY KEY (Login ) ); #------------------------------------------------------------ # Table: Planning #------------------------------------------------------------ CREATE TABLE Planning( id_planning Int NOT NULL , nom Varchar (25) , id_utilisateur Int NOT NULL, PRIMARY KEY (id_planning ) ); #------------------------------------------------------------ # Table: Archive planning #------------------------------------------------------------ CREATE TABLE Archive_planning( id_planning Int NOT NULL , Nom Varchar (20) NOT NULL , jour Varchar (25) NOT NULL , repas Varchar (25) NOT NULL , id_Recette Int NOT NULL, PRIMARY KEY (id_planning ) ); #------------------------------------------------------------ # Table: Archives liste achat #------------------------------------------------------------ CREATE TABLE Archives_liste_achat( id_planning Int NOT NULL , id_Recette Int NOT NULL , PRIMARY KEY (id_planning ,id_Recette ) ); #------------------------------------------------------------ # Table: Composer #------------------------------------------------------------ CREATE TABLE Composer( quantite Int , unite Varchar (2) , id_Recette Int NOT NULL , id_ingredient Int NOT NULL , PRIMARY KEY (id_Recette ,id_ingredient ) ); #------------------------------------------------------------ # Table: Est interdit #------------------------------------------------------------ CREATE TABLE Est_interdit( id_ingredient Int NOT NULL , id_regime Int NOT NULL , PRIMARY KEY (id_ingredient ,id_regime ) ); #------------------------------------------------------------ # Table: Possede #------------------------------------------------------------ CREATE TABLE Possede( Quantite Int , unite Int , id_utilisateur Int NOT NULL , id_ingredient Int NOT NULL , PRIMARY KEY (id_utilisateur ,id_ingredient ) ); #------------------------------------------------------------ # Table: Creer liste #------------------------------------------------------------ CREATE TABLE Creer_liste( jour Varchar (25) , repas Varchar (25) , id_Recette Int NOT NULL , id_planning Int NOT NULL , PRIMARY KEY (id_Recette ,id_planning ) ); #------------------------------------------------------------ # Table: convient #------------------------------------------------------------ CREATE TABLE convient_a( id_regime Int NOT NULL , id_Recette Int NOT NULL , PRIMARY KEY (id_regime ,id_Recette ) ); #------------------------------------------------------------ # Contrainte #------------------------------------------------------------ ALTER TABLE Recette ADD CONSTRAINT CK_Recette_difficulte check (difficulte in ('Tres facile', 'Facile', 'Moyen', 'Difficile', 'Tres difficile')); ALTER TABLE Recette ADD CONSTRAINT CK_Recette_prix check (prix in ('1', '2', '3', '4', '5')); ALTER TABLE Recette ADD CONSTRAINT FK_Recette_id_utilisateur FOREIGN KEY (id_utilisateur) REFERENCES utilisateur(id_utilisateur); ALTER TABLE etape ADD CONSTRAINT FK_etape_id_Recette FOREIGN KEY (id_Recette) REFERENCES Recette(id_Recette); ALTER TABLE ingredient ADD CONSTRAINT FK_ingredient_id_categorie FOREIGN KEY (id_categorie) REFERENCES categorie(id_categorie); ALTER TABLE utilisateur ADD CONSTRAINT FK_utilisateur_Login FOREIGN KEY (Login) REFERENCES Login(Login); ALTER TABLE utilisateur ADD CONSTRAINT FK_utilisateur_id_planning FOREIGN KEY (id_planning) REFERENCES Planning(id_planning); ALTER TABLE utilisateur ADD CONSTRAINT FK_utilisateur_id_Recette FOREIGN KEY (id_Recette) REFERENCES Recette(id_Recette); ALTER TABLE Composer ADD CONSTRAINT FK_Composer_id_Recette FOREIGN KEY (id_Recette) REFERENCES Recette(id_Recette); ALTER TABLE Composer ADD CONSTRAINT FK_Composer_id_ingredient FOREIGN KEY (id_ingredient) REFERENCES Ingredient(id_ingredient); ALTER TABLE Composer ADD CONSTRAINT CK_Composer_unite check (unite in ('U', 'g')); ALTER TABLE Est_interdit ADD CONSTRAINT FK_Est_interdit_id_ingredient FOREIGN KEY (id_ingredient) REFERENCES Ingredient(id_ingredient); ALTER TABLE Est_interdit ADD CONSTRAINT FK_Est_interdit_id_regime FOREIGN KEY (id_regime) REFERENCES Regime(id_regime); ALTER TABLE Possede ADD CONSTRAINT FK_Possede_id_utilisateur FOREIGN KEY (id_utilisateur) REFERENCES utilisateur(id_utilisateur); ALTER TABLE Possede ADD CONSTRAINT FK_Possede_id_ingredient FOREIGN KEY (id_ingredient) REFERENCES Ingredient(id_ingredient); ALTER TABLE Possede ADD CONSTRAINT CK_Possede_unite check (unite in ('U', 'g')); ALTER TABLE Creer_liste ADD CONSTRAINT FK_Creer_liste_id_Recette FOREIGN KEY (id_Recette) REFERENCES Recette(id_Recette); ALTER TABLE Creer_liste ADD CONSTRAINT FK_Creer_liste_id_planning FOREIGN KEY (id_planning) REFERENCES Planning(id_planning); ALTER TABLE Creer_liste ADD CONSTRAINT CK_Creer_liste_jour check (jour in ('Lundi', 'Mardi', 'Mercredi', 'Jeudi','Vendredi', 'Samedi', 'Dimanche')); ALTER TABLE Creer_liste ADD CONSTRAINT CK_Creer_liste_repas check (repas in ('Petit dejeuner', 'Dejeuner', 'Diner')); ALTER TABLE convient_a ADD CONSTRAINT FK_convient_a_id_regime FOREIGN KEY (id_regime) REFERENCES Regime(id_regime); ALTER TABLE convient_a ADD CONSTRAINT FK_convient_a_id_Recette FOREIGN KEY (id_Recette) REFERENCES Recette(id_Recette); ALTER TABLE Planning ADD CONSTRAINT FK_Planning_id_utilisateur FOREIGN KEY (id_utilisateur) REFERENCES utilisateur(id_utilisateur);
true
33f1df3cc96e3cdabaca1f9d804263d7de2ee539
SQL
alekxey51/SQL_3_Course
/Горецкий/SQL 9 lab.sql
WINDOWS-1251
2,102
4.09375
4
[]
no_license
use school; SELECT firstname AS [], birthday AS [ ], class AS [], classnumber AS [], [name] AS [] FROM cityes JOIN students ON cityes.ID = students.cityID WHERE firstname LIKE '%' SELECT firstname AS [], class AS [], classnumber AS [], housenumber AS [ ], roomnumber AS [o ], variant.ID AS [] FROM students JOIN variant ON students.ID = variant.studentID WHERE housenumber > 30 SELECT firstname AS [], secondname AS [], birthday AS [ ], housenumber AS [ ], roomnumber AS [o ], [name] AS [] FROM cityes JOIN students ON cityes.ID = students.cityID WHERE birthday NOT BETWEEN '2000-10-04' AND '2001-11-06' ORDER BY birthday SELECT firstname AS [], birthday AS [ ], age AS [], sex AS [], email AS [ ], [name] AS [], itemname AS [] FROM cityes JOIN items ON cityes.ID = items.ID JOIN speciality ON cityes.ID = speciality.ID JOIN teachers ON cityes.ID = teachers.cityID AND items.ID = teachers.itemID AND speciality.ID = teachers.specialityID WHERE firstname LIKE '%' SELECT secondname AS , firstname AS , middlename AS , birthday AS [ ], age AS , sex AS , housenumber AS [ ], roomnumber AS [ ], experience AS , email AS [ ], category AS , name AS , NumberOfHours AS [ ], itemname AS , type AS , PickDate AS [ ] FROM teachers JOIN speciality ON teachers.specialityID = speciality.ID JOIN cityes ON teachers.cityID = cityes.ID JOIN items ON teachers.itemID = items.ID JOIN itemstypes ON items.itemtypeID = itemstypes.ID JOIN variant ON items.ID = variant.itemID
true
c8463231d6d12bba3d1c504d270ea8d019970f5a
SQL
shikhagoyal96/http5101_final_project
/data/seasondatabase.sql
UTF-8
2,625
3.484375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Dec 03, 2019 at 09:52 PM -- Server version: 5.7.24-log -- PHP Version: 7.2.10 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: `seasondatabase` -- -- -------------------------------------------------------- -- -- Table structure for table `season` -- CREATE TABLE `season` ( `seasonid` int(20) UNSIGNED NOT NULL COMMENT 'PrimaryKey', `seasontitle` varchar(255) COLLATE latin1_bin DEFAULT NULL, `seasonbody` mediumtext COLLATE latin1_bin ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin; -- -- Dumping data for table `season` -- INSERT INTO `season` (`seasonid`, `seasontitle`, `seasonbody`) VALUES (1, 'Summer', 'Summer is the hottest of the four temperate seasons, falling after spring and before autumn. At the summer solstice, the days are longest and the nights are shortest, with day length decreasing as the season progresses after the solstice. '), (2, 'Fall', 'Autumn, also known as fall in North American English, is one of the four temperate seasons. Autumn marks the transition from summer to winter, in September or March, when the duration of daylight becomes noticeably shorter and the temperature cools considerably.'), (3, 'Winters', 'Winter is the coldest season of the year in polar and temperate zones (winter does not occur in most of the tropical zone). It occurs after autumn and before spring in each year. Winter is caused by the axis of the Earth in that hemisphere being oriented away from the Sun. Different cultures define different dates as the start of winter, and some use a definition based on weather. When it is winter in the Northern Hemisphere, it is summer in the Southern Hemisphere, and vice versa.'); -- -- Indexes for dumped tables -- -- -- Indexes for table `season` -- ALTER TABLE `season` ADD PRIMARY KEY (`seasonid`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `season` -- ALTER TABLE `season` MODIFY `seasonid` int(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'PrimaryKey', 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
6ec69b09986796bfc7045af294730f47b4a1f7a0
SQL
Nivedita30-mishra/Basic-Banking-System
/user.sql
UTF-8
2,718
3.28125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 14, 2021 at 01:51 PM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.0 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: `user` -- -- -------------------------------------------------------- -- -- Table structure for table `trans` -- CREATE TABLE `trans` ( `transaction id` int(20) NOT NULL, `sender` varchar(20) NOT NULL, `reciever` varchar(20) NOT NULL, `amount` float NOT NULL, `date_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `trans` -- INSERT INTO `trans` (`transaction id`, `sender`, `reciever`, `amount`, `date_time`) VALUES (1, 'Nivedita Mishra', 'Tannu Mishra', 110, '2021-03-16 12:41:48.544309'); -- -------------------------------------------------------- -- -- Table structure for table `user_list` -- CREATE TABLE `user_list` ( `id` int(20) NOT NULL, `name` varchar(20) NOT NULL, `email` varchar(30) NOT NULL, `balance` float NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `user_list` -- INSERT INTO `user_list` (`id`, `name`, `email`, `balance`) VALUES (1, 'Nivedita Mishra', 'niveditamishra3011@gmail.com', 376463), (2, 'Tannu Mishra', 'tannumishra22@gmail.com', 20000), (3, 'Deep Mishra', 'mishradeep@gmail.com', 437737), (4, 'Shailaja Mishra', 'snmishra33@gmail.com', 375735), (5, 'Vedhashree Naik', 'vedhashree869@gmail.com', 89874), (6, 'Tanushree Poojary', 'poojarytantan79@gmail.com', 978000), (7, 'Kirti Moily', 'kmoily29@gmail.com', 97897), (8, 'Anita Uniyal', 'anuniyal97@gmail.com', 67800), (9, 'Laxmi Yadav', 'luxyadav72@gmail.com', 976250), (10, 'Shalini Mishra', 'shalumishra17@gmail.com', 8786); -- -- Indexes for dumped tables -- -- -- Indexes for table `trans` -- ALTER TABLE `trans` ADD PRIMARY KEY (`transaction id`); -- -- Indexes for table `user_list` -- ALTER TABLE `user_list` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `trans` -- ALTER TABLE `trans` MODIFY `transaction id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user_list` -- ALTER TABLE `user_list` MODIFY `id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; 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
622a87eeba3e126bcbfcaf08a5c5708f45777117
SQL
LuisFernandoSandovalParra/ScriptsDB_MySql_Oracle-Empresa_Seguridad_Privada
/SCRIPTS DB - EMPRESA SEGURIDAD PRIVADA/cccursos_vigilantes.sql
UTF-8
263
2.75
3
[]
no_license
-- CREACION DE LAS RESTRICCIONES DE LA TABLA CURSOS_VIGILANTES ALTER TABLE CURSOS_VIGILANTES ADD( CONSTRAINT CUV_FK_IDE FOREIGN KEY (ID_EMP) REFERENCES EMPLEADOS(ID_EMP), CONSTRAINT CUV_FK_IDC FOREIGN KEY (ID_CURSO) REFERENCES CURSOS(ID_CURSO) );
true
0abc9ec9b669803e5a16f3fc0a724fef13bba35a
SQL
olegTervo/FastReserve
/database/schema.sql
UTF-8
1,435
4.03125
4
[]
no_license
CREATE TABLE IF NOT EXISTS Users ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(128) NOT NULL, secondName VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, phoneNumber BIGINT, password TEXT NOT NULL, isModerator BIT ); CREATE TABLE IF NOT EXISTS Item ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(128) NOT NULL, type INT, isPublic BIT, info TEXT, author SERIAL, FOREIGN KEY (author) REFERENCES Users(id) ); CREATE TABLE IF NOT EXISTS ItemType ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(128) NOT NULL ); INSERT INTO ItemType (id, name) values (0, 'Undefined'), (1, 'Väline'), (2, 'Ajoneuvo'), (3, 'Pinta ala'), (4, 'Palvelu'), (5, 'Muu tyyppi'); ALTER TABLE Item ADD FOREIGN KEY (type) REFERENCES ItemType(id); CREATE TABLE IF NOT EXISTS Channel ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(128) NOT NULL, author SERIAL NOT NULL, isPublic BIT ); CREATE TABLE IF NOT EXISTS ChannelItem ( item_id SERIAL, channel_id SERIAL, CONSTRAINT PK PRIMARY KEY (item_id,channel_id), FOREIGN KEY (item_id) REFERENCES Item(id), FOREIGN KEY (channel_id) REFERENCES Channel(id) ); CREATE TABLE IF NOT EXISTS ChannelUser ( user_id SERIAL, channel_id SERIAL, isAdmin BIT, isBanned BIT ); ALTER TABLE ChannelUser ADD PRIMARY KEY (user_id, channel_id); ALTER TABLE ChannelUser ADD FOREIGN KEY (user_id) REFERENCES Users(id); ALTER TABLE ChannelUser ADD FOREIGN KEY (channel_id) REFERENCES Channel(id);
true
61ccbe0c0e3f307b16bccf571ebacc4a7ed93ee8
SQL
deflaux/bigquery-examples
/1000genomes/sql/sample-variant-hotspots.sql
UTF-8
985
4.125
4
[ "Apache-2.0" ]
permissive
# Summarize the variant counts for a particular sample by 10,000 start-wide windows # in order to identify variant hotspots within a chromosome for a particular sample. SELECT reference_name, window, window * 10000 AS window_start, ((window * 10000) + 9999) AS window_end, MIN(start) AS min_variant_start, MAX(start) AS max_variant_start, sample_id, COUNT(sample_id) AS num_variants_in_window, FROM ( SELECT reference_name, start, INTEGER(FLOOR(start / 10000)) AS window, call.call_set_name AS sample_id, NTH(1, call.genotype) WITHIN call AS first_allele, NTH(2, call.genotype) WITHIN call AS second_allele, FROM [genomics-public-data:1000_genomes.variants] WHERE call.call_set_name = 'HG00096' HAVING first_allele > 0 OR (second_allele IS NOT NULL AND second_allele > 0)) GROUP BY reference_name, window, window_start, window_end, sample_id ORDER BY num_variants_in_window DESC, window
true
8dbf88fca995b61332179b63345731de85c09388
SQL
MuriloMilani8870/2s2019-t2-hroads-sprint-1-bd
/M_MuriloRafaelGiovanni_hroads_manipulacao_02.sql
ISO-8859-1
1,427
3.09375
3
[ "MIT" ]
permissive
Use SENAI_HROADS_MANHA Insert Into Classes (NomeClasse) Values ('Brbaro') ,('Cruzado') ,('Caadora de Demnios') ,('Monge') ,('Necromante') ,('Feiticeiro') ,('Arcanista'); Insert Into Habilidades (NomeHabilidade , IdTipoHabilidade , DescricaoHabilidade , CustoDeMana) Values ('Lana Mortal' , 1 , 'Arremessa uma lana que penetra os inimigos e causa 20 ' , 25) ,('Escudo Supremo' , 2 , 'Conjura uma aura protetora em volta do alvo capaz de reduzir os golpes recebidos em 50%' , 50) ,('Recuperar Vida' , 3 , 'Recupera 100% da vida perdida que o alvo perdeu' , 50 ); Insert Into TipoHabilidades (NomeTipo) Values ('Ataque') ,('Defesa') ,('Cura') ,('Magia'); Insert into ClasseHabilidade (IdClasse , IdHabilidade) Values (1,1) ,(1,2) ,(2,2) ,(3,1) ,(4,3) ,(4,2) ,(6,3) Insert into ClasseHabilidade (IdClasse) Values (5) ,(7) Insert into Personagens (NomePersonagem,IdClasse,CapacidadeMaximaVida,CapacidadeMaximaMana,DataDeAtualizacao,DataCriacao) Values ('DeuBug' , 1 , 100 , 80 , '2019-08-09T10:30:00' ,'2019-08-09T10:30:00') ,('BitBug' , 4 , 70 , 100 , '2019-08-09T10:30:00' , '2019-08-09T10:30:00') ,('Fer8' , 7 , 75 , 60 , '2019-08-09T10:30:00' , '2019-08-09T10:30:00') update Personagens set NomePersonagem = 'Fer7' where IdPersonagem = 5 update Classes set NomeClasse = 'Necromancer' where IdClasse = 5
true
23e31c55161d3c577045c29a3b1dac83ddaceeb3
SQL
san1j/springboot_poetHub
/src/main/resources/data.sql
UTF-8
3,370
2.953125
3
[ "MIT" ]
permissive
INSERT INTO USER (email,enabled,first_name,last_name,password,role,username,user_id) VALUES ('asdf@fs.sf',true,'firstName','lastName','$2a$06$OAPObzhRdRXBCbk7Hj/ot.jY3zPwR8n7/mfLtKIgTzdJa4.6TwsIm', 'USER','anonymous',1); INSERT INTO USER(email,enabled,first_name,last_name,password,role,username,user_id) VALUES ('ella@df.sd',true,'firstName','lastName','$2a$06$OAPObzhRdRXBCbk7Hj/ot.jY3zPwR8n7/mfLtKIgTzdJa4.6TwsIm', 'USER','Ella Higginson',2); INSERT INTO USER(email,enabled,first_name,last_name,password,role,username,user_id) VALUES ('elliot@df.sd',true,'firstName','lastName','$2a$06$OAPObzhRdRXBCbk7Hj/ot.jY3zPwR8n7/mfLtKIgTzdJa4.6TwsIm', 'USER','T.S.Eliot',3); INSERT INTO POEM(body,title,user_id,poem_id) VALUES ('I know a place where the sun is like gold, And the cherry blooms burst with snow, And down underneath is the loveliest nook, Where the four-leaf clovers grow. One leaf is for hope, and one is for faith, And one is for love, you know, And God put another in for luck— If you search, you will find where they grow. But you must have hope, and you must have faith, You must love and be strong—and so— If you work, if you wait, you will find the place Where the four-leaf clovers grow.','Four-Leaf Clover',2,6); INSERT INTO POEM(body,title,user_id,poem_id) VALUES ('Straight thro’ a fold of purple mist The sun goes down—a crimson wheel— And like an opal burns the sea That once was cold as steel. With pomp of purple, gold and red, Thou wilt come back at morrow’s dawn… But thou can’st never bring, O Sun, The Christmas that is gone!','Christmas Eve',2,5); INSERT INTO POEM(body,title,user_id,poem_id) VALUES ('The hours steal by with still, unasking lips— So lightly that I cannot hear their tread; And softly touch me with their finger-tips To find if I be dreaming, or be dead. And yet however still their flight may be, Their ceaseless going weights my heart with tears; These touches will have wrought deep scars on me— When the light hours have worn to heavy years.','The Passing of the Hours',2,4); INSERT INTO POEM(body,title,user_id,poem_id) VALUES ('The winter evening settles down With smell of steaks in passageways. Six o’clock. The burnt-out ends of smoky days. And now a gusty shower wraps The grimy scraps Of withered leaves about your feet And newspapers from vacant lots; The showers beat On broken blinds and chimney-pots, And at the corner of the street A lonely cab-horse steams and stamps.','Preludes',3,3); INSERT INTO POEM(body,title,user_id,poem_id) VALUES ('The wrath of wind, it comes and goes, The fear of men, no longer blows, The hunger of fire, it does devour, But all who give in, it will sour, The strength of water, cannot be matched, By every evil scheme thats hatched, The life of earth, is unsurpassed, Unless you’ve seen, the future past. Do not be weathered, by elements strong, Their strength by no means, lasts that long.','Strength',1,2); INSERT INTO POEM (body,title,user_id,poem_id) VALUES ('The sun it shines, regardless, The grass it grows, oblivious, The water it sits, fathomless. The moon it reflects, lovingly, The tree it stands, determinedly, The sand it moves, impulsively. Time is a constant, unstoppable, Space is vast, incalculable, Life is a gift, remarkable.','Life',1,1);
true
59a2cf934720e98f7fdd1ca6b8291e5bcade7a39
SQL
francis-andrade/feup-tbda
/T2/ex4_queries_verification.sql
UTF-8
7,275
4.03125
4
[]
no_license
-- The results of each query in this file must be equal to the results of the corresponding query in the file "ex4_queries.sql" ---------------------------------- --a)------------------------------ ---------------------------------- SELECT p.sigla, sum(l.mandatos) FROM GTD7.partidos p, GTD7.listas l WHERE p.sigla = l.partido GROUP BY p.sigla ORDER BY p.sigla; ---------------------------------- --b)------------------------------ ---------------------------------- WITH zonas_partidos AS (SELECT d.codigo AS codigo, SUM(v.votos) AS votos, v.partido AS partido FROM GTD7.distritos d, GTD7.concelhos c, GTD7.freguesias f, GTD7.votacoes v WHERE d.codigo = c.distrito AND c.codigo = f.concelho AND f.codigo = v.freguesia GROUP BY d.codigo, v.partido) SELECT d.nome, tmp.partido, tmp.votos FROM zonas_partidos tmp, GTD7.distritos d WHERE d.codigo = tmp.codigo ORDER BY d.nome, tmp.partido; ---------------------------------- --c)------------------------------ ---------------------------------- WITH zonas_partidos AS (SELECT c.codigo AS codigo, SUM(v.votos) AS votos, v.partido AS partido FROM GTD7.concelhos c, GTD7.freguesias f, GTD7.votacoes v WHERE c.codigo = f.concelho AND f.codigo = v.freguesia GROUP BY c.codigo, v.partido) SELECT c.nome, tmp.partido, tmp.votos FROM zonas_partidos tmp, GTD7.concelhos c WHERE c.codigo = tmp.codigo AND NOT EXISTS(SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos)ORDER BY c.nome; ---------------------------------- --d)------------------------------ ---------------------------------- select d.nome, pa.votantes, pa.abstencoes, pa.inscritos, pa.brancos, pa.nulos, pa.votantes-pa.brancos-pa.nulos, sum(v.votos) from GTD7.freguesias f, GTD7.concelhos c, GTD7.distritos d, GTD7.votacoes v, GTD7.participacoes pa where v.freguesia=f.codigo and f.concelho=c.codigo and c.distrito=pa.distrito and c.distrito=d.codigo group by d.nome, pa.votantes, pa.abstencoes, pa.inscritos, pa.brancos, pa.nulos having sum(v.votos)+pa.brancos+pa.nulos+pa.abstencoes<>pa.inscritos; ---------------------------------- --e)------------------------------ ---------------------------------- select g.partido, round(100*(votosp/votost), 1), round(100*(mandatosp/mandatost), 1), round((votosp/votost-mandatosp/mandatost)*100,1) from (select partido, sum(votos) votosp from GTD7.votacoes group by partido) g, (select partido, sum(mandatos) mandatosp from GTD7.listas group by partido) m, (select sum(votantes) votost from GTD7.participacoes) tv, (select sum(mandatos) mandatost from GTD7.listas) tm where g.partido=m.partido; ---------------------------------- --f)------------------------------ ---------------------------------- select sigla from GTD7.partidos where sigla not in ( select sigla from GTD7.partidos, GTD7.distritos where (sigla,codigo) not in ( select partido, distrito from GTD7.listas where mandatos>0)); ------------------------------------------------------------------- --g1)-Partido Vencedor em cada distrito---------------------------- ------------------------------------------------------------------- WITH zonas_partidos AS (SELECT d.codigo AS codigo, SUM(v.votos) AS votos, v.partido AS partido FROM GTD7.distritos d, GTD7.concelhos c, GTD7.freguesias f, GTD7.votacoes v WHERE d.codigo = c.distrito AND c.codigo = f.concelho AND f.codigo = v.freguesia GROUP BY d.codigo, v.partido) SELECT d.nome, tmp.partido, tmp.votos FROM zonas_partidos tmp, GTD7.distritos d WHERE d.codigo = tmp.codigo AND NOT EXISTS(SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos) ORDER BY d.nome; ------------------------------------------------------------------- --g21)--Freguesia onde houve maioria absoluta---------------------- ------------------------------------------------------------------- WITH zonas_partidos AS (SELECT f.codigo AS codigo, f.nome AS nome, v.votos AS votos, v.partido AS partido FROM GTD7.freguesias f, GTD7.votacoes v WHERE f.codigo = v.freguesia ) SELECT tmp.nome, tmp.partido, ROUND(100*(tmp.votos / (total.votos+0.00001)), 1) FROM zonas_partidos tmp, (SELECT z.codigo AS codigo, SUM(z.votos) AS votos FROM zonas_partidos z GROUP BY z.codigo) total WHERE tmp.codigo = total.codigo AND NOT EXISTS( SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos) AND tmp.votos / (total.votos+0.00001) > 0.5 ORDER BY tmp.nome; SELECT COUNT(*) FROM ( WITH zonas_partidos AS (SELECT f.codigo AS codigo, f.nome AS nome, v.votos AS votos, v.partido AS partido FROM GTD7.freguesias f, GTD7.votacoes v WHERE f.codigo = v.freguesia ) SELECT tmp.nome, tmp.partido, ROUND(100*(tmp.votos / (total.votos+0.00001)), 1) FROM zonas_partidos tmp, (SELECT z.codigo AS codigo, SUM(z.votos) AS votos FROM zonas_partidos z GROUP BY z.codigo) total WHERE tmp.codigo = total.codigo AND NOT EXISTS( SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos) AND tmp.votos / (total.votos+0.00001) > 0.5 ORDER BY tmp.nome); ------------------------------------------------------------------- --g22)--Concelho onde houve maioria absoluta----------------------- ------------------------------------------------------------------- WITH zonas_partidos AS (SELECT c.codigo AS codigo, SUM(v.votos) AS votos, v.partido AS partido FROM GTD7.concelhos c, GTD7.freguesias f, GTD7.votacoes v WHERE c.codigo = f.concelho AND f.codigo = v.freguesia GROUP BY c.codigo, v.partido) SELECT c.nome, tmp.partido, ROUND(100*(tmp.votos / (total.votos+0.00001)), 1) FROM zonas_partidos tmp, GTD7.concelhos c, (SELECT z.codigo AS codigo, SUM(z.votos) AS votos FROM zonas_partidos z GROUP BY z.codigo) total WHERE tmp.codigo = total.codigo AND c.codigo = tmp.codigo AND NOT EXISTS(SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos) AND tmp.votos / (total.votos+0.00001) > 0.5 ORDER BY c.nome; ------------------------------------------------------------------- --g23)--Distrito onde houve maioria absoluta----------------------- ------------------------------------------------------------------- WITH zonas_partidos AS (SELECT d.codigo AS codigo, SUM(v.votos) AS votos, v.partido AS partido FROM GTD7.distritos d, GTD7.concelhos c, GTD7.freguesias f, GTD7.votacoes v WHERE d.codigo = c.distrito AND c.codigo = f.concelho AND f.codigo = v.freguesia GROUP BY d.codigo, v.partido) SELECT d.nome, tmp.partido, ROUND(100*(tmp.votos / (total.votos+0.00001)), 1) FROM zonas_partidos tmp, GTD7.distritos d, (SELECT z.codigo AS codigo, SUM(z.votos) AS votos FROM zonas_partidos z GROUP BY z.codigo) total WHERE tmp.codigo = total.codigo AND d.codigo = tmp.codigo AND NOT EXISTS(SELECT * FROM zonas_partidos tmp2 WHERE tmp2.codigo = tmp.codigo AND tmp2.partido != tmp.partido AND tmp.votos < tmp2.votos) AND tmp.votos / (total.votos+0.00001) > 0.5 ORDER BY d.nome; ------------------------------------------------------------------- --g3)--Distrito onde houve maioria absoluta por mandatos---------- -------------------------------------------------------------------
true
b5052464fd2f4411631cf19d606b822a8a8695a9
SQL
TaleLearnCode/CPL20ArchiveSite
/src/SQL/uspRetrieveSpeakersForSession.sql
UTF-8
419
4.125
4
[ "MIT" ]
permissive
CREATE PROCEDURE dbo.uspRetrieveSpeakersForSession ( @SessionId INT ) AS BEGIN SELECT DISTINCT Speaker.AspNetUserId, Contact.FirstName, Contact.LastName, Speaker.Biography FROM Speaker INNER JOIN Contact ON Contact.Id = Speaker.ContactId WHERE Speaker.AspNetUserId IN (SELECT SpeakerId FROM SessionSpeaker WHERE SessionId = @SessionId) END
true
1ba28404db858182aa6c5d6ac1e93b2cd7df0b4b
SQL
Gnana119/Database
/GeneralScripts/ComparePreviousRow_value_withCurrentRow.sql
UTF-8
1,878
4.28125
4
[]
no_license
--Select * from UserActivity -----------till SQL Server 2018 R2 -------------------- ;with UserActivitySplit (rownumber,[user],activity,activitytime,activitydate) AS ( Select ROW_NUMBER() OVER (Order by [user],activitytime) As RowNumber ,[user] ,Activity ,ActivityTime ,CAST(Activitytime as date) activitydate From UserActivity ) SELECT logon."user" As UserID ,Logon.activity ,Logon.activitydate ,Logoff.activitytime as logofftime ,logon.activitytime as LoginTime ,Datediff(minute,logoff.activitytime,logon.activitytime) As IdelTime FROM (Select * from UserActivitySplit where activity = 'LogON') As LogOn INNER JOIN (Select * from Useractivitysplit where activity = 'LogOff') As LogOff ON logon."user" = logoff."user" AND logon.activitydate = logoff.activitydate and logoff.rownumber = logon.rownumber-1 ----------------------------SQL Server 2012 and above------------------------ SELECT *, IdelTime = CASE Activity WHEN 'LogOn' THEN DATEDIFF(minute,LAG(activitytime,1) OVER (Order BY "user",activitytime),ActivityTime) ELSE NULL END FROM useractivity ;With LAGOptionUserActivities As ( Select Activity, CAST(Activitytime as date) as Activitydate, "user" as LogOnUser ,LAG("user",1) over(order by "user",activitytime) As LogoffUser ,activitytime as LogOnActivityTime ,LAG(activitytime,1) over(Order By "user",ActivityTime) As LogOffActivityTime ,CAST(ActivityTime As Date) As LogOnActivityDate ,CAST(LAG(activitytime,1) Over(Order By "user",ActivityTime) As Date) As LogOffActivityDate FROM UserActivity ) Select Activity ,logonuser ,Activitydate ,LogOnActivityTime ,LogOffActivityTime ,DATEDIFF(minute,LogOffActivityTime,LogOnActivityTime) As Ideltime FROM LAGOptionUserActivities Where Activity = 'LogOn' AND LogOffActivityTime is not null and LogOffActivityDate = LogOnActivityDate and LogoffUser = LogOnUser
true
85f77e974ab8afad8acd1cfd9dbfc7850d1ec02e
SQL
bruc3yan/lacdb
/sql/final.sql
UTF-8
16,443
3.25
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.3.10.4 -- http://www.phpmyadmin.net -- -- Host: mysql.claremontbooks.com -- Generation Time: May 15, 2014 at 05:05 AM -- Server version: 5.1.56 -- PHP Version: 5.3.27 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `zonkey` -- -- -------------------------------------------------------- -- -- Table structure for table `banned_customers` -- DROP TABLE IF EXISTS `banned_customers`; CREATE TABLE IF NOT EXISTS `banned_customers` ( `bid` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) NOT NULL, `notes` text, `bannedbystaff` varchar(64) NOT NULL, `dateunban` date NOT NULL, PRIMARY KEY (`bid`), KEY `sid` (`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Dumping data for table `banned_customers` -- -- -------------------------------------------------------- -- -- Table structure for table `customers` -- DROP TABLE IF EXISTS `customers`; CREATE TABLE IF NOT EXISTS `customers` ( `customerid` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) NOT NULL, `name` varchar(64) NOT NULL, `email` varchar(256) NOT NULL, `phone` varchar(64) NOT NULL, `school` varchar(64) NOT NULL, PRIMARY KEY (`customerid`), UNIQUE KEY `sid` (`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; -- -- Dumping data for table `customers` -- INSERT INTO `customers` (`customerid`, `sid`, `name`, `email`, `phone`, `school`) VALUES (1, 333, 'aaa', '', '', ''), (6, 40114398, 'bruce', '', '', 'hmc'), (7, 40156787, 'Angela', '', '', 'HMC'), (8, 40114399, 'Yan', '', '', 'HMC'), (9, 4444, '', '', '', 'HMC'); -- -------------------------------------------------------- -- -- Table structure for table `equipmentdata` -- DROP TABLE IF EXISTS `equipmentdata`; CREATE TABLE IF NOT EXISTS `equipmentdata` ( `equipmentid` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(256) NOT NULL, `qtyleft` int(11) DEFAULT '999', `notes` varchar(256) DEFAULT NULL, `ownerid` int(11) DEFAULT '0', PRIMARY KEY (`equipmentid`), KEY `ownerid` (`ownerid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ; -- -- Dumping data for table `equipmentdata` -- INSERT INTO `equipmentdata` (`equipmentid`, `name`, `qtyleft`, `notes`, `ownerid`) VALUES (2, 'Ping pong paddle', 0, 'peeling stickers...', 0), (3, 'billiards supply', 985, '3 sets', 0), (4, 'basketballs', 997, 'different brands', 0), (8, 'Volleyball', 85, 'blue and green', 0), (9, 'socks', 50, 'for zombies', 0), (11, 'balls', 90, 'what balls', 0); -- -------------------------------------------------------- -- -- Table structure for table `equipmentrentals` -- DROP TABLE IF EXISTS `equipmentrentals`; CREATE TABLE IF NOT EXISTS `equipmentrentals` ( `rentid` int(11) NOT NULL AUTO_INCREMENT, `equipmentid` int(11) NOT NULL, `sname` varchar(64) NOT NULL, `sid` int(11) NOT NULL, `dateout` date NOT NULL, `datein` date DEFAULT NULL, `school` varchar(64) NOT NULL, `timeout` datetime NOT NULL, `timein` datetime NOT NULL, `notes` text NOT NULL, `pid` int(11) DEFAULT NULL, PRIMARY KEY (`rentid`), KEY `sid` (`sid`), KEY `equipmentid` (`equipmentid`), KEY `pid` (`pid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Dumping data for table `equipmentrentals` -- INSERT INTO `equipmentrentals` (`rentid`, `equipmentid`, `sname`, `sid`, `dateout`, `datein`, `school`, `timeout`, `timein`, `notes`, `pid`) VALUES (2, 3, 'aa', 333, '2014-05-15', NULL, 'asdf', '2014-05-15 12:31:51', '0000-00-00 00:00:00', '', NULL), (6, 3, 'bruce', 40114398, '2014-05-15', NULL, 'hmc', '2014-05-15 00:00:00', '0000-00-00 00:00:00', '', NULL), (7, 3, 'Bruce Yan', 40114398, '2014-05-15', NULL, 'HNC', '2014-05-15 01:21:56', '0000-00-00 00:00:00', '', NULL), (8, 3, 'Bruce Yan', 40114398, '2014-05-15', NULL, 'HMC', '2014-05-15 01:22:32', '0000-00-00 00:00:00', '', NULL), (9, 3, '2', 40114398, '2014-05-15', NULL, '1', '2014-05-15 01:23:01', '0000-00-00 00:00:00', '', NULL), (10, 4, '1', 40114398, '2014-05-15', NULL, 'G', '2014-05-15 01:24:54', '0000-00-00 00:00:00', '', NULL), (11, 4, '1', 40114398, '2014-05-15', NULL, 'HNC', '2014-05-15 01:27:57', '0000-00-00 00:00:00', '', NULL), (12, 3, 'Angela', 40156787, '2014-05-15', '2014-05-15', 'HMC', '2014-05-15 01:28:59', '2014-05-15 01:30:30', 'done', NULL); -- -------------------------------------------------------- -- -- Table structure for table `found` -- DROP TABLE IF EXISTS `found`; CREATE TABLE IF NOT EXISTS `found` ( `itemid` int(11) NOT NULL AUTO_INCREMENT, `item` varchar(256) NOT NULL, `datefound` date NOT NULL, PRIMARY KEY (`itemid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Dumping data for table `found` -- INSERT INTO `found` (`itemid`, `item`, `datefound`) VALUES (1, 'Frisbee', '2014-05-12'); -- -------------------------------------------------------- -- -- Table structure for table `lost` -- DROP TABLE IF EXISTS `lost`; CREATE TABLE IF NOT EXISTS `lost` ( `itemid` int(11) NOT NULL AUTO_INCREMENT, `item` varchar(256) NOT NULL, `datelost` date NOT NULL, `description` varchar(256) NOT NULL, PRIMARY KEY (`itemid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Dumping data for table `lost` -- INSERT INTO `lost` (`itemid`, `item`, `datelost`, `description`) VALUES (1, 'water bottle', '2014-05-11', 'Bruce @ 213-555-0005'); -- -------------------------------------------------------- -- -- Table structure for table `lostandfound` -- DROP TABLE IF EXISTS `lostandfound`; CREATE TABLE IF NOT EXISTS `lostandfound` ( `itemid` int(11) NOT NULL AUTO_INCREMENT, `item` varchar(256) NOT NULL, `datefound` date NOT NULL, `returnedto` varchar(256) DEFAULT NULL, `datereturn` date DEFAULT NULL, `notes` text, `category` varchar(16) NOT NULL, PRIMARY KEY (`itemid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=125 ; -- -- Dumping data for table `lostandfound` -- INSERT INTO `lostandfound` (`itemid`, `item`, `datefound`, `returnedto`, `datereturn`, `notes`, `category`) VALUES (4, 'diet coke', '2014-05-15', 'me', '2014-05-15', 'coke', 'Lost'), (120, 'water bottle (purple)', '2014-05-14', 'reported by angela', '2014-05-15', 'actually it''s stolen out', 'Found'), (121, 'apple pie', '2014-05-13', 'ivan', '2014-05-15', 'it''s been eaten', 'Lost'), (122, 'slices of pie', '2014-05-14', 'lac staff', '2014-05-15', 'eaten by lac staff', 'Found'), (123, 'sdfasdfads', '0000-00-00', '', '2014-05-15', '', 'Lost'), (124, 'asdfa', '0000-00-00', '', '2014-05-15', '', 'Found'); -- -------------------------------------------------------- -- -- Table structure for table `mudderbikedata` -- DROP TABLE IF EXISTS `mudderbikedata`; CREATE TABLE IF NOT EXISTS `mudderbikedata` ( `bikeid` int(11) NOT NULL AUTO_INCREMENT, `available` varchar(4) NOT NULL DEFAULT 'Yes', `notes` varchar(256) DEFAULT NULL, `dateofbirth` date DEFAULT NULL, `dateofdeath` date DEFAULT NULL, PRIMARY KEY (`bikeid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; -- -- Dumping data for table `mudderbikedata` -- INSERT INTO `mudderbikedata` (`bikeid`, `available`, `notes`, `dateofbirth`, `dateofdeath`) VALUES (1, '0', NULL, NULL, NULL), (2, '0', NULL, NULL, NULL), (3, '0', NULL, NULL, NULL), (4, '0', 'Doesn''t show up in current database', NULL, NULL), (5, '0', NULL, NULL, NULL), (6, '0', NULL, NULL, NULL), (7, '0', NULL, NULL, NULL), (8, '0', NULL, NULL, NULL), (9, '0', NULL, NULL, NULL), (10, '1', 'Doesn''t show up in current database ', NULL, NULL), (11, '1', NULL, NULL, NULL), (12, '0', NULL, NULL, NULL), (13, '1', 'Doesn''t show up in current database ', NULL, NULL), (14, '1', NULL, NULL, NULL), (15, '1', NULL, NULL, NULL), (16, '1', NULL, NULL, NULL), (17, '1', NULL, NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `mudderbikerentals` -- DROP TABLE IF EXISTS `mudderbikerentals`; CREATE TABLE IF NOT EXISTS `mudderbikerentals` ( `rentid` int(11) NOT NULL AUTO_INCREMENT, `bikeid` int(11) NOT NULL, `sname` varchar(64) NOT NULL, `sid` int(11) NOT NULL, `waiver` varchar(4) NOT NULL, `dateout` date NOT NULL, `keyreturnedto` varchar(64) DEFAULT NULL, `datein` date DEFAULT NULL, `status` varchar(64) DEFAULT NULL, `latedays` int(11) DEFAULT NULL, `paidcollectedby` varchar(64) DEFAULT NULL, `notes` text, `pid` int(11) DEFAULT NULL, PRIMARY KEY (`rentid`), KEY `sid` (`sid`), KEY `bikeid` (`bikeid`), KEY `pid` (`pid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -- Dumping data for table `mudderbikerentals` -- INSERT INTO `mudderbikerentals` (`rentid`, `bikeid`, `sname`, `sid`, `waiver`, `dateout`, `keyreturnedto`, `datein`, `status`, `latedays`, `paidcollectedby`, `notes`, `pid`) VALUES (3, 4, '333', 333, 'a', '2014-05-15', NULL, NULL, '', NULL, NULL, '', NULL), (5, 9, 'number 9, bruce', 40114398, 'Y', '2014-05-15', NULL, NULL, '', NULL, NULL, '', NULL), (6, 10, 'Yan', 40114399, 'N', '2014-05-15', 'Ivan', '0000-00-00', 'Returned', 0, '', '', NULL), (7, 11, '', 4444, '', '2014-05-15', '', '0000-00-00', 'Returned', 0, '', '', NULL); -- -------------------------------------------------------- -- -- Table structure for table `owners` -- DROP TABLE IF EXISTS `owners`; CREATE TABLE IF NOT EXISTS `owners` ( `name` varchar(256) NOT NULL, `ownerid` int(11) NOT NULL, `description` varchar(256) DEFAULT NULL, `contactName` varchar(256) DEFAULT NULL, `contactNum` varchar(64) DEFAULT NULL, `contactEmail` varchar(256) DEFAULT NULL, PRIMARY KEY (`ownerid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `owners` -- INSERT INTO `owners` (`name`, `ownerid`, `description`, `contactName`, `contactNum`, `contactEmail`) VALUES ('LAC Public', 0, 'Public equipments that allow LAC users to check out.', 'Ivan Wong', NULL, 'iwong@hmc.edu'), ('LAC Private', 1, 'Private equipments for internal use only', 'Ivan Wong', NULL, 'iwong@hmc.edu'); -- -------------------------------------------------------- -- -- Table structure for table `payment_history_bike` -- DROP TABLE IF EXISTS `payment_history_bike`; CREATE TABLE IF NOT EXISTS `payment_history_bike` ( `pid` int(11) NOT NULL, `sid` int(11) NOT NULL, `amount` float NOT NULL, `staff` varchar(64) NOT NULL, `rentid` int(11) NOT NULL, PRIMARY KEY (`pid`), KEY `rentid` (`rentid`), KEY `sid` (`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `payment_history_bike` -- -- -------------------------------------------------------- -- -- Table structure for table `payment_history_equip` -- DROP TABLE IF EXISTS `payment_history_equip`; CREATE TABLE IF NOT EXISTS `payment_history_equip` ( `pid` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) NOT NULL, `amount` float NOT NULL, `staff` varchar(64) NOT NULL, `rentid` int(11) NOT NULL, PRIMARY KEY (`pid`), KEY `sid` (`sid`), KEY `rentid` (`rentid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; -- -- Dumping data for table `payment_history_equip` -- -- -------------------------------------------------------- -- -- Table structure for table `roomrentals` -- DROP TABLE IF EXISTS `roomrentals`; CREATE TABLE IF NOT EXISTS `roomrentals` ( `rentid` int(11) NOT NULL AUTO_INCREMENT, `roomid` int(11) NOT NULL, `sid` int(11) NOT NULL, `checkout` date NOT NULL, `timeout` datetime NOT NULL, `checkin` date NOT NULL, `timein` datetime NOT NULL, `notes` text NOT NULL, `status` varchar(4) DEFAULT NULL, PRIMARY KEY (`rentid`), KEY `roomid` (`roomid`), KEY `sid` (`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; -- -- Dumping data for table `roomrentals` -- INSERT INTO `roomrentals` (`rentid`, `roomid`, `sid`, `checkout`, `timeout`, `checkin`, `timein`, `notes`, `status`) VALUES (1, 1, 40114399, '2014-05-15', '2014-05-15 04:03:47', '2014-05-16', '2014-05-16 04:06:34', '', ''), (2, 1, 40114398, '2014-05-01', '2014-05-01 23:00:00', '2014-06-01', '2014-06-01 12:00:00', 'Test test test', NULL), (3, 2, 40156787, '2014-05-15', '2014-05-15 04:42:56', '2014-05-16', '2014-05-16 04:43:00', '1', ''), (4, 1, 40114398, '2014-05-01', '2014-05-01 23:00:00', '0000-00-00', '0000-00-00 00:00:00', 'yay', ''), (5, 1, 40114398, '2014-05-01', '2014-05-01 23:00:00', '2014-06-01', '2014-06-01 12:00:00', 'actually it''s stolen out', NULL); -- -------------------------------------------------------- -- -- Table structure for table `roomsdata` -- DROP TABLE IF EXISTS `roomsdata`; CREATE TABLE IF NOT EXISTS `roomsdata` ( `roomid` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) NOT NULL, PRIMARY KEY (`roomid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; -- -- Dumping data for table `roomsdata` -- INSERT INTO `roomsdata` (`roomid`, `name`) VALUES (1, 'Riggs Room'), (2, 'Baker Room'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `uid` int(11) NOT NULL AUTO_INCREMENT, `level` int(1) NOT NULL DEFAULT '9', `name` varchar(256) NOT NULL, `email` varchar(64) NOT NULL, `password` varchar(256) NOT NULL, `phone` varchar(64) DEFAULT NULL, `school` varchar(64) NOT NULL, `profile` text, PRIMARY KEY (`uid`), KEY `level` (`level`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`uid`, `level`, `name`, `email`, `password`, `phone`, `school`, `profile`) VALUES (1, 1, 'Bruce Yan', 'byan@hmc.edu', 'e203fe127f487098df65a701831606b724f974a073db7aa8d0f88ac02d133824', '310-907-6543', 'HMC', 'Perosnal Profile Info here'), (2, 1, 'Angela Zhou', 'azhou@hmc.edu', 'e203fe127f487098df65a701831606b724f974a073db7aa8d0f88ac02d133824', '909-767-1190', 'HMC', 'Perosnal Profile Info here'); -- -- Constraints for dumped tables -- -- -- Constraints for table `banned_customers` -- ALTER TABLE `banned_customers` ADD CONSTRAINT `banned_customers_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `equipmentdata` -- ALTER TABLE `equipmentdata` ADD CONSTRAINT `equipmentdata_ibfk_2` FOREIGN KEY (`ownerid`) REFERENCES `owners` (`ownerid`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `equipmentrentals` -- ALTER TABLE `equipmentrentals` ADD CONSTRAINT `equipmentrentals_ibfk_4` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `equipmentrentals_ibfk_1` FOREIGN KEY (`equipmentid`) REFERENCES `equipmentdata` (`equipmentid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `equipmentrentals_ibfk_3` FOREIGN KEY (`pid`) REFERENCES `payment_history_equip` (`pid`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `mudderbikerentals` -- ALTER TABLE `mudderbikerentals` ADD CONSTRAINT `mudderbikerentals_ibfk_1` FOREIGN KEY (`bikeid`) REFERENCES `mudderbikedata` (`bikeid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `mudderbikerentals_ibfk_2` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `payment_history_bike` -- ALTER TABLE `payment_history_bike` ADD CONSTRAINT `payment_history_bike_ibfk_2` FOREIGN KEY (`rentid`) REFERENCES `mudderbikerentals` (`rentid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `payment_history_bike_ibfk_1` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `payment_history_equip` -- ALTER TABLE `payment_history_equip` ADD CONSTRAINT `payment_history_equip_ibfk_2` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `payment_history_equip_ibfk_1` FOREIGN KEY (`rentid`) REFERENCES `equipmentrentals` (`rentid`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `roomrentals` -- ALTER TABLE `roomrentals` ADD CONSTRAINT `roomrentals_ibfk_1` FOREIGN KEY (`roomid`) REFERENCES `roomsdata` (`roomid`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `roomrentals_ibfk_2` FOREIGN KEY (`sid`) REFERENCES `customers` (`sid`) ON DELETE NO ACTION ON UPDATE NO ACTION;
true
067235329638211143e6518cf5462f1cfcfc76ee
SQL
gouldju1/r2sql
/cosql/resources/database/soccer_2/schema.sql
UTF-8
1,668
3.59375
4
[]
no_license
/* * SQL scripts for CS61 Intro to SQL lectures * FILENAME SOCCER2.SQL */ DROP TABLE IF EXISTS Player; DROP TABLE IF EXISTS Tryout; DROP TABLE IF EXISTS College; CREATE TABLE College ( cName varchar(20) NOT NULL, state varchar(2), enr numeric(5,0), PRIMARY KEY (cName) ); CREATE TABLE Player ( pID numeric(5,0) NOT NULL, pName varchar(20), yCard varchar(3), HS numeric(5,0), PRIMARY KEY (pID) ); CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3), PRIMARY KEY (pID, cName), FOREIGN KEY (pID) REFERENCES Player(pID), FOREIGN KEY (cName) REFERENCES College(cName) ); /* note that "left" and "right" are reserved words in SQL */ INSERT INTO College VALUES ('LSU', 'LA', 18000); INSERT INTO College VALUES ('ASU', 'AZ', 12000); INSERT INTO College VALUES ('OU', 'OK', 22000); INSERT INTO College VALUES ('FSU', 'FL', 19000); INSERT INTO Player VALUES (10001, 'Andrew', 'no', 1200); INSERT INTO Player VALUES (20002, 'Blake', 'no', 1600); INSERT INTO Player VALUES (30003, 'Charles', 'no', 300); INSERT INTO Player VALUES (40004, 'David', 'yes', 1600); INSERT INTO Player VALUES (40002, 'Drago', 'yes', 1600); INSERT INTO Player VALUES (50005, 'Eddie', 'yes', 600); INSERT INTO Tryout VALUES (10001, 'LSU', 'goalie', 'no'); INSERT INTO Tryout VALUES (10001, 'ASU', 'goalie', 'yes'); INSERT INTO Tryout VALUES (20002, 'FSU', 'striker', 'yes'); INSERT INTO Tryout VALUES (30003, 'OU', 'mid', 'no'); INSERT INTO Tryout VALUES (40004, 'ASU', 'goalie', 'no'); INSERT INTO Tryout VALUES (50005, 'LSU', 'mid', 'no');
true
09a620aac574a165d5bbb2122f558f9df06bcc6c
SQL
naysolange/students-payment-preferences
/db/create-tables.sql
UTF-8
1,388
3.53125
4
[]
no_license
USE students; CREATE TABLE payment_option ( id INTEGER NOT NULL AUTO_INCREMENT, description VARCHAR(100) NOT NULL, PRIMARY KEY (id) ); INSERT INTO payment_option(description) VALUES("Credit card (1 installment)"); INSERT INTO payment_option(description) VALUES("Credit card (3 installments)"); INSERT INTO payment_option(description) VALUES("Credit card (6 installments)"); INSERT INTO payment_option(description) VALUES("Debit card"); INSERT INTO payment_option(description) VALUES("Cash"); INSERT INTO payment_option(description) VALUES("Transfer"); CREATE TABLE student ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, career VARCHAR(255) NOT NULL, birth_date DATE, phone_number VARCHAR(50) NOT NULL, country VARCHAR(100) NOT NULL, city VARCHAR(100) NOT NULL, payment_option_id INTEGER, PRIMARY KEY (id), FOREIGN KEY (payment_option_id) REFERENCES payment_option(id) ); INSERT INTO student(name, email, career, birth_date, phone_number, country, city, payment_option_id) VALUES("Violeta Gonzalez", "violeta@gmail.com", "Data science", "1984-07-04", "541161507899", "Argentina", "CABA", 1); INSERT INTO student(name, email, career, birth_date, phone_number, country, city, payment_option_id) VALUES("Santiago Perez", "santiperez@gmail.com", "Data science", "1995-12-02", "541166989984", "Argentina", "CABA", 4);
true
c194b667627eaada33afcb5dde801e01336728c8
SQL
BayMaxx2001/Summer2021_term3
/DBI/PE SAMPLE/PE 02/3.sql
UTF-8
207
3.984375
4
[]
no_license
with t as( select c.name, count(fc.category_id) as 'Number of films' from film_category fc, category c where fc.category_id = c.category_id group by c.name) select t.* from t order by t.[Number of films] asc
true
8b825b604a78bc7503323b33c1d830dfa6bb6163
SQL
praveen-sivadasan/Spring
/SpringRest/Movieflix/database/tables_create.sql
UTF-8
3,613
3.640625
4
[]
no_license
/* Schema creation script */ /* 1. Code */ create table code( code_id_pk integer not null primary key auto_increment, value varchar(30) not null ); /* 2. */ create table code_master( code_master_id_pk integer not null primary key auto_increment, code_id_fk integer, value varchar(30) not null, foreign key(code_id_fk) references code(code_id_pk) ); /* 3. */ create table title( title_id_pk integer not null primary key auto_increment, title varchar(50) not null, title_type_id_fk integer, year varchar(20) not null, rating_id_fk integer, release_date date not null, runtime varchar(30) not null, director varchar(30) not null, writer varchar(30) not null, actors varchar(100) not null, plot varchar(200) not null, awards varchar(100) default 'N/A', user_rating float, poster varchar(100) default 'N/A', metascore varchar(100) default 'N/A', imdb_rating integer, imdb_votes varchar(100) default 'N/A', imdb_id varchar(100) not null, create_date date not null, delete_flag integer not null, foreign key(title_type_id_fk) references code_master(code_master_id_pk), foreign key(rating_id_fk) references code_master(code_master_id_pk) ); /* 4. */ create table title_language( title_language_id_pk integer not null primary key auto_increment, title_id_fk integer, language_id_fk integer, foreign key(title_id_fk) references title(title_id_pk), foreign key(language_id_fk) references code_master(code_master_id_pk) ); /* 5. */ create table title_country( title_country_id_pk integer not null primary key auto_increment, title_id_fk integer, country_id_fk integer, foreign key(title_id_fk) references title(title_id_pk), foreign key(country_id_fk) references code_master(code_master_id_pk) ); /* 6. */ create table title_genre( title_genre_id_pk integer not null primary key auto_increment, title_id_fk integer, genre_id_fk integer, foreign key(title_id_fk) references title(title_id_pk), foreign key(genre_id_fk) references code_master(code_master_id_pk) ); /* 7. */ create table user_details( user_details_id_pk integer not null primary key auto_increment, address varchar(70) not null, phone_number varchar(20) not null ); /* 8. */ create table account( account_id_pk integer not null primary key auto_increment, first_name varchar(30) not null, last_name varchar(30) not null, user_name varchar(30) not null, password varchar(30) not null, user_details_id_fk integer, gender_id_fk integer, email varchar(40) not null, account_role_id_fk integer, create_date date not null, foreign key(gender_id_fk) references code_master(code_master_id_pk), foreign key(account_role_id_fk) references code_master(code_master_id_pk), foreign key(user_details_id_fk) references user_details(user_details_id_pk) ); /* 9. */ create table user_fav_movie_genre( user_fav_movie_genre_id_pk integer not null primary key auto_increment, account_id_fk integer, genre_id_fk integer, foreign key(account_id_fk) references account(account_id_pk), foreign key(genre_id_fk) references code_master(code_master_id_pk) ); /* 10. */ create table user_title_rating( user_title_rating_id_pk integer not null primary key auto_increment, title_id_fk integer, account_id_fk integer, rating integer, foreign key(account_id_fk) references account(account_id_pk), foreign key(title_id_fk) references title(title_id_pk) ); /* 11. */ create table user_title_comment( user_title_comment_id_pk integer not null primary key auto_increment, title_id_fk integer, account_id_fk integer, comment varchar(300), create_date date not null, foreign key(account_id_fk) references account(account_id_pk), foreign key(title_id_fk) references title(title_id_pk) );
true
cd67d701fa47fc223d4f2c19526050fefd43e47d
SQL
edgar-code-repository/spring-boot-movies-rest-api
/sql/procedures/insert_genre.sql
UTF-8
215
2.640625
3
[]
no_license
CREATE PROCEDURE insert_genre (OUT genreId INT, IN name VARCHAR(150)) BEGIN declare genreId INT default 0; insert tbl_genre(name) values (name); set genreId = last_insert_id(); select genreId; END
true
fb8ef56c28bf572d6b5f3b9439b85a523445dcd6
SQL
andysarbini/new_hris
/db/mdl_office.sql
UTF-8
2,643
2.71875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 22, 2019 at 03:27 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `cms_bluehrd` -- -- -------------------------------------------------------- -- -- Table structure for table `mdl_office` -- CREATE TABLE `mdl_office` ( `office_id` int(11) NOT NULL, `office` varchar(64) NOT NULL, `alamat` text NOT NULL, `company_id` int(2) NOT NULL, `lon` varchar(16) NOT NULL, `lat` varchar(16) NOT NULL, `gmt` int(1) NOT NULL DEFAULT '7' COMMENT 'default ada di WIB +7', `no_prop` int(2) NOT NULL, `no_kab` int(2) NOT NULL, `status_id` int(1) NOT NULL, `induksi_id` int(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `mdl_office` -- INSERT INTO `mdl_office` (`office_id`, `office`, `alamat`, `company_id`, `lon`, `lat`, `gmt`, `no_prop`, `no_kab`, `status_id`, `induksi_id`) VALUES (11, 'BANTAR GEBANG RAYON A', 'alamat_dummy', 1, '106.984584', '-6.319249', 7, 32, 16, 1, 1), (12, 'BEKASI RAYON A', 'alamat_dummy', 1, '106.984584', '-6.319249', 7, 32, 16, 1, 1), (13, 'BEKASI RAYON B', 'alamat_dummy', 1, '106.984584', '-6.319249', 7, 32, 16, 1, 1), (14, 'CIBITUNG RAYON A', 'alamat_dummy', 3, '106.984584', '-6.319249', 7, 53, 11, 1, 1), (15, 'CIBITUNG RAYON B', 'alamat_dummy', 1, '106.984584', '-6.319249', 7, 32, 16, 1, 1), (16, 'BENOA RAYON', 'alamat_dummy', 2, '115.20996', '-8.80194', 8, 51, 1, 1, 1), (17, 'KALIASEM RAYON A', 'alamat_dummy', 1, '115.02285', '-8.17619', 7, 51, 1, 1, 1), (18, 'BIMA RAYON', 'alamat_dummy', 2, '118.728687', '-8.456958', 8, 52, 6, 1, 1), (19, 'LOMBOK TENGAH', 'alamat_dummy', 3, '116.273239', '-8.762127', 7, 52, 1, 1, 1), (20, 'LOMBOK TIMUR', 'alamat_dummy', 2, '116.092035', '-8.587546', 7, 53, 1, 1, 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `mdl_office` -- ALTER TABLE `mdl_office` ADD PRIMARY KEY (`office_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `mdl_office` -- ALTER TABLE `mdl_office` MODIFY `office_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; 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
55e79ac21a9bc32706faeb09bf65687358df0be0
SQL
alexferdinansyah/Inet2-DataAuditPSA
/DataAuditPSA/Query/DI_AUDIT_PSA01_DA.sql
UTF-8
2,137
2.59375
3
[]
no_license
-------------------------------------------------------- -- File created - Senin-Maret-25-2019 -------------------------------------------------------- -------------------------------------------------------- -- DDL for Table DI_AUDIT_PSA01 -------------------------------------------------------- CREATE TABLE "REPORTINTRA"."DI_AUDIT_PSA01" ( "CA_DSC" VARCHAR2(4000 BYTE), "CODE_TAX_PAY_METH" NUMBER(5,0), "DAT_ANN" DATE, "DAT_END_INT_PER" DATE, "DAT_EX" DATE, "DAT_FIRST_INT_PER" DATE, "DAT_INST_DEAD" DATE, "DAT_INT_RATE" DATE, "DAT_NEW_RED" DATE, "DAT_PAY" DATE, "DAT_REC" DATE, "DAT_START_PER" DATE, "ID_CA_CAPCO" CHAR(40 BYTE), "LST_UPD_TS" CHAR(17 BYTE), "MIN_DENM" NUMBER(32,6), "NEW_INT_RATE" NUMBER(5,2), "NUM_INT_PER" NUMBER(38,0), "PERC_INT_RATE" NUMBER(5,2), "PERC_PRE" NUMBER(5,2), "PERC_RED" NUMBER(23,20), "PERC_RED_PRI" NUMBER(5,2), "TYP_CA" NUMBER(5,0), "FLG_TAX" NUMBER(1,0), "INS_ID_INS_CAPCO" CHAR(40 BYTE), "ACCT_ID_ACCT_CAPCO_PROCEED" CHAR(40 BYTE), "ACCT_ID_ACCT_CAPCO_TAX" CHAR(40 BYTE), "CODE_STA" NUMBER(5,0), "ID_CAE_CAPCO" CHAR(40 BYTE), "LASTUPDATE" CHAR(17 BYTE), "ACCT_ID_ACCT_CAPCO" CHAR(40 BYTE), "ACCT_ID_ACCT_CAPCO_SRC" CHAR(40 BYTE), "AMT_GROSS" NUMBER(32,6), "AMT_TAX" NUMBER(32,6), "AMT_NET" NUMBER(32,6) ) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "REPORTINTRA" ; -------------------------------------------------------- -- Constraints for Table DI_AUDIT_PSA01 -------------------------------------------------------- ALTER TABLE "REPORTINTRA"."DI_AUDIT_PSA01" MODIFY ("DAT_ANN" NOT NULL ENABLE); ALTER TABLE "REPORTINTRA"."DI_AUDIT_PSA01" MODIFY ("ID_CA_CAPCO" NOT NULL ENABLE); ALTER TABLE "REPORTINTRA"."DI_AUDIT_PSA01" MODIFY ("CODE_STA" NOT NULL ENABLE); ALTER TABLE "REPORTINTRA"."DI_AUDIT_PSA01" MODIFY ("ID_CAE_CAPCO" NOT NULL ENABLE);
true
80fba5baf2e22461ea661a3c944811de33cc694a
SQL
Jamie0810/grpc-api
/migration/13_update-channels.sql
UTF-8
523
2.796875
3
[]
no_license
-- +goose Up -- SQL in this section is executed when the migration is applied. INSERT INTO `order_channels` (`id`, `channel_id`, `channel_name`, `is_enable`) VALUES (8, 'vgam', 'VGAM', 1), (9, 'atp', 'VATP', 1); INSERT INTO `order_channels` (`id`, `channel_id`, `channel_name`, `is_enable`) VALUES (10, 'shan6', 'SHAN6', 1); -- +goose Down -- SQL in this section is executed when the migration is rolled back. DELETE FROM `order_channels` WHERE `id` IN (8,9) ; DELETE FROM `order_channels` WHERE `id` IN (10);
true
c7557524f7e73a5354e835877f90a52531482938
SQL
zz0733/op-gbsql
/history/v1073/stat/V1.0.1.0051__C_player_transfer_collection.sql
UTF-8
1,110
3.328125
3
[]
no_license
-- auto gen by wayne 2016-11-30 19:53:11 CREATE TABLE IF NOT EXISTS player_transfer_collection ( id serial NOT NULL, transfer_type character varying(32) NOT NULL, api_id integer, comp_id integer, master_id integer, site_id integer NOT NULL, site_name character varying, transfer_date date, total_num integer, lost_num integer, success_num integer, fail_num integer, process_num integer, create_time TIMESTAMP, CONSTRAINT player_transfer_collection_pkey PRIMARY KEY (id) ) WITH (OIDS=FALSE) ; COMMENT ON TABLE player_transfer_collection IS '转账订单统计表--wayne'; COMMENT ON COLUMN player_transfer_collection.site_id IS '站点ID'; COMMENT ON COLUMN player_transfer_collection.transfer_date IS '转账日期'; COMMENT ON COLUMN player_transfer_collection.total_num IS '订单总数'; COMMENT ON COLUMN player_transfer_collection.lost_num IS '掉单数'; COMMENT ON COLUMN player_transfer_collection.success_num IS '成功数'; COMMENT ON COLUMN player_transfer_collection.fail_num IS '失败数'; COMMENT ON COLUMN player_transfer_collection.process_num IS '处理中的订单数';
true
d76b26e4dedbc7a2ca9eea6e1a0708e357beb12d
SQL
szintakacseva/datascience_for_webshops
/sql/kpi.sql
UTF-8
3,591
3.8125
4
[]
no_license
/*kpi.csv*/ WITH rfm_sid AS ( SELECT clientid, count(*) CountOfAllInteractions, count(distinct sid) CountOfSessions, sid, currency, sum(DISTINCT IF(status IN ('OS', 'OJ', 'OO', 'QS', 'QJ', 'QO', 'RS', 'RJ', 'RO'),1,0)) CountOfSales, sum(DISTINCT IF(status IN ('OS', 'OJ', 'OO', 'QS', 'QJ', 'QO', 'RS', 'RJ', 'RO'), cartvalue, 0)) ValueOfSales, sum(DISTINCT IF(status IN ('AS', 'AJ', 'AO'),1,0)) CountOfAbandons, sum(DISTINCT IF(status IN ('AS', 'AJ', 'AO'), cartvalue, 0)) ValueOfAbandons FROM whale WHERE clientid in ('tmp_clientid') AND sid is not null GROUP BY clientid, currency, sid ), rfm_browserid AS ( SELECT clientid, substr(sid, 14, 5) AS browserid, currency, sum(CountOfSessions) CountOfSessions, sum(CountOfSales) CountOfSales, ROUND(AVG(ValueOfSales)) AOV, sum(CountOfAbandons) CountOfAbandons, ROUND(AVG(ValueOfAbandons)) AAV FROM rfm_sid WHERE clientid in ('tmp_clientid') GROUP BY clientid, currency, substr(sid, 14, 5) ), rfm_lastorderdate AS ( SELECT clientid, substr(sid, 14, 5) AS browserid, currency, max(date_format(date_start, '%Y-%m-%d')) as LastOrderDate, max(date_format(date_start, '%Y-%m')) as LastOrderMonth, concat(date_format(max(date_start), '%Y'), '-', cast(quarter(max(date_start)) as varchar)) as OrderQuarter, date_diff('day', max(date_start), current_timestamp) as NrOfDaysSinceLastOrder FROM whale WHERE clientid in ('tmp_clientid') AND status in ('OS', 'OJ', 'OO', 'QS', 'QJ', 'QO', 'RS', 'RJ', 'RO') GROUP BY clientid, currency, substr(sid, 14, 5) ), rfm_lastabandondate AS ( SELECT clientid, substr(sid, 14, 5) AS browserid, currency, max(date_format(date_start, '%Y-%m-%d')) as LastAbandonDate, max(date_format(date_start, '%Y-%m')) as LastAbandonMonth, concat(date_format(max(date_start), '%Y'), '-', cast(quarter(max(date_start)) as varchar)) as AbandonQuarter, date_diff('day', max(date_start), current_timestamp) as NrOfDaysSinceLastAbandon FROM whale WHERE clientid in ('tmp_clientid') AND status in ('AS', 'AJ', 'AO') GROUP BY clientid, currency, substr(sid, 14, 5) ), rfm_all AS ( SELECT b.*, round(cast(b.CountOfAbandons as double)/cast(b.CountOfSessions as double),2) as AR, l.LastOrderDate, l.LastOrderMonth, l.OrderQuarter, l.NrOfDaysSinceLastOrder, a.LastAbandonDate, a.LastAbandonMonth, a.AbandonQuarter, a.NrOfDaysSinceLastAbandon FROM rfm_browserid b, rfm_lastorderdate l, rfm_lastabandondate a WHERE b.browserid = l.browserid and a.browserid = b.browserid ), bounce_rate_sid AS ( SELECT clientid, sid, substr(sid, 14, 5) AS browserid, count(sid) AS CountOfJsons FROM crab_dev WHERE clientid in ('tmp_clientid') AND sid is not null GROUP BY clientid, substr(sid, 14, 5), sid ), bounce_rate_browserid AS ( SELECT clientid, browserid, COUNT(CountOfJsons) AS Visits, COUNT(CASE WHEN CountOfJsons = 1 THEN CountOfJsons END) BRnumber FROM bounce_rate_sid WHERE clientid in ('tmp_clientid') GROUP BY clientid, browserid ), kpi AS ( select rfm.*, br.BRnumber, br.Visits, round(cast(br.BRnumber as double)/cast(br.Visits as double),4) as BR, round(cast(rfm.CountOfSales as double)/cast(br.Visits as double),4) as CR, rfm.CountOfSales*rfm.AOV as CLV from rfm_all rfm INNER JOIN bounce_rate_browserid br ON rfm.browserid = br.browserid ) select * from kpi
true
23a8d3975a535af1bd53ce2bdb9985cd37123793
SQL
ApurboRahman/spring-office-employee
/src/main/resources/db/20200404/db_create_script.sql
UTF-8
2,389
3.671875
4
[]
no_license
CREATE TABLE IF NOT EXISTS MENUS( MENU_ID SERIAL, MENU_NAME VARCHAR(100), DESCRIPTION VARCHAR(255), CREATE_USER VARCHAR(6), CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, CREATE_PGID VARCHAR(6), UPDATE_USER VARCHAR(6), UPDATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, UPDATE_PGID VARCHAR(6) ); CREATE SEQUENCE SEQ_MENU_ID AS INTEGER START 1 OWNED BY MENUS.MENU_ID; CREATE TABLE IF NOT EXISTS ROLES( ROLE_ID SERIAL, ROLE_NAME VARCHAR(100), DESCRIPTION VARCHAR(255), CREATE_USER VARCHAR(6), CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, CREATE_PGID VARCHAR(6), UPDATE_USER VARCHAR(6), UPDATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, UPDATE_PGID VARCHAR(6) ); CREATE SEQUENCE SEQ_ROLE_ID AS INTEGER START 1 OWNED BY ROLES.ROLE_ID; CREATE TABLE IF NOT EXISTS ROLE_MENU_PERMISSIONS ( ROLE_MENU_PERMISSION_ID SERIAL, MENU_ID INTEGER NOT NULL, ROLE_ID INTEGER NOT NULL, CREATE_USER VARCHAR(6), CREATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, CREATE_PGID VARCHAR(6), UPDATE_USER VARCHAR(6), UPDATE_DATE TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, UPDATE_PGID VARCHAR(6) ); CREATE SEQUENCE SEQ_ROLE_MENU_PERMISSION_ID AS integer START 1 OWNED BY ROLE_MENU_PERMISSIONS.ROLE_MENU_PERMISSION_ID; CREATE TABLE IF NOT EXISTS JOB_POSTS ( post_code VARCHAR(4) PRIMARY KEY NOT NULL, post_name TEXT NOT NULL, create_user VARCHAR(6) NOT NULL, create_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, create_pgid VARCHAR(15) NOT NULL, update_user VARCHAR(6) NOT NULL, update_date TIMESTAMP WITH TIME ZONE NOT NULL, update_pgid VARCHAR(15) NOT NULL ); CREATE TABLE IF NOT EXISTS DEPARTMENTS ( dept_code VARCHAR(6) PRIMARY KEY NOT NULL, dept_name VARCHAR(30), create_user VARCHAR(6) NOT NULL, create_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, create_pgid VARCHAR(15) NOT NULL, update_user VARCHAR(6) NOT NULL, update_date TIMESTAMP WITH TIME ZONE NOT NULL, update_pgid VARCHAR(15) NOT NULL );
true
f56653da9099814a18a82505133c0c9a96164455
SQL
haochenprophet/database
/biosecurity.sql
UTF-8
7,455
3.21875
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `biosecurity` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `biosecurity`; -- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64) -- -- Host: localhost Database: biosecurity -- ------------------------------------------------------ -- Server version 8.0.13-commercial /*!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 */; 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 `report` -- DROP TABLE IF EXISTS `report`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `report` ( `idreport` int(11) NOT NULL AUTO_INCREMENT, `uuid` varchar(45) NOT NULL, `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `when` datetime NOT NULL, `where` varchar(400) NOT NULL COMMENT 'detailed address', `nation` varchar(100) NOT NULL, `province` varchar(100) NOT NULL, `city` varchar(100) NOT NULL, `organization` varchar(400) NOT NULL COMMENT 'Hospital name', `who` varchar(45) NOT NULL COMMENT 'Patient name', `id_card` varchar(45) NOT NULL, `phone` varchar(45) DEFAULT NULL COMMENT 'Patient''s contact phone number', `address` varchar(45) DEFAULT NULL COMMENT 'Patient''s contact address', `profession` varchar(45) DEFAULT NULL, `place` varchar(45) DEFAULT NULL COMMENT 'Work place', `guardian` varchar(45) DEFAULT NULL COMMENT 'Guardian name', `contact` varchar(450) DEFAULT NULL COMMENT 'Guardian Contact', `what` varchar(800) DEFAULT NULL COMMENT 'Content of report', `why` varchar(800) DEFAULT NULL COMMENT 'cause of disease', `etiology` varchar(100) DEFAULT NULL COMMENT 'Virus name, bacteria name, ', `contagious` varchar(45) DEFAULT NULL COMMENT 'Is it contagious', `how` varchar(800) DEFAULT NULL COMMENT 'How to deal with and solve', `level` varchar(45) NOT NULL DEFAULT 'normal' COMMENT 'emergency level:normal,high,low', `amount` int(11) NOT NULL DEFAULT '1', `reporter` varchar(200) DEFAULT NULL COMMENT 'reporter', `telephone` varchar(45) DEFAULT NULL COMMENT 'reporter telephone', `priority` int(11) DEFAULT '0' COMMENT 'Priority of feedback processing', `status` varchar(45) DEFAULT NULL COMMENT 'Current processing status', `remark` varchar(1000) DEFAULT NULL, `feedback` varchar(1000) DEFAULT NULL, `result` varchar(1000) DEFAULT NULL, `file` varchar(450) DEFAULT NULL COMMENT 'Medical records file Video url or UUID', `video` varchar(450) DEFAULT NULL COMMENT 'Video url or UUID', `audio` varchar(450) DEFAULT NULL COMMENT 'audio url or UUID', `image` varchar(450) DEFAULT NULL COMMENT 'image url or UUID', PRIMARY KEY (`idreport`,`uuid`,`time`,`when`,`nation`,`province`,`city`,`organization`,`who`,`id_card`), UNIQUE KEY `idreport_UNIQUE` (`idreport`), UNIQUE KEY `uuid_UNIQUE` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' Direct Report System'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `report` -- LOCK TABLES `report` WRITE; /*!40000 ALTER TABLE `report` DISABLE KEYS */; /*!40000 ALTER TABLE `report` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `url` -- DROP TABLE IF EXISTS `url`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `url` ( `idurl` int(11) NOT NULL AUTO_INCREMENT, `who` varchar(45) DEFAULT NULL COMMENT 'who create the link item .', `what` varchar(100) NOT NULL COMMENT 'what the link item information ?', `type` varchar(45) DEFAULT NULL, `url` varchar(200) NOT NULL COMMENT 'where the URL address', `logo` varchar(200) NOT NULL COMMENT 'where the URL logo path', `when` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'the link create time .', `status` varchar(45) DEFAULT NULL, `remark` varchar(200) DEFAULT NULL, `priority` int(11) NOT NULL DEFAULT '0', `where` varchar(45) NOT NULL DEFAULT 'china', PRIMARY KEY (`idurl`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='URL links .'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `url` -- LOCK TABLES `url` WRITE; /*!40000 ALTER TABLE `url` DISABLE KEYS */; INSERT INTO `url` VALUES (1,'198382.com','CDC_GOV','website','https://www.cdc.gov/','img/biosecurity.jpg','2020-03-21 14:02:02','normal','utf8',0,'china'),(2,'198382.com','CDC_CN','website','http://www.chinacdc.cn/','img/biosecurity.jpg','2020-03-21 14:04:12','normal','utf8',0,'china'),(3,'198382.com','WHO','website','https://www.who.int/','img/who.jpg','2020-03-21 14:10:19','normal','utf8',0,'china'),(4,'198382.com','中草药(Chinese Herbal Antidote)','website','http://www.tiprpress.com','img/herbs.jpg','2020-03-24 18:54:53','normal','utf8',0,'china'),(5,'198382.com','Epidemiology Direct Reporting System','website','biosecurity_report.php','img/biosecurity.jpg','2020-06-10 17:26:06','normal','utf8',0,'china'); /*!40000 ALTER TABLE `url` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `virus` -- DROP TABLE IF EXISTS `virus`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `virus` ( `idvirus` int(11) NOT NULL AUTO_INCREMENT, `uuid` varchar(45) NOT NULL, `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `name` varchar(200) NOT NULL, `type` varchar(45) NOT NULL COMMENT 'Animals, plants, bacteria, viruses', `structure` varchar(45) NOT NULL COMMENT 'Biological structure Single-stranded RNA viruses, double-stranded RNA viruses, single-stranded DNA viruses and double-stranded DNA viruses', `contagious` varchar(45) NOT NULL COMMENT 'Is it contagious', `conceal` int(11) NOT NULL DEFAULT '0' COMMENT 'Virus incubation period', `level` int(11) NOT NULL DEFAULT '0' COMMENT 'Levels of danger', `infectiousness` varchar(1000) DEFAULT NULL COMMENT 'infect way', `origin` varchar(1000) DEFAULT NULL COMMENT 'Virus origin', `who` varchar(45) DEFAULT NULL COMMENT 'author', `status` varchar(45) DEFAULT NULL, `remark` varchar(1000) DEFAULT NULL, PRIMARY KEY (`idvirus`,`uuid`,`time`,`name`,`type`,`structure`,`contagious`), UNIQUE KEY `idvirus_UNIQUE` (`idvirus`), UNIQUE KEY `name_UNIQUE` (`name`), UNIQUE KEY `uuid_UNIQUE` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `virus` -- LOCK TABLES `virus` WRITE; /*!40000 ALTER TABLE `virus` DISABLE KEYS */; /*!40000 ALTER TABLE `virus` 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-06-13 20:08:08
true
9aacd9b1dbbdfdc803b33e4df3311c0c9eadd0c9
SQL
zhangjunfang/nsp
/MyEclipse 10/auditworks/target/classes/schema.sql
UTF-8
1,442
3.6875
4
[]
no_license
-- ============ mybatis ============ -- drop table account; create table account ( userid varchar(80) not null, email varchar(80) not null, name varchar(80) not null, constraint pk_account primary key (userid) ); -- ============ shiro ============ --users create table users ( username varchar(255) primary key, password varchar(255) not null ); create table roles ( role_name varchar(255) primary key ); create table user_roles ( username varchar(255) not null, role_name varchar(255) not null, constraint user_roles_uq unique ( username, role_name ) ); create table roles_permissions ( role_name varchar(255) not null, permission varchar(255) not null, primary key (role_name, permission) ); -- ============ mybatis ============ INSERT INTO account VALUES('id1','beyondj2ee@gmail.com','justine'); INSERT INTO account VALUES('id2','beyondj2ee+mybatis@gmail.com','daniel'); -- ============ shiro ============ insert into users values ('user1', 'user1' ); insert into users values ('user2', 'user2' ); insert into roles values ( 'role1' ); insert into roles values ( 'role2' ); insert into user_roles values ( 'user1', 'role1' ); insert into user_roles values ( 'user1', 'role2' ); insert into user_roles values ( 'user2', 'role2' ); insert into roles_permissions values ( 'role1', 'permission1'); insert into roles_permissions values ( 'role1', 'permission2'); insert into roles_permissions values ( 'role2', 'permission1'); commit;
true
49c581f346de946fa09501fdb7d51bd5d8665d4e
SQL
meldig/SQL
/modification/correction_erreurs_geometrie_ta_sur_topo_g.sql
UTF-8
4,318
3.625
4
[]
no_license
SET SERVEROUTPUT ON DECLARE BEGIN SAVEPOINT POINT_SAVE_TA_SUR_TOPO_G; /* Cette procédure a pour objectif de corriger les erreurs de géométrie présentes dans la table TA_SUR_TOPO_G. Les erreurs corrigées ci-dessous sont celles identifiées dans la table, ça ne veut pas dire que tous les types d'erreurs sont corrigés. Seuls ceux qui ont été identifiés le sont. */ -- Erreur 13349 -> auto intersection UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_UTIL.RECTIFY_GEOMETRY(a.geom, 0.005) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = '13349'; -- Erreur 13356 -> géométries disposant de sommets en doublons UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_GEOM.SDO_BUFFER(a.geom, 0, 0.001) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = '13356'; -- Erreur 13367 -> Mauvaise orientation des anneaux intérieurs/extérieurs UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_UTIL.RECTIFY_GEOMETRY(a.geom, 0.005) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = '13367'; -- Erreur 13366 et 13350 ainsi que les géométries de type 2004 UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = ( SELECT SDO_AGGR_UNION(SDOAGGRTYPE(b.geom, 0.001)) FROM GEO.TA_SUR_TOPO_G b WHERE a.objectid = b.objectid ) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) IN ('13366', '13350') OR a.geom.sdo_gtype = 2004; -- Suppression des entités ne disposant pas de géométrie DELETE FROM GEO.TA_SUR_TOPO_G a WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = 'NULL'; -- Correction des polygones ne disposant que de trois sommets au lieu des quatre minimum requis UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_GEOM.SDO_BUFFER(a.geom, 0, 0.005) WHERE SDO_UTIL.GETNUMVERTICES(a.geom)=3 ; -- Suppression des objets de type point (qui n'ont rien à faire dans cette table) DELETE FROM GEO.TA_SUR_TOPO_G a WHERE a.geom.sdo_gtype = 2001; -- Suppression des objets de type ligne DELETE FROM GEO.TA_SUR_TOPO_G a WHERE a.geom.sdo_gtype = 2002; ------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------- -- Seconde partie des corrections -- Erreur 13349 -> auto intersection - Correction des objets dont les corrections précédentes auraient pu provoquer cette erreur UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_UTIL.RECTIFY_GEOMETRY(a.geom, 0.005) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = '13349'; -- Erreur 13356 -> géométries disposant de sommets en doublons - correction de cette erreur que les corrections ci-dessus n'ont pu corriger UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = SDO_UTIL.RECTIFY_GEOMETRY(a.geom, 0.005) WHERE SUBSTR(SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.geom, 0.005), 0, 5) = '13356'; -- Transformation du type collection en type polygone. Cette requête résulte des transformations dues aux requêtes précédentes UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = ( SELECT SDO_AGGR_UNION(SDOAGGRTYPE(b.geom, 0.001)) FROM GEO.TA_SUR_TOPO_G b WHERE a.objectid = b.objectid ) WHERE a.geom.sdo_gtype = 2004; -- Correction des arcs : tout arc est transformé en lignes simples UPDATE GEO.TA_SUR_TOPO_G a SET a.geom = sdo_geom.sdo_arc_densify(a.GEOM,0.005,'arc_tolerance=0.05 unit=m') WHERE geo.get_info(a.geom,2)=1005 OR geo.get_info(a.geom,2)=1003 and geo.get_info(a.geom,3) in (4,2); COMMIT; -- En cas d'erreur une exception est levée et un rollback effectué, empêchant ainsi toute modification de se faire et de retourner à l'état de la table précédent. EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('L''erreur ' || SQLCODE || 'est survenue. Un rollback a été effectué : ' || SQLERRM(SQLCODE)); ROLLBACK TO POINT_SAVE_TA_SUR_TOPO_G; END;
true
2fd63992c07486df1345d03af06f6ce4ac3f8c6f
SQL
michaellee2245/group-project
/db/task/get_by_name.sql
UTF-8
736
4.09375
4
[]
no_license
/* Get the latest task with the given name */ SELECT task.id AS id, task.board_id AS board_id, task.owner_id AS owner_id, task.name AS name, task.priority AS priority, task.status AS status, to_char(task.start_date, 'MM/DD/YYYY') AS start_date, task.position AS position, task.group_name AS group, to_char(task.end_date, 'MM/DD/YYYY') AS end_date, task.time_est AS time_est, to_char(task.ts, 'MM/DD/YYYY HH12:MI AM') AS ts, owner.name AS owner, owner.profile_pic AS owner_pic, board.name AS board_name, team.name AS team FROM task JOIN person AS owner ON owner.id = task.owner_id JOIN board ON board.id = task.board_id JOIN team ON board.team = team.id WHERE task.name = $1 ORDER BY task.ts DESC LIMIT 1;
true
1eb9801b63b4f53013edbbeda300ff9810d9a221
SQL
romulovieira777/Curso_Mysql
/Aula_41.sql
UTF-8
801
3.421875
3
[]
no_license
/* Escolhendo um Banco de Dados */ USE db_biblioteca; /* Criando uma Tabela */ CREATE TABLE camisas ( idCamisa TINYINT PRIMARY KEY AUTO_INCREMENT, nome VARCHAR(25), tamanho ENUM('Pequena', 'Média', 'Grande', 'Extra-Grande') ); /* Inserindo Dados na Tabela */ INSERT INTO camisas ( nome, tamanho ) VALUES ( 'regata', 'grande' ); /* Selecionando Dados de uma Tabela */ SELECT * FROM camisas; /* Inserindo Dados na Tabela */ INSERT INTO camisas ( nome, tamanho ) VALUES ( 'social', 'Média' ), ( 'Polo', 'Pequena' ), ( 'Polo', 'Grande' ), ( 'Camiseta', 'Extra-Grande' ); /* Selecionando Dados da Tabela */ SELECT * FROM camisas; /* Consultando os Valores Permissíveis na Coluna */ SHOW COLUMNS FROM camisas LIKE 'tamanho';
true
42c915241afbcebc73cc7eec2f062e6ccac67e36
SQL
MariaAlonsoLopez/Proyecto_BBDD
/Listado_socios.sql
ISO-8859-10
1,943
3.40625
3
[]
no_license
SET SERVEROUTPUT ON; /** ##### REQ 3: LISTADO DE SOCIOS Y SUS ABONADOS ###################################################################################### **/ SET SERVEROUTPUT ON; CREATE OR REPLACE PROCEDURE listado_socios IS --Cursor que almacena los socios CURSOR c_socios IS SELECT n_socio, nombre, antiguedad FROM socio; r_socios c_socios%ROWTYPE; --Cursor que devuelve los abonados de dicho socio CURSOR c_abonado (socio NUMBER) IS SELECT n_abonado, nombre , parentesco FROM abonado WHERE n_socio=socio; r_abonado c_abonado%ROWTYPE; v_contador_abonados NUMBER := 0; BEGIN --Abrimos el primer cursor que devolvera todos los socios OPEN c_socios; DBMS_OUTPUT.PUT_LINE('SOCIOS Y SUS ABONADOS: '); LOOP FETCH c_socios INTO r_socios; EXIT WHEN c_socios%NOTFOUND; DBMS_OUTPUT.PUT_LINE('********************************************'); DBMS_OUTPUT.PUT_LINE('--N socio: '||r_socios.n_socio); DBMS_OUTPUT.PUT_LINE('--Nombre: ' || r_socios.nombre); DBMS_OUTPUT.PUT_LINE('--Antiguedad: ' || r_socios.antiguedad); --Trabajamos con el segundo cursor que nos dara los abonados de ese socio DBMS_OUTPUT.PUT_LINE('--ABONADOS: '); FOR r_abonado IN c_abonado(r_socios.n_socio) LOOP DBMS_OUTPUT.PUT_LINE('----N abonado: '||r_abonado.n_abonado || ' Nombre: '||r_abonado.nombre || ' Parentesco: '|| r_abonado.parentesco); v_contador_abonados := v_contador_abonados+1; END LOOP; --Bucle abonados DBMS_OUTPUT.PUT_LINE('--N total abonados: '|| v_contador_abonados); v_contador_abonados := 0; END LOOP; --Bucle socios CLOSE c_socios; END; / /** #################################################################################################################################### **/
true
7b4456e47e094535076e8da6c4172c00212828f6
SQL
sabbccc/GameShop
/Queries(Main DB_No fragments)/Main.sql
UTF-8
417
2.765625
3
[]
no_license
--main SET VERIFY OFF; SET SERVEROUTPUT ON; accept x char prompt 'Please enter operation: '; accept y char prompt 'Please enter search type(product/publisher): '; accept z char prompt 'Please enter product/publisher name: '; DECLARE a varchar2(10); b varchar2(10); c product.ptitle%Type; BEGIN a := '&x'; b := '&y'; c := '&z'; if(a = 'Search' and b = 'product') then product_proc(c); end if; END; /
true
fd0ac06d4dbe2adda058e04f495d3b89e4040df0
SQL
CUBRID/cubrid-testcases
/sql/_13_issues/_11_2h/cases/bug_bts_6314.sql
UTF-8
589
2.734375
3
[ "BSD-3-Clause" ]
permissive
create table t1 (c char(10), unique key uk1 (c)); create table t2 (c char(10), unique key uk2 (c)); create table t3 (c char(10), unique key uk3(1)); create table t4 (c char(10), unique key uk4 (c(1))); create table t5 (a int, b int, unique key uk5 (a,b)); create table t6 (a int, b int, unique key uk6 (1,2)); create table t7 (c char(10), unique key uk7(c) DEFERRABLE); create table t8 (c char(10), unique key uk8 (c) INITIALLY DEFERRED); create table t9 (a int, b int, unique key uk9 (1,2) DEFERRABLE); drop table t1; drop table t2; drop table t5; drop table t7; drop table t8;
true
0075706a2e1e8d602935b24a4f26478dc9aa4394
SQL
JeongYunu/SQL
/Ex/Ex01.sql
UTF-8
4,115
4.3125
4
[]
no_license
--select절 from절 --모든 컬럼들 조회하기 select * from employees; select * from departments; --원하는 컬럼만 조회하기 select employee_id, first_name, first_name, last_name from employees; --출력할때 컬럼에 별명 사용하기/원컬럼은 변하지않음 select employee_id as empNO, --as키워드 는 대문자로만 표기 됨 first_name "F-name", --as는 누락해도 상관없음 salary "상 금" --공백이나 특수기호는 ""로 감싸야함 from employees; --예제 select first_name 이름, phone_number 전화번호, hire_date 입사일, salary 급여 from employees; select employee_id 사원번호, first_name 성, last_name 이름, salary 연봉, phone_number 전화번호, email 이메일, hire_date 입사일 from employees; --연결 연산자(concatenation)로 컬럼들 붙이기 select first_name, last_name from employees; select first_name || last_name --2컬럼을 하나의 컬럼으로 from employees; select first_name ||''|| last_name --||은 더하기 역할 자바로치면 "first_name" + "" + "last_name" from employees; select first_name ||'-'|| last_name --따옴표안에 문자를 출력할수있다 from employees; select first_name ||' hire date is '|| hire_date as 입사일 --as생략가능 from employees; --산술 연산자 사용하기 select first_name, salary from employees; select first_name, salary, salary*12 -- 사칙연산 모두 가능 from employees; select first_name, salary, salary*12, (salary+300)*12 from employees; select job_id --job_id*12 숫자만 가능 from employees; select first_name || '-' || last_name 성명, salary 급여, (salary*12) 연봉, salary*12+5000 연봉2, phone_number 전화번호 from employees; --where절 select first_name, department_id from employees where department_id = 10; --비교연산자 예제 select first_name from employees where salary >= 15000; select first_name, hire_date from employees where hire_date >= '07/01/01'; select salary from employees where first_name = 'Lex'; select first_name, salary from employees where salary >= 14000 and salary <= 17000; --예제 select first_name, salary from employees where salary <= 14000 or salary >= 17000; select first_name, hire_date from employees where hire_date >= '04/01/01' and hire_date <= '05/12/31'; --where절 between연산자로 특정구간 값 출력하기 select first_name, salary from employees where salary between 14000 and 17000; --작은값을 앞에 큰값을 뒤에 두값을 모두 포함하는 결과를 출력 --IN 연산자로 여러 조건을 검사하기 select first_name, last_name, salary from employees where first_name in ('Neena', 'Lex', 'John'); select first_name, last_name, salary from employees where first_name = 'Neena' or first_name = 'Lex' or first_name = 'John'; --in연산자 예제 select first_name, salary from employees where salary = 2100 or salary = 3100 or salary = 4100 or salary = 5100; select first_name, salary from employees where salary in (2100, 3100, 4100, 5100); --Like 연산자로 비슷한것들 모두 찾기 select first_name, last_name, salary from employees where first_name like 'L%'; --Like연산자 예제 select first_name, salary from employees where first_name like '%am%'; --이름에 am 을 포함한 select first_name, salary from employees where first_name like '_a%'; --이름의 두번째 글자가 a 일경우 출력 select first_name from employees where first_name like '___a%'; --이름의 네번째 글자가 a 일경우 출력 select first_name from employees where first_name like '__a_'; --이름이 4글자인 사원중 끝에서 두번째 글자가 a 일경우 출력
true
c21ca2bb999ccd30fd37f48bbe5b21e403fadbe9
SQL
silence-do-good/stress-test-Postgres-and-MySQL
/dump/high/day26/select0025.sql
UTF-8
403
3.546875
4
[]
no_license
SELECT obs.sensor_id, avg(counts) FROM (SELECT sensor_id, date_trunc('day', timestamp), count(*) as counts FROM WiFiAPObservation WHERE timestamp>'2017-11-25T00:25:00Z' AND timestamp<'2017-11-26T00:25:00Z' AND SENSOR_ID = ANY(array['thermometer7','3146_clwa_6049','3141_clwa_1420','wemo_01','3145_clwa_5231']) GROUP BY sensor_id, date_trunc('day', timestamp)) AS obs GROUP BY sensor_id
true
fd812bd7f33ab7729c6f960b9718ad70864cf246
SQL
50minutos/MOC-10776
/SSMS/10776/020.sql
ISO-8859-1
1,404
3.40625
3
[]
no_license
USE DB SELECT * FROM SYS.fulltext_languages CREATE TABLE EXEMPLO_FULLTEXT ( COD_EXEMPLO_FULLTEXT INT IDENTITY PRIMARY KEY, DADOS_EXEMPLO_FULLTEXT TEXT ) INSERT EXEMPLO_FULLTEXT VALUES ('ABC DO TRUCO'), ('BATATINHA QUANDO NASCE'), ('PLANTAO DE BATATA SEM MESTRE'), ('TRUCO SEM MESTRE') SELECT * FROM EXEMPLO_FULLTEXT WHERE DADOS_EXEMPLO_FULLTEXT = 'XXX' SELECT * FROM EXEMPLO_FULLTEXT WHERE DADOS_EXEMPLO_FULLTEXT LIKE '%MESTRE%' CREATE FULLTEXT CATALOG DB WITH ACCENT_SENSITIVITY = ON AS DEFAULT SELECT DB_NAME() EXEC SP_FULLTEXT_DATABASE ENABLE EXEC sp_help EXEMPLO_FULLTEXT EXEC SP_FULLTEXT_TABLE EXEMPLO_FULLTEXT, 'CREATE', 'DB', 'PK__EXEMPLO___CFDC277C4F2F915E' EXEC SP_FULLTEXT_COLUMN EXEMPLO_FULLTEXT, 'DADOS_EXEMPLO_FULLTEXT', 'ADD', 'BRAZILIAN' EXEC SP_FULLTEXT_TABLE EXEMPLO_FULLTEXT, 'ACTIVATE' ALTER FULLTEXT INDEX ON EXEMPLO_FULLTEXT SET CHANGE_TRACKING = AUTO --CRIAR AGENDAMENTO PARA CADA 5 MINUTOS SELECT * FROM EXEMPLO_FULLTEXT WHERE CONTAINS(DADOS_EXEMPLO_FULLTEXT, 'TRUCO') SELECT * FROM EXEMPLO_FULLTEXT WHERE CONTAINS(DADOS_EXEMPLO_FULLTEXT, 'BATATA AND NOT MESTRE OR TRUCO AND NOT MESTRE') SELECT * FROM EXEMPLO_FULLTEXT WHERE CONTAINS(DADOS_EXEMPLO_FULLTEXT, 'NEAR((TRUCO, MESTRE), 2, TRUE)') SELECT * FROM EXEMPLO_FULLTEXT WHERE FREETEXT(DADOS_EXEMPLO_FULLTEXT, 'BATATA') SELECT * FROM SYS.fulltext_system_stopwords WHERE language_id = 1046 --agnaldo@50minutos.com.br
true
cfd0e14efc5469f2eab526374ea7915bcff6ac3f
SQL
JZuegg/CastDB_SQL
/DataModel/Run_Tbl_ScreenRun.sql
UTF-8
3,058
2.953125
3
[]
no_license
-- ==================================================================== -- Definition -- ==================================================================== @../Schema/CastDB_Define.sql -------------------------------------------------- -- Table Definition -------------------------------------------------- DEFINE xTable=ScreenRun DEFINE xTrigger=ScrRun DEFINE xID=Run_ID -- Drop Table &xTable.; Create Table &xTable. ( Run_ID Varchar2(55), Run_Name Varchar2(100), Run_Type Varchar2(5), Project_Lst Varchar2(512), CpOz_ID Varchar2(50), Stock_Format Varchar2(50), wf_nStock_Plates Number(7,0), wf_nMother_Plates Number(7,0), wf_nTest_Plates Number(7,0), wf_Plating Varchar2(50), wf_Plating_Date Date, wf_Plating_Ready Date, wf_Screens Varchar2(150), Run_Issues Varchar2(250), Run_Status Varchar2(150), Next_Selection Varchar2(50), Screen_Date Date, nCompound Number(7,0), nAssay Number(7,0), nMotherPlate Number(7,0), nTestPlate Number(7,0), nInhibition Number(7,0), nMIC Number(7,0), nCytotox Number(7,0), nHaemolysis Number(7,0), nCMC Number(7,0), nQC Number(7,0), Status Number(3), aCreatedBy Varchar2(20), aCreatedDate Date, aModifiedBy Varchar2(20), aModifiedDate Date, CONSTRAINT &xTrigger._PKey PRIMARY KEY(&xID.) ) TABLESPACE &TBLSPACE_DAT; -- ==================================================================== -- Standard Trigger and Grants -- ==================================================================== @../Schema/stdTrigger.sql @../Schema/stdGrant.sql -- ==================================================================== -- Sequence -- ==================================================================== Drop Sequence &xTrigger._PS_SEQ; Drop Sequence &xTrigger._HC_SEQ; Drop Sequence &xTrigger._HV_SEQ; Delete From &APPLICATION_ID. Where ID_Table = '&xTable.' And ID_Field = '&xID.'; Create Sequence &xTrigger._PS_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE NOCACHE; Insert Into &APPLICATION_ID. (ID_Table,ID_Field,ID_Type,ID_Format,ID_SEQ) Values ('&xTable.','&xID.',NULL,'PSR:5','&xTrigger._PS_SEQ'); Create Sequence &xTrigger._HC_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE NOCACHE; Insert Into &APPLICATION_ID. (ID_Table,ID_Field,ID_Type,ID_Format,ID_SEQ) Values ('&xTable.','&xID.',NULL,'HCR:5','&xTrigger._HC_SEQ'); Create Sequence &xTrigger._HV_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE NOCACHE; Insert Into &APPLICATION_ID. (ID_Table,ID_Field,ID_Type,ID_Format,ID_SEQ) Values ('&xTable.','&xID.',NULL,'HVR:5','&xTrigger._HV_SEQ');
true
4f3bccb79bb0275b07b76d8c0322baf47ad95552
SQL
risingvivek/gs-spring-boot-complete
/src/main/resource/data.sql
UTF-8
327
2.765625
3
[]
no_license
DROP TABLE IF EXISTS Book; CREATE TABLE Book ( id INT AUTO_INCREMENT PRIMARY KEY, author VARCHAR(250) NOT NULL, name VARCHAR(250) NOT NULL, price VARCHAR(250) DEFAULT NULL ); INSERT INTO Book (author, name, price) VALUES ('Aliko', 'Dangote', '111'), ('Bill', 'Gates', '222'), ('Folrunsho', 'Alakija', '333');
true
6f5ae97b3c6cef586101eda26dfb6179e01acf81
SQL
CoolHatsker3000/JavaSpringNTProject
/DB/db.sql
UTF-8
2,294
3.625
4
[]
no_license
drop table tariff_info; drop table tariff_attrs; drop table user_info; drop table user_attrs; drop table users; drop table tariffs; create table tariffs( tariff_id INT PRIMARY KEY, tariff_name VARCHAR(20) unique, payment decimal(10,2) ); create table tariff_attrs( attr_id int CONSTRAINT attributes_pk primary KEY, attr_name varchar(20) ); create table tariff_info( tariff_id int CONSTRAINT tariff_info_fk_tariffs REFERENCES tariffs(tariff_id), attr_id int CONSTRAINT tariff_info_fk_attributes REFERENCES tariff_attrs(attr_id), attr_v varchar(30) not null ); create table users( user_id INT CONSTRAINT users_pk primary KEY, user_balance decimal(7,2) default 0, tariff_id int CONSTRAINT users_fk REFERENCES tariffs(tariff_id) ); create table user_attrs( attr_id int CONSTRAINT user_attrs_pk primary KEY, attr_name varchar(20) unique ); create table user_info( user_id CONSTRAINT user_info_fk_users REFERENCES users(user_id), attr_id CONSTRAINT user_info_fk_user_attrs REFERENCES user_attrs(attr_id), attr_v VARCHAR(30) ); insert into tariffs values (1,'firstTar',120.00); insert into tariffs values (2,'secondTar',300); insert into tariffs values (3,'thirdTar',350.00); insert into tariffs values (4,'fourthTar',500); insert into tariff_attrs values (1,'mins'); insert into tariff_attrs values (2,'sms'); insert into tariff_attrs values (3,'traffic'); insert into tariff_info values (1,1,'3000'); insert into tariff_info values (2,1,'1500'); insert into tariff_info values (2,2,'300'); insert into tariff_info values (2,3,'15'); insert into tariff_info values (3,1,'2000'); insert into tariff_info values (3,3,'10'); insert into tariff_info values (4,1,'5500'); insert into tariff_info values (4,2,'500'); insert into tariff_info values (4,3,'25'); insert into users values (000,5000,null); insert into users values (9603334466,1000,2); insert into users values (9997774466,2000,4); insert into users values (9993332299,2000,3); insert into user_attrs values (1,'fn'); insert into user_attrs values (2,'ln'); insert into user_info values (9603334466,1,'Andrey'); insert into user_info values (9603334466,2,'Ivanov'); insert into user_info values (9997774466,1,'Dusya'); insert into user_info values (9997774466,2,'Nehaeva');
true
67867cb1cc019c4e000dc065112c63716ee3fd4b
SQL
moesandar213511/edms_gov
/government.sql
UTF-8
13,669
2.8125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.4 -- https://www.phpmyadmin.net/ -- -- Host: localhost:4306 -- Generation Time: Jul 23, 2021 at 06:36 AM -- Server version: 10.1.37-MariaDB -- PHP Version: 7.3.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `government` -- -- -------------------------------------------------------- -- -- Table structure for table `adjures` -- CREATE TABLE `adjures` ( `id` bigint(20) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `file` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `description` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `adjures` -- INSERT INTO `adjures` (`id`, `title`, `file`, `description`, `created_at`, `updated_at`) VALUES (2, 'What is Lorem Ipsum?', '5d8b543ab66e6_Deep Dive Python By Win Htut.pdf', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', '2019-09-25 09:47:27', '2019-09-25 11:49:14'), (6, 'Why do we use it?', '5d8b5449a4068_1.pdf', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', '2019-09-25 10:20:33', '2019-09-25 11:49:29'), (7, 'Why didi we open Subdepartment1?', '5d8f3e9f036b1_Fire_Education_and_the_News.pdf', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.', '2019-09-28 11:06:07', '2019-09-28 11:06:07'); -- -------------------------------------------------------- -- -- 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 `letters` -- CREATE TABLE `letters` ( `id` bigint(20) UNSIGNED NOT NULL, `letter_no` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `purpose_letter` text COLLATE utf8mb4_unicode_ci NOT NULL, `detail` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, `attach_file` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `is_read` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'false', `key_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'simple', `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 `letters` -- INSERT INTO `letters` (`id`, `letter_no`, `date`, `title`, `purpose_letter`, `detail`, `attach_file`, `is_read`, `key_code`, `type`, `created_at`, `updated_at`) VALUES (18, 'd34343', '2019-09-05', '2LhXczIxsy2CIlOhjrE0uWj/jlKGPdqDFqkPOjoGvKsWe08HgxeUZJXWh2B9NrjNml1bjCJDMp3zoiK2YpzRQsE+Y7DKD+yUQzcH0L42aZc=', 'Peter Schmeichel interested in Manchester United football director role', '2LhXczIxsy2CIlOhjrE0uWj/jlKGPdqDFqkPOjoGvKsWe08HgxeUZJXWh2B9NrjNml1bjCJDMp3zoiK2YpzRQsE+Y7DKD+yUQzcH0L42aZc=', NULL, 'false', '343434343434', 'important', '2019-09-25 12:30:17', '2019-09-25 12:30:17'); -- -------------------------------------------------------- -- -- Table structure for table `letter_sub_departments` -- CREATE TABLE `letter_sub_departments` ( `id` bigint(20) UNSIGNED NOT NULL, `letter_id` int(11) NOT NULL, `in_sub_depart_id` int(11) NOT NULL, `out_sub_depart_id` int(11) NOT NULL, `type` 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 `letter_sub_departments` -- INSERT INTO `letter_sub_departments` (`id`, `letter_id`, `in_sub_depart_id`, `out_sub_depart_id`, `type`, `created_at`, `updated_at`) VALUES (24, 18, 11, 12, NULL, '2019-09-25 12:30:17', '2019-09-25 12:30:17'); -- -------------------------------------------------------- -- -- Table structure for table `main_departments` -- CREATE TABLE `main_departments` ( `id` bigint(20) UNSIGNED NOT NULL, `depart_name` varchar(191) 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 `main_departments` -- INSERT INTO `main_departments` (`id`, `depart_name`, `created_at`, `updated_at`) VALUES (39, 'main department one', '2019-09-24 13:50:48', '2019-09-24 13:50:56'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) 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, '2019_09_19_165703_create_main_departments_table', 2), (7, '2019_09_21_084615_create_sub_departments_table', 3), (8, '2019_09_21_171632_create_letters_table', 4), (10, '2019_09_21_175210_create_letter_sub_departments_table', 5), (11, '2019_09_25_153945_create_adjures_table', 6); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) 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 `sub_departments` -- CREATE TABLE `sub_departments` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `main_depart_id` int(11) NOT NULL, `office_phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `human_phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `latitude` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `longitude` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `logo` varchar(191) 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 `sub_departments` -- INSERT INTO `sub_departments` (`id`, `name`, `main_depart_id`, `office_phone`, `human_phone`, `address`, `latitude`, `longitude`, `logo`, `created_at`, `updated_at`) VALUES (9, 'sub department one one', 39, '093434343434', '093434343434', 'Myitkyina', '4343434', '4343434', '5d8b5c94c1b7b_1551597326_49390114_2047775935309954_5272228649699901440_n.jpg', '2019-09-25 12:24:52', '2019-09-25 12:24:52'), (10, 'sub department one one one', 39, '093434343434', '093434343434', 'Myitkyina', '4343434', '4343434', '5d8b5cae04fc3_1551597499_49625884_304434320206303_7668481115631386624_n.jpg', '2019-09-25 12:25:18', '2019-09-25 12:25:18'), (11, 'no', 39, '093434343434', '3434343434', 'Myitkyina', '093434343434', '11111111', '5d8b5d8461fda_1551597583_50835152_232785204294692_5366485069970014208_n.jpg', '2019-09-25 12:28:52', '2019-09-25 12:28:52'), (12, 'no1', 39, '093434343434', '093434343434', 'Myitkyina', '4343434', '4343434', '5d8b5d9aeafec_1551597529_49808111_2241682259431965_1816195816683995136_n.jpg', '2019-09-25 12:29:14', '2019-09-25 12:29:14'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `user_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `data_id` int(11) NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `user_name`, `password`, `type`, `data_id`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'admin', '$2y$10$LS9I8ah9M6akzAvLNLJ3wusK2wZYFbqMZrQuUAQBQqKcRJ7xlA7yS', 'admin', 0, NULL, NULL, NULL), (32, 'sub department one one', '$2y$10$zV497xoRkzLTkKVpDXnZZebc2xVF1plGjoHiShUEtPUM0LF/xfLQK', 'sub_depart_admin', 9, NULL, '2019-09-25 12:24:52', '2019-11-17 04:21:56'), (33, 'sub department one one one', '$2y$10$f7szJoYu4cHw42tbLPxBBurJODq15byvQj66LTM9t1ogBJ9LdpWBe', 'sub_depart_admin', 10, NULL, '2019-09-25 12:25:18', '2019-09-25 12:25:18'), (34, 'no', '$2y$10$Dfg9VnPlNAIkRqeeXOn6ruw/4FVQl/obJOnK5mWnpW4TU1oBXdmju', 'sub_depart_admin', 11, NULL, '2019-09-25 12:28:52', '2019-09-25 12:28:52'), (35, 'no1', '$2y$10$4EXPFK4AI7qJ29kpG8kRR.2VCWKMKgCp75K41PuRLASF4CYkta4yi', 'sub_depart_admin', 12, NULL, '2019-09-25 12:29:15', '2019-11-17 04:22:15'), (36, 'Subdepartment1', '$2y$10$FmMbqhfLFoci9JkdC1h2cuj/UD268yMUO1OaaturJbQngc8rW4s.C', 'sub_depart_admin', 13, NULL, '2019-09-28 10:58:19', '2019-09-28 11:01:29'); -- -- Indexes for dumped tables -- -- -- Indexes for table `adjures` -- ALTER TABLE `adjures` ADD PRIMARY KEY (`id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `letters` -- ALTER TABLE `letters` ADD PRIMARY KEY (`id`); -- -- Indexes for table `letter_sub_departments` -- ALTER TABLE `letter_sub_departments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `main_departments` -- ALTER TABLE `main_departments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `sub_departments` -- ALTER TABLE `sub_departments` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `adjures` -- ALTER TABLE `adjures` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `letters` -- ALTER TABLE `letters` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `letter_sub_departments` -- ALTER TABLE `letter_sub_departments` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `main_departments` -- ALTER TABLE `main_departments` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `sub_departments` -- ALTER TABLE `sub_departments` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; 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
61bebcb7d93a93cd76b6a4a2d00065a639a5194a
SQL
DavidJNoh/sql
/business.sql
UTF-8
1,292
4.09375
4
[]
no_license
SELECT SUM('billing.amount'), charged_datetime FROM billing WHERE billing.charged_datetime >='2012/03/01' AND billing.charged_datetime<'2012/04/01' SELECT clients.client_id, SUM('billing.amount') as revenue FROM clients LEFT JOIN billing ON clients.client_id = billing.client_id WHERE clients.client_id=2 GROUP BY clients.client_id SELECT sites.domain_name, clients.client_id FROM clients LEFT JOIN sites ON clients.client_id = sites.client_id WHERE client_id =10 SELECT clients.client_id, count('sites.site_id') as number_of_websites, sites.created_datetime FROM clients LEFT JOIN sites ON sites.client_id = clients.client_id WHERE clients.client_id = 1 GROUP BY sites.created_datetime; -- SELECT sites.domain_name as website, count('leads.leads_id') as number_of_leads, leads.registered_datetime -- FROM sites -- LEFT JOIN leads ON sites.site_id = leads.site_id -- WHERE leads.registered_datetime>= 2011/01/01 AND leads.registered_datetime < 2011/02/15 -- SELECT clients.first_name as client_name, count('leads.leads_id') as number_of_leads, leads.registered_datetime -- FROM clients -- LEFT JOIN sites ON clients.client_id = sites.site_id -- LEFT JOIN leads ON sites.site_id = leads.site_id -- WHERE leads.registered_datetime>= 2011/01/01 AND leads.registered_datetime < 2011/23/31;
true
dfd35007e734b507a3d8f73b4a90b2e85868a440
SQL
dstreev/big-data-apps
/apps/retail/schema/spark-retail-schema.sql
UTF-8
929
3.5625
4
[ "Apache-2.0" ]
permissive
CREATE DATABASE IF NOT EXISTS ${TARGET_DB}; USE ${TARGET_DB}; DROP TABLE IF EXISTS CUSTOMER; CREATE TABLE IF NOT EXISTS CUSTOMER ( ID STRING, FULL_NAME STRING, ADDRESS STRING, STATE STRING, CONTACT_NUM STRING ) USING ORC; DROP TABLE IF EXISTS VISIT; CREATE TABLE IF NOT EXISTS VISIT ( ID STRING, CUSTOMER_ID STRING, VISIT_TS TIMESTAMP, STAY_TIME BIGINT, VISIT_DATE DATE ) USING ORC PARTITIONED BY (VISIT_DATE); DROP TABLE IF EXISTS PURCHASE; CREATE TABLE IF NOT EXISTS PURCHASE ( ID STRING, CUSTOMER_ID STRING, VISIT_ID STRING, SALES_REP STRING, REGISTER STRING, TRANSACTION_ID STRING, DISCOUNT DOUBLE, DISCOUNT_CODE STRING, TOTAL_PURCHASE DOUBLE, TENDER_TYPE STRING, PURCHASE_TS TIMESTAMP, PURCHASE_DATE DATE ) USING ORC PARTITIONED BY (PURCHASE_DATE);
true
229cf94c292f20206dd0eb89aa3c8a47bfb5f821
SQL
idrisabdul/withus
/database/withus.sql
UTF-8
13,785
2.625
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 02, 2021 at 12:37 PM -- Server version: 10.1.28-MariaDB -- PHP Version: 7.1.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `withus` -- -- -------------------------------------------------------- -- -- Table structure for table `artikel` -- CREATE TABLE `artikel` ( `id` int(11) NOT NULL, `kategori` varchar(128) NOT NULL, `judul` varchar(128) NOT NULL, `content` varchar(1201) NOT NULL, `rating` int(11) NOT NULL, `author` varchar(128) NOT NULL, `image` varchar(128) NOT NULL, `tgl` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `chat` -- CREATE TABLE `chat` ( `id_chat` int(11) NOT NULL, `pesan_masuk` int(20) NOT NULL, `pesan_keluar` int(20) NOT NULL, `pesan` varchar(512) NOT NULL, `tgl_chat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `chat` -- INSERT INTO `chat` (`id_chat`, `pesan_masuk`, `pesan_keluar`, `pesan`, `tgl_chat`) VALUES (1, 3, 2, 'Y', '2021-05-31 13:00:08'), (2, 3, 2, 'T', '2021-05-31 13:03:33'), (3, 3, 2, 'Ti', '2021-05-31 13:03:57'), (4, 5, 3, 'n', '2021-05-31 13:04:14'), (5, 5, 3, 'b', '2021-05-31 13:06:11'), (6, 5, 3, 'v', '2021-05-31 13:09:22'), (7, 5, 3, 'c', '2021-05-31 13:09:34'), (8, 2, 3, 'vb', '2021-05-31 13:09:52'), (9, 3, 2, 'I', '2021-05-31 13:09:58'), (10, 3, 2, 'G', '2021-05-31 13:10:08'), (11, 5, 3, 'm', '2021-05-31 13:10:15'), (12, 2, 3, 'cccc', '2021-05-31 13:10:34'), (13, 3, 2, 'Yys', '2021-05-31 13:10:42'), (14, 5, 3, 'xx', '2021-05-31 13:11:00'), (15, 3, 2, 'Halo lika..? ', '2021-05-31 13:11:45'), (16, 2, 3, 'iyaa..?', '2021-05-31 13:12:02'), (17, 3, 2, 'Kamu dimana lika..? ', '2021-05-31 13:12:11'), (18, 3, 2, 'Di mana yaa..? ', '2021-05-31 13:12:23'), (19, 6, 3, 'tws', '2021-05-31 13:12:43'), (20, 3, 2, 'G', '2021-05-31 13:12:54'), (21, 3, 2, 'H', '2021-05-31 13:13:04'), (22, 3, 2, 'U', '2021-05-31 13:13:14'), (23, 3, 2, 'J', '2021-05-31 13:13:20'), (24, 6, 3, 'n', '2021-05-31 13:13:32'), (25, 3, 2, 'Sombong amat ga dibales', '2021-05-31 13:13:43'), (26, 2, 3, 'bacot iihhh', '2021-05-31 13:13:56'), (27, 3, 2, 'b', '2021-05-31 23:13:46'), (28, 2, 3, 'Ampun bang jago', '2021-05-31 23:13:56'), (29, 2, 3, 'Bb', '2021-05-31 23:14:11'), (30, 5, 2, 'b', '2021-05-31 23:14:23'), (31, 3, 6, 'coba 2 untuk 3', '2021-05-31 23:56:44'), (32, 6, 3, 'nn', '2021-06-01 00:13:11'), (33, 3, 1, 'Cek lika', '2021-06-01 02:31:14'), (34, 1, 3, 'k', '2021-06-01 02:36:34'), (35, 1, 3, 'Perintah SELECT DISTINCT digunakan untuk menampilkan nilai yang berbeda. Di dalam sebuah tabel, kolom sering berisi banyak nilai duplikat; Dan terkadang Anda hanya ingin membuat daftar nilai yang berbeda. Perintah SELECT DISTINCT digunakan untuk menampilkan hanya nilai yang berbeda dari suatu data.', '2021-06-01 02:36:49'), (36, 3, 1, 'F', '2021-06-01 02:37:04'), (37, 3, 1, 'U', '2021-06-02 07:09:45'), (38, 3, 2, 'Hahah', '2021-06-03 06:16:15'), (39, 2, 3, 'Hihihii', '2021-06-03 06:17:12'), (40, 3, 2, 'Dear diary', '2021-07-02 02:10:35'), (41, 3, 2, 'D', '2021-07-02 02:10:42'), (42, 3, 2, 'S', '2021-07-02 02:10:46'), (43, 2, 1, 'ferda..', '2021-07-02 09:20:29'), (44, 1, 2, 'Iyaa', '2021-07-02 09:20:53'), (45, 2, 1, 'lagi apa..?', '2021-07-02 09:21:14'), (46, 6, 2, 'Hh', '2021-07-02 09:23:21'), (47, 2, 1, 'ssss', '2021-07-02 09:23:29'), (48, 2, 1, 'a', '2021-07-02 09:28:57'), (49, 2, 1, 'A', '2021-07-02 09:30:16'), (50, 2, 1, 'a', '2021-07-02 09:30:57'), (51, 2, 1, 's', '2021-07-02 09:31:11'), (52, 2, 1, 'a', '2021-07-02 09:31:59'), (53, 2, 1, 'a', '2021-07-02 09:32:24'), (54, 1, 2, 'Yhh', '2021-07-02 09:32:34'), (55, 2, 1, 'd', '2021-07-02 09:33:44'), (56, 1, 2, 'Gg', '2021-07-02 09:33:54'), (57, 2, 1, 'aa', '2021-07-02 09:34:14'), (58, 1, 2, 'Fttt', '2021-07-02 09:34:24'), (59, 2, 1, 'aaa', '2021-07-02 09:34:36'), (60, 1, 2, 'Ggg', '2021-07-02 09:35:00'), (61, 2, 1, 'd', '2021-07-02 09:35:10'), (62, 1, 2, 'Gg', '2021-07-02 09:35:37'), (63, 2, 1, 's', '2021-07-02 09:36:06'), (64, 2, 1, 'w', '2021-07-02 09:37:48'), (65, 2, 1, 'aa', '2021-07-02 09:38:52'), (66, 2, 1, 'aaa', '2021-07-02 09:39:25'), (67, 2, 1, 'aaaaa', '2021-07-02 09:40:15'), (68, 2, 1, 'aaa', '2021-07-02 09:40:51'), (69, 2, 1, 'a', '2021-07-02 09:42:05'), (70, 2, 1, 'aaa', '2021-07-02 09:42:46'), (71, 2, 1, 'aaa', '2021-07-02 09:43:11'), (72, 2, 1, 'aaa', '2021-07-02 09:43:26'), (73, 1, 2, 'Ccc', '2021-07-02 09:44:11'), (74, 1, 2, 'Ccc', '2021-07-02 09:45:07'), (75, 2, 1, 'aaa', '2021-07-02 09:45:24'), (76, 2, 1, 'aa', '2021-07-02 09:48:31'), (77, 1, 2, 'Ccc', '2021-07-02 09:50:48'), (78, 1, 2, 'Gg', '2021-07-02 09:51:11'), (79, 2, 1, 'aa', '2021-07-02 09:52:11'), (80, 2, 1, 'a', '2021-07-02 09:53:11'), (81, 1, 2, 'Ccc', '2021-07-02 09:54:33'), (82, 1, 2, 'Vccc', '2021-07-02 09:55:27'), (83, 2, 1, 'ssss', '2021-07-02 09:55:49'), (84, 1, 2, 'Vv', '2021-07-02 09:56:45'), (85, 1, 2, 'Cc', '2021-07-02 09:59:23'), (86, 2, 1, 'aa', '2021-07-02 10:00:09'), (87, 1, 2, 'Tft', '2021-07-02 10:01:12'), (88, 1, 2, 'Cvg', '2021-07-02 10:02:09'), (89, 2, 1, 'aaaa', '2021-07-02 10:02:21'), (90, 1, 2, 'Ftty', '2021-07-02 10:04:21'), (91, 1, 2, 'Ff', '2021-07-02 10:05:41'), (92, 2, 1, 'a', '2021-07-02 10:10:40'), (93, 1, 2, 'Ggggg', '2021-07-02 10:11:31'), (94, 2, 1, 'ss', '2021-07-02 10:12:45'), (95, 2, 1, 's', '2021-07-02 10:13:11'), (96, 2, 1, 'a', '2021-07-02 10:13:33'), (97, 2, 1, 'dddd', '2021-07-02 10:13:59'), (98, 1, 2, 'Bbh', '2021-07-02 10:14:17'), (99, 2, 1, 'aaaaa', '2021-07-02 10:16:31'), (100, 1, 2, 'Vcvg', '2021-07-02 10:17:47'), (101, 2, 1, 'xss', '2021-07-02 10:17:58'), (102, 2, 1, 'hia', '2021-07-02 10:18:08'), (103, 1, 2, 'Ffff', '2021-07-02 10:18:35'), (104, 2, 1, 'ss', '2021-07-02 10:19:28'), (105, 2, 1, 'aaa', '2021-07-02 10:20:16'), (106, 1, 2, 'Hhh', '2021-07-02 10:20:59'), (107, 1, 2, 'Fff', '2021-07-02 10:21:32'), (108, 2, 1, 'ssss', '2021-07-02 10:21:43'), (109, 1, 2, 'Ggggg', '2021-07-02 10:22:48'), (110, 2, 1, 'sss', '2021-07-02 10:23:06'), (111, 1, 2, 'Halo ferda...? ', '2021-07-02 10:25:07'), (112, 2, 1, 'fcvgttr', '2021-07-02 10:25:35'); -- -------------------------------------------------------- -- -- Table structure for table `jawab` -- CREATE TABLE `jawab` ( `id_jawab` int(11) NOT NULL, `nama_nanya` varchar(100) NOT NULL, `kategori` varchar(100) NOT NULL, `id_tanya` int(11) NOT NULL, `pertanyaan` varchar(2000) NOT NULL, `nama_jawab` varchar(100) NOT NULL, `jawaban` varchar(2000) NOT NULL, `rating` int(10) NOT NULL, `tgl_jawab` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `jawab` -- INSERT INTO `jawab` (`id_jawab`, `nama_nanya`, `kategori`, `id_tanya`, `pertanyaan`, `nama_jawab`, `jawaban`, `rating`, `tgl_jawab`) VALUES (2, '0', '3', 6, 'aduh tugas mulu anj', '2', ' icikiwier', 0, '2021-06-26'), (6, 'Idris', '1', 1, 'Halo gaes', '2', 'asdaw', 0, '2021-06-26'), (7, 'Idris', '1', 1, 'Halo gaes', '2', 'fed', 0, '2021-06-26'); -- -------------------------------------------------------- -- -- Table structure for table `kategori` -- CREATE TABLE `kategori` ( `id` int(11) NOT NULL, `nm_kategori` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kategori` -- INSERT INTO `kategori` (`id`, `nm_kategori`) VALUES (1, 'karir'), (2, 'Percintaan'), (3, 'Kampus'), (4, 'Bisnis'), (5, 'Keluarga'); -- -------------------------------------------------------- -- -- Table structure for table `rating_jawab` -- CREATE TABLE `rating_jawab` ( `id_jawab` int(11) NOT NULL, `username` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `rating_jawab` -- INSERT INTO `rating_jawab` (`id_jawab`, `username`) VALUES (94, ''), (94, ''), (95, 'ferda'), (52, 'idris'), (67, 'idris'), (75, 'idris'), (96, 'idris'), (97, 'ferda'), (97, 'idris'), (111, 'idris'), (69, 'idris'), (96, 'ferda'), (111, 'ferda'), (113, 'ferda'), (113, 'idris'), (114, 'idris'), (116, 'alrasyid2610'), (116, 'idris'), (115, 'alrasyid2610'); -- -------------------------------------------------------- -- -- Table structure for table `tanya` -- CREATE TABLE `tanya` ( `id_tanya` int(11) NOT NULL, `kategori` varchar(12) NOT NULL, `username` varchar(20) NOT NULL, `user_id` int(11) NOT NULL, `pertanyaan` varchar(2000) NOT NULL, `tgl_pertanyaan` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tanya` -- INSERT INTO `tanya` (`id_tanya`, `kategori`, `username`, `user_id`, `pertanyaan`, `tgl_pertanyaan`) VALUES (1, '1', '1', 1, 'Halo gaes', '2021-06-24 11:51:08'), (2, '2', '1', 1, 'Dimanakah ia sang kekasih?\r\n', '2021-06-24 12:00:30'), (3, '2', '0', 1, 'uwawu', '2021-06-24 13:27:42'), (5, '2', '0', 1, 'mama yukero', '2021-06-24 13:38:09'), (6, '3', '0', 1, 'aduh tugas mulu anj', '2021-06-24 13:38:34'), (8, '5', '1', 1, 'kangen mama', '2021-06-30 07:37:41'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id_user` int(11) NOT NULL, `username` varchar(128) NOT NULL, `email` varchar(128) NOT NULL, `profesi` varchar(20) NOT NULL, `password` varchar(255) NOT NULL, `no_wa` varchar(128) NOT NULL, `user_level` int(11) NOT NULL COMMENT '1. admin 2. Psikolog 3. User ' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id_user`, `username`, `email`, `profesi`, `password`, `no_wa`, `user_level`) VALUES (0, 'Anonymous', '', '', '', '0', 0), (1, 'idris', 'idris@gmail.com', 'mahasiswa', '$2y$10$yE5xuD7Pyy9GyN6LWfIPA.2X2mPDwq/FiSGX2M0w2Jb6Yo/lenh4G', '0', 1), (2, 'ferda', 'ferda@gmail.com', 'mahasiswa', '$2y$10$eiuSFos8k3Xx693he4RPhebn8zYnAI5YIlGhrcwEKy4rs9NJhsXqa', '5', 2), (3, 'Lika Puspa', 'likapuspa@gmail.com', 'Mahasiswa', '$2y$10$k.Gxf2sUvQoQfh8uQLtMw.G7MO0YFMjvX3k4D7r41cnbcrcQjNOre', '2147483647', 2), (8, 'coba3', 'coba2@gmail.com', 'awda', '$2y$10$nvOy8jZO6msRgyHjtvfc8.53tBGonEBD2/Pm15xRT86dKCE0X4wlW', '12', 3), (9, 'alrasyid2610', 'alrasyid2610@gmail.com', 'Karyawan Swasta', '$2y$10$IwKlVk3Q3a7kk58OqrxxpeJhnpfEZRgkP.9vR0LNb2tNFhM.QZmkG', '2147483647', 3), (10, 'harun', 'harun@gmail.com', 'harun', '$2y$10$HQwx0rDcEh51bRjxcGhiieFIbyc818La0AQe6Vze7VILWNtRE3nHu', '0', 3), (12, 'ruby', 'ruby@gmail.com', 'Pengusaha', '$2y$10$eY19RhBXGTrW1g2IGP/2EOy4OJMZAS36T2M/74hxdTG9pDcnZDx5e', '0', 3); -- -------------------------------------------------------- -- -- Table structure for table `user_consultan` -- CREATE TABLE `user_consultan` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `nama_lengkap` varchar(128) NOT NULL, `img_profile` varchar(128) NOT NULL, `motto_hidup` varchar(128) NOT NULL, `kategori` varchar(128) NOT NULL, `rating` int(11) DEFAULT NULL, `total_client` varchar(128) DEFAULT NULL, `alamat` varchar(128) NOT NULL, `status` int(11) NOT NULL COMMENT '0: wait, 1: fix, 2: rejected', `on_off` int(11) NOT NULL COMMENT '0:off; 1:on, 2:booked', `tarif` decimal(10,0) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_consultan` -- INSERT INTO `user_consultan` (`id`, `user_id`, `nama_lengkap`, `img_profile`, `motto_hidup`, `kategori`, `rating`, `total_client`, `alamat`, `status`, `on_off`, `tarif`) VALUES (2, 2, 'Ferda Rahma Janesha', 'rohis.png', 'Ingin jadi ', '3', NULL, NULL, 'adw', 1, 0, '30000'), (3, 3, 'Lika Puspa', 'rohis.png', 'Ingin menjadi entrepreneur', '4', NULL, NULL, 'Ingin menjadi entrepreneur', 0, 0, '45000'); -- -- Indexes for dumped tables -- -- -- Indexes for table `artikel` -- ALTER TABLE `artikel` ADD PRIMARY KEY (`id`); -- -- Indexes for table `chat` -- ALTER TABLE `chat` ADD PRIMARY KEY (`id_chat`); -- -- Indexes for table `jawab` -- ALTER TABLE `jawab` ADD PRIMARY KEY (`id_jawab`); -- -- Indexes for table `kategori` -- ALTER TABLE `kategori` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tanya` -- ALTER TABLE `tanya` ADD PRIMARY KEY (`id_tanya`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id_user`); -- -- Indexes for table `user_consultan` -- ALTER TABLE `user_consultan` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `artikel` -- ALTER TABLE `artikel` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `chat` -- ALTER TABLE `chat` MODIFY `id_chat` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=113; -- -- AUTO_INCREMENT for table `jawab` -- ALTER TABLE `jawab` MODIFY `id_jawab` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `kategori` -- ALTER TABLE `kategori` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `tanya` -- ALTER TABLE `tanya` MODIFY `id_tanya` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `user_consultan` -- ALTER TABLE `user_consultan` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 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
4c3afd4afddd794fa35d61bfb5957b1ff5144308
SQL
daniiel/cursos
/Oracle 11g - Introduction to SQL/courselabs/plpu/solns/sol_08_03_e.sql
UTF-8
166
2.53125
3
[]
no_license
UPDATE employees set job_id = 'ST_MAN' WHERE employee_id = (SELECT employee_id FROM employees WHERE last_name = 'Beh');
true
3903b7a38065fc0ecb28bc8b096a17545750c1ac
SQL
arunkpatra/athena
/subprojects/athena-data/queries/ytd-gross-breakage-by-merchant.sql
UTF-8
1,785
4.40625
4
[ "MIT" ]
permissive
-- YTD Top merchants with breakage -- Description: Find out the total breakage by merchant -- Verified: OK -- Approach -- 1. Which cards have expired as of today in the last one year? -- 2. What was the breakage on each such card? -- 3. Group by card type and sum ALL breakages. That gives the total breakage for a card type select merchant_name, AMB.merchant_breakage, CURRENT_DATE as as_of_date from (select merchant_code, sum(breakage) as merchant_breakage from (select P.merchant_code as merchant_code, P.tx_value as purchase_value, R.total_redeemed as redeemed_value, (purchase_value - redeemed_value) as breakage from (select gc_uuid, merchant_code, tx_value from transaction where tx_type = 'PURCHASE') P, -- Purchase value on card instance (select gc_uuid, sum(tx_value) as total_redeemed from transaction where tx_type = 'REDEMPTION' group by gc_uuid) R, -- Redeemed value on card instance (select gc_uuid from card where gc_expiry_date < current_date and (CURRENT_DATE::date - gc_expiry_date) < 365) E, -- Expired card instances in this year (YTD) card -- card instances where P.gc_uuid = E.gc_uuid and E.gc_uuid = card.gc_uuid and E.gc_uuid = R.gc_uuid) MB group by merchant_code) AMB, merchant where AMB.merchant_code = merchant.merchant_code order by AMB.merchant_breakage desc;
true
9f3e96b21eb81c1fb078d11b1fdf9b92ae30518f
SQL
XCentium/NBF
/src/DBScripts/Test Scripts/images 02.sql
UTF-8
1,572
2.96875
3
[]
no_license
select productid from products where number like '56289%' and statusid = 1 select * from products where Number = '41899' select * from ProductSKUs where ProductId = 222479 and OptionCode = '11' select * from ProductSKUs where productid = 115815 and IsWebEnabled > 0 select * from ProductWebImages where productid = 41899 and (UsageId = 1 or IsPrimary = 1) order by IsPrimary desc, WebSortOrder select * from ProductSkusWebImages where productskuid in ( select productskuid from ProductSKUs where productid = 222479 and IsWebEnabled > 0 ) select * from ProductWebImages where productid = 222479 select pswi.ProductSKUId, count(*) from ProductSkusWebImages pswi join ProductWebImages pwi on pwi.WebImageId = pswi.WebImageId and UsageId = 2 where productskuid in ( select productskuid from ProductSKUs where IsWebEnabled > 0 ) group by pswi.ProductSKUId having count(*) > 1 order by pswi.ProductSKUId 12374 12377 12378 12379 select * from ProductWebImages pwi join ProductSkusWebImages pswi on pswi.ProductSKUId where pwi.productid = 115815 and (pwi.UsageId = 1 or pwi.IsPrimary = 1) order by IsPrimary desc, WebSortOrder select * from LookupImageUsages https://cdn-us-ec.yottaa.net/5407231486305e33060009aa/00f0b540b8130135e366123dfe2baf36.yottaa.net/v~19.b8/is/image/NationalBusinessFurniture/56289_4?hei=50&wid=50&qlt=100&yocs=_&yoloc=us https://cdn-us-ec.yottaa.net/5407231486305e33060009aa/00f0b540b8130135e366123dfe2baf36.yottaa.net/v~19.b8/is/image/NationalBusinessFurniture/rmt-56289-fea1_lrg?wid=50&hei=50&qlt=100&yocs=_&yoloc=us rmt-56289-fea1_lrg
true
9ac2d3ea572e9275e9aa0ea5c285a117d427fd1a
SQL
cboy868/lion
/modules/install/data/install.sql
UTF-8
140,935
3.09375
3
[]
no_license
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86) -- -- Host: localhost Database: lion_test -- ------------------------------------------------------ -- Server version 5.6.17 /*!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 `album` -- DROP TABLE IF EXISTS `album`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `album` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `category_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `photo_num` int(11) DEFAULT '0', `recommend` smallint(6) DEFAULT '0', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `album` -- LOCK TABLES `album` WRITE; /*!40000 ALTER TABLE `album` DISABLE KEYS */; /*!40000 ALTER TABLE `album` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `album_2` -- DROP TABLE IF EXISTS `album_2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `album_2` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `category_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `photo_num` int(11) DEFAULT '0', `recommend` smallint(6) DEFAULT '0', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `album_2` -- LOCK TABLES `album_2` WRITE; /*!40000 ALTER TABLE `album_2` DISABLE KEYS */; /*!40000 ALTER TABLE `album_2` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `album_image` -- DROP TABLE IF EXISTS `album_image`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `album_image` ( `id` int(11) NOT NULL AUTO_INCREMENT, `album_id` int(11) DEFAULT NULL, `mod` int(11) DEFAULT NULL, `author_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `desc` text COLLATE utf8_unicode_ci, `ext` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `album_image` -- LOCK TABLES `album_image` WRITE; /*!40000 ALTER TABLE `album_image` DISABLE KEYS */; /*!40000 ALTER TABLE `album_image` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `area` -- DROP TABLE IF EXISTS `area`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `area` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` char(255) NOT NULL, `level` tinyint(4) unsigned NOT NULL DEFAULT '0', `pid` mediumint(8) unsigned NOT NULL DEFAULT '0', `list` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `upid` (`pid`,`list`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='常用地区表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `area` -- LOCK TABLES `area` WRITE; /*!40000 ALTER TABLE `area` DISABLE KEYS */; /*!40000 ALTER TABLE `area` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `attachment` -- DROP TABLE IF EXISTS `attachment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `attachment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `desc` text COLLATE utf8_unicode_ci, `ext` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `attachment` -- LOCK TABLES `attachment` WRITE; /*!40000 ALTER TABLE `attachment` DISABLE KEYS */; /*!40000 ALTER TABLE `attachment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `attachment_rel` -- DROP TABLE IF EXISTS `attachment_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `attachment_rel` ( `res_id` int(11) DEFAULT NULL, `res_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `attach_id` int(11) DEFAULT NULL, `use` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, KEY `attach_id` (`attach_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `attachment_rel` -- LOCK TABLES `attachment_rel` WRITE; /*!40000 ALTER TABLE `attachment_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `attachment_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `auth_assignment` -- DROP TABLE IF EXISTS `auth_assignment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth_assignment` ( `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) DEFAULT NULL, PRIMARY KEY (`item_name`,`user_id`), CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth_assignment` -- LOCK TABLES `auth_assignment` WRITE; /*!40000 ALTER TABLE `auth_assignment` DISABLE KEYS */; /*!40000 ALTER TABLE `auth_assignment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `auth_item` -- DROP TABLE IF EXISTS `auth_item`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth_item` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `type` int(11) NOT NULL, `description` text COLLATE utf8_unicode_ci, `real_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_menu` smallint(1) DEFAULT '0', `level` int(11) DEFAULT NULL, `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`name`), KEY `rule_name` (`rule_name`), KEY `idx-auth_item-type` (`type`), CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth_item` -- LOCK TABLES `auth_item` WRITE; /*!40000 ALTER TABLE `auth_item` DISABLE KEYS */; /*!40000 ALTER TABLE `auth_item` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `auth_item_child` -- DROP TABLE IF EXISTS `auth_item_child`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth_item_child` ( `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`parent`,`child`), KEY `child` (`child`), CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth_item_child` -- LOCK TABLES `auth_item_child` WRITE; /*!40000 ALTER TABLE `auth_item_child` DISABLE KEYS */; /*!40000 ALTER TABLE `auth_item_child` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `auth_rule` -- DROP TABLE IF EXISTS `auth_rule`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `auth_rule` ( `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, `data` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auth_rule` -- LOCK TABLES `auth_rule` WRITE; /*!40000 ALTER TABLE `auth_rule` DISABLE KEYS */; /*!40000 ALTER TABLE `auth_rule` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `blog` -- DROP TABLE IF EXISTS `blog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `blog` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `summary` text COLLATE utf8_unicode_ci, `thumb` int(11) DEFAULT NULL, `video` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` int(11) DEFAULT NULL, `recommend` smallint(6) DEFAULT '0', `is_customer` smallint(6) DEFAULT '0', `is_top` smallint(6) DEFAULT '0', `type` smallint(6) DEFAULT '1', `memorial_id` int(11) DEFAULT '0', `privacy` smallint(6) DEFAULT '1', `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `publish_at` datetime DEFAULT NULL, `created_by` int(11) DEFAULT NULL, `ip` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `blog` -- LOCK TABLES `blog` WRITE; /*!40000 ALTER TABLE `blog` DISABLE KEYS */; /*!40000 ALTER TABLE `blog` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `blog_album` -- DROP TABLE IF EXISTS `blog_album`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `blog_album` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `summary` text COLLATE utf8_unicode_ci, `thumb` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` int(11) DEFAULT NULL, `recommend` smallint(6) DEFAULT '0', `is_customer` smallint(6) DEFAULT '0', `is_top` smallint(6) DEFAULT '0', `memorial_id` int(11) DEFAULT '0', `privacy` smallint(6) DEFAULT '1', `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `num` int(11) DEFAULT NULL, `created_by` int(11) DEFAULT NULL, `ip` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `blog_album` -- LOCK TABLES `blog_album` WRITE; /*!40000 ALTER TABLE `blog_album` DISABLE KEYS */; /*!40000 ALTER TABLE `blog_album` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `blog_album_photo` -- DROP TABLE IF EXISTS `blog_album_photo`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `blog_album_photo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `album_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `body` text COLLATE utf8_unicode_ci, `ext` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ip` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `privacy` smallint(6) DEFAULT '1', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `blog_album_photo` -- LOCK TABLES `blog_album_photo` WRITE; /*!40000 ALTER TABLE `blog_album_photo` DISABLE KEYS */; /*!40000 ALTER TABLE `blog_album_photo` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `client` -- DROP TABLE IF EXISTS `client`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `client` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(128) NOT NULL COMMENT '客户名称', `gender` tinyint(4) DEFAULT '1', `age` tinyint(4) DEFAULT NULL, `user_id` int(11) DEFAULT '0' COMMENT '账号id', `telephone` varchar(128) DEFAULT NULL COMMENT '家庭电话', `mobile` varchar(128) DEFAULT '' COMMENT '手机号', `email` varchar(200) DEFAULT NULL, `qq` varchar(128) DEFAULT '', `wechat` varchar(128) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT '', `province_id` int(11) DEFAULT '0', `city_id` int(11) DEFAULT '0', `zone_id` int(11) DEFAULT '0', `address` text COMMENT '详细地址', `note` text COMMENT '备注', `guide_id` int(11) DEFAULT '0' COMMENT '导购员ID', `come_from` tinyint(4) DEFAULT NULL COMMENT '客户来源', `agent_id` int(11) DEFAULT '0' COMMENT '最终业值ID', `status` tinyint(4) DEFAULT '1' COMMENT '1 正常 0 删除', `created_by` int(11) DEFAULT '0', `created_at` int(11) NOT NULL COMMENT '添加时间', `updated_at` int(11) NOT NULL COMMENT '更新时间', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='预约表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `client` -- LOCK TABLES `client` WRITE; /*!40000 ALTER TABLE `client` DISABLE KEYS */; /*!40000 ALTER TABLE `client` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `client_deal` -- DROP TABLE IF EXISTS `client_deal`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_deal` ( `id` int(11) NOT NULL, `client_id` int(11) NOT NULL DEFAULT '0', `guide_id` int(11) NOT NULL DEFAULT '0', `agent_id` int(11) NOT NULL DEFAULT '0', `recep_id` int(11) NOT NULL DEFAULT '0', `res_name` varchar(200) CHARACTER SET utf8 NOT NULL DEFAULT '', `res_id` int(11) NOT NULL DEFAULT '0', `name` varchar(200) DEFAULT '', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '成交时间', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态 1-正常成交, 2感兴趣 -1-删除 ', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `client_deal` -- LOCK TABLES `client_deal` WRITE; /*!40000 ALTER TABLE `client_deal` DISABLE KEYS */; /*!40000 ALTER TABLE `client_deal` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `client_reception` -- DROP TABLE IF EXISTS `client_reception`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_reception` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', `client_id` int(11) NOT NULL DEFAULT '0' COMMENT '客户信息ID', `guide_id` int(11) DEFAULT '0' COMMENT '导购员id', `agent_id` int(11) DEFAULT '0', `car_number` varchar(128) DEFAULT NULL, `person_num` int(11) DEFAULT '1', `start` datetime DEFAULT NULL COMMENT '开始时间', `end` datetime DEFAULT NULL COMMENT '结束时间', `un_reason` tinyint(4) DEFAULT '113', `is_success` tinyint(4) DEFAULT '0', `note` text COMMENT '备注', `type` tinyint(4) NOT NULL COMMENT '联系类型', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0 删除', `created_at` int(11) DEFAULT NULL COMMENT '录入时间', `updated_at` int(11) DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`id`), KEY `idx_gid` (`guide_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='接待记录表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `client_reception` -- LOCK TABLES `client_reception` WRITE; /*!40000 ALTER TABLE `client_reception` DISABLE KEYS */; /*!40000 ALTER TABLE `client_reception` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `cms_category` -- DROP TABLE IF EXISTS `cms_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cms_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT NULL, `mid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(1) DEFAULT '1', `seo_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_description` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cms_category` -- LOCK TABLES `cms_category` WRITE; /*!40000 ALTER TABLE `cms_category` DISABLE KEYS */; /*!40000 ALTER TABLE `cms_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `cms_nav` -- DROP TABLE IF EXISTS `cms_nav`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `cms_nav` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` text COLLATE utf8_unicode_ci, `show` smallint(6) DEFAULT '1', `sort` smallint(6) DEFAULT '0', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `cms_nav` -- LOCK TABLES `cms_nav` WRITE; /*!40000 ALTER TABLE `cms_nav` DISABLE KEYS */; /*!40000 ALTER TABLE `cms_nav` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `comment` -- DROP TABLE IF EXISTS `comment`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `comment` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from` int(11) DEFAULT NULL, `to` int(11) DEFAULT NULL, `res_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `pid` int(11) DEFAULT '0', `content` text COLLATE utf8_unicode_ci, `privacy` smallint(1) DEFAULT '0', `status` smallint(1) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `comment` -- LOCK TABLES `comment` WRITE; /*!40000 ALTER TABLE `comment` DISABLE KEYS */; /*!40000 ALTER TABLE `comment` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `contact` -- DROP TABLE IF EXISTS `contact`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `contact` ( `id` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `note` text COLLATE utf8_unicode_ci, `ip` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `contact` -- LOCK TABLES `contact` WRITE; /*!40000 ALTER TABLE `contact` DISABLE KEYS */; /*!40000 ALTER TABLE `contact` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `email_receive` -- DROP TABLE IF EXISTS `email_receive`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `email_receive` ( `id` int(11) NOT NULL AUTO_INCREMENT, `email` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `msg` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `email_receive` -- LOCK TABLES `email_receive` WRITE; /*!40000 ALTER TABLE `email_receive` DISABLE KEYS */; /*!40000 ALTER TABLE `email_receive` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `email_send` -- DROP TABLE IF EXISTS `email_send`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `email_send` ( `id` int(11) NOT NULL AUTO_INCREMENT, `from_user` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `from_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `msg` text COLLATE utf8_unicode_ci, `time` datetime DEFAULT NULL, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `email_send` -- LOCK TABLES `email_send` WRITE; /*!40000 ALTER TABLE `email_send` DISABLE KEYS */; /*!40000 ALTER TABLE `email_send` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `favor` -- DROP TABLE IF EXISTS `favor`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `favor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `res_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `res_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `favor` -- LOCK TABLES `favor` WRITE; /*!40000 ALTER TABLE `favor` DISABLE KEYS */; /*!40000 ALTER TABLE `favor` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `focus` -- DROP TABLE IF EXISTS `focus`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `focus` ( `id` int(10) NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `link` varchar(255) NOT NULL, `intro` text, `image` varchar(512) NOT NULL DEFAULT '', `category_id` int(10) NOT NULL, `sort` int(11) DEFAULT '0', `status` tinyint(1) NOT NULL DEFAULT '1', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `focus` -- LOCK TABLES `focus` WRITE; /*!40000 ALTER TABLE `focus` DISABLE KEYS */; /*!40000 ALTER TABLE `focus` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `focus_category` -- DROP TABLE IF EXISTS `focus_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `focus_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL COMMENT '标题', `thumb` varchar(255) DEFAULT NULL, `intro` text NOT NULL COMMENT '描述', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `focus_category` -- LOCK TABLES `focus_category` WRITE; /*!40000 ALTER TABLE `focus_category` DISABLE KEYS */; /*!40000 ALTER TABLE `focus_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave` -- DROP TABLE IF EXISTS `grave`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT '0', `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `area_totle` float DEFAULT NULL, `area_use` float DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '2', `user_id` int(11) DEFAULT NULL, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(6) NOT NULL DEFAULT '1', `is_show` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否在门户和手机显示', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave` -- LOCK TABLES `grave` WRITE; /*!40000 ALTER TABLE `grave` DISABLE KEYS */; /*!40000 ALTER TABLE `grave` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_address` -- DROP TABLE IF EXISTS `grave_address`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_address` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `province_id` int(11) DEFAULT NULL, `city_id` int(11) DEFAULT NULL, `zone_id` int(11) DEFAULT NULL, `address` text COLLATE utf8_unicode_ci, `postcode` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `status` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_address` -- LOCK TABLES `grave_address` WRITE; /*!40000 ALTER TABLE `grave_address` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_address` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_bury` -- DROP TABLE IF EXISTS `grave_bury`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_bury` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tomb_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `dead_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `dead_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `dead_num` smallint(6) NOT NULL, `bury_type` smallint(6) DEFAULT NULL, `pre_bury_date` datetime DEFAULT NULL, `bury_date` datetime DEFAULT NULL, `bury_time` time DEFAULT NULL, `bury_user` int(11) DEFAULT NULL, `bury_order` smallint(6) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_bury` -- LOCK TABLES `grave_bury` WRITE; /*!40000 ALTER TABLE `grave_bury` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_bury` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_car` -- DROP TABLE IF EXISTS `grave_car`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_car` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `type` smallint(1) DEFAULT '1', `keeper` int(11) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_car` -- LOCK TABLES `grave_car` WRITE; /*!40000 ALTER TABLE `grave_car` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_car` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_car_addr` -- DROP TABLE IF EXISTS `grave_car_addr`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_car_addr` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `type` smallint(1) DEFAULT '1', `time` int(11) DEFAULT '0', `status` smallint(1) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_car_addr` -- LOCK TABLES `grave_car_addr` WRITE; /*!40000 ALTER TABLE `grave_car_addr` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_car_addr` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_car_record` -- DROP TABLE IF EXISTS `grave_car_record`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_car_record` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bury_id` int(11) DEFAULT NULL, `user_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `grave_id` int(11) DEFAULT NULL, `dead_id` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `dead_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `car_id` int(11) DEFAULT NULL, `driver_id` int(11) DEFAULT NULL, `use_date` date DEFAULT NULL, `use_time` time DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `contact_user` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `contact_mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `user_num` int(11) DEFAULT NULL, `addr_id` int(11) DEFAULT NULL, `addr` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `order_id` int(11) DEFAULT NULL, `order_rel_id` int(11) DEFAULT NULL, `is_cremation` smallint(6) DEFAULT '0', `is_back` smallint(6) DEFAULT '0', `car_type` smallint(6) DEFAULT NULL, `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_car_record` -- LOCK TABLES `grave_car_record` WRITE; /*!40000 ALTER TABLE `grave_car_record` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_car_record` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_card` -- DROP TABLE IF EXISTS `grave_card`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_card` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tomb_id` int(11) NOT NULL COMMENT '墓位id', `start` date DEFAULT NULL COMMENT '开始时间', `end` date DEFAULT NULL COMMENT '结束日期', `total` int(11) DEFAULT NULL COMMENT '续费总年数', `created_by` int(11) DEFAULT '0' COMMENT '添加人', `created_at` int(11) DEFAULT NULL COMMENT '添加时间', `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_card` -- LOCK TABLES `grave_card` WRITE; /*!40000 ALTER TABLE `grave_card` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_card` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_card_rel` -- DROP TABLE IF EXISTS `grave_card_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_card_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `card_id` int(11) NOT NULL COMMENT '主表id', `tomb_id` int(11) NOT NULL COMMENT '墓位id', `start` date DEFAULT NULL COMMENT '开始日期', `end` date DEFAULT NULL COMMENT '结束日期', `order_id` int(11) DEFAULT '0' COMMENT '订单id', `price` decimal(10,2) DEFAULT '0.00' COMMENT '续费钱数', `total` int(11) DEFAULT NULL COMMENT '续费年数', `num` int(11) DEFAULT '0' COMMENT '周期数', `customer_name` varchar(50) DEFAULT '', `mobile` varchar(20) DEFAULT '', `created_by` int(11) DEFAULT '0' COMMENT '添加人', `created_at` int(11) DEFAULT NULL COMMENT '添加时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_card_rel` -- LOCK TABLES `grave_card_rel` WRITE; /*!40000 ALTER TABLE `grave_card_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_card_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_clean` -- DROP TABLE IF EXISTS `grave_clean`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_clean` ( `id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `bury_id` int(11) DEFAULT '0', `order_id` int(11) NOT NULL DEFAULT '0', `order_detail_id` int(11) NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `content` text, `op_user` int(11) NOT NULL DEFAULT '0', `clean_user` int(11) NOT NULL DEFAULT '0', `goods_id` int(11) NOT NULL DEFAULT '0', `sku_id` int(11) NOT NULL DEFAULT '0', `use_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `end_use_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `daynum` tinyint(4) NOT NULL DEFAULT '3', `is_over` tinyint(4) NOT NULL DEFAULT '0', `clean_cate` tinyint(4) DEFAULT '0', `clean_type` tinyint(4) DEFAULT '1', `status` tinyint(4) NOT NULL DEFAULT '1', `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_clean` -- LOCK TABLES `grave_clean` WRITE; /*!40000 ALTER TABLE `grave_clean` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_clean` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_customer` -- DROP TABLE IF EXISTS `grave_customer`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_customer` ( `id` int(11) NOT NULL AUTO_INCREMENT, `client_id` int(11) DEFAULT '0', `tomb_id` int(11) NOT NULL, `user_id` int(11) DEFAULT '0', `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `second_ct` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `second_mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `units` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `province` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `city` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `zone` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `addr` text COLLATE utf8_unicode_ci, `relation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `is_vip` smallint(1) DEFAULT '0', `vip_desc` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_customer` -- LOCK TABLES `grave_customer` WRITE; /*!40000 ALTER TABLE `grave_customer` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_customer` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_dead` -- DROP TABLE IF EXISTS `grave_dead`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_dead` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `memorial_id` int(11) DEFAULT NULL, `dead_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `second_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `dead_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `serial` int(11) DEFAULT NULL, `gender` smallint(1) DEFAULT '1', `birth_place` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `birth` date DEFAULT NULL, `fete` date DEFAULT NULL, `is_alive` smallint(1) DEFAULT '1', `is_adult` smallint(1) DEFAULT NULL, `age` smallint(6) DEFAULT NULL, `follow_id` int(11) DEFAULT NULL, `desc` text COLLATE utf8_unicode_ci, `is_ins` smallint(1) DEFAULT '0', `bone_type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `bone_box` smallint(6) DEFAULT NULL, `pre_bury` datetime DEFAULT NULL, `bury` datetime DEFAULT NULL, `sort` smallint(6) DEFAULT '0', `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_dead` -- LOCK TABLES `grave_dead` WRITE; /*!40000 ALTER TABLE `grave_dead` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_dead` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_dead_dates` -- DROP TABLE IF EXISTS `grave_dead_dates`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_dead_dates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tomb_id` int(11) NOT NULL, `dead_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `dead_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `solar_dt` date DEFAULT NULL, `lunar_dt` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `time` time DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `created_at` int(11) DEFAULT NULL, `updated_at` int(11) DEFAULT NULL, `status` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_dead_dates` -- LOCK TABLES `grave_dead_dates` WRITE; /*!40000 ALTER TABLE `grave_dead_dates` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_dead_dates` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_images_inscfg` -- DROP TABLE IF EXISTS `grave_images_inscfg`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_images_inscfg` ( `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '自增ID', `title` varchar(255) DEFAULT NULL COMMENT '图片标题', `desc` text COMMENT '图片描述', `path` varchar(255) NOT NULL COMMENT '保存路径,类型以后的路径', `name` varchar(64) NOT NULL COMMENT '保存名称', `owner_id` int(10) NOT NULL DEFAULT '0' COMMENT '用户ID', `img_use` varchar(100) NOT NULL COMMENT '图片的用户', `sort` mediumint(5) NOT NULL DEFAULT '0' COMMENT '排序', `add_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', `md5` char(32) NOT NULL COMMENT '图片的md5', `ext` varchar(10) NOT NULL COMMENT '图片的类型', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否被删除', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_images_inscfg` -- LOCK TABLES `grave_images_inscfg` WRITE; /*!40000 ALTER TABLE `grave_images_inscfg` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_images_inscfg` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins` -- DROP TABLE IF EXISTS `grave_ins`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `guide_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `op_id` int(11) DEFAULT NULL, `order_rel_id` int(11) DEFAULT NULL, `goods_id` int(11) DEFAULT NULL, `type` smallint(1) DEFAULT '0', `tpl_cfg` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `position` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `shape` varchar(1) COLLATE utf8_unicode_ci DEFAULT 'v', `content` text COLLATE utf8_unicode_ci, `img` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `font` smallint(1) DEFAULT '1', `big_num` smallint(6) DEFAULT NULL, `small_num` smallint(6) NOT NULL DEFAULT '0' COMMENT '小字个数', `new_small_num` smallint(6) NOT NULL DEFAULT '0' COMMENT '新增小字数', `new_big_num` smallint(6) DEFAULT NULL, `is_tc` smallint(1) DEFAULT '0', `final_tc` smallint(1) DEFAULT '0', `is_confirm` smallint(1) DEFAULT '0', `confirm_date` date DEFAULT NULL, `confirm_by` int(11) DEFAULT NULL, `pre_finish` date DEFAULT NULL, `finish_at` date DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `version` int(11) DEFAULT '0', `paint` smallint(6) DEFAULT NULL, `is_stand` smallint(1) DEFAULT '0', `paint_price` decimal(10,2) DEFAULT NULL, `letter_price` decimal(10,2) DEFAULT NULL, `tc_price` decimal(10,2) DEFAULT NULL, `changed` smallint(1) DEFAULT '0', `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins` -- LOCK TABLES `grave_ins` WRITE; /*!40000 ALTER TABLE `grave_ins` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins_cfg` -- DROP TABLE IF EXISTS `grave_ins_cfg`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins_cfg` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '配置id', `name` varchar(100) NOT NULL COMMENT '配置名', `shape` char(1) NOT NULL DEFAULT 'v' COMMENT 'v竖,h横', `is_god` tinyint(1) NOT NULL COMMENT '1天主 0非天主', `is_front` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1前模板,0后模板', `note` text NOT NULL COMMENT '备注', `sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins_cfg` -- LOCK TABLES `grave_ins_cfg` WRITE; /*!40000 ALTER TABLE `grave_ins_cfg` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins_cfg` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins_cfg_case` -- DROP TABLE IF EXISTS `grave_ins_cfg_case`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins_cfg_case` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id', `cfg_id` int(11) NOT NULL COMMENT '配置id', `num` int(11) NOT NULL COMMENT '人数', `width` int(11) NOT NULL COMMENT '图片宽', `height` int(11) NOT NULL COMMENT '图片高', `img` varchar(200) DEFAULT NULL COMMENT '示例图片', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,0删除 ', `sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序', `add_time` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='碑文配置名称表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins_cfg_case` -- LOCK TABLES `grave_ins_cfg_case` WRITE; /*!40000 ALTER TABLE `grave_ins_cfg_case` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins_cfg_case` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins_cfg_rel` -- DROP TABLE IF EXISTS `grave_ins_cfg_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins_cfg_rel` ( `grave_id` int(11) NOT NULL COMMENT '墓区id', `cfg_id` int(11) NOT NULL COMMENT '配置id' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='墓区与配置关联表,多对多'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins_cfg_rel` -- LOCK TABLES `grave_ins_cfg_rel` WRITE; /*!40000 ALTER TABLE `grave_ins_cfg_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins_cfg_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins_cfg_value` -- DROP TABLE IF EXISTS `grave_ins_cfg_value`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins_cfg_value` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增加id', `case_id` int(11) NOT NULL COMMENT '配置名id', `mark` char(20) NOT NULL COMMENT '标识,如title、name等', `sort` int(11) NOT NULL DEFAULT '0' COMMENT '序号,比如逝者有两个时,排个序', `is_big` tinyint(1) NOT NULL DEFAULT '1', `size` int(11) NOT NULL COMMENT '字体尺寸', `x` int(11) NOT NULL COMMENT 'x轴距离', `y` int(11) NOT NULL COMMENT 'y方向距离', `color` varchar(10) NOT NULL COMMENT '颜色,存16进制好一些', `direction` tinyint(4) NOT NULL COMMENT '字超向,0:正向,1:反向', `text` varchar(100) NOT NULL COMMENT '测试值', `add_time` datetime NOT NULL COMMENT '添加时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='碑文配置表'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins_cfg_value` -- LOCK TABLES `grave_ins_cfg_value` WRITE; /*!40000 ALTER TABLE `grave_ins_cfg_value` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins_cfg_value` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_ins_log` -- DROP TABLE IF EXISTS `grave_ins_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_ins_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ins_id` int(11) NOT NULL, `op_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `action` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `img` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `content` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_ins_log` -- LOCK TABLES `grave_ins_log` WRITE; /*!40000 ALTER TABLE `grave_ins_log` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_ins_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_portrait` -- DROP TABLE IF EXISTS `grave_portrait`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_portrait` ( `id` int(11) NOT NULL AUTO_INCREMENT, `guide_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `sku_id` int(11) DEFAULT NULL, `order_id` int(11) DEFAULT NULL, `order_rel_id` int(11) DEFAULT NULL, `dead_ids` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `photo_original` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `photo_processed` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `confirm_by` int(11) DEFAULT NULL, `confirm_at` datetime DEFAULT NULL, `photo_confirm` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `use_at` datetime DEFAULT NULL, `up_at` datetime DEFAULT NULL, `notice_id` int(11) DEFAULT NULL, `type` smallint(6) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `sort` int(11) DEFAULT '0', `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_portrait` -- LOCK TABLES `grave_portrait` WRITE; /*!40000 ALTER TABLE `grave_portrait` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_portrait` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_portrait_log` -- DROP TABLE IF EXISTS `grave_portrait_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_portrait_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `portrait_id` int(11) NOT NULL, `op_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `action` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `img` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_portrait_log` -- LOCK TABLES `grave_portrait_log` WRITE; /*!40000 ALTER TABLE `grave_portrait_log` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_portrait_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_return` -- DROP TABLE IF EXISTS `grave_return`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_return` ( `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_return` -- LOCK TABLES `grave_return` WRITE; /*!40000 ALTER TABLE `grave_return` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_return` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_tomb` -- DROP TABLE IF EXISTS `grave_tomb`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_tomb` ( `id` int(11) NOT NULL AUTO_INCREMENT, `grave_id` int(11) DEFAULT NULL, `row` int(11) DEFAULT NULL, `col` int(11) DEFAULT NULL, `special` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `tomb_no` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hole` smallint(6) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `cost` decimal(10,2) DEFAULT NULL, `area_total` float DEFAULT NULL, `area_use` float DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `customer_id` int(11) DEFAULT NULL, `agent_id` int(11) DEFAULT NULL, `agency_id` int(11) DEFAULT NULL, `guide_id` int(11) DEFAULT NULL, `sale_time` datetime DEFAULT NULL, `mnt_by` varchar(200) COLLATE utf8_unicode_ci DEFAULT '', `note` text COLLATE utf8_unicode_ci, `thumb` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_tomb` -- LOCK TABLES `grave_tomb` WRITE; /*!40000 ALTER TABLE `grave_tomb` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_tomb` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `grave_withdraw` -- DROP TABLE IF EXISTS `grave_withdraw`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `grave_withdraw` ( `id` int(11) NOT NULL AUTO_INCREMENT, `guide_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `tomb_id` int(11) NOT NULL, `current_tomb_id` int(11) NOT NULL, `refund_id` int(11) DEFAULT NULL, `ct_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_card` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_relation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `reson` text COLLATE utf8_unicode_ci, `price` decimal(10,2) DEFAULT NULL, `in_tomb_id` int(11) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `grave_withdraw` -- LOCK TABLES `grave_withdraw` WRITE; /*!40000 ALTER TABLE `grave_withdraw` DISABLE KEYS */; /*!40000 ALTER TABLE `grave_withdraw` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `image_config` -- DROP TABLE IF EXISTS `image_config`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `image_config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `is_thumb` smallint(1) DEFAULT '1', `thumb_mode` smallint(1) DEFAULT '1', `thumb_config` text COLLATE utf8_unicode_ci, `water_mod` smallint(1) DEFAULT '1', `water_image` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `water_text` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `water_opacity` int(4) DEFAULT '100', `water_pos` smallint(6) DEFAULT NULL, `min_width` int(11) DEFAULT NULL, `min_height` int(11) DEFAULT NULL, `created_at` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `image_config` -- LOCK TABLES `image_config` WRITE; /*!40000 ALTER TABLE `image_config` DISABLE KEYS */; /*!40000 ALTER TABLE `image_config` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory` -- DROP TABLE IF EXISTS `inventory`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory` ( `id` int(11) NOT NULL AUTO_INCREMENT, `goods_id` int(11) DEFAULT NULL, `sku_id` int(11) DEFAULT NULL, `record` float DEFAULT NULL, `actual` float DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_date` datetime DEFAULT NULL, `diff_num` float DEFAULT NULL, `diff_amount` decimal(10,2) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory` -- LOCK TABLES `inventory` WRITE; /*!40000 ALTER TABLE `inventory` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_purchase` -- DROP TABLE IF EXISTS `inventory_purchase`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_purchase` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplier_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `checker_id` int(11) DEFAULT NULL, `checker_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `total` decimal(10,2) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `supply_at` date NOT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_purchase` -- LOCK TABLES `inventory_purchase` WRITE; /*!40000 ALTER TABLE `inventory_purchase` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_purchase` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_purchase_finance` -- DROP TABLE IF EXISTS `inventory_purchase_finance`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_purchase_finance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `purchase_id` int(11) DEFAULT NULL, `refund_id` int(11) DEFAULT NULL, `amount` decimal(10,2) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '2', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_purchase_finance` -- LOCK TABLES `inventory_purchase_finance` WRITE; /*!40000 ALTER TABLE `inventory_purchase_finance` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_purchase_finance` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_purchase_refund` -- DROP TABLE IF EXISTS `inventory_purchase_refund`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_purchase_refund` ( `id` int(11) NOT NULL AUTO_INCREMENT, `purchase_rel_id` int(11) DEFAULT NULL, `num` float DEFAULT NULL, `amount` decimal(10,2) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '2', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_purchase_refund` -- LOCK TABLES `inventory_purchase_refund` WRITE; /*!40000 ALTER TABLE `inventory_purchase_refund` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_purchase_refund` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_purchase_rel` -- DROP TABLE IF EXISTS `inventory_purchase_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_purchase_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supplier_id` int(11) NOT NULL, `record_id` int(11) NOT NULL, `goods_id` int(11) NOT NULL, `sku_id` int(11) NOT NULL, `unit_price` decimal(10,2) DEFAULT NULL, `num` float DEFAULT NULL, `unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `total` decimal(10,2) DEFAULT NULL, `retail` decimal(10,2) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_purchase_rel` -- LOCK TABLES `inventory_purchase_rel` WRITE; /*!40000 ALTER TABLE `inventory_purchase_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_purchase_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_storage` -- DROP TABLE IF EXISTS `inventory_storage`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_storage` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `pos` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `op_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_storage` -- LOCK TABLES `inventory_storage` WRITE; /*!40000 ALTER TABLE `inventory_storage` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_storage` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `inventory_supplier` -- DROP TABLE IF EXISTS `inventory_supplier`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `inventory_supplier` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cp_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `cp_phone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `addr` text COLLATE utf8_unicode_ci NOT NULL, `ct_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_mobile` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `ct_sex` smallint(6) DEFAULT NULL, `qq` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `wechat` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_by` int(11) NOT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `inventory_supplier` -- LOCK TABLES `inventory_supplier` WRITE; /*!40000 ALTER TABLE `inventory_supplier` DISABLE KEYS */; /*!40000 ALTER TABLE `inventory_supplier` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `links` -- DROP TABLE IF EXISTS `links`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `links` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `status` smallint(1) DEFAULT '1', `created_at` int(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `links` -- LOCK TABLES `links` WRITE; /*!40000 ALTER TABLE `links` DISABLE KEYS */; /*!40000 ALTER TABLE `links` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `memorial` -- DROP TABLE IF EXISTS `memorial`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `memorial` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `tomb_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `privacy` smallint(1) DEFAULT '0', `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `tpl` varchar(200) COLLATE utf8_unicode_ci DEFAULT 'ink', `status` smallint(1) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `memorial` -- LOCK TABLES `memorial` WRITE; /*!40000 ALTER TABLE `memorial` DISABLE KEYS */; /*!40000 ALTER TABLE `memorial` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `memorial_day` -- DROP TABLE IF EXISTS `memorial_day`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `memorial_day` ( `id` int(11) NOT NULL AUTO_INCREMENT, `memorial_id` int(11) DEFAULT NULL, `date` date DEFAULT NULL, `date_type` smallint(1) DEFAULT '1', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(1) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `memorial_day` -- LOCK TABLES `memorial_day` WRITE; /*!40000 ALTER TABLE `memorial_day` DISABLE KEYS */; /*!40000 ALTER TABLE `memorial_day` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `memorial_pray` -- DROP TABLE IF EXISTS `memorial_pray`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `memorial_pray` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `memorial_id` int(11) NOT NULL, `type` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `msg` text COLLATE utf8_unicode_ci, `order_id` int(11) DEFAULT '0', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `memorial_pray` -- LOCK TABLES `memorial_pray` WRITE; /*!40000 ALTER TABLE `memorial_pray` DISABLE KEYS */; /*!40000 ALTER TABLE `memorial_pray` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `memorial_rel` -- DROP TABLE IF EXISTS `memorial_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `memorial_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `memorial_id` int(11) NOT NULL, `res_name` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `res_id` int(11) NOT NULL, `res_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `res_user` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `res_cover` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `memorial_rel` -- LOCK TABLES `memorial_rel` WRITE; /*!40000 ALTER TABLE `memorial_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `memorial_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `memorial_user` -- DROP TABLE IF EXISTS `memorial_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `memorial_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `memorial_id` int(11) NOT NULL, `relation` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `memorial_user` -- LOCK TABLES `memorial_user` WRITE; /*!40000 ALTER TABLE `memorial_user` DISABLE KEYS */; /*!40000 ALTER TABLE `memorial_user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `message` -- DROP TABLE IF EXISTS `message`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `message` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_id` int(11) DEFAULT NULL, `res_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'goods', `op_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `term` date DEFAULT NULL, `product` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `mobile` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `qq` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `skype` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `company` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) DEFAULT '1', `created_at` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `message` -- LOCK TABLES `message` WRITE; /*!40000 ALTER TABLE `message` DISABLE KEYS */; /*!40000 ALTER TABLE `message` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `migration` -- DROP TABLE IF EXISTS `migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `migration` ( `version` varchar(180) NOT NULL, `apply_time` int(11) DEFAULT NULL, PRIMARY KEY (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `migration` -- LOCK TABLES `migration` WRITE; /*!40000 ALTER TABLE `migration` DISABLE KEYS */; /*!40000 ALTER TABLE `migration` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `module` -- DROP TABLE IF EXISTS `module`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `module` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) DEFAULT NULL, `title` varchar(200) NOT NULL, `intro` text, `logo` varchar(200) DEFAULT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `module` -- LOCK TABLES `module` WRITE; /*!40000 ALTER TABLE `module` DISABLE KEYS */; /*!40000 ALTER TABLE `module` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `module_code` -- DROP TABLE IF EXISTS `module_code`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `module_code` ( `id` int(11) NOT NULL AUTO_INCREMENT, `module` varchar(50) NOT NULL, `type` varchar(50) NOT NULL DEFAULT 'model', `code` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='模块代码'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `module_code` -- LOCK TABLES `module_code` WRITE; /*!40000 ALTER TABLE `module_code` DISABLE KEYS */; /*!40000 ALTER TABLE `module_code` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `module_field` -- DROP TABLE IF EXISTS `module_field`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `module_field` ( `id` int(11) NOT NULL AUTO_INCREMENT, `model_id` int(11) NOT NULL, `table` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `pop_note` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `html` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `option` text COLLATE utf8_unicode_ci, `default` text COLLATE utf8_unicode_ci, `is_show` smallint(1) DEFAULT '1', `order` smallint(1) DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `module_field` -- LOCK TABLES `module_field` WRITE; /*!40000 ALTER TABLE `module_field` DISABLE KEYS */; /*!40000 ALTER TABLE `module_field` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `module_model` -- DROP TABLE IF EXISTS `module_model`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `module_model` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mid` int(11) NOT NULL COMMENT '代替原来用id的mod', `module` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `dir` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci NOT NULL, `link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `order` smallint(4) DEFAULT NULL, `show` smallint(1) DEFAULT '1', `logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `module_model` -- LOCK TABLES `module_model` WRITE; /*!40000 ALTER TABLE `module_model` DISABLE KEYS */; /*!40000 ALTER TABLE `module_model` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `news` -- DROP TABLE IF EXISTS `news`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `news` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `subtitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `summary` text COLLATE utf8_unicode_ci, `author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `pic_author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `video_author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `source` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `video` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `recommend` smallint(6) DEFAULT '0', `is_top` smallint(6) DEFAULT '0', `type` smallint(6) DEFAULT '1', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `news` -- LOCK TABLES `news` WRITE; /*!40000 ALTER TABLE `news` DISABLE KEYS */; /*!40000 ALTER TABLE `news` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `news_category` -- DROP TABLE IF EXISTS `news_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `news_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT '0', `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `thumb` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(1) DEFAULT '1', `seo_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_description` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `news_category` -- LOCK TABLES `news_category` WRITE; /*!40000 ALTER TABLE `news_category` DISABLE KEYS */; /*!40000 ALTER TABLE `news_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `news_data` -- DROP TABLE IF EXISTS `news_data`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `news_data` ( `news_id` int(11) NOT NULL AUTO_INCREMENT, `body` text COLLATE utf8_unicode_ci, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`news_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `news_data` -- LOCK TABLES `news_data` WRITE; /*!40000 ALTER TABLE `news_data` DISABLE KEYS */; /*!40000 ALTER TABLE `news_data` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `news_photo` -- DROP TABLE IF EXISTS `news_photo`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `news_photo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `news_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `body` text COLLATE utf8_unicode_ci, `ext` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ip` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `news_photo` -- LOCK TABLES `news_photo` WRITE; /*!40000 ALTER TABLE `news_photo` DISABLE KEYS */; /*!40000 ALTER TABLE `news_photo` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `note` -- DROP TABLE IF EXISTS `note`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `note` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `user_id` int(11) DEFAULT NULL, `start` date DEFAULT NULL, `end` date DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `note` -- LOCK TABLES `note` WRITE; /*!40000 ALTER TABLE `note` DISABLE KEYS */; /*!40000 ALTER TABLE `note` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order` -- DROP TABLE IF EXISTS `order`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tid` int(11) DEFAULT NULL, `wechat_uid` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `origin_price` decimal(10,2) DEFAULT NULL, `type` smallint(6) DEFAULT '1', `progress` smallint(6) DEFAULT '0', `note` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order` -- LOCK TABLES `order` WRITE; /*!40000 ALTER TABLE `order` DISABLE KEYS */; /*!40000 ALTER TABLE `order` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order_delay` -- DROP TABLE IF EXISTS `order_delay`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order_delay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `pre_dt` date DEFAULT NULL, `pay_dt` datetime DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `created_by` int(11) DEFAULT NULL, `is_verified` smallint(1) DEFAULT '0', `verified_by` int(11) DEFAULT NULL, `verified_at` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order_delay` -- LOCK TABLES `order_delay` WRITE; /*!40000 ALTER TABLE `order_delay` DISABLE KEYS */; /*!40000 ALTER TABLE `order_delay` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order_log` -- DROP TABLE IF EXISTS `order_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(11) NOT NULL, `op_id` int(11) NOT NULL, `old` text NOT NULL, `diff` text, `intro` text, `type` tinyint(4) NOT NULL DEFAULT '4', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf32 COMMENT='订单日志'; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order_log` -- LOCK TABLES `order_log` WRITE; /*!40000 ALTER TABLE `order_log` DISABLE KEYS */; /*!40000 ALTER TABLE `order_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order_pay` -- DROP TABLE IF EXISTS `order_pay`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order_pay` ( `id` int(11) NOT NULL AUTO_INCREMENT, `wechat_uid` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `order_id` int(11) DEFAULT NULL, `order_no` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `trade_no` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `total_fee` decimal(10,2) DEFAULT NULL, `total_pay` decimal(10,2) DEFAULT NULL, `pay_method` smallint(6) DEFAULT NULL, `pay_result` smallint(6) DEFAULT NULL, `paid_at` datetime DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `checkout_at` datetime DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order_pay` -- LOCK TABLES `order_pay` WRITE; /*!40000 ALTER TABLE `order_pay` DISABLE KEYS */; /*!40000 ALTER TABLE `order_pay` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order_refund` -- DROP TABLE IF EXISTS `order_refund`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order_refund` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tid` int(11) NOT NULL DEFAULT '0', `order_id` int(11) DEFAULT NULL, `wechat_uid` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `fee` decimal(10,2) DEFAULT NULL, `progress` smallint(6) DEFAULT '1', `price` decimal(10,2) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `note` text COLLATE utf8_unicode_ci, `checkout_at` datetime DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order_refund` -- LOCK TABLES `order_refund` WRITE; /*!40000 ALTER TABLE `order_refund` DISABLE KEYS */; /*!40000 ALTER TABLE `order_refund` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `order_rel` -- DROP TABLE IF EXISTS `order_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `order_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tid` int(11) DEFAULT '0', `wechat_uid` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `type` smallint(6) DEFAULT '1', `category_id` smallint(6) DEFAULT NULL, `goods_id` int(11) DEFAULT NULL, `sku_id` int(11) DEFAULT NULL, `sku_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `order_id` int(11) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `original_price` decimal(10,2) NOT NULL DEFAULT '0.00', `price_unit` decimal(10,2) DEFAULT NULL, `num` int(11) DEFAULT NULL, `use_time` datetime DEFAULT NULL, `note` text COLLATE utf8_unicode_ci, `is_refund` tinyint(1) NOT NULL DEFAULT '0', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, `status` smallint(6) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `order_rel` -- LOCK TABLES `order_rel` WRITE; /*!40000 ALTER TABLE `order_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `order_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post` -- DROP TABLE IF EXISTS `post`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `category_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `subtitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `summary` text COLLATE utf8_unicode_ci, `body` text COLLATE utf8_unicode_ci NOT NULL, `thumb` int(11) DEFAULT NULL, `ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `photo_num` int(11) NOT NULL DEFAULT '0', `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `recommend` smallint(6) DEFAULT '0', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1text 2 image 3video', `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post` -- LOCK TABLES `post` WRITE; /*!40000 ALTER TABLE `post` DISABLE KEYS */; /*!40000 ALTER TABLE `post` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_2` -- DROP TABLE IF EXISTS `post_2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_2` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `category_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `subtitle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `summary` text COLLATE utf8_unicode_ci, `body` text COLLATE utf8_unicode_ci NOT NULL, `thumb` int(11) DEFAULT NULL, `ip` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `recommend` smallint(6) DEFAULT '0', `created_by` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `photo_num` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '1', `updated_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', `author2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_2` -- LOCK TABLES `post_2` WRITE; /*!40000 ALTER TABLE `post_2` DISABLE KEYS */; /*!40000 ALTER TABLE `post_2` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_attach` -- DROP TABLE IF EXISTS `post_attach`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_attach` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_id` int(11) DEFAULT NULL, `author_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `desc` text COLLATE utf8_unicode_ci, `ext` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_attach` -- LOCK TABLES `post_attach` WRITE; /*!40000 ALTER TABLE `post_attach` DISABLE KEYS */; /*!40000 ALTER TABLE `post_attach` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_category` -- DROP TABLE IF EXISTS `post_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cover` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(1) DEFAULT '1', `seo_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_description` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_category` -- LOCK TABLES `post_category` WRITE; /*!40000 ALTER TABLE `post_category` DISABLE KEYS */; /*!40000 ALTER TABLE `post_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_data` -- DROP TABLE IF EXISTS `post_data`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_data` ( `post_id` int(11) NOT NULL AUTO_INCREMENT, `body` text COLLATE utf8_unicode_ci, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`post_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_data` -- LOCK TABLES `post_data` WRITE; /*!40000 ALTER TABLE `post_data` DISABLE KEYS */; /*!40000 ALTER TABLE `post_data` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_data_2` -- DROP TABLE IF EXISTS `post_data_2`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_data_2` ( `post_id` int(11) NOT NULL AUTO_INCREMENT, `body` text COLLATE utf8_unicode_ci, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`post_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_data_2` -- LOCK TABLES `post_data_2` WRITE; /*!40000 ALTER TABLE `post_data_2` DISABLE KEYS */; /*!40000 ALTER TABLE `post_data_2` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `post_image` -- DROP TABLE IF EXISTS `post_image`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `post_image` ( `id` int(11) NOT NULL AUTO_INCREMENT, `post_id` int(11) DEFAULT NULL, `mod` int(11) DEFAULT NULL, `author_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `view_all` int(11) DEFAULT '0', `com_all` int(11) DEFAULT '0', `desc` text COLLATE utf8_unicode_ci, `ext` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `post_image` -- LOCK TABLES `post_image` WRITE; /*!40000 ALTER TABLE `post_image` DISABLE KEYS */; /*!40000 ALTER TABLE `post_image` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `settlement` -- DROP TABLE IF EXISTS `settlement`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `settlement` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_id` int(11) NOT NULL, `op_id` int(11) NOT NULL, `guide_id` int(11) DEFAULT NULL, `agent_id` int(11) DEFAULT NULL, `type` smallint(6) NOT NULL, `pay_type` smallint(6) NOT NULL, `ori_price` decimal(10,2) NOT NULL, `price` decimal(10,2) NOT NULL, `year` smallint(6) DEFAULT NULL, `quarter` tinyint(4) NOT NULL COMMENT '季度', `month` smallint(2) DEFAULT NULL, `week` smallint(2) DEFAULT NULL, `day` smallint(2) DEFAULT NULL, `settle_time` datetime NOT NULL, `pay_time` datetime DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `settlement` -- LOCK TABLES `settlement` WRITE; /*!40000 ALTER TABLE `settlement` DISABLE KEYS */; /*!40000 ALTER TABLE `settlement` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `settlement_rel` -- DROP TABLE IF EXISTS `settlement_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `settlement_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `settlement_id` int(11) NOT NULL, `order_id` int(11) NOT NULL, `op_id` int(11) NOT NULL, `guide_id` int(11) DEFAULT NULL, `agent_id` int(11) DEFAULT NULL, `res_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `category_id` int(11) NOT NULL, `goods_id` int(11) NOT NULL, `sku_id` int(11) NOT NULL, `type` smallint(6) DEFAULT NULL, `num` int(11) DEFAULT '1', `ori_price` decimal(10,2) NOT NULL, `price` decimal(10,2) NOT NULL, `year` smallint(6) DEFAULT NULL, `month` smallint(2) DEFAULT NULL, `week` smallint(2) DEFAULT NULL, `day` smallint(2) DEFAULT NULL, `settle_time` datetime NOT NULL, `pay_time` datetime DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `settlement_rel` -- LOCK TABLES `settlement_rel` WRITE; /*!40000 ALTER TABLE `settlement_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `settlement_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `settlement_tomb` -- DROP TABLE IF EXISTS `settlement_tomb`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `settlement_tomb` ( `id` int(11) NOT NULL AUTO_INCREMENT, `num` int(11) DEFAULT NULL, `amount` decimal(20,2) DEFAULT NULL, `time` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `settlement_tomb` -- LOCK TABLES `settlement_tomb` WRITE; /*!40000 ALTER TABLE `settlement_tomb` DISABLE KEYS */; /*!40000 ALTER TABLE `settlement_tomb` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_attach` -- DROP TABLE IF EXISTS `shop_attach`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_attach` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_id` int(11) DEFAULT NULL, `author_id` int(11) DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) DEFAULT NULL, `desc` text COLLATE utf8_unicode_ci, `ext` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_attach` -- LOCK TABLES `shop_attach` WRITE; /*!40000 ALTER TABLE `shop_attach` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_attach` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_attr` -- DROP TABLE IF EXISTS `shop_attr`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_attr` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type_id` int(11) DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_multi` smallint(6) DEFAULT '0', `is_spec` smallint(6) DEFAULT '0', `body` text COLLATE utf8_unicode_ci, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_attr` -- LOCK TABLES `shop_attr` WRITE; /*!40000 ALTER TABLE `shop_attr` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_attr` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_av` -- DROP TABLE IF EXISTS `shop_av`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_av` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type_id` int(11) DEFAULT NULL, `attr_id` int(11) DEFAULT NULL, `val` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_av` -- LOCK TABLES `shop_av` WRITE; /*!40000 ALTER TABLE `shop_av` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_av` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_av_rel` -- DROP TABLE IF EXISTS `shop_av_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_av_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `type_id` int(11) DEFAULT NULL, `category_id` int(11) DEFAULT NULL, `goods_id` int(11) DEFAULT NULL, `attr_id` int(11) DEFAULT NULL, `av_id` int(11) DEFAULT NULL, `value` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_av_rel` -- LOCK TABLES `shop_av_rel` WRITE; /*!40000 ALTER TABLE `shop_av_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_av_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_bag` -- DROP TABLE IF EXISTS `shop_bag`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_bag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) DEFAULT '0', `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `op_id` int(11) DEFAULT NULL, `original_price` decimal(10,2) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `rate` decimal(10,2) NOT NULL COMMENT '折扣率', `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `type` smallint(6) DEFAULT '1', `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_bag` -- LOCK TABLES `shop_bag` WRITE; /*!40000 ALTER TABLE `shop_bag` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_bag` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_bag_rel` -- DROP TABLE IF EXISTS `shop_bag_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_bag_rel` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bag_id` int(11) NOT NULL, `goods_id` int(11) NOT NULL, `sku_id` int(11) NOT NULL, `num` int(11) NOT NULL DEFAULT '1', `unit_price` decimal(10,2) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_bag_rel` -- LOCK TABLES `shop_bag_rel` WRITE; /*!40000 ALTER TABLE `shop_bag_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_bag_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_cart` -- DROP TABLE IF EXISTS `shop_cart`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_cart` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `type` smallint(6) DEFAULT '1', `goods_id` int(11) DEFAULT NULL, `sku_id` int(11) DEFAULT NULL, `num` int(11) DEFAULT NULL, `note` text COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_cart` -- LOCK TABLES `shop_cart` WRITE; /*!40000 ALTER TABLE `shop_cart` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_cart` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_category` -- DROP TABLE IF EXISTS `shop_category`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT NULL, `type_id` int(11) DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(6) NOT NULL DEFAULT '1', `is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否前台显示 ', `seo_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_description` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_category` -- LOCK TABLES `shop_category` WRITE; /*!40000 ALTER TABLE `shop_category` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_category` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_goods` -- DROP TABLE IF EXISTS `shop_goods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_goods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `category_id` int(11) DEFAULT NULL, `pinyin` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `serial` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `skill` text COLLATE utf8_unicode_ci, `unit` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `original_price` decimal(10,2) DEFAULT '0.00' COMMENT '原价', `num` int(11) DEFAULT NULL, `is_recommend` smallint(6) DEFAULT '0', `is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否前台显示', `status` smallint(6) NOT NULL DEFAULT '1', `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_goods` -- LOCK TABLES `shop_goods` WRITE; /*!40000 ALTER TABLE `shop_goods` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_goods` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_history` -- DROP TABLE IF EXISTS `shop_history`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_history` ( `id` int(11) NOT NULL AUTO_INCREMENT, `wechat_uid` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `goods_id` int(11) DEFAULT NULL, `sku_id` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_history` -- LOCK TABLES `shop_history` WRITE; /*!40000 ALTER TABLE `shop_history` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_history` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_mix` -- DROP TABLE IF EXISTS `shop_mix`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_mix` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mix_cate` int(11) DEFAULT '0', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_mix` -- LOCK TABLES `shop_mix` WRITE; /*!40000 ALTER TABLE `shop_mix` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_mix` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_mix_cate` -- DROP TABLE IF EXISTS `shop_mix_cate`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_mix_cate` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `thumb` int(11) DEFAULT NULL, `body` text COLLATE utf8_unicode_ci, `sort` smallint(6) NOT NULL DEFAULT '0', `is_leaf` smallint(6) NOT NULL DEFAULT '1', `seo_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `seo_description` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_mix_cate` -- LOCK TABLES `shop_mix_cate` WRITE; /*!40000 ALTER TABLE `shop_mix_cate` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_mix_cate` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_mix_rel` -- DROP TABLE IF EXISTS `shop_mix_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_mix_rel` ( `category_id` int(11) DEFAULT NULL, `mix_cate` int(11) DEFAULT '0', `goods_id` int(11) DEFAULT NULL, `mix_id` int(11) DEFAULT NULL, `measure` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `type` smallint(1) DEFAULT '0', `status` smallint(6) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_mix_rel` -- LOCK TABLES `shop_mix_rel` WRITE; /*!40000 ALTER TABLE `shop_mix_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_mix_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_process` -- DROP TABLE IF EXISTS `shop_process`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_process` ( `id` int(11) NOT NULL AUTO_INCREMENT, `goods_id` int(11) DEFAULT NULL, `step` smallint(6) DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `thumb` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `type` smallint(6) DEFAULT '1', `sort` smallint(6) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_process` -- LOCK TABLES `shop_process` WRITE; /*!40000 ALTER TABLE `shop_process` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_process` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_sku` -- DROP TABLE IF EXISTS `shop_sku`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_sku` ( `id` int(11) NOT NULL AUTO_INCREMENT, `goods_id` int(11) NOT NULL, `serial` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `num` int(11) DEFAULT NULL, `price` decimal(10,2) DEFAULT NULL, `original_price` decimal(10,2) DEFAULT '0.00', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `av` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_sku` -- LOCK TABLES `shop_sku` WRITE; /*!40000 ALTER TABLE `shop_sku` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_sku` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `shop_type` -- DROP TABLE IF EXISTS `shop_type`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `shop_type` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `shop_type` -- LOCK TABLES `shop_type` WRITE; /*!40000 ALTER TABLE `shop_type` DISABLE KEYS */; /*!40000 ALTER TABLE `shop_type` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sms_receive` -- DROP TABLE IF EXISTS `sms_receive`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sms_receive` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `msg` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sms_receive` -- LOCK TABLES `sms_receive` WRITE; /*!40000 ALTER TABLE `sms_receive` DISABLE KEYS */; /*!40000 ALTER TABLE `sms_receive` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sms_send` -- DROP TABLE IF EXISTS `sms_send`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sms_send` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mobile` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `msg` text COLLATE utf8_unicode_ci, `time` datetime DEFAULT NULL, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sms_send` -- LOCK TABLES `sms_send` WRITE; /*!40000 ALTER TABLE `sms_send` DISABLE KEYS */; /*!40000 ALTER TABLE `sms_send` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `subject` -- DROP TABLE IF EXISTS `subject`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `subject` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci NOT NULL, `link` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `cover` int(11) DEFAULT NULL, `path` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `cate` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '分类', `status` smallint(6) DEFAULT '1', `updated_at` int(11) NOT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `subject` -- LOCK TABLES `subject` WRITE; /*!40000 ALTER TABLE `subject` DISABLE KEYS */; /*!40000 ALTER TABLE `subject` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sys_menu` -- DROP TABLE IF EXISTS `sys_menu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sys_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `auth_name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `pid` int(11) DEFAULT NULL, `icon` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` smallint(6) NOT NULL DEFAULT '1', `status` smallint(6) NOT NULL DEFAULT '1', `description` text COLLATE utf8_unicode_ci, `panel` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sys_menu` -- LOCK TABLES `sys_menu` WRITE; /*!40000 ALTER TABLE `sys_menu` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_menu` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sys_note` -- DROP TABLE IF EXISTS `sys_note`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sys_note` ( `id` int(11) NOT NULL AUTO_INCREMENT, `res_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `res_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `content` text COLLATE utf8_unicode_ci, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sys_note` -- LOCK TABLES `sys_note` WRITE; /*!40000 ALTER TABLE `sys_note` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_note` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sys_note_log` -- DROP TABLE IF EXISTS `sys_note_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sys_note_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `note_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `content` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sys_note_log` -- LOCK TABLES `sys_note_log` WRITE; /*!40000 ALTER TABLE `sys_note_log` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_note_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `sys_settings` -- DROP TABLE IF EXISTS `sys_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sys_settings` ( `sname` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `svalue` text COLLATE utf8_unicode_ci, `svalues` text COLLATE utf8_unicode_ci, `sintro` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `stype` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `sort` int(11) NOT NULL DEFAULT '0', `smodule` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`sname`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sys_settings` -- LOCK TABLES `sys_settings` WRITE; /*!40000 ALTER TABLE `sys_settings` DISABLE KEYS */; /*!40000 ALTER TABLE `sys_settings` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `tag` -- DROP TABLE IF EXISTS `tag`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tag_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `num` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `status` smallint(6) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `tag` -- LOCK TABLES `tag` WRITE; /*!40000 ALTER TABLE `tag` DISABLE KEYS */; /*!40000 ALTER TABLE `tag` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `tag_rel` -- DROP TABLE IF EXISTS `tag_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tag_rel` ( `tag_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `res_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `tag_rel` -- LOCK TABLES `tag_rel` WRITE; /*!40000 ALTER TABLE `tag_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `tag_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task` -- DROP TABLE IF EXISTS `task`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cate_id` int(11) DEFAULT NULL, `res_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `order_rel_id` int(11) DEFAULT NULL, `op_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `content` text COLLATE utf8_unicode_ci, `pre_finish` datetime DEFAULT NULL, `finish` datetime DEFAULT NULL, `status` smallint(2) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task` -- LOCK TABLES `task` WRITE; /*!40000 ALTER TABLE `task` DISABLE KEYS */; /*!40000 ALTER TABLE `task` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_goods` -- DROP TABLE IF EXISTS `task_goods`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_goods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `info_id` int(11) DEFAULT NULL, `res_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `res_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_goods` -- LOCK TABLES `task_goods` WRITE; /*!40000 ALTER TABLE `task_goods` DISABLE KEYS */; /*!40000 ALTER TABLE `task_goods` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_info` -- DROP TABLE IF EXISTS `task_info`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `intro` text COLLATE utf8_unicode_ci, `msg` text COLLATE utf8_unicode_ci, `msg_time` text COLLATE utf8_unicode_ci, `trigger` int(11) DEFAULT '1', `msg_type` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `status` smallint(6) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_info` -- LOCK TABLES `task_info` WRITE; /*!40000 ALTER TABLE `task_info` DISABLE KEYS */; /*!40000 ALTER TABLE `task_info` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_log` -- DROP TABLE IF EXISTS `task_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `task_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `action` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `conent` text COLLATE utf8_unicode_ci, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_log` -- LOCK TABLES `task_log` WRITE; /*!40000 ALTER TABLE `task_log` DISABLE KEYS */; /*!40000 ALTER TABLE `task_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_order` -- DROP TABLE IF EXISTS `task_order`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_order` ( `id` int(11) NOT NULL AUTO_INCREMENT, `task_id` int(11) DEFAULT NULL, `order_id` int(11) DEFAULT NULL, `order_rel_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_order` -- LOCK TABLES `task_order` WRITE; /*!40000 ALTER TABLE `task_order` DISABLE KEYS */; /*!40000 ALTER TABLE `task_order` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_self` -- DROP TABLE IF EXISTS `task_self`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_self` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) DEFAULT NULL, `title` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `content` text COLLATE utf8_unicode_ci, `pre_finish` datetime DEFAULT NULL, `finish` datetime DEFAULT NULL, `status` smallint(2) DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_self` -- LOCK TABLES `task_self` WRITE; /*!40000 ALTER TABLE `task_self` DISABLE KEYS */; /*!40000 ALTER TABLE `task_self` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `task_user` -- DROP TABLE IF EXISTS `task_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `info_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `default` smallint(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `task_user` -- LOCK TABLES `task_user` WRITE; /*!40000 ALTER TABLE `task_user` DISABLE KEYS */; /*!40000 ALTER TABLE `task_user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user` -- DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL, `avatar` int(11) DEFAULT NULL, `status` smallint(6) NOT NULL DEFAULT '10', `is_staff` smallint(1) NOT NULL, `allowance` int(11) DEFAULT NULL, `allowance_updated_at` int(11) DEFAULT NULL, `api_token` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `password_reset_token` (`password_reset_token`), UNIQUE KEY `email` (`email`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user` -- LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; INSERT INTO `user` VALUES (1,'admin','KlroUlkExNSpTlbnUOa-Ph6bB80j-oHr','$2y$13$G.v5Tj9OKgJ7EZnLyLnQ1.Zawipm/esmHgNl2SpOil0gNAnmlOqyy',NULL,'cb@163.com',NULL,NULL,10,1,NULL,NULL,'',1495981056,1495981056); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_addition` -- DROP TABLE IF EXISTS `user_addition`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_addition` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `real_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `logins` int(11) DEFAULT NULL, `gender` smallint(1) DEFAULT '1', `birth` date DEFAULT NULL, `height` int(11) DEFAULT NULL, `weight` float DEFAULT NULL, `qq` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `address` text COLLATE utf8_unicode_ci, `hobby` text COLLATE utf8_unicode_ci, `native_place` text COLLATE utf8_unicode_ci, `intro` text COLLATE utf8_unicode_ci, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_addition` -- LOCK TABLES `user_addition` WRITE; /*!40000 ALTER TABLE `user_addition` DISABLE KEYS */; /*!40000 ALTER TABLE `user_addition` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_field` -- DROP TABLE IF EXISTS `user_field`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_field` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `pop_note` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `html` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `option` text COLLATE utf8_unicode_ci, `default` text COLLATE utf8_unicode_ci, `is_show` smallint(1) DEFAULT '1', `order` smallint(1) DEFAULT NULL, `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_field` -- LOCK TABLES `user_field` WRITE; /*!40000 ALTER TABLE `user_field` DISABLE KEYS */; /*!40000 ALTER TABLE `user_field` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_log` -- DROP TABLE IF EXISTS `user_log`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_log` ( `user_id` int(11) DEFAULT NULL, `login_date` datetime DEFAULT NULL, `login_ip` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_log` -- LOCK TABLES `user_log` WRITE; /*!40000 ALTER TABLE `user_log` DISABLE KEYS */; /*!40000 ALTER TABLE `user_log` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_token` -- DROP TABLE IF EXISTS `user_token`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_token` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `code` varchar(32) COLLATE utf8_unicode_ci NOT NULL, `created_at` int(11) NOT NULL, `type` smallint(6) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_token` -- LOCK TABLES `user_token` WRITE; /*!40000 ALTER TABLE `user_token` DISABLE KEYS */; /*!40000 ALTER TABLE `user_token` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat` -- DROP TABLE IF EXISTS `wechat`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat` ( `id` int(11) NOT NULL AUTO_INCREMENT, `token` varchar(255) NOT NULL, `access_token` varchar(255) DEFAULT NULL, `encodingaeskey` varchar(255) DEFAULT NULL, `level` tinyint(2) NOT NULL COMMENT '类型:订阅号 认证主阅 服务号 服务订阅', `name` varchar(200) NOT NULL, `original` varchar(200) NOT NULL, `appid` varchar(100) NOT NULL, `appsecret` varchar(100) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat` -- LOCK TABLES `wechat` WRITE; /*!40000 ALTER TABLE `wechat` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_group` -- DROP TABLE IF EXISTS `wechat_group`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_group` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `count` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_group` -- LOCK TABLES `wechat_group` WRITE; /*!40000 ALTER TABLE `wechat_group` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_group` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_menu` -- DROP TABLE IF EXISTS `wechat_menu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT, `wid` int(11) NOT NULL, `main_id` int(11) NOT NULL, `pid` int(11) DEFAULT NULL, `level` smallint(6) NOT NULL DEFAULT '1', `code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `type` smallint(6) NOT NULL DEFAULT '1', `key` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_menu` -- LOCK TABLES `wechat_menu` WRITE; /*!40000 ALTER TABLE `wechat_menu` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_menu` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_menu_main` -- DROP TABLE IF EXISTS `wechat_menu_main`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_menu_main` ( `id` int(11) NOT NULL AUTO_INCREMENT, `wid` int(11) NOT NULL, `name` varchar(100) NOT NULL, `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1普通 菜单 2个性菜单', `is_active` tinyint(4) NOT NULL DEFAULT '1', `gender` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0不限 1男 2女', `tag` int(11) NOT NULL DEFAULT '0' COMMENT '0不限', `client_platform_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0不限', `language` smallint(6) NOT NULL DEFAULT '0' COMMENT '0不限', `country` varchar(100) DEFAULT NULL COMMENT '空则不限', `province` varchar(100) DEFAULT NULL COMMENT '空则不限', `city` varchar(100) DEFAULT NULL COMMENT '空则不限', `created_at` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_menu_main` -- LOCK TABLES `wechat_menu_main` WRITE; /*!40000 ALTER TABLE `wechat_menu_main` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_menu_main` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_tag` -- DROP TABLE IF EXISTS `wechat_tag`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `wid` int(11) NOT NULL, `tag_id` int(11) NOT NULL COMMENT '微信返回', `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `count` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_tag` -- LOCK TABLES `wechat_tag` WRITE; /*!40000 ALTER TABLE `wechat_tag` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_tag` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_tag_rel` -- DROP TABLE IF EXISTS `wechat_tag_rel`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_tag_rel` ( `wid` int(11) NOT NULL, `tag_id` int(11) NOT NULL, `openid` varchar(200) NOT NULL, UNIQUE KEY `wid` (`wid`,`tag_id`,`openid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_tag_rel` -- LOCK TABLES `wechat_tag_rel` WRITE; /*!40000 ALTER TABLE `wechat_tag_rel` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_tag_rel` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_token` -- DROP TABLE IF EXISTS `wechat_token`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_token` ( `wechat_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `access_token` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, `expire_at` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_token` -- LOCK TABLES `wechat_token` WRITE; /*!40000 ALTER TABLE `wechat_token` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_token` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `wechat_user` -- DROP TABLE IF EXISTS `wechat_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `wechat_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gid` int(11) DEFAULT NULL, `openid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `nickname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `remark` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `sex` smallint(6) DEFAULT NULL, `language` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL, `city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `province` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `country` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `headimgurl` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `subscribe` smallint(6) DEFAULT NULL, `subscribe_at` int(11) DEFAULT NULL, `created_at` int(11) NOT NULL, `realname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mobile` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL, `birth` date DEFAULT NULL, `addr` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`), UNIQUE KEY `openid` (`openid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wechat_user` -- LOCK TABLES `wechat_user` WRITE; /*!40000 ALTER TABLE `wechat_user` DISABLE KEYS */; /*!40000 ALTER TABLE `wechat_user` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-05-28 22:42:29
true
2fb0f600d82727c4d5c3b1adceeaa26aa23c4c36
SQL
silviabooks/SIoT-Blockchain-Platform
/db/social_iot_platform_sve.sql
UTF-8
80,454
2.609375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 28, 2018 at 06:56 -- Server version: 10.1.13-MariaDB -- PHP Version: 5.6.20 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: `social_iot_platform_sve` -- -- -------------------------------------------------------- -- -- Table structure for table `SVE_1` -- CREATE TABLE `SVE_1` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_1` -- INSERT INTO `SVE_1` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_2` -- CREATE TABLE `SVE_2` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_2` -- INSERT INTO `SVE_2` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_3` -- CREATE TABLE `SVE_3` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_3` -- INSERT INTO `SVE_3` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('19', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_4` -- CREATE TABLE `SVE_4` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_4` -- INSERT INTO `SVE_4` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_5` -- CREATE TABLE `SVE_5` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_5` -- INSERT INTO `SVE_5` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_6` -- CREATE TABLE `SVE_6` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_6` -- INSERT INTO `SVE_6` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_7` -- CREATE TABLE `SVE_7` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_7` -- INSERT INTO `SVE_7` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_8` -- CREATE TABLE `SVE_8` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_8` -- INSERT INTO `SVE_8` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_9` -- CREATE TABLE `SVE_9` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_9` -- INSERT INTO `SVE_9` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_10` -- CREATE TABLE `SVE_10` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_10` -- INSERT INTO `SVE_10` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_11` -- CREATE TABLE `SVE_11` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_11` -- INSERT INTO `SVE_11` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_12` -- CREATE TABLE `SVE_12` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_12` -- INSERT INTO `SVE_12` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('17', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_13` -- CREATE TABLE `SVE_13` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_13` -- INSERT INTO `SVE_13` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('21', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_14` -- CREATE TABLE `SVE_14` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_14` -- INSERT INTO `SVE_14` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_15` -- CREATE TABLE `SVE_15` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_15` -- INSERT INTO `SVE_15` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('13', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_16` -- CREATE TABLE `SVE_16` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_16` -- INSERT INTO `SVE_16` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_17` -- CREATE TABLE `SVE_17` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_17` -- INSERT INTO `SVE_17` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('12', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_18` -- CREATE TABLE `SVE_18` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_18` -- INSERT INTO `SVE_18` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_19` -- CREATE TABLE `SVE_19` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_19` -- INSERT INTO `SVE_19` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_20` -- CREATE TABLE `SVE_20` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_20` -- INSERT INTO `SVE_20` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_21` -- CREATE TABLE `SVE_21` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_21` -- INSERT INTO `SVE_21` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_22` -- CREATE TABLE `SVE_22` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_22` -- INSERT INTO `SVE_22` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_23` -- CREATE TABLE `SVE_23` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_23` -- INSERT INTO `SVE_23` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_24` -- CREATE TABLE `SVE_24` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_24` -- INSERT INTO `SVE_24` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_25` -- CREATE TABLE `SVE_25` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_25` -- INSERT INTO `SVE_25` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_26` -- CREATE TABLE `SVE_26` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_26` -- INSERT INTO `SVE_26` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_27` -- CREATE TABLE `SVE_27` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_27` -- INSERT INTO `SVE_27` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_28` -- CREATE TABLE `SVE_28` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_28` -- INSERT INTO `SVE_28` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_29` -- CREATE TABLE `SVE_29` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_29` -- INSERT INTO `SVE_29` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_30` -- CREATE TABLE `SVE_30` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_30` -- INSERT INTO `SVE_30` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_31` -- CREATE TABLE `SVE_31` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_31` -- INSERT INTO `SVE_31` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_32` -- CREATE TABLE `SVE_32` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_32` -- INSERT INTO `SVE_32` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_33` -- CREATE TABLE `SVE_33` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_33` -- INSERT INTO `SVE_33` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_34` -- CREATE TABLE `SVE_34` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_34` -- INSERT INTO `SVE_34` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('10', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_35` -- CREATE TABLE `SVE_35` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_35` -- INSERT INTO `SVE_35` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('11', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('80', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_36` -- CREATE TABLE `SVE_36` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_36` -- INSERT INTO `SVE_36` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('13', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_37` -- CREATE TABLE `SVE_37` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_37` -- INSERT INTO `SVE_37` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_38` -- CREATE TABLE `SVE_38` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_38` -- INSERT INTO `SVE_38` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('10', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('14', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('28', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('3', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('37', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('4', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('5', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_39` -- CREATE TABLE `SVE_39` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_39` -- INSERT INTO `SVE_39` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('13', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('23', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('45', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_40` -- CREATE TABLE `SVE_40` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_40` -- INSERT INTO `SVE_40` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('12', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_41` -- CREATE TABLE `SVE_41` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_41` -- INSERT INTO `SVE_41` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('7', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_42` -- CREATE TABLE `SVE_42` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_42` -- INSERT INTO `SVE_42` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('12', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('20', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_43` -- CREATE TABLE `SVE_43` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_43` -- INSERT INTO `SVE_43` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('17', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('22', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('25', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('41', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('44', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_44` -- CREATE TABLE `SVE_44` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_44` -- INSERT INTO `SVE_44` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('21', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('27', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('35', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('38', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('40', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('43', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('6', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_45` -- CREATE TABLE `SVE_45` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_45` -- INSERT INTO `SVE_45` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('11', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('15', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('18', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('19', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('2', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('24', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('26', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('30', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('32', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('36', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('9', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -------------------------------------------------------- -- -- Table structure for table `SVE_80` -- CREATE TABLE `SVE_80` ( `id_friend` varchar(255) NOT NULL, `REL` varchar(255) DEFAULT NULL, `MS_LOCATOR` varchar(255) DEFAULT NULL, `SVE_LOCATOR` varchar(255) DEFAULT NULL, `SERVER` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `SVE_80` -- INSERT INTO `SVE_80` (`id_friend`, `REL`, `MS_LOCATOR`, `SVE_LOCATOR`, `SERVER`) VALUES ('1', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('16', 'OOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('29', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('31', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('33', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('34', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('39', 'SOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('42', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'), ('8', 'CLOR', '192.168.42.178', 'silvia-HP-Notebook/192.168.42.178:200', '0'); -- -- Indexes for dumped tables -- -- -- Indexes for table `SVE_1` -- ALTER TABLE `SVE_1` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_2` -- ALTER TABLE `SVE_2` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_3` -- ALTER TABLE `SVE_3` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_4` -- ALTER TABLE `SVE_4` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_5` -- ALTER TABLE `SVE_5` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_6` -- ALTER TABLE `SVE_6` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_7` -- ALTER TABLE `SVE_7` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_8` -- ALTER TABLE `SVE_8` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_9` -- ALTER TABLE `SVE_9` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_10` -- ALTER TABLE `SVE_10` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_11` -- ALTER TABLE `SVE_11` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_12` -- ALTER TABLE `SVE_12` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_13` -- ALTER TABLE `SVE_13` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_14` -- ALTER TABLE `SVE_14` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_15` -- ALTER TABLE `SVE_15` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_16` -- ALTER TABLE `SVE_16` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_17` -- ALTER TABLE `SVE_17` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_18` -- ALTER TABLE `SVE_18` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_19` -- ALTER TABLE `SVE_19` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_20` -- ALTER TABLE `SVE_20` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_21` -- ALTER TABLE `SVE_21` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_22` -- ALTER TABLE `SVE_22` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_23` -- ALTER TABLE `SVE_23` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_24` -- ALTER TABLE `SVE_24` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_25` -- ALTER TABLE `SVE_25` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_26` -- ALTER TABLE `SVE_26` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_27` -- ALTER TABLE `SVE_27` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_28` -- ALTER TABLE `SVE_28` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_29` -- ALTER TABLE `SVE_29` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_30` -- ALTER TABLE `SVE_30` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_31` -- ALTER TABLE `SVE_31` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_32` -- ALTER TABLE `SVE_32` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_33` -- ALTER TABLE `SVE_33` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_34` -- ALTER TABLE `SVE_34` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_35` -- ALTER TABLE `SVE_35` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_36` -- ALTER TABLE `SVE_36` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_37` -- ALTER TABLE `SVE_37` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_38` -- ALTER TABLE `SVE_38` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_39` -- ALTER TABLE `SVE_39` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_40` -- ALTER TABLE `SVE_40` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_41` -- ALTER TABLE `SVE_41` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_42` -- ALTER TABLE `SVE_42` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_43` -- ALTER TABLE `SVE_43` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_44` -- ALTER TABLE `SVE_44` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_45` -- ALTER TABLE `SVE_45` ADD PRIMARY KEY (`id_friend`); -- -- Indexes for table `SVE_80` -- ALTER TABLE `SVE_80` ADD PRIMARY KEY (`id_friend`); /*!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
28ebf6a3d9fac19c054969d492e36d0fc9933b1c
SQL
zhouyongguo1/lequ-db
/mysql/V20160110_1700__create_table.sql
UTF-8
2,475
3.546875
4
[ "Apache-2.0" ]
permissive
CREATE TABLE core_role ( `id` int unsigned NOT NULL AUTO_INCREMENT, `team_id` int unsigned NOT NULL, `name` nvarchar(100) NOT NULL, `status` varchar(100) NOT NULL DEFAULT 'ACTIVE', PRIMARY KEY (`id`), FOREIGN KEY (`team_id`) REFERENCES core_team(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE core_user ( `id` int unsigned NOT NULL AUTO_INCREMENT, `team_id` int unsigned NOT NULL, `name` nvarchar(100) NOT NULL, `pass` nvarchar(100) NOT NULL, `email` varchar(100) NOT NULL, `photo` varchar(200) DEFAULT NULL, `role_id` int unsigned DEFAULT NULL, `permission` varchar(100) NOT NULL DEFAULT 'NONE', `is_owner` tinyint(1) DEFAULT 0, `status` varchar(100) NOT NULL DEFAULT 'ACTIVE', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created_by` int unsigned DEFAULT NULL, `updated_by` int unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE core_user_config ( `id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `theme` nvarchar(100) NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`user_id`) REFERENCES core_user(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE core_event ( `id` int unsigned NOT NULL AUTO_INCREMENT, `team_id` int unsigned NOT NULL, `user_id` int unsigned NOT NULL, `title` nvarchar(200) NOT NULL, `content` nvarchar(500) DEFAULT NULL, `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `owner_type` varchar(50) DEFAULT NULL, `owner_id` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`team_id`) REFERENCES core_team(`id`), FOREIGN KEY (`user_id`) REFERENCES core_user(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE core_invite ( `id` int unsigned NOT NULL AUTO_INCREMENT, `team_id` int unsigned NOT NULL, `name` nvarchar(100) DEFAULT NULL, `status` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, `role_id` int unsigned, `content` nvarchar(500), `owner_type` varchar(50) DEFAULT NULL, `owner_id` int unsigned DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created_by` int unsigned DEFAULT NULL, `updated_by` int unsigned DEFAULT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`team_id`) REFERENCES core_team(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
true
520c958dab8b5dd317afabdfaf17a89bf3e11753
SQL
HDBISG/TradeTrustGateway
/resource/mysql.sql
UTF-8
3,806
3.140625
3
[]
no_license
drop table T_TTGW_WALLET; CREATE TABLE `T_TTGW_WALLET` ( `WALLET_ACCN_ID` varchar(35) NOT NULL, `WALLET_PRIVATE_KEY` varchar(256) DEFAULT NULL, `WALLET_ADDR` varchar(128) DEFAULT NULL, `WALLET_PASSWORD` varchar(128) DEFAULT NULL, `WALLET_JSON` VARCHAR(2048) DEFAULT NULL, `WALLET_STATUS` varchar(10) NOT NULL, `WALLET_UID_CREATE` varchar(35) DEFAULT NULL, `WALLET_DT_CREATE` datetime DEFAULT NULL, `WALLET_UID_UPD` varchar(35) DEFAULT NULL, `WALLET_DT_UPD` datetime DEFAULT NULL, PRIMARY KEY (`WALLET_ACCN_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; drop table T_TTGW_DOCSTORE; CREATE TABLE `T_TTGW_DOCSTORE` ( `DOCSTORE_ACCN_ID` varchar(35) NOT NULL, `DOCSTORE_STORE_NAME` varchar(128) NOT NULL, `DOCSTORE_ADDR` varchar(128) NOT NULL, `DOCSTORE_WALLET_ADDR` varchar(128) NOT NULL, `DOCSTORE_TRAN_HASH` varchar(128) NOT NULL, `DOCSTORE_NETWORK` VARCHAR(128) DEFAULT NULL, `DOCSTORE_RENDER_NAME` VARCHAR(128) DEFAULT NULL, `DOCSTORE_RENDER_TYPE` VARCHAR(128) DEFAULT NULL, `DOCSTORE_RENDER_URL` VARCHAR(128) DEFAULT NULL, `DOCSTORE_NAME` VARCHAR(128) DEFAULT NULL, `DOCSTORE_ISSUER_NAME` VARCHAR(128) DEFAULT NULL, `DOCSTORE_ISSUER_TYPE` VARCHAR(128) DEFAULT NULL, `DOCSTORE_ISSUER_LOCATION` VARCHAR(128) DEFAULT NULL, `DOCSTORE_REMARK` VARCHAR(1024) DEFAULT NULL, `DOCSTORE_STATUS` varchar(10) NOT NULL, `DOCSTORE_UID_CREATE` varchar(35) DEFAULT NULL, `DOCSTORE_DT_CREATE` datetime DEFAULT NULL, `DOCSTORE_UID_UPD` varchar(35) DEFAULT NULL, `DOCSTORE_DT_UPD` datetime DEFAULT NULL, PRIMARY KEY (`DOCSTORE_ACCN_ID`,`DOCSTORE_STORE_NAME` ) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; drop table T_TTGW_DOC; CREATE TABLE `T_TTGW_DOC` ( `DOC_DOC_ID` varchar(128) NOT NULL, `DOC_ACCN_ID` varchar(35) NOT NULL, `DOC_STORE_NAME` varchar(128) NOT NULL, `DOC_WALLET_ADDR` varchar(128) NOT NULL, `DOC_TRAN_HASH` varchar(128) NOT NULL, `DOC_WRAP_HASH` VARCHAR(128) DEFAULT NULL, `DOC_ADDR` varchar(128) NOT NULL, `DOC_WRAP_DOC` MEDIUMTEXT NOT NULL, `DOC_WRAP_RAW_DOC` MEDIUMTEXT DEFAULT NULL, `DOC_STATUS` varchar(10) NOT NULL, `DOC_UID_CREATE` varchar(35) DEFAULT NULL, `DOC_DT_CREATE` datetime DEFAULT NULL, `DOC_UID_UPD` varchar(35) DEFAULT NULL, `DOC_DT_UPD` datetime DEFAULT NULL, PRIMARY KEY (`DOC_DOC_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; drop table T_TTGW_AUDITLOG; CREATE TABLE `T_TTGW_AUDITLOG` ( `AUDT_ID` varchar(35) NOT NULL, `AUDT_EVENT` varchar(100) NOT NULL, `AUDT_TIMESTAMP` datetime NOT NULL, `AUDT_ACCNID` varchar(35) NOT NULL, `AUDT_STORE_NAME` varchar(35) DEFAULT NULL, `AUDT_UID` varchar(35) NULL, `AUDT_UNAME` varchar(35) DEFAULT NULL COMMENT 'User name', `AUDT_REMOTE_IP` varchar(35) DEFAULT NULL, `AUDT_REQUET` MEDIUMTEXT NOT NULL, `AUDT_RSP_STATUS` varchar(225) DEFAULT NULL, `AUDT_RSP_MESSAGE` varchar(225) DEFAULT NULL, `AUDT_RSP_DETAILS` MEDIUMTEXT DEFAULT NULL, `AUDT_REMARKS` varchar(4096) DEFAULT NULL, PRIMARY KEY (`AUDT_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; drop table T_TTGW_TRAN; CREATE TABLE `T_TTGW_TRAN` ( `TRAN_ID` varchar(128) NOT NULL, `TRAN_ACCN_ID` varchar(35) NOT NULL, `TRAN_STORE_NAME` varchar(128) NOT NULL, `TRAN_TYPE` VARCHAR(35) DEFAULT NULL, `TRAN_NETWORK` VARCHAR(35) DEFAULT NULL, `TRAN_HASH` varchar(128) NOT NULL, `TRAN_WALLET_ADDR` VARCHAR(128) DEFAULT NULL, `TRAN_STORE_ADDR` VARCHAR(128) DEFAULT NULL, `TRAN_WRAP_HASH` VARCHAR(128) DEFAULT NULL, `TRAN_RESULT` VARCHAR(1) DEFAULT NULL, `TRAN_REMARKS` varchar(4096) DEFAULT NULL, `TRAN_STATUS` varchar(10) NOT NULL, `TRAN_UID_CREATE` varchar(35) DEFAULT NULL, `TRAN_DT_CREATE` datetime DEFAULT NULL, `TRAN_UID_UPD` varchar(35) DEFAULT NULL, `TRAN_DT_UPD` datetime DEFAULT NULL, PRIMARY KEY (`TRAN_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
true
87467e10b1d2e3940f0c340b189d07b8bb02b0e7
SQL
ju5t1nhhh/niitblogsystem
/sql/data.sql
UTF-8
2,161
3.09375
3
[]
no_license
#添加假数据 USE niitblog; #添加管理员 INSERT INTO bsuser(username,email,password) VALUES('root','root@niit.com','root'); #添加用户 INSERT INTO bsuser(username,email,password) VALUES ('Apple','apple@niit.com','apple'), ('Banana','banana@niit.com','banana'), ('Cat','cat@niit.com','cat'), ('Doctor','doctor@niit.com','doctor'), ('Egg','egg@niit.com','egg'); #添加博文 INSERT INTO bspost(author,title,body,status) VALUES ('Apple','One Apple One Day','Doctor keep me away.',1), ('Apple','Two Apples Two Days','Doctor keep me away.',1), ('Apple','Three Apples Three Days','Doctor keep me away.',1), ('Apple','Four Apples Four Days','Doctor keep me away.',1), ('Apple','Five Apples Five Days','Doctor keep me away.',1), ('Apple','Six Apples Six Days','Doctor keep me away.',1), ('Apple','No Apples No Days','Doctor keep me away.',0), ('Apple','Noo Apples Noo Days','Doctor keep me away.',0), ('Apple','Nooo Apples Nooo Days','Doctor keep me away.',0); #添加评论 INSERT INTO bscomment(postid,active,passive,comment) VALUES (1,'Banana','Apple','Good Post'), (1,'Apple','Banana','Thx'), (1,'Cat','Banana','是的'); #添加留言 INSERT INTO bsleaveword(active,passive,leaveword) VALUES ('Banana','Apple','Hello Apple.'), ('Apple','Banana','Hello back.'), ('Cat','Banana','踩踩。'); #添加私信 INSERT INTO bschat(active,passive,msg) VALUES ('Banana','Apple','Hello Apple.'), ('Apple','Banana','Hello back.'), ('Cat','Banana','踩踩。'); #添加点赞 INSERT INTO bslike(active,passive) VALUES ('Banana','Apple'), ('Cat','Apple'); INSERT INTO bslike(active,passive,postid) VALUES ('Banana','Apple',1); #添加标签 INSERT INTO bstag(tagname,posts) VALUES ('Good Apples'), ('No Apples'); #添加标签博文关系 INSERT INTO bstag2post(postid,tagid) VALUES (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,2),(8,2),(9,2); #添加关注 INSERT INTO bsfollow(active,passive) VALUES ('Banana','Apple'), ('Cat','Apple'); #添加消息 INSERT INTO bsmessage(username,msgtype,status) VALUES ('Banana',1,0),('Banana',1,1),('Banana',2,0), ('Apple',2,1),('Apple',3,0),('Apple',3,1),('Apple',4,0),('Apple',4,1); #添加敏感信息 INSERT INTO bssensitive(word) VALUES ('fuck'),('妈的');
true
c9e04dc1b6a1a9549178f9ff1ebc45a2ba0d4611
SQL
rusli-nasir/smsempresayii
/protected/extensions/gtc/_dev/demo_schema.sql
UTF-8
3,105
3.6875
4
[]
no_license
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; -- ----------------------------------------------------- -- Table `demo_category` -- ----------------------------------------------------- DROP TABLE IF EXISTS `demo_category` ; CREATE TABLE IF NOT EXISTS `demo_category` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(45) NULL , PRIMARY KEY (`id`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `demo_product` -- ----------------------------------------------------- DROP TABLE IF EXISTS `demo_product` ; CREATE TABLE IF NOT EXISTS `demo_product` ( `id` INT NOT NULL AUTO_INCREMENT , `category_id` INT NULL , `name` VARCHAR(45) NULL , `madeAt` DATE NULL , `isAvailable` TINYINT NULL , PRIMARY KEY (`id`) , INDEX `fk_product_category1` (`category_id` ASC) , CONSTRAINT `fk_product_category1` FOREIGN KEY (`category_id` ) REFERENCES `demo_category` (`id` ) ON DELETE SET NULL ON UPDATE SET NULL) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `demo_feature` -- ----------------------------------------------------- DROP TABLE IF EXISTS `demo_feature` ; CREATE TABLE IF NOT EXISTS `demo_feature` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(45) NULL , PRIMARY KEY (`id`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `demo_description` -- ----------------------------------------------------- DROP TABLE IF EXISTS `demo_description` ; CREATE TABLE IF NOT EXISTS `demo_description` ( `title` VARCHAR(45) NULL , `text` TEXT NULL , `product_id` INT NOT NULL , PRIMARY KEY (`product_id`) , INDEX `fk_demo_description_demo_product1` (`product_id` ASC) , CONSTRAINT `fk_demo_description_demo_product1` FOREIGN KEY (`product_id` ) REFERENCES `demo_product` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `demo_feature_has_product` -- ----------------------------------------------------- DROP TABLE IF EXISTS `demo_feature_has_product` ; CREATE TABLE IF NOT EXISTS `demo_feature_has_product` ( `feature_id` INT NOT NULL , `product_id` INT NOT NULL , PRIMARY KEY (`feature_id`, `product_id`) , INDEX `fk_feature_has_product_feature1` (`feature_id` ASC) , INDEX `fk_feature_has_product_product1` (`product_id` ASC) , CONSTRAINT `fk_feature_has_product_feature1` FOREIGN KEY (`feature_id` ) REFERENCES `demo_feature` (`id` ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_feature_has_product_product1` FOREIGN KEY (`product_id` ) REFERENCES `demo_product` (`id` ) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
bf5e2c2ebcf4fc700c2796d622343c60f9528d37
SQL
elhuss/webline
/weblinedb.sql
UTF-8
3,182
2.921875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 09, 2019 at 10:28 AM -- Server version: 5.5.25a -- PHP Version: 5.4.4 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: `weblinedb` -- -- -------------------------------------------------------- -- -- Table structure for table `admins` -- CREATE TABLE IF NOT EXISTS `admins` ( `user` varchar(255) NOT NULL, `pass` varchar(255) NOT NULL, `email` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `admins` -- INSERT INTO `admins` (`user`, `pass`, `email`) VALUES ('admin', '12345', 'admin@webline.com'); -- -------------------------------------------------------- -- -- Table structure for table `contactus` -- CREATE TABLE IF NOT EXISTS `contactus` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `email` text NOT NULL, `phone` text NOT NULL, `company` text NOT NULL, `message` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -- Dumping data for table `contactus` -- INSERT INTO `contactus` (`id`, `name`, `email`, `phone`, `company`, `message`) VALUES (1, 'huss', 'huss77_5@live.com', '0114141414', 'vodafone', 'i need you to build my website please'); -- -------------------------------------------------------- -- -- Table structure for table `team` -- CREATE TABLE IF NOT EXISTS `team` ( `id` int(11) NOT NULL AUTO_INCREMENT, `image` text NOT NULL, `name` text NOT NULL, `jop` text NOT NULL, `email` text NOT NULL, `facebook` text NOT NULL, `linkedin` text NOT NULL, `twitter` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- -- Dumping data for table `team` -- INSERT INTO `team` (`id`, `image`, `name`, `jop`, `email`, `facebook`, `linkedin`, `twitter`) VALUES (1, 'man1.jpg', 'hussien ramadan', 'ceo manager', 'huss_77@webline.com', '#', '#', '#'), (3, 'man4.jpg', 'mohamed ali', 'marketer', 'mohamed@webline.com', '#', '#', '#'), (4, 'man3.jpg', 'ahmed sliem', 'developer', 'ahmed@webline.com', '#', '#', '#'); -- -------------------------------------------------------- -- -- Table structure for table `works` -- CREATE TABLE IF NOT EXISTS `works` ( `id` int(11) NOT NULL AUTO_INCREMENT, `image` text NOT NULL, `name` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Dumping data for table `works` -- INSERT INTO `works` (`id`, `image`, `name`) VALUES (1, 'img1.jpg', 'wozzby.com'), (2, 'img1.jpg', 'synergovo.com'), (5, 'img1.jpg', 'rynaty.com'), (6, 'img1.jpg', 'dubaimedical.com'), (9, 'img1.jpg', 'lozzby.com'), (10, 'img1.jpg', 'kwirfy.com'), (11, 'img1.jpg', 'foroly.com'), (12, 'img1.jpg', 'mexmy.com'); /*!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
2e437739431e182ecb724ead41368f35135dff45
SQL
georgelzh/SQL-Server-Notes
/chap8_joins_versus_subqueries/more_eg.sql
UTF-8
1,160
4.4375
4
[]
no_license
--------more examples --find name of all departments that offers a course with INTRO in the title select d2m.dname from Department_to_major d2m where d2m.Dcode in (select c.OFFERING_DEPT from Course c where c.COURSE_NAME like '%INTRO%') --eg 2 --find students name, student major code, section id of students --who earned Cs in courses taught by Professor Hermano select s.SNAME, s.MAJOR, gr.SECTION_ID from Student s, Grade_report gr where gr.STUDENT_NUMBER = s.STNO and gr.GRADE = 'C' and gr.SECTION_ID in (select t.section_id from Section t where t.INSTRUCTOR like 'hermano') --eg 3, list the name and major code of students who --earned Cs in courses taught by professor King select s.SNAME, s.MAJOR from Student s where s.STNO in (select gr.student_number from Grade_report gr where gr.GRADE = 'C' and gr.SECTION_ID in (select se.SECTION_ID from Section se where Instructor like 'king')) select distinct s.sname, s.major from Student s JOIN Grade_report gr ON s.STNO = gr.STUDENT_NUMBER where gr.GRADE = 'C' and gr.SECTION_ID in (select se.SECTION_ID from Section se where INSTRUCTOR like '%KING%')
true
e8cb5ff46f697a940a8277648ae0fd33a0737b17
SQL
viveksacademia4git/auction
/sqldata/auction_auction_item.sql
UTF-8
2,401
3.125
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64) -- -- Host: localhost Database: auction -- ------------------------------------------------------ -- Server version 8.0.16 /*!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 */; 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 `auction_item` -- DROP TABLE IF EXISTS `auction_item`; /*!40101 SET @saved_cs_client = @@character_set_client */; SET character_set_client = utf8mb4 ; CREATE TABLE `auction_item` ( `itemId` int(11) NOT NULL AUTO_INCREMENT, `itemName` varchar(100) DEFAULT NULL, `itemType` varchar(50) DEFAULT NULL, `additionalInfo` varchar(100) DEFAULT NULL, `owner` varchar(50) DEFAULT NULL, `quantity` int(11) DEFAULT '1', `initialPrice` int(11) DEFAULT '0', `sold` tinyint(1) DEFAULT '0', `deleteFlag` tinyint(1) DEFAULT '0', PRIMARY KEY (`itemId`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `auction_item` -- LOCK TABLES `auction_item` WRITE; /*!40000 ALTER TABLE `auction_item` DISABLE KEYS */; INSERT INTO `auction_item` VALUES (1,'Painting','Painting','By Great JB','JB',2,6500,0,0),(2,'Turtle Sclupture','Artificat','Turtle','JB',1,2000,1,0),(3,'Animal Pictures','Photos','Wildlife Photo','Mark Frazer',30,25,0,0); /*!40000 ALTER TABLE `auction_item` 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 2019-06-13 10:26:16
true