text stringlengths 6 9.38M |
|---|
----------------------------------
-- BCP v1.2.0 New Metadata --
----------------------------------
-- New Columns
ALTER TABLE SPFB_BCP_USERS_MD ADD MAIN_USER SMALLINT;
ALTER TABLE SPFB_BCP_COMPANY_MD ADD MAIN_USER_CODE VARCHAR(8);
ALTER TABLE SPFB_BCP_PRODUCTS_MD ADD REM_WMQFTE_QM VARCHAR(48);
ALTER TABLE SPFB_BCP_PRODUCTS_MD ADD REM_WMQFTE_AGENT VARCHAR(24);
COMMIT;
|
DROP DATABASE IF EXISTS `ticket-selling-system-db`;
CREATE DATABASE `ticket-selling-system-db`;
USE `ticket-selling-system-db`;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
username VARCHAR(255) NOT NULL UNIQUE,
`password` VARCHAR(255) NOT NULL,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
email VARCHAR(255),
`role` ENUM('cashier', 'administrator') NOT NULL
);
DROP TABLE IF EXISTS artists;
CREATE TABLE artists (
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
dj_name VARCHAR(255) UNIQUE,
first_name VARCHAR(255),
last_name VARCHAR(255),
email VARCHAR(255)
);
DROP TABLE IF EXISTS genres;
CREATE TABLE genres (
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
genre VARCHAR(255) NOT NULL UNIQUE
);
DROP TABLE IF EXISTS shows;
CREATE TABLE shows (
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
genre_id BIGINT NOT NULL REFERENCES genres (id),
artist_id BIGINT NOT NULL REFERENCES artists (id),
title VARCHAR(255) NOT NULL UNIQUE,
`date` TIMESTAMP,
nr_of_tickets INT NOT NULL
);
DROP TABLE IF EXISTS tickets;
CREATE TABLE tickets (
id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT UNIQUE,
show_id BIGINT NOT NULL REFERENCES shows (id),
nr_of_places INT NOT NULL
); |
CREATE PROCEDURE sp_count_open_dispatch(@START_DATE datetime,
@END_DATE datetime)
AS
SELECT Count(*) FROM DispatchAbstract
WHERE DispatchDate BETWEEN @START_DATE AND @END_DATE
|
DELIMITER //
DROP PROCEDURE IF EXISTS spGetStates //
CREATE PROCEDURE spGetStates (IN pCountryID INT)
BEGIN
select name from state where countryID = pCountryID;
END; //
delimiter ;
call spGetStates(fnGetCountryID("Costa Rica"));
|
DROP DATABASE IF EXISTS xin_viec_db;
CREATE DATABASE xin_viec_db;
USE xin_viec_db;
CREATE TABLE jobs (
id INT NOT NULL AUTO_INCREMENT,
job_name VARCHAR(100) NOT NULL,
job_avatar VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE posts(
id INT NOT NULL AUTO_INCREMENT,
job_id INT NOT NULL,
username VARCHAR(255) NOT NULL,
phone_number TEXT NOT NULL,
post_content TEXT NOT NULL,
job_location TEXT NULL,
experience TEXT NULL,
salary TEXT NULL,
post_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
job_search BOOLEAN NOT NULL DEFAULT TRUE,
PRIMARY KEY (id),
FOREIGN KEY (job_id) REFERENCES jobs(id)
);
-- job_search stands for post that's posted by the ones who looking for a job to work. It is default to true.
|
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: payment
-- ------------------------------------------------------
-- Server version 5.7.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION = @@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE = @@TIME_ZONE */;
/*!40103 SET TIME_ZONE = '+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */;
--
-- Table structure for table `t_alipay_config`
--
DROP TABLE IF EXISTS `t_alipay_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_alipay_config` (
`id` VARCHAR(32) NOT NULL,
`user_id` VARCHAR(32) NOT NULL
COMMENT '用户ID',
`channel` VARCHAR(16) DEFAULT NULL
COMMENT '渠道',
`rate` FLOAT DEFAULT NULL
COMMENT '费率',
`notify_url` VARCHAR(256) DEFAULT NULL,
`partner` VARCHAR(32) DEFAULT NULL
COMMENT '合作者身份(PID)',
`account` VARCHAR(32) DEFAULT NULL
COMMENT '账号',
`security_code` VARCHAR(64) DEFAULT NULL
COMMENT '安全校验码',
`public_key` TEXT COMMENT '公钥',
`private_key` TEXT COMMENT '私钥',
`create_time` DATETIME DEFAULT NULL,
`update_time` DATETIME DEFAULT NULL,
`version` INT(11) DEFAULT NULL,
`paymethod` VARCHAR(500) DEFAULT NULL
COMMENT '支付宝支付,不填支持所有',
`app_id` VARCHAR(500) DEFAULT NULL
COMMENT '支付宝appid',
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_alipay_config`
--
LOCK TABLES `t_alipay_config` WRITE;
/*!40000 ALTER TABLE `t_alipay_config`
DISABLE KEYS */;
INSERT INTO `t_alipay_config` (`id`, `user_id`, `channel`, `rate`, `notify_url`, `partner`, `account`, `security_code`, `public_key`, `private_key`, `create_time`, `update_time`, `version`, `paymethod`, `app_id`)
VALUES ('57ecd15cd4c6cccc7db46adf', '57ecd15cd4c6cccc7db46adc', 'alipay', 0,
'http://payment.dev.sudaotech.com/platform/alipay/{uid}/aliCallback',
'2088521026903864', 'hzyunling@163.com', '90hgwfw0ojyx2esfwq8kbbghe6dcdqsz',
'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDI6d306Q8fIfCOaTXyiUeJHkrIvYISRcc73s3vF1ZT7XN8RNPwJxo8pWaJMmvyTn9N4HQ632qJBVHf8sxHi/fEsraprwCtzvzQETrNRwVxLO5jVmRGi60j8Ue1efIlzPXV9je9mkjzOmdssymZkh2QhUrCmZYI/FCEa3/cNMW0QIDAQAB',
'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDjlowAUck/jRM7BFwSRp6w3zJ7bzCVFC5WdOMqFSxGW8wehutxpxQSNqpxERPTVc2dU6aR1hmmSF1ZzqF0hZfETDxgHvN6vYeQlMbG30lGM0SilNYvHI5+1Dl0dgROQJN/lTt+XVgTDm5gTfRFZYs6g47iy+bbXhniVEt8KBdjie52Gh/+QlrDC/R8dGsPRfFT/ilWhqMS8ZzruIlZ+3GfSodN8AGccpD4vR2bZMjqDU4Mu8B3n1Yz4ok4aaSf4ZBzGqhBwqZnZA9Go6LJwE9X1r0yAV9Q4GZ3HHu0BWAKi0UhBRsrwrOj5EUrRWZidavatSkkfYjK7TpoXeKchTcfAgMBAAECggEAAw82CJcQ3oLV/FgdqL08SuJlOlWPUKG50b22hA1O0A9R2iM0LQ3y7h/AAM8a9h9UKUZDmfhH1f1pC9kEQJ2/IYto0F36Je9AUEg/t9KumHv98zWO/4khvUC7GP6xJiAmG3P1HcjBc1ghUbgajYhE699y30egbdiA/pLlhODBF7xvc9vV+LyBuxC9sBOJ+CLHkma3q07E4sOw6vRUqMIXfe1wPP9NDVU2qZ5AV5SDmEIcDDNbK01M1SuDSN8h5vK+EpRNE5IEqadpL41ehp6RWqf4SGRU5l5LTEyLNyZxMKAiSU5XBeoxk5A3KLW66WQvMPeuTVJRumiSkvKKNl5bqQKBgQDxaDvePp6FYemgjyI/zMKbQrKQaD/pdnhNyLsLpsFbxbN26T0rIhvQcR5BsNSf9vOlNOXBj1fZHCIcUoYFejUjJTxySqRKEE9JOA1hjCtUr/8bby/qa3RgiHvB7W6P2VO5NU9FjgRQmaaJoMgaK5Kace79Hw2uc7J+1AwM6YSF1QKBgQDxWHaRyDfknSWYjobAIXXDkDG3JMcazNU5cj77yRe5cLYbmW1gBzFEysTvuX9BbKXrlgw5/oR4mPV4Hm5LJXx5tJ/WHJNlcYCgAHpWKmBkXHz9MDAZvdjL70FELiJ7nTfc3Uo5gFUN+JOIthvF7oFDoqLu/7xCvNg7SHIK5tm/IwKBgGoqoxmshF64ntyD1lYkoPlTLeCgWGs+NM5QlyIapjLMEY8cKFCN4ZmcBehx8jCflKt1Rg4IEmRjIQU/rb0+75uTRrAk73e7EINs6UWbNXs7I4BXN8VqmHXT0EmLN/J/a3iqX0CBopgn2rvwP9BylTjjHm2neIbeTwPEEcCj+io5AoGBAOKzLe0SHS5pTn9WocynoW7pa0mVClFqRn+HiRIJend+IBEctViWaPktXn+vxpE19USt1R5ErTp6s1j5fLCprZrEx77faLTJQQEKcd+uPo0HM4DAWu5THemx+6SHkWx76ZVVZ/tLSJmu/SZVqRDrUBCwHExTfAtUR+inzDfhUHfxAoGBAL6F8DsEo2uetZLvazNVZGHb9oylS0Lm6LMww/USecdGfxQFzEfpjp3gs000JSFmCdEAKy+eU3gD/rPm7tW7HFxyLOl8y/Vsv0Y6BjXDN24pdR5t5mHr/UPRG7LkApgWxFHfp8YFFnvOL0U797JZ3TV6nNuEJ/NZ8Ou6Yn+nCWjo',
'2016-07-29 18:22:53', '2016-07-29 18:22:53', 0, NULL, '2017032706429399');
/*!40000 ALTER TABLE `t_alipay_config`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_huashipay_config`
--
DROP TABLE IF EXISTS `t_huashipay_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_huashipay_config` (
`id` VARCHAR(32) NOT NULL,
`user_id` VARCHAR(32) NOT NULL
COMMENT '用户ID',
`channel` VARCHAR(16) DEFAULT NULL
COMMENT '渠道',
`rate` FLOAT DEFAULT NULL
COMMENT '费率',
`notify_url` VARCHAR(256) DEFAULT NULL,
`channelid` VARCHAR(64) DEFAULT NULL
COMMENT '华势分配的渠道编号',
`merid` VARCHAR(64) DEFAULT NULL
COMMENT '华势分配的商户编号',
`termid` VARCHAR(64) DEFAULT NULL
COMMENT '华势分配的终端编号',
`secert` VARCHAR(64) DEFAULT NULL
COMMENT '华势分配的渠道密钥',
`key` VARCHAR(64) DEFAULT NULL
COMMENT '请求的签名参数',
`create_time` DATETIME DEFAULT NULL,
`update_time` DATETIME DEFAULT NULL,
`version` INT(11) DEFAULT NULL,
`bind_app_id` VARCHAR(64) DEFAULT NULL,
`bind_app_secret` VARCHAR(64) DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_huashipay_config`
--
LOCK TABLES `t_huashipay_config` WRITE;
/*!40000 ALTER TABLE `t_huashipay_config`
DISABLE KEYS */;
/*!40000 ALTER TABLE `t_huashipay_config`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_order`
--
DROP TABLE IF EXISTS `t_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order` (
`id` VARCHAR(32) NOT NULL,
`uid` VARCHAR(32) NOT NULL,
`created` DATETIME DEFAULT NULL,
`paid` TINYINT(1) DEFAULT NULL,
`refunded` TINYINT(1) DEFAULT NULL,
`channel` VARCHAR(16) DEFAULT NULL,
`order_no` VARCHAR(32) DEFAULT NULL,
`client_ip` VARCHAR(16) DEFAULT NULL,
`amount` INT(11) DEFAULT NULL,
`amount_settle` INT(11) DEFAULT NULL,
`currency` VARCHAR(8) DEFAULT NULL,
`subject` VARCHAR(32) DEFAULT NULL,
`body` VARCHAR(128) DEFAULT NULL,
`time_paid` DATETIME DEFAULT NULL,
`time_expire` DATETIME DEFAULT NULL,
`transaction_no` VARCHAR(32) DEFAULT NULL,
`amount_refunded` INT(11) DEFAULT NULL,
`failure_code` VARCHAR(32) DEFAULT NULL,
`failure_msg` VARCHAR(32) DEFAULT NULL,
`description` VARCHAR(256) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uid_order_no_unique` (`uid`, `order_no`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_order`
--
LOCK TABLES `t_order` WRITE;
/*!40000 ALTER TABLE `t_order`
DISABLE KEYS */;
INSERT INTO `t_order` (`id`, `uid`, `created`, `paid`, `refunded`, `channel`, `order_no`, `client_ip`, `amount`, `amount_settle`, `currency`, `subject`, `body`, `time_paid`, `time_expire`, `transaction_no`, `amount_refunded`, `failure_code`, `failure_msg`, `description`)
VALUES ('59191dd946ec2b2229c44bec', '57ecd15cd4c6cccc7db46adc', '2017-05-15 11:17:45', 0, 0, 'alipay', '0021',
'116.226.237.168', 10000, 100, 'cny', 'haha-subject', 'haha-body', NULL,
'2017-05-15 14:17:45', '', 0, '0', '成功', ''),
('5919704a46ecd9cd1da19826', '57ecd15cd4c6cccc7db46adc', '2017-05-15 17:09:30', 0, 0, 'alipay', 'FW1', '127.0.0.1', 1,
100, 'cny', '乐宝时代-购买服务', '{\"order_no\":\"FW1\",\"userId\":2}', NULL,
'2017-05-15 20:09:30', '', 0, '0', '成功', '');
/*!40000 ALTER TABLE `t_order`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_order_notify`
--
DROP TABLE IF EXISTS `t_order_notify`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order_notify` (
`id` VARCHAR(32) NOT NULL,
`transcation_id` VARCHAR(32) DEFAULT NULL,
`status` VARCHAR(8) DEFAULT NULL,
`stage` INT(11) DEFAULT NULL,
`execution_time` DATETIME DEFAULT NULL,
`created` DATETIME DEFAULT NULL,
`updated` DATETIME DEFAULT NULL,
`version` TINYINT(4) DEFAULT '0',
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_order_notify`
--
LOCK TABLES `t_order_notify` WRITE;
/*!40000 ALTER TABLE `t_order_notify`
DISABLE KEYS */;
/*!40000 ALTER TABLE `t_order_notify`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_order_trace`
--
DROP TABLE IF EXISTS `t_order_trace`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_order_trace` (
`id` VARCHAR(32) NOT NULL,
`uid` VARCHAR(32) DEFAULT NULL,
`channel` VARCHAR(16) DEFAULT NULL,
`order_no` VARCHAR(32) DEFAULT NULL,
`created` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uidx_uid_channel_order_no` (`uid`, `channel`, `order_no`) USING BTREE,
KEY `idx_created` (`created`) USING BTREE,
KEY `idx_uid_order_no` (`uid`, `order_no`) USING BTREE
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_order_trace`
--
LOCK TABLES `t_order_trace` WRITE;
/*!40000 ALTER TABLE `t_order_trace`
DISABLE KEYS */;
INSERT INTO `t_order_trace` (`id`, `uid`, `channel`, `order_no`, `created`)
VALUES ('59191dd946ec2b2229c44bed', '57ecd15cd4c6cccc7db46adc', 'alipay', '0021', '2017-05-15 11:17:45'),
('5919704a46ecd9cd1da19827', '57ecd15cd4c6cccc7db46adc', 'alipay', 'FW1', '2017-05-15 17:09:30');
/*!40000 ALTER TABLE `t_order_trace`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_rest_user`
--
DROP TABLE IF EXISTS `t_rest_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_rest_user` (
`id` VARCHAR(32) NOT NULL
COMMENT 'ID',
`username` VARCHAR(16) NOT NULL
COMMENT '用户名',
`password` VARCHAR(16) DEFAULT NULL
COMMENT '密码',
`enabled` TINYINT(1) DEFAULT NULL
COMMENT '启用状态',
`create_time` DATETIME DEFAULT NULL
COMMENT '创建时间',
`update_time` DATETIME DEFAULT NULL
COMMENT '更新时间',
`version` INT(11) NOT NULL DEFAULT '0'
COMMENT '版本号',
PRIMARY KEY (`id`),
KEY `index_username` (`username`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_rest_user`
--
LOCK TABLES `t_rest_user` WRITE;
/*!40000 ALTER TABLE `t_rest_user`
DISABLE KEYS */;
INSERT INTO `t_rest_user` (`id`, `username`, `password`, `enabled`, `create_time`, `update_time`, `version`)
VALUES ('57ecd15cd4c6cccc7db46adc', 'sd-lebao', 'sd-lebao', 1, '2016-05-05 18:22:53', '2016-05-05 18:22:53', 0);
/*!40000 ALTER TABLE `t_rest_user`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_rest_user_authority`
--
DROP TABLE IF EXISTS `t_rest_user_authority`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_rest_user_authority` (
`id` VARCHAR(32) NOT NULL,
`uid` VARCHAR(32) NOT NULL
COMMENT '用户ID',
`authority` VARCHAR(16) NOT NULL
COMMENT '权限',
PRIMARY KEY (`id`),
KEY `index_uid` (`uid`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_rest_user_authority`
--
LOCK TABLES `t_rest_user_authority` WRITE;
/*!40000 ALTER TABLE `t_rest_user_authority`
DISABLE KEYS */;
INSERT INTO `t_rest_user_authority` (`id`, `uid`, `authority`)
VALUES ('57ecd15cd4c6cccc7db46add', '57ecd15cd4c6cccc7db46adc', 'ROLE_API');
/*!40000 ALTER TABLE `t_rest_user_authority`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_user_notify_config`
--
DROP TABLE IF EXISTS `t_user_notify_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_user_notify_config` (
`id` VARCHAR(32) NOT NULL,
`user_id` VARCHAR(32) NOT NULL,
`notify_url` VARCHAR(256) NOT NULL,
`env_type` TINYINT(4) DEFAULT NULL,
`create_time` DATETIME DEFAULT NULL,
`update_time` DATETIME DEFAULT NULL,
`version` INT(11) DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_user_notify_config`
--
LOCK TABLES `t_user_notify_config` WRITE;
/*!40000 ALTER TABLE `t_user_notify_config`
DISABLE KEYS */;
INSERT INTO `t_user_notify_config` (`id`, `user_id`, `notify_url`, `env_type`, `create_time`, `update_time`, `version`)
VALUES ('57ecd15cd4c6cccc7db46ade', '57ecd15cd4c6cccc7db46adc', 'http://localhost:9041/platform/app/pay/callback', 0,
'2016-08-22 14:43:42', '2016-08-22 14:43:44', NULL);
/*!40000 ALTER TABLE `t_user_notify_config`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_wxpay_config`
--
DROP TABLE IF EXISTS `t_wxpay_config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_wxpay_config` (
`id` VARCHAR(32) NOT NULL,
`user_id` VARCHAR(32) DEFAULT NULL
COMMENT '用户ID',
`channel` VARCHAR(16) DEFAULT NULL
COMMENT '渠道',
`rate` FLOAT DEFAULT NULL
COMMENT '费率',
`notify_url` VARCHAR(256) DEFAULT NULL,
`app_id` VARCHAR(32) DEFAULT NULL
COMMENT '微信 App ID (微信开放平台 => 管理中心 => 移动应用 => 查看)',
`app_secret` VARCHAR(64) DEFAULT NULL
COMMENT 'AppSecret (微信开放平台 => 管理中心 => 移动应用 => 查看)',
`partner` VARCHAR(16) DEFAULT NULL
COMMENT '微信支付商户号 (微信支付申请完成之后,在微信商户平台的通知邮件中获取,请确保邮件上的 AppID 与微信开放平台上的 AppID 一致)',
`partner_key` VARCHAR(32) DEFAULT NULL
COMMENT 'API 密钥 微信商户平台=> API 安全=>设置密钥,将设置的32位密钥填入此处',
`account` VARCHAR(32) DEFAULT NULL
COMMENT '员工登录帐号 (微信商户平台=>员工账号=>新增员工账号,将员工的登录账号填入此处)',
`api_client_cert` TEXT COMMENT 'pem 格式,用于退款及退款查询。微信商户平台 => API 安全 => API 证书 =>下载证书',
`api_client_key` TEXT COMMENT 'pem 格式,用于退款及退款查询。微信商户平台 => API 安全 => API 证书 =>下载证书',
`create_time` DATETIME DEFAULT NULL,
`update_time` DATETIME DEFAULT NULL,
`version` INT(11) DEFAULT '0',
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_wxpay_config`
--
LOCK TABLES `t_wxpay_config` WRITE;
/*!40000 ALTER TABLE `t_wxpay_config`
DISABLE KEYS */;
INSERT INTO `t_wxpay_config` (`id`, `user_id`, `channel`, `rate`, `notify_url`, `app_id`, `app_secret`, `partner`, `partner_key`, `account`, `api_client_cert`, `api_client_key`, `create_time`, `update_time`, `version`)
VALUES
('57ecd15cd4c6cccc7db46ae0', '57ecd15cd4c6cccc7db46adc', 'wx', 0, 'http://bigbox100.com/payment/wxpay/{uid}/callback',
'wxd51de813b211d5e6', 'b8383db2be86776d317243c094a12e2d', '1406924302',
'QxUaWjz06MhyDoYRf2BemsZTVPIFGc3b', NULL, NULL, NULL, '2016-05-05 18:22:53',
'2016-05-05 18:22:53', 0);
/*!40000 ALTER TABLE `t_wxpay_config`
ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE = @OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE = @OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT = @OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS = @OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION = @OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES = @OLD_SQL_NOTES */;
-- Dump completed on 2017-05-17 19:27:15
|
/*
* Project:Easy Web Framework
* Description:
* EasyFK stands for Easy Web Framework.It's an open source product for E-Business / E-Commerce.It
* was launched by a chinese Hezhiping(QQ:110476592) in 2015.The goal of EasyFK is to provide a
* foundation and starting point for reliable, secure , simple-to-use ,cost-effective ,scalable
* and suitable-for-Chinese E-Business / E-Commerce solutions. With EasyFK, you can get started
* right away without the huge deployment and maintenance costs of E-Business / E-Commerce systems.
* Of course, you can customize it or use it as a framework to implement your most challenging business needs.
* EasyFk is licensed under the Apache License Version 2.0. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Author:hezhiping Email:110476592@qq.com
*/
CREATE TABLE IF NOT EXISTS `security_group` (
`GROUP_ID` varchar(20) NOT NULL,
`NAME` varchar(100) default NULL,
`DESCRIPTION` varchar(255) default NULL,
`IS_SYSTEM` char(1) default 'N',
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`GROUP_ID`),
KEY `SCRT_GRP_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
KEY `SCRT_GRP_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for security_group_permission
-- ----------------------------
CREATE TABLE IF NOT EXISTS `security_group_permission` (
`GROUP_ID` varchar(20) NOT NULL,
`PERMISSION_ID` varchar(60) NOT NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`GROUP_ID`,`PERMISSION_ID`),
KEY `SEC_GRP_PERM_GRP` (`GROUP_ID`),
KEY `SCT_GRP_PRMN_TXSTP` (`LAST_UPDATED_TX_STAMP`),
KEY `SCT_GRP_PRMN_TXCRS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for security_permission
-- add PERMISSION_TAG field for shiro permission
-- ----------------------------
CREATE TABLE IF NOT EXISTS `security_permission` (
`PERMISSION_ID` varchar(60) NOT NULL,
`DESCRIPTION` varchar(255) default NULL,
`DYNAMIC_ACCESS` varchar(255) default NULL,
`PERMISSION_TAG` varchar(60) NOT NULL ,
`PARENT_ID` varchar(60) NOT NULL,
`IS_SYSTEM` char(1) default 'N',
`RELATIVE_CLASS` varchar(255) default NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`PERMISSION_ID`),
KEY `SCRT_PRMSSN_TXSTMP` (`LAST_UPDATED_TX_STAMP`),
KEY `SCRT_PRMSSN_TXCRTS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for security_permission_auto_grant
-- ----------------------------
CREATE TABLE IF NOT EXISTS `security_permission_auto_grant` (
`PERMISSION_ID` varchar(60) NOT NULL,
`GRANT_PERMISSION` varchar(250) NOT NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`PERMISSION_ID`,`GRANT_PERMISSION`),
KEY `SEC_PERM_AUTO_GRNT` (`PERMISSION_ID`),
KEY `SCT_PRN_AT_GRT_TXP` (`LAST_UPDATED_TX_STAMP`),
KEY `SCT_PRN_AT_GRT_TXS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user_login_security_group
-- ----------------------------
CREATE TABLE IF NOT EXISTS `user_login_security_group` (
`USER_LOGIN_ID` varchar(250) NOT NULL,
`GROUP_ID` varchar(20) NOT NULL,
`FROM_DATE` datetime NOT NULL,
`THRU_DATE` datetime default NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`USER_LOGIN_ID`,`GROUP_ID`,`FROM_DATE`),
KEY `USER_SECGRP_USER` (`USER_LOGIN_ID`),
KEY `USER_SECGRP_GRP` (`GROUP_ID`),
KEY `USR_LGN_SCT_GRP_TP` (`LAST_UPDATED_TX_STAMP`),
KEY `USR_LGN_SCT_GRP_TS` (`CREATED_TX_STAMP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `role_type` (
`ROLE_TYPE_ID` varchar(20) NOT NULL,
`PARENT_TYPE_ID` varchar(20) default NULL,
`HAS_TABLE` char(1) default NULL,
`DESCRIPTION` varchar(255) default NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`ROLE_TYPE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for role_type_attr
-- ----------------------------
CREATE TABLE IF NOT EXISTS `role_type_attr` (
`ROLE_TYPE_ID` varchar(20) NOT NULL,
`ATTR_NAME` varchar(60) NOT NULL,
`LAST_UPDATED_STAMP` datetime default NULL,
`LAST_UPDATED_TX_STAMP` datetime default NULL,
`CREATED_STAMP` datetime default NULL,
`CREATED_TX_STAMP` datetime default NULL,
PRIMARY KEY (`ROLE_TYPE_ID`,`ATTR_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
select t.id,t.nombre,f.nombre,aca.nombre from umg_carrera t
join umg_facultad_gradoacademico fac on fac.id = t.id_facultad_academico
join umg_grado_academico aca on aca.id = fac.id_grado_academico
join umg_facultad f on f.id = fac.id_facultad;
select t.id, aca.nombre from umg_facultad_gradoacademico t
join umg_grado_academico aca on aca.id = t.id_grado_academico where t.id_facultad = 5;
select fac.id, fac.nombre from umg_sede_facultad_carrera t
join umg_carrera carr on carr.id = t.id_carrera
join umg_facultad_gradoacademico aca on aca.id = carr.id_facultad_academico
join umg_facultad fac on fac.id = aca.id_facultad group by fac.id;
select t.nombre , aca.nombre from umg_carrera t
join umg_facultad_gradoacademico gra on gra.id = t.id_facultad_academico
join umg_grado_academico aca on aca.id = gra.id_grado_academico
and gra.id_facultad = 7; |
/* Создание просмотра водителей на сменах с положительным балансом */
CREATE VIEW /*PREFIX*/S_DRIVER_POSITIVE_SHIFTS
AS
SELECT *
FROM /*PREFIX*/S_DRIVER_SHIFTS
WHERE (MIN_BALANCE IS NULL)
OR (ACTUAL_BALANCE>MIN_BALANCE)
--
/* Фиксация изменений */
COMMIT |
# Report the number of orders 'On Hold' for each customer.
SELECT customerName, COUNT(orderNumber) FROM Customers
JOIN Orders ON Customers.customerNumber = Orders.customerNumber
WHERE status='on hold'
GROUP BY 1 |
-- USER is a reserved keyword with Postgres
-- You must use double quotes in every query that user is in:
-- ex. SELECT * FROM "user";
-- Otherwise you will have errors!
CREATE TABLE "user" (
"id" SERIAL PRIMARY KEY,
"username" VARCHAR (80) UNIQUE NOT NULL,
"password" VARCHAR (1000) NOT NULL
);
CREATE TABLE "group" (
"id" SERIAL PRIMARY KEY,
"group_name" VARCHAR (80) UNIQUE NOT NULL,
"admin" INT REFERENCES "user"
);
CREATE TABLE "user_group" (
"id" SERIAL PRIMARY KEY,
"group_id" INT REFERENCES "group",
"user_id" INT REFERENCES "user");
CREATE TABLE "genres"
(
"id" SERIAL PRIMARY KEY,
"genre_name" VARCHAR (80) UNIQUE NOT NULL,
"tmdb" INT);
INSERT INTO "genres" ("genre_name", "tmdb") VALUES ("Action", 28), ("Adventure", 12), ("Animation", 16),
("Comedy", 35), ("Crime", 80), ("Documentary", 99), ("Drama", 18), ("Family", 10751), ("Fantasy", 14), ("History", 36),
("Horror", 27), ("Music", 10402), ("Mystery", 9648), ("Romance", 10749), ("Science Fiction", 878), ("TV Movie", 10770),
("Thriller", 53), ("War", 10752), ("Western", 37);
CREATE TABLE "user_genres"
(
"id" SERIAL PRIMARY KEY,
"user_id" INT REFERENCES "user",
"genre_id" INT REFERENCES "genres",
"like" boolean
);
CREATE TABLE "group_genres"
(
"id" SERIAL PRIMARY KEY,
"group_id" INT REFERENCES "group",
"genre_id" INT REFERENCES "genres",
"like" boolean
);
CREATE TABLE "movies"
(
"id" SERIAL PRIMARY KEY,
"title" VARCHAR,
"description" VARCHAR,
"poster_path" VARCHAR
);
CREATE TABLE "user_movies"
(
"id" SERIAL PRIMARY KEY,
"user_id" INT REFERENCES "user",
"movie_id" INT REFERENCES "movies"
);
CREATE TABLE "group_movies"
(
"id" SERIAL PRIMARY KEY,
"group_id" INT REFERENCES "group",
"movie_id" INT REFERENCES "movies"
); |
--13.1
EXEC Northwind.GreatestOrders 5, 1998
EXEC Northwind.GreatestOrders 4, 1996
--Проверочный запрос
SELECT OrderID, e.FirstName , ' ', e.LastName AS Person, Price
FROM northwind.employees AS e
INNER JOIN
( SELECT odmax.EmployeeID, OrderID, MAX(odmax.Price) AS Price
FROM
( SELECT o.EmployeeID, od.OrderID AS OrderID,
SUM(od.Quantity * od.UnitPrice * (1 - od.Discount)) AS Price
FROM Northwind.[Order Details] AS od
INNER JOIN Northwind.orders AS o
ON o.OrderID = od.OrderID
GROUP BY od.OrderID, o.EmployeeID ) AS odmax
GROUP BY odmax.EmployeeID, odmax.OrderID) AS max
ON max.EmployeeID = e.EmployeeID
ORDER BY Person
--13.2
EXEC Northwind.ShippedOrdersDiff 35
EXEC Northwind.ShippedOrdersDiff 4
--13.4
SELECT Northwind.IsBoss(1) AS Boss
SELECT Northwind.IsBoss(2) AS Boss
SELECT Northwind.IsBoss(3) AS Boss
SELECT Northwind.IsBoss(4) AS Boss
SELECT Northwind.IsBoss(5) AS Boss
SELECT Northwind.IsBoss(6) AS Boss
SELECT Northwind.IsBoss(7) AS Boss
SELECT Northwind.IsBoss(8) AS Boss
SELECT Northwind.IsBoss(9) AS Boss
--13.3
EXEC Northwind.SubordinationInfo 2
EXEC Northwind.SubordinationInfo 5
EXEC Northwind.SubordinationInfo 8 |
[데드락(DEAD LOCK)을 발생하고 결과를 확인한다 - SESSION 1]
2) '장각' 학생의 행에 독점 잠금이 발생됨
'관우' 학생의 수정을 시도했으나 상대 SESSION 0의
독점 잠금에 의해 WAIT 상태로 진입하게 된다
SELECT SNO, SNAME, MAJOR
FROM STUDENT
WHERE SNAME IN ('관우', '장각');
UPDATE STUDENT SET MAJOR = '경제'
WHERE SNAME = '장각';
UPDATE STUDENT SET MAJOR = '경제'
WHERE SNAME = '관우';
|
SELECT
dados.vinicola
FROM (SELECT
va.nome as vinicola, COUNT(*) as qtd_vinho
FROM
vinicola va
INNER JOIN vinho vo ON
vo.fk_vinicola = va.codigo
GROUP BY
va.nome) as dados
WHERE
dados.qtd_vinho > 2 |
insert into customer(id,first_name,last_name,email,password)
values(10001,'kamet','saklani','kamet4u@gmail.com','test123'); |
###################################################
# add a new foreign key in variation and variaiton_synonym table, to allow get variations by source
###################################################
ALTER TABLE variation ADD KEY source_idx (source_id);
ALTER TABLE variation_synonym ADD KEY source_idx (source_id);
INSERT INTO meta (meta_key, meta_value) VALUES ('patch', 'patch_47_48_b.sql|source_id key');
|
/****** Object: UserDefinedFunction [dbo].[fnc_CWI_GetJobAdType] Script Date: 3/15/2014 9:48:25 PM ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fnc_CWI_GetJobAdType]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[fnc_CWI_GetJobAdType]
GO
/****** Object: UserDefinedFunction [dbo].[fnc_CWI_GetJobAdType] Script Date: 3/15/2014 9:48:25 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].[fnc_CWI_GetJobAdType]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
BEGIN
execute dbo.sp_executesql @statement = N'
/*
SELECT dbo.fnc_CWI_GetJobAdType(1315)
*/
CREATE FUNCTION [dbo].[fnc_CWI_GetJobAdType]
(
@JobId bigint
)
RETURNS
varchar(max)
AS
BEGIN
DECLARE @adtype varchar(max) = ''''
select top 1 @adtype = LA.LookupName from dbo.fnc_GetJobSummaryTemplateData(@jobId)
INNER JOIN Lookup LA
ON LA.Id = (CASE WHEN ISNUMERIC(FieldValue) = 1 THEN CAST(FieldValue AS int)
ELSE 0 END)
where MappingFieldId = 20208 /* Ad Type */
RETURN @adtype
END
'
END
GO
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 15, 2018 at 06:02 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `trainingcenter`
--
-- --------------------------------------------------------
--
-- Table structure for table `students`
--
CREATE TABLE `students` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`surname` varchar(30) NOT NULL,
`phone` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tokens`
--
CREATE TABLE `tokens` (
`userId` int(11) NOT NULL,
`token` varchar(64) NOT NULL,
`expDate` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tokens`
--
INSERT INTO `tokens` (`userId`, `token`, `expDate`) VALUES
(1, '7AryH8ydKsn3n7vVJrXam7T0aaaJrybuTpOFw8z9WTQKz9hSxzCyeWWD07DbmU1V', '2018-06-13 18:19:03'),
(1, '9gMPw4WHM5k3DD3OKiHOfluj2xii9ILVrZvmF4106pBe6LygstGXWeLtOdmhAKh6', '2018-06-19 21:05:36'),
(1, 'GXqDzpbGVWOhagmOWAZt5eaafdW4tXrkcWgJ2gVhZXrsJD5CTu8CZTNueSzetXiA', '2018-06-16 19:24:59');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(24) NOT NULL,
`surname` varchar(24) NOT NULL,
`email` tinytext NOT NULL,
`phone` varchar(20) NOT NULL,
`username` varchar(24) NOT NULL,
`password` varchar(64) NOT NULL,
`privilege` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`avatar` tinytext
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `surname`, `email`, `phone`, `username`, `password`, `privilege`, `avatar`) VALUES
(1, 'Sargis', '', '', '', 'admin', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', 0, NULL),
(2, 'Sargis', 'Shahinyan', 'shahinyan.sargis@gmail.com', '037-49-43-64', 'admin', '0ffe1abd1a08215353c233d6e009613e95eec4253832a761af28ff37ac5a150c', 1, '/img/avatars/275c277a24858eda2ed14e68cdc1fb76a8204fb49f248ebdcbb945bac5adf77a.png');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `students`
--
ALTER TABLE `students`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tokens`
--
ALTER TABLE `tokens`
ADD PRIMARY KEY (`userId`,`token`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `students`
--
ALTER TABLE `students`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `tokens`
--
ALTER TABLE `tokens`
ADD CONSTRAINT `tokens_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`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 */;
|
alter table tblComment alter column UserRef int null
alter table relUserRole add constraint PK_relUserRole
primary key (UserRef, RoleRef) |
# patch_45_46_d.sql
#
# title: Meta unique key
#
# description:
# Add unique key to meta_key/meta_value columns in meta table.
ALTER TABLE meta ADD UNIQUE key_value (meta_key, meta_value);
# patch identifier
INSERT INTO meta (meta_key, meta_value) VALUES ('patch', 'patch_45_46_d.sql|meta_unique_key');
|
CREATE DATABASE umuzi:
USE umuzi;
CREATE TABLE Customers(
CustomerID int (11) NOT NULL AUTO_INCREMENT,
FirstName varchar(50) DEFAULT NULL,
LastName varchar(50) DEFAULT NULL,
Gender varchar(20) DEFAULT NULL,
Address varchar(200) DEFAULT NULL,
Phone bigint(20) DEFAULT NULL,
Email varchar(100) DEFAULT NULL,
City varchar(20)
Country varchar(50) DEFAULT NULL,
PRIMARY KEY(CustomerID)
);
INSERT INTO Customers VALUES(1,'John','Hibert','Male','284 chaucer st',84789657,'john@gmail.com','Johannesburg','South Africa'),
(2,'Thando','Sithole','Female','240 Sect 1',794445584,'thando@gmail.com','Cape Town','South Africa'),
(3,'Leon','Glen','Male','81 Everton RD,Gilits',820332830,'Leon@gmail.com','Durban','South Africa'),
(4,'charl','Muller','Male','290A Dorset Ecke',44856872553,'Berlin','Germany'),
(5,'Julia','Stein','Female','2 Wernerring',448672445058,'Js234@gmail.com','Frankfurt','Germany');
CREATE TABLE Employees(
EmployeeID int (11) NOT NULL AUTO_INCREMENT,
FirstName varchar(50) DEFAULT NULL,
LastName varchar(50) DEFAULT NULL,
Email varchar(100) DEFAULT NULL,
JobTittle varchar(50) DEFAULT NULL,
PRIMARY KEY(EmployeeID)
);
INSERT INTO Employees VALUES(1,'Kani','Matthew','mat@gmail.com','Manager'),
(2,'Lesly','Cronje','LesC@gmail.com','Clerk'),
(3,'Gideon','Maduku','m@gmail.com','Account');
CREATE TABLE Orders (
OrderID int (11) NOT NULL AUTO_INCREMENT,
ProductID int(11) DEFAULT NULL,
PaymentID int(11) DEFAULT NULL,
FilfilledByEmployeeID int(11) DEFAULT NULL,
DateRequired datetime DEFAULT NULL,
DateShipped datetime DEFAULT NULL,
Status varchar(20) DEFAULT NULL,
PRIMARY KEY(OrderID)
);
INSERT INTO Orders VALUES(1,1,1,2,'2018-09-05 00:00:00',NULL,'Not shipped'),
(2,1,2,2,'2018-09-04 00:00:00','2018-09-03 00:00:00','Shipped'),
(3,3,3,3,'2018-09-06',NULL,'Not shipped');
CREATE TABLE Payments(
CustomerID int (11) NOT NULL AUTO_INCREMENT,
PaymentsID int(11) DEFAULT NULL,
PaymentDate datetime DEFAULT NULL,
Amount decimal(10,2) DEFAULT NULL
PRIMARY KEY(CustomerID)
);
INSERT INTO Payments VALUES(1,1,'2018-09-01 00:00:00',150.75),
(5,2,'2018-09-03 00:00:00',150.75),
(4,3,'2018-09-03',700.60);
CREATE TABLE Products(
ProductID int (11) NOT NULL AUTO_INCREMENT,
ProductName varchar(100) DEFAULT NULL,
Description varchar(300) DEFAULT NULL,
BuyPrice decimal(10,2) DEFAULT NULL,
PRIMARY KEY(ProductID)
);
INSERT INTO Products VALUES(1,'Herley Davidson Chopper','This replica features working kickstand, front suspension, gear-shift lever',150.75),
(2,'Classic Car','Turnable front wheels, steering function',550.75),
(3,'Sports car','Turnable front wheels,steering function',700.60);
|
// constraints
CREATE CONSTRAINT ON (track:Songs) ASSERT track.id IS UNIQUE;
CREATE CONSTRAINT ON (arts:Artists) ASSERT arts.artists IS UNIQUE;
// INDEXES
CREATE INDEX FOR (track:Songs) ON (track.name, track.id, track.artists, track.genres, track.year);
CREATE INDEX FOR (arts:Artists) ON (arts.artists, arts.track, arts.genres);
CREATE INDEX FOR (temp_arts:Arts) ON(temp_arts.artists, temp_arts.genres);
CREATE INDEX FOR (genre:Genres) ON (genre.genres, genre.artists);
CREATE INDEX FOR (era:Years) ON (era.year, era.artists);
// id: The Spotify ID for the track.
// duration_ms
// The duration of the track in milliseconds.
// mode
// Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.
// genres
// A list of the genres the artist is associated with. For example: "Prog Rock" , "Post-Grunge". (If not yet classified, the array is empty.)
// popularity
// The popularity of the artist. The value will be between 0 and 100, with 100 being the most popular. The artist’s popularity is calculated from the popularity of all the artist’s tracks.
CREATE INDEX ON :Popstars(popularity);
CREATE INDEX ON :Promising(popularity);
CREATE INDEX ON :Wannabes(popularity);
CREATE INDEX ON :Flops(popularity);
// valence
// A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry).
CREATE INDEX ON :HappyGoLucky(mood);
CREATE INDEX ON :BrokenHearted(mood);
// acousticness
// A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.
CREATE INDEX ON :Acoustic(acousticness);
// liveness
// Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.
CREATE INDEX ON :CrowdPleaser(live);
CREATE INDEX ON :Studio(live);
// danceability
// Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.
CREATE INDEX ON :DanceMonkey(dance);
CREATE INDEX ON :CantDance(dance);
// energy
// Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.
CREATE INDEX ON :AdrenalineJunky(energy);
CREATE INDEX ON :Balanced(energy);
CREATE INDEX ON :NoPulse(energy);
// instrumentalness
// Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal”. The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0.
CREATE INDEX ON :Vocal(instrumentalness);
CREATE INDEX ON :PopBand(instrumentalness);
CREATE INDEX ON :Instrumental(instrumentalness);
// loudness
// The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db.
CREATE INDEX ON :Loud(loudness);
CREATE INDEX ON :Soft(loudness);
// Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks.
CREATE INDEX ON :Lyrical(speechiness);
CREATE INDEX ON :Mainstream(speechiness);
CREATE INDEX ON :Musical(speechiness);
// tempo
// The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration.
CREATE INDEX ON :HighTempo(tempo);
CREATE INDEX ON :BalancedTempo(tempo);
CREATE INDEX ON :LowTempo(tempo);
// Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.
// The key the track is in. Integers map to pitches using standard Pitch Class notation . E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. |
DROP TABLE IF EXISTS girls;
CREATE TABLE girls (
id INTEGER PRIMARY KEY,
name TEXT,
wears_glasses INTEGER,
fave_thing VARCHAR(255),
least_fave_thing VARCHAR(255)
);
|
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%Phone%'
ORDER BY schema_name, table_name;
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%GSM%'
ORDER BY schema_name, table_name; |
SELECT * FROM Students WHERE CreditHours NOT BETWEEN 10 AND 20;
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.1.48-community - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL version: 7.0.0.4140
-- Date/time: 2012-06-06 15:41:07
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;
-- Dumping structure for table app.producttype
CREATE TABLE IF NOT EXISTS `producttype` (
`fldid` int(11) NOT NULL AUTO_INCREMENT,
`fldname` varchar(100) DEFAULT NULL,
PRIMARY KEY (`fldid`),
UNIQUE KEY `fldid` (`fldid`),
UNIQUE KEY `fldname` (`fldname`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- Dumping data for table app.producttype: ~3 rows (approximately)
/*!40000 ALTER TABLE `producttype` DISABLE KEYS */;
INSERT INTO `producttype` (`fldid`, `fldname`) VALUES
(2, 'Döner'),
(3, 'Kokoreç'),
(1, 'Pizza');
/*!40000 ALTER TABLE `producttype` ENABLE KEYS */;
/*!40014 SET FOREIGN_KEY_CHECKS=1 */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
-- +migrate Up
CREATE TABLE IF NOT EXISTS users (
id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL,
-- name varchar(255) NOT NULL,
name varchar(255),
email varchar(255) NOT NULL,
age int,
password varchar(255) NOT NULL,
created_at timestamp NOT NULL,
updated_at timestamp NOT NULL,
deleted_at timestamp
);
-- +migrate Down
DROP TABLE IF EXISTS users; |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 13, 2020 at 11:43 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `cse301`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`username` varchar(6) NOT NULL,
`name` text NOT NULL,
`email` varchar(25) NOT NULL,
`password` varchar(25) NOT NULL,
`phone` text NOT NULL,
`gender` varchar(7) NOT NULL,
`address` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`username`, `name`, `email`, `password`, `phone`, `gender`, `address`) VALUES
('admin', 'Khalid Bin Walid', 'admin@yahoo.com', 'admin', '01856683434', 'Male', 'East Rampura, Dhaka.');
-- --------------------------------------------------------
--
-- Table structure for table `booking`
--
CREATE TABLE `booking` (
`id` int(11) NOT NULL,
`room_no` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `booking`
--
INSERT INTO `booking` (`id`, `room_no`) VALUES
(19010, 101),
(19011, 101);
-- --------------------------------------------------------
--
-- Table structure for table `room`
--
CREATE TABLE `room` (
`room_no` int(11) NOT NULL,
`total_seat` int(11) NOT NULL,
`available_seat` int(11) NOT NULL,
`fee` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `room`
--
INSERT INTO `room` (`room_no`, `total_seat`, `available_seat`, `fee`) VALUES
(101, 5, 5, 2000),
(102, 1, 0, 1000),
(103, 2, 1, 1500);
-- --------------------------------------------------------
--
-- Table structure for table `stay`
--
CREATE TABLE `stay` (
`id` int(11) NOT NULL,
`room_no` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `stay`
--
INSERT INTO `stay` (`id`, `room_no`) VALUES
(19001, 102),
(19002, 103);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` text NOT NULL,
`password` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`phone` text NOT NULL,
`address` text NOT NULL,
`gender` varchar(7) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `password`, `email`, `phone`, `address`, `gender`) VALUES
(19001, 'Asif', 'asif', 'a@gmail.com', '01718475494', 'Rampura', 'Male'),
(19002, 'Nadim', 'nadim', 'n@gmail.com', '029355693', 'Badda', 'Female'),
(19010, 'Test 1', 'test', 'test1@gmail.com', '01823805116', 'Shantinagar, Dhaka.', 'Female'),
(19011, 'Test 2', 'test', 'test2@gmail.com', '01818476464', 'Mirpur, Dhaka.', 'Male');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`username`);
--
-- Indexes for table `booking`
--
ALTER TABLE `booking`
ADD PRIMARY KEY (`id`),
ADD KEY `room_no` (`room_no`);
--
-- Indexes for table `room`
--
ALTER TABLE `room`
ADD PRIMARY KEY (`room_no`);
--
-- Indexes for table `stay`
--
ALTER TABLE `stay`
ADD PRIMARY KEY (`id`),
ADD KEY `room_no` (`room_no`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `room`
--
ALTER TABLE `room`
MODIFY `room_no` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=106;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19012;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `booking`
--
ALTER TABLE `booking`
ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `booking_ibfk_2` FOREIGN KEY (`room_no`) REFERENCES `room` (`room_no`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `stay`
--
ALTER TABLE `stay`
ADD CONSTRAINT `stay_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `stay_ibfk_2` FOREIGN KEY (`room_no`) REFERENCES `room` (`room_no`) 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 */;
|
CREATE DATABASE orders;
USE orders;
CREATE TABLE details (
name VARCHAR (20) NOT NULL,
email VARCHAR (20) NOT NULL,
password VARCHAR (20) NOT NULL,
address VARCHAR (20) NOT NULL,
city VARCHAR (20) NOT NULL,
state VARCHAR (20) NOT NULL,
zipcode VARCHAR (20) NOT NULL,
creditcard VARCHAR (20) NOT NULL,
expiry VARCHAR (20) NOT NULL,
cvv VARCHAR (20) NOT NULL,
billingzip VARCHAR (20) NOT NULL
)
-- mysql -u root < server/schema.sql |
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS projects CASCADE;
DROP TABLE IF EXISTS tests CASCADE;
DROP TABLE IF EXISTS user_project CASCADE;
DROP TABLE IF EXISTS projectMembers CASCADE;
DROP TABLE IF EXISTS projectmembers CASCADE;
DROP TABLE IF EXISTS tasks CASCADE;
DROP TYPE IF EXISTS enum_gender;
DROP TYPE IF EXISTS enum_role;
DROP TYPE IF EXISTS enum_priority;
DROP TYPE IF EXISTS enum_status;
CREATE TYPE enum_gender AS ENUM ('M', 'F', 'O');
CREATE TYPE enum_role AS ENUM ('Coordinator', 'Member', 'Pending');
CREATE TYPE enum_priority AS ENUM('High', 'Medium', 'Low');
CREATE TYPE enum_status AS ENUM('Completed', 'Pending', 'Progress');
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
birthday VARCHAR NOT NULL,
email VARCHAR UNIQUE NOT NULL,
username VARCHAR UNIQUE NOT NULL,
password VARCHAR NOT NULL,
remember_token VARCHAR
);
CREATE TABLE projects(
id SERIAL PRIMARY KEY,
proj_title VARCHAR NOT NULL,
proj_description VARCHAR NOT NULL,
team_size INTEGER NOT NULL,
privacy BOOLEAN NOT NULL
);
CREATE TABLE user_project(
user_id SERIAL references users,
project_id SERIAL references projects,
is_coord BOOLEAN NOT NULL,
PRIMARY KEY(user_id, project_id)
);
CREATE TABLE tests(
id SERIAL PRIMARY KEY,
email VARCHAR UNIQUE NOT NULL,
username VARCHAR UNIQUE NOT NULL,
password VARCHAR NOT NULL,
name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
gender enum_gender NOT NULL,
country VARCHAR NOT NULL
);
CREATE TABLE projectMembers(
project_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
role enum_role NOT NULL,
PRIMARY KEY(project_id, user_id)
);
CREATE TABLE tasks(
task_id SERIAL PRIMARY KEY,
taskOwner INTEGER REFERENCES users NOT NULL,
project_id INTEGER REFERENCES projects NOT NULL,
taskName VARCHAR(60) NOT NULL,
taskDescription VARCHAR(500) NOT NULL,
priority enum_priority NOT NULL,
dateCreated DATE NOT NULL,
dateLimit DATE,
status enum_status
);
INSERT INTO users VALUES (
DEFAULT,
'Andre',
'Marques',
'25/04/1988',
'andremarques@gmail.com',
'andremarques',
'$2y$12$irfoE9SMNlFFnow80p9a4OCZpkYSnSJ8cRM0kxU4/7zk4i5QGP1TG'
); -- Password is andre123. Generated using Hash::make('1234')
INSERT INTO users VALUES (
DEFAULT,
'Julia',
'Pereira',
'12/07/1997',
'juliapereira@gmail.com',
'JuPereira',
'$2y$12$hnpEMqzx/R2P1Nb389TxMOTi5TY1WtvxxBD/nASGKttDcWHdS91Zm'
); -- Password is julia123. Generated using Hash::make('1234')
insert into projects values (DEFAULT, 'Hansen, Hansen and Kilback', 'Curabitur in libero ut massa volutpat convallis. Morbi odio odio, elementum eu, interdum eu, tincidunt in, leo. Maecenas pulvinar lobortis est. Phasellus sit amet erat. Nulla tempus. Vivamus in felis eu sapien cursus vestibulum.', 76, true);
insert into projects values (DEFAULT, 'Wilderman LLC', 'Vestibulum quam sapien, varius ut, blandit non, interdum in, ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis faucibus accumsan odio. Curabitur convallis. Duis consequat dui nec nisi volutpat eleifend. Donec ut dolor. Morbi vel lectus in quam fringilla rhoncus.', 52, false);
insert into projects values (DEFAULT, 'DuBuque-Huels', 'In hac habitasse platea dictumst. Etiam faucibus cursus urna. Ut tellus. Nulla ut erat id mauris vulputate elementum. Nullam varius. Nulla facilisi. Cras non velit nec nisi vulputate nonummy. Maecenas tincidunt lacus at velit. Vivamus vel nulla eget eros elementum pellentesque.', 75, false);
insert into projects values (DEFAULT, 'Franecki and Sons', 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin risus. Praesent lectus. Vestibulum quam sapien, varius ut, blandit non, interdum in, ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis faucibus accumsan odio. Curabitur convallis.', 43, true);
insert into projects values (DEFAULT, 'O''Connell, Romaguera and Roob', 'Duis aliquam convallis nunc. Proin at turpis a pede posuere nonummy. Integer non velit. Donec diam neque, vestibulum eget, vulputate ut, ultrices vel, augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec pharetra, magna vestibulum aliquet ultrices, erat tortor sollicitudin mi, sit amet lobortis sapien sapien non mi. Integer ac neque. Duis bibendum. Morbi non quam nec dui luctus rutrum. Nulla tellus.', 61, true);
insert into projects values (DEFAULT, 'Mann Inc', 'In hac habitasse platea dictumst. Etiam faucibus cursus urna. Ut tellus. Nulla ut erat id mauris vulputate elementum. Nullam varius. Nulla facilisi.', 93, true);
|
CREATE TABLE `city` (
`id` INT(255) NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`state_id` INT NOT NULL,
`coordinates` POINT NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `news` (
`id` INT NOT NULL AUTO_INCREMENT,
`city_id` INT,
`state_id` INT,
`date` DATETIME NOT NULL,
`title` VARCHAR(255) NOT NULL,
`url` TEXT NOT NULL,
`source_id` INT NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `state` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `source` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`type` TEXT NOT NULL,
PRIMARY KEY (`id`)
);
ALTER TABLE `city` ADD CONSTRAINT `city_fk0` FOREIGN KEY (`state`) REFERENCES `state`(`id`);
ALTER TABLE `news` ADD CONSTRAINT `news_fk0` FOREIGN KEY (`city_id`) REFERENCES `city`(`id`);
ALTER TABLE `news` ADD CONSTRAINT `news_fk1` FOREIGN KEY (`state_id`) REFERENCES `state`(`id`);
ALTER TABLE `news` ADD CONSTRAINT `news_fk2` FOREIGN KEY (`source_id`) REFERENCES `source`(`id`);
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 23, 2020 at 10:04 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `accounting_codeigniter_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_banks`
--
CREATE TABLE `tbl_banks` (
`bank_id` int(11) NOT NULL,
`bank_name` varchar(100) NOT NULL,
`bank_code` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_banks`
--
INSERT INTO `tbl_banks` (`bank_id`, `bank_name`, `bank_code`) VALUES
(2, 'Bank of ceylon', 5678),
(3, 'Seylan Bank', 5863),
(1, 'Sampath Bank', 7850),
(4, 'Hatton National Bank', 8945);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_bank_branches`
--
CREATE TABLE `tbl_bank_branches` (
`bank_branch_id` int(11) NOT NULL,
`bank_name` varchar(100) NOT NULL,
`bank_branch_name` varchar(100) NOT NULL,
`bank_branch_code` int(3) NOT NULL,
`date_created` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_bank_branches`
--
INSERT INTO `tbl_bank_branches` (`bank_branch_id`, `bank_name`, `bank_branch_name`, `bank_branch_code`, `date_created`) VALUES
(1, 'Seylan Bank', 'Kalutara Branch', 102, '2020-07-23'),
(2, 'NDB Bank', 'Kalutara Branch', 114, '2020-07-23'),
(3, 'Sampath bank', 'Kalutara Branch', 122, '2020-07-23'),
(4, 'NDB Bank', 'Colombo Branch', 145, '2020-07-23'),
(5, 'Seylan Bank', 'Galle branch', 200, '2020-07-23');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tbl_banks`
--
ALTER TABLE `tbl_banks`
ADD PRIMARY KEY (`bank_code`),
ADD UNIQUE KEY `bank_code` (`bank_code`);
--
-- Indexes for table `tbl_bank_branches`
--
ALTER TABLE `tbl_bank_branches`
ADD PRIMARY KEY (`bank_branch_code`),
ADD UNIQUE KEY `bank_branch_code` (`bank_branch_code`);
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 */;
|
------------------------------------------------------------------------------------
------------------------------ TRIBUTARIO ------------------------------------------
------------------------------------------------------------------------------------
DROP TABLE IF EXISTS evolucaodividaativa CASCADE;
DROP SEQUENCE IF EXISTS evolucaodividaativa_v30_sequencial_seq;
----------------------------------------------------------------------------------------
------------------------------ FIM TRIBUTARIO ------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
------------------------------- INÍCIO FOLHA -------------------------------------------
----------------------------------------------------------------------------------------
------Removendo coluna da tabela de tipo de assentamentos
---------------------------------------------------------
ALTER TABLE tipoasse DROP CONSTRAINT h12_natureza_fk;
ALTER TABLE tipoasse DROP COLUMN h12_natureza;
------Removendo colunas à tabela cfpess para guardar rúbricas de desconto no exercício e exercício anterior
-----------------------------------------------------------------------------------------------------------
ALTER TABLE cfpess DROP COLUMN r11_rubricasubstituicaoatual;
ALTER TABLE cfpess DROP COLUMN r11_rubricasubstituicaoanterior;
------Removendo tabelas
-----------------------
DROP TABLE IF EXISTS loteregistropontorhfolhapagamento;
DROP TABLE IF EXISTS assentamentosubstituicao;
DROP TABLE IF EXISTS assentaloteregistroponto;
DROP TABLE IF EXISTS baserhcadregime;
DROP TABLE IF EXISTS naturezatipoassentamento;
------Removendo sequencias
--------------------------
DROP SEQUENCE IF EXISTS loteregistropontorhfolhapagamento_rh162_sequencial_seq;
DROP SEQUENCE IF EXISTS assentaloteregistroponto_rh160_sequencial_seq;
DROP SEQUENCE IF EXISTS baserhcadregime_rh158_sequencial_seq;
DROP SEQUENCE IF EXISTS naturezatipoassentamento_rh159_sequencial_seq;
------removendo dados das tabelas para contrato emergencial.
------------------------------------------------------------
DROP TABLE IF EXISTS rhcontratoemergencialrenovacao;
DROP TABLE IF EXISTS rhcontratoemergencial;
DROP SEQUENCE IF EXISTS rhcontratoemergencial_rh163_sequencial_seq;
DROP SEQUENCE IF EXISTS rhcontratoemergencialrenovacao_rh164_sequencial_seq;
----------------------------------------------------------------------------------------
---------------------------------- FIM FOLHA -------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
------------------------------ FINANCEIRO ------------------------------------------
----------------------------------------------------------------------------------------
ALTER TABLE empprestaitem ALTER COLUMN e46_valor TYPE real;
----------------------------------------------------------------------------------------
------------------------------ FIM FINANCEIRO ------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------- TIME C ---------------------------------------------
----------------------------------------------------------------------------------------
ALTER TABLE ensino
DROP COLUMN ed10_ordem;
ALTER TABLE far_matersaude
DROP COLUMN fa01_codigobarras;
-- Tarefa do censo
insert into db_layoutcampos( db52_codigo ,db52_layoutlinha ,db52_nome ,db52_descr ,db52_layoutformat ,db52_posicao ,db52_default ,db52_tamanho ,db52_ident ,db52_imprimir ,db52_alinha ,db52_obs ,db52_quebraapos )
values ( 12162 ,734 ,'pipe' ,'FINALIZADOR DE LINHA' ,14 ,685 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12387 ,735 ,'pipe' ,'FINALIZADOR DE LINHA' ,14 ,216 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12031 ,736 ,'pipe' ,'FINALIZADOR DE LINHA' ,14 ,218 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12056 ,737 ,'pipe' ,'PIPE' ,14 ,388 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12070 ,738 ,'pipe' ,'PIPE' ,14 ,252 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12161 ,739 ,'pipe' ,'PIPE' ,14 ,136 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12243 ,740 ,'pipe' ,'PIPE' ,14 ,101 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12343 ,741 ,'pipe' ,'PIPE' ,14 ,393 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12345 ,742 ,'pipe' ,'PIPE' ,14 ,396 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 ),
( 12346 ,743 ,'pipe' ,'PIPE' ,14 ,104 ,'' ,1 ,'f' ,'t' ,'d' ,'' ,0 );
update censoativcompl
set ed133_c_descr = upper('PROGRAMA MAIS EDUCACAO')
where ed133_i_codigo = 91003;
update censoativcompl
set ed133_c_descr = upper('CONSERVAÇÃO DO SOLO E COMPOSTEIRA')
where ed133_i_codigo = 16101;
update censoativcompl
set ed133_c_descr = upper('CANTEIROS SUSTENTÁVEIS')
where ed133_i_codigo = 16102;
update censoativcompl
set ed133_c_descr = upper('CUIDADOS COM ANIMAIS')
where ed133_i_codigo = 16103;
update turmaacativ
set ed267_i_censoativcompl = 13102
from turmaac, calendario
where ed267_i_turmaac = ed268_i_codigo
and ed52_i_codigo = ed268_i_calendario
and ed52_i_ano = 2015
and ed267_i_censoativcompl = 16101;
update turmaacativ
set ed267_i_censoativcompl = 13103
from turmaac, calendario
where ed267_i_turmaac = ed268_i_codigo
and ed52_i_codigo = ed268_i_calendario
and ed52_i_ano = 2015
and ed267_i_censoativcompl = 16102;
update turmaacativ
set ed267_i_censoativcompl = 13201
from turmaac, calendario
where ed267_i_turmaac = ed268_i_codigo
and ed52_i_codigo = ed268_i_calendario
and ed52_i_ano = 2015
and ed267_i_censoativcompl = 13108 ;
----------------------------------------------------------------------------------------
--------------------------------- FIM TIME C -------------------------------------------
---------------------------------------------------------------------------------------- |
CREATE TABLE addresses (
id SERIAL PRIMARY KEY,
address_line_1 VARCHAR(15) NOT NULL,
address_line_2 VARCHAR(50) NOT NULL,
town VARCHAR(25) NOT NULL,
postcode VARCHAR(7) NOT NULL
);
CREATE TABLE invoicees (
id SERIAL PRIMARY KEY,
first_name VARCHAR(25) NOT NULL,
last_name VARCHAR(25) NOT NULL,
telephone VARCHAR(11) NOT NULL,
email VARCHAR(50) NOT NULL,
payment_method VARCHAR(5) CHECK (payment_method IN ('CASH','BACS','DD')) NOT NULL,
address_id INT REFERENCES addresses (id) ON UPDATE CASCADE NOT NULL
);
CREATE TABLE students (
id SERIAL PRIMARY KEY,
invoicee_id INT REFERENCES invoicees (id) ON UPDATE CASCADE,
first_name VARCHAR(25) NOT NULL,
last_name VARCHAR(25) NOT NULL,
active BOOLEAN DEFAULT true NOT NULL,
fee_per_hour NUMERIC(4,2) DEFAULT 30.00 NOT NULL
);
CREATE TABLE sessions (
id SERIAL PRIMARY KEY,
student_id INT REFERENCES students (id) ON UPDATE CASCADE NOT NULL,
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP NOT NULL
);
CREATE TABLE invoices (
id SERIAL PRIMARY KEY,
invoicee_id INT REFERENCES invoicees (id) NOT NULL
current_balance NUMERIC(4,2)
);
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50547
Source Host : localhost:3306
Source Database : webtest
Target Server Type : MYSQL
Target Server Version : 50547
File Encoding : 65001
Date: 2016-07-08 08:23:12
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for orders
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`id` int(100) NOT NULL,
`product` varchar(20) DEFAULT NULL,
`price` float(10,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of orders
-- ----------------------------
INSERT INTO `orders` VALUES ('1', '电视', '900.00');
INSERT INTO `orders` VALUES ('2', '洗衣机', '100.00');
INSERT INTO `orders` VALUES ('3', '洗衣粉', '90.00');
INSERT INTO `orders` VALUES ('4', '桔子', '9.00');
INSERT INTO `orders` VALUES ('5', '洗衣粉', '90.00');
|
CREATE TABLE author (
author_id MEDIUMINT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(20) NOT NULL,
last_name VARCHAR(30) NOT NULL,
rating SMALLINT,
PRIMARY KEY (author_id),
UNIQUE KEY (first_name, last_name)
) ENGINE=InnoDB AUTO_INCREMENT=1;
insert into author (
select author_id, first_name, last_name, rating
from test.author);
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- ホスト: 127.0.0.1
-- 生成日時: 2020-07-07 15:08:07
-- サーバのバージョン: 10.4.13-MariaDB
-- PHP のバージョン: 7.4.7
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 */;
--
-- データベース: `user`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL UNIQUE,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
REM base - nothing here
SET DEFINE OFF;
|
DROP TABLE IF EXISTS xrowgroupworkflow;
CREATE TABLE xrowgroupworkflow (
id int(11) NOT NULL auto_increment,
status int(11) default NULL,
`date` int(11) NOT NULL default '0',
data longtext NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
IF OBJECT_ID('FindStars', 'P') IS NOT NULL
DROP PROCEDURE FindStars
GO
CREATE PROCEDURE FindStars @MinRA float, @MaxRA float, @MinDec float, @MaxDec float, @BrighterThan float AS
SELECT * FROM StarLocations SL
WHERE SL.RA BETWEEN @MinRA AND @MaxRA
AND SL.Dec BETWEEN @MinDec AND @MaxDec
AND SL.Mag <= @BrighterThan
GO |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 27, 2018 at 05:50 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `curriculumdb`
--
-- --------------------------------------------------------
--
-- Table structure for table `tblauto`
--
CREATE TABLE `tblauto` (
`id` int(11) NOT NULL,
`autostart` varchar(30) NOT NULL,
`autoend` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblauto`
--
INSERT INTO `tblauto` (`id`, `autostart`, `autoend`) VALUES
(1, '100', 35),
(2, '0', 8);
-- --------------------------------------------------------
--
-- Table structure for table `tblcourse`
--
CREATE TABLE `tblcourse` (
`CourseId` int(11) NOT NULL,
`Course` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblcourse`
--
INSERT INTO `tblcourse` (`CourseId`, `Course`) VALUES
(1, 'BSIT'),
(5, 'BEED');
-- --------------------------------------------------------
--
-- Table structure for table `tblcurriculum`
--
CREATE TABLE `tblcurriculum` (
`CurriculumId` int(11) NOT NULL,
`SubjectId` int(11) NOT NULL,
`CourseId` int(11) NOT NULL,
`Semester` varchar(35) NOT NULL,
`YearLevel` varchar(32) NOT NULL,
`AcademicYear` varchar(30) NOT NULL,
`PreRequisite` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblcurriculum`
--
INSERT INTO `tblcurriculum` (`CurriculumId`, `SubjectId`, `CourseId`, `Semester`, `YearLevel`, `AcademicYear`, `PreRequisite`) VALUES
(1, 1, 1, 'First', 'First', '2016-2017', 'None'),
(2, 2, 1, 'First', 'First', '2016-2017', 'None'),
(3, 1, 1, 'First', 'Second', '2016-2017', 'ENG 11'),
(4, 1, 1, 'Second', 'First', '2016-2017', 'None'),
(5, 2, 2, 'First', 'First', '2016-2017', 'None'),
(6, 2, 2, 'First', 'Second', '2016-2017', 'MATH 11');
-- --------------------------------------------------------
--
-- Table structure for table `tblgrades`
--
CREATE TABLE `tblgrades` (
`GradesId` int(11) NOT NULL,
`CourseId` int(11) NOT NULL,
`IdNo` varchar(90) NOT NULL,
`SubjectId` int(11) NOT NULL,
`Grades` double NOT NULL,
`YearLevel` varchar(32) NOT NULL,
`Sem` varchar(99) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblgrades`
--
INSERT INTO `tblgrades` (`GradesId`, `CourseId`, `IdNo`, `SubjectId`, `Grades`, `YearLevel`, `Sem`) VALUES
(1, 1, '123123', 3, 1, 'First', 'First'),
(2, 1, '123123', 4, 2, 'First', 'First'),
(3, 1, '123123', 5, 2, 'First', 'First'),
(4, 1, '123123', 6, 2, 'First', 'First'),
(5, 1, '123123', 7, 2.3, 'First', 'First'),
(6, 1, '123123', 8, 2.1, 'First', 'First'),
(7, 1, '123123', 9, 1.3, 'First', 'First'),
(8, 1, '123123', 10, 0, 'First', 'Second'),
(9, 1, '123123', 11, 0, 'First', 'Second'),
(10, 1, '123123', 12, 0, 'First', 'Second'),
(11, 1, '123123', 13, 0, 'First', 'Second'),
(12, 1, '123123', 14, 0, 'First', 'Second'),
(13, 1, '123123', 15, 0, 'First', 'Second'),
(14, 1, '123123', 16, 0, 'First', 'Second'),
(15, 1, '123123', 17, 0, 'First', 'Second'),
(16, 1, '123123', 18, 0, 'First', 'Second'),
(17, 1, '123123', 19, 0, 'Second', 'First'),
(18, 1, '123123', 20, 0, 'Second', 'First'),
(19, 1, '123123', 21, 0, 'Second', 'First'),
(20, 1, '123123', 22, 0, 'Second', 'First'),
(21, 1, '123123', 23, 0, 'Second', 'First'),
(22, 1, '123123', 24, 0, 'Second', 'First'),
(23, 1, '123123', 25, 0, 'Second', 'First'),
(24, 1, '123123', 26, 0, 'Second', 'First'),
(25, 1, '123123', 27, 0, 'Second', 'First'),
(26, 1, '123123', 28, 0, 'Second', 'Second'),
(27, 1, '123123', 29, 0, 'Second', 'Second'),
(28, 1, '123123', 30, 0, 'Second', 'Second'),
(29, 1, '123123', 31, 0, 'Second', 'Second'),
(30, 1, '123123', 32, 0, 'Second', 'Second'),
(31, 1, '123123', 33, 0, 'Second', 'Second'),
(32, 1, '123123', 34, 0, 'Second', 'Second'),
(33, 1, '123123', 35, 0, 'Second', 'Second'),
(34, 1, '123123', 36, 0, 'Third', 'First'),
(35, 1, '123123', 37, 0, 'Third', 'First'),
(36, 1, '123123', 38, 0, 'Third', 'First'),
(37, 1, '123123', 39, 0, 'Third', 'First'),
(38, 1, '123123', 40, 0, 'Third', 'First'),
(39, 1, '123123', 41, 0, 'Third', 'First'),
(40, 1, '123123', 42, 0, 'Third', 'First'),
(41, 1, '123123', 43, 0, 'Third', 'First'),
(42, 1, '123123', 44, 0, 'Third', 'Second'),
(43, 1, '123123', 45, 0, 'Third', 'Second'),
(44, 1, '123123', 46, 0, 'Third', 'Second'),
(45, 1, '123123', 47, 0, 'Third', 'Second'),
(46, 1, '123123', 48, 0, 'Third', 'Second'),
(47, 1, '123123', 49, 0, 'Third', 'Second'),
(48, 1, '123123', 50, 0, 'Third', 'Second'),
(49, 1, '123123', 51, 0, 'Third', 'Second'),
(50, 1, '123123', 52, 0, 'Fourth', 'First'),
(51, 1, '123123', 53, 0, 'Fourth', 'First'),
(52, 1, '123123', 54, 0, 'Fourth', 'First'),
(53, 1, '123123', 55, 0, 'Fourth', 'First'),
(54, 1, '123123', 56, 0, 'Fourth', 'First'),
(55, 1, '123123', 57, 0, 'Fourth', 'First'),
(56, 1, '123123', 58, 0, 'Fourth', 'Second'),
(57, 1, '123123', 59, 1.1, 'First', 'First'),
(58, 1, '123123', 60, 1.2, 'First', 'First'),
(59, 1, '1234322', 3, 3.2, 'First', 'First'),
(60, 1, '1234322', 4, 2, 'First', 'First'),
(61, 1, '1234322', 5, 3.6, 'First', 'First'),
(62, 1, '1234322', 6, 1, 'First', 'First'),
(63, 1, '1234322', 7, 2.1, 'First', 'First'),
(64, 1, '1234322', 8, 2, 'First', 'First'),
(65, 1, '1234322', 9, 3, 'First', 'First'),
(66, 1, '1234322', 10, 0, 'First', 'Second'),
(67, 1, '1234322', 11, 0, 'First', 'Second'),
(68, 1, '1234322', 12, 0, 'First', 'Second'),
(69, 1, '1234322', 13, 0, 'First', 'Second'),
(70, 1, '1234322', 14, 0, 'First', 'Second'),
(71, 1, '1234322', 15, 0, 'First', 'Second'),
(72, 1, '1234322', 16, 0, 'First', 'Second'),
(73, 1, '1234322', 17, 0, 'First', 'Second'),
(74, 1, '1234322', 18, 0, 'First', 'Second'),
(75, 1, '1234322', 19, 0, 'Second', 'First'),
(76, 1, '1234322', 20, 0, 'Second', 'First'),
(77, 1, '1234322', 21, 0, 'Second', 'First'),
(78, 1, '1234322', 22, 0, 'Second', 'First'),
(79, 1, '1234322', 23, 0, 'Second', 'First'),
(80, 1, '1234322', 24, 0, 'Second', 'First'),
(81, 1, '1234322', 25, 0, 'Second', 'First'),
(82, 1, '1234322', 26, 0, 'Second', 'First'),
(83, 1, '1234322', 27, 0, 'Second', 'First'),
(84, 1, '1234322', 28, 0, 'Second', 'Second'),
(85, 1, '1234322', 29, 0, 'Second', 'Second'),
(86, 1, '1234322', 30, 0, 'Second', 'Second'),
(87, 1, '1234322', 31, 0, 'Second', 'Second'),
(88, 1, '1234322', 32, 0, 'Second', 'Second'),
(89, 1, '1234322', 33, 0, 'Second', 'Second'),
(90, 1, '1234322', 34, 0, 'Second', 'Second'),
(91, 1, '1234322', 35, 0, 'Second', 'Second'),
(92, 1, '1234322', 36, 0, 'Third', 'First'),
(93, 1, '1234322', 37, 0, 'Third', 'First'),
(94, 1, '1234322', 38, 0, 'Third', 'First'),
(95, 1, '1234322', 39, 0, 'Third', 'First'),
(96, 1, '1234322', 40, 0, 'Third', 'First'),
(97, 1, '1234322', 41, 0, 'Third', 'First'),
(98, 1, '1234322', 42, 0, 'Third', 'First'),
(99, 1, '1234322', 43, 0, 'Third', 'First'),
(100, 1, '1234322', 44, 0, 'Third', 'Second'),
(101, 1, '1234322', 45, 0, 'Third', 'Second'),
(102, 1, '1234322', 46, 0, 'Third', 'Second'),
(103, 1, '1234322', 47, 0, 'Third', 'Second'),
(104, 1, '1234322', 48, 0, 'Third', 'Second'),
(105, 1, '1234322', 49, 0, 'Third', 'Second'),
(106, 1, '1234322', 50, 0, 'Third', 'Second'),
(107, 1, '1234322', 51, 0, 'Third', 'Second'),
(108, 1, '1234322', 52, 0, 'Fourth', 'First'),
(109, 1, '1234322', 53, 0, 'Fourth', 'First'),
(110, 1, '1234322', 54, 0, 'Fourth', 'First'),
(111, 1, '1234322', 55, 0, 'Fourth', 'First'),
(112, 1, '1234322', 56, 0, 'Fourth', 'First'),
(113, 1, '1234322', 57, 0, 'Fourth', 'First'),
(114, 1, '1234322', 58, 0, 'Fourth', 'Second'),
(115, 1, '1234322', 59, 1.1, 'First', 'First'),
(116, 1, '1234322', 60, 1.3, 'First', 'First'),
(117, 1, '312312312', 3, 0, 'First', 'First'),
(118, 1, '312312312', 4, 0, 'First', 'First'),
(119, 1, '312312312', 5, 0, 'First', 'First'),
(120, 1, '312312312', 6, 0, 'First', 'First'),
(121, 1, '312312312', 7, 0, 'First', 'First'),
(122, 1, '312312312', 8, 0, 'First', 'First'),
(123, 1, '312312312', 9, 0, 'First', 'First'),
(124, 1, '312312312', 10, 0, 'First', 'Second'),
(125, 1, '312312312', 11, 0, 'First', 'Second'),
(126, 1, '312312312', 12, 0, 'First', 'Second'),
(127, 1, '312312312', 13, 0, 'First', 'Second'),
(128, 1, '312312312', 14, 0, 'First', 'Second'),
(129, 1, '312312312', 15, 0, 'First', 'Second'),
(130, 1, '312312312', 16, 0, 'First', 'Second'),
(131, 1, '312312312', 17, 0, 'First', 'Second'),
(132, 1, '312312312', 18, 0, 'First', 'Second'),
(133, 1, '312312312', 19, 0, 'Second', 'First'),
(134, 1, '312312312', 20, 0, 'Second', 'First'),
(135, 1, '312312312', 21, 0, 'Second', 'First'),
(136, 1, '312312312', 22, 0, 'Second', 'First'),
(137, 1, '312312312', 23, 0, 'Second', 'First'),
(138, 1, '312312312', 24, 0, 'Second', 'First'),
(139, 1, '312312312', 25, 0, 'Second', 'First'),
(140, 1, '312312312', 26, 0, 'Second', 'First'),
(141, 1, '312312312', 27, 0, 'Second', 'First'),
(142, 1, '312312312', 28, 0, 'Second', 'Second'),
(143, 1, '312312312', 29, 0, 'Second', 'Second'),
(144, 1, '312312312', 30, 0, 'Second', 'Second'),
(145, 1, '312312312', 31, 0, 'Second', 'Second'),
(146, 1, '312312312', 32, 0, 'Second', 'Second'),
(147, 1, '312312312', 33, 0, 'Second', 'Second'),
(148, 1, '312312312', 34, 0, 'Second', 'Second'),
(149, 1, '312312312', 35, 0, 'Second', 'Second'),
(150, 1, '312312312', 36, 0, 'Third', 'First'),
(151, 1, '312312312', 37, 0, 'Third', 'First'),
(152, 1, '312312312', 38, 0, 'Third', 'First'),
(153, 1, '312312312', 39, 0, 'Third', 'First'),
(154, 1, '312312312', 40, 0, 'Third', 'First'),
(155, 1, '312312312', 41, 0, 'Third', 'First'),
(156, 1, '312312312', 42, 0, 'Third', 'First'),
(157, 1, '312312312', 43, 0, 'Third', 'First'),
(158, 1, '312312312', 44, 0, 'Third', 'Second'),
(159, 1, '312312312', 45, 0, 'Third', 'Second'),
(160, 1, '312312312', 46, 0, 'Third', 'Second'),
(161, 1, '312312312', 47, 0, 'Third', 'Second'),
(162, 1, '312312312', 48, 0, 'Third', 'Second'),
(163, 1, '312312312', 49, 0, 'Third', 'Second'),
(164, 1, '312312312', 50, 0, 'Third', 'Second'),
(165, 1, '312312312', 51, 0, 'Third', 'Second'),
(166, 1, '312312312', 52, 0, 'Fourth', 'First'),
(167, 1, '312312312', 53, 0, 'Fourth', 'First'),
(168, 1, '312312312', 54, 0, 'Fourth', 'First'),
(169, 1, '312312312', 55, 0, 'Fourth', 'First'),
(170, 1, '312312312', 56, 0, 'Fourth', 'First'),
(171, 1, '312312312', 57, 0, 'Fourth', 'First'),
(172, 1, '312312312', 58, 0, 'Fourth', 'Second'),
(173, 1, '312312312', 59, 0, 'First', 'First'),
(174, 1, '312312312', 60, 0, 'First', 'First'),
(175, 1, '121031', 3, 0, 'First', 'First'),
(176, 1, '121031', 4, 0, 'First', 'First'),
(177, 1, '121031', 5, 0, 'First', 'First'),
(178, 1, '121031', 6, 0, 'First', 'First'),
(179, 1, '121031', 7, 0, 'First', 'First'),
(180, 1, '121031', 8, 0, 'First', 'First'),
(181, 1, '121031', 9, 0, 'First', 'First'),
(182, 1, '121031', 10, 0, 'First', 'Second'),
(183, 1, '121031', 11, 0, 'First', 'Second'),
(184, 1, '121031', 12, 0, 'First', 'Second'),
(185, 1, '121031', 13, 0, 'First', 'Second'),
(186, 1, '121031', 14, 0, 'First', 'Second'),
(187, 1, '121031', 15, 0, 'First', 'Second'),
(188, 1, '121031', 16, 0, 'First', 'Second'),
(189, 1, '121031', 17, 0, 'First', 'Second'),
(190, 1, '121031', 18, 0, 'First', 'Second'),
(191, 1, '121031', 19, 0, 'Second', 'First'),
(192, 1, '121031', 20, 0, 'Second', 'First'),
(193, 1, '121031', 21, 0, 'Second', 'First'),
(194, 1, '121031', 22, 0, 'Second', 'First'),
(195, 1, '121031', 23, 0, 'Second', 'First'),
(196, 1, '121031', 24, 0, 'Second', 'First'),
(197, 1, '121031', 25, 0, 'Second', 'First'),
(198, 1, '121031', 26, 0, 'Second', 'First'),
(199, 1, '121031', 27, 0, 'Second', 'First'),
(200, 1, '121031', 28, 0, 'Second', 'Second'),
(201, 1, '121031', 29, 0, 'Second', 'Second'),
(202, 1, '121031', 30, 0, 'Second', 'Second'),
(203, 1, '121031', 31, 0, 'Second', 'Second'),
(204, 1, '121031', 32, 0, 'Second', 'Second'),
(205, 1, '121031', 33, 0, 'Second', 'Second'),
(206, 1, '121031', 34, 0, 'Second', 'Second'),
(207, 1, '121031', 35, 0, 'Second', 'Second'),
(208, 1, '121031', 36, 0, 'Third', 'First'),
(209, 1, '121031', 37, 0, 'Third', 'First'),
(210, 1, '121031', 38, 0, 'Third', 'First'),
(211, 1, '121031', 39, 0, 'Third', 'First'),
(212, 1, '121031', 40, 0, 'Third', 'First'),
(213, 1, '121031', 41, 0, 'Third', 'First'),
(214, 1, '121031', 42, 0, 'Third', 'First'),
(215, 1, '121031', 43, 0, 'Third', 'First'),
(216, 1, '121031', 44, 0, 'Third', 'Second'),
(217, 1, '121031', 45, 0, 'Third', 'Second'),
(218, 1, '121031', 46, 0, 'Third', 'Second'),
(219, 1, '121031', 47, 0, 'Third', 'Second'),
(220, 1, '121031', 48, 0, 'Third', 'Second'),
(221, 1, '121031', 49, 0, 'Third', 'Second'),
(222, 1, '121031', 50, 0, 'Third', 'Second'),
(223, 1, '121031', 51, 0, 'Third', 'Second'),
(224, 1, '121031', 52, 0, 'Fourth', 'First'),
(225, 1, '121031', 53, 0, 'Fourth', 'First'),
(226, 1, '121031', 54, 0, 'Fourth', 'First'),
(227, 1, '121031', 55, 0, 'Fourth', 'First'),
(228, 1, '121031', 56, 0, 'Fourth', 'First'),
(229, 1, '121031', 57, 0, 'Fourth', 'First'),
(230, 1, '121031', 58, 0, 'Fourth', 'Second'),
(231, 1, '121031', 59, 0, 'First', 'First'),
(232, 1, '121031', 60, 0, 'First', 'First'),
(233, 1, '312312290', 3, 0, 'First', 'First'),
(234, 1, '312312290', 4, 0, 'First', 'First'),
(235, 1, '312312290', 5, 0, 'First', 'First'),
(236, 1, '312312290', 6, 0, 'First', 'First'),
(237, 1, '312312290', 7, 0, 'First', 'First'),
(238, 1, '312312290', 8, 0, 'First', 'First'),
(239, 1, '312312290', 9, 0, 'First', 'First'),
(240, 1, '312312290', 10, 0, 'First', 'Second'),
(241, 1, '312312290', 11, 0, 'First', 'Second'),
(242, 1, '312312290', 12, 0, 'First', 'Second'),
(243, 1, '312312290', 13, 0, 'First', 'Second'),
(244, 1, '312312290', 14, 0, 'First', 'Second'),
(245, 1, '312312290', 15, 0, 'First', 'Second'),
(246, 1, '312312290', 16, 0, 'First', 'Second'),
(247, 1, '312312290', 17, 0, 'First', 'Second'),
(248, 1, '312312290', 18, 0, 'First', 'Second'),
(249, 1, '312312290', 19, 0, 'Second', 'First'),
(250, 1, '312312290', 20, 0, 'Second', 'First'),
(251, 1, '312312290', 21, 0, 'Second', 'First'),
(252, 1, '312312290', 22, 0, 'Second', 'First'),
(253, 1, '312312290', 23, 0, 'Second', 'First'),
(254, 1, '312312290', 24, 0, 'Second', 'First'),
(255, 1, '312312290', 25, 0, 'Second', 'First'),
(256, 1, '312312290', 26, 0, 'Second', 'First'),
(257, 1, '312312290', 27, 0, 'Second', 'First'),
(258, 1, '312312290', 28, 0, 'Second', 'Second'),
(259, 1, '312312290', 29, 0, 'Second', 'Second'),
(260, 1, '312312290', 30, 0, 'Second', 'Second'),
(261, 1, '312312290', 31, 0, 'Second', 'Second'),
(262, 1, '312312290', 32, 0, 'Second', 'Second'),
(263, 1, '312312290', 33, 0, 'Second', 'Second'),
(264, 1, '312312290', 34, 0, 'Second', 'Second'),
(265, 1, '312312290', 35, 0, 'Second', 'Second'),
(266, 1, '312312290', 36, 0, 'Third', 'First'),
(267, 1, '312312290', 37, 0, 'Third', 'First'),
(268, 1, '312312290', 38, 0, 'Third', 'First'),
(269, 1, '312312290', 39, 0, 'Third', 'First'),
(270, 1, '312312290', 40, 0, 'Third', 'First'),
(271, 1, '312312290', 41, 0, 'Third', 'First'),
(272, 1, '312312290', 42, 0, 'Third', 'First'),
(273, 1, '312312290', 43, 0, 'Third', 'First'),
(274, 1, '312312290', 44, 0, 'Third', 'Second'),
(275, 1, '312312290', 45, 0, 'Third', 'Second'),
(276, 1, '312312290', 46, 0, 'Third', 'Second'),
(277, 1, '312312290', 47, 0, 'Third', 'Second'),
(278, 1, '312312290', 48, 0, 'Third', 'Second'),
(279, 1, '312312290', 49, 0, 'Third', 'Second'),
(280, 1, '312312290', 50, 0, 'Third', 'Second'),
(281, 1, '312312290', 51, 0, 'Third', 'Second'),
(282, 1, '312312290', 52, 0, 'Fourth', 'First'),
(283, 1, '312312290', 53, 0, 'Fourth', 'First'),
(284, 1, '312312290', 54, 0, 'Fourth', 'First'),
(285, 1, '312312290', 55, 0, 'Fourth', 'First'),
(286, 1, '312312290', 56, 0, 'Fourth', 'First'),
(287, 1, '312312290', 57, 0, 'Fourth', 'First'),
(288, 1, '312312290', 58, 0, 'Fourth', 'Second'),
(289, 1, '312312290', 59, 0, 'First', 'First'),
(290, 1, '312312290', 60, 0, 'First', 'First'),
(291, 1, '312312312-32', 3, 0, 'First', 'First'),
(292, 1, '312312312-32', 4, 0, 'First', 'First'),
(293, 1, '312312312-32', 5, 0, 'First', 'First'),
(294, 1, '312312312-32', 6, 0, 'First', 'First'),
(295, 1, '312312312-32', 7, 0, 'First', 'First'),
(296, 1, '312312312-32', 8, 0, 'First', 'First'),
(297, 1, '312312312-32', 9, 0, 'First', 'First'),
(298, 1, '312312312-32', 10, 0, 'First', 'Second'),
(299, 1, '312312312-32', 11, 0, 'First', 'Second'),
(300, 1, '312312312-32', 12, 0, 'First', 'Second'),
(301, 1, '312312312-32', 13, 0, 'First', 'Second'),
(302, 1, '312312312-32', 14, 0, 'First', 'Second'),
(303, 1, '312312312-32', 15, 0, 'First', 'Second'),
(304, 1, '312312312-32', 16, 0, 'First', 'Second'),
(305, 1, '312312312-32', 17, 0, 'First', 'Second'),
(306, 1, '312312312-32', 18, 0, 'First', 'Second'),
(307, 1, '312312312-32', 19, 0, 'Second', 'First'),
(308, 1, '312312312-32', 20, 0, 'Second', 'First'),
(309, 1, '312312312-32', 21, 0, 'Second', 'First'),
(310, 1, '312312312-32', 22, 0, 'Second', 'First'),
(311, 1, '312312312-32', 23, 0, 'Second', 'First'),
(312, 1, '312312312-32', 24, 0, 'Second', 'First'),
(313, 1, '312312312-32', 25, 0, 'Second', 'First'),
(314, 1, '312312312-32', 26, 0, 'Second', 'First'),
(315, 1, '312312312-32', 27, 0, 'Second', 'First'),
(316, 1, '312312312-32', 28, 0, 'Second', 'Second'),
(317, 1, '312312312-32', 29, 0, 'Second', 'Second'),
(318, 1, '312312312-32', 30, 0, 'Second', 'Second'),
(319, 1, '312312312-32', 31, 0, 'Second', 'Second'),
(320, 1, '312312312-32', 32, 0, 'Second', 'Second'),
(321, 1, '312312312-32', 33, 0, 'Second', 'Second'),
(322, 1, '312312312-32', 34, 0, 'Second', 'Second'),
(323, 1, '312312312-32', 35, 0, 'Second', 'Second'),
(324, 1, '312312312-32', 36, 0, 'Third', 'First'),
(325, 1, '312312312-32', 37, 0, 'Third', 'First'),
(326, 1, '312312312-32', 38, 0, 'Third', 'First'),
(327, 1, '312312312-32', 39, 0, 'Third', 'First'),
(328, 1, '312312312-32', 40, 0, 'Third', 'First'),
(329, 1, '312312312-32', 41, 0, 'Third', 'First'),
(330, 1, '312312312-32', 42, 0, 'Third', 'First'),
(331, 1, '312312312-32', 43, 0, 'Third', 'First'),
(332, 1, '312312312-32', 44, 0, 'Third', 'Second'),
(333, 1, '312312312-32', 45, 0, 'Third', 'Second'),
(334, 1, '312312312-32', 46, 0, 'Third', 'Second'),
(335, 1, '312312312-32', 47, 0, 'Third', 'Second'),
(336, 1, '312312312-32', 48, 0, 'Third', 'Second'),
(337, 1, '312312312-32', 49, 0, 'Third', 'Second'),
(338, 1, '312312312-32', 50, 0, 'Third', 'Second'),
(339, 1, '312312312-32', 51, 0, 'Third', 'Second'),
(340, 1, '312312312-32', 52, 0, 'Fourth', 'First'),
(341, 1, '312312312-32', 53, 0, 'Fourth', 'First'),
(342, 1, '312312312-32', 54, 0, 'Fourth', 'First'),
(343, 1, '312312312-32', 55, 0, 'Fourth', 'First'),
(344, 1, '312312312-32', 56, 0, 'Fourth', 'First'),
(345, 1, '312312312-32', 57, 0, 'Fourth', 'First'),
(346, 1, '312312312-32', 58, 0, 'Fourth', 'Second'),
(347, 1, '312312312-32', 59, 0, 'First', 'First'),
(348, 1, '312312312-32', 60, 0, 'First', 'First'),
(349, 1, '312312312-32', 3, 0, 'First', 'First'),
(350, 1, '312312312-32', 4, 0, 'First', 'First'),
(351, 1, '312312312-32', 5, 0, 'First', 'First'),
(352, 1, '312312312-32', 6, 0, 'First', 'First'),
(353, 1, '312312312-32', 7, 0, 'First', 'First'),
(354, 1, '312312312-32', 8, 0, 'First', 'First'),
(355, 1, '312312312-32', 9, 0, 'First', 'First'),
(356, 1, '312312312-32', 10, 0, 'First', 'Second'),
(357, 1, '312312312-32', 11, 0, 'First', 'Second'),
(358, 1, '312312312-32', 12, 0, 'First', 'Second'),
(359, 1, '312312312-32', 13, 0, 'First', 'Second'),
(360, 1, '312312312-32', 14, 0, 'First', 'Second'),
(361, 1, '312312312-32', 15, 0, 'First', 'Second'),
(362, 1, '312312312-32', 16, 0, 'First', 'Second'),
(363, 1, '312312312-32', 17, 0, 'First', 'Second'),
(364, 1, '312312312-32', 18, 0, 'First', 'Second'),
(365, 1, '312312312-32', 19, 0, 'Second', 'First'),
(366, 1, '312312312-32', 20, 0, 'Second', 'First'),
(367, 1, '312312312-32', 21, 0, 'Second', 'First'),
(368, 1, '312312312-32', 22, 0, 'Second', 'First'),
(369, 1, '312312312-32', 23, 0, 'Second', 'First'),
(370, 1, '312312312-32', 24, 0, 'Second', 'First'),
(371, 1, '312312312-32', 25, 0, 'Second', 'First'),
(372, 1, '312312312-32', 26, 0, 'Second', 'First'),
(373, 1, '312312312-32', 27, 0, 'Second', 'First'),
(374, 1, '312312312-32', 28, 0, 'Second', 'Second'),
(375, 1, '312312312-32', 29, 0, 'Second', 'Second'),
(376, 1, '312312312-32', 30, 0, 'Second', 'Second'),
(377, 1, '312312312-32', 31, 0, 'Second', 'Second'),
(378, 1, '312312312-32', 32, 0, 'Second', 'Second'),
(379, 1, '312312312-32', 33, 0, 'Second', 'Second'),
(380, 1, '312312312-32', 34, 0, 'Second', 'Second'),
(381, 1, '312312312-32', 35, 0, 'Second', 'Second'),
(382, 1, '312312312-32', 36, 0, 'Third', 'First'),
(383, 1, '312312312-32', 37, 0, 'Third', 'First'),
(384, 1, '312312312-32', 38, 0, 'Third', 'First'),
(385, 1, '312312312-32', 39, 0, 'Third', 'First'),
(386, 1, '312312312-32', 40, 0, 'Third', 'First'),
(387, 1, '312312312-32', 41, 0, 'Third', 'First'),
(388, 1, '312312312-32', 42, 0, 'Third', 'First'),
(389, 1, '312312312-32', 43, 0, 'Third', 'First'),
(390, 1, '312312312-32', 44, 0, 'Third', 'Second'),
(391, 1, '312312312-32', 45, 0, 'Third', 'Second'),
(392, 1, '312312312-32', 46, 0, 'Third', 'Second'),
(393, 1, '312312312-32', 47, 0, 'Third', 'Second'),
(394, 1, '312312312-32', 48, 0, 'Third', 'Second'),
(395, 1, '312312312-32', 49, 0, 'Third', 'Second'),
(396, 1, '312312312-32', 50, 0, 'Third', 'Second'),
(397, 1, '312312312-32', 51, 0, 'Third', 'Second'),
(398, 1, '312312312-32', 52, 0, 'Fourth', 'First'),
(399, 1, '312312312-32', 53, 0, 'Fourth', 'First'),
(400, 1, '312312312-32', 54, 0, 'Fourth', 'First'),
(401, 1, '312312312-32', 55, 0, 'Fourth', 'First'),
(402, 1, '312312312-32', 56, 0, 'Fourth', 'First'),
(403, 1, '312312312-32', 57, 0, 'Fourth', 'First'),
(404, 1, '312312312-32', 58, 0, 'Fourth', 'Second'),
(405, 1, '312312312-32', 59, 0, 'First', 'First'),
(406, 1, '312312312-32', 60, 0, 'First', 'First');
-- --------------------------------------------------------
--
-- Table structure for table `tblprerequisite`
--
CREATE TABLE `tblprerequisite` (
`PreRequisiteId` int(11) NOT NULL,
`SubjectId` int(11) NOT NULL,
`Pre1` varchar(90) NOT NULL,
`Pre2` varchar(90) NOT NULL,
`Pre3` varchar(90) NOT NULL,
`Pre4` varchar(90) NOT NULL,
`Pre5` varchar(90) NOT NULL,
`Pre6` varchar(90) NOT NULL,
`Pre7` varchar(90) NOT NULL,
`Pre8` varchar(90) NOT NULL,
`Pre9` varchar(90) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblprerequisite`
--
INSERT INTO `tblprerequisite` (`PreRequisiteId`, `SubjectId`, `Pre1`, `Pre2`, `Pre3`, `Pre4`, `Pre5`, `Pre6`, `Pre7`, `Pre8`, `Pre9`) VALUES
(1, 3, '', '', '', '', '', '', '', '', ''),
(2, 4, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(3, 5, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(4, 6, '', '', '', '', '', '', '', '', ''),
(5, 7, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(6, 8, '', '', '', '', '', '', '', '', ''),
(7, 9, '', '', '', '', '', '', '', '', ''),
(8, 10, 'ENG 11', '', '', '', '', '', '', '', ''),
(9, 11, '', '', '', '', '', '', '', '', ''),
(10, 12, '', '', '', '', '', '', '', '', ''),
(11, 13, '', '', '', '', '', '', '', '', ''),
(12, 14, 'SOC SCI 11', '', '', '', '', '', '', '', ''),
(13, 15, '', '', '', '', '', '', '', '', ''),
(14, 16, '', '', '', '', '', '', '', '', ''),
(15, 17, '', '', '', '', '', '', '', '', ''),
(16, 18, '', '', '', '', '', '', '', '', ''),
(17, 19, '', '', '', '', '', '', '', '', ''),
(18, 20, '', '', '', '', '', '', '', '', ''),
(19, 21, '', '', '', '', '', '', '', '', ''),
(20, 22, '', '', '', '', '', '', '', '', ''),
(21, 23, '', '', '', '', '', '', '', '', ''),
(22, 24, '', '', '', '', '', '', '', '', ''),
(23, 25, '', '', '', '', '', '', '', '', ''),
(24, 26, '', '', '', '', '', '', '', '', ''),
(25, 27, '', '', '', '', '', '', '', '', ''),
(26, 28, '', '', '', '', '', '', '', '', ''),
(27, 29, '', '', '', '', '', '', '', '', ''),
(28, 30, 'SOC SCI 12', '', '', '', '', '', '', '', ''),
(29, 31, '', '', '', '', '', '', '', '', ''),
(30, 32, '', '', '', '', '', '', '', '', ''),
(31, 33, '', '', '', '', '', '', '', '', ''),
(32, 34, '', '', '', '', '', '', '', '', ''),
(33, 35, '', '', '', '', '', '', '', '', ''),
(34, 36, '', '', '', '', '', '', '', '', ''),
(35, 37, '', '', '', '', '', '', '', '', ''),
(36, 38, '', '', '', '', '', '', '', '', ''),
(37, 39, '', '', '', '', '', '', '', '', ''),
(38, 40, '', '', '', '', '', '', '', '', ''),
(39, 41, '', '', '', '', '', '', '', '', ''),
(40, 42, '', '', '', '', '', '', '', '', ''),
(41, 43, 'SOC SCI 13', '', '', '', '', '', '', '', ''),
(42, 44, '', '', '', '', '', '', '', '', ''),
(43, 45, '', '', '', '', '', '', '', '', ''),
(44, 46, '', '', '', '', '', '', '', '', ''),
(45, 47, '', '', '', '', '', '', '', '', ''),
(46, 48, '', '', '', '', '', '', '', '', ''),
(47, 49, '', '', '', '', '', '', '', '', ''),
(48, 50, '', '', '', '', '', '', '', '', ''),
(49, 51, '', '', '', '', '', '', '', '', ''),
(50, 52, '', '', '', '', '', '', '', '', ''),
(51, 53, '', '', '', '', '', '', '', '', ''),
(52, 54, '', '', '', '', '', '', '', '', ''),
(53, 55, '', '', '', '', '', '', '', '', ''),
(54, 56, '', '', '', '', '', '', '', '', ''),
(55, 57, '', '', '', '', '', '', '', '', ''),
(56, 58, '', '', '', '', '', '', '', '', ''),
(57, 59, '', '', '', '', '', '', '', '', ''),
(58, 60, '', '', '', '', '', '', '', '', ''),
(59, 10025, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(60, 10027, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(62, 10028, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(63, 10029, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(64, 10031, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(65, 10032, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(66, 10033, 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'),
(67, 62, 'FIL 11', 'HIST 12', 'IT 113', '', '', '', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `tblstudent`
--
CREATE TABLE `tblstudent` (
`ID` int(11) NOT NULL,
`IdNo` varchar(90) NOT NULL,
`Firstname` varchar(255) NOT NULL,
`Lastname` varchar(255) NOT NULL,
`MI` varchar(255) NOT NULL,
`HomeAddress` varchar(255) NOT NULL,
`Sex` varchar(35) NOT NULL,
`CourseId` int(11) NOT NULL,
`YearLevel` varchar(32) NOT NULL,
`StudentPhoto` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblstudent`
--
INSERT INTO `tblstudent` (`ID`, `IdNo`, `Firstname`, `Lastname`, `MI`, `HomeAddress`, `Sex`, `CourseId`, `YearLevel`, `StudentPhoto`) VALUES
(1, '123123', 'Mark Antony', 'Fernandez', 'R', 'Kalinga Aklan', 'Male', 1, 'First', 'kisspng-reset-button-clip-art-update-cliparts-5aae91224c2291.1980798515213898583119.jpg'),
(3, '312312312', 'James', 'Yap', 'E', 'Aklan', 'Male', 1, 'First', 'file-clip-art-file-folder.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tblsubject`
--
CREATE TABLE `tblsubject` (
`SubjectId` int(11) NOT NULL,
`Subject` varchar(128) NOT NULL,
`DescriptiveTitle` varchar(255) NOT NULL,
`LecUnit` int(11) NOT NULL,
`LabUnit` int(11) NOT NULL,
`CourseId` int(11) NOT NULL,
`YearLevel` varchar(30) NOT NULL,
`Semester` varchar(30) NOT NULL,
`PreRequisite` varchar(255) NOT NULL,
`Level` int(11) NOT NULL,
`PreTaken` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tblsubject`
--
INSERT INTO `tblsubject` (`SubjectId`, `Subject`, `DescriptiveTitle`, `LecUnit`, `LabUnit`, `CourseId`, `YearLevel`, `Semester`, `PreRequisite`, `Level`, `PreTaken`) VALUES
(3, 'ENG 11', 'STUDY AND THINKING SKILLS', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(4, 'MATH 11', 'COLLEGE ALGEBRA', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(5, 'SOC SCI 11', 'GENERAL PSYCHOLOGY WITH DRUG ABUSE PREVENTION', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(6, 'NAT SCI 11', 'BIOLOGICAL SCIENCE', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(7, 'IT 101', 'IT FUNDAMENTALS', 2, 1, 1, 'First', 'First', 'None', 1, 0),
(8, 'IT 102', 'PROGRAMMING LANGUAGE (LOGIC FORMULATION)', 2, 1, 1, 'First', 'First', 'None', 1, 0),
(9, 'NSTP 11', 'NATIONAL SERVICE TRAINING PROGRAM 11', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(10, 'ENG 12', 'WRITING IN THE DISCIPLINE', 3, 0, 1, 'First', 'Second', 'ENG 11', 1, 0),
(11, 'FIL 12', 'PAGBASA AT PAGSULAT TUNGO SA PANANALIKSIK', 3, 0, 1, 'First', 'Second', 'FIL 11', 1, 0),
(12, 'MATH 13', 'PLANE AND SPHERICAL TRIGONOMETRY', 4, 0, 1, 'First', 'Second', 'MATH 11', 1, 0),
(13, 'NAT SCI 12', 'GENERAL PHYSICS ', 3, 0, 1, 'First', 'Second', 'NAT SCI 11', 1, 0),
(14, 'SOC SCI 12', 'SOCIETY, CULTURE AND FAMILY PLANNING', 3, 0, 1, 'First', 'Second', 'SOC SCI 11', 1, 0),
(15, 'HUM 11', 'INTRO TO HUMANITIES', 3, 0, 1, 'First', 'Second', 'None', 1, 0),
(16, 'IT 103', 'PROGRAMMING 2 (STRUCTURED COMP PROG)', 2, 1, 1, 'First', 'Second', 'IT 102', 1, 0),
(17, 'PE 12', 'INDIVIDUAL AND DUAL SPORTS', 2, 0, 1, 'First', 'Second', 'PE 11', 1, 0),
(18, 'NSTP 12', 'NATIONAL SERVICE TRAINING PROGRAM 2', 3, 0, 1, 'First', 'Second', 'NSTP 11', 1, 0),
(19, 'BUS COM 11', 'BUSINESS COMMUNICATION', 3, 0, 1, 'Second', 'First', 'ENG 12', 2, 0),
(20, 'FIL 13', 'MASINING NA PAKIKIPAGTALASTASAN', 3, 0, 1, 'Second', 'First', 'FIL 12', 2, 0),
(21, 'HIST 11', 'LIFE AND WORKS OF RIZAL', 3, 0, 1, 'Second', 'First', 'None', 2, 0),
(22, 'IT 104', 'COMPUTER ORGANIZATION', 2, 1, 1, 'Second', 'First', 'IT 103', 2, 0),
(23, 'IT 105', 'OBJECT ORIENTED PROGRAMMING', 2, 1, 1, 'Second', 'First', 'IT 103', 2, 0),
(24, 'IT 106', 'DISCRETE MATHEMATICS', 3, 0, 1, 'Second', 'First', 'MATH 13', 2, 0),
(25, 'IT 107', 'ACCOUNTING PRINCIPLES AND FINANCIAL SYSTEM', 3, 0, 1, 'Second', 'First', 'MATH 13', 2, 0),
(26, 'IT 108', 'PC SERVICING', 2, 1, 1, 'Second', 'First', 'IT 101', 2, 0),
(27, 'PE 13', 'RHYTHMIC ACTIVITIES', 2, 0, 1, 'Second', 'First', 'PE 11', 2, 0),
(28, 'ENG 13', 'SPEECH AND ORAL COMMUNICATION', 3, 0, 1, 'Second', 'Second', 'ENG 13', 2, 0),
(29, 'STAT 12', 'PROBABILITY AND STATISTICS', 4, 0, 1, 'Second', 'Second', 'MATH 13', 2, 0),
(30, 'SOC SCI 13', 'BASIC ECON. W/ TAXATION AND AGRARIAN REFORM', 3, 0, 1, 'Second', 'Second', 'SOC SCI 12', 2, 0),
(31, 'HIST 12', 'Philippine History Its roots and Development', 3, 0, 1, 'Second', 'Second', 'None', 2, 0),
(32, 'IT 109', 'DATABASE MANAGEMENT SYSTEM', 2, 1, 1, 'Second', 'Second', 'IT 103,IT 106', 2, 0),
(33, 'IT 110', 'OPERATING SYSTEM APPLICATIONS', 2, 1, 1, 'Second', 'Second', 'IT 108', 2, 0),
(34, 'IT 111', 'NETWORK MANAGEMENT', 2, 1, 1, 'Second', 'Second', 'IT 108', 2, 0),
(35, 'PE 14', 'TEAM SPORTS', 2, 0, 1, 'Second', 'Second', 'PE 11', 2, 0),
(36, 'PHILO 11', 'LOGIC AND PHILOSOPHY OF MAN', 3, 0, 1, 'Third', 'First', 'HUM 11', 3, 0),
(37, 'LIT 11', 'PHILIPPINE LITERATURE', 3, 0, 1, 'Third', 'First', 'None', 3, 0),
(38, 'IT 112', 'WEB DEVELOPMENT', 2, 1, 1, 'Third', 'First', 'IT 105, IT 109', 3, 0),
(39, 'IT 113', 'DATABASE MANAGEMENT SYSTEM 2', 2, 1, 1, 'Third', 'First', 'IT 109', 3, 0),
(40, 'IT 114', 'SYSTEM ANALYSIS AND DESIGN', 3, 0, 1, 'Third', 'First', 'IT 105, IT 109', 3, 0),
(41, 'IT 115', 'IT ELECTIVE 1(FUTURE AND CURRENT TRENDS IN IT)', 3, 0, 1, 'Third', 'First', 'All IT Subjects in First Year', 3, 0),
(42, 'IT 116', 'SEMINARS/FIELTRIPS', 1, 0, 1, 'Third', 'First', '3rd Year Standing', 3, 0),
(43, 'SOC SCI 14', 'POLITICS, GOVERNANCE W/ THE NEW CONSTITUTION', 3, 0, 1, 'Third', 'First', 'SOC SCI 13', 3, 0),
(44, 'LIT 12', 'WOLRD LITERATURE', 3, 0, 1, 'Third', 'Second', 'None', 3, 0),
(45, 'IT 117', 'SOFTWARE ENGINEERING', 2, 1, 1, 'Third', 'Second', 'IT 114, IT 115', 3, 0),
(46, 'IT 118', 'MULTIMEDIA SYSTEM', 2, 1, 1, 'Third', 'Second', 'IT 112, IT 115', 3, 0),
(47, 'IT 119', 'PROFESSIONAL ETHICS', 3, 0, 1, 'Third', 'Second', 'IT 101', 3, 0),
(48, 'IT 120', 'IT ELECTIVE 2(NETWORK ADMIN AND PERFORMANCE)', 2, 1, 1, 'Third', 'Second', 'IT 111', 3, 0),
(49, 'IT 126', 'CONTENT MANAGEMENT SYSTEM', 3, 0, 1, 'Third', 'Second', 'IT 112, IT 113, IT 114', 3, 0),
(50, 'IT 122', 'CAPSTONE PROJECT 1', 2, 1, 1, 'Third', 'Second', 'IT 112, IT 113, IT 114', 3, 0),
(51, 'NAT SCI 16', 'ELECTRICITY AND MAGNETISM ', 3, 0, 1, 'Third', 'Second', 'NAT SCI 12', 3, 0),
(52, 'IT 123', 'CAPSTONE PROJECT 2', 2, 1, 1, 'Fourth', 'First', '4rthYr Standing', 4, 0),
(53, 'IT 124', 'IT ELECTIVE 3(WIRELESS TECH)', 2, 1, 1, 'Fourth', 'First', '4rthYr Standing', 4, 0),
(54, 'IT 125', 'IT ELECTIVE 4(JAVA PROGRAMMING)', 2, 1, 1, 'Fourth', 'First', '4rthYr Standing', 4, 0),
(55, 'IT 121', 'MOBILE COMPUTING', 3, 0, 1, 'Fourth', 'First', '4rthYr Standing', 4, 0),
(56, 'IT 132', 'AUTOCAD', 3, 0, 1, 'Fourth', 'First', '4rthYr Standing', 4, 0),
(57, 'IT 128', 'IT ELECTIVE 5(ARTIFICIAL INTELLIGENCE)', 2, 1, 1, 'Fourth', 'First', '4rtYr Standing', 4, 0),
(58, 'IT 129', 'OJT/INTERNSHIP PROGRAM(600 HOURS)', 0, 9, 1, 'Fourth', 'Second', '4rthYr Standing', 4, 0),
(59, 'FIL 11', 'KOMUNIKASYON SA AKADEMIKONG FILIPINO', 3, 0, 1, 'First', 'First', 'None', 1, 0),
(60, 'PE 11', 'PHYSICAL FITNESS & SELF TESTING ACTIVITIES', 2, 0, 1, 'First', 'First', 'None', 1, 0),
(62, 'hsyah', 'asdasd', 2, 2, 5, 'First', 'First', 'NONE', 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `tbluseraccount`
--
CREATE TABLE `tbluseraccount` (
`UserId` int(11) NOT NULL,
`Fullname` varchar(255) NOT NULL,
`User_name` varchar(255) NOT NULL,
`Pass` varchar(255) NOT NULL,
`UserType` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbluseraccount`
--
INSERT INTO `tbluseraccount` (`UserId`, `Fullname`, `User_name`, `Pass`, `UserType`) VALUES
(1, 'Janobe', 'admin', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'Administrator'),
(2, 'Faculty', 'faculty', '5cee1c23e1604e9ae4f2c0e93bbb4c6eb72b5f2c', 'Faculty');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tblauto`
--
ALTER TABLE `tblauto`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tblcourse`
--
ALTER TABLE `tblcourse`
ADD PRIMARY KEY (`CourseId`);
--
-- Indexes for table `tblcurriculum`
--
ALTER TABLE `tblcurriculum`
ADD PRIMARY KEY (`CurriculumId`);
--
-- Indexes for table `tblgrades`
--
ALTER TABLE `tblgrades`
ADD PRIMARY KEY (`GradesId`);
--
-- Indexes for table `tblprerequisite`
--
ALTER TABLE `tblprerequisite`
ADD PRIMARY KEY (`PreRequisiteId`);
--
-- Indexes for table `tblstudent`
--
ALTER TABLE `tblstudent`
ADD PRIMARY KEY (`ID`),
ADD UNIQUE KEY `IdNo` (`IdNo`);
--
-- Indexes for table `tblsubject`
--
ALTER TABLE `tblsubject`
ADD PRIMARY KEY (`SubjectId`);
--
-- Indexes for table `tbluseraccount`
--
ALTER TABLE `tbluseraccount`
ADD PRIMARY KEY (`UserId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tblauto`
--
ALTER TABLE `tblauto`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tblcourse`
--
ALTER TABLE `tblcourse`
MODIFY `CourseId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `tblcurriculum`
--
ALTER TABLE `tblcurriculum`
MODIFY `CurriculumId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tblgrades`
--
ALTER TABLE `tblgrades`
MODIFY `GradesId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=407;
--
-- AUTO_INCREMENT for table `tblprerequisite`
--
ALTER TABLE `tblprerequisite`
MODIFY `PreRequisiteId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=68;
--
-- AUTO_INCREMENT for table `tblstudent`
--
ALTER TABLE `tblstudent`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tblsubject`
--
ALTER TABLE `tblsubject`
MODIFY `SubjectId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=63;
--
-- AUTO_INCREMENT for table `tbluseraccount`
--
ALTER TABLE `tbluseraccount`
MODIFY `UserId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*
Name: Amount of FB User Login Succed
Data source: 4
Created By: Admin
Last Update At: 2016-02-12T15:37:25.590277+00:00
*/
SELECT COUNT(*) AS FB_Logins,
FROM
(SELECT post_prop23
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME_UTC_USEC("{{enddate}}", "%Y-%m-31")'))
WHERE post_page_event = "100" and post_prop23 = 'FB User Login Succeed' /* Counting Logins */
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}') )L
|
-- MySQL dump 10.13 Distrib 5.5.40, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: study
-- ------------------------------------------------------
-- Server version 5.5.40-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `articles`
--
DROP TABLE IF EXISTS `articles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `articles` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text,
`subsectionID` int(9) NOT NULL,
`createDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `articles`
--
LOCK TABLES `articles` WRITE;
/*!40000 ALTER TABLE `articles` DISABLE KEYS */;
INSERT INTO `articles` VALUES (1,'123','',0,'2015-01-18 21:22:26'),(2,'qwerty','123',0,'2015-01-18 21:22:52'),(3,'z','zzczxc',0,'2015-01-18 21:23:44'),(4,'z','zzczxc',0,'2015-01-18 21:25:20'),(5,'z','zzczxc',0,'2015-01-18 21:25:47'),(6,'z','zzczxc',0,'2015-01-18 21:26:20'),(7,'z','zzczxc',0,'2015-01-18 21:27:18'),(8,'z','zzczxc',0,'2015-01-18 21:27:49'),(9,'z','zzczxc',0,'2015-01-18 21:28:48'),(10,'z','zzczxc',0,'2015-01-18 21:29:29'),(11,'z','zzczxc',0,'2015-01-18 21:31:47'),(12,'Статья о бытие','Описание статьи о бытие.',2,'2015-01-18 21:32:21');
/*!40000 ALTER TABLE `articles` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `direction`
--
DROP TABLE IF EXISTS `direction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `direction` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` mediumtext,
`dateCreate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `direction`
--
LOCK TABLES `direction` WRITE;
/*!40000 ALTER TABLE `direction` DISABLE KEYS */;
INSERT INTO `direction` VALUES (1,'php','Записи php','2015-01-17 13:26:41'),(2,'mysql','Записи - mysql','2015-01-17 13:27:38'),(3,'unix ','Записи - Unix','2015-01-17 13:28:11');
/*!40000 ALTER TABLE `direction` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `section`
--
DROP TABLE IF EXISTS `section`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `section` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` mediumtext,
`directionID` int(9) DEFAULT NULL,
`dateCreate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `section`
--
LOCK TABLES `section` WRITE;
/*!40000 ALTER TABLE `section` DISABLE KEYS */;
INSERT INTO `section` VALUES (1,'Реляційні бази даних ','Опис реляційних баз ',2,'2015-01-17 13:39:57'),(2,'',NULL,NULL,'2015-01-17 13:39:57');
/*!40000 ALTER TABLE `section` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `subsection`
--
DROP TABLE IF EXISTS `subsection`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subsection` (
`id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` mediumtext,
`sectionID` int(9) NOT NULL,
`dateCreate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `subsection`
--
LOCK TABLES `subsection` WRITE;
/*!40000 ALTER TABLE `subsection` DISABLE KEYS */;
INSERT INTO `subsection` VALUES (1,'Нормалізація даних','Опис нормалізації даних',1,'2015-01-17 15:13:46'),(2,'Денормалізація даних','Опис денормалізації даних',1,'2015-01-17 15:17:34');
/*!40000 ALTER TABLE `subsection` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-01-18 23:36:56
|
/*
Name: Number of times saved by Language
Data source: 4
Created By: Admin
Last Update At: 2016-05-13T18:16:14.594548+00:00
*/
SELECT LANGUAGE,
count(*) Times_Saved,
FROM
(SELECT post_prop64 AS LANGUAGE,
post_prop26,
post_prop24
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME_UTC_USEC("{{enddate}}", "%Y-%m-31")'))
WHERE post_page_event='100'
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}')
AND DATE(date_time) > DATE('2016-04-18')
AND (post_prop25 = "articleSaved")
GROUP BY post_prop26,
post_prop24,
LANGUAGE) v
LEFT JOIN [djomniture:devspark.MG_Articles] AS a ON v.post_prop26=a.id
GROUP BY LANGUAGE
ORDER BY Times_Saved DESC
|
CREATE Procedure sp_print_StockDestruction_Detail (@StockDestroyID as integer)
As
SELECT "Product Code" = ClaimsDetail.Product_Code, "Item Name" = Items.ProductName,
"Batch" = Batch,"Expiry" = Expiry,"Purchase Price" = PurchasePrice,
"Claimed Quantity" = StockDestructionDetail.ClaimQuantity,
"Destroy Quantity" = StockDestructionDetail.DestroyQuantity,
"Rate" = Rate, "Value" = Quantity * Rate, "Remarks" = Remarks
FROM ClaimsDetail, Items, StockDestructionDetail, StockDestructionAbstract
WHERE StockDestructionDetail.DocSerial = @StockDestroyID
AND ClaimsDetail.Product_Code = Items.Product_Code
AND StockDestructionAbstract.ClaimID = ClaimsDetail.ClaimID
AND StockDestructionAbstract.DocSerial = StockDestructionDetail.DocSerial
AND StockDestructionDetail.Product_Code = Items.Product_code
AND StockDestructionDetail.BatchCode = ClaimsDetail.Batch_Code
|
'''
执行用时:477 ms, 在所有 MySQL 提交中击败了84.25% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
'''
# Write your MySQL query statement below
select player_id,
min(event_date) as first_login
from activity
group by player_id
'''
执行用时:495 ms, 在所有 MySQL 提交中击败了56.10% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
'''
# Write your MySQL query statement below
select player_id, event_date as first_login
from (
select
player_id,
event_date,
rank() over (partition by player_id order by event_date) as rk
from activity
# group by player_id
) t where rk = 1
'''
执行用时:490 ms, 在所有 MySQL 提交中击败了63.97% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
'''
# Write your MySQL query statement below
select player_id, event_date as first_login
from (
select
player_id,
event_date,
row_number() over (partition by player_id order by event_date) as rn
from activity
) t where rn = 1
'''
执行用时:507 ms, 在所有 MySQL 提交中击败了42.96% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
'''
# Write your MySQL query statement below
select
distinct player_id,
min(event_date) over (partition by player_id order by event_date) as first_login
from activity
'''
执行用时:501 ms, 在所有 MySQL 提交中击败了48.77% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
'''
# Write your MySQL query statement below
select
distinct player_id,
first_value(event_date) over (partition by player_id order by event_date) as first_login
from activity
|
/*
开票通知-产品资料
*/
delimiter $
drop trigger if exists Tgr_BillNotifies_AftereUpdate $
create trigger Tgr_BillNotifies_AftereUpdate after update
on BillNotifies
for each row
begin
/*定义变量*/
declare srid varchar(255);
declare sNewInvoiceNO varchar(255);
declare sOldInvoiceNO varchar(255);
set srid=new.rid;
set sNewInvoiceNO=new.InvoiceNO;
set sOldInvoiceNO=old.InvoiceNO;
begin
/*定义变量*/
declare sPurchaseOrderNo varchar(255);
declare sItemNo varchar(255);
declare sSOL_RecordID varchar(255);
/*定义结束标志变量*/
declare Done2 int default 0;
/*定义游标 以及赋值*/
declare Cursor_BillNotifies_AftereUpdate_BillNotifiesLine cursor for
Select PurchaseOrderNo,ItemNo,SOL_RecordID From BillNotifiesLine Where pid=srid;
/*指定游标循环结束时的返回值 */
declare continue handler for not found set Done2 =1;
/*打开游标*/
open Cursor_BillNotifies_AftereUpdate_BillNotifiesLine;
/*循环开始*/
flag_loop_BillNotifiesLine:loop
/*给游标变量赋值*/
fetch Cursor_BillNotifies_AftereUpdate_BillNotifiesLine into sPurchaseOrderNo,sItemNo,sSOL_RecordID;
/*判断游标的循环是否结束*/
if Done2 then
leave flag_loop_BillNotifiesLine ;
end if ;
call Proc_Shipments_SumBilledAmount2(srid,sPurchaseOrderNo,sItemNo,sSOL_RecordID);-- 出运明细-采购明细-开票金额
end loop; /*循环结束*/
close Cursor_BillNotifies_AftereUpdate_BillNotifiesLine;/*关闭游标*/
end;
end$
delimiter ; |
CREATE PROCEDURE mERP_sp_get_InvInvalidMarginItems
(
@INVOICEID INT,
@Mode Int=0,
@GRNDate DateTime = Null
)
AS
If @GRNDate Is Null
Set @GRNDate = GetDate()
Create Table #RecItemList (ItemOrderID Int, CategoryID Int, ParentCatID Int, Margin Decimal(18,6))
Insert Into #RecItemList (ItemOrderID, CategoryID, ParentCatID, Margin)
Select IDR.ItemOrder, ICA.CategoryID, ICB.CategoryID,
isNull(dbo.merp_fn_Get_ProductMargin(IDR.Product_Code,@GRNDate),0)
From InvoiceDetailReceived IDR, Items I, ItemCategories ICA, ItemCategories ICB
Where IDR.InvoiceID = @INVOICEID
And (IDR.Pending > 0 Or @Mode = 2)
And IDR.Product_Code = I.Product_Code
And I.CategoryID = ICA.CategoryID
And ICA.ParentID = ICB.CategoryID
-- To Show the Margin not defined received Items
SELECT Distinct IDR.ForumCode , I.ProductName,0 'ExistingMargin',0 'NewMargin'
FROM InvoiceDetailReceived IDR, #RecItemList RIL, Items I
WHERE IDR.InvoiceID = @INVOICEID
And Margin = 0
And RIL.ItemOrderID = IDR.ItemOrder
And IDR.Product_Code = I.Product_Code
union
select S.Product_Code,Items.ProductName,OldMargin,Percentage
from dbo.mERP_fn_GetNewProductMargin(@INVOICEID,@GRNDate) S,Items
where S.Product_Code=Items.Product_Code
and S.Percentage > 0
Drop Table #RecItemList
|
create unique index UIDX_PERSONIDENT_FOEDSELSNUMMER_ID ON PERSONIDENT(FOEDSELSNUMMER); |
use book_sc;
insert into books values
('0672329166','Luke Welling and Laura Thomson','PHP and MySQL Web Development',1,49.99,
'PHP & MySQL Web Development teaches the reader to develop dynamic, secure e-commerce web sites. You will learn to integrate and implement these technologies by following real-world examples and working sample projects.'),
('067232976X','Julie Meloni','Sams Teach Yourself PHP, MySQL and Apache All-in-One',1,34.99,
'Using a straightforward, step-by-step approach, each lesson in this book builds on the previous ones, enabling you to learn the essentials of PHP scripting, MySQL databases, and the Apache web server from the ground up.'),
('0672319241','Sterling Hughes and Andrei Zmievski','PHP Developer\'s Cookbook',1,39.99,
'Provides a complete, solutions-oriented guide to the challenges most often faced by PHP developers\r\nWritten specifically for experienced Web developers, the book offers real-world solutions to real-world needs\r\n');
insert into categories values
(1,'Internet'),
(2,'Self-help'),
(3,'Fiction'),
(4,'Gardening');
insert into admin values
('admin',sha1('admin'));
|
CREATE OR REPLACE PUBLIC SYNONYM ti_constant_pkg FOR orient.ti_constant_pkg; |
CREATE TABLE TASKSTATUS
(
ID INTEGER PRIMARY KEY,
NAME VARCHAR(50) UNIQUE NOT NULL,
DESCRIPTION TEXT NOT NULL
);
CREATE TABLE EMPLOYEE
(
ID INTEGER PRIMARY KEY,
NAME VARCHAR(50) UNIQUE NOT NULL
);
CREATE TABLE TASK
(
ID INTEGER PRIMARY KEY,
TITLE VARCHAR(200) NOT NULL,
NUMBER VARCHAR(20) UNIQUE NOT NULL,
DESCRIPTION TEXT NOT NULL,
TASKSTATUSID INTEGER NOT NULL REFERENCES TASKSTATUS,
APPROVED BOOLEAN,
EXECUTOR INTEGER REFERENCES EMPLOYEE
);
CREATE TABLE PRIMARY_KEY_SEQUENCES
(
TABLE_NAME VARCHAR(50) NOT NULL UNIQUE,
CURRENT_PK_VALUE INTEGER NOT NULL
);
INSERT INTO PRIMARY_KEY_SEQUENCES (TABLE_NAME, CURRENT_PK_VALUE) VALUES ('TASKSTATUS', 0);
INSERT INTO PRIMARY_KEY_SEQUENCES (TABLE_NAME, CURRENT_PK_VALUE) VALUES ('EMPLOYEE', 0);
INSERT INTO PRIMARY_KEY_SEQUENCES (TABLE_NAME, CURRENT_PK_VALUE) VALUES ('TASK', 0);
|
/*
** Question: https://leetcode.com/problems/market-analysis-i/
*/
-- method 1, MS SQL
SELECT
u.user_id AS buyer_id,
u.join_date,
COALESCE(t1.orders_in_2019, 0) AS orders_in_2019
FROM Users u
LEFT OUTER JOIN (
SELECT buyer_id, COUNT(*) AS orders_in_2019
FROM Orders
WHERE DATEPART(yy, order_date) = 2019
GROUP BY buyer_id
) t1
ON u.user_id = t1.buyer_id
-- method 2, Oracle
-- Reference is this solution: https://leetcode.com/problems/market-analysis-i/discuss/357761/A-simple-MYSQL-solution-beats-100-so-far
SELECT
u.user_id AS buyer_id, u.join_date,
COUNT(o.order_id) AS orders_in_2019
FROM Users u
LEFT OUTER JOIN Orders o
ON u.user_id = o.buyer_id AND DATEPART(yy, order_date) = 2019
GROUP BY u.user_id, u.join_date
|
DROP TABLE IF EXISTS exchange_rates;
CREATE TABLE IF NOT EXISTS exchange_rates
(
id SERIAL PRIMARY KEY ,
currency_from VARCHAR(3) ,
currency_to VARCHAR(3) ,
rate NUMERIC ,
rate_date DATE ,
updated_time TIMESTAMP
);
-- CREATE SEQUENCE exchange_rates_id_seq INCREMENT BY 1;
-- DROP TABLE IF EXISTS exchange_rates;
-- DROP SEQUENCE IF EXISTS exchange_rates_id_seq;
|
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MariaDB
Source Server Version : 100408
Source Host : localhost:3306
Source Schema : test
Target Server Type : MariaDB
Target Server Version : 100408
File Encoding : 65001
Date: 23/10/2019 10:29:40
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for cannabis
-- ----------------------------
DROP TABLE IF EXISTS `cannabis`;
CREATE TABLE `cannabis` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'รหัส',
`firstname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'ชื่อ',
`lastname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'นามสกุล',
`cid` varchar(13) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'บัตรประชาชน',
`birthday_en` date NOT NULL COMMENT 'วันเดือนปีเกิด ค.ศ.',
`disease` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'โรคประจำตัว ผู้ป่วย 4 กลุ่มโรค',
`screening` date NOT NULL COMMENT 'วันที่ประสงค์เข้าคัดกรอง',
`mobile` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'เบอร์โทร',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `index_cid`(`cid`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
|
-- Create table
create table GEUSUARI
(
CD_USUARIO NUMBER(6) not null,
NM_USUARIO VARCHAR2(40) not null,
DS_LOGIN VARCHAR2(30) not null,
ST_USUARIO VARCHAR2(1) not null,
NM_INICIAL VARCHAR2(6) ,
DS_EMAIL VARCHAR2(200),
NR_DDD NUMBER(2) ,
NR_TELEFONE NUMBER(8) ,
ST_TROCA_FILIAL VARCHAR2(1) ,
ST_MOSTRA_APLICACAO VARCHAR2(1) ,
ST_PERMISSAO_MENU VARCHAR2(1),
NM_USUINC VARCHAR2(30) not null,
DT_USUINC DATE not null,
DS_ACESSO VARCHAR2(30),
CD_USUARIO_PAI NUMBER(6),
NM_USUALT VARCHAR2(30),
DT_USUALT DATE
)
tablespace DADOS_TABLESPACE
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 64K
minextents 1
maxextents unlimited
pctincrease 0
);
-- Add comments to the columns
comment on column GEUSUARI.CD_USUARIO
is 'Código do usuário';
comment on column GEUSUARI.NM_USUARIO
is 'Nome do usuário';
comment on column GEUSUARI.DS_LOGIN
is 'Nome do login';
comment on column GEUSUARI.ST_USUARIO
is 'Domínio para o status do usuário do sistema';
comment on column GEUSUARI.ST_ATUALIZA_HELP
is 'Domínio para os valores Sim ou Não';
comment on column GEUSUARI.NM_INICIAL
is 'Iniciais do nome do usuário';
comment on column GEUSUARI.DS_EMAIL
is 'E-mail do usuário';
comment on column GEUSUARI.NR_DDD
is 'DDD do usuário';
comment on column GEUSUARI.NR_TELEFONE
is 'Número do telefone do usuário';
comment on column GEUSUARI.QT_ULT_ACESSOS
is 'Quantidade de itens de menu que estará nos últimos acessos';
comment on column GEUSUARI.ST_EXPIRA_SENHA
is 'Domínio para os valores Sim ou Não';
comment on column GEUSUARI.ST_TROCA_FILIAL
is 'Domínio para os valores Sim ou Não';
comment on column GEUSUARI.ST_MOSTRA_APLICACAO
is 'Domínio para os valores Sim ou Não';
comment on column GEUSUARI.ST_PERMISSAO_MENU
is 'Define se o usuário pode alterar as permissões do menu';
comment on column GEUSUARI.ST_LIBERA_MENU_TOTAL
is 'Flag para definir se mostra o menu total para o usuário alterar';
comment on column GEUSUARI.NM_USUINC
is 'Nome do usuário de inclusão';
comment on column GEUSUARI.DT_USUINC
is 'Data de inclusão';
comment on column GEUSUARI.DS_SENHA_WEB
is 'Descrição da senha para visualizar a senha da web';
comment on column GEUSUARI.DT_EXPIRACAO_SENHA
is 'Data de expiração da senha';
comment on column GEUSUARI.DS_ACESSO
is 'Senha do usuário';
comment on column GEUSUARI.CD_MATRICULA_FOLHA
is 'Código da matrícula da folha de pgto';
comment on column GEUSUARI.CD_USUARIO_PAI
is 'Código do usuário';
comment on column GEUSUARI.NM_USUALT
is 'Nome do usuário de alteração';
comment on column GEUSUARI.DT_USUALT
is 'Data de alteração';
-- Create/Recreate primary, unique and foreign key constraints
alter table GEUSUARI
add constraint PK_GEUSUARI primary key (CD_USUARIO)
using index
tablespace INDICES_TABLESPACE
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 64K
minextents 1
maxextents unlimited
pctincrease 0
);
alter table GEUSUARI
add constraint FK_GEUSUARIPAI_GEUSUARI_FILHO foreign key (CD_USUARIO_PAI)
references GEUSUARI (CD_USUARIO);
-- Create/Recreate check constraints
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_ATUALIZA_HELP
check (ST_ATUALIZA_HELP IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_EXPIRA_SENHA
check (ST_EXPIRA_SENHA IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_LIB_MENU_TOT
check (ST_LIBERA_MENU_TOTAL IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_MOSTRA_APLIC
check (ST_MOSTRA_APLICACAO IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_PERMISSAO_MENU
check (ST_PERMISSAO_MENU IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_TROCA_FILIAL
check (ST_TROCA_FILIAL IN ('S', 'N'));
alter table GEUSUARI
add constraint CK_GEUSUARI_ST_USUARIO
check (ST_USUARIO IN ('A', 'B', 'D'));
-- Create/Recreate indexes
create index FK_GEUSUARIPAI_GEUSUARI_FILHO_ on GEUSUARI (CD_USUARIO_PAI)
tablespace INDICES_TABLESPACE
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 64K
minextents 1
maxextents unlimited
pctincrease 0
);
create public synonym GEUSUARI for geusuari;
grant all on geusuari to linepack_role; |
SELECT table_catalog,
table_schema,
table_name,
table_type,
self_referencing_column_name,
reference_generation,
user_defined_type_catalog,
user_defined_type_schema,
user_defined_type_name,
is_insertable_into,
is_typed,
commit_action
FROM
information_schema.tables
|
DROP TABLE `<taivol/DK11>_loomaaed`
CREATE TABLE IF NOT EXISTS `<taivol/DK11>_loomaaed` (
`id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`nimi` VARCHAR(100) NOT NULL,
`puur` INT(11) NOT NULL,
`liik` VARCHAR(100) NOT NULL
);
INSERT INTO `<taivol/DK11>_loomaaed` (`id`, `nimi`, `puur`, `liik`) VALUES
(1, 'Olaf', 8, 'pildid/bear.png'),
(2, 'Kassper', 2, 'pildid/cat.png'),
(3, 'Kaarel', 2, 'pildid/cat.png'),
(4, 'Toomas', 2, 'pildid/cat.png'),
(5, 'Rosso', 4, 'pildid/pig.png'),
(6, 'Porco', 4, 'pildid/pig.png'),
(7, 'Lucy', 5, 'pildid/monkey.png'),
(8, 'Hopper', 8, 'pildid/rabbit.png'),
(9, 'Maali', 7, 'pildid/cow.png'),
(10, 'Kasper', 7, 'pildid/cow.png'),
(11, 'Mingi', 7, 'pildid/cow.png'); |
-- Задание 4_1 Из таблицы users необходимо извлечь пользователей, родившихся в августе и мае.
-- Месяцы заданы в виде списка английских названий (may, august)
use shop;
select * from users;
select *, MONTHNAME(birthday_at) as month_1 from users where (MONTH(birthday_at) = 5) or (MONTH(birthday_at) = 8); |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 26, 2018 at 02:46 PM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `99workers`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
DROP TABLE IF EXISTS `admin`;
CREATE TABLE IF NOT EXISTS `admin` (
`aid` int(11) NOT NULL AUTO_INCREMENT,
`aname` varchar(200) NOT NULL,
`pass` varchar(200) NOT NULL,
`email` varchar(200) NOT NULL,
PRIMARY KEY (`aid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`aid`, `aname`, `pass`, `email`) VALUES
(1, 'wer qwe', 'pass', 'asdf@kjfd');
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
CREATE TABLE IF NOT EXISTS `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`descr` text NOT NULL,
`status` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`, `descr`, `status`) VALUES
(4, 'asdfer', 'uyrtw', 0),
(3, 'asdfasdf', 'asdfsadfas', 1);
-- --------------------------------------------------------
--
-- Table structure for table `portfolio`
--
DROP TABLE IF EXISTS `portfolio`;
CREATE TABLE IF NOT EXISTS `portfolio` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`pname` varchar(200) NOT NULL,
`pimage` varchar(200) NOT NULL,
`pdescr` text NOT NULL,
`cid` int(11) NOT NULL,
PRIMARY KEY (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `portfolio`
--
INSERT INTO `portfolio` (`pid`, `pname`, `pimage`, `pdescr`, `cid`) VALUES
(3, 'szdff', '1516959021portfolio.jpg', 'sad', 4);
-- --------------------------------------------------------
--
-- Table structure for table `product`
--
DROP TABLE IF EXISTS `product`;
CREATE TABLE IF NOT EXISTS `product` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`pname` varchar(200) NOT NULL,
`cost` int(11) NOT NULL,
`pdescr` text NOT NULL,
`pimage` varchar(200) NOT NULL,
`link` varchar(250) NOT NULL,
`status` int(2) NOT NULL,
PRIMARY KEY (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`pid`, `pname`, `cost`, `pdescr`, `pimage`, `link`, `status`) VALUES
(1, 'dsfg', 54, 'gsf', '1516959550product.jpg', 'http://fdsg.com', 0);
-- --------------------------------------------------------
--
-- Table structure for table `project`
--
DROP TABLE IF EXISTS `project`;
CREATE TABLE IF NOT EXISTS `project` (
`pid` int(10) NOT NULL AUTO_INCREMENT,
`pname` varchar(200) NOT NULL,
`dscr` text NOT NULL,
`cost` int(11) NOT NULL,
`attach` varchar(200) NOT NULL,
`pstatus` int(1) NOT NULL,
`pprogress` text NOT NULL,
`scid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `project`
--
INSERT INTO `project` (`pid`, `pname`, `dscr`, `cost`, `attach`, `pstatus`, `pprogress`, `scid`, `uid`) VALUES
(1, 'fgdfg', 'gdfgfdg', 5867, '1516969676portfolio.JPG', 0, '', 3, 0),
(2, 'drgf', 'dfgdfg', 45345, '1516969732portfolio.JPG', 0, '', 3, 0),
(3, 'egt', 'etg', 53, '', 1, '', 3, 3),
(4, 'fgthgf', 'hgfhfgh', 543245, '', 0, '', 3, 3);
-- --------------------------------------------------------
--
-- Table structure for table `scategory`
--
DROP TABLE IF EXISTS `scategory`;
CREATE TABLE IF NOT EXISTS `scategory` (
`scid` int(11) NOT NULL AUTO_INCREMENT,
`scname` varchar(200) NOT NULL,
`scdescr` text NOT NULL,
`scstatus` int(1) NOT NULL,
PRIMARY KEY (`scid`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `scategory`
--
INSERT INTO `scategory` (`scid`, `scname`, `scdescr`, `scstatus`) VALUES
(2, '0', '0', 1),
(3, 'sef', 'sfsdf', 0);
-- --------------------------------------------------------
--
-- Table structure for table `service`
--
DROP TABLE IF EXISTS `service`;
CREATE TABLE IF NOT EXISTS `service` (
`sid` int(10) NOT NULL AUTO_INCREMENT,
`sname` varchar(200) NOT NULL,
`short_descr` varchar(200) NOT NULL,
`sdescr` text NOT NULL,
`image` text NOT NULL,
`scid` int(10) NOT NULL,
`status` int(1) NOT NULL,
PRIMARY KEY (`sid`)
) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `service`
--
INSERT INTO `service` (`sid`, `sname`, `short_descr`, `sdescr`, `image`, `scid`, `status`) VALUES
(22, 't5wr', 'rt', 'rew', '', 1, 1),
(23, 'df', 'sfd', 'fds', '1516960500service.jpg', 3, 0);
-- --------------------------------------------------------
--
-- Table structure for table `subscription`
--
DROP TABLE IF EXISTS `subscription`;
CREATE TABLE IF NOT EXISTS `subscription` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(200) NOT NULL,
`created` datetime NOT NULL,
`status` int(3) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `subscription`
--
INSERT INTO `subscription` (`id`, `email`, `created`, `status`) VALUES
(1, 'a', '2018-01-26 08:13:09', 1),
(2, 'amitanand.kvj.2@gmail.com', '2018-01-26 08:13:29', 1),
(3, 'A', '2018-01-26 08:54:00', 1),
(4, 'A', '2018-01-26 08:55:36', 1),
(5, 'A', '2018-01-26 08:57:08', 1),
(6, 'FG', '2018-01-26 08:57:57', 1),
(7, 'A', '2018-01-26 09:01:58', 1),
(8, 'a', '2018-01-26 09:08:31', 1),
(9, 'ad', '2018-01-26 09:09:02', 1),
(10, 'amit ana', '2018-01-26 09:09:24', 1),
(11, 'amitanand.kvj.2@gmail.com', '2018-01-26 09:10:32', 1),
(12, 'amitanand.kvj.3@gmail.com', '2018-01-26 09:15:34', 1);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(200) NOT NULL,
`lname` varchar(100) NOT NULL,
`email` varchar(200) NOT NULL,
`password` varchar(200) NOT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
`status` int(11) NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`uid`, `fname`, `lname`, `email`, `password`, `created`, `modified`, `status`) VALUES
(3, '', '', 'amitanand.kvj.2@gmail.com', '202cb962ac59075b964b07152d234b70', '2018-01-25 20:36:03', '2018-01-26 12:40:57', 1),
(4, 'amit', 'anand', 'amitanand.kvj.3@gmail.com', '202cb962ac59075b964b07152d234b70', '2018-01-25 20:40:21', '2018-01-26 12:40:57', 1),
(5, 'amit', 'chutiya', 'amit@chu.tiya', '202cb962ac59075b964b07152d234b70', '2018-01-26 10:59:19', '2018-01-26 12:40:57', 1);
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 */;
|
/*
Name: # Listings views- (DR2015)
Data source: 4
Created By: Admin
Last Update At: 2015-08-24T15:21:31.609278+00:00
*/
SELECT COUNT(*) AS Views,
FROM
(SELECT FIRST(SPLIT(LAST(SPLIT(post_prop5, '/')), '-')) AS Listing
/*Listing properties per listing*/
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,'CONCAT(REPLACE(table_id,"_","-"),"-01") BETWEEN STRFTIME_UTC_USEC("{{startdate}}", "%Y-%m-01") and STRFTIME_UTC_USEC("{{enddate}}", "%Y-%m-31")'))
WHERE post_page_event = "0" /*PageView Calls*/
AND post_prop19 = 'listing' /* Counting Listings */
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}') )c
/*List of valid listings (active/no active)*/
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL ON c.Listing = MG_HL.Listing_id
|
MERGE Common.ApplicationParameters AS trg
USING
(
VALUES
(N'Site.Url', N'http://текстовичёк.рф')
,(N'Site.UrlName', N'текстовичёк.рф')
,(N'Site.SupportEmail', N'support@текстовичёк.рф')
,(N'Role.AnonymousRole', N'Anonymous')
,(N'Role.RegisteredUserRole', N'User')
,(N'Page.About', N'13')
,(N'Page.Rules', N'13')
,(N'User.DefaultAvatarId', N'-1')
,(N'Email.SystemFrom', N'noreply@xn--b1amfiegqdr.xn--p1ai')
,(N'Email.SystemFromDisplay', N'noreply@текстовичёк.рф')
,(N'Email.Host', N'smtp-56.1gb.ru')
,(N'Email.Port', N'465')
,(N'Email.Login', N'u251838')
,(N'Email.Password', N'sdz1kq7j6q9vBW0')
) AS src (Name, Value)
ON trg.Name = src.Name
WHEN NOT MATCHED BY TARGET THEN
INSERT (Name, Value)
VALUES (Name, Value)
WHEN NOT MATCHED BY SOURCE THEN
DELETE
;
MERGE Informative.SiteReviewTypes AS trg
USING
(
VALUES
(N'Tip', N'Подсказка')
,(N'Question', N'Вопрос')
,(N'Offer', N'Предложение')
) AS src (Name, Title)
ON trg.Name = src.Name
WHEN NOT MATCHED BY TARGET THEN
INSERT (Name, Title)
VALUES (Name, Title)
WHEN NOT MATCHED BY SOURCE THEN
DELETE
;
|
insert into subaru_key (car_id,part_id)
values(${car_id},${part_id}); |
Create Procedure mERP_sp_Get_CSDisplayPayoutPeriod(@SchemeID Int, @Mode Int = 0)
As
Begin
IF @Mode = 2
Select ID, PayoutPeriodFrom, PayoutPeriodTo from tbl_mERP_SchemePAyoutPeriod
Where SchemeID = @SchemeID And Active = 1 And
PayoutPeriodTo < (Select Top 1 TransactionDate from SetUp)
Order By 1
Else IF @Mode = 1
Select ID, PayoutPeriodFrom, PayoutPeriodTo from tbl_mERP_SchemePAyoutPeriod
Where SchemeID = @SchemeID And Active = 1
Order By 1
Else
Select ID, PayoutPeriodFrom, PayoutPeriodTo from tbl_mERP_SchemePAyoutPeriod
Where SchemeID = @SchemeID
Order By 1
End
|
BEGIN TRANSACTION
ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0;
CREATE INDEX [flags] ON regions(flags);
ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0;
ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
COMMIT
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 03, 2019 at 06:31 PM
-- Server version: 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: `atg`
--
-- --------------------------------------------------------
--
-- Table structure for table `atg`
--
CREATE TABLE `atg` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`pincode` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Dumping data for table `atg`
--
INSERT INTO `atg` (`id`, `name`, `email`, `pincode`, `created_at`, `updated_at`) VALUES
(1, 'Aurobindo Parida', 'aparida1987@gmail.com', 160071, '2019-06-03 12:42:52', '2019-06-03 18:12:52'),
(2, 'Aurobindo Parida', 'aparida19871@gmail.com', 160071, '2019-06-03 12:45:54', '2019-06-03 18:15:54'),
(3, 'Aurobindo Parida', 'aparida1987y@gmail.com', 160071, '2019-06-03 12:46:57', '2019-06-03 18:16:57'),
(4, 'Aurobindo Parida', 'aparida19873@gmail.com', 160071, '2019-06-03 12:51:03', '2019-06-03 18:21:03'),
(5, 'Aurobindo Parida', 'aparida19827@gmail.com', 160071, '2019-06-03 12:52:24', '2019-06-03 18:22:24');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `atg`
--
ALTER TABLE `atg`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `atg`
--
ALTER TABLE `atg`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
/*!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 */;
|
INSERT INTO info (id, text) VALUES (1, 'Salem Alem!');
|
ALTER TABLE tblThemes ADD PageCountToShow int DEFAULT NULL
ALTER TABLE tblThemes ADD MaxCountToSubmit int DEFAULT NULL |
/*
IMPLICIT TYPE CONVERSION
=================================
- on INSERT and UPDATES values are converted o the data types of the affected colum.
- on SELECT statements values are converted from the type of the columns to the
type of the target variable.
- Oracle adjusts precision and scale for numeric data typs to allow for maximum
capacity.
- When converting a TIMESTAMP to a DATE the fractional part is truncated.
- When comparing a DATE to a CHAR type, the CHAR type is converted to a DATE
- When a SQL function or operator is called with an argument of the wrong data type,
Oracle implicitly converts the argument if possible.
- When making assignments the value at the right side of the equal sign (=) is converted
to the type of the assignment target on the left side.
- during character concatenation, non-character data is converted to CHAR on NCHAR
- For arithmetic operations or comparisons between character or non-characterdata types,
Oracle converts to NUMER, DATE or ROWID as appropriate.
- In arithmetic opertion involving only character data, oracle converts to a NUMBER.
- User-defined types cannot be IMPLICITLY converted
character data cannot be implicitly converted to a DATE unless it is in teh dafault date format specified
in the session.
character data cannot be implicitly converted to a number if it contains dollar sign or commas
EXPLICIT TYPE CONVERSION
=================================
It is Oracle's recommendation that you use explicit type conversion using conversion
functions for the following reasons:
- code is easier to read
- implicit data type convrsion can have negative impact on performance
- implicit conversion depends on the context in which it occours and may not work
the same way in every case
- Algorithms for implicit conversion are subject to change across software releases
and among Oracle products.
*/
alter session set NLS_TERRITORY='AMERICA';
alter session set NLS_NUMERIC_CHARACTERS='.,';
DECLARE
a NUMBER;
BEGIN
a := '123.400' || 999; --> explicitely: to_number('123.400' || to_char(999) );
dbms_output.put_line(a);
end ;
/
declare
a number;
begin
a := 3 ** 3 ; -- 3^3
dbms_output.put_line(a);
end;
/
|
drop database if exists liuyan;
create database liuyan;
use liuyan;
create table user_inf
(
id int auto_increment primary key,
name varchar(255),
pass varchar(255)
);
insert into user_inf
values(null,'crazyit','123');
insert into user_inf
values(null,'tiger','123');
|
SELECT * FROM %s WHERE collection='%s' AND is_active; |
-- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Mar 17, 2017 at 11:24 AM
-- Server version: 5.5.49-log
-- PHP Version: 7.0.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 utf8mb4 */;
--
-- Database: `infup`
--
-- --------------------------------------------------------
--
-- Table structure for table `cmnt`
--
CREATE TABLE IF NOT EXISTS `cmnt` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`User_id` int(11) NOT NULL,
`cmnt` text COLLATE utf8_spanish_ci NOT NULL,
`date` datetime NOT NULL,
`important` enum('yes','no') COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Cmnt about the elders';
-- --------------------------------------------------------
--
-- Table structure for table `devices`
--
CREATE TABLE IF NOT EXISTS `devices` (
`id` int(11) NOT NULL,
`ip` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
-- --------------------------------------------------------
--
-- Table structure for table `elder`
--
CREATE TABLE IF NOT EXISTS `elder` (
`id` int(11) NOT NULL,
`firstname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`lastname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`fullname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`Persona_iIdentity_number` varchar(12) COLLATE utf8_spanish_ci NOT NULL,
`tel` varchar(18) COLLATE utf8_spanish_ci NOT NULL,
`mobile_tel` varchar(18) COLLATE utf8_spanish_ci DEFAULT NULL,
`mail` varchar(256) COLLATE utf8_spanish_ci DEFAULT NULL,
`street` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`postcode` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`city` varchar(256) COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='LIst of elders';
-- --------------------------------------------------------
--
-- Table structure for table `elderinfo`
--
CREATE TABLE IF NOT EXISTS `elderinfo` (
`id` int(11) NOT NULL,
`medicine_cabinet_placement` text COLLATE utf8_spanish_ci NOT NULL,
`insulin` enum('yes','no') COLLATE utf8_spanish_ci NOT NULL,
`active` enum('yes','no') COLLATE utf8_spanish_ci NOT NULL,
`Death_date` datetime DEFAULT NULL,
`info` text COLLATE utf8_spanish_ci NOT NULL,
`directions` text COLLATE utf8_spanish_ci NOT NULL,
`elder_id` int(11) NOT NULL,
`relative_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Infromation about the elder';
-- --------------------------------------------------------
--
-- Table structure for table `laundry`
--
CREATE TABLE IF NOT EXISTS `laundry` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`date` date NOT NULL,
`cmnt` text COLLATE utf8_spanish_ci,
`performed` enum('yes','no','declined') COLLATE utf8_spanish_ci NOT NULL,
`performer_id` int(11) DEFAULT NULL,
`planer_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Chart of laundry';
-- --------------------------------------------------------
--
-- Table structure for table `relative`
--
CREATE TABLE IF NOT EXISTS `relative` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`firstname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`lastname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`tel` varchar(18) COLLATE utf8_spanish_ci DEFAULT NULL,
`mobile_tel` varchar(18) COLLATE utf8_spanish_ci DEFAULT NULL,
`mail` varchar(256) COLLATE utf8_spanish_ci DEFAULT NULL,
`street` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`postcode` varchar(10) COLLATE utf8_spanish_ci NOT NULL,
`city` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`relation` varchar(70) COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='List of elders relatives';
-- --------------------------------------------------------
--
-- Table structure for table `shopping`
--
CREATE TABLE IF NOT EXISTS `shopping` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`date` date NOT NULL,
`cmnt` text COLLATE utf8_spanish_ci,
`performed` enum('yes','no','declined') COLLATE utf8_spanish_ci NOT NULL,
`performer_id` int(11) DEFAULT NULL,
`planer_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Chart of shopping';
-- --------------------------------------------------------
--
-- Table structure for table `shower`
--
CREATE TABLE IF NOT EXISTS `shower` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`date` date NOT NULL,
`cmnt` text COLLATE utf8_spanish_ci,
`performed` enum('yes','no','declined') COLLATE utf8_spanish_ci NOT NULL,
`performer_id` int(11) DEFAULT NULL,
`planer_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Chart of showers';
-- --------------------------------------------------------
--
-- Table structure for table `sskcmnt`
--
CREATE TABLE IF NOT EXISTS `sskcmnt` (
`id` int(11) NOT NULL,
`elder_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`cmnt` text COLLATE utf8_spanish_ci NOT NULL,
`date` datetime NOT NULL,
`important` enum('yes','no') COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='Cmnt about the elders from ssk';
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL,
`firstname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`lastname` varchar(256) COLLATE utf8_spanish_ci NOT NULL,
`username` varchar(60) COLLATE utf8_spanish_ci NOT NULL,
`password` varchar(500) COLLATE utf8_spanish_ci NOT NULL,
`mail` varchar(254) COLLATE utf8_spanish_ci NOT NULL,
`type` enum('admin','planer','ssk','caregiver','systemAdmin') COLLATE utf8_spanish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci COMMENT='List of users';
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cmnt`
--
ALTER TABLE `cmnt`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `devices`
--
ALTER TABLE `devices`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `elder`
--
ALTER TABLE `elder`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `elderinfo`
--
ALTER TABLE `elderinfo`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `laundry`
--
ALTER TABLE `laundry`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `relative`
--
ALTER TABLE `relative`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `shopping`
--
ALTER TABLE `shopping`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `shower`
--
ALTER TABLE `shower`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `sskcmnt`
--
ALTER TABLE `sskcmnt`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cmnt`
--
ALTER TABLE `cmnt`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `devices`
--
ALTER TABLE `devices`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `elder`
--
ALTER TABLE `elder`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `elderinfo`
--
ALTER TABLE `elderinfo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `laundry`
--
ALTER TABLE `laundry`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `relative`
--
ALTER TABLE `relative`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `shopping`
--
ALTER TABLE `shopping`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `shower`
--
ALTER TABLE `shower`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sskcmnt`
--
ALTER TABLE `sskcmnt`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
/*!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 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 15, 2018 at 04:24 AM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `pengelolaanzakat`
--
-- --------------------------------------------------------
--
-- Table structure for table `jenisprogram`
--
CREATE TABLE `jenisprogram` (
`id` int(11) NOT NULL,
`nama` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `jenisprogram`
--
INSERT INTO `jenisprogram` (`id`, `nama`) VALUES
(1, 'Depok Sehat'),
(2, 'Depok Cerdas'),
(3, 'Depok Peduli'),
(4, 'Depok Takwa'),
(5, 'Depok Berkah');
-- --------------------------------------------------------
--
-- Table structure for table `kecamatan`
--
CREATE TABLE `kecamatan` (
`id` int(11) NOT NULL,
`nama` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `kecamatan`
--
INSERT INTO `kecamatan` (`id`, `nama`) VALUES
(9, 'Beji'),
(2, 'Bojongsari'),
(6, 'Cilodong'),
(7, 'Cimanggis'),
(11, 'Cinere'),
(4, 'Cipayung'),
(10, 'Limo'),
(3, 'Pancoran Mas'),
(1, 'Sawangan'),
(5, 'Sukma Jaya'),
(8, 'Tapos');
-- --------------------------------------------------------
--
-- Table structure for table `kelurahan`
--
CREATE TABLE `kelurahan` (
`id` int(11) NOT NULL,
`nama` varchar(45) DEFAULT NULL,
`idkecamatan` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `kelurahan`
--
INSERT INTO `kelurahan` (`id`, `nama`, `idkecamatan`) VALUES
(1, 'Pengasinan', 1),
(2, 'Bedahan', 1),
(3, 'Pasir Putih', 1),
(4, 'Sawangan Baru', 1),
(5, 'Sawangan Lama', 1),
(6, 'Kedaung', 1),
(7, 'Cinangka', 1),
(8, 'Duren Seribu', 2),
(9, 'Duren Mekar', 2),
(10, 'Bojongsari Lama', 2),
(11, 'Bojongsari Baru', 2),
(12, 'Pondok Petir', 2),
(13, 'Serua', 2),
(14, 'Curug', 2),
(15, 'Rangkapan Jaya Baru', 3),
(16, 'Rangkapan Jaya', 3),
(17, 'Mampang', 3),
(18, 'Pancoran Mas', 3),
(19, 'Depok Jaya', 3),
(20, 'Depok', 3),
(21, 'Pondok Ranggon', 4),
(22, 'Cilangkap', 4),
(23, 'Cipayung', 4),
(24, 'Bambu Apus', 4),
(25, 'Lubang Buaya', 4),
(26, 'Sukmajaya', 5),
(27, 'Tirtajaya', 5),
(28, 'Mekar Jaya', 5),
(29, 'Abadijaya', 5),
(30, 'Bakti Jaya', 5),
(31, 'Cisalak', 5),
(32, 'Kalimulya', 6),
(33, 'Jatimulya', 6),
(34, 'Kalibaru', 6),
(35, 'Cilodong', 6),
(36, 'Sukamaju', 6),
(37, 'Harjamukti', 7),
(38, 'Cisalak Pasar', 7),
(39, 'Mekarsari', 7),
(40, 'Pasir Gunung Selatan', 7),
(41, 'Curug', 7),
(42, 'Tugu', 7),
(43, 'Cilangkap', 8),
(44, 'Cimpaeun', 8),
(45, 'Tapos', 8),
(46, 'Leuwinaggung', 8),
(47, 'Jatijajar', 8),
(48, 'Sukamaju Baru', 8),
(49, 'Sukatani', 8),
(50, 'Beji', 9),
(51, 'Beji Timur', 9),
(52, 'Kemirimuka', 9),
(53, 'Pondok Cina', 9),
(54, 'Kukusan', 9),
(55, 'Tanah Baru', 9),
(56, 'Grogol', 10),
(57, 'Limo', 10),
(58, 'Meruyung', 10),
(59, 'Krukut', 10),
(60, 'Cinere', 11),
(61, 'Gandul', 11),
(62, 'Pangkalan Jati Baru', 11),
(63, 'Pangkalan Jati Lama', 11);
-- --------------------------------------------------------
--
-- Table structure for table `mustahik`
--
CREATE TABLE `mustahik` (
`id` int(11) NOT NULL,
`nik` varchar(45) DEFAULT NULL,
`nama` varchar(45) DEFAULT NULL,
`jeniskelamin` varchar(45) DEFAULT NULL,
`tempatlahir` varchar(45) DEFAULT NULL,
`tanggallahir` varchar(45) DEFAULT NULL,
`idkecamatan` int(11) NOT NULL,
`idkelurahan` int(11) NOT NULL,
`alamat` varchar(45) DEFAULT NULL,
`foto` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `mustahik`
--
INSERT INTO `mustahik` (`id`, `nik`, `nama`, `jeniskelamin`, `tempatlahir`, `tanggallahir`, `idkecamatan`, `idkelurahan`, `alamat`, `foto`) VALUES
(1, '', 'a', '', '', '', 2, 3, '', ''),
(3, '2', 's', 'Pria', '', '', 2, 3, '', ''),
(4, '1', 'd', '', '', '2018-11-09', 1, 1, '', ''),
(5, '4', 'f', 'Wanita', '', '', 6, 4, '', ''),
(6, '5', 'g', 'Pria', '', '2018-10-08', 7, 6, '', ''),
(7, '11', 'h', 'Pria', '', '2018-11-12', 7, 6, '', ''),
(8, '12', 'j', 'Pria', '', '2018-11-12', 7, 6, '', ''),
(9, '13', 'k', '', '', '', 11, 3, '', NULL),
(10, '131', 'l', '', '', '', 11, 3, '', '131.jpg'),
(11, '55', 'q', NULL, NULL, NULL, 3, 18, NULL, NULL),
(66, NULL, 'w', NULL, NULL, NULL, 4, 18, NULL, NULL),
(67, '77', 'e', NULL, NULL, NULL, 5, 3, NULL, NULL),
(68, '88', 'r', NULL, NULL, NULL, 8, 5, NULL, NULL),
(69, '99', 't', NULL, '', NULL, 9, 7, NULL, NULL),
(70, '00', NULL, NULL, NULL, NULL, 10, 11, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `muzaki`
--
CREATE TABLE `muzaki` (
`id` int(11) NOT NULL,
`nik` varchar(45) DEFAULT NULL,
`nama` varchar(45) DEFAULT NULL,
`jeniskelamin` varchar(45) DEFAULT NULL,
`tempatlahir` varchar(45) DEFAULT NULL,
`tanggallahir` varchar(45) DEFAULT NULL,
`idkecamatan` int(11) NOT NULL,
`idkelurahan` int(11) NOT NULL,
`alamat` varchar(45) DEFAULT NULL,
`foto` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `pengumpulan`
--
CREATE TABLE `pengumpulan` (
`id` int(11) NOT NULL,
`idmuzaki` int(11) NOT NULL,
`idupz` int(11) NOT NULL,
`keterangan` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `penyaluran`
--
CREATE TABLE `penyaluran` (
`id` int(11) NOT NULL,
`idmustahik` int(11) NOT NULL,
`idjenisprogram` int(11) NOT NULL,
`keterangan` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `penyaluran`
--
INSERT INTO `penyaluran` (`id`, `idmustahik`, `idjenisprogram`, `keterangan`) VALUES
(1, 6, 3, NULL),
(2, 8, 2, NULL),
(3, 4, 1, NULL),
(4, 67, 5, NULL),
(5, 10, 1, ''),
(6, 11, 3, NULL),
(7, 4, 2, NULL),
(8, 3, 1, NULL),
(9, 4, 5, NULL),
(10, 3, 2, '');
-- --------------------------------------------------------
--
-- Table structure for table `upz`
--
CREATE TABLE `upz` (
`id` int(11) NOT NULL,
`nama` varchar(45) DEFAULT NULL,
`idkecamatan` int(11) NOT NULL,
`idkelurahan` int(11) NOT NULL,
`alamat` varchar(45) DEFAULT NULL,
`foto` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `jenisprogram`
--
ALTER TABLE `jenisprogram`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `kecamatan`
--
ALTER TABLE `kecamatan`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `nama_UNIQUE` (`nama`);
--
-- Indexes for table `kelurahan`
--
ALTER TABLE `kelurahan`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_kelurahan_kecamatan_idx` (`idkecamatan`);
--
-- Indexes for table `mustahik`
--
ALTER TABLE `mustahik`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_mustahik_kelurahan1_idx` (`idkelurahan`),
ADD KEY `fk_mustahik_kecamatan1_idx` (`idkecamatan`);
--
-- Indexes for table `muzaki`
--
ALTER TABLE `muzaki`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `nik_UNIQUE` (`nik`),
ADD KEY `fk_mustahik_kelurahan1_idx` (`idkelurahan`),
ADD KEY `fk_mustahik_kecamatan1_idx` (`idkecamatan`);
--
-- Indexes for table `pengumpulan`
--
ALTER TABLE `pengumpulan`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_pengumpulan_upz1_idx` (`idupz`),
ADD KEY `fk_pengumpulan_muzaki1_idx` (`idmuzaki`);
--
-- Indexes for table `penyaluran`
--
ALTER TABLE `penyaluran`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_pembagian_jenisprogram1_idx` (`idjenisprogram`),
ADD KEY `fk_pembagian_mustahik1_idx` (`idmustahik`);
--
-- Indexes for table `upz`
--
ALTER TABLE `upz`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_upz_kelurahan1_idx` (`idkelurahan`),
ADD KEY `fk_upz_kecamatan1_idx` (`idkecamatan`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `jenisprogram`
--
ALTER TABLE `jenisprogram`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `kecamatan`
--
ALTER TABLE `kecamatan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `kelurahan`
--
ALTER TABLE `kelurahan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;
--
-- AUTO_INCREMENT for table `mustahik`
--
ALTER TABLE `mustahik`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=71;
--
-- AUTO_INCREMENT for table `muzaki`
--
ALTER TABLE `muzaki`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pengumpulan`
--
ALTER TABLE `pengumpulan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `penyaluran`
--
ALTER TABLE `penyaluran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `upz`
--
ALTER TABLE `upz`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `kelurahan`
--
ALTER TABLE `kelurahan`
ADD CONSTRAINT `fk_kelurahan_kecamatan` FOREIGN KEY (`idkecamatan`) REFERENCES `kecamatan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `mustahik`
--
ALTER TABLE `mustahik`
ADD CONSTRAINT `fk_mustahik_kecamatan1` FOREIGN KEY (`idkecamatan`) REFERENCES `kecamatan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_mustahik_kelurahan1` FOREIGN KEY (`idkelurahan`) REFERENCES `kelurahan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `muzaki`
--
ALTER TABLE `muzaki`
ADD CONSTRAINT `fk_mustahik_kecamatan10` FOREIGN KEY (`idkecamatan`) REFERENCES `kecamatan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_mustahik_kelurahan10` FOREIGN KEY (`idkelurahan`) REFERENCES `kelurahan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `pengumpulan`
--
ALTER TABLE `pengumpulan`
ADD CONSTRAINT `fk_pengumpulan_muzaki1` FOREIGN KEY (`idmuzaki`) REFERENCES `muzaki` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_pengumpulan_upz1` FOREIGN KEY (`idupz`) REFERENCES `upz` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `penyaluran`
--
ALTER TABLE `penyaluran`
ADD CONSTRAINT `fk_pembagian_jenisprogram1` FOREIGN KEY (`idjenisprogram`) REFERENCES `jenisprogram` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_pembagian_mustahik1` FOREIGN KEY (`idmustahik`) REFERENCES `mustahik` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `upz`
--
ALTER TABLE `upz`
ADD CONSTRAINT `fk_upz_kecamatan1` FOREIGN KEY (`idkecamatan`) REFERENCES `kecamatan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_upz_kelurahan1` FOREIGN KEY (`idkelurahan`) REFERENCES `kelurahan` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
set @userId = 5771;
set @hubName = 'NOTIFIER';
#GetUserHubConnections
select * from connections
where userId = @userId and hubName = @hubName;
#FindByConnectionId
select * from connections
where userId = @userId and hubName = @hubName
limit 1;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 27, 2019 at 07:04 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `pkl`
--
-- --------------------------------------------------------
--
-- Table structure for table `kategori`
--
CREATE TABLE `kategori` (
`id_kategori` int(11) NOT NULL,
`nama_kategori` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kategori`
--
INSERT INTO `kategori` (`id_kategori`, `nama_kategori`) VALUES
(1, 'Dokter'),
(3, 'biji1'),
(8, 'semut'),
(11, 'GULA'),
(12, 'g'),
(13, 'asd'),
(14, 'ASD'),
(15, 'SDAS'),
(16, 'asd'),
(17, 'as');
-- --------------------------------------------------------
--
-- Table structure for table `keterangan`
--
CREATE TABLE `keterangan` (
`id_keterangan` int(11) NOT NULL,
`sakit` varchar(255) NOT NULL,
`ijin` varchar(255) NOT NULL,
`hadir` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pegawai`
--
CREATE TABLE `pegawai` (
`id_pegawai` int(11) NOT NULL,
`id_kategori` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`password` text NOT NULL,
`gaji_pegawai` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pegawai`
--
INSERT INTO `pegawai` (`id_pegawai`, `id_kategori`, `email`, `password`, `gaji_pegawai`) VALUES
(9, 1, 'f@gmail.com', 'f', 500004);
-- --------------------------------------------------------
--
-- Table structure for table `presensi`
--
CREATE TABLE `presensi` (
`tgl_absen` date NOT NULL,
`id_pegawai` int(11) NOT NULL,
`id_kategori` int(11) NOT NULL,
`nama_pegawai` varchar(255) NOT NULL,
`keterangan` varchar(255) NOT NULL,
`keterlambatan` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `terlambat`
--
CREATE TABLE `terlambat` (
`tanggal_terlambat` date NOT NULL,
`id_pegawai` int(11) NOT NULL,
`id_kategori` int(11) NOT NULL,
`keterangan` varchar(255) NOT NULL,
`keterlambatan` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `kategori`
--
ALTER TABLE `kategori`
ADD PRIMARY KEY (`id_kategori`);
--
-- Indexes for table `keterangan`
--
ALTER TABLE `keterangan`
ADD PRIMARY KEY (`id_keterangan`);
--
-- Indexes for table `pegawai`
--
ALTER TABLE `pegawai`
ADD PRIMARY KEY (`id_pegawai`),
ADD KEY `id_kategori` (`id_kategori`);
--
-- Indexes for table `presensi`
--
ALTER TABLE `presensi`
ADD PRIMARY KEY (`tgl_absen`),
ADD KEY `id_kategori` (`id_kategori`),
ADD KEY `id_pegawai` (`id_pegawai`);
--
-- Indexes for table `terlambat`
--
ALTER TABLE `terlambat`
ADD KEY `id_pegawai` (`id_pegawai`),
ADD KEY `id_kategori` (`id_kategori`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `kategori`
--
ALTER TABLE `kategori`
MODIFY `id_kategori` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `keterangan`
--
ALTER TABLE `keterangan`
MODIFY `id_keterangan` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pegawai`
--
ALTER TABLE `pegawai`
MODIFY `id_pegawai` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `pegawai`
--
ALTER TABLE `pegawai`
ADD CONSTRAINT `pegawai_ibfk_1` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id_kategori`);
--
-- Constraints for table `presensi`
--
ALTER TABLE `presensi`
ADD CONSTRAINT `presensi_ibfk_1` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id_kategori`),
ADD CONSTRAINT `presensi_ibfk_2` FOREIGN KEY (`id_pegawai`) REFERENCES `pegawai` (`id_pegawai`);
--
-- Constraints for table `terlambat`
--
ALTER TABLE `terlambat`
ADD CONSTRAINT `terlambat_ibfk_1` FOREIGN KEY (`id_kategori`) REFERENCES `kategori` (`id_kategori`),
ADD CONSTRAINT `terlambat_ibfk_2` FOREIGN KEY (`id_pegawai`) REFERENCES `pegawai` (`id_pegawai`);
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 */;
|
/*
Name: SOCIAL MODS
Data source: 4
Created By: Admin
Last Update At: 2015-10-19T16:20:39.397927+00:00
*/
SELECT '<a href="?p_mgid='+ v.mgid + '&p_mod=' + ModDisplayName + '" onClick="gotoMyURL(href)">' + marketingGroup + '</a>' as MG,
Amount_of_Listings,
ModDisplayName AS MOD,
Views,
Visits,
Visitors,
FROM
(SELECT marketingGroup,
mgid,
COUNT(DISTINCT Listing) AS Amount_of_Listings,
ModDisplayName,
COUNT(visit_num) AS Views,
COUNT(DISTINCT post_visid_high + "-" + post_visid_low + "-" + visit_num) Visits,
COUNT(DISTINCT post_visid_high + "-" + post_visid_low) Visitors,
FROM
(SELECT MG_HL.marketingGroup_name AS marketingGroup,
MG_HL.marketingGroup_id AS mgid,
nvl(M.DisplayName_s,post_prop10) AS ModDisplayName,
Listing,
post_visid_high,
post_visid_low,
visit_num
FROM
(SELECT nvl(L.Listing,v.Listing) AS Listing,
post_visid_high,
post_visid_low,
visit_num,
post_prop10
FROM
(SELECT FIRST(SPLIT(LAST(SPLIT(post_prop5, '/')), '-')) AS Listing,
post_visid_high,
post_visid_low,
visit_num,
post_prop10
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal, " month(TIMESTAMP(CONCAT(REPLACE(table_id,"_","-"),"-01"))) >= month(DATE('{{startdate}}')) and month(TIMESTAMP(CONCAT(REPLACE(table_id,"_","-"),"-01"))) <= month(DATE('{{enddate}}')) "))
WHERE post_page_event = "0" /*PAGE VIEW CALLS*/
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}')
AND post_prop19 = 'listing' /* Counting Listings */ ) v FULL
OUTER JOIN EACH
(SELECT string(id) AS Listing
FROM [djomniture:devspark.MG_Listings]) AS L ON v.Listing = L.Listing) v
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL ON v.Listing = MG_HL.listing_id
JOIN [djomniture:devspark.MG_Social_Mods] M ON post_prop10 = MOD_s)
GROUP BY marketingGroup,
mgid,
ModDisplayName) v
ORDER BY marketingGroup,
Amount_of_Listings,
ModDisplayName
|
select count(distinct(city)) from station;
|
-- 字典表
CREATE TABLE `dictionary` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`parent_id` bigint unsigned NOT NULL COMMENT '父ID',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
`app_module` varchar(50) null comment '应用模块',
`type` varchar(50) NOT NULL COMMENT '字典类型',
`item_name` varchar(100) NOT NULL COMMENT '显示名',
`item_value` varchar(100) DEFAULT NULL COMMENT '存储值',
`description` varchar(100) DEFAULT NULL COMMENT '描述说明',
`extdata` varchar(200) DEFAULT NULL COMMENT '扩展JSON',
`sort_id` smallint NOT NULL DEFAULT '99' COMMENT '排序号',
`is_editable` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否可改',
`is_deletable` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否可删',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`)
) AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '数据字典';
-- 创建索引
create index idx_directory on dictionary(type, item_value);
create index idx_directory_tenant on dictionary(tenant_id);
|
CREATE procedure sp_InvoiceHistory_Detail_DataExport (@FromDate as datetime,@ToDate as DateTime,@SalesmanID as nvarchar(255) )
AS
Select IA.InvoiceID as SO_NO
,ID.Serial as ORD_DTL_ID
,PRD_IND ='N'
,ID.Product_Code as PRODUCT_CD
,TYPE = 'S'
,Items.UOM as TXN_UOM_CD
,sum(ID.Quantity) as TXN_QTY
,TXN_UOM_CONV = 1
,Items.UOM as TARGET_UOM_CD
,sum(ID.Quantity) as TARGET_QTY
,null as TARGET_QTY_ON_BASEUOM
,Items.MRP as LIST_PRICE
,Items.PTR as SELL_PRICE
,null as DISC_AMT
,null as DISC_PERCENTAGE
,null as NET_AMT
,null as LINK_PRODUCT_CD
,null as SCHEME_CD
from invoiceabstract IA inner join InvoiceDetail ID on IA.InvoiceID = ID.InvoiceID
inner join Items on ID.Product_Code = Items.Product_Code
where IA.InvoiceDate BETWEEN @FROMDATE AND @TODATE
and IA.SalesmanID in (select * from dbo.sp_SplitIn2Rows(@SalesmanID, ','))
and (isnull(IA.Status,0) & 128 ) = 0
and (isnull(IA.Status,0) & 64 ) = 0
and IA.InvoiceType in (1,3)
Group by IA.InvoiceID,ID.Serial,ID.Product_Code ,Items.UOM,Items.MRP,Items.PTR
|
SET time_zone = "+00:00";
CREATE TABLE `request` (
`id` int(11) NOT NULL,
`email` varchar(100) NOT NULL,
`data` text NOT NULL,
`payment` varchar(100) NOT NULL,
`hash` varchar(40) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `request`
ADD PRIMARY KEY (`id`),
ADD KEY `hash` (`hash`);
ALTER TABLE `request`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
|
CREATE TABLE "Group" (
"id" SERIAL PRIMARY KEY,
"name" TEXT NOT NULL,
"ownerId" INTEGER NOT NULL,
"createdAt" DATE NOT NULL DEFAULT CURRENT_DATE,
--groups can be without description
"description" TEXT NOT NULL,
--null if turned off in settings
"inviteToken" TEXT,
"isModerated" BOOLEAN NOT NULL,
"advancedConfig" JSONB
-- "apiKey" TEXT
);
-- CREATE TYPE "GroupActionType" AS ENUM('MEMBER_JOIN', 'MEMBER_LEAVE', 'NEW_INVITE_LINK', 'TASK_ADD', 'TASK_TEXT_EDIT', 'FILE_REMOVE', 'TASK_REMOVE');
-- CREATE TABLE "GroupLog" (-- for loging the group actions
-- "groupId" INTEGER NOT NULL REFERENCES "Group" ON DELETE CASCADE,
-- "actionType" "GroupActionType" NOT NULL,
-- "timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- not safe
-- PRIMARY KEY("groupId", "timestamp");
-- todo: add json type field
-- );
CREATE TABLE "Member" (
"groupId" INTEGER REFERENCES "Group" ON DELETE CASCADE,
"userId" INTEGER,
"joinDate" DATE NOT NULL DEFAULT CURRENT_DATE,
"isModerator" BOOLEAN NOT NULL DEFAULT FALSE,
-- user member preferences
"trackHomeworkCompletion" BOOLEAN NOT NULL,
"shareHomeworkCompletion" BOOLEAN NOT NULL,
PRIMARY KEY("groupId", "userId")
);
CREATE TABLE "Homework" (
"id" SERIAL PRIMARY KEY,
"groupId" INTEGER NOT NULL REFERENCES "Group" ON DELETE CASCADE,
"givedTo" DATE NOT NULL,
"createdBy" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3),
"subject" TEXT NOT NULL,
"text" TEXT NOT NULL
);
CREATE TABLE "File" (
"id" SERIAL PRIMARY KEY,
"homeworkId" INTEGER NOT NULL REFERENCES "Homework" ON DELETE CASCADE,
"fileLink" TEXT NOT NULL,
-- if null - the same user who has added homework
"addedByUserId" INTEGER
); |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 21, 2017 at 02:18 PM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
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: `two`
--
-- --------------------------------------------------------
--
-- Table structure for table `fakta`
--
CREATE TABLE `fakta` (
`id_fakta` int(250) NOT NULL,
`kode_fakta` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `fakta`
--
INSERT INTO `fakta` (`id_fakta`, `kode_fakta`) VALUES
(171, 'M002'),
(172, 'J003'),
(173, 'G008'),
(174, 'C016'),
(175, 'S016');
-- --------------------------------------------------------
--
-- Table structure for table `kondisi`
--
CREATE TABLE `kondisi` (
`id_kondisi` varchar(250) NOT NULL,
`nama_kondisi` text NOT NULL,
`kode_kondisi` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kondisi`
--
INSERT INTO `kondisi` (`id_kondisi`, `nama_kondisi`, `kode_kondisi`) VALUES
('C001', 'Tombol function Num Lock dalam keadaan aktif', '4'),
('C002', 'Driver Hot Key belum terinstall pada laptop', '4'),
('C003', 'Sudah terinstall driver Hot Key, key <Fn> tidak berfungsi', '4'),
('C004', 'Kombinasi tombol Fn + F7 dalam keadaan aktif', '4'),
('C005', 'File-file sistem rusak', '4'),
('C006', 'Konektor touch pad lepas atau renggang', '4'),
('C007', 'Suhu prosessor normal ( 30 ° - 60 ° )', '4'),
('C008', 'Suhu prosessor tidak normal ( > 60 ° )', '4'),
('C009', 'Perangkat layar diatur ke monitor eksternal', '4'),
('C010', 'Lampu indikator Sleep menyala', '4'),
('C011', 'Tingkat kecerahan terlalu rendah', '4'),
('C012', 'Hard disk tidak terdeteksi di BIOS', '4'),
('C013', 'Hard disk terdeteksi di BIOS, laptop tetap tidak mau booting', '4'),
('C014', 'Setting-an brightnes (terang/redup) terlalu dominan', '4'),
('C015', 'Driver VGA bermasalah', '4'),
('C016', 'Setting-an DPI tidak sesuai', '4'),
('C017', 'Hard disk penuh', '4'),
('C018', 'Hard disk overheat', '4'),
('C019', 'Media disk kotor', '4'),
('C020', 'Lensa optik kotor', '4'),
('C021', 'Dioda laser optik rusak', '4'),
('C022', 'Motor pintu tidak bekerja', '4'),
('C023', 'Gigi roda kotor dan karet tape sudah mengembang', '4'),
('C024', 'Hard disk sering di format full', '4'),
('G001', 'Mengetik huruf, angka yang muncul', '3'),
('G002', 'Key <Fn> (function) tidak berfungsi', '3'),
('G003', 'Touch pad tidak berfungsi', '3'),
('G004', 'Laptop hang', '3'),
('G005', 'LCD tidak menampilkan gambar', '3'),
('G006', 'Laptop tidak bisa booting (login windows)', '3'),
('G007', 'LCD terlalu terang/terlalu redup', '3'),
('G008', 'Pada LCD muncul garis-garis biru-merah-putih', '3'),
('G009', 'Blue screen saat menjalankan aplikasi berat', '3'),
('G010', 'Laptop tiba-tiba mati', '3'),
('G011', 'Drive optik membaca data tersendat-sendat', '3'),
('G012', 'Drive optik tidak memancarkan sinar infrared', '3'),
('G013', 'Drive optik susah buka tutup pintu', '3'),
('G014', 'Hard disk tidak dapat di format', '3'),
('J001', 'Keyboard', '2'),
('J002', 'Touch Pad', '2'),
('J003', 'Layar LCD', '2'),
('J004', 'Processor', '2'),
('J005', 'Driver Optik', '2'),
('J006', 'Harddisk', '2'),
('M001', 'Input', '1'),
('M002', 'Output', '1'),
('M003', 'Process', '1'),
('M004', 'Storage', '1'),
('S001', 'Non-aktifkan tombol function Num Lock dengan menekan\r\nkombinasi <Fn> + <F11>/Num Lock (tergantung model\r\nlaptop, baca buku manual)', '5'),
('S002', 'Installasikan driver Hot Key', '5'),
('S003', 'Diver bermasalah, download driver (misal pada situs : \r\nhttp://Drivercollection.com)', '5'),
('S004', 'Non-aktifkan dengan menekan kembali kombinasi <Fn> + \r\n<F7> (tergantung model laptop, baca buku manual)', '5'),
('S005', '1) Lakukan virus scanning lewat safe mode (lebih efektif \r\nketimbang lewat modus normal, karena pada safe\r\nmode sistem bekerja secara minimal dan membuat anti\r\nvirus lebih leluasa dalam melakukan scanning) ; \r\n2) Scan juga menggunakan program pembersih registry\r\n(registry tweaker, registry cleaner, dan lain-lain) ; \r\n3) Apabila masih bermasalah, install tanpa format hard disk\r\n(boot menggunakan CD windows, kemudian masuk ke\r\nmode recovery) atau install ulang saja windows.', '5'),
('S006', 'Pasang kembali konektor dengan benar', '5'),
('S007', 'Tambahkan cooler/kipas pendingin untuk membantu \r\nmendinginkan prosessor agar tidak terlalu panas', '5'),
('S008', 'Instal ulang sistem operasi \r\n\r\nKeterangan :\r\nDengan sistem baru, komputer akan lebih ringan dan filefile\r\n\r\nmasih bekerja dengan baik. Apabila install ulang ini\r\ntidak menyelesaikan masalah, hampir dipastikan laptop\r\nmengalami masalah hardware. Jika sudah demikian,\r\nsebaiknya bawa laptop ke tempat servis', '5'),
('S009', 'Gunakan kombinasi tombol <Fn> + <F5> (tergantung\r\nmodel laptop, baca buku manual) untuk mengalihkan layar\r\nkembali ke laptop', '5'),
('S010', 'Tekan dan lepas tombol power untuk melanjutkan', '5'),
('S011', 'Gunakan kombinasi tombol <Fn> + dengan tombol \r\nsetting-an brightness (meningkat, biasanya pada keypad\r\nberlogo matahari). Atur tingkat kecerahan sesuai dengan\r\nkenyamanan mata', '5'),
('S012', 'Install ulang sistem operasi', '5'),
('S013', 'Kerusakan terdapat pada komponen hard disk, biasanya \r\nsocket hard disk kendur atau pin-pin hard disk ada yang\r\npatah. \r\nSebagai solusinya, ganti/perbaiki komponen yang\r\nbermasalah. Jika tetap tidak mau booting, ganti hard disk \r\ntersebut karena sudah rusak', '5'),
('S014', 'Gunakan kombinasi tombol <Fn> + dengan tombol \r\nsetting-an brightnes (penambahan/pengurangan,\r\nbiasanya pada keypad berlogo matahari). Atur cahaya\r\nsesuai dengan kenyamanan mata', '5'),
('S015', 'Install ulang driver VGA. Jika masih bermasalah bawa ke\r\ntempat servis', '5'),
('S016', 'Refresh kembali Screen Rate yang ada pada Display\r\nProperties (OS : windows) kemudian set ke 60 Hz', '5'),
('S017', 'Uninstall aplikasi lainnya yang tidak terlalu penting sampai\r\nhard disk cukup ruang untuk menjalankan aplikasi yang\r\ndiinginkan', '5'),
('S018', 'Tambahkan cooler/kipas pendingin untuk membantu\r\nmendinginkan hard disk agar tidak terlalu panas \r\n(overheat)', '5'),
('S019', 'Membersihkan permukaan disk tersebut dengan \r\nmenggunakan alkohol dan gunakan kapas untuk\r\nmengoleskannya', '5'),
('S020', 'Membersihkan lensa optik tersebut dengan CD Cleaner', '5'),
('S021', 'Ganti dengan optik yang sama (misalnya optik CD-ROM \r\ndengan optik CD-ROM, optik DVD-ROM dengan optik\r\nDVD-ROM)', '5'),
('S022', 'Mengganti motor pintu', '5'),
('S023', 'Ganti karet tape dan bersihkan roda gigi poros pintu \r\nkemudian berikan pelumas untuk melancarkan\r\npergerakan', '5'),
('S024', 'Gunakan disk manager untuk mem-format', '5');
-- --------------------------------------------------------
--
-- Table structure for table `rule`
--
CREATE TABLE `rule` (
`id_rule` int(250) NOT NULL,
`start_rule` varchar(250) DEFAULT NULL,
`point_rule` varchar(250) NOT NULL,
`status_rule` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `rule`
--
INSERT INTO `rule` (`id_rule`, `start_rule`, `point_rule`, `status_rule`) VALUES
(1, '0', 'M001', 0),
(2, '0', 'M002', 0),
(3, '0', 'M003', 0),
(4, '0', 'M004', 0),
(5, 'M001', 'J001', 0),
(6, 'M001', 'J002', 0),
(7, 'M002', 'J003', 0),
(8, 'M003', 'J004', 0),
(9, 'M004', 'J005', 0),
(10, 'M004', 'J006', 0),
(11, 'J001', 'G001', 0),
(12, 'J001', 'G002', 0),
(13, 'J002', 'G003', 0),
(14, 'J003', 'G004', 0),
(15, 'J003', 'G005', 0),
(16, 'J003', 'G006', 0),
(17, 'J003', 'G007', 0),
(18, 'J003', 'G008', 0),
(19, 'J003', 'G009', 0),
(20, 'J004', 'G004', 0),
(21, 'J005', 'G011', 0),
(22, 'J005', 'G012', 0),
(23, 'J005', 'G013', 0),
(24, 'J006', 'G006', 0),
(25, 'J006', 'G009', 0),
(26, 'J006', 'G014', 0),
(27, 'G001', 'C001', 0),
(28, 'G002', 'C002', 0),
(29, 'G002', 'C003', 0),
(30, 'G003', 'C004', 0),
(31, 'G003', 'C005', 0),
(32, 'G004', 'C007', 0),
(33, 'G004', 'C008', 0),
(34, 'G005', 'C009', 0),
(35, 'G005', 'C010', 0),
(36, 'G005', 'C011', 0),
(37, 'G006', 'C012', 0),
(38, 'G006', 'C013', 0),
(39, 'G007', 'C014', 0),
(40, 'G007', 'C015', 0),
(41, 'G008', 'C016', 0),
(42, 'G009', 'C017', 0),
(43, 'G009', 'C018', 0),
(44, 'G010', 'C008', 0),
(45, 'G011', 'C019', 0),
(46, 'G011', 'C020', 0),
(47, 'G012', 'C021', 0),
(48, 'G013', 'C022', 0),
(49, 'G013', 'C023', 0),
(50, 'G014', 'C024', 0),
(51, 'G003', 'C006', 0),
(52, 'C001', 'S001', 0),
(53, 'C002', 'S002', 0),
(54, 'C003', 'S003', 0),
(55, 'C004', 'S004', 0),
(56, 'C005', 'S005', 0),
(57, 'C006', 'S006', 0),
(58, 'C007', 'S007', 0),
(59, 'C008', 'S008', 0),
(60, 'C009', 'S009', 0),
(61, 'C010', 'S010', 0),
(62, 'C011', 'S011', 0),
(63, 'C012', 'S012', 0),
(64, 'C013', 'S013', 0),
(65, 'C014', 'S014', 0),
(66, 'C015', 'S015', 0),
(67, 'C016', 'S016', 0),
(68, 'C017', 'S017', 0),
(69, 'C018', 'S018', 0),
(70, 'C019', 'S019', 0),
(71, 'C020', 'S020', 0),
(72, 'C021', 'S021', 0),
(73, 'C022', 'S022', 0),
(74, 'C023', 'S023', 0),
(75, 'C024', 'S024', 0),
(76, 'S001', '0', 1),
(77, 'S002', '0', 1),
(78, 'S003', '0', 1),
(79, 'S004', '0', 1),
(80, 'S005', '0', 1),
(81, 'S006', '0', 1),
(82, 'S007', '0', 1),
(83, 'S008', '0', 1),
(84, 'S009', '0', 1),
(85, 'S010', '0', 1),
(86, 'S011', '0', 1),
(87, 'S012', '0', 1),
(88, 'S013', '0', 1),
(89, 'S014', '0', 1),
(90, 'S015', '0', 1),
(91, 'S016', '0', 1),
(92, 'S017', '0', 1),
(93, 'S018', '0', 1),
(94, 'S019', '0', 1),
(95, 'S020', '0', 1),
(96, 'S021', '0', 1),
(97, 'S022', '0', 1),
(98, 'S023', '0', 1),
(99, 'S024', '0', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `fakta`
--
ALTER TABLE `fakta`
ADD PRIMARY KEY (`id_fakta`);
--
-- Indexes for table `kondisi`
--
ALTER TABLE `kondisi`
ADD PRIMARY KEY (`id_kondisi`);
--
-- Indexes for table `rule`
--
ALTER TABLE `rule`
ADD PRIMARY KEY (`id_rule`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `fakta`
--
ALTER TABLE `fakta`
MODIFY `id_fakta` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=176;
--
-- AUTO_INCREMENT for table `rule`
--
ALTER TABLE `rule`
MODIFY `id_rule` int(250) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;
/*!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 */;
|
CREATE TABLE users(
userId INT,
userName varchar,
userAgeRange varchar,
userGender varchar,
userInterests varchar,
usageTime varchar,
companyId INT
);
\copy users(userId,userName,userAgeRange,userGender,userInterests,usageTime, companyId) FROM '*insert spreadsheet path here*' DELIMITER ',' CSV HEADER
select * from users;
CREATE TABLE companies(
companyId INT,
companyName varchar,
headquarter varchar,
revenue varchar,
founded date,
userAmount varchar
);
insert into companies(companyId, companyName, headquarter, revenue, founded, userAmount) VALUES (1, 'Facebook', 'Menlo Park, CA, US', '86 B', '2004-02-04', '2.8 B');
insert into companies VALUES (2, 'Instagram', 'Menlo Park, CA, US', '12 B', '2010-10-6', '815 M');
insert into companies VALUES (3, 'Snapchat', 'Santa Monica, CA, US', '2.5 B', '2011-09-16', '265 M');
insert into companies VALUES (4, 'Tiktok', 'Culver City, CA, US', '1 B', '2016-09-01', '500 M');
insert into companies VALUES (5, 'Twitter', 'San Francisco, CA, US', '3.7 B', '2006-03-21', '187 M');
insert into companies VALUES (6, 'Youtube', 'San Bruno, CA, US', '19.8 B', '2005-02-14', '2.3 B');
select * from companies;
CREATE TABLE ad(
adId varchar,
companyId INT,
adType varchar,
adFormat varchar
);
\copy ad(adId,companyId,adType,adFormat) FROM '*insert spreadsheet path here*' DELIMITER ',' CSV HEADER
select * from ad;
--1) Which time intervals do users use social media the most?
-- Counts of all time intervals
select
usageTime,
count(*)
from users
Group by usageTime
Order by count(*) DESC;
-- The time interval most frequently used by users
select
usageTime,
count(*)
from users
Group by usageTime
Order by count(*) DESC limit 1;
--2) Which ad type and format should each company put on their platform to attract the largest audience?
--The 1st & 2nd output table (the entire table will be too long, so our group divides it into 2 separate tables) will show the ad type counts for each company
--The 3rd output table will show the ad format counts for each company
--The largest number in each row is the ad type/format that each company should apply
-- ad type count for each company part 1
select
sum(case when adType like '%Gaming%' then 1 else 0 end) AS gamesCount,
sum(case when adType like '%Animals%' then 1 else 0 end) AS animalsCount,
sum(case when adType like '%Sports%' then 1 else 0 end) AS sportsCount,
sum(case when adType like '%Arts%' then 1 else 0 end) AS artsCount,
sum(case when adType like '%Music%' then 1 else 0 end) AS musicCount,
sum(case when adType like '%Food%' then 1 else 0 end) AS foodCount,
sum(case when adType like '%Makeup%' then 1 else 0 end) AS makeupCount,
sum(case when adType like '%Travel%' then 1 else 0 end) AS travelCount,
sum(case when adType like '%Media%' then 1 else 0 end) AS mediaCount,
sum(case when adType like '%Films%' then 1 else 0 end) AS filmsCount,
sum(case when adType like '%Novels%' then 1 else 0 end) AS novelsCount,
sum(case when adType like '%Comic%' then 1 else 0 end) AS comicsCount,
c.companyName
from ad a
inner join companies c ON
c.companyId = a.companyId
group by c.companyId,c.companyName;
-- ad type count for each company part 2
select
sum(case when adType like '%Cars%' then 1 else 0 end) AS carCount,
sum(case when adType like '%Education%' then 1 else 0 end) AS educationCount,
sum(case when adType like '%Science%' then 1 else 0 end) AS scienceCount,
sum(case when adType like '%Social services%' then 1 else 0 end) AS socialservicesCount,
sum(case when adType like '%Job%' then 1 else 0 end) AS jobCount,
sum(case when adType like '%Business%' then 1 else 0 end) AS businessCount,
sum(case when adType like '%languages%' then 1 else 0 end) AS languagesCount,
sum(case when adType like '%sponsored%' then 1 else 0 end) AS sponsoredAdsCount,
sum(case when adType like '%Marketing%' then 1 else 0 end) AS marketingCount,
sum(case when adType like '%Others%' then 1 else 0 end) AS othersCount,
sum(case when adType like '%None%' then 1 else 0 end) AS noneCount,
c.companyName
from ad a
inner join companies c ON
c.companyId = a.companyId
group by c.companyId,c.companyName;
-- ad format count for each company
select
sum(case when adFormat like '%Pop-up%' then 1 else 0 end) AS PopupCount,
sum(case when adFormat like '%Banner%' then 1 else 0 end) AS BannerCount,
sum(case when adFormat like '%Skip%' then 1 else 0 end) AS SkipAdCount,
sum(case when adFormat like '%Sponsored%' then 1 else 0 end) AS SponsoredPostCount,
sum(case when adFormat like '%Others%' then 1 else 0 end) AS OthersCount,
c.companyName
from ad a
inner join companies c ON
c.companyId = a.companyId
group by c.companyId,c.companyName; |
with totalFlights_CTE(airport_desc,flight_count)
as(select A.airport_desc, count(*) as flight_count
from flight_reports F, airport_codes A
where F.dest_airport_code = A.airport_code or F.origin_airport_code = A.airport_code
group by A.airport_desc
order by flight_count desc
limit 5)
select TF.airport_desc
from totalFlights_CTE TF
order by TF.airport_desc; |
SELECT *
FROM "user"
LIMIT 5
OFFSET ?; |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 21, 2013 at 07:54 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.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: `knockout`
--
-- --------------------------------------------------------
--
-- Table structure for table `students`
--
CREATE TABLE IF NOT EXISTS `students` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`status` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ;
--
-- Dumping data for table `students`
--
INSERT INTO `students` (`id`, `name`, `age`, `status`) VALUES
(1, 'monkey d. luffy', 15, 1),
(2, 'ron', 20, 0),
(3, 'angel', 20, 0),
(4, 'son goku', 30, 1),
(5, 'naruto uzumaki', 16, 1),
(6, 'draco', 15, 1),
(10, 'NIklaus MikaelSon', 1500, 1),
(16, 'Elijah', 1000, 1);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
Answering Time Series Questions with Window Functions |
-- phpMyAdmin SQL Dump
-- version 3.4.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 16, 2012 at 11:13 AM
-- Server version: 5.1.61
-- PHP Version: 5.3.17
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: `v0090686_agrouruguay`
--
CREATE DATABASE `v0090686_agrouruguay` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `v0090686_agrouruguay`;
-- --------------------------------------------------------
--
-- Table structure for table `foto_inmueble`
--
CREATE TABLE IF NOT EXISTS `foto_inmueble` (
`finm_numero` int(11) NOT NULL,
`inm_codigo` int(11) NOT NULL,
`finm_title` varchar(150) NOT NULL,
`finm_url` varchar(1000) NOT NULL,
`finm_alt` varchar(80) NOT NULL,
PRIMARY KEY (`finm_numero`),
KEY `foto_inmueble_fk` (`inm_codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `foto_inmueble`
--
INSERT INTO `foto_inmueble` (`finm_numero`, `inm_codigo`, `finm_title`, `finm_url`, `finm_alt`) VALUES
(1, 1, 'Campo 84 has', '../imagenes/fotoinm/FotoInmueble1.JPG', 'Campo 84 has'),
(2, 2, 'Hotel Spa', '../imagenes/fotoinm/FotoInmueble2.jpg', 'Hotel Spa'),
(3, 3, 'Lotes Country', '../imagenes/fotoinm/FotoInmueble3.jpg', 'Lotes Country'),
(4, 4, 'Campo San Javier', '../imagenes/fotoinm/FotoInmueble4.jpg', '45 has.'),
(5, 5, 'Campo 45has.', '../imagenes/fotoinm/FotoInmueble5.jpg', 'Campo 45 has.'),
(6, 6, 'Chacra Soriano 38has.', '../imagenes/fotoinm/FotoInmueble6.jpg', 'Chacra Soriano 38has.'),
(7, 7, 'campo pedid', '../imagenes/fotoinm/FotoInmueble7.jpg', 'campo pedid');
-- --------------------------------------------------------
--
-- Table structure for table `foto_maquinaria`
--
CREATE TABLE IF NOT EXISTS `foto_maquinaria` (
`fmaq_numero` int(11) NOT NULL,
`maq_codigo` int(11) NOT NULL,
`fmaq_title` varchar(150) NOT NULL,
`fmaq_url` varchar(1000) NOT NULL,
`fmaq_alt` varchar(80) NOT NULL,
PRIMARY KEY (`fmaq_numero`),
KEY `foto_maquina_fk` (`maq_codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `foto_maquinaria`
--
INSERT INTO `foto_maquinaria` (`fmaq_numero`, `maq_codigo`, `fmaq_title`, `fmaq_url`, `fmaq_alt`) VALUES
(6, 6, 'Tractor Ferguson1175', '../imagenes/fotomaq/FotoMaquinaria6.jpg', 'Tractor Ferguson1175'),
(7, 7, 'HANOMAG 35', '../imagenes/fotomaq/FotoMaquinaria7.jpg', 'HANOMAG 35'),
(8, 8, 'tractor muestra', '../imagenes/fotomaq/FotoMaquinaria8.jpg', 'Tractor muestra'),
(9, 9, 'MB 911', '../imagenes/fotomaq/FotoMaquinaria9.JPG', 'MB 911/71');
-- --------------------------------------------------------
--
-- Table structure for table `inmueble`
--
CREATE TABLE IF NOT EXISTS `inmueble` (
`inm_codigo` int(11) NOT NULL,
`inm_titulo` varchar(150) NOT NULL,
`inm_descripcion` varchar(10000) NOT NULL,
PRIMARY KEY (`inm_codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `inmueble`
--
INSERT INTO `inmueble` (`inm_codigo`, `inm_titulo`, `inm_descripcion`) VALUES
(1, 'Campo Sojero 84 has. - Cañuelas', 'A 800 mts. ruta 205 c/mejoras, casa, galpon, molino, alambrado perimetral, antes ganado ahora SOJA!!OPORTUNIDAD..u$s12.000ha.'),
(2, 'Hotel Spa - Cañuelas', '3 Pisos, 12 Habitaciones por piso, todos en suite Spa, Sauna, Restaurant, Salón de eventos con retroproyector y pantalla. u$s300.000 y ctas.'),
(3, 'Lotes Country Principado de San Vicente', 'Desde 700 m2, ciudad náutica en 200 has, 1 House principal en 3 plantas de 900 m2 estilo nórdico, 1 house hípico, 1 house golf, canales navegables, centro de servicios.u$s45.000'),
(4, 'Campo agricola 45has. San Javier-Rio Negro', 'Ubicado a 3.5km el centro de San Javier, monte alamos criollos y sauces llorones, cañada, quinta con arboles frutales, camino vecinal de tosca.u$s230.000'),
(5, 'Campo 45 has. San Javier-Rio Negro', 'A 4 km. del centro de San Javier, construccion a reciclar, quintas c/eucaliptus colorados, algarrobos, espinillos, arboles frutales, cañada..u$s230.000.-'),
(6, 'Chacra 38has. Soriano-Mercedes', 'A 10km. de Mercedes, casa 3 habitaciones, galpon 10x6, pozo c/bomba, chiqueros y gallineros, tubo y manga, tajamar, alambrado a nuevo...u$s430.000.-'),
(7, 'BUSCAMOS CAMPOS POR PEDIDOS CONCRETOS!!!', 'PARA COMPRAR O ARRENDAR, EN URUGUAY Y EN ARGENTINA URGENTE!!! PEDIDOS CONCRETOS!!!');
-- --------------------------------------------------------
--
-- Table structure for table `maquinaria`
--
CREATE TABLE IF NOT EXISTS `maquinaria` (
`maq_codigo` int(11) NOT NULL,
`maq_titulo` varchar(150) NOT NULL,
`maq_descripcion` varchar(10000) NOT NULL,
PRIMARY KEY (`maq_codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `maquinaria`
--
INSERT INTO `maquinaria` (`maq_codigo`, `maq_titulo`, `maq_descripcion`) VALUES
(6, 'Tractor Massey Ferguson 1175 Mod.80', 'En Muy buen estado, posee toma de fuerza, levante de tres puntos,y salida de control remoto. u$s14.500'),
(7, 'HANOMAG 35 HP FULL-FULL ORIG -mod.1955', 'Muy buen estado!!! Toma de fuerza polea y traba en diferencial.u$s6.000.- '),
(8, 'SI TIENE UNA MAQUINARIA EN VENTA!!!', 'CONSULTENOS NOSOTROS SE LA COMERCIALIZAMOS!!!!'),
(9, 'Mercedez Benz 911 Mod. 71 Mot. 1114', 'MOTOR MERCEDES 1114, FURGON CERRADO,3 ASIENTOS , LARGO DE CARGA INTERNO 7,50 MTS\r\nPORTON TRASERO LIBRO 2.40 X2 MTS DE ALTO 2 PTAS LAT, APERT A AIRE,\r\nCAP DE CARGA 8OOO KGMS PALOMAS REFORZADAS PARA CARGA\r\n MOTOR MUY BUENO CUB DELANT BUENAS, PINTADO HACE POCO TOTAL$ 26,000 SE ACEPTAN PERMUTAS \r\n');
-- --------------------------------------------------------
--
-- Table structure for table `registro`
--
CREATE TABLE IF NOT EXISTS `registro` (
`reg_numero` int(11) NOT NULL AUTO_INCREMENT,
`reg_fecha` datetime DEFAULT NULL,
`reg_tipo_aviso` varchar(20) DEFAULT NULL,
`reg_operacion` varchar(50) DEFAULT NULL,
`reg_cod_aviso` int(11) DEFAULT NULL,
`reg_nro_foto` int(11) DEFAULT NULL,
`reg_titulo_aviso` varchar(20) DEFAULT NULL,
`reg_descripcion_aviso` varchar(10000) DEFAULT NULL,
`reg_title_foto` varchar(150) DEFAULT NULL,
`reg_alt_foto` varchar(80) DEFAULT NULL,
`reg_url_foto` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`reg_numero`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ;
--
-- Dumping data for table `registro`
--
INSERT INTO `registro` (`reg_numero`, `reg_fecha`, `reg_tipo_aviso`, `reg_operacion`, `reg_cod_aviso`, `reg_nro_foto`, `reg_titulo_aviso`, `reg_descripcion_aviso`, `reg_title_foto`, `reg_alt_foto`, `reg_url_foto`) VALUES
(9, '2010-06-26 15:01:07', 'Maquinaria', 'Alta', 1, 1, 'Maquinaria 1', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 1', 'Maquinaria 1', 'FotoMaquinaria1.png'),
(10, '2010-06-26 15:01:37', 'Maquinaria', 'Alta', 2, 2, 'Maquinaria 2', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 2', 'Maquinaria 2', 'FotoMaquinaria2.png'),
(11, '2010-06-26 15:01:59', 'Maquinaria', 'Alta', 3, 3, 'Maquinaria 3', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 3', 'Maquinaria 3', 'FotoMaquinaria3.png'),
(12, '2010-06-26 15:02:23', 'Maquinaria', 'Alta', 4, 4, 'Maquinaria 4', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 4', 'Maquinaria 4', 'FotoMaquinaria4.png'),
(13, '2010-06-26 15:04:28', 'Maquinaria', 'Alta', 5, 5, 'Maquinaria 5', '- Descripción breve de la maquinaria a tratar -', 'Maquinaria 5', 'Maquinaria 5', 'FotoMaquinaria5.png'),
(14, '2010-06-26 15:05:56', 'Inmueble', 'Alta', 1, 1, 'Campo 84 has. - Ca&n', 'Alambrado, galpón y casa... OPORTUNIDAD...', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.jpg'),
(15, '2010-06-26 15:06:45', 'Inmueble', 'Alta', 2, 2, 'Hotel Spa - Ca&ntild', '3 Pisos, 12 Habitaciones por piso, todos en suite Spa, Sauna, Restaurant, Salón de eventos con retroproyector y pantalla', 'Hotel Spa', 'Hotel Spa', 'FotoInmueble2.jpg'),
(16, '2010-06-26 15:07:51', 'Inmueble', 'Alta', 3, 3, 'Lotes Country Princi', 'Desde 700 m2, ciudad náutica en 200 has, 1 House principal en 3 plantas de 900 m2 estilo nórdico, 1 house hípico, 1 house golf, canales navegables, centro de servicios.', 'Lotes Country', 'Lotes Country', 'FotoInmueble3.jpg'),
(17, '2010-06-26 15:09:13', 'Maquinaria', 'Modifica Aviso', 1, 0, 'Maquinaria 1', '- Descripción breve de la maquinaria a tratar -', '', '', ''),
(18, '2010-06-26 15:09:25', 'Maquinaria', 'Modifica Aviso', 2, 0, 'Maquinaria 2', '- Descripción breve de la maquinaria a tratar -', '', '', ''),
(19, '2010-06-26 15:09:39', 'Maquinaria', 'Modifica Aviso', 3, 0, 'Maquinaria 3', '- Descripción breve de la maquinaria a tratar -', '', '', ''),
(20, '2010-06-26 15:09:49', 'Maquinaria', 'Modifica Aviso', 4, 0, 'Maquinaria 4', '- Descripción breve de la maquinaria a tratar -', '', '', ''),
(21, '2010-06-28 12:57:47', 'Inmueble', 'Modifica Aviso', 1, 0, 'Campo Sojero 84 has.', 'A 800 mts. ruta 205 c/mejoras, casa, galpon, molino, alambrado perimetral, antes ganado ahora SOJA!!OPORTUNIDAD...', '', '', ''),
(22, '2010-06-28 12:59:47', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(23, '2010-06-28 13:00:18', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(24, '2010-06-28 13:00:49', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(25, '2010-06-28 13:01:08', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(26, '2010-06-28 13:01:55', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(27, '2010-06-28 13:03:11', 'Inmueble', 'Modifica Foto', 0, 1, '', '', 'Campo 84 has', 'Campo 84 has', 'FotoInmueble1.JPG'),
(28, '2010-06-30 12:41:42', 'Inmueble', 'Alta', 4, 4, 'Campo agricola 45has', 'Ubicado a 3.5km el centro de San Javier, monte alamos criollos y sauces llorones, cañada, quinta con arboles frutales, camino vecinal de tosca.', 'Campo San Javier', 'Campo San Javier', 'FotoInmueble4.jpg'),
(29, '2010-06-30 12:46:58', 'Inmueble', 'Alta', 5, 5, 'Campo 45 has. San Ja', 'A 4 km. del centro de San Javier, construccion a reciclar, quintas c/eucaliptus colorados, algarrobos, espinillos, arboles frutales, cañada..u$s230.000.-', 'Campo 45has.', 'Campo 45has.', 'FotoInmueble5.jpg'),
(30, '2010-06-30 12:52:07', 'Inmueble', 'Alta', 6, 6, 'Chacra 38has. Sorian', 'A 10km. de Mercedes, casa 3 habitaciones, galpon 10x6, pozo c/bomba, chiqueros y gallineros, tubo y manga, tajamar, alambrado a nuevo...u$s430.000.-', 'Chacra Soriano 38has.', 'Chacra Soriano 38has.', 'FotoInmueble6.jpg'),
(31, '2010-06-30 12:53:41', 'Inmueble', 'Modifica Aviso', 1, 0, 'Campo Sojero 84 has.', 'A 800 mts. ruta 205 c/mejoras, casa, galpon, molino, alambrado perimetral, antes ganado ahora SOJA!!OPORTUNIDAD..u$s12.000ha.', '', '', ''),
(32, '2010-06-30 12:54:26', 'Inmueble', 'Modifica Aviso', 2, 0, 'Hotel Spa - Ca&ntild', '3 Pisos, 12 Habitaciones por piso, todos en suite Spa, Sauna, Restaurant, Salón de eventos con retroproyector y pantalla. u$s300.000 y ctas.', '', '', ''),
(33, '2010-06-30 12:55:06', 'Inmueble', 'Modifica Aviso', 3, 0, 'Lotes Country Princi', 'Desde 700 m2, ciudad náutica en 200 has, 1 House principal en 3 plantas de 900 m2 estilo nórdico, 1 house hípico, 1 house golf, canales navegables, centro de servicios.u$s45.000', '', '', ''),
(34, '2010-06-30 12:56:41', 'Inmueble', 'Modifica Aviso', 4, 0, 'Campo agricola 45has', 'Ubicado a 3.5km el centro de San Javier, monte alamos criollos y sauces llorones, cañada, quinta con arboles frutales, camino vecinal de tosca.u$s230.000', '', '', ''),
(35, '2010-06-30 13:37:14', 'Maquinaria', 'Alta', 6, 6, 'Tractor Massey Fergu', 'En Muy buen estado, posee toma de fuerza, levante de tres puntos,y salida de control remoto. u$s14.500', 'Tractor Ferguson1175', 'Tractor Ferguson1175', 'FotoMaquinaria6.jpg'),
(36, '2010-06-30 13:37:48', 'Maquinaria', 'Baja', 1, 1, 'Maquinaria 1', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 1', 'Maquinaria 1', '../imagenes/fotomaq/FotoMaquinaria1.png'),
(37, '2010-06-30 13:37:55', 'Maquinaria', 'Baja', 2, 2, 'Maquinaria 2', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 2', 'Maquinaria 2', '../imagenes/fotomaq/FotoMaquinaria2.png'),
(38, '2010-06-30 13:38:03', 'Maquinaria', 'Baja', 3, 3, 'Maquinaria 3', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 3', 'Maquinaria 3', '../imagenes/fotomaq/FotoMaquinaria3.png'),
(39, '2010-06-30 13:38:09', 'Maquinaria', 'Baja', 4, 4, 'Maquinaria 4', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 4', 'Maquinaria 4', '../imagenes/fotomaq/FotoMaquinaria4.png'),
(40, '2010-06-30 13:38:16', 'Maquinaria', 'Baja', 5, 5, 'Maquinaria 5', '- Descripci&oacute;n breve de la maquinaria a tratar -', 'Maquinaria 5', 'Maquinaria 5', '../imagenes/fotomaq/FotoMaquinaria5.png'),
(41, '2010-06-30 13:44:47', 'Maquinaria', 'Alta', 7, 7, 'HANOMAG 35 HP FULL-F', 'Muy buen estado!!! Toma de fuerza polea y traba en diferencial.u$s6.000.- ', 'HANOMAG 35', 'HANOMAG 35', 'FotoMaquinaria7.jpg'),
(42, '2010-06-30 13:50:21', 'Maquinaria', 'Alta', 8, 8, 'SI TIENE UNA MAQUINA', 'cONSULTENOS NOSOTROS SE LA COMERCIALIZAMOS!!!!', 'tractor muestra', 'tractor muestra', 'FotoMaquinaria8.jpg'),
(43, '2010-06-30 13:51:02', 'Maquinaria', 'Modifica Aviso', 8, 0, 'SI TIENE UNA MAQUINA', 'CONSULTENOS NOSOTROS SE LA COMERCIALIZAMOS!!!!', '', '', ''),
(44, '2010-06-30 13:56:22', 'Inmueble', 'Alta', 7, 7, 'BUSCAMOS CAMPOS POR ', 'PARA COMPRAR O ARRENDAR, EN URUGUAY Y EN ARGENTINA URGENTE!!! PEDIDOS CONCRETOS!!!', 'campo pedid', 'campo pedid', 'FotoInmueble7.jpg'),
(45, '2010-06-30 17:23:22', 'Maquinaria', 'Alta', 9, 9, 'es una prueba', 'prueba', 'foto prueba', 'foto prueba', 'FotoMaquinaria9.jpg'),
(46, '2010-06-30 17:24:24', 'Maquinaria', 'Modifica Aviso', 9, 0, 'es una 2 prueba', 'prueba2', '', '', ''),
(47, '2010-06-30 17:24:59', 'Maquinaria', 'Modifica Foto', 0, 9, '', '', 'foto 2 prueba', 'foto 2 prueba', 'FotoMaquinaria9.jpg'),
(48, '2010-06-30 17:26:03', 'Maquinaria', 'Baja', 9, 9, 'es una 2 prueba', 'prueba2', 'foto 2 prueba', 'foto 2 prueba', '../imagenes/fotomaq/FotoMaquinaria9.jpg'),
(49, '2010-07-19 16:51:30', 'Maquinaria', 'Alta', 9, 9, 'Mercedez Benz 911 Mo', 'MERCEDES BENZ 911 AÑO 1971 MODELO LO 48 ,EX COLECTIVO\r\nMOTOR MERCEDES 1114, FURGON CERRADO,3 ASIENTOS , LARGO DE CARGA INTERNO 7,50 MTS\r\nPORTON TRASERO LIBRO 2.40 X2 MTS DE ALTO 2 PUERTAS LATERALES APERTURA A AIRE\r\nCAPACIDAD DE CARGA 8OOO KGMS PALOMAS REFORZADAS PARA CARGA\r\n MOTOR MUY BUENO CUBIERTAS DELANTERAS BUENAS, PINTADO HACE POCOS MESES\r\nPRECIO TOTAL$ 26,000 SE ACEPTAN PERMUTAS X AUTOS HASTA 10,000 $ Y EN BUEN ESTADO\r\nTITULAR PAPELES EN REGLA CEDULA Y TITULO \r\n', 'MB 911', 'MB 911', 'FotoMaquinaria9.JPG'),
(50, '2010-07-19 16:54:50', 'Maquinaria', 'Modifica Aviso', 9, 0, 'Mercedez Benz 911 Mo', 'MOTOR MERCEDES 1114, FURGON CERRADO,3 ASIENTOS , LARGO DE CARGA INTERNO 7,50 MTS\r\nPORTON TRASERO LIBRO 2.40 X2 MTS DE ALTO 2 PTAS LAT, APERT A AIRE,\r\nCAP DE CARGA 8OOO KGMS PALOMAS REFORZADAS PARA CARGA\r\n MOTOR MUY BUENO CUB DELANT BUENAS, PINTADO HACE POCO TOTAL$ 26,000 SE ACEPTAN PERMUTAS \r\n', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `usuario`
--
CREATE TABLE IF NOT EXISTS `usuario` (
`usr_id` varchar(20) NOT NULL,
`usr_nombre` varchar(50) NOT NULL,
`usr_password` varchar(50) NOT NULL,
PRIMARY KEY (`usr_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `usuario`
--
INSERT INTO `usuario` (`usr_id`, `usr_nombre`, `usr_password`) VALUES
('david', 'German Dosko', 'David2010'),
('mauricio', 'Mauricio Sosa Cabral', 'Mauricio2010'),
('sergio', 'Sergio Sosa Cabral', 'Sergio2010');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `foto_inmueble`
--
ALTER TABLE `foto_inmueble`
ADD CONSTRAINT `foto_inmueble_fk` FOREIGN KEY (`inm_codigo`) REFERENCES `inmueble` (`inm_codigo`); |
DROP TABLE IF EXISTS t_paypal_config;
CREATE TABLE t_paypal_config (
id varchar(32) NOT NULL
comment '主键',
user_id varchar(32) NOT NULL
comment '用户id',
channel varchar(16) not null
comment '支付channel',
rate float default null
comment '收费比率',
env varchar(100) not null
comment '环境',
account varchar(100) null,
merchant_id varchar(500) not null
comment '商户id',
public_key varchar(1000) not null
comment '商户公钥',
private_key varchar(1000) not null
comment '商户私钥',
create_time datetime null,
update_time datetime null,
version int null,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci,
comment 'paypal支付配置表'; |
--系统配置
CREATE TABLE `sysm_config_data_syn` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(200) default NULL,
`center_ip` varchar(200) default NULL,
`data_syn_port` varchar(200) default NULL,
`remarks` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
CREATE TABLE `sysm_config_db` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(200) default NULL,
`db_url` varchar(200) default NULL,
`db_driver` varchar(200) default NULL,
`username` varchar(200) default NULL,
`password` varchar(200) default NULL,
`remarks` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
CREATE TABLE `sysm_config_sms` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(200) default NULL,
`send_ip` varchar(200) default NULL,
`send_port` varchar(200) default NULL,
`email_server` varchar(200) default NULL,
`email` varchar(200) default NULL,
`username` varchar(200) default NULL,
`password` varchar(200) default NULL,
`remarks` varchar(1000) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
|
INSERT INTO car (brand, year, color) VALUES
('Audi', 1992, 'Red'),
('Fiat', 2001, 'Red'),
('Mercedes', 1991, 'Brown'),
('Fiat', 1962, 'Black'),
('Renault', 1997, 'Brown'),
('Renault', 1967, 'Maroon'),
('Renault', 1986, 'Yellow'),
('BMW', 1970, 'Maroon'),
('Fiat', 1990, 'Silver'),
('Renault', 1972, 'Black');
|
CREATE DATABASE IF NOT EXISTS airline;
USE airline;
DROP TABLE IF EXISTS `customer_info`;
|
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 */;
-- voer hier tussen u persoonlijke sql scripts
CREATE TABLE `JupilerLeague` (
`thuis` int(11) NOT NULL,
`uit` int(11) NOT NULL,
`ploeg` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `JupilerLeague` (`thuis`, `uit`, `ploeg`) VALUES
(1,4, 'Anderlecht - Standaard'),
(2,2, 'Genk - Mechelen'),
(0,1, 'Club Brugge - Gent'),
(1,2, 'Charleroi - Cherle'),
(3,1, 'Oostende - Beveren');
-- voer hier tussen u persoonlijke sql scripts
/*!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 */;
|
-- SALES INFORMATION SYSTEM --
--------------------
-- TABLE CREATION --
--------------------
CREATE TABLE sales_man
(
sno INT PRIMARY KEY,
sname VARCHAR(20) NOT NULL,
place VARCHAR(20),
phone VARCHAR(10) UNIQUE
);
-- TABLE CREATED --
-- SCHEMA DIAGRAM --
-- +-------+-------------+------+-----+---------+-------+ --
-- | Field | Type | Null | Key | Default | Extra | --
-- +-------+-------------+------+-----+---------+-------+ --
-- | sno | int(11) | NO | PRI | NULL | | --
-- | sname | varchar(20) | NO | | NULL | | --
-- | place | varchar(20) | YES | | NULL | | --
-- | phone | varchar(10) | YES | UNI | NULL | | --
-- +-------+-------------+------+-----+---------+-------+ --
-- TABLE CREATION --
CREATE TABLE sales_order
(
order_no INT PRIMARY KEY,
order_date DATE NOT NULL,
sno INT,
del_type VARCHAR(20),
order_status VARCHAR(20),
CONSTRAINT P FOREIGN KEY(sno) REFERENCES sales_man(sno),
CHECK(del_type = 'P' OR del_type = "F"),
CHECK(order_status = 'INPROCESS' OR order_status = 'FULLFILLED' OR order_status = 'BACKORDER' OR order_status = "CANCELLED")
);
-- TABLE CREATED --
-- SCHEMA DIAGRAM --
-- +--------------+-------------+------+-----+---------+-------+
-- | Field | Type | Null | Key | Default | Extra |
-- +--------------+-------------+------+-----+---------+-------+
-- | order_no | int(11) | NO | PRI | NULL | |
-- | order_date | date | NO | | NULL | |
-- | sno | int(11) | YES | MUL | NULL | |
-- | del_type | varchar(20) | YES | | NULL | |
-- | order_status | varchar(20) | YES | | NULL | |
-- +--------------+-------------+------+-----+---------+-------+
-- A) --
INSERT INTO sales_man VALUES
(
101, 'JAZ2', 'VATAKARA', '8978456512'
),
(
102, 'ASHWATHI', 'KANNUR', '7485961425'
),
(
103, 'ADITHYAN', 'BANGALORE', '7845659885'
),
(
104, 'SHERIN', 'THIVANDRUM', '7485961425'
);
SELECT * FROM sales_man;
INSERT INTO sales_order VALUES
(
35, 2018-09-05, 'P', 'INPROCESS'
),
(
24, 2019-10-15, 'F', 'FULLFILLED'
),
(
43, 2019-05-16, 'P', 'BACKDOOR'
),
(
12, 2019-04-21, 'F', 'CANCELLED'
);
SELECT * FROM sales_order;
-- B) --
ALTER TABLE sales_man DROP PRIMARY KEY
-- THIS UNIQUE KEY IS REFEREENCED BY SOME FORIGN KEY --
-- C) --
ALTER TABLE sales_manDROP CONSTRAINT P;
-- D) --
ALTER TABLE sales_man ADD PRIMARY KEY(sno);
-- E) --
ALTER TABLE sales_order ADD CHECK(del_type = 'P' OR del_type = 'F');
ADD FOREIGN KEY(sno) REFERENCES sales_man(sno); |
/* ********* 사용자 생성, 삭제 *********
-- 사용자 생성 : CREATE USER
CREATE USER 사용자명(유저명) --"MDGUEST"
IDENTIFIED BY 비밀번호 --"mdguest"
DEFAULT TABLESPACE 테이블스페이스 --"USERS"
TEMPORARY TABLESPACE 임시작업테이블스페이스 --"TEMP";
-- 사용할 용량 지정(수정)
ALTER USER "MDGUEST" QUOTA UNLIMITED ON "USERS";
-- 사용자 수정 : ALTER USER
ALTER USER 사용자명(유저명) IDENTIFIED BY 비밀번호;
-- 권한부여(롤 사용 권한 부여, 롤 부여)
GRANT "CONNECT" TO "MDGUEST" ;
GRANT "RESOURCE" TO "MDGUEST" ;
-- 사용자 삭제 : DROP USER
DROP USER 유저명 [CASCADE];
--CASCADE : 삭제시점에 사용자(유저)가 보유한 모든 데이타 삭제
*************************************/
-- (관리자계정 SYSTEM에서 작업하고) 유저생상 권한을 가진 SYSTEM에서 작업
-- 유저명 MDGUEST, 암호 : mdguest
-- USER SQL
CREATE USER "MDGUEST" IDENTIFIED BY "mdguest"
DEFAULT TABLESPACE "USERS"
TEMPORARY TABLESPACE "TEMP";
-- 롤(역할) 부여 : GRANT
-- ROLES
GRANT "CONNECT" TO "MDGUEST" ;
GRANT "RESOURCE" TO "MDGUEST" ;
/*
롤 부여 부분을 한 문장으로 작성도 가능하다.
GRANT CONNECT, RESOURCE TO MDGUSET;
*/
-- 뷰를 생성할 수 있는 권한 부여
-- SYSTEM PRIVILEGES
GRANT CREATE VIEW TO "MDGUEST" ;
---------------------------------
-- (SYSTEM) CONNECT, RESOURCE 롤(ROLE) 에 있는 권한 확인
SELECT
*
FROM SYS.dba_sys_privs
WHERE grantee IN( 'CONNECT', 'RESOURCE')
ORDER BY grantee, privilege
;
--=============================
/****** 권한 부여(GRANT), 권한 취소(REVOKE) **********************
GRANT 권한 [ON 객체] TO {사용자|ROLE|PUBLIC,.., n} [WITH GRANT OPTION]
--PUBLIC은 모든 사용자에게 적용을 의미
GRANT 권한 TO 사용자; --권한을 사용자에게 부여
GRANT 권한 ON 객체 TO 사용자; -객체에 대한 권한을 사용자에게 부여
-->> WITH GRANT OPTION :객체에 대한 권한을 사용자에게 부여
-- 권한을 받은 사용자가 다른 사용자에게 권한부여할 권리 포함
GRANT 권한 ON 객체 TO 사용자 WITH GRANT OPTION;
--------------------
-->>>권한 취소(REVOKE)
REVOKE 권한 [ON 객체] FROM {사용자|ROLE|PUBLIC,.., n} CASCADE
--CASCADE는 사용자가 다른 사용자에게 부여한 권한까지 취소시킴
(확인 및 검증 후 작업)
REVOKE 권한 FROM 사용자; --권한을 사용자에게 부여
REVOKE 권한 ON 객체 FROM 사용자; -객체에 대한 권한을 사용자에게 부여
*************************************************/
-- 권한부여 : MADANG 유저의 BOOK 테이블에 대한 SELECT 권한을 MDGUEST에게 부여
--------(SYSTEM) 권한부여 - MADANG.BOOK, 시스템이 가지고 있는 것이 아니니 MADANG.을 사용해야 함
SELECT * FROM MADANG.BOOK; -- 시스템에서 그냥 BOOK 이 아니라 MADANG.BOOK이라고 하면 접근이 가능하다.
GRANT SELECT ON MADANG.BOOK TO MDGUEST;
----(MDGUSET) MADANG.BOOK 테이블 데이터 조회(SLEECT) 할 수 있음
SELECT * FROM MADANG.BOOK; -- 시스템에서 MDGUSET에 MADANG.BOOK에 접근할 수 있는 권한을 주었기 때문에 가능하다
SELECT * FROM MADANG.CUSTOMER; -- 권한이 없어 접근이 불가능함 : "table or view does not exist"
-- (SYSTEM) 권한 회수(REVOKE) - MADANG.BOOK
REVOKE SELECT ON MADANG.BOOK FROM MDGUSET; -- 회수하면 접근권한이 없어짐
--------------------------------------
--(MADANG 유저에서) CUSTOMER 테이블에 대하여 MDGUEST 유저에게
---- SELECT, UPDATE 권한 부여
SELECT * FROM MADANG.BOOK;
-- 내가 가지고 있다면 MADANG. 을 생략가능
GRANT SELECT, UPDATE ON CUSTOMER TO MDGUEST;
--(MDGUEST 에서) CUSTOMER 테이블 SELECT, UPDATE
-- 권한을 부여 받아서 SELECT, UPDATE 작업 가능
SELECT * FROM MADANG.customer;
UPDATE MADANG.CUSTOMER
SET PHONE = '010-1111-2222'
WHERE NAME = '박세리'
;
-- (MADANG) 권한 취소(회수)
REVOKE SELECT, UPDATE ON CUSTOMER FROM MDGUEST;
------------------------
-- (MADANG) WITH GRANT OPTION : 다른 유저에게 권한을 부여할 수 있도록 허용
GRANT SELECT, UPDATE ON CUSTOMER TO MDGUEST WITH GRANT OPTION;
--(MDGUEST) 다른 유저에게 권한을 부여
GRANT SELECT, UPDATE ON MADANG.CUSTOMER TO HR;
-- (HR) MADANG.CUSTOMER SELECT
SELECT * FROM MADANG.customer;
SELECT * FROM MADANG.BOOK; -- 권한부여 X, 접근 X
-- (MADANG)권한취소
REVOKE SELECT, UPDATE ON CUSTOMER FROM MDGUEST;
--------------------
-- (관리자 SYSTEM 에서) 유저삭제
DROP USER MDGUEST CASCADE;
-- 만약 오류가 생긴다면 접속을 해제해야 한다.
|
CREATE TABLE IF NOT EXISTS `login` (
`account_id` int(11) unsigned NOT NULL auto_increment,
`userid` varchar(23) NOT NULL default '',
`user_pass` varchar(32) NOT NULL default '',
`languagem` enum('pt-br','en-us','es-us') NOT NULL default 'pt-br',
`group_id` tinyint(3) NOT NULL default '0',
`state` int(11) unsigned NOT NULL default '0',
`email` varchar(39) NOT NULL default '',
`lastlogin` datetime NOT NULL default '0000-00-00 00:00:00',
`last_ip` varchar(100) NOT NULL default '',
`vip` varchar(100) NOT NULL default '',
PRIMARY KEY (`account_id`),
KEY `name` (`userid`)
) ENGINE=MyISAM AUTO_INCREMENT=2000000; |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.15)
# Database: shop
# Generation Time: 2016-12-20 22:20:27 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table categories
# ------------------------------------------------------------
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(60) DEFAULT NULL,
`image` varchar(255) DEFAULT '',
`product_count` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` (`id`, `name`, `image`, `product_count`)
VALUES
(1,'Computers','http://placehold.it/800x300',0),
(2,'Cars','http://placehold.it/800x300',0),
(3,'Buses','http://placehold.it/800x300',0);
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table orders
# ------------------------------------------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(11) DEFAULT NULL,
`product_name` varchar(60) DEFAULT NULL,
`product_price` double(10,2) DEFAULT NULL,
`email` varchar(125) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
INSERT INTO `orders` (`id`, `product_id`, `product_name`, `product_price`, `email`)
VALUES
(1,0,'',0.00,'filipkulig@gmail.com'),
(2,3,'Audi',43000.00,'filipkulig@gmail.com'),
(3,3,'Audi',43000.00,'filipkulig@gmail.com'),
(4,3,'Audi',43000.00,'filipkulig@gmail.com'),
(5,3,'Audi',43000.00,'filipkulig@gmail.com'),
(6,3,'Audi',43000.00,'filipkulig@gmail.com'),
(7,3,'Audi',43000.00,'filipkulig@gmail.com'),
(8,3,'Audi',43000.00,'filipkulig@gmail.com'),
(9,3,'Audi',43000.00,'filipkulig@gmail.com'),
(10,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(11,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(12,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(13,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(14,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(15,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(16,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(17,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(18,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(19,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(20,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(21,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(22,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(23,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(24,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(25,1,'MacBook Pro',2300.00,'filipkulig@gmail.com'),
(26,3,'Audi',43000.00,'filipkulig@gmail.com'),
(27,2,'Dell ',759.00,'filipkulig@gmail.com'),
(28,2,'Dell ',759.00,'filipkulig@gmail.com'),
(29,3,'Audi',43000.00,'filipkulig@gmail.com');
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table products
# ------------------------------------------------------------
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`category_id` int(11) DEFAULT NULL,
`name` varchar(60) DEFAULT NULL,
`image` varchar(60) DEFAULT NULL,
`description` text,
`price` double(10,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` (`id`, `category_id`, `name`, `image`, `description`, `price`)
VALUES
(1,1,'MacBook Pro','http://placehold.it/800x300','Super !!!!',2300.00),
(2,1,'Dell ','http://placehold.it/800x300','Super dell, best in the market !!',759.00),
(3,2,'Audi','http://placehold.it/800x300','Vorsprung durch technik',43000.00);
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 14, 2016 at 03:00 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
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: `mydatabase`
--
-- --------------------------------------------------------
--
-- Table structure for table `menu`
--
CREATE TABLE `menu` (
`food_id` varchar(10) NOT NULL,
`food_name` varchar(30) NOT NULL,
`food_price` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `menu`
--
INSERT INTO `menu` (`food_id`, `food_name`, `food_price`) VALUES
('F10001', 'Char Kuey Teow', 4.5),
('F10002', 'Popiah', 2.5),
('F10003', 'Wan Tan Mee', 5);
-- --------------------------------------------------------
--
-- Table structure for table `neworder`
--
CREATE TABLE `neworder` (
`order_no` varchar(6) NOT NULL,
`seat_no` varchar(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `order_list`
--
CREATE TABLE `order_list` (
`order_no` varchar(6) NOT NULL,
`item` varchar(30) NOT NULL,
`price` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
CREATE TABLE `payment` (
`payment_id` varchar(6) NOT NULL,
`order_no` varchar(6) NOT NULL,
`payment_type` varchar(12) NOT NULL,
`account_no` varchar(20) NOT NULL,
`subtotal` double NOT NULL,
`gst` double NOT NULL,
`total` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `payment`
--
INSERT INTO `payment` (`payment_id`, `order_no`, `payment_type`, `account_no`, `subtotal`, `gst`, `total`) VALUES
('P1000', 'O1001', 'Cash', '---', 12, 0.72, 12.72),
('P1001', 'O1002', 'Credit Card', '123456789', 14.5, 0.87, 15.37),
('P1002', 'O1000', 'Credit Card', '123456789', 12.6, 0.76, 13.36),
('P1003', 'O1001', 'Cash', '---', 4.5, 0.27, 4.77);
-- --------------------------------------------------------
--
-- Table structure for table `personnel`
--
CREATE TABLE `personnel` (
`id` varchar(4) NOT NULL,
`name` varchar(50) NOT NULL,
`ic` varchar(14) NOT NULL,
`address` varchar(100) NOT NULL,
`gender` varchar(6) NOT NULL,
`hp` varchar(12) NOT NULL,
`stype` varchar(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `personnel`
--
INSERT INTO `personnel` (`id`, `name`, `ic`, `address`, `gender`, `hp`, `stype`) VALUES
('M100', 'Wong', '960426', 'aaa', 'Male', '012-3456789', 'M'),
('S100', 'Seong', '960426', 'aaa', 'Male', '012-3456789', 'S');
/*!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 */;
|
/*
Navicat Premium Data Transfer
Source Server : 58.87.107.26
Source Server Type : MySQL
Source Server Version : 50556
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 50556
File Encoding : 65001
Date: 23/08/2018 16:42:38
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
`articleid` int(20) NOT NULL AUTO_INCREMENT,
`createTime` datetime NULL DEFAULT NULL,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`gist` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`author` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '泛银河系含漱爆破液',
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`top` tinyint(2) NULL DEFAULT 2 COMMENT '是否置顶:2为否1为是',
`imgurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片地址',
`category` int(255) NULL DEFAULT NULL,
`view` int(255) NULL DEFAULT NULL,
PRIMARY KEY (`articleid`) USING BTREE,
INDEX `title`(`title`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 250 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for categories
-- ----------------------------
DROP TABLE IF EXISTS `categories`;
CREATE TABLE `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`categories` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`imgurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`, `slug`) USING BTREE,
UNIQUE INDEX `slug`(`slug`) USING BTREE,
INDEX `id`(`id`) USING BTREE,
INDEX `categories`(`categories`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for commentchild
-- ----------------------------
DROP TABLE IF EXISTS `commentchild`;
CREATE TABLE `commentchild` (
`articleid` int(20) NOT NULL,
`childid` int(11) NOT NULL AUTO_INCREMENT,
`commentDate` datetime NULL DEFAULT NULL,
`commentName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`commentContent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`fatherid` int(255) NULL DEFAULT NULL,
PRIMARY KEY (`childid`) USING BTREE,
INDEX `articleid`(`articleid`) USING BTREE,
INDEX `father`(`fatherid`) USING BTREE,
CONSTRAINT `commentchild_ibfk_1` FOREIGN KEY (`articleid`) REFERENCES `article` (`articleid`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `father` FOREIGN KEY (`fatherid`) REFERENCES `commentfather` (`fatherid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 46 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for commentfather
-- ----------------------------
DROP TABLE IF EXISTS `commentfather`;
CREATE TABLE `commentfather` (
`articleid` int(20) NOT NULL,
`fatherid` int(11) NOT NULL AUTO_INCREMENT,
`commentDate` datetime NULL DEFAULT NULL,
`commentName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`commentContent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`fatherid`) USING BTREE,
INDEX `articleid`(`articleid`) USING BTREE,
CONSTRAINT `articleid` FOREIGN KEY (`articleid`) REFERENCES `article` (`articleid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB AUTO_INCREMENT = 59 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for music
-- ----------------------------
DROP TABLE IF EXISTS `music`;
CREATE TABLE `music` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`musicurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`author` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`posterurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`album` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 43 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for slider
-- ----------------------------
DROP TABLE IF EXISTS `slider`;
CREATE TABLE `slider` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`imgurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`index` int(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`avatarurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`userid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`password` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`introduction` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`email` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`job` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
|
-- it lists all shows without a
-- linked gender.
SELECT tv_shows.title, tv_show_genres.genre_id
FROM tv_shows LEFT OUTER JOIN tv_show_genres
ON tv_shows.id = tv_show_genres.show_id
WHERE tv_show_genres.show_id IS NULL
ORDER BY tv_shows.title, tv_show_genres.genre_id; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.