text
stringlengths
6
9.38M
/* Navicat Premium Data Transfer Source Server : 我本地的 Source Server Type : MySQL Source Server Version : 50629 Source Host : localhost:3306 Source Schema : cjb Target Server Type : MySQL Target Server Version : 50629 File Encoding : 65001 Date: 03/01/2020 18:01:42 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for lcn_business_t -- ---------------------------- DROP TABLE IF EXISTS `lcn_business_t`; CREATE TABLE `lcn_business_t` ( `id` int(11) NOT NULL, `business_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for lcn_mq_msg_t -- ---------------------------- DROP TABLE IF EXISTS `lcn_mq_msg_t`; CREATE TABLE `lcn_mq_msg_t` ( `id` int(11) NOT NULL COMMENT '主键', `message_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消息ID', `message_body` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '消息内容json', `message_send_num` int(11) NULL DEFAULT NULL COMMENT '消息发送次数', `message_status` tinyint(1) NULL DEFAULT NULL COMMENT '1 发送中 2 发送完成', `queue_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '队列名称', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for lcn_order_t -- ---------------------------- DROP TABLE IF EXISTS `lcn_order_t`; CREATE TABLE `lcn_order_t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `order_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; -- ---------------------------- -- Table structure for lcn_warehouse_t -- ---------------------------- DROP TABLE IF EXISTS `lcn_warehouse_t`; CREATE TABLE `lcn_warehouse_t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `stock` int(11) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
/* Navicat MySQL Data Transfer Source Server : root Source Server Version : 50714 Source Host : localhost:3306 Source Database : hdstyle Target Server Type : MYSQL Target Server Version : 50714 File Encoding : 65001 Date: 2017-07-14 14:10:13 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for goods -- ---------------------------- DROP TABLE IF EXISTS `goods`; CREATE TABLE `goods` ( `id` int(255) unsigned NOT NULL AUTO_INCREMENT, `img` varchar(255) CHARACTER SET utf8 NOT NULL, `newPrice` int(55) NOT NULL, `oldPrice` int(10) NOT NULL, `buyImg` varchar(255) CHARACTER SET utf8 NOT NULL, `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=222 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of goods -- ---------------------------- INSERT INTO `goods` VALUES ('1', '../img/list_pic1_1.jpg', '136', '278', '../img/buy.png', '娜娜日记2017夏装新款女装蓝色宽松背带裤女牛仔裤长裤裤子NL'); INSERT INTO `goods` VALUES ('2', '../img/list_pic1_2.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装女装夏新款侧面开叉宽松阔腿休闲裤GY6000娋'); INSERT INTO `goods` VALUES ('3', '../img/list_pic1_3.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('4', '../img/list_pic1_4.jpg', '88', '198', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('5', '../img/list_pic1_5.jpg', '116', '228', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('6', '../img/list_pic1_6.jpg', '149', '168', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('7', '../img/list_pic1_7.jpg', '98', '299', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('8', '../img/list_pic1_8.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('9', '../img/list_pic1_9.jpg', '116', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('10', '../img/list_pic1_10.jpg', '152', '288', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('11', '../img/list_pic1_11.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('12', '../img/list_pic1_12.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('13', '../img/list_pic1_13.jpg', '122', '233', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('14', '../img/list_pic1_14.jpg', '122', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('15', '../img/list_pic1_15.jpg', '222', '289', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('16', '../img/list_pic1_16.jpg', '88', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('17', '../img/list_pic1_17.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('18', '../img/list_pic1_18.jpg', '66', '188', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('19', '../img/list_pic1_19.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('20', '../img/list_pic2_1.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('38', '../img/list_pic2_19.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('21', '../img/list_pic2_2.jpg', '152', '288', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('22', '../img/list_pic2_3.jpg', '88', '198', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('23', '../img/list_pic2_4.jpg', '116', '228', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('24', '../img/list_pic2_4.jpg', '149', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('25', '../img/list_pic2_6.jpg', '98', '299', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('26', '../img/list_pic2_7.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('27', '../img/list_pic2_8.jpg', '116', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('28', '../img/list_pic2_9.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('29', '../img/list_pic2_10.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('30', '../img/list_pic2_11.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('31', '../img/list_pic2_12.jpg', '122', '233', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('32', '../img/list_pic2_13.jpg', '122', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('33', '../img/list_pic2_14.jpg', '222', '289', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('34', '../img/list_pic2_15.jpg', '88', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('35', '../img/list_pic2_16.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('36', '../img/list_pic2_17.jpg', '66', '188', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('37', '../img/list_pic2_18.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('39', '../img/list_pic3_1.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('41', '../img/list_pic3_3.jpg', '123', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('40', '../img/list_pic3_2.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('48', '../img/list_pic3_10.jpg', '116', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('49', '../img/list_pic3_11.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('50', '../img/list_pic3_12.jpg', '152', '288', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('51', '../img/list_pic3_13.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('52', '../img/list_pic3_14.jpg', '122', '233', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('53', '../img/list_pic3_15.jpg', '122', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('54', '../img/list_pic3_16.jpg', '222', '289', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('55', '../img/list_pic3_17.jpg', '88', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('56', '../img/list_pic3_18.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('57', '../img/list_pic3_19.jpg', '66', '188', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('58', '../img/list_pic4_1.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('59', '../img/list_pic4_2.jpg', '123', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('60', '../img/list_pic4_3.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('61', '../img/list_pic4_4.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('62', '../img/list_pic4_4.jpg', '88', '198', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('63', '../img/list_pic4_5.jpg', '116', '228', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('64', '../img/list_pic4_6.jpg', '149', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('65', '../img/list_pic4_7.jpg', '98', '299', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('66', '../img/list_pic4_8.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('67', '../img/list_pic4_9.jpg', '116', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('69', '../img/list_pic4_11.jpg', '152', '288', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('68', '../img/list_pic4_10.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('70', '../img/list_pic4_12.jpg', '122', '233', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('71', '../img/list_pic4_13.jpg', '122', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('72', '../img/list_pic4_14.jpg', '222', '289', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('73', '../img/list_pic4_15.jpg', '88', '168', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('74', '../img/list_pic4_16.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('75', '../img/list_pic4_17.jpg', '66', '188', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('76', '../img/list_pic4_18.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('42', '../img/list_pic3_4.jpg', '152', '288', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款纯色碎花吊带连衣裙'); INSERT INTO `goods` VALUES ('43', '../img/list_pic3_5.jpg', '88', '198', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('44', '../img/list_pic3_6.jpg', '116', '228', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('45', '../img/list_pic3_7.jpg', '149', '168', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('46', '../img/list_pic3_8.jpg', '98', '299', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('47', '../img/list_pic3_9.jpg', '136', '278', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('77', '../img/list_pic5_1.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('78', '../img/list_pic5_2.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('79', '../img/list_pic5_3.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('80', '../img/list_pic5_4.jpg', '123', '666', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('81', '../img/list_pic5_4.jpg', '333', '777', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('202', '../img/list_pic5_5.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款开衩中长款短袖连衣裙JN7239埕0524'); INSERT INTO `goods` VALUES ('203', '../img/list_pic5_6.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('204', '../img/list_pic5_7.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('205', '../img/list_pic5_8.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('206', '../img/list_pic5_9.jpg', '123', '666', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('207', '../img/list_pic5_10.jpg', '333', '777', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松显瘦纯色白衬衫NG8456茵0525'); INSERT INTO `goods` VALUES ('208', '../img/list_pic5_11.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('209', '../img/list_pic5_12.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('210', '../img/list_pic5_2.jpg', '123', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('211', '../img/list_pic5_13.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('212', '../img/list_pic5_14.jpg', '123', '666', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款修身显瘦微喇牛仔裤PC7576晽0524'); INSERT INTO `goods` VALUES ('219', '../img/list_pic5_17.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('214', '../img/list_pic5_15.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('215', '../img/list_pic5_16.jpg', '99', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款宽松潮绑带长T裙连衣裙女IG8022僥'); INSERT INTO `goods` VALUES ('216', '../img/list_pic5_17.jpg', '123', '222', '../img/buy.png', '韩都衣舍2017韩版女装夏新款白色微喇毛边九分牛仔裤'); INSERT INTO `goods` VALUES ('217', '../img/list_pic5_18.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('218', '../img/list_pic5_19.jpg', '123', '666', '../img/buy.png', '韩都衣舍2017韩版女装夏装新款高腰九分连体休闲裤JQ9931樰0503'); INSERT INTO `goods` VALUES ('220', '../img/list_pic5_18.jpg', '99', '222', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); INSERT INTO `goods` VALUES ('221', '../img/list_pic5_19.jpg', '123', '666', '../img/buy.png', '韩都衣舍17新款韩版女装拼接字母A字牛仔短裙半身裙MR7612汩0525'); -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) CHARACTER SET utf8 NOT NULL, `password` varchar(255) CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('18', '10096@qq.com', 'f5bb0c8de146c67b44babbf4e6584cc0'); INSERT INTO `user` VALUES ('29', '10086@qq.com', 'f5bb0c8de146c67b44babbf4e6584cc0'); INSERT INTO `user` VALUES ('28', '10086@qq.com', 'f5bb0c8de146c67b44babbf4e6584cc0'); INSERT INTO `user` VALUES ('26', '10086@163.com', 'f5bb0c8de146c67b44babbf4e6584cc0'); SET FOREIGN_KEY_CHECKS=1;
INSERT INTO tipo_archivo(id,nombre) VALUES(1,'Consejo Directivo'); INSERT INTO tipo_archivo(id,nombre) VALUES(2,'Nota a Rectorado'); INSERT INTO tipo_archivo(id,nombre) VALUES(3,'Consejo Superior'); INSERT INTO tipo_archivo(id,nombre) VALUES(4,'Acta Seguimiento');
-- AlterTable ALTER TABLE "Student" ALTER COLUMN "password" DROP NOT NULL;
CREATE TABLE IF NOT EXISTS filmes ( `idFilmes` INT UNSIGNED NOT NULL AUTO_INCREMENT, `Nome` VARCHAR(45) NULL, `linkTrailler` VARCHAR(45) NULL, PRIMARY KEY (`idFilmes`));
INSERT INTO public.language(id_language,name) VALUES (1,'Abkhaz'), (2,'Afar'), (3,'Africanos'), (4,'Akan'), (5,'Albania'), (6,'Amárico'), (7,'Árabe'), (8,'Aragonés'), (9,'Armenio'), (10,'Assamese'), (11,'Avaric'), (12,'Avestan'), (13,'Aymara'), (14,'Azerbaiyán'), (15,'Bambara'), (16,'Bashkir'), (17,'Vasco'), (18,'Belarús'), (19,'Bengalí'), (20,'Bihari'), (21,'Bislama'), (22,'Bosnia'), (23,'Breton'), (24,'Búlgaro'), (25,'Burmese'), (26,'Catalán'), (27,'Chamorro'), (28,'Chechenio'), (29,'Chichewa, Chewa, Nyanja'), (30,'Chino'), (31,'Chuvashia'), (32,'Cornualles'), (33,'Corso'), (34,'Cree'), (35,'Croacia'), (36,'Checo'), (37,'Danés'), (38,'Divehi, Dhivehi, Maldivas'), (39,'Holandés'), (40,'Dzongkha'), (41,'Inglés'), (42,'Esperanto'), (43,'Estonia'), (44,'Ewe'), (45,'Faroese'), (46,'Fiji'), (47,'Finlandés'), (48,'Francés'), (49,'Fula, Fulah, Pulaar, Pular'), (50,'Galicia'), (51,'Georgiano'), (52,'Alemán'), (53,'Griego Moderno'), (54,'Guaraní'), (55,'Gujarati'), (56,'Haitiano, creole haitiano'), (57,'Hausa'), (58,'Hebreo (moderno)'), (59,'Herero'), (60,'Hindi'), (61,'Hiri Motu'), (62,'Húngaro'), (63,'Interlingua'), (64,'Indonesio'), (65,'Interlingue'), (66,'Irlanda'), (67,'Igbo'), (68,'Inupiaq'), (69,'Ido'), (70,'Islandés'), (71,'Italiano'), (72,'Inuktitut'), (73,'Japonés'), (74,'Javanés'), (75,'Kalaallisut, Groenlandia'), (76,'Canarés'), (77,'Kanuri'), (78,'Cachemira'), (79,'Kazajstán'), (80,'Khmer'), (81,'Kikuyu, Gikuyu'), (82,'Kinyarwanda'), (83,'Kirguises, Kirguistán'), (84,'Komi'), (85,'Kongo'), (86,'Corea'), (87,'Kurdo'), (88,'Kwanyama, Kuanyama'), (89,'Latin'), (90,'Luxemburgués'), (91,'Luganda'), (92,'Limburgués, Limburgan, Limburger'), (93,'Lingala'), (94,'Lao'), (95,'Lituano'), (96,'Luba-Katanga'), (97,'Letonia'), (98,'Manx'), (99,'Macedonia'), (100,'Madagascar'), (101,'Malayo'), (102,'Malayalam'), (103,'Maltés'), (104,'Māori'), (105,'Maratí (Marathi)'), (106,'De las Islas Marshall'), (107,'Mongolia'), (108,'Nauru'), (109,'Navajo, Navaho'), (110,'Noruego Bokmål'), (111,'Ndebele del Norte'), (112,'Nepali'), (113,'Ndonga'), (114,'Noruego Nynorsk'), (115,'Noruego'), (116,'Nuosu'), (117,'Ndebele del sur'), (118,'Occitano'), (119,'Ojibwe, Ojibwa'), (120,'Antiguo eslavo eclesiástico, Iglesia eslava, eslavo eclesiástico, antiguo Búlgaro, Esclavo viejo'), (121,'Oromo'), (122,'Oriya'), (123,'Osetia del Sur, osetio'), (124,'Panjabi, Punjabi'), (125,'Pāli'), (126,'Persa'), (127,'Polaco'), (128,'Pashto, Pushto'), (129,'Portugués'), (130,'Quechua'), (131,'Romanche'), (132,'Kirundi'), (133,'Rumania, Moldavia, Moldavan'), (134,'Ruso'), (135,'Sánscrito (samskrta)'), (136,'Sardo'), (137,'Sindhi'), (138,'Sami del norte'), (139,'Samoa'), (140,'Sango'), (141,'Serbio'), (142,'Gaélico escocés, gaélico'), (143,'Shona'), (144,'Cingalés, singalés'), (145,'Eslovaca'), (146,'Esloveno'), (147,'Somalí'), (148,'Southern Sotho'), (149,'Español, castellano'), (150,'Sundanese'), (151,'Swahili'), (152,'Swati'), (153,'Sueco'), (154,'Tamil'), (155,'Telugu'), (156,'Tayikistán'), (157,'Tailandia'), (158,'Tigrinya'), (159,'Tibetano estándar, Tibetano, Central'), (160,'Turkmenistán'), (161,'Tagalo'), (162,'Tswana'), (163,'Tonga (Islas Tonga)'), (164,'Turco'), (165,'Tsonga'), (166,'Tártara'), (167,'Twi'), (168,'Tahitian'), (169,'Uighur, Uyghur'), (170,'Ucrania'), (171,'Urdu'), (172,'Uzbeko'), (173,'Venda'), (174,'Vietnamita'), (175,'Volapük'), (176,'Valonia'), (177,'Galés'), (178,'Wolof'), (179,'Oeste de Frisia'), (180,'Xhosa'), (181,'Yiddish'), (182,'Yoruba'), (183,'Zhuang, Chuang'), (184,'Zulu');
-- phpMyAdmin SQL Dump -- version 4.0.10deb1 -- http://www.phpmyadmin.net -- -- Servidor: 127.0.0.1 -- Tempo de Geração: 31/07/2015 às 03:05 -- Versão do servidor: 5.5.43-0ubuntu0.14.04.1 -- Versão do PHP: 5.5.9-1ubuntu4.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Banco de dados: `clockshop` -- CREATE DATABASE IF NOT EXISTS `clockshop` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `clockshop`; -- -------------------------------------------------------- -- -- Estrutura para tabela `customers` -- CREATE TABLE IF NOT EXISTS `customers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `customerName` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `address` varchar(50) NOT NULL, `city` varchar(50) NOT NULL, `state` varchar(50) DEFAULT NULL, `postalCode` varchar(15) DEFAULT NULL, `password` varchar(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Fazendo dump de dados para tabela `customers` -- INSERT INTO `customers` (`id`, `customerName`, `email`, `address`, `city`, `state`, `postalCode`, `password`) VALUES (1, 'a', 'b', 'c', 'd', 'f', '1', '2'); -- -------------------------------------------------------- -- -- Estrutura para tabela `products` -- CREATE TABLE IF NOT EXISTS `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `product_code` varchar(60) NOT NULL, `product_name` varchar(60) NOT NULL, `product_desc` tinytext NOT NULL, `product_img_name` varchar(60) NOT NULL, `price` decimal(10,2) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `product_code` (`product_code`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Fazendo dump de dados para tabela `products` -- INSERT INTO `products` (`id`, `product_code`, `product_name`, `product_desc`, `product_img_name`, `price`) VALUES (1, 'PD1001', 'Relógio Tommi Couro Marrom', 'Relógio masculino com pulseira de couro na cor marrom e caixa com fundo azul marinho.', 'vivara-tommi.jpg', '200.50'), (2, 'PD1002', 'Relógio Tommi Prata Fundo Azul', 'Relógio masculino da Tommi Hilfiger com pulseira de aço na cor prata e caixa com fundo azul marinho.', 'vivara-tommi-2.jpg', '500.85'), (3, 'PD1003', 'Relógio Prata Borda Vermelha', 'Relógio masculino da Tommi Hilfiger com pulseira em aço, cor prata e borda da caixa em cor vermelha. Fundo da caixa na cor cinza escuro.', 'vivara-tommi-3.jpg', '100.00'), (4, 'PD1004', 'Relógio Azul Marinho Tommi', 'Relógio masculino com pulseira de borracha e caixa cor azul marinho, estilo esportivo.', 'vivara-tommi-4.jpg', '400.30'); /*!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 */;
-- Generated by Oracle SQL Developer Data Modeler -- at: 2020-04-17 14:08:49 BST -- site: Oracle Database 11g -- type: Oracle Database 11g --Author: Markus Baciu(C18350801) --Description: Tables created from ERD for Automated Exams CREATE TABLE class ( classid NUMBER(5) NOT NULL, classsize NUMBER(2) ); ALTER TABLE class ADD CONSTRAINT class_pk PRIMARY KEY ( classid ); CREATE TABLE exam ( examid NUMBER(5) NOT NULL, examsession VARCHAR2(6) NOT NULL, examdate DATE NOT NULL, starttime number(4) NOT NULL, examduration number(4) NOT NULL, compulsory CHAR(1) NOT NULL, audio CHAR(1), graphics CHAR(1), question_questionno NUMBER(2) NOT NULL ); ALTER TABLE exam ADD CONSTRAINT exam_pk PRIMARY KEY ( examid ); CREATE TABLE question ( questionno NUMBER(2) NOT NULL, questiontype VARCHAR2(10) NOT NULL, questionans VARCHAR2(50) NOT NULL, questionscore NUMBER(2) NOT NULL ); ALTER TABLE question ADD CONSTRAINT question_pk PRIMARY KEY ( questionno ); CREATE TABLE student ( studentid VARCHAR2(5) NOT NULL, saddress VARCHAR2(50), studentname VARCHAR2(10) NOT NULL, class_classid NUMBER(5) NOT NULL ); ALTER TABLE student ADD CONSTRAINT student_pk PRIMARY KEY ( studentid ); CREATE TABLE subject ( subjectid VARCHAR2(5) NOT NULL, subjectname VARCHAR2(10), exam_examid NUMBER(5) NOT NULL ); ALTER TABLE subject ADD CONSTRAINT subject_pk PRIMARY KEY ( subjectid ); CREATE TABLE teacher ( teacherid VARCHAR2(5) NOT NULL, teachername VARCHAR2(20), subject_subjectid VARCHAR2(5) NOT NULL, class_classid NUMBER(5) NOT NULL ); ALTER TABLE teacher ADD CONSTRAINT teacher_pk PRIMARY KEY ( teacherid ); ALTER TABLE exam ADD CONSTRAINT exam_question_fk FOREIGN KEY ( question_questionno ) REFERENCES question ( questionno ); ALTER TABLE student ADD CONSTRAINT student_class_fk FOREIGN KEY ( class_classid ) REFERENCES class ( classid ); ALTER TABLE subject ADD CONSTRAINT subject_exam_fk FOREIGN KEY ( exam_examid ) REFERENCES exam ( examid ); ALTER TABLE teacher ADD CONSTRAINT teacher_class_fk FOREIGN KEY ( class_classid ) REFERENCES class ( classid ); ALTER TABLE teacher ADD CONSTRAINT teacher_subject_fk FOREIGN KEY ( subject_subjectid ) REFERENCES subject ( subjectid ); commit; -- Oracle SQL Developer Data Modeler Summary Report: -- -- CREATE TABLE 6 -- CREATE INDEX 0 -- ALTER TABLE 11 -- CREATE VIEW 0 -- ALTER VIEW 0 -- CREATE PACKAGE 0 -- CREATE PACKAGE BODY 0 -- CREATE PROCEDURE 0 -- CREATE FUNCTION 0 -- CREATE TRIGGER 0 -- ALTER TRIGGER 0 -- CREATE COLLECTION TYPE 0 -- CREATE STRUCTURED TYPE 0 -- CREATE STRUCTURED TYPE BODY 0 -- CREATE CLUSTER 0 -- CREATE CONTEXT 0 -- CREATE DATABASE 0 -- CREATE DIMENSION 0 -- CREATE DIRECTORY 0 -- CREATE DISK GROUP 0 -- CREATE ROLE 0 -- CREATE ROLLBACK SEGMENT 0 -- CREATE SEQUENCE 0 -- CREATE MATERIALIZED VIEW 0 -- CREATE MATERIALIZED VIEW LOG 0 -- CREATE SYNONYM 0 -- CREATE TABLESPACE 0 -- CREATE USER 0 -- -- DROP TABLESPACE 0 -- DROP DATABASE 0 -- -- REDACTION POLICY 0 -- -- ORDS DROP SCHEMA 0 -- ORDS ENABLE SCHEMA 0 -- ORDS ENABLE OBJECT 0 -- -- ERRORS 0 -- WARNINGS 0
-- Jan 27, 2009 3:08:36 PM ECT -- BF2530003 UPDATE AD_Column SET DefaultValue='100',Updated=TO_DATE('2009-01-27 15:08:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53406 ; -- Jan 27, 2009 3:15:38 PM ECT -- BF2530003 ALTER TABLE PP_Product_Planning MODIFY Yield NUMBER(10) DEFAULT 100 ; UPDATE PP_Product_Planning SET Yield = 100 WHERE AD_Client_ID = 11; UPDATE M_Product SET AD_Org_ID =0 WHERE AD_Client_ID = 11; UPDATE PP_Product_BOM SET AD_Org_ID =0 WHERE AD_Client_ID = 11; UPDATE PP_Product_BOMLine SET AD_Org_ID =0 WHERE AD_Client_ID = 11; UPDATE AD_Workflow SET AD_Org_ID =0 WHERE AD_Client_ID = 11; UPDATE S_Resource SET AD_Org_ID =0 WHERE AD_Client_ID = 11;
\c animals_db_dev; INSERT INTO users(name, email, password) VALUES ('Harry Wizard', 'urAwizard@Harry.com', '1234567890'), ('Kvothe', 'weirdGuy@rothfuss.com', 'qwerty0987');
CREATE TABLE publisher ( id_publisher INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(45) NOT NULL, PRIMARY KEY(id_publisher) ); CREATE TABLE author ( id_author INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(45) NOT NULL, PRIMARY KEY(id_author) ); CREATE TABLE user_type ( type_id INTEGER UNSIGNED NOT NULL, type VARCHAR(45) NOT NULL, PRIMARY KEY(type_id) ); CREATE TABLE user ( code INTEGER UNSIGNED NOT NULL, type_id INTEGER UNSIGNED NOT NULL, username VARCHAR(45) NOT NULL, email VARCHAR(45) NOT NULL, password VARCHAR(45) NOT NULL, PRIMARY KEY(code), FOREIGN KEY(type_id) REFERENCES user_type(type_id) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE book ( isbn VARCHAR(13) NOT NULL, id_author INTEGER UNSIGNED NOT NULL, id_publisher INTEGER UNSIGNED NOT NULL, name VARCHAR(200) NOT NULL, description TEXT NULL, PRIMARY KEY(isbn), FOREIGN KEY(id_publisher) REFERENCES publisher(id_publisher) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY(id_author) REFERENCES author(id_author) ON DELETE NO ACTION ON UPDATE NO ACTION ); CREATE TABLE announce ( code INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, isbn VARCHAR(13) NOT NULL, sold BOOL NULL DEFAULT false, description TEXT NULL, PRIMARY KEY(code, isbn), FOREIGN KEY(isbn) REFERENCES book(isbn) ON DELETE NO ACTION ON UPDATE NO ACTION );
DROP DATABASE IF EXISTS photo; CREATE DATABASE photo; USE photo; DROP TABLE IF EXISTS lectures; CREATE TABLE lectures ( `id` int(3) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL DEFAULT '', `surname` varchar(100) NOT NULL DEFAULT '', `photo` mediumblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1; INSERT INTO lectures values (1,"Mario","Rossi",null); INSERT INTO lectures values (2,"Antonio","Verdi",null); INSERT INTO lectures values (3,"Marco","Gialli",null);
-- sample SQL statements for the app_log CREATE TABLE app_log ( id int not null PRIMARY KEY, logtype varchar(255), logmessage text , logtime int, )
-- SELECT文 -- AS + 任意のキーワードで別名を定義できる SELECT 費目 AS ITEM, 入金額 AS RECEIVE, 出金額 AS PAY FROM 家計簿 AS MONEYBOOK WHERE 費目 = '給料' -- UPDATE文 -- UPDATE文は基本的にWHERE句を使用する(WHEREを使わないと全件更新されてしまう) -- DELETE文 -- DELETE文は基本的にWHERE句を使用する(WHEREを使わないと全件削除されてしまう) -- INSERT文 INSERT INTO 家計簿 (費目, 日付, 出金額) #すべての列に値を追加する場合は省略可能 VALUES ('通信費', '2018-02-20', 6200) -- 練習問題 -- 2-3 -- 1 SELECT コード, 地域, 都道府県名, 県庁所在地, 面積 FROM 都道府県 -- 2 SELECT * FROM 都道府県 -- 3 SELECT 地域 AS area, 都道府県名 AS pref FROM 都道府県 -- 2-4 INSERT INTO 都道府県        (コード, 地域, 都道府県, 面積) VALUES ('26', '近畿', '京都'、4613); INSERT INTO 都道府県 VALUES ('37', '四国', '香川', '高松', 1876); INSERT INTO 都道府県 (コード, 都道府県名, 県庁所在地) VALUES ('40', '福岡', '福岡') -- 2-5 UPDATE 都道府県 SET 県庁所在地 = '京都' WHERE コード = '26'; UPDATE 都道府県 SET 地域 = '九州', 面積 = 4976 WHERE コード = '40' -- 2-6 DELETE FROM 都道府県 WHERE コード = '26'
DELIMITER // CREATE FUNCTION gen_rnd_us_phone() RETURNS CHAR(14) CHARSET utf8 NO SQL BEGIN DECLARE res_pn VARCHAR(16) DEFAULT ''; /* See https://en.wikipedia.org/wiki/Social_Security_number */ SET @gen_rnd_string_characters := '0123456789'; SET res_pn := CONCAT('1-555-', gen_rnd_string(3), '-', gen_rnd_string(4)); SET @gen_rnd_string_characters := NULL; RETURN res_pn; END // DELIMITER ;
WITH FUNCTION application_category ( p_sql_text IN VARCHAR2, p_command_name IN VARCHAR2 DEFAULT NULL ) RETURN VARCHAR2 DETERMINISTIC IS k_appl_handle_prefix CONSTANT VARCHAR2(30) := '/*'||CHR(37); k_appl_handle_suffix CONSTANT VARCHAR2(30) := CHR(37)||'*/'||CHR(37); BEGIN IF p_sql_text LIKE k_appl_handle_prefix||'Transaction Processing'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'addTransactionRow'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'checkEndRowValid'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'checkStartRowValid'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'deleteValue'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'exists'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch commit by idempotency token'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch latest transactions for cache'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Find lower commit id for transaction cache warm up'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'findMatchingRow'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getMaxTransactionCommitID'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getNewTransactionID'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getTransactionProgress'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'lockForCommit'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'lockKievTransactor'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'putBucket'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'readTransactionsSince'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'recordTransactionState'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'setValue'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'SPM:CP'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateIdentityValue'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateNextKievTransID'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateTransactorState'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'upsert_transactor_state'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'writeTransactionKeys'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'QueryTransactorHosts'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'WriteBucketValues'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'batch commit'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'batch mutation log'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'fetchAllIdentities'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'fetch_epoch'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'readFromTxorStateBeginTxn'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'readOnlyBeginTxn'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'validateTransactorState'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getDataStoreMaxTransaction'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'legacyGetDataStoreMaxTransaction'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'isPartitionDropDisabled'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getWithVersionOffsetSql'||k_appl_handle_suffix OR LOWER(p_sql_text) LIKE CHR(37)||'lock table kievtransactions'||CHR(37) THEN RETURN 'TP'; /* Transaction Processing */ -- ELSIF p_sql_text LIKE k_appl_handle_prefix||'Read Only'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'bucketIndexSelect'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'bucketKeySelect'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'bucketValueSelect'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countTransactions'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch snapshots'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Get system time'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getAutoSequences'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getNextIdentityValue'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getValues'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Lock row Bucket_Snapshot'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'longFromDual'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performContinuedScanValues'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performFirstRowsScanQuery'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performScanQuery'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performSnapshotScanQuery'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performStartScanValues'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'selectBuckets'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch latest revisions'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch max sequence for'||k_appl_handle_suffix -- streaming OR p_sql_text LIKE k_appl_handle_prefix||'Fetch partition interval for'||k_appl_handle_suffix -- streaming OR p_sql_text LIKE k_appl_handle_prefix||'Find High value for'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Find partitions for'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Init lock name for snapshot'||k_appl_handle_suffix -- snapshot OR p_sql_text LIKE k_appl_handle_prefix||'List snapshot tables.'||k_appl_handle_suffix -- snapshot OR p_sql_text LIKE k_appl_handle_prefix||'Tail read bucket'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'performSegmentedScanQuery'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'listArchiveStatusByIndexName'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'listAssignmentsByIndexName'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'listHosts'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateHost'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateArchiveStatus'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateOperationLock'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'get KIEVWORKFLOWS table indexes'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'GetOldestLsn'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'GetStreamRecords'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Check if another workflow is running'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Delete old workflows from'||k_appl_handle_suffix THEN RETURN 'RO'; /* Read Only */ -- ELSIF p_sql_text LIKE k_appl_handle_prefix||'Background'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Bootstrap snapshot table Kiev_S'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'bucketIdentitySelect'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'checkMissingTables'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countAllBuckets'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countAllRows'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countKievTransactionRows'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countKtkRows'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Delete garbage'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Delete rows from'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'deleteBucketGarbage'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'enumerateSequences'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch config'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'fetch_leader_heartbeat'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'gcEventMaxId'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'gcEventTryInsert'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Get txn at time'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'get_leader'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getCurEndTime'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getDBSchemaVersion'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getEndTimeOlderThan'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getGCLogEntries'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getMaxTransactionOlderThan'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getSchemaMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getSupportedLibVersions'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'hashBucket'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'hashSnapshot'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Populate workspace'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'populateBucketGCWorkspace'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'primeTxCache'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'readOnlyRoleExists'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Row count between transactions'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'secondsSinceLastGcEvent'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'sync_leadership'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Test if table Kiev_S'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Update snapshot metadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'update_heartbeat'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'validateIfWorkspaceEmpty'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'verify_is_leader'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Checking existence of Mutation Log Table'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Checks if KIEVTRANSACTIONKEYS table is empty'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Checks if KIEVTRANSACTIONS table is empty'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch partition interval for KT'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Fetch partition interval for KTK'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'Insert dynamic config'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'createProxyUser'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'createSequence'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'deregister_host'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'dropAutoSequenceMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'dropBucketFromMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'dropSequenceMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'get KievTransactionKeys table indexes'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'get KievTransactions table indexes'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'get session count'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'initializeMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'isKtPartitioned'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'isPartitioned'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'log'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'register_host'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'updateSchemaVersionInDB'||k_appl_handle_suffix THEN RETURN 'BG'; /* Background */ -- ELSIF p_sql_text LIKE k_appl_handle_prefix||'Ignore'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'enumerateKievPdbs'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'getJDBCSuffix'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'MV_REFRESH'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'null'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'selectColumnsForTable'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'selectDatastoreMd'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'SQL Analyze('||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'validateDataStoreId'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countMetadata'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'countSequenceInstances'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'iod-telemetry'||k_appl_handle_suffix OR p_sql_text LIKE k_appl_handle_prefix||'insert snapshot metadata'||k_appl_handle_suffix OR p_sql_text LIKE CHR(37)||k_appl_handle_prefix||'OPT_DYN_SAMP'||k_appl_handle_suffix THEN RETURN 'IG'; /* Ignore */ -- -- -- ELSIF p_command_name IN ('INSERT', 'UPDATE') -- THEN RETURN 'TP'; /* Transaction Processing */ -- -- -- ELSIF p_command_name = 'DELETE' -- THEN RETURN 'BG'; /* Background */ -- -- -- ELSIF p_command_name = 'SELECT' -- THEN RETURN 'RO'; /* Read Only */ -- -- ELSE RETURN 'UN'; /* Unknown */ END IF; END application_category; -- bl AS (SELECT /*+ OPT_PARAM('_px_cdb_view_enabled' 'FALSE') MATERIALIZE NO_MERGE */ con_id, signature, COUNT(*) AS bl FROM cdb_sql_plan_baselines WHERE enabled = 'YES' AND accepted = 'YES' AND ROWNUM >= 1 GROUP BY con_id, signature), -- pr AS (SELECT /*+ OPT_PARAM('_px_cdb_view_enabled' 'FALSE') MATERIALIZE NO_MERGE */ con_id, signature, COUNT(*) AS pr FROM cdb_sql_profiles WHERE status = 'ENABLED' AND ROWNUM >= 1 GROUP BY con_id, signature), -- pa AS (SELECT /*+ OPT_PARAM('_px_cdb_view_enabled' 'FALSE') MATERIALIZE NO_MERGE */ con_id, signature, COUNT(*) AS pa FROM cdb_sql_patches WHERE status = 'ENABLED' AND ROWNUM >= 1 GROUP BY con_id, signature), t AS (SELECT /*+ OPT_PARAM('_px_cdb_view_enabled' 'FALSE') MATERIALIZE NO_MERGE */ con_id, dbid, sql_id, REPLACE(REPLACE(DBMS_LOB.substr(sql_text, 1000), CHR(10), CHR(32)), CHR(9), CHR(32)) AS sql_text FROM dba_hist_sqltext WHERE ('&&sql_text_piece.' IS NULL OR UPPER(DBMS_LOB.substr(sql_text, 1000)) LIKE UPPER('%&&sql_text_piece.%'))), sqlstat1 AS ( SELECT /*+ MATERIALIZE NO_MERGE */ h.dbid, h.instance_number, h.force_matching_signature, h.sql_id, h.plan_hash_value, h.con_id, h.module, h.parsing_schema_name, MAX(h.sharable_mem) AS sharable_mem, MAX(h.version_count) AS version_count, SUM(h.fetches_delta) AS fetches_delta, SUM(h.executions_delta) AS executions_delta, SUM(h.parse_calls_delta) AS parse_calls_delta, SUM(h.disk_reads_delta) AS disk_reads_delta, SUM(h.buffer_gets_delta) AS buffer_gets_delta, SUM(h.rows_processed_delta) AS rows_processed_delta, SUM(h.cpu_time_delta) AS cpu_time_delta, SUM(h.elapsed_time_delta) AS elapsed_time_delta, SUM(h.iowait_delta) AS iowait_delta, SUM(h.clwait_delta) AS clwait_delta, SUM(h.apwait_delta) AS apwait_delta, SUM(h.ccwait_delta) AS ccwait_delta, SUM(h.plsexec_time_delta) AS plsexec_time_delta, SUM(h.javexec_time_delta) AS javexec_time_delta FROM dba_hist_sqlstat h WHERE h.dbid = &&cs_dbid. AND h.instance_number = &&cs_instance_number. AND h.snap_id BETWEEN &&cs_snap_id_from. AND &&cs_snap_id_to. AND ('&&sql_id.' IS NULL OR h.sql_id = '&&sql_id.') AND ('&&cs2_parsing_schema_name.' = '*' OR h.parsing_schema_name LIKE '%&&cs2_parsing_schema_name.%') GROUP BY h.dbid, h.instance_number, h.force_matching_signature, h.sql_id, h.plan_hash_value, h.con_id, h.module, h.parsing_schema_name ), sqlstat2 AS ( SELECT /*+ OPT_PARAM('_px_cdb_view_enabled' 'FALSE') MATERIALIZE NO_MERGE */ h.dbid, h.instance_number, h.force_matching_signature AS signature, h.sql_id, h.plan_hash_value, h.con_id, h.module, h.parsing_schema_name, h.sharable_mem, h.version_count, h.fetches_delta AS fetches, h.executions_delta AS executions, h.parse_calls_delta AS parse_calls, h.disk_reads_delta AS disk_reads, h.buffer_gets_delta AS buffer_gets, h.rows_processed_delta AS rows_processed, h.fetches_delta / &&cs_begin_end_seconds. AS fetches_ps, h.executions_delta / &&cs_begin_end_seconds. AS executions_ps, h.parse_calls_delta / &&cs_begin_end_seconds. AS parse_calls_ps, h.cpu_time_delta / POWER(10, 6) AS cpu_secs, h.elapsed_time_delta / POWER(10, 6) AS db_secs, h.iowait_delta / POWER(10, 6) AS io_secs, h.clwait_delta / POWER(10, 6) AS cl_secs, h.apwait_delta / POWER(10, 6) AS ap_secs, h.ccwait_delta / POWER(10, 6) AS cc_secs, h.plsexec_time_delta / POWER(10, 6) AS pl_secs, h.javexec_time_delta / POWER(10, 6) AS ja_secs, h.rows_processed_delta / GREATEST(h.executions_delta, 1) AS rows_processed_pe, h.buffer_gets_delta / GREATEST(h.executions_delta, 1) AS buffer_gets_pe, h.disk_reads_delta / GREATEST(h.executions_delta, 1) AS disk_reads_pe, h.elapsed_time_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS db_ms_pe, h.cpu_time_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS cpu_ms_pe, h.iowait_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS io_ms_pe, h.apwait_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS ap_ms_pe, h.ccwait_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS cc_ms_pe, h.clwait_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS cl_ms_pe, h.plsexec_time_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS pl_ms_pe, h.javexec_time_delta / GREATEST(h.executions_delta, 1) / POWER(10, 3) AS ja_ms_pe, h.elapsed_time_delta / GREATEST(h.rows_processed_delta, 1) / POWER(10, 3) AS db_ms_prp, h.cpu_time_delta / GREATEST(h.rows_processed_delta, 1) / POWER(10, 3) AS cpu_ms_prp, h.buffer_gets_delta / GREATEST(h.rows_processed_delta, 1) AS buffer_gets_prp, h.disk_reads_delta / GREATEST(h.rows_processed_delta, 1) AS disk_reads_prp, h.elapsed_time_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS db_aas, h.cpu_time_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS cpu_aas, h.iowait_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS io_aas, h.apwait_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS ap_aas, h.ccwait_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS cc_aas, h.clwait_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS cl_aas, h.plsexec_time_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS pl_aas, h.javexec_time_delta / POWER(10, 6) / &&cs_begin_end_seconds. AS ja_aas, t.sql_text, application_category(t.sql_text, 'UN') AS sql_type, c.name AS pdb_name FROM sqlstat1 h, t, v$containers c -- CROSS APPLY ( -- SELECT a.name AS command_name -- FROM v$sql v, audit_actions a -- WHERE v.sql_id = h.sql_id -- AND v.con_id = h.con_id -- AND v.plan_hash_value = h.plan_hash_value -- AND a.action = v.command_type -- ORDER BY v.last_active_time DESC -- FETCH FIRST 1 ROW ONLY -- ) v WHERE t.con_id = h.con_id AND t.dbid = h.dbid AND t.sql_id = h.sql_id AND c.con_id = h.con_id ), sqlstat3 AS ( SELECT /*+ MATERIALIZE NO_MERGE */ s.sql_id, s.plan_hash_value, v.has_baseline, v.has_profile, v.has_patch, -- s.db_secs, s.cpu_secs, s.io_secs, s.cl_secs, s.ap_secs, s.cc_secs, s.pl_secs, s.ja_secs, s.db_ms_pe, s.cpu_ms_pe, s.io_ms_pe, s.ap_ms_pe, s.cc_ms_pe, s.cl_ms_pe, s.pl_ms_pe, s.ja_ms_pe, s.db_aas, s.cpu_aas, s.io_aas, s.ap_aas, s.cc_aas, s.cl_aas, s.pl_aas, s.ja_aas, s.parse_calls, s.executions, s.fetches, s.parse_calls_ps, s.executions_ps, s.fetches_ps, s.db_ms_prp, s.cpu_ms_prp, s.rows_processed, s.buffer_gets, s.rows_processed_pe, s.buffer_gets_pe, s.buffer_gets_prp, s.disk_reads, s.disk_reads_pe, s.disk_reads_prp, s.sharable_mem, s.version_count, -- s.sql_type, s.sql_text, s.module, s.parsing_schema_name, s.pdb_name FROM sqlstat2 s CROSS APPLY ( SELECT CASE WHEN v.sql_plan_baseline IS NULL THEN 'N' ELSE 'Y' END AS has_baseline, CASE WHEN v.sql_profile IS NULL THEN 'N' ELSE 'Y' END AS has_profile, CASE WHEN v.sql_patch IS NULL THEN 'N' ELSE 'Y' END AS has_patch FROM v$sql v WHERE s.plan_hash_value > 0 AND v.sql_id = s.sql_id AND v.con_id = s.con_id AND v.plan_hash_value = s.plan_hash_value -- AND v.child_address = s.last_active_child_address ORDER BY v.last_active_time DESC FETCH FIRST 1 ROW ONLY ) v -- WHERE ( '&&kiev_tx.' = '*' -- OR '&&kiev_tx.' LIKE '%'||s.sql_type||'%' -- does not seem to work on 19c -- ) WHERE CASE WHEN '&&kiev_tx.' = '*' THEN 1 WHEN '&&kiev_tx.' LIKE '%'||s.sql_type||'%' THEN 1 ELSE 0 END = 1 ORDER BY &&cs_order_by. FETCH FIRST &&top_n. ROWS ONLY )
/* Name: Query may Data source: 4 Created By: Admin Last Update At: 2015-09-08T17:37:15.484626+00:00 */ SELECT FIRST(SPLIT(LAST(SPLIT(post_prop5, '/')), '-')) as post_prop20, post_prop5 as URL, post_prop7 as agent_id, post_prop10 as MOD, post_page_event, post_visid_high, post_visid_low, date_time, post_prop1, post_prop19, post_prop69, post_prop70, post_prop71, post_prop72, page_url, visit_num, FROM djomniture:cipomniture_djmansionglobal.2015_05 WHERE post_prop19 = 'listing' /* Counting Listings */ AND post_page_event = "0" /*condition indicated by kevin chen*/
drop table if exists users; drop table if exists nodes; drop table if exists pools; drop table if exists poolnodes; drop table if exists vips; drop table if exists settings; drop table if exists pooltypes; create table users ( id integer primary key autoincrement, username string unique not null, password string not null, realname string not null, email string not null ); create table settings ( id integer primary key autoincrement, skey string not null, sval string not null, unique (skey) ); create table interfaces ( id integer primary key autoincrement, iname string not null unique ); create table vrrp ( id integer primary key autoincrement, address string nog null unique, interface integer not null references interfaces(id) on update cascade on delete restrict ); create table nodes ( id integer primary key autoincrement, description string not null, ip string not null, port integer not null, owner integer not null default 1 references users(id) on update cascade on delete set default, unique (ip, port, owner) ); create table pooltypes ( id integer primary key autoincrement, typename string not null, typeconf string not null, unique (typename), unique (typeconf) ); insert into pooltypes (typename, typeconf) values ('Natted', 'NAT'); insert into pooltypes (typename, typeconf) values ('Direct Routing', 'DR'); insert into pooltypes (typename, typeconf) values ('Tunneled', 'TUN'); create table pools ( id integer primary key autoincrement, poolname string not null, pooltype integer not null references pooltypes(id) on update cascade on delete cascade, owner integer not null default 1 references users(id) on update cascade on delete set default, unique (poolname, owner) ); create table poolnodes ( id integer primary key autoincrement, node integer not null references nodes(id) on update cascade on delete restrict, pool integer not null references pools(id) on update cascade on delete cascade, owner integer not null default 1 references users(id) on update cascade on delete set default, unique (node, pool, owner) ); create table vips ( id integer primary key autoincrement, ip string not null, port string not null, pool integer not null references pools(id) on update cascade on delete restrict, owner integer not null default 1 references users(id) on update cascade on delete set default, interface integer not null references interfaces(id) on update cascade on delete restrict, unique (ip, port) );
CREATE PROCEDURE sp_Cancel_Bills(@VENDOR NVARCHAR(15), @FROMDATE DATETIME, @TODATE DATETIME) AS SELECT BillAbstract.VendorID, Vendors.Vendor_Name, BillID, BillDate, Value +AdjustmentAmount + TaxAmount, Status, BillReference, DocumentID, BillAbstract.Balance,DocSerialType,DocIDReference, InvoiceReference FROM BillAbstract, Vendors WHERE BillAbstract.VendorID LIKE @VENDOR AND Vendors.VendorID = BillAbstract.VendorID AND BillDate BETWEEN @FROMDATE AND @TODATE --AND (Status & 128) = 0 -- 128 includes both amendment and cancelled bills --AND (BillAbstract.Value + BillAbstract.AdjustmentAmount + BillAbstract.TaxAmount) = BillAbstract.Balance ORDER BY BillAbstract.VendorID, BillAbstract.BillDate
CREATE TABLE peeps(id SERIAL PRIMARY KEY, peep VARCHAR(60), time TIMESTAMP, user_id int8);
select `totalprice` * 1.0625, `custkey` from `tpch`.`tiny`.`orders` order by 1 fetch next 20 rows only
insert into szerep values ('mérőeszköz felügyelő'), ('metrológus'), ('laborvezető'), ('lekérdező'), ('admin');
SELECT Salary FROM Employees
USE secmail; set foreign_key_checks=0; drop table user; drop table message; drop table tag; drop table message_tag; drop table message_recipient; CREATE TABLE user( user_id INT AUTO_INCREMENT, user_address VARCHAR(40) NOT NULL, user_password VARCHAR(40) NOT NULL, user_salt VARCHAR(40), primary key(user_id) ); CREATE TABLE message( message_id INT AUTO_INCREMENT, sender_id INT NOT NULL, message_subject VARCHAR(100), message_content VARCHAR(1000), message_attatchment BLOB, message_date DATETIME, PRIMARY KEY (message_id), FOREIGN KEY (sender_id) REFERENCES user(user_id) ); CREATE TABLE tag( tag_id INT auto_increment, tag_name VARCHAR(40), primary key ( tag_id) ); CREATE TABLE message_tag( tag_id INT, user_id INT, FOREIGN KEY (tag_id) REFERENCES tag(tag_id), FOREIGN KEY (user_id) REFERENCES user(user_id) ); CREATE TABLE message_recipient ( user_id INT, message_id INT, FOREIGN KEY (user_id) REFERENCES user (user_id), FOREIGN KEY (message_id) REFERENCES message (message_id) ); INSERT INTO user(user_id, user_address, user_password) VALUES ( 0, "test", "test"); INSERT INTO user(user_id, user_address, user_password) VALUES ( 0, "test2", "test2"); Select * from user;
/* ** Question: https://leetcode.com/problems/sales-analysis-i/ */ -- method 1, Oracle SELECT t2.seller_id FROM ( SELECT t1.seller_id, RANK() OVER (ORDER BY t1.total_price DESC) AS pos FROM ( SELECT s.seller_id, SUM(s.price) AS total_price FROM Sales s GROUP BY s.seller_id ) t1 ) t2 WHERE t2.pos = 1 ORDER BY t2.seller_id -- method 2, MySQL/Postgres -- Doesn't seem to work on Oracle -- Note: seems like a subquery with result of 1*1 table can be seen as a single value SELECT s.seller_id FROM Sales s GROUP BY s.seller_id HAVING SUM(s.price) = ( SELECT SUM(s.price) AS total_price FROM Sales s GROUP BY s.seller_id ORDER BY total_price DESC LIMIT 1 ) ORDER BY s.seller_id;
USE sakila SELECT first_name, last_name FROM actor JOIN film_actor USING (actor_id) JOIN film USING (film_id) WHERE title = 'ZHIVAGO CORE'; SELECT first_name, last_name FROM actor JOIN film_actor USING (actor_id) WHERE film_id = (SELECT film_id FROM film WHERE title = 'ZHIVAGO CORE'); SELECT film_id FROM film WHERE title = 'ZHIVAGO CORE'; SELECT first_name, last_name FROM actor JOIN film_actor USING (actor_id) WHERE film_id = 998; SELECT MAX(rental_date) FROM rental JOIN customer USING (customer_id) WHERE email = 'WESLEY.BULL@sakilacustomer.org'; SELECT title FROM film JOIN inventory USING (film_id) JOIN rental USING (inventory_id) JOIN customer USING (customer_id) WHERE email = 'WESLEY.BULL@sakilacustomer.org' AND rental_date = '2005-08-23 15:46:33'; SELECT title FROM film JOIN inventory USING (film_id) JOIN rental USING (inventory_id) WHERE rental_date = (SELECT MAX(rental_date) FROM rental JOIN customer USING (customer_id) WHERE email = 'WESLEY.BULL@sakilacustomer.org');
.output 2h.txt SELECT A.term, SUM(A.count * B.count) FROM (SELECT * FROM frequency WHERE docid = '10080_txt_crude') AS A JOIN (SELECT * FROM frequency WHERE docid = '17035_txt_earn') AS B ON A.term = B.term GROUP BY A.term; SELECT SUM(A.count * B.count) FROM (SELECT * FROM frequency WHERE docid = '10080_txt_crude') AS A JOIN (SELECT * FROM frequency WHERE docid = '17035_txt_earn') AS B ON A.term = B.term;
/*!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 utf8mb4 */; /*!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 `comentarios` -- DROP TABLE IF EXISTS `comments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `comments` ( `id` int NOT NULL AUTO_INCREMENT, `comment` varchar(510) NOT NULL, `boss` int NOT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_boss_idx` (`boss`), CONSTRAINT `fk_comment_boss` FOREIGN KEY (`boss`) REFERENCES `boss` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; DROP TABLE IF EXISTS `boss`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `boss` ( `id` int NOT NULL AUTO_INCREMENT, `game` varchar(128) NOT NULL, `enemy` int DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_boss_enemy_idx` (`enemy`), CONSTRAINT `fk_boss_enemies` FOREIGN KEY (`enemy`) REFERENCES `enemies` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `likes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `likes` ( `id` int NOT NULL AUTO_INCREMENT, `hard` int DEFAULT 0, `easy` int DEFAULT 0, `boss` int NOT NULL, PRIMARY KEY (`id`), KEY `fk_likes_boss_idx` (`boss`), CONSTRAINT `fk_likes_boss` FOREIGN KEY (`boss`) REFERENCES `boss` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; -- -- Table structure for table `produtos` -- DROP TABLE IF EXISTS `enemies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `enemies` ( `id` int NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` varchar(510) NOT NULL, `difficulty` varchar(60) NOT NULL, `image1` varchar(255) NOT NULL, `image2` varchar(255) DEFAULT NULL, `image3` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; DROP TABLE IF EXISTS `detonated`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `detonated` ( `id` int NOT NULL AUTO_INCREMENT, `detonated` varchar(510) NOT NULL, `enemy` int NOT NULL, PRIMARY KEY (`id`), KEY `fk_enemies_idx` (`enemy`), CONSTRAINT `fk_detonated_enemy` FOREIGN KEY (`enemy`) REFERENCES `enemies` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `enemies` VALUES (1,'Nemesis','Nemesis, também chamado de Pursuer ou Chaser, é um personagem fictício da série Resident Evil. Criado pela Capcom, apareceu pela primeira vez em Resident Evil 3.','Hard','nemesis1.jpg','nemesis2.jpg','nemesis3.jpg'), (2,'Sephiroth','Sephiroth é um personagem fictício e o principal antagonista de Final Fantasy VII desenvolvido pela Square.','Super Hard','sephiroth1.jpg','sephiroth2.jpg','sephiroth3.jpg'), (3,'Doctor Neo Cortex','Doctor Neo Cortex é um personagem fictício e o principal antagonista da série de videogames Crash Bandicoot.','Easy','neocortex1.jpg','neocortex2.jpg','neocortex3.jpg'), (4,'Sigma','Sigma é o principal antagonista da série de videogames Mega Man X. Criado pelo Dr. Cain, Sigma foi considerado o melhor dos Reploids e foi o primeiro líder dos Maverick Hunters.','Hard','sigma1.jpg','sigma2.jpg','sigma3jpg'), (5,'Ganon','Ganon também conhecido como Ganondorf em sua forma Gerudo, é o principal antagonista da série de jogos The Legend of Zelda','Medium','ganon2.jpg','ganon1.jpg','ganon3.jpg'), (6,'Alduin','Alduin, ou o Devorador de Mundos, como é conhecido pelos habitantes de Skyrim, é um dragão imensamente poderoso.','Hard','alduin1.jpg','alduin2.jpg','alduin3.jpg'), (7,'M. Bison','M. Bison, também conhecido como Ditador, é um personagem de videogame criado pela Capcom. Apresentado pela primeira vez em Street Fighter II: The World Warrior.','Medium','bison2.jpg','bison1.jpg','bison3.jpg'), (8,'Montaro','Motaro é um personagem da franquia de jogos Mortal Kombat.Ele foi introduzido em Mortal Kombat 3 como sub-chefe principal do jogo.','Super Hard','motaro2.jpg','motaro1.jpg','motaro3.jpg'); INSERT INTO `detonated` VALUES (1, 'Quando estiver controlando a Jill, sempre que encontrar uma granada (a normal, não a de atordoamento), guarde-a e não hesite em joga-las em Nemesis quando ele a perseguir na cidade.\nO dano das granadas é alto e vai permitir que você ganhe tempo para se afastar mais dele.\nSempre que Nemesis estiver perseguindo a heroína do game, preste atenção nos geradores elétricos portáteis espalhados pelo cenário.\nAtire neles quando o monstrengo passar perto, pois Nemesis será eletrocutado e você ganha mais tempo para correr e despistá-lo!', 1), (2, 'Nesta batalha, passaremos por várias fases, nas quais teremos que enfraquecer nosso inimigo final, levando em consideração que é o mais poderoso que enfrentaremos ao longo do jogo, é ideal que sigamos alguns conselhos que nos permitam ter as melhores estratégias Nesta batalha, para isso, veremos Como vencer Sephiroth em cada uma das fases até chegar ao fim, continuando a leitura será necessário para alcançar as respostas, então vamos fazê-lo.', 2), (3, 'Primeiro, desvie dos foguetes e do serrote de Mecha Bandicoot. Depois, fique de frente para Mecha Bandicoot e espere que ele atire bolas verdes como Neo Cortex fez. Quando ela chegar em você, use o giro para jogar a bola de volta para Mecha Bandicoot. Faça duas vezes para destruir um braço dele. Depois, ele usará apenas o serrote e lançará a bola verde. Jogue-a de volta para Mecha Bandicoot mais duas vezes. Depois, ele apenas atirará a bola verde. Jogue-a para Mecha Bandicoot por 3 vezes.', 3), (4, 'No momento que a luta começar use um Hadoken para dar cabo dele, ou as coisas podem complicar muito, ele lança uma onda de energia fácil de desviar e tem um ataque onde fica se movendo em zigue-zague pelo cenário, esse não é tão fácil de desviar, por isso é bom acabar com a luta logo no início, pois o que vem depois vai exigir todos os sub-tanks cheios, de qualquer forma a arma mais eficiente contra ele é o Spark Shot.', 4), (5, 'Já no chão, ele pode usar a sua espada de um lado para o outro, criando uma série de bolas de fogo (e um fluxo de ar que podes montar com o teu Paraglider e que te permite disparar setas de cima) ou de cima para baixo que, se aterrar em ti, pode praticamente matar-te de uma única assentada.', 5), (6, 'Os NPCs vão atirar no dragão enquanto voa, mas não há como infligir dano até que ele seja forçado a aterrissar com o “Dragonrend”. Um toque no botão para gritar já dispara a habilidade, o que pode atordoar o dragão depois que ele estiver no chão.', 6), (7, 'Assim, o amigo do Ryu ou deve pular horizontalmente e chutar ele no ar ou no solo, ou mandar Shoryukens (aprenda a executar todos os golpes de Street Fighter 2) quando ele estiver no ar.', 7), (8, 'O salto com soco (jumping punch) é similar ao chute, mas com uma grande diferença: em vez de pular na direção de Motaro, dê um salto vertical e, então, dê um soco quando atingir o ponto mais alto do salto. Assim que o soco atingir Motaro e você aterrissar, salte para trás, fora do alcance dele, ou você será agarrado. A chave para usar esta tática é a precisão: você deve calcular seu salto de modo que atinja o topo no momento em que Motaro ficar ao seu alcance. Pule antes e você vai errar, socando o ar; pule tarde demais e ele vai bloqueá-lo antes que você possa atingi-lo.', 8); INSERT INTO `boss` VALUES (1, 'Resident Evil 3', 1), (2, 'Final Fantasy VII', 2), (3, 'Crash Bandicoot', 3), (4, 'Mega Man X', 4), (5, 'Legend of Zelda', 5), (6, 'Skyrim', 6), (7, 'Street Fight II', 7), (8, 'Mortal Kombat 3', 8); INSERT INTO `likes` VALUES (1, 5, 3, 1), (2, 7, 1, 2), (3, 1, 4, 3), (4, 3, 3, 4), (5, 3, 4, 5), (6, 10, 3, 6), (7, 4, 2, 7), (8, 8, 2, 8); INSERT INTO `comments` VALUES (1, 'Guarde todas balas possiveis!', 1, 'Mark'), (2, 'Tente não lutar parado, ou vai se dar mal!', 1, 'Cloud'), (3, 'Ele é fraco contra Magnum.', 1, 'Sam'), (4, 'Phoenix Down não fará efeito!', 2, 'Sam'), (5, 'Use poção de veneno nas armas.', 2, 'Frodo'), (6, 'Tente duelar com nivel 99', 2, 'Aragorn'), (7, 'Cuidado com os raios do robo gigante!', 3, 'Mark'), (8, 'Colete as maçãs antes de batalhar.', 3, 'Cloud'), (9, 'Gire quando ele atirar caixas.', 3, 'Zelda'), (10, 'Pegue o hadouken antes de ir no Sigma.', 4, 'Zelda'), (11, 'Junte a armadura completa, assim fica fácil.', 4, 'Sam'), (12, 'Desvie dos morcegos, eles são terríveis!', 4, 'Mark'), (13, 'Use a epona para ter mais velocidade.', 5, 'Cloud'), (14, 'Toque a ocarina ao contrário.', 5, 'Aragorn'), (15, 'Fique abaixado contra o fogo que ele solta.', 5, 'Frodo'), (16, 'Use o Fus ho dah e fim de papo.', 6, 'Zelda'), (17, 'Tente lutar usando Daedrick.', 6, 'Mark'), (18, 'Toda poção de vida é pouco!', 6, 'Frodo'), (19, 'Não deixe ele combar!', 7, 'Frodo'), (20, 'Se ele combar, já era!', 7, 'Mark'), (21, 'É sério, não deixa ele combar!', 7, 'Sam'), (22, 'O famoso bate e corre.', 8, 'Zelda'), (23, 'Não fique exposto por muito tempo!', 8, 'Cloud'), (24, 'O coice dele tira metade da vida, cuidado!', 9, 'Aragorn');
/* Get all the list of countries that are in the continent of Europe*/ USE world; SELECT * FROM country WHERE continent = 'Europe'; /*Get all the list of countries that are in the continent of North America and Africa.*/ USE world; SELECT * FROM country WHERE continent IN('North America', 'Africa'); /*Get all the list of cities that are part of a country with population greater than 100 millions*/ USE world; SELECT country.Code AS country_code, country.Name AS country_name, country.continent, country.Population AS country_population, city.Name as city FROM country LEFT JOIN city ON country.Code = city.CountryCode WHERE country.Population > 100000000 ORDER BY country.Name; /*Get all the list of countries (display the full country name) who speak 'Spanish' as their language.*/ USE world; SELECT country.Name, countrylanguage.Language AS language FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language = 'Spanish'; /*Get all the list of countries (display the full country name) who speak 'Spanish' as their official language.*/ USE world; SELECT country.Name, countrylanguage.Language AS language, countrylanguage.IsOfficial FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language = 'Spanish' AND countrylanguage.IsOfficial = 'T'; /*Get all the list of countries (display the full country name) who speak either 'Spanish' or 'English' as their official language.*/ USE world; SELECT country.Name, countrylanguage.Language AS language, countrylanguage.IsOfficial FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language IN('Spanish','English') AND countrylanguage.IsOfficial = 'T'; /*Get all the list of countries (display the full country name) where 'Arabic' is spoken by more than 30% of the population but where it's not the country's official language.*/ USE world; SELECT country.Name, countrylanguage.Language AS language, countrylanguage.IsOfficial language, countrylanguage.Percentage FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language = 'Arabic' AND countrylanguage.Percentage>30 AND countrylanguage.IsOfficial = 'F'; /*Get all the list of countries (display the full country name) where 'French' is the official language but where less than 50% of the population in that country actually speaks that language.*/ USE world; SELECT country.Name, countrylanguage.Language AS language, countrylanguage.IsOfficial, countrylanguage.Percentage FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.Language = 'French' AND countrylanguage.Percentage<50 AND countrylanguage.IsOfficial = 'T'; /* Get all the list of countries (display the full country name and the full language name) and their official language. Order the result so that those with the same official language are shown together.*/ USE world; SELECT country.Name, countrylanguage.Language AS language, countrylanguage.IsOfficial FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode WHERE countrylanguage.IsOfficial = 'T' ORDER BY countrylanguage.Language; /*Get the top 100 cities with the most population. Display the city's full country name also as well as their official language.*/ USE world; SELECT country.Name, city.Name AS city, countrylanguage.Language AS language, countrylanguage.IsOfficial FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode LEFT JOIN city ON country.Code = city.CountryCode WHERE countrylanguage.IsOfficial = 'T' ORDER BY city.Population DESC LIMIT 100; /*Get the top 100 cities with the most population where the life_expectancy for the country is less than 40.*/ USE world; SELECT country.Name AS country, country.LifeExpectancy, city.Name AS city, city.Population FROM country LEFT JOIN city ON country.Code = city.CountryCode WHERE country.LifeExpectancy < 40 ORDER BY city.Population DESC LIMIT 100; /*Get the top 100 countries who speak English and where life expectancy is highest. Show the country with the highest life expectancy first*/ USE world; SELECT country.Name AS country, city.Name AS city, country.LifeExpectancy FROM country LEFT JOIN countrylanguage ON country.Code = countrylanguage.CountryCode LEFT JOIN city ON country.Code = city.CountryCode WHERE countrylanguage.Language = 'English' ORDER BY country.LifeExpectancy DESC LIMIT 100;
 select COMPANY.COMPANY_NAME ,COMPANY.COMPANY_ID ,COMPANY.HOSTINTFACETYPE ,COMPANYWH.WHID from COMPANY, COMPANYWH, COMPANYEMP where COMPANY.COMPANY_ID = COMPANYWH.COMPANY_ID and COMPANY.COMPANY_ID = COMPANYEMP.COMPANY_ID and COMPANYEMP.EMPID = :EMPID order by COMPANY.COMPANY_NAME
/* Travail pratique 1 --> Sidi Allaf Nom de la deuxième personne Date 06-07-2021 */ DROP DATABASE IF EXISTS PosteClientDFC; CREATE DATABASE IF NOT EXISTS PosteClientDFC; USE PosteClientDFC; -- ----------------------------------------------------- -- Étape 1 : Création des tables -- -- ----------------------------------------------------- create table local ( id_local int unsigned primary key, nom_local Varchar(45) null )engine = innodb; create table fabricant ( id_fabricant int unsigned primary key, nom_fabricant Varchar(45) null )engine = innodb; create table poste ( id_poste int unsigned primary key , id_fabricant int unsigned, desc_poste VARCHAR(45) null, desc_processeur varchar(45) null, nb_ram_mo varchar (45) , tail_disque_giga int unsigned, id_local int unsigned , FOREIGN KEY(id_fabricant) REFERENCES fabricant(id_fabricant) ON DELETE no action on update no action, FOREIGN KEY(id_local) REFERENCES local(id_local) ON DELETE no action on update no action )engine = innodb; create table peripherique( id_peripherique int unsigned primary key , nom_peripherique varchar(45)null , id_poste int unsigned, id_fabricant int unsigned, FOREIGN KEY(id_fabricant) REFERENCES fabricant(id_fabricant) ON DELETE no action on update no action, FOREIGN KEY(id_poste) REFERENCES poste (id_poste) ON DELETE no action on update no action )engine=innodb; CREATE TABLE IF NOT EXISTS usager ( id_usager INT UNSIGNED PRIMARY KEY, nom_usager VARCHAR(45) NOT NULL, prenom_usager VARCHAR(45) NOT NULL, telephone_usager VARCHAR(15) NULL, local_id_local INT UNSIGNED NULL, FOREIGN KEY (local_id_local) REFERENCES local (id_local) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS editeur ( id_editeur INT UNSIGNED PRIMARY KEY , nom_editeur VARCHAR(45) NOT NULL) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS logiciel ( id_logiciel INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, nom_logiciel VARCHAR(45) NOT NULL, nb_licence INT NULL, id_editeur INT UNSIGNED NOT NULL, FOREIGN KEY (id_editeur) REFERENCES editeur (id_editeur) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS poste_has_logiciel ( id_poste INT UNSIGNED NOT NULL, id_logiciel INT UNSIGNED NOT NULL, PRIMARY KEY (id_poste, id_logiciel), FOREIGN KEY (id_poste) REFERENCES poste (id_poste) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY (id_logiciel) REFERENCES logiciel (id_logiciel) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS usager_has_poste ( id_usager INT UNSIGNED NOT NULL, id_poste INT UNSIGNED NOT NULL, PRIMARY KEY (id_usager, id_poste), FOREIGN KEY (id_usager) REFERENCES usager (id_usager) ON DELETE NO ACTION ON UPDATE NO ACTION, FOREIGN KEY (id_poste) REFERENCES poste (id_poste) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB;
CREATE TABLE [Dictionaries].[DictionaryElementNames] ( [DictionaryElementNameId] INT IDENTITY (1, 1) NOT NULL, [DictionaryElementId] INT NOT NULL, [Name] NVARCHAR (1000) NOT NULL, [Description] NVARCHAR (4000) NULL, [IsDeleted] BIT NOT NULL, [LanguageId] INT NOT NULL, [CreationDate] DATETIME NOT NULL, [CreatorId] INT NOT NULL, CONSTRAINT [PK_DictionaryElementNames] PRIMARY KEY CLUSTERED ([DictionaryElementNameId] ASC), CONSTRAINT [FK_DictionaryElementNames_DictionaryElements1] FOREIGN KEY ([DictionaryElementId]) REFERENCES [Dictionaries].[DictionaryElements] ([DictionaryElementId]), CONSTRAINT [FK_DictionaryElementNames_DictionaryElements2] FOREIGN KEY ([LanguageId]) REFERENCES [Dictionaries].[DictionaryElements] ([DictionaryElementId]), CONSTRAINT [FK_DictionaryElementNames_UserAccountId] FOREIGN KEY ([CreatorId]) REFERENCES [UserAccounts].[UserAccounts] ([UserAccountId]) );
--Write a SQL statement to create a table Groups. Groups should have unique name (use unique constraint). CREATE TABLE Groups ( GroupId INT IDENTITY, Name NVARCHAR(50) UNIQUE NOT NULL, CONSTRAINT PK_Groups PRIMARY KEY(GroupId) )
DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS questions; DROP TABLE IF EXISTS question_follows; DROP TABLE IF EXISTS replies; DROP TABLE IF EXISTS question_likes; CREATE TABLE users ( id INTEGER PRIMARY KEY, fname TEXT NOT NULL, lname TEXT NOT NULL ); CREATE TABLE questions ( id INTEGER PRIMARY KEY, title TEXT NOT NULL, body TEXT, user_id INTEGER NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id) ); CREATE TABLE question_follows ( id INTEGER PRIMARY KEY, user_id INTEGER NOT NULL, question_id INTEGER NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (question_id) REFERENCES questions(id) ); CREATE TABLE replies ( id INTEGER PRIMARY KEY, parent_id INTEGER, user_id INTEGER NOT NULL, body TEXT NOT NULL, question_id INTEGER NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (question_id) REFERENCES questions(id), FOREIGN KEY (parent_id) REFERENCES replies(id) ); CREATE TABLE question_likes ( id INTEGER PRIMARY KEY, user_id INTEGER NOT NULl, question_id INTEGER NOT NULL ); INSERT INTO users (fname,lname) VALUES ('Katarina','Rossi'), ('Ujwala','Aaduru'), ('Jon', 'Snow'), ('Daenerys', 'Targaryen'); INSERT INTO questions (title,body,user_id) VALUES ('What is your favorite?','color',1), ('What is RDBMS?','sql',1), ('What is RSPEC','ruby',1), ('How do you insert into tables','using sql',2), ('Where are my dragons????','seriously dude', 4), ('Is Ghost still alive?', 'Can''t remember', 1); INSERT INTO question_follows (user_id,question_id) VALUES (1, 2), (3, 2), (4, 2), (1, 3), (2, 3), (4, 1); INSERT INTO replies (user_id,body,question_id) VALUES (2,'Black',1), (3, 'Presumably', 4); INSERT INTO replies (user_id,body,question_id, parent_id) VALUES (1, 'Good. Enough are already dead.', 4, 2); INSERT INTO question_likes (user_id,question_id) VALUES (2,1), (2, 3), (2,2), (2,4), (3,2), (1, 3);
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 27, 2017 at 06:07 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 5.5.38 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `medical_app` -- -- -------------------------------------------------------- -- -- Table structure for table `alerts` -- CREATE TABLE `alerts` ( `id` int(11) NOT NULL, `message` text NOT NULL, `name_of_doctor` text NOT NULL, `alert_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `alerts` -- INSERT INTO `alerts` (`id`, `message`, `name_of_doctor`, `alert_date`) VALUES (30, 'there is a strange disease', 'igbinobaebenezer@gmail.com', '2017-05-05 00:05:25'), (33, 'Good Job', 'igbinobaebenezer@gmail.com', '2017-05-20 09:27:05'), (34, 'charger', 'igbinobaebenezer@gmail.com', '2017-05-20 09:31:14'), (35, 'Nice stuff', 'igbinobaebenezer@gmail.com', '2017-05-20 09:56:19'), (36, 'Thers is a cock croach', 'igbinobaebenezer@gmail.com', '2017-05-25 04:15:58'), (0, 'hey man', 'bosun@gmail.com', '2017-06-06 11:50:41'), (0, 'Shit', 'bosun@gmail.com', '2017-06-06 00:50:20'), (0, 'Mr sam is here with me', 'bosun@gmail.com', '2017-06-06 11:21:54'), (0, 'Daniel is Arround', 'bosun@gmail.com', '2017-06-13 08:24:28'), (0, 'There is an outbreak of diseases', 'bosun@gmail.com', '2017-06-26 11:16:29'), (0, 'i need ', 'bosun@gmail.com', '2017-06-26 06:44:51'); -- -------------------------------------------------------- -- -- Table structure for table `appointments` -- CREATE TABLE `appointments` ( `appointment_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `status` text NOT NULL, `appointment` text NOT NULL, `appointment_date` varchar(200) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, `date_sent` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `reply` varchar(1000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `appointments` -- INSERT INTO `appointments` (`appointment_id`, `user_id`, `status`, `appointment`, `appointment_date`, `date_sent`, `reply`) VALUES (110, 175, 'Approved', 'Brain', '06/16/2017', '2017-06-27 15:15:57', ' Nioce'), (111, 189, 'Approve', 'Nice job', '06/08/2017', '2017-06-27 15:53:27', ' Fool'), (112, 189, 'Approve', 'Yeep!', '06/16/2017', '2017-06-27 11:48:17', ''); -- -------------------------------------------------------- -- -- Table structure for table `chat` -- CREATE TABLE `chat` ( `msg_id` int(11) NOT NULL, `sender` varchar(300) NOT NULL, `message` text NOT NULL, `role` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `chat` -- INSERT INTO `chat` (`msg_id`, `sender`, `message`, `role`) VALUES (78, 'paul paul', 'I Love this', ''), (80, 'Donbay Ekwenem', 'Hey', 'Patient'), (84, 'paul paul', 'hello doctor', ''), (85, 'Medical Professional', 'how are you doing today', ''); -- -------------------------------------------------------- -- -- Table structure for table `emergency_report` -- CREATE TABLE `emergency_report` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `name` text NOT NULL, `report` varchar(1000) NOT NULL, `emergency_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `reply` varchar(1000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `emergency_report` -- INSERT INTO `emergency_report` (`id`, `user_id`, `name`, `report`, `emergency_date`, `reply`) VALUES (62, 185, 'Oladipupo Suleyat', 'OIL', '2017-06-21 15:54:58', ' I need slight'), (63, 175, 'Rat Rattus', 'I need a drug', '2017-06-27 15:47:27', ''); -- -------------------------------------------------------- -- -- Table structure for table `medical_profile` -- CREATE TABLE `medical_profile` ( `user_id` int(11) NOT NULL, `first_name` varchar(250) NOT NULL, `last_name` varchar(250) NOT NULL, `phone` varchar(250) NOT NULL, `Location` varchar(300) NOT NULL, `document` text NOT NULL, `age` varchar(200) NOT NULL, `height` varchar(200) NOT NULL, `user` varchar(200) NOT NULL, `email` varchar(250) NOT NULL, `weight` varchar(200) NOT NULL, `sickness` varchar(200) NOT NULL, `last_visit` varchar(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `medical_profile` -- INSERT INTO `medical_profile` (`user_id`, `first_name`, `last_name`, `phone`, `Location`, `document`, `age`, `height`, `user`, `email`, `weight`, `sickness`, `last_visit`) VALUES (221, 'Rat', ' Rattus', '08182320479', 'CUCRID', '5.jpg', '4yrs', '4yrs', 'Rat Rattus', 'rat@gmail.com', ' 4yrs', '06/14/2017', 'Fine'), (222, 'paul', ' paul', '08034280892', 'PG Hall', 'modern-certificate-_1035-8151.jpg', '30yrs', '30yrs', 'paul paul', 'paul@gmail.com', '30kg', '06/15/2017', 'Malaria'), (229, '', '', '', '', '', '10000yrs', '10000cm', '', 'flash@gmail.com', '10000kg', '', 'Typhoid'), (230, 'Gbenga ', 'Adeniyi', '08182320479', 'CUCRID', '', '', '', '', '', '', '', ''), (231, 'Charles', 'Ayo', '08182320479', 'CUCRID', '', '', '', '', '', '', '', ''), (234, 'Donbay', 'Ekwenem', '08182320479', 'CUCRID', 'geometric-business-report-template_1146-124.jpg', '101yrs', '101yrs', '', 'donbay@gmail.com', '101kg', '06/14/2017', 'Null'), (239, 'Darlene', 'zeche', '08182320479', 'CUCRID', 'armaganvideos-thumb.jpg', '41yrs', '41yrs', '', 'darlene@yahoo.com', '41yrs', '06/28/2017', 'Malaria'), (240, 'Ramota', 'Suleyat', '08182320479', 'CUCRID', 'white-polo-shirt-collection_23-2147629179.jpg', '3yrs', '3yrs', '', 'ramota@yahoomail.com', '3yrs', '06/14/2017', 'Malaria & Typhoid'), (241, 'Shoyemi', 'Ogunvadejho', '08034280892', 'PG', 'Lighthouse.jpg', '100000000yrs', '100000000cm', '', 'shoyemi@gmail.com', '1000000kg', '06/08/2017', 'Malaira'), (242, 'Kayode', 'Rotmas', '8182320479', 'CUCRID', '', '', '', '', 'kayode@gmail.com', '', '', ''), (243, 'Bucky', 'Alao', '09032099139', 'CU', '', '', '', '', 'buky@gmail.com', '', '', ''), (244, 'Segun', 'Igbinoba', '8182320479', 'CUCRID', 'Capture.PNG', '30yrs', '30yrs', '', 'segun@gmail.com', '30yrs', '06/14/2017', 'Malaria'), (245, 'David', 'Arausi', '08182320479', 'CUCRID', 'IMG_6560.JPG', '18yrs', '18cm', '', 'david@gmail.com', '18kg', '06/19/2017', 'Sharp memory'), (246, 'Funmilayo', 'Ogunmo', '8182320479', 'Hebrojn Startup Labs', '', '', '', '', 'funmi@gmail.com', '', '', ''), (247, 'Funmilayo', 'Ogunmo', '08182320479', 'Hebron Labs', '', '', '', '', 'funmi@gmail.com', '', '', ''), (248, 'Oladipupo', 'Suleyat', '08182320479', 'CU', 'a.PNG', '30yrs', '30cm', '', 'oladipupo@gmail.com', '70kg', '06/08/2017', 'Malaria & Typhoid'), (249, 'sand', 'sand', '08173407497', 'CSIS', '', '', '', '', 'sand@t.com', '', '', ''), (250, 'Paper', 'paper', '08182320479', 'wv', '', '', '', '', 'paper@gmail.com', '', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `medica_confirmation` -- CREATE TABLE `medica_confirmation` ( `id` int(11) NOT NULL, `name` varchar(500) NOT NULL, `medical_id` int(11) NOT NULL, `email` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `medica_confirmation` -- INSERT INTO `medica_confirmation` (`id`, `name`, `medical_id`, `email`) VALUES (41, 'Lizard Lizard', 3, 'lizard@gmail.com'), (42, 'Rodent rat', 4, 'rodent@gmail.com'), (43, 'Flash Dog', 5, 'flash@gmail.com'), (44, 'Ayo Oluwabusola', 6, 'ayo@gmail.com'); -- -------------------------------------------------------- -- -- Table structure for table `requests` -- CREATE TABLE `requests` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `request` text NOT NULL, `status` text NOT NULL, `request_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `reply` varchar(1000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `requests` -- INSERT INTO `requests` (`id`, `user_id`, `request`, `status`, `request_date`, `reply`) VALUES (116, 185, 'Fool', 'Approve', '2017-06-26 17:26:34', ' I need you to come'), (117, 185, 'Cover', 'Approved', '2017-06-26 17:59:14', ' Yay'), (118, 189, 'I Love this', 'Approved', '2017-06-26 19:11:38', ' yes'), (119, 189, 'I love life', 'Approved', '2017-06-26 17:13:44', ''), (120, 189, 'I love life', 'Approved', '2017-06-27 15:55:19', ' yeah'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id` int(11) NOT NULL, `first_name` text NOT NULL, `last_name` text NOT NULL, `Location` text NOT NULL, `role` text NOT NULL, `medical_id` varchar(1000) NOT NULL, `phone` varchar(100) NOT NULL, `email` text NOT NULL, `password` text NOT NULL, `alert` varchar(1000) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id`, `first_name`, `last_name`, `Location`, `role`, `medical_id`, `phone`, `email`, `password`, `alert`) VALUES (174, 'bosun', 'bosun', '', 'Medical Professional', '', '08182320479', 'bosun@gmail.com', 'bosun', ''), (175, 'Rat', 'Rattus', 'CUCRID', 'Patient', '', '08182320479', 'rat@gmail.com', 'rat', 'God is Love'), (184, 'Funmilayo', 'Ogunmo', 'Hebron Labs', 'Patient', '95', '08182320479', 'funmi@gmail.com', 'funmi', 'God is Love'), (185, 'Oladipupo', 'Suleyat', 'CU', 'Patient', '54', '08182320479', 'oladipupo@gmail.com', 'oladipupo', 'God is Love'), (189, 'sand', 'sand', 'CSIS', 'Patient', '44', '08173407497', 'sand@t.com', 'sand', 'hewl'), (190, 'Paper', 'paper', 'wv', 'Patient', '54', '08182320479', 'paper@gmail.com', 'paper', ''); -- -- Indexes for dumped tables -- -- -- Indexes for table `appointments` -- ALTER TABLE `appointments` ADD PRIMARY KEY (`appointment_id`); -- -- Indexes for table `chat` -- ALTER TABLE `chat` ADD PRIMARY KEY (`msg_id`); -- -- Indexes for table `emergency_report` -- ALTER TABLE `emergency_report` ADD PRIMARY KEY (`id`); -- -- Indexes for table `medical_profile` -- ALTER TABLE `medical_profile` ADD PRIMARY KEY (`user_id`); -- -- Indexes for table `medica_confirmation` -- ALTER TABLE `medica_confirmation` ADD PRIMARY KEY (`id`); -- -- Indexes for table `requests` -- ALTER TABLE `requests` ADD PRIMARY KEY (`id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `appointments` -- ALTER TABLE `appointments` MODIFY `appointment_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=124; -- -- AUTO_INCREMENT for table `chat` -- ALTER TABLE `chat` MODIFY `msg_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=86; -- -- AUTO_INCREMENT for table `emergency_report` -- ALTER TABLE `emergency_report` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64; -- -- AUTO_INCREMENT for table `medical_profile` -- ALTER TABLE `medical_profile` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=251; -- -- AUTO_INCREMENT for table `medica_confirmation` -- ALTER TABLE `medica_confirmation` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45; -- -- AUTO_INCREMENT for table `requests` -- ALTER TABLE `requests` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=121; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=191; /*!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 */;
select distinct dup_repo_name, number from gha_issues where dup_repo_name = 'kubernetes/kubernetes' and updated_at <= now() - '{{to}}'::interval and updated_at > now() - '{{from}}'::interval and id not in ( select id from gha_issues where updated_at > now() - '{{to}}'::interval ) ;
CREATE TABLE IF NOT EXISTS `#__md_invoicemember` ( `id` int(11) NOT NULL AUTO_INCREMENT, `invoice_id` int(11) NOT NULL, `member_id` int(11) NOT NULL, `member_type_id` int(11) NOT NULL, `fee` decimal(10,0) NOT NULL, PRIMARY KEY (`id`), KEY `invoice_id_i1` (`invoice_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Anamakine: 127.0.0.1 -- Üretim Zamanı: 01 Haz 2020, 22:56:49 -- Sunucu sürümü: 10.4.11-MariaDB -- PHP Sürümü: 7.2.26 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ı: `prolabnetflix` -- -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `kullanici` -- CREATE TABLE `kullanici` ( `ID` int(4) NOT NULL, `Ad` varchar(30) COLLATE utf8_turkish_ci NOT NULL, `Email` varchar(30) COLLATE utf8_turkish_ci NOT NULL, `Parola` varchar(16) COLLATE utf8_turkish_ci NOT NULL, `DogumTarihi` varchar(11) COLLATE utf8_turkish_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci; -- -- Tablo döküm verisi `kullanici` -- INSERT INTO `kullanici` (`ID`, `Ad`, `Email`, `Parola`, `DogumTarihi`) VALUES (1, 'user1', 'user1@deneme.com', '123456789', '27/5/2020'), (2, 'user2', 'user2@deneme.com', '123456789', '1/2/2020'), (3, 'user3', 'user3@deneme.com', '987654321', '31/5/2020'), (4, 'user4', 'user4@deneme.com', '987654321', '1/1/2020'), (5, 'user5', 'user5@deneme.com', '147258369', '31/5/2020'), (7, 'user6', 'user6@deneme.com', '123456789', '12/12/2012'), (8, 'user7', 'user7@deneme.com', '789456123', '3/5/1987'), (9, 'user8', 'user8@deneme.com', '789456123', '2/3/2015'); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `kullanici_program` -- CREATE TABLE `kullanici_program` ( `KID` int(4) NOT NULL, `PID` int(4) NOT NULL, `IzlenmeTarihi` varchar(11) COLLATE utf8_turkish_ci NOT NULL, `IzlenmeSuresi` int(4) NOT NULL, `KaldigiBolum` int(4) NOT NULL, `Puan` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci; -- -- Tablo döküm verisi `kullanici_program` -- INSERT INTO `kullanici_program` (`KID`, `PID`, `IzlenmeTarihi`, `IzlenmeSuresi`, `KaldigiBolum`, `Puan`) VALUES (1, 4, '31.05.2020', 120, 1, 8), (1, 8, '31.05.2020', 120, 1, 10), (2, 2, '30.05.2020', 90, 1, 7), (2, 53, '28.05.2020', 200, 5, 7), (2, 59, '29.05.2020', 200, 6, 5), (1, 66, '05.05.2005', 300, 14, 6), (3, 75, '02.02.2020', 100, 4, 5), (3, 74, '02.02.2020', 100, 3, 4), (4, 73, '02.02.2020', 200, 5, 3), (4, 72, '02.02.2020', 200, 4, 8), (3, 55, '02.02.2020', 100, 3, 4), (4, 47, '02.02.2020', 120, 1, 6), (5, 11, '30.05.2010', 120, 1, 10), (5, 11, '30.05.2010', 120, 1, 9); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `program` -- CREATE TABLE `program` ( `ID` int(11) NOT NULL, `Ad` varchar(300) NOT NULL, `Tip` enum('Film','Dizi','Tv Show') NOT NULL, `BolumS` int(11) NOT NULL, `Uzunluk` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin5; -- -- Tablo döküm verisi `program` -- INSERT INTO `program` (`ID`, `Ad`, `Tip`, `BolumS`, `Uzunluk`) VALUES (1, 'Recep İvedik 6', 'Film', 1, 116), (2, 'Assassın\'s Creed', 'Film', 1, 92), (3, 'Alaca Karanlık', 'Film', 1, 93), (4, 'Yüzüklerin Efendisi İki Kule', 'Film', 1, 121), (5, 'Maske', 'Film', 1, 139), (6, 'Kara Şövalye', 'Film', 1, 111), (7, 'Sherlock Holmes', 'Film', 1, 131), (8, 'Yüzüklerin Efendisi kralın Dönüşü', 'Film', 1, 127), (9, 'Transformers Kayıp Çağ', 'Film', 1, 185), (10, 'Başlangıç', 'Film', 1, 134), (11, 'Interstellar', 'Film', 1, 127), (12, 'Harry Potter lüm Yadigarları', 'Film', 1, 98), (13, 'Jurassic World', 'Film', 1, 114), (14, 'Fantastik Canavarlar', 'Film', 1, 122), (15, 'Ninja Kaplumbağalar', 'Film', 1, 129), (16, 'Kuşlarla Dans', 'Film', 1, 121), (17, 'Mission Blue', 'Film', 1, 140), (18, 'Mercan Peşinde', 'Film', 1, 91), (19, 'Dream Big', 'Film', 1, 107), (20, 'Ay\'daki Son Adam', 'Film', 1, 125), (21, 'Plastik Okyanus', 'Film', 1, 106), (22, 'Rakamlarla Tahmin', 'Film', 1, 94), (23, 'Ben Efsaneyim', 'Film', 1, 91), (24, 'Arif V 216', 'Film', 1, 90), (25, 'pk', 'Film', 1, 139), (26, 'Örümcek Adam', 'Film', 1, 138), (27, 'Jurassıc Park', 'Film', 1, 103), (28, 'Frankestein ', 'Film', 1, 96), (29, 'Gezegenimiz', 'Film', 1, 120), (30, '72 sevimli hayvan', 'Film', 1, 116), (31, 'Kuşçular', 'Film', 1, 98), (32, 'Marsta Keşif', 'Film', 1, 108), (33, 'Gezegenimiz', 'Film', 1, 130), (34, 'Pandemic', 'Film', 1, 127), (35, 'Pokemon', 'Film', 1, 129), (36, 'Şirinler', 'Film', 1, 127), (37, 'Charlie\'nin Çikolata Fabrikası', 'Film', 1, 140), (38, 'Alvin ve Sincaplar', 'Film', 1, 96), (39, 'Scooby-Doo', 'Film', 1, 98), (40, 'Kung Fu Panda', 'Film', 1, 109), (41, 'Mr. Bean Tatilde', 'Film', 1, 134), (42, 'Shrek ', 'Film', 1, 112), (43, 'Mega Zeka', 'Film', 1, 103), (44, 'Bizi Hatırla', 'Film', 1, 138), (45, 'Delibal', 'Film', 1, 136), (46, 'Kardeşim Benim', 'Film', 1, 115), (47, 'Dangal', 'Film', 1, 128), (48, 'Yerçekimi', 'Film', 1, 110), (49, 'Jaws', 'Film', 1, 139), (50, 'Da Vinci Şifresi', 'Film', 1, 91), (51, 'Marwel\' Iron Fist', 'Dizi', 57, 49), (52, 'Ejderhalar', 'Dizi', 29, 42), (53, 'Diriliş Ertuğrul', 'Dizi', 65, 30), (54, 'Trol Avcıları: Arcadia Hikayeleri', 'Dizi', 26, 31), (55, 'How I met your mother', 'Dizi', 60, 52), (56, 'Leyla ile Mecnun', 'Dizi', 58, 29), (57, 'Beni Böyle Sev', 'Dizi', 25, 51), (58, 'Patron Bebek Yine İş başında', 'Dizi', 35, 38), (59, 'Atiye', 'Dizi', 71, 42), (60, 'Maşa ve Koca Ayı', 'Dizi', 64, 44), (61, 'Sünger Bob', 'Dizi', 55, 54), (62, 'Stranger Tings', 'Dizi', 19, 37), (63, 'The Originals', 'Dizi', 59, 55), (64, 'Angry Birds', 'Dizi', 63, 25), (65, 'Criminal', 'Dizi', 23, 52), (66, 'Beyblade', 'Dizi', 38, 23), (67, 'Sonic X ', 'Dizi', 53, 44), (68, 'Kung Fu Panda Muhteşem Sırlar', 'Dizi', 76, 37), (69, 'The Blacklist', 'Dizi', 45, 37), (70, 'Dünyanın En Sıra Dışı Evleri', 'Tv Show', 14, 63), (71, 'Car Masters', 'Tv Show', 12, 44), (72, 'Büyük Tasarımlar', 'Tv Show', 20, 62), (73, 'Basketball or Nothing', 'Tv Show', 14, 57), (74, 'The Big Family Cooking', 'Tv Show', 21, 44), (75, 'Sıradışı Kulübeler', 'Tv Show', 12, 38); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `program_tur` -- CREATE TABLE `program_tur` ( `PID` int(11) NOT NULL, `TID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin5; -- -- Tablo döküm verisi `program_tur` -- INSERT INTO `program_tur` (`PID`, `TID`) VALUES (1, 1), (2, 1), (2, 3), (3, 1), (3, 10), (4, 1), (4, 3), (5, 1), (5, 3), (6, 1), (6, 3), (7, 1), (8, 1), (8, 3), (9, 1), (10, 1), (11, 1), (11, 6), (12, 1), (12, 3), (12, 5), (13, 1), (14, 1), (14, 5), (15, 1), (15, 3), (16, 2), (17, 2), (18, 2), (19, 2), (20, 2), (21, 2), (22, 2), (23, 3), (24, 3), (24, 8), (25, 3), (25, 10), (26, 1), (26, 3), (27, 1), (27, 3), (28, 1), (28, 3), (28, 9), (29, 2), (29, 4), (30, 2), (30, 4), (31, 2), (31, 4), (32, 2), (32, 4), (33, 2), (33, 4), (34, 2), (34, 4), (35, 5), (36, 5), (36, 8), (37, 5), (37, 8), (38, 5), (39, 5), (40, 1), (40, 5), (41, 5), (42, 5), (42, 8), (43, 5), (43, 8), (44, 6), (45, 6), (45, 10), (46, 6), (46, 8), (47, 6), (48, 3), (48, 6), (49, 7), (50, 7), (51, 1), (52, 1), (52, 5), (53, 1), (54, 1), (54, 5), (55, 10), (56, 10), (57, 6), (57, 10), (58, 5), (58, 8), (59, 1), (59, 10), (60, 5), (61, 5), (61, 8), (62, 1), (62, 9), (63, 6), (63, 9), (64, 5), (64, 8), (65, 7), (66, 5), (66, 11), (67, 1), (67, 11), (68, 1), (69, 1), (69, 7), (70, 12), (71, 12), (72, 12), (73, 12), (74, 12), (75, 12); -- -------------------------------------------------------- -- -- Tablo için tablo yapısı `tur` -- CREATE TABLE `tur` ( `ID` int(11) NOT NULL, `Ad` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin5; -- -- Tablo döküm verisi `tur` -- INSERT INTO `tur` (`ID`, `Ad`) VALUES (1, 'Aksiyon ve Macera'), (2, 'Belgesel'), (3, 'Bilim Kurgu ve Fantastik Yapımlar'), (4, 'Bilim ve Doğa'), (5, 'Çocuk ve Aile'), (6, 'Drama'), (7, 'Gerilim'), (8, 'Komedi'), (9, 'Korku'), (10, 'Romantik'), (11, 'Anime'), (12, 'Reality Programs'); -- -- Dökümü yapılmış tablolar için indeksler -- -- -- Tablo için indeksler `kullanici` -- ALTER TABLE `kullanici` ADD PRIMARY KEY (`ID`), ADD UNIQUE KEY `Email` (`Email`); -- -- Tablo için indeksler `kullanici_program` -- ALTER TABLE `kullanici_program` ADD KEY `FKID` (`KID`), ADD KEY `FPID` (`PID`); -- -- Tablo için indeksler `program` -- ALTER TABLE `program` ADD PRIMARY KEY (`ID`); -- -- Tablo için indeksler `program_tur` -- ALTER TABLE `program_tur` ADD KEY `relPID` (`PID`), ADD KEY `relTID` (`TID`); -- -- Tablo için indeksler `tur` -- ALTER TABLE `tur` ADD PRIMARY KEY (`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 `ID` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Tablo için AUTO_INCREMENT değeri `program` -- ALTER TABLE `program` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=76; -- -- Tablo için AUTO_INCREMENT değeri `tur` -- ALTER TABLE `tur` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- Dökümü yapılmış tablolar için kısıtlamalar -- -- -- Tablo kısıtlamaları `kullanici_program` -- ALTER TABLE `kullanici_program` ADD CONSTRAINT `FKID` FOREIGN KEY (`KID`) REFERENCES `kullanici` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `FPID` FOREIGN KEY (`PID`) REFERENCES `program` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Tablo kısıtlamaları `program_tur` -- ALTER TABLE `program_tur` ADD CONSTRAINT `relPID` FOREIGN KEY (`PID`) REFERENCES `program` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `relTID` FOREIGN KEY (`TID`) REFERENCES `tur` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- phpMyAdmin SQL Dump -- version 3.4.10.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: May 21, 2015 at 12:40 PM -- Server version: 5.1.71 -- PHP Version: 5.3.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `ma202dc_GroupProject` -- -- -------------------------------------------------------- -- -- Table structure for table `Comment` -- CREATE TABLE IF NOT EXISTS `Comment` ( `Comment_ID` int(11) NOT NULL AUTO_INCREMENT, `Responder_ID` text NOT NULL, `Comment_Body` text NOT NULL, PRIMARY KEY (`Comment_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- -- -- Table structure for table `Login` -- CREATE TABLE IF NOT EXISTS `Login` ( `Email` varchar(20) NOT NULL, `Password` varchar(20) NOT NULL, `F_Name` varchar(20) NOT NULL, `L_Name` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Login` -- INSERT INTO `Login` (`Email`, `Password`, `F_Name`, `L_Name`) VALUES ('ma202dc@gold.ac.uk', '1234', 'Dean', 'Cooksey'); -- -------------------------------------------------------- -- -- Table structure for table `Question` -- CREATE TABLE IF NOT EXISTS `Question` ( `Q_ID` int(11) NOT NULL AUTO_INCREMENT, `Username` varchar(20) NOT NULL, `Q_Category` varchar(50) NOT NULL, `Q_Body` varchar(1024) NOT NULL, `Q_Rating` int(255) NOT NULL, PRIMARY KEY (`Q_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ; -- -- Dumping data for table `Question` -- INSERT INTO `Question` (`Q_ID`, `Username`, `Q_Category`, `Q_Body`, `Q_Rating`) VALUES (8, 'joshakinsola', 'computing', 'i need to find out how to edit and delete posts on my php', 0), (5, 'ma202dc@gold.ac.uk', 'history', 'Whe edgfwaefwaerdfwaedfwed', 0), (6, 'joshakinsola', 'Category', 'How do i use tables in php?', 0), (10, 'ma202dc@gold.ac.uk', 'food', 'What is the canteen food like?', 0), (12, 'ma202dc@gold.ac.uk', 'computing', 'Anyone used ruby on rails before?', 0), (20, 'ma202dc@gold.ac.uk', 'history', 'when was the rhb building erected?', 0), (21, 'ma202dc@gold.ac.uk', 'computing', 'What''s the best processor for gaming? ', 0); -- -------------------------------------------------------- -- -- Table structure for table `User` -- CREATE TABLE IF NOT EXISTS `User` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Email` varchar(20) NOT NULL, `Password` varchar(20) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `User` -- INSERT INTO `User` (`ID`, `Email`, `Password`) VALUES (1, 'ma202dc@gold.ac.uk', 'test'), (2, 'joshakinsola', 'test'); /*!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 */;
DELETE FROM `t_big_category`; INSERT INTO `t_big_category` (`big_category_id`, `big_category_name`, `big_category_caption`, `big_category_image`) VALUES (1, '儿童测试', NULL, NULL), (2, '青少年测试', NULL, NULL); DELETE FROM `t_evaluate_record`; DELETE FROM `t_evaluate_score`; DELETE FROM `t_small_category`; INSERT INTO `t_small_category` (`small_category_id`, `big_category_id`, `small_category_name`) VALUES (1, 1, '活泼性格'), (2, 1, '儿童日常行为'), (3, 1, '儿童智力'), (4, 1, '心理健康'), (5, 1, '动觉型学习风格'), (6, 1, '音乐天赋'), (7, 1, '体育天赋'), (8, 2, '活泼性格'), (9, 2, '青少年日常行为'), (10, 2, '语文测试'), (11, 2, '专研风格'), (12, 2, '视觉型学习风格'), (13, 2, '音乐天赋'), (14, 2, '篮球天赋'); DELETE FROM `t_subject`; INSERT INTO `t_subject` (`id`, `answer0`, `answer1`, `answer2`, `answer3`, `big_category_id`, `small_category_id`, `subject_answer`, `subject_conent`, `subject_weight`) VALUES (1, '喜好娱乐', '善于说服', '坚持不屑', '适应力强', 1, 1, 0, '在日常生活中,比较符合哪个选项?', 5), (2, '善于社交', '意志坚定', '不善交际', '温良平和', 1, 1, 0, '在人际交往中,比较符合哪个选项?', 5), (3, '发起者', '领导者', '调解者', '聆听者', 1, 1, 0, '在日常游戏中,喜欢扮演哪个角色?', 5), (4, '跳跃性', '攻击性', '规范性', '顺从性', 1, 1, 0, '在思维方式中,比较符合哪个选项?', 5), (5, '主动', '逆反', '挑剔', '胆小', 1, 1, 0, '在处理事务中,比较符合哪个选项?', 5), (6, '生机勃勃吧', '贯彻始终', '井井有条', '愿意听从', 1, 1, 0, '在生活自我管理中,比较符合哪个选项?', 5), (7, '吐在路边', '含在嘴里', '咽下去', '吐在纸巾里', 1, 2, 3, '如果走在马路上忽然想吐痰,又找不到垃圾桶,应该怎么办?', 5), (8, '节约用水', '节约用电', '在桌椅板上乱画乱刻', '随手关灯', 1, 2, 2, '下面哪个做法不正确?', 5), (9, '报告老师,同意后进入', '不进入', '偷偷进入', '随便进入', 1, 2, 0, '迟到或者有事情晚进入教师,应该怎么做?', 5), (10, '专心听别人讲', '随便插嘴', '不喜欢听就不听', '随便听听', 1, 2, 0, '别人与你交谈,应该怎么做?', 5), (11, '很生气,请病假不参加活动', '完全服从队的决议', '不情愿服从队的决议,随便筹备队会', '拒绝服从', 1, 2, 1, '我想主持主题中队会,可是队员推荐李杨作主持人,让我帮助中队委筹备队会,我应该怎么做?', 5), (12, '与平常一样,就当作没有人过来', '主动问好', '好奇的问同学去看', '不让他们进来', 1, 2, 1, '有客人到校或者到班级里听课,我应该怎么做?', 5), (13, '8', '9', '7', '6', 1, 3, 0, '农户有17只羊,9只都病死了,还剩几只羊?', 5), (14, '聋子', '瞎子', '瘸子', '正常人', 1, 3, 1, '谁从来不看医生?', 5), (15, '9', '8', '7', '6', 1, 3, 0, '鱼缸里有9条鱼,走近一看死了2条,这时鱼缸里还有几条鱼?', 5), (16, '5', '10', '20', '6', 1, 3, 0, '父子俩对手下棋,每人都下了5盘,他们一共下了几盘棋?', 5), (17, '10', '20', '6', '2', 1, 3, 3, '一面五星红旗上有两种颜色,10面五星红旗拱有多少中颜色?', 5), (18, '1', '2', '4', '6', 1, 3, 1, '一个人唱完学雷锋用了2分钟,3个人唱完这首歌,最少用积几分钟?', 5), (19, '从不', '偶尔', '常常', '总是', 1, 4, 0, '爱发脾气,控制能力差?', 5), (20, '从不', '偶尔', '常常', '总是', 1, 4, 0, '一到考试就焦虑、压力大?', 5), (21, '从不', '偶尔', '常常', '总是', 1, 4, 0, '厌学、逃学不上课,爱开小差?', 5), (22, '从不', '偶尔', '常常', '总是', 1, 4, 0, '人际交往差、不合群,不喜欢交朋友?', 5), (23, '从不', '偶尔', '常常', '总是', 1, 4, 0, '没有自信、胆小、自卑?', 5), (24, '从不', '偶尔', '常常', '总是', 1, 4, 0, '做事情,坚持不了多久,没有集中力?', 5), (25, '喜欢画画、拼图,动手能力强', '喜欢听故事', '好动,不愿守规矩', '喜欢静静得呆着', 1, 5, 0, '日常爱好比较符合哪个选项?', 5), (26, '不爱说话', '偶尔说话', '爱说、爱讲', '模仿说话', 1, 5, 1, '日常说话比较符合哪个选项?', 5), (27, '快', '慢', '中等', '比较慢', 1, 5, 0, '说话思考速度?', 5), (28, '看地图', '问路', '相信直觉', '等爸爸妈妈', 1, 5, 1, '迷路时,应该怎么做?', 5), (29, '运动', '看电影', '看书', '听音乐', 1, 5, 0, '业务时间,喜欢做什么?', 5), (30, '目不转睛看黑板', '心不在焉', '动来动去', '趴在桌上', 1, 5, 2, '上课表现是怎样的?', 5), (31, '很准', '不准', '偶尔准', '不喜欢唱歌', 1, 6, 0, '唱歌音阶怎么样?', 5), (32, '很出色', '不出色', '偶尔出色', '不背诗和韵律的句子', 1, 6, 0, '背诗和韵律的句子怎么样?', 5), (33, '很准', '不准', '偶尔准', '不辨别', 1, 6, 0, '辨别乐器的声音能力怎么样?', 5), (34, '喜欢', '不喜欢', '偶尔唱', '从来不唱', 1, 6, 0, '喜欢跟着儿歌一起唱歌?', 5), (35, '会,并且做的很协调', '会,但是不协调', '偶尔做', '不做', 1, 6, 0, '播放音乐,会跟着音乐一起做动作?', 5), (36, '可以,声情并茂', '会讲,但是讲的不好', '偶尔讲', '不讲', 1, 6, 0, '可以精彩的讲故事?', 5), (37, '经常', '偶尔', '不经常', '不跑步', 1, 7, 0, '日常是否经常跑来跑去?', 5), (38, '经常', '偶尔', '不经常', '不跳', 1, 7, 0, '日常是否经常跳来跳去?', 5), (39, '非常久', '就只能跑一会', '一般', '不跑步', 1, 7, 0, '日常是否可以跑很久?', 5), (40, '非常好', '一般', '不好', '不知道', 1, 7, 0, '柔韧性好不好?', 5), (41, '经常长', '不长', '一般', '偶尔长', 1, 7, 0, '每天运动时间长不长?', 5), (42, '非常喜欢', '偶尔', '一般', '不喜欢', 1, 7, 0, '喜欢看体育类的电视吗?', 5), (43, '非常喜欢', '偶尔喜欢', '不喜欢', '喜欢在家里带着', 1, 7, 0, '喜欢户外活动吗?', 5), (44, '非常活泼、好动、爱说话', '沉默寡言', '喜欢聆听', '喜欢安静', 2, 8, 0, '在日常生活中,比较符合哪个选项?', 5), (45, '善于社交', '意志坚定', '不善交际', '温良平和', 2, 8, 0, '在人际交往中,比较符合哪个选项?', 5), (46, '发起者', '领导者', '调解者', '聆听者', 2, 8, 0, '在日常游戏中,喜欢扮演哪个角色?', 5), (47, '跳跃性', '攻击性', '规范性', '顺从性', 2, 8, 0, '在思维方式中,比较符合哪个选项?', 5), (48, '主动', '逆反', '挑剔', '胆小', 2, 8, 0, '在处理事务中,比较符合哪个选项?', 5), (49, '生机勃勃吧', '贯彻始终', '井井有条', '愿意听从', 2, 8, 0, '在生活自我管理中,比较符合哪个选项?', 5), (50, '仪表端庄,和谐文雅', '穿戴不整洁', '不喜欢运动', '不刷牙', 2, 9, 0, '在日常生活中,哪项认为是正确的?', 5), (51, '语言肮脏', '语言文明', '骂人', '说脏话', 2, 9, 1, '说话时,应该注意什么?', 5), (52, '专心听别人讲', '随便插嘴', '不喜欢听就不听', '随便听听', 9, 9, 0, '别人与你交谈,应该怎么做?', 5), (53, '很生气,请病假不参加活动', '完全服从队的决议', '不情愿服从队的决议,随便筹备队会', '拒绝服从', 9, 9, 1, '我想主持主题中队会,可是队员推荐李杨作主持人,让我帮助中队委筹备队会,我应该怎么做?', 5), (54, '与平常一样,就当作没有人过来', '主动问好', '好奇的问同学去看', '不让他们进来', 2, 9, 1, '有客人到校或者到班级里听课,我应该怎么做?', 5), (55, '报告老师,同意后进入', '不进入', '偷偷进入', '随便进入', 2, 9, 0, '迟到或者有事情晚进入教师,应该怎么做?', 5), (56, '总是', '偶尔', '几次', '记不住', 2, 10, 0, '当你新接触到一个外语单词,你能在第一时间记住它的拼写吗?', 5), (57, '总是', '偶尔', '几次', '不能', 2, 10, 0, '在你的朋友中,又很多讲各自家乡话的人,在与人交往一段时间后,你发现你也能和他们以同样的方言交流吗?', 5), (58, '看原版', '看中文', '偶尔看原版', '实在没有中文,才看原版', 2, 10, 0, '当你对外语有了一定的了解后,你愿意看原版电影,还是看中文翻译?', 5), (59, '非常有兴趣', '没感觉', '不自在', '非常不自在', 2, 10, 0, '当你第一次听到某外国语种时,对哪些稀奇古怪的读音,又什么感受?', 5), (60, '会', '不会外语', '只背诵中文', '没尝试过', 2, 10, 0, '你会唱一首外国歌曲吗或者背诵外语散文吗?', 5), (61, '可以马上', '偶尔可以', '不会', '根本说不出来', 2, 10, 0, '你可以马上说出不同种类的词语各项用法吗?', 5), (62, '可以看得懂', '偶尔看得懂', '稍微看得懂', '看不懂', 2, 11, 0, '硬科幻、悬疑烧脑片能看懂?', 5), (63, '可以', '不行', '需要很久', '完全不行', 2, 11, 0, '三体原著能2-3口气看完的基本没问题?', 5), (64, '没有感觉', '偶尔感觉', '一点点不适', '非常不舒服', 2, 11, 0, '这次疫情中有没有感觉到极度不适?', 5), (65, '每天都在学习', '不学习', '偶尔学习', '睡觉', 2, 11, 0, '这次疫情中,在无人监管的状态下,有没有每天完成一些学习任务?', 5), (66, '不用调整', '格式非常错乱,需要来来回回调整', '格式前后不一致,需要调整', '偶尔调整', 2, 11, 0, '写文档时,文档格式需要调整吗?', 5), (67, '一学就会', '要很久才可以学会', '永远学不会', '偶尔学会', 2, 11, 0, '学习新鲜事务,例如学做饭,一学就会?', 5), (68, '喜欢画画、拼图,动手能力强', '喜欢听故事', '好动,不愿守规矩', '喜欢静静得呆着', 2, 12, 0, '日常爱好比较符合哪个选项?', 5), (69, '不爱说话', '偶尔说话', '爱说、爱讲', '模仿说话', 2, 12, 1, '日常说话比较符合哪个选项?', 5), (70, '快', '慢', '中等', '比较慢', 2, 12, 0, '说话思考速度?', 5), (71, '看地图', '问路', '相信直觉', '等爸爸妈妈', 2, 12, 1, '迷路时,应该怎么做?', 5), (72, '运动', '看电影', '看书', '听音乐', 2, 12, 0, '业务时间,喜欢做什么?', 5), (73, '目不转睛看黑板', '心不在焉', '动来动去', '趴在桌上', 2, 12, 2, '上课表现是怎样的?', 5), (74, '很准', '不准', '偶尔准', '不喜欢唱歌', 2, 13, 0, '唱歌音阶怎么样?', 5), (75, '很出色', '不出色', '偶尔出色', '不背诗和韵律的句子', 2, 13, 0, '背诗和韵律的句子怎么样?', 5), (76, '很准', '不准', '偶尔准', '不辨别', 2, 13, 0, '辨别乐器的声音能力怎么样?', 5), (77, '喜欢', '不喜欢', '偶尔唱', '从来不唱', 2, 13, 0, '喜欢跟着儿歌一起唱歌?', 5), (78, '会,并且做的很协调', '会,但是不协调', '偶尔做', '不做', 2, 13, 0, '播放音乐,会跟着音乐一起做动作?', 5), (79, '可以,声情并茂', '会讲,但是讲的不好', '偶尔讲', '不讲', 2, 13, 0, '可以精彩的讲故事?', 5), (80, '是的', '不是', '偶尔', '看情况', 2, 14, 0, '你是不是觉得会打篮球的人很帅气?', 5), (81, '是的', '不是', '偶尔', '看情况', 2, 14, 0, '你是不是觉得女生会打篮球是一件很酷的事情?', 5), (82, '是的', '不是', '偶尔', '看情况', 2, 14, 0, '篮球对你来说是不是一项有趣的运动?', 5), (83, '篮球', '游戏', '都不喜欢', '看情况', 2, 14, 0, '游戏和篮球你更喜欢哪个?', 5), (84, '是的', '不是', '偶尔', '看情况', 2, 14, 0, '你是否关注NBA?', 5), (85, '是的', '不是', '偶尔', '看情况', 2, 14, 0, '你腿脚很协调?', 5);
INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B001', 'BA001', 'P001'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B002', 'BA001', 'P002'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B003', 'BA001', 'P003'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B004', 'BA001', 'P004'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B005', 'BA001', 'P005'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B006', 'VR001', 'P006'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B007', 'VR001', 'P007'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B008', 'VR001', 'P008'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B010', 'VR001', 'P005'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B009', 'VR001', 'P009'); INSERT INTO KAVITH.BOOKINGCB004273 (BOOKINGNO, FLIGHTNO, PASSENGERID) VALUES ('B011', 'VR001', 'P001');
PRAGMA foreign_keys = ON; .mode columns .headers ON CREATE TABLE User( idUser INTEGER PRIMARY KEY, firstName VARCHAR NOT NULL, lastName VARCHAR NOT NULL, birthDate DATE NOT NULL, email VARCHAR NOT NULL UNIQUE, password VARCHAR NOT NULL, profilePhoto VARCHAR DEFAULT "default.png", active INTEGER NOT NULL DEFAULT 1 ); CREATE TABLE Event( idEvent INTEGER PRIMARY KEY, name VARCHAR NOT NULL, date DATETIME NOT NULL, description VARCHAR, type INTEGER REFERENCES EventType(idEventType) ON DELETE SET NULL ON UPDATE CASCADE, address VARCHAR, private BOOLEAN DEFAULT 0, idUserCreator INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, eventPhoto VARCHAR DEFAULT "default.png", active INTEGER NOT NULL DEFAULT 1 ); CREATE TABLE EventType( idEventType INTEGER PRIMARY KEY, type VARCHAR NOT NULL UNIQUE ); CREATE TABLE Registration( idUser INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, idEvent INTEGER REFERENCES Event(idEvent) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (idUser, idEvent) ); CREATE TABLE PendingInvite( idSender INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, emailReceiver VARCHAR NOT NULL, idEvent INTEGER REFERENCES Event(idEvent) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (idSender, emailReceiver, idEvent) ); CREATE TABLE Invite( idSender INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, idReceiver INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, idEvent INTEGER REFERENCES Event(idEvent) ON DELETE CASCADE ON UPDATE CASCADE, active INTEGER NOT NULL DEFAULT 1, PRIMARY KEY (idSender, idReceiver, idEvent) ); CREATE TABLE Comment( idComment INTEGER PRIMARY KEY, content VARCHAR, photo VARCHAR, date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, idUser INTEGER REFERENCES User(idUser) ON DELETE CASCADE ON UPDATE CASCADE, idEvent INTEGER REFERENCES Event(idEvent) ON DELETE CASCADE ON UPDATE CASCADE, parentComment INTEGER REFERENCES Comment(idComment) ON DELETE CASCADE ON UPDATE CASCADE, CHECK(content IS NOT NULL OR photo IS NOT NULL) ); CREATE TRIGGER TriggerUserCreator AFTER INSERT ON Event FOR EACH ROW BEGIN INSERT INTO Registration(idUser,idEvent) VALUES (NEW.idUserCreator,NEW.idEvent); END;
CREATE DATABASE IF NOT EXISTS `cloud` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `cloud`; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user`( id INT(11) NOT NULL AUTO_INCREMENT, user_name varchar(40), name varchar(20), age int(3), balance decimal(10,2), PRIMARY KEY(`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8;
/****** Object: StoredProcedure [dbo].[prc_CWI_SetInvoiceDeliveryResend] Script Date: 4/11/2014 1:43:13 PM ******/ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_SetInvoiceDeliveryResend]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[prc_CWI_SetInvoiceDeliveryResend] GO /****** Object: StoredProcedure [dbo].[prc_CWI_SetInvoiceDeliveryResend] Script Date: 4/11/2014 1:43:13 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_SetInvoiceDeliveryResend]') AND type in (N'P', N'PC')) BEGIN EXEC dbo.sp_executesql @statement = N' /******************************************************************* * PROCEDURE: prc_CWI_SetInvoiceDeliveryResend * Purpose : This PROC would be called to update the invoice delivery * Invoked from : ManageInvoiceDelivery.aspx * CREATED: Mohankumar Sundaram 27MAR14 * MODIFICATION HISTORY * DATE AUTHOR DESCRIPTION ********************************************************************** Execution example : ********************************************************************** exec prc_CWI_SetInvoiceDeliveryResend @invoiceId = 1, @deliveryMethod = ''22121'', @inUserId=3 **********************************************************************/ CREATE PROCEDURE [dbo].[prc_CWI_SetInvoiceDeliveryResend] @invoiceId bigint, @deliveryMethod varchar(max), @email varchar(max) = NULL, @inUserId INT AS BEGIN SET NOCOUNT ON BEGIN TRY IF NOT EXISTS(SELECT top 1 1 FROM CWI_Invoice WHERE Id = @invoiceId) begin declare @message NVARCHAR(2000) = ''Invoice Id '' + CAST(@invoiceId as VARCHAR(max)) + '' not exists''; THROW 50000,@message , 1; end DECLARE @tblDeliveryMethod TABLE ( MethodId INT ) INSERT INTO @tblDeliveryMethod SELECT cast(Items as int) FROM dbo.fnc_SplitCommaSeparatedValuesIntoTable(@deliveryMethod, '','') BEGIN TRANSACTION TRAN1 BEGIN TRY -----------------updating the field as deleted if record already exists-------- UPDATE [CWI_InvoiceDelivery] SET IsDeleted = 1, ModifiedBy =@inUserId, ModifiedOn = GETDATE() WHERE InvoiceId = @invoiceId AND IsDeleted = 0 ----------------inserting the records from temp table to invoice delivery table---------- INSERT INTO [dbo].[CWI_InvoiceDelivery] ( InvoiceId, DeliveryLookupId, DeliveryEmail, DeliveryOn, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, IsDeleted ) SELECT @invoiceId, MethodId, CASE WHEN MethodId = 22121 THEN NULL ELSE @email END, /* for print no email is NULL*/ CASE WHEN MethodId = 22121 THEN GETDATE() ELSE NULL END, /* for print delivery immediate*/ @inUserId, GETDATE(), @inUserId, GETDATE(), 0 FROM @tblDeliveryMethod -----------------updating the invoice table------------ UPDATE CWI_Invoice SET [StatusLookupId]=8010 ----pending finance submission status WHERE Id = @invoiceId AND StatusLookupId = 8009 /* Pending Invoice Delivery */ UPDATE CWI_Invoice SET [DeliveryOn]=GETDATE(), [DeliveryBy]=@inUserId WHERE Id = @invoiceId ----------------updating job table---------- UPDATE J SET JobStatusLookupId=8010 ----pending finance submission status FROM CWI_Job J WHERE J.InvoiceId = @invoiceId END TRY BEGIN CATCH IF @@TRANCOUNT >0 ROLLBACK TRANSACTION TRAN1; EXEC prc_CWI_AppRaiseError; THROW; END CATCH IF @@TRANCOUNT > 0 COMMIT TRANSACTION TRAN1; END TRY BEGIN CATCH EXEC prc_CWI_AppRaiseError; THROW; END CATCH SET NOCOUNT OFF END ' END GO
 SELECT OWNER, INDEX_NAME, INDEX_TYPE, TABLE_OWNER, TABLE_NAME, TABLE_TYPE, UNIQUENESS, COMPRESSION, PREFIX_LENGTH, TABLESPACE_NAME, INI_TRANS, MAX_TRANS, INITIAL_EXTENT, NEXT_EXTENT, MIN_EXTENTS, MAX_EXTENTS, PCT_INCREASE, PCT_THRESHOLD, INCLUDE_COLUMN, FREELISTS, FREELIST_GROUPS, PCT_FREE, LOGGING, BLEVEL, LEAF_BLOCKS, DISTINCT_KEYS, AVG_LEAF_BLOCKS_PER_KEY, AVG_DATA_BLOCKS_PER_KEY, CLUSTERING_FACTOR, STATUS, NUM_ROWS, SAMPLE_SIZE, LAST_ANALYZED, DEGREE, INSTANCES, PARTITIONED, TEMPORARY, GENERATED, SECONDARY, BUFFER_POOL, FLASH_CACHE, CELL_FLASH_CACHE, USER_STATS, DURATION, PCT_DIRECT_ACCESS, ITYP_OWNER, ITYP_NAME, PARAMETERS, GLOBAL_STATS, DOMIDX_STATUS, DOMIDX_OPSTATUS, FUNCIDX_STATUS, JOIN_INDEX, IOT_REDUNDANT_PKEY_ELIM, DROPPED, VISIBILITY, DOMIDX_MANAGEMENT, SEGMENT_CREATED FROM ALL_INDEXES WHERE OWNER = @OWNER
-- MySQL Script generated by MySQL Workbench -- Wed Jun 6 13:51:41 2018 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema TCDatabase -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `TCDatabase` ; -- ----------------------------------------------------- -- Schema TCDatabase -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `TCDatabase` DEFAULT CHARACTER SET utf8 ; USE `TCDatabase` ; -- ----------------------------------------------------- -- Table `TCDatabase`.`CenterType` -- ----------------------------------------------------- DROP TABLE IF EXISTS `TCDatabase`.`CenterType` ; CREATE TABLE IF NOT EXISTS `TCDatabase`.`CenterType` ( `Id` INT NOT NULL AUTO_INCREMENT, `Value` VARCHAR(200) NOT NULL, PRIMARY KEY (`Id`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `TCDatabase`.`Center` -- ----------------------------------------------------- DROP TABLE IF EXISTS `TCDatabase`.`Center` ; CREATE TABLE IF NOT EXISTS `TCDatabase`.`Center` ( `Id` INT NOT NULL AUTO_INCREMENT, `Name` VARCHAR(200) NOT NULL, `StreetAddress` VARCHAR(200) NULL, `CenterTypeId` INT NOT NULL, `CenterTypeDesc` VARCHAR(500) NULL, PRIMARY KEY (`Id`), CONSTRAINT `fk_Center_CenterType_Id` FOREIGN KEY (`Id`) REFERENCES `TCDatabase`.`CenterType` (`Id`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `TCDatabase`.`Appointment` -- ----------------------------------------------------- DROP TABLE IF EXISTS `TCDatabase`.`Appointment` ; CREATE TABLE IF NOT EXISTS `TCDatabase`.`Appointment` ( `Id` INT NOT NULL AUTO_INCREMENT, `ClientFullName` VARCHAR(200) NOT NULL, `Date` DATE NOT NULL, `Center` INT NOT NULL, PRIMARY KEY (`Id`), CONSTRAINT `fk_Appointment_Center_Id` FOREIGN KEY (`Id`) REFERENCES `TCDatabase`.`Center` (`Id`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
---------------------------------------------------------------------------------------- -- -- File name: cs_sprf_create.sql -- -- Purpose: Create a SQL Profile for given SQL_ID -- -- Author: Carlos Sierra -- -- Version: 2020/12/20 -- -- Usage: Connecting into PDB. -- -- Enter SQL_ID and PLAN_HASH_VALUE when requested. -- -- Example: $ sqlplus / as sysdba -- SQL> @cs_sprf_create.sql -- -- Notes: Accesses AWR data thus you must have an Oracle Diagnostics Pack License. -- -- Developed and tested on 12.1.0.2. -- --------------------------------------------------------------------------------------- -- @@cs_internal/cs_primary.sql @@cs_internal/cs_cdb_warn.sql @@cs_internal/cs_set.sql @@cs_internal/cs_def.sql @@cs_internal/cs_file_prefix.sql -- DEF cs_script_name = 'cs_sprf_create'; -- PRO 1. SQL_ID: DEF cs_sql_id = '&1.'; UNDEF 1; -- SELECT '&&cs_file_prefix._&&cs_script_name._&&cs_sql_id.' cs_file_name FROM DUAL; -- @@cs_internal/cs_signature.sql -- @@cs_internal/cs_&&dba_or_cdb._plans_performance.sql @@cs_internal/cs_sprf_internal_list.sql -- PRO PRO 2. PLAN_HASH_VALUE (required) DEF cs_plan_hash_value = "&2."; UNDEF 2; -- @@cs_internal/cs_spool_head.sql PRO SQL> @&&cs_script_name..sql "&&cs_sql_id." "&&cs_plan_hash_value." @@cs_internal/cs_spool_id.sql -- PRO SQL_ID : &&cs_sql_id. PRO SIGNATURE : &&cs_signature. PRO SQL_HANDLE : &&cs_sql_handle. PRO APPLICATION : &&cs_application_category. PRO PLAN_HASH_VAL: &&cs_plan_hash_value. -- SET HEA OFF; PRINT :cs_sql_text SET HEA ON; -- drop existing profile if any @@cs_internal/cs_sprf_internal_drop.sql -- -- create xfr files @@cs_sprf_xfr.sql "&&cs_sql_id." "&&cs_plan_hash_value." -- create sql profile @cs_sprf_xfr_1_&&cs_sql_id..sql @cs_sprf_xfr_2_&&cs_plan_hash_value..sql -- -- continues with xfr spool @@cs_internal/cs_set.sql SPO &&cs_file_name..txt APP -- @@cs_internal/cs_sprf_internal_list.sql PRO PRO SQL> @&&cs_script_name..sql "&&cs_sql_id." "&&cs_plan_hash_value." -- @@cs_internal/cs_spool_tail.sql @@cs_internal/cs_undef.sql @@cs_internal/cs_reset.sql --
SELECT DISTINCT COUNT(*) FROM country;
SELECT * FROM psdb.employees WHERE psdb.employees.first_name LIKE 'Crist%';
-- 1 EXPLAIN ANALYZE SELECT potential_customers.* FROM potential_customers WHERE city LIKE '%1%'; CREATE INDEX potential_customers_city_idx ON potential_customers(city); DROP INDEX potential_customers_city_idx; -- 2 EXPLAIN ANALYSE SELECT users.* FROM users INNER JOIN carts c on users.user_id = c.users_user_id INNER JOIN orders o on c.cart_id = o.carts_cart_id WHERE is_staff=1 AND o.total>1000; CREATE INDEX users_user_id_idx ON users(user_id); CREATE INDEX carts_user_id_idx ON carts(users_user_id); CREATE INDEX order_cart_id_idx ON orders(carts_cart_id, total); DROP INDEX users_user_id_idx; DROP INDEX carts_user_id_idx; DROP INDEX order_cart_id_idx; -- 3 EXPLAIN ANALYSE SELECT p.*, COUNT(cp.products_product_id) AS to_be_in_cart_times FROM products p JOIN cart_product cp ON p.product_id = cp.products_product_id GROUP BY p.product_id ORDER BY to_be_in_cart_times; CREATE INDEX products_product_id_idx ON products(product_id); CREATE INDEX cart_product_products_product_id_idx ON cart_product(products_product_id); DROP INDEX products_product_id_idx; DROP INDEX cart_product_products_product_id_idx; -- 4 EXPLAIN ANALYZE SELECT products.* FROM products INNER JOIN categories USING(category_id) WHERE category_id<10 OR category_id IN (13, 17) ORDER BY category_id; CREATE INDEX categories_category_id_idx ON categories (category_id); CREATE INDEX products_category_id_idx ON products (category_id); DROP INDEX categories_category_id_idx; DROP INDEX products_category_id_idx;
create table if not exists burgers ( burger text primary key, cost double precision not null ); create table if not exists toppings ( topping text primary key, cost double precision not null ); create table if not exists clients ( -- clientId serial, clientId integer, firstName text not null, lastName text not null, primary key (clientId) ); create table if not exists orders ( orderId serial primary key, clientId integer not null, date timestamp with time zone not null, completed boolean default false, foreign key (clientId) references clients (clientId) ); create table if not exists products ( productId serial primary key, burger text not null, foreign key (burger) references burgers (burger) ); create table if not exists products_toppings ( productId integer not null, topping text not null, amount integer not null, foreign key (productId) references products (productId), foreign key (topping) references toppings (topping), primary key (topping, productId) ); create table if not exists orders_products ( orderId integer not null, productId integer not null, cost double precision not null, foreign key (orderId) references orders (orderId), foreign key (productId) references products (productId), primary key (orderId, productId) );
-- Remove test database and users. -- ! MySql specific ! DROP DATABASE IF EXISTS `test_authorization`; -- delete all created users (prefix is hardcoded!) SET @users = NULL; SELECT GROUP_CONCAT('\'', `user`, '\'@\'', `host`, '\'') INTO @users FROM `mysql`.`user` WHERE `user` LIKE '_:%' OR `user` = 'authorizer'; SET @drop_command = CONCAT('DROP USER ', @users); PREPARE drop_statement FROM @drop_command; EXECUTE drop_statement; DEALLOCATE PREPARE drop_statement;
CREATE TABLE institusjon ( id BIGINT PRIMARY KEY, org_nummer VARCHAR, tss_ekstern_id VARCHAR NOT NULL, versjon BIGINT DEFAULT 0 NOT NULL, opprettet_av VARCHAR(20) DEFAULT 'VL' NOT NULL, opprettet_tid TIMESTAMP(3) DEFAULT LOCALTIMESTAMP NOT NULL, endret_av VARCHAR(20), endret_tid TIMESTAMP(3) ); CREATE SEQUENCE institusjon_seq INCREMENT BY 50 START WITH 1000000 NO CYCLE; CREATE UNIQUE INDEX uidx_institusjon_org_nummer ON institusjon (org_nummer); CREATE UNIQUE INDEX uidx_institusjon_tss_ekstern_id ON institusjon (tss_ekstern_id)
-- Your SQL goes here CREATE TABLE db_updates ( id INTEGER PRIMARY KEY NOT NULL, started DATETIME NOT NULL, finished DATETIME NOT NULL, tracks_before INTEGER NOT NULL, tracks_after INTEGER NOT NULL, albums_before INTEGER NOT NULL, albums_after INTEGER NOT NULL, artists_before INTEGER NOT NULL, artists_after INTEGER NOT NULL, inserted DATETIME, updated DATETIME );
CREATE TABLE tipo_setor ( id SERIAL4 PRIMARY KEY, setor VARCHAR(200) NOT NULL ); ALTER SEQUENCE tipo_setor_id_seq RESTART WITH 1001; INSERT INTO tipo_setor VALUES (1,'NEPCRIM'), (2,'CONTENCIOSO'), (3,'MEDIACAO');
CREATE TABLE IF NOT EXISTS map__maps( id SERIAL PRIMARY KEY, server_id int references servers(id), size int );
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 04, 2014 at 01:31 PM -- Server version: 5.5.32 -- PHP Version: 5.4.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `test` -- CREATE DATABASE IF NOT EXISTS `test` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `test`; DELIMITER $$ -- -- Procedures -- CREATE DEFINER=`root`@`localhost` PROCEDURE `test_multi_sets`() DETERMINISTIC begin select user() as first_col; select user() as first_col, now() as second_col; select user() as first_col, now() as second_col, now() as third_col; end$$ DELIMITER ; -- -------------------------------------------------------- -- -- Table structure for table `auth` -- CREATE TABLE IF NOT EXISTS `auth` ( `user` varchar(20) NOT NULL, `pass` varchar(20) NOT NULL, `pat1x` int(11) NOT NULL, `pat1y` int(11) NOT NULL, `pat2x` int(11) NOT NULL, `pat2y` int(11) NOT NULL, `pat3x` int(11) NOT NULL, `pat3y` int(11) NOT NULL, `type` varchar(20) NOT NULL, `filepath` varchar(200) NOT NULL, PRIMARY KEY (`user`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `auth` -- INSERT INTO `auth` (`user`, `pass`, `pat1x`, `pat1y`, `pat2x`, `pat2y`, `pat3x`, `pat3y`, `type`, `filepath`) VALUES ('a', 'a', 0, 0, 0, 0, 0, 0, 'user', 'F:/Image/HD/3D-skull-horriifying-terrific1printableprintable.jpg'), ('abhi', 'abhi', 0, 0, 0, 0, 0, 0, 'user', 'F:/Image/Google-Wallpaper-Full-HD-Pics.jpg'), ('dada', 'dada', 43, 134, 445, 725, 920, 604, 'admin', 'F:/Image/Memes/526322_347378735394968_1378163215_n.jpg'), ('h', 'h', 427, 350, 812, 297, 648, 325, 'user', 'F:/Image/Memes/425292_531544770237258_1581213122_n.jpg'), ('moresh', 'moresh', 590, 115, 243, 496, 1258, 403, 'user', 'F:/Image/Metal Gear Rising Revengence/metal-gear-rising-revengeance-16912-1920x1080.jpg'), ('sharan', 'sharan', 0, 0, 0, 0, 0, 0, 'user', 'F:/Image/Metal Gear Rising Revengence/metal_gear_rising_revengeance.jpg'), ('test', 'test', 0, 0, 0, 0, 0, 0, 'user', 'E:/a.jpg'), ('vaibhav', 'vaibhav', 0, 0, 0, 0, 0, 0, 'user', 'F:/Image/Metal Gear Rising Revengence/metal-gear-rising-revengeance-16912-1920x1080.jpg'); /*!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 */;
#legacySQL select org.id as org_id, org.login as org, repo.name as repo, repo.id as rid, min(created_at) as date_from, max(created_at) as date_to from -- [githubarchive:month.202201], [githubarchive:month.202307], [githubarchive:month.202306], [githubarchive:month.202305], [githubarchive:month.202304], [githubarchive:month.202303], [githubarchive:month.202302], [githubarchive:month.202301], [githubarchive:year.2022], [githubarchive:year.2021], [githubarchive:year.2020], [githubarchive:year.2019], [githubarchive:year.2018], [githubarchive:year.2017], [githubarchive:year.2016], [githubarchive:year.2015], [githubarchive:year.2014] where org.id = ( select org.id from -- [githubarchive:month.202201], [githubarchive:month.202307], [githubarchive:month.202306], [githubarchive:month.202305], [githubarchive:month.202304], [githubarchive:month.202303], [githubarchive:month.202302], [githubarchive:month.202301], [githubarchive:year.2022], [githubarchive:year.2021], [githubarchive:year.2020], [githubarchive:year.2019] [githubarchive:year.2018], [githubarchive:year.2017], [githubarchive:year.2016], [githubarchive:year.2015], [githubarchive:year.2014] where org.login = '{{org}}' group by org.id, created_at order by created_at desc limit 1 ) group by org_id, org, repo, rid order by date_from ;
DROP TABLE IF EXISTS `article`; CREATE TABLE IF NOT EXISTS `article` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(50) NOT NULL, `author` VARCHAR(20) NOT NULL, `timestamp` int(11) UNSIGNED NOT NULL, `content` MEDIUMTEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS `comment`; CREATE TABLE IF NOT EXISTS `comment` ( `cid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, `id` BIGINT UNSIGNED NOT NULL, `fromIP` VARCHAR(20) NOT NULL, `timestamp` int(11) UNSIGNED NOT NULL, `content` MEDIUMTEXT NOT NULL, PRIMARY KEY (`Cid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 17 Jan 2018 pada 15.25 -- Versi Server: 10.1.21-MariaDB -- PHP Version: 7.1.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `erapor` -- -- -------------------------------------------------------- -- -- Struktur dari tabel `admin` -- CREATE TABLE `admin` ( `id_admin` int(11) NOT NULL, `username` varchar(50) NOT NULL, `password` text NOT NULL, `nama_admin` varchar(100) NOT NULL, `foto_admin` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `admin` -- INSERT INTO `admin` (`id_admin`, `username`, `password`, `nama_admin`, `foto_admin`) VALUES (1, 'admin', '$2y$10$QnW9cBa6JLS/fgoON78x9O37HVgsSEcwaEtYzWkdQIKy57jg9ub9C', 'Admin Satu', NULL), (2, 'budi', '$2y$10$bTcjntxsA28PcaElHXrvgu3CUCOtAu2IHvaPSV4Y5/Ptgwo/wt6zO', 'Budi', NULL), (3, 'andi', '$2y$10$PwbDzv9Bh/Xg53Q.H3bRXuBFM3tcqmOfhIprUhjnh4gZWVi4uz..i', 'Andini', NULL); -- -------------------------------------------------------- -- -- Struktur dari tabel `guru` -- CREATE TABLE `guru` ( `id_guru` int(11) NOT NULL, `nik` varchar(50) NOT NULL, `nama_guru` varchar(100) NOT NULL, `jk_guru` int(1) NOT NULL, `foto_guru` text, `password_guru` text NOT NULL, `telp_guru` varchar(20) DEFAULT NULL, `alamat_guru` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `guru` -- INSERT INTO `guru` (`id_guru`, `nik`, `nama_guru`, `jk_guru`, `foto_guru`, `password_guru`, `telp_guru`, `alamat_guru`) VALUES (1, 'nik1', 'Zxc Vbn', 1, NULL, '$2y$10$nxEcpjlQm8fPH7UIWtRxXeeB5CSVjsU0qkatNj2wxgibtmpcyQdvO', '09767', 'rfghj'), (2, 'nik2', 'Asd Fgh', 0, NULL, '$2y$10$fm7.kltxxo.0RC7MmRPwNeuxsoDbQo1/s36um0/UIqSsKgXFM8HyK', '00796759', 'rhvjbknm'); -- -------------------------------------------------------- -- -- Struktur dari tabel `jenis_mapel` -- CREATE TABLE `jenis_mapel` ( `id_jenis_mapel` int(11) NOT NULL, `nama_jenis_mapel` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `jenis_mapel` -- INSERT INTO `jenis_mapel` (`id_jenis_mapel`, `nama_jenis_mapel`) VALUES (1, 'Umum'), (2, 'Kejuruan'); -- -------------------------------------------------------- -- -- Struktur dari tabel `kd` -- CREATE TABLE `kd` ( `id_kd` int(11) NOT NULL, `nama_kd` varchar(50) NOT NULL, `urutan` int(5) NOT NULL, `semester` int(1) NOT NULL, `id_mapel` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kd` -- INSERT INTO `kd` (`id_kd`, `nama_kd`, `urutan`, `semester`, `id_mapel`) VALUES (3, 'teks naratif', 1, 2, 5), (4, 'jenis kata', 2, 2, 5), (5, 'announcement', 1, 1, 2), (6, 'narative', 2, 1, 2), (7, 'descriptive', 1, 2, 2), (8, 'procedure', 2, 2, 2), (9, 'report', 3, 2, 2), (10, 'puisi', 1, 1, 5), (11, 'majas', 2, 1, 5), (12, 'pantun', 3, 1, 5), (13, 'sunting teks', 4, 1, 5), (14, 'teks ulasan', 5, 1, 5), (15, 'kata baku', 6, 1, 5), (16, 'report', 3, 1, 2), (17, 'listening', 4, 1, 2); -- -------------------------------------------------------- -- -- Struktur dari tabel `kelas` -- CREATE TABLE `kelas` ( `id_kelas` int(11) NOT NULL, `id_kelompok_kelas` int(11) NOT NULL, `nama_kelas` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kelas` -- INSERT INTO `kelas` (`id_kelas`, `id_kelompok_kelas`, `nama_kelas`) VALUES (1, 1, 'X RPL 1'), (2, 2, 'X TKJ 1'), (3, 1, 'X RPL 2'), (4, 2, 'X TKJ 2'); -- -------------------------------------------------------- -- -- Struktur dari tabel `kelas_siswa` -- CREATE TABLE `kelas_siswa` ( `id_kelas_siswa` int(11) NOT NULL, `id_siswa` int(11) NOT NULL, `id_kelas` int(11) NOT NULL, `th_ajar` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kelas_siswa` -- INSERT INTO `kelas_siswa` (`id_kelas_siswa`, `id_siswa`, `id_kelas`, `th_ajar`) VALUES (1, 1, 1, 2017), (2, 2, 1, 2017), (3, 1, 1, 2016), (4, 7, 2, 2017), (5, 8, 2, 2017); -- -------------------------------------------------------- -- -- Struktur dari tabel `kelompok_kelas` -- CREATE TABLE `kelompok_kelas` ( `id_kelompok_kelas` int(11) NOT NULL, `nama_kelompok_kelas` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kelompok_kelas` -- INSERT INTO `kelompok_kelas` (`id_kelompok_kelas`, `nama_kelompok_kelas`) VALUES (1, 'X RPL'), (2, 'X TKJ'); -- -------------------------------------------------------- -- -- Struktur dari tabel `kurikulum` -- CREATE TABLE `kurikulum` ( `id_kurikulum` int(11) NOT NULL, `nama_kurikulum` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `kurikulum` -- INSERT INTO `kurikulum` (`id_kurikulum`, `nama_kurikulum`) VALUES (1, 'K13'); -- -------------------------------------------------------- -- -- Struktur dari tabel `mapel` -- CREATE TABLE `mapel` ( `id_mapel` int(11) NOT NULL, `id_kurikulum` int(11) NOT NULL, `id_jenis_mapel` int(11) DEFAULT NULL, `nama_mapel` varchar(50) NOT NULL, `kkm` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `mapel` -- INSERT INTO `mapel` (`id_mapel`, `id_kurikulum`, `id_jenis_mapel`, `nama_mapel`, `kkm`) VALUES (2, 1, 1, 'Bahasa Inggris', 75), (5, 1, 1, 'Bahasa Indonesia', 75), (6, 1, 2, 'Pemrograman Dasar', 70); -- -------------------------------------------------------- -- -- Struktur dari tabel `mapel_guru` -- CREATE TABLE `mapel_guru` ( `id_mapel_guru` int(11) NOT NULL, `id_mapel` int(11) DEFAULT NULL, `id_guru` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `mapel_guru` -- INSERT INTO `mapel_guru` (`id_mapel_guru`, `id_mapel`, `id_guru`) VALUES (9, 2, 2), (10, 5, 2), (11, 6, 2); -- -------------------------------------------------------- -- -- Struktur dari tabel `mapel_kelas` -- CREATE TABLE `mapel_kelas` ( `id_mapel_kelas` int(11) NOT NULL, `id_mapel` int(11) DEFAULT NULL, `id_kelompok_kelas` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `mapel_kelas` -- INSERT INTO `mapel_kelas` (`id_mapel_kelas`, `id_mapel`, `id_kelompok_kelas`) VALUES (12, 2, 2), (13, 5, 2), (21, 2, 1), (22, 5, 1), (23, 6, 1); -- -------------------------------------------------------- -- -- Struktur dari tabel `nilai` -- CREATE TABLE `nilai` ( `id_nilai` int(11) NOT NULL, `id_mapel` int(11) DEFAULT NULL, `id_kelas_siswa` int(11) NOT NULL, `nilai_uts` int(11) NOT NULL, `nilai_uas` int(11) NOT NULL, `nilai_akhir` int(11) NOT NULL, `semester` int(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `nilai` -- INSERT INTO `nilai` (`id_nilai`, `id_mapel`, `id_kelas_siswa`, `nilai_uts`, `nilai_uas`, `nilai_akhir`, `semester`) VALUES (1, 5, 1, 88, 80, 80, 1), (2, 5, 2, 0, 90, 0, 1), (3, 5, 1, 89, 77, 0, 2), (4, 5, 2, 0, 0, 0, 2), (5, 2, 2, 90, 0, 90, 1), (6, 2, 1, 75, 75, 0, 1); -- -------------------------------------------------------- -- -- Struktur dari tabel `nilai_kd` -- CREATE TABLE `nilai_kd` ( `id_nilai_kd` int(11) NOT NULL, `id_kd` int(11) NOT NULL, `id_kelas_siswa` int(11) NOT NULL, `nilai` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `nilai_kd` -- INSERT INTO `nilai_kd` (`id_nilai_kd`, `id_kd`, `id_kelas_siswa`, `nilai`) VALUES (2, 11, 1, 70), (3, 10, 2, 75), (4, 3, 1, 78), (5, 3, 2, 75), (6, 4, 2, 87), (7, 10, 1, 80), (8, 12, 1, 75), (9, 4, 1, 80), (10, 11, 2, 0), (11, 12, 2, 90), (12, 5, 2, 0), (13, 6, 2, 0), (14, 13, 1, 86), (15, 14, 1, 88), (16, 15, 1, 90), (17, 5, 1, 80), (18, 6, 1, 60), (19, 16, 1, 90), (20, 17, 1, 100); -- -------------------------------------------------------- -- -- Struktur dari tabel `nilai_sikap` -- CREATE TABLE `nilai_sikap` ( `id_nilai_sikap` int(11) NOT NULL, `id_kelas_siswa` int(11) NOT NULL, `semester` int(11) NOT NULL, `nilai` varchar(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `nilai_sikap` -- INSERT INTO `nilai_sikap` (`id_nilai_sikap`, `id_kelas_siswa`, `semester`, `nilai`) VALUES (1, 1, 1, 'A'), (2, 3, 1, 'B'); -- -------------------------------------------------------- -- -- Struktur dari tabel `rumus` -- CREATE TABLE `rumus` ( `nilai_kd` int(11) NOT NULL, `nilai_uts` int(11) NOT NULL, `nilai_uas` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `rumus` -- INSERT INTO `rumus` (`nilai_kd`, `nilai_uts`, `nilai_uas`) VALUES (40, 30, 30); -- -------------------------------------------------------- -- -- Struktur dari tabel `siswa` -- CREATE TABLE `siswa` ( `id_siswa` int(11) NOT NULL, `nisn` varchar(50) NOT NULL, `nis` varchar(50) NOT NULL, `nama_siswa` varchar(100) NOT NULL, `tempat_lahir` varchar(50) NOT NULL, `tgl_lahir` date NOT NULL, `jk` int(1) NOT NULL, `foto_siswa` text, `id_kelas_siswa` int(11) DEFAULT NULL, `id_guru` int(11) DEFAULT NULL, `password` text NOT NULL, `th_kelulusan` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data untuk tabel `siswa` -- INSERT INTO `siswa` (`id_siswa`, `nisn`, `nis`, `nama_siswa`, `tempat_lahir`, `tgl_lahir`, `jk`, `foto_siswa`, `id_kelas_siswa`, `id_guru`, `password`, `th_kelulusan`) VALUES (1, 'nisn1', 'nis1', 'Abc Def', 'Madiun', '2000-12-04', 1, NULL, 1, 2, '$2y$10$bE5B1m4kXirWVODfmW/n7uelUgfD1z4n.zjf6SFNTsfIJ8DehoUgC', NULL), (2, 'nisn2', 'nis2', 'Ghi Jkl', 'Surabaya', '1999-12-28', 0, NULL, 2, NULL, '$2y$10$6q7diIniGs8f.4kI29AiyuAyWLVt/aszq/iqhGauIXv6GqokSKpd2', NULL), (7, 'nisn3', 'nis3', 'Mno Pqr', 'Bandung', '2017-12-04', 0, NULL, 1, 2, '$2y$10$qY30mzVQyIaYtmnw.mF8muc8CLF0tpGKBaIqopPYi2GzrESxNHvHW', NULL), (8, 'nisn4', 'nis4', 'Stu Vwx', 'Bogor', '2000-06-14', 1, NULL, 2, NULL, '$2y$10$Q8RIaD7Vl82y/FOKf7euZOeuHInGKmuAKPv6VZEFV5mxcnvIMzD46', NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id_admin`); -- -- Indexes for table `guru` -- ALTER TABLE `guru` ADD PRIMARY KEY (`id_guru`); -- -- Indexes for table `jenis_mapel` -- ALTER TABLE `jenis_mapel` ADD PRIMARY KEY (`id_jenis_mapel`); -- -- Indexes for table `kd` -- ALTER TABLE `kd` ADD PRIMARY KEY (`id_kd`), ADD KEY `id_mapel` (`id_mapel`); -- -- Indexes for table `kelas` -- ALTER TABLE `kelas` ADD PRIMARY KEY (`id_kelas`), ADD KEY `id_kelompok_kelas` (`id_kelompok_kelas`); -- -- Indexes for table `kelas_siswa` -- ALTER TABLE `kelas_siswa` ADD PRIMARY KEY (`id_kelas_siswa`), ADD KEY `id_siswa` (`id_siswa`), ADD KEY `id_kelas` (`id_kelas`); -- -- Indexes for table `kelompok_kelas` -- ALTER TABLE `kelompok_kelas` ADD PRIMARY KEY (`id_kelompok_kelas`); -- -- Indexes for table `kurikulum` -- ALTER TABLE `kurikulum` ADD PRIMARY KEY (`id_kurikulum`); -- -- Indexes for table `mapel` -- ALTER TABLE `mapel` ADD PRIMARY KEY (`id_mapel`), ADD KEY `id_kurikulum` (`id_kurikulum`), ADD KEY `id_jenis_mapel` (`id_jenis_mapel`); -- -- Indexes for table `mapel_guru` -- ALTER TABLE `mapel_guru` ADD PRIMARY KEY (`id_mapel_guru`), ADD KEY `id_mapel` (`id_mapel`), ADD KEY `id_guru` (`id_guru`); -- -- Indexes for table `mapel_kelas` -- ALTER TABLE `mapel_kelas` ADD PRIMARY KEY (`id_mapel_kelas`), ADD KEY `id_mapel` (`id_mapel`), ADD KEY `id_kelompok_kelas` (`id_kelompok_kelas`), ADD KEY `id_kelompok_kelas_2` (`id_kelompok_kelas`); -- -- Indexes for table `nilai` -- ALTER TABLE `nilai` ADD PRIMARY KEY (`id_nilai`), ADD KEY `id_mapel` (`id_mapel`), ADD KEY `id_kelas_siswa` (`id_kelas_siswa`); -- -- Indexes for table `nilai_kd` -- ALTER TABLE `nilai_kd` ADD PRIMARY KEY (`id_nilai_kd`), ADD KEY `id_kd` (`id_kd`), ADD KEY `id_siswa` (`id_kelas_siswa`); -- -- Indexes for table `nilai_sikap` -- ALTER TABLE `nilai_sikap` ADD PRIMARY KEY (`id_nilai_sikap`), ADD KEY `id_kelas_siswa` (`id_kelas_siswa`); -- -- Indexes for table `siswa` -- ALTER TABLE `siswa` ADD PRIMARY KEY (`id_siswa`), ADD KEY `id_kelas` (`id_kelas_siswa`), ADD KEY `id_guru` (`id_guru`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id_admin` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `guru` -- ALTER TABLE `guru` MODIFY `id_guru` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `jenis_mapel` -- ALTER TABLE `jenis_mapel` MODIFY `id_jenis_mapel` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `kd` -- ALTER TABLE `kd` MODIFY `id_kd` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `kelas` -- ALTER TABLE `kelas` MODIFY `id_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `kelas_siswa` -- ALTER TABLE `kelas_siswa` MODIFY `id_kelas_siswa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `kelompok_kelas` -- ALTER TABLE `kelompok_kelas` MODIFY `id_kelompok_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `kurikulum` -- ALTER TABLE `kurikulum` MODIFY `id_kurikulum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `mapel` -- ALTER TABLE `mapel` MODIFY `id_mapel` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `mapel_guru` -- ALTER TABLE `mapel_guru` MODIFY `id_mapel_guru` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `mapel_kelas` -- ALTER TABLE `mapel_kelas` MODIFY `id_mapel_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `nilai` -- ALTER TABLE `nilai` MODIFY `id_nilai` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `nilai_kd` -- ALTER TABLE `nilai_kd` MODIFY `id_nilai_kd` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; -- -- AUTO_INCREMENT for table `nilai_sikap` -- ALTER TABLE `nilai_sikap` MODIFY `id_nilai_sikap` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `siswa` -- ALTER TABLE `siswa` MODIFY `id_siswa` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables) -- -- -- Ketidakleluasaan untuk tabel `kd` -- ALTER TABLE `kd` ADD CONSTRAINT `kd_ibfk_1` FOREIGN KEY (`id_mapel`) REFERENCES `mapel` (`id_mapel`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `kelas` -- ALTER TABLE `kelas` ADD CONSTRAINT `kelas_ibfk_1` FOREIGN KEY (`id_kelompok_kelas`) REFERENCES `kelompok_kelas` (`id_kelompok_kelas`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `kelas_siswa` -- ALTER TABLE `kelas_siswa` ADD CONSTRAINT `kelas_siswa_ibfk_1` FOREIGN KEY (`id_siswa`) REFERENCES `siswa` (`id_siswa`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `kelas_siswa_ibfk_2` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id_kelas`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `mapel` -- ALTER TABLE `mapel` ADD CONSTRAINT `mapel_ibfk_1` FOREIGN KEY (`id_kurikulum`) REFERENCES `kurikulum` (`id_kurikulum`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mapel_ibfk_2` FOREIGN KEY (`id_jenis_mapel`) REFERENCES `jenis_mapel` (`id_jenis_mapel`) ON DELETE SET NULL ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `mapel_guru` -- ALTER TABLE `mapel_guru` ADD CONSTRAINT `mapel_guru_ibfk_1` FOREIGN KEY (`id_mapel`) REFERENCES `mapel` (`id_mapel`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mapel_guru_ibfk_2` FOREIGN KEY (`id_guru`) REFERENCES `guru` (`id_guru`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `mapel_kelas` -- ALTER TABLE `mapel_kelas` ADD CONSTRAINT `mapel_kelas_ibfk_1` FOREIGN KEY (`id_mapel`) REFERENCES `mapel` (`id_mapel`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `mapel_kelas_ibfk_2` FOREIGN KEY (`id_kelompok_kelas`) REFERENCES `kelompok_kelas` (`id_kelompok_kelas`) ON DELETE CASCADE; -- -- Ketidakleluasaan untuk tabel `nilai` -- ALTER TABLE `nilai` ADD CONSTRAINT `nilai_ibfk_1` FOREIGN KEY (`id_mapel`) REFERENCES `mapel` (`id_mapel`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `nilai_ibfk_2` FOREIGN KEY (`id_kelas_siswa`) REFERENCES `kelas_siswa` (`id_kelas_siswa`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `nilai_kd` -- ALTER TABLE `nilai_kd` ADD CONSTRAINT `nilai_kd_ibfk_2` FOREIGN KEY (`id_kd`) REFERENCES `kd` (`id_kd`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `nilai_kd_ibfk_3` FOREIGN KEY (`id_kelas_siswa`) REFERENCES `kelas_siswa` (`id_kelas_siswa`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `nilai_sikap` -- ALTER TABLE `nilai_sikap` ADD CONSTRAINT `nilai_sikap_ibfk_1` FOREIGN KEY (`id_kelas_siswa`) REFERENCES `kelas_siswa` (`id_kelas_siswa`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Ketidakleluasaan untuk tabel `siswa` -- ALTER TABLE `siswa` ADD CONSTRAINT `siswa_ibfk_2` FOREIGN KEY (`id_guru`) REFERENCES `guru` (`id_guru`) ON DELETE SET NULL ON UPDATE CASCADE; /*!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 */;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; CREATE TABLE `direction` ( `BACKWARD` varchar(11) NOT NULL, `FORWARD` varchar(11) NOT NULL, `RIGHTT` varchar(11) NOT NULL, `LEFTT` varchar(11) NOT NULL, `STOP` varchar(11) NOT NULL, `id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; INSERT INTO `direction` (`BACKWARD`, `FORWARD`, `RIGHTT`, `LEFTT`, `STOP`, `id`) VALUES ('', 'FORWARD', '', '', '', 1), ('', '', '', 'L', '', 2), ('', 'Forward', '', '', '', 3), ('', '', '', 'Left', '', 4), ('', '', 'Right', '', '', 5), ('Backward', '', '', '', '', 6), ('', '', '', '', 'Stop', 7), ('', 'Forward', '', '', '', 8); ALTER TABLE `direction` ADD PRIMARY KEY (`id`); ALTER TABLE `direction` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; COMMIT;
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 09-07-2021 a las 23:53:48 -- Versión del servidor: 10.4.18-MariaDB -- Versión de PHP: 8.0.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `carro_ju` -- CREATE DATABASE IF NOT EXISTS `carro_ju` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; USE `carro_ju`; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `carril` -- DROP TABLE IF EXISTS `carril`; CREATE TABLE `carril` ( `numero_carril` bigint(20) NOT NULL, `placa_carro` varchar(6) NOT NULL, `numero_pista` varchar(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `carril` -- INSERT INTO `carril` (`numero_carril`, `placa_carro`, `numero_pista`) VALUES (1, 'QJL390', 'LGG'), (2, 'ESB546', 'LGG'), (3, 'IJV565', 'LGG'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `carro` -- DROP TABLE IF EXISTS `carro`; CREATE TABLE `carro` ( `placa` varchar(6) NOT NULL, `avance` bigint(20) DEFAULT NULL, `descripcion` varchar(255) DEFAULT NULL, `posicion` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `carro` -- INSERT INTO `carro` (`placa`, `avance`, `descripcion`, `posicion`) VALUES ('QJL390', 5100, 'verde', 1), ('ESB546', 3800, 'azul', 3), ('IJV565', 4100, 'azul', 2); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `conductor` -- DROP TABLE IF EXISTS `conductor`; CREATE TABLE `conductor` ( `nombre` varchar(12) NOT NULL, `no_veces_ganado` int(11) DEFAULT NULL, `placa_carro` varchar(6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `conductor` -- INSERT INTO `conductor` (`nombre`, `no_veces_ganado`, `placa_carro`) VALUES ('Juan', 1, 'QJL390'), ('Alex', 0, 'ESB546'), ('Dylann', 0, 'IJV565'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `hibernate_sequence` -- DROP TABLE IF EXISTS `hibernate_sequence`; CREATE TABLE `hibernate_sequence` ( `next_val` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `hibernate_sequence` -- INSERT INTO `hibernate_sequence` (`next_val`) VALUES (5); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `juego` -- DROP TABLE IF EXISTS `juego`; CREATE TABLE `juego` ( `numero_juego` bigint(20) NOT NULL, `id_pista` varchar(5) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `juego` -- INSERT INTO `juego` (`numero_juego`, `id_pista`) VALUES (4, 'LGG'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `juego_jugador` -- DROP TABLE IF EXISTS `juego_jugador`; CREATE TABLE `juego_jugador` ( `id_juego` bigint(20) NOT NULL, `id_jugador` varchar(12) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `juego_jugador` -- INSERT INTO `juego_jugador` (`id_juego`, `id_jugador`) VALUES (4, 'Alex'), (4, 'Dylann'), (4, 'Juan'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `jugador` -- DROP TABLE IF EXISTS `jugador`; CREATE TABLE `jugador` ( `nombre` varchar(12) NOT NULL, `turno` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `jugador` -- INSERT INTO `jugador` (`nombre`, `turno`) VALUES ('Juan', 1), ('Alex', 2), ('Dylann', 3); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pista` -- DROP TABLE IF EXISTS `pista`; CREATE TABLE `pista` ( `id` varchar(5) NOT NULL, `nombre` varchar(255) DEFAULT NULL, `tamano_pista` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `pista` -- INSERT INTO `pista` (`id`, `nombre`, `tamano_pista`) VALUES ('LGG', 'AHZ', 5); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `podio` -- DROP TABLE IF EXISTS `podio`; CREATE TABLE `podio` ( `codigo_podio` int(11) NOT NULL, `puesto` int(11) DEFAULT NULL, `nombre_jugador` varchar(12) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `podio` -- INSERT INTO `podio` (`codigo_podio`, `puesto`, `nombre_jugador`) VALUES (1, 1, 'Juan'), (1, 2, 'Dylann'), (1, 3, 'Alex'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sequence` -- DROP TABLE IF EXISTS `sequence`; CREATE TABLE `sequence` ( `next_val` bigint(20) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Volcado de datos para la tabla `sequence` -- INSERT INTO `sequence` (`next_val`) VALUES (1); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `carril` -- ALTER TABLE `carril` ADD PRIMARY KEY (`numero_carril`), ADD UNIQUE KEY `UK_jsjnf7xnn028fsqgofdcjfksc` (`placa_carro`), ADD KEY `FK7rwwf8rdwaeeohv3djw8os5ay` (`numero_pista`); -- -- Indices de la tabla `carro` -- ALTER TABLE `carro` ADD PRIMARY KEY (`placa`); -- -- Indices de la tabla `conductor` -- ALTER TABLE `conductor` ADD PRIMARY KEY (`nombre`), ADD UNIQUE KEY `UK_o74j3mqmy64wmu37bh1673r1s` (`placa_carro`); -- -- Indices de la tabla `juego` -- ALTER TABLE `juego` ADD PRIMARY KEY (`numero_juego`), ADD KEY `FKgjq8akwpuqnjs0ovqpb66g6wx` (`id_pista`); -- -- Indices de la tabla `juego_jugador` -- ALTER TABLE `juego_jugador` ADD PRIMARY KEY (`id_juego`,`id_jugador`), ADD KEY `FKs597ok1nvmvd31pqxxtdkscdi` (`id_jugador`); -- -- Indices de la tabla `jugador` -- ALTER TABLE `jugador` ADD PRIMARY KEY (`nombre`); -- -- Indices de la tabla `pista` -- ALTER TABLE `pista` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `podio` -- ALTER TABLE `podio` ADD PRIMARY KEY (`codigo_podio`,`nombre_jugador`), ADD UNIQUE KEY `UK_3encx2igcekuwj6uas4m54fr3` (`nombre_jugador`); 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 */;
UPDATE TB_USER SET NICKNAME = @NICKNAME, EMAIL = @EMAIL, UPDATE_DT = NOW() WHERE USER_NO = @USER_NO
insert into dest.schema.foo(a,b,c) select a,b,c from source.schema.bar
use MyDB; CREATE TABLE userTbl -- 회원 테이블 ( userID CHAR(8) NOT NULL PRIMARY KEY, -- 사용자아이디 name VARCHAR(10) NOT NULL, -- 이름 birthYear INT NOT NULL, -- 출생년도 addr CHAR(2) NOT NULL, -- 지역(경기,서울,경남 식으로 2글자만입력) mobile1 CHAR(3), -- 휴대폰의 국번(011, 016, 017, 018, 019, 010 등) mobile2 CHAR(8), -- 휴대폰의 나머지 전화번호(하이픈제외) height SMALLINT, -- 키 mDate DATE -- 회원 가입일 )engine=InnoDB default charset=utf8; CREATE TABLE buyTbl -- 회원 구매 테이블 ( num INT AUTO_INCREMENT NOT NULL PRIMARY KEY, -- 순번(PK) userID CHAR(8) NOT NULL, -- 아이디(FK) prodName CHAR(6) NOT NULL, -- 물품명 groupName CHAR(4) , -- 분류 price INT NOT NULL, -- 단가 amount SMALLINT NOT NULL, -- 수량 FOREIGN KEY (userID) REFERENCES userTbl(userID) )engine=InnoDB default charset=utf8; INSERT INTO userTbl VALUES('LSG', '이승기', 1987, '서울', '011', '1111111', 182, '2008-8-8'); INSERT INTO userTbl VALUES('KBS', '김범수', 1979, '경남', '011', '2222222', 173, '2012-4-4'); INSERT INTO userTbl VALUES('KKH', '김경호', 1971, '전남', '019', '3333333', 177, '2007-7-7'); INSERT INTO userTbl VALUES('JYP', '조용필', 1950, '경기', '011', '4444444', 166, '2009-4-4'); INSERT INTO userTbl VALUES('SSK', '성시경', 1979, '서울', NULL , NULL , 186, '2013-12-12'); INSERT INTO userTbl VALUES('LJB', '임재범', 1963, '서울', '016', '6666666', 182, '2009-9-9'); INSERT INTO userTbl VALUES('YJS', '윤종신', 1969, '경남', NULL , NULL , 170, '2005-5-5'); INSERT INTO userTbl VALUES('EJW', '은지원', 1972, '경북', '011', '8888888', 174, '2014-3-3'); INSERT INTO userTbl VALUES('JKW', '조관우', 1965, '경기', '018', '9999999', 172, '2010-10-10'); INSERT INTO userTbl VALUES('BBK', '바비킴', 1973, '서울', '010', '0000000', 176, '2013-5-5'); INSERT INTO buyTbl VALUES(NULL, 'KBS', '운동화', NULL , 30, 2); INSERT INTO buyTbl VALUES(NULL, 'KBS', '노트북', '전자', 1000, 1); INSERT INTO buyTbl VALUES(NULL, 'JYP', '모니터', '전자', 200, 1); INSERT INTO buyTbl VALUES(NULL, 'BBK', '모니터', '전자', 200, 5); INSERT INTO buyTbl VALUES(NULL, 'KBS', '청바지', '의류', 50, 3); INSERT INTO buyTbl VALUES(NULL, 'BBK', '메모리', '전자', 80, 10); INSERT INTO buyTbl VALUES(NULL, 'SSK', '책', '서적', 15, 5); INSERT INTO buyTbl VALUES(NULL, 'EJW', '책', '서적', 15, 2); INSERT INTO buyTbl VALUES(NULL, 'EJW', '청바지', '의류', 50, 1); INSERT INTO buyTbl VALUES(NULL, 'BBK', '운동화', NULL, 30, 2); INSERT INTO buyTbl VALUES(NULL, 'EJW', '책', '서적', 15, 1); INSERT INTO buyTbl VALUES(NULL, 'BBK', '운동화', NULL, 30, 2); select * from userTbl; select * from buyTbl; SELECT userTbl.userID, name, sum(price * amount) as '총 구매액', grade as '고객등급' FROM userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by(userID) order by sum(price * amount) desc; SELECT userTbl.userID, name, (price * amount) as '총 구매액', grade as '고객등급' FROM userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by(userID) order by sum(price * amount) desc; select userTbl.userID, name, sum(price * amount) as '총 구매액', grade as '고객등급' from userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by userID order by sum(price * amount) desc; select userTbl.userID, name, sum(price * amount) as '총 구매액', grade as '고객등급' from userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by buyTbl.userID order by sum(price * amount) desc; select * from userTbl left join buyTbl on userTbl.userID = buyTbl.userID; SELECT userID, sum(price * amount) as '구매금액' FROM buyTbl group by(userID) order by sum(price * amount) desc; alter table userTbl ADD grade varchar(5); alter table userTbl drop column grade; drop procedure if exists userG; alter database mydb character set utf8 collate utf8_general_ci; DELIMITER $$ CREATE PROCEDURE userG() BEGIN declare Perform int; declare vGrade VARCHAR(10); declare vuserID varchar(10); declare endOfRow boolean default false; DECLARE userCursor CURSOR FOR SELECT userTbl.userID, sum(price * amount) FROM userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by(userID); declare continue handler for not found set endOfRow = true; alter table userTbl ADD grade varchar(5); open userCursor; cursor_loop: LOOP FETCH userCursor INTO vuserID, Perform; if endOfRow then leave cursor_loop; end if; if Perform >= 1500 then set vGrade = '최우수고객'; else if Perform >= 1000 then set vGrade = '우수고객'; else if Perform >= 1 then set vGrade = '일반고객'; else set vGrade = '유령고객'; end if; end if; end if; update userTbl set grade = vGrade where userID = vuserID; end loop cursor_loop; select userTbl.userID, name, sum(price * amount) as '총 구매액', grade as '고객등급' from userTbl left join buyTbl on userTbl.userID = buyTbl.userID group by userID order by sum(price * amount) desc; close userCursor; END $$ DELIMITER ; call userG();
SELECT "วันที่รับบริการ", "เวลาที่รับบริการ", "วันที่จำหน่าย", "เวลาที่จำหน่าย", "HN", "VN", "AN", "ชื่อ-สกุล", "รหัสแผนก", "ชื่อแผนก", "ต้นทุนยา", "ต้นทุนเวชภัณฑ์", "ต้นทุนอื่นๆ", "ค่ายา", "ค่าเวชภัณฑ์", "Lab", "X-ray", "ทันตกรรม", "กายภาพ", "ล้างไต", "ค่าอุปกรณ์", "ค่าแพทย์", "ค่าบริการพยาบาล", "ค่าบริการโรงพยาบาล", "ค่าห้อง", "ค่าอาหาร", "เหมาจ่าย", "อื่นๆ", "รวมค่าบริการ", "ส่วนลด", "ยอดสุทธิ", tmp."รวมค่าบริการ"-tmp."ส่วนลด"-tmp."ยอดสุทธิ" "DIFF", "สิทธิเรียกเก็บทั้งหมด" FROM ( SELECT acccredit.visit_id, acccredit.visit_date "วันที่รับบริการ", acccredit.visit_time "เวลาที่รับบริการ", acccredit.financial_discharge_date "วันที่จำหน่าย", acccredit.financial_discharge_time "เวลาที่จำหน่าย", acccredit.hn "HN", acccredit.vn "VN", acccredit.an "AN", acccredit.patient_name "ชื่อ-สกุล", verify_deptid "รหัสแผนก", ordered_by_department "ชื่อแผนก", SUM(CASE WHEN account_id='01' THEN (quantity*unit_price_cost) ELSE 0 END)::FLOAT "ต้นทุนยา", SUM(CASE WHEN account_id='02' THEN (quantity*unit_price_cost) ELSE 0 END)::FLOAT "ต้นทุนเวชภัณฑ์", SUM(CASE WHEN account_id<>'01' AND account_id<>'02' THEN (quantity*unit_price_cost) ELSE 0 END)::FLOAT "ต้นทุนอื่นๆ", SUM(CASE WHEN account_id='01' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่ายา", SUM(CASE WHEN account_id='02' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าเวชภัณฑ์", SUM(CASE WHEN account_id='03' THEN acccredit.linesale ELSE 0 END)::FLOAT "Lab", SUM(CASE WHEN account_id='04' THEN acccredit.linesale ELSE 0 END)::FLOAT "X-ray", SUM(CASE WHEN account_id='05' THEN acccredit.linesale ELSE 0 END)::FLOAT "ทันตกรรม", SUM(CASE WHEN account_id='06' THEN acccredit.linesale ELSE 0 END)::FLOAT "กายภาพ", SUM(CASE WHEN account_id='07' THEN acccredit.linesale ELSE 0 END)::FLOAT "ล้างไต", SUM(CASE WHEN account_id='08' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าอุปกรณ์", SUM(CASE WHEN account_id='09' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าแพทย์", SUM(CASE WHEN account_id='10' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าบริการพยาบาล", SUM(CASE WHEN account_id='11' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าบริการโรงพยาบาล", SUM(CASE WHEN account_id='12' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าห้อง", SUM(CASE WHEN account_id='13' THEN acccredit.linesale ELSE 0 END)::FLOAT "ค่าอาหาร", SUM(CASE WHEN account_id='14' THEN acccredit.linesale ELSE 0 END)::FLOAT "เหมาจ่าย", SUM(CASE WHEN account_id='15' THEN acccredit.linesale ELSE 0 END)::FLOAT "อื่นๆ", SUM(ROUND(CAST(acccredit.linesale AS NUMERIC), 2))::FLOAT "รวมค่าบริการ", SUM(ROUND(CAST(acccredit.wlinediscount AS NUMERIC), 2))::FLOAT "ส่วนลด", SUM(ROUND(CAST(acccredit.wlinepaid AS NUMERIC), 2))::FLOAT "ยอดสุทธิ", (SELECT all_plan FROM bpk_account_debit_detail WHERE visit_id=acccredit.visit_id LIMIT 1) "สิทธิเรียกเก็บทั้งหมด" FROM bpk_account_credit_detail acccredit WHERE financial_discharge_date BETWEEN '$P!{dBeginDate}' AND '$P!{dEndDate}' AND fix_visit_type_id='1' GROUP BY visit_id, acccredit.visit_date, visit_time, acccredit.financial_discharge_date, financial_discharge_time, acccredit.hn, acccredit.vn, acccredit.an, acccredit.patient_name, verify_deptid, ordered_by_department ) tmp ORDER BY "ชื่อแผนก" COLLATE "th_TH", "วันที่รับบริการ", "เวลาที่รับบริการ", "AN"
DROP TABLE USR; Create Table USR ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT, NAME VARCHAR(100) NOT NULL, EMAIL VARCHAR(50) NOT NULL, PWDHASH VARCHAR(50) NOT NULL, PRIMARY KEY(ID), CONSTRAINT UNQ_USR_EMAIL UNIQUE(EMAIL) ); DROP TABLE CODE_SET; CREATE TABLE CODE_SET ( NAME VARCHAR(10) NOT NULL, CODE VARCHAR(10) NOT NULL, CD_DESC VARCHAR(1000) NOT NULL, USER_ID INT UNSIGNED NOT NULL, PRIMARY KEY(NAME,CODE), CONSTRAINT FK_CD_USR FOREIGN KEY(USER_ID) REFERENCES USR(ID) ); DROP TABLE DISH; Create Table DISH ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT, DISH_NM VARCHAR(10) NOT NULL, CUSN_CD VARCHAR(10) NOT NULL, USER_ID INT UNSIGNED NOT NULL, PRIMARY KEY(ID), CONSTRAINT FK_DISH_USR FOREIGN KEY(USER_ID) REFERENCES USR(ID) ); DROP TABLE MENU; Create Table MENU ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT, DT DATE NOT NULL, MEAL_CD VARCHAR(10) NOT NULL, DISH_ID INT UNSIGNED NOT NULL, USER_ID INT UNSIGNED NOT NULL, PRIMARY KEY(ID), CONSTRAINT FK_MENU_DISH FOREIGN KEY(DISH_ID) REFERENCES DISH(ID), CONSTRAINT FK_MENU_USR FOREIGN KEY(USER_ID) REFERENCES USR(ID) ); DROP TABLE RCP_ING Create Table RCP_ING ( DISH_ID INT UNSIGNED NOT NULL, ING_CD VARCHAR(10) NOT NULL , PRIMARY KEY(DISH_ID,ING_CD), CONSTRAINT FK_ING_DISH FOREIGN KEY(DISH_ID) REFERENCES DISH(ID) ); DROP TABLE RCP_STEPS; CREATE TABLE RCP_STEPS ( ID INT UNSIGNED NOT NULL AUTO_INCREMENT, DISH_ID INT UNSIGNED, STEPS VARCHAR(1000) NOT NULL, PRIMARY KEY(ID), CONSTRAINT FK_STP_DISH FOREIGN KEY(DISH_ID) REFERENCES DISH(ID) );
select w_state ,i_item_id ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date)) then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_before ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as date)) then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_after from catalog_sales left outer join catalog_returns on (catalog_sales.cs_order_number = catalog_returns.cr_order_number and catalog_sales.cs_item_sk = catalog_returns.cr_item_sk) ,warehouse ,item ,date_dim where i_current_price between 0.99 and 1.49 and item.i_item_sk = catalog_sales.cs_item_sk and catalog_sales.cs_warehouse_sk = warehouse.w_warehouse_sk and catalog_sales.cs_sold_date_sk = date_dim.d_date_sk and date_dim.d_date between (cast ('1998-04-08' as date) - interval '30' days) and (cast ('1998-04-08' as date) + interval '30' days) group by w_state ,i_item_id order by w_state ,i_item_id limit 100 ;
drop table if exists user_profile; CREATE TABLE `user_profile` ( `id` int NOT NULL, `device_id` int NOT NULL, `gender` varchar(14) NOT NULL, `age` int , `university` varchar(32) NOT NULL, `province` varchar(32) NOT NULL, `gpa` float); INSERT INTO user_profile VALUES(1,2138,'male',21,'北京大学','BeiJing',3.4); INSERT INTO user_profile VALUES(2,3214,'male',null,'复旦大学','Shanghai',4.0); INSERT INTO user_profile VALUES(3,6543,'female',20,'北京大学','BeiJing',3.2); INSERT INTO user_profile VALUES(4,2315,'female',23,'浙江大学','ZheJiang',3.6); INSERT INTO user_profile VALUES(5,5432,'male',25,'山东大学','Shandong',3.8); # mysql select device_id, gender, age, university, gpa from user_profile where university in ('北京大学', "复旦大学", "山东大学")
CREATE TABLE public.gha_commits_roles ( sha varchar(40) not null, event_id bigint not null, role varchar(120) not null, actor_id bigint, actor_login varchar(120) not null default '', actor_name varchar(160) not null default '', actor_email varchar(160) not null default '', dup_repo_id bigint not null, dup_repo_name varchar(160) not null, dup_created_at timestamp without time zone not null, primary key(sha, event_id, role) ); ALTER TABLE public.gha_commits_roles OWNER TO gha_admin; grant select on gha_commits_roles to "devstats_team"; grant select on gha_commits_roles to "ro_user"; create index commits_roles_sha_idx on gha_commits_roles(sha); create index commits_roles_event_id_idx on gha_commits_roles(event_id); create index commits_roles_role_idx on gha_commits_roles(role); create index commits_roles_actor_id_idx on gha_commits_roles(actor_id); create index commits_roles_actor_login_idx on gha_commits_roles(actor_login); create index commits_roles_actor_name_idx on gha_commits_roles(actor_name); create index commits_roles_actor_email_idx on gha_commits_roles(actor_email); create index commits_roles_dup_repo_id_idx on gha_commits_roles(dup_repo_id); create index commits_roles_dup_repo_name_idx on gha_commits_roles(dup_repo_name); create index commits_roles_dup_created_at_idx on gha_commits_roles(dup_created_at);
CREATE TABLE IF NOT EXISTS dialer ( id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, host VARCHAR(50) NOT NULL, port INT UNSIGNED NOT NULL, from_name VARCHAR(50) NOT NULL, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, hash_salt INT, access_token VARCHAR(50) NOT NULL )
DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM; INSERT INTO `users` (`id`, `name`) VALUES (1, 'Jon'), (2, 'Steve'), (3, 'Kikim'); DROP TABLE IF EXISTS `books`; CREATE TABLE IF NOT EXISTS `books` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(30) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), FOREIGN key (user_id) REFERENCES user(id) ) ENGINE=MyISAM; INSERT INTO `books` (`id`, `title`, `user_id`) VALUES (1, 'Just do it ..', 1), (2, 'The best way ...', 1), (3,'Marketing 4.0',3);
select sample_time, session_id sid, sql_id, sql_plan_hash_value, sal_plan_line_id, event, time_waited, delta_time from ash where to_char(sample_time,'yyyy-mm-dd hh24:mi')=to_char(sysdate,'yyyy-mm-dd ')||'&1' order by sample_time;
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.6.17 - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL Version: 9.3.0.4984 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET NAMES utf8mb4 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -- Dumping structure for table citygis.connections DROP TABLE IF EXISTS `connections`; CREATE TABLE IF NOT EXISTS `connections` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` datetime DEFAULT '0000-00-00 00:00:00', `value` int(11) NOT NULL DEFAULT '0', `port` varchar(200) NOT NULL DEFAULT '0', `unit_id` bigint(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Data exporting was unselected. -- Dumping structure for table citygis.events DROP TABLE IF EXISTS `events`; CREATE TABLE IF NOT EXISTS `events` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` datetime DEFAULT '0000-00-00 00:00:00', `value` int(11) NOT NULL DEFAULT '0', `port` varchar(200) NOT NULL DEFAULT '0', `unit_id` bigint(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Data exporting was unselected. -- Dumping structure for table citygis.monitoring DROP TABLE IF EXISTS `monitoring`; CREATE TABLE IF NOT EXISTS `monitoring` ( `id` int(11) NOT NULL AUTO_INCREMENT, `unit_id` bigint(20) DEFAULT NULL, `begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `type` varchar(100) NOT NULL DEFAULT '0', `min` bigint(20) NOT NULL DEFAULT '0', `max` bigint(20) NOT NULL DEFAULT '0', `sum` bigint(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Data exporting was unselected. -- Dumping structure for table citygis.positions DROP TABLE IF EXISTS `positions`; CREATE TABLE IF NOT EXISTS `positions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `unit_id` bigint(20) NOT NULL DEFAULT '0', `rdx` bigint(20) NOT NULL DEFAULT '0', `rdy` bigint(20) NOT NULL DEFAULT '0', `speed` int(11) NOT NULL DEFAULT '0', `course` int(11) NOT NULL DEFAULT '0', `numsatel` int(11) NOT NULL DEFAULT '0', `hdop` int(11) NOT NULL DEFAULT '0', `quality` varchar(50) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB 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 */;
SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `ID` BIGINT NOT NULL AUTO_INCREMENT, `USERNAME` VARCHAR(128) NOT NULL, `PASSWORD` VARCHAR(128) NOT NULL, `EMAIL` VARCHAR(128), `NAME` VARCHAR(128), `ROLE` VARCHAR(16), `STATE` INT NOT NULL, `REGISTER_DATE` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `VERSION` BIGINT NOT NULL DEFAULT 0, CONSTRAINT `PK_USER` PRIMARY KEY (`ID`), CONSTRAINT `UK_USER_USERNAME` UNIQUE KEY (`USERNAME`), CONSTRAINT `UK_USER_EMAIL` UNIQUE KEY (`EMAIL`) ) CHARACTER SET utf8 COLLATE utf8_bin engine=InnoDB; CREATE INDEX `I_USER_USERNAME` ON `user`(`USERNAME`); CREATE INDEX `I_USER_EMAIL` ON `user`(`EMAIL`); DROP TABLE IF EXISTS `story`; CREATE TABLE `story` ( `ID` BIGINT NOT NULL AUTO_INCREMENT, `TITLE` VARCHAR(256) NOT NULL, `DESCRIPTION` TEXT, `WEB_URL` TEXT NULL, `IMAGE` TEXT, `IMAGE_MINI` TEXT, `DIFFICULTY` DOUBLE NOT NULL, `BOOK_ENABLED` BOOLEAN NOT NULL, `BOOK_PRICE` DOUBLE NULL, `BOOK_DESCRIPTION` TEXT NULL, `ORDER_N` INT NOT NULL, `STATE` INT NOT NULL, `VERSION` BIGINT NOT NULL DEFAULT 0, CONSTRAINT `PK_STORY` PRIMARY KEY (`ID`) ) CHARACTER SET utf8 COLLATE utf8_bin engine=InnoDB; DROP TABLE IF EXISTS `category`; CREATE TABLE `category` ( `ID` BIGINT NOT NULL AUTO_INCREMENT, `NAME` VARCHAR(128) NOT NULL, `VERSION` BIGINT NOT NULL DEFAULT 0, CONSTRAINT `PK_CATEGORY` PRIMARY KEY (`ID`), CONSTRAINT `UK_CATEGORY` UNIQUE KEY (`NAME`) ) CHARACTER SET utf8 COLLATE utf8_bin engine=InnoDB; DROP TABLE IF EXISTS `story_category`; CREATE TABLE `story_category` ( `ID` BIGINT NOT NULL AUTO_INCREMENT, `STORY_ID` BIGINT NOT NULL, `CATEGORY_ID` BIGINT NOT NULL, `VERSION` BIGINT NOT NULL DEFAULT 0, CONSTRAINT `PK_STORY_CATEGORY` PRIMARY KEY (`ID`), CONSTRAINT `FK_STORY_CATEGORY_STORY` FOREIGN KEY (`STORY_ID`) REFERENCES `story` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `FK_STORY_CATEGORY_CATEGORY` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `category` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) CHARACTER SET utf8 COLLATE utf8_bin engine=InnoDB; SET FOREIGN_KEY_CHECKS = 1;
INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (1,1,1,1650); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (2,1,2,1670); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (3,1,3,1110); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (4,1,4,1200); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (5,1,5,1380); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (6,2,6,1415); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (7,2,1,1395); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (8,2,2,1660); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (9,2,3,1710); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (10,2,4,1720); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (11,3,5,1890); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (12,3,8,1920); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (13,3,7,1975); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (14,3,1,2000); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (15,3,2,1050); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (16,4,3,1075); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (17,4,4,1440); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (18,4,8,1410); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (19,4,6,1480); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (20,4,7,1520); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (21,5,1,1490); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (22,5,3,1720); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (23,5,4,1670); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (24,5,5,1320); INSERT INTO towary_przesuniecia(pk,fk_przesuniecia_magazynowe,fk_towary,ilość) VALUES (25,5,6,1030);
alter table cards modify column nfs_code varchar(64) not null default ''; alter table cards modify column m_code varchar(128) not null default '';
create table migration_accounts( id integer not null primary key, academic_cert_expected_date varchar(255), acca_reg_card_expected_date varchar(255), annual_family_income varchar(255), attendance_record_expected_date varchar(255), bpp_email varchar(255), bptc_number varchar(255), cab_code varchar(255), cash_on_hand varchar(255), cim_membership_number varchar(255), conditions_of_residency varchar(255), country_of_birth varchar(255), country_of_residence varchar(255), criminal_conviction varchar(255), criminal_conviction_details varchar(255), currently_in_uk_with_a_visa varchar(255), debt varchar(255), dependents_while_studying varchar(255), description varchar(255), learning_support varchar(255), document_storage_url varchar(255), are_you_a_citizen_of_the_eea varchar(255), employment_legal varchar(255), employment_non_legal varchar(255), eng_exam_date varchar(255), eng_exam_type_other varchar(255), english_lang_test_expected_date varchar(255), ever_studied_in_uk_before varchar(255), exam_result varchar(255), family_members varchar(255), fathers_occupation varchar(255), fax varchar(255), first_language varchar(255), further_education_date varchar(255), gender varchar(255), higher_education_completed varchar(255), inn_of_court varchar(255), intend_to_apply_for_student_visa varchar(255), job_type_graduation varchar(255), kin_address varchar(255), kin_city varchar(255), kin_contact_telephone varchar(255), kin_country varchar(255), kin_email varchar(255), kin_name varchar(255), kin_postcode varchar(255), kin_region varchar(255), language_skills varchar(255), language_test_type varchar(255), account_name varchar(255), loan varchar(255), middle_name varchar(255), minimum_1_Year_post_education varchar(255), monthly_expenses varchar(255), mothers_occupation varchar(255), primary_nationality varchar(255), neptune_student_id varchar(255), no_mail_hardcopy varchar(255), no_phone varchar(255), no_sms varchar(255), other_email varchar(255), account_owner varchar(255), parent_guardian_first_name varchar(255), parent_guardian_last_name varchar(255), parent_guardian_relationship varchar(255), passport_copy_expected_date varchar(255), passport_exp_date varchar(255), passport_issue_date varchar(255), passport_number varchar(255), passport_place_of_issue varchar(255), personal_email varchar(255), date_of_birth varchar(255), email varchar(255), email_opt_out varchar(255), home_phone varchar(255), lead_source varchar(255), mailing_address varchar(255), mobile varchar(255), home_address varchar(255), other_phone varchar(255), title_as_of_bus_card varchar(255), phone varchar(255), preferred_email varchar(255), preferred_first_name varchar(255), preferred_phone varchar(255), previous_lpc varchar(255), previous_surname varchar(255), previously_applied_for_visa varchar(255), previously_refused_for_visa varchar(255), record_source varchar(255), references_expected_date varchar(255), remain_in_country varchar(255), secondary_nationality varchar(255), disability varchar(255), student_id varchar(255), learning_support_details varchar(255), srn varchar(255), staying_with_relatives varchar(255), staying_with_relatives_detail varchar(255), student_cycle varchar(255), student_type varchar(255), student_visa_sponsor varchar(255), toefl_number varchar(255), account_type varchar(255), type_of_visa_intend_to_apply varchar(255), ucas_number varchar(255), uk_first_entry_date varchar(255), uk_permanent_residence_date varchar(255), visa_copy_expected_date varchar(255), visa_expiration varchar(255), visa_refusal_copy_expected_date varchar(255), visa_type varchar(255), website varchar(255), work_email varchar(255), work_phone varchar(255), x3_student_number )
SELECT Pays,AVG(kcal_pppj) as kcal_pppj_moy FROM ( SELECT Pays,Année,SUM(dispo_alim_kcal_p_j) as kcal_pppj From dispo_alim Group by Pays,Année) GROUP BY Pays ORDER BY kcal_pppj_moy LIMIT 10;
create or replace trigger too_many_core_courses before insert on degree_course for each row declare num_core_courses natural; begin select count(*) into num_core_courses from degree_course where Deg_code = :new.Deg_code and Type = 'Core'; if num_core_courses >= 6 then raise_application_error(-20001, ('Course' || :new.Deg_code || 'cannot be inserted')); end if; end; First trigger statement which can be inserted: insert into degree_course values('1','535', 'Core'); Cannot be inserted: insert into degree_course values('2','779', 'Core'); create or replace trigger no_prerequisite_course before insert on transcript for each row declare num_pre_course natural; begin select count(*) into num_pre_course from transcript, course, prerequisite where :new.Course_no = course.Course_no and :new.Course_no = prerequisite.Course and :new.Student_ID = transcript.Student_ID and transcript.Course_no = prerequisite.Prereq; if num_pre_course = 0 then raise_application_error(-20001, ('Student' || :new.Student_ID || 'cannot take class'|| :new.Course_no)); end if; end; can be inserted: insert into transcript values('123456789','699','Spring','2015',NULL); cannot be inserted: insert into transcript values('123456788','699','Spring','2015',NULL); create or replace trigger too_many_concentrations before insert on student_concentration for each row declare num_concentrations natural; begin select count(*) into num_concentrations from student_concentration, student, concentration where student.Student_ID = :new.Student_ID and concentration.Conc_code = :new.Conc_code; if num_concentrations >= 2 then raise_application_error(-20001, ('Student' || :new.Student_ID || 'cannot have more concentration')); end if; end; can be inserted: insert into student_concentration values('123456789','1'); cannot be inserted: create or replace function get_gpa(v_Student_ID in transcript.Student_ID%type) return transcript.Grade%type as GPA FLOAT; check_grade FLOAT; num_courses natural; sum_Grade FLOAT; i natural; begin select count(*) into num_courses from transcript where Student_ID = v_Student_ID; i := 1; sum_Grade := 0.0; while (i <= num_courses) LOOP select grade into check_grade from (select grade,Student_ID, rownum as rn from transcript where Student_ID=v_Student_ID) where rn=i; sum_Grade := sum_Grade + check_grade; i := i + 1; END LOOP; GPA := sum_Grade/num_courses; return (GPA); end; begin dbms_output.put_line(get_gpa(123456789)); end;
DROP PROCEDURE IF EXISTS SP_INCATEGORIA; DELIMITER $$ CREATE PROCEDURE SP_INCATEGORIA( IN pcNombre VARCHAR(45), IN pcDescripcion VARCHAR(255) ) SP:BEGIN /**/ INSERT INTO categoria_pregunta (nombre_cat,descripcion) VALUES(pcNombre, pcDescripcion); /**/ END $$ DELIMITER ; /* call SP_INCATEGORIA('categoria 1', 'Primera categoria'); */
select * from Note ORDER BY Score DESC;
/* Welcome to the SQL mini project. For this project, you will use Springboard' online SQL platform, which you can log into through the following link: https://sql.springboard.com/ Username: student Password: learn_sql@springboard The data you need is in the "country_club" database. This database contains 3 tables: i) the "Bookings" table, ii) the "Facilities" table, and iii) the "Members" table. Note that, if you need to, you can also download these tables locally. In the mini project, you'll be asked a series of questions. You can solve them using the platform, but for the final deliverable, paste the code for each solution into this script, and upload it to your GitHub. Before starting with the questions, feel free to take your time, exploring the data, and getting acquainted with the 3 tables. */ /* Q1: Some of the facilities charge a fee to members, but some do not. Please list the names of the facilities that do. */ SELECT name FROM `Facilities` WHERE membercost != '0.0' Result: name Tennis Court 1 Tennis Court 2 Massage Room 1 Massage Room 2 Squash Court /* Q2: How many facilities do not charge a fee to members? */ SELECT COUNT( * ) FROM `Facilities` WHERE membercost = '0.0' ResultL COUNT( * ) 4 /* Q3: How can you produce a list of facilities that charge a fee to members, where the fee is less than 20% of the facility's monthly maintenance cost? Return the facid, facility name, member cost, and monthly maintenance of the facilities in question. */ SELECT facid, name AS "facility name", membercost AS "member cost", monthlymaintenance AS "monthly maintenance" FROM `Facilities` WHERE membercost != '0.0' AND membercost < 0.2 * monthlymaintenance Result: "0","Tennis Court 1","5.0","200" "1","Tennis Court 2","5.0","200" "4","Massage Room 1","9.9","3000" "5","Massage Room 2","9.9","3000" "6","Squash Court","3.5","80" /* Q4: How can you retrieve the details of facilities with ID 1 and 5? Write the query without using the OR operator. */ SELECT * FROM Facilities WHERE facid IN (1,5) Result: "1","Tennis Court 2","5.0","25.0","8000","200" "5","Massage Room 2","9.9","80.0","4000","3000" /* Q5: How can you produce a list of facilities, with each labelled as 'cheap' or 'expensive', depending on if their monthly maintenance cost is more than $100? Return the name and monthly maintenance of the facilities in question. */ SELECT name, monthlymaintenance, CASE WHEN monthlymaintenance <=100 THEN 'cheap' ELSE 'expensive' END AS "cheaporexpensive" FROM Facilities Results: "Tennis Court 1","200","expensive" "Tennis Court 2","200","expensive" "Badminton Court","50","cheap" "Table Tennis","10","cheap" "Massage Room 1","3000","expensive" "Massage Room 2","3000","expensive" "Squash Court","80","cheap" "Snooker Table","15","cheap" "Pool Table","15","cheap" /* Q6: You'd like to get the first and last name of the last member(s) who signed up. Do not use the LIMIT clause for your solution. */ SELECT surname, firstname, joindate FROM `Members` WHERE joindate = ( SELECT MAX( joindate ) FROM Members ) Result: "Smith","Darren","2012-09-26 18:08:45" /* Q7: How can you produce a list of all members who have used a tennis court? Include in your output the name of the court, and the name of the member formatted as a single column. Ensure no duplicate data, and order by the member name. */ SELECT CONCAT( firstname, ' ', surname ) AS "Full name", name AS "Court Name" FROM Members INNER JOIN Bookings USING ( memid ) INNER JOIN Facilities ON Bookings.facid = Facilities.facid WHERE name LIKE 'Tennis Court%' AND memid != "0" GROUP BY CONCAT( firstname, ' ', surname ) Result: "Anne Baker","Tennis Court 1" "Burton Tracy","Tennis Court 2" "Charles Owen","Tennis Court 1" "Darren Smith","Tennis Court 2" "David Farrell","Tennis Court 1" "David Jones","Tennis Court 2" "David Pinker","Tennis Court 1" "Douglas Jones","Tennis Court 1" "Erica Crumpet","Tennis Court 1" "Florence Bader","Tennis Court 2" "Gerald Butters","Tennis Court 1" "Henrietta Rumney","Tennis Court 2" "Jack Smith","Tennis Court 1" "Janice Joplette","Tennis Court 1" "Jemima Farrell","Tennis Court 2" "Joan Coplin","Tennis Court 1" "John Hunt","Tennis Court 1" "Matthew Genting","Tennis Court 1" "Millicent Purview","Tennis Court 2" "Nancy Dare","Tennis Court 2" "Ponder Stibbons","Tennis Court 2" "Ramnaresh Sarwin","Tennis Court 2" "Tim Boothe","Tennis Court 2" "Tim Rownam","Tennis Court 2" "Timothy Baker","Tennis Court 2" "Tracy Smith","Tennis Court 1" /* Q8: How can you produce a list of bookings on the day of 2012-09-14 which will cost the member (or guest) more than $30? Remember that guests have different costs to members (the listed costs are per half-hour 'slot'), and the guest user's ID is always 0. Include in your output the name of the facility, the name of the member formatted as a single column, and the cost. Order by descending cost, and do not use any subqueries. */ SELECT Facilities.name AS "Facility name", CONCAT( firstname, ' ', surname ) AS "Full name", CASE WHEN memid = '0' THEN guestcost * slots ELSE membercost * slots END AS "Cost" FROM Bookings INNER JOIN Facilities USING ( facid ) INNER JOIN Members USING ( memid ) WHERE starttime LIKE '2012-09-14%' AND CASE WHEN memid = '0' THEN guestcost * slots ELSE membercost * slots END > 30 ORDER BY Cost DESC Result: "Massage Room 2","GUEST GUEST","320.0" "Massage Room 1","GUEST GUEST","160.0" "Massage Room 1","GUEST GUEST","160.0" "Massage Room 1","GUEST GUEST","160.0" "Tennis Court 2","GUEST GUEST","150.0" "Tennis Court 1","GUEST GUEST","75.0" "Tennis Court 1","GUEST GUEST","75.0" "Tennis Court 2","GUEST GUEST","75.0" "Squash Court","GUEST GUEST","70.0" "Massage Room 1","Jemima Farrell","39.6" "Squash Court","GUEST GUEST","35.0" "Squash Court","GUEST GUEST","35.0" /* Q9: This time, produce the same result as in Q8, but using a subquery. */ SELECT * FROM (SELECT Facilities.name AS "Facility name", CONCAT( firstname, ' ', surname ) AS "Full name", CASE WHEN memid = '0' THEN guestcost * slots ELSE membercost * slots END AS "Cost" FROM Bookings INNER JOIN Facilities USING ( facid ) INNER JOIN Members USING ( memid ) WHERE starttime LIKE '2012-09-14%' ) AS X WHERE X.Cost > 30 ORDER BY X.Cost DESC Result: "Massage Room 2","GUEST GUEST","320.0" "Massage Room 1","GUEST GUEST","160.0" "Massage Room 1","GUEST GUEST","160.0" "Massage Room 1","GUEST GUEST","160.0" "Tennis Court 2","GUEST GUEST","150.0" "Tennis Court 1","GUEST GUEST","75.0" "Tennis Court 1","GUEST GUEST","75.0" "Tennis Court 2","GUEST GUEST","75.0" "Squash Court","GUEST GUEST","70.0" "Massage Room 1","Jemima Farrell","39.6" "Squash Court","GUEST GUEST","35.0" "Squash Court","GUEST GUEST","35.0" /* Q10: Produce a list of facilities with a total revenue less than 1000. The output of facility name and total revenue, sorted by revenue. Remember that there's a different cost for guests and members! */ SELECT name, SUM( CASE WHEN memid = '0' THEN guestcost * slots ELSE membercost * slots END) AS revenue FROM Bookings INNER JOIN Facilities USING(facid) GROUP BY name HAVING SUM( CASE WHEN memid = '0' THEN guestcost * slots ELSE membercost * slots END) < 1000 ORDER BY revenue Result: "Table Tennis","180.0" "Snooker Table","240.0" "Pool Table","270.0"
/* Table: Employees +-------------+------+ | Column Name | Type | +-------------+------+ | emp_id | int | | event_day | date | | in_time | int | | out_time | int | +-------------+------+ (emp_id, event_day, in_time) is the primary key of this table. The table shows the employees' entries and exits in an office. event_day is the day at which this event happened, in_time is the minute at which the employee entered the office, and out_time is the minute at which they left the office. in_time and out_time are between 1 and 1440. It is guaranteed that no two events on the same day intersect in time, and in_time < out_time. Write an SQL query to calculate the total time in minutes spent by each employee on each day at the office. Note that within one day, an employee can enter and leave more than once. The time spent in the office for a single entry is out_time - in_time. Return the result table in any order. */ SELECT event_day AS day, emp_id, SUM(out_time - in_time) AS total_time FROM Employees GROUP BY event_day, emp_id;
-- phpMyAdmin SQL Dump -- version 2.11.9.5 -- http://www.phpmyadmin.net -- -- Host: 10.1.12.40 -- Generation Time: Sep 30, 2014 at 02:53 PM -- Server version: 5.0.83 -- PHP Version: 4.4.9 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: `db280315_nyuko` -- -- -------------------------------------------------------- -- -- Table structure for table `application_tbl` -- CREATE TABLE IF NOT EXISTS `application_tbl` ( `app_id` int(11) NOT NULL auto_increment, `app_descp` varchar(100) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(6) NOT NULL, PRIMARY KEY (`app_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; -- -- Dumping data for table `application_tbl` -- INSERT INTO `application_tbl` (`app_id`, `app_descp`, `create_date`, `delete_flag`) VALUES (1, 'Photoshop CS1', '2014-09-04 15:39:55', 0), (2, 'Photoshop CS2', '2014-09-04 15:39:55', 0), (3, 'Photoshop CS3', '2014-09-04 15:39:56', 0), (4, 'Photoshop CS4', '2014-09-04 15:39:56', 0), (5, 'Photoshop CS5', '2014-09-04 15:39:56', 0), (6, 'Photoshop CS6', '2014-09-04 15:39:56', 0), (7, 'Illustrator CS1', '2014-09-04 15:39:56', 0), (8, 'Illustrator CS2', '2014-09-04 15:39:56', 0), (9, 'Illustrator CS3', '2014-09-04 15:39:56', 0), (10, 'Illustrator CS4', '2014-09-04 15:39:56', 0), (11, 'Illustrator CS5', '2014-09-04 15:39:56', 0), (12, 'Illustrator CS6', '2014-09-04 15:39:56', 0), (13, 'InDesign CS1', '2014-09-04 15:39:56', 0), (14, 'InDesign CS2', '2014-09-04 15:39:56', 0), (15, 'InDesign CS3', '2014-09-04 15:39:56', 0), (16, 'InDesign CS4', '2014-09-04 15:39:56', 0), (17, 'InDesign CS5', '2014-09-04 15:39:56', 0), (18, 'InDesign CS6', '2014-09-04 15:39:56', 0); -- -------------------------------------------------------- -- -- Table structure for table `client_tbl` -- CREATE TABLE IF NOT EXISTS `client_tbl` ( `client_id` int(11) NOT NULL auto_increment, `company_name` varchar(50) collate utf8_unicode_ci NOT NULL, `client_user_name` varchar(50) collate utf8_unicode_ci NOT NULL, `address` tinytext collate utf8_unicode_ci NOT NULL, `created_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=38 ; -- -- Dumping data for table `client_tbl` -- INSERT INTO `client_tbl` (`client_id`, `company_name`, `client_user_name`, `address`, `created_date`, `delete_flag`) VALUES (3, '佐川印刷株式会社 東京支店', 'RUBBER SOUL', '東京都品川区南品川5-2-10 佐川印刷東京ビル', '2014-09-18 13:32:07', 0), (4, '佐川印刷株式会社 横浜支店', 'RUBBER SOUL', '神奈川県横浜市神奈川区反町2丁目14番地2', '2014-09-18 13:32:55', 0), (5, '佐川印刷株式会社 大阪支店', 'RUBBER SOUL', '大阪市西区北堀江2丁目2番18号 佐川印刷大阪ビル2F', '2014-09-18 13:33:52', 0), (6, '佐川印刷株式会社 京都支店', 'RUBBER SOUL', '京都府向日市森本町戌亥5番地の3', '2014-09-18 13:35:42', 0), (7, '佐川印刷株式会社 北関東支店', 'RUBBER SOUL', '埼玉県さいたま市南区白幡4-12-19', '2014-09-18 13:36:30', 0), (8, '株式会社シップス', 'RUBBER SOUL', '東京都中央区銀座1-20-15', '2014-09-18 13:37:24', 0), (9, '株式会社セン グラフィックアーツ', 'RUBBER SOUL', '東京都文京区水道1‐4‐10', '2014-09-18 13:40:42', 0), (10, 'ダイオープリンティング株式会社', 'RUBBER SOUL', '東京都豊島区北大塚 1-13-4 オーク大塚ビル', '2014-09-18 13:41:53', 0), (11, '不二印刷株式会社', 'RUBBER SOUL', '大阪市北区南森町1-2-28', '2014-09-18 13:43:13', 0), (12, '株式会社サイバーネット', 'RUBBER SOUL', '東京都豊島区東池袋3-22-7 CN ビル ', '2014-09-18 13:44:16', 0), (13, 'JTB印刷株式会社', 'RUBBER SOUL', '東京都品川区南品川5丁目2-10', '2014-09-18 13:45:29', 0), (14, '富士ゼロックスサービスリンク株式会社', 'RUBBER SOUL', '東京都港区芝5-34-6 新田町ビル10階', '2014-09-18 13:46:29', 0), (15, '富士ゼロックスサービスリンク株式会社', 'RUBBER SOUL', 'Tokyo', '2014-09-18 13:47:44', 0), (16, '株式会社ガット', 'RUBBER SOUL', 'Tokyo', '2014-09-18 13:48:14', 0), (17, '竹田印刷株式会社', 'RUBBER SOUL', '東京都北区上中里二丁目9番1号', '2014-09-18 13:49:07', 0), (18, 'SGS Associates株式会社', 'RUBBER SOUL', '東京都千代田区外神田2-18-21 楽器会館601', '2014-09-18 13:50:04', 0), (19, '株式会社デジタルプラネッツ', 'RUBBER SOUL', '東京都中央区新富1丁目14番1号 いちご八丁堀ビル 6F', '2014-09-18 13:52:11', 0), (20, '株式会社帆風', 'RUBBER SOUL', '東京都新宿区下宮比町2-29', '2014-09-18 13:53:31', 0), (21, 'トロア企画株式会社', 'RUBBER SOUL', '東京都千代田区神田神保町1-27 渡辺ビル3F', '2014-09-18 13:54:33', 0), (22, '株式会社新星コーポレーション', 'RUBBER SOUL', '東京都練馬区高野台2丁目16番17号', '2014-09-18 13:56:25', 0), (23, '㈱さら', 'RUBBER SOUL', 'tokyo', '2014-09-18 13:57:02', 1), (24, '株式会社さら', 'RUBBER SOUL', 'tokyo', '2014-09-18 13:57:17', 0), (25, '株式会社ADKアーツ', 'RUBBER SOUL', '東京都港区虎ノ門一丁目10番5号\r\n日土地虎ノ門ビル', '2014-09-18 13:58:11', 0), (26, '株式会社V.C.C.', 'ATU', '大阪市北区同心1丁目6番27号', '2014-09-18 13:59:26', 0), (27, '株式会社mix', 'ATU', 'Tokyo', '2014-09-18 14:00:46', 0), (28, '株式会社プリマリール', 'ATU', '東京都新宿区下宮比町2-29 \r\n飯田橋NKビル6F (', '2014-09-18 14:02:05', 0), (29, 'アルトラエンタテインメント株式会社', 'ATU', 'Tokyo-meguro', '2014-09-18 14:05:54', 0), (30, '㈱目録舎', 'ATU', 'Tokyo', '2014-09-18 14:07:25', 1), (31, '株式会社目録舎', 'ATU', 'Tokyo', '2014-09-18 14:08:08', 0), (32, '株式会社ラバーソウル', 'RUBBER SOUL', 'Tokyo', '2014-09-18 14:09:00', 0), (33, 'Michele', 'Michele', 'vietnam', '2014-09-19 11:36:09', 1), (34, 'Michele', 'ATU', 'Vietnam', '2014-09-19 11:36:55', 0), (35, '蘇州ラバーソウル', 'RUBBER SOUL', 'Suzhou', '2014-09-19 11:37:26', 0), (36, 'ラバーソウル ミャンマー', 'RUBBER SOUL', 'myanmmer', '2014-09-19 11:38:13', 0), (37, '株式会社バドインターナショナル', 'RUBBERSOUL', '東京都渋谷区恵比寿4丁目20番3号 恵比寿ガーデンプレイスタワー17階', '2014-09-30 12:47:24', 0); -- -------------------------------------------------------- -- -- Table structure for table `order_tbl` -- CREATE TABLE IF NOT EXISTS `order_tbl` ( `order_id` int(11) NOT NULL auto_increment, `order_uid` varchar(9) collate utf8_unicode_ci NOT NULL, `client_id` int(11) NOT NULL COMMENT 'fk client_tbl', `address` tinytext collate utf8_unicode_ci NOT NULL, `responsible_person` varchar(50) collate utf8_unicode_ci NOT NULL, `order_person` varchar(100) collate utf8_unicode_ci NOT NULL, `client_person` varchar(30) collate utf8_unicode_ci NOT NULL, `order_dept` varchar(100) collate utf8_unicode_ci NOT NULL, `order_date` datetime NOT NULL, `receipt_date` datetime NOT NULL COMMENT 'hashuu yotei', `product_name` varchar(50) character set utf8 NOT NULL, `client_price` int(11) NOT NULL COMMENT 'juchu kingaku', `order_price` int(11) NOT NULL COMMENT 'hacchu kingaku', `company_sell_price` int(11) NOT NULL, `margin_price` int(11) NOT NULL, `os_id` int(11) NOT NULL COMMENT 'fk os_tbl', `layout` varchar(30) character set utf8 NOT NULL, `text_size` int(11) NOT NULL, `format` varchar(255) collate utf8_unicode_ci NOT NULL, `divs` varchar(255) collate utf8_unicode_ci NOT NULL, `display_data` smallint(2) NOT NULL COMMENT '1:yes, 2:no', `display_data_qty` int(11) NOT NULL, `ad` varchar(255) collate utf8_unicode_ci NOT NULL, `comment` tinytext character set utf8 NOT NULL, `start_time` datetime NOT NULL, `end_time` datetime NOT NULL, `delivery_date` datetime NOT NULL, `status_id` int(11) NOT NULL COMMENT 'fk status_tbl', `order_type` smallint(2) NOT NULL COMMENT '1:hacchu, 2:juchu', `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`order_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=25 ; -- -- Dumping data for table `order_tbl` -- INSERT INTO `order_tbl` (`order_id`, `order_uid`, `client_id`, `address`, `responsible_person`, `order_person`, `client_person`, `order_dept`, `order_date`, `receipt_date`, `product_name`, `client_price`, `order_price`, `company_sell_price`, `margin_price`, `os_id`, `layout`, `text_size`, `format`, `divs`, `display_data`, `display_data_qty`, `ad`, `comment`, `start_time`, `end_time`, `delivery_date`, `status_id`, `order_type`, `create_date`, `delete_flag`) VALUES (1, 'ORDAC63B8', 1, 'Irifune', 'RubberSoulC', 'RubberSoulC', 'rubbersoul', 'RS入船C', '2014-09-05 13:54:36', '2014-09-05 06:54:00', 'DTPC', 0, 90000, 10000, 200, 1, '5', 7, '5', '8', 0, 0, '4', 'Comments is the comments.', '2014-09-12 00:00:00', '2014-09-23 02:00:00', '2014-09-12 03:00:00', 12, 1, '2014-09-05 13:54:36', 0), (2, 'ORDCDB104', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-09-05 14:31:52', '2014-09-05 06:54:00', 'DTP', 0, 5000, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 11, 1, '2014-09-05 14:31:52', 0), (3, 'ORDC8BEC6', 0, 'Irifunessssss', 'RubberSoul', '', 'rubbersoul', 'RS入船', '2014-09-05 14:41:31', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-05 14:41:31', 0), (4, 'ORDF1BBAC', 0, 'Irifune343', 'RubberSoul', '', 'rubbersoul', 'RS入船', '2014-09-09 14:17:08', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:17:08', 0), (5, 'ORDF03959', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-11-09 14:19:07', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:19:07', 0), (6, 'ORD7122EE', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-01-09 14:21:02', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:21:02', 0), (7, 'ORDE7E9F2', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-12-09 14:23:34', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:23:34', 0), (8, 'ORDCC7BE7', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-11-09 14:25:39', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:25:39', 0), (9, 'ORD7E79E5', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-12-09 14:27:17', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:27:17', 0), (10, 'ORDF8ADA9', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-11-09 14:28:47', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:28:47', 0), (11, 'ORDCDD8DE', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-10-09 14:30:21', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:30:21', 0), (12, 'ORDD42050', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-10-09 14:31:48', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:31:48', 0), (13, 'ORD337761', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-12-09 14:46:43', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:46:43', 0), (14, 'ORDCEB829', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-10-09 14:50:59', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:50:59', 0), (15, 'ORD3819F3', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-11-09 14:53:04', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:53:04', 0), (16, 'ORDA65A35', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-12-09 14:55:05', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:55:05', 0), (17, 'ORDA657EC', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-01-09 14:56:28', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 14:56:28', 0), (18, 'ORDBDB124', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-01-09 14:59:16', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-09 14:59:16', 0), (19, 'ORD5428F3', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-02-09 15:00:02', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 1, '2014-09-09 15:00:02', 0), (20, 'ORDFEE9E0', 1, 'Irifune', 'RubberSoul', 'RubberSoul', 'rubbersoul', 'RS入船', '2014-09-11 17:41:35', '2014-09-05 06:54:00', 'DTP', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', 'Comments', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1, 2, '2014-09-11 17:41:35', 0), (21, 'ORDD0D9F5', 3, '東京都品川区南品川5-2-10 佐川印刷東京ビル', '住友準之介', '', 'rubbersoul', '営業部', '2014-09-19 17:21:34', '2014-09-19 17:19:00', 'DB登録', 1500, 0, 0, 0, 1, '0', 0, '0', '0', 1, 5, '0', '', '2014-09-19 17:19:00', '2014-09-30 18:30:00', '2014-09-30 19:00:00', 3, 2, '2014-09-19 17:21:34', 0), (22, 'ORD55FD74', 1, '', '', '', 'rubbersoul', '', '2014-09-25 10:02:14', '2014-09-25 10:00:00', '', 0, 0, 0, 0, 1, '0', 0, '0', '0', 1, 0, '0', '', '2014-09-25 10:00:00', '2014-09-30 00:00:00', '2014-10-01 00:00:00', 1, 1, '2014-09-25 10:02:14', 0), (23, 'ORDD3F5D9', 3, '', 'cli_user', 'test', 'rubbersoul', '', '2014-09-25 11:37:58', '2014-09-25 11:37:00', 'dtp', 0, 0, 0, 0, 12, '0', 0, '0', '0', 1, 0, '0', '', '2014-09-25 11:37:00', '2014-09-30 00:00:00', '2014-10-01 00:00:00', 1, 1, '2014-09-25 11:37:58', 0), (24, 'ORD870233', 3, '', '住友準之介', '', '平野係長', '', '2014-09-26 18:31:14', '2014-09-26 13:30:00', 'JTB', 150000, 0, 0, 0, 1, '1', 1, '0', '0', 1, 0, '0', '', '2014-09-26 13:30:00', '2014-10-17 02:00:00', '2014-09-17 10:30:00', 1, 2, '2014-09-26 18:31:14', 0); -- -------------------------------------------------------- -- -- Table structure for table `ord_app_tbl` -- CREATE TABLE IF NOT EXISTS `ord_app_tbl` ( `order_id` int(11) NOT NULL, `app_id` int(11) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(6) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `ord_app_tbl` -- INSERT INTO `ord_app_tbl` (`order_id`, `app_id`, `create_date`, `delete_flag`) VALUES (5, 6, '2014-09-09 14:19:11', 0), (5, 6, '2014-09-09 14:19:11', 0), (5, 6, '2014-09-09 14:19:11', 0), (6, 14, '2014-09-09 14:21:02', 0), (6, 14, '2014-09-09 14:21:02', 0), (6, 14, '2014-09-09 14:21:02', 0), (7, 12, '2014-09-09 14:23:34', 0), (7, 12, '2014-09-09 14:23:34', 0), (7, 12, '2014-09-09 14:23:34', 0), (8, 18, '2014-09-09 14:25:43', 0), (8, 18, '2014-09-09 14:25:43', 0), (8, 18, '2014-09-09 14:25:43', 0), (9, 1, '2014-09-09 14:27:19', 0), (9, 1, '2014-09-09 14:27:19', 0), (9, 1, '2014-09-09 14:27:19', 0), (10, 2, '2014-09-09 14:28:47', 0), (10, 2, '2014-09-09 14:28:47', 0), (10, 2, '2014-09-09 14:28:47', 0), (11, 3, '2014-09-09 14:30:22', 0), (11, 3, '2014-09-09 14:30:22', 0), (11, 3, '2014-09-09 14:30:22', 0), (12, 2, '2014-09-09 14:31:49', 0), (12, 2, '2014-09-09 14:31:49', 0), (12, 2, '2014-09-09 14:31:50', 0), (13, 2, '2014-09-09 14:46:44', 0), (13, 2, '2014-09-09 14:46:44', 0), (13, 3, '2014-09-09 14:46:44', 0), (14, 2, '2014-09-09 14:51:00', 0), (14, 1, '2014-09-09 14:51:00', 0), (14, 4, '2014-09-09 14:51:00', 0), (15, 1, '2014-09-09 14:53:04', 0), (15, 1, '2014-09-09 14:53:04', 0), (15, 1, '2014-09-09 14:53:05', 0), (16, 2, '2014-09-09 14:55:06', 0), (16, 3, '2014-09-09 14:55:06', 0), (16, 4, '2014-09-09 14:55:06', 0), (17, 5, '2014-09-09 14:56:30', 0), (17, 2, '2014-09-09 14:56:30', 0), (17, 2, '2014-09-09 14:56:32', 0), (18, 1, '2014-09-09 14:59:16', 0), (18, 1, '2014-09-09 14:59:16', 0), (18, 1, '2014-09-09 14:59:16', 0), (19, 2, '2014-09-09 15:00:02', 0), (19, 3, '2014-09-09 15:00:02', 0), (19, 3, '2014-09-09 15:00:02', 0), (1, 2, '2014-09-12 18:11:56', 0), (1, 6, '2014-09-12 18:11:56', 0), (1, 1, '2014-09-12 18:11:56', 0), (3, 7, '2014-09-18 16:33:10', 0), (3, 2, '2014-09-18 16:33:10', 0), (4, 5, '2014-09-18 16:36:08', 0), (4, 5, '2014-09-18 16:36:08', 0), (4, 5, '2014-09-18 16:36:08', 0), (21, 6, '2014-09-19 17:22:19', 0), (21, 18, '2014-09-19 17:22:19', 0), (21, 12, '2014-09-19 17:22:19', 0), (23, 2, '2014-09-25 11:37:58', 0), (24, 6, '2014-09-26 18:31:14', 0), (24, 9, '2014-09-26 18:31:14', 0), (24, 18, '2014-09-26 18:31:14', 0); -- -------------------------------------------------------- -- -- Table structure for table `ord_rf_tbl` -- CREATE TABLE IF NOT EXISTS `ord_rf_tbl` ( `order_id` int(11) NOT NULL, `rf_id` int(11) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `ord_rf_tbl` -- INSERT INTO `ord_rf_tbl` (`order_id`, `rf_id`, `create_date`, `delete_flag`) VALUES (5, 10, '2014-09-09 14:19:08', 0), (5, 10, '2014-09-09 14:19:09', 0), (5, 10, '2014-09-09 14:19:09', 0), (6, 5, '2014-09-09 14:21:02', 0), (6, 5, '2014-09-09 14:21:02', 0), (6, 5, '2014-09-09 14:21:02', 0), (7, 3, '2014-09-09 14:23:34', 0), (7, 3, '2014-09-09 14:23:34', 0), (7, 3, '2014-09-09 14:23:34', 0), (8, 2, '2014-09-09 14:25:40', 0), (8, 2, '2014-09-09 14:25:41', 0), (8, 2, '2014-09-09 14:25:42', 0), (9, 1, '2014-09-09 14:27:18', 0), (9, 1, '2014-09-09 14:27:18', 0), (9, 1, '2014-09-09 14:27:18', 0), (10, 4, '2014-09-09 14:28:47', 0), (10, 4, '2014-09-09 14:28:47', 0), (10, 4, '2014-09-09 14:28:47', 0), (11, 6, '2014-09-09 14:30:22', 0), (11, 6, '2014-09-09 14:30:22', 0), (11, 6, '2014-09-09 14:30:22', 0), (12, 7, '2014-09-09 14:31:48', 0), (12, 6, '2014-09-09 14:31:49', 0), (12, 1, '2014-09-09 14:31:49', 0), (13, 1, '2014-09-09 14:46:44', 0), (13, 1, '2014-09-09 14:46:44', 0), (13, 1, '2014-09-09 14:46:44', 0), (14, 1, '2014-09-09 14:50:59', 0), (14, 1, '2014-09-09 14:51:00', 0), (14, 1, '2014-09-09 14:51:00', 0), (15, 1, '2014-09-09 14:53:04', 0), (15, 3, '2014-09-09 14:53:04', 0), (15, 3, '2014-09-09 14:53:04', 0), (16, 5, '2014-09-09 14:55:06', 0), (16, 3, '2014-09-09 14:55:06', 0), (16, 3, '2014-09-09 14:55:06', 0), (17, 3, '2014-09-09 14:56:29', 0), (17, 4, '2014-09-09 14:56:29', 0), (17, 1, '2014-09-09 14:56:29', 0), (18, 3, '2014-09-09 14:59:16', 0), (18, 2, '2014-09-09 14:59:16', 0), (18, 2, '2014-09-09 14:59:16', 0), (19, 1, '2014-09-09 15:00:02', 0), (19, 2, '2014-09-09 15:00:02', 0), (19, 3, '2014-09-09 15:00:02', 0), (1, 7, '2014-09-12 18:11:55', 0), (1, 1, '2014-09-12 18:11:55', 0), (3, 2, '2014-09-18 16:33:10', 0), (3, 5, '2014-09-18 16:33:10', 0), (4, 1, '2014-09-18 16:36:08', 0), (4, 1, '2014-09-18 16:36:08', 0), (4, 1, '2014-09-18 16:36:08', 0), (21, 3, '2014-09-19 17:22:19', 0), (23, 2, '2014-09-25 11:37:58', 0), (23, 5, '2014-09-25 11:37:58', 0), (23, 2, '2014-09-25 11:37:58', 0), (24, 3, '2014-09-26 18:31:14', 0); -- -------------------------------------------------------- -- -- Table structure for table `os_tbl` -- CREATE TABLE IF NOT EXISTS `os_tbl` ( `os_id` int(11) NOT NULL auto_increment, `os_descp` varchar(100) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`os_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -- Dumping data for table `os_tbl` -- INSERT INTO `os_tbl` (`os_id`, `os_descp`, `create_date`, `delete_flag`) VALUES (1, 'Macintosh OS X 10.0', '2014-09-04 15:33:41', 0), (2, 'Macintosh OS X 10.1', '2014-09-04 15:33:41', 0), (3, 'Macintosh OS X 10.2', '2014-09-04 15:33:41', 0), (4, 'Macintosh OS X 10.3', '2014-09-04 15:33:41', 0), (5, 'Macintosh X 10.4', '2014-09-04 15:33:42', 0), (6, 'Macintosh X 10.5', '2014-09-04 15:33:42', 0), (7, 'Macintosh X 10.6', '2014-09-04 15:33:42', 0), (8, 'Macintosh X 10.7', '2014-09-04 15:33:42', 0), (9, 'Macintosh X 10.8', '2014-09-04 15:33:42', 0), (10, 'Macintosh X 10.9', '2014-09-04 15:33:42', 0), (11, 'Macintosh X 10.10', '2014-09-04 15:33:42', 0), (12, 'Windows OS 7', '2014-09-19 17:06:22', 0), (13, 'Windows OS 8', '2014-09-19 17:06:51', 0); -- -------------------------------------------------------- -- -- Table structure for table `receiptfacts_tbl` -- CREATE TABLE IF NOT EXISTS `receiptfacts_tbl` ( `rf_id` int(11) NOT NULL auto_increment, `rf_descp` varchar(200) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`rf_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ; -- -- Dumping data for table `receiptfacts_tbl` -- INSERT INTO `receiptfacts_tbl` (`rf_id`, `rf_descp`, `create_date`, `delete_flag`) VALUES (1, '統一名刺', '2014-09-04 15:30:49', 0), (2, '統一名刺(両面)', '2014-09-04 15:30:49', 0), (3, 'DTP新規 コーディング', '2014-09-04 15:30:49', 0), (4, '編集', '2014-09-04 15:30:49', 0), (5, 'トレース', '2014-09-04 15:30:49', 0), (6, '切り抜き', '2014-09-04 15:30:49', 0), (7, '色修正マスク', '2014-09-04 15:30:49', 0), (8, 'WEB画面作成', '2014-09-04 15:30:49', 0), (9, '文字入力', '2014-09-04 15:30:49', 0), (10, 'マスキング', '2014-09-04 15:30:50', 0), (11, 'その他', '2014-09-04 15:30:50', 0), (13, 'DTPコーディング 修正', '2014-09-26 18:32:51', 0); -- -------------------------------------------------------- -- -- Table structure for table `status_tbl` -- CREATE TABLE IF NOT EXISTS `status_tbl` ( `sta_id` int(11) NOT NULL auto_increment, `sta_descp` varchar(100) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`sta_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ; -- -- Dumping data for table `status_tbl` -- INSERT INTO `status_tbl` (`sta_id`, `sta_descp`, `create_date`, `delete_flag`) VALUES (1, '予定', '2014-09-04 15:49:33', 0), (2, '入稿', '2014-09-04 15:49:33', 0), (3, '初校出し', '2014-09-04 15:49:33', 0), (4, '再校', '2014-09-04 15:49:33', 0), (5, '再校出し', '2014-09-04 15:49:33', 0), (6, '三校', '2014-09-04 15:49:33', 0), (7, '三校出し', '2014-09-04 15:49:33', 0), (8, '四校', '2014-09-04 15:49:33', 0), (9, '四校出し', '2014-09-04 15:49:33', 0), (10, '五校', '2014-09-04 15:49:33', 0), (11, '五校出し', '2014-09-04 15:49:33', 0), (12, '校了', '2014-09-04 15:49:33', 0); -- -------------------------------------------------------- -- -- Table structure for table `user_tbl` -- CREATE TABLE IF NOT EXISTS `user_tbl` ( `id` int(11) NOT NULL auto_increment, `user_id` varchar(10) collate utf8_unicode_ci NOT NULL, `user_name` varchar(50) collate utf8_unicode_ci NOT NULL, `department_name` varchar(20) collate utf8_unicode_ci NOT NULL, `email` varchar(50) collate utf8_unicode_ci NOT NULL, `password` varchar(128) collate utf8_unicode_ci NOT NULL, `salt` varchar(128) collate utf8_unicode_ci NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(6) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; -- -- Dumping data for table `user_tbl` -- INSERT INTO `user_tbl` (`id`, `user_id`, `user_name`, `department_name`, `email`, `password`, `salt`, `create_date`, `delete_flag`) VALUES (4, 'RUBBERSOUL', 'zV2REmWa', '', 'j.sumitomo@rubbersoul.co.jp', '9e79bcceac857a02d1542f3696cb2a7061a9adcc7ed67d588388ce235c611523cb5a920fb1ec79dd86362ca3ddadbeabdd3c426f8e29e5563cad9cfd79a5ea4e', '31bca02094eb78126a517b206a88c73cfa9ec6f704c7030d18212cace820f025f00bf0ea68dbf3f3a5436ca63b53bf7bf80ad8d5de7d8359d0b7fed9dbc3ab99', '2014-09-19 17:15:55', 0), (6, 'master', 'master', 'master', 'master@gmail.com', 'ed629a2611daf5101f655279699bfccaa0bf6dda29e2ed3f6496a9dc7846d05b6642aab4ac18c97a1bc5b9ca3a570112621bff71c512de0028492434d12008ba', '3c9ad55147a7144f6067327c3b82ea70e7c5426add9ceea4d07dc2902239bf9e049b88625eb65d014a7718f79354608cab0921782c643f0208983fffa3582e40', '2014-09-30 14:50:49', 0); -- -------------------------------------------------------- -- -- Table structure for table `year_tbl` -- CREATE TABLE IF NOT EXISTS `year_tbl` ( `year_id` int(11) NOT NULL auto_increment, `year_start` int(4) NOT NULL, `year_end` int(4) NOT NULL, `create_date` datetime NOT NULL, `delete_flag` smallint(2) NOT NULL, PRIMARY KEY (`year_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -- Dumping data for table `year_tbl` -- INSERT INTO `year_tbl` (`year_id`, `year_start`, `year_end`, `create_date`, `delete_flag`) VALUES (1, 1990, 2030, '2014-09-30 14:13:05', 0);
CREATE PROC Director_InsertOrEdit @DirectorId int, @FirstName varchar(50), @LastName varchar(50), @Nationality varchar(255), @Birth int AS BEGIN IF(@DirectorId = 0) BEGIN INSERT INTO Directors(FirstName,LastName,Nationality,Birth) VALUES(@FirstName,@LastName,@Nationality,@Birth) END; ELSE BEGIN UPDATE Directors SET FirstName = @FirstName, LastName = @LastName, Nationality =@Nationality, Birth = @Birth WHERE DirectorId = @DirectorId END END
-- -------------------------------------------------------- -- Servidor: mysql.asgardprint.com.br -- Versão do servidor: 5.6.27-log - Source distribution -- OS do Servidor: Linux -- HeidiSQL Versão: 9.3.0.4984 -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 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' */; -- Copiando estrutura do banco de dados para asgardprint01 DROP DATABASE IF EXISTS `asgardprint01`; CREATE DATABASE IF NOT EXISTS `asgardprint01` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `asgardprint01`; -- Copiando estrutura para tabela asgardprint01.emprestimo DROP TABLE IF EXISTS `emprestimo`; CREATE TABLE IF NOT EXISTS `emprestimo` ( `emprestimo_id` int(11) NOT NULL AUTO_INCREMENT, `obra_id` int(11) DEFAULT NULL, `local_emprestimo_id` int(11) DEFAULT NULL, `emprestimo_sysdata` datetime DEFAULT CURRENT_TIMESTAMP, `emprestimo_locatario` varchar(75) DEFAULT NULL, `emprestimo_data_saida` date DEFAULT NULL, `emprestimo_previsao_devolucao` date DEFAULT NULL, `emprestimo_data_devolucao` date DEFAULT NULL, PRIMARY KEY (`emprestimo_id`), KEY `obra_id_local_emprestimo_id` (`obra_id`,`local_emprestimo_id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; -- Copiando dados para a tabela asgardprint01.emprestimo: ~1 rows (aproximadamente) DELETE FROM `emprestimo`; /*!40000 ALTER TABLE `emprestimo` DISABLE KEYS */; INSERT INTO `emprestimo` (`emprestimo_id`, `obra_id`, `local_emprestimo_id`, `emprestimo_sysdata`, `emprestimo_locatario`, `emprestimo_data_saida`, `emprestimo_previsao_devolucao`, `emprestimo_data_devolucao`) VALUES (1, 1, 1, '2015-10-25 18:47:57', 'Sr. Fatec', '2015-10-30', '2015-11-30', '0000-00-00'), (3, 1, 1, '2015-10-25 18:55:11', 'Sr. Fatec', '2015-10-25', '2015-10-25', '2015-10-25'); /*!40000 ALTER TABLE `emprestimo` ENABLE KEYS */; -- Copiando estrutura para tabela asgardprint01.ingresso DROP TABLE IF EXISTS `ingresso`; CREATE TABLE IF NOT EXISTS `ingresso` ( `ingresso_id` int(11) NOT NULL, `ingresso_obra_id` int(11) NOT NULL, `ingresso_obra_nome` varchar(75) NOT NULL, `ingresso_obra_valor` varchar(11) NOT NULL, `ingresso_desconto` varchar(11) NOT NULL, `ingresso_pagar_valor` double(11,2) NOT NULL, `ingresso_meiaentrada` tinyint(1) NOT NULL, `ingresso_gratuito` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Copiando dados para a tabela asgardprint01.ingresso: ~0 rows (aproximadamente) DELETE FROM `ingresso`; /*!40000 ALTER TABLE `ingresso` DISABLE KEYS */; /*!40000 ALTER TABLE `ingresso` ENABLE KEYS */; -- Copiando estrutura para tabela asgardprint01.local_emprestimo DROP TABLE IF EXISTS `local_emprestimo`; CREATE TABLE IF NOT EXISTS `local_emprestimo` ( `local_emprestimo_id` int(11) NOT NULL AUTO_INCREMENT, `local_emprestimo_sysdata` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `local_emprestimo_nome` varchar(75) NOT NULL, `local_emprestimo_email` varchar(75) NOT NULL, `local_emprestimo_telefone` varchar(40) NOT NULL, `local_emprestimo_responsavel` varchar(75) NOT NULL, `local_emprestimo_cep` varchar(9) NOT NULL, `local_emprestimo_tipo_logradouro` varchar(15) NOT NULL DEFAULT 'RUA', `local_emprestimo_logradouro` varchar(75) NOT NULL, `local_emprestimo_numero` varchar(5) NOT NULL, `local_emprestimo_complemento` varchar(40) NOT NULL, `local_emprestimo_bairro` varchar(50) NOT NULL, `local_emprestimo_cidade` varchar(35) NOT NULL DEFAULT 'São Paulo', `local_emprestimo_uf` char(2) NOT NULL DEFAULT 'SP', `local_emprestimo_ativo` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`local_emprestimo_id`) ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1; -- Copiando dados para a tabela asgardprint01.local_emprestimo: ~12 rows (aproximadamente) DELETE FROM `local_emprestimo`; /*!40000 ALTER TABLE `local_emprestimo` DISABLE KEYS */; INSERT INTO `local_emprestimo` (`local_emprestimo_id`, `local_emprestimo_sysdata`, `local_emprestimo_nome`, `local_emprestimo_email`, `local_emprestimo_telefone`, `local_emprestimo_responsavel`, `local_emprestimo_cep`, `local_emprestimo_tipo_logradouro`, `local_emprestimo_logradouro`, `local_emprestimo_numero`, `local_emprestimo_complemento`, `local_emprestimo_bairro`, `local_emprestimo_cidade`, `local_emprestimo_uf`, `local_emprestimo_ativo`) VALUES (5, '2015-10-25 16:57:05', 'FATEC Zona Leste', 'teste@fatec.com.br', 'FATEC Zona Leste', 'Sr. Fatec', '03030-100', 'Avenida', 'Aguia de Haia', '', '', 'Arthur Alvim', 'São Paulo', 'SP', 1), (6, '2015-10-25 17:00:11', 'FATEC Zona Sul', 'teste@fatec.com.br', '(11) 99999-9999', 'Sr. Fatec', '03030-100', 'Avenida', 'Aguia de Haia', '', '', 'Arthur Alvim', 'São Paulo', 'SP', 1), (8, '2015-10-26 23:44:17', 'Fatex Legal 2', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (9, '2015-10-26 23:44:17', 'Fatec Zona', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (10, '2015-10-26 23:44:17', 'Fatec Especial', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Rua', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (11, '2015-10-26 23:44:17', 'Fatec ADS', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (12, '2015-10-26 23:44:17', 'FateX 10', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (13, '2015-10-26 23:44:17', 'FateX 15', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (15, '2015-10-26 23:59:43', '15000 Fatec Local', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (16, '2015-10-26 23:44:17', 'Fatec ADS', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (17, '2015-10-26 23:59:43', '77000 Fatec Local', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (18, '2015-10-26 23:59:43', '1131000 Fatec Local', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (19, '2015-10-26 23:59:43', '1131 Fatec Local', 'fatter@fatec.com', '(99) 9999-99999', 'Cyrax', '11101-001', 'Avenida', 'dos fatecanos', '919', 'Casa', 'Jardim Estudantil', 'São Paulo', 'SP', 1), (20, '2015-10-29 01:09:30', 'Local de Emprestimo do Rafael', 'rafael@fatec.com.br', '(11) 9191-91919', 'Rafael', '03030-303', 'Avenida', 'do Oratório', '9999a', 'Casa', 'Jardim dos Formulários', 'São Paulo', 'SP', 1); /*!40000 ALTER TABLE `local_emprestimo` ENABLE KEYS */; -- Copiando estrutura para tabela asgardprint01.obra DROP TABLE IF EXISTS `obra`; CREATE TABLE IF NOT EXISTS `obra` ( `obra_id` int(11) NOT NULL AUTO_INCREMENT, `obra_sysdata` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `obra_nome` varchar(75) NOT NULL, `obra_autor` varchar(75) NOT NULL, `obra_data` date NOT NULL, `obra_biografia` text NOT NULL, `obra_tipo` varchar(40) NOT NULL, `obra_categoria` varchar(40) NOT NULL, `obra_localizacao` varchar(75) NOT NULL, `obra_disponibilidade` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`obra_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; -- Copiando dados para a tabela asgardprint01.obra: ~4 rows (aproximadamente) DELETE FROM `obra`; /*!40000 ALTER TABLE `obra` DISABLE KEYS */; INSERT INTO `obra` (`obra_id`, `obra_sysdata`, `obra_nome`, `obra_autor`, `obra_data`, `obra_biografia`, `obra_tipo`, `obra_categoria`, `obra_localizacao`, `obra_disponibilidade`) VALUES (1, '2015-10-27 17:45:56', '2', '2', '2015-10-27', '2', '2', '2', '2', 0), (2, '2015-10-27 18:24:03', 'Rafael', 'Obra Legal', '2010-10-10', 'epa lele ', 'Pintura', 'Moderna', 'Salao Principal', 1), (3, '2015-10-29 17:16:32', 'Opan', 'eita', '2010-10-10', 'Legl', 'Pintura', 'Barroca', 'Salao Principal', 1), (4, '2015-10-29 17:18:55', 'Teste 3', 'teste', '2010-10-10', 'legal legal', 'Pintura', 'Barroca', 'Salao Principal', 1); /*!40000 ALTER TABLE `obra` ENABLE KEYS */; -- Copiando estrutura para tabela asgardprint01.visitante DROP TABLE IF EXISTS `visitante`; CREATE TABLE IF NOT EXISTS `visitante` ( `visitante_id` int(11) NOT NULL AUTO_INCREMENT, `visitante_sysdata` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `visitante_cpf` varchar(14) NOT NULL DEFAULT '', `visitante_nacionalidade` varchar(50) NOT NULL, `visitante_idade` int(3) NOT NULL DEFAULT '0', `visitante_sexo` varchar(10) NOT NULL, `visitante_grau_instrucao` varchar(40) NOT NULL, `visitante_meio_transporte` varchar(40) NOT NULL, `visitante_ativo` tinyint(1) DEFAULT '1', PRIMARY KEY (`visitante_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- Copiando dados para a tabela asgardprint01.visitante: ~2 rows (aproximadamente) DELETE FROM `visitante`; /*!40000 ALTER TABLE `visitante` DISABLE KEYS */; INSERT INTO `visitante` (`visitante_id`, `visitante_sysdata`, `visitante_cpf`, `visitante_nacionalidade`, `visitante_idade`, `visitante_sexo`, `visitante_grau_instrucao`, `visitante_meio_transporte`, `visitante_ativo`) VALUES (3, '2015-10-29 17:13:01', '111.111.111-11', 'Outros', 100, 'Masculino', 'Analfabeto', 'Coletivo privado', 1), (4, '2015-10-29 17:13:14', '222.222.222-22', 'Outros', 20, 'Feminino', 'Fundamental completo', 'Próprio', 1); /*!40000 ALTER TABLE `visitante` ENABLE KEYS */; /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-- MySQL dump 10.11 -- -- Host: localhost Database: ranking -- ------------------------------------------------------ -- Server version 5.0.51a-24+lenny5 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `clients` -- DROP TABLE IF EXISTS `clients`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `clients` ( `clients_id` int(11) NOT NULL auto_increment, `name` varchar(150) NOT NULL, PRIMARY KEY (`clients_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `clients` -- LOCK TABLES `clients` WRITE; /*!40000 ALTER TABLE `clients` DISABLE KEYS */; INSERT INTO `clients` VALUES (1,'Default client'); /*!40000 ALTER TABLE `clients` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `clients_has_domains` -- DROP TABLE IF EXISTS `clients_has_domains`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `clients_has_domains` ( `clients_id` int(11) NOT NULL, `domains_id` int(11) NOT NULL, PRIMARY KEY (`domains_id`), KEY `clients_id` (`clients_id`,`domains_id`), CONSTRAINT `clients_has_domains_ibfk_1` FOREIGN KEY (`clients_id`) REFERENCES `clients` (`clients_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `clients_has_domains_ibfk_2` FOREIGN KEY (`domains_id`) REFERENCES `domains` (`domains_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `clients_has_domains` -- LOCK TABLES `clients_has_domains` WRITE; /*!40000 ALTER TABLE `clients_has_domains` DISABLE KEYS */; INSERT INTO `clients_has_domains` VALUES (1,1); /*!40000 ALTER TABLE `clients_has_domains` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `domains` -- DROP TABLE IF EXISTS `domains`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `domains` ( `domains_id` int(11) NOT NULL auto_increment, `domain` varchar(100) NOT NULL, `pages_to_crawl` int(5) NOT NULL default '1', `domain_min_sleep` int(5) NOT NULL, `domain_max_sleep` int(5) NOT NULL, `keyword_min_sleep` int(5) NOT NULL, `keyword_max_sleep` int(5) NOT NULL, PRIMARY KEY (`domains_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `domains` -- LOCK TABLES `domains` WRITE; /*!40000 ALTER TABLE `domains` DISABLE KEYS */; INSERT INTO `domains` VALUES (1,'www.webmug.de',1,10,60,2,5); /*!40000 ALTER TABLE `domains` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `domains_has_keywords` -- DROP TABLE IF EXISTS `domains_has_keywords`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `domains_has_keywords` ( `domains_id` int(11) NOT NULL, `keywords_id` int(11) NOT NULL, KEY `keywords_id` (`keywords_id`), KEY `domains_id` (`domains_id`), CONSTRAINT `domains_has_keywords_ibfk_1` FOREIGN KEY (`domains_id`) REFERENCES `domains` (`domains_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `domains_has_keywords_ibfk_2` FOREIGN KEY (`keywords_id`) REFERENCES `keywords` (`keywords_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `domains_has_keywords` -- LOCK TABLES `domains_has_keywords` WRITE; /*!40000 ALTER TABLE `domains_has_keywords` DISABLE KEYS */; INSERT INTO `domains_has_keywords` VALUES (1,1); /*!40000 ALTER TABLE `domains_has_keywords` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `keywords` -- DROP TABLE IF EXISTS `keywords`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `keywords` ( `keywords_id` int(11) NOT NULL auto_increment, `keyword` varchar(200) NOT NULL, `prio` int(6) NOT NULL, PRIMARY KEY (`keywords_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `keywords` -- LOCK TABLES `keywords` WRITE; /*!40000 ALTER TABLE `keywords` DISABLE KEYS */; INSERT INTO `keywords` VALUES (1,'webmug',100); /*!40000 ALTER TABLE `keywords` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `results` -- DROP TABLE IF EXISTS `results`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; CREATE TABLE `results` ( `date` date NOT NULL, `keywords_id` varchar(11) NOT NULL, `pos_google` varchar(6) NOT NULL, `pos_bing` varchar(6) NOT NULL, UNIQUE KEY `uniq` (`date`,`keywords_id`,`pos_google`,`pos_bing`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -- -- Dumping data for table `results` --
CREATE TABLE `resume`.`re_users` ( `user_id` INT(11) NOT NULL AUTO_INCREMENT , `full_name` VARCHAR(36) NOT NULL , `email` VARCHAR(160) NOT NULL , `password` VARCHAR(30) NOT NULL , `created_date` DATETIME NOT NULL, `updated_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`user_id`) ) ENGINE = InnoDB; ALTER TABLE `re_users` ADD UNIQUE(`email`); CREATE TABLE `resume`.`re_user_sessions` ( `session_id` INT(11) NOT NULL AUTO_INCREMENT , `user_id` INT(11) NOT NULL , `session_token` VARCHAR(64) NOT NULL , `login_date` DATETIME NOT NULL , `logout` TINYINT(1) NOT NULL DEFAULT '0' , `logout_date` DATETIME NOT NULL , PRIMARY KEY (`session_id`) ) ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS task_manager.users ( id uuid, email varchar, password text, fname varchar, lname varchar, role varchar, img varchar, PRIMARY KEY (id, email) );
USE DBSISTEMACOVID; # DML PARA TESTES INSERT INTO INSTITUICAO(IDINSTITUICAO, NOME) VALUES (1, 'UFSC'); INSERT INTO INSTITUICAO(IDINSTITUICAO, NOME) VALUES (2, 'USP'); INSERT INTO INSTITUICAO(IDINSTITUICAO, NOME) VALUES (3, 'MIT'); INSERT INTO INSTITUICAO(IDINSTITUICAO, NOME) VALUES (4, 'Universidade de Moscow'); INSERT INTO INSTITUICAO(IDINSTITUICAO, NOME) VALUES (5, 'Universidade de Tokio'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(1, 1, 1, 'JOAQUIM', 'PEREIRA', '1977-10-15', 'M', '11111111111'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(2, 1, 3, 'GREGORY', 'SMITH', '1972-05-20', 'M', '22222222222'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(3, 1, 5, 'AKI', 'TAKAYAMA', '1985-01-26', 'F', '33333333333'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(4, 2, NULL, 'MARIA', 'DA SILVA', '1988-02-10', 'F', '44444444444'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(5, 2, NULL, 'FERNANDA', 'ZANOTTO', '1992-11-11', 'F', '55555555555'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(6, 3, NULL, 'MICHEL', 'HANADA', '1966-09-07', 'M', '66666666666'); INSERT INTO PESSOA(IDPESSOA, IDTIPO, IDINSTITUICAO, NOME, SOBRENOME, DATA_NASCIMENTO, SEXO, CPF) VALUES(7, 3, NULL, 'CLEYSON', 'SHMIDT', '1973-03-18', 'M', '77777777777'); # ESTAGIO_INICIAL = 1; # ESTAGIO_TESTES = 2; # ESTAGIO_APLICACAO_EM_MASSA = 3; INSERT INTO VACINA(IDVACINA, IDPESQUISADOR, NOME, PAIS_ORIGEM, ESTAGIO_PESQUISA, DATA_INICIO_PESQUISA) VALUES(1, 1, 'VACINA DAS TAINHAS', 'BRASIL', 1, '2020-09-15'); INSERT INTO VACINA(IDVACINA, IDPESQUISADOR, NOME, PAIS_ORIGEM, ESTAGIO_PESQUISA, DATA_INICIO_PESQUISA) VALUES(2, 3, 'VACINA DOS SAMURAIS', 'JAPÃO', 2, '2020-06-23'); INSERT INTO VACINA(IDVACINA, IDPESQUISADOR, NOME, PAIS_ORIGEM, ESTAGIO_PESQUISA, DATA_INICIO_PESQUISA) VALUES(3, 2, 'SPUTNIK V', 'RÚSSIA', 3, '2020-04-29'); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (1, 1, 4.0); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (1, 3, 3.3); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (1, 4, 2.6); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (1, 6, 3.8); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (1, 7, 4.9); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (2, 2, 4.0); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (2, 3, 3.8); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (2, 5, 5.0); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 1, 3.3); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 2, 2.1); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 3, 4.1); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 4, 5.0); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 5, 2.7); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 6, 2.2); INSERT INTO NOTA(IDVACINA, IDPESSOA, VALOR) VALUES (3, 7, 1.9);
-- Aug 19, 2008 3:25:12 PM EST -- BF2059012_ViewPI UPDATE AD_Form SET Classname='org.adempiere.apps.graph.ViewPI',Updated=TO_TIMESTAMP('2008-08-19 15:25:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Form_ID=119 ;
ALTER TABLE consulta DROP COLUMN prescricao; ALTER TABLE consulta ADD COLUMN observacao TEXT;
DROP DATABASE IF EXISTS ems; CREATE DATABASE ems; /*CREATE USER 'emsuser'@'localhost' IDENTIFIED BY 'emspass';*/ GRANT ALL PRIVILEGES ON ems.* TO emsuser@'localhost' IDENTIFIED BY 'emspass'; USE ems; -- ----------------------------------------------------- -- Table USERS (USUARIOS): OBLIGATORIO email @alumnos.uvigo.es -- ----------------------------------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `id` INT UNSIGNED AUTO_INCREMENT , `username` VARCHAR(50), `name` VARCHAR(50), `surname` VARCHAR(50), `dni` VARCHAR(12), `address` VARCHAR(128), `phone` INT(15), `birthdate` DATE, `faculty` VARCHAR(50) DEFAULT NULL, `course` INT(2) DEFAULT NULL, `email` VARCHAR(50), `password` VARCHAR(50), `role` ENUM ('Admin_ORI', 'Admin_SEC', 'Coordinador', 'Alumno') DEFAULT 'Alumno', `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `status` TINYINT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table DESTINATIONS (DESTINOS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `destinations`; CREATE TABLE IF NOT EXISTS `destinations` ( `id` INT UNSIGNED AUTO_INCREMENT, `country` VARCHAR(128), `university` VARCHAR(128), `description` VARCHAR(128), `places` INT(2), `duration` INT(2), `contact_person` VARCHAR(128), `destination_requirements` VARCHAR(128), `origin_requirements` VARCHAR(128), PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table PLACES (PLAZAS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `places`; CREATE TABLE IF NOT EXISTS `places` ( `id` INT UNSIGNED AUTO_INCREMENT, `user_id` INT UNSIGNED, `destination_id` INT UNSIGNED, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table LEARNING_AGREEMENTS (CONTRATOS DE ESTUDIO) -- ----------------------------------------------------- DROP TABLE IF EXISTS `learning_agreements`; CREATE TABLE IF NOT EXISTS `learning_agreements` ( `id` INT UNSIGNED AUTO_INCREMENT, `destination_subjects` VARCHAR(128), `origin_subjects` VARCHAR(128), `duration` INT(2), `contact_person` VARCHAR(128), `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `user_id` INT UNSIGNED, `place_id` INT UNSIGNED, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table EXTENSION_REQUESTS (AMPLIACIONES) -- ----------------------------------------------------- DROP TABLE IF EXISTS `extension_requests`; CREATE TABLE IF NOT EXISTS `extension_requests` ( `id` INT UNSIGNED AUTO_INCREMENT, `description` VARCHAR(128), `months` INT(2), `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `user_id` INT UNSIGNED, `place_id` INT UNSIGNED, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table RESIGNATIONS (RENUNCIAS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `resignations`; CREATE TABLE IF NOT EXISTS `resignations` ( `id` INT UNSIGNED AUTO_INCREMENT, `description` VARCHAR(128), `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `user_id` INT UNSIGNED, `place_id` INT UNSIGNED, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table DOCUMENTS (DOCUMENTOS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `documents`; CREATE TABLE IF NOT EXISTS `documents` ( `id` INT UNSIGNED AUTO_INCREMENT, `type` ENUM ('Aceptación de plaza', 'Contrato financiero', 'Ficha de perceptores', 'Aceptación uso de datos', 'Contrato seguro On Campus', 'Contrato de estudios', 'Modificación contrato de estudios', 'Certificado de llegada', 'Ampliación de estancia', 'Renuncia de plaza', 'Certificado de fin de estancia') DEFAULT NULL, `description` VARCHAR(128) DEFAULT NULL, `file` VARCHAR(255) DEFAULT NULL, `file_dir` VARCHAR(255) DEFAULT NULL, `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `user_id` INT UNSIGNED, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table SCHOOL_YEARS (AÑOS ACADÉMICOS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `school_years`; CREATE TABLE IF NOT EXISTS `school_years` ( `id` INT UNSIGNED AUTO_INCREMENT, `date` VARCHAR(128), `description` VARCHAR(128), PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- Table DEADLINES (PLAZOS) -- ----------------------------------------------------- DROP TABLE IF EXISTS `deadlines`; CREATE TABLE IF NOT EXISTS `deadlines` ( `id` INT UNSIGNED AUTO_INCREMENT, `name` VARCHAR(128), `description` VARCHAR(128), `type` ENUM ('10 días', '15 días', '20 días', '1 mes', '2 meses', '3 meses', '6 meses', '10 meses') DEFAULT '1 mes', `created` DATETIME DEFAULT CURRENT_TIMESTAMP, `modified` DATETIME DEFAULT CURRENT_TIMESTAMP, `document_id` INT UNSIGNED DEFAULT NULL, PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ----------------------------------------------------- -- FOREIGN KEYS -- ----------------------------------------------------- /* TABLE PLACES*/ ALTER TABLE places ADD FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, ADD FOREIGN KEY (destination_id) REFERENCES destinations (id) ON DELETE CASCADE ON UPDATE CASCADE; /* TABLE LEARNING_AGREEMENTS*/ ALTER TABLE learning_agreements ADD FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, ADD FOREIGN KEY (place_id) REFERENCES places (id) ON DELETE CASCADE ON UPDATE CASCADE; /* TABLE EXTENSION_REQUESTS*/ ALTER TABLE extension_requests ADD FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, ADD FOREIGN KEY (place_id) REFERENCES places (id) ON DELETE CASCADE ON UPDATE CASCADE; /* TABLE RESIGNATIONS*/ ALTER TABLE resignations ADD FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, ADD FOREIGN KEY (place_id) REFERENCES places (id) ON DELETE CASCADE ON UPDATE CASCADE; /* TABLE DOCUMENTS*/ ALTER TABLE documents ADD FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE; /* TABLE PERIODS*/ ALTER TABLE deadlines ADD FOREIGN KEY (document_id) REFERENCES documents (id) ON DELETE CASCADE ON UPDATE CASCADE; -- ----------------------------------------------------- -- INSERTS `USERS` -- ----------------------------------------------------- INSERT INTO `users` (`id`, `username`, `name`, `surname`, `dni`, `address`, `phone`, `birthdate`,`faculty`, `course`, `email`, `password`, `role`, `created`, `modified`, `status`) VALUES ('1', 'rgcarrera', 'Ramon', 'Gago Carrera', '53613886N', 'Avda. Buenos Aires nº24 3º 32003', '652354782', '1990-07-07', 'ESEI', NULL,'rgcarrera@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Admin_ORI', NOW(), NOW(), '1'), ('2', 'agrodriguez', 'Alma', 'Gómez Rodríguez', '77548923J', 'Calle Celso Emilio Ferreiro nº2 1ºE 32004', '641896572', '1969-11-25', 'ESEI', NULL, 'agrodriguez@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Coordinador', NOW(), NOW(), '1'), ('3', 'arsampayo', 'Alturo', 'Rodriguez Sampayo', '68315282L', 'Avda. Habana nº45 7º 32002', '632985412', '1960-04-14','ESEI', NULL, 'arsampayo@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Admin_SEC', NOW(), NOW(), '1'), ('4', 'jrmartina', 'Joshua', 'Rodriguez Martiña', '11543374D', 'Calle Santo Domingo nº15 4º 32005', '689523140', '1993-10-1','ESEI', '4','jrmartina@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Alumno', NOW(), NOW(), '1'), ('5', 'drbarros', 'Domingo', 'Rivera Barros', '60521487P', 'Calle Erverdelo Nº123 3ºA', '635896547', '1994-11-23','ESEI', '3','drbarros@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Alumno', NOW(), NOW(), '1'), ('6', 'jrrodriguez', 'Jose Manuel', 'Rodriguez Rodriguez', '15498654B','Avda. de Marín Nº54 2ºC', '632326589', '1991-1-10','ESEI', '3','jrrodriguez@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Alumno', NOW(), NOW(), '1'), ('7', 'asdiaz', 'Ana Isabel', 'Suárez Díaz', '539611718V','Calle Nogueira de Ramuín nº1 4º', '645892103', '1995-05-16','ESEI', '4','asdiaz@gmail.com', '3583a9864279f442056d6aee66aa147ed8c8284e', 'Alumno', NOW(), NOW(), '1'); -- ----------------------------------------------------- -- INSERTS `DESTINATIONS` -- ----------------------------------------------------- INSERT INTO `destinations` (`id`, `country`, `university`, `description`, `places`, `duration`, `contact_person`,`destination_requirements`, `origin_requirements`) VALUES ('1', 'Alemania', 'Universität Kassel', 'Universidad pública situada en el estado federado de Hesse', '3', '6', 'Derek Richter', 'B1 Alemán', 'Ninguno'), ('2', 'Francia', 'Université de Nantes', 'Universidad pública situada en Loire-Atlantique', '1', '6', 'Louis Leblanc', 'B1 Francés', 'Ninguno'), ('3', 'Italia', 'Universitá degli Studi di Catania', ' Es la Universidad más antigua de Sicilia y la 13º en Italia con aproximadamente 62.000 estudiantes', '2', '6', 'Giuseppe Barbanera', 'Ninguno', 'Ninguno'), ('4', 'Polonia', 'Bialystok University of Technology', 'Universidad pública polaca', '2', '10', 'Aleska Rosenstock', 'Ninguno', 'Ninguno'); -- ----------------------------------------------------- -- Table PLACES (PLAZAS) -- ----------------------------------------------------- INSERT INTO `places` (`id`, `user_id`, `destination_id`) VALUES ('1', '4', '1'), ('2', '6', '1'), ('3', '7', '2'), ('4', '5', '4'); -- ----------------------------------------------------- -- INSERTS `LEARNING_AGREEMENTS` -- ----------------------------------------------------- INSERT INTO `learning_agreements` (`id`, `destination_subjects`, `origin_subjects`, `duration`, `contact_person`, `created`, `modified`,`user_id`, `place_id`) VALUES ('1', 'A01, A08, A12, A17, A18', 'G150501, G150502, G150503, G150504, G150503 ', '6', 'Derek Richter', NOW(), NOW(), '4', '1'), ('2', 'A02, A03, A13, A17, A20', 'G150969, G150970, G150503, G150405, G150506 ', '6', 'Derek Richter', NOW(), NOW(), '6', '2'), ('3', 'F01, F05, F10, F11, F12', 'G150501, G150405, G150968, G150502, G150602 ', '6', 'Louis Leblanc', NOW(), NOW(), '7', '3'), ('4', 'P06, P09, P13, P15, P16, P21, P25, P26, P27, P30', 'G150505, G150302, G150606, G150504, G150503, G150505, G150506, G150605, G150970, G150969 ', '10', 'Aleska Rosenstock', NOW(), NOW(), '5', '4'); -- ----------------------------------------------------- -- INSERTS `EXTENSION_REQUESTS` -- ----------------------------------------------------- INSERT INTO `extension_requests` (`id`, `description`, `months`, `created`, `modified`, `user_id`, `place_id`) VALUES ('1', 'Ampliación de estancia', '4', NOW(), NOW(), '4', '1'), ('2', 'Ampliación de estancia', '4', NOW(), NOW(), '7', '3'); -- ----------------------------------------------------- -- INSERTS `RESIGNATIONS` -- ----------------------------------------------------- INSERT INTO `resignations` (`id`, `description`, `created`, `modified`, `user_id`, `place_id`) VALUES ('1', 'Renuncia de plaza por motivos personales', NOW(), NOW(), '6', '2'); -- ----------------------------------------------------- -- INSERTS `DOCUMENTS` -- ----------------------------------------------------- /* PROBLEMA: A la hora de poner los plazos recibe el document_id pero este pertenece a un user_id, se le borraría este último?*/ INSERT INTO `documents` (`id`,`type`, `file`, `file_dir`, `created`, `modified`,`user_id`) VALUES ('1', 'Petición plaza erasmus', 'plaza_erasmus.pdf', '1', NOW(), NOW(),'4'), ('2', 'Petición destinos erasmus', 'destinos_erasmus.pdf', '2', NOW(), NOW(),'4'), ('3', 'Aceptación o renuncia de plaza asignada', 'aceptacion_erasmus.pdf', '3', NOW(), NOW(),'4'), ('4', 'Contrato financiero', 'datos_financieros.pdf', '4', NOW(), NOW(),'4'), ('5', 'Ficha de perceptores', 'ficha_perceptores.pdf', '5', NOW(), NOW(),'4'), ('6', 'Autorización uso de datos', 'autorización_uso_datos.pdf', '6', NOW(), NOW(),'4'), ('7', 'Contrato seguro On Campus', 'seguro_on_campus.pdf', '7', NOW(), NOW(),'4'), ('8', 'Contrato de estudios', 'contrato_estudios.pdf', '8', NOW(), NOW(), '4'), ('9', 'Modificación contrato de estudios', 'modificación_contrato_estudios.pdf', '9', NOW(), NOW(), '4'), ('10', 'Certificado de llegada', 'certificado_llegada.pdf', '10', NOW(), NOW(),'4'), ('11', 'Ampliación de estancia', 'ampliacion_estancia.pdf', '11', NOW(), NOW(), '4'), ('12', 'Renuncia de plaza', 'renuncia_plaza.pdf', '12', NOW(), NOW(), '6'), ('13', 'Certificado de fin de estancia', 'certificado_fin_estancia.pdf', '13', NOW(), NOW(), NULL); -- ----------------------------------------------------- -- INSERTS `SCHOOL_YEARS` -- ----------------------------------------------------- INSERT INTO `school_years` (`id`, `date`, `description`) VALUES ('1', '2016-2017', 'Año académico Erasmus +'), ('2', '2017-2018', 'Año académico Erasmus +'); -- ----------------------------------------------------- -- INSERTS `PERIODS` -- ----------------------------------------------------- /* No tiene sentido asociar un document_id...*/ /*NO SE HACER LOS PLAZOS*/ INSERT INTO `deadlines` (`id`, `name`, `description`,`type`, `created`, `modified`,`document_id`) VALUES ('1', 'Plazo de solicitud de plaza erasmus', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '1'), ('2', 'Plazo de solicitud de destino erasmus', 'El plazo expirará dentro de 15 días contando a partir del siguiente día laboral tras la publicación', '15 días', NOW(), NOW(), '2'), ('3', 'Plazo de entrega de la aceptación o renuncia de plaza erasmus', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '3'), ('4', 'Plazo de entrega del contrato finaciero', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '4'), ('5', 'Plazo de entrega de la ficha de perceptores', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '5'), ('6', 'Plazo de entrega de la autorización del uso de datos', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '6'), ('7', 'Plazo de entrega del contrato del seguro On Campus', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '7'), ('8', 'Plazo de entrega del contrato de estudios', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '8'), ('9', 'Plazo de modificación del contrato de estudios', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '9'), ('10', 'Plazo de entrega del certificado de llegada', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '10'), ('11', 'Plazo de petición de amplicación de estancia', 'El plazo expirará dentro de 6 meses contando a partir del siguiente día laboral tras la publicación', '6 meses', NOW(), NOW(), '11'), ('12', 'Plazo de petición de renuncia de plaza erasmus', 'El plazo expirará dentro de 10 meses contando a partir del siguiente día laboral tras la publicación', '10 meses', NOW(), NOW(), '12'), ('13', 'Plazo de entrega del certificado de fin de estancia', 'El plazo expirará dentro de un mes contando a partir del siguiente día laboral tras la publicación', '1 mes', NOW(), NOW(), '13');
CREATE TABLE IF NOT EXISTS competition ( id INTEGER NOT NULL, name VARCHAR(512) NOT NULL, location VARCHAR(512), start_date DATE, end_date DATE, age_threshold_date DATE, mats INTEGER NOT NULL, password_hash INTEGER, wi_password_hash INTEGER, pd_password_hash INTEGER, sb_password_hash INTEGER, license_name VARCHAR(255), license_type VARCHAR(255), license_contact VARCHAR(255), director_name VARCHAR(255), director_contact VARCHAR(255), closed BOOL NOT NULL DEFAULT 'false', last_updated TIME NOT NULL ); CREATE TABLE IF NOT EXISTS player_details ( id INTEGER NOT NULL, club VARCHAR(255), home_phone VARCHAR(20), work_phone VARCHAR(20), mobile VARCHAR(20), addr_street VARCHAR(255), addr_city VARCHAR(255), addr_postcode VARCHAR(4), addr_state VARCHAR(3), email VARCHAR(512), emergency_name VARCHAR(255), emergency_phone VARCHAR(20), emergency_mobile VARCHAR(20), medical_conditions TEXT, medical_info TEXT, injury_info TEXT, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS player ( id INTEGER NOT NULL, details_id INTEGER, visible_id VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, gender VARCHAR(5), dob DATE, weight REAL, grade VARCHAR(20), locked_status VARCHAR(20), is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS pool ( id INTEGER NOT NULL , description VARCHAR(512) NOT NULL, max_age INTEGER NOT NULL, min_age INTEGER NOT NULL, max_weight REAL, min_weight REAL, max_grade VARCHAR(20), min_grade VARCHAR(20), gender VARCHAR(20), match_time INTEGER NOT NULL, min_break_time INTEGER NOT NULL, golden_score_time INTEGER NOT NULL, template_name VARCHAR(512), locked_status VARCHAR(20), is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS player_has_pool ( player_id INTEGER NOT NULL, pool_id INTEGER NOT NULL, approved BOOL NOT NULL DEFAULT 'false', player_pos INTEGER, is_locked BOOL, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(player_id, pool_id) ); CREATE TABLE IF NOT EXISTS fight ( id INTEGER NOT NULL, pool_id INTEGER NOT NULL, player_code1 VARCHAR(16), player_code2 VARCHAR(16), pos_in_pool INTEGER NOT NULL, i_points INTEGER DEFAULT 0, w_points INTEGER DEFAULT 0, y_points INTEGER DEFAULT 0, k_points INTEGER DEFAULT 0, l_points INTEGER DEFAULT 0, is_locked BOOL, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS session ( id INTEGER NOT NULL, session_type VARCHAR(20) NOT NULL, name VARCHAR(512), mat VARCHAR(128), locked_status VARCHAR(20), is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS session_link ( id INTEGER NOT NULL, session_id INTEGER NOT NULL, following_id INTEGER NOT NULL, link_type VARCHAR(10), is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) ); CREATE TABLE IF NOT EXISTS session_has_pool ( session_id INTEGER NOT NULL, pool_id INTEGER NOT NULL, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(session_id, pool_id) ); CREATE TABLE IF NOT EXISTS session_has_fight ( fight_id INTEGER NOT NULL, session_id INTEGER NOT NULL, pos_in_session INTEGER NOT NULL, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(session_id, fight_id) ); CREATE TABLE IF NOT EXISTS fight_result ( id INTEGER NOT NULL, fight_id INTEGER NOT NULL, player_score1 INTEGER NOT NULL, player_score2 INTEGER NOT NULL, player_id1 INTEGER NOT NULL, player_id2 INTEGER NOT NULL, event_log TEXT, is_valid BOOL, last_updated TIME NOT NULL, PRIMARY KEY(id) );
/* Aufgaben zu Winestore DB */ #Datum: 4.10.2020 #Autor: R. Zimmermann #-----------------------------------------------------------------------------------------------------------------*/ SHOW DATABASES; USE winestore; SHOW TABLES; SELECT * FROM wine_type; # 1. Wie viele Kunden sind in der Datenbank registriert? # 1a. Sind Kunden doppelt eingetragen? # 1b. Wie viele Kunden haben eine Bestellung ? # 1c. Liste der Kunden die keine Bestellung haben # 1d. Integrität/Konsistenz der Beziehung orders-items prüfen: # 1e. Integrität/Konsistenz der Tabellen customer-orders prüfen # 2. Gibt es überhaupt unvollständige Kundendatensätze? # 2a. Kontrollieren Sie die MussFelder (Not NULL) auf der Tabelle customer - Sinnvoll? # 3. Wie viele (verschiedene ?!) Weine sind eingetragen # 3a. Wie viele verschiedene Weine sind eingetragen, wenn nicht der Jahrgang aber der Weintyp als Unterschied gelten? # 3b. Wie viele verschiedene Weinnamen sind überhaupt eingetragen? # 3b. Wie viele verschiedene Weine sind eingetragen, wenn Name, Jahrgang und der Weintyp als Unterschied gelten ? # 4. Wieviele verschiedene Weinnamen sind erfasst? # 4a. Zählen Sie die Anzahl der Weine pro Weinnamen - was fällt auf? - warum ist das so? # 4b. Doubletten suchen # 5. Wie viele verschiedene Weine gibt es von jedem Weintyp? # 5a. Erstellen Sie hier eine Auswertung GROUP BY mit ROLLUP # 6. Von welchem Weintyp gibt es am meisten verschiedene Weine? # 7. Wie viele Weinflaschen sind total am Lager? # 7a. Sind alle erfassten Weine am Lager # 7b. Liste Anzahl Weinflaschen pro Region am Lager? # 7c. Liste der wineries mit der zugehörigen Region # 7d. Liste der Regionen mit der Anzahl zugehöriger Wineries # 7e. In welcher Region liegen die meisten Wineries? # 8. Wie gross ist der Lagerwert zu Einstandspreisen der Weine? # Aufgabe: Was kostet der billigste Wein im Einkauf? # Aufgabe: Was kostet der teuerste Wein im Einkauf? # Aufgabe: Was ist der durchschnittliche Einkaufspreis pro Flasche? # 9. In welchem Land wohnen die meisten Kunden? # 10. Wie viele Bestellungen hat der oder die Kunden mit den meisten Bestellungen ? # 11. Liste des/der Kunden mit der höchsten Anzahl Bestellungen geordnet nach sur- und firstname ! # 12. Liste der Weine, die in keiner Bestellung vorkommen # 13. Liste der Marge (Differenz zwischen Einstands- und Verkaufspreis) der bestellten Weine pro Verkaufsposition # 13a. Wo tauchen hier Fragen auf? Wie kontrollieren wir das ? # 13b. Sind alle Margen positiv ? # 13c. Ist dieser Weinhändler ein guter Geschäftsmann ? # 13d. Wie gross ist die Gesamtmarge overall? # 14. Liste der Kunden mit dem Totalbetrag aller Bestellungen eines Kunden # mit Marge pro Kunde: # Kontrolle eines Kunden: # 15. Wie hoch ist die Summe der Bestellung des Kunden, der wertmässig am meisten bestellt hat? # 16. Welcher Kunde hat diese grösste Bestellsumme? # 17. Aus welcher Region kommen die meisten Weine? # 18. Aus welchen Trauben sind die jeweiligen Weine zusammengesetzt? # Liste mit group_concat # 18a. Welcher Wein ist «verschnitten» und welcher nicht? # 19. Sind alle varieties "im Einsatz"? # ja sie sind - und wine_variety ist konsistent zu wine? # ja die Beziehung ist konsistent # 20. Aus wie vielen grape_varieties besteht der Wein, der am "meisten" verschnitten ist? # 20a. Welcher/welche Wein/e ist/sind das ? # 20b. Wie viele Weine sind in 20a. betroffen? # 21. Welche grape_ variety ist über alle Weine am meisten beteiligt? # 22. Welcher Kunde hat den höchsten durchschnittlichen Preis/Flasche in all seinen Bestellpositionen? # 23.Zeige alle Kunden mit mindestens einer „Nullmargenposition“ # 24. Welche Kunden haben keine “Nullmargenposition”? # 25. Zeige alle Kunden mit jeweils allen „Nullmargenpositionen“ in allen Bestellungen mit Angabe von order_id und item_id
2018-10-17 05:00:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.290ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.690ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 178.380ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.620ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.210ms 2018-10-17 05:01:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.560ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.810ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 180.160ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 4.530ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.050ms 2018-10-17 05:02:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 9.990ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.030ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 220.910ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 7.860ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.830ms 2018-10-17 05:03:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.180ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 4.020ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 219.140ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.670ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.990ms 2018-10-17 05:04:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.020ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.690ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 180.740ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.600ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.530ms 2018-10-17 05:05:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.220ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.770ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 179.270ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.320ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.480ms 2018-10-17 05:06:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.000ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.270ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 506.570ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.510ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.790ms 2018-10-17 05:07:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.770ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 5.500ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 715.100ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.170ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.370ms 2018-10-17 05:08:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.340ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.640ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 182.000ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.360ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.530ms 2018-10-17 05:09:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.030ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.930ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 178.110ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.670ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.640ms 2018-10-17 05:10:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.900ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.630ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 720.920ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.540ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.940ms 2018-10-17 05:11:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.140ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.950ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 285.120ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 12.810ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.100ms 2018-10-17 05:12:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.210ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.330ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 259.350ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 9.220ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.420ms 2018-10-17 05:13:56 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.100ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.440ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 211.210ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 7.770ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.550ms 2018-10-17 05:14:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.660ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.790ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 540.830ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.550ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.760ms 2018-10-17 05:15:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 5.450ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.120ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 382.520ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.740ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-17 05:16:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.290ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.480ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 659.160ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 2.730ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.810ms 2018-10-17 05:17:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 9.080ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 5.270ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 435.970ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.420ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.590ms 2018-10-17 05:18:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.140ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.710ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 514.470ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 4.120ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.530ms 2018-10-17 05:19:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.590ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.210ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 623.690ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 11.550ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.800ms 2018-10-17 05:20:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.560ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.980ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 471.550ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.950ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.850ms 2018-10-17 05:21:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.750ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 6.030ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 503.890ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.540ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.840ms 2018-10-17 05:22:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.200ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.940ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 274.180ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.920ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.800ms 2018-10-17 05:23:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.120ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.540ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 384.810ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.250ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.480ms 2018-10-17 05:24:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.460ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.950ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 182.770ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.420ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.800ms 2018-10-17 05:25:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.850ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.580ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 183.460ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 8.690ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.270ms 2018-10-17 05:26:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.920ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.320ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 465.740ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.580ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.840ms 2018-10-17 05:27:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.190ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.790ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 344.300ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.170ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.290ms 2018-10-17 05:28:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.710ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.980ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 188.890ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 5.700ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 5.220ms 2018-10-17 05:29:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 10.430ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.090ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 511.460ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.300ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 7.780ms 2018-10-17 05:30:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 6.790ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.820ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 504.760ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 13.040ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.850ms 2018-10-17 05:31:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.970ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.830ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 332.010ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.620ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 3.530ms 2018-10-17 05:32:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.650ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.690ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 317.230ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 6.820ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.560ms 2018-10-17 05:33:57 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.450ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.140ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 235.990ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 11.670ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 16.190ms 2018-10-17 05:34:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.370ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.140ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 467.800ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.840ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 5.650ms 2018-10-17 05:35:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.840ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.910ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 563.220ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 6.680ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.570ms 2018-10-17 05:36:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.600ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 1.940ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 682.830ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 4.220ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.350ms 2018-10-17 05:37:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.130ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.810ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 274.800ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.750ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.690ms 2018-10-17 05:38:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.350ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.810ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 457.760ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.930ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.750ms 2018-10-17 05:39:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.370ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.770ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 443.280ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.700ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.680ms 2018-10-17 05:40:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.310ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.420ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 344.430ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.430ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.380ms 2018-10-17 05:41:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 4.990ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.970ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 243.450ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.760ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.800ms 2018-10-17 05:42:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.930ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.600ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 192.060ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.520ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.880ms 2018-10-17 05:43:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.090ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.800ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 262.520ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 6.450ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.540ms 2018-10-17 05:44:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.050ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.330ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 184.210ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.200ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.440ms 2018-10-17 05:45:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.020ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.050ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 180.370ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.270ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.530ms 2018-10-17 05:46:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.250ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 1.790ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 188.490ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.500ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-17 05:47:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.130ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.840ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 399.590ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.890ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.480ms 2018-10-17 05:48:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.180ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 6.350ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 286.100ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 10.500ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.390ms 2018-10-17 05:49:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.790ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.710ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 177.220ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.320ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.330ms 2018-10-17 05:50:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.180ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.740ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 184.400ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.400ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.430ms 2018-10-17 05:51:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.270ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.610ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 357.980ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 6.450ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.440ms 2018-10-17 05:52:59 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.350ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 11.490ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 511.300ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.730ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.300ms 2018-10-17 05:53:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.060ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.500ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 177.550ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.610ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.330ms 2018-10-17 05:54:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.990ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.680ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 180.880ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 10.100ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.550ms 2018-10-17 05:55:58 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.120ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.890ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 179.150ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.980ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.490ms 2018-10-17 05:56:59 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.670ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.080ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 364.940ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.460ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.450ms 2018-10-17 05:57:59 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.150ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.430ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 422.350ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.530ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.840ms 2018-10-17 05:58:59 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 2.960ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 3.100ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 696.930ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 9.910ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.660ms 2018-10-17 05:59:59 controller: AlarmController action: getAlarmData select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc 3.200ms select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0 2.950ms select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id` 733.130ms select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc 3.960ms select * from `admin_users` where `admin_users`.`id` = 6 limit 1 2.900ms
drop table rate_template_update; create table rate_template_update ( `uid` varchar(10) not null, `hotel_id` varchar(10) not null, `rate_code` varchar(10) not null, `rate_type_class_code` text default '', `currency_code` text default '', `rate_type_name` text default '', `default_short_description` text default '', `default_long_description` text default '', `active` text default '', `negotiated` text default '', `include_tax_by_default` text default '', `commission_policy` text default '', `default_guarantee_policy` text default '', `default_cancel_policy` text default '', `breakfast_included_in_rate` text default '', `meal_plan` text default '', `rate_category_code` text default '', `derive_type` text default '', `derive_rate_code` text default '', `default_price` text default '', UNIQUE KEY `rate_template_key` (`uid`, `hotel_id`,`rate_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; drop table price_season_template; create table price_season_template ( `uid` varchar(10) not null, `hotel_id` varchar(10) not null, `rate_code` varchar(10) not null, `start_day` text default '', `start_month` text default '', `start_year` text default '', `end_day` text default '', `end_month` text default '', `end_year` text default '', `no_end_date` text default '', `room_code` varchar(10) not null, `base_price` text default '', `derived_formula` text default '', `factor` text default '', `include_tax_by_default` text default '', KEY `price_season_template_key` (`uid`, `hotel_id`,`rate_code`), KEY `price_season_template_key_2` (`uid`, `hotel_id`,`rate_code`,`room_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; drop table hotel_rate_audit; create table hotel_rate_audit ( `uid` varchar(10) not null, `property_hotel_name` text default '', `property_hotel_id` varchar(10) not null, `codes_redx_rate_type_code` varchar(10) not null, `mapping_amadeus` text default '', `mapping_galileo` text default '', `mapping_sabre` text default '', `mapping_worldspan` text default '', KEY `hotel_rate_audit_key` (`uid`, `property_hotel_id`,`codes_redx_rate_type_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; drop table stay_restrictions; create table stay_restrictions ( `uid` varchar(10) not null, `hotel_id` varchar(10) not null, `rate_code` varchar(10) not null, `min_stay_arrival` text default '', UNIQUE KEY `stay_restrictions_key` (`uid`, `hotel_id`,`rate_code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--5b WITH dept_avg_temp AS ( Select deptno, avg(sal) as dept_avg from nikovits.Emp group by deptno ), gen_avg_temp AS ( Select avg(sal) as gen_avg from nikovits.Emp ) Select dname, round(dept_avg, 2), round(gen_avg, 2), abs(round(gen_avg - dept_avg,2)) as sal_diff from nikovits.Dept dept, dept_avg_temp, gen_avg_temp where dept.deptno=dept_avg_temp.deptno; -- copy table from teacher drop table emp2; drop table dept2; CREATE TABLE emp2 AS SELECT * FROM nikovits.emp; CREATE TABLE dept2 AS SELECT * FROM nikovits.dept; --db1_exercise6_DML --1 delete from emp2 where comm is null; --2 delete from emp2 where hiredate < '1982.01.01'; --3 delete from emp2 where deptno in ( select deptno from dept2 where loc='DALLAS' ); --4 delete from emp2 where sal < (select avg(sal) from emp2); --5 delete from emp2 outer where sal < (select avg(sal) from emp2 where deptno= outer.deptno); --6 delete from emp2 where sal = (select max(sal) from emp2); --7 delete from dept2 where deptno in ( select deptno from emp2 join nikovits.sal_cat on sal between lowest_sal and highest_sal where category =2 ); --8 delete from dept2 where deptno in ( select deptno from emp2 join nikovits.sal_cat on sal between lowest_sal and highest_sal where category=2 group by deptno having count (*)>=2 ) ; --9a INSERT INTO emp2 (empno, ename, deptno, hiredate, sal) VALUES (1, 'Smith', 10, SYSDATE, (select avg(sal) from emp2 where deptno=10)) ; --9/b INSERT INTO emp2 (empno, ename, deptno, hiredate, sal) select 1, 'Smith', 10, SYSDATE, (select avg(sal) from emp2 where deptno=10) from dual; --10 UPDATE emp2 SET sal=sal+sal*0.2 WHERE deptno=20; --11 UPDATE emp2 SET sal=sal+500 WHERE comm is null OR sal < (select avg(sal) from emp2); --12 UPDATE emp2 SET comm=coalesce (comm, 0)+(select max(comm) from emp2); --13 UPDATE emp2 SET ename='Poor' WHERE sal = (select min(sal) from emp2); --14 UPDATE emp2 SET comm=coalesce (comm, 0) + 3000 where empno in ( select e.empno from emp2 e join emp2 sub on e.empno = sub.mgr group by e.empno having count (*)>=2 ); --15 UPDATE emp2 SET sal=sal+(select min(sal) from emp2) WHERE empno in ( select e.empno from emp2 e join emp2 sub on e.empno = sub.mgr ); UPDATE emp2 SET sal=sal+(select min(sal) from emp2) WHERE empno in ( select mgr from emp2 ); --16 UPDATE emp2 outer SET sal=sal+(select avg(Sal) from emp2 where deptno=outer.deptno) WHERE empno in ( select empno from emp2 MINUS select mgr from emp2 ); rollback;
BEGIN TRANSACTION; PRAGMA foreign_keys=ON; PRAGMA encoding = "UTF-8"; CREATE TABLE `users` ( `id` INTEGER PRIMARY KEY, `mail_address` TEXT NOT NULL UNIQUE, `member_type` TEXT NOT NULL, `password` TEXT NOT NULL, `created_at` TEXT NOT NULL DEFAULT (DATETIME('now', '+9 hours')), `updated_at` TEXT NOT NULL DEFAULT (DATETIME('now', '+9 hours')), CHECK(member_type = 'passenger' or member_type = 'crew') ); CREATE TABLE `orders` ( `id` INTEGER PRIMARY KEY, `passenger_id` INTEGER NOT NULL, `crew_id` INTEGER, `dispatch_point` TEXT NOT NULL, `order_status` TEXT NOT NULL DEFAULT 'requested', `ordered_at` TEXT NOT NULL DEFAULT (DATETIME('now', '+9 hours')), `estimated_dispatched_at` TEXT, `dispatched_at` TEXT, `completed_at` TEXT, `created_at` TEXT NOT NULL DEFAULT (DATETIME('now', '+9 hours')), `updated_at` TEXT NOT NULL DEFAULT (DATETIME('now', '+9 hours')), FOREIGN KEY (passenger_id) REFERENCES users(id), CHECK(order_status = 'requested' or order_status = 'accepted' or order_status = 'dispatched' or order_status = 'completed') ); CREATE TRIGGER trigger_users_updated_at AFTER UPDATE ON users BEGIN UPDATE users SET updated_at = DATETIME('now', '+9 hours') WHERE id == NEW.id; END; CREATE TRIGGER trigger_orders_updated_at AFTER UPDATE ON orders BEGIN UPDATE orders SET updated_at = DATETIME('now', '+9 hours') WHERE id == NEW.id; END; COMMIT TRANSACTION;