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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2eab6cfffacc5afad8af6d8e61aec749615206b9 | SQL | Isx-chs/pids | /WebContent/bd/proyecto_dawi.sql | UTF-8 | 22,405 | 3.140625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Principal
Source Server Version : 50524
Source Host : localhost:3306
Source Database : proyecto_dawi
Target Server Type : MYSQL
Target Server Version : 50524
File Encoding : 65001
Date: 2013-01-24 23:36:42
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `dawi_area`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_area`;
CREATE TABLE `dawi_area` (
`area_id` int(11) NOT NULL AUTO_INCREMENT,
`area_descripcion` varchar(250) DEFAULT NULL,
PRIMARY KEY (`area_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_area
-- ----------------------------
INSERT INTO `dawi_area` VALUES ('1', 'Sistema');
INSERT INTO `dawi_area` VALUES ('2', 'Gerencia General');
INSERT INTO `dawi_area` VALUES ('3', 'Marketing');
INSERT INTO `dawi_area` VALUES ('4', 'Recursos Humanos');
-- ----------------------------
-- Table structure for `dawi_detalle`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_detalle`;
CREATE TABLE `dawi_detalle` (
`det_id` int(11) NOT NULL AUTO_INCREMENT,
`det_id_req` int(11) DEFAULT NULL,
`det_actividad` varchar(250) DEFAULT NULL,
`det_fec_ini` date DEFAULT NULL,
`det_fec_fin` date DEFAULT NULL,
`det_encargado` int(11) DEFAULT NULL,
`det_estado` int(1) DEFAULT NULL,
`det_descripcion` varchar(255) DEFAULT NULL,
`det_tipo` int(1) DEFAULT NULL,
PRIMARY KEY (`det_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_detalle
-- ----------------------------
-- ----------------------------
-- Table structure for `dawi_estado`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_estado`;
CREATE TABLE `dawi_estado` (
`est_id` int(11) NOT NULL AUTO_INCREMENT,
`est_descripcion` varchar(250) DEFAULT NULL,
PRIMARY KEY (`est_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_estado
-- ----------------------------
INSERT INTO `dawi_estado` VALUES ('1', 'Aprobado');
INSERT INTO `dawi_estado` VALUES ('2', 'Pendiente');
INSERT INTO `dawi_estado` VALUES ('3', 'Rechazado');
-- ----------------------------
-- Table structure for `dawi_modulo`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_modulo`;
CREATE TABLE `dawi_modulo` (
`mod_id` int(11) NOT NULL AUTO_INCREMENT,
`mod_nombre` varchar(250) DEFAULT NULL,
`mod_key` varchar(250) DEFAULT NULL,
`mod_link` varchar(250) DEFAULT NULL,
PRIMARY KEY (`mod_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_modulo
-- ----------------------------
INSERT INTO `dawi_modulo` VALUES ('1', 'Requerimiento', 'requerimiento', 'm_Reqierimiento');
INSERT INTO `dawi_modulo` VALUES ('2', 'Sistemas', 'sistema', 'm_Sistema');
INSERT INTO `dawi_modulo` VALUES ('3', 'Proyecto', 'proyecto', 'm_Proyecto');
INSERT INTO `dawi_modulo` VALUES ('4', 'Desarrollo', 'desarrollo', 'm_Desarrollo');
INSERT INTO `dawi_modulo` VALUES ('5', 'QA', 'calidad', 'm_Calidad');
INSERT INTO `dawi_modulo` VALUES ('6', 'Informes', 'informe', 'm_Informe');
-- ----------------------------
-- Table structure for `dawi_perfil`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_perfil`;
CREATE TABLE `dawi_perfil` (
`per_id` int(11) NOT NULL AUTO_INCREMENT,
`per_descripcion` varchar(250) DEFAULT NULL,
PRIMARY KEY (`per_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_perfil
-- ----------------------------
INSERT INTO `dawi_perfil` VALUES ('1', 'Programador');
INSERT INTO `dawi_perfil` VALUES ('2', 'Analista');
INSERT INTO `dawi_perfil` VALUES ('3', 'Lider de Proyecto');
INSERT INTO `dawi_perfil` VALUES ('4', 'Prueba');
INSERT INTO `dawi_perfil` VALUES ('5', 'Sistemas');
INSERT INTO `dawi_perfil` VALUES ('7', 'Solicitante');
INSERT INTO `dawi_perfil` VALUES ('8', 'Responsable Desarrollo');
INSERT INTO `dawi_perfil` VALUES ('9', 'Responsable Analista');
-- ----------------------------
-- Table structure for `dawi_privilegio`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_privilegio`;
CREATE TABLE `dawi_privilegio` (
`per_id` int(11) NOT NULL,
`mod_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_privilegio
-- ----------------------------
INSERT INTO `dawi_privilegio` VALUES ('7', '1');
INSERT INTO `dawi_privilegio` VALUES ('5', '2');
INSERT INTO `dawi_privilegio` VALUES ('3', '3');
INSERT INTO `dawi_privilegio` VALUES ('2', '5');
INSERT INTO `dawi_privilegio` VALUES ('9', '5');
INSERT INTO `dawi_privilegio` VALUES ('1', '4');
INSERT INTO `dawi_privilegio` VALUES ('8', '4');
INSERT INTO `dawi_privilegio` VALUES ('9', '6');
INSERT INTO `dawi_privilegio` VALUES ('4', '1');
INSERT INTO `dawi_privilegio` VALUES ('4', '2');
INSERT INTO `dawi_privilegio` VALUES ('4', '3');
INSERT INTO `dawi_privilegio` VALUES ('4', '4');
INSERT INTO `dawi_privilegio` VALUES ('4', '5');
INSERT INTO `dawi_privilegio` VALUES ('4', '6');
-- ----------------------------
-- Table structure for `dawi_requerimiento`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_requerimiento`;
CREATE TABLE `dawi_requerimiento` (
`req_id` int(11) NOT NULL AUTO_INCREMENT,
`req_titulo` varchar(250) DEFAULT NULL,
`req_fecha` date DEFAULT NULL,
`req_obsr` varchar(250) DEFAULT NULL,
`req_id_area` int(11) DEFAULT NULL,
`req_id_solicitante` int(11) DEFAULT NULL COMMENT 'req_id_solicitante: es la FK de la tabla usuario, en este caso dando el rol de solicitante',
`req_id_estado` int(11) DEFAULT NULL,
`req_importancia` char(1) DEFAULT NULL,
`req_prioridad` int(11) DEFAULT NULL,
`req_id_responsable` int(11) DEFAULT NULL COMMENT 're_id_responsable: es una FK de la tabla usuario en este caso como responsable de desarrollo',
`req_recursos` varchar(250) DEFAULT NULL,
`req_estado_final` int(1) DEFAULT NULL,
`req_etapa_id` int(11) DEFAULT NULL,
`req_sistema` varchar(250) DEFAULT NULL,
`req_modulo` varchar(250) DEFAULT NULL,
PRIMARY KEY (`req_id`)
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_requerimiento
-- ----------------------------
INSERT INTO `dawi_requerimiento` VALUES ('1', 'prueba', '2012-12-20', 'sdf', '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('2', 'prueba 2', '2012-12-11', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('3', 'prueba 3', '2012-12-11', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('4', 'prueba 4', '2012-12-17', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('5', 'prueba 5', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('6', 'prueba 6', '2012-12-17', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('7', 'prueba 7', '2012-12-19', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('8', 'prueba 8', '2012-12-19', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('9', 'prueba 9', '2012-12-19', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('10', 'prueba 10', '2012-12-19', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('11', 'prueba 11', '2012-12-19', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('12', 'prueba 12', '2012-12-18', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('13', 'prueba 13', '2012-12-18', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('14', 'prueba 14', '2012-12-18', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('15', 'test 1', '2012-12-18', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('16', 'test 2', '2012-12-18', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('17', 'test 3', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('18', 'test 4', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('19', 'test 5', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('20', 'test 6', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('21', 'test 7', '2012-12-22', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('22', 'test 8', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('23', 'test 9', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('24', 'test 10', '2012-12-20', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('25', 'test 11', '2012-12-22', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('26', 'test 12', '2012-12-22', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('27', 'test 13', '2012-12-22', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('28', 'test 14', '2012-12-22', null, '1', '1', '2', null, null, null, null, '2', '3', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('29', 'INGRESO 1', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('30', 'INGRESO 2', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('31', 'INGRESO 3', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('32', 'INGRESO 4', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('33', 'INGRESO 5', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('34', 'INGRESO 6', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('35', 'INGRESO 7', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('36', 'INGRESO 8', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('37', 'INGRESO 10', '2012-12-01', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('38', 'j', '2013-01-24', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('39', 'a', '2013-01-24', null, '1', '1', '1', null, null, null, null, '2', '2', null, null);
INSERT INTO `dawi_requerimiento` VALUES ('40', 'INGRESO 10', '2013-01-24', null, '1', '1', '1', null, null, null, null, '2', '2', 'Sistema R.R.H.H.', 'type');
-- ----------------------------
-- Table structure for `dawi_usuario`
-- ----------------------------
DROP TABLE IF EXISTS `dawi_usuario`;
CREATE TABLE `dawi_usuario` (
`us_id` int(11) NOT NULL AUTO_INCREMENT,
`us_user` varchar(50) DEFAULT NULL,
`us_pass` varchar(250) DEFAULT NULL,
`us_nombre` varchar(250) DEFAULT NULL,
`us_apellido` varchar(250) DEFAULT NULL,
`us_per_id` int(11) DEFAULT NULL,
`us_area_id` int(11) DEFAULT NULL,
`us_sexo` char(1) DEFAULT NULL,
`us_email` varchar(50) DEFAULT NULL,
`us_telefono` varchar(50) DEFAULT NULL,
PRIMARY KEY (`us_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of dawi_usuario
-- ----------------------------
INSERT INTO `dawi_usuario` VALUES ('1', 'carlos', 'dawi', 'carlos', 'huamani', '4', '1', 'M', 'carlos.hs.92@gmail.com', '997396491');
INSERT INTO `dawi_usuario` VALUES ('2', 'renato', 'lp3', 'renato', 'arrascue', '1', '1', 'M', 'rarrascue93@hotmail.com', '989458789');
INSERT INTO `dawi_usuario` VALUES ('6', 'luis', 'calidad', 'Luis', 'Vasquez', '2', '1', 'F', null, null);
INSERT INTO `dawi_usuario` VALUES ('7', 'req', 'demo', 'Juan', 'Perez', '7', '2', 'M', null, null);
INSERT INTO `dawi_usuario` VALUES ('8', 'sis', 'demo', 'Daniela', 'Gomez', '5', '1', 'F', null, null);
INSERT INTO `dawi_usuario` VALUES ('9', 'pro', 'demo', 'Carlos', 'Huamani', '3', '1', 'M', null, null);
INSERT INTO `dawi_usuario` VALUES ('10', 'lis', 'demo', 'Wendy', 'Ibarra', '9', '1', 'F', null, null);
INSERT INTO `dawi_usuario` VALUES ('11', 'lid', 'demo', 'Richard', 'Cuicapaza', '8', '1', 'M', null, null);
INSERT INTO `dawi_usuario` VALUES ('12', 'pro2', 'demo', 'Cesar', 'Soplin', '3', '1', 'M', null, null);
-- ----------------------------
-- Procedure structure for `obtenerDetallexUsuario`
-- ----------------------------
DROP PROCEDURE IF EXISTS `obtenerDetallexUsuario`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `obtenerDetallexUsuario`(IN v_det_tipo INT, IN v_det_encargado INT)
BEGIN
SELECT * FROM dawi_detalle
WHERE det_tipo = v_det_tipo
AND det_encargado = v_det_encargado
AND det_estado = 2;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_actualizarDetalle`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_actualizarDetalle`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_actualizarDetalle`(IN v_det_id INT, IN v_det_tipo INT)
BEGIN
DECLARE v_cant INT DEFAULT 0;
DECLARE v_cant_fin INT DEFAULT 0;
DECLARE v_det_req_id INT DEFAULT 0;
SET v_det_req_id = (SELECT det_id_req FROM dawi_detalle WHERE det_id = v_det_id);
UPDATE dawi_detalle SET det_estado = 1 WHERE det_id = v_det_id;
SET v_cant = (SELECT COUNT(det_id) FROM dawi_detalle WHERE det_id_req = v_det_req_id and det_tipo=v_det_tipo);
SET v_cant_fin = (SELECT COUNT(det_id) FROM dawi_detalle WHERE det_id_req = v_det_req_id and det_estado = 1 and det_tipo=v_det_tipo);
IF v_cant = v_cant_fin THEN
IF v_det_tipo = 1 THEN
UPDATE dawi_requerimiento SET req_etapa_id = 5,req_id_estado=2 WHERE req_id = v_det_req_id;
ELSEIF v_det_tipo = 2 THEN
UPDATE dawi_requerimiento SET req_etapa_id = 6,req_id_estado=2 WHERE req_id = v_det_req_id;
END IF;
END IF;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_actualizar_proyecto`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_actualizar_proyecto`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_actualizar_proyecto`(
IN v_req_importancia INT,
IN v_req_prioridad INT,
IN v_req_id INT,
IN v_req_id_responsable INT,
IN v_req_recursos VARCHAR(250))
BEGIN
UPDATE dawi_requerimiento
SET req_etapa_id = 4,
req_recursos = v_req_recursos,
req_prioridad=v_req_prioridad,
req_id_responsable=v_req_id_responsable,
req_importancia = v_req_importancia
WHERE req_id = v_req_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_actualizar_sistema`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_actualizar_sistema`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_actualizar_sistema`(
IN v_estado_id INT,
IN v_req_id INT,
IN v_obsr VARCHAR(250))
BEGIN
DECLARE v_estado_final INT DEFAULT 2;
DECLARE v_req_etapa_id INT DEFAULT 3;
IF v_estado_id = 3 THEN SET v_estado_final = 3,v_req_etapa_id = 2;
ELSE SET v_estado_final = 2, v_estado_id = 2;
END IF;
UPDATE dawi_requerimiento
SET req_etapa_id = v_req_etapa_id,
req_obsr = v_obsr,
req_id_estado=v_estado_id,
req_estado_final = v_estado_final
WHERE req_id = v_req_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_buscar_area`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_buscar_area`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_buscar_area`(IN v_area_id INT)
BEGIN
SELECT * FROM dawi_area
where area_id = v_area_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_buscar_usuario`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_buscar_usuario`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_buscar_usuario`(IN v_us_id INT)
BEGIN
SELECT * FROM dawi_usuario
where us_id = v_us_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_buscar_x_perfil`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_buscar_x_perfil`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_buscar_x_perfil`(IN v_us_per_id INT)
BEGIN
SELECT * FROM dawi_usuario
where us_per_id = v_us_per_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_guardarDetalle`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_guardarDetalle`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_guardarDetalle`(
IN v_det_id_req INT,
IN v_det_actividad VARCHAR(255),
IN v_det_fec_ini DATE,
IN v_det_fec_fin DATE,
IN v_det_encargado INT,
IN v_det_descripcion VARCHAR(255),
IN v_det_tipo INT
)
BEGIN
INSERT INTO dawi_detalle (det_id_req,det_actividad,det_fec_ini,det_fec_fin,det_encargado,det_estado,det_descripcion,det_tipo)
VALUES (v_det_id_req,v_det_actividad,v_det_fec_ini,v_det_fec_fin,v_det_encargado,2,v_det_descripcion,v_det_tipo);
UPDATE dawi_requerimiento SET req_id_estado=4 WHERE req_id = v_det_id_req;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_insertarsistema`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_insertarsistema`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_insertarsistema`(IN req_titulo VARCHAR(250),
IN req_id_area INT,
IN req_sistema VARCHAR(250), IN req_modulo VARCHAR(250), IN req_id_solicitante INT)
BEGIN
INSERT INTO dawi_requerimiento(req_titulo,req_fecha,req_id_area,req_id_solicitante,req_id_estado,req_estado_final,req_etapa_id, req_sistema, req_modulo) values(req_titulo,now(),req_id_area,req_id_solicitante,1,2,2,req_sistema, req_modulo);
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_listarDetalle`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_listarDetalle`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_listarDetalle`(IN v_det_id_req INT, IN v_det_tipo INT)
BEGIN
SELECT * FROM dawi_detalle
where det_id_req = v_det_id_req and det_tipo=v_det_tipo;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_login`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_login`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_login`(IN us VARCHAR(250), IN pwd VARCHAR(250))
BEGIN
SELECT * FROM dawi_usuario
where us_user like us and us_pass like pwd;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_obetenerrequerimientosegunestado`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_obetenerrequerimientosegunestado`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_obetenerrequerimientosegunestado`(IN v_estado VARCHAR(250))
BEGIN
SELECT * FROM dawi_requerimiento
where CAST(req_id_estado AS CHAR(250)) = v_estado;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_obtenerDetalle`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_obtenerDetalle`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_obtenerDetalle`(IN v_det_id INT)
BEGIN
SELECT * FROM dawi_detalle
where det_id = v_det_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_obtener_requerimiento`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_obtener_requerimiento`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_obtener_requerimiento`(IN v_id INT)
BEGIN
SELECT * FROM dawi_requerimiento
where req_id = v_id;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_obtener_requerimientos`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_obtener_requerimientos`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_obtener_requerimientos`(IN v_etapa INT)
BEGIN
SELECT * FROM dawi_requerimiento
where req_etapa_id >= v_etapa;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_pribilegio`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_pribilegio`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_pribilegio`(IN v_perfil INT)
BEGIN
SELECT dawi_modulo.mod_id, dawi_modulo.mod_nombre, dawi_modulo.mod_key
FROM dawi_perfil
INNER JOIN dawi_privilegio
ON dawi_perfil.per_id = dawi_privilegio.per_id
INNER JOIN dawi_modulo
ON dawi_modulo.mod_id = dawi_privilegio.mod_id
where dawi_perfil.per_id = v_perfil;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for `sp_privilegios`
-- ----------------------------
DROP PROCEDURE IF EXISTS `sp_privilegios`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_privilegios`(IN v_perfil INT)
BEGIN
SELECT dawi_modulo.mod_id,
dawi_modulo.mod_nombre,
dawi_modulo.mod_key,
dawi_modulo.mod_link
FROM dawi_perfil
INNER JOIN dawi_privilegio
ON dawi_perfil.per_id = dawi_privilegio.per_id
INNER JOIN dawi_modulo
ON dawi_modulo.mod_id = dawi_privilegio.mod_id
where dawi_perfil.per_id = v_perfil;
END
;;
DELIMITER ;
| true |
d6329274d16f66f0de5ae6288df08a3aac06bba2 | SQL | liwc0329/spring-boot-h2-jpa | /src/main/resources/test.sql | UTF-8 | 260 | 2.84375 | 3 | [] | no_license | DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY,
NAME VARCHAR(255));
INSERT INTO TEST VALUES(1, 'Hello');
INSERT INTO TEST VALUES(2, 'World');
SELECT * FROM TEST ORDER BY ID;
UPDATE TEST SET NAME='Hi' WHERE ID=1;
DELETE FROM TEST WHERE ID=2; | true |
c286b3cb76236680f1ae0a3a378b2456ff78ca4b | SQL | SHARKJBB/mvc-demo | /mysql.sql | UTF-8 | 3,321 | 2.84375 | 3 | [] | no_license | create database gzhb;
use gzhb;
show tables;
drop table user;
#�û���
create table user(
id int auto_increment primary key,
gh varchar(20),#���ţ���ע���ʱ���Զ���������ǰ���ڼ�id
name varchar(50),
pwd varchar(50),
phone varchar(20),
pow int default 0,#Ȩ�ޣ�0:��ʾ��ͨԱ����1:��ʾ����Ա��2:��ʾ��������Ա
manager_id int default 0,#0:��ʾû���ϼ����������˾����������Ա�û���
bm_id int#����ID��
);
#��������Ա�û�
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711151","a","201711151","12345678901",2,0,1);
#����Ա�û�
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711152","b","201711152","12345678901",1,1,2);
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711153","c","201711153","12345678901",1,1,2);
#��ͨ�û�
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711154","d","201711154","12345678901",0,2,3);
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711155","e","201711155","12345678901",0,2,3);
insert into user(gh,name,pwd,phone,pow,manager_id,bm_id)
values("201711156","f","201711156","12345678901",0,3,4);
#���ű�
create table bumen(
id int auto_increment primary key,
name varchar(20)
);
insert into bumen(name) values("1");
insert into bumen(name) values("2");
insert into bumen(name) values("3");
insert into bumen(name) values("4");
#�㱨��
create table hb(
id int auto_increment primary key,
ty int,#�㱨���͡�0-�ܱ���1-�±���2-�걨
rq varchar(20),#�㱨���������ڣ�XXXX��XX��XX��
zyys int,#����/�¶�/���
bmName varchar(20),#��������
m_name varchar(20),#�쵼����
csren varchar(20),#����������
user_id int,#������id
st int#�㱨��״̬��0-��ʾû���ʼ���1-�Ѿ����ͣ�2-�ȴ����ͣ�3-�Ѿ�����
);
#����/����/����ȱ���Ϊ�㱨���������ӱ����ڡ�
create table nowtask(
id int auto_increment primary key,
cdtask varchar(3000),#�������
xdrq varchar(30),#�´����ڣ����ڸ�ʽ��XXX��XXX��XXX��
wcrq varchar(30),#������ڣ����ڸ�ʽ��XXX��XXX��XXX��
hb_id int#�㱨id
);
#����/����/����ȱ���Ϊ�㱨����������ڡ�
create table nexttask(
id int auto_increment primary key,
cdtask varchar(3000),#�������
rq varchar(30),#Ԥ��������ڣ����ڸ�ʽ��XXX��XXX��XXX��
zr varchar(30),#������
xtbm varchar(30),#������
bz varchar(3000),#��ע
hb_id int#�㱨id
);
#�����������Ϊ�㱨����������ڡ�
create table wenti(
id int auto_increment primary key,
cdtask varchar(3000),#�������
zywt varchar(3000),#��Ҫ����
dcjjy varchar(3000),#�Բ�����
hb_id int#�㱨��ID
); | true |
dcdd0249d7550fba24c16fd3a835c164b511b1e2 | SQL | revaturelabs/forge-review-service | /Portfolio-Review-Service/src/main/resources/data.sql | UTF-8 | 1,151 | 2.65625 | 3 | [] | no_license | insert into user_table values (1,'admin@revature.net','adminFirst',true,'adminLast','admin');
insert into user_table values (2,'user@revature.net','FirstName',false,'LastName','password');
insert into portfolio values(1, 'Pending', 2 );
insert into criteria_table values (1,'aboutMe','0','0');
insert into criteria_table values (2,'education','0','0');
insert into criteria_table values (3,'industryEquivalancy','0','0');
insert into criteria_table values (4,'projects','0','0');
insert into criteria_table values (5,'skillMatrix','0','0');
/*
insert into portfolio_items values('AboutMe', 1, 1);
insert into about_me values ('I am a full stack java developer', 1, 'AboutMe', 1, 1);
insert into portfolio_items(dtype, portfolio_id, description, portfolio_items_id) values('ABOUT_ME', 1, 'AboutMeDescript', DEFAULT);
insert into portfolio_items(dtype, portfolio_id, description, portfolio_items_id) values('ABOUT_ME', 1, 'AboutMeDescript', DEFAULT);
insert into portfolio_items(dtype, portfolio_id, skill_matrix_id, skill_title, portfolio_items_id) values('skill_matrix', 1, DEFAULT, 'bananas', DEFAULT);
insert into skill_matrix_items values(DEFAULT, 6, 'H2', 1);
*/
| true |
7c281cbef3474fd0e91a749eece5d852fd86127c | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day21/select0854.sql | UTF-8 | 191 | 2.765625 | 3 | [] | no_license |
SELECT timeStamp, temperature
FROM ThermometerObservation
WHERE timestamp>'2017-11-20T08:54:00Z' AND timestamp<'2017-11-21T08:54:00Z' AND SENSOR_ID='1ac44852_b414_47e6_a7bd_478807f09c0e'
| true |
35ae75f3946a7a7a208366eea8a62662d259ca10 | SQL | tkrizsa/xld | /api-homebudget/src/main/resources/install/expense.sql | UTF-8 | 1,544 | 3.21875 | 3 | [] | no_license | --@xld-modelVersion : 9604b4de8d8f94c7a69a431d09bbaa1a
--@xld-versionHint : initial
CREATE TABLE `homebudget.expense` (
`expenseId` BIGINT,
`expenseKindId` BIGINT,
`expenseName` VARCHAR(200),
PRIMARY KEY(`expenseId`),
CONSTRAINT `fk_expense_expenseKindId` FOREIGN KEY (`expenseKindId`) REFERENCES `homebudget.expensekind`(`expenseKindId`)
)
--@xld-modelVersion : 9c116ab2b4fff7d921bca4b64deeab09
--@xld-versionHint : rename to expenseDescription
ALTER TABLE `homebudget.expense`
CHANGE `expenseName` `expenseDescription` TEXT
--@xld-modelVersion : 0c0076a670246d0bf4602520e8582912
--@xld-versionHint : set fields to not null
ALTER TABLE `homebudget.expense`
CHANGE `expenseId` `expenseId` BIGINT NOT NULL,
CHANGE `expenseKindId` `expenseKindId` BIGINT NOT NULL
--@xld-modelVersion : 11446ba8d196747c7fab485d5d08485f
--@xld-versionHint : add money field
ALTER TABLE `homebudget.expense`
ADD `amount` NUMERIC(24,4) NOT NULL
--@xld-modelVersion : fae682e41f94eb37fc94f766861f1da4
--@xld-versionHint : add money field
ALTER TABLE `homebudget.expense`
ADD `date` date NULL
--@xld-go
UPDATE `homebudget.expense` SET date = NOW()
--@xld-go
ALTER TABLE `homebudget.expense`
CHANGE `date` `date` date NOT NULL
--@xld-modelVersion : 4f318b5ee062cc320be8b006900f5ef3
--@xld-versionHint : add actorId field
TRUNCATE TABLE `homebudget.expense`
--@xld-go
ALTER TABLE `homebudget.expense`
ADD `actorId` BIGINT NOT NULL
| true |
c7aa56635b17cfcd9351533967be7e7540f8dd90 | SQL | saini5um/Misc | /CEL_SBL_Fetch_Price.sql | UTF-8 | 3,798 | 3.40625 | 3 | [] | no_license | alter session set current_schema = SIEBEL;
alter session set nls_date_format = 'dd-Mon-YYYY HH24:MI:SS';
select m.SERIAL_NUM, p.name, p.part_num, count(*)
--select m.SERIAL_NUM, a.prod_id, m.prod_id, p.name, p.part_num, a.row_id, a.PAR_ASSET_ID,
--a.ROOT_ASSET_ID, a1.ATTR_NAME, a1.CHAR_VAL
from s_asset a, s_prod_int p, s_asset_xa a1, s_asset m
where m.prod_id = p.row_id
and a.ROOT_ASSET_ID = m.row_id
and m.serial_num like '01%'
--and a.ROOT_ASSET_ID = '1-34U0WD'
--and a.SERIAL_NUM = '0193380597'
and a.prod_id = '1-3VGH6'
and a.status_cd = 'Active'
and p.PART_NUM like 'RTP%'
and a1.char_val is not null
and a1.asset_id = a.row_id
group by m.SERIAL_NUM, p.name, p.part_num
having count(*) = 7;
SELECT a.*
--INTO V_COUNT
FROM SIEBEL.CX_NEWEASY_PH a, SIEBEL.S_PROD_INT PROD, SIEBEL.S_PRI_LST_ITEM c, SIEBEL.S_PROD_INT PLANPROD
WHERE a.x_prod_id=PROD.row_id AND
PROD.row_id= c.prod_id AND
PROD.PART_NUM = 'MDR5584' and
PLANPROD.ROW_ID = a.X_PLAN_ID AND
PLANPROD.PART_NUM = 'PB10840' AND
a.X_PROTECTION_CD = 'Without Protection' and
a.X_TYPE = 'Easy Phone'
and a.x_source = 'Portal';
delete cx_neweasy_ph where row_id = '1-2UPKPKE';
select * From cx_neweasy_ph where X_PLAN_ID = '1-QVD3I3';
select row_id, created, part_num, name from s_prod_int where row_id = '1-1BHKYEY5';
select row_id, created, part_num, name from s_prod_int where part_num = 'MDR5584';
SELECT a.*
--INTO V_COUNT
FROM SIEBEL.CX_NEWEASY_PH a, SIEBEL.S_PROD_INT PROD, SIEBEL.S_PRI_LST_ITEM c, SIEBEL.S_PROD_INT PLANPROD
WHERE a.x_prod_id=PROD.row_id AND
PROD.row_id= c.prod_id AND
PROD.PART_NUM = 'MDR5584' and
PLANPROD.ROW_ID = a.X_PLAN_ID AND
PLANPROD.PART_NUM = 'PB09890'; --AND
a.X_PROTECTION_CD = 'Without Protection' and
-- a.X_TYPE = 'Easy Phone';
-- and a.x_source = 'Portal';
SELECT a.*
--INTO V_COUNT
FROM SIEBEL.CX_NEWEASY_PH a, SIEBEL.S_PROD_INT PROD, SIEBEL.S_PRI_LST_ITEM c, SIEBEL.S_PROD_INT PLANPROD
WHERE a.x_prod_id=PROD.row_id AND
PROD.row_id= c.prod_id AND
PROD.PART_NUM = 'MDR5584' and
PLANPROD.ROW_ID = a.X_PLAN_ID AND
PLANPROD.PART_NUM = 'PB12100' AND ;
-- a.X_PROTECTION_CD = 'Without Protection' and
-- a.X_TYPE = 'Easy Phone';
-- and a.x_source = 'Portal';
select * from s_prod_int where part_num = 'PB10840';
select row_id, created, name, part_num
from s_prod_int where name like 'FiRST Gold Supreme CBS%' --'FiRST Platinum CBS%'--'FiRST Gold Supreme CBS%'
and PART_NUM like 'PB%';
select p.row_id, p.created, p.name, p.part_num, e.*
from cx_neweasy_ph e, s_prod_int p
where x_plan_id = '1-Y3OKUM'
and e.x_prod_id = p.row_id
and p.name like 'S%'
and e.x_type = 'Easy Phone';
select distinct a.X_EMI AS EMIAMOUNT,a.X_CANCELLATION_KD_FEE AS KEEPDEVICECANCELLATIONFEE,a.X_UPFRONT AS UPFRONTAMOUNT,
c.MSRP_PRI_UNIT AS DEVICEPRICE, a.X_EXPRESS_NEWPH_FEE AS EXPRESSFEE, a.X_CHANGE_FEE AS CHANGEFEE, a.X_BUYOUT_FEE BUYOUTFEE,
a.X_NON_SUBSIDIZED_FEE NONSUBFEE, a.X_CANCELLATION_RD_FEE RETRUNDEVCANFEE
from SIEBEL.CX_NEWEASY_PH a, SIEBEL.S_PROD_INT PROD,SIEBEL.S_PRI_LST_ITEM c, SIEBEL.S_PROD_INT PLANPROD, SIEBEL.S_PROD_INT_X PRODX
where a.x_prod_id=PROD.row_id AND
PROD.row_id= c.prod_id AND
PROD.ROW_ID=PRODX.PAR_ROW_ID(+) AND
PROD.PART_NUM = 'MDR5584' AND
PLANPROD.row_id(+) = a.x_plan_id AND
(PLANPROD.part_num is null or PLANPROD.part_num = 'PB12100') AND
a.X_PROTECTION_CD = 'Without Protection' AND
a.X_TYPE = 'Easy Phone' AND
-- a.X_STATUS = "Active" AND
a.x_source = 'Portal';
| true |
39a645e69ca91143df593bb408e4246e04075aab | SQL | s23m/cake-persistence | /org.s23m.cell.persistence/src/main/resources/sql/common_ddl.sql | UTF-8 | 5,022 | 3.875 | 4 | [] | no_license | -- DDL which should execute correctly against PostgreSQL, MySQL, H2
CREATE TABLE IF NOT EXISTS Identity (
uuid varchar(36) NOT NULL,
name varchar(100) NOT NULL,
pluralName varchar(100) NOT NULL,
codeName varchar(100),
pluralCodeName varchar(100),
payload TEXT,
PRIMARY KEY (uuid),
CONSTRAINT uc_name_uuid UNIQUE (name, uuid)
);
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS Agent (
urr varchar(36) NOT NULL,
uuid varchar(36) NOT NULL,
email varchar(254),
-- should be large enough for bcrypt / scrypt
password varchar(1024) NOT NULL,
-- phone numbers are a maximum of 15 digits, but this allows whitespace and + character
mobile varchar(30),
firstName varchar(50) NOT NULL,
lastName varchar(50) NOT NULL,
alias varchar(50) NOT NULL,
PRIMARY KEY (urr),
CONSTRAINT uc_agent_uuid_urr UNIQUE (uuid, urr),
CONSTRAINT fk_agent_urr FOREIGN KEY (urr) REFERENCES identity (uuid),
CONSTRAINT fk_agent_uuid FOREIGN KEY (uuid) REFERENCES identity (uuid)
);
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS Graph (
urr varchar(36) NOT NULL,
uuid varchar(36) NOT NULL,
category varchar(36) NOT NULL,
container varchar(36) NOT NULL,
isAbstractValue varchar(36) NOT NULL,
maxCardinalityValueInContainer varchar(36),
properClass varchar(36) NOT NULL,
contentAsXml TEXT,
PRIMARY KEY (urr),
CONSTRAINT uc_graph_uuid_urr UNIQUE (uuid,urr),
CONSTRAINT fk_graph_urr FOREIGN KEY (urr) REFERENCES identity (uuid),
CONSTRAINT fk_graph_uuid FOREIGN KEY (uuid) REFERENCES identity (uuid),
CONSTRAINT fk_category FOREIGN KEY (category) REFERENCES identity (uuid),
CONSTRAINT fk_container FOREIGN KEY (container) REFERENCES identity (uuid),
CONSTRAINT fk_isAbstractValue FOREIGN KEY (isAbstractValue) REFERENCES identity (uuid),
CONSTRAINT fk_maxCardinalityValueInContainer FOREIGN KEY (maxCardinalityValueInContainer) REFERENCES identity (uuid),
CONSTRAINT chk_graph_properClass CHECK (properClass IN ('Vertex', 'Edge', 'EdgeEnd', 'Visibility', 'SuperSetReference'))
);
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS Arrow (
urr varchar(36) NOT NULL,
category varchar(36) NOT NULL,
properClass varchar(36) NOT NULL,
fromGraph varchar(36) NOT NULL,
toGraph varchar(36) NOT NULL,
PRIMARY KEY (urr),
CONSTRAINT chk_arrow_properClass CHECK (properClass IN ('Edge', 'Visibility', 'SuperSetReference')),
CONSTRAINT uc_from_to_properClass UNIQUE (fromGraph, toGraph, properClass, category),
CONSTRAINT uc_to_properClass UNIQUE (toGraph, properClass, category),
CONSTRAINT fk_arrow FOREIGN KEY (urr) REFERENCES graph (urr),
CONSTRAINT fk_fromGraph FOREIGN KEY (fromGraph) REFERENCES graph (urr),
CONSTRAINT fk_toGraph FOREIGN KEY (toGraph) REFERENCES graph (urr)
);
-- --------------------------------------------------------
CREATE TABLE IF NOT EXISTS Edge (
urr varchar(36) NOT NULL,
minCardinalityValueFromEdgeEnd varchar(36) NOT NULL,
minCardinalityValueToEdgeEnd varchar(36) NOT NULL,
maxCardinalityValueFromEdgeEnd varchar(36) NOT NULL,
maxCardinalityValueToEdgeEnd varchar(36) NOT NULL,
isNavigableValueFromEdgeEnd varchar(36) NOT NULL,
isNavigableValueToEdgeEnd varchar(36) NOT NULL,
isContainerValueFromEdgeEnd varchar(36) NOT NULL,
isContainerValueToEdgeEnd varchar(36) NOT NULL,
fromEdgeEnd varchar(36) NOT NULL,
toEdgeEnd varchar(36) NOT NULL,
PRIMARY KEY (urr),
CONSTRAINT fk_edge FOREIGN KEY (urr) REFERENCES arrow (urr),
CONSTRAINT fk_minCardinalityValueFromEdgeEnd FOREIGN KEY (minCardinalityValueFromEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_minCardinalityValueToEdgeEnd FOREIGN KEY (minCardinalityValueToEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_maxCardinalityValueFromEdgeEnd FOREIGN KEY (maxCardinalityValueFromEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_maxCardinalityValueToEdgeEnd FOREIGN KEY (maxCardinalityValueToEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_isNavigableValueFromEdgeEnd FOREIGN KEY (isNavigableValueFromEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_isNavigableValueToEdgeEnd FOREIGN KEY (isNavigableValueToEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_isContainerValueFromEdgeEnd FOREIGN KEY (isContainerValueFromEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_isContainerValueToEdgeEnd FOREIGN KEY (isContainerValueToEdgeEnd) REFERENCES identity (uuid),
CONSTRAINT fk_fromEdgeEnd FOREIGN KEY (fromEdgeEnd) REFERENCES graph (urr),
CONSTRAINT fk_toEdgeEnd FOREIGN KEY (toEdgeEnd) REFERENCES graph (urr)
);
-- --------------------------------------------------------
CREATE INDEX idx_Identity_name_uuid ON Identity (name, uuid);
CREATE INDEX idx_Graph_uuid_urr ON Graph (uuid, urr);
CREATE INDEX idx_Graph_from_to_properClass_category ON Arrow (fromGraph, toGraph, properClass, category);
CREATE INDEX idx_Graph_to_properClass_category ON Arrow (toGraph, properClass, category);
| true |
0ca2397d0c1ccd3e1cab33b33d5807ae7c5b293e | SQL | NTXpro/NTXbases_de_datos | /DatabaseNTXpro/ERP/Stored Procedures/Procs1/Usp_Sel_CajaChicaDetalle_By_IdCajaChica.sql | UTF-8 | 1,152 | 3.21875 | 3 | [] | no_license |
CREATE PROC [ERP].[Usp_Sel_CajaChicaDetalle_By_IdCajaChica]
@IdMovimientoCajaChica INT
AS
BEGIN
SELECT MCD.ID,
MCD.IdMovimientoCajaChica,
MCD.Orden,
MCD.IdCuenta,
C.Nombre NombreCuenta,
MCD.IdPlanCuenta,
PC.CuentaContable,
MCD.IdProyecto,
P.Numero NumeroProyecto,
MCD.IdEntidad,
MCD.Nombre,
MCD.IdTipoComprobante,
TC.Nombre NombreTipoComprobante,
MCD.Serie,
MCD.Documento,
MCD.Total,
MCD.IdDebeHaber,
DH.Nombre NombreDebeHaber,
MCD.CodigoAuxiliar,
MCC.TipoCambio,
MCD.IdCuentaPagar,
MCD.FlagTransferencia,
MCD.IdMovimientoTesoreria,
C.IdMoneda,
MCD.Operacion
FROM ERP.MovimientoCajaChicaDetalle MCD
INNER JOIN ERP.MovimientoCajaChica MCC ON MCC.ID = MCD.IdMovimientoCajaChica
LEFT JOIN ERP.Proyecto P ON P.ID = MCD.IdProyecto
LEFT JOIN ERP.Cuenta C ON C.ID = MCD.IdCuenta
LEFT JOIN ERP.PlanCuenta PC ON PC.ID = MCD.IdPlanCuenta
INNER JOIN Maestro.DebeHaber DH ON DH.ID = MCD.IdDebeHaber
LEFT JOIN PLE.T10TipoComprobante TC ON TC.ID = MCD.IdTipoComprobante
WHERE MCD.IdMovimientoCajaChica = @IdMovimientoCajaChica
END | true |
6929d1c13dffedfd4c8d83019702d1f64ca62127 | SQL | marciellioliveira/2watch | /2watch.sql | UTF-8 | 1,454 | 2.921875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 19, 2018 at 09:34 PM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `2watch`
--
-- --------------------------------------------------------
--
-- Table structure for table `usuario`
--
CREATE TABLE `usuario` (
`id_user` int(11) NOT NULL,
`nome_user` varchar(100) NOT NULL,
`sobrenome_user` varchar(100) NOT NULL,
`email_user` varchar(100) NOT NULL,
`senha_user` varchar(100) NOT NULL,
`fotoPerfil_user` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`id_user`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `usuario`
--
ALTER TABLE `usuario`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT;COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
1d6d48996a2e55281ec87f666345ac42f9175f32 | SQL | JungWonHong/Spring | /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/JspSemi/boardupload/JOBS2.sql | UHC | 3,002 | 3.875 | 4 | [] | no_license | SET TERMOUT On
SET ECHO On
GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO jobs2 IDENTIFIED BY semi ;
ALTER USER JOBS2 DEFAULT TABLESPACE USERS;
ALTER USER JOBS2 TEMPORARY TABLESPACE TEMP;
CONNECT jobs2/semi
DROP TABLE ȸ;
DROP TABLE ;
DROP TABLE äԽ;
DROP TABLE Ʈ;
DROP TABLE ıԽ;
DROP TABLE ҽԽ;
DROP TABLE ̷¼;
DROP TABLE ȸ;
CREATE TABLE ȸ(
̵ varchar2(40) primary key,
̸ varchar2(40) not null,
йȣ varchar2(40) not null,
ڵȣ varchar2(40) not null,
̸ varchar2(40) not null,
ȸ date default sysdate not null ,
number not null,
̷¼Ͽ number default 0,
ITڰ number default 0,
ڱҰ varchar2(4000),
Ʈ varchar2(40)
) ;
CREATE TABLE ̷¼(
ۼھ̵ varchar2(40) not null,
ȸ varchar2(40) not null,
ڱҰ varchar2(4000) not null,
Ʈ varchar2(40),
ڰ varchar2(500),
foreign key(ۼھ̵) references ȸ(̵)
);
CREATE TABLE Ʈ(
varchar2(40) primary key,
ǥ varchar2(40) unique not null,
ġ varchar2(100) not null,
varchar2(40) not null,
NUMBER not null,
ٹ varchar2(40),
ٹڼ NUMBER not null
);
CREATE TABLE ȸ(
̸ varchar2(40) not null,
̵ varchar2(40) primary key,
йȣ varchar2(40) not null,
̸ varchar2(40) not null,
ڵȣ varchar2(40) not null,
varchar2(40) not null,
ȸ date default sysdate not null
);
CREATE TABLE ıԽ(
۹ȣ NUMBER primary key,
ۼ DATE default sysdate not null,
varchar2(50) not null,
ۼ varchar2(40) not null,
ȸ NUMBER default 0,
varchar2(4000) not null,
NUMBER default 0 not null
);
CREATE TABLE äԽ(
NUMBER not null,
NUMBER not null,
NUMBER default 0,
ɷ varchar2(50),
ٹð varchar2(50),
varchar2(50) not null,
¥ date not null,
۹ȣ number primary key,
varchar2(4000) not null,
varchar2(40) not null,
Ʈ varchar2(100),
ۼ date default sysdate not null,
foreign key() references Ʈ()
);
CREATE TABLE ҽԽ(
۹ȣ number primary key,
varchar2(50) not null,
ۼ varchar2(40) not null,
ۼ date default sysdate not null,
ȸ number default 0,
varchar2(4000) not null,
÷ varchar2(100)
);
CREATE TABLE (
۹ȣ number primary key,
ۼ varchar2(40),
varchar2(400),
Խñ۹ȣ number,
ۼ date default sysdate not null,
foreign key(Խñ۹ȣ) references ҽԽ(۹ȣ)
);
COMMIT;
SET TERMOUT ON
SET ECHO ON | true |
16d92206b266783c7045bc11781fc4ac10d5d38b | SQL | lucascavalcante/rapadura-valley-mapa | /db/places_3.sql | UTF-8 | 591 | 2.6875 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `places` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`approved` int(1) DEFAULT NULL,
`title` varchar(100) NOT NULL,
`type` varchar(20) NOT NULL,
`lat` float NOT NULL,
`lng` float NOT NULL,
`address` varchar(200) NOT NULL,
`uri` varchar(200) NOT NULL,
`description` varchar(255) NOT NULL,
`sector` varchar(50) NOT NULL,
`owner_name` varchar(100) NOT NULL,
`owner_email` varchar(100) NOT NULL,
`sg_organization_id` int(9) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
| true |
ee5058a5f4e17e687a7ba86e2218871aa37e8712 | SQL | softlog/postgresql_scripts | /embarcador/v_emb_conhecimentos_embarcados_mgr.sql | UTF-8 | 1,942 | 3.28125 | 3 | [] | no_license | -- View: public.v_emb_conhecimentos_embarcados_mgr
-- DROP VIEW public.v_emb_conhecimentos_embarcados_mgr;
CREATE OR REPLACE VIEW public.v_emb_conhecimentos_embarcados_mgr AS
SELECT DISTINCT c.id_emb_conhecimento_embarcado,
c.codigo_empresa,
c.codigo_filial,
c.serie_conhecimento,
c.numero_conhecimento,
c.data_emissao,
c.condicao_frete,
c.peso_transportado,
c.valor_frete,
c.base_calculo_icms,
c.aliquota_icms,
c.valor_icms,
c.frete_peso,
c.frete_valor,
c.sec_cat,
c.itr,
c.despacho,
c.pedagio,
c.valor_ademe,
c.substituicao_tributaria,
c.cnpj_emitente,
f.nome_razao AS transportadora,
c.cnpj_remetente,
filial.razao_social AS embarcadora,
c.acao_documento,
c.tipo_transporte,
c.cfop,
c.tipo_meio_transporte,
c.total_outras_despesas,
c.valor_iss,
c.serie_conhecimento_origem,
c.numero_conhecimento_origem,
c.pendencias,
vc.id_conhecimento,
vc.numero_ctrc_filial AS numero_minuta,
string_agg(nf.numero_nota_fiscal::text, ','::text) AS lst_nf,
dc.numero_documento AS numero_fatura,
dc.data_vencimento AS vencimento_fatura
FROM emb_conhecimentos_embarcados c
LEFT JOIN fornecedores f ON f.cnpj_cpf::bpchar = c.cnpj_emitente
LEFT JOIN filial ON filial.cnpj = c.cnpj_remetente
LEFT JOIN v_emb_conhecimentos_embarcados vc ON vc.id_emb_conhecimento_embarcado = c.id_emb_conhecimento_embarcado
LEFT JOIN emb_notas_fiscais nf ON nf.id_emb_conhecimento_embarcado = c.id_emb_conhecimento_embarcado
LEFT JOIN emb_documentos_cobranca_itens dci ON dci.id_emb_conhecimento_embarcado = c.id_emb_conhecimento_embarcado
LEFT JOIN emb_documentos_cobranca dc ON dc.id_emb_documento_cobranca = dci.id_emb_documento_cobranca
GROUP BY c.id_emb_conhecimento_embarcado, f.id_fornecedor, filial.id_filial, vc.id_conhecimento, vc.numero_ctrc_filial, dc.id_emb_documento_cobranca;
| true |
ad2505174ac9d6e519306c8040e315499e970fd3 | SQL | britalodev/poeHarvestSeeds | /target/classes/sql/WILD.sql | UTF-8 | 13,728 | 2.828125 | 3 | [
"MIT"
] | permissive | INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Caster modifier crafting effect when Harvested', 'Ursaling Seed', 'T1', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reforge a Normal or Magic item as a Rare item with random modifiers, including a Caster modifier', 1),
('Reforge a Rare item with new random modifiers, including a Caster modifier', 1),
('Remove a random non-Caster modifier from an item and add a new Caster modifier', 1),
('Remove a random non-Caster modifier from an item and add a new Caster modifier', 1),
('Augment a Magic or Rare item with a new Caster modifier', 1),
('Augment a Magic or Rare item with a new Caster modifier', 1),
('Remove a random Caster modifier from an item', 1),
('Randomise the numeric values of the random Caster modifiers on a Magic or Rare item', 1),
('Remove a random Caster modifier from an item and add a new Caster modifier', 1),
('Reforge a Rare item with new random modifiers, including a Caster modifier. Caster modifiers are more common', 1),
('Augment a Magic or Rare item with a new Caster modifier with Lucky values', 1);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Physical modifier crafting effect when Harvested', 'Hellion Seed', 'T1', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reforge a Normal or Magic item as a Rare item with random modifiers, including a Physical modifier', 2),
('Reforge a Rare item with new random modifiers, including a Physical modifier', 2),
('Remove a random non-Physical modifier from an item and add a new Physical modifier', 2),
('Augment a Magic or Rare item with a new Physical modifier', 2),
('Remove a random Physical modifier from an item', 2),
('Randomise the numeric values of the random Physical modifiers on a Magic or Rare item', 2),
('Remove a random Physical modifier from an item and add a new Physical modifier', 2),
('Reforge a Rare item with new random modifiers, including a Physical modifier. Physical modifiers are more common', 2),
('Augment a Magic or Rare item with a new Physical modifier with Lucky values', 2);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Socket colour crafting effect when Harvested', 'Thornwolf Seed', 'T1', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reforge the colour of a non-red socket on an item, turning it Red', 3),
('Reforge the colour of a non-blue socket on an item, turning it Blue', 3),
('Reforge the colour of a non-green socket on an item, turning it Green', 3),
('Reforge the colour of two random sockets on an item, turning them Red and Blue', 3),
('Reforge the colour of two random sockets on an item, turning them Red and Green', 3),
('Reforge the colour of two random sockets on an item, turning them Blue and Green', 3),
('Reforge the colour of three random sockets on an item, turning them Red, Green and Blue', 3),
('Reforge the colour of a non-white socket on an item, turning it White', 3);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Fire modifier crafting effect when Harvested', 'Ape Seed', 'T1', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reforge a Normal or Magic item as a Rare item with random modifiers, including a Fire modifier', 4),
('Reforge a Rare item with new random modifiers, including a Fire modifier', 4),
('Remove a random non-Fire modifier from an item and add a new Fire modifier', 4),
('Augment a Magic or Rare item with a new Fire modifier', 4),
('Remove a random Fire modifier from an item', 4),
('Randomise the numeric values of the random Fire modifiers on a Magic or Rare item', 4),
('Remove a random Fire modifier from an item and add a new Fire modifier', 4),
('Reforge a Rare item with new random modifiers, including a Fire modifier. Fire modifiers are more common', 4),
('Augment a Magic or Rare item with a new Fire modifier with Lucky values', 4);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Currency crafting effect with improved outcome chances when Harvested', 'Hatchling Seed', 'T1', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reforges the number of sockets on an item 10 times, using the outcome with the greatest number of sockets', 5),
('Reforges the links between sockets on an item 10 times, using the outcome with the greatest number of linked sockets', 5),
('Reforges the colours of sockets on an item 10 times, using the outcome with the greatest number of less-common socket colours', 5),
('Improves the Quality of a Flask by at least 10%. Has greater effect on lower rarity flasks. The maximum quality is 20%', 5),
('Improves the Quality of a Gem by at least 10%. The maximum quality is 20%', 5),
('Upgrades a Normal Item to a random rarity 10 times, using the outcome with the highest rarity', 5),
('Reforges a Rare item with new random modifiers 10 times, using the outcome with the highest average modifier level', 5);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random crafting effect that changes the element of Elemental Resistance modifiers when Harvested', 'Bristlebeast Grain', 'T2', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Change a modifier that grants Fire Resistance into a similar-tier modifier that grants Cold Resistance', 6),
('Change a modifier that grants Cold Resistance into a similar-tier modifier that grants Lightning Resistance', 6),
('Change a modifier that grants Lightning Resistance into a similar-tier modifier that grants Fire Resistance', 6),
('Change a modifier that grants Fire Resistance into a similar-tier modifier that grants Lightning Resistance', 6),
('Change a modifier that grants Cold Resistance into a similar-tier modifier that grants Fire Resistance', 6),
('Change a modifier that grants Lightning Resistance into a similar-tier modifier that grants Cold Resistance', 6);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a currency item exchange, trading three of a certain type of currency for other currency items when Harvested', 'Snap Hound Grain', 'T2', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Exchange 3 Chaos Orbs for a Divine Orb', 7),
('Exchange 3 Orbs of Transmutation for 3 Orbs of Alchemy', 7),
('Exchange 3 Blessed Orbs for 6 Orbs of Alteration', 7),
('Exchange 3 Orbs of Alchemy for 6 Cartographer\'s Chisels', 7),
('Exchange 3 Chromatic Orbs for 6 Gemcutter\'s Prisms', 7),
('Exchange 3 Jeweller\'s Orbs for 6 Orbs of Fusing', 7),
('Exchange 3 Orbs of Augmentation for 3 Regal Orbs', 7),
('Exchange 3 Scrolls of Wisdom for 6 Orbs of Chance', 7),
('Exchange 3 Simple Sextants for 3 Prime Sextants', 7),
('Exchange 3 Prime Sextants for 3 Awakened Sextants', 7),
('Exchange 3 Orbs of Scouring for 3 Orbs of Annulment', 7),
('Exchange 3 Orbs of Alteration for 3 Chaos Orbs', 7),
('Exchange 3 Vaal Orbs for 6 Orbs of Regret', 7),
('Exchange 3 Cartographer\'s Chisels for 3 Vaal Orbs', 7);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random effect that exchanges Fossils, Essences, Delirium Orbs, Oils or Catalysts when Harvested', 'Homunculus Grain', 'T2', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Change a stack of Fossils into a different type of Fossil', 8),
('Change a stack of Essences into a different type of the same tier', 8),
('Change a stack of Delirium Orbs into a different type of Delirium Orb', 8),
('Change a stack of Oils into a different colour of Oil', 8),
('Change a stack of Catalysts into a different type of Catalyst', 8);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Allows you to Sacrifice a Map to influence Zana\'s crafting options when Harvested', 'Chieftain Grain', 'T2', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Sacrifice a Map. Add a free craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Anarchy craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Nemesis craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Domination craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Bloodlines craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Rampage craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Ambush craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Harbinger craft to your Map device', 9),
('Sacrifice a Map. Add a free Infused Perandus craft to your Map device', 9);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random crafting effect that reforges a Rare item a certain way when Harvested', 'Spikeback Grain', 'T2', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Reroll a Rare item, keeping all Prefixes', 10),
('Reroll a Rare item, keeping all Suffixes', 10),
('Reroll a Rare item, being much less likely to receive the same modifier types', 10),
('Reroll a Rare item, being much more likely to receive the same modifier types', 10);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Allows you to sacrifice a Map to gain additional Atlas missions when Harvested', 'Bristle Matron Bulb', 'T3', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Sacrifice a Map to gain 3 Alva Atlas Missions', 11),
('Sacrifice a Map to gain 3 Niko Atlas Missions', 11),
('Sacrifice a Map to gain 3 Einhar Atlas Missions', 11),
('Sacrifice a Map to gain 3 Jun Atlas Missions', 11),
('Sacrifice a Map to gain 3 Zana Atlas Missions', 11),
('Sacrifice a Map to gain 1 Atlas Mission for each Master', 11);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Allows you to sacrifice a Weapon or Armour to create Jewellery or Jewels when Harvested', 'Hellion Alpha Bulb', 'T3', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Sacrifice a Weapon or Armour to create a Belt with similar modifiers', 12),
('Sacrifice a Weapon or Armour to create a Ring with similar modifiers', 12),
('Sacrifice a Weapon or Armour to create an Amulet with similar modifiers', 12),
('Sacrifice a Weapon or Armour to create a Jewel with similar modifiers', 12);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Allows you to Sacrifice a Map to create items for the Atlas when Harvested', 'Thornmaw Bulb', 'T3', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Sacrifice a White or Yellow Map to create random Map Fragments based on its tier', 13),
('Sacrifice a Red Map to create random Map Fragments based on its tier', 13),
('Sacrifice a Map to create random Map currency based on its tier', 13),
('Sacrifice a Map to create a random Scarab based on its colour', 13),
('Sacrifice a tier 14 map or higher to create a random Elder Guardian-occupied Map', 13),
('Sacrifice a tier 14 map or higher to create a random Shaper Guardian-occupied Map', 13),
('Sacrifice a tier 14 map or higher to create a random Unique Synthesis Map', 13);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveals a random Weapon Enchantment that replaces Quality\'s effect when Harvested', 'Brambleback Bulb', 'T3', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Enchant a Weapon. Quality does not increase its Physical Damage, has increased 1% increased Critical Strike Chance per 4% Quality', 14),
('Enchant a Weapon. Quality does not increase its Physical Damage, grants increased 1% increased Accuracy per 2% Quality', 14),
('Enchant a Weapon. Quality does not increase its Physical Damage, has 1% increased Attack Speed per 8% Quality', 14),
('Enchant a Weapon. Quality does not increase its Physical Damage, has +1 Weapon Range per 10% Quality', 14),
('Enchant a Weapon. Quality does not increase its Physical Damage, grants 1% increased Elemental Damage per 2% Quality', 14),
('Enchant a Weapon. Quality does not increase its Physical Damage, grants 1% increased Area of Effect per 4% Quality', 14);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Causes other seeds to offer an additional crafting outcome. This effect is limited to one per harvest when Harvested', 'Infestation Queen Bulb', 'T3', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES ('Causes other seeds to offer an additional crafting outcome. This effect is limited to one per harvest when Harvested', 15);
-- Next
INSERT INTO seeds.seed
(descricao, nome, tier, tipo_seed)
VALUES('Reveal a random crafting effect that locks a random modifier on an item when Harvested', 'Wild Thornfruit', 'T4', 'WILD');
INSERT INTO seeds.craft
(descricao, seedid)
VALUES
('Fracture a random modifier on an item with at least 5 modifiers, locking it in place. This can\'t be used on Influenced, Synthesised, or Fractured items', 16),
('Fracture a Suffix on an item with least 3 Suffixes. This can\'t be used on Influenced, Synthesised, or Fractured items', 16),
('Fracture a Prefix on an item with at least 3 Prefixes. This can\'t be used on Influenced, Synthesised, or Fractured items.', 16); | true |
3a6e6672270f9719c5b987e1f7411e76f31d2ce2 | SQL | julian916/gedesDel2018 | /SCRIPTS_DE_MIGRACION/Migracion_Personas.sql | UTF-8 | 2,622 | 3.96875 | 4 | [] | no_license | /*Genero una consulta utilizando row_number() para contabilizar la cantidad de recurrencia de un documento y un email
para luego filtrar con recurrencia igual a 1 tal que pueda alimentar la entidad personas sin los duplicados*/
with clientes as(
SELECT Cliente_Pasaporte_Nro as nro_documento
,Cliente_Mail as email
,Cliente_Nombre as nombre
,Cliente_Apellido as apellido
,Cliente_Nacionalidad as nacionalidad
,Cliente_Fecha_Nac as fecha_nac
,Cliente_Dom_Calle as calle
,Cliente_Nro_Calle as nro_calle
,Cliente_Piso as piso
,Cliente_Depto as depto
,row_number() OVER(PARTITION BY Cliente_Pasaporte_Nro ORDER BY Cliente_Mail) AS cantDocumentos
,row_number() OVER(PARTITION BY [Cliente_Mail] ORDER BY Cliente_Mail) AS cantEmail
FROM [gd_esquema].[Maestra]
GROUP BY Cliente_Pasaporte_Nro
,Cliente_Mail
,Cliente_Nombre
,Cliente_Apellido
,Cliente_Nacionalidad
,Cliente_Dom_Calle
,Cliente_Nro_Calle
,Cliente_Piso
,Cliente_Depto
,Cliente_Fecha_Nac
)
/*Inserto tabla temporal*/
select * into #temp_clientes
from clientes;
/*Inserto la entidad Personas teniendo como filtro que cantidad de recurrencia de documentos e email sean unicas*/
insert into [CUATROGDD2018].[Personas](
[nro_documento]
,[email]
,[nombre]
,[apellido]
,[nacionalidad]
,[direccion]
,[nro_calle]
,[piso]
,[departamento]
,[fecha_nacimiento]
,[id_usuario]
)
select nro_documento
,email
,nombre
,apellido
,nacionalidad
,calle
,nro_calle
,piso
,depto
,fecha_nac
,2
from #temp_clientes
where cantDocumentos=1 and cantEmail=1
order by nro_documento,email;--84.507 registros insertados
print 'Insersión de personas finalizada - ' + convert(varchar,@@rowcount) + ' registros insertados.';
/*Inserto table Personas_Repetidas teniendo como filtro lo opuesto al filtro anterior*/
insert into [CUATROGDD2018].[Personas](
[nro_documento]
,[email]
,[nombre]
,[apellido]
,[nacionalidad]
,[direccion]
,[nro_calle]
,[piso]
,[departamento]
,[fecha_nacimiento]
,[id_usuario]
,[estado]
)
select nro_documento
,email
,nombre
,apellido
,nacionalidad
,calle
,nro_calle
,piso
,depto
,fecha_nac
,2
,'Inconsistente'
from #temp_clientes
where cantDocumentos>1 or cantEmail>1
order by [nro_documento],[email]
print 'Insersión de personas duplicadas finalizada - ' + convert(varchar,@@rowcount) + ' registros insertados.';
/*Borro tabla temporal*/
drop table #temp_clientes;
| true |
2a31811730dac047ce3fa9c86666277e6223b47b | SQL | Tushar503/hopewellhospital | /databases/tbapt001.sql | UTF-8 | 1,671 | 2.84375 | 3 | [] | no_license | -- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.21 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5599
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for hopewelldb
CREATE DATABASE IF NOT EXISTS `hopewelldb` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `hopewelldb`;
-- Dumping structure for table hopewelldb.staffapp_appointment
CREATE TABLE IF NOT EXISTS `staffapp_appointment` (
`userEmail` varchar(200) NOT NULL,
`userName` varchar(200) NOT NULL,
`userMobile` varchar(200) NOT NULL,
`userAddress` varchar(500) NOT NULL,
`userCity` varchar(10) NOT NULL,
`userState` varchar(200) NOT NULL,
`userDisease` varchar(200) NOT NULL,
`Department` varchar(200) NOT NULL,
`DoctorName` varchar(200) NOT NULL,
`AppointmentDate` varchar(200) NOT NULL,
`isActive` tinyint(1) NOT NULL,
`isQueue` tinyint(1) NOT NULL,
`userAge` varchar(10) NOT NULL,
PRIMARY KEY (`userEmail`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
| true |
8ac8136caa4dc77a76eec17b4314694317254f5b | SQL | tylerj9010/Week-5-JPA-Servlet-JSP | /mySQLdumpEmp.sql | UTF-8 | 3,966 | 3.40625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `employee` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `employee`;
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: cis175.czi7y22egyxa.us-east-2.rds.amazonaws.com Database: employee
-- ------------------------------------------------------
-- Server version 5.7.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `EMPS_IN_DEP`
--
DROP TABLE IF EXISTS `EMPS_IN_DEP`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `EMPS_IN_DEP` (
`EMP_ID` int(11) NOT NULL,
`DEPARTMENT_ID` int(11) NOT NULL,
KEY `EMP_ID` (`EMP_ID`),
KEY `DEPARTMENT_ID` (`DEPARTMENT_ID`),
CONSTRAINT `EMPS_IN_DEP_ibfk_1` FOREIGN KEY (`EMP_ID`) REFERENCES `employee` (`ID`),
CONSTRAINT `EMPS_IN_DEP_ibfk_2` FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES `department` (`DEPARTMENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `EMPS_IN_DEP`
--
LOCK TABLES `EMPS_IN_DEP` WRITE;
/*!40000 ALTER TABLE `EMPS_IN_DEP` DISABLE KEYS */;
INSERT INTO `EMPS_IN_DEP` (`EMP_ID`, `DEPARTMENT_ID`) VALUES (5,9);
/*!40000 ALTER TABLE `EMPS_IN_DEP` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `department`
--
DROP TABLE IF EXISTS `department`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `department` (
`DEPARTMENT_ID` int(11) NOT NULL AUTO_INCREMENT,
`DEPARTMENT_NAME` varchar(30) DEFAULT NULL,
PRIMARY KEY (`DEPARTMENT_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `department`
--
LOCK TABLES `department` WRITE;
/*!40000 ALTER TABLE `department` DISABLE KEYS */;
INSERT INTO `department` (`DEPARTMENT_ID`, `DEPARTMENT_NAME`) VALUES (9,'Software Development');
/*!40000 ALTER TABLE `department` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `employee`
--
DROP TABLE IF EXISTS `employee`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `employee` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`FIRSTNAME` varchar(35) NOT NULL,
`LASTNAME` varchar(35) NOT NULL,
`AGE` int(11) NOT NULL,
`POSITION` varchar(35) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `employee`
--
LOCK TABLES `employee` WRITE;
/*!40000 ALTER TABLE `employee` DISABLE KEYS */;
INSERT INTO `employee` (`ID`, `FIRSTNAME`, `LASTNAME`, `AGE`, `POSITION`) VALUES (1,'Tyler','Johnson',19,'student'),(5,'Mary','Beth',45,'Software Engineer'),(6,'John','Smith',21,'Student');
/*!40000 ALTER TABLE `employee` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-02-27 19:55:31
| true |
98f1ee9130760c0bc243983864fd3dd6d7d5003a | SQL | GloriaBeltran/magic-moon | /database/db.sql | UTF-8 | 895 | 3.203125 | 3 | [] | no_license | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE DATABASE IF NOT EXISTS dbmagicmoon;
USE dbmagicmoon;
CREATE TABLE IF NOT EXISTS tblproductos (
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
nombre varchar(200) NOT NULL,
categoria varchar(250) NOT NULL,
precio varchar(150) NOT NULL,
cantidad varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS tblusuarios (
uid varchar(260) NOT NULL PRIMARY KEY,
nombre varchar(250) NOT NULL,
email varchar(250) NOT NULL,
telefono varchar(250) NOT NULL,
password varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS tblventas (
idPedido varchar(250) NOT NULL PRIMARY KEY,
fecha date NOT NULL,
uid varchar(250) NOT NULL,
idProductos varchar(300) NOT NULL,
valorP varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | true |
c1449d287e4cd111427ce81e29960c21804ba434 | SQL | Carmen90/BD-SQL | /haycupo.sql | UTF-8 | 629 | 3.09375 | 3 | [] | no_license | create or replace
function "haycupo"
(curso in char) return boolean
is
numeroPlazas cursos.plazas%type;
numeroAlumnosInscritos integer := 0;
existeCurso boolean := false;
begin
select plazas into numeroPlazas
from cursos
where codigo = curso;
existeCurso := true;
select count(id_participante) into numeroAlumnosInscritos
from cursos natural join inscripciones
group by codigo;
if(numeroPlazas>numeroAlumnosInscritos) then
return true;
else
return false;
end if;
Exception
when no_data_found then
if existeCurso then
return true;
else
return false;
end if;
end; | true |
5438c1f04212c7fc8910299f770510b45bdf30e8 | SQL | QianSeNianHua/lemonblog_service | /lib/mysql/lemonblog.sql | UTF-8 | 9,711 | 3.296875 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : mariadb
Source Server Type : MariaDB
Source Server Version : 100410
Source Host : 127.0.0.1:3306
Source Schema : lemonblog
Target Server Type : MariaDB
Target Server Version : 100410
File Encoding : 65001
Date: 18/12/2019 18:32:20
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`commentId` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论id',
`userId` int(11) NOT NULL DEFAULT -1 COMMENT '评论者的用户id',
`createTime` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
`nickname` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评论者的昵称',
`portraitURL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
`level` int(1) NULL DEFAULT NULL COMMENT '1表示第一层评论,2表示第二层评论',
`fatherCommentId` int(11) NULL DEFAULT NULL COMMENT '这是个子评论,它的父评论的评论id',
`appointCommentId` int(11) NULL DEFAULT NULL COMMENT '@某人的评论id',
`content` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评论内容',
`fileId` int(11) NULL DEFAULT NULL COMMENT '被评论的文章id',
PRIMARY KEY (`commentId`) USING BTREE,
INDEX `fileId`(`fileId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '评论区' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of comment
-- ----------------------------
INSERT INTO `comment` VALUES (1, 1, '2019-12-08 17:59:20.000', NULL, NULL, 1, NULL, NULL, '很棒!', 1);
INSERT INTO `comment` VALUES (2, -1, '2019-12-08 18:59:20.000', '容祖儿', NULL, 1, NULL, NULL, '666', 1);
INSERT INTO `comment` VALUES (3, -1, '2019-12-08 19:59:20.000', '马云', NULL, 2, 2, NULL, '你是容祖儿啊', 1);
INSERT INTO `comment` VALUES (4, 1, '2019-12-08 20:59:20.000', NULL, NULL, 2, 2, NULL, '你篡位了', 1);
INSERT INTO `comment` VALUES (5, -1, '2019-12-08 21:59:20.000', '杨幂', NULL, 2, 2, 4, '作者,你好啊', 1);
-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
`fileId` int(11) NOT NULL AUTO_INCREMENT COMMENT '文章id',
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章标题',
`createTime` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
`visit` int(11) NULL DEFAULT NULL COMMENT '访问量',
`contentURL` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文章内容',
`folderId` int(11) NULL DEFAULT NULL COMMENT '分类文件夹的id',
`userId` int(11) NULL DEFAULT NULL COMMENT '用户id',
`fileUUID` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文章唯一Id',
PRIMARY KEY (`fileId`) USING BTREE,
INDEX `folderId`(`folderId`) USING BTREE,
INDEX `userId`(`userId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文章' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of file
-- ----------------------------
INSERT INTO `file` VALUES (1, '文章一', '2019-12-09 17:59:20.000', 3, 'F:/wamp64/www/egg/files/20191206170950.txt', 1, 1, '0dbe3d99-d554-4312-9512-9d40442e20f9');
INSERT INTO `file` VALUES (2, '文章二', '2019-12-09 18:59:20.000', NULL, 'F:/wamp64/www/egg/files/20191206170950.txt', 1, 1, '297199eb-fa0a-4fef-b92f-9d91eff9b5a5');
INSERT INTO `file` VALUES (3, '文章三', '2019-12-10 17:59:20.000', 50, 'F:/wamp64/www/egg/files/20191206170950.txt', 2, 1, '7e5dc99b-6788-4a6a-8cdb-e071ccee40c1');
INSERT INTO `file` VALUES (4, '文章四', '2019-12-10 18:59:20.000', 41, 'F:/wamp64/www/egg/files/20191206170950.txt', 2, 1, 'd53ddf17-8ad5-45ca-914f-58b6aa2f390e');
-- ----------------------------
-- Table structure for folder
-- ----------------------------
DROP TABLE IF EXISTS `folder`;
CREATE TABLE `folder` (
`folderId` int(11) NOT NULL AUTO_INCREMENT COMMENT '文件夹id',
`folderName` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件夹名称',
`createTime` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
`userId` int(11) NULL DEFAULT NULL COMMENT '用户id',
`thumbnailURL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '缩略图',
PRIMARY KEY (`folderId`) USING BTREE,
INDEX `userId`(`userId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '文件夹' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of folder
-- ----------------------------
INSERT INTO `folder` VALUES (1, 'aaa', '2019-12-08 17:59:20.000', 1, NULL);
INSERT INTO `folder` VALUES (2, 'bbb', '2019-12-08 18:59:20.000', 1, NULL);
-- ----------------------------
-- Table structure for opensource
-- ----------------------------
DROP TABLE IF EXISTS `opensource`;
CREATE TABLE `opensource` (
`opensourceId` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`introduction` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '介绍',
`tagIds` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签id,多个标签用逗号隔开',
`thumbnailURL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '缩略图',
`href` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '链接地址',
`userId` int(11) NULL DEFAULT NULL COMMENT '用户id',
PRIMARY KEY (`opensourceId`) USING BTREE,
INDEX `userId`(`userId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '我的开源项目' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of opensource
-- ----------------------------
INSERT INTO `opensource` VALUES (1, '项目一', '介绍内容', '1,2', NULL, 'https://www.baidu.com', 1);
-- ----------------------------
-- Table structure for tag
-- ----------------------------
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
`tagId` int(11) NOT NULL AUTO_INCREMENT COMMENT '标签id',
`tagName` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标签名',
PRIMARY KEY (`tagId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '标签' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of tag
-- ----------------------------
INSERT INTO `tag` VALUES (1, 'Javascript');
INSERT INTO `tag` VALUES (2, 'Nodejs');
INSERT INTO `tag` VALUES (3, 'vue');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`userId` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户id',
`createTime` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
`nickname` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '昵称',
`briefIntro` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '个性签名',
`portraitURL` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
`account` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账号',
`password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '密码',
`otherLogin` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他登录方式:微信、QQ、微博',
`userUUID` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '防止前端直接获取所有用户',
PRIMARY KEY (`userId`) USING BTREE,
UNIQUE INDEX `account`(`account`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, '2019-12-08 17:59:20.000', '柠檬味的蓝海', NULL, NULL, '528627432', '18923960258', NULL, '93585f57-56fc-f968-9f07-4aaf740d6f89');
INSERT INTO `user` VALUES (2, '2019-12-18 16:11:34.866', 'xzt', NULL, NULL, '123456789', '123456', NULL, '8ac11807-c86f-4caa-9623-3fcb89e9b26c');
INSERT INTO `user` VALUES (5, '2019-12-18 16:38:08.076', 'xzt', NULL, NULL, '1234567890', '123456', NULL, '3ed23eff-9289-4ddf-92d4-68468c6a990f');
INSERT INTO `user` VALUES (6, '2019-12-18 16:38:37.054', 'xzt', NULL, NULL, '12345678901', '123456', NULL, 'f32ff2d3-8a69-4cc5-8da4-2779de71295a');
-- ----------------------------
-- Function structure for countComment
-- ----------------------------
DROP FUNCTION IF EXISTS `countComment`;
delimiter ;;
CREATE FUNCTION `countComment`(_fileId int)
RETURNS int(11)
BEGIN
declare re int;
set re = 0;
set re = (select count(*) as count from `comment` where fileId = _fileId);
RETURN re;
END
;;
delimiter ;
-- ----------------------------
-- Function structure for countFileFromFolder
-- ----------------------------
DROP FUNCTION IF EXISTS `countFileFromFolder`;
delimiter ;;
CREATE FUNCTION `countFileFromFolder`(_folderId int)
RETURNS int(11)
BEGIN
DECLARE re INT;
SET re = (SELECT count(*) as count FROM file WHERE folderId = _folderId);
RETURN re;
END
;;
delimiter ;
SET FOREIGN_KEY_CHECKS = 1;
| true |
ec31b8f33b30393481566da34d069211ede1d332 | SQL | alexdev06/ExpressFood | /express_food_bdd.sql | UTF-8 | 10,961 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost:3306
-- Généré le : lun. 08 juil. 2019 à 18:38
-- Version du serveur : 5.7.24
-- Version de PHP : 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `express_food`
--
-- --------------------------------------------------------
--
-- Structure de la table `adresse`
--
CREATE TABLE `adresse` (
`id` int(11) NOT NULL,
`numero_voie` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type_voie` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`nom_voie` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`complement` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`code_postal` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
`ville` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`client_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `adresse`
--
INSERT INTO `adresse` (`id`, `numero_voie`, `type_voie`, `nom_voie`, `complement`, `code_postal`, `ville`, `client_id`) VALUES
(2, '32 bis', 'Boulevard', 'Jean Médecin', NULL, '06000', 'Nice', 1),
(3, '13', 'Rue', 'Charles De Gaulle', 'Bâtiment D', '13100', 'Marseille', 2),
(4, '1', 'Rue', 'Stanislas', NULL, '06400', 'Cannes', 4),
(5, '21 - 24', 'Place', 'Bellecour', NULL, '69000', 'Lyon', 3);
-- --------------------------------------------------------
--
-- Structure de la table `client`
--
CREATE TABLE `client` (
`id` int(11) NOT NULL,
`nom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`prenom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`telephone` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `client`
--
INSERT INTO `client` (`id`, `nom`, `prenom`, `email`, `telephone`, `password`) VALUES
(1, 'Dupont', 'Jean', 'dupont.jean@gmail.com', '0684526952', 'klmsgdfgjlmsjg4dsfg65s4dFFGrg785dg7sg7sdf968g7sd8g74sg4s96gdd'),
(2, 'Raye', 'Félix', 'f.raye@gmail.com', '0648548965', 'jkljflqqfdqFQSDFqsjlfqsfjqlsjfqfsf7e74rgfd6g4srgDRSG'),
(3, 'Lalanne', 'Jacques', 'j.lalanne@gmail.com', '0625458963', 'jhkkqsjdfhlkKYHdfkqhfkqsdf4d5f54h54jghf6j46fdrggdFG45rdtrt756fgdgs'),
(4, 'Jacquet', 'Raymond', 'j.raymond@gmail.com', '0625145632', 'SSS34RTTYytfyifdgsjiodghffgHTty676khjfgklgjdhfkjlhkdflyh66UHJFYUedtyuufguuFFrtrr775');
-- --------------------------------------------------------
--
-- Structure de la table `commande`
--
CREATE TABLE `commande` (
`reference` int(11) NOT NULL,
`date_commande` datetime NOT NULL,
`prix_total_ht` decimal(10,2) NOT NULL,
`prix_total_ttc` decimal(10,2) NOT NULL,
`client_id` int(11) NOT NULL,
`adresse_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `commande`
--
INSERT INTO `commande` (`reference`, `date_commande`, `prix_total_ht`, `prix_total_ttc`, `client_id`, `adresse_id`) VALUES
(1001, '2019-06-11 12:00:00', '13.00', '15.60', 1, 2),
(1002, '2019-06-11 11:20:00', '9.20', '11.04', 4, 4),
(1003, '2019-06-12 00:00:00', '11.50', '13.80', 3, 5);
-- --------------------------------------------------------
--
-- Structure de la table `ligne_commande`
--
CREATE TABLE `ligne_commande` (
`produit_id` int(11) NOT NULL,
`commande_reference` int(11) NOT NULL,
`quantite` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `ligne_commande`
--
INSERT INTO `ligne_commande` (`produit_id`, `commande_reference`, `quantite`) VALUES
(1, 1001, 1),
(1, 1002, 1),
(3, 1001, 1),
(3, 1002, 1),
(5, 1003, 2);
-- --------------------------------------------------------
--
-- Structure de la table `livraison`
--
CREATE TABLE `livraison` (
`id` int(11) NOT NULL,
`statut` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`date_livraison` datetime NOT NULL,
`livreur_id` int(11) NOT NULL,
`commande_reference` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `livraison`
--
INSERT INTO `livraison` (`id`, `statut`, `date_livraison`, `livreur_id`, `commande_reference`) VALUES
(1, 'Livré', '2019-06-11 12:23:00', 1, 1001),
(2, 'Livré', '2019-06-11 12:02:00', 2, 1002),
(3, 'Livré', '2019-06-12 12:30:00', 3, 1003);
-- --------------------------------------------------------
--
-- Structure de la table `livreur`
--
CREATE TABLE `livreur` (
`id` int(11) NOT NULL,
`nom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`prenom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`statut` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`longitude` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`latitude` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `livreur`
--
INSERT INTO `livreur` (`id`, `nom`, `prenom`, `password`, `statut`, `longitude`, `latitude`) VALUES
(1, 'Dubois', 'Rémy', 'lksfdjqmf34fdskDSQF466FSgsdgksdljgmlsSF45sfjdDSGsdlkgjdsg45fjgsklg78kgflsjgslmdjgFGSD', 'Disponible', '2.3587388837891012', '48.847240788170275'),
(2, 'Alonso', 'Michael', 'hjdsqkhfq34TRFGksdlgjslmfjfqsDFSFQSf343fksdqljfqjfkjqsljfe3fjhguhu43dfSSfQTG34gdrt34', 'Disponible', '2.3587388837891045', '48.847240788170223'),
(3, 'Dufour', 'Olivia', 'SQDFQSD34Fsdfqfege45fdqsg567fsggsdfgDFGQErfergfD45677gdfsggsdFGgTSGr45ftgSDGGSDFGSD', 'Disponible', '2.3587388837891052', '48.847240788170285'),
(4, 'Marchand', 'Géraldine', 'SDFQ34TdrrdTRERgFDSFGSD45445rrgGDSGSDGSD45gdfsgsdgdfs45RtgrTRgssdGSHTHRT45fgSDGSDFGSDG', 'En livraison', '2.3587388837891066', '48.8472407881702231'),
(5, 'Joli', 'Romain', 'DFGSV45ghfghdhgH5654h87678hghfdhfFGHfdhFGHDRE455fdsgsdfFGGG54FDGSgsdgsjsgdh2hnjq', 'En congé', '', '');
-- --------------------------------------------------------
--
-- Structure de la table `produit`
--
CREATE TABLE `produit` (
`id` int(11) NOT NULL,
`nom` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`prix_unitaire_ht` decimal(10,2) NOT NULL,
`date_fabrication` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `produit`
--
INSERT INTO `produit` (`id`, `nom`, `description`, `type`, `prix_unitaire_ht`, `date_fabrication`) VALUES
(1, 'Tagliatelles Carbonara', 'De très bonne pâtes!!!', 'Plat', '11.00', '2019-06-11'),
(2, 'Pizza au Pistou', 'Une succulente pizza !', 'Plat', '10.00', '2019-06-11'),
(3, 'Glace au caramel', 'Une délicieuse glace!', 'Dessert', '5.00', '2019-06-11'),
(4, 'Tarte aux Pommes', 'Une délicieuse part de tarte aux pommes!', 'Dessert', '5.00', '2019-06-11'),
(5, 'Quiche Lorraine', 'Une part quiche Lorraine fabriquée de manière traditionnelle: lardon fumés, crème fraîche, oeufs.', 'Plat', '5.60', '2019-06-12'),
(6, 'Soupe de Poissons', 'Véritable soupe de poissons avec des poissons frais!', 'Plat', '6.90', '2019-06-12'),
(7, 'Fondant au chocolat', 'Délicieuse part de fondant au chocolat noir.', 'Dessert', '3.50', '2019-06-12'),
(8, 'Île flottante', 'Succulente île flottante avec de la crème anglaise faite maison!', 'Dessert', '3.60', '2019-06-12');
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `adresse`
--
ALTER TABLE `adresse`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_client_id` (`client_id`);
--
-- Index pour la table `client`
--
ALTER TABLE `client`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `commande`
--
ALTER TABLE `commande`
ADD PRIMARY KEY (`reference`),
ADD KEY `fk_commande_client_id` (`client_id`),
ADD KEY `fk_commande_adresse_id` (`adresse_id`);
--
-- Index pour la table `ligne_commande`
--
ALTER TABLE `ligne_commande`
ADD PRIMARY KEY (`produit_id`,`commande_reference`) USING BTREE,
ADD KEY `fk_ligne_commande_commande_reference` (`commande_reference`);
--
-- Index pour la table `livraison`
--
ALTER TABLE `livraison`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_livraison_livreur_id` (`livreur_id`),
ADD KEY `fk_livraison_commande_reference` (`commande_reference`);
--
-- Index pour la table `livreur`
--
ALTER TABLE `livreur`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `produit`
--
ALTER TABLE `produit`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `adresse`
--
ALTER TABLE `adresse`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT pour la table `client`
--
ALTER TABLE `client`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pour la table `livraison`
--
ALTER TABLE `livraison`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `livreur`
--
ALTER TABLE `livreur`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT pour la table `produit`
--
ALTER TABLE `produit`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `adresse`
--
ALTER TABLE `adresse`
ADD CONSTRAINT `fk_client_id` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`);
--
-- Contraintes pour la table `commande`
--
ALTER TABLE `commande`
ADD CONSTRAINT `fk_commande_adresse_id` FOREIGN KEY (`adresse_id`) REFERENCES `adresse` (`id`),
ADD CONSTRAINT `fk_commande_client_id` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`);
--
-- Contraintes pour la table `ligne_commande`
--
ALTER TABLE `ligne_commande`
ADD CONSTRAINT `fk_ligne_commande_commande_reference` FOREIGN KEY (`commande_reference`) REFERENCES `commande` (`reference`),
ADD CONSTRAINT `fk_ligne_commande_produit_id` FOREIGN KEY (`produit_id`) REFERENCES `produit` (`id`);
--
-- Contraintes pour la table `livraison`
--
ALTER TABLE `livraison`
ADD CONSTRAINT `fk_livraison_commande_reference` FOREIGN KEY (`commande_reference`) REFERENCES `commande` (`reference`),
ADD CONSTRAINT `fk_livraison_livreur_id` FOREIGN KEY (`livreur_id`) REFERENCES `livreur` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
f0e9cbe28b8cb6c67193f3785614821636c1b608 | SQL | LXW1602/mall | /create.sql | UTF-8 | 1,372 | 3.609375 | 4 | [] | no_license | /*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2018/6/6 15:31:53 */
/*==============================================================*/
create database mall;
use mall;
SET NAMES utf8;
drop table if exists tb_goods;
drop table if exists tb_goodstype;
/*==============================================================*/
/* Table: tb_goods */
/*==============================================================*/
create table tb_goods
(
id int not null auto_increment,
name varchar(32),
typeid int,
price double,
count int,
primary key (id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*==============================================================*/
/* Table: tb_goodstype */
/*==============================================================*/
create table tb_goodstype
(
id int not null auto_increment,
name varchar(64),
primary key (id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
alter table tb_goods add constraint FK_Reference_1 foreign key (typeid)
references tb_goodstype (id) on delete restrict on update restrict;
| true |
1c0bb0acada379dad373a3b2d425d613d4f234f8 | SQL | Academia-Hack-Promo2/w7_d34_ch9_hcarreno389 | /facturas.sql | UTF-8 | 2,218 | 3.53125 | 4 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- lun 06 abr 2015 21:43:29 VET
-- Model: New Model Version: 1.0
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `mydb` ;
-- -----------------------------------------------------
-- Table `mydb`.`clientes`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`clientes` (
`id` INT NOT NULL COMMENT ' ',
`nombre` VARCHAR(45) NOT NULL,
`ci` VARCHAR(45) NOT NULL,
`correo` VARCHAR(45) NULL,
`afiliacion` TINYINT(1) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`facturas`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`facturas` (
`id` INT NOT NULL,
`clientes_id` INT NOT NULL,
`fecha` DATE NOT NULL,
`total` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`),
INDEX `fk_facturas_clientes1_idx` (`clientes_id` ASC),
CONSTRAINT `fk_facturas_clientes1`
FOREIGN KEY (`clientes_id`)
REFERENCES `mydb`.`clientes` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`productos`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`productos` (
`id` INT NOT NULL COMMENT ' ',
`nombre` VARCHAR(45) NOT NULL COMMENT ' ',
`precio` INT NOT NULL,
`descripcion` VARCHAR(45) NULL,
`facturas_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `fk_productos_facturas_idx` (`facturas_id` ASC),
CONSTRAINT `fk_productos_facturas`
FOREIGN KEY (`facturas_id`)
REFERENCES `mydb`.`facturas` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
1651a87f7d6b0a1bcd29322479aa208c5bf303c9 | SQL | Lagosa/TutorUp | /resources/db/migration/V2_5__create_separate_table_with_dates.sql | UTF-8 | 942 | 3.578125 | 4 | [] | no_license | DELETE FROM tutor_offers;
ALTER TABLE tutor_offers DROP COLUMN dateFrom;
ALTER TABLE tutor_offers DROP COLUMN dateTo;
ALTER TABLE tutor_offers DROP COLUMN parentOfferID;
ALTER TABLE tutor_offers DROP COLUMN inSeriesNumber;
CREATE TABLE tutor_offers_dates
(
dateId bigserial NOT NULL,
offerId int NOT NULL,
dateFrom DATE NOT NULL,
dateTo DATE NOT NULL,
hourFrom TIME(7) NOT NULL,
hourTo TIME(7) NOT NULL,
status varchar(50) NOT NULL DEFAULT('ACTIVE')
);
ALTER TABLE tutor_offers_dates ADD CONSTRAINT tutor_offers_dates_offerId_fk FOREIGN KEY(offerId) REFERENCES tutor_offers(offerid);
CREATE INDEX tutor_offers_dates_offerId_idx ON tutor_offers_dates(offerId);
CREATE INDEX tutor_offers_dates_dateFrom_idx ON tutor_offers_dates(dateFrom);
CREATE INDEX tutor_offers_dates_dateTo_idx ON tutor_offers_dates(dateTo);
CREATE INDEX tutor_offers_dates_status_idx ON tutor_offers_dates(status); | true |
b1f885b16370738b3c2f35dfcf4ff4324b385152 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day21/select0816.sql | UTF-8 | 405 | 3.5 | 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-20T08:16:00Z' AND timestamp<'2017-11-21T08:16:00Z' AND SENSOR_ID = ANY(array['3141_clwa_1500','3146_clwa_6029','wemo_03','3141_clwa_1100','3141_clwa_1427'])
GROUP BY sensor_id, date_trunc('day', timestamp)) AS obs
GROUP BY sensor_id
| true |
6d7bd417435ec93489a6f9d48aefce987b829d3b | SQL | BiserHristov/SoftUni | /05. C# DataBase/01. MS SQL/EXAM_MS SQL/01.sql | UTF-8 | 1,082 | 3.53125 | 4 | [
"MIT"
] | permissive | --CREATE DATABASE Bitbucket
CREATE TABLE Users
(
Id INT PRIMARY KEY IDENTITY,
Username VARCHAR(30) NOT NULL,
[Password] VARCHAR(30) NOT NULL,
Email VARCHAR(50) NOT NULL
)
CREATE TABLE Repositories
(
Id INT PRIMARY KEY IDENTITY,
[Name] VARCHAR(50) NOT NULL
)
CREATE TABLE RepositoriesContributors
(
RepositoryId INT REFERENCES Repositories(Id) NOT NULL,
ContributorId INT REFERENCES Users(Id) NOT NULL,
PRIMARY KEY(RepositoryId, ContributorId)
)
CREATE TABLE Issues
(
Id INT PRIMARY KEY IDENTITY,
Title VARCHAR(255) NOT NULL,
IssueStatus CHAR(6) NOT NULL,
RepositoryId INT REFERENCES Repositories(Id) NOT NULL,
AssigneeId INT REFERENCES Users(Id) NOT NULL
)
CREATE TABLE Commits
(
Id INT PRIMARY KEY IDENTITY,
[Message] VARCHAR(255) NOT NULL,
IssueId INT REFERENCES Issues(Id),
RepositoryId INT REFERENCES Repositories(Id) NOT NULL,
ContributorId INT REFERENCES Users(Id) NOT NULL
)
CREATE TABLE Files
(
Id INT PRIMARY KEY IDENTITY,
[Name] VARCHAR(100) NOT NULL,
Size DECIMAL(18,2) NOT NULL,
ParentId INT REFERENCES Files(Id),
CommitId INT REFERENCES Commits(Id) NOT NULL
) | true |
9d80be63161d04988f5a50729f0eb6cb2337d75f | SQL | valverdethiago/trading-api | /db/query/account.sql | UTF-8 | 495 | 3.515625 | 4 | [
"MIT"
] | permissive | -- name: GetAccountByUsername :one
SELECT *
FROM account
WHERE username = $1;
-- name: GetAccountById :one
SELECT *
FROM account
WHERE account_uuid = $1;
-- name: ListAccounts :many
SELECT *
FROM account
ORDER BY created_date;
-- name: CreateAccount :one
INSERT INTO account (username, email)
VALUES ($1, $2)
RETURNING *;
-- name: UpdateAccount :one
UPDATE account
SET username = $1,
email = $2,
updated_date = now()
WHERE account_uuid = $3
RETURNING *; | true |
8eecc3a360ed9233050d53072cfc57f7b661fa76 | SQL | sandroalvesperes/chat | /docs/tables.sql | UTF-8 | 6,088 | 3.796875 | 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';
SET NAMES UTF8 COLLATE utf8_general_ci;
-- -----------------------------------------------------
-- Table `support_user`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `support_user` ;
CREATE TABLE IF NOT EXISTS `support_user` (
`id_support_user` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(50) NOT NULL ,
`sex` ENUM('M','F') NOT NULL ,
`email` VARCHAR(120) NOT NULL ,
`password` CHAR(32) CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL COMMENT 'MD5' ,
`last_activity` DATETIME NULL ,
`typing` BIT NOT NULL DEFAULT 0 ,
`online` BIT NOT NULL DEFAULT 0 ,
`active` BIT NOT NULL DEFAULT 1 ,
PRIMARY KEY (`id_support_user`) )
ENGINE = InnoDB;
CREATE UNIQUE INDEX `uq_user_email` ON `support_user` (`email` ASC) ;
-- -----------------------------------------------------
-- Table `client_user`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `client_user` ;
CREATE TABLE IF NOT EXISTS `client_user` (
`id_client_user` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(60) NOT NULL ,
`email` VARCHAR(120) NOT NULL ,
`sex` ENUM('M','F') NOT NULL ,
`last_activity` DATETIME NOT NULL ,
`typing` BIT NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id_client_user`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `chat`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `chat` ;
CREATE TABLE IF NOT EXISTS `chat` (
`id_chat` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`id_client_user` INT UNSIGNED NOT NULL ,
`id_support_user` SMALLINT UNSIGNED NULL ,
`subject` VARCHAR(45) NOT NULL ,
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`closed` DATETIME NULL ,
`closed_by` ENUM('Support','Client','System') NULL ,
`rate` TINYINT UNSIGNED NULL COMMENT '1 to 5' ,
PRIMARY KEY (`id_chat`) ,
FOREIGN KEY (`id_client_user` )
REFERENCES `client_user` (`id_client_user` )
ON DELETE RESTRICT
ON UPDATE RESTRICT,
FOREIGN KEY (`id_support_user` )
REFERENCES `support_user` (`id_support_user` )
ON DELETE RESTRICT
ON UPDATE RESTRICT)
ENGINE = InnoDB;
CREATE INDEX `fk_chat_client_user1` ON `chat` (`id_client_user` ASC) ;
CREATE INDEX `fk_chat_support_user1` ON `chat` (`id_support_user` ASC) ;
-- -----------------------------------------------------
-- Table `chat_message`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `chat_message` ;
CREATE TABLE IF NOT EXISTS `chat_message` (
`id_chat_message` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`id_chat` BIGINT UNSIGNED NOT NULL ,
`sent_by` ENUM('Support', 'Client') NOT NULL ,
`sent_by_id` INT UNSIGNED NOT NULL ,
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`message` TEXT NOT NULL ,
PRIMARY KEY (`id_chat_message`) ,
FOREIGN KEY (`id_chat` )
REFERENCES `chat` (`id_chat` )
ON DELETE RESTRICT
ON UPDATE RESTRICT)
ENGINE = InnoDB;
CREATE INDEX `fk_chat_message_chat1` ON `chat_message` (`id_chat` ASC) ;
-- -----------------------------------------------------
-- Table `param`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `param` ;
CREATE TABLE IF NOT EXISTS `param` (
`id_param` TINYINT ZEROFILL NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(20) NOT NULL ,
`value` VARCHAR(120) NOT NULL ,
`description` TEXT NULL ,
PRIMARY KEY (`id_param`) )
ENGINE = MyISAM;
CREATE UNIQUE INDEX `un_param_name` ON `param` (`name` ASC) ;
-- -----------------------------------------------------
-- Table `support_user_access`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `support_user_access` ;
CREATE TABLE IF NOT EXISTS `support_user_access` (
`id_support_user` SMALLINT UNSIGNED NOT NULL ,
`maintain_user` BIT NOT NULL DEFAULT 0 ,
`support_status` BIT NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id_support_user`) ,
FOREIGN KEY (`id_support_user` )
REFERENCES `support_user` (`id_support_user` )
ON DELETE RESTRICT
ON UPDATE RESTRICT)
ENGINE = InnoDB;
CREATE INDEX `fk_support_user_access_support_user1` ON `support_user_access` (`id_support_user` ASC) ;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-- -----------------------------------------------------
-- Data for table `support_user`
-- -----------------------------------------------------
SET AUTOCOMMIT=0;
INSERT INTO `support_user` (`id_support_user`, `name`, `sex`, `email`, `password`, `last_activity`, `typing`, `online`, `active`) VALUES (null, 'Admin', 'M', 'your.email@yourhost.com.br', '81dc9bdb52d04dc20036dbd8313ed055', NOW(), 0, 0, 1);
COMMIT;
-- -----------------------------------------------------
-- Data for table `param`
-- -----------------------------------------------------
SET AUTOCOMMIT=0;
INSERT INTO `param` (`id_param`, `name`, `value`, `description`) VALUES (null, 'STATUS', '0', 'support status (0 or 1)');
INSERT INTO `param` (`id_param`, `name`, `value`, `description`) VALUES (null, 'EMAIL', 'you_email@your_host.com', 'this is the e-mail that will be used to receive the messages from the clients');
INSERT INTO `param` (`id_param`, `name`, `value`, `description`) VALUES (null, 'WAITING_TOO_MUCH', '7', 'this is to highlight the client when the he is waiting to much to receive support. The time is in minutes');
INSERT INTO `param` (`id_param`, `name`, `value`, `description`) VALUES (null, 'SET_OFFLINE_IN', '60', 'if the support has no activity for a time that exceeds this parameter, the user will be turned offline automatically. This time is in minutes');
COMMIT;
-- -----------------------------------------------------
-- Data for table `support_user_access`
-- -----------------------------------------------------
SET AUTOCOMMIT=0;
INSERT INTO `support_user_access` (`id_support_user`, `maintain_user`, `support_status`) VALUES (1, 1, 1);
COMMIT; | true |
6d364629ba05663304332672b5a04de5e508607a | SQL | rnz269/bamazon | /bamazon.sql | UTF-8 | 801 | 3.140625 | 3 | [] | no_license | CREATE DATABASE bamazon_db;
USE bamazon_db;
CREATE TABLE products (
item_id INTEGER(11)AUTO_INCREMENT NOT NULL,
product_name VARCHAR(30) NOT NULL,
department_name VARCHAR(30),
price INTEGER(11),
stock_quantity INTEGER(11),
PRIMARY KEY (item_id)
);
INSERT INTO products
(product_name, department_name, price, stock_quantity) values
("running shoes", "footwear", 100, 15),
("apple watch", "technology", 300, 25),
("iPad Air", "technology", 400, 50),
("echo dot", "technology", 50, 1000),
("protein powder", "nutrition", 40, 100),
("Astrophysics", "books", 10, 20),
("fruit loops", "food", 5, 100),
("shaving blades", "grooming", 20, 200),
("quest bars", "nutrition", 100, 100),
("light bulbs", "utilities", 10, 250);
SELECT * FROM products;
| true |
34b7b1247851aec43ffd0fb4e97df7bcbec1fc3a | SQL | LonelehKitten/Marketplace | /update.sql | UTF-8 | 560 | 2.546875 | 3 | [] | no_license | -- Mudar status do Produto 1
UPDATE unidade SET status='Nao disponivel' WHERE anuncioID=1;
-- Mudar endereço do ID 1
UPDATE usuario SET endereco='Alguma rua, 101' WHERE id=2;
-- Mudar status do Pedido para Aprovada
UPDATE pedido SET status='Aprovada',dataAprovacao='2020-06-09 21:53:00' WHERE id=1;
-- Mudar status do Pedido para Cancelado
UPDATE pedido SET status='Cancelada',dataPedidoDevolucao=CURRENT_TIMESTAMP(0) WHERE id=1;
-- Mudar status do Pedido para Concluido
UPDATE pedido SET status='Concluido',dataConclusao=CURRENT_TIMESTAMP(0) WHERE id=1;
| true |
286634d5b25347c92dd8c6bbd8a0474f9eef5d24 | SQL | martandsingh/dubhold | /sql-assessment_final_sub.sql | WINDOWS-1252 | 4,490 | 4.25 | 4 | [] | no_license | ---- CASE STUDY 1: -----------
-- Sellers table
CREATE TABLE sellers
(
id INTEGER PRIMARY KEY IDENTITY(1,1),
[name] VARCHAR(30) NOT NULL,
rating INTEGER NOT NULL
)
-- items table
CREATE TABLE items
(
id INTEGER PRIMARY KEY IDENTITY(1,1),
[name] VARCHAR(30) NOT NULL,
sellerId INTEGER REFERENCES sellers(id)
)
-- INSERT VALUES IN Sellers
INSERT INTO sellers
VALUES
('seller A', 5),
('seller B', 5),
('seller C', 5),
('seller D', 3),
('seller E', 2.7)
-- INSERT VALUES IN ITEMS
INSERT INTO items
VALUES
('item A', 1),
('item B', 2),
('item C', 1),
('item D', 3),
('item E', 4),
('item F', 5),
('item G', 5)
SELECT * FROM items
SELECT * FROM sellers
/*
: Write a query that selects the item name and the name of its seller for each item that belongs to a seller with a rating greater than 4.
The query should return the name of the item as the first column and name of the seller as the second column
*/
SELECT i.name AS ItemName, s.name AS SellerName
FROM items i
INNER JOIN sellers s
ON i.sellerId = s.id
WHERE s.rating > 4
----------CASE STUDY 2-----------------------------------------------------------
CREATE TABLE employees
(
id INTEGER NOT NULL PRIMARY KEY,
managerId INTEGER REFERENCES employees(id),
[name] VARCHAR(30) NOT NULL
)
INSERT INTO employees
VALUES
(1, NULL, 'Emp 1'),
(2, NULL, 'Emp 2'),
(3, 1, 'Emp 3'),
(4, 1, 'Emp 4'),
(5, 2, 'Emp 5'),
(6, NULL, 'Emp 6')
select * FROM employees
/*
Q: Write a query that selects only the names of employees who are not managers.
*/
SELECT emp.name FROM employees emp
WHERE emp.id NOT IN (
SELECT DISTINCT
man.managerId
FROM employees man
WHERE man.managerId IS NOT NULL
)
----CASE STUDY 3----------------------------------------------------------
-- As we already have a employee table for case study 2, so i am dropping that table first
drop table if exists employees
CREATE TABLE regions(
id INTEGER PRIMARY KEY IDENTITY(1,1),
name VARCHAR(50) NOT NULL
)
INSERT INTO regions
(name)
VALUES
('region 1'),
('region 2'),
('region 3'),
('region 4'),
('region 5'),
('region 6'),
('region 7')
CREATE TABLE states(
id INTEGER PRIMARY KEY IDENTITY(1,1),
name VARCHAR(50) NOT NULL,
regionId INTEGER NOT NULL REFERENCES regions(id)
)
INSERT INTO states
(name, regionId)
VALUES
('state 1', 1),
('state 2', 1),
('state 3', 2),
('state 4', 3),
('state 5', 3),
('state 6', 5),
('state 6', 4),
('state 6', 6),
('state 6', 7)
CREATE TABLE employees(
id INTEGER PRIMARY KEY IDENTITY(1,1),
name VARCHAR(50) NOT NULL,
stateId INTEGER NOT NULL REFERENCES states(id)
)
INSERT INTO employees
(name, stateId)
VALUES
('Emp 1', 1),
('Emp 2', 1),
('Emp 3', 2),
('Emp 4', 2),
('Emp 5', 3),
('Emp 6', 4),
('Emp 7', 5),
('Emp 8', 6)
CREATE TABLE sales(
id INTEGER PRIMARY KEY IDENTITY(1,1),
amount INTEGER NOT NULL,
employeeId INTEGER NOT NULL REFERENCES employees(id)
)
INSERT INTO sales
(amount, employeeid)
VALUES
(20000, 1),
(26000, 1),
(40000, 2),
(10000, 2),
(24000, 3),
(26400, 4),
(27600, 5),
(78600, 6),
(26800, 7),
(29800, 8)
/*
Management requires a comparative region sales analysis report. Write a query that returns:
The region name.
Average sales per employee for the region (Average sales = Total sales made for the region / Number of employees in the region).
The difference between the average sales of the region with the highest average sales, and the average sales per employee for the region (average sales to be calculated as explained above).
Employees can have multiple sales. A region with no sales should be also returned. Use 0 for average sales per employee for such a region when calculating the 2nd and the 3rd column.
*/
select * from regions
select * from states
select * from employees
select * from sales
-- drop table sales
-- drop table employees
-- drop table states
-- drop table regions
with sales_final AS (
select r.name as region,
case when sum(isnull(s.amount,0)) = 0 then 0
else sum(isnull(s.amount,0))/count(distinct e.id) end as average
from regions r
left join states st on r.id = st.regionid
left join employees e on st.id = e.stateid
left join sales s on e.id = s.employeeid
group by r.id, r.name)
select region, average
, (select max(average) from sales_final) - average as diff
from sales_final
-- FINISH | true |
cd8a6d9bc361f87d00b35fc1a620caeb7c189a84 | SQL | c1-ra/encheres | /SQL Database/3_Peuplement pour tests.sql | ISO-8859-1 | 3,947 | 2.859375 | 3 | [] | no_license | /* ETATS_VENTE */
INSERT INTO ETATS_VENTE VALUES('Cre');
INSERT INTO ETATS_VENTE VALUES('En cours');
INSERT INTO ETATS_VENTE VALUES('Termine');
INSERT INTO ETATS_VENTE VALUES('Retire');
/* CATEGORIES */
INSERT INTO CATEGORIES VALUES('Ameublement');
INSERT INTO CATEGORIES VALUES('Informatique');
INSERT INTO CATEGORIES VALUES('Sport&Loisirs');
INSERT INTO CATEGORIES VALUES('Vetement');
/* UTILISATEURS */
INSERT INTO UTILISATEURS VALUES('pseudo1', 'nom1', 'prenom1', 'mail1@mail.fr', '0000000000', '0 rue truc', '00000', 'ville1', 'mdp1', 75, 0);
INSERT INTO UTILISATEURS (pseudo, nom, prenom, email, telephone, rue, code_postal, ville, mot_de_passe) VALUES ('pseudo2', 'nom2', 'prenom2', 'mail2@mail.fr', '0000000002', '2 rue truc', '20000', 'ville2', 'mdp2');
INSERT INTO UTILISATEURS VALUES('pseudo3', 'nom3', 'prenom3', 'mail3@mail.fr', '0000030000', '3 rue truc', '03000', 'ville3', 'mdp3', 128, 0);
INSERT INTO UTILISATEURS VALUES('pseudo4', 'nom4', 'prenom4', 'mail4@mail.fr', '0000040000', '4 rue truc', '04000', 'ville4', 'mdp4', 1122, 0);
/* ARTICLES */
INSERT INTO ARTICLES VALUES('bureau', 'desc', GETDATE()-7, GETDATE()+8, 7, 0, 2, 1);
INSERT INTO ARTICLES VALUES('tlphone', 'desc', GETDATE()-9, GETDATE()+2, 3, 0, 2, 2);
INSERT INTO ARTICLES VALUES('tapis de sport', 'desc', GETDATE()-2, GETDATE()+10, 525, 0, 1, 3);
INSERT INTO ARTICLES VALUES('pull', 'desc', GETDATE()-3, GETDATE()+20, 1890, 0, 1, 4);
INSERT INTO ARTICLES VALUES('ordinateur', 'desc', GETDATE()-1, GETDATE()+5, 325, 0, 2, 2);
INSERT INTO ARTICLES VALUES('lampe de bureau', 'desc', GETDATE()-1, GETDATE()+5, 32, 0, 3, 1);
INSERT INTO ARTICLES VALUES('bonnet', 'desc', GETDATE()-15, GETDATE()-12, 32, 0, 3, 4);
INSERT INTO ARTICLES VALUES('lecteur mp3', 'desc', GETDATE()+21, GETDATE()+27, 325, 0, 1, 2);
INSERT INTO ARTICLES VALUES('gourde', 'desc', GETDATE()-23, GETDATE()-10, 32, 0, 3, 3);
INSERT INTO ARTICLES VALUES('vlo', 'desc', GETDATE()-22, GETDATE()-12, 32, 0, 1, 3);
INSERT INTO ARTICLES VALUES('briques', 'desc', GETDATE()-22, GETDATE()+12, 0, 10, 3, 3);
INSERT INTO ARTICLES VALUES('commode', 'desc', GETDATE()-9, GETDATE()+2, 3, 0, 3, 1);
/* ENCHERES */
INSERT INTO ENCHERES VALUES (1, 1, GETDATE()-5, 9);
INSERT INTO ENCHERES VALUES (1, 2, GETDATE()-7, 49);
INSERT INTO ENCHERES VALUES (2, 3, GETDATE()-1, 755);
INSERT INTO ENCHERES VALUES (3, 4, GETDATE()-2, 47);
INSERT INTO ENCHERES VALUES (2, 5, GETDATE(), 93);
INSERT INTO ENCHERES VALUES (1, 6, GETDATE(), 97);
INSERT INTO ENCHERES VALUES (3, 1, GETDATE()-4, 77);
INSERT INTO ENCHERES VALUES (1, 2, GETDATE()-5, 53);
INSERT INTO ENCHERES VALUES (1, 7, GETDATE()-14, 53);
INSERT INTO ENCHERES VALUES (2, 7, GETDATE()-13, 55);
INSERT INTO ENCHERES VALUES (1, 7, GETDATE()-12, 88);
INSERT INTO ENCHERES VALUES (1, 9, GETDATE()-15, 109);
INSERT INTO ENCHERES VALUES (2, 9, GETDATE()-12, 567);
INSERT INTO ENCHERES VALUES (2, 10, GETDATE()-20, 875);
INSERT INTO ENCHERES VALUES (3, 10, GETDATE()-15, 1098);
/* RETRAITS */
INSERT INTO RETRAITS VALUES (1, '7 rue de la Fontaine', 'villeDiverse', '75000');
INSERT INTO RETRAITS VALUES (2, '3 avenue Orange', 'villeR', '34982');
INSERT INTO RETRAITS VALUES (3, '8 avenue Machin', 'villeR2', '49034');
INSERT INTO RETRAITS VALUES (4, '8 rue de la Foret', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (5, '9 rue de la Foret', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (6, '10 rue des Petits Champs', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (7, '1 rue des Peupliers', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (8, '2 rue Truc', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (9, '3 place des Coquelicots', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (10, '20 boulevard Magenta', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (11, '12 rue des Bleuets', 'villeR3', '23451');
INSERT INTO RETRAITS VALUES (12, '12 rue des Bleuets', 'villeR4', '23451'); | true |
1f93732b1569dea5d903feca2536c5577a18ddb5 | SQL | ravinduh/DSHS | /resources/dshs.sql | UTF-8 | 6,088 | 3.703125 | 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,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `DSHS` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `DSHS` ;
-- -----------------------------------------------------
-- Table `DSHS`.`student`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`student` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(45) NULL ,
`description` VARCHAR(800) NULL ,
`school` VARCHAR(200) NULL ,
`date_of_birth` DATE NULL ,
`contact_nu` VARCHAR(45) NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`moderator`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`moderator` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(45) NOT NULL ,
`designation` VARCHAR(200) NOT NULL ,
`address` VARCHAR(256) NOT NULL ,
`contact_nu` VARCHAR(45) NOT NULL ,
`email` VARCHAR(128) NULL ,
`nic` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`verify`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`verify` (
`id` INT NOT NULL AUTO_INCREMENT ,
`moderator_id` INT NOT NULL ,
`student_id` INT NOT NULL ,
`verified_date` DATE NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `moderator_id_idx` (`moderator_id` ASC) ,
INDEX `student_id_idx` (`student_id` ASC) ,
CONSTRAINT `fk_verify_moderator1`
FOREIGN KEY (`moderator_id` )
REFERENCES `DSHS`.`moderator` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_verify_student1`
FOREIGN KEY (`student_id` )
REFERENCES `DSHS`.`student` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`refree`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`refree` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(128) NOT NULL ,
`designation` VARCHAR(200) NOT NULL ,
`contact_nu` VARCHAR(45) NULL ,
`nic` VARCHAR(10) NOT NULL ,
`moderator_id` INT NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `moderator_id_idx` (`moderator_id` ASC) ,
CONSTRAINT `fk_refree_moderator1`
FOREIGN KEY (`moderator_id` )
REFERENCES `DSHS`.`moderator` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`guradian`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`guradian` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(128) NOT NULL ,
`occupation` VARCHAR(128) NOT NULL ,
`address` VARCHAR(256) NOT NULL ,
`contact_nu` VARCHAR(45) NOT NULL ,
`student_id` INT NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `student_id_idx` (`student_id` ASC) ,
CONSTRAINT `fk_guardian_student1`
FOREIGN KEY (`student_id` )
REFERENCES `DSHS`.`student` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`requirement`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`requirement` (
`id` INT NOT NULL AUTO_INCREMENT ,
`details` VARCHAR(1000) NOT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`student_has_requirement`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`student_has_requirement` (
`id` INT NOT NULL AUTO_INCREMENT ,
`student_id` INT NOT NULL ,
`requirement_id` INT NOT NULL ,
`moderator_id` INT NOT NULL ,
`donated_date` DATE NULL ,
PRIMARY KEY (`id`) ,
INDEX `requirement_id_idx` (`requirement_id` ASC) ,
INDEX `moderator_id_idx` (`moderator_id` ASC) ,
INDEX `student_id_idx` (`student_id` ASC) ,
CONSTRAINT `fk_student_has_requirement_student1`
FOREIGN KEY (`student_id` )
REFERENCES `DSHS`.`student` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_student_has_requirement_moderator1`
FOREIGN KEY (`moderator_id` )
REFERENCES `DSHS`.`moderator` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_student_has_requirement_requirement1`
FOREIGN KEY (`requirement_id` )
REFERENCES `DSHS`.`requirement` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`donor`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`donor` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(128) NOT NULL ,
`occupation` VARCHAR(128) NULL ,
`address` VARCHAR(256) NOT NULL ,
`contact_nu` VARCHAR(45) NOT NULL ,
`nic` VARCHAR(10) NOT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `DSHS`.`donor_donate_student`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DSHS`.`donor_donate_student` (
`id` INT NOT NULL AUTO_INCREMENT ,
`student_id` INT NOT NULL ,
`donated_date` DATE NOT NULL ,
`details` VARCHAR(500) NULL ,
`donor_id` INT NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `student_id_idx` (`student_id` ASC) ,
INDEX `donor_id_idx` (`donor_id` ASC) ,
CONSTRAINT `fk_donor_donate_student_student1`
FOREIGN KEY (`student_id` )
REFERENCES `DSHS`.`student` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_donor_donate_student_donor1`
FOREIGN KEY (`donor_id` )
REFERENCES `DSHS`.`donor` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
USE `DSHS` ;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
7c5909baa3db1734a3c8dc3778fe05d525b75627 | SQL | mskutlu/bonita-migration | /src/main/resources/version/to_7_3_0/configuration/postgres_.sql | UTF-8 | 356 | 2.796875 | 3 | [] | no_license | CREATE TABLE configuration (
tenant_id INT8 NOT NULL,
content_type VARCHAR(50) NOT NULL,
resource_name VARCHAR(120) NOT NULL,
resource_content BYTEA NOT NULL
);
ALTER TABLE configuration ADD CONSTRAINT pk_configuration PRIMARY KEY (tenant_id, content_type, resource_name);
CREATE INDEX idx_configuration ON configuration (tenant_id, content_type);
| true |
7b56131b22acffa072622d60667da2b307800d6c | SQL | prodigyoff/dbLab4-6 | /src/main/resources/lab3DBScript.sql | UTF-8 | 7,835 | 3.75 | 4 | [] | no_license | CREATE SCHEMA IF NOT EXISTS `kit` ;
USE `kit` ;
DROP TABLE IF EXISTS `advertisment_panel_has_advertisment`;
DROP TABLE IF EXISTS `supermarket_has_section`;
DROP TABLE IF EXISTS `advertisment`;
DROP TABLE IF EXISTS `trade_network_has_supermarket`;
DROP TABLE IF EXISTS `trade_network`;
DROP TABLE IF EXISTS `supermarket`;
DROP TABLE IF EXISTS `house`;
DROP TABLE IF EXISTS `street`;
DROP TABLE IF EXISTS `city`;
DROP TABLE IF EXISTS `advertisment_panel`;
DROP TABLE IF EXISTS `section`;
CREATE TABLE IF NOT EXISTS `section` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE IF NOT EXISTS `advertisment_panel` (
`id` INT NOT NULL AUTO_INCREMENT,
`producer` VARCHAR(30) NOT NULL,
`screen_resolution` VARCHAR(20) NOT NULL,
`consuming_power_amount_in_wats` INT NOT NULL,
`section_id` INT NOT NULL,
`number_of_panels` INT NULL,
PRIMARY KEY (`id`),
INDEX `advertisment_panel_section_idx` (`section_id`));
CREATE TABLE IF NOT EXISTS `city` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE IF NOT EXISTS `street` (
`id` INT NOT NULL AUTO_INCREMENT,
`city_id` INT NOT NULL,
`name` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`),
INDEX `street_city_idx` (`city_id`));
CREATE TABLE IF NOT EXISTS `house` (
`id` INT NOT NULL AUTO_INCREMENT,
`street_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `house_street_idx` (`street_id`));
CREATE TABLE IF NOT EXISTS `supermarket` (
`id` INT NOT NULL AUTO_INCREMENT,
`house_id` INT NOT NULL,
`description` VARCHAR(50) NULL,
`area_size_in_meters` INT NOT NULL,
`work_scheudle_start` TIME NOT NULL,
`work_scheudle_end` TIME NOT NULL,
`average_customers_amount` INT NULL,
FOREIGN KEY (`house_id`) REFERENCES `house`(`id`),
PRIMARY KEY (`id`));
CREATE TABLE IF NOT EXISTS `kit`.`trade_network` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(40) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name_UNIQUE_idx` (`name`));
CREATE TABLE IF NOT EXISTS `trade_network_has_supermarket` (
`id` INT NOT NULL AUTO_INCREMENT,
`trade_network_id` INT NOT NULL,
`supermarket_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `trade-network_has_supermarket_idx` (`supermarket_id`),
INDEX `supermarket_has_trade-network_idx` (`trade_network_id`));
CREATE TABLE IF NOT EXISTS `advertisment` (
`id` INT NOT NULL AUTO_INCREMENT,
`description` VARCHAR(45) NULL,
`producer` VARCHAR(45) NOT NULL,
`duration` TIME NOT NULL,
`trade_network_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `advertisment_trade-network_idx` (`trade_network_id`));
CREATE TABLE IF NOT EXISTS `supermarket_has_section` (
`id` INT NOT NULL AUTO_INCREMENT,
`supermarket_id` INT NOT NULL,
`section_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `supermarket_has_section_idx` (`section_id`),
INDEX `section_has_supermarket_idx` (`supermarket_id`));
CREATE TABLE IF NOT EXISTS `advertisment_panel_has_advertisment` (
`id` INT NOT NULL AUTO_INCREMENT,
`advertisment_panel_id` INT NOT NULL,
`advertisment_id` INT NOT NULL,
PRIMARY KEY (`id`),
INDEX `advertisment_panel_has_advertismentidx` (`advertisment_id`),
INDEX `advertisment_has_advertisment_panel_idx` (`advertisment_panel_id`));
ALTER TABLE `advertisment_panel`
ADD FOREIGN KEY (`section_id`)
REFERENCES `section` (`id`);
ALTER TABLE `trade_network_has_supermarket`
ADD FOREIGN KEY (`trade_network_id`)
REFERENCES `trade_network` (`id`),
ADD FOREIGN KEY (`supermarket_id`)
REFERENCES `supermarket` (`id`);
ALTER TABLE `advertisment`
ADD FOREIGN KEY (`trade_network_id`)
REFERENCES `trade_network` (`id`);
ALTER TABLE `supermarket_has_section`
ADD FOREIGN KEY (`supermarket_id`)
REFERENCES `supermarket` (`id`),
ADD FOREIGN KEY (`section_id`)
REFERENCES `section` (`id`);
ALTER TABLE `advertisment_panel_has_advertisment`
ADD FOREIGN KEY (`advertisment_panel_id`)
REFERENCES `advertisment_panel` (`id`),
ADD FOREIGN KEY (`advertisment_id`)
REFERENCES `advertisment` (`id`);
ALTER TABLE `kit`.`street`
ADD FOREIGN KEY (`city_id`)
REFERENCES `kit`.`city` (`id`);
ALTER TABLE `house`
ADD FOREIGN KEY (`street_id`)
REFERENCES `street` (`id`);
CREATE INDEX section_name_idx ON section(name);
CREATE INDEX city_name_idx ON city(name);
INSERT INTO `section`(`name`)
VALUES ("chuvash"),
("qwe"),
("ok"),
("ya"),
("web"),
("developer"),
("ladno"),
("db"),
("ok"),
("what");
INSERT INTO `advertisment_panel`(`producer`,`screen_resolution`,`consuming_power_amount_in_wats`,
`section_id`,`number_of_panels`)
VALUES ("vlad","1680x1050","250","1","2"),
("dimon","1920x1080","150","2","3"),
("pavlo","1940x1080","350","3","4"),
("osada","1960x1080","450","4","5"),
("poe","1980x1080","170","5","6"),
("not a producer","2000x1080","270","6","7"),
("shavuch","2020x1080","10","7","8"),
("myname","2040x1080","15","8","9"),
("yourname","2060x1080","50","9","10"),
("ourname","2080x1080","1500","10","11");
INSERT INTO `city`(`name`)
VALUES ("lviv"),
("krakiv"),
("kyiv"),
("anothercity"),
("text"),
("bottomtext"),
("uppertext"),
("chuvash"),
("vachush"),
("ok");
INSERT INTO `street`(`city_id`,`name`)
VALUES ("1","st"),
("2","myst"),
("3","chuvash"),
("4","bandery"),
("5","iot"),
("6","marko"),
("7","vlad"),
("8","davl"),
("9","dimon"),
("10","oleg");
INSERT INTO `house`(`street_id`)
VALUES ("1"),
("2"),
("3"),
("4"),
("5"),
("6"),
("7"),
("8"),
("9"),
("10");
INSERT INTO `supermarket`(`house_id`,`description`,`area_size_in_meters`,
`work_scheudle_start`,`work_scheudle_end`,`average_customers_amount`)
VALUES ("1","scription","251","07:30:00","21:30:00","850"),
("2","ok","252","08:30:00","18:30:00","750"),
("3","text","51","07:30:00","17:30:00","950"),
("4","toptext","253","09:30:00","16:30:00","1850"),
("5","bottomtext","254","10:30:00","18:15:00","650"),
("6","middletext","255","09:30:00","22:30:00","550"),
("7","uppertoptext","256","08:30:00","21:30:00","8250"),
("8","upperdowntext","257","07:30:00","16:30:00","2850"),
("9","yourtext","258","07:30:00","15:30:00","3850"),
("10","mytext","259","07:30:00","14:30:00","4850");
INSERT INTO `trade_network`(`name`)
VALUES ("marko"),
("ymnuy"),
("web"),
("developer"),
("anton"),
("toje"),
("ladno"),
("db"),
("pochemy"),
("why");
INSERT INTO `trade_network_has_supermarket`(`trade_network_id`,`supermarket_id`)
VALUES ("1","1"),
("2","2"),
("3","3"),
("4","4"),
("5","5"),
("6","6"),
("7","7"),
("8","8"),
("9","9"),
("10","10");
INSERT INTO `advertisment` (`description`,`producer`,`duration`,`trade_network_id`)
VALUES ("desc","vlad","00:03:00","1"),
("riptions","dimon","00:30:00","2"),
("scription","osada","00:10:00","3"),
("ondescript","pavlo","00:15:00","4"),
("deonscript","chuvash","01:30:00","5"),
("pirsction","roman","00:01:00","6"),
("opetrds","maran","00:02:00","7"),
("whyme","archik","00:02:30","8"),
("mytext","prodigy","00:01:45","9"),
("text","pradyucer","00:05:00","10");
INSERT INTO `supermarket_has_section`(`supermarket_id`,`section_id`)
VALUES ("1","1"),
("2","2"),
("3","3"),
("4","4"),
("5","5"),
("6","6"),
("7","7"),
("8","8"),
("9","9"),
("10","10");
INSERT INTO `advertisment_panel_has_advertisment`(`advertisment_panel_id`,`advertisment_id`)
VALUES ("1","1"),
("2","2"),
("3","3"),
("4","4"),
("5","5"),
("6","6"),
("7","7"),
("8","8"),
("9","9"),
("10","10"); | true |
c3b538843f3c9cc3a13b2c1a9140f2b28cd0e586 | SQL | saphyron/randomstuff | /Databaser og Operativ systemer/Create Relationel Algebra.sql | UTF-8 | 377 | 2.796875 | 3 | [] | no_license | drop table if exists Reserves
drop table if exists Sailors
drop table if exists Boats
create table Sailors(
said int primary key,
sname varchar(20),
rating int,
age int
)
create table Boats(
bid int primary key,
bname varchar(20),
color varchar(10)
)
create table Reserves(
said int FOREIGN KEY REFERENCES sailors(said),
bid int FOREIGN KEY REFERENCES boats(bid),
dag date
)
| true |
18ddea5cdac052cd86cd2588d91827d588df4b57 | SQL | coutinho98/desafio-MDS | /banco de dados/escola.sql | UTF-8 | 3,025 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 28, 2021 at 11:45 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `escola`
--
-- --------------------------------------------------------
--
-- Table structure for table `aluno`
--
CREATE TABLE `aluno` (
`id` int(11) NOT NULL,
`nome` varchar(535) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `aluno`
--
INSERT INTO `aluno` (`id`, `nome`) VALUES
(1, 'Cristiano Ronaldo'),
(2, 'Kurt Cobain'),
(3, 'Albert Einstein');
-- --------------------------------------------------------
--
-- Table structure for table `disciplinas`
--
CREATE TABLE `disciplinas` (
`id` int(11) NOT NULL,
`disciplina` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `disciplinas`
--
INSERT INTO `disciplinas` (`id`, `disciplina`) VALUES
(1, 'Matemática'),
(2, 'Física'),
(3, 'Biologia');
-- --------------------------------------------------------
--
-- Table structure for table `nota`
--
CREATE TABLE `nota` (
`aluno_id` int(11) NOT NULL,
`disciplina_id` int(11) NOT NULL,
`nota` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `nota`
--
INSERT INTO `nota` (`aluno_id`, `disciplina_id`, `nota`) VALUES
(1, 1, 8.5),
(1, 2, 4),
(2, 1, 4),
(2, 2, 7.1),
(3, 1, 5.6),
(3, 2, 4.7);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `aluno`
--
ALTER TABLE `aluno`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `disciplinas`
--
ALTER TABLE `disciplinas`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `nota`
--
ALTER TABLE `nota`
ADD PRIMARY KEY (`aluno_id`,`disciplina_id`),
ADD KEY `fk_disciplina` (`disciplina_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `aluno`
--
ALTER TABLE `aluno`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `disciplinas`
--
ALTER TABLE `disciplinas`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `disciplinas`
--
ALTER TABLE `disciplinas`
ADD CONSTRAINT `teste` FOREIGN KEY (`id`) REFERENCES `aluno` (`id`);
--
-- Constraints for table `nota`
--
ALTER TABLE `nota`
ADD CONSTRAINT `fk_aluno` FOREIGN KEY (`aluno_id`) REFERENCES `aluno` (`id`),
ADD CONSTRAINT `fk_disciplina` FOREIGN KEY (`disciplina_id`) REFERENCES `disciplinas` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
abc850715cf1d8583557ee5b90c7bdbfcd552e6e | SQL | RTejos73/tareasCodingDojo | /MySQL/normalizacion/JOIN.sql | UTF-8 | 909 | 3.6875 | 4 | [] | no_license | use lead_gen_business;
SELECT c.first_name, c.last_name, b.amount, b.charged_datetime FROM clients c
JOIN billing b on c.id = b.id;
SELECT s.domain_name, l.first_name, l.last_name FROM sites s
JOIN leads l ON s.id = l.id;
SELECT c.first_name AS cients_first, c.last_name AS clients_last, s.domain_name, l.first_name AS leads_first
FROM clients c
JOIN sites s ON s.id = c.id
JOIN leads l ON l.id = s.id;
SELECT c.first_name, c.last_name, s.domain_name FROM clients c
LEFT JOIN sites s ON c.id = s.id;
SELECT c.first_name, c.last_name, sum(b.amount) AS suma FROM clients c
JOIN billing b ON c.id = b.id
GROUP BY c.id;
SELECT group_concat(' ', s.domain_name) , c.first_name, c.last_name FROM clients c
JOIN sites s ON c.id = s.clients_id
GROUP BY c.id;
SELECT count(l.id) as cant, s.domain_name FROM sites s
JOIN leads l ON s.id = l.sites_id
GROUP BY s.id;
select * from sites order by clients_id; | true |
e044303bc36e89d93eee580f8821e1ccde599676 | SQL | ingridfc28/estudos-git | /Juntando+consultas.sql | UTF-8 | 1,817 | 3.203125 | 3 | [] | no_license |
SELECT DISTINCT [TABELA DE CLIENTES].BAIRRO FROM [TABELA DE CLIENTES]
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].BAIRRO FROM [TABELA DE CLIENTES]
UNION
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].BAIRRO FROM [TABELA DE CLIENTES]
UNION ALL
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].[BAIRRO], [TABELA DE CLIENTES].[DATA DE NASCIMENTO] FROM [TABELA DE CLIENTES]
UNION ALL
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO, [TABELA DE VENDEDORES].[NOME] FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].[BAIRRO], [TABELA DE CLIENTES].[NOME] FROM [TABELA DE CLIENTES]
UNION ALL
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO, [TABELA DE VENDEDORES].[NOME] FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].[BAIRRO], [TABELA DE CLIENTES].[NOME], 'CLIENTE' FROM [TABELA DE CLIENTES]
UNION ALL
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO, [TABELA DE VENDEDORES].[NOME], 'VENDEDOR' FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].BAIRRO FROM [TABELA DE CLIENTES]
UNION
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO FROM [TABELA DE VENDEDORES]
SELECT DISTINCT [TABELA DE CLIENTES].[BAIRRO], [TABELA DE CLIENTES].[NOME], 'CLIENTE' FROM [TABELA DE CLIENTES]
UNION ALL
SELECT DISTINCT [TABELA DE VENDEDORES].BAIRRO, [TABELA DE VENDEDORES].[NOME], 'VENDEDOR' FROM [TABELA DE VENDEDORES]
-- utlizando UNION ALL e comitando no github
SELECT DISTINCT [TABELA DE CLIENTES].NOME FROM [TABELA DE CLIENTES]
LEFT JOIN
SELECT DISTINCT
wHERE [TABELA DE PRODUTOS].[CODIGO DO PRODUTO] FROM [TABELA DE PRODUTOS] = [TABELA DE PRODUTOS].SABOR
-- CODIGO ERRADO NAO FUNCIONA.
| true |
03866a3870e10ffcd88448d0bf2ffa6f1e787bfd | SQL | Learsix1/Laboratorio-BD | /Practica5.sql | ISO-8859-1 | 7,908 | 3.171875 | 3 | [] | no_license | use practica1
insert into Alumnos values (1,'Andres', 'Hernandez', 'Yaez')
insert into Alumnos values (2,'Carlos', 'Hernandez', 'Perez')
insert into Alumnos values (3,'Brayan', 'Fernandez', 'Flores')
insert into Alumnos values (4,'Blanca', 'Pea', 'Ruiz')
insert into Alumnos values (5,'Reyna', 'Alanis', 'Gomez')
insert into Alumnos values (6,'Veronica', 'Castro', 'Trujillo')
insert into Alumnos values (7,'Everardo', 'Ruiz', 'Castellan')
insert into Alumnos values (8,'Brandon', 'Rivas', 'Cordoba')
insert into Alumnos values (9,'Javier', 'Hernandez', 'Snow')
insert into Alumnos values (10,'Anastacio', 'Figueroa', 'Targaryen')
insert into Alumnos values (11,'Paulo', 'Flores', 'Stark')
UPDATE Alumnos
SET id_alumnos = 1669625
WHERE nombre = 'Andres' AND apellido_paterno = 'Hernandez';
DELETE FROM Alumnos
WHERE id_alumnos = 11;
select * from Alumnos
insert into Maestro values (1,'Pepe', 'Hernandez', 'Oroa')
insert into Maestro values (2,'Miguel', 'Fernandez', 'Nieto')
insert into Maestro values (3,'Raul', 'Perez', 'Fox')
insert into Maestro values (4,'Hector', 'Silva', 'Salinas')
insert into Maestro values (5,'Brandon', 'Davila', 'Rios')
insert into Maestro values (6,'Pablo', 'Hernandez', 'Reyes')
insert into Maestro values (7,'Juan', 'Hernandez', 'Hernandez')
insert into Maestro values (8,'Saul', 'Seanz', 'Cerda')
insert into Maestro values (9,'Laura', 'Yaez', 'Flores')
insert into Maestro values (10,'Sofia', 'Guzman', 'Lopez')
insert into Maestro values (11,'Alejandra', 'Guzman', 'Ruiz')
UPDATE Maestro
SET id_maestro = 5685457
WHERE id_maestro = 1;
DELETE FROM Maestro
WHERE id_maestro = 11;
select * from Maestro
insert into Empleado values (1, 'Juan', 'Perez', 'Cerda', '10/02/2017')
insert into Empleado values (2, 'Eber', 'Hernandez', 'Magaa', '20/12/2015')
insert into Empleado values (3, 'Eduardo', 'Herrera','Rey', '30/03/2014')
insert into Empleado values (4, 'Sergio', 'Perez','Hernandez', '16/07/2015')
insert into Empleado values (5, 'Luis', 'Perez','Herrera', '16/08/2017')
insert into Empleado values (6, 'Raul', 'Gomez','Monsivaes', '14/04/2012')
insert into Empleado values (7, 'Miguel', 'Bose','Reyna', '10/02/2017')
insert into Empleado values (8, 'Felipe', 'Reina','Canseco', '10/02/2017')
insert into Empleado values (9, 'Juan', 'Manuel','Perez', '10/02/2017')
insert into Empleado values (10, 'Andres', 'Hernandez','Lopez', '10/02/2017')
insert into Empleado values (11, 'Jesus', 'Padilla','Saul', '10/02/2017')
UPDATE Empleado
SET id_empleado = 525454
WHERE id_empleado = 1;
DELETE FROM Empleado
WHERE id_empleado = 11;
select * from Empleado
insert into Facultad values (1, 'Facultad de ciencias fisico matematicas')
insert into Facultad values (2, 'Facultad de musica')
insert into Facultad values (3, 'Facultad de medicina')
insert into Facultad values (4, 'Facultad de derecho')
insert into Facultad values (5, 'Facultad de arquitectura')
insert into Facultad values (6, 'Facultad de artes visuales')
insert into Facultad values (7, 'Facultad de ingenieria civil')
insert into Facultad values (8, 'Facultad de agronomia')
insert into Facultad values (9, 'Facultad de ciencias quimicas')
insert into Facultad values (10, 'Facultad de ciencias biologicas')
insert into Facultad values (11, 'Facultad de economia')
UPDATE Facultad
SET id_facultad = 656454
WHERE id_facultad = 1;
DELETE FROM Facultad
WHERE id_facultad = 11;
select * from Facultad
insert into Carrera values (1, 'Licenciatura en Matemticas')
insert into Carrera values (2, 'Licenciatura en Fisica')
insert into Carrera values (3, 'Licenciatura en Economia')
insert into Carrera values (4, 'Licenciatura en Artes Visuales')
insert into Carrera values (5, 'Licenciatura en Acturia')
insert into Carrera values (6, 'Licenciatura en Ciencias Computacionales')
insert into Carrera values (7, 'Licenciatura en Agronomia')
insert into Carrera values (8, 'Licenciatura en Derecho')
insert into Carrera values (9, 'Licenciatura en Criminologia')
insert into Carrera values (10, 'Licenciatura en Diseo Industrial')
insert into Carrera values (11, 'Ingeniero Civil')
UPDATE Carrera
SET id_carrera = 15214
WHERE id_carrera = 1;
DELETE FROM Carrera
WHERE nombre_carrera = 'Ingeniero Civil'
select * from Carrera
insert into Materia values (1, 'Algebra')
insert into Materia values (2, 'Calculo Diferencias')
insert into Materia values (3, 'Fisica')
insert into Materia values (4, 'Competencia Comunicativa')
insert into Materia values (5, 'Programacion orientada a objetos')
insert into Materia values (6, 'Ambiente y Sustentabilidad')
insert into Materia values (7, 'Base de Datos')
insert into Materia values (8, 'Telecomunicaciones')
insert into Materia values (9, 'Calculo Integral')
insert into Materia values (10, 'Algebra Lineal')
insert into Materia values (11, 'Derecho Informatico')
UPDATE Materia
SET id_materia = 52648
WHERE id_materia = 1;
DELETE FROM Materia
WHERE nombre_materia = 'Derecho Informatico';
select * from Materia
insert into Departamento values (1, 'Becas')
insert into Departamento values (2, 'Escolar')
insert into Departamento values (3, 'Tesoreria')
insert into Departamento values (4, 'Soporte Tecnico')
insert into Departamento values (5, 'Limpieza')
insert into Departamento values (6, 'Sub Direccion')
insert into Departamento values (7, 'Direccion')
insert into Departamento values (8, 'Coordinacion Academica')
insert into Departamento values (9, 'Deportes')
insert into Departamento values (10, 'Sociedad de Alumnos')
insert into Departamento values (11, 'Desarrollo Sustentable')
UPDATE Departamento
SET id_departamento = 526
WHERE id_departamento = 1;
DELETE FROM Departamento
WHERE id_departamento = 11;
select * from Departamento
insert into Calificacion values (1,100, 78)
insert into Calificacion values (2,80, 80)
insert into Calificacion values (3,75, 100)
insert into Calificacion values (4,96, 50)
insert into Calificacion values (5,70, 41)
insert into Calificacion values (6,80, 65)
insert into Calificacion values (7,90, 77)
insert into Calificacion values (8,95, 45)
insert into Calificacion values (9,65, 50)
insert into Calificacion values (10,80, 65)
insert into Calificacion values (11,75, 50)
UPDATE Calificacion
SET parcial_2= 70
WHERE parcial_2 = 41;
DELETE FROM Calificacion
WHERE id_calificacion = 11;
select * from Calificacion
insert into Becarios values (1,'Andres', 'Hernandez', 'Sanchez')
insert into Becarios values (2,'Carlos', 'Hernandez', 'Flores')
insert into Becarios values (3,'Brayan', 'Fernandez', 'Gomez')
insert into Becarios values (4,'Blanca', 'Pea', 'Herrera')
insert into Becarios values (5,'Reyna', 'Alanis', 'Leon')
insert into Becarios values (6,'Veronica', 'Castro', 'Lennin')
insert into Becarios values (7,'Everardo', 'Ruis', 'Stalin')
insert into Becarios values (8,'Brandon', 'Rivas', 'Stark')
insert into Becarios values (9,'Javier', 'Hernandez', 'Flores')
insert into Becarios values (10,'Anastacio', 'Figueroa', 'Figueroa')
insert into Becarios values (11,'Paulo', 'Flores', 'Havok')
UPDATE Becarios
SET id_becario = 20265
WHERE nombre = 'Andres'
AND apellido_paterno = 'Hernandez';
DELETE FROM Becarios
WHERE id_becario = 11;
select * from Becarios
insert into Grupo values (1)
insert into Grupo values (2)
insert into Grupo values (3)
insert into Grupo values (4)
insert into Grupo values (5)
insert into Grupo values (6)
insert into Grupo values (7)
insert into Grupo values (8)
insert into Grupo values (9)
insert into Grupo values (10)
insert into Grupo values (11)
UPDATE Grupo
SET id_grupo = 7
WHERE id_grupo = 10;
DELETE FROM Grupo
WHERE id_grupo = 15;
select * from Grupo | true |
0103a25323f1717c629e37458a67194190a362c6 | SQL | darrylma/FSND_Tournament_Database | /tournament.sql | UTF-8 | 1,691 | 4.625 | 5 | [] | no_license | -- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.
DROP DATABASE IF EXISTS tournament;
CREATE DATABASE tournament;
\c tournament
DROP VIEW IF EXISTS standings;
DROP VIEW IF EXISTS match_count;
DROP VIEW IF EXISTS win_count;
DROP TABLE IF EXISTS matches;
DROP TABLE IF EXISTS players;
CREATE TABLE players (player_id SERIAL PRIMARY KEY,
name TEXT);
CREATE TABLE matches (match_id SERIAL PRIMARY KEY,
winner INT REFERENCES players (player_id) ON DELETE CASCADE,
loser INT REFERENCES players (player_id) ON DELETE CASCADE
CHECK (winner <> loser));
-- Keeps track of number of wins per player
CREATE VIEW win_count AS
SELECT player_id, name, count(matches.winner) AS wins
FROM players LEFT JOIN matches
ON players.player_id = matches.winner
GROUP BY players.player_id;
-- Keeps track of number of matches per player
CREATE VIEW match_count AS
SELECT player_id, name, count(matches.match_id) AS matches
FROM players LEFT JOIN matches
ON (players.player_id = matches.winner
OR players.player_id = matches.loser)
GROUP BY players.player_id;
-- Displays number of wins and matches per player ranked by total number of wins
CREATE VIEW standings AS
SELECT win_count.player_id, win_count.name, win_count.wins, match_count.matches
FROM win_count JOIN match_count
ON win_count.player_id = match_count.player_id
ORDER BY win_count.wins DESC;
| true |
ba6926b9612dc3b65223539fbc4c88b007258e4d | SQL | linyimeng/novice | /novice/directsales/psql/推荐奖检查.sql | UTF-8 | 314 | 2.59375 | 3 | [] | no_license | select * from awards_directpush(5,1000)
select directpushuser_id
from public.directsales_doubletrack where id = 5;
select identity_id from public.directsales_doubletrack as dd where dd.id = 1;
select da.percentage from public.directsales_awards as da where da.memberlevel_id = 4 and da.keyword='directpush' | true |
0c3cbe459438b8116fb25b184e4e1305a7bf6340 | SQL | grayasm/git-main | /tutorial/postgresql_11.1_doc/08_data_types/06.0_boolean.sql | UTF-8 | 1,389 | 3.40625 | 3 | [] | no_license | /* Cap.8 Data Types
8.5 Boolean Type
psql -d mytestdb -U pgmihai
\i 06.0_boolean.sql
\?
\qecho '\033[2J'
*/
/* PostgreSQL provides the standard SQL type boolean.
It can have 3 states: "true", "false" and "unknown" or SQL null value.
Valid literals for "true": TRUE, 't', 'true', 'y', 'yes', 'on', '1'
Valid literals for "false": FALSE, 'f', 'false', 'n', 'no', 'off', '0'
*/
DROP TABLE IF EXISTS booleant CASCADE;
CREATE TABLE booleant (id SERIAL, bv boolean, tv TEXT);
INSERT INTO booleant (bv, tv) VALUES
(TRUE, 'sic est'),
('t', 'sic est'),
('true', 'sic est'),
('y', 'sic est'),
('yes', 'sic est'),
('on', 'sic est'),
('1', 'sic est'),
(FALSE, 'non est'),
('f', 'non est'),
('false','non est'),
('n', 'non est'),
('no', 'non est'),
('off', 'non est'),
('0', 'non est');
SELECT * FROM booleant WHERE bv;
/*
id | bv | tv
----+----+---------
1 | t | sic est
2 | t | sic est
3 | t | sic est
4 | t | sic est
5 | t | sic est
6 | t | sic est
7 | t | sic est
(7 rows)
*/
SELECT * FROM booleant WHERE bv = FALSE;
/*
id | bv | tv
----+----+---------
8 | f | non est
9 | f | non est
10 | f | non est
11 | f | non est
12 | f | non est
13 | f | non est
14 | f | non est
(7 rows)
*/
| true |
8597a792664a7c827b30a9f3609076dad5d97f05 | SQL | ahmetdemirayakk/girgir | /kullanici.sql | UTF-8 | 3,728 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Anamakine: localhost:3306
-- Üretim Zamanı: 02 Ara 2017, 15:37:18
-- Sunucu sürümü: 10.0.33-MariaDB
-- PHP Sürümü: 5.6.30
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 */;
--
-- Veritabanı: `natureltrakya_2017`
--
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `kullanici`
--
CREATE TABLE `kullanici` (
`kullanici_id` int(11) NOT NULL,
`subMerchantKey` varchar(500) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_magaza` enum('0','1','2') COLLATE utf8_turkish_ci NOT NULL DEFAULT '0',
`kullanici_magazafoto` varchar(500) COLLATE utf8_turkish_ci NOT NULL DEFAULT 'dimg/magaza-fotoyok.png',
`kullanici_zaman` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`kullanici_resim` varchar(250) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_tc` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_banka` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_iban` varchar(50) COLLATE utf8_turkish_ci DEFAULT NULL,
`kullanici_ad` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_soyad` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_mail` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_gsm` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_password` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_adres` varchar(250) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_il` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_ilce` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_unvan` varchar(100) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_tip` enum('PERSONAL','PRIVATE_COMPANY','LIMITED_OR_JOINT_STOCK_COMPANY','') COLLATE utf8_turkish_ci DEFAULT 'PERSONAL',
`kullanici_vdaire` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_vno` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_yetki` varchar(50) COLLATE utf8_turkish_ci NOT NULL,
`kullanici_durum` int(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci;
--
-- Tablo döküm verisi `kullanici`
--
INSERT INTO `kullanici` (`kullanici_id`, `subMerchantKey`, `kullanici_magaza`, `kullanici_magazafoto`, `kullanici_zaman`, `kullanici_resim`, `kullanici_tc`, `kullanici_banka`, `kullanici_iban`, `kullanici_ad`, `kullanici_soyad`, `kullanici_mail`, `kullanici_gsm`, `kullanici_password`, `kullanici_adres`, `kullanici_il`, `kullanici_ilce`, `kullanici_unvan`, `kullanici_tip`, `kullanici_vdaire`, `kullanici_vno`, `kullanici_yetki`, `kullanici_durum`) VALUES
(153, '', '0', 'dimg/magazafoto/28832avatar-02-jpg.jpg', '2017-07-31 11:31:57', '', '', '', NULL, 'Emrah', 'Yüksel', 'info@emrahyuksel.com.tr', '05326668991', 'e10adc3949ba59abbe56e057f20f883e', 's1', 'İstanbul', 'Çatalca', 'sdf', 'PERSONAL', 'sdf', 'sdf', '5', 1);
--
-- Dökümü yapılmış tablolar için indeksler
--
--
-- Tablo için indeksler `kullanici`
--
ALTER TABLE `kullanici`
ADD PRIMARY KEY (`kullanici_id`);
--
-- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri
--
--
-- Tablo için AUTO_INCREMENT değeri `kullanici`
--
ALTER TABLE `kullanici`
MODIFY `kullanici_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=164;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 |
5ac4a6a7a6b260e1a9b53f3d96e2436fb97fb2f0 | SQL | matsuha/tin | /auto/up_ts_heya_tinryo_his_start_ymd_sum.sql | SHIFT_JIS | 2,185 | 3.453125 | 3 | [] | no_license | REM
REM =head1 NAME
REM
REM up_ts_heya_tinryo_his_start_ymd_sum.sql
REM
REM =head1 DESCRIPTION
REM
REM (TS_HEYA_TINRYO_HIS)̏XV
REM
REM ăX^[gtOtĂ镨̏ꍇ
REM
REM R[hɂ́Af[^ςāAꌚAꕔ̏
REM ԒɕύXɂȂꍇB
REM ԂƂẮAPł邪AƂĂ͕R[hɂȂ̂
REM ŏĨR[hɍŏꂽX^[go^Kv
REM
REM =head1 HISTORY
REM
REM =over 4
REM
REM =item 2010/10/25 M.TAKIUCHI CREATED
REM
REM =item 2010/10/25 M.TAKIUCHI COMMENT ADD FOR POD
REM
REM =back
REM
REM =head1 Trouble Shooting
REM
REM xsĂʂɂȂB
REM
REM =head1 AUTHOR
REM
REM VXe@(mtakiuc@kantei.co.jp)
REM
REM =cut
REM
update
ts_heya_tinryo_his aa
set
aa.start_ymd_sum = (
select
max(tinryo_his_ymd) as tinryo_his_ymd
from
ts_heya_tinryo_his bb
where
aa.tatemono_cd = bb.tatemono_cd
and aa.roomno = bb.roomno
and bb.tinryo_his_ymd <= to_date('&&THIS_KYOKYU_YMD', 'yyyymmdd')
and bb.start_flg = '1'
group by
tatemono_cd
, roomno
)
where
tinryo_his_ymd = to_date('&&THIS_KYOKYU_YMD', 'yyyymmdd')
and end_flg != '1'
and start_flg != '1'
and exists (
select
tatemono_cd
, roomno
from
ts_heya_tinryo_his cc
where
tinryo_his_ymd <= to_date('&&THIS_KYOKYU_YMD', 'yyyymmdd')
and start_flg = '1'
and aa.tatemono_cd = cc.tatemono_cd
and aa.roomno = cc.roomno
)
and nvl(aa.start_ymd_sum, sysdate - 3650) < (
select
max(tinryo_his_ymd) as tinryo_his_ymd
from
ts_heya_tinryo_his dd
where
aa.tatemono_cd = dd.tatemono_cd
and aa.roomno = dd.roomno
and dd.tinryo_his_ymd <= to_date('&&THIS_KYOKYU_YMD', 'yyyymmdd')
and dd.start_flg = '1'
group by
tatemono_cd
, roomno
)
/
| true |
2897b11a6e52a69e729e44e9d84d1375da62b436 | SQL | veslo1/apmgr | /migrations/storage/39/aclUnitSearchUp.sql | UTF-8 | 27,636 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.3.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 28, 2010 at 05:53 PM
-- Server version: 5.1.46
-- PHP Version: 5.3.2
SET FOREIGN_KEY_CHECKS=0;
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: `apmgr`
--
-- --------------------------------------------------------
--
-- Table structure for table `actions`
--
DROP TABLE IF EXISTS `actions`;
CREATE TABLE IF NOT EXISTS `actions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`icon` varchar(90) DEFAULT NULL,
`display` tinyint(4) NOT NULL DEFAULT '1',
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`(2)),
KEY `icon` (`icon`(6))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=98 ;
--
-- Dumping data for table `actions`
--
REPLACE INTO `actions` (`id`, `name`, `icon`, `display`, `dateCreated`, `dateUpdated`) VALUES
(1, 'Index', '/images/dashboard/onebit_01.gif', 1, '2010-04-20 15:03:36', NULL),
(2, 'Dailyview', NULL, 1, '2010-04-20 15:03:36', NULL),
(3, 'Weekview', NULL, 1, '2010-04-20 15:03:36', NULL),
(4, 'Viewevent', NULL, 1, '2010-04-20 15:03:36', NULL),
(5, 'Search', NULL, 1, '2010-04-20 15:03:36', NULL),
(6, 'Error', NULL, 1, '2010-04-20 15:03:36', NULL),
(7, 'Noaccess', NULL, 1, '2010-04-20 15:03:36', NULL),
(8, 'Createaccount', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:36', NULL),
(9, 'Createaccountlink', NULL, 1, '2010-04-20 15:03:36', NULL),
(10, 'Searchunit', '/images/24/search_48.gif', 1, '2010-04-20 15:03:36', '2010-05-28 16:50:33'),
(11, 'Selectbill', NULL, 1, '2010-04-20 15:03:36', NULL),
(12, 'Createbill', NULL, 1, '2010-04-20 15:03:36', NULL),
(13, 'Updateaccount', NULL, 1, '2010-04-20 15:03:36', NULL),
(14, 'Updateaccountlink', NULL, 1, '2010-04-20 15:03:36', NULL),
(15, 'Viewallaccounts', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(16, 'Viewaccount', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(17, 'Viewallaccountlinks', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(18, 'Db', NULL, 1, '2010-04-20 15:03:36', NULL),
(19, 'Text', NULL, 1, '2010-04-20 15:03:36', NULL),
(20, 'Read', NULL, 1, '2010-04-20 15:03:36', NULL),
(21, 'Createmaintenancerequest', NULL, 1, '2010-04-20 15:03:36', NULL),
(22, 'Viewallmaintenancerequests', NULL, 1, '2010-04-20 15:03:36', NULL),
(23, 'Viewmymaintenancerequests', NULL, 1, '2010-04-20 15:03:36', NULL),
(24, 'Viewmaintenancerequest', NULL, 1, '2010-04-20 15:03:36', NULL),
(25, 'Help', NULL, 1, '2010-04-20 15:03:36', NULL),
(26, 'Update', '/images/dashboard/onebit_20.gif', 1, '2010-04-20 15:03:36', NULL),
(27, 'Viewallmodules', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(28, 'View', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(29, 'Roleaccess', NULL, 1, '2010-04-20 15:03:36', NULL),
(32, 'Delete', '/images/dashboard/onebit_32.gif', 1, '2010-04-20 15:03:37', NULL),
(34, 'Createamenity', NULL, 1, '2010-04-20 15:03:37', NULL),
(35, 'Createapartment', NULL, 1, '2010-04-20 15:03:37', NULL),
(36, 'Createunitsingle', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:37', NULL),
(37, 'Createunitbulk', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:37', NULL),
(38, 'Createunitmodel', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:37', NULL),
(39, 'Createmodelrentschedule', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:37', NULL),
(40, 'Unitmodelindex', '/images/dashboard/onebit_01.gif', 1, '2010-04-20 15:03:37', NULL),
(41, 'Amenityindex', '/images/dashboard/onebit_01.gif', 1, '2010-04-20 15:03:37', NULL),
(42, 'Addusertolist', NULL, 1, '2010-04-20 15:03:37', NULL),
(43, 'Removeuserfromlist', NULL, 1, '2010-04-20 15:03:37', NULL),
(44, 'Confirmation', NULL, 1, '2010-04-20 15:03:37', NULL),
(45, 'Enterdiscounts', NULL, 1, '2010-04-20 15:03:37', NULL),
(46, 'Entermoveindate', NULL, 1, '2010-04-20 15:03:37', NULL),
(47, 'Searchaddtenet', NULL, 1, '2010-04-20 15:03:37', NULL),
(48, 'Selectaccountlink', NULL, 1, '2010-04-20 15:03:37', NULL),
(49, 'Selectrentschedule', NULL, 1, '2010-04-20 15:03:37', NULL),
(50, 'Startleasewizard', NULL, 1, '2010-04-20 15:03:37', NULL),
(51, 'Deleteapartment', NULL, 1, '2010-04-20 15:03:37', NULL),
(52, 'Viewunittenet', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:37', NULL),
(53, 'Addtounit', NULL, 1, '2010-04-20 15:03:37', NULL),
(54, 'Cancellease', NULL, 1, '2010-04-20 15:03:37', NULL),
(55, 'Updateamenity', NULL, 1, '2010-04-20 15:03:37', NULL),
(56, 'Updateapartment', NULL, 1, '2010-04-20 15:03:37', NULL),
(57, 'Updateunit', NULL, 1, '2010-04-20 15:03:37', NULL),
(58, 'Updateunitmodel', NULL, 1, '2010-04-20 15:03:37', NULL),
(59, 'Getregions', NULL, 1, '2010-04-20 15:03:37', NULL),
(60, 'Viewunit', NULL, 1, '2010-04-20 15:03:37', NULL),
(61, 'Viewallamenities', NULL, 1, '2010-04-20 15:03:37', NULL),
(62, 'Viewallapartments', NULL, 1, '2010-04-20 15:03:37', NULL),
(63, 'Viewallunitmodels', NULL, 1, '2010-04-20 15:03:37', NULL),
(64, 'Viewallunits', NULL, 1, '2010-04-20 15:03:37', NULL),
(65, 'Viewapartment', NULL, 1, '2010-04-20 15:03:37', NULL),
(66, 'Viewallmodelrentschedule', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:37', NULL),
(67, 'Viewlease', NULL, 1, '2010-04-20 15:03:37', NULL),
(68, 'Viewleaselist', NULL, 1, '2010-04-20 15:03:37', NULL),
(69, 'Viewmodelrentschedule', NULL, 1, '2010-04-20 15:03:37', NULL),
(70, 'Changepwd', NULL, 1, '2010-04-20 15:03:37', NULL),
(71, 'Changerole', NULL, 1, '2010-04-20 15:03:37', NULL),
(72, 'Logout', NULL, 1, '2010-04-20 15:03:37', NULL),
(73, 'Deleteevent', NULL, 1, '2010-04-25 15:03:18', NULL),
(74, 'Deleteguest', NULL, 1, '2010-04-25 15:03:18', NULL),
(75, 'Deleteeventtime', NULL, 1, '2010-04-25 15:03:18', NULL),
(76, 'Updateevent', NULL, 1, '2010-04-25 15:03:18', NULL),
(77, 'Createdeposit', NULL, 1, '2010-04-25 15:03:18', NULL),
(78, 'Createfee', NULL, 1, '2010-04-25 15:03:18', NULL),
(79, 'Updatedeposit', NULL, 1, '2010-04-25 15:03:18', NULL),
(80, 'Updatefee', NULL, 1, '2010-04-25 15:03:18', NULL),
(81, 'Viewaccounttransactions', NULL, 1, '2010-04-25 15:03:18', NULL),
(82, 'Viewalldeposits', NULL, 1, '2010-04-25 15:03:18', NULL),
(83, 'Viewallfees', NULL, 1, '2010-04-25 15:03:18', NULL),
(84, 'Selectfeedeposit', NULL, 1, '2010-04-25 15:03:18', NULL),
(85, 'Deleteallguests', NULL, 1, '2010-05-14 21:09:46', NULL),
(86, 'Createaccounttransaction', NULL, 1, '2010-05-14 21:09:46', NULL),
(87, 'Updatedepositaccountlink', NULL, 1, '2010-05-14 21:09:46', NULL),
(88, 'Updatefeeaccountlink', NULL, 1, '2010-05-14 21:09:46', NULL),
(89, 'Viewbill', NULL, 1, '2010-05-14 21:09:47', NULL),
(90, 'Viewpaymentdetail', NULL, 1, '2010-05-14 21:09:47', NULL),
(91, 'Viewtransaction', NULL, 1, '2010-05-14 21:09:47', NULL),
(92, 'Createleasefee', NULL, 1, '2010-05-14 21:09:47', NULL),
(93, 'Createleasedeposit', NULL, 1, '2010-05-14 21:09:47', NULL),
(94, 'Unitsforrent', NULL, 1, '2010-05-14 21:09:47', NULL),
(95, 'Viewunitgraphics', NULL, 1, '2010-05-14 21:09:47', NULL),
(96, 'Addpicture', '/images/dashboard/camera_add_48.gif', 1, '2010-05-14 21:09:13', NULL),
(97, 'Deleteunitmetadata', NULL, 1, '2010-05-24 12:12:27', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `controllers`
--
DROP TABLE IF EXISTS `controllers`;
CREATE TABLE IF NOT EXISTS `controllers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(90) NOT NULL,
`icon` varchar(250) DEFAULT NULL,
`display` tinyint(4) NOT NULL DEFAULT '0',
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`(5))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='All the controllers that we have' AUTO_INCREMENT=15 ;
--
-- Dumping data for table `controllers`
--
REPLACE INTO `controllers` (`id`, `name`, `icon`, `display`, `dateCreated`, `dateUpdated`) VALUES
(1, 'Create', '/images/dashboard/onebit_48.gif', 1, '2010-04-20 15:03:36', NULL),
(2, 'Index', '/images/dashboard/onebit_01.gif', 1, '2010-04-20 15:03:36', NULL),
(3, 'Delete', '/images/dashboard/onebit_32.gif', 0, '2010-04-20 15:03:36', '2010-05-01 13:45:06'),
(4, 'Update', '/images/dashboard/onebit_20.gif', 0, '2010-04-20 15:03:36', '2010-05-01 13:45:31'),
(5, 'View', '/images/dashboard/onebit_02.gif', 1, '2010-04-20 15:03:36', NULL),
(6, 'Error', NULL, 0, '2010-04-20 15:03:36', NULL),
(7, 'Search', '/images/24/search_48.gif', 1, '2010-04-20 15:03:36', '2010-05-28 16:45:37'),
(8, 'Leasewizard', NULL, 0, '2010-04-20 15:03:37', NULL),
(9, 'Tenet', NULL, 0, '2010-04-20 15:03:37', NULL),
(10, 'Join', NULL, 0, '2010-04-20 15:03:37', NULL),
(11, 'Login', NULL, 0, '2010-04-20 15:03:37', NULL),
(12, 'Add', NULL, 0, '2010-05-14 21:09:47', NULL),
(13, 'Backend', NULL, 0, '2010-05-22 12:12:17', NULL),
(14, 'Apply', NULL, 0, '2010-05-22 12:12:17', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `modules`
--
DROP TABLE IF EXISTS `modules`;
CREATE TABLE IF NOT EXISTS `modules` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`icon` varchar(250) DEFAULT NULL,
`display` tinyint(4) NOT NULL DEFAULT '0',
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`name`(5))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='The content of the modules folder, ie all the modules' AUTO_INCREMENT=13 ;
--
-- Dumping data for table `modules`
--
REPLACE INTO `modules` (`id`, `name`, `icon`, `display`, `dateCreated`, `dateUpdated`) VALUES
(1, 'calendar', '/images/dashboard/calendar.png', 1, '2010-04-20 15:03:36', NULL),
(2, 'default', '/images/dashboard/ok.gif', 1, '2010-04-20 15:03:36', NULL),
(3, 'financial', '/images/dashboard/dollar.gif', 1, '2010-04-20 15:03:36', NULL),
(4, 'logs', NULL, 0, '2010-04-20 15:03:36', NULL),
(5, 'maintenance', '/images/dashboard/spanner_48.gif', 1, '2010-04-20 15:03:36', NULL),
(6, 'messages', '/images/dashboard/messages.gif', 1, '2010-04-20 15:03:36', NULL),
(7, 'modules', NULL, 0, '2010-04-20 15:03:36', NULL),
(8, 'permission', '/images/dashboard/onebit_04.gif', 1, '2010-04-20 15:03:36', NULL),
(9, 'role', '/images/dashboard/role.gif', 1, '2010-04-20 15:03:36', NULL),
(10, 'unit', '/images/dashboard/apartment.gif', 1, '2010-04-20 15:03:36', NULL),
(11, 'user', '/images/dashboard/user_48.gif', 1, '2010-04-20 15:03:36', NULL),
(12, 'applicant', NULL, 0, '2010-05-20 22:10:40', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `permission`
--
DROP TABLE IF EXISTS `permission`;
CREATE TABLE IF NOT EXISTS `permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`moduleId` int(11) NOT NULL,
`controllerId` int(11) NOT NULL,
`actionId` int(11) NOT NULL,
`alias` varchar(50) NOT NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `moduleId` (`moduleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=151 ;
--
-- Dumping data for table `permission`
--
REPLACE INTO `permission` (`id`, `moduleId`, `controllerId`, `actionId`, `alias`, `dateCreated`, `dateUpdated`) VALUES
(1, 1, 1, 1, 'Calendar Create Index', '2010-04-20 15:03:36', NULL),
(2, 1, 2, 1, 'Calendar Index Index', '2010-04-20 15:03:36', NULL),
(3, 1, 5, 1, 'Calendar View Index', '2010-04-20 15:03:36', NULL),
(4, 1, 5, 2, 'Calendar View Dailyview', '2010-04-20 15:03:36', NULL),
(5, 1, 5, 3, 'Calendar View Weekview', '2010-04-20 15:03:36', NULL),
(6, 1, 5, 4, 'Calendar View Viewevent', '2010-04-20 15:03:36', NULL),
(7, 2, 2, 1, 'Default Index Index', '2010-04-20 15:03:36', NULL),
(8, 2, 2, 5, 'Default Index Search', '2010-04-20 15:03:36', NULL),
(9, 2, 6, 6, 'Default Error Error', '2010-04-20 15:03:36', NULL),
(10, 2, 6, 7, 'Default Error Noaccess', '2010-04-20 15:03:36', NULL),
(11, 3, 1, 8, 'Financial Create Createaccount', '2010-04-20 15:03:36', NULL),
(12, 3, 1, 9, 'Financial Create Createaccountlink', '2010-04-20 15:03:36', NULL),
(13, 3, 1, 10, 'Financial Create Searchunit', '2010-04-20 15:03:36', NULL),
(14, 3, 1, 11, 'Financial Create Selectbill', '2010-04-20 15:03:36', NULL),
(15, 3, 1, 12, 'Financial Create Createbill', '2010-04-20 15:03:36', NULL),
(16, 3, 2, 1, 'Financial Index Index', '2010-04-20 15:03:36', NULL),
(17, 3, 4, 13, 'Financial Update Updateaccount', '2010-04-20 15:03:36', NULL),
(18, 3, 4, 14, 'Financial Update Updateaccountlink', '2010-04-20 15:03:36', NULL),
(19, 3, 5, 15, 'Financial View Viewallaccounts', '2010-04-20 15:03:36', NULL),
(20, 3, 5, 16, 'Financial View Viewaccount', '2010-04-20 15:03:36', NULL),
(21, 3, 5, 17, 'Financial View View All Account Links', '2010-04-20 15:03:36', '2010-05-02 15:11:15'),
(22, 4, 2, 1, 'Logs Index Index', '2010-04-20 15:03:36', NULL),
(23, 4, 2, 18, 'Logs Index Db', '2010-04-20 15:03:36', NULL),
(24, 4, 2, 19, 'Logs Index Text', '2010-04-20 15:03:36', NULL),
(25, 4, 2, 20, 'Logs Index Read', '2010-04-20 15:03:36', NULL),
(26, 4, 6, 6, 'Logs Error Error', '2010-04-20 15:03:36', NULL),
(27, 5, 1, 21, 'Maintenance Create Createmaintenancerequest', '2010-04-20 15:03:36', NULL),
(28, 5, 5, 22, 'Maintenance View Viewallmaintenancerequests', '2010-04-20 15:03:36', NULL),
(29, 5, 5, 23, 'Maintenance View Viewmymaintenancerequests', '2010-04-20 15:03:36', NULL),
(30, 5, 5, 24, 'Maintenance View Viewmaintenancerequest', '2010-04-20 15:03:36', NULL),
(31, 6, 1, 1, 'Messages Create Index', '2010-04-20 15:03:36', NULL),
(32, 6, 2, 1, 'Messages Index Index', '2010-04-20 15:03:36', NULL),
(33, 6, 3, 25, 'Messages Delete Help', '2010-04-20 15:03:36', NULL),
(34, 6, 3, 1, 'Messages Delete Index', '2010-04-20 15:03:36', NULL),
(35, 6, 4, 1, 'Messages Update Index', '2010-04-20 15:03:36', NULL),
(36, 6, 5, 1, 'Messages View Index', '2010-04-20 15:03:36', NULL),
(37, 7, 2, 1, 'Modules Index Index', '2010-04-20 15:03:36', NULL),
(38, 7, 6, 6, 'Modules Error Error', '2010-04-20 15:03:36', NULL),
(39, 7, 4, 1, 'Modules Update Index', '2010-04-20 15:03:36', NULL),
(40, 7, 4, 26, 'Modules Update Update', '2010-04-20 15:03:36', NULL),
(41, 7, 5, 1, 'Modules View Index', '2010-04-20 15:03:36', NULL),
(42, 7, 5, 27, 'Modules View Viewallmodules', '2010-04-20 15:03:36', NULL),
(43, 8, 2, 1, 'Permission Index Index', '2010-04-20 15:03:36', NULL),
(44, 8, 6, 6, 'Permission Error Error', '2010-04-20 15:03:36', NULL),
(45, 8, 7, 1, 'Permission Search Index', '2010-04-20 15:03:36', NULL),
(46, 8, 4, 1, 'Permission Update Index', '2010-04-20 15:03:36', NULL),
(47, 8, 5, 1, 'Permission View Index', '2010-04-20 15:03:36', NULL),
(48, 8, 5, 28, 'Permission View View', '2010-04-20 15:03:36', NULL),
(49, 9, 1, 1, 'Role Create Index', '2010-04-20 15:03:36', NULL),
(50, 9, 1, 29, 'Role Create Roleaccess', '2010-04-20 15:03:36', NULL),
(53, 9, 2, 1, 'Role Index Index', '2010-04-20 15:03:37', NULL),
(54, 9, 6, 6, 'Role Error Error', '2010-04-20 15:03:37', NULL),
(55, 9, 6, 7, 'Role Error Noaccess', '2010-04-20 15:03:37', NULL),
(56, 9, 3, 1, 'Role Delete Index', '2010-04-20 15:03:37', NULL),
(57, 9, 3, 32, 'Role Delete Delete', '2010-04-20 15:03:37', NULL),
(59, 9, 7, 1, 'Role Search Index', '2010-04-20 15:03:37', NULL),
(60, 9, 4, 1, 'Role Update Index', '2010-04-20 15:03:37', NULL),
(61, 9, 4, 26, 'Role Update Update', '2010-04-20 15:03:37', NULL),
(62, 9, 5, 1, 'Role View Index', '2010-04-20 15:03:37', NULL),
(63, 9, 5, 28, 'Role View View', '2010-04-20 15:03:37', NULL),
(64, 9, 5, 29, 'Role View Roleaccess', '2010-04-20 15:03:37', NULL),
(65, 10, 1, 1, 'Unit Create Index', '2010-04-20 15:03:37', NULL),
(66, 10, 1, 34, 'Unit Create Createamenity', '2010-04-20 15:03:37', NULL),
(67, 10, 1, 35, 'Unit Create Createapartment', '2010-04-20 15:03:37', NULL),
(68, 10, 1, 36, 'Unit Create Createunitsingle', '2010-04-20 15:03:37', NULL),
(69, 10, 1, 37, 'Unit Create Createunitbulk', '2010-04-20 15:03:37', NULL),
(70, 10, 1, 38, 'Unit Create Createunitmodel', '2010-04-20 15:03:37', NULL),
(71, 10, 1, 39, 'Unit Create Createmodelrentschedule', '2010-04-20 15:03:37', NULL),
(72, 10, 2, 1, 'Unit Index Index', '2010-04-20 15:03:37', NULL),
(73, 10, 2, 40, 'Unit Index Unitmodelindex', '2010-04-20 15:03:37', NULL),
(74, 10, 2, 41, 'Unit Index Amenityindex', '2010-04-20 15:03:37', NULL),
(75, 10, 6, 6, 'Unit Error Error', '2010-04-20 15:03:37', NULL),
(76, 10, 8, 42, 'Unit Leasewizard Addusertolist', '2010-04-20 15:03:37', NULL),
(77, 10, 8, 43, 'Unit Leasewizard Removeuserfromlist', '2010-04-20 15:03:37', NULL),
(78, 10, 8, 44, 'Unit Leasewizard Confirmation', '2010-04-20 15:03:37', NULL),
(79, 10, 8, 45, 'Unit Leasewizard Enterdiscounts', '2010-04-20 15:03:37', NULL),
(80, 10, 8, 46, 'Unit Leasewizard Entermoveindate', '2010-04-20 15:03:37', NULL),
(81, 10, 8, 47, 'Unit Leasewizard Searchaddtenet', '2010-04-20 15:03:37', NULL),
(82, 10, 8, 48, 'Unit Leasewizard Selectaccountlink', '2010-04-20 15:03:37', NULL),
(83, 10, 8, 49, 'Unit Leasewizard Selectrentschedule', '2010-04-20 15:03:37', NULL),
(84, 10, 8, 50, 'Unit Leasewizard Startleasewizard', '2010-04-20 15:03:37', NULL),
(85, 10, 3, 1, 'Unit Delete Index', '2010-04-20 15:03:37', NULL),
(86, 10, 3, 32, 'Unit Delete Delete', '2010-04-20 15:03:37', NULL),
(87, 10, 3, 51, 'Unit Delete Deleteapartment', '2010-04-20 15:03:37', NULL),
(88, 10, 9, 52, 'Unit Tenet Viewunittenet', '2010-04-20 15:03:37', NULL),
(89, 10, 9, 47, 'Unit Tenet Searchaddtenet', '2010-04-20 15:03:37', NULL),
(90, 10, 9, 53, 'Unit Tenet Addtounit', '2010-04-20 15:03:37', NULL),
(91, 10, 4, 1, 'Unit Update Index', '2010-04-20 15:03:37', NULL),
(92, 10, 4, 54, 'Unit Update Cancellease', '2010-04-20 15:03:37', NULL),
(93, 10, 4, 55, 'Unit Update Updateamenity', '2010-04-20 15:03:37', NULL),
(94, 10, 4, 56, 'Unit Update Updateapartment', '2010-04-20 15:03:37', NULL),
(95, 10, 4, 57, 'Unit Update Updateunit', '2010-04-20 15:03:37', NULL),
(96, 10, 4, 58, 'Unit Update Updateunitmodel', '2010-04-20 15:03:37', NULL),
(97, 10, 4, 59, 'Unit Update Getregions', '2010-04-20 15:03:37', NULL),
(98, 10, 5, 60, 'Unit View Viewunit', '2010-04-20 15:03:37', NULL),
(99, 10, 5, 61, 'Unit View Viewallamenities', '2010-04-20 15:03:37', NULL),
(100, 10, 5, 62, 'Unit View Viewallapartments', '2010-04-20 15:03:37', NULL),
(101, 10, 5, 63, 'Unit View Viewallunitmodels', '2010-04-20 15:03:37', NULL),
(102, 10, 5, 64, 'Unit View Viewallunits', '2010-04-20 15:03:37', NULL),
(103, 10, 5, 65, 'Unit View Viewapartment', '2010-04-20 15:03:37', NULL),
(104, 10, 5, 66, 'Unit View Viewallmodelrentschedule', '2010-04-20 15:03:37', NULL),
(105, 10, 5, 67, 'Unit View Viewlease', '2010-04-20 15:03:37', NULL),
(106, 10, 5, 68, 'Unit View Viewleaselist', '2010-04-20 15:03:37', NULL),
(107, 10, 5, 69, 'Unit View Viewmodelrentschedule', '2010-04-20 15:03:37', NULL),
(108, 11, 10, 1, 'User Join Index', '2010-04-20 15:03:37', NULL),
(109, 11, 1, 1, 'User Create Index', '2010-04-20 15:03:37', NULL),
(110, 11, 2, 1, 'User Index Index', '2010-04-20 15:03:37', NULL),
(111, 11, 6, 6, 'User Error Error', '2010-04-20 15:03:37', NULL),
(112, 11, 6, 7, 'User Error Noaccess', '2010-04-20 15:03:37', NULL),
(113, 11, 4, 1, 'User Update Index', '2010-04-20 15:03:37', NULL),
(114, 11, 4, 70, 'User Update Changepwd', '2010-04-20 15:03:37', NULL),
(115, 11, 4, 71, 'User Update Changerole', '2010-04-20 15:03:37', NULL),
(116, 11, 5, 1, 'User View Index', '2010-04-20 15:03:37', NULL),
(117, 11, 11, 1, 'User Login Index', '2010-04-20 15:03:37', NULL),
(118, 11, 11, 72, 'User Login Logout', '2010-04-20 15:03:37', NULL),
(119, 11, 11, 6, 'User Login Error', '2010-04-20 15:03:37', NULL),
(120, 1, 3, 73, 'Calendar Delete Deleteevent', '2010-04-25 15:03:18', NULL),
(121, 1, 3, 74, 'Calendar Delete Deleteguest', '2010-04-25 15:03:18', NULL),
(122, 1, 3, 75, 'Calendar Delete Deleteeventtime', '2010-04-25 15:03:18', NULL),
(123, 1, 4, 76, 'Calendar Update Updateevent', '2010-04-25 15:03:18', NULL),
(124, 3, 1, 77, 'Financial Create Createdeposit', '2010-04-25 15:03:18', NULL),
(125, 3, 1, 78, 'Financial Create Createfee', '2010-04-25 15:03:18', NULL),
(126, 3, 4, 79, 'Financial Update Updatedeposit', '2010-04-25 15:03:18', NULL),
(127, 3, 4, 80, 'Financial Update Updatefee', '2010-04-25 15:03:18', NULL),
(128, 3, 5, 81, 'Financial View Viewaccounttransactions', '2010-04-25 15:03:18', NULL),
(129, 3, 5, 82, 'Financial View Viewalldeposits', '2010-04-25 15:03:18', NULL),
(130, 3, 5, 83, 'Financial View Viewallfees', '2010-04-25 15:03:18', NULL),
(131, 5, 2, 1, 'Maintenance Index Index', '2010-04-25 15:03:18', NULL),
(132, 10, 8, 84, 'Unit Leasewizard Selectfeedeposit', '2010-04-25 15:03:19', NULL),
(133, 1, 3, 85, 'Calendar Delete Deleteallguests', '2010-05-14 21:09:46', NULL),
(134, 3, 1, 86, 'Financial Create Createaccounttransaction', '2010-05-14 21:09:46', NULL),
(135, 3, 4, 87, 'Financial Update Updatedepositaccountlink', '2010-05-14 21:09:46', NULL),
(136, 3, 4, 88, 'Financial Update Updatefeeaccountlink', '2010-05-14 21:09:46', NULL),
(137, 3, 5, 89, 'Financial View Viewbill', '2010-05-14 21:09:47', NULL),
(138, 3, 5, 90, 'Financial View Viewpaymentdetail', '2010-05-14 21:09:47', NULL),
(139, 3, 5, 91, 'Financial View Viewtransaction', '2010-05-14 21:09:47', NULL),
(140, 10, 1, 92, 'Unit Create Createleasefee', '2010-05-14 21:09:47', NULL),
(141, 10, 1, 93, 'Unit Create Createleasedeposit', '2010-05-14 21:09:47', NULL),
(142, 10, 5, 94, 'Unit View Unitsforrent', '2010-05-14 21:09:47', NULL),
(143, 10, 5, 95, 'Unit View Viewunitgraphics', '2010-05-14 21:09:47', NULL),
(144, 10, 12, 1, 'Unit Add Index', '2010-05-14 21:09:47', NULL),
(145, 10, 12, 96, 'Unit Add Addpicture', '2010-05-14 21:09:13', NULL),
(146, 12, 5, 1, 'Applicant View Index', '2010-05-20 22:10:40', NULL),
(147, 12, 13, 1, 'Applicant Backend Index', '2010-05-22 12:12:17', NULL),
(148, 12, 14, 1, 'Applicant Apply Index', '2010-05-22 12:12:17', NULL),
(149, 10, 3, 97, 'Unit Delete Deleteunitmetadata', '2010-05-24 12:12:27', NULL),
(150, 10, 7, 1, 'Unit Search Index', '2010-05-24 12:12:27', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rolePermission`
--
DROP TABLE IF EXISTS `rolePermission`;
CREATE TABLE IF NOT EXISTS `rolePermission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roleId` int(11) NOT NULL,
`permissionId` int(11) NOT NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `tuple` (`roleId`,`permissionId`),
KEY `roleId` (`roleId`),
KEY `permissionId` (`permissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relation between roles and permissions' AUTO_INCREMENT=113 ;
--
-- Dumping data for table `rolePermission`
--
REPLACE INTO `rolePermission` (`id`, `roleId`, `permissionId`, `dateCreated`, `dateUpdated`) VALUES
(1, 2, 1, '2010-04-20 16:07:44', NULL),
(2, 3, 1, '2010-04-20 16:07:47', NULL),
(3, 2, 2, '2010-04-20 16:07:49', NULL),
(4, 3, 2, '2010-04-20 16:07:52', NULL),
(5, 3, 4, '2010-04-20 16:07:56', NULL),
(6, 2, 4, '2010-04-20 16:07:58', NULL),
(7, 2, 3, '2010-04-20 16:07:59', NULL),
(8, 2, 6, '2010-04-20 16:08:06', NULL),
(9, 2, 5, '2010-04-20 16:08:09', NULL),
(10, 3, 5, '2010-04-20 16:08:11', NULL),
(11, 3, 6, '2010-04-20 16:08:13', NULL),
(12, 3, 3, '2010-04-20 16:08:16', NULL),
(13, 2, 110, '2010-04-20 16:08:35', NULL),
(14, 2, 119, '2010-04-20 16:08:37', NULL),
(16, 2, 118, '2010-04-20 16:08:42', NULL),
(17, 2, 114, '2010-04-20 16:08:45', NULL),
(18, 2, 113, '2010-04-20 16:08:49', NULL),
(19, 2, 116, '2010-04-20 16:08:54', NULL),
(20, 3, 110, '2010-04-20 16:08:57', NULL),
(21, 3, 114, '2010-04-20 16:08:59', NULL),
(23, 3, 119, '2010-04-20 16:09:03', NULL),
(24, 3, 113, '2010-04-20 16:09:07', NULL),
(25, 3, 116, '2010-04-20 16:09:10', NULL),
(26, 2, 9, '2010-04-20 16:12:07', NULL),
(27, 3, 9, '2010-04-20 16:12:09', NULL),
(28, 2, 10, '2010-04-20 16:12:11', NULL),
(29, 3, 10, '2010-04-20 16:12:16', NULL),
(30, 2, 7, '2010-04-20 16:12:18', NULL),
(31, 3, 7, '2010-04-20 16:12:21', NULL),
(33, 3, 112, '2010-04-20 16:12:37', NULL),
(34, 2, 112, '2010-04-20 16:12:40', NULL),
(35, 2, 111, '2010-04-20 16:12:42', NULL),
(36, 3, 111, '2010-04-20 16:12:45', NULL),
(37, 3, 118, '2010-04-20 16:54:46', NULL),
(38, 2, 120, '2010-04-25 15:04:53', NULL),
(39, 3, 120, '2010-04-25 15:04:56', NULL),
(40, 2, 122, '2010-04-25 15:04:58', NULL),
(41, 3, 122, '2010-04-25 15:05:00', NULL),
(42, 2, 121, '2010-04-25 15:05:03', NULL),
(43, 3, 121, '2010-04-25 15:05:04', NULL),
(45, 4, 102, '2010-05-03 22:44:21', NULL),
(47, 4, 72, '2010-05-03 22:45:51', NULL),
(48, 4, 103, '2010-05-03 22:46:31', NULL),
(51, 1, 91, '2010-05-02 14:22:24', NULL),
(54, 1, 1, '2010-05-02 14:40:10', NULL),
(55, 1, 145, '2010-05-14 21:49:57', NULL),
(56, 6, 145, '2010-05-14 21:49:57', NULL),
(60, 1, 143, '2010-05-16 15:53:32', NULL),
(61, 4, 143, '2010-05-16 15:53:32', NULL),
(62, 5, 143, '2010-05-16 15:53:32', NULL),
(63, 6, 143, '2010-05-16 15:53:32', NULL),
(71, 2, 117, '2010-05-22 01:00:44', NULL),
(72, 3, 117, '2010-05-22 01:00:44', NULL),
(73, 4, 117, '2010-05-22 01:00:44', NULL),
(74, 3, 108, '2010-05-22 11:46:45', NULL),
(75, 4, 108, '2010-05-22 11:46:45', NULL),
(76, 1, 148, '2010-05-22 12:41:13', NULL),
(77, 2, 148, '2010-05-22 12:41:13', NULL),
(78, 3, 148, '2010-05-22 12:41:13', NULL),
(79, 4, 148, '2010-05-22 12:41:13', NULL),
(80, 5, 148, '2010-05-22 12:41:13', NULL),
(81, 6, 148, '2010-05-22 12:41:13', NULL),
(82, 7, 148, '2010-05-22 12:41:13', NULL),
(83, 8, 148, '2010-05-22 12:41:13', NULL),
(84, 1, 150, '2010-05-24 12:59:01', NULL),
(85, 2, 150, '2010-05-24 12:59:01', NULL),
(86, 3, 150, '2010-05-24 12:59:01', NULL),
(87, 4, 150, '2010-05-24 12:59:01', NULL),
(88, 5, 150, '2010-05-24 12:59:01', NULL),
(89, 6, 150, '2010-05-24 12:59:01', NULL),
(90, 7, 150, '2010-05-24 12:59:01', NULL),
(91, 8, 150, '2010-05-24 12:59:01', NULL),
(92, 2, 98, '2010-05-28 17:48:42', NULL),
(93, 3, 98, '2010-05-28 17:48:42', NULL),
(94, 4, 98, '2010-05-28 17:48:42', NULL),
(95, 5, 98, '2010-05-28 17:48:42', NULL),
(96, 6, 98, '2010-05-28 17:48:42', NULL),
(97, 7, 98, '2010-05-28 17:48:42', NULL),
(98, 8, 98, '2010-05-28 17:48:42', NULL),
(99, 1, 142, '2010-05-28 17:49:22', NULL),
(100, 2, 142, '2010-05-28 17:49:22', NULL),
(101, 3, 142, '2010-05-28 17:49:22', NULL),
(102, 4, 142, '2010-05-28 17:49:22', NULL),
(103, 5, 142, '2010-05-28 17:49:22', NULL),
(104, 6, 142, '2010-05-28 17:49:22', NULL),
(105, 7, 142, '2010-05-28 17:49:22', NULL),
(106, 8, 142, '2010-05-28 17:49:22', NULL),
(107, 3, 100, '2010-05-28 17:49:49', NULL),
(108, 4, 100, '2010-05-28 17:49:49', NULL),
(109, 5, 100, '2010-05-28 17:49:49', NULL),
(110, 6, 100, '2010-05-28 17:49:49', NULL),
(111, 7, 100, '2010-05-28 17:49:49', NULL),
(112, 8, 100, '2010-05-28 17:49:49', NULL);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `permission`
--
ALTER TABLE `permission`
ADD CONSTRAINT `permission_ibfk_1` FOREIGN KEY (`moduleId`) REFERENCES `modules` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `rolePermission`
--
ALTER TABLE `rolePermission`
ADD CONSTRAINT `rolePermission_ibfk_1` FOREIGN KEY (`roleId`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `rolePermission_ibfk_2` FOREIGN KEY (`permissionId`) REFERENCES `permission` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
SET FOREIGN_KEY_CHECKS=1;
| true |
a86310d9a3a91552f2f31dcb8b8e9b9f0e537c27 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day11/select0005.sql | UTF-8 | 178 | 2.625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-10T00:05:00Z' AND timestamp<'2017-11-11T00:05:00Z' AND temperature>=37 AND temperature<=57
| true |
93ca44b6982f183a160986c40df039a5f6532eff | SQL | antarus/mystra-pve | /vagrant-conf/provision-sql/20160809.sql | UTF-8 | 63,330 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Lun 08 Août 2016 à 22:26
-- Version du serveur: 5.5.50-0ubuntu0.14.04.1
-- Version de PHP: 5.5.9-1ubuntu4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de données: `mystra_pve`
--
-- --------------------------------------------------------
--
-- Structure de la table `bosses`
--
CREATE TABLE IF NOT EXISTS `bosses` (
`idBosses` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id battlenet',
`nom` varchar(155) NOT NULL,
`level` int(11) NOT NULL,
`vie` int(11) DEFAULT NULL,
PRIMARY KEY (`idBosses`),
UNIQUE KEY `nom_UNIQUE` (`nom`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `bosses_has_npc`
--
CREATE TABLE IF NOT EXISTS `bosses_has_npc` (
`idBosses` int(11) NOT NULL,
`idNpc` int(11) NOT NULL,
PRIMARY KEY (`idBosses`,`idNpc`),
KEY `fk_bosses_has_npc_npc1_idx` (`idNpc`),
KEY `fk_bosses_has_npc_bosses1_idx` (`idBosses`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `classes`
--
CREATE TABLE IF NOT EXISTS `classes` (
`idClasses` int(11) NOT NULL AUTO_INCREMENT,
`couleur` varchar(7) NOT NULL,
`nom` varchar(45) NOT NULL,
`icon` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idClasses`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;
--
-- Contenu de la table `classes`
--
INSERT INTO `classes` (`idClasses`, `couleur`, `nom`, `icon`) VALUES
(1, '#C69B6D', 'Guerrier', NULL),
(2, '#F48CBA', 'Paladin', NULL),
(3, '#AAD372', 'Chasseur', NULL),
(4, '#FFF468', 'Voleur', NULL),
(5, '#AAAAAA', 'Prêtre', NULL),
(6, '#C41E3B', 'Chevalier de la mort', NULL),
(7, '#2359FF', 'Chaman', NULL),
(8, '#68CCEF', 'Mage', NULL),
(9, '#9382C9', 'Démoniste', NULL),
(10, '#008467', 'Moine', NULL),
(11, '#FF7C0A', 'Druide', NULL);
-- --------------------------------------------------------
--
-- Structure de la table `evenements`
--
CREATE TABLE IF NOT EXISTS `evenements` (
`idEvenements` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`dateHeureDebutInvitation` datetime DEFAULT NULL,
`dateHeureDebutEvenement` datetime DEFAULT NULL,
`dateHeureFinInscription` datetime NOT NULL,
`lvlMin` mediumint(9) DEFAULT NULL,
`ouvertATous` tinyint(1) DEFAULT NULL,
`dateCreation` datetime DEFAULT NULL,
`dateModification` datetime DEFAULT NULL,
`idDonjon` int(11) NOT NULL,
`idUsers` int(11) NOT NULL,
`idGuildes` int(11) DEFAULT NULL,
`idRoster` int(11) DEFAULT NULL,
`idEvenements_template` int(11) DEFAULT NULL,
PRIMARY KEY (`idEvenements`),
KEY `fk_evenements_donjon1_idx` (`idDonjon`),
KEY `fk_evenements_users1_idx` (`idUsers`),
KEY `fk_evenements_guildes1_idx` (`idGuildes`),
KEY `fk_evenements_roster1_idx` (`idRoster`),
KEY `fk_evenements_evenements_template1_idx` (`idEvenements_template`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `evenements_personnage`
--
CREATE TABLE IF NOT EXISTS `evenements_personnage` (
`idEvenement_personnage` int(11) NOT NULL AUTO_INCREMENT,
`status` varchar(45) DEFAULT NULL COMMENT 'abs\nvalide\nconfirme\npresent',
`dateCreation` datetime DEFAULT NULL,
`dateModification` datetime DEFAULT NULL,
`idEvenements` int(11) NOT NULL,
`idPersonnage` int(11) NOT NULL,
PRIMARY KEY (`idEvenement_personnage`),
KEY `fk_evenement_personnage_evenements1_idx` (`idEvenements`),
KEY `fk_evenement_personnage_personnage1_idx` (`idPersonnage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `evenements_roles`
--
CREATE TABLE IF NOT EXISTS `evenements_roles` (
`idEvenements_roles` int(11) NOT NULL AUTO_INCREMENT,
`nombre` mediumint(9) NOT NULL,
`ordre` mediumint(9) DEFAULT NULL,
`idEvenements` int(11) NOT NULL,
`idRole` int(11) NOT NULL,
PRIMARY KEY (`idEvenements_roles`),
KEY `fk_evenements_roles_evenements1_idx` (`idEvenements`),
KEY `fk_evenements_roles_role1_idx` (`idRole`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `evenements_template`
--
CREATE TABLE IF NOT EXISTS `evenements_template` (
`idEvenements_template` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`dateHeureDebutInvitation` datetime DEFAULT NULL,
`dateHeureDebutEvenement` datetime DEFAULT NULL,
`dateHeureFinInscription` datetime NOT NULL,
`lvlMin` mediumint(9) DEFAULT NULL,
`ouvertATous` tinyint(1) DEFAULT NULL,
`dateCreation` datetime DEFAULT NULL,
`dateModification` datetime DEFAULT NULL,
`idDonjon` int(11) NOT NULL,
`idGuildes` int(11) DEFAULT NULL,
`idRoster` int(11) DEFAULT NULL,
PRIMARY KEY (`idEvenements_template`),
KEY `fk_evenements_donjon1_idx` (`idDonjon`),
KEY `fk_evenements_template_guildes1_idx` (`idGuildes`),
KEY `fk_evenements_template_roster1_idx` (`idRoster`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `evenements_template_roles`
--
CREATE TABLE IF NOT EXISTS `evenements_template_roles` (
`idEvenements_template_roles` int(11) NOT NULL AUTO_INCREMENT,
`nombre` mediumint(9) DEFAULT NULL,
`ordre` mediumint(9) DEFAULT NULL,
`idEvenements_template` int(11) NOT NULL,
`idRoles` int(11) NOT NULL,
PRIMARY KEY (`idEvenements_template_roles`),
KEY `fk_evenements_template_roles_evenements_template1_idx` (`idEvenements_template`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `faction`
--
CREATE TABLE IF NOT EXISTS `faction` (
`idFaction` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) NOT NULL,
`logo` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idFaction`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `faction`
--
INSERT INTO `faction` (`idFaction`, `nom`, `logo`) VALUES
(0, 'Alliance', NULL),
(1, 'Horde', NULL);
-- --------------------------------------------------------
--
-- Structure de la table `guildes`
--
CREATE TABLE IF NOT EXISTS `guildes` (
`idGuildes` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) NOT NULL,
`serveur` varchar(150) NOT NULL,
`niveau` mediumint(9) DEFAULT NULL,
`miniature` varchar(100) DEFAULT NULL,
`idFaction` int(11) NOT NULL,
PRIMARY KEY (`idGuildes`),
KEY `fk_guildes_faction1_idx` (`idFaction`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Contenu de la table `guildes`
--
INSERT INTO `guildes` (`idGuildes`, `nom`, `serveur`, `niveau`, `miniature`, `idFaction`) VALUES
(1, 'Mystra', 'Garona', 25, '', 0);
-- --------------------------------------------------------
--
-- Structure de la table `items`
--
CREATE TABLE IF NOT EXISTS `items` (
`idItem` int(10) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`ajouterPar` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`majPar` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`idBnet` int(10) DEFAULT NULL,
`couleur` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`idItem`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
--
-- Contenu de la table `items`
--
INSERT INTO `items` (`idItem`, `nom`, `ajouterPar`, `majPar`, `idBnet`, `couleur`, `icon`) VALUES
(1, 'Remnant of Chaos', 'Import murloc', '', 133762, '', 'ability_felarakkoa_feldetonation_red'),
(2, 'Edict of Argus', 'Import murloc', '', 124382, '', 'inv_staff_2h_felfireraid_d_03'),
(3, 'Demon Prince''s Ascendant Crown', 'Import murloc', '', 124159, '', 'inv_helm_plate_archimonde_d_01'),
(4, 'Badge of Hellfire''s Conqueror', 'Import murloc', '', 127969, '', 'inv_jewelry_talisman_01'),
(5, 'Badge of Hellfire''s Protector', 'Import murloc', '', 127970, '', 'inv_jewelry_talisman_01'),
(6, 'Eredar Fel-Chain Gloves', 'Import murloc', '', 124291, '', 'inv_glove_mail_raidhunter_p_01'),
(7, 'Flickering Felspark', 'Import murloc', '', 124231, '', 'spell_fire_ragnaros_molteninfernogreen'),
(8, 'Felgrease-Smudged Robes', 'Import murloc', '', 124168, '', 'inv_cloth_raidmage_p_01robe'),
(9, 'Smoldercore Bulwark', 'Import murloc', '', 124356, '', 'inv_shield_1h_felfireraid_d_01'),
(10, 'Hand Loader Gauntlets', 'Import murloc', '', 124289, '', 'inv_glove_mail_raidhunter_p_01'),
(11, 'Voltage Regulation Diode', 'Import murloc', '', 124213, '', 'inv_6_2raid_necklace_1b'),
(12, 'Pedal-Pushing Sandals', 'Import murloc', '', 124148, '', 'inv_cloth_raidmage_p_01boot'),
(13, 'Pilot''s Pauldrons', 'Import murloc', '', 124174, '', 'inv_cloth_raidmage_p_01shoulder'),
(14, 'Iron Skullcrusher', 'Import murloc', '', 124373, '', 'inv_mace_1h_felfireraid_d_01'),
(15, 'Spiked Bloodstone Pendant', 'Import murloc', '', 124220, '', 'inv_6_0raid_necklace_4b'),
(16, 'Gurtogg''s Discarded Hood', 'Import murloc', '', 124258, '', 'inv_leather_raidrogue_p_01helm'),
(17, 'Bloody Berserker''s Bracers', 'Import murloc', '', 124312, '', 'inv_bracer_mail_raidhunter_p_01'),
(18, 'Ancient Gorestained Wrap', 'Import murloc', '', 124169, '', 'inv_robe_cloth_raidwarlock_p_01'),
(19, 'Shawl of Sanguinary Ritual', 'Import murloc', '', 124137, '', 'inv_cape_felfire_raid_d_01'),
(20, 'Toxicologist''s Treated Boots', 'Import murloc', '', 124250, '', 'inv_leather_raidrogue_p_01boots'),
(21, 'Congealed Globule Loop', 'Import murloc', '', 124197, '', 'inv_6_2raid_ring_4c'),
(22, 'Soulwarped Tower Shield', 'Import murloc', '', 124357, '', 'inv_shield_1h_felfireraid_d_02'),
(23, 'Chain Wristguards of the Stricken', 'Import murloc', '', 124313, '', 'inv_bracer_mail_raidshaman_p_01'),
(24, 'Casque of Foul Concentration', 'Import murloc', '', 124331, '', 'inv_plate_raidpaladin_p_01helm'),
(25, 'Gauntlets of Hellfire''s Protector', 'Import murloc', '', 127964, '', 'inv_gauntlets_29'),
(26, 'Satin Gloves of Injustice', 'Import murloc', '', 124153, '', 'inv_glove_cloth_raidpriest_p_01'),
(27, 'Oppressor''s Merciless Treads', 'Import murloc', '', 124251, '', 'inv_boot_leather_raidmonk_p_01'),
(28, 'Pauldrons of Contempt', 'Import murloc', '', 124306, '', 'inv_shoulder_mail_raidhunter_p_01'),
(29, 'Malicious Censer', 'Import murloc', '', 124226, '', 'inv_guild_cauldron_b'),
(30, 'Unstable Felshadow Emulsion', 'Import murloc', '', 124234, '', 'inv_misc_endlesspotion'),
(31, 'Shoulders of Hellfire''s Protector', 'Import murloc', '', 127967, '', 'inv_shoulder_22');
-- --------------------------------------------------------
--
-- Structure de la table `item_personnage_raid`
--
CREATE TABLE IF NOT EXISTS `item_personnage_raid` (
`idItemRaidPersonnage` int(11) NOT NULL AUTO_INCREMENT,
`idRaid` mediumint(8) NOT NULL,
`idItem` int(10) NOT NULL,
`idPersonnage` int(11) NOT NULL,
`valeur` float(10,2) DEFAULT NULL,
`bonus` varchar(150) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`idItemRaidPersonnage`),
KEY `fk_item_personnage_raid_raids1_idx` (`idRaid`),
KEY `fk_item_personnage_raid_items1_idx` (`idItem`),
KEY `fk_item_personnage_raid_personnages1_idx` (`idPersonnage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ;
--
-- Contenu de la table `item_personnage_raid`
--
INSERT INTO `item_personnage_raid` (`idItemRaidPersonnage`, `idRaid`, `idItem`, `idPersonnage`, `valeur`, `bonus`) VALUES
(1, 1, 1, 59, 0.00, ':::'),
(2, 1, 1, 98, 0.00, ':::'),
(3, 1, 1, 324, 0.00, ':::'),
(5, 1, 1, 105, 0.00, ':::'),
(7, 1, 3, 174, 0.00, '1798:1487:529:'),
(8, 1, 4, 62, 0.00, '570:::'),
(9, 1, 1, 130, 0.00, ':::'),
(10, 1, 4, 230, 0.00, '570:::'),
(11, 1, 5, 350, 0.00, '570:::'),
(12, 1, 6, 165, 0.00, '1798:41:1492:'),
(13, 2, 7, 174, 0.00, '1798:1492:3441:'),
(18, 2, 12, 101, 0.00, '1798:1487:529:'),
(22, 2, 16, 353, 0.00, '1798:1487:529:'),
(25, 2, 19, 105, 0.00, '1798:1487:529:'),
(26, 2, 20, 324, 0.00, '1798:1487:529:'),
(28, 2, 22, 166, 0.00, '1798:1487:529:'),
(29, 2, 23, 354, 0.00, '1798:1487:529:'),
(31, 2, 25, 249, 0.00, '570:::'),
(33, 2, 26, 59, 0.00, '1798:1487:529:'),
(34, 2, 27, 220, 0.00, '1798:1487:529:'),
(36, 2, 29, 98, 0.00, '1798:1487:529:'),
(37, 2, 30, 62, 0.00, '1798:42:1487:'),
(38, 2, 30, 130, 0.00, '1798:1497:3441:'),
(39, 2, 31, 350, 0.00, '570:::');
-- --------------------------------------------------------
--
-- Structure de la table `mode_difficulte`
--
CREATE TABLE IF NOT EXISTS `mode_difficulte` (
`idMode` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(100) NOT NULL,
`nom_bnet` varchar(100) DEFAULT NULL COMMENT 'nom battle net',
PRIMARY KEY (`idMode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- Contenu de la table `mode_difficulte`
--
INSERT INTO `mode_difficulte` (`idMode`, `nom`, `nom_bnet`) VALUES
(1, 'Raid LFR', 'RAID_FLEX_LFR'),
(2, 'Raid NM', 'RAID_FLEX_NORMAL'),
(3, 'Raid HM', 'RAID_FLEX_HEROIC'),
(4, 'Raid MM', 'RAID_MYTHIC'),
(5, 'Donjon NM', 'DUNGEON_NORMAL'),
(6, 'Donjon HM', 'DUNGEON_HEROIC'),
(7, 'Donjon MM', 'DUNGEON_MYTHIC');
-- --------------------------------------------------------
--
-- Structure de la table `npc`
--
CREATE TABLE IF NOT EXISTS `npc` (
`idNpc` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id battlenet',
`nom` varchar(45) NOT NULL,
PRIMARY KEY (`idNpc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `personnages`
--
CREATE TABLE IF NOT EXISTS `personnages` (
`idPersonnage` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`niveau` mediumint(9) NOT NULL,
`genre` tinyint(1) DEFAULT NULL COMMENT 'id battlenet\n1 femme\n0 homme',
`miniature` varchar(100) DEFAULT NULL,
`royaume` varchar(100) DEFAULT NULL,
`idFaction` int(11) NOT NULL,
`idClasses` int(11) NOT NULL,
`idRace` int(11) NOT NULL,
`idGuildes` int(11) DEFAULT NULL,
`idUsers` int(11) DEFAULT NULL,
PRIMARY KEY (`idPersonnage`),
KEY `fk_personnage_users1_idx` (`idUsers`),
KEY `fk_personnage_guildes1_idx` (`idGuildes`),
KEY `fk_personnages_faction1_idx` (`idFaction`),
KEY `fk_personnages_classes1_idx` (`idClasses`),
KEY `fk_personnages_race1_idx` (`idRace`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=361 ;
--
-- Contenu de la table `personnages`
--
INSERT INTO `personnages` (`idPersonnage`, `nom`, `niveau`, `genre`, `miniature`, `royaume`, `idFaction`, `idClasses`, `idRace`, `idGuildes`, `idUsers`) VALUES
(1, 'Ironkain', 100, 0, 'garona/172/1659564-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(2, 'Océannia', 100, 1, 'garona/104/1813864-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(3, 'Matéus', 100, 0, 'garona/121/1859705-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(4, 'Zatoichy', 100, 0, 'garona/104/2021992-avatar.jpg', 'Garona', 0, 5, 4, 1, NULL),
(5, 'Mordrède', 100, 0, 'garona/30/2636318-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(6, 'Lagaboulette', 100, 1, 'garona/223/2676447-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(7, 'Yarixa', 100, 1, 'garona/70/2711622-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(8, 'Prony', 100, 0, 'garona/83/2803795-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(9, 'Octo', 100, 0, 'garona/230/5208038-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(10, 'Kerimaa', 100, 1, 'garona/125/5767549-avatar.jpg', 'Garona', 0, 3, 11, 1, NULL),
(11, 'Capikaze', 100, 0, 'garona/170/9321898-avatar.jpg', 'Garona', 0, 1, 11, 1, NULL),
(12, 'Bøubøule', 100, 0, 'garona/79/9410383-avatar.jpg', 'Garona', 0, 3, 3, 1, NULL),
(13, 'Sadday', 100, 1, 'garona/46/9553198-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(14, 'Falinns', 100, 0, 'garona/234/9607402-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(15, 'Myna', 100, 1, 'garona/161/9657249-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(16, 'Reve', 100, 1, 'garona/148/9673876-avatar.jpg', 'Garona', 0, 9, 7, 1, NULL),
(17, 'Cely', 100, 1, 'garona/113/9790833-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(18, 'Alandrys', 100, 0, 'garona/58/9801530-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(19, 'Elirys', 100, 1, 'garona/137/10309257-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(20, 'Parlama', 100, 1, 'garona/143/10635151-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(21, 'Alax', 100, 0, 'garona/54/11104054-avatar.jpg', 'Garona', 0, 2, 3, 1, NULL),
(22, 'Acronomicon', 100, 0, 'garona/76/12192588-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(23, 'Lhilhi', 100, 1, 'garona/209/12288465-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(24, 'Arthyss', 100, 0, 'garona/109/12343149-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(25, 'Apisto', 100, 0, 'garona/199/12419527-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(26, 'Nryan', 100, 0, 'garona/87/12421719-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(27, 'Karabistouil', 100, 1, 'garona/66/13559106-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(28, 'Ptitepoucett', 100, 1, 'garona/237/13613805-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(29, 'Healsangel', 100, 1, 'garona/226/14281954-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(30, 'Kiev', 100, 0, 'garona/212/14996436-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(31, 'Nisya', 100, 1, 'garona/34/15257378-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(32, 'Waly', 100, 0, 'garona/223/16120287-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(33, 'Kaarapital', 100, 1, 'garona/134/16132486-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(34, 'Poupoucetire', 100, 1, 'garona/234/16132842-avatar.jpg', 'Garona', 0, 3, 11, 1, NULL),
(35, 'Arcalyne', 100, 1, 'garona/244/17042164-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(36, 'Kaarabine', 100, 1, 'garona/170/17945514-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(37, 'Lisys', 100, 1, 'garona/178/18159538-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(38, 'Bogossa', 100, 1, 'garona/71/19291463-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(39, 'Nostalgie', 100, 1, 'garona/25/19346713-avatar.jpg', 'Garona', 0, 5, 11, 1, NULL),
(40, 'Rurú', 100, 1, 'garona/200/19821000-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(41, 'Heresânkh', 100, 1, 'garona/158/20167326-avatar.jpg', 'Garona', 0, 5, 11, 1, NULL),
(42, 'Antarus', 100, 0, 'garona/146/21289874-avatar.jpg', 'Garona', 0, 5, 4, 1, NULL),
(43, 'Laetitiaa', 100, 1, 'garona/203/22083275-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(44, 'Khronøs', 100, 0, 'garona/125/23517053-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(45, 'Karalich', 100, 1, 'garona/26/23697690-avatar.jpg', 'Garona', 0, 6, 4, 1, NULL),
(46, 'Poulich', 100, 1, 'garona/109/23709549-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(47, 'Prozzak', 100, 0, 'garona/42/26734122-avatar.jpg', 'Garona', 0, 5, 3, 1, NULL),
(48, 'Bigbeer', 100, 0, 'garona/255/28860159-avatar.jpg', 'Garona', 0, 3, 3, 1, NULL),
(49, 'Redoot', 100, 1, 'garona/254/29159934-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(50, 'Byluna', 100, 1, 'garona/220/29529308-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(51, 'Plateùs', 100, 0, 'garona/10/30977034-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(52, 'Dooc', 100, 1, 'garona/2/33189122-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(53, 'Shynzu', 100, 1, 'garona/149/34208149-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(54, 'Lylybelle', 100, 1, 'garona/99/34321507-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(55, 'Ilidøs', 100, 0, 'garona/9/34456073-avatar.jpg', 'Garona', 0, 6, 4, 1, NULL),
(56, 'Tÿra', 100, 0, 'garona/57/35029305-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(57, 'Xcalibur', 100, 0, 'garona/24/35030552-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(58, 'Auron', 100, 0, 'garona/61/35204669-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(59, 'Tikchbila', 100, 0, 'garona/154/36140954-avatar.jpg', 'Garona', 0, 8, 22, 1, NULL),
(60, 'Harigston', 100, 1, 'garona/119/37148279-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(61, 'Aeoline', 100, 1, 'garona/61/37618237-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(62, 'Olare', 100, 0, 'garona/10/37762058-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(63, 'Bachantes', 100, 0, 'garona/49/39400497-avatar.jpg', 'Garona', 0, 1, 3, 1, NULL),
(64, 'Capï', 100, 1, 'garona/40/40891944-avatar.jpg', 'Garona', 0, 3, 25, 1, NULL),
(65, 'Pléco', 100, 1, 'garona/225/40947937-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(66, 'Dootty', 100, 1, 'garona/247/43145207-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(67, 'Cellesta', 100, 1, 'garona/19/43252755-avatar.jpg', 'Garona', 0, 5, 11, 1, NULL),
(68, 'Laugan', 100, 0, 'garona/23/45220631-avatar.jpg', 'Garona', 0, 5, 3, 1, NULL),
(69, 'Ptitelouve', 100, 1, 'garona/123/45595259-avatar.jpg', 'Garona', 0, 4, 22, 1, NULL),
(70, 'Talisia', 100, 1, 'garona/12/46258956-avatar.jpg', 'Garona', 0, 8, 7, 1, NULL),
(71, 'Spoiler', 100, 0, 'garona/31/46725407-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(72, 'Kalamïty', 100, 1, 'garona/195/48465859-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(73, 'Aelyne', 100, 1, 'garona/116/48794484-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(74, 'Félicias', 100, 1, 'garona/137/49561225-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(75, 'Iriséa', 100, 1, 'garona/60/49766972-avatar.jpg', 'Garona', 0, 8, 4, 1, NULL),
(76, 'Rapiou', 100, 0, 'garona/76/50125388-avatar.jpg', 'Garona', 0, 4, 22, 1, NULL),
(77, 'Ächille', 100, 0, 'garona/21/50140693-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(78, 'Thusùxx', 100, 0, 'garona/97/50817121-avatar.jpg', 'Garona', 0, 11, 22, 1, NULL),
(79, 'Cartam', 100, 0, 'garona/135/50938503-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(80, 'Mâjuscule', 100, 1, 'garona/85/51698517-avatar.jpg', 'Garona', 0, 8, 11, 1, NULL),
(81, 'Cartmân', 100, 0, 'garona/100/51740004-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(82, 'Deathinition', 100, 0, 'garona/206/52678862-avatar.jpg', 'Garona', 0, 6, 11, 1, NULL),
(83, 'Mérys', 100, 1, 'garona/141/52905101-avatar.jpg', 'Garona', 0, 4, 1, 1, NULL),
(84, 'Cartmän', 100, 0, 'garona/102/53301094-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(85, 'Jðe', 100, 0, 'garona/8/53700616-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(86, 'Gøuma', 100, 0, 'garona/116/54341236-avatar.jpg', 'Garona', 0, 8, 3, 1, NULL),
(87, 'Gøuminette', 100, 1, 'garona/120/54341240-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(88, 'Sømetimes', 100, 1, 'garona/74/54789706-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(89, 'Odreth', 100, 0, 'garona/231/55060199-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(90, 'Nydelia', 100, 1, 'garona/51/55169843-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(91, 'Valyanas', 100, 1, 'garona/30/55325214-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(92, 'Lønï', 100, 1, 'garona/254/55326462-avatar.jpg', 'Garona', 0, 8, 7, 1, NULL),
(93, 'Crysista', 100, 1, 'garona/148/55543956-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(94, 'Rylia', 100, 1, 'garona/83/55557203-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(95, 'Oriane', 100, 1, 'garona/205/55836621-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(96, 'Swanya', 100, 1, 'garona/7/56419335-avatar.jpg', 'Garona', 0, 3, 22, 1, NULL),
(97, 'Zazagentil', 100, 0, 'garona/46/56717358-avatar.jpg', 'Garona', 0, 5, 7, 1, NULL),
(98, 'Ðeltasu', 100, 0, 'garona/144/56734608-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(99, 'Nayka', 100, 1, 'garona/75/56993099-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(100, 'Galiowyn', 100, 0, 'garona/12/57240076-avatar.jpg', 'Garona', 0, 11, 22, 1, NULL),
(101, 'Philémons', 100, 0, 'garona/186/57348538-avatar.jpg', 'Garona', 0, 9, 7, 1, NULL),
(102, 'Smado', 100, 0, 'garona/114/57897330-avatar.jpg', 'Garona', 0, 10, 7, 1, NULL),
(103, 'Thyios', 100, 1, 'garona/106/57899626-avatar.jpg', 'Garona', 0, 10, 25, 1, NULL),
(104, 'Unnder', 100, 0, 'garona/253/58228221-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(105, 'Coonta', 100, 1, 'garona/127/59596159-avatar.jpg', 'Garona', 0, 9, 7, 1, NULL),
(106, 'Kâlia', 100, 1, 'garona/223/59663071-avatar.jpg', 'Garona', 0, 10, 25, 1, NULL),
(107, 'Jesuisblonde', 100, 1, 'garona/179/59805875-avatar.jpg', 'Garona', 0, 4, 1, 1, NULL),
(108, 'Olaf', 100, 0, 'garona/235/59918571-avatar.jpg', 'Garona', 0, 6, 3, 1, NULL),
(109, 'Aygul', 100, 1, 'garona/229/59934181-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(110, 'Thynael', 100, 1, 'garona/112/60011888-avatar.jpg', 'Garona', 0, 6, 22, 1, NULL),
(111, 'Drethz', 100, 0, 'garona/61/60030013-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(112, 'Amnésiâ', 100, 1, 'garona/24/60044568-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(113, 'Aryaa', 100, 1, 'garona/119/60073847-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(114, 'Ciryaliel', 100, 1, 'garona/237/60352493-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(115, 'Kâdyll', 100, 1, 'garona/244/60942836-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(116, 'Kàdyll', 100, 1, 'garona/85/61138261-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(117, 'Ivøri', 100, 1, 'garona/232/61292008-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(118, 'Deathss', 100, 0, 'garona/187/61502395-avatar.jpg', 'Garona', 0, 6, 22, 1, NULL),
(119, 'Angelÿn', 100, 1, 'garona/15/61609999-avatar.jpg', 'Garona', 0, 8, 25, 1, NULL),
(120, 'Yoshino', 100, 1, 'garona/60/61798972-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(121, 'Baêlle', 100, 1, 'garona/214/62194646-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(122, 'Suyon', 100, 1, 'garona/141/62668429-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(123, 'Yukïno', 100, 1, 'garona/164/62752932-avatar.jpg', 'Garona', 0, 6, 11, 1, NULL),
(124, 'Samisa', 100, 1, 'garona/43/62753835-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(125, 'Jisun', 100, 1, 'garona/42/63894058-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(126, 'Ayumu', 100, 1, 'garona/202/63920074-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(127, 'Mickie', 100, 1, 'garona/119/65614711-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(128, 'Minji', 100, 1, 'garona/115/65681011-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(129, 'Acta', 100, 1, 'garona/92/65854812-avatar.jpg', 'Ner''zhul', 0, 3, 11, 1, NULL),
(130, 'Nathe', 100, 1, 'garona/77/65920589-avatar.jpg', 'Ner''zhul', 0, 5, 1, NULL, NULL),
(131, 'Kréa', 100, 1, 'garona/121/65934969-avatar.jpg', 'Ner''zhul', 0, 7, 11, 1, NULL),
(132, 'Eclypse', 100, 1, 'garona/179/66122931-avatar.jpg', 'Ner''zhul', 0, 3, 22, 1, NULL),
(133, 'Healle', 100, 1, 'garona/96/66131296-avatar.jpg', 'Ner''zhul', 0, 5, 4, 1, NULL),
(134, 'Emac', 100, 1, 'garona/218/66211802-avatar.jpg', 'Ner''zhul', 0, 1, 22, 1, NULL),
(135, 'Dìgg', 100, 0, 'garona/173/66213549-avatar.jpg', 'Ner''zhul', 0, 8, 11, 1, NULL),
(136, 'Wumbat', 100, 0, 'garona/180/66235060-avatar.jpg', 'Ner''zhul', 0, 11, 22, 1, NULL),
(137, 'Lnaudru', 100, 1, 'garona/232/66251496-avatar.jpg', 'Ner''zhul', 0, 11, 22, 1, NULL),
(138, 'Alwynn', 100, 0, 'garona/253/66481661-avatar.jpg', 'Garona', 0, 5, 4, 1, NULL),
(139, 'Baldar', 100, 0, 'garona/61/66540093-avatar.jpg', 'Ner''zhul', 0, 2, 1, 1, NULL),
(140, 'Xylomi', 100, 1, 'garona/185/66549177-avatar.jpg', 'Ner''zhul', 0, 7, 11, 1, NULL),
(141, 'Hassakura', 100, 0, 'garona/104/66554472-avatar.jpg', 'Ner''zhul', 0, 7, 11, 1, NULL),
(142, 'Bellame', 100, 1, 'garona/86/67268182-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(143, 'Karacast', 100, 1, 'garona/89/67511385-avatar.jpg', 'Garona', 0, 9, 7, 1, NULL),
(144, 'Kaara', 100, 1, 'garona/152/67514776-avatar.jpg', 'Garona', 0, 8, 7, 1, NULL),
(145, 'Cøcalight', 100, 1, 'garona/69/67702597-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(146, 'Karaoutai', 100, 1, 'garona/10/67769098-avatar.jpg', 'Garona', 0, 5, 7, 1, NULL),
(147, 'Zygore', 100, 0, 'garona/94/67822686-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(148, 'Kimtan', 100, 1, 'garona/37/68474149-avatar.jpg', 'Garona', 0, 10, 4, 1, NULL),
(149, 'Jiwon', 100, 1, 'garona/83/68678739-avatar.jpg', 'Garona', 0, 6, 4, 1, NULL),
(150, 'Okarin', 100, 0, 'garona/37/69615909-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(151, 'Mûrmûr', 100, 1, 'garona/95/69866079-avatar.jpg', 'Garona', 0, 9, 22, 1, NULL),
(152, 'Cøcazerø', 100, 0, 'garona/86/70524502-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(153, 'Graalimpie', 100, 0, 'garona/192/71505600-avatar.jpg', 'Ner''zhul', 0, 6, 4, 1, NULL),
(154, 'Kadyl', 100, 1, 'garona/31/71591199-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(155, 'Mizutani', 100, 1, 'garona/21/72120085-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(156, 'Jevo', 100, 0, 'garona/124/73588092-avatar.jpg', 'Garona', 0, 8, 7, 1, NULL),
(157, 'Yùkinà', 100, 1, 'garona/1/73646593-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(158, 'Hayes', 100, 1, 'garona/99/73668963-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(159, 'Timelord', 100, 0, 'garona/53/73684021-avatar.jpg', 'Ner''zhul', 0, 1, 4, 1, NULL),
(160, 'Niylla', 100, 1, 'garona/133/73691781-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(161, 'Destinee', 100, 1, 'garona/76/73718092-avatar.jpg', 'Garona', 0, 8, 25, 1, NULL),
(162, 'Tîmelord', 100, 0, 'garona/38/73722406-avatar.jpg', 'Ner''zhul', 0, 3, 4, 1, NULL),
(163, 'Yùkinø', 100, 1, 'garona/144/73912720-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(164, 'Belleange', 100, 1, 'garona/253/73919997-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(165, 'Antaruss', 100, 1, 'garona/10/74018058-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(166, 'Christange', 100, 1, 'garona/87/74051159-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(167, 'Lenøre', 100, 1, 'garona/130/74374274-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(168, 'Bloodynight', 100, 1, 'garona/213/74478293-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(169, 'Xeralynn', 100, 1, 'garona/191/75077567-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(170, 'Lishaoran', 100, 0, 'garona/128/75897728-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(171, 'Zantell', 100, 1, 'garona/147/75911571-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(172, 'Benjiwars', 100, 0, 'garona/232/75921640-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(173, 'Kashyk', 100, 1, 'garona/172/75924396-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(174, 'Sfy', 100, 0, 'garona/77/77472589-avatar.jpg', 'Ner''zhul', 0, 8, 1, NULL, NULL),
(175, 'Jevy', 100, 0, 'garona/192/78349504-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(176, 'Nosfia', 100, 1, 'garona/196/78395588-avatar.jpg', 'Garona', 0, 1, 25, 1, NULL),
(177, 'Ewanaelle', 100, 1, 'garona/83/84882771-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(178, 'Miks', 100, 1, 'garona/106/89038442-avatar.jpg', 'Sargeras', 0, 9, 1, 1, NULL),
(179, 'Balrog', 100, 0, 'garona/68/89081924-avatar.jpg', 'Sargeras', 0, 1, 22, 1, NULL),
(180, 'Dogua', 100, 0, 'garona/166/89086886-avatar.jpg', 'Sargeras', 0, 9, 1, 1, NULL),
(181, 'Ildriar', 100, 0, 'garona/166/89091494-avatar.jpg', 'Sargeras', 0, 2, 1, 1, NULL),
(182, 'Misswow', 100, 1, 'garona/195/89097923-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(183, 'Azalaïs', 100, 1, 'garona/66/89184834-avatar.jpg', 'Sargeras', 0, 5, 4, 1, NULL),
(184, 'Drahas', 100, 0, 'garona/63/89275455-avatar.jpg', 'Sargeras', 0, 6, 11, 1, NULL),
(185, 'Chlöre', 100, 1, 'garona/96/89276000-avatar.jpg', 'Sargeras', 0, 6, 4, 1, NULL),
(186, 'Pushup', 100, 1, 'garona/20/89295892-avatar.jpg', 'Sargeras', 0, 8, 1, 1, NULL),
(187, 'Belnadifia', 100, 1, 'garona/228/89356004-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(188, 'Tohetta', 100, 1, 'garona/252/89367292-avatar.jpg', 'Sargeras', 0, 6, 1, 1, NULL),
(189, 'Damnetus', 100, 0, 'garona/24/89529880-avatar.jpg', 'Sargeras', 0, 11, 22, 1, NULL),
(190, 'Trinquette', 100, 1, 'garona/139/89549707-avatar.jpg', 'Sargeras', 0, 1, 1, 1, NULL),
(191, 'Parlevent', 100, 1, 'garona/9/89552649-avatar.jpg', 'Sargeras', 0, 7, 11, 1, NULL),
(192, 'Asharaak', 100, 0, 'garona/151/89552791-avatar.jpg', 'Sargeras', 0, 4, 22, 1, NULL),
(193, 'Drèams', 100, 1, 'garona/86/89564502-avatar.jpg', 'Sargeras', 0, 9, 1, 1, NULL),
(194, 'Ango', 100, 1, 'garona/73/89630537-avatar.jpg', 'Sargeras', 0, 5, 11, 1, NULL),
(195, 'Tifettes', 100, 1, 'garona/175/89636527-avatar.jpg', 'Sargeras', 0, 8, 4, 1, NULL),
(196, 'Riddick', 100, 0, 'garona/193/89665985-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(197, 'Lotùs', 100, 1, 'garona/240/89688304-avatar.jpg', 'Sargeras', 0, 4, 4, 1, NULL),
(198, 'Maenira', 100, 1, 'garona/18/89702930-avatar.jpg', 'Sargeras', 0, 5, 1, 1, NULL),
(199, 'Nynja', 100, 0, 'garona/150/89718422-avatar.jpg', 'Sargeras', 0, 10, 25, 1, NULL),
(200, 'Xàe', 100, 1, 'garona/27/89733403-avatar.jpg', 'Sargeras', 0, 8, 1, 1, NULL),
(201, 'Feniks', 100, 1, 'garona/78/89738318-avatar.jpg', 'Sargeras', 0, 10, 1, 1, NULL),
(202, 'Azhrei', 100, 0, 'garona/22/89739798-avatar.jpg', 'Sargeras', 0, 2, 1, 1, NULL),
(203, 'Fenixia', 100, 1, 'garona/178/89743282-avatar.jpg', 'Sargeras', 0, 8, 1, 1, NULL),
(204, 'Omezaroth', 100, 0, 'garona/19/89854483-avatar.jpg', 'Sargeras', 0, 3, 4, 1, NULL),
(205, 'Gromack', 100, 0, 'garona/112/90017136-avatar.jpg', 'Sargeras', 0, 1, 1, 1, NULL),
(206, 'Zephyel', 100, 0, 'garona/38/90068262-avatar.jpg', 'Sargeras', 0, 9, 22, 1, NULL),
(207, 'Spartìate', 100, 1, 'garona/25/92064537-avatar.jpg', 'Sargeras', 0, 1, 4, 1, NULL),
(208, 'Üther', 100, 0, 'garona/154/93266586-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(209, 'Nebutron', 100, 0, 'garona/80/93613392-avatar.jpg', 'Garona', 0, 8, 7, 1, NULL),
(210, 'Midoru', 100, 0, 'garona/174/93614510-avatar.jpg', 'Garona', 0, 3, 22, 1, NULL),
(211, 'Prédictrice', 100, 1, 'garona/236/93673708-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(212, 'Xinding', 100, 1, 'garona/38/93801510-avatar.jpg', 'Garona', 0, 4, 1, 1, NULL),
(213, 'Timelôrd', 100, 0, 'garona/61/93863997-avatar.jpg', 'Ner''zhul', 0, 11, 4, 1, NULL),
(214, 'Titepoucette', 100, 1, 'garona/69/94163269-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(215, 'Nokitsune', 100, 1, 'garona/242/94319090-avatar.jpg', 'Garona', 0, 10, 25, 1, NULL),
(216, 'Xäntra', 100, 1, 'garona/175/94611375-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(217, 'Zélya', 100, 1, 'garona/179/94718131-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(218, 'Seyer', 100, 0, 'garona/86/94837334-avatar.jpg', 'Sargeras', 0, 2, 1, 1, NULL),
(219, 'Kàdyl', 100, 1, 'garona/110/95004270-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(220, 'Wochifan', 100, 0, 'garona/245/95029749-avatar.jpg', 'Garona', 0, 10, 25, 1, NULL),
(221, 'Orophinae', 100, 1, 'garona/236/95043564-avatar.jpg', 'Garona', 0, 5, 11, 1, NULL),
(222, 'Eiziah', 100, 1, 'garona/93/95045213-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(223, 'Raenis', 100, 0, 'garona/229/95116261-avatar.jpg', 'Sargeras', 0, 3, 4, 1, NULL),
(224, 'Zoar', 100, 0, 'garona/228/95148004-avatar.jpg', 'Sargeras', 0, 9, 7, 1, NULL),
(225, 'Anyra', 100, 1, 'garona/232/95432936-avatar.jpg', 'Sargeras', 0, 3, 1, 1, NULL),
(226, 'Eon', 100, 1, 'garona/17/95441937-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(227, 'Nøsfé', 100, 0, 'garona/244/95503092-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(228, 'Irginwor', 100, 0, 'garona/62/95794238-avatar.jpg', 'Ner''zhul', 0, 9, 1, 1, NULL),
(229, 'Ayshell', 100, 1, 'garona/62/96186942-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(230, 'Kâdyl', 100, 1, 'garona/25/96249369-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(231, 'Elyä', 100, 1, 'garona/84/96272212-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(232, 'Galérius', 100, 0, 'garona/235/96323819-avatar.jpg', 'Garona', 0, 11, 22, 1, NULL),
(233, 'Amassis', 100, 0, 'garona/105/96431465-avatar.jpg', 'Sargeras', 0, 8, 11, 1, NULL),
(234, 'Lèvy', 100, 1, 'garona/246/96557046-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(235, 'Märgâlärds', 100, 0, 'garona/13/96674829-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(236, 'Kidipet', 100, 0, 'garona/169/96749993-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(237, 'Myllenia', 100, 1, 'garona/149/96820373-avatar.jpg', 'Sargeras', 0, 5, 1, 1, NULL),
(238, 'Kidisparai', 100, 0, 'garona/183/96877239-avatar.jpg', 'Garona', 0, 1, 3, 1, NULL),
(239, 'Ida', 100, 1, 'garona/80/96981584-avatar.jpg', 'Garona', 0, 4, 3, 1, NULL),
(240, 'Anÿ', 100, 1, 'garona/13/96982797-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(241, 'Belanima', 100, 1, 'garona/41/97195305-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(242, 'Hibe', 100, 0, 'garona/193/97235905-avatar.jpg', 'Sargeras', 0, 2, 3, 1, NULL),
(243, 'Kâdyll', 100, 1, 'garona/146/97287058-avatar.jpg', 'Ner''zhul', 0, 4, 1, 1, NULL),
(244, 'Myllé', 100, 1, 'garona/75/97468747-avatar.jpg', 'Sargeras', 0, 8, 1, 1, NULL),
(245, 'Cëly', 100, 1, 'garona/12/98057228-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(246, 'Kuramì', 100, 1, 'garona/5/98185477-avatar.jpg', 'Garona', 0, 7, 25, 1, NULL),
(247, 'Chandrak', 100, 1, 'garona/19/98205971-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(248, 'Kazathwin', 100, 0, 'garona/77/98251853-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(249, 'Commonbaby', 100, 0, 'garona/125/98300541-avatar.jpg', 'Sargeras', 0, 1, 1, 1, NULL),
(250, 'Luminara', 100, 1, 'garona/112/98507376-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(251, 'Tatoon', 100, 1, 'garona/148/98531988-avatar.jpg', 'Garona', 0, 5, 4, 1, NULL),
(252, 'Løuu', 100, 1, 'garona/65/98663233-avatar.jpg', 'Garona', 0, 10, 25, 1, NULL),
(253, 'Shaölin', 100, 0, 'garona/158/98933406-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(254, 'Rénovatrice', 100, 1, 'garona/53/99038261-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(255, 'Protectrice', 100, 1, 'garona/68/99038276-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(256, 'Ragnfrid', 100, 1, 'garona/113/99224689-avatar.jpg', 'Ner''zhul', 0, 2, 11, 1, NULL),
(257, 'Lorelaïs', 100, 1, 'garona/190/99256766-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(258, 'Nénuphar', 100, 1, 'garona/198/99263174-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(259, 'Frizzy', 100, 1, 'garona/151/99375255-avatar.jpg', 'Garona', 0, 8, 11, 1, NULL),
(260, 'Ashéron', 100, 0, 'garona/8/99442440-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(261, 'Equinoc', 100, 0, 'garona/198/99486150-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(262, 'Gàdock', 100, 0, 'garona/67/99504451-avatar.jpg', 'Garona', 0, 2, 3, 1, NULL),
(263, 'Kïkï', 100, 1, 'garona/18/99551250-avatar.jpg', 'Garona', 0, 1, 11, 1, NULL),
(264, 'Darthvicious', 100, 0, 'garona/134/99609478-avatar.jpg', 'Ner''zhul', 0, 6, 1, 1, NULL),
(265, 'Kadyll', 100, 0, 'garona/208/99687376-avatar.jpg', 'Sargeras', 0, 1, 1, 1, NULL),
(266, 'Daxou', 100, 0, 'garona/164/99707812-avatar.jpg', 'Garona', 0, 3, 3, 1, NULL),
(267, 'Jolarson', 100, 0, 'garona/15/99708175-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(268, 'Dameos', 100, 0, 'garona/170/99708330-avatar.jpg', 'Garona', 0, 1, 4, 1, NULL),
(269, 'Nawamoon', 100, 1, 'garona/146/99708562-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(270, 'Isyama', 100, 1, 'garona/185/99710649-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(271, 'Syriana', 100, 1, 'garona/215/99710935-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(272, 'Drassien', 100, 0, 'garona/204/99721420-avatar.jpg', 'Garona', 0, 9, 22, 1, NULL),
(273, 'Potak', 100, 0, 'garona/141/99785101-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(274, 'Chëësycrüst', 100, 1, 'garona/59/99807035-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(275, 'Zekee', 100, 0, 'garona/209/99812817-avatar.jpg', 'Garona', 0, 4, 22, 1, NULL),
(276, 'Pixie', 100, 1, 'garona/51/99822899-avatar.jpg', 'Garona', 0, 11, 22, 1, NULL),
(277, 'Kälïndrä', 100, 1, 'garona/126/99853694-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(278, 'Dürkor', 100, 0, 'garona/3/100087043-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(279, 'Nourslaouf', 100, 1, 'garona/50/100186162-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(280, 'Iphigénias', 100, 1, 'garona/223/100218335-avatar.jpg', 'Garona', 0, 3, 11, 1, NULL),
(281, 'Persefal', 100, 0, 'garona/7/100224775-avatar.jpg', 'Garona', 0, 11, 22, 1, NULL),
(282, 'Tiliön', 100, 0, 'garona/250/100260346-avatar.jpg', 'Sargeras', 0, 3, 4, 1, NULL),
(283, 'Farramirht', 100, 0, 'garona/201/100285641-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(284, 'Byx', 100, 1, 'garona/224/100363488-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(285, 'Dhämey', 100, 1, 'garona/15/100442127-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(286, 'Myllénième', 100, 1, 'garona/83/100450643-avatar.jpg', 'Sargeras', 0, 10, 1, 1, NULL),
(287, 'Arrowdiac', 100, 0, 'garona/132/100508036-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(288, 'Yükinø', 100, 1, 'garona/239/100547311-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(289, 'Saggitarius', 100, 0, 'garona/97/100550241-avatar.jpg', 'Sargeras', 0, 9, 22, 1, NULL),
(290, 'Redd', 100, 0, 'garona/205/100577741-avatar.jpg', 'Garona', 0, 4, 22, 1, NULL),
(291, 'Melyria', 100, 1, 'garona/128/100578688-avatar.jpg', 'Garona', 0, 5, 22, 1, NULL),
(292, 'Bonobo', 100, 1, 'garona/151/100625815-avatar.jpg', 'Garona', 0, 10, 4, 1, NULL),
(293, 'Neeli', 100, 1, 'garona/92/100661340-avatar.jpg', 'Garona', 0, 1, 11, 1, NULL),
(294, 'Edmun', 100, 0, 'garona/120/100721784-avatar.jpg', 'Ner''zhul', 0, 11, 22, 1, NULL),
(295, 'Cøuette', 100, 1, 'garona/153/100756889-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(296, 'Thoby', 100, 0, 'garona/105/100765545-avatar.jpg', 'Garona', 0, 6, 22, 1, NULL),
(297, 'Naïntuable', 100, 0, 'garona/231/100769255-avatar.jpg', 'Garona', 0, 2, 11, 1, NULL),
(298, 'Trìs', 100, 1, 'garona/82/100809554-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(299, 'Gadounette', 100, 1, 'garona/115/100829043-avatar.jpg', 'Garona', 0, 5, 11, 1, NULL),
(300, 'Nowek', 100, 1, 'garona/232/100914408-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(301, 'Ptibouldpoil', 100, 0, 'garona/214/100969686-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(302, 'Natundra', 100, 1, 'garona/42/100976170-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(303, 'Seiily', 100, 1, 'garona/21/101098773-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(304, 'Chamyfou', 100, 0, 'garona/92/101108828-avatar.jpg', 'Sargeras', 0, 7, 25, 1, NULL),
(305, 'Dayia', 100, 1, 'garona/66/101109314-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(306, 'Elenorias', 100, 1, 'garona/106/101133674-avatar.jpg', 'Sargeras', 0, 9, 1, 1, NULL),
(307, 'Ankôu', 100, 0, 'garona/8/101351432-avatar.jpg', 'Garona', 0, 6, 1, 1, NULL),
(308, 'Marlöw', 100, 0, 'garona/143/101380751-avatar.jpg', 'Garona', 0, 1, 11, 1, NULL),
(309, 'Woôd', 100, 0, 'garona/231/101402599-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(310, 'Lania', 100, 1, 'garona/137/101420169-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(311, 'Pesthys', 100, 1, 'garona/128/101501824-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(312, 'Mîou', 100, 1, 'garona/212/101528788-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(313, 'Mîû', 100, 1, 'garona/116/101539700-avatar.jpg', 'Sargeras', 0, 8, 1, 1, NULL),
(314, 'Noriah', 100, 1, 'garona/204/101565388-avatar.jpg', 'Garona', 0, 7, 3, 1, NULL),
(315, 'Copaincochon', 100, 0, 'garona/146/101653394-avatar.jpg', 'Garona', 0, 3, 4, 1, NULL),
(316, 'Myurogue', 100, 1, 'garona/24/101660696-avatar.jpg', 'Sargeras', 0, 4, 3, 1, NULL),
(317, 'Myû', 100, 1, 'garona/72/101688136-avatar.jpg', 'Sargeras', 0, 3, 1, 1, NULL),
(318, 'Miöü', 100, 1, 'garona/52/101781300-avatar.jpg', 'Sargeras', 0, 2, 1, 1, NULL),
(319, 'Myouu', 100, 1, 'garona/46/101840174-avatar.jpg', 'Sargeras', 0, 6, 11, 1, NULL),
(320, 'Zigloo', 100, 0, 'garona/80/102043984-avatar.jpg', 'Sargeras', 0, 6, 1, 1, NULL),
(321, 'Jðke', 100, 0, 'garona/178/102047666-avatar.jpg', 'Garona', 0, 3, 1, 1, NULL),
(322, 'Myumonk', 100, 1, 'garona/62/102097726-avatar.jpg', 'Sargeras', 0, 10, 1, 1, NULL),
(323, 'Shapodpaille', 100, 1, 'garona/227/102107107-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(324, 'Féniks', 100, 1, 'garona/225/102218721-avatar.jpg', 'Sargeras', 0, 4, 1, 1, NULL),
(325, 'Miucham', 100, 0, 'garona/134/102253446-avatar.jpg', 'Sargeras', 0, 7, 11, 1, NULL),
(326, 'Myuwar', 100, 1, 'garona/29/102320925-avatar.jpg', 'Sargeras', 0, 1, 7, 1, NULL),
(327, 'Myupriest', 100, 1, 'garona/26/102329114-avatar.jpg', 'Sargeras', 0, 5, 1, 1, NULL),
(328, 'Myudemo', 100, 1, 'garona/33/102329121-avatar.jpg', 'Sargeras', 0, 9, 7, 1, NULL),
(329, 'Garfunk', 100, 1, 'garona/164/102413220-avatar.jpg', 'Garona', 0, 8, 4, 1, NULL),
(330, 'Escaheris', 100, 0, 'garona/44/102492716-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(331, 'Gothmog', 100, 0, 'garona/138/102506122-avatar.jpg', 'Ner''zhul', 0, 9, 1, 1, NULL),
(332, 'Capiana', 100, 1, 'garona/70/102515782-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(333, 'Myllésime', 100, 1, 'garona/36/102587940-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(334, 'Sâber', 100, 1, 'garona/145/102615441-avatar.jpg', 'Garona', 0, 1, 11, 1, NULL),
(335, 'Peckeur', 100, 0, 'garona/69/102676293-avatar.jpg', 'Garona', 0, 9, 7, 1, NULL),
(336, 'Balcmeg', 100, 0, 'garona/226/102748898-avatar.jpg', 'Garona', 0, 3, 22, 1, NULL),
(337, 'Orgäna', 100, 1, 'garona/124/102948732-avatar.jpg', 'Garona', 0, 5, 4, 1, NULL),
(338, 'Yooda', 100, 0, 'garona/147/102948755-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(339, 'Amidalä', 100, 1, 'garona/0/102993152-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(340, 'Watto', 100, 0, 'garona/127/102993791-avatar.jpg', 'Garona', 0, 1, 1, 1, NULL),
(341, 'Fréya', 100, 1, 'garona/87/103414103-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(342, 'Belami', 100, 0, 'garona/252/103604476-avatar.jpg', 'Garona', 0, 9, 1, 1, NULL),
(343, 'Malonys', 100, 1, 'garona/120/103699320-avatar.jpg', 'Ner''zhul', 0, 11, 4, 1, NULL),
(344, 'Keldrys', 100, 0, 'garona/179/103814579-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(345, 'Subkryss', 100, 0, 'garona/234/103856874-avatar.jpg', 'Garona', 0, 6, 4, 1, NULL),
(346, 'Mîôû', 100, 1, 'garona/238/103861998-avatar.jpg', 'Sargeras', 0, 11, 4, 1, NULL),
(347, 'Akakaros', 100, 0, 'garona/39/103966759-avatar.jpg', 'Garona', 0, 8, 1, 1, NULL),
(348, 'Storran', 100, 0, 'garona/127/104337279-avatar.jpg', 'Garona', 0, 2, 1, 1, NULL),
(349, 'Jeanluc', 100, 0, 'garona/199/104374983-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(350, 'Gârfunk', 100, 1, 'garona/181/104378805-avatar.jpg', 'Garona', 0, 10, 11, 1, NULL),
(351, 'Justyce', 100, 1, 'garona/167/104588455-avatar.jpg', 'Sargeras', 0, 5, 1, 1, NULL),
(352, 'Trìskel', 100, 1, 'garona/26/104911642-avatar.jpg', 'Garona', 0, 5, 1, 1, NULL),
(353, 'Xântra', 100, 1, 'garona/23/104968727-avatar.jpg', 'Garona', 0, 11, 4, 1, NULL),
(354, 'Faïlly', 100, 0, 'garona/74/104989514-avatar.jpg', 'Garona', 0, 5, 3, 1, NULL),
(355, 'Nïcky', 100, 1, 'garona/67/105019459-avatar.jpg', 'Garona', 0, 7, 11, 1, NULL),
(356, 'Liköpi', 100, 0, 'garona/255/90054655-avatar.jpg', 'Sargeras', 0, 7, 11, 1, NULL),
(357, 'Haknarion', 100, 0, 'garona/136/90073736-avatar.jpg', 'Sargeras', 0, 1, 1, 1, NULL),
(358, 'Alys', 100, 1, 'garona/216/61403608-avatar.jpg', 'Garona', 0, 10, 1, 1, NULL),
(359, 'Sloveyn', 100, 1, 'garona/172/105300908-avatar.jpg', 'Garona', 0, 7, 25, 1, NULL),
(360, 'Mÿsti', 100, 1, 'internal-record-3714/139/105779083-avatar.jpg', 'Kirin Tor', 0, 11, 22, NULL, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `personnages_has_specialisation`
--
CREATE TABLE IF NOT EXISTS `personnages_has_specialisation` (
`specialisation_idSpecialisation` int(11) NOT NULL,
`personnages_idPersonnage` int(11) NOT NULL,
`isPrincipal` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`specialisation_idSpecialisation`,`personnages_idPersonnage`),
KEY `fk_specialisation_has_personnages_personnages1_idx` (`personnages_idPersonnage`),
KEY `fk_specialisation_has_personnages_specialisation1_idx` (`specialisation_idSpecialisation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `race`
--
CREATE TABLE IF NOT EXISTS `race` (
`idRace` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(45) NOT NULL,
`icon` varchar(255) DEFAULT NULL,
PRIMARY KEY (`idRace`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=27 ;
--
-- Contenu de la table `race`
--
INSERT INTO `race` (`idRace`, `nom`, `icon`) VALUES
(1, 'Humain', NULL),
(2, 'Orc', NULL),
(3, 'Nain', NULL),
(4, 'Elfe de la nuit', NULL),
(5, 'Mort-vivant', NULL),
(6, 'Tauren', NULL),
(7, 'Gnome', NULL),
(8, 'Troll', NULL),
(9, 'Gobelin', NULL),
(10, 'Elfe de sang', NULL),
(11, 'Draeneï', NULL),
(22, 'Worgen', NULL),
(24, 'Pandaren', NULL),
(25, 'Pandaren', NULL),
(26, 'Pandaren', NULL);
-- --------------------------------------------------------
--
-- Structure de la table `raids`
--
CREATE TABLE IF NOT EXISTS `raids` (
`idRaid` mediumint(8) NOT NULL AUTO_INCREMENT,
`idEvenements` int(11) DEFAULT NULL,
`date` timestamp NULL DEFAULT NULL,
`note` text CHARACTER SET utf8 COLLATE utf8_bin,
`valeur` float(6,2) DEFAULT '0.00',
`ajoutePar` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`majPar` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`idRaid`),
KEY `fk_raids_evenements1_idx` (`idEvenements`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Contenu de la table `raids`
--
INSERT INTO `raids` (`idRaid`, `idEvenements`, `date`, `note`, `valeur`, `ajoutePar`, `majPar`) VALUES
(1, NULL, '2016-08-03 21:16:10', 'Hellfire Citadel - flex HM', 0.00, 'Import murloc', ''),
(2, NULL, '2016-08-03 18:50:10', 'Hellfire Citadel - flex HM', 0.00, 'Import murloc', '');
-- --------------------------------------------------------
--
-- Structure de la table `raid_personnage`
--
CREATE TABLE IF NOT EXISTS `raid_personnage` (
`idRaid` mediumint(8) NOT NULL,
`idPersonnage` int(11) NOT NULL,
PRIMARY KEY (`idRaid`,`idPersonnage`),
KEY `fk_raid_personnage_raids1_idx` (`idRaid`),
KEY `fk_raid_personnage_personnages1_idx` (`idPersonnage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Contenu de la table `raid_personnage`
--
INSERT INTO `raid_personnage` (`idRaid`, `idPersonnage`) VALUES
(1, 59),
(1, 62),
(1, 64),
(1, 81),
(1, 98),
(1, 101),
(1, 105),
(1, 130),
(1, 138),
(1, 165),
(1, 166),
(1, 174),
(1, 220),
(1, 230),
(1, 249),
(1, 262),
(1, 324),
(1, 350),
(1, 352),
(1, 353),
(1, 354),
(1, 360),
(2, 59),
(2, 62),
(2, 64),
(2, 81),
(2, 98),
(2, 101),
(2, 105),
(2, 130),
(2, 138),
(2, 166),
(2, 174),
(2, 220),
(2, 230),
(2, 249),
(2, 262),
(2, 324),
(2, 350),
(2, 352),
(2, 353),
(2, 354),
(2, 360);
-- --------------------------------------------------------
--
-- Structure de la table `role`
--
CREATE TABLE IF NOT EXISTS `role` (
`idRole` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(55) NOT NULL,
PRIMARY KEY (`idRole`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Contenu de la table `role`
--
INSERT INTO `role` (`idRole`, `nom`) VALUES
(1, 'Tank'),
(2, 'Soigneur'),
(3, 'DPS Cac'),
(4, 'DPS Distant');
-- --------------------------------------------------------
--
-- Structure de la table `roster`
--
CREATE TABLE IF NOT EXISTS `roster` (
`idRoster` int(11) NOT NULL AUTO_INCREMENT,
`nom` varchar(100) NOT NULL,
PRIMARY KEY (`idRoster`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `roster_has_personnage`
--
CREATE TABLE IF NOT EXISTS `roster_has_personnage` (
`idRoster` int(11) NOT NULL,
`idPersonnage` int(11) NOT NULL,
PRIMARY KEY (`idRoster`,`idPersonnage`),
KEY `fk_roster_has_personnage_personnage1_idx` (`idPersonnage`),
KEY `fk_roster_has_personnage_roster1_idx` (`idRoster`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `specialisation`
--
CREATE TABLE IF NOT EXISTS `specialisation` (
`idSpecialisation` int(11) NOT NULL AUTO_INCREMENT,
`idClasses` int(11) NOT NULL,
`idRole` int(11) NOT NULL,
`nom` varchar(100) NOT NULL,
`icon` varchar(100) DEFAULT NULL,
PRIMARY KEY (`idSpecialisation`),
KEY `fk_specialisation_classes1_idx` (`idClasses`),
KEY `fk_specialisation_role1_idx` (`idRole`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ;
--
-- Contenu de la table `specialisation`
--
INSERT INTO `specialisation` (`idSpecialisation`, `idClasses`, `idRole`, `nom`, `icon`) VALUES
(1, 1, 3, 'Armes', 'ability_warrior_savageblow'),
(2, 1, 3, 'Fureur', 'ability_warrior_innerrage'),
(3, 1, 1, 'Protection', 'ability_warrior_defensivestance'),
(4, 2, 2, 'Sacré', 'spell_holy_holybolt'),
(5, 2, 1, 'Protection', 'ability_paladin_shieldofthetemplar'),
(6, 2, 3, 'Vindicte', 'spell_holy_auraoflight'),
(7, 3, 4, 'Maîtrise des bêtes', 'ability_hunter_bestialdiscipline'),
(8, 3, 4, 'Précision', 'ability_hunter_focusedaim'),
(9, 3, 4, 'Survie', 'ability_hunter_camouflage'),
(10, 4, 3, 'Assassinat', 'ability_rogue_eviscerate'),
(11, 4, 3, 'Combat', 'ability_backstab'),
(12, 4, 3, 'Finesse', 'ability_stealth'),
(13, 5, 2, 'Discipline', 'spell_holy_powerwordshield'),
(14, 5, 2, 'Sacré', 'spell_holy_guardianspirit'),
(15, 5, 4, 'Ombre', 'spell_shadow_shadowwordpain'),
(16, 6, 1, 'Sang', 'spell_deathknight_bloodpresence'),
(17, 6, 3, 'Givre', 'spell_deathknight_frostpresence'),
(18, 6, 3, 'Impie', 'spell_deathknight_unholypresence'),
(19, 7, 4, 'Élémentaire', 'spell_nature_lightning'),
(20, 7, 3, 'Amélioration', 'spell_shaman_improvedstormstrike'),
(21, 7, 2, 'Restauration', 'spell_nature_magicimmunity'),
(22, 8, 4, 'Arcanes', 'spell_holy_magicalsentry'),
(23, 8, 4, 'Feu', 'spell_fire_firebolt02'),
(24, 8, 4, 'Givre', 'spell_frost_frostbolt02'),
(25, 9, 4, 'Affliction', 'spell_shadow_deathcoil'),
(26, 9, 4, 'Démonologie', 'spell_shadow_metamorphosis'),
(27, 9, 4, 'Destruction', 'spell_shadow_rainoffire'),
(28, 10, 1, 'Maître brasseur', 'spell_monk_brewmaster_spec'),
(29, 10, 2, 'Tisse-brume', 'spell_monk_mistweaver_spec'),
(30, 10, 3, 'Marche-vent', 'spell_monk_windwalker_spec'),
(31, 11, 4, 'Équilibre', 'spell_nature_starfall'),
(32, 11, 3, 'Farouche', 'ability_druid_catform'),
(33, 11, 1, 'Gardien', 'ability_racial_bearform'),
(34, 11, 2, 'Restauration', 'spell_nature_healingtouch');
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`idUsers` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(15) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`pwd` varchar(150) NOT NULL,
`pseudo` varchar(150) DEFAULT NULL,
`email` varchar(250) DEFAULT NULL,
`avatar` varchar(150) DEFAULT NULL,
`admin` tinyint(1) DEFAULT NULL,
`forgetPass` varchar(500) DEFAULT NULL,
PRIMARY KEY (`idUsers`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `zone`
--
CREATE TABLE IF NOT EXISTS `zone` (
`idZone` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id battlenet',
`nom` varchar(255) NOT NULL,
`lvlMin` mediumint(9) NOT NULL,
`lvlMax` mediumint(9) NOT NULL,
`tailleMin` mediumint(9) NOT NULL,
`tailleMax` mediumint(9) NOT NULL,
`patch` varchar(45) NOT NULL,
`isDonjon` tinyint(1) NOT NULL,
`isRaid` tinyint(1) NOT NULL,
PRIMARY KEY (`idZone`),
UNIQUE KEY `nom_UNIQUE` (`nom`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Structure de la table `zone_has_bosses`
--
CREATE TABLE IF NOT EXISTS `zone_has_bosses` (
`idZone` int(11) NOT NULL,
`idBosses` int(11) NOT NULL,
PRIMARY KEY (`idZone`,`idBosses`),
KEY `fk_zone_has_bosses_bosses1_idx` (`idBosses`),
KEY `fk_zone_has_bosses_zone1_idx` (`idZone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Structure de la table `zone_has_mode_diffculte`
--
CREATE TABLE IF NOT EXISTS `zone_has_mode_diffculte` (
`idZone` int(11) NOT NULL,
`idMode` int(11) NOT NULL,
PRIMARY KEY (`idZone`,`idMode`),
KEY `fk_mode_difficulte_has_zone_zone1_idx` (`idZone`),
KEY `fk_mode_difficulte_has_zone_mode_difficulte1_idx` (`idMode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Contraintes pour les tables exportées
--
--
-- Contraintes pour la table `bosses_has_npc`
--
ALTER TABLE `bosses_has_npc`
ADD CONSTRAINT `fk_bosses_has_npc_bosses1` FOREIGN KEY (`idBosses`) REFERENCES `bosses` (`idBosses`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_bosses_has_npc_npc1` FOREIGN KEY (`idNpc`) REFERENCES `npc` (`idNpc`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `evenements`
--
ALTER TABLE `evenements`
ADD CONSTRAINT `fk_evenements_donjon1` FOREIGN KEY (`idDonjon`) REFERENCES `zone` (`idZone`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_evenements_template1` FOREIGN KEY (`idEvenements_template`) REFERENCES `evenements_template` (`idEvenements_template`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_guildes1` FOREIGN KEY (`idGuildes`) REFERENCES `guildes` (`idGuildes`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_roster1` FOREIGN KEY (`idRoster`) REFERENCES `roster` (`idRoster`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_users1` FOREIGN KEY (`idUsers`) REFERENCES `users` (`idUsers`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `evenements_personnage`
--
ALTER TABLE `evenements_personnage`
ADD CONSTRAINT `fk_evenement_personnage_evenements1` FOREIGN KEY (`idEvenements`) REFERENCES `evenements` (`idEvenements`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenement_personnage_personnage1` FOREIGN KEY (`idPersonnage`) REFERENCES `personnages` (`idPersonnage`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `evenements_roles`
--
ALTER TABLE `evenements_roles`
ADD CONSTRAINT `fk_evenements_roles_evenements1` FOREIGN KEY (`idEvenements`) REFERENCES `evenements` (`idEvenements`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_roles_role1` FOREIGN KEY (`idRole`) REFERENCES `role` (`idRole`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `evenements_template`
--
ALTER TABLE `evenements_template`
ADD CONSTRAINT `fk_evenements_donjon10` FOREIGN KEY (`idDonjon`) REFERENCES `zone` (`idZone`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_template_guildes1` FOREIGN KEY (`idGuildes`) REFERENCES `guildes` (`idGuildes`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_evenements_template_roster1` FOREIGN KEY (`idRoster`) REFERENCES `roster` (`idRoster`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `evenements_template_roles`
--
ALTER TABLE `evenements_template_roles`
ADD CONSTRAINT `fk_evenements_template_roles_evenements_template1` FOREIGN KEY (`idEvenements_template`) REFERENCES `evenements_template` (`idEvenements_template`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `guildes`
--
ALTER TABLE `guildes`
ADD CONSTRAINT `fk_guildes_faction1` FOREIGN KEY (`idFaction`) REFERENCES `faction` (`idFaction`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `item_personnage_raid`
--
ALTER TABLE `item_personnage_raid`
ADD CONSTRAINT `fk_item_personnage_raid_items1` FOREIGN KEY (`idItem`) REFERENCES `items` (`idItem`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_item_personnage_raid_personnages1` FOREIGN KEY (`idPersonnage`) REFERENCES `personnages` (`idPersonnage`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_item_personnage_raid_raids1` FOREIGN KEY (`idRaid`) REFERENCES `raids` (`idRaid`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `personnages`
--
ALTER TABLE `personnages`
ADD CONSTRAINT `fk_personnages_classes1` FOREIGN KEY (`idClasses`) REFERENCES `classes` (`idClasses`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_personnages_faction1` FOREIGN KEY (`idFaction`) REFERENCES `faction` (`idFaction`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_personnages_race1` FOREIGN KEY (`idRace`) REFERENCES `race` (`idRace`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_personnage_guildes1` FOREIGN KEY (`idGuildes`) REFERENCES `guildes` (`idGuildes`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_personnage_users1` FOREIGN KEY (`idUsers`) REFERENCES `users` (`idUsers`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `personnages_has_specialisation`
--
ALTER TABLE `personnages_has_specialisation`
ADD CONSTRAINT `fk_specialisation_has_personnages_personnages1` FOREIGN KEY (`personnages_idPersonnage`) REFERENCES `personnages` (`idPersonnage`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_specialisation_has_personnages_specialisation1` FOREIGN KEY (`specialisation_idSpecialisation`) REFERENCES `specialisation` (`idSpecialisation`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `raids`
--
ALTER TABLE `raids`
ADD CONSTRAINT `fk_raids_evenements1` FOREIGN KEY (`idEvenements`) REFERENCES `evenements` (`idEvenements`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `raid_personnage`
--
ALTER TABLE `raid_personnage`
ADD CONSTRAINT `fk_raid_personnage_personnages1` FOREIGN KEY (`idPersonnage`) REFERENCES `personnages` (`idPersonnage`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_raid_personnage_raids1` FOREIGN KEY (`idRaid`) REFERENCES `raids` (`idRaid`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `roster_has_personnage`
--
ALTER TABLE `roster_has_personnage`
ADD CONSTRAINT `fk_roster_has_personnage_personnage1` FOREIGN KEY (`idPersonnage`) REFERENCES `personnages` (`idPersonnage`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_roster_has_personnage_roster1` FOREIGN KEY (`idRoster`) REFERENCES `roster` (`idRoster`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `specialisation`
--
ALTER TABLE `specialisation`
ADD CONSTRAINT `fk_specialisation_classes1` FOREIGN KEY (`idClasses`) REFERENCES `classes` (`idClasses`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_specialisation_role1` FOREIGN KEY (`idRole`) REFERENCES `role` (`idRole`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `zone_has_bosses`
--
ALTER TABLE `zone_has_bosses`
ADD CONSTRAINT `fk_zone_has_bosses_bosses1` FOREIGN KEY (`idBosses`) REFERENCES `bosses` (`idBosses`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_zone_has_bosses_zone1` FOREIGN KEY (`idZone`) REFERENCES `zone` (`idZone`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `zone_has_mode_diffculte`
--
ALTER TABLE `zone_has_mode_diffculte`
ADD CONSTRAINT `fk_mode_difficulte_has_zone_mode_difficulte1` FOREIGN KEY (`idMode`) REFERENCES `mode_difficulte` (`idMode`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_mode_difficulte_has_zone_zone1` FOREIGN KEY (`idZone`) REFERENCES `zone` (`idZone`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!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 |
f3560f74ede16b53a02e29f03f7e1b658aee3804 | SQL | agodinhost/android | /QuestoesGratis/docs/ddl.sql | ISO-8859-1 | 2,900 | 3.890625 | 4 | [] | no_license | -- -------------------------------------------------------- #
-- Essas tabelas so importadas na instalao da aplicao. #
-- -------------------------------------------------------- #
CREATE TABLE questions(
_id INTEGER PRIMARY KEY,
banca TEXT,
ano TEXT,
orgao TEXT,
uf TEXT,
cargo TEXT,
disciplina TEXT,
assunto TEXT,
question TEXT NOT NULL,
optionA TEXT NOT NULL,
optionB TEXT NOT NULL,
optionC TEXT,
optionD TEXT,
optionE TEXT,
"match" TEXT NOT NULL,
used TEXT
);
CREATE TABLE answers(
_id INTEGER PRIMARY KEY AUTOINCREMENT,
quizId INTEGER NOT NULL,
questionId INTEGER NOT NULL,
number INTEGER NOT NULL,
answer TEXT
);
CREATE TABLE quizzes(
_id INTEGER PRIMARY KEY AUTOINCREMENT,
date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
filter TEXT NOT NULL,
rating REAL NOT NULL DEFAULT 0.0,
status INTEGER NOT NULL DEFAULT 0,
lastNumber INTEGER NOT NULL DEFAULT 1,
questionsCount INTEGER DEFAULT 0
);
CREATE VIEW IF NOT EXISTS vw_answers
AS SELECT q.*, a.quizId, a._ID as answerId, a.number, a.answer
FROM questions q, answers a
WHERE a.questionId = q._id
ORDER BY
a.quizId, a.number;
CREATE VIEW IF NOT EXISTS vw_answers_sum
AS SELECT v.quizId,
q.questionsCount,
SUM( 1 ) as rightAnswers
FROM vw_answers v,
quizzes q
WHERE q._id = v.quizId
AND trim( v.match ) = v.answer
GROUP BY
v.quizId, q.questionsCount
ORDER BY
v.quizId;
CREATE TRIGGER IF NOT EXISTS tg_answers_ai
AFTER INSERT ON answers
FOR EACH ROW
BEGIN
UPDATE questions
SET used = ifnull( used, '--' )
WHERE _id = NEW.questionId;
UPDATE quizzes
SET questionsCount = questionsCount + 1
WHERE _id = NEW.quizId;
END;
CREATE TRIGGER IF NOT EXISTS tg_answers_au
AFTER UPDATE ON answers
FOR EACH ROW
BEGIN
UPDATE questions
SET used = CASE WHEN trim( match ) = NEW.answer
THEN 'r' || substr( ifnull( used, '--' ), 2, 1 )
ELSE substr( ifnull( used, '--' ), 1, 1 ) || 'w'
END
WHERE _id = OLD.questionId;
UPDATE quizzes
SET lastNumber = OLD.number
WHERE _id = OLD.quizId;
END;
CREATE UNIQUE INDEX ix_answers_quizId_questionId
ON answers( quizId ASC, questionId ASC);
DROP INDEX IF EXISTS ix_answers_quizId_questionId;
DROP TRIGGER IF EXISTS tg_answers_au;
DROP TRIGGER IF EXISTS tg_answers_ai;
DROP VIEW IF EXISTS vw_answers_sum;
DROP VIEW IF EXISTS vw_answers;
DROP TABLE IF EXISTS answers;
DROP TABLE IF EXISTS quizzes;
DROP TABLE IF EXISTS questions;
-- EOF. | true |
77fc90c8ed584dfbc77a3b199294a4ef46a55a3c | SQL | almogaya1315/FamilyCore | /FCore.Identity.DAL/sql/FCore_Identity_Query.sql | UTF-8 | 256 | 2.59375 | 3 | [] | no_license |
use [FCore.DB.UserIdentity]
select *
from dbo.AspNetUsers
update dbo.AspNetUsers
set Password = 'lkga1315'
where UserName = 'Lior'
update dbo.AspNetUsers
set Password = 'Lkga1315!'
where MemberId = 1
delete
from dbo.AspNetUsers
where MemberId > 0 | true |
c0c20919be5b2289b83feea87afc4c45a843527b | SQL | ganeshbabuNN/Databases | /RDMS/Oracle Database/RegularExpression_REGEXP_COUNT_CountOfWords.sql | UTF-8 | 743 | 3.09375 | 3 | [] | no_license | ---counts number of times of the word "kam"
select regexp_count(street_address,'kam', 1,'i') count1 from locations;
/*
this funciton returns a count of the words "and'in the bookname column
-Backreferences
A Useful features of RE is the abilitye to store sub-expression for resue later.
this is also called backreferencing.
it allows sophisticated replace capabiliites such as swapping patterns
in new positions or indicating repeated word or letter occurrences.
the matched part of the sub-expression is stored in a temporary buffer. the buffer is numbered
from left to right and accessed with the \ digit notations, where digit is a number between 1 and 9
and matches the digitth sub-expression , as indicated by a set of parentheses
*/ | true |
aeae7cccf744000c7de3919c3a543fd0869223a7 | SQL | vzdrizhni/SQL-Zoo-project | /more_join.sql | UTF-8 | 3,128 | 4.625 | 5 | [
"MIT"
] | permissive | -- 1. List the films where the yr is 1962 [Show id, title]
SELECT id, title
FROM movie
WHERE yr=1962
-- 2. Give year of 'Citizen Kane'.
SELECT yr
FROM movie
WHERE title = 'Citizen Kane'
-- 3. List all of the Star Trek movies, include the id, title and yr (all of these movies include the words Star Trek in the title). Order results by year.
SELECT id, title, yr
FROM movie
WHERE title LIKE 'Star Trek%'
ORDER BY yr
-- 4. What id number does the actor 'Glenn Close' have?
SELECT actor.id
FROM actor
WHERE name = 'Glenn Close'
-- 5. What is the id of the film 'Casablanca'
SELECT id
FROM movie
WHERE title = 'Casablanca'
-- 6. Obtain the cast list for 'Casablanca'
SELECT name
FROM casting JOIN actor ON actorid = id
WHERE movieid = 11768;
-- 7. Obtain the cast list for the film 'Alien'
SELECT name
FROM actor JOIN casting ON actor.id = casting.actorid JOIN movie ON movie.id = casting.movieid
WHERE title = 'Alien'
-- 8. List the films in which 'Harrison Ford' has appeared
SELECT title
FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid
WHERE name = 'Harrison Ford'
-- 9. List the films where 'Harrison Ford' has appeared - but not in the starring role. [Note: the ord field of casting gives the position of the actor. If ord=1 then this actor is in the starring role]
SELECT title
FROM movie JOIN casting ON id = movieid JOIN actor ON actor.id = actorid
WHERE name = 'Harrison Ford' AND ord != 1
-- 10. List the films together with the leading star for all 1962 films.
SELECT title, name
FROM movie JOIN casting ON movie.id = movieid JOIN actor ON actor.id = actorid
WHERE yr = 1962 AND ord = 1
-- 11. Which were the busiest years for 'Rock Hudson', show the year and the number of movies he made each year for any year in which he made more than 2 movies.
SELECT yr,COUNT(title) FROM
movie JOIN casting ON movie.id=movieid
JOIN actor ON actorid=actor.id
WHERE name='Rock Hudson'
GROUP BY yr
HAVING COUNT(title) > 2
-- 12. List the film title and the leading actor for all of the films 'Julie Andrews' played in.
SELECT title, name FROM movie
JOIN casting ON (movie.id = movieid AND ord = 1) JOIN actor ON (actor.id = actorid)
WHERE movie.id IN (
SELECT movieid FROM casting
WHERE actorid IN (
SELECT id FROM actor
WHERE name = 'Julie Andrews'))
-- 13. Obtain a list, in alphabetical order, of actors who've had at least 15 starring roles.
SELECT name FROM actor
WHERE (SELECT COUNT(movieid)
FROM casting WHERE actorid=id AND ord=1)>=15
GROUP BY name
-- 14. List the films released in the year 1978 ordered by the number of actors in the cast, then by title.
SELECT title, COUNT(actorid) FROM movie
JOIN casting ON movieid=id
WHERE yr=1978 GROUP BY title
ORDER BY (SELECT COUNT(actorid)
FROM casting
WHERE movieid=id)
DESC, title ASC
-- 15. List all the people who have worked with 'Art Garfunkel'.
SELECT name FROM actor
JOIN casting ON actorid=id
WHERE movieid IN (SELECT movieid FROM casting
WHERE actorid=(SELECT id FROM actor
WHERE name='Art Garfunkel'))
AND actor.name != 'Art Garfunkel'
| true |
4ab359ac59a2fd7577b6c3636f4d14c0b15c7b04 | SQL | CUBRID/cubrid-testcases | /sql/_13_issues/_12_1h/cases/bug_bts_7951.sql | UTF-8 | 1,842 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | create table t(t timestamp,id int auto_increment(2,3),v varchar(100)) partition by list(t) (
partition p0 values in ('1970-3-10'),
partition p1 values in ('1971-2-01'),
partition p2 values in ('1972-2-19'));
insert into t(t) values('1970-3-10'),('1971-2-01'),('1972-2-19');
alter table t promote partition p2;
drop t;
truncate table t__p__p2;
drop t__p__p2;
create table t(t timestamp,id int auto_increment(2,3),v varchar(100)) partition by list(t) (
partition p0 values in ('1970-3-10'),
partition p1 values in ('1971-2-01'),
partition p2 values in ('1972-2-19'));
insert into t(t) values('1970-3-10'),('1971-2-01'),('1972-2-19');
alter table t promote partition p2;
drop t;
drop table t__p__p2;
create table t(t timestamp,id int auto_increment(2,3),v varchar(100)) partition by list(t) (
partition p0 values in ('1970-3-10'),
partition p1 values in ('1971-2-01'),
partition p2 values in ('1972-2-19'));
insert into t(t) values('1970-3-10'),('1971-2-01'),('1972-2-19');
alter table t promote partition p2;
drop t;
update t__p__p2 set t=NULL where t='1972-2-19';
drop table t__p__p2;
create table t(t timestamp,id int auto_increment(2,3),v varchar(100)) partition by list(t) (
partition p0 values in ('1970-3-10'),
partition p1 values in ('1971-2-01'),
partition p2 values in ('1972-2-19'));
insert into t(t) values('1970-3-10'),('1971-2-01'),('1972-2-19');
alter table t promote partition p2;
drop t;
insert into t__p__p2(t) values('1972-2-19');
drop table t__p__p2;
create table t(t timestamp,id int auto_increment(2,3),v varchar(100)) partition by list(t) (
partition p0 values in ('1970-3-10'),
partition p1 values in ('1971-2-01'),
partition p2 values in ('1972-2-19'));
insert into t(t) values('1970-3-10'),('1971-2-01'),('1972-2-19');
alter table t promote partition p2;
drop t;
delete from t__p__p2;
drop table t__p__p2;
| true |
1cad809d18e726ac9e962169d3cb6d0b9f7e47a3 | SQL | basimar/ub_speicherbibliothek | /speibi_lieferung/korr-item_kass.sql | UTF-8 | 1,014 | 2.90625 | 3 | [] | no_license | /******************************************************************************/
/* Script zum Veraendern von z30-Saetzen mit cursor ueber die temp. Tabelle */
/* barcodes_kass */
/******************************************************************************/
update dsv51.z30
set z30_upd_time_stamp = '&1',
z30_item_process_status = 'NV',
z30_sub_library= 'BSSBI',
z30_collection = 'MAG',
z30_item_status = '20',
z30_item_statistic = 'Kass.Ex.'
where exists (select barcode from barcodes_kass where barcode = z30_barcode);
/* hier noch ein diff der Mutationen zu eingabe.dat machen und loggen */
/* oder aus log: logical record count 3, aber weiter unten: 2 rows updated */
set heading off;
set pause off;
set echo off;
set feedback off;
set termout off;
spool lesefehler_kass.txt
select barcode from barcodes_kass minus (select z30_barcode from z30 where z30_barcode in (select barcode from barcodes_kass));
spool off
EXIT;
| true |
24cba41e88e4a10e5a6cd689c281703dd92eaf96 | SQL | yyyasmin/CBT | /db_back/menta_21_10_2021.sql | UTF-8 | 16,053 | 2.671875 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 13.4
-- Dumped by pg_dump version 13.4
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."user" (id, username, password, email, registered_on, is_super_user, school_logo_name, matya_logo_name) FROM stdin;
1 yyy yyy yyy@gmail.com 2021-08-29 14:56:39.768526 t \N \N
\.
--
-- Data for Name: ufile; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.ufile (id, author_id, data, name, body, selected, hide) FROM stdin;
\.
--
-- Data for Name: general_txt; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.general_txt (id, ufile_id, author_id, type, h_name, e_name, h_plural_name, gt_type, class_name, title, body, "default", color_txt, color, table_color, title_color, odd_color, even_color, image_url, selected, hide, used, prnt_id, usr_node) FROM stdin;
7559 \N 1 thought מחשבה Thought מחשבות CBT Thought אני לא שווה אני לא מספיק טוב ולא רוצים אותי f red #ff0000 green_table #66ff99 \N \N /static/img/CBT/bad_thought.jpg f t t 0 false
0 \N 1 student תלמיד Student תלמידים CBT Student Dummy Dummy t green #00b300 green_table #66ff99 \N \N /static/img/CBT/somebody.jpg t f t 0 false
8403 \N 1 emotion רגש Emotion רגשות Emotion Emotion 8888 999999 f blue blue green_table #66ff99 \N \N true f t t 8074 false
1 \N 1 student תלמיד Student תלמידים Student Student Dummy Dummy f green #006600 green_table #66ff99 \N \N \N f t t \N false
23 \N 1 sub_tag תת קטגוריה Sub category \N DBT Sub_tag יחסים עם תלמידים מהכיתה Relationship with class mates t #000000 \N \N \N \N /static/img/DBT/ f f t \N false
13 \N 1 accupation תפקיד Accupation \N Accupation Accupation Dummy Dummy f black #00284d \N \N \N \N \N f f t \N false
7 \N 1 emotion רגש Emotion רגשות CBT Emotion תסכול וכעס אני כועס מתוסכל ומרגיש מבואס f red #ff0000 green_table #66ff99 \N \N /static/img/CBT//static/img/CBT/sad.jpg f f t 8074 false
12 \N 1 test אמות מידה להערכה Evaluation indices אמות מידה להערכה \N Test Dummy Dummy f orange #ffcc00 orange_table #ffff99 \N \N \N f f t \N false
19 \N 1 value Value Value ערכים DBT Value עצמאות independence f #000000 green_table #66ff99 \N \N /static/img/DBT/independence.jpg f f t \N false
20 \N 1 age_range קבוצת גיל Age range \N DBT Age_range ביס יסודי כיתות ג-ו t #000000 \N \N \N \N /static/img/DBT/ f f t \N false
22 \N 1 tag קטגוריה Category \N DBT Tag יחסים בין אישיים Personal relationships t #000000 \N \N \N \N /static/img/DBT/ f f t \N false
10 \N 1 tag נושא Tag \N Tag Tag כללי general f black #00284d \N \N \N \N \N f f t \N false
21 \N 1 scrt רמת אבטחה Security level \N DBT Scrt ציבורי public t #000000 \N \N \N \N /static/img/DBT/ f f t \N false
24 \N 1 destination מטרה Destination מטרות Destination Destination New dest f green #006600 green_table #66ff99 \N \N \N f f t \N false
18 \N 1 value Value Value ערכים DBT Value יחסים בין אישיים personal relationship f #000000 green_table #66ff99 \N \N /static/img/DBT/personal.jpg f f t \N false
8507 \N 1 result תוצאה Result התנהגויות Result Result החברים מתרחקים ממני איבדתי חברים f blue blue green_table #66ff99 \N \N true f t t 8117 false
15 \N 1 result תוצאה Result התנהגויות CBT Result החברים מתרחקים ממני החברים מתרחקים ממני ולא מזמינים אותי למשחקי כדור f red #ff0000 green_table #66ff99 \N \N /static/img/CBT/edison.jpg f f t 9 false
7636 \N 1 emotion רגש Emotion רגשות CBT Emotion אני מרגיש רגוע וטוב לי אני מרגיש רגוע ומסופק. טוב לי. t green #00b300 green_table #66ff99 \N \N /static/img/CBT/happy_1.jpg f f t 8074 false
25 \N 1 destination מטרה Destination מטרות Destination Destination התלמיד יזהה מצב רוח אצל ילד אחר מהכיתה התלמיד יזהה מצב רוח כללי (שמח \\ עצוב \\ נרגש\\ כועס ) אצל ילד אחר מהכיתה f green #006600 green_table #66ff99 \N \N \N f f t 0 false
8341 \N 1 emotion רגש Emotion רגשות Emotion Emotion devistated devistated f false false green_table #66ff99 \N \N /static/img/CBT/default_image.jpg f t t 8074 false
8074 \N 1 thought מחשבה Thought מחשבות CBT Thought אני לא שווה אני לא מספיק טוב ואף אחד לא צריך אותי. אני אשאר לבד f red #ff0000 green_table #66ff99 \N \N /static/img/CBT/bad_thought.jpg f f t 7558 false
8117 \N 1 behavior התנהגות Behavior התנהגויות CBT Behavior אני מצטרף למשחק ןמבקש עזרה להשתפר אני ממצטרף למשחק ומבקש ממשהו שחזק במשחק לאמן אותי כדי להשתפר t green #00b300 green_table #66ff99 \N \N /static/img/CBT/good_choice.jpg f f t 7 false
11 \N 1 method_type סוג\\מדיית הוראה Method media or type \N Method_type Method_type Dummy Dummy f black #00284d \N \N \N \N \N f f t \N false
7558 \N 1 situation סיטואציה Situation סיטואציות CBT Situation לא הזמינו אותי למשחק היו בחירות למשחק בכדור ונשארתי אחרון t orange #ff981a green_table #66ff99 \N \N /static/img/CBT/situation_1.jpg f f t 0 false
16 \N 1 obstacle ערך Obstacle מכשולים CBT Obstacle עצמאות אני רוצה להחליט ולעשות דברים בעצמי t green #00b300 green_table #66ff99 \N \N /static/img/CBT/ f f t \N false
8376 \N 1 emotion רגש Emotion רגשות Emotion Emotion 1111111111 2222222222222 f false false green_table #66ff99 \N \N false f t t 8074 false
2 \N 1 student תלמיד Student תלמידים Student Student Dummy Dummy f green #006600 green_table #66ff99 \N \N \N f t t \N false
8382 \N 1 emotion רגש Emotion רגשות Emotion Emotion 66666 77777 f false false green_table #66ff99 \N \N true f t t 8074 false
17 \N 1 value ערך Value ערכים DBT Value משפחה family t #000000 green_table #66ff99 \N \N /static/img/DBT/family.jpg f f t \N false
8542 \N 1 result תוצאה Result התנהגויות Result Result החברים מתרחקים ממני the friends i have are drifted away f blue blue green_table #66ff99 \N \N true f t t 9 false
9 \N 1 behavior התנהגות Behavior התנהגויות CBT Behavior ברוגז אני עוזב בכעס ולא מצורף יותר לעולם שילכו לה.... f red #ff0000 green_table #66ff99 \N \N /static/img/CBT//static/img/CBT/bad_choice.jpg f f t 7 false
9432 \N 1 situation סיטואציה Situation סיטואציות Situation Situation 1111 Enter your description f green green green_table #66ff99 \N \N /static/img/CBT/default_image.jpg f t t 0 false
10218 \N 1 profile פרופיל Profile \N Profile Profile Dummys Profile 0 f black ##000066 \N \N \N \N default_image.jpg f f t -1 false
10063 \N 1 thought מחשבה Thought מחשבות Thought Thought המורה לא אוהבת אותי המורה שכחה להזכיר לי מה לעשות. אני לאחשוב לה. f red red green_table #66ff99 \N \N /static/img/Thought/default_image.jpg f f t 9574 true
10464 \N 1 behavior התנהגות Behavior התנהגויות Behavior Behavior Enter your title Enter your description f green lightgray green_table #66ff99 \N \N /static/img/CBT/default_image.jpg f f f 7 true
10465 \N 1 result תוצאה Result התנהגויות Result Result Enter your title Enter your description f green lightgray green_table #66ff99 \N \N /static/img/CBT/default_image.jpg f f f 9 true
9574 \N 1 situation סיטואציה Situation סיטואציות Situation Situation לא הכנתי שיעורים I didn't make my homework f red red green_table #66ff99 \N \N /static/img/CBT/default_image.jpg f f t 0 true
10467 \N 1 situation סיטואציה Situation סיטואציות Situation Situation Enter your title Enter your description f green lightgray green_table #66ff99 \N \N /static/img/Situation/default_image.jpg f f f 0 true
10469 \N 1 emotion רגש Emotion רגשות Emotion Emotion Enter your title Enter your description f green lightgray green_table #66ff99 \N \N /static/img/Emotion/default_image.jpg f f f 10063 true
10470 \N 1 thought מחשבה Thought מחשבות Thought Thought Enter your title Enter your description f green lightgray green_table #66ff99 \N \N /static/img/Thought/default_image.jpg f f f 10218 true
5 \N 1 thought מחשבה Thought מחשבות CBT Thought אולי אני לא טוב במשחקי כדור, אבל בדברים אחרים כן משחק כדור זה לא הצד החזק שלי, אבל בדברים אחרים אני יותר טוב, ואני יכול להתאמן כדי להשתפר. לא צריך להיות טוב במשהו כדיל להתאמן בו. f green #00b300 green_table #66ff99 \N \N /static/img/CBT/good_thought.jpg f f t 7558 false
26 \N 1 destination מטרה Destination מטרות Destination Destination התלמיד יזהה מצב רוח אצל ילד אחר מהכיתה התלמיד יזהה מצב רוח כללי (שמח \\ עצוב \\ נרגש\\ כועס ) אצל ילד אחר מהכיתה f green #006600 green_table #66ff99 \N \N \N f f t \N false
\.
--
-- Data for Name: Behavior; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Behavior" (id, description) FROM stdin;
9 \N
8117 \N
10464 \N
\.
--
-- Data for Name: Emotion; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Emotion" (id, description) FROM stdin;
7 \N
8341 \N
10469 \N
8376 \N
8382 \N
8403 \N
7636 \N
\.
--
-- Data for Name: Result; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Result" (id, description) FROM stdin;
15 \N
8507 \N
10465 \N
8542 \N
\.
--
-- Data for Name: Solution; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Solution" (id, description) FROM stdin;
\.
--
-- Data for Name: Thought; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Thought" (id, description) FROM stdin;
5 \N
8074 \N
10470 \N
10063 \N
7559 \N
\.
--
-- Data for Name: accupation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.accupation (id) FROM stdin;
13
\.
--
-- Data for Name: age_range; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.age_range (id, from_age, to_age) FROM stdin;
20 7 12
\.
--
-- Data for Name: alembic_version; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.alembic_version (version_num) FROM stdin;
4d10f796f704
\.
--
-- Data for Name: destination; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.destination (id) FROM stdin;
24
25
26
\.
--
-- Data for Name: document; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.document (id) FROM stdin;
\.
--
-- Data for Name: feedback; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.feedback (id, name, email, registered_on, user_friendly, team_work, make_job_easy, save_time, continue_using, change, add, remove, db_helps) FROM stdin;
\.
--
-- Data for Name: goal; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.goal (id) FROM stdin;
\.
--
-- Data for Name: gray; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.gray (id) FROM stdin;
\.
--
-- Data for Name: method; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.method (id) FROM stdin;
\.
--
-- Data for Name: method_type; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.method_type (id) FROM stdin;
11
\.
--
-- Data for Name: obstacle; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.obstacle (id, description) FROM stdin;
16 \N
\.
--
-- Data for Name: parent_child_relationship; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.parent_child_relationship (parent_id, child_id) FROM stdin;
7 9
22 23
25 20
25 22
25 23
25 21
22 25
23 25
0 25
26 20
26 22
26 23
26 21
22 26
23 26
0 26
7559 7
7558 5
7558 8074
8074 7
0 7558
0 9432
0 9574
9 15
9574 10063
0 10218
\.
--
-- Data for Name: person; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.person (id, person_id, gender, first_name, last_name, email, birth_date, grade, background, profetional) FROM stdin;
\.
--
-- Data for Name: profile; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.profile (id) FROM stdin;
10218
\.
--
-- Data for Name: resource; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.resource (id) FROM stdin;
\.
--
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.student (id, student_id, gender, first_name, last_name, email, birth_date, grade, background, profetional) FROM stdin;
1 0 male \N \N \N 2021-01-01 1 \tddd \N
2 0 male \N \N \N 2021-01-01 1 \tddd \N
0 0 male Dummy Dummy \N 2021-01-01 1 \tddd \N
\.
--
-- Data for Name: teacher; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.teacher (id, teacher_id, gender, first_name, last_name, email, birth_date, grade, background, profetional) FROM stdin;
\.
--
-- Data for Name: role; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.role (id, student_id, teacher_id) FROM stdin;
\.
--
-- Data for Name: school; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.school (id, school_logo_name, matya_logo_name) FROM stdin;
\.
--
-- Data for Name: scrt; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.scrt (id) FROM stdin;
21
\.
--
-- Data for Name: situation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.situation (id, description) FROM stdin;
9432 \N
10467 \N
7558 \N
9574 \N
\.
--
-- Data for Name: status; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.status (id) FROM stdin;
\.
--
-- Data for Name: strength; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.strength (id) FROM stdin;
\.
--
-- Data for Name: sub_tag; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.sub_tag (id) FROM stdin;
23
\.
--
-- Data for Name: subject; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.subject (id) FROM stdin;
\.
--
-- Data for Name: tag; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.tag (id) FROM stdin;
10
22
\.
--
-- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.test (id) FROM stdin;
12
\.
--
-- Data for Name: todo; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.todo (id) FROM stdin;
\.
--
-- Data for Name: value; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.value (id, description) FROM stdin;
17 \N
18 \N
19 \N
\.
--
-- Data for Name: weakness; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.weakness (id) FROM stdin;
\.
--
-- Name: feedback_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.feedback_id_seq', 1, false);
--
-- Name: general_txt_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.general_txt_id_seq', 10470, true);
--
-- Name: ufile_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.ufile_id_seq', 1, false);
--
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.user_id_seq', 1, true);
--
-- PostgreSQL database dump complete
--
| true |
72ad7487593689d1b1e3d42bd7aa5eccded41f08 | SQL | braccolucianoj/beon-coding-backend | /devops/database/schema.sql | UTF-8 | 1,285 | 3.65625 | 4 | [] | no_license | CREATE TABLE flight (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
flight_date TIMESTAMP WITH TIME ZONE NOT NULL,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
-- This should be normalized
price FLOAT NOT NULL,
origin VARCHAR(255) NOT NULL,
destination VARCHAR(255) NOT NULL,
location_info JSONB NOT NULL
);
CREATE TABLE person (
id SERIAL PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
identity_number INTEGER NOT NULL,
birth_date date NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE TABLE app_user (
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
phone VARCHAR(20) NOT NULL,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
UNIQUE(email),
UNIQUE(phone)
);
CREATE TABLE person_flight (
id SERIAL PRIMARY KEY,
flight_role VARCHAR(255) NOT NULL,
person_id INTEGER NOT NULL,
flight_id INTEGER NOT NULL,
-- References
FOREIGN KEY (person_id) REFERENCES person (id) ON DELETE NO ACTION,
FOREIGN KEY (flight_id) REFERENCES flight (id) ON DELETE NO ACTION
);
| true |
665a4a791ca32b79206e3a29045aaeadc3280bf0 | SQL | AlRusMil/db_231120 | /topic5/Aggregation.sql | UTF-8 | 2,380 | 4.3125 | 4 | [] | no_license | DROP database IF EXISTS shop;
CREATE database shop;
USE shop;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(255) COMMENT 'Имя покупателя',
birthday_at DATE COMMENT 'Дата рождения',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) COMMENT = 'Покупатели';
INSERT INTO users (name, birthday_at) VALUES
('Геннадий', '1990-10-05'),
('Наталья', '1984-11-12'),
('Александр', '1985-05-20'),
('Сергей', '1988-02-14'),
('Иван', '1998-01-12'),
('Мария', '1992-08-29'),
('Георгий', '1984-10-10'),
('Дмитрий', '1989-12-01'),
('Евгения', '1979-03-25'),
('Анна', '1981-05-23');
-- 1. Подсчитайте средний возраст пользователей в таблице users.
SELECT name, timestampdiff(YEAR, birthday_at, NOW()) AS age
FROM users;
SELECT round(avg(timestampdiff(YEAR, birthday_at, NOW())),2) AS age
FROM users;
SELECT round(avg(timestampdiff(YEAR, birthday_at, NOW()))) AS age
FROM users;
-- 2. Подсчитайте количество дней рождения, которые приходятся на каждый из дней недели.
-- Следует учесть, что необходимы дни недели текущего года, а не года рождения.
-- Дни рождения у пользователей
SELECT name, DAYNAME(STR_TO_DATE(CONCAT(YEAR(NOW()),'-',
MONTH(birthday_at),'-',
DAY(birthday_at)), '%Y-%m-%d')) as DAYOFWEEK
FROM users;
-- Количество дней рождения на каждый день недели
SELECT DAYNAME(STR_TO_DATE(CONCAT(YEAR(NOW()),'-',
MONTH(birthday_at),'-',
DAY(birthday_at)), '%Y-%m-%d')) as DAYOFWEEK, COUNT(*)
FROM users
GROUP BY DAYOFWEEK;
-- 3. Подсчитайте произведение чисел в столбце таблицы.
DROP TABLE IF EXISTS sometab;
CREATE TABLE sometab (
id SERIAL PRIMARY KEY,
value INT
);
INSERT INTO sometab (value) VALUES
(1),
(2),
(3),
(4),
(5),
(10),
(5),
(4),
(4);
SELECT value FROM sometab;
SELECT ROUND(EXP(SUM(LN(value)))) FROM sometab;
| true |
63fd1c2424598b1b3b19f006b17d42a4583f8302 | SQL | Dlayer/dlayer | /private/database/tables/structure/user_site_page_structure_column.sql | UTF-8 | 689 | 3.03125 | 3 | [
"MIT"
] | permissive |
CREATE TABLE `user_site_page_structure_column` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`site_id` int(11) unsigned NOT NULL,
`page_id` int(11) unsigned NOT NULL,
`row_id` int(11) unsigned DEFAULT NULL,
`size` tinyint(2) unsigned NOT NULL DEFAULT '12',
`column_type_id` tinyint(3) UNSIGNED NOT NULL DEFAULT '3',
`offset` tinyint(2) unsigned NOT NULL DEFAULT '0',
`sort_order` int(11) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `site_id` (`site_id`),
KEY `row_id` (`row_id`),
KEY `sort_order` (`sort_order`),
KEY `page_id` (`page_id`),
KEY `column_type_id` (`column_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
| true |
4985a91bd52f467e97b19ca59674a4d99ec429a5 | SQL | gamingbet/gb | /gamingbets.sql | UTF-8 | 24,621 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Czas wygenerowania: 23 Mar 2013, 16:27
-- Wersja serwera: 5.5.16
-- Wersja PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Baza danych: `gamingbets`
--
-- --------------------------------------------------------
--
-- Struktura tabeli dla `admins`
--
CREATE TABLE IF NOT EXISTS `admins` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`add` date NOT NULL,
`headAdmin` enum('true','false') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Zrzut danych tabeli `admins`
--
INSERT INTO `admins` (`id`, `userId`, `add`, `headAdmin`) VALUES
(1, 1, '2013-02-04', 'true');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `bets`
--
CREATE TABLE IF NOT EXISTS `bets` (
`id` int(111) NOT NULL AUTO_INCREMENT,
`matchId` int(11) NOT NULL,
`type` varchar(32) NOT NULL,
`score-1` double NOT NULL,
`score-2` double NOT NULL,
`score-3` double NOT NULL,
`active` enum('true','false') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `bets`
--
INSERT INTO `bets` (`id`, `matchId`, `type`, `score-1`, `score-2`, `score-3`, `active`) VALUES
(1, 1, 'win', 3.01, 1.11, 0, 'true'),
(2, 2, 'win', 1.01, 9, 0, 'true');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `countries`
--
CREATE TABLE IF NOT EXISTS `countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`shortCode` varchar(2) NOT NULL,
`longCode` varchar(3) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=247 ;
--
-- Zrzut danych tabeli `countries`
--
INSERT INTO `countries` (`id`, `shortCode`, `longCode`, `name`) VALUES
(1, 'AD', 'AND', 'Andora'),
(2, 'AE', 'ARE', 'Zjednoczone Emiraty Arabskie'),
(3, 'AF', 'AFG', 'Afganistan'),
(4, 'AG', 'ATG', 'Antigua i Barbuda'),
(5, 'AI', 'AIA', 'Anguilla'),
(6, 'AL', 'ALB', 'Albania'),
(7, 'AM', 'ARM', 'Armenia'),
(8, 'AN', 'ANT', 'Antyle Holenderskie'),
(9, 'AO', 'AGO', 'Angola'),
(10, 'AQ', 'ATA', 'Antarktyda'),
(11, 'AR', 'ARG', 'Argentyna'),
(12, 'AS', 'ASM', 'Samoa Amerykańskie'),
(13, 'AT', 'AUT', 'Austria'),
(14, 'AU', 'AUS', 'Australia'),
(15, 'AW', 'ABW', 'Aruba'),
(16, 'AX', 'ALA', 'Wyspy Alandzkie'),
(17, 'AZ', 'AZE', 'Azerbejdżan'),
(18, 'BA', 'BIH', 'Bośnia i Hercegowina'),
(19, 'BB', 'BRB', 'Barbados'),
(20, 'BD', 'BGD', 'Bangladesz'),
(21, 'BE', 'BEL', 'Belgia'),
(22, 'BF', 'BFA', 'Burkina Faso'),
(23, 'BG', 'BGR', 'Bułgaria'),
(24, 'BH', 'BHR', 'Bahrajn'),
(25, 'BI', 'BDI', 'Burundi'),
(26, 'BJ', 'BEN', 'Benin'),
(27, 'BL', 'BLM', 'Saint-Barthélemy'),
(28, 'BM', 'BMU', 'Bermudy'),
(29, 'BN', 'BRN', 'Brunei'),
(30, 'BO', 'BOL', 'Boliwia'),
(31, 'BR', 'BRA', 'Brazylia'),
(32, 'BS', 'BHS', 'Bahamy'),
(33, 'BT', 'BTN', 'Bhutan'),
(34, 'BV', 'BVT', 'Wyspa Bouveta'),
(35, 'BW', 'BWA', 'Botswana'),
(36, 'BY', 'BLR', 'Białoruś'),
(37, 'BZ', 'BLZ', 'Belize'),
(38, 'CA', 'CAN', 'Kanada'),
(39, 'CC', 'CCK', 'Wyspy Kokosowe'),
(40, 'CD', 'COD', 'Demokratyczna Republika Konga'),
(41, 'CF', 'CAF', 'Republika Środkowoafrykańska'),
(42, 'CG', 'COG', 'Kongo'),
(43, 'CH', 'CHE', 'Szwajcaria'),
(44, 'CI', 'CIV', 'Wybrzeże Kości Słoniowej'),
(45, 'CK', 'COK', 'Wyspy Cooka'),
(46, 'CL', 'CHL', 'Chile'),
(47, 'CM', 'CMR', 'Kamerun'),
(48, 'CN', 'CHN', 'Chiny'),
(49, 'CO', 'COL', 'Kolumbia'),
(50, 'CR', 'CRI', 'Kostaryka'),
(51, 'CU', 'CUB', 'Kuba'),
(52, 'CV', 'CPV', 'Republika Zielonego Przylądka'),
(53, 'CX', 'CXR', 'Wyspa Bożego Narodzenia'),
(54, 'CY', 'CYP', 'Cypr'),
(55, 'CZ', 'CZE', 'Czeska'),
(56, 'DE', 'DEU', 'Niemcy'),
(57, 'DJ', 'DJI', 'Dżibuti'),
(58, 'DK', 'DNK', 'Dania'),
(59, 'DM', 'DMA', 'Dominika'),
(60, 'DO', 'DOM', 'Dominikańska'),
(61, 'DZ', 'DZA', 'Algieria'),
(62, 'EC', 'ECU', 'Ekwador'),
(63, 'EE', 'EST', 'Estonia'),
(64, 'EG', 'EGY', 'Egipt'),
(65, 'EH', 'ESH', 'Sahara Zachodnia'),
(66, 'ER', 'ERI', 'Erytrea'),
(67, 'ES', 'ESP', 'Hiszpania'),
(68, 'ET', 'ETH', 'Etiopia'),
(69, 'FI', 'FIN', 'Finlandia'),
(70, 'FJ', 'FJI', 'Fidżi'),
(71, 'FK', 'FLK', 'Malwiny'),
(72, 'FM', 'FSM', 'Mikronezja'),
(73, 'FO', 'FRO', 'Wyspy Owcze'),
(74, 'FR', 'FRA', 'Francja'),
(75, 'GA', 'GAB', 'Gabon'),
(76, 'GB', 'GBR', 'Wielka Brytania'),
(77, 'GD', 'GRD', 'Grenada'),
(78, 'GE', 'GEO', 'Gruzja'),
(79, 'GF', 'GUF', 'Gujana Francuska'),
(80, 'GG', 'GGY', 'Guernsey'),
(81, 'GH', 'GHA', 'Ghana'),
(82, 'GI', 'GIB', 'Gibraltar'),
(83, 'GL', 'GRL', 'Grenlandia'),
(84, 'GM', 'GMB', 'Gambia'),
(85, 'GN', 'GIN', 'Gwinea'),
(86, 'GP', 'GLP', 'Gwadelupa'),
(87, 'GQ', 'GNQ', 'Gwinea Równikowa'),
(88, 'GR', 'GRC', 'Grecja'),
(89, 'GS', 'SGS', 'Georgia Południowa i Sandwich Południowy'),
(90, 'GT', 'GTM', 'Gwatemala'),
(91, 'GU', 'GUM', 'Guam'),
(92, 'GW', 'GNB', 'Gwinea Bissau'),
(93, 'GY', 'GUY', 'Gujana'),
(94, 'HK', 'HKG', 'Hongkong'),
(95, 'HM', 'HMD', 'Wyspy Heard i McDonalda'),
(96, 'HN', 'HND', 'Honduras'),
(97, 'HR', 'HRV', 'Chorwacja'),
(98, 'HT', 'HTI', 'Haiti'),
(99, 'HU', 'HUN', 'Węgry'),
(100, 'ID', 'IDN', 'Indonezja'),
(101, 'IE', 'IRL', 'Irlandia'),
(102, 'IL', 'ISR', 'Izrael'),
(103, 'IM', 'IMN', 'Wyspa Man'),
(104, 'IN', 'IND', 'Indie'),
(105, 'IO', 'IOT', 'Brytyjskie Terytorium Oceanu Indyjskiego'),
(106, 'IQ', 'IRQ', 'Irak'),
(107, 'IR', 'IRN', 'Iran'),
(108, 'IS', 'ISL', 'Islandia'),
(109, 'IT', 'ITA', 'Włochy'),
(110, 'JE', 'JEY', 'Jersey'),
(111, 'JM', 'JAM', 'Jamajka'),
(112, 'JO', 'JOR', 'Jordania'),
(113, 'JP', 'JPN', 'Japonia'),
(114, 'KE', 'KEN', 'Kenia'),
(115, 'KG', 'KGZ', 'Kirgistan'),
(116, 'KH', 'KHM', 'Kambodża'),
(117, 'KI', 'KIR', 'Kiribati'),
(118, 'KM', 'COM', 'Komory'),
(119, 'KN', 'KNA', 'Saint Kitts i Nevis'),
(120, 'KP', 'PRK', 'Korea Północna'),
(121, 'KR', 'KOR', 'Korea Południowa'),
(122, 'KW', 'KWT', 'Kuwejt'),
(123, 'KY', 'CYM', 'Kajmany'),
(124, 'KZ', 'KAZ', 'Kazachstan'),
(125, 'LA', 'LAO', 'Laos'),
(126, 'LB', 'LBN', 'Liban'),
(127, 'LC', 'LCA', 'Saint Lucia'),
(128, 'LI', 'LIE', 'Liechtenstein'),
(129, 'LK', 'LKA', 'Sri Lanka'),
(130, 'LR', 'LBR', 'Liberia'),
(131, 'LS', 'LSO', 'Lesotho'),
(132, 'LT', 'LTU', 'Litwa'),
(133, 'LU', 'LUX', 'Luksemburg'),
(134, 'LV', 'LVA', 'Łotwa'),
(135, 'LY', 'LBY', 'Libia'),
(136, 'MA', 'MAR', 'Maroko'),
(137, 'MC', 'MCO', 'Monako'),
(138, 'MD', 'MDA', 'Mołdawia'),
(139, 'ME', 'MNE', 'Czarnogóra'),
(140, 'MF', 'MAF', 'Saint-Martin'),
(141, 'MG', 'MDG', 'Madagaskar'),
(142, 'MH', 'MHL', 'Wyspy Marshalla'),
(143, 'MK', 'MKD', 'Macedonia'),
(144, 'ML', 'MLI', 'Mali'),
(145, 'MM', 'MMR', '(Myanmar)'),
(146, 'MN', 'MNG', 'Mongolia'),
(147, 'MO', 'MAC', 'Makau'),
(148, 'MP', 'MNP', 'Mariany Północne'),
(149, 'MQ', 'MTQ', 'Martynika'),
(150, 'MR', 'MRT', 'Mauretania'),
(151, 'MS', 'MSR', 'Montserrat'),
(152, 'MT', 'MLT', 'Malta'),
(153, 'MU', 'MUS', 'Mauritius'),
(154, 'MV', 'MDV', 'Malediwy'),
(155, 'MW', 'MWI', 'Malawi'),
(156, 'MX', 'MEX', 'Meksyk'),
(157, 'MY', 'MYS', 'Malezja'),
(158, 'MZ', 'MOZ', 'Mozambik'),
(159, 'NA', 'NAM', 'Namibia'),
(160, 'NC', 'NCL', 'Nowa Kaledonia'),
(161, 'NE', 'NER', 'Niger'),
(162, 'NF', 'NFK', 'Norfolk'),
(163, 'NG', 'NGA', 'Nigeria'),
(164, 'NI', 'NIC', 'Nikaragua'),
(165, 'NL', 'NLD', '(Niderlandy)'),
(166, 'NO', 'NOR', 'Norwegia'),
(167, 'NP', 'NPL', 'Nepal'),
(168, 'NR', 'NRU', 'Nauru'),
(169, 'NU', 'NIU', 'Niue'),
(170, 'NZ', 'NZL', 'Nowa Zelandia'),
(171, 'OM', 'OMN', 'Oman'),
(172, 'PA', 'PAN', 'Panama'),
(173, 'PE', 'PER', 'Peru'),
(174, 'PF', 'PYF', 'Polinezja Francuska'),
(175, 'PG', 'PNG', 'Papua-Nowa Gwinea'),
(176, 'PH', 'PHL', 'Filipiny'),
(177, 'PK', 'PAK', 'Pakistan'),
(178, 'PL', 'POL', 'Polska'),
(179, 'PM', 'SPM', 'Saint-Pierre i Miquelon'),
(180, 'PN', 'PCN', 'Pitcairn'),
(181, 'PR', 'PRI', 'Portoryko'),
(182, 'PS', 'PSE', 'Palestyna'),
(183, 'PT', 'PRT', 'Portugalia'),
(184, 'PW', 'PLW', 'Palau'),
(185, 'PY', 'PRY', 'Paragwaj'),
(186, 'QA', 'QAT', 'Katar'),
(187, 'RE', 'REU', 'Reunion'),
(188, 'RO', 'ROU', 'Rumunia'),
(189, 'RS', 'SRB', 'Serbia'),
(190, 'RU', 'RUS', 'Rosja'),
(191, 'RW', 'RWA', 'Rwanda'),
(192, 'SA', 'SAU', 'Arabia Saudyjska'),
(193, 'SB', 'SLB', 'Wyspy Salomona'),
(194, 'SC', 'SYC', 'Seszele'),
(195, 'SD', 'SDN', 'Sudan'),
(196, 'SE', 'SWE', 'Szwecja'),
(197, 'SG', 'SGP', 'Singapur'),
(198, 'SH', 'SHN', 'Helena i Zależne'),
(199, 'SI', 'SVN', 'Słowenia'),
(200, 'SJ', 'SJM', 'Jan Mayen (wyspa)'),
(201, 'SK', 'SVK', 'Słowacja'),
(202, 'SL', 'SLE', 'Sierra Leone'),
(203, 'SM', 'SMR', 'San Marino'),
(204, 'SN', 'SEN', 'Senegal'),
(205, 'SO', 'SOM', 'Somalia'),
(206, 'SR', 'SUR', 'Surinam'),
(207, 'ST', 'STP', 'Wyspy Świętego Tomasza i Książęca'),
(208, 'SV', 'SLV', 'Salwador'),
(209, 'SY', 'SYR', 'Syria'),
(210, 'SZ', 'SWZ', 'Suazi'),
(211, 'TC', 'TCA', 'Turks i Caicos'),
(212, 'TD', 'TCD', 'Czad'),
(213, 'TF', 'ATF', 'Antarktyczne Francuskie Terytoria Południowe'),
(214, 'TG', 'TGO', 'Togo'),
(215, 'TH', 'THA', 'Tajlandia'),
(216, 'TJ', 'TJK', 'Tadżykistan'),
(217, 'TK', 'TKL', 'Tokelau'),
(218, 'TL', 'TLS', 'Timor Wschodni'),
(219, 'TM', 'TKM', 'Turkmenistan'),
(220, 'TN', 'TUN', 'Tunezja'),
(221, 'TO', 'TON', 'Tonga'),
(222, 'TR', 'TUR', 'Turcja'),
(223, 'TT', 'TTO', 'Trynidad i Tobago'),
(224, 'TV', 'TUV', 'Tuvalu'),
(225, 'TW', 'TWN', 'Tajwan'),
(226, 'TZ', 'TZA', 'Tanzania'),
(227, 'UA', 'UKR', 'Ukraina'),
(228, 'UG', 'UGA', 'Uganda'),
(229, 'UM', 'UMI', 'Dalekie Wyspy Mniejsze Stanów Zjednoczonych'),
(230, 'US', 'USA', 'Stany Zjednoczone'),
(231, 'UY', 'URY', 'Urugwaj'),
(232, 'UZ', 'UZB', 'Uzbekistan'),
(233, 'VA', 'VAT', 'Watykan'),
(234, 'VC', 'VCT', 'Saint Vincent i Grenadyny'),
(235, 'VE', 'VEN', 'Wenezuela'),
(236, 'VG', 'VGB', 'Brytyjskie Wyspy Dziewicze'),
(237, 'VI', 'VIR', 'Wyspy Dziewicze Stanów Zjednoczonych'),
(238, 'VN', 'VNM', 'Wietnam'),
(239, 'VU', 'VUT', 'Vanuatu'),
(240, 'WF', 'WLF', 'Wallis i Futuna'),
(241, 'WS', 'WSM', 'Samoa'),
(242, 'YE', 'YEM', 'Jemen'),
(243, 'YT', 'MYT', 'Majotta'),
(244, 'ZA', 'ZAF', 'Republika Południowej Afryki'),
(245, 'ZM', 'ZMB', 'Zambia'),
(246, 'ZW', 'ZWE', 'Zimbabwe');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gameId` int(11) NOT NULL,
`name` varchar(32) NOT NULL,
`city` varchar(32) NOT NULL,
`countryId` int(11) NOT NULL,
`dataBegin` datetime NOT NULL,
`dataEnd` datetime NOT NULL,
`descriptions` int(11) NOT NULL,
`teamsId` varchar(128) NOT NULL,
`url` varchar(32) NOT NULL,
`images` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Struktura tabeli dla `games`
--
CREATE TABLE IF NOT EXISTS `games` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`short` varchar(10) NOT NULL,
`logo` varchar(15) NOT NULL,
`menuDisplay` enum('true','false') NOT NULL,
`lp` int(11) NOT NULL,
`register` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Zrzut danych tabeli `games`
--
INSERT INTO `games` (`id`, `name`, `short`, `logo`, `menuDisplay`, `lp`, `register`) VALUES
(1, 'Counter Strike', 'cs', 'cs.png', 'false', 2, '2013-02-02 12:00:00'),
(2, 'League of Legends', 'lol', 'lol.png', 'true', 1, '2013-02-15 22:00:00'),
(3, 'Startcraft 2', 'sc2', 'sc2.png', 'false', 0, '2013-02-16 00:00:00');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `gamings`
--
CREATE TABLE IF NOT EXISTS `gamings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fullname` varchar(32) NOT NULL,
`tag` varchar(32) NOT NULL,
`register` datetime NOT NULL,
`active` enum('true','false') NOT NULL,
`image` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `gamings`
--
INSERT INTO `gamings` (`id`, `fullname`, `tag`, `register`, `active`, `image`, `url`) VALUES
(1, 'Fnatic Team', 'Fnatic', '2013-02-15 22:00:00', 'true', 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSoqiTJGmV9yRMPfy6LirDCDH-BxFh_uT7aP8-gUGIRmydh_dq58K6SFw', 'http://www.fnatic.com/'),
(2, 'Meet Your Makers', 'MYM', '2013-02-15 22:00:00', 'true', 'http://www.in4.pl/ima_news/2009/1_19511.', 'http://www.mymym.com/');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `keys`
--
CREATE TABLE IF NOT EXISTS `keys` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`key` varchar(64) NOT NULL,
`action` varchar(32) NOT NULL,
`date` datetime NOT NULL,
`ip` varchar(24) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
--
-- Zrzut danych tabeli `keys`
--
INSERT INTO `keys` (`id`, `userId`, `key`, `action`, `date`, `ip`) VALUES
(1, 3, 'b4235174b6dae0e722cd8d0b835f1374', 'account', '2013-03-22 22:48:13', '127.0.0.1');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `matches`
--
CREATE TABLE IF NOT EXISTS `matches` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`eventsId` int(11) NOT NULL,
`gameId` int(11) NOT NULL,
`teamId-1` int(11) NOT NULL,
`teamId-2` int(11) NOT NULL,
`active` enum('true','false') NOT NULL,
`add` datetime NOT NULL,
`start` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `matches`
--
INSERT INTO `matches` (`id`, `eventsId`, `gameId`, `teamId-1`, `teamId-2`, `active`, `add`, `start`) VALUES
(1, 0, 2, 1, 2, 'true', '2013-02-15 00:00:00', '2013-02-28 12:15:00'),
(2, 0, 3, 2, 1, 'true', '2013-02-16 00:00:00', '2013-04-05 15:30:00');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`position` enum('before','after','footer') NOT NULL,
`lp` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`link` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
--
-- Zrzut danych tabeli `menu`
--
INSERT INTO `menu` (`id`, `position`, `lp`, `name`, `link`) VALUES
(1, 'before', 1, 'start', '/'),
(2, 'after', 1, 'events', 'events'),
(3, 'footer', 1, 'map-site', 'mapa-strony'),
(4, 'footer', 2, 'help', 'centrum-pomocy'),
(5, 'footer', 3, 'contact', 'kontakt'),
(6, 'footer', 5, 'work', 'praca'),
(7, 'footer', 4, 'about', 'o-betclic'),
(8, 'footer', 6, 'rules', 'rules'),
(9, 'footer', 7, 'private', 'privates'),
(10, 'footer', 8, 'gaming', 'gaming'),
(11, 'footer', 9, 'team', 'team'),
(12, 'before', 2, 'test', 'test-side');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `pages`
--
CREATE TABLE IF NOT EXISTS `pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title-pl` varchar(255) NOT NULL,
`title-en` varchar(255) NOT NULL,
`short-url` varchar(255) NOT NULL,
`access` enum('all','users','admins') NOT NULL,
`content-pl` longtext NOT NULL,
`content-en` longtext NOT NULL,
`add` datetime NOT NULL,
`userId` int(11) NOT NULL,
`type` enum('html','bbcode') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `pages`
--
INSERT INTO `pages` (`id`, `title-pl`, `title-en`, `short-url`, `access`, `content-pl`, `content-en`, `add`, `userId`, `type`) VALUES
(1, 'Testowa strona', 'Side for testing', 'test-side', 'all', 'przykladowa tresc', 'for example contain', '2013-02-15 05:24:25', 1, 'html'),
(2, 'Regulamin', 'Rules', 'rules', 'all', '<ol>\r\n<li>Rejestracja jest darmowa</li>\r\n</ol>', '<ol>\r\n<li>If u wanna make a account u must pay for this</li>\r\n</ol>', '2013-02-23 00:00:00', 1, 'html');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `panels`
--
CREATE TABLE IF NOT EXISTS `panels` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lp` int(11) NOT NULL,
`active` enum('true','false') NOT NULL,
`name` varchar(255) NOT NULL,
`content` text NOT NULL,
`type` enum('html','bbcode') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Zrzut danych tabeli `panels`
--
INSERT INTO `panels` (`id`, `lp`, `active`, `name`, `content`, `type`) VALUES
(1, 1, 'true', 'login', 'file:login.php', ''),
(2, 2, 'true', 'events', 'file:events.php', ''),
(3, 3, 'false', 'BBCode tester', '[code]$zmienna = \\''ALA MA KOTA (12|15)\\''; $liczba = preg_match(\\''/([0-9]+)\\\\|([0-9]+)/\\'', $zmienna, $wyniki);[/code] zwroci: [code]array(3) { [0]=> string(5) \\"12|15\\" [1]=> string(2) \\"12\\" [2]=> string(2) \\"15\\" }[/code]', 'bbcode'),
(4, 2, 'false', 'HTML tester', '<div class="logos">\r\n <img src="files/images/logos/intel.png">\r\n <img src="files/images/logos/nvidia.png">\r\n </div>', 'html');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `partners`
--
CREATE TABLE IF NOT EXISTS `partners` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lp` int(11) NOT NULL,
`name` varchar(252) NOT NULL,
`image` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `partners`
--
INSERT INTO `partners` (`id`, `lp`, `name`, `image`, `url`) VALUES
(1, 1, 'Intel Corporation', 'intel.PNG', 'http://www.intel.pl/content/www/pl/pl/homepage.html'),
(2, 2, 'NVIDIA Corporation', 'nvidia.png', '');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstName` varchar(32) NOT NULL,
`surname` varchar(32) NOT NULL,
`age` date NOT NULL,
`gamingId` int(11) NOT NULL,
`teamId` int(11) NOT NULL,
`countryId` int(11) NOT NULL,
`register` datetime NOT NULL,
`avatar` varchar(48) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Struktura tabeli dla `settings`
--
CREATE TABLE IF NOT EXISTS `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category` varchar(16) NOT NULL,
`type` varchar(16) NOT NULL,
`name` varchar(255) NOT NULL,
`value-pl` text NOT NULL,
`value-en` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
--
-- Zrzut danych tabeli `settings`
--
INSERT INTO `settings` (`id`, `category`, `type`, `name`, `value-pl`, `value-en`) VALUES
(1, 'auth', 'number', 'unActiveTime', '15', '15'),
(2, 'general', 'string', 'keywords', 'keywords', 'keywords english'),
(3, 'general', 'string', 'description', 'description', 'description english'),
(4, 'general', 'string', 'url', 'http://localhost', 'http://localhost'),
(5, 'ads', 'bool', 'top', 'true', 'true'),
(6, 'general', 'bool', 'login', 'true', 'true'),
(7, 'match', 'number', 'next-match', '5', '5'),
(8, 'general', 'string', 'sitename', 'www.GamingBETS.pl', 'www.GamingBETS.pl'),
(9, 'bets', 'number', 'start-credits', '0', '0'),
(10, 'register', 'bool', 'register', 'true', 'true'),
(11, 'register', 'bool', 'active-account', 'true', 'true'),
(12, 'general', 'bool', 'change-lang', 'true', 'true'),
(13, 'general', 'string', 'default-lang', 'pl', 'pl'),
(14, 'general', 'string', 'rules', 'rules', 'rules'),
(15, 'general', 'string', 'link', 'http://localhost', 'http://localhost'),
(16, 'general', 'string', 'publickey', '6LewTN4SAAAAAOCmGWUIz5PDiqj3kzxPvqWw1Rty', '6LewTN4SAAAAAOCmGWUIz5PDiqj3kzxPvqWw1Rty'),
(17, 'general', 'string', 'privatekey', '6LewTN4SAAAAANVI6UKd3fVBrXzWcCJXA2e-NBTV', '6LewTN4SAAAAANVI6UKd3fVBrXzWcCJXA2e-NBTV'),
(18, 'general', 'string', 'theme', 'blackglass', 'blackglass'),
(19, 'auth', 'number', 'hash-key', '15', '15'),
(20, 'auth', 'number', 'antispam', '3', '3');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `slider`
--
CREATE TABLE IF NOT EXISTS `slider` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lp` int(11) NOT NULL,
`name-pl` varchar(255) NOT NULL,
`name-en` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`description-pl` varchar(255) NOT NULL,
`description-en` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`active` enum('true','false') NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `slider`
--
INSERT INTO `slider` (`id`, `lp`, `name-pl`, `name-en`, `image`, `description-pl`, `description-en`, `url`, `active`) VALUES
(1, 1, 'Intel Extreme Masters', 'Intel Extreme Masters', 'iem.png', '21 stycznia, Warszawa', 'January, 21th, Warsaw', 'page/1', 'true'),
(2, 2, 'League of Legends European Qualification', 'League of Legends European Qualification', 'lol.png', '22 stycznia, Katowice', 'January, 22th, Katowice', 'page/2', 'true');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `social`
--
CREATE TABLE IF NOT EXISTS `social` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`lp` int(11) NOT NULL,
`active` enum('true','false') NOT NULL,
`name` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
--
-- Zrzut danych tabeli `social`
--
INSERT INTO `social` (`id`, `lp`, `active`, `name`, `url`) VALUES
(1, 1, 'true', 'facebook', 'http://facebook.com/pieczar92'),
(2, 2, 'true', 'twitter', 'http://twitter.com/pieczar92');
-- --------------------------------------------------------
--
-- Struktura tabeli dla `teams`
--
CREATE TABLE IF NOT EXISTS `teams` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gameId` int(11) NOT NULL,
`gamingId` int(11) NOT NULL,
`countryId` int(11) NOT NULL,
`registrer` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Struktura tabeli dla `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`session-id` varchar(13) NOT NULL,
`active` enum('true','false') NOT NULL,
`nick` varchar(32) NOT NULL,
`password` varchar(64) NOT NULL,
`email` varchar(32) NOT NULL,
`lang` varchar(3) NOT NULL,
`credits` int(11) NOT NULL,
`creditsWon` int(11) NOT NULL,
`creditsBought` int(11) NOT NULL,
`register` datetime NOT NULL,
`logged` datetime NOT NULL,
`lastAction` datetime NOT NULL,
`firstName` varchar(16) NOT NULL,
`surname` varchar(32) NOT NULL,
`age` date NOT NULL,
`street` varchar(32) NOT NULL,
`city` varchar(32) NOT NULL,
`code` varchar(8) NOT NULL,
`countryId` int(11) NOT NULL,
`avatar` varchar(48) NOT NULL,
`ip` varchar(24) NOT NULL,
`ban` enum('true','false') NOT NULL,
`banTime` datetime NOT NULL,
`newsletter` enum('true','false') NOT NULL,
`refId` int(11) NOT NULL,
`refCount` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Zrzut danych tabeli `users`
--
INSERT INTO `users` (`id`, `session-id`, `active`, `nick`, `password`, `email`, `lang`, `credits`, `creditsWon`, `creditsBought`, `register`, `logged`, `lastAction`, `firstName`, `surname`, `age`, `street`, `city`, `code`, `countryId`, `avatar`, `ip`, `ban`, `banTime`, `newsletter`, `refId`, `refCount`) VALUES
(1, '514cb27a9a45c', 'true', 'pomek', 'f6595796e883e10a472d5b3d2af53ceb9e1c6b32be1cbac57b', 'pieczar92@interia.pl', 'pl', 1200, 1000, 200, '2013-02-01 00:00:00', '2013-03-22 20:35:22', '2013-03-22 20:46:36', 'Kamil', 'Piechaczek', '1992-01-29', 'Sopocka', 'Sopot', '81-812', 178, 'e9e2cc14a6988f518ac666e48a0b53ad.png', '127.0.0.1', 'false', '0000-00-00 00:00:00', 'true', 0, 1),
(2, '514c68001f088', 'true', 'pomek92', '1b0196edfd601f1889667efaebb33b8c12572835da3f027f78', 'pomek92@pomek92.pl', 'pl', 0, 0, 0, '2013-03-16 22:59:17', '2013-03-22 15:17:36', '2013-03-22 15:17:36', '', '', '0000-00-00', '', '', '', 178, 'none.jpg', '127.0.0.1', 'false', '0000-00-00 00:00:00', 'true', 1, 0),
(3, '', 'false', 'noob', '3054dc00cb601f1889667efaebb33b8c12572835da3f027f78', 'noob@noob.pl', 'pl', 0, 0, 0, '2013-03-22 22:48:13', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '', '', '0000-00-00', '', '', '', 178, 'none.jpg', '127.0.0.1', 'false', '0000-00-00 00:00:00', 'false', 1, 0);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
37151a8d788ca6f62083a40312af83f8d7f86c93 | SQL | sanishmaharjan/spring-scaffold | /src/main/resources/db/migration/V1_001__CreatePersonTable.sql | UTF-8 | 620 | 2.703125 | 3 | [] | no_license | CREATE TABLE persons
(
id SERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
middle_name VARCHAR(50) NULL,
last_name VARCHAR(50) NOT NULL,
address VARCHAR(255) NULL,
email VARCHAR(255) NULL,
gender VARCHAR(6) DEFAULT 'Male' NOT NULL,
is_deleted BOOLEAN DEFAULT FALSE NOT NULL,
delete_reason VARCHAR(255) NULL,
deleted_at TIMESTAMP NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NULL
); | true |
fa35aff3e5de3418665d1d502ddb8058a6f74e75 | SQL | xupt007/crm | /target/classes/crm.sql | UTF-8 | 22,298 | 3.125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50540
Source Host : localhost:3306
Source Schema : crm
Target Server Type : MySQL
Target Server Version : 50540
File Encoding : 65001
Date: 20/04/2018 13:08:38
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for crm_class
-- ----------------------------
DROP TABLE IF EXISTS `crm_class`;
CREATE TABLE `crm_class` (
`classId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`courseTypeId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`beginTime` datetime DEFAULT NULL,
`endTime` datetime DEFAULT NULL,
`status` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`totalCount` int(11) DEFAULT NULL,
`upgradeCount` int(11) DEFAULT NULL,
`changeCount` int(11) DEFAULT NULL,
`runoffCount` int(11) DEFAULT NULL,
`remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`uploadTime` datetime DEFAULT NULL,
`uploadPath` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`uploadFilename` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`classId`) USING BTREE,
INDEX `courseTypeId`(`courseTypeId`) USING BTREE,
CONSTRAINT `crm_class_ibfk_1` FOREIGN KEY (`courseTypeId`) REFERENCES `crm_course_type` (`courseTypeId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_class
-- ----------------------------
INSERT INTO `crm_class` VALUES ('1caa2824-0075-4bd0-8ca4-4435660214e4', '2c9091c14c78e58b014c78e867b80009', 'WEB1期', '2018-04-01 00:00:00', '2018-08-01 00:00:00', '已开班', 1, 0, 0, 0, '主讲HTML5,javascript css servlet/jsp el表达式', NULL, NULL, NULL);
INSERT INTO `crm_class` VALUES ('2c9091c14c78e58b014c78e9106e000b', '2c9091c14c78e58b014c78e829b70008', 'SE1期', '2018-03-01 00:00:00', '2018-06-30 00:00:00', '已开班', -2, 2, 0, 0, '主讲面向对象,常用类,接口继承,集合', '2018-04-14 00:00:00', NULL, 'java基础班2期课程表.xlsx');
INSERT INTO `crm_class` VALUES ('2c9091c14c78e58b014c78e9601a000c', '2c9091c14c78e58b014c78e829b70008', 'SE2期', '2018-06-01 00:00:00', '2018-10-31 00:00:00', '未开班', 1, 0, 0, 0, '多态,多线程,网络编程 ,项目实战', NULL, NULL, NULL);
INSERT INTO `crm_class` VALUES ('59dcebbe-e86d-4849-ac12-4fc79cd1ab4f', '2c9091c14c78e58b014c78e867b80009', 'WEB2期', '2018-05-01 00:00:00', '2018-10-01 00:00:00', '未开班', 0, 0, 0, 0, '主讲数据库,MVC设计模式,HTTP协议', NULL, NULL, NULL);
INSERT INTO `crm_class` VALUES ('d326ac08-21cc-4e58-9d5a-d1f16de97381', '2c9091c14c78e58b014c78e829b700455', 'EE1期', '2018-03-01 00:00:00', '2018-07-01 00:00:00', '已开班', 0, 0, 0, 0, '主讲 Strust2,hibernate,spring,springmvc,mybatis等开源技术框架', NULL, NULL, NULL);
INSERT INTO `crm_class` VALUES ('df389c72-420b-4ce7-b841-bda011cba8db', '2c9091c14c78e58b014c78e829b700455', 'EE2期', '2018-06-08 00:00:00', '2018-10-01 00:00:00', '未开班', 0, 0, 0, 0, '主讲 springboot,dubbo分布式框架,redis数据库 maven', NULL, NULL, NULL);
-- ----------------------------
-- Table structure for crm_course_type
-- ----------------------------
DROP TABLE IF EXISTS `crm_course_type`;
CREATE TABLE `crm_course_type` (
`courseTypeId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`courseCost` double DEFAULT NULL,
`total` int(11) DEFAULT NULL,
`courseName` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`remark` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`courseTypeId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_course_type
-- ----------------------------
INSERT INTO `crm_course_type` VALUES ('2c9091c14c78e58b014c78e829b70008', 2000, 96, 'javaSE', 'java基础课程');
INSERT INTO `crm_course_type` VALUES ('2c9091c14c78e58b014c78e829b700455', 4000, 96, 'javaEE', 'javaEE企业级课程');
INSERT INTO `crm_course_type` VALUES ('2c9091c14c78e58b014c78e867b80009', 3000, 96, 'javaWeb', 'javaWeb中级课程');
-- ----------------------------
-- Table structure for crm_department
-- ----------------------------
DROP TABLE IF EXISTS `crm_department`;
CREATE TABLE `crm_department` (
`depId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`depName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`depId`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_department
-- ----------------------------
INSERT INTO `crm_department` VALUES ('2c9091c14c78e58b014c78e67de10001', 'java学院');
INSERT INTO `crm_department` VALUES ('2c9091c14c78e58b014c78e68ded0002', '咨询部');
-- ----------------------------
-- Table structure for crm_follow
-- ----------------------------
DROP TABLE IF EXISTS `crm_follow`;
CREATE TABLE `crm_follow` (
`followId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`followTime` datetime DEFAULT NULL,
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`staffId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`referId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`followId`) USING BTREE,
INDEX `staffId`(`staffId`) USING BTREE,
INDEX `referId`(`referId`) USING BTREE,
CONSTRAINT `crm_follow_ibfk_1` FOREIGN KEY (`staffId`) REFERENCES `crm_staff` (`staffId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_follow_ibfk_2` FOREIGN KEY (`referId`) REFERENCES `crm_refer` (`referId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_follow
-- ----------------------------
INSERT INTO `crm_follow` VALUES ('344acd99-14d2-481e-9703-a77a8151656f', '2018-04-15 00:01:39', '测试一下这个功能', '2c9091c14c78e58b014c78e5c32a0000', '125a0341c41b4f2baf972964c80dc2aa');
-- ----------------------------
-- Table structure for crm_graduate
-- ----------------------------
DROP TABLE IF EXISTS `crm_graduate`;
CREATE TABLE `crm_graduate` (
`granduateId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`studentId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`companyName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`salary` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`post` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`entryTime` datetime DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`classId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`granduateId`) USING BTREE,
INDEX `studentId`(`studentId`) USING BTREE,
INDEX `classId`(`classId`) USING BTREE,
CONSTRAINT `crm_graduate_ibfk_1` FOREIGN KEY (`studentId`) REFERENCES `crm_student` (`studentId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_graduate_ibfk_2` FOREIGN KEY (`classId`) REFERENCES `crm_class` (`classId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_graduate
-- ----------------------------
INSERT INTO `crm_graduate` VALUES ('faacdcbd-15ad-4309-a16e-59cdf7fa29b4', '98965f45-1be0-4d87-b43c-4b675c273bdc', '测试小公司', '8888', 'java开发工程师', '2018-04-27 00:00:00', '测试小数据', '1caa2824-0075-4bd0-8ca4-4435660214e4');
-- ----------------------------
-- Table structure for crm_post
-- ----------------------------
DROP TABLE IF EXISTS `crm_post`;
CREATE TABLE `crm_post` (
`postId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`postName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`depId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`postId`) USING BTREE,
INDEX `depId`(`depId`) USING BTREE,
CONSTRAINT `crm_post_ibfk_1` FOREIGN KEY (`depId`) REFERENCES `crm_department` (`depId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_post
-- ----------------------------
INSERT INTO `crm_post` VALUES ('2c9091c14c78e58b014c78e6b34a0003', '总监', '2c9091c14c78e58b014c78e67de10001');
INSERT INTO `crm_post` VALUES ('2c9091c14c78e58b014c78e6d4510004', '讲师', '2c9091c14c78e58b014c78e67de10001');
INSERT INTO `crm_post` VALUES ('2c9091c14c78e58b014c78e6f2340005', '主管', '2c9091c14c78e58b014c78e68ded0002');
INSERT INTO `crm_post` VALUES ('3fc33ec5-75b1-4d69-957b-aa1e2b6f74e6', '部长', '2c9091c14c78e58b014c78e68ded0002');
-- ----------------------------
-- Table structure for crm_refer
-- ----------------------------
DROP TABLE IF EXISTS `crm_refer`;
CREATE TABLE `crm_refer` (
`referId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`telephone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`qq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`intentionLevel` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`courseTypeId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`classId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`staffId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
PRIMARY KEY (`referId`) USING BTREE,
INDEX `courseTypeId`(`courseTypeId`) USING BTREE,
INDEX `classId`(`classId`) USING BTREE,
INDEX `staffId`(`staffId`) USING BTREE,
CONSTRAINT `crm_refer_ibfk_1` FOREIGN KEY (`courseTypeId`) REFERENCES `crm_course_type` (`courseTypeId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_refer_ibfk_2` FOREIGN KEY (`classId`) REFERENCES `crm_class` (`classId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_refer_ibfk_3` FOREIGN KEY (`staffId`) REFERENCES `crm_staff` (`staffId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_refer
-- ----------------------------
INSERT INTO `crm_refer` VALUES ('125a0341c41b4f2baf972964c80dc2aa', '李四', '15611111111', '11111111', 'A', '2c9091c14c78e58b014c78e829b70008', '2c9091c14c78e58b014c78e9106e000b', '西部开源', '2', '测试数据', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-14 15:43:21');
INSERT INTO `crm_refer` VALUES ('2159e925-eb6f-4db0-975e-7a970a62a8cc', '毛毛', '15666666', '45678915', 'B', '2c9091c14c78e58b014c78e829b70008', '2c9091c14c78e58b014c78e9601a000c', '同学介绍', '2', '测试小数据2', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:33:40');
INSERT INTO `crm_refer` VALUES ('57094588-5395-47fa-80ed-928e779167fd', '赵欢', '456789465', '45645646', 'B', '2c9091c14c78e58b014c78e867b80009', '1caa2824-0075-4bd0-8ca4-4435660214e4', '大街上找的', '2', '测试小数据3', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:34:37');
INSERT INTO `crm_refer` VALUES ('7027a18a-8283-406e-aa88-1875a5783efd', '刘通', '4467498', '10000000', 'A', '2c9091c14c78e58b014c78e829b70008', '2c9091c14c78e58b014c78e9106e000b', '同学介绍', '1', '测试小数据1', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:32:54');
INSERT INTO `crm_refer` VALUES ('7582c8ae-fe2b-423f-998c-f8ee927a62f7', '老王', '1515646415', '465456564', 'B', '2c9091c14c78e58b014c78e829b70008', '2c9091c14c78e58b014c78e9106e000b', '随便哪来的', '1', '测试小数据4', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:35:22');
-- ----------------------------
-- Table structure for crm_runoff
-- ----------------------------
DROP TABLE IF EXISTS `crm_runoff`;
CREATE TABLE `crm_runoff` (
`runoffId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`studentId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`staffId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
`isRefund` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`refundAmount` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`runoffId`) USING BTREE,
INDEX `studentId`(`studentId`) USING BTREE,
INDEX `staffId`(`staffId`) USING BTREE,
CONSTRAINT `crm_runoff_ibfk_1` FOREIGN KEY (`studentId`) REFERENCES `crm_student` (`studentId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_runoff_ibfk_2` FOREIGN KEY (`staffId`) REFERENCES `crm_staff` (`staffId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_runoff
-- ----------------------------
INSERT INTO `crm_runoff` VALUES ('1f9b3955-7740-45b9-a22b-e0c95474e6c6', '9a53e329-6e32-445c-b070-c106c8a198b4', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-19 17:08:14', '退款', '1000', '测试数据');
-- ----------------------------
-- Table structure for crm_staff
-- ----------------------------
DROP TABLE IF EXISTS `crm_staff`;
CREATE TABLE `crm_staff` (
`staffId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`loginName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`loginPwd` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`staffName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`gender` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`onDutyDate` date DEFAULT NULL,
`postId` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`staffId`) USING BTREE,
INDEX `postId`(`postId`) USING BTREE,
CONSTRAINT `crm_staff_ibfk_1` FOREIGN KEY (`postId`) REFERENCES `crm_post` (`postId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_staff
-- ----------------------------
INSERT INTO `crm_staff` VALUES ('2c9091c14c78e58b014c78e5c32a0000', 'jack', '827ccb0eea8a706c4c34a16891f84e7b', '管理员', NULL, NULL, NULL);
INSERT INTO `crm_staff` VALUES ('2c9091c14c78e58b014c78e759b40006', 'rose', 'ec6a6536ca304edf844d1d248a4f08dc', '肉丝', '女', '2013-04-16', '3fc33ec5-75b1-4d69-957b-aa1e2b6f74e6');
INSERT INTO `crm_staff` VALUES ('2c9091c14c78e58b014c78e7ecd90007', 'tom', '2e99bf4e42962410038bc6fa4ce40d97', '汤姆', '女', '2014-04-24', '2c9091c14c78e58b014c78e6f2340005');
INSERT INTO `crm_staff` VALUES ('639a54a6-3520-4f2e-ba7e-138196902a71', 'wuhongyu', '81dc9bdb52d04dc20036dbd8313ed055', '吴宏宇', '男', '2018-04-10', '2c9091c14c78e58b014c78e6d4510004');
INSERT INTO `crm_staff` VALUES ('cf604f72-bdff-4f41-8469-9c559ec766ed', 'zhaohuan', '81dc9bdb52d04dc20036dbd8313ed055', '赵欢', '男', '2018-04-02', '2c9091c14c78e58b014c78e6f2340005');
-- ----------------------------
-- Table structure for crm_station
-- ----------------------------
DROP TABLE IF EXISTS `crm_station`;
CREATE TABLE `crm_station` (
`stationId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`studentId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`staffId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`createDate` datetime DEFAULT NULL,
`beforeClassId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`afterClassId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`stationId`) USING BTREE,
INDEX `studentId`(`studentId`) USING BTREE,
INDEX `staffId`(`staffId`) USING BTREE,
INDEX `beforeClassId`(`beforeClassId`) USING BTREE,
INDEX `afterClassId`(`afterClassId`) USING BTREE,
CONSTRAINT `crm_station_ibfk_1` FOREIGN KEY (`studentId`) REFERENCES `crm_student` (`studentId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_station_ibfk_2` FOREIGN KEY (`staffId`) REFERENCES `crm_staff` (`staffId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_station_ibfk_3` FOREIGN KEY (`beforeClassId`) REFERENCES `crm_class` (`classId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_station_ibfk_4` FOREIGN KEY (`afterClassId`) REFERENCES `crm_class` (`classId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_station
-- ----------------------------
INSERT INTO `crm_station` VALUES ('62a3e282-a029-41bc-9c40-e317334e21a6', '9a53e329-6e32-445c-b070-c106c8a198b4', '转班', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-19 16:11:47', '2c9091c14c78e58b014c78e9601a000c', '2c9091c14c78e58b014c78e9106e000b');
INSERT INTO `crm_station` VALUES ('87853921-931f-433b-83c3-a4059d3c3a25', '04b49119-bfd2-450e-9253-46429a6d3dd9', '升级', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:49:07', '2c9091c14c78e58b014c78e9106e000b', '2c9091c14c78e58b014c78e9601a000c');
INSERT INTO `crm_station` VALUES ('fa64823a-9a9f-4a80-8159-d993fc7f117a', '98965f45-1be0-4d87-b43c-4b675c273bdc', '升级', '2c9091c14c78e58b014c78e5c32a0000', '2018-04-20 11:49:59', '2c9091c14c78e58b014c78e9106e000b', '1caa2824-0075-4bd0-8ca4-4435660214e4');
-- ----------------------------
-- Table structure for crm_student
-- ----------------------------
DROP TABLE IF EXISTS `crm_student`;
CREATE TABLE `crm_student` (
`studentId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`telephone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`identity` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '身份证',
`qq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`gender` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`mustTuition` int(255) DEFAULT NULL,
`actualTuition` int(255) DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`school` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`education` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`professional` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`identityAddress` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`homeTelephone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`homeContact` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`status` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`classId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`referId` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
PRIMARY KEY (`studentId`) USING BTREE,
INDEX `classId`(`classId`) USING BTREE,
INDEX `referId`(`referId`) USING BTREE,
CONSTRAINT `crm_student_ibfk_1` FOREIGN KEY (`classId`) REFERENCES `crm_class` (`classId`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `crm_student_ibfk_2` FOREIGN KEY (`referId`) REFERENCES `crm_refer` (`referId`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of crm_student
-- ----------------------------
INSERT INTO `crm_student` VALUES ('04b49119-bfd2-450e-9253-46429a6d3dd9', '毛毛', '15666666', '12345646', '45678915', '男', 2000, 2000, '115646@qq.com', '西安邮电大学', '本科', '信息工程', '西安', '西安', '测试数据1', '556465464', '爸爸', '升级', '2c9091c14c78e58b014c78e9601a000c', '2159e925-eb6f-4db0-975e-7a970a62a8cc', '2018-04-20 11:47:46');
INSERT INTO `crm_student` VALUES ('98965f45-1be0-4d87-b43c-4b675c273bdc', '赵欢', '456789465', '1231332123', '45645646', '男', 2000, 2000, '1115841@qq.com', '西安邮电大学', '本科', '信息工程', '西安', '西安', '测试小数据1', '15465465465', '爸爸', '毕业', '1caa2824-0075-4bd0-8ca4-4435660214e4', '57094588-5395-47fa-80ed-928e779167fd', '2018-04-20 11:48:37');
INSERT INTO `crm_student` VALUES ('9a53e329-6e32-445c-b070-c106c8a198b4', '吴宏宇', '156123456', '211224199611185239', '10000000', '男', 3000, 3000, '111111@qq.com', '西安邮电大学', '本科', '信息工程', '西安', '西安', '测试数据', '123456789', '王五', '退费', '2c9091c14c78e58b014c78e9106e000b', NULL, '2018-04-18 18:59:22');
INSERT INTO `crm_student` VALUES ('ab661f0f-4e8f-479f-a1bc-c22b57a23689', '李四', '15611111111', '1231354674879798', '11111111', '男', 2000, 1000, '45644456@qq.com', '西安邮电大学', '本科', '信息工程', '西安', '西安', '测试小数据', '1321345646', '爸爸', '新生', '2c9091c14c78e58b014c78e9106e000b', '125a0341c41b4f2baf972964c80dc2aa', '2018-04-20 11:36:45');
SET FOREIGN_KEY_CHECKS = 1;
| true |
22e36fd8f915cc01cbe44a2f832198d299767614 | SQL | anderson-sancto/marketsoap | /DB.sql | UTF-8 | 1,792 | 3.546875 | 4 | [] | no_license | CREATE DATABASE `marketsoap` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
-- marketsoap.cliente definition
CREATE TABLE `cliente` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nome` varchar(100) NOT NULL,
`sexo` char(1) NOT NULL,
`dataNascimento` date NOT NULL,
`cpf` varchar(20) DEFAULT NULL,
`telefone` varchar(11) NOT NULL,
`endereco` varchar(30) NOT NULL,
`cidade` varchar(20) NOT NULL,
`estado` char(2) NOT NULL,
`cep` varchar(8) NOT NULL,
`email` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `cpf` (`cpf`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
-- marketsoap.funcionario definition
CREATE TABLE `funcionario` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(30) NOT NULL,
`senha` varchar(30) NOT NULL,
`nome` varchar(100) NOT NULL,
`sexo` char(1) NOT NULL,
`dataNascimento` date NOT NULL,
`cpf` varchar(20) DEFAULT NULL,
`telefone` varchar(11) NOT NULL,
`endereco` varchar(30) NOT NULL,
`cidade` varchar(20) NOT NULL,
`estado` char(2) NOT NULL,
`funcao` varchar(30) NOT NULL,
`cep` varchar(8) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `cpf` (`cpf`)
) ENGINE=InnoDB AUTO_INCREMENT=115 DEFAULT CHARSET=utf8mb4;
-- marketsoap.produto definition
CREATE TABLE `produto` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`descricao` varchar(50) NOT NULL,
`quantidade` int(11) DEFAULT 10,
`valor` decimal(9,2) NOT NULL,
`nome` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;
-- marketsoap.venda definition
CREATE TABLE `venda` (
`id_cliente` int(11) NOT NULL,
`id_funcionario` int(11) NOT NULL,
`id_produto` int(11) NOT NULL,
`quantidade` int(11) NOT NULL,
`id_venda` varchar(13) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
| true |
c8d60cd3576f0bff33ba2f975fbc19155c24089c | SQL | AjoyKumarPujari/Audio-Format-Converter | /converter.sql | UTF-8 | 2,125 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 15, 2020 at 01:59 PM
-- Server version: 8.0.18
-- 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: `converter`
--
-- --------------------------------------------------------
--
-- Table structure for table `file_info`
--
DROP TABLE IF EXISTS `file_info`;
CREATE TABLE IF NOT EXISTS `file_info` (
`id` int(70) NOT NULL AUTO_INCREMENT,
`file_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`file_size` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`file_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
`UID` int(20) NOT NULL AUTO_INCREMENT,
`NAME` varchar(30) NOT NULL,
`EMAIL` varchar(30) NOT NULL,
`PHNO` int(10) NOT NULL,
`PASSWORD` varchar(20) DEFAULT NULL,
PRIMARY KEY (`UID`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`UID`, `NAME`, `EMAIL`, `PHNO`, `PASSWORD`) VALUES
(1, 'Ajoy', 'ajoykumarpujari@gmail.com', 2147483647, 'password'),
(2, 'Ajoy', 'ajoykumarpujari@gmail.com', 2147483647, 'password'),
(3, 'Ajoy', 'ajoykumarpujari@gmail.com', 8474, 'pass'),
(4, 'Ajoy', 'ajoykumarpujari@gmail.com', 847487105, 'pass');
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 |
ad6fa9210fb5ee60e5496ace073df11769854f63 | SQL | suziray/nextpath | /schema.sql | UTF-8 | 1,102 | 3.359375 | 3 | [] | no_license | create table usr (
id serial PRIMARY KEY,
first_name text not null,
last_name text not null,
title text,
company text,
education text
);
create table experience (
id serial PRIMARY KEY,
usr_id integer REFERENCES usr (id),
title text,
company text,
duration int,
description text,
tags text,
curr boolean
);
create table project (
id serial PRIMARY KEY,
title text not null,
skill text,
description text,
create_time timestamp not null
);
create table company (
id serial PRIMARY KEY,
name text not null,
type text,
url text,
size integer
);
create table usrprojectrel (
id serial PRIMARY KEY,
usr_id integer REFERENCES usr (id),
project_id integer REFERENCES project (id),
score decimal,
register_time timestamp not null,
finish_time timestamp,
content text
);
create table companyprojectrel (
id serial PRIMARY KEY,
company_id integer REFERENCES company (id),
project_id integer REFERENCES project (id),
list_time timestamp not null,
start_time timestamp not null,
expire_time timestamp not null,
time_limit integer
);
| true |
2d45059b430211557fe1c30464e45fe89fec7a8f | SQL | hp-wsp/ts-safe | /src/main/resources/db/V1_11__create_table.sql | UTF-8 | 737 | 2.890625 | 3 | [] | no_license | #-----------------------------------------------------------------------
# 添加是否复查以前查出的隐患字段
#------------------------------------------------------------------------
ALTER TABLE c_check_task ADD is_review TINYINT DEFAULT 0 NOT NULL COMMENT '是否复查以前查出的隐患';
ALTER TABLE c_check_task ADD num CHAR(32) NOT NULL COMMENT '检查任务编号';
CREATE UNIQUE INDEX idx_num ON c_check_task(num);
#-----------------------------------------------------------------------
#用户添加职务和手机号
#-----------------------------------------------------------------------
ALTER TABLE c_member ADD mobile VARCHAR(20) COMMENT '手机';
ALTER TABLE c_member ADD job VARCHAR(20) COMMENT '职务'; | true |
601b86965577cb5cab386a4a1ee43e0c0407be41 | SQL | bjoernbos/its-hackathon-hamburg | /scripts/sql/buffer_hamburger_streckennetz.sql | UTF-8 | 316 | 3.484375 | 3 | [] | no_license | DROP TABLE IF EXISTS its_hackathon.hamburg_streckennetz_buffer;
CREATE TABLE its_hackathon.hamburg_streckennetz_buffer AS
SELECT
n.id, ST_Buffer(n.geom, 100) AS geom
FROM
its_hackathon.db_streckennetz n,
its_hackathon.hamburg_bounds b
WHERE
ST_Contains(b.geom, n.geom)
OR
ST_Intersects(b.geom, n.geom);
| true |
5598cd4e0f484c937748c67564bb48d5e5f2f550 | SQL | planetacomputer/phpFoment2016 | /sql/ej5-2.sql | UTF-8 | 581 | 3.640625 | 4 | [] | no_license | SELECT e.EMPL_FORNAME, e.EMPL_SURNAME, o.OFFC_CITY, k.KNLN_NAME
FROM t_employees e
INNER JOIN t_offices o ON
e.OFFC_ID = o.OFFC_ID
LEFT OUTER JOIN t_knowledge_lines k ON
e.KNLN_ID = k.KNLN_ID
WHERE o.OFFC_COUNTRY IN ('España', 'Chile')
AND e.EMPL_MENTOR_ID is NULL;
CREATE VIEW V_PROJECTS_EMPLOYEES
(NOMBRE, APELLIDOS, NUM_EMPLEADO, NOM_PROJT, CODI_PRJT)
AS
SELECT e.EMPL_FORNAME, e.EMPL_SURNAME, e.EMPL_NUMBER, p.PRJT_NAME, p.PRJT_CODE
FROM t_employees e
INNER JOIN t_projects_employees pe ON
e.EMPL_ID = pe.EMPL_ID
INNER JOIN t_projects p ON
pe.PRJT_ID = p.PRJT_ID;
| true |
5bba43605503b338586485fe6d0826fe80b50ce9 | SQL | devmountain-lfg/devmtn-lfg | /db/tables.sql | UTF-8 | 1,606 | 3.671875 | 4 | [] | no_license | DROP TABLE IF EXISTS user_events;
DROP TABLE IF EXISTS user_preferences;
DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS activities;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
user_id SERIAL PRIMARY KEY,
created_date TIMESTAMP NOT NULL DEFAULT NOW(),
first_name varchar(50) NOT NULL,
last_name varchar(50) NOT NULL,
gender varchar(1) NULL,
email varchar(75) NOT NULL,
phone_number varchar(13) NULL,
username varchar(20) NOT NULL,
user_password varchar NOT NULL,
universal_distance int NOT NULL DEFAULT 10,
last_updated TIMESTAMP NOT NULL DEFAULT NOW()
)
;
CREATE TABLE activities (
activity_id SERIAL PRIMARY KEY,
activity_name varchar(50) NOT NULL,
description varchar NULL,
date_invented DATE NULL,
min_players_required int NULL
)
;
CREATE TABLE user_preferences (
user_preference_id SERIAL PRIMARY KEY,
user_id int REFERENCES users(user_id),
activity_id int REFERENCES activities(activity_id)
)
;
CREATE TABLE events (
event_id SERIAL PRIMARY KEY,
activity_id int REFERENCES activities(activity_id),
created_date TIMESTAMP DEFAULT NOW(),
event_date_start TIMESTAMP NOT NULL,
event_date_end TIMESTAMP NOT NULL,
public_event BOOLEAN,
creator_id int REFERENCES users(user_id),
max_players int,
event_message varchar,
event_address_1 varchar,
event_address_2 varchar,
event_city varchar(50),
event_state varchar(2),
event_zip varchar(10)
)
;
CREATE TABLE user_events (
user_id int REFERENCES users(user_id),
event_id int REFERENCES events(event_id)
)
;
| true |
e7b626998b117dcf3743f0a115b10aa8f948c077 | SQL | mastodonlabs/Football | /sql/create.tbl.user_permissions.sql | UTF-8 | 263 | 2.875 | 3 | [] | no_license |
--
-- Roles: user, pool_admin, site_admin
--
CREATE TABLE role (
id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
edit_pool ENUM('Y', 'N') DEFAULT 'N'
);
CREATE TABLE user_roles (
a3m_account_id INTEGER,
role_id INTEGER
);
| true |
e9acf346e6ed0394ce84d9de3f3a0737b551ec77 | SQL | aimohi/ot-harjoitustyo | /data/schema.sql | UTF-8 | 269 | 2.875 | 3 | [] | no_license | CREATE TABLE Users
(
id INTEGER PRIMARY KEY,
username TEXT,
password TEXT
);
CREATE TABLE Accounts
(
id INTEGER PRIMARY KEY,
user_id INTEGER REFERENCES Users,
date DATE,
amount INTEGER,
account TEXT,
name TEXT,
currency TEXT
);
| true |
9d2e7492dc14ff7ec425b6c2299aaaa33b59fdc9 | SQL | hayatemiyayoshi/lamp_practice | /lamp_dock/append_schema.sql | UTF-8 | 1,544 | 3.4375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- ホスト: mysql
-- 生成日時: 2021 年 2 月 11 日 12:35
-- サーバのバージョン: 5.7.32
-- PHP のバージョン: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
--
-- データベース: `sample`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `details`
--
CREATE TABLE `details` (
`detail_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`price` int(11) NOT NULL,
`amount` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- テーブルの構造 `histories`
--
CREATE TABLE `histories` (
`order_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- ダンプしたテーブルのインデックス
--
--
-- テーブルのインデックス `details`
--
ALTER TABLE `details`
ADD PRIMARY KEY (`detail_id`);
--
-- テーブルのインデックス `histories`
--
ALTER TABLE `histories`
ADD PRIMARY KEY (`order_id`);
--
-- ダンプしたテーブルの AUTO_INCREMENT
--
--
-- テーブルの AUTO_INCREMENT `details`
--
ALTER TABLE `details`
MODIFY `detail_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- テーブルの AUTO_INCREMENT `histories`
--
ALTER TABLE `histories`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
| true |
a9117ebec33bd0b5c97b230497318783e347f7f1 | SQL | Tommimehtanen/database-design | /tiep3_koostekyselyt_h6_t9_279330.sql | UTF-8 | 291 | 3.375 | 3 | [] | no_license | --Tietokantojen perusteet 2020
--H6 T9
--tommi.mehtanen@tuni.fi
SELECT DISTINCT artwork.artwork_id AS artwork_id, artwork_name
FROM artwork, displayed_at
WHERE artwork.artwork_id = displayed_at.artwork_id
GROUP BY artwork.artwork_id
HAVING COUNT(*) >= ALL (SELECT COUNT(*) FROM artwork)
ORDER BY artwork.artwork_id; | true |
d16b369a3858eb3d2a32c49419ddb9ca6c78cc6e | SQL | Ares-xhs/spring-cloud | /jta-atomikos/src/main/resources/sql/consumer.sql | UTF-8 | 428 | 3.171875 | 3 | [] | no_license | # DROP DATABASE consumer;
CREATE DATABASE consumer;
USE consumer;
CREATE TABLE consumer (
id BIGINT NOT NULL AUTO_INCREMENT
COMMENT '主键',
name VARCHAR(40) NOT NULL
COMMENT '名称',
recv_time TIMESTAMP NOT NULL
COMMENT '接收时间',
result TINYINT NOT NULL
COMMENT '返回结果',
PRIMARY KEY (id)
)
ENGINE = InnoDB
AUTO_INCREMENT = 100
CHARSET = utf8
COMMENT '客户表';
| true |
4601cec7c4d71a7a3f4edff65deadf82f55a912f | SQL | miranda-price/CSC-174-Lab-4 | /export.sql | UTF-8 | 1,807 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 20, 2021 at 04:40 PM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
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: `lab03`
--
-- --------------------------------------------------------
--
-- Table structure for table `contacts`
--
CREATE TABLE `contacts` (
`counter` int(11) NOT NULL,
`firstName` varchar(50) NOT NULL,
`lastname` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`phoneNumber` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `contacts`
--
INSERT INTO `contacts` (`counter`, `firstName`, `lastname`, `email`, `phoneNumber`) VALUES
(3, 'newFirst', 'newLast', 'new@mail', 1238904567),
(4, 'abc', 'def', 'email', 1234567890),
(8, 'entry', 'testing', 'entry.testing@mail', 1112223344),
(10, 'opq', 'rst', 'fakemail@mail', 1115559988),
(12, 'firstname', 'lastname', 'first.last@email', 1113336699);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
ADD PRIMARY KEY (`counter`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
MODIFY `counter` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
1b1a81e8d33188c3c9cc77262943cf769659201e | SQL | radtek/abs3 | /sql/mmfo/bars/Function/f_get_typdist.sql | WINDOWS-1251 | 1,444 | 2.8125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/function/f_get_typdist.sql =========*** Run
PROMPT =====================================================================================
CREATE OR REPLACE FUNCTION BARS.F_GET_TYPDIST (p_rnk number)
-- :
-- 0 - .
-- 1 -
-- 2 - CORP2
return number
is
l_rez number;
begin
begin
select 2 into l_rez from BARSAQ.IBANK_RNK i where i.rnk = p_rnk;
exception when no_data_found then
begin
select 1 into l_rez from customer where sab is not null and rnk = p_rnk;
exception when no_data_found then l_rez := 0;
end;
end;
return l_rez;
end;
/
show err;
PROMPT *** Create grants F_GET_TYPDIST ***
grant EXECUTE on F_GET_TYPDIST to BARS_ACCESS_DEFROLE;
grant EXECUTE on F_GET_TYPDIST to START1;
PROMPT =====================================================================================
PROMPT *** End *** ========== Scripts /Sql/BARS/function/f_get_typdist.sql =========*** End
PROMPT =====================================================================================
| true |
fd0acbeb81287ac39a4469ebc72eb5c32a3cba6e | SQL | algebres/biblioteca-cakephp | /bd/bd.sql | UTF-8 | 1,819 | 3.90625 | 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';
CREATE SCHEMA IF NOT EXISTS `biblioteca` DEFAULT CHARACTER SET utf8 ;
USE `biblioteca` ;
-- -----------------------------------------------------
-- Table `biblioteca`.`generos`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `biblioteca`.`generos` (
`id` INT NOT NULL AUTO_INCREMENT ,
`genero` VARCHAR(45) NULL ,
`classificacao` INT NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `biblioteca`.`autores`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `biblioteca`.`autores` (
`id` INT NOT NULL AUTO_INCREMENT ,
`autor` VARCHAR(100) NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `biblioteca`.`livros`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `biblioteca`.`livros` (
`id` INT NOT NULL AUTO_INCREMENT ,
`nome` VARCHAR(100) NULL ,
`generos_id` INT NOT NULL ,
`autores_id` INT NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `fk_livros_generos` (`generos_id` ASC) ,
INDEX `fk_livros_autores1` (`autores_id` ASC) ,
CONSTRAINT `fk_livros_generos`
FOREIGN KEY (`generos_id` )
REFERENCES `biblioteca`.`generos` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_livros_autores1`
FOREIGN KEY (`autores_id` )
REFERENCES `biblioteca`.`autores` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
eceed838c392d0f28a2b0191577d439ab022f95c | SQL | johnmcteague/springbox-cloud | /springbox-recommendations/src/main/resources/import.sql | UTF-8 | 274 | 2.65625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS ratings (
`user_id` INT NOT NULL,
`movie_id` VARCHAR(45) NOT NULL,
`rating` FLOAT NULL,
`timestamp` BIGINT NULL,
PRIMARY KEY (`user_id`, `movie_id`));
insert into ratings(user_id,movie_id,rating,timestamp) values(1,11,8.0,1460944234);
| true |
6524823465929e2930c4fb2e5d1fd86d1fc60618 | SQL | leeshamiller/PersonalProject | /db/delete_task_inbox.sql | UTF-8 | 163 | 3 | 3 | [] | no_license | DELETE FROM task
WHERE task_id = ${task_id};
select * from task
where task_date = 'inbox'
and completed = false
and t_user_id = ${t_user_id}
order by task_id desc | true |
92f29a5ca8baa2cabadc5344d4ccbb8c26ee1eed | SQL | 2904nando/narguis_sabores | /SQL/selects_nervosos.sql | UTF-8 | 2,860 | 4.03125 | 4 | [] | no_license | -- Database: narguis
-- DROP DATABASE narguis;
-- Select de Essências e códigos de categorias
SELECT
essencia.cd_essencia,
essencia.nm_essencia,
essencia.ds_marca,
essencia.pr_preco_medio,
essencia.ds_descricao,
essencia.ds_foto,
essencia.qt_pacote,
array_agg(categoria.cd_categoria),
array_agg(categoria.nm_categoria),
array_agg(categoria.ds_descricao)
FROM essencia
INNER JOIN essencia_categoria ON essencia_categoria.cd_essencia = essencia.cd_essencia
INNER JOIN categoria ON essencia_categoria.cd_categoria = categoria.cd_categoria
GROUP BY essencia.cd_essencia
ORDER BY cd_essencia;
-- Select de Misturas e códigos de categorias
SELECT
mistura.cd_mistura,
mistura.nm_mistura,
mistura.ds_mistura,
es1.cd_essencia essencia_1,
es1.nm_essencia,
es1.ds_foto,
mistura.nr_porcentagem_1,
es2.cd_essencia essencia_2,
es2.nm_essencia,
es2.ds_foto,
mistura.nr_porcentagem_2,
array_agg(categoria.cd_categoria),
array_agg(categoria.nm_categoria),
array_agg(categoria.ds_descricao)
FROM mistura
INNER JOIN mistura_categoria ON mistura_categoria.cd_mistura = mistura.cd_mistura
INNER JOIN categoria ON categoria.cd_categoria = mistura_categoria.cd_categoria
INNER JOIN essencia AS es1 ON es1.cd_essencia = mistura.fk_essencia_1
INNER JOIN essencia AS es2 ON es2.cd_essencia = mistura.fk_essencia_2
GROUP BY (mistura.cd_mistura, es1.cd_essencia, es2.cd_essencia)
ORDER BY mistura.cd_mistura;
-- Select focado de essência
SELECT
essencia.cd_essencia,
essencia.nm_essencia,
essencia.ds_marca,
essencia.pr_preco_medio,
essencia.ds_descricao,
essencia.ds_foto,
essencia.qt_pacote,
array_agg(categoria.cd_categoria),
array_agg(categoria.nm_categoria),
array_agg(categoria.ds_descricao)
FROM essencia
INNER JOIN essencia_categoria ON essencia_categoria.cd_essencia = essencia.cd_essencia
INNER JOIN categoria ON essencia_categoria.cd_categoria = categoria.cd_categoria
WHERE essencia.cd_essencia = 1
GROUP BY essencia.cd_essencia;
-- Select focado de mistura
SELECT
mistura.cd_mistura,
mistura.nm_mistura,
mistura.ds_mistura,
es1.cd_essencia essencia_1,
es1.nm_essencia,
mistura.nr_porcentagem_1,
es2.cd_essencia essencia_2,
es2.nm_essencia,
mistura.nr_porcentagem_2,
array_agg(categoria.cd_categoria),
array_agg(categoria.nm_categoria),
array_agg(categoria.ds_descricao)
FROM mistura
INNER JOIN mistura_categoria ON mistura_categoria.cd_mistura = mistura.cd_mistura
INNER JOIN categoria ON categoria.cd_categoria = mistura_categoria.cd_categoria
INNER JOIN essencia AS es1 ON es1.cd_essencia = mistura.fk_essencia_1
INNER JOIN essencia AS es2 ON es2.cd_essencia = mistura.fk_essencia_2
WHERE mistura.cd_mistura = 1
GROUP BY (mistura.cd_mistura, es1.cd_essencia, es2.cd_essencia);
-- Select de Categorias
SELECT * FROM categoria;
-- Select focado de Categoria
SELECT * FROM categoria WHERE cd_categoria=1;
| true |
4f8045d733fb1b6286c9afb7092afd21f4b7bb3b | SQL | ompal/diagno-lab-doc | /diagnoLab.sql | UTF-8 | 6,989 | 3.15625 | 3 | [] | no_license | use diagno_lab;
CREATE TABLE `permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`display` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`desc` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
CREATE TABLE `role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`display` varchar(100) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL,
`desc` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
CREATE TABLE `role_permission` (
`role_id` bigint(20) NOT NULL,
`permission_id` bigint(20) NOT NULL,
KEY `FKf8yllw1ecvwqy3ehyxawqa1qp` (`permission_id`),
KEY `FKa6jx8n8xkesmjmv6jqug6bg68` (`role_id`),
CONSTRAINT `FKa6jx8n8xkesmjmv6jqug6bg68` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`),
CONSTRAINT `FKf8yllw1ecvwqy3ehyxawqa1qp` FOREIGN KEY (`permission_id`) REFERENCES `permission` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_expired` bit(1) DEFAULT NULL,
`account_locked` bit(1) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`created_by` bigint(20) DEFAULT NULL,
`credentials_expired` bit(1) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`enabled` bit(1) DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`middle_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`mobile` varchar(10) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
`username` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `user_role` (
`user_id` bigint(20) NOT NULL,
`role_id` bigint(20) NOT NULL,
KEY `FKa68196081fvovjhkek5m97n3y` (`role_id`),
KEY `FK859n2jvi8ivhui0rl0esws6o` (`user_id`),
CONSTRAINT `FK859n2jvi8ivhui0rl0esws6o` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),
CONSTRAINT `FKa68196081fvovjhkek5m97n3y` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `password_reset_token` (
`id` bigint(20) NOT NULL,
`expiry_date` datetime NOT NULL,
`token` varchar(255) NOT NULL,
`user_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_ima88norei0uw3te4lim0qsl` (`token`),
KEY `FKt3xh3951985ln0y0v5m85c8is` (`user_id`),
CONSTRAINT `FKt3xh3951985ln0y0v5m85c8is` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `oauth_client_details` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`access_token_validity` int(11) DEFAULT NULL,
`additional_information` varchar(255) DEFAULT NULL,
`authorities` varchar(255) DEFAULT NULL,
`authorized_grant_types` varchar(255) DEFAULT NULL,
`autoapprove` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`client_secret` varchar(255) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`resource_ids` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`web_server_redirect_uri` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UK_3my6lp6ttga6hhwtsutscqset` (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE `address_master` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`address` VARCHAR(200) NOT NULL,
`area` VARCHAR(45) NOT NULL,
`city` VARCHAR(45) NOT NULL,
`district` VARCHAR(45) NOT NULL,
`state` VARCHAR(45) NOT NULL,
`pin_code` INT NOT NULL,
`country` VARCHAR(45) NOT NULL,
UNIQUE INDEX `address_UNIQUE` (`address` ASC),
PRIMARY KEY (`id`));
CREATE TABLE `test_category_master` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`test_name` varchar(200) NOT NULL,
`test_desc` varchar(300) NOT NULL,
`category_type` int(11) NOT NULL,
`parent_id` bigint(20) NOT NULL,
`test_amount` int(11) DEFAULT NULL,
`discount_amount` int(11) DEFAULT NULL,
`facility_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `sjhdgfjsdhfgjsdgfjsdgfjsdgf_idx` (`facility_id`),
CONSTRAINT `sjhdgfjsdhfgjsdgfjsdgfjsdgf` FOREIGN KEY (`facility_id`) REFERENCES `medical_facility_details` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
SELECT * FROM diagno_lab.test_category_master where parent_id=0 and facility_id=1;
SELECT * FROM diagno_lab.test_category_master where parent_id = 1 and category_type = 0 and facility_id=1;
SELECT * FROM diagno_lab.test_category_master where parent_id = 2 and category_type = 1 and facility_id=1;
SELECT * FROM diagno_lab.test_category_master where parent_id = 6 and category_type = 1 and facility_id=1;
CREATE TABLE `patient_details` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(10) NOT NULL,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`gender` varchar(20) NOT NULL,
`age` int(11) NOT NULL,
`email` varchar(100) DEFAULT NULL,
`mobile` varchar(10) NOT NULL,
`aadhar_no` varchar(12) DEFAULT NULL,
`address_id` bigint(20) NOT NULL,
`facility_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `sajkhfkjsdhkaldhfksdfkd_idx` (`address_id`),
KEY `ajkshgksjdhsdjkghklfjghkdfjghkf_idx` (`facility_id`),
CONSTRAINT `ajkshgksjdhsdjkghklfjghkdfjghkf` FOREIGN KEY (`facility_id`) REFERENCES `medical_facility_details` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `sajkhfkjsdhkaldhfksdfkd` FOREIGN KEY (`address_id`) REFERENCES `address_master` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `patient_registration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`patient_id` bigint(20) NOT NULL,
`advised_date` date NOT NULL,
`advised_by_doctor` varchar(50) DEFAULT NULL,
`advised_facility` varchar(100) DEFAULT NULL,
`advised_facility_address` bigint(20) DEFAULT NULL,
`report_delivery_mode` varchar(45) DEFAULT NULL,
`is_urgent` int(11) DEFAULT NULL,
`reffered_by` varchar(45) DEFAULT NULL,
`insurance_company_id` int(11) DEFAULT NULL,
`clinical_history` varchar(500) DEFAULT NULL,
`report_delivered_by` int(11) DEFAULT NULL,
`facility_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `ajkdghajkhgkjsdhfksdhfkdjsfkd_idx` (`facility_id`),
KEY `jkahgkjsdhgsdkfhkdjhfksdjf_idx` (`advised_facility_address`),
KEY `zxnmbvmxcbvmxcvbmxcvmxc_idx` (`patient_id`),
CONSTRAINT `ajkdghajkhgkjsdhfksdhfkdjsfkd` FOREIGN KEY (`facility_id`) REFERENCES `medical_facility_details` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `jkahgkjsdhgsdkfhkdjhfksdjf` FOREIGN KEY (`advised_facility_address`) REFERENCES `address_master` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `zxnmbvmxcbvmxcvbmxcvmxc` FOREIGN KEY (`patient_id`) REFERENCES `patient_details` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
45280bbde2696a42429357fe0b3c8e0c110cb71f | SQL | DimolSPA/Dimol-Fix-Carteras | /Dimol.Carteras/Dimol.Carteras.Database/dbo/Stored Procedures/Procs2/Trae_ProvCli_Sucursales.sql | UTF-8 | 462 | 2.859375 | 3 | [] | no_license |
Create Procedure Trae_ProvCli_Sucursales(@pcs_codemp integer, @pcs_pclid integer) as
SELECT provcli_sucursal.pcs_pcsid,
provcli_sucursal.pcs_nombre,
provcli_sucursal.pcs_casamatriz
FROM provcli_sucursal
WHERE ( provcli_sucursal.pcs_codemp = @pcs_codemp ) AND
( provcli_sucursal.pcs_pclid = @pcs_pclid )
ORDER BY provcli_sucursal.pcs_casamatriz DESC,
provcli_sucursal.pcs_nombre ASC
| true |
aecc1c32e1e5a46b13848ac7269a5900e87c10d9 | SQL | Aadam20/Electronic-Voting-System- | /ElectronicVotingSystem/evsdatabase.sql | UTF-8 | 6,817 | 3.046875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 17, 2017 at 05:37 PM
-- Server version: 5.5.54-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.21
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: `evsdatabase`
--
CREATE DATABASE IF NOT EXISTS `evsdatabase` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `evsdatabase`;
-- --------------------------------------------------------
--
-- Table structure for table `adminList`
--
CREATE TABLE IF NOT EXISTS `adminList` (
`adminID` int(11) NOT NULL,
`password` varchar(200) NOT NULL,
PRIMARY KEY (`password`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `adminList`
--
INSERT INTO `adminList` (`adminID`, `password`) VALUES
(1234, '1234'),
(0, 'Admin'),
(813006410, 'mercery1?');
-- --------------------------------------------------------
--
-- Table structure for table `mailinglist`
--
CREATE TABLE IF NOT EXISTS `mailinglist` (
`RegistrationNumber` int(11) NOT NULL,
`Constituency` varchar(100) NOT NULL,
`Password` varchar(200) NOT NULL,
`TimeOfRegistration` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`RegistrationNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mailinglist`
--
INSERT INTO `mailinglist` (`RegistrationNumber`, `Constituency`, `Password`, `TimeOfRegistration`) VALUES
(814001534, 'St. George North East', '8nxaB25aBv', '2017-04-13 10:15:13');
-- --------------------------------------------------------
--
-- Table structure for table `parties`
--
CREATE TABLE IF NOT EXISTS `parties` (
`Party` varchar(200) NOT NULL,
`Acronym` varchar(200) NOT NULL,
`Color_Code` varchar(10) NOT NULL,
PRIMARY KEY (`Acronym`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `parties`
--
INSERT INTO `parties` (`Party`, `Acronym`, `Color_Code`) VALUES
('National Democratic Congress', 'NDC', 'yellow'),
('New National Party', 'NNP', '#008000');
-- --------------------------------------------------------
--
-- Table structure for table `results`
--
CREATE TABLE IF NOT EXISTS `results` (
`released` int(11) NOT NULL,
`time_of_release` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`released`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `results`
--
INSERT INTO `results` (`released`, `time_of_release`) VALUES
(1, '2017-04-13 10:59:25');
-- --------------------------------------------------------
--
-- Table structure for table `voters`
--
CREATE TABLE IF NOT EXISTS `voters` (
`RegistrationNumber` int(11) NOT NULL,
`Surname` varchar(100) NOT NULL,
`GivenNames` varchar(200) NOT NULL,
`Sex` varchar(10) NOT NULL,
`DateOfBirth` date NOT NULL,
`CountryOfBirth` varchar(200) NOT NULL,
`DateIssued` date NOT NULL,
`ExpireDate` date NOT NULL,
`HeightFeet` int(11) NOT NULL,
`HeightInches` int(11) NOT NULL,
`Voted` int(11) NOT NULL DEFAULT '0',
`Constituency` varchar(200) NOT NULL,
`Password` varchar(200) NOT NULL,
`Phone` varchar(200) NOT NULL,
`E-Mail` varchar(200) NOT NULL,
PRIMARY KEY (`RegistrationNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `voters`
--
INSERT INTO `voters` (`RegistrationNumber`, `Surname`, `GivenNames`, `Sex`, `DateOfBirth`, `CountryOfBirth`, `DateIssued`, `ExpireDate`, `HeightFeet`, `HeightInches`, `Voted`, `Constituency`, `Password`, `Phone`, `E-Mail`) VALUES
(814001534, 'Ahmad', 'Aadam', 'M', '1995-12-04', 'Grenada', '2015-04-13', '2025-04-13', 6, 2, 1, 'St. George North East', '6b06b3f0c160f0fac3ae412c656ac99095720859', '1(474)742-6372', 'AadamAhmad@gmail.com');
-- --------------------------------------------------------
--
-- Table structure for table `votes`
--
CREATE TABLE IF NOT EXISTS `votes` (
`Constituency` varchar(100) NOT NULL,
`NDC` int(11) NOT NULL DEFAULT '0',
`NNP` int(11) NOT NULL DEFAULT '0',
`NNPTraditional` int(11) NOT NULL DEFAULT '0',
`NDCTraditional` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`Constituency`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `votes`
--
INSERT INTO `votes` (`Constituency`, `NDC`, `NNP`, `NNPTraditional`, `NDCTraditional`) VALUES
('St. Andrew North West', 0, 0, 34, 12),
('St. Andrew South East', 1, 0, 2, 3),
('St. Andrew South West', 0, 0, 0, 0),
('St. George North East', 0, 0, 4, 4),
('St. George North West', 0, 0, 22, 39),
('St. George South', 0, 0, 0, 0),
('St. George South East', 0, 0, 0, 0),
('St. John', 0, 0, 0, 0),
('St. Mark', 0, 0, 0, 0),
('St. Patrick East', 0, 0, 0, 0),
('St. Patrick West', 0, 0, 0, 0),
('Town of St. George', 0, 0, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `votes_offline`
--
CREATE TABLE IF NOT EXISTS `votes_offline` (
`Constituency` varchar(200) NOT NULL,
`NNP` int(11) NOT NULL DEFAULT '0',
`NDC` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`Constituency`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `votes_offline`
--
INSERT INTO `votes_offline` (`Constituency`, `NNP`, `NDC`) VALUES
('St. Andrew North West', 0, 0),
('St. Andrew South East', 0, 0),
('St. Andrew South West', 0, 0),
('St. George North East', 0, 0),
('St. George North West', 0, 0),
('St. George South', 0, 0),
('St. George South East', 0, 0),
('St. John', 11, 10),
('St. Mark', 12, 13),
('St. Patrick East', 0, 0),
('St. Patrick West', 0, 0),
('Town of St. George', 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `votes_online`
--
CREATE TABLE IF NOT EXISTS `votes_online` (
`Constituency` varchar(200) NOT NULL,
`NNP` int(11) NOT NULL DEFAULT '0',
`NDC` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`Constituency`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `votes_online`
--
INSERT INTO `votes_online` (`Constituency`, `NNP`, `NDC`) VALUES
('St. Andrew North West', 0, 0),
('St. Andrew South East', 0, 0),
('St. Andrew South West', 0, 0),
('St. George North East', 2, 1),
('St. George North West', 0, 0),
('St. George South', 0, 0),
('St. George South East', 0, 0),
('St. John', 3, 4),
('St. Mark', 6, 5),
('St. Patrick East', 0, 0),
('St. Patrick West', 0, 0),
('Town of St. George', 0, 0);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
541a6328923ba1296ccea2cb899824bb97e4721d | SQL | tayduivn/training | /rdbms/update/sacwis_990.sql | UTF-8 | 1,108 | 2.640625 | 3 | [] | no_license | --STGAP00016107 - Release(4.2) MR-075 Add new field
--add new column
ALTER TABLE CAPS.CAPS_RESOURCE
ADD (
IND_HOLD_PLACEMENTS VARCHAR2(1)
);
COMMENT ON COLUMN CAPS.CAPS_RESOURCE.IND_HOLD_PLACEMENTS IS 'Indicator to put home on a hold placements status that would set resource status as inactive on approval.';
-- new column for resource_history
ALTER TABLE CAPS.RESOURCE_HISTORY
ADD (
IND_HOLD_PLACEMENTS VARCHAR2(1)
);
COMMENT ON COLUMN CAPS.RESOURCE_HISTORY.IND_HOLD_PLACEMENTS IS 'Indicator to put home on a hold placements status that would set resource status as inactive on approval.';
-- new column for resource_history_audit
ALTER TABLE CAPS.RESOURCE_HISTORY_AUDIT
ADD (
IND_HOLD_PLACEMENTS VARCHAR2(1)
);
COMMENT ON COLUMN CAPS.RESOURCE_HISTORY_AUDIT.IND_HOLD_PLACEMENTS IS 'Indicator to put home on a hold placements status that would set resource status as inactive on approval.';
insert into caps.schema_version(id_schema_version,application_version,comments)
values (991, 'SacwisRev4', 'Release 4.2 - DBCR 16107');
commit;
| true |
959669a3bd0f59907b5fcec37b8b6f17892f9a2e | SQL | Oscajunq/HandsON | /HandsON_Oracle/DBA/System_Parameters.sql | UTF-8 | 482 | 3.171875 | 3 | [] | no_license | --* File Name : System_Parameters.sql
--* Author : DR Timothy S Hall
--* Description : Displays a list of all the system parameters.
--* Requirements : Access to the v$ views.
--* Call Syntax : @System_Parameters
--* Last Modified: 15/07/2000
PROMPT
SET LINESIZE 500
SET PAGESIZE 30
SET PAUSE ON
COLUMN "Name" FORMAT A30
COLUMN "Value" FORMAT A200
SELECT Upper(a.name) "Name",
Substr(a.value,1,200) "Value"
FROM v$system_parameter a
ORDER BY 1;
SET PAUSE OFF
PROMPT
| true |
ad32737c07ad5724c12e19ed4ef3a94e169cc953 | SQL | antihax/esi-isk | /sql/0_users.sql | UTF-8 | 271 | 2.734375 | 3 | [
"MIT"
] | permissive | CREATE TABLE IF NOT EXISTS users (
refresh_token TEXT NOT NULL,
access_token TEXT NOT NULL,
access_expires TIMESTAMP NOT NULL,
character_id INTEGER,
owner_hash TEXT,
last_processed TIMESTAMP,
PRIMARY KEY (refresh_token)
);
| true |
df2dd60e510946607ede7a7f990a715c4c7bc5ae | SQL | Oriinks/PL-SQL-Projekt-na-studiach | /ProjectSQLOracle/Select.sql | UTF-8 | 774 | 3.3125 | 3 | [] | no_license | --Select 1
CREATE VIEW widok_problem_globalny AS
Select Nazwa, count(TelephoneNumber),DataRozpoczecia,DataZakonczenia
FROM GlobalProblem ,GlobalProblemNumber, Usluga
WHERE Global_Problem_Id=global_problemnum_id AND Rodzaj_Id=Id;
CREATE OR REPLACE VIEW widok_problem_globalny AS
Select Nazwa, count(TelephoneNumber),DataRozpoczecia,DataZakonczenia
FROM GlobalProblem ,GlobalProblemNumber, Usluga
WHERE Global_Problem_Id=global_problemnum_id AND Rodzaj_Id=Id
GROUP BY DataRozpoczecia,DataZakonczenia,Rodzaj_Id,Nazwa;
--Select 2
SELECT Opis, DataDodania,Nazwa,Imie,Nazwisko,TelephoneNumber_Number
FROM Ticklery, Typ, employee
WHERE Employe_Id=Employee_Id AND Typ_Id_Typ=Id_Typ
GROUP BY TelephoneNumber_Number,DataDodania,Employee_Id,Nazwa,Imie,Nazwisko,Opis; | true |
1784d0f74c2e148bca804171c5e426f25d2b36ed | SQL | SudhirDeshwal/PHP_Project | /DB_Scripts/coronatravels_april5_phpMyAdmin.sql | UTF-8 | 5,129 | 3.4375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 05, 2020 at 06:22 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.4
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: `coronatravels`
--
-- --------------------------------------------------------
--
-- Table structure for table `bookings`
--
CREATE TABLE `bookings` (
`booking_id` int(11) NOT NULL,
`trip_id` int(11) DEFAULT NULL,
`number_adults` int(11) DEFAULT NULL,
`number_children` int(11) DEFAULT NULL,
`total_cost` decimal(10,2) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `bookings`
--
INSERT INTO `bookings` (`booking_id`, `trip_id`, `number_adults`, `number_children`, `total_cost`, `user_id`) VALUES
(1, 1, 2, 1, '700.00', 1),
(2, 2, 2, 0, '900.00', 2);
-- --------------------------------------------------------
--
-- Table structure for table `hotels`
--
CREATE TABLE `hotels` (
`hotel_id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL,
`address` varchar(200) DEFAULT NULL,
`rating` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `hotels`
--
INSERT INTO `hotels` (`hotel_id`, `name`, `address`, `rating`) VALUES
(1, 'Panama Hotel', '123 Panama City', 4.5),
(2, 'Havana Inn', '1456 Castro Way', 5);
-- --------------------------------------------------------
--
-- Table structure for table `images`
--
CREATE TABLE `images` (
`image_id` int(11) NOT NULL,
`path` varchar(500) DEFAULT NULL,
`trip_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `images`
--
INSERT INTO `images` (`image_id`, `path`, `trip_id`) VALUES
(1, './images/panama1.jpg', 1),
(2, '/images/image2.jpg', 2),
(3, './images/panama2.jpg', 1),
(4, '/images/image4.png', 2),
(5, './images/panama1.jpg', 1);
-- --------------------------------------------------------
--
-- Table structure for table `trips`
--
CREATE TABLE `trips` (
`trip_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`short_description` varchar(50) NOT NULL,
`long_description` text NOT NULL,
`country` varchar(50) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`hotel_id` int(11) NOT NULL,
`cost` decimal(10,2) NOT NULL,
`status` varchar(50) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `trips`
--
INSERT INTO `trips` (`trip_id`, `name`, `short_description`, `long_description`, `country`, `start_date`, `end_date`, `hotel_id`, `cost`, `status`) VALUES
(1, 'Panama 7 Day Getaway', 'The best Panama trip ever', 'The best panama trip ever to exist', 'Panama', '2020-01-01', '2020-02-08', 1, '450.00', 'open'),
(2, 'Havana 2 Week Lounge', 'The best Cuba trip ever!', 'The best Cuba trip to ever exit!', 'Cuba', '2020-01-01', '2020-02-08', 2, '500.00', 'open');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`user_id` int(11) NOT NULL,
`password_hash` varchar(500) DEFAULT NULL,
`first_name` varchar(50) DEFAULT NULL,
`last_name` varchar(50) DEFAULT NULL,
`phone` varchar(50) DEFAULT NULL,
`dob` date DEFAULT NULL,
`role` varchar(50) DEFAULT NULL,
`status` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`email_verification_code` varchar(500) DEFAULT NULL,
`password_recovery_code` varchar(500) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`user_id`, `password_hash`, `first_name`, `last_name`, `phone`, `dob`, `role`, `status`, `created_at`, `email_verification_code`, `password_recovery_code`) VALUES
(1, 'dsfsadfsdafdsf', 'John', 'Doe', '55555', '1956-01-01', 'user', 'enabled', '2020-01-02 05:00:00', 'dsfsfdsfdsf', 'asdasdasdasd'),
(2, 'dfdsfsdfdsf', 'Jane', 'Doe', '5555', '1978-01-01', 'user', 'pass_verification', '2020-01-01 05:00:00', 'adsadasdsad', NULL),
(3, 'fsdfsdfsdf', 'Big', 'Boss', '55555', '1990-01-01', 'admin', 'enabled', '2020-01-01 05:00:00', 'sadasdasdasd', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
ADD PRIMARY KEY (`booking_id`);
--
-- Indexes for table `hotels`
--
ALTER TABLE `hotels`
ADD PRIMARY KEY (`hotel_id`);
--
-- Indexes for table `images`
--
ALTER TABLE `images`
ADD PRIMARY KEY (`image_id`);
--
-- Indexes for table `trips`
--
ALTER TABLE `trips`
ADD PRIMARY KEY (`trip_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
7a9c2f2dda8d119786a75923d302dfa42584f3e7 | SQL | mubtakir-lazuardi/sql-union-then-join-table | /query.sql | UTF-8 | 687 | 2.515625 | 3 | [] | no_license | SELECT * FROM users LEFT JOIN(
SELECT * FROM budaya
UNION
SELECT * FROM bumd
UNION
SELECT * FROM kerajinan_masyarakat
UNION
SELECT * FROM kuliner
UNION
SELECT * FROM pariwisata
) foo ON users.id_user = foo.id_admin
// if something ambiguous
SELECT id_user, U.nama AS penulis, foo.nama, tgl FROM users U LEFT JOIN(
SELECT * FROM budaya
UNION
SELECT * FROM bumd
UNION
SELECT * FROM kerajinan_masyarakat
UNION
SELECT * FROM kuliner
UNION
SELECT * FROM pariwisata
) foo ON U.id_user = foo.id_admin
| true |
4e94343675e7afc218e6d5f06bea84f1ad50f92c | SQL | AntonMolganov/NewHope | /database/scripts/03_insert_main_data.sql | UTF-8 | 4,199 | 3.046875 | 3 | [] | no_license | --заполняем доступные виды транспорта
declare
begin
insert into newhope.transport_types
(transport_type_id,
s_name)
values
(1,
'Автобус');
insert into newhope.transport_types
(transport_type_id,
s_name)
values
(2,
'Троллейбус');
insert into newhope.transport_types
(transport_type_id,
s_name)
values
(3,
'Трамвай');
insert into newhope.transport_types
(transport_type_id,
s_name)
values
(4,
'Маршрутное такси');
commit;
end;
/
--заполняем оценки по которым будем оценивать (сейчас тольо 5, далее можно предусмотрет любое число и более гибко)
declare
begin
insert into newhope.estimate_types
(estimate_type_id,
s_name)
values
(1,
'Соблюдение графика (точность)');
insert into newhope.estimate_types
(estimate_type_id,
s_name)
values
(2,
'Заполненность транспорта');
insert into newhope.estimate_types
(estimate_type_id,
s_name)
values
(3,
'Техническое состояние транспорта');
insert into newhope.estimate_types
(estimate_type_id,
s_name)
values
(4,
'Соблюдение ПДД');
insert into newhope.estimate_types
(estimate_type_id,
s_name)
values
(5,
'Качество оказания услуг');
commit;
end;
/
--заполняем доступных пермских перевозчиков
declare
begin
insert into newhope.shippers
(shipper_id,
s_name)
values
(1,
'ПермГорЭлектроТранспорт');
insert into newhope.shippers
(shipper_id,
s_name)
values
(2,
'ПермАвтобус');
insert into newhope.shippers
(shipper_id,
s_name)
values
(3,
'ПермТакси');
commit;
end;
/
declare
begin
--добаляем доступных автобусных маршрутов
--автобусные маршруты
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(1,
'77',
1);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(2,
'14',
1);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(3,
'68',
1);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(4,
'1',
1);
--троллейбусы
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(5,
'12',
2);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(6,
'5',
2);
--трамваи
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(7,
'6',
3);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(8,
'5',
3);
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(9,
'12',
3);
--маршрутное такси
insert into newhope.routes
(route_id,
s_name,
transport_type_id)
values
(10,
'666',
4);
commit;
end;
/
--добавляем новых клиентов
declare
begin
insert into newhope.clients
(client_id,
s_name,
s_phone,
s_email)
values
(1,
'Антон',
'+7(999)-111-2222',
'anton@newhope.ru');
insert into newhope.clients
(client_id,
s_name,
s_phone,
s_email)
values
(2,
'Владимир',
'+7(999)-111-3333',
'vladimir@newhope.ru');
insert into newhope.clients
(client_id,
s_name,
s_phone,
s_email)
values
(3,
'Михаил',
'+7(999)-111-4444',
'mikhail@newhope.ru');
insert into newhope.clients
(client_id,
s_name,
s_phone,
s_email)
values
(4,
'Илья',
'+7(999)-111-5555',
'ilya@newhope.ru');
commit;
end;
/
| true |
d4d1c7bc31b0a93652d622d7f27219c2ffb09006 | SQL | tatiananosova/SpringBootApp | /create.sql | UTF-8 | 2,091 | 3.6875 | 4 | [] | no_license | drop table if exists hiber.product cascade;
create table hiber.product
(
id serial not null,
title varchar not null,
cost int,
deleted bool,
version int not null
);
create unique index product_id_uindex
on hiber.product (id);
create unique index product_title_uindex
on hiber.product (title);
alter table hiber.product
add constraint product_pk
primary key (id);
insert into hiber.product (title, cost, deleted, version) values
('Potato',4,false,1),
('Tomato',5,false,1),
('Sweet Potato',6,false,1),
('Cucumber',7,false,1),
('Radish',8,false,1),
('Pepper',9,false,1),
('Pepper Bell',10,false,1),
('Horse Radish',1,false,1),
('Zucchini',2,false,1),
('Pumpkin',3,true,3);
drop table if exists hiber.customer cascade;
create table hiber.customer
(
id serial not null,
name varchar not null
);
create unique index customer_id_uindex
on hiber.customer (id);
create unique index customer_name_uindex
on hiber.customer (name);
alter table hiber.customer
add constraint customer_pk
primary key (id);
insert into hiber.customer (name) values ('Sasha'), ('Vasya'), ('Misha'), ('Petya');
drop table if exists hiber.customer_product cascade;
create table hiber.customer_product
(
customer_id int not null
constraint customer__fk
references hiber.customer,
product_id int not null
constraint product__fk
references hiber.product
); | true |
9add50fa1c6f6d8375b0a6bbd6684f12363dbd2b | SQL | pstroot/maison.website | /database/maisondesprit_structure_only.sql | UTF-8 | 4,599 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2013 at 10:58 AM
-- Server version: 5.5.27-log
-- PHP Version: 5.4.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 utf8 */;
--
-- Database: `maisondesprit`
--
-- --------------------------------------------------------
--
-- Table structure for table `artists`
--
DROP TABLE IF EXISTS `artists`;
CREATE TABLE IF NOT EXISTS `artists` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '',
`slug` varchar(100) DEFAULT '',
`caption` text,
`description` text,
`cat_id` int(11) DEFAULT '1',
`coverImage` varchar(100) DEFAULT '',
`theOrder` int(11) NOT NULL DEFAULT '0',
`isActive` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=371 ;
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS `categories`;
CREATE TABLE IF NOT EXISTS `categories` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`cat_name` varchar(100) NOT NULL DEFAULT '',
`cat_slug` varchar(100) NOT NULL DEFAULT '',
`theOrder` int(11) NOT NULL DEFAULT '0',
`isActive` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=29 ;
-- --------------------------------------------------------
--
-- Table structure for table `films`
--
DROP TABLE IF EXISTS `films`;
CREATE TABLE IF NOT EXISTS `films` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`slug` varchar(100) DEFAULT NULL,
`headline` varchar(255) DEFAULT NULL,
`description` text,
`date` date DEFAULT NULL,
`thumbnail` varchar(255) DEFAULT NULL,
`mp4` varchar(255) DEFAULT NULL,
`webm` varchar(255) DEFAULT NULL,
`ogv` varchar(255) DEFAULT NULL,
`mov` varchar(255) DEFAULT NULL,
`width` int(11) DEFAULT NULL,
`height` int(11) DEFAULT NULL,
`theOrder` int(11) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`date_added` datetime DEFAULT NULL,
`date_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=511 ;
-- --------------------------------------------------------
--
-- Table structure for table `images`
--
DROP TABLE IF EXISTS `images`;
CREATE TABLE IF NOT EXISTS `images` (
`image_id` int(11) NOT NULL AUTO_INCREMENT,
`artist_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(100) DEFAULT '',
`caption` mediumtext,
`filename` varchar(255) NOT NULL DEFAULT '',
`width` int(11) DEFAULT NULL,
`height` int(11) DEFAULT NULL,
`slug` varchar(100) NOT NULL DEFAULT '',
`theOrder` int(11) NOT NULL DEFAULT '0',
`isActive` tinyint(1) DEFAULT '1',
PRIMARY KEY (`image_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3592 ;
-- --------------------------------------------------------
--
-- Table structure for table `news`
--
DROP TABLE IF EXISTS `news`;
CREATE TABLE IF NOT EXISTS `news` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`target` varchar(100) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`style` text,
`theOrder` int(11) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`date_added` datetime NOT NULL,
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
-- --------------------------------------------------------
--
-- Table structure for table `press`
--
DROP TABLE IF EXISTS `press`;
CREATE TABLE IF NOT EXISTS `press` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text NOT NULL,
`description` text NOT NULL,
`footer_text` text NOT NULL,
`url` text NOT NULL,
`theOrder` int(11) DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`date_added` datetime DEFAULT NULL,
`date_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
49c9f3f410582439d6ae69fbd3dd227e71355db9 | SQL | kaolin244/Game | /gra.sql | UTF-8 | 2,528 | 3.109375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Czas generowania: 16 Lis 2016, 23:38
-- Wersja serwera: 10.1.16-MariaDB
-- Wersja PHP: 5.6.24
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 */;
--
-- Baza danych: `gra`
--
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `map`
--
CREATE TABLE `map` (
`village_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`position_x` int(11) NOT NULL,
`position_y` int(11) NOT NULL,
`points` int(11) NOT NULL,
`village_name` text CHARACTER SET utf8 COLLATE utf8_polish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_polish_ci;
-- --------------------------------------------------------
--
-- Struktura tabeli dla tabeli `users`
--
CREATE TABLE `users` (
`uid` int(11) NOT NULL,
`username` varchar(25) COLLATE utf8mb4_polish_ci NOT NULL,
`password` varchar(200) COLLATE utf8mb4_polish_ci NOT NULL,
`email` varchar(100) COLLATE utf8mb4_polish_ci NOT NULL,
`name` varchar(100) COLLATE utf8mb4_polish_ci NOT NULL,
`profile_pic` varchar(200) COLLATE utf8mb4_polish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_polish_ci;
--
-- Zrzut danych tabeli `users`
--
INSERT INTO `users` (`uid`, `username`, `password`, `email`, `name`, `profile_pic`) VALUES
(1, 'gracz244', 'df4892648029cf5c78b7f33cb837bbecaa076ac2ca57334593ecc4f2caa27098', 'pawe@wp.pl', '', ''),
(2, 'graczulek', 'f1ba95f135546ef592c3d5ab138f22a4db3369c6227279c256b54e46031e12ad', 'apskdakldh@gmail.com', '', ''),
(3, 'marcinex', '2826bc789ed991efe64e13af78c12392d0457226de7d23b6d9573412e5d49675', 'aksdhoj@wp.pl', '', ''),
(4, 'pasodp', '23e71694f328c8091eb0e48b8498f8972b8a0bc64ab07707a0195c0947383fc1', 'asodhoasdh@opwkaj.pl', '', '');
--
-- Indeksy dla zrzutów tabel
--
--
-- Indexes for table `map`
--
ALTER TABLE `map`
ADD PRIMARY KEY (`village_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`uid`),
ADD UNIQUE KEY `username` (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT dla tabeli `map`
--
ALTER TABLE `map`
MODIFY `village_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT dla tabeli `users`
--
ALTER TABLE `users`
MODIFY `uid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
917264e6b929f4bf00d0b9e4743bfa61235f1406 | SQL | shdb1/springweb-security | /src/main/resources/script.sql | UTF-8 | 380 | 2.984375 | 3 | [] | no_license |
CREATE TABLE students (
username text NOT NULL DEFAULT '',
password text NOT NULL DEFAULT '',
enabled smallint NOT NULL DEFAULT 1
)
CREATE TABLE roles (
username text NOT NULL DEFAULT '',
role text NOT NULL DEFAULT ''
) ;
INSERT INTO students
VALUES ('johny', 'johnysecured', 1);
INSERT INTO roles
VALUES
('johny', 'Admin'),
('johny', 'CEO');
commit;
| true |
357778394053834c0485d9a1a8d6f894ad31e3ed | SQL | DanielMuthupandi/FAST | /FAST/vsql/NETSUITEOPENAIR/NO_Schedulerequest.sql | UTF-8 | 4,920 | 3.578125 | 4 | [] | no_license | /****
****Script Name : NO_Schedulerequest.sql
****Description : Incremental data load for NO_Schedulerequest
****/
/* Setting timing on**/
\timing
/**SET SESSION AUTOCOMMIT TO OFF;**/
\set ON_ERROR_STOP on
CREATE LOCAL TEMP TABLE Start_Time_Tmp ON COMMIT PRESERVE ROWS AS select sysdate st from dual;
/* Inserting values into Audit table */
INSERT INTO swt_rpt_stg.FAST_LD_AUDT
(
SUBJECT_AREA
,TBL_NM
,LD_DT
,START_DT_TIME
,END_DT_TIME
,SRC_REC_CNT
,TGT_REC_CNT
,COMPLTN_STAT
)
select 'NETSUITEOPENAIR','NO_Schedulerequest',sysdate::date,sysdate,null,(select count(*) from "swt_rpt_stg"."NO_Schedulerequest") ,null,'N';
Commit;
CREATE LOCAL TEMP TABLE NO_Schedulerequest_stg_Tmp ON COMMIT PRESERVE ROWS AS
(
SELECT DISTINCT * FROM swt_rpt_stg.NO_Schedulerequest)
SEGMENTED BY HASH(Id,Updated) ALL NODES;
CREATE LOCAL TEMP TABLE NO_Schedulerequest_base_Tmp ON COMMIT PRESERVE ROWS AS
(
SELECT DISTINCT Id,Updated FROM swt_rpt_base.NO_Schedulerequest)
SEGMENTED BY HASH(Id,Updated) ALL NODES;
CREATE LOCAL TEMP TABLE NO_Schedulerequest_stg_Tmp_Key ON COMMIT PRESERVE ROWS AS
(
SELECT Id, max(Updated) as Updated FROM NO_Schedulerequest_stg_Tmp group by Id)
SEGMENTED BY HASH(Id,Updated) ALL NODES;
/* Inserting Stage table data into Historical Table */
insert /*+DIRECT*/ into swt_rpt_stg.NO_Schedulerequest_Hist
(
id
,created
,number
,userid
,startdate
,date
,attachmentid
,enddate
,approval_status
,updated
,date_approved
,date_submitted
,customerid
,timetype
,timetypeid
,project_taskid
,projectid
,categoryid
,notes
,externalid
,description
,prefix
,total
,name
,LD_DT
,SWT_INS_DT
,d_source
)
select
id
,created
,number
,userid
,startdate
,date
,attachmentid
,enddate
,approval_status
,updated
,date_approved
,date_submitted
,customerid
,timetype
,timetypeid
,project_taskid
,projectid
,categoryid
,notes
,externalid
,description
,prefix
,total
,name
,SYSDATE AS LD_DT
,SWT_INS_DT
,'base'
FROM "swt_rpt_base".NO_Schedulerequest WHERE id in
(SELECT STG.id FROM NO_Schedulerequest_stg_Tmp_Key STG JOIN NO_Schedulerequest_base_Tmp
ON STG.id = NO_Schedulerequest_base_Tmp.id AND STG.updated >= NO_Schedulerequest_base_Tmp.updated);
/* Deleting before seven days data from current date in the Historical Table */
delete /*+DIRECT*/ from "swt_rpt_stg"."NO_Schedulerequest_Hist" where LD_DT::date <= TIMESTAMPADD(DAY,-7,sysdate)::date;
/* Incremental VSQL script for loading data from Stage to Base */
DELETE /*+DIRECT*/ FROM "swt_rpt_base".NO_Schedulerequest WHERE id in
(SELECT STG.id FROM NO_Schedulerequest_stg_Tmp_Key STG JOIN NO_Schedulerequest_base_Tmp
ON STG.id = NO_Schedulerequest_base_Tmp.id AND STG.updated >= NO_Schedulerequest_base_Tmp.updated);
INSERT /*+DIRECT*/ INTO "swt_rpt_base".NO_Schedulerequest
(
id
,created
,number
,userid
,startdate
,date
,attachmentid
,enddate
,approval_status
,updated
,date_approved
,date_submitted
,customerid
,timetype
,timetypeid
,project_taskid
,projectid
,categoryid
,notes
,externalid
,description
,prefix
,total
,name
,SWT_INS_DT
)
SELECT DISTINCT
NO_Schedulerequest_stg_Tmp.id
,created
,number
,userid
,startdate
,date
,attachmentid
,enddate
,approval_status
,NO_Schedulerequest_stg_Tmp.updated
,date_approved
,date_submitted
,customerid
,timetype
,timetypeid
,project_taskid
,projectid
,categoryid
,notes
,externalid
,description
,prefix
,total
,name
,SYSDATE AS SWT_INS_DT
FROM NO_Schedulerequest_stg_Tmp JOIN NO_Schedulerequest_stg_Tmp_Key ON NO_Schedulerequest_stg_Tmp.Id= NO_Schedulerequest_stg_Tmp_Key.Id AND NO_Schedulerequest_stg_Tmp.Updated=NO_Schedulerequest_stg_Tmp_Key.Updated
WHERE NOT EXISTS
(SELECT 1 FROM "swt_rpt_base".NO_Schedulerequest BASE
WHERE NO_Schedulerequest_stg_Tmp.Id = BASE.Id);
/* Deleting partial audit entry */
DELETE FROM swt_rpt_stg.FAST_LD_AUDT where SUBJECT_AREA = 'NETSUITEOPENAIR' and
TBL_NM = 'NO_Schedulerequest' and
COMPLTN_STAT = 'N' and
LD_DT=sysdate::date and
SEQ_ID = (select max(SEQ_ID) from swt_rpt_stg.FAST_LD_AUDT where SUBJECT_AREA = 'NETSUITEOPENAIR' and TBL_NM = 'NO_Schedulerequest' and COMPLTN_STAT = 'N');
/* Inserting new audit entry with all stats */
INSERT INTO swt_rpt_stg.FAST_LD_AUDT
(
SUBJECT_AREA
,TBL_NM
,LD_DT
,START_DT_TIME
,END_DT_TIME
,SRC_REC_CNT
,TGT_REC_CNT
,COMPLTN_STAT
)
select 'NETSUITEOPENAIR','NO_Schedulerequest',sysdate::date,(select st from Start_Time_Tmp),sysdate,(select count(*) from "swt_rpt_stg"."NO_Schedulerequest") ,(select count(*) from swt_rpt_base.NO_Schedulerequest where SWT_INS_DT::date = sysdate::date),'Y';
Commit;
select do_tm_task('mergeout','swt_rpt_stg.NO_Schedulerequest_Hist');
select do_tm_task('mergeout','swt_rpt_base.NO_Schedulerequest');
select do_tm_task('mergeout','swt_rpt_stg.FAST_LD_AUDT');
SELECT ANALYZE_STATISTICS('swt_rpt_base.NO_Schedulerequest');
INSERT /*+Direct*/ INTO swt_rpt_stg.NO_Schedulerequest_Hist SELECT * from swt_rpt_stg.NO_Schedulerequest;
COMMIT;
TRUNCATE TABLE swt_rpt_stg.NO_Schedulerequest;
| true |
456dc13982469ac249b2d1cb161e2550466f8728 | SQL | jalapa1/assignment-dbms | /SQLQuery555.sql | UTF-8 | 1,000 | 3.28125 | 3 | [] | no_license | create database assignment1
use assignment1
create table data2(
Id int not null,
name varchar(20) not null,
age int not null,
city varchar(15) not null
);
insert into data2 values(101,'varsha',22,'banglore');
insert into data2 values(102,'kavya',32,'hyd');
insert into data2 values(103,'raju',25,'ctc');
insert into data2 values(104,'meghna',24,'nkl');
insert into data2 values(105,'nandhini',26,'wgl');
delete from data2 where name='varsha'
select * from data2 where name ='raju' and city ='ctc'
select * from data2 where id =131 and age =22
select * from data2 where id =101 and age =22
select * from data2 where id =101 or age =67
select * from data2 where id =101 and name ='jala'
select * from data2 where id !=101 and name ='varsha'
select * from data2 where id =101 or name ='varsha' and city !='banglore'
select * from data2 where( id =101 or name ='varsha') and city !='banglore'
select * from data2 where id =101 or (name ='varsha' and city !='banglore')
| true |
c79153be060caa8e1b13e148cc73fe00fc07b8f6 | SQL | robert-fink/CS3380-Database-Applications-and-Information-Systems | /Lab3/rwfwcb_lab3/rwfwcb_create_tables.sql | UTF-8 | 1,876 | 3.65625 | 4 | [] | no_license | /* Robert Fink
-- rwfwcb 18074424
-- cs3380 lab3
*/
/*A1--Create the pilot table.*/
create table pilot (
fname varchar(15),
lname varchar(15) NOT NULL,
license_num integer AUTO_INCREMENT PRIMARY KEY,
birthdate date NOT NULL
)ENGINE=INNODB;
/*A2--Create the plane table with a foreign key referencing 'pilot'.*/
create table plane (
tail_num varchar(10) PRIMARY KEY,
brand varchar(25),
model varchar(25),
owner_license_num integer references pilot(license_num),
num_engines smallint
)ENGINE=INNODB;
/*B1--Insert 10 records into the pilot table.*/
insert into pilot values('Charles', 'Lindbergh', DEFAULT, '1902-04-02');
insert into pilot values('Amelia', 'Earhart', DEFAULT, '1897-07-24');
insert into pilot values('Bessie', 'Coleman', DEFAULT, '1892-01-26');
insert into pilot values('Chuck', 'Yeager', DEFAULT, '1923-02-13');
insert into pilot values('Jeana', 'Yeager', DEFAULT, '1952-05-18');
insert into pilot values('Chesley', 'Sullenberger', DEFAULT, '1951-01-23');
insert into pilot values('Matt', 'Hall', DEFAULT, '1971-09-16');
insert into pilot values('Rogert', 'Williams', DEFAULT, '1894-08-12');
insert into pilot values('Paul', 'Tibbets', DEFAULT, '1915-02-23');
insert into pilot values('Jacqueline', 'Cochran', DEFAULT, '1906-05-11');
/*B2--Insert 10 records into the plane table (provide a valid license #).*/
insert into plane values(1, 'Boeing', '747-8', 21, 4);
insert into plane values(2, 'Boeing', '747-8', 1, 4);
insert into plane values(3, 'Boeing', '747-8', 11, 4);
insert into plane values(4, 'Boeing', '777x', 91, 2);
insert into plane values(5, 'Boeing', '787', 81, 2);
insert into plane values(6, 'Airbus', 'A318', 71, 1);
insert into plane values(7, 'Airbus', 'A380', 61, 4);
insert into plane values(8, 'Airbus', 'A380', 31, 4);
insert into plane values(9, 'Airbus', 'A320', 41, 2);
insert into plane values(10, 'Cessna', 'Z900', 51, 6);
| true |
5c0328bda386ea797b7c5790fcffae15f306eb23 | SQL | hnifmaghfur/Ankasa-Backend | /file.sql | UTF-8 | 2,889 | 3.5 | 4 | [] | no_license | CREATE TABLE users
(
id INT NOT NULL AUTO_INCREMENT,
email VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
created_at DATETIME,
phone VARCHAR(30),
status INT NOT NULL,
gcm_token VARCHAR(200) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE cities
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE destinations
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
photo VARCHAR(255) NOT NULL,
status INT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE airports
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
photo VARCHAR(255) NOT NULL,
star VARCHAR(10) NOT NULL,
review VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE classes
(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
price VARCHAR(100) NOT NULL,
estimate VARCHAR(100) NOT NULL,
terminal VARCHAR(10) NOT NULL,
gate VARCHAR(10) NOT NULL,
id_destination INT,
id_airport INT,
PRIMARY KEY (id),
FOREIGN KEY (id_destination) REFERENCES destinations(id) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (id_airport) REFERENCES airports(id) ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE transactions
(
id INT NOT NULL AUTO_INCREMENT,
unique_code VARCHAR(100) NOT NULL,
status INT NOT NULL,
departure_at DATETIME,
id_class INT,
id_user INT,
PRIMARY KEY (id),
FOREIGN KEY (id_class) REFERENCES classes(id) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (id_user) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE notifications
(
id INT NOT NULL AUTO_INCREMENT,
is_open INT NOT NULL,
title VARCHAR(255) NOT NULL,
description LONGTEXT NOT NULL,
created_at DATETIME,
id_user INT,
PRIMARY KEY (id),
FOREIGN KEY (id_user) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE chats
(
id INT NOT NULL AUTO_INCREMENT,
created_at DATETIME,
message LONGTEXT NOT NULL,
id_sender INT,
id_receiver INT,
PRIMARY KEY (id),
FOREIGN KEY (id_sender) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (id_receiver) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE bubble_chat
(
id INT NOT NULL AUTO_INCREMENT,
total VARCHAR(100) NOT NULL,
id_sender INT,
id_receiver INT,
PRIMARY KEY (id),
FOREIGN KEY (id_sender) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (id_receiver) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE TABLE profiles
(
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(100) NOT NULL,
address LONGTEXT,
postcode VARCHAR(15),
created_at DATETIME,
id_user INT,
id_city INT,
PRIMARY KEY (id),
FOREIGN KEY (id_user) REFERENCES users(id) ON DELETE SET NULL ON UPDATE CASCADE,
FOREIGN KEY (id_city) REFERENCES cities(id) ON DELETE SET NULL ON UPDATE CASCADE
); | true |
b700282afee3b880c40a21d45f85b677e5f27cef | SQL | vntrbr/SeederFaker | /seed.sql | UTF-8 | 15,676 | 3.171875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Mar 2021 pada 04.54
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.2.34
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: `seed`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `kelas`
--
CREATE TABLE `kelas` (
`id` bigint(20) UNSIGNED NOT NULL,
`nama_kelas` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`kompetensikealhlian` varchar(5) 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 untuk tabel `kelas`
--
INSERT INTO `kelas` (`id`, `nama_kelas`, `kompetensikealhlian`, `created_at`, `updated_at`) VALUES
(1, 'XII', 'RPL', NULL, NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `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, '2021_02_25_023614_create_kelas_table', 2);
-- --------------------------------------------------------
--
-- Struktur dari tabel `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `students`
--
CREATE TABLE `students` (
`nama` varchar(35) NOT NULL,
`umur` int(2) NOT NULL,
`alamat` text NOT NULL,
`jenisk` varchar(35) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `students`
--
INSERT INTO `students` (`nama`, `umur`, `alamat`, `jenisk`) VALUES
('James', 15, 'Citypark', 'Laki'),
('Galur Natsir', 14, 'Ki. Raden No. 667, Padangsidempuan 14386, Maluku', 'wanita'),
('Galak Warsa Widodo', 14, 'Gg. Basuki Rahmat No. 111, Samarinda 14657, Lampung', 'pria'),
('Koko Manullang M.Farm', 19, 'Ds. Sentot Alibasa No. 123, Tidore Kepulauan 45886, Riau', 'pria'),
('Umar Tarihoran S.Pd', 15, 'Psr. Cokroaminoto No. 871, Pagar Alam 98223, DIY', 'wanita'),
('Bancar Salman Sihotang S.Kom', 15, 'Jr. Tentara Pelajar No. 837, Bengkulu 10685, KepR', 'wanita'),
('Ani Tiara Riyanti', 16, 'Psr. Sukabumi No. 494, Banjar 88178, SumUt', 'wanita'),
('Chelsea Aryani', 13, 'Gg. Baya Kali Bungur No. 905, Tebing Tinggi 92719, JaTeng', 'wanita'),
('Diah Padmi Suryatmi S.Kom', 16, 'Kpg. Katamso No. 718, Surabaya 50730, SulSel', 'pria'),
('Labuh Tampubolon', 14, 'Jln. Madiun No. 193, Tangerang Selatan 24787, Lampung', 'pria'),
('Argono Pratama M.Pd', 17, 'Jln. Bambon No. 292, Tidore Kepulauan 82786, SulBar', 'wanita'),
('Cindy Gilda Hariyah', 18, 'Dk. Bambu No. 675, Sungai Penuh 94255, KalUt', 'pria'),
('Lanang Prasasta', 11, 'Psr. Baranang Siang No. 69, Pekalongan 73314, Banten', 'wanita'),
('Eja Pratama', 13, 'Kpg. Ciwastra No. 506, Medan 49614, NTB', 'pria'),
('Zulfa Utami', 8, 'Kpg. Radio No. 384, Pematangsiantar 21962, MalUt', 'wanita'),
('Ika Tiara Nurdiyanti S.Farm', 14, 'Kpg. Raya Ujungberung No. 973, Dumai 98179, KalUt', 'wanita'),
('Titi Zizi Purnawati', 19, 'Gg. Hang No. 193, Semarang 74799, NTT', 'pria'),
('Aurora Oni Usamah', 16, 'Ki. Basmol Raya No. 642, Semarang 45379, SulUt', 'wanita'),
('Carla Andriani', 18, 'Jln. Achmad No. 703, Banjarmasin 33548, JaTim', 'wanita'),
('Wardi Prasasta', 17, 'Ds. Pasir Koja No. 164, Tidore Kepulauan 24507, DIY', 'wanita'),
('Farah Rachel Wahyuni', 7, 'Jln. Sugiyopranoto No. 656, Bengkulu 48042, SumUt', 'pria'),
('Lasmono Galang Prayoga', 8, 'Ds. Yap Tjwan Bing No. 61, Salatiga 89613, SulTra', 'pria'),
('Gaiman Rajata', 14, 'Dk. Perintis Kemerdekaan No. 397, Payakumbuh 35563, SulTeng', 'wanita'),
('Rina Victoria Kuswandari', 10, 'Kpg. Dewi Sartika No. 174, Subulussalam 50549, JaTeng', 'wanita'),
('Lukita Salahudin', 17, 'Gg. Eka No. 106, Bima 88773, Lampung', 'wanita'),
('Dinda Dian Astuti S.I.Kom', 10, 'Ds. Setia Budi No. 726, Semarang 94623, KalTeng', 'wanita'),
('Kamal Dasa Manullang', 8, 'Psr. Rajiman No. 314, Ternate 47264, SulUt', 'wanita'),
('Bancar Akarsana Pradana S.Psi', 14, 'Jln. Arifin No. 81, Gorontalo 53412, Lampung', 'wanita'),
('Yance Puspasari', 18, 'Kpg. Sutami No. 833, Depok 77429, Bali', 'pria'),
('Hafshah Jessica Kusmawati M.Ak', 9, 'Dk. Karel S. Tubun No. 728, Banda Aceh 18759, Jambi', 'pria'),
('Wirda Genta Winarsih', 17, 'Ki. Cihampelas No. 110, Kediri 20291, DIY', 'pria'),
('Indah Kamaria Nurdiyanti', 12, 'Gg. Thamrin No. 654, Yogyakarta 37105, MalUt', 'wanita'),
('Harimurti Ardianto', 19, 'Kpg. Fajar No. 121, Metro 54363, Jambi', 'wanita'),
('Muhammad Winarno', 9, 'Kpg. Padang No. 484, Depok 37516, JaTim', 'wanita'),
('Halima Cornelia Nurdiyanti S.Pd', 14, 'Ki. Nakula No. 390, Banjarbaru 70380, KepR', 'wanita'),
('Bambang Prabowo', 10, 'Jr. Pasirkoja No. 669, Gunungsitoli 47155, NTB', 'wanita'),
('Dariati Wahyudin', 12, 'Ds. BKR No. 271, Dumai 52926, KalSel', 'wanita'),
('Kajen Kasim Nugroho', 13, 'Ds. Pahlawan No. 990, Surabaya 60327, BaBel', 'wanita'),
('Jindra Uwais S.T.', 18, 'Jln. Aceh No. 937, Administrasi Jakarta Timur 85246, Riau', 'pria'),
('Harja Firgantoro S.T.', 7, 'Ki. Bazuka Raya No. 859, Gorontalo 76558, Gorontalo', 'wanita'),
('Ikin Pranowo', 7, 'Ds. Arifin No. 84, Madiun 53356, PapBar', 'wanita'),
('Maimunah Kasiyah Wahyuni M.Ak', 18, 'Jln. Sampangan No. 409, Batu 14939, Banten', 'pria'),
('Eko Sihombing', 11, 'Ki. Halim No. 781, Sorong 53495, NTB', 'wanita'),
('Tina Laras Hasanah M.Farm', 8, 'Psr. Barasak No. 113, Pangkal Pinang 28620, Bengkulu', 'pria'),
('Azalea Fujiati', 9, 'Kpg. Suryo No. 283, Blitar 54194, Jambi', 'pria'),
('Kunthara Suwarno', 12, 'Dk. Sutarjo No. 36, Tebing Tinggi 71855, KepR', 'wanita'),
('Kayla Talia Agustina S.Gz', 15, 'Dk. Kyai Mojo No. 142, Langsa 62925, Jambi', 'wanita'),
('Jaga Waluyo', 13, 'Jr. Bakhita No. 26, Bau-Bau 35143, PapBar', 'pria'),
('Yulia Winarsih S.Ked', 11, 'Dk. Pacuan Kuda No. 490, Ambon 44942, Maluku', 'pria'),
('Tania Uyainah', 18, 'Kpg. Honggowongso No. 947, Samarinda 67963, Bali', 'pria'),
('Laras Nabila Agustina S.Farm', 7, 'Psr. Sadang Serang No. 960, Kediri 26613, KalTim', 'wanita'),
('Rangga Iswahyudi', 8, 'Dk. Achmad Yani No. 43, Tidore Kepulauan 86642, KalTim', 'pria'),
('Winda Purwanti', 10, 'Ki. Tambun No. 242, Sukabumi 17267, Riau', 'wanita'),
('Sabrina Natalia Mardhiyah M.M.', 10, 'Dk. Cokroaminoto No. 166, Solok 72686, Banten', 'pria'),
('Ajimat Estiawan Mansur S.T.', 8, 'Dk. Bagonwoto No. 924, Sibolga 90195, SulUt', 'pria'),
('Karna Iswahyudi', 11, 'Psr. Gajah No. 559, Pariaman 48474, SumSel', 'pria'),
('Asman Marpaung', 19, 'Gg. Lada No. 829, Ternate 97131, SulTra', 'pria'),
('Clara Padmi Purwanti S.Ked', 9, 'Dk. Bak Mandi No. 481, Pontianak 88915, KalUt', 'wanita'),
('Bagya Saefullah', 7, 'Psr. Cikutra Timur No. 766, Palopo 49900, MalUt', 'wanita'),
('Rika Hartati S.E.', 11, 'Jr. Cihampelas No. 257, Tarakan 36832, SulBar', 'wanita'),
('Cakrabuana Napitupulu', 8, 'Jln. Yosodipuro No. 816, Kendari 15264, Gorontalo', 'pria'),
('Hartana Asman Halim S.Gz', 8, 'Dk. BKR No. 7, Pematangsiantar 98950, KepR', 'wanita'),
('Mustofa Marbun', 16, 'Ki. Diponegoro No. 693, Subulussalam 90401, Gorontalo', 'pria'),
('Budi Haryanto', 12, 'Jr. Mulyadi No. 286, Blitar 83820, JaTim', 'wanita'),
('Prayitna Putu Tarihoran', 18, 'Psr. Zamrud No. 582, Balikpapan 91956, SulTra', 'wanita'),
('Harto Simbolon', 7, 'Dk. Jakarta No. 742, Sorong 17425, NTT', 'pria'),
('Lurhur Mandala', 18, 'Jr. Flores No. 906, Salatiga 51060, Aceh', 'pria'),
('Kamila Rahmawati', 19, 'Ds. Pacuan Kuda No. 386, Sungai Penuh 98342, KalTim', 'wanita'),
('Lintang Farida', 7, 'Gg. Baja Raya No. 584, Banjarbaru 46639, Papua', 'wanita'),
('Cici Pratiwi', 16, 'Gg. Mahakam No. 165, Lhokseumawe 14819, JaBar', 'pria'),
('Uchita Fitriani Rahmawati', 13, 'Kpg. Tentara Pelajar No. 586, Probolinggo 89938, MalUt', 'wanita'),
('Wardaya Utama S.Psi', 9, 'Dk. Gremet No. 595, Manado 65792, JaBar', 'wanita'),
('Yosef Irawan', 10, 'Dk. Kebonjati No. 68, Tanjungbalai 92705, Maluku', 'wanita'),
('Yunita Mandasari', 8, 'Jr. Bagas Pati No. 766, Tegal 43420, Banten', 'pria'),
('Praba Marpaung', 19, 'Dk. Bakin No. 79, Cilegon 52913, MalUt', 'wanita'),
('Nurul Yuliarti', 7, 'Psr. Achmad Yani No. 494, Bekasi 91300, SulBar', 'wanita'),
('Soleh Rafi Sihombing', 17, 'Ds. Sudirman No. 324, Bima 94276, Maluku', 'pria'),
('Harto Estiono Adriansyah', 19, 'Ds. Jend. A. Yani No. 389, Sukabumi 92256, KalBar', 'wanita'),
('Abyasa Sinaga S.Farm', 12, 'Ki. Rajawali No. 238, Tidore Kepulauan 33450, Lampung', 'wanita'),
('Rachel Rika Laksita S.H.', 7, 'Jr. Cokroaminoto No. 33, Sibolga 73904, Papua', 'wanita'),
('Padmi Laksmiwati', 12, 'Dk. Suprapto No. 733, Surabaya 11810, KepR', 'pria'),
('Winda Lala Pertiwi S.H.', 7, 'Psr. B.Agam Dlm No. 678, Pangkal Pinang 27964, JaTim', 'wanita'),
('Muhammad Prabowo', 10, 'Jln. Urip Sumoharjo No. 609, Tidore Kepulauan 58792, JaBar', 'wanita'),
('Radit Bahuwirya Pradipta S.E.I', 9, 'Ds. Sukabumi No. 438, Batam 59569, SulUt', 'pria'),
('Ophelia Malika Yulianti', 10, 'Kpg. Mulyadi No. 189, Medan 24034, SumUt', 'pria'),
('Sabrina Hastuti', 11, 'Kpg. Haji No. 542, Kediri 40808, Banten', 'pria'),
('Irwan Sihombing', 10, 'Jln. Barat No. 830, Binjai 18031, Jambi', 'pria'),
('Karma Yusuf Dongoran S.Pd', 8, 'Psr. Sukajadi No. 330, Administrasi Jakarta Barat 95853, Bali', 'pria'),
('Zahra Genta Laksmiwati S.H.', 14, 'Ki. Kartini No. 312, Lubuklinggau 26076, Bengkulu', 'pria'),
('Raina Aryani S.Psi', 14, 'Jr. Banceng Pondok No. 494, Cimahi 96654, SumUt', 'wanita'),
('Galar Warsa Permadi S.T.', 17, 'Dk. Bakaru No. 872, Makassar 78086, NTT', 'pria'),
('Usyi Nadine Laksita S.Kom', 8, 'Gg. Radio No. 858, Surakarta 77049, SulBar', 'wanita'),
('Mumpuni Nababan', 7, 'Dk. Hasanuddin No. 662, Probolinggo 68090, KepR', 'pria'),
('Kezia Sudiati S.T.', 14, 'Jr. Sunaryo No. 665, Ambon 10074, DKI', 'pria'),
('Ella Puspasari', 16, 'Dk. Baiduri No. 505, Sabang 32535, NTB', 'wanita'),
('Ilyas Prayoga Saptono S.E.', 19, 'Psr. B.Agam Dlm No. 788, Serang 46338, JaBar', 'pria'),
('Caket Ajiman Nainggolan', 12, 'Ki. Bah Jaya No. 905, Sungai Penuh 25294, Bengkulu', 'pria'),
('Gamani Tamba', 18, 'Ki. Bakit No. 378, Salatiga 82596, JaTim', 'pria'),
('Belinda Rahmawati', 8, 'Kpg. Zamrud No. 350, Tanjung Pinang 22575, SulTra', 'pria'),
('Oman Sihombing M.M.', 14, 'Ds. Acordion No. 889, Ambon 70428, JaTeng', 'pria'),
('Nova Gabriella Melani', 17, 'Jr. Urip Sumoharjo No. 885, Langsa 11602, PapBar', 'wanita'),
('Rahmi Rahayu', 13, 'Ds. Banda No. 876, Makassar 17039, KalTim', 'wanita'),
('Ridwan Jayeng Sitorus S.Kom', 14, 'Jr. HOS. Cjokroaminoto (Pasirkaliki) No. 909, Solok 11813, DIY', 'wanita'),
('Kuncara Ramadan', 12, 'Psr. Bawal No. 349, Surakarta 12696, PapBar', 'pria'),
('Adiarja Kawaya Hutapea S.Sos', 14, 'Jr. Barasak No. 870, Pontianak 80792, DKI', 'wanita'),
('Paris Susanti', 9, 'Dk. Bah Jaya No. 852, Pagar Alam 18704, DKI', 'pria'),
('Jarwi Salahudin S.Psi', 13, 'Ki. Monginsidi No. 124, Parepare 18362, Gorontalo', 'wanita'),
('Ida Oktaviani', 13, 'Dk. Casablanca No. 726, Administrasi Jakarta Barat 75205, SulTeng', 'wanita'),
('Puspa Paris Yolanda', 15, 'Jr. Lada No. 438, Malang 41927, SulBar', 'wanita'),
('Ratna Janet Nasyiah M.Kom.', 18, 'Jln. Eka No. 200, Probolinggo 73328, JaBar', 'pria'),
('Manah Gandi Latupono S.T.', 14, 'Gg. Achmad Yani No. 785, Denpasar 94499, JaBar', 'pria'),
('Widya Azalea Riyanti', 13, 'Kpg. Gajah Mada No. 989, Bandar Lampung 26765, KepR', 'wanita'),
('Simon Najmudin', 19, 'Ds. Bambon No. 172, Sabang 12828, JaBar', 'pria'),
('Agnes Gabriella Winarsih S.IP', 17, 'Jln. Bakin No. 69, Payakumbuh 81777, SumSel', 'wanita'),
('Jamalia Astuti S.T.', 19, 'Psr. Tangkuban Perahu No. 254, Tasikmalaya 50528, JaTeng', 'pria'),
('Ikin Kamal Suwarno', 16, 'Dk. Bawal No. 891, Bengkulu 61877, Riau', 'pria'),
('Tantri Pertiwi', 11, 'Kpg. Raya Setiabudhi No. 532, Prabumulih 42485, NTB', 'pria'),
('Hafshah Laila Laksita S.Kom', 10, 'Jr. BKR No. 149, Lhokseumawe 80630, KalBar', 'wanita'),
('Jane Irma Wulandari S.Farm', 19, 'Ki. Cemara No. 119, Dumai 41347, SulBar', 'pria'),
('Dartono Cengkal Nainggolan S.Pt', 13, 'Jln. Rajiman No. 593, Bukittinggi 97748, KalBar', 'pria'),
('Asman Tampubolon S.H.', 10, 'Gg. Mulyadi No. 818, Denpasar 97539, Papua', 'wanita'),
('Shakila Eli Purwanti', 19, 'Ds. Bara No. 690, Ternate 58878, DKI', 'wanita'),
('Pangestu Hidayat', 12, 'Jln. Achmad No. 445, Palembang 22586, Gorontalo', 'wanita'),
('Patricia Rahimah', 11, 'Ds. Dahlia No. 263, Lubuklinggau 11922, Riau', 'wanita'),
('Erik Mahfud Pranowo', 19, 'Psr. Basoka No. 400, Batu 21462, KalTim', 'wanita'),
('Prima Prasetya S.Sos', 14, 'Psr. BKR No. 53, Jambi 57991, NTT', 'pria'),
('Lili Susanti', 17, 'Ds. Bazuka Raya No. 51, Lubuklinggau 72186, SulUt', 'pria'),
('Balijan Wasita', 18, 'Kpg. Cihampelas No. 317, Cilegon 38794, Banten', 'pria'),
('Kasiyah Dina Kusmawati', 7, 'Jln. Panjaitan No. 597, Lhokseumawe 19096, SumSel', 'wanita'),
('Warsa Natsir S.Sos', 13, 'Kpg. Yosodipuro No. 500, Lubuklinggau 73638, JaTeng', 'pria'),
('Capa Harsaya Nababan S.H.', 14, 'Kpg. Suniaraja No. 478, Prabumulih 43432, JaBar', 'wanita'),
('Padmi Andriani S.Kom', 12, 'Psr. Thamrin No. 243, Tebing Tinggi 87966, NTT', 'pria'),
('Jarwadi Widodo', 7, 'Jln. Bak Mandi No. 995, Tomohon 42865, KepR', 'wanita'),
('Putri Aryani S.E.I', 13, 'Psr. Ahmad Dahlan No. 462, Mojokerto 85610, DKI', 'pria'),
('Enteng Thamrin', 15, 'Jr. Ters. Jakarta No. 479, Lhokseumawe 52095, DIY', 'wanita'),
('Aurora Mulyani', 18, 'Ki. Gremet No. 208, Kediri 88793, Gorontalo', 'wanita'),
('Karma Karja Gunarto M.Pd', 17, 'Gg. Bass No. 949, Tanjungbalai 42332, SumSel', 'wanita'),
('Ade Titin Usamah S.H.', 19, 'Ds. Sentot Alibasa No. 654, Langsa 20475, KalTim', 'wanita'),
('Aisyah Maya Mandasari', 11, 'Kpg. Baranang Siang Indah No. 428, Bogor 47269, SumSel', 'pria'),
('Hartana Gunarto', 10, 'Jln. Batako No. 974, Tebing Tinggi 13473, SulUt', 'pria'),
('Tania Purwanti', 14, 'Psr. Pahlawan No. 957, Manado 70664, KalSel', 'pria'),
('Septi Utami', 16, 'Ki. Laksamana No. 742, Banda Aceh 46447, Jambi', 'wanita'),
('Widya Rahayu Laksita', 8, 'Ki. Soekarno Hatta No. 184, Pekalongan 81159, KepR', 'wanita'),
('Hani Irma Mardhiyah', 11, 'Jln. Ki Hajar Dewantara No. 273, Batu 82421, NTB', 'wanita'),
('Balijan Uda Simbolon M.Pd', 11, 'Jln. Baranang Siang No. 29, Batu 83352, PapBar', 'wanita'),
('Ami Fitria Wastuti S.H.', 13, 'Jr. Muwardi No. 863, Palangka Raya 35486, DIY', 'pria'),
('Restu Suartini', 19, 'Psr. Babakan No. 132, Blitar 68420, PapBar', 'pria'),
('Eka Rahimah', 10, 'Kpg. Bah Jaya No. 12, Tidore Kepulauan 64543, Bali', 'pria'),
('Tedi Margana Jailani S.E.I', 12, 'Kpg. B.Agam Dlm No. 217, Bau-Bau 76523, KalUt', 'pria'),
('Sabri Wibowo', 15, 'Jr. Bappenas No. 592, Tomohon 49208, SulBar', 'wanita'),
('Jinawi Damanik S.E.', 15, 'Psr. Mahakam No. 337, Pagar Alam 81069, SulBar', 'pria');
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `kelas`
--
ALTER TABLE `kelas`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indeks untuk tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `kelas`
--
ALTER TABLE `kelas`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
431b3d4d195ec151d531954262d8373b499a2a07 | SQL | IliaIliev94/SoftUni-Work | /C# MS SQL/CRUD-Databases Exercise/12. Find 5 Best Paid Employees.sql | UTF-8 | 98 | 2.625 | 3 | [] | no_license | -- Get 5 Top Paid Employees
SELECT TOP(5) FirstName, LastName FROM Employees
ORDER BY Salary DESC | true |
b3c480df15f854ca11a141cb755343bfa65c31b2 | SQL | lsauva/PiscinePHP | /d05/ex11/ex11.sql | UTF-8 | 1,342 | 4.1875 | 4 | [] | no_license | -- ### Premiere version sans INNER JOIN
-- SELECT
-- UPPER(last_name) AS NAME,
-- first_name,
-- price
-- FROM
-- user_card,
-- member,
-- subscription
-- WHERE
-- user_card.id_user = member.id_user_card
-- AND member.id_sub = subscription.id_sub
-- AND subscription.price > 42
-- ORDER BY
-- last_name ASC,
-- first_name ASC;
-- Version 2 avec INNER JOIN sur `user_card`.`id_user` = `member`.`id_member`
-- 17 reponses
SELECT
UPPER(`user_card`.`last_name`) AS NAME,
`user_card`.`first_name`,
`subscription`.`price`
FROM
`user_card`
INNER JOIN `member` ON
`user_card`.`id_user` = `member`.`id_member`
INNER JOIN `subscription` ON
`member`.`id_sub` = `subscription`.`id_sub`
WHERE `subscription`.`price` > 42
ORDER BY
`last_name` ASC,
`first_name` ASC;
-- version finale, logique au niveau de la construction de la base, pas au niveau des resultats (2 reponses)
-- SELECT
-- UPPER(`user_card`.`last_name`) AS NAME,
-- `user_card`.`first_name`,
-- `subscription`.`price`
-- FROM
-- `user_card`
-- INNER JOIN `member` ON
-- `user_card`.`id_user` = `member`.`id_user_card`
-- INNER JOIN `subscription` ON
-- `member`.`id_sub` = `subscription`.`id_sub`
-- WHERE `subscription`.`price` > 42
-- ORDER BY
-- `last_name` ASC,
-- `first_name` ASC;
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.