text stringlengths 6 9.38M |
|---|
-- criando ficha cadastral de proprietario
create table proprietario
(
nome varchar(30) not null,
enderprop varchar(30) not null,
estcivil varchar(30) null,
cpf varchar(30) not null,
rg varchar(30) not null,
contato varchar(30) null,
email varchar(30) not null,
banco varchar(30) not null,
agencia int not null,
conta varchar(30) not null,
endereco varchar(30) not null,
valaluguel int not null,
datinicio varchar(30) not null,
percontato varchar(30) not null
primary key (nome,rg)
);
-- inserindo registro na tabela dos proprietarios
insert into proprietario values ('Xavier','Rua Antonia das Cunhas','Solteiro','120.410.780-10','90.502.322-1','14992-5412','Xaviermelordes@gmail.com','Bradesco','3375','0152504-P','Avenida dos Santos','500','04/02/2020','05/01/1700');
-- inserindo mais cinco registro na tabela dos proprietarios
insert into proprietario values ('Bianca','Rua dos Tres Mello ','Cansada','220.440.770-20','10.552.332-2','14988-5410','Biancameesilva@outlook.com','ltau','4272','0100504-P','Avenida Fatima dos Relo','600','01/03/1999','02/01/1700');
insert into proprietario values ('Carlos','Rua dos Carlos Cunhas','Solteiro','320.515.780-20','30.509.322-3','14902-5002','Carlosdoslordes@hotmail.com','Citibank','5570','0786504-P','Avenida Hello dos Pereira','700','05/08/2020','01/01/1700');
insert into proprietario values ('Daniela','Rua Daniela das Releira','Cansada','424.415.781-30','40.508.328-4','14951-5610','Danielamelordes@gmail.com','Santander','6301','0132533-P','Avenida de Avenida dos Santos','800','14/011/1888','06/01/1700');
insert into proprietario values ('Erique','Rua Word das Dales','Solteiro','724.321.409-40','50.412.100-5','14941-0411','Eriquelordesria@hotmail.com','Bradesco','7470','0104404-P','Avenida de Avenida dos Santos','900','04/02/2020','05/01/1700');
insert into proprietario values ('Fabia','Rua Cunhas da Rimeiras','Cansada','322.450.320-60','60.412.602-6','14933-5109','Wordrinfabiana@outlook.com','Citibank','3085','0454404-P','Avenida Santos de Avenidas','1000','04/02/2020','05/01/1700');
-- verificando dados dos proprietarios
select * from proprietario;
|
--oracle
alter table F_DATACATALOG add CREATOR VARCHAR2(32);
alter table F_DATACATALOG add UPDATOR VARCHAR2(32);
alter table F_DATACATALOG RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
alter table F_OPTDEF add CREATOR VARCHAR2(32);
alter table F_OPTDEF add UPDATOR VARCHAR2(32);
alter table F_OPTDEF RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
alter table F_OPTINFO add CREATOR VARCHAR2(32);
alter table F_OPTINFO add UPDATOR VARCHAR2(32);
alter table F_OPTINFO RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
alter table F_ROLEPOWER add CREATOR VARCHAR2(32);
alter table F_ROLEPOWER add UPDATOR VARCHAR2(32);
alter table F_ROLEPOWER RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
alter table F_USERROLE add CREATOR VARCHAR2(32);
alter table F_USERROLE add UPDATOR VARCHAR2(32);
alter table F_USERROLE RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
alter table F_USERUNIT add CREATOR VARCHAR2(32);
alter table F_USERUNIT add UPDATOR VARCHAR2(32);
alter table F_USERUNIT RENAME COLUMN LASTMODIFYDATE TO UPDATEDATE;
--mysql
alter table F_DATACATALOG add CREATOR VARCHAR(32);
alter table F_DATACATALOG add UPDATOR VARCHAR(32);
alter table F_DATACATALOG change LASTMODIFYDATE UPDATEDATE date;
alter table F_OPTDEF add CREATOR VARCHAR(32);
alter table F_OPTDEF add UPDATOR VARCHAR(32);
alter table F_OPTDEF change LASTMODIFYDATE UPDATEDATE date;
alter table F_OPTINFO add CREATOR VARCHAR(32);
alter table F_OPTINFO add UPDATOR VARCHAR(32);
alter table F_OPTINFO change LASTMODIFYDATE UPDATEDATE date;
alter table F_ROLEPOWER add CREATOR VARCHAR(32);
alter table F_ROLEPOWER add UPDATOR VARCHAR(32);
alter table F_ROLEPOWER change LASTMODIFYDATE UPDATEDATE date;
alter table F_USERROLE add CREATOR VARCHAR(32);
alter table F_USERROLE add UPDATOR VARCHAR(32);
alter table F_USERROLE change LASTMODIFYDATE UPDATEDATE date;
alter table F_USERUNIT add CREATOR VARCHAR(32);
alter table F_USERUNIT add UPDATOR VARCHAR(32);
alter table F_USERUNIT change LASTMODIFYDATE UPDATEDATE date; |
-- {{ ref('snowplow_days') }}
{{
config(
materialized='date_partitioned_table',
date_source='snowplow_days',
date_field='date_day',
date_partitioned_base_schema='snowplow',
date_partitioned_base_relation='event_daily',
filter_output=False
)
}}
with all_events as (
select * from __dbt_source_data
),
events as (
select * from all_events
),
web_page_context as (
select * from {{ ref('snowplow_base_web_page_context') }}
),
fixed as (
select
* except(br_viewheight, event),
collector_tstamp as derived_tstamp,
dvce_tstamp as dvce_created_tstamp,
null as mkt_clickid,
null as mkt_network,
case when event = 'pv' then 'page_view'
when event = 'pp' then 'page_ping'
else event
end as event,
case
when br_viewheight like '%x%'
then cast(split(br_viewheight, 'x')[safe_offset(0)] as float64)
else null
end as br_viewheight,
case
when br_viewheight like '%x%'
then cast(split(br_viewheight, 'x')[safe_offset(1)] as float64)
else null
end as br_viewwidth
from events
where
-- this breaks the snowplow package
(br_viewheight is null or br_viewheight != 'cliqz.com/tracking')
)
select
`page_view_id`,
`event_id`,
`app_id`,
`br_type`,
`br_family`,
`collector_tstamp`,
`doc_height`,
`doc_width`,
`domain_sessionid`,
`domain_sessionidx`,
`domain_userid`,
`dvce_ismobile`,
`dvce_screenheight`,
`dvce_sent_tstamp`,
`dvce_tstamp`,
`dvce_created_tstamp`,
`derived_tstamp`,
`dvce_type`,
`event`,
`geo_city`,
`geo_country`,
`geo_latitude`,
`geo_longitude`,
`geo_region`,
`geo_region_name`,
`geo_timezone`,
`geo_zipcode`,
`mkt_campaign`,
`mkt_content`,
`mkt_medium`,
`mkt_source`,
`mkt_term`,
`os_family`,
`os_manufacturer`,
`os_name`,
`os_timezone`,
`page_referrer`,
`page_title`,
`page_url`,
`page_urlfragment`,
`page_urlhost`,
`page_urlpath`,
`page_urlport`,
`page_urlquery`,
`page_urlscheme`,
`platform`,
`pp_xoffset_max`,
`pp_xoffset_min`,
`pp_yoffset_max`,
`pp_yoffset_min`,
`refr_medium`,
`refr_source`,
`refr_term`,
`refr_urlfragment`,
`refr_urlhost`,
`refr_urlpath`,
`refr_urlport`,
`refr_urlquery`,
`refr_urlscheme`,
`se_action`,
`se_category`,
`se_label`,
`se_property`,
`se_value`,
`user_fingerprint`,
`user_id`,
`user_ipaddress`,
`useragent`,
`v_tracker`,
-- null as `mkt_clickid`,
-- null as `mkt_network`,
-- null as `etl_tstamp`,
-- null as `dvce_screenwidth`,
-- null as `ip_isp`,
-- null as `ip_organization`,
-- null as `ip_domain`,
-- null as `ip_netspeed`,
-- null as `browser`,
-- null as `browser_name`,
-- null as `browser_major_version`,
-- null as `browser_minor_version`,
-- null as `browser_build_version`,
-- null as `browser_engine`,
-- null as `browser_language`,
case
when (br_viewwidth) > 100000 then null
else br_viewwidth
end as br_viewwidth,
case
when (br_viewheight) > 100000 then null
else br_viewheight
end as br_viewheight
from fixed
join web_page_context using (event_id)
|
# Write your MySQL query statement below
# 执行用时:326 ms, 在所有 MySQL 提交中击败了91.25%的用户
# 内存消耗:0 B, 在所有 MySQL 提交中击败了100.00%的用户
select Name as Customers from Customers c where c.Id not in
(select CustomerId from Orders)
/* Write your T-SQL query statement below */
# 不加distinct会超时
# 0 / 12 个通过测试用例
# 状态:超出时间限制
# 提交时间:几秒前
# 不过,有时也能通过
# 执行用时:1014 ms, 在所有 mssql 提交中击败了64.50%的用户
# 内存消耗:0 B, 在所有 mssql 提交中击败了100.00%的用户
select Name as Customers from Customers c where c.Id not in
(select CustomerId from Orders)
/* Write your T-SQL query statement below */
# 执行用时:1290 ms, 在所有 mssql 提交中击败了41.25%的用户
# 内存消耗:0 B, 在所有 mssql 提交中击败了100.00%的用户
select Name as Customers from Customers c where c.Id not in
(select distinct CustomerId from Orders)
/*
执行用时:623 ms, 在所有 MySQL 提交中击败了14.85% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:11 / 11
*/
# Write your MySQL query statement below
select name as customers from customers
where id not in (select customerid from orders)
/*
执行用时:592 ms, 在所有 MySQL 提交中击败了26.36% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:11 / 11
*/
# Write your MySQL query statement below
select name as customers from customers c
where not exists (select customerid from orders o where c.id = o.customerid)
/*
执行用时:524 ms, 在所有 MySQL 提交中击败了86.31% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:11 / 11
*/
# Write your MySQL query statement below
select name as customers from customers c
where not exists (select 14234 from orders o where c.id = o.customerid)
/*
执行用时:574 ms, 在所有 MySQL 提交中击败了36.84% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:11 / 11
*/
# Write your MySQL query statement below
select name as customers from customers c
left join orders o on c.id = o.customerid where o.id is null
|
/*
Navicat MySQL Data Transfer
Source Server : docker-master
Source Server Version : 50717
Source Host : 192.168.249.128:3307
Source Database : db-test
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2017-03-07 10:13:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for t_sys_dic_type
-- ----------------------------
DROP TABLE IF EXISTS `t_sys_dic_type`;
CREATE TABLE `t_sys_dic_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL DEFAULT '',
`status` int(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `code_index` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_sys_dic_type
-- ----------------------------
INSERT INTO `t_sys_dic_type` VALUES ('1', 'goodCategory', '物品分类', '1');
INSERT INTO `t_sys_dic_type` VALUES ('2', 'express', '快递', '1');
|
DELIMITER $$
CREATE PROCEDURE `PRO_BOOKING`(
IN pi_player_id bigint,
IN pi_match_id bigint,
IN pi_match_day date,
IN pi_type int,
IN pi_create_user_id bigint,
IN pi_comment VARCHAR(2000),
OUT po_response VARCHAR(200))
BEGIN
DECLARE v_booking_id bigint unsigned DEFAULT 1;
INSERT INTO `football`.`booking` (`n_player_id`, `n_match_id`, `d_match_day`, `n_type`, `n_created_user_id`, `s_comment`, `d_created_at`)
VALUES (pi_player_id, pi_match_id, pi_match_day, pi_type, pi_create_user_id, pi_comment, sysdate());
SELECT LAST_INSERT_ID()
INTO v_booking_id;
INSERT INTO `football`.`booking_log` ( `n_booking_id`, `n_user_id`, `s_reason`, `n_status_old`, `n_status_new`, `d_created_at`)
VALUES (v_booking_id, pi_create_user_id, 'booking', '0', '1', sysdate());
SET po_response = 'OK';
END$$
DELIMITER ;
|
CREATE table Role(
id serial unique primary key ,
name text,
is_admin boolean
);
CREATE table Users(
id serial primary key ,
name text,
email text,
password_hash text,
role int,
foreign key (role) references role(id)
); |
create user &&REPLICATION_USER identified by "&PASSWORD" DEFAULT TABLESPACE &&DEFAULT_REPLICATION_TABLESPACE;
alter user &&REPLICATION_USER quota unlimited on &&DEFAULT_REPLICATION_TABLESPACE;
grant resource,create session to &&REPLICATION_USER ;
grant select on v_$database to &&REPLICATION_USER ;
grant select on v_$transaction to &&REPLICATION_USER ;
grant select on v_$logmnr_contents to &&REPLICATION_USER ;
grant select on gv_$transaction to &&REPLICATION_USER ;
grant select on dba_users to &&REPLICATION_USER ;
grant select on dba_tables to &&REPLICATION_USER ;
grant select on DBA_LOG_GROUPS to &&REPLICATION_USER ;
grant select on dba_constraints to &&REPLICATION_USER ;
grant execute_catalog_role to &&REPLICATION_USER ;
grant select_catalog_role to &&REPLICATION_USER ;
grant create database link to &&REPLICATION_USER ;
grant execute on DBMS_UTILITY to &&REPLICATION_USER ;
grant execute on DBMS_LOGMNR to &&REPLICATION_USER ;
grant alter any table to &&REPLICATION_USER ;
grant select any table to &&REPLICATION_USER;
grant delete any table to &&REPLICATION_USER;
grant insert any table to &&REPLICATION_USER;
grant update any table to &&REPLICATION_USER;
grant drop any table to &&REPLICATION_USER;
grant SELECT ANY TRANSACTION to &&REPLICATION_USER ;
|
--Fix printer corrupted printer settings in Macola by removing the user's records from this table
SELECT * FROM printdft_sql WHERE prt_df_user LIKE 'RWALKER%'
DELETE FROM printdft_sql WHERE prt_df_user LIKE 'RWALKER%'
|
DROP DATABASE IF EXISTS `super_rent`; /*Add by Eli*/ |
CREATE TABLE `country` (
`countryId` int(11) NOT NULL AUTO_INCREMENT,
`countryName` varchar(100) NOT NULL,
PRIMARY KEY (`countryId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
create index IX_4A6E107E on opencps_feedback (email); |
CREATE TABLE `T_VERSION` (
`Version` int NOT NULL PRIMARY KEY,
`UpTime` timestamp NOT NULL
) DEFAULT CHARSET=utf8;
INSERT INTO `T_VERSION` VALUES ('0', now());
CREATE TABLE `T_ROLE` (
`Id` int(11) NOT NULL PRIMARY KEY,
`Name` varchar(64) NOT NULL,
`Authorities` varchar(1024) NOT NULL,
`ReadOnly` tinyint(1) NOT NULL
) DEFAULT CHARSET=utf8;
INSERT INTO `T_ROLE` VALUES (1001, 'Admin', '_', 0);
CREATE TABLE `T_USER` (
`Name` varchar(64) NOT NULL PRIMARY KEY,
`Phone` varchar(64) NOT NULL,
`Email` varchar(64) NOT NULL,
`Passw` varchar(128) NOT NULL,
`Roles` varchar(128) NOT NULL,
`Ctime` timestamp NOT NULL
) DEFAULT CHARSET=utf8;
INSERT INTO `T_USER` VALUES ('admin', '10086', 'admin@xframe.dev', '21232f297a57a5a743894a0e4a801fc3', '1001', now()); |
select
cc_call_center_id Call_Center,
cc_name Call_Center_Name,
cc_manager Manager,
sum(cr_net_loss) Returns_Loss
from
call_center,
catalog_returns,
date_dim,
customer,
customer_address,
customer_demographics,
household_demographics
where catalog_returns.cr_call_center_sk = call_center.cc_call_center_sk
and catalog_returns.cr_returned_date_sk = date_dim.d_date_sk
and catalog_returns.cr_returning_customer_sk = customer.c_customer_sk
and customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk
and household_demographics.hd_demo_sk = customer.c_current_hdemo_sk
and customer_address.ca_address_sk = customer.c_current_addr_sk
and d_year = 1999
and d_moy = 11
and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown')
or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree'))
and hd_buy_potential like '0-500%'
and ca_gmt_offset = -7
group by cc_call_center_id
,cc_name
,cc_manager
,cd_marital_status
,cd_education_status
order by Returns_Loss desc
; |
-- 消息模版表
CREATE TABLE message_template (
id bigserial not null,
tenant_id bigint default 0 not null,
app_module VARCHAR(50),
code VARCHAR(20) NOT NULL,
title VARCHAR(100) NOT NULL,
content VARCHAR(500) NOT NULL,
ext_data VARCHAR(500),
is_deleted BOOLEAN default FALSE not null,
create_by bigint DEFAULT 0 NOT NULL,
create_time timestamp default CURRENT_TIMESTAMP not null,
update_time timestamp default CURRENT_TIMESTAMP null
);
-- 添加备注
comment on column message_template.id is 'ID';
comment on column message_template.tenant_id is '租户ID';
comment on column message_template.app_module is '应用模块';
comment on column message_template.code is '模版编码';
comment on column message_template.title is '模版标题';
comment on column message_template.content is '模版内容';
comment on column message_template.ext_data is '扩展数据';
comment on column message_template.is_deleted is '是否删除';
comment on column message_template.create_by is '创建人';
comment on column message_template.create_time is '创建时间';
comment on column message_template.update_time is '更新时间';
comment on table message_template is '消息模版';
-- 创建索引
create index idx_msg_tmpl_tenant on message_template (tenant_id);
create index idx_msg_tmpl_code ON message_template(code);
-- 消息表
CREATE TABLE message (
id bigserial not null,
tenant_id bigint default 0 not null,
app_module VARCHAR(50),
template_id bigint,
business_type VARCHAR(100) not null,
business_code VARCHAR(50) default 0 not null,
sender VARCHAR(100) not null,
receiver VARCHAR(100) not null,
title VARCHAR(100) NOT NULL,
content VARCHAR(500) NOT NULL,
channel VARCHAR(30) NOT NULL,
status VARCHAR(30) NOT NULL,
result VARCHAR(200),
schedule_time timestamp null,
ext_data VARCHAR(200),
is_deleted BOOLEAN default FALSE not null,
create_time timestamp default CURRENT_TIMESTAMP not null,
update_time timestamp default CURRENT_TIMESTAMP null
);
comment on column message.id is 'ID';
comment on column message.tenant_id is '租户ID';
comment on column message.app_module is '应用模块';
comment on column message.template_id is '模版id';
comment on column message.business_type is '业务类型';
comment on column message.business_code is '业务标识';
comment on column message.sender is '发送方';
comment on column message.receiver is '接收方';
comment on column message.title is '标题';
comment on column message.content is '内容';
comment on column message.channel is '发送通道';
comment on column message.status is '消息状态';
comment on column message.result is '发送结果';
comment on column message.schedule_time is '定时发送时间';
comment on column message.ext_data is '扩展数据';
comment on column message.is_deleted is '是否删除';
comment on column message.update_time is '更新时间';
comment on column message.create_time is '创建时间';
comment on table message is '消息';
create index idx_msg_tenant on message (tenant_id);
create index idx_msg_template on message (template_id);
create index idx_msg_receiver on message (receiver);
|
with prs as (
select pr.id,
pr.dup_repo_id as repo_id,
pr.dup_repo_name as repo_name,
pr.created_at,
pr.merged_at,
pr.event_id
from
gha_pull_requests pr
where
pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
and pr.event_id = (
select s.event_id from gha_pull_requests s where s.id = pr.id order by s.updated_at desc limit 1
)
), prs_labels as (
select distinct pr.id,
pr.repo_id,
pr.repo_name,
iel.label_name,
pr.created_at,
pr.merged_at,
pr.event_id as pr_event_id
from
prs pr,
gha_issues_pull_requests ipr,
gha_issues_events_labels iel
where
pr.id = ipr.pull_request_id
and pr.repo_id = ipr.repo_id
and pr.repo_name = ipr.repo_name
and ipr.issue_id = iel.issue_id
and iel.label_name in ('kind/api-change', 'kind/bug', 'kind/feature', 'kind/design', 'kind/cleanup', 'kind/documentation', 'kind/flake', 'kind/kep')
and iel.created_at >= '{{from}}'
and iel.created_at < '{{to}}'
and ipr.created_at >= '{{from}}'
and ipr.created_at < '{{to}}'
), prs_groups as (
select distinct sub.repo_group,
sub.id,
sub.created_at,
sub.merged_at
from (
select coalesce(ecf.repo_group, r.repo_group) as repo_group,
pr.id,
pr.created_at,
pr.merged_at
from
gha_repos r,
prs pr
left join
gha_events_commits_files ecf
on
ecf.event_id = pr.event_id
where
r.id = pr.repo_id
and r.name = pr.repo_name
and pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
) sub
where
sub.repo_group is not null
), prs_groups_labels as (
select distinct sub.repo_group,
sub.label_name,
sub.id,
sub.created_at,
sub.merged_at
from (
select coalesce(ecf.repo_group, r.repo_group) as repo_group,
pr.id,
pr.label_name,
pr.created_at,
pr.merged_at
from
gha_repos r,
prs_labels pr
left join
gha_events_commits_files ecf
on
ecf.event_id = pr.pr_event_id
where
r.id = pr.repo_id
and r.name = pr.repo_name
and pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
) sub
where
sub.repo_group is not null
), tdiffs as (
select id,
extract(epoch from coalesce(merged_at - created_at, now() - created_at)) / 3600 as age
from
prs
), tdiffs_groups as (
select id,
repo_group,
extract(epoch from coalesce(merged_at - created_at, now() - created_at)) / 3600 as age
from
prs_groups
), tdiffs_labels as (
select id,
substring(label_name from 6) as label,
extract(epoch from coalesce(merged_at - created_at, now() - created_at)) / 3600 as age
from
prs_labels
), tdiffs_groups_labels as (
select id,
repo_group,
substring(label_name from 6) as label,
extract(epoch from coalesce(merged_at - created_at, now() - created_at)) / 3600 as age
from
prs_groups_labels
)
select
'prs_age;All,All;n,m' as name,
round(count(distinct id) / {{n}}, 2) as num,
percentile_disc(0.5) within group (order by age asc) as age_median
from
tdiffs
union select 'prs_age;' || repo_group || ',All;n,m' as name,
round(count(distinct id) / {{n}}, 2) as num,
percentile_disc(0.5) within group (order by age asc) as age_median
from
tdiffs_groups
group by
repo_group
union select
'prs_age;All,' || label || ';n,m' as name,
round(count(distinct id) / {{n}}, 2) as num,
percentile_disc(0.5) within group (order by age asc) as age_median
from
tdiffs_labels
group by
label
union select 'prs_age;' || repo_group || ',' || label || ';n,m' as name,
round(count(distinct id) / {{n}}, 2) as num,
percentile_disc(0.5) within group (order by age asc) as age_median
from
tdiffs_groups_labels
group by
label,
repo_group
order by
num desc,
name asc
;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 07, 2018 at 07:52 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: `wifout`
--
-- --------------------------------------------------------
--
-- Table structure for table `allowed`
--
CREATE TABLE `allowed` (
`allowed_ID` int(10) NOT NULL,
`allowedDate` date NOT NULL,
`bssidMAC` varchar(100) NOT NULL,
`channelNum` varchar(100) NOT NULL,
`nameSSID` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `blocked`
--
CREATE TABLE `blocked` (
`blocked_ID` int(10) NOT NULL,
`blockedDate` date NOT NULL,
`bssidMACB` varchar(100) NOT NULL,
`channelNumB` varchar(100) NOT NULL,
`nameSSIDB` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `credentials`
--
CREATE TABLE `credentials` (
`admin_ID` int(10) NOT NULL,
`userName` varchar(100) NOT NULL,
`passWord` varchar(1000) NOT NULL,
`email` varchar(100) NOT NULL,
`tracking` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `credentials`
--
INSERT INTO `credentials` (`admin_ID`, `userName`, `passWord`, `email`, `tracking`) VALUES
(2, 'wifoutadmin', 'pbkdf2:sha256:50000$Bg1NLfCd$34c143af9a6b9fbde356745722f4efd281bda8707629abf7181461d6505bd118', 'ragnamon@yahoo.com', '/');
-- --------------------------------------------------------
--
-- Table structure for table `DailyCount`
--
CREATE TABLE `DailyCount` (
`dataD_ID` int(100) NOT NULL,
`dateDaily` varchar(1000) NOT NULL,
`monthAndYear` varchar(1000) NOT NULL,
`AllowedD` varchar(1000) NOT NULL,
`BlockedD` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `MonthlyCount`
--
CREATE TABLE `MonthlyCount` (
`dataM_ID` int(100) NOT NULL,
`dateMonthly` varchar(1000) NOT NULL,
`yearOfMonth` varchar(1000) NOT NULL,
`AllowedM` varchar(1000) NOT NULL,
`BlockedM` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `reports`
--
CREATE TABLE `reports` (
`report_ID` int(200) NOT NULL,
`dateOfProcess` date NOT NULL,
`yearOfProcess` varchar(1000) NOT NULL,
`monthOfProcess` varchar(1000) NOT NULL,
`dayOfProcess` varchar(1000) NOT NULL,
`weekNofProcess` varchar(1000) NOT NULL,
`timeOfProcess` varchar(1000) NOT NULL,
`bssidMACR` varchar(1000) NOT NULL,
`ssidNameR` varchar(1000) NOT NULL,
`channelR` varchar(1000) NOT NULL,
`StatusR` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `tempChannel`
--
CREATE TABLE `tempChannel` (
`channel_ID` int(100) NOT NULL,
`channelNumb` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tempChannel`
--
INSERT INTO `tempChannel` (`channel_ID`, `channelNumb`) VALUES
(0, '1');
-- --------------------------------------------------------
--
-- Table structure for table `tempDate`
--
CREATE TABLE `tempDate` (
`date_ID` int(100) NOT NULL,
`monthRecordfromR` varchar(1000) NOT NULL,
`yearRecordfromR` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `WeeklyCount`
--
CREATE TABLE `WeeklyCount` (
`dataW_ID` int(100) NOT NULL,
`dateWeekly` varchar(1000) NOT NULL,
`yearOfWeek` varchar(1000) NOT NULL,
`AllowedW` varchar(1000) NOT NULL,
`BlockedW` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `YearlyCount`
--
CREATE TABLE `YearlyCount` (
`dataY_ID` int(100) NOT NULL,
`dateYearly` varchar(1000) NOT NULL,
`AllowedY` varchar(1000) NOT NULL,
`BlockedY` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `allowed`
--
ALTER TABLE `allowed`
ADD PRIMARY KEY (`allowed_ID`);
--
-- Indexes for table `blocked`
--
ALTER TABLE `blocked`
ADD PRIMARY KEY (`blocked_ID`);
--
-- Indexes for table `credentials`
--
ALTER TABLE `credentials`
ADD PRIMARY KEY (`admin_ID`);
--
-- Indexes for table `DailyCount`
--
ALTER TABLE `DailyCount`
ADD PRIMARY KEY (`dataD_ID`);
--
-- Indexes for table `MonthlyCount`
--
ALTER TABLE `MonthlyCount`
ADD PRIMARY KEY (`dataM_ID`);
--
-- Indexes for table `reports`
--
ALTER TABLE `reports`
ADD PRIMARY KEY (`report_ID`);
--
-- Indexes for table `tempChannel`
--
ALTER TABLE `tempChannel`
ADD PRIMARY KEY (`channel_ID`);
--
-- Indexes for table `tempDate`
--
ALTER TABLE `tempDate`
ADD PRIMARY KEY (`date_ID`);
--
-- Indexes for table `WeeklyCount`
--
ALTER TABLE `WeeklyCount`
ADD PRIMARY KEY (`dataW_ID`);
--
-- Indexes for table `YearlyCount`
--
ALTER TABLE `YearlyCount`
ADD PRIMARY KEY (`dataY_ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `allowed`
--
ALTER TABLE `allowed`
MODIFY `allowed_ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91;
--
-- AUTO_INCREMENT for table `blocked`
--
ALTER TABLE `blocked`
MODIFY `blocked_ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;
--
-- AUTO_INCREMENT for table `credentials`
--
ALTER TABLE `credentials`
MODIFY `admin_ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `DailyCount`
--
ALTER TABLE `DailyCount`
MODIFY `dataD_ID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `MonthlyCount`
--
ALTER TABLE `MonthlyCount`
MODIFY `dataM_ID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `reports`
--
ALTER TABLE `reports`
MODIFY `report_ID` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91;
--
-- AUTO_INCREMENT for table `tempDate`
--
ALTER TABLE `tempDate`
MODIFY `date_ID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `WeeklyCount`
--
ALTER TABLE `WeeklyCount`
MODIFY `dataW_ID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `YearlyCount`
--
ALTER TABLE `YearlyCount`
MODIFY `dataY_ID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
ALGORITHM differents
VAR
set1:ARRAY_OF INTEGER[10];
set2:ARRAY_OF INTEGER[10];
i,j:INTEGER;
sum:INTEGER:=0;
Found:BOOLEAN;
BEGIN
FOR i FROM 0 TO set1.length-1 DO
found :=false;
FOR j FROM 0 TO set2.length-1 DO
IF (set1[i]=set2[j]) THEN
found= true
break
END IF
if (found == false ) THEN
sum := sum + set1[i]
FOR j FROM 0 TO set2.length-1 DO
found :=false;
FOR i FROM 0 TO set1.length-1 DO
IF (set2[j]=set1[i]) THEN
found= true
break
END IF
if (found == false ) THEN
sum := sum + set2[i]
END IF
Write("somme des elements differents",sum)
|
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255) NOT NULL,
PRIMARY KEY (Code)
);
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255) NOT NULL ,
Price DECIMAL NOT NULL ,
Manufacturer INTEGER NOT NULL,
PRIMARY KEY (Code),
FOREIGN KEY (Manufacturer) REFERENCES Manufacturers(Code)
) ENGINE=INNODB;
INSERT INTO Manufacturers(Code,Name) VALUES(1,'Sony');
INSERT INTO Manufacturers(Code,Name) VALUES(2,'Creative Labs');
INSERT INTO Manufacturers(Code,Name) VALUES(3,'Hewlett-Packard');
INSERT INTO Manufacturers(Code,Name) VALUES(4,'Iomega');
INSERT INTO Manufacturers(Code,Name) VALUES(5,'Fujitsu');
INSERT INTO Manufacturers(Code,Name) VALUES(6,'Winchester');
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(1,'Hard drive',240,5);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(2,'Memory',120,6);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(3,'ZIP drive',150,4);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(4,'Floppy disk',5,6);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(5,'Monitor',240,1);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(6,'DVD drive',180,2);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(7,'CD drive',90,2);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(8,'Printer',270,3);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(9,'Toner cartridge',66,3);
INSERT INTO Products(Code,Name,Price,Manufacturer) VALUES(10,'DVD burner',180,2);
3/ select Name from Products;
4/ select Name , Price from Products;
5/ select Name from Products where Price>=200
6/ select * from Products where Price between 60 AND 120
7/ select Name , Price*100 from Products
8/ select avg(Price) from Products
9/ select avg(Price) from Products where manufacter=2
10/ select count(*) from Products where Pricec>=180
11/ select Name,Price from Products where Price>=180 ordred by Price desc , Name asc
12/ select * from Products p inner join Manufacturers m ON p.manufacturer=m.code
13/ select p.Name , m.Price , m.Name from Products p inner join Manufacturers m ON p.manufacturer=m.code
14/ select m.code , avg(Price) from Products p inner join Manufacturers m ON p.manufacturer=m.code group by manufacturer
15/ select m.Name, avg(Price) from Products p inner join Manufacturers m ON p.manufacturer=m.code group by manufacturer
16/ SELECT m.Name , AVG(Price) FROM products p INNER JOIN manufacturers m ON p.Manufacturer=m.Code
GROUP BY Manufacturer HAVING AVG(Price)>=150
17/ select Name , min(Price) from Products
18/ SELECT products.*, MAX(Price),manufacturers.Name FROM products INNER JOIN manufacturers
ON manufacturers.Code=products.Manufacturer GROUP BY Manufacturer
------ SELECT products.Name, products.Price,manufacturers.Name FROM products , manufacturers WHERE manufacturers.Code=products.Manufacturer
------ AND products.Price IN (SELECT MAX(Price) FROM products GROUP BY Manufacturer);
19/ insert into products values('loudspeakers',70,2)
20/ update Products set='laser Print' where code=8
21/ update Products set= Price-(Price*0,1)
22/ update Products set= Price-(Price*0,1) where Price>=120 |
use plats_journal
select A.annonsid, A.annonsrubrik, A.yrkesbenamning,A.yrkesbenamningId,Y.name, Y.yrkesgrupp,G.name,G.yrkesomrade,O.name from Annons A, Yrke Y, Yrkesgrupp G, Yrkesomrade O where A.yrkesbenamningid=Y.id and Y.yrkesgrupp=G.id and G.yrkesomrade=O.id;
|
WITH PHARMA_SALES_DATA AS(
SELECT
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."DATUM" AS "DATUM",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."M01AB" AS "M01AB",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."M01AE" AS "M01AE",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."N02BA" AS "N02BA",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."N02BE" AS "N02BE",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."N05B" AS "N05B",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."N05C" AS "N05C",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."R03" AS "R03",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."R06" AS "R06",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."YEAR" AS "YEAR",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."MONTH" AS "MONTH",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."HOUR" AS "HOUR",
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"."WEEKDAY_NAME" AS "WEEKDAY_NAME"
FROM
"snowflake"."SCHEMA_INFO"."SALESDAILY_S"
LIMIT
100
),
AVG_TBL AS (SELECT AVG("snowflake"."SCHEMA_INFO"."SALESDAILY_S"."M01AB") AS M01AB_AVG FROM "snowflake"."SCHEMA_INFO"."SALESDAILY_S")
SELECT PHARMA_SALES_DATA.DATUM AS "DATE", PHARMA_SALES_DATA."M01AB" AS "Acetic Acid Derivatives Sales", PHARMA_SALES_DATA."R06" AS "Antihistamines Sales"
FROM PHARMA_SALES_DATA, AVG_TBL
WHERE PHARMA_SALES_DATA."M01AB" > AVG_TBL.M01AB_AVG
ORDER BY PHARMA_SALES_DATA.DATUM |
delete from TASK_CALL_INFO where task_type='0000';
commit;
delete from TASK_CALL_INFO where task_type='0001';
commit;
delete from TASK_CALL_INFO where task_type='0002';
commit;
delete from TASK_CALL_INFO where task_type='0003';
commit;
delete from TASK_CALL_INFO;
commit;
delete from task_call_info_his;
commit;
insert into TASK_CALL_INFO values('0001','0001','0', SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0001','0001','0', SYS_GUID(),SYSDATE,'1','1', substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0001','0001','0', SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
commit;
insert into TASK_CALL_INFO values('0002','0002','0', SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0002','0002','0', SYS_GUID(),SYSDATE,'1','1', substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0002','0002','0', SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
commit;
insert into TASK_CALL_INFO values('0003','0003','0',SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0003','0003','0',SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
insert into TASK_CALL_INFO values('0003','0003','0',SYS_GUID(),SYSDATE,'1','1',substr( SYS_GUID(),0,16),'1','1','18612995529','18612995529','1','1','1','1','1','1','19-2月 -19 11.22.55.000000 上午',1,1);
commit;
select * from TASK_CALL_INFO for update;
select * from task_call_info_his;
MULBOR_BASE
select * from MULBOR_BASE where app_id = '190710A623P00031';
select * from MULBOR_RISK_ITEM where app_id = '190710A623P00031';
select ANTIFRAUD_C82D025AF778 from MULBOR_ANTIFRAUD_INDE where app_id = '190710A623P00031';
select * from MULBOR_BLACK_LIST where app_id = '190710A623P00031';
select * from MULBOR_DESCREDIT_COUNT where app_id = '190710A623P00031';
select * from MULBOR_GREY_LIST where app_id = '190710A623P00031';
select * from MULBOR_BASE order by crt_time desc;
select * from MULBOR_RISK_ITEM order by crt_time desc;
select * from MULBOR_ANTIFRAUD_INDE order by crt_time desc;
select * from MULBOR_BLACK_LIST order by crt_time desc;
select * from MULBOR_DESCREDIT_COUNT order by crt_time desc;
select * from MULBOR_GREY_LIST order by crt_time desc;
delete from MULBOR_GREY_LIST;
delete from MULBOR_DESCREDIT_COUNT;
delete from MULBOR_BLACK_LIST;
delete from MULBOR_ANTIFRAUD_INDE;
delete from MULBOR_RISK_ITEM;
delete from MULBOR_BASE;
commit;
select * from FICO_BIG_DATA_HUB;
delete from FICO_BIG_DATA_HUB;
select * from OPAS_SEA_AIR_DATA;
delete from OPAS_SEA_AIR_DATA;
delete from BAIRONG_ALS_BASE;
delete from BAIRONG_ALS_D7;
delete from BAIRONG_ALS_D15;
delete from BAIRONG_ALS_M1;
delete from BAIRONG_ALS_M3;
delete from BAIRONG_ALS_M6;
delete from BAIRONG_ALS_M12;
delete from BAIRONG_ALS_FST;
delete from BAIRONG_ALS_LST;
commit;
select count(*) from BAIRONG_ALS_BASE;
select * from BAIRONG_ALS_BASE where 1=1 order by crt_time desc;
select * from BAIRONG_ALS_BASE;
select * from BAIRONG_ALS_D7;
select * from BAIRONG_ALS_D15;
select * from BAIRONG_ALS_M1;
select * from BAIRONG_ALS_M3;
select * from BAIRONG_ALS_M6;
select * from BAIRONG_ALS_M12;
select * from BAIRONG_ALS_FST;
select * from BAIRONG_ALS_LST;
select count(*) from BAIRONG_ALS_BASE;
update TASK_CALL_STATUS set task_status = '0' where uuid ='3 ';
select task_status from TASK_CALL_STATUS order by crt_time desc where uuid ='3 ';
select * from TASK_CALL_STATUS order by crt_time desc for update;
select * from TASK_STATUS_HISTORY order by crt_time desc;
select count(1) from TASK_STATUS_HISTORY;
select * from task_call_worker for update;
insert into task_call_worker values('000202','外国人永久居留证信息核查服务','com.huaxia.cams.worker.WST000202TaskWorker','');
insert into task_call_worker values('F00202','外国人永久居留证信息核查服务附卡','com.huaxia.cams.worker.WSTF00202TaskWorker','');
-----------------------------------------------PAD人像---------------------------------------------
select * from NCIIC_XP_INFO
bairong_als_trn_batch_detail
PROC_TOOL_CLEAN_DTJD
PROC_TOOL_CLEAN_DTJD
select * from OPAS_PBOC_PERSONAL_INFO;
select * from V$NLS_PARAMETERS;
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000201','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','410221199505293452','刘伟','18612995529','1','1',0,0);
commit;
select * from task_call_status order by crt_time desc;
select * from BAIRONG_ALS_BASE where crt_user = 'CAMS' and crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from task_call_status where app_id = '1904019623P00012';
select * from task_status_history where app_id = '1904019623P00012' and task_type = '001101';
select * from task_status_history order by crt_time desc;
select * from POLICE_SIMPLIFY_INFO where INSTR(ERROR_MESSAGE,'库中无此号')>0 ;
select * from TRD_OPERATOR_ONLINE where 1=1 order by crt_time desc;
select to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,9999999999)),10,0) from dual;
select * from TRD_OPERATOR_ONLINE order by crt_time desc;
select count(*) from TRD_OPERATOR_ONLINE order by crt_time desc;
500407
select count(*) as coun from bairong_als_base where (CRT_TIME BETWEEN sysdate -1 AND sysdate)
select * from sys_user;
select * from opas_biz_inp_appl_c1 ;
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','610628198304020051','申龙','18777182225','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','132332197309133013','贾奉忱','13722866448','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','132323197303060013','段立亭','13930193601','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130626198001011855','万八','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','13018219870224572X','陈亚楠','15131185527','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130132198110245730','王志鹏','13315984245','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130626198001015291','反非','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130626197901016972','万十二','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','13062619800101057X','万六','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','360426197410101736','李广新','13979250908','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130626197901018791','万十二','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','532901199202072697','王慧宾','15287202804','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','330104198511284134','张敏','13732297900','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','362133198007170014','许海峰','15579706919','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','130626198501015676','王商品','13810519424','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','332623196806143610','屠昌新','13575865430','1','1',0,0);
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','610221197904286119','李长安','1886870851','1','1',0,0);
commit;
select * from task_call_status order by crt_time desc;
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000700','0',to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0),'01','511524199003037213','余碧波','18557546116','1','1',0,0);
--------------------------测试数量限制的sql语句-----------------------------------------to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,9999999999)),10,0)
----创建任务 test 测试外国人项目-----------------
declare
appid varchar2(200):= '';
i number;
begin
i:=0;
while i<1 loop
select to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0) into appid from dual;
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'000202','0',appid,'01','410221199505293452','刘伟','18612995524','1','1',0,0);
insert into opas_biz_inp_appl_c1(APP_ID,C1_BIRTH,C5_IDTE1) values(appid,trunc(sysdate),trunc(sysdate+1));
commit;
i:= i+1;
end loop;
end;
dbms_output.put_line(appid);
select * from task_call_status order by crt_time desc;
select * from task_status_history order by crt_time desc;
select APP_ID,C1_BIRTH,C5_IDTE1 from opas_biz_inp_appl_c1 order by crt_time desc;
declare
appid varchar2(200):= '';
i number;
begin
i:=0;
while i<1 loop
select to_char(sysdate,'yyyymmdd')||lpad(round(dbms_random.value(1,99999999)),8,0) into appid from dual;
insert into task_call_status values( sys_guid(),sysdate,sysdate,'liuwei', sys_guid(),'F00202','0',appid,'01','410221199505293452','刘伟','18612995524','1','1',0,0);
insert into opas_biz_inp_appl_c2(APP_ID,C2_BIRTH,C5_IDTE2) values(appid,trunc(sysdate),trunc(sysdate+1));
commit;
i:= i+1;
end loop;
end;
select * from task_call_status order by crt_time desc;
select * from task_status_history order by crt_time desc;
select APP_ID,C2_BIRTH,C5_IDTE2 from opas_biz_inp_appl_c2 order by crt_time desc;
select * from NCIIC_FOREIGNER_INFO order by crt_time desc;
--5
select count(*) from task_call_status t where t.TASK_type = '000202' and t.TASK_STATUS = '0';
update task_call_status t set TASK_STATUS='80' where t.TASK_type = 'F00202' and t.TASK_STATUS = '0';
select count(*) from NCIIC_FOREIGNER_INFO order by crt_time desc;
SELECT to_char(C1_BIRTH,'yyyymmdd') as birth,to_char(C5_IDTE1+1,'yyyymmdd') as EXPIRY_DATE FROM OPAS_BIZ_INP_APPL_C1 WHERE APP_ID = '2020061029253259' and ROWNUM = '1';
----------------------------------------------------------
insert into opas_biz_inp_appl_c1(APP_ID,C1_BIRTH,C5_IDTE1) values('2',trunc(sysdate),trunc(sysdate));
select trunc(sysdate) from dual;
select * from opas_biz_inp_appl_c1 order by crt_time desc;
--------人像比对-----------------------------------
select * from POLICE_XP_INFO order by crt_time desc;
--------人像表的数量:18----------------------------------
select * from POLICE_XP_INFO order by crt_time desc;
select count(*) from POLICE_XP_INFO order by crt_time desc;
------------------------------------------------------百融多头借贷-----------------------------------------------
select * from BAIRONG_ALS_BASE where crt_time between sysdate-1 and sysdate order by crt_time desc;
------------------------------------------------------同盾多头借贷-----------------------------------------------
select * from MULBOR_BASE where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_GREY_LIST where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_DESCREDIT_COUNT where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_BLACK_LIST where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_ANTIFRAUD_INDE where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_RISK_ITEM where crt_time between sysdate-1 and sysdate order by crt_time desc;
select * from MULBOR_BASE where crt_time between sysdate-1 and sysdate order by crt_time desc;
-------------------------------------查询异常--------------------------------
select * from task_call_status where task_status='0' order by crt_time desc;
------------------------------------------------------再网时长-----------------------------------------------
select * from TRD_OPERATOR_ONLINE where 1=1 order by crt_time desc;
POLICE_SIMPLIFY_INFO
NCIIC_FOREIGNER_INFO
alter table NCIIC_FOREIGNER_INFO add (CARD_FLAG CHAR(1) default '0');
alter table NCIIC_FOREIGNER_INFO add (CERT_TYPE VARCHAR2(2));
comment on column NCIIC_FOREIGNER_INFO.CERT_TYPE
is '证件类型,07外国人永久居留身份证,90港澳居民身份证,91台湾居民居住证';
comment on column NCIIC_FOREIGNER_INFO.CARD_FLAG
is '主卡副卡区分标志,0主卡,1副卡';
SELECT to_char(C2_BIRTH,'yyyymmdd'),to_char(C5_IDTE2,'yyyymmdd') FROM OPAS_BIZ_INP_APPL_C2 WHERE APP_ID = #{appId, jdbcType=CHAR} and ROWNUM = '1'
|
/**
* @name importFields
* @public
*/
Select *
From impexceltablefields t
Where :impFileType = t.impfile
Order by t.cellnumber |
--Returns summary information about missing index groups, for example, the performance improvements that could be gained by implementing a specific group of missing indexes.
select *
from sys.dm_db_missing_index_group_stats
--Returns detailed information about a missing index; for example, it returns the name and identifier of the table where the index is missing, and the columns and column types that should make up the missing index.
select *
from sys.dm_db_missing_index_details
--Returns information about the database table columns that are missing an index.
select *
from sys.dm_db_missing_index_columns(316) |
--Problem 04
SELECT TOP (5)
e.EmployeeID
,e.FirstName
,e.Salary
,d.[Name]
FROM Employees AS e
JOIN Departments AS d ON e.DepartmentID=d.DepartmentID
WHERE e.Salary>15000
ORDER BY d.DepartmentID ASC
|
drop table if exists t_board;
create table t_board (
bno int unsigned not null auto_increment primary key,
title varchar(200) not null,
content text null,
writer varchar(50) not null,
regdate timestamp not null default now(),
upddate timestamp not null default now() on update now(),
viewcnt int default 0
);
insert into t_board (title, content, writer)
values ('test title', 'test content', 'tester');
insert into t_board (title, content, writer)
values ('test title2', 'test content2', 'tester2');
insert into t_board (title, content, writer)
values ('테스트 제목', '테스트 내용', '테스트 작가');
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
(select title, content, writer from t_board);
insert into t_board (title, content, writer)
values ('test title', 'test content', 'ahram1'); |
CREATE TABLE ABS (x INT);
-- error 42601: syntax error: near "ABS"
CREATE TABLE ACOS (x INT);
-- error 42601: syntax error: near "ACOS"
CREATE TABLE ALL (x INT);
-- error 42601: syntax error: near "ALL"
CREATE TABLE ALLOCATE (x INT);
-- error 42601: syntax error: near "ALLOCATE"
CREATE TABLE ALTER (x INT);
-- error 42601: syntax error: near "ALTER"
CREATE TABLE AND (x INT);
-- error 42601: syntax error: near "AND"
CREATE TABLE ANY (x INT);
-- error 42601: syntax error: near "ANY"
CREATE TABLE ARE (x INT);
-- error 42601: syntax error: near "ARE"
CREATE TABLE ARRAY (x INT);
-- error 42601: syntax error: near "ARRAY"
CREATE TABLE ARRAY_AGG (x INT);
-- error 42601: syntax error: near "ARRAY_AGG"
CREATE TABLE ARRAY_MAX_CARDINALITY (x INT);
-- error 42601: syntax error: near "ARRAY_MAX_CARDINALITY"
CREATE TABLE AS (x INT);
-- error 42601: syntax error: near "AS"
CREATE TABLE ASENSITIVE (x INT);
-- error 42601: syntax error: near "ASENSITIVE"
CREATE TABLE ASIN (x INT);
-- error 42601: syntax error: near "ASIN"
CREATE TABLE ASYMMETRIC (x INT);
-- error 42601: syntax error: near "ASYMMETRIC"
CREATE TABLE AT (x INT);
-- error 42601: syntax error: near "AT"
CREATE TABLE ATAN (x INT);
-- error 42601: syntax error: near "ATAN"
CREATE TABLE ATOMIC (x INT);
-- error 42601: syntax error: near "ATOMIC"
CREATE TABLE AUTHORIZATION (x INT);
-- error 42601: syntax error: near "AUTHORIZATION"
CREATE TABLE AVG (x INT);
-- error 42601: syntax error: near "AVG"
CREATE TABLE BEGIN (x INT);
-- error 42601: syntax error: near "BEGIN"
CREATE TABLE BEGIN_FRAME (x INT);
-- error 42601: syntax error: near "BEGIN_FRAME"
CREATE TABLE BEGIN_PARTITION (x INT);
-- error 42601: syntax error: near "BEGIN_PARTITION"
CREATE TABLE BETWEEN (x INT);
-- error 42601: syntax error: near "BETWEEN"
CREATE TABLE BIGINT (x INT);
-- error 42601: syntax error: near "BIGINT"
CREATE TABLE BINARY (x INT);
-- error 42601: syntax error: near "BINARY"
CREATE TABLE BLOB (x INT);
-- error 42601: syntax error: near "BLOB"
CREATE TABLE BOOLEAN (x INT);
-- error 42601: syntax error: near "BOOLEAN"
CREATE TABLE BOTH (x INT);
-- error 42601: syntax error: near "BOTH"
CREATE TABLE BY (x INT);
-- error 42601: syntax error: near "BY"
CREATE TABLE CALL (x INT);
-- error 42601: syntax error: near "CALL"
CREATE TABLE CALLED (x INT);
-- error 42601: syntax error: near "CALLED"
CREATE TABLE CARDINALITY (x INT);
-- error 42601: syntax error: near "CARDINALITY"
CREATE TABLE CASCADED (x INT);
-- error 42601: syntax error: near "CASCADED"
CREATE TABLE CASE (x INT);
-- error 42601: syntax error: near "CASE"
CREATE TABLE CAST (x INT);
-- error 42601: syntax error: near "CAST"
CREATE TABLE CEIL (x INT);
-- error 42601: syntax error: near "CEIL"
CREATE TABLE CEILING (x INT);
-- error 42601: syntax error: near "CEILING"
CREATE TABLE CHAR (x INT);
-- error 42601: syntax error: near "CHAR"
CREATE TABLE CHAR_LENGTH (x INT);
-- error 42601: syntax error: near "CHAR_LENGTH"
CREATE TABLE CHARACTER (x INT);
-- error 42601: syntax error: near "CHARACTER"
CREATE TABLE CHARACTER_LENGTH (x INT);
-- error 42601: syntax error: near "CHARACTER_LENGTH"
CREATE TABLE CHECK (x INT);
-- error 42601: syntax error: near "CHECK"
CREATE TABLE CLASSIFIER (x INT);
-- error 42601: syntax error: near "CLASSIFIER"
CREATE TABLE CLOB (x INT);
-- error 42601: syntax error: near "CLOB"
CREATE TABLE CLOSE (x INT);
-- error 42601: syntax error: near "CLOSE"
CREATE TABLE COALESCE (x INT);
-- error 42601: syntax error: near "COALESCE"
CREATE TABLE COLLATE (x INT);
-- error 42601: syntax error: near "COLLATE"
CREATE TABLE COLLECT (x INT);
-- error 42601: syntax error: near "COLLECT"
CREATE TABLE COLUMN (x INT);
-- error 42601: syntax error: near "COLUMN"
CREATE TABLE COMMIT (x INT);
-- error 42601: syntax error: near "COMMIT"
CREATE TABLE CONDITION (x INT);
-- error 42601: syntax error: near "CONDITION"
CREATE TABLE CONNECT (x INT);
-- error 42601: syntax error: near "CONNECT"
CREATE TABLE CONSTRAINT (x INT);
-- error 42601: syntax error: near "CONSTRAINT"
CREATE TABLE CONTAINS (x INT);
-- error 42601: syntax error: near "CONTAINS"
CREATE TABLE CONVERT (x INT);
-- error 42601: syntax error: near "CONVERT"
CREATE TABLE COPY (x INT);
-- error 42601: syntax error: near "COPY"
CREATE TABLE CORR (x INT);
-- error 42601: syntax error: near "CORR"
CREATE TABLE CORRESPONDING (x INT);
-- error 42601: syntax error: near "CORRESPONDING"
CREATE TABLE COS (x INT);
-- error 42601: syntax error: near "COS"
CREATE TABLE COSH (x INT);
-- error 42601: syntax error: near "COSH"
CREATE TABLE COUNT (x INT);
-- error 42601: syntax error: near "COUNT"
CREATE TABLE COVAR_POP (x INT);
-- error 42601: syntax error: near "COVAR_POP"
CREATE TABLE COVAR_SAMP (x INT);
-- error 42601: syntax error: near "COVAR_SAMP"
CREATE TABLE CREATE (x INT);
-- error 42601: syntax error: near "CREATE"
CREATE TABLE CROSS (x INT);
-- error 42601: syntax error: near "CROSS"
CREATE TABLE CUBE (x INT);
-- error 42601: syntax error: near "CUBE"
CREATE TABLE CUME_DIST (x INT);
-- error 42601: syntax error: near "CUME_DIST"
CREATE TABLE CURRENT (x INT);
-- error 42601: syntax error: near "CURRENT"
CREATE TABLE CURRENT_CATALOG (x INT);
-- error 42601: syntax error: near "CURRENT_CATALOG"
CREATE TABLE CURRENT_DATE (x INT);
-- error 42601: syntax error: near "CURRENT_DATE"
CREATE TABLE CURRENT_DEFAULT_TRANSFORM_GROUP (x INT);
-- error 42601: syntax error: near "CURRENT_DEFAULT_TRANSFORM_GROUP"
CREATE TABLE CURRENT_PATH (x INT);
-- error 42601: syntax error: near "CURRENT_PATH"
CREATE TABLE CURRENT_ROLE (x INT);
-- error 42601: syntax error: near "CURRENT_ROLE"
CREATE TABLE CURRENT_ROW (x INT);
-- error 42601: syntax error: near "CURRENT_ROW"
CREATE TABLE CURRENT_SCHEMA (x INT);
-- error 42601: syntax error: near "CURRENT_SCHEMA"
CREATE TABLE CURRENT_TIME (x INT);
-- error 42601: syntax error: near "CURRENT_TIME"
CREATE TABLE CURRENT_TIMESTAMP (x INT);
-- error 42601: syntax error: near "CURRENT_TIMESTAMP"
CREATE TABLE CURRENT_PATH (x INT);
-- error 42601: syntax error: near "CURRENT_PATH"
CREATE TABLE CURRENT_ROLE (x INT);
-- error 42601: syntax error: near "CURRENT_ROLE"
CREATE TABLE CURRENT_TRANSFORM_GROUP_FOR_TYPE (x INT);
-- error 42601: syntax error: near "CURRENT_TRANSFORM_GROUP_FOR_TYPE"
CREATE TABLE CURRENT_USER (x INT);
-- error 42601: syntax error: near "CURRENT_USER"
CREATE TABLE CURSOR (x INT);
-- error 42601: syntax error: near "CURSOR"
CREATE TABLE CYCLE (x INT);
-- error 42601: syntax error: near "CYCLE"
CREATE TABLE DATE (x INT);
-- error 42601: syntax error: near "DATE"
CREATE TABLE DAY (x INT);
-- error 42601: syntax error: near "DAY"
CREATE TABLE DEALLOCATE (x INT);
-- error 42601: syntax error: near "DEALLOCATE"
CREATE TABLE DEC (x INT);
-- error 42601: syntax error: near "DEC"
CREATE TABLE DECIMAL (x INT);
-- error 42601: syntax error: near "DECIMAL"
CREATE TABLE DECFLOAT (x INT);
-- error 42601: syntax error: near "DECFLOAT"
CREATE TABLE DECLARE (x INT);
-- error 42601: syntax error: near "DECLARE"
CREATE TABLE DEFAULT (x INT);
-- error 42601: syntax error: near "DEFAULT"
CREATE TABLE DEFINE (x INT);
-- error 42601: syntax error: near "DEFINE"
CREATE TABLE DELETE (x INT);
-- error 42601: syntax error: near "DELETE"
CREATE TABLE DENSE_RANK (x INT);
-- error 42601: syntax error: near "DENSE_RANK"
CREATE TABLE DEREF (x INT);
-- error 42601: syntax error: near "DEREF"
CREATE TABLE DESCRIBE (x INT);
-- error 42601: syntax error: near "DESCRIBE"
CREATE TABLE DETERMINISTIC (x INT);
-- error 42601: syntax error: near "DETERMINISTIC"
CREATE TABLE DISCONNECT (x INT);
-- error 42601: syntax error: near "DISCONNECT"
CREATE TABLE DISTINCT (x INT);
-- error 42601: syntax error: near "DISTINCT"
CREATE TABLE DOUBLE (x INT);
-- error 42601: syntax error: near "DOUBLE"
CREATE TABLE DROP (x INT);
-- error 42601: syntax error: near "DROP"
CREATE TABLE DYNAMIC (x INT);
-- error 42601: syntax error: near "DYNAMIC"
CREATE TABLE EACH (x INT);
-- error 42601: syntax error: near "EACH"
CREATE TABLE ELEMENT (x INT);
-- error 42601: syntax error: near "ELEMENT"
CREATE TABLE ELSE (x INT);
-- error 42601: syntax error: near "ELSE"
CREATE TABLE EMPTY (x INT);
-- error 42601: syntax error: near "EMPTY"
CREATE TABLE END (x INT);
-- error 42601: syntax error: near "END"
CREATE TABLE END_FRAME (x INT);
-- error 42601: syntax error: near "END_FRAME"
CREATE TABLE END_PARTITION (x INT);
-- error 42601: syntax error: near "END_PARTITION"
CREATE TABLE END-EXEC (x INT);
-- error 42601: syntax error: near "END"
CREATE TABLE EQUALS (x INT);
-- error 42601: syntax error: near "EQUALS"
CREATE TABLE ESCAPE (x INT);
-- error 42601: syntax error: near "ESCAPE"
CREATE TABLE EVERY (x INT);
-- error 42601: syntax error: near "EVERY"
CREATE TABLE EXCEPT (x INT);
-- error 42601: syntax error: near "EXCEPT"
CREATE TABLE EXEC (x INT);
-- error 42601: syntax error: near "EXEC"
CREATE TABLE EXECUTE (x INT);
-- error 42601: syntax error: near "EXECUTE"
CREATE TABLE EXISTS (x INT);
-- error 42601: syntax error: near "EXISTS"
CREATE TABLE EXP (x INT);
-- error 42601: syntax error: near "EXP"
CREATE TABLE EXTERNAL (x INT);
-- error 42601: syntax error: near "EXTERNAL"
CREATE TABLE EXTRACT (x INT);
-- error 42601: syntax error: near "EXTRACT"
CREATE TABLE FALSE (x INT);
-- error 42601: syntax error: near "FALSE"
CREATE TABLE FETCH (x INT);
-- error 42601: syntax error: near "FETCH"
CREATE TABLE FILTER (x INT);
-- error 42601: syntax error: near "FILTER"
CREATE TABLE FIRST_VALUE (x INT);
-- error 42601: syntax error: near "FIRST_VALUE"
CREATE TABLE FLOAT (x INT);
-- error 42601: syntax error: near "FLOAT"
CREATE TABLE FLOOR (x INT);
-- error 42601: syntax error: near "FLOOR"
CREATE TABLE FOR (x INT);
-- error 42601: syntax error: near "FOR"
CREATE TABLE FOREIGN (x INT);
-- error 42601: syntax error: near "FOREIGN"
CREATE TABLE FRAME_ROW (x INT);
-- error 42601: syntax error: near "FRAME_ROW"
CREATE TABLE FREE (x INT);
-- error 42601: syntax error: near "FREE"
CREATE TABLE FROM (x INT);
-- error 42601: syntax error: near "FROM"
CREATE TABLE FULL (x INT);
-- error 42601: syntax error: near "FULL"
CREATE TABLE FUNCTION (x INT);
-- error 42601: syntax error: near "FUNCTION"
CREATE TABLE FUSION (x INT);
-- error 42601: syntax error: near "FUSION"
CREATE TABLE GET (x INT);
-- error 42601: syntax error: near "GET"
CREATE TABLE GLOBAL (x INT);
-- error 42601: syntax error: near "GLOBAL"
CREATE TABLE GRANT (x INT);
-- error 42601: syntax error: near "GRANT"
CREATE TABLE GROUP (x INT);
-- error 42601: syntax error: near "GROUP"
CREATE TABLE GROUPING (x INT);
-- error 42601: syntax error: near "GROUPING"
CREATE TABLE GROUPS (x INT);
-- error 42601: syntax error: near "GROUPS"
CREATE TABLE HAVING (x INT);
-- error 42601: syntax error: near "HAVING"
CREATE TABLE HOLD (x INT);
-- error 42601: syntax error: near "HOLD"
CREATE TABLE HOUR (x INT);
-- error 42601: syntax error: near "HOUR"
CREATE TABLE IDENTITY (x INT);
-- error 42601: syntax error: near "IDENTITY"
CREATE TABLE IN (x INT);
-- error 42601: syntax error: near "IN"
CREATE TABLE INDICATOR (x INT);
-- error 42601: syntax error: near "INDICATOR"
CREATE TABLE INITIAL (x INT);
-- error 42601: syntax error: near "INITIAL"
CREATE TABLE INNER (x INT);
-- error 42601: syntax error: near "INNER"
CREATE TABLE INOUT (x INT);
-- error 42601: syntax error: near "INOUT"
CREATE TABLE INSENSITIVE (x INT);
-- error 42601: syntax error: near "INSENSITIVE"
CREATE TABLE INSERT (x INT);
-- error 42601: syntax error: near "INSERT"
CREATE TABLE INT (x INT);
-- error 42601: syntax error: near "INT"
CREATE TABLE INTEGER (x INT);
-- error 42601: syntax error: near "INTEGER"
CREATE TABLE INTERSECT (x INT);
-- error 42601: syntax error: near "INTERSECT"
CREATE TABLE INTERSECTION (x INT);
-- error 42601: syntax error: near "INTERSECTION"
CREATE TABLE INTERVAL (x INT);
-- error 42601: syntax error: near "INTERVAL"
CREATE TABLE INTO (x INT);
-- error 42601: syntax error: near "INTO"
CREATE TABLE IS (x INT);
-- error 42601: syntax error: near "IS"
CREATE TABLE JOIN (x INT);
-- error 42601: syntax error: near "JOIN"
CREATE TABLE JSON_ARRAY (x INT);
-- error 42601: syntax error: near "JSON_ARRAY"
CREATE TABLE JSON_ARRAYAGG (x INT);
-- error 42601: syntax error: near "JSON_ARRAYAGG"
CREATE TABLE JSON_EXISTS (x INT);
-- error 42601: syntax error: near "JSON_EXISTS"
CREATE TABLE JSON_OBJECT (x INT);
-- error 42601: syntax error: near "JSON_OBJECT"
CREATE TABLE JSON_OBJECTAGG (x INT);
-- error 42601: syntax error: near "JSON_OBJECTAGG"
CREATE TABLE JSON_QUERY (x INT);
-- error 42601: syntax error: near "JSON_QUERY"
CREATE TABLE JSON_TABLE (x INT);
-- error 42601: syntax error: near "JSON_TABLE"
CREATE TABLE JSON_TABLE_PRIMITIVE (x INT);
-- error 42601: syntax error: near "JSON_TABLE_PRIMITIVE"
CREATE TABLE JSON_VALUE (x INT);
-- error 42601: syntax error: near "JSON_VALUE"
CREATE TABLE LAG (x INT);
-- error 42601: syntax error: near "LAG"
CREATE TABLE LANGUAGE (x INT);
-- error 42601: syntax error: near "LANGUAGE"
CREATE TABLE LARGE (x INT);
-- error 42601: syntax error: near "LARGE"
CREATE TABLE LAST_VALUE (x INT);
-- error 42601: syntax error: near "LAST_VALUE"
CREATE TABLE LATERAL (x INT);
-- error 42601: syntax error: near "LATERAL"
CREATE TABLE LEAD (x INT);
-- error 42601: syntax error: near "LEAD"
CREATE TABLE LEADING (x INT);
-- error 42601: syntax error: near "LEADING"
CREATE TABLE LEFT (x INT);
-- error 42601: syntax error: near "LEFT"
CREATE TABLE LIKE (x INT);
-- error 42601: syntax error: near "LIKE"
CREATE TABLE LIKE_REGEX (x INT);
-- error 42601: syntax error: near "LIKE_REGEX"
CREATE TABLE LISTAGG (x INT);
-- error 42601: syntax error: near "LISTAGG"
CREATE TABLE LN (x INT);
-- error 42601: syntax error: near "LN"
CREATE TABLE LOCAL (x INT);
-- error 42601: syntax error: near "LOCAL"
CREATE TABLE LOCALTIME (x INT);
-- error 42601: syntax error: near "LOCALTIME"
CREATE TABLE LOCALTIMESTAMP (x INT);
-- error 42601: syntax error: near "LOCALTIMESTAMP"
CREATE TABLE LOG (x INT);
-- error 42601: syntax error: near "LOG"
CREATE TABLE LOG10 (x INT);
-- error 42601: syntax error: near "LOG10"
CREATE TABLE LOWER (x INT);
-- error 42601: syntax error: near "LOWER"
CREATE TABLE MATCH (x INT);
-- error 42601: syntax error: near "MATCH"
CREATE TABLE MATCH_NUMBER (x INT);
-- error 42601: syntax error: near "MATCH_NUMBER"
CREATE TABLE MATCH_RECOGNIZE (x INT);
-- error 42601: syntax error: near "MATCH_RECOGNIZE"
CREATE TABLE MATCHES (x INT);
-- error 42601: syntax error: near "MATCHES"
CREATE TABLE MAX (x INT);
-- error 42601: syntax error: near "MAX"
CREATE TABLE MEMBER (x INT);
-- error 42601: syntax error: near "MEMBER"
CREATE TABLE MERGE (x INT);
-- error 42601: syntax error: near "MERGE"
CREATE TABLE METHOD (x INT);
-- error 42601: syntax error: near "METHOD"
CREATE TABLE MIN (x INT);
-- error 42601: syntax error: near "MIN"
CREATE TABLE MINUTE (x INT);
-- error 42601: syntax error: near "MINUTE"
CREATE TABLE MOD (x INT);
-- error 42601: syntax error: near "MOD"
CREATE TABLE MODIFIES (x INT);
-- error 42601: syntax error: near "MODIFIES"
CREATE TABLE MODULE (x INT);
-- error 42601: syntax error: near "MODULE"
CREATE TABLE MONTH (x INT);
-- error 42601: syntax error: near "MONTH"
CREATE TABLE MULTISET (x INT);
-- error 42601: syntax error: near "MULTISET"
CREATE TABLE NATIONAL (x INT);
-- error 42601: syntax error: near "NATIONAL"
CREATE TABLE NATURAL (x INT);
-- error 42601: syntax error: near "NATURAL"
CREATE TABLE NCHAR (x INT);
-- error 42601: syntax error: near "NCHAR"
CREATE TABLE NCLOB (x INT);
-- error 42601: syntax error: near "NCLOB"
CREATE TABLE NEW (x INT);
-- error 42601: syntax error: near "NEW"
CREATE TABLE NO (x INT);
-- error 42601: syntax error: near "NO"
CREATE TABLE NONE (x INT);
-- error 42601: syntax error: near "NONE"
CREATE TABLE NORMALIZE (x INT);
-- error 42601: syntax error: near "NORMALIZE"
CREATE TABLE NOT (x INT);
-- error 42601: syntax error: near "NOT"
CREATE TABLE NTH_VALUE (x INT);
-- error 42601: syntax error: near "NTH_VALUE"
CREATE TABLE NTILE (x INT);
-- error 42601: syntax error: near "NTILE"
CREATE TABLE NULL (x INT);
-- error 42601: syntax error: near "NULL"
CREATE TABLE NULLIF (x INT);
-- error 42601: syntax error: near "NULLIF"
CREATE TABLE NUMERIC (x INT);
-- error 42601: syntax error: near "NUMERIC"
CREATE TABLE OCTET_LENGTH (x INT);
-- error 42601: syntax error: near "OCTET_LENGTH"
CREATE TABLE OCCURRENCES_REGEX (x INT);
-- error 42601: syntax error: near "OCCURRENCES_REGEX"
CREATE TABLE OF (x INT);
-- error 42601: syntax error: near "OF"
CREATE TABLE OFFSET (x INT);
-- error 42601: syntax error: near "OFFSET"
CREATE TABLE OLD (x INT);
-- error 42601: syntax error: near "OLD"
CREATE TABLE OMIT (x INT);
-- error 42601: syntax error: near "OMIT"
CREATE TABLE ON (x INT);
-- error 42601: syntax error: near "ON"
CREATE TABLE ONE (x INT);
-- error 42601: syntax error: near "ONE"
CREATE TABLE ONLY (x INT);
-- error 42601: syntax error: near "ONLY"
CREATE TABLE OPEN (x INT);
-- error 42601: syntax error: near "OPEN"
CREATE TABLE OR (x INT);
-- error 42601: syntax error: near "OR"
CREATE TABLE ORDER (x INT);
-- error 42601: syntax error: near "ORDER"
CREATE TABLE OUT (x INT);
-- error 42601: syntax error: near "OUT"
CREATE TABLE OUTER (x INT);
-- error 42601: syntax error: near "OUTER"
CREATE TABLE OVER (x INT);
-- error 42601: syntax error: near "OVER"
CREATE TABLE OVERLAPS (x INT);
-- error 42601: syntax error: near "OVERLAPS"
CREATE TABLE OVERLAY (x INT);
-- error 42601: syntax error: near "OVERLAY"
CREATE TABLE PARAMETER (x INT);
-- error 42601: syntax error: near "PARAMETER"
CREATE TABLE PARTITION (x INT);
-- error 42601: syntax error: near "PARTITION"
CREATE TABLE PATTERN (x INT);
-- error 42601: syntax error: near "PATTERN"
CREATE TABLE PER (x INT);
-- error 42601: syntax error: near "PER"
CREATE TABLE PERCENT (x INT);
-- error 42601: syntax error: near "PERCENT"
CREATE TABLE PERCENT_RANK (x INT);
-- error 42601: syntax error: near "PERCENT_RANK"
CREATE TABLE PERCENTILE_CONT (x INT);
-- error 42601: syntax error: near "PERCENTILE_CONT"
CREATE TABLE PERCENTILE_DISC (x INT);
-- error 42601: syntax error: near "PERCENTILE_DISC"
CREATE TABLE PERIOD (x INT);
-- error 42601: syntax error: near "PERIOD"
CREATE TABLE PORTION (x INT);
-- error 42601: syntax error: near "PORTION"
CREATE TABLE POSITION (x INT);
-- error 42601: syntax error: near "POSITION"
CREATE TABLE POSITION_REGEX (x INT);
-- error 42601: syntax error: near "POSITION_REGEX"
CREATE TABLE POWER (x INT);
-- error 42601: syntax error: near "POWER"
CREATE TABLE PRECEDES (x INT);
-- error 42601: syntax error: near "PRECEDES"
CREATE TABLE PRECISION (x INT);
-- error 42601: syntax error: near "PRECISION"
CREATE TABLE PREPARE (x INT);
-- error 42601: syntax error: near "PREPARE"
CREATE TABLE PRIMARY (x INT);
-- error 42601: syntax error: near "PRIMARY"
CREATE TABLE PROCEDURE (x INT);
-- error 42601: syntax error: near "PROCEDURE"
CREATE TABLE PTF (x INT);
-- error 42601: syntax error: near "PTF"
CREATE TABLE RANGE (x INT);
-- error 42601: syntax error: near "RANGE"
CREATE TABLE RANK (x INT);
-- error 42601: syntax error: near "RANK"
CREATE TABLE READS (x INT);
-- error 42601: syntax error: near "READS"
CREATE TABLE REAL (x INT);
-- error 42601: syntax error: near "REAL"
CREATE TABLE RECURSIVE (x INT);
-- error 42601: syntax error: near "RECURSIVE"
CREATE TABLE REF (x INT);
-- error 42601: syntax error: near "REF"
CREATE TABLE REFERENCES (x INT);
-- error 42601: syntax error: near "REFERENCES"
CREATE TABLE REFERENCING (x INT);
-- error 42601: syntax error: near "REFERENCING"
CREATE TABLE REGR_AVGX (x INT);
-- error 42601: syntax error: near "REGR_AVGX"
CREATE TABLE REGR_AVGY (x INT);
-- error 42601: syntax error: near "REGR_AVGY"
CREATE TABLE REGR_COUNT (x INT);
-- error 42601: syntax error: near "REGR_COUNT"
CREATE TABLE REGR_INTERCEPT (x INT);
-- error 42601: syntax error: near "REGR_INTERCEPT"
CREATE TABLE REGR_R2 (x INT);
-- error 42601: syntax error: near "REGR_R2"
CREATE TABLE REGR_SLOPE (x INT);
-- error 42601: syntax error: near "REGR_SLOPE"
CREATE TABLE REGR_SXX (x INT);
-- error 42601: syntax error: near "REGR_SXX"
CREATE TABLE REGR_SXY (x INT);
-- error 42601: syntax error: near "REGR_SXY"
CREATE TABLE REGR_SYY (x INT);
-- error 42601: syntax error: near "REGR_SYY"
CREATE TABLE RELEASE (x INT);
-- error 42601: syntax error: near "RELEASE"
CREATE TABLE RESULT (x INT);
-- error 42601: syntax error: near "RESULT"
CREATE TABLE RETURN (x INT);
-- error 42601: syntax error: near "RETURN"
CREATE TABLE RETURNS (x INT);
-- error 42601: syntax error: near "RETURNS"
CREATE TABLE REVOKE (x INT);
-- error 42601: syntax error: near "REVOKE"
CREATE TABLE RIGHT (x INT);
-- error 42601: syntax error: near "RIGHT"
CREATE TABLE ROLLBACK (x INT);
-- error 42601: syntax error: near "ROLLBACK"
CREATE TABLE ROLLUP (x INT);
-- error 42601: syntax error: near "ROLLUP"
CREATE TABLE ROW (x INT);
-- error 42601: syntax error: near "ROW"
CREATE TABLE ROW_NUMBER (x INT);
-- error 42601: syntax error: near "ROW_NUMBER"
CREATE TABLE ROWS (x INT);
-- error 42601: syntax error: near "ROWS"
CREATE TABLE RUNNING (x INT);
-- error 42601: syntax error: near "RUNNING"
CREATE TABLE SAVEPOINT (x INT);
-- error 42601: syntax error: near "SAVEPOINT"
CREATE TABLE SCOPE (x INT);
-- error 42601: syntax error: near "SCOPE"
CREATE TABLE SCROLL (x INT);
-- error 42601: syntax error: near "SCROLL"
CREATE TABLE SEARCH (x INT);
-- error 42601: syntax error: near "SEARCH"
CREATE TABLE SECOND (x INT);
-- error 42601: syntax error: near "SECOND"
CREATE TABLE SEEK (x INT);
-- error 42601: syntax error: near "SEEK"
CREATE TABLE SELECT (x INT);
-- error 42601: syntax error: near "SELECT"
CREATE TABLE SENSITIVE (x INT);
-- error 42601: syntax error: near "SENSITIVE"
CREATE TABLE SESSION_USER (x INT);
-- error 42601: syntax error: near "SESSION_USER"
CREATE TABLE SET (x INT);
-- error 42601: syntax error: near "SET"
CREATE TABLE SHOW (x INT);
-- error 42601: syntax error: near "SHOW"
CREATE TABLE SIMILAR (x INT);
-- error 42601: syntax error: near "SIMILAR"
CREATE TABLE SIN (x INT);
-- error 42601: syntax error: near "SIN"
CREATE TABLE SINH (x INT);
-- error 42601: syntax error: near "SINH"
CREATE TABLE SKIP (x INT);
-- error 42601: syntax error: near "SKIP"
CREATE TABLE SMALLINT (x INT);
-- error 42601: syntax error: near "SMALLINT"
CREATE TABLE SOME (x INT);
-- error 42601: syntax error: near "SOME"
CREATE TABLE SPECIFIC (x INT);
-- error 42601: syntax error: near "SPECIFIC"
CREATE TABLE SPECIFICTYPE (x INT);
-- error 42601: syntax error: near "SPECIFICTYPE"
CREATE TABLE SQL (x INT);
-- error 42601: syntax error: near "SQL"
CREATE TABLE SQLEXCEPTION (x INT);
-- error 42601: syntax error: near "SQLEXCEPTION"
CREATE TABLE SQLSTATE (x INT);
-- error 42601: syntax error: near "SQLSTATE"
CREATE TABLE SQLWARNING (x INT);
-- error 42601: syntax error: near "SQLWARNING"
CREATE TABLE SQRT (x INT);
-- error 42601: syntax error: near "SQRT"
CREATE TABLE START (x INT);
-- error 42601: syntax error: near "START"
CREATE TABLE STATIC (x INT);
-- error 42601: syntax error: near "STATIC"
CREATE TABLE STDDEV_POP (x INT);
-- error 42601: syntax error: near "STDDEV_POP"
CREATE TABLE STDDEV_SAMP (x INT);
-- error 42601: syntax error: near "STDDEV_SAMP"
CREATE TABLE SUBMULTISET (x INT);
-- error 42601: syntax error: near "SUBMULTISET"
CREATE TABLE SUBSET (x INT);
-- error 42601: syntax error: near "SUBSET"
CREATE TABLE SUBSTRING (x INT);
-- error 42601: syntax error: near "SUBSTRING"
CREATE TABLE SUBSTRING_REGEX (x INT);
-- error 42601: syntax error: near "SUBSTRING_REGEX"
CREATE TABLE SUCCEEDS (x INT);
-- error 42601: syntax error: near "SUCCEEDS"
CREATE TABLE SUM (x INT);
-- error 42601: syntax error: near "SUM"
CREATE TABLE SYMMETRIC (x INT);
-- error 42601: syntax error: near "SYMMETRIC"
CREATE TABLE SYSTEM (x INT);
-- error 42601: syntax error: near "SYSTEM"
CREATE TABLE SYSTEM_TIME (x INT);
-- error 42601: syntax error: near "SYSTEM_TIME"
CREATE TABLE SYSTEM_USER (x INT);
-- error 42601: syntax error: near "SYSTEM_USER"
CREATE TABLE TABLE (x INT);
-- error 42601: syntax error: near "TABLE"
CREATE TABLE TABLESAMPLE (x INT);
-- error 42601: syntax error: near "TABLESAMPLE"
CREATE TABLE TAN (x INT);
-- error 42601: syntax error: near "TAN"
CREATE TABLE TANH (x INT);
-- error 42601: syntax error: near "TANH"
CREATE TABLE THEN (x INT);
-- error 42601: syntax error: near "THEN"
CREATE TABLE TIME (x INT);
-- error 42601: syntax error: near "TIME"
CREATE TABLE TIMESTAMP (x INT);
-- error 42601: syntax error: near "TIMESTAMP"
CREATE TABLE TIMEZONE_HOUR (x INT);
-- error 42601: syntax error: near "TIMEZONE_HOUR"
CREATE TABLE TIMEZONE_MINUTE (x INT);
-- error 42601: syntax error: near "TIMEZONE_MINUTE"
CREATE TABLE TO (x INT);
-- error 42601: syntax error: near "TO"
CREATE TABLE TRAILING (x INT);
-- error 42601: syntax error: near "TRAILING"
CREATE TABLE TRANSLATE (x INT);
-- error 42601: syntax error: near "TRANSLATE"
CREATE TABLE TRANSLATE_REGEX (x INT);
-- error 42601: syntax error: near "TRANSLATE_REGEX"
CREATE TABLE TRANSLATION (x INT);
-- error 42601: syntax error: near "TRANSLATION"
CREATE TABLE TREAT (x INT);
-- error 42601: syntax error: near "TREAT"
CREATE TABLE TRIGGER (x INT);
-- error 42601: syntax error: near "TRIGGER"
CREATE TABLE TRIM (x INT);
-- error 42601: syntax error: near "TRIM"
CREATE TABLE TRIM_ARRAY (x INT);
-- error 42601: syntax error: near "TRIM_ARRAY"
CREATE TABLE TRUE (x INT);
-- error 42601: syntax error: near "TRUE"
CREATE TABLE TRUNCATE (x INT);
-- error 42601: syntax error: near "TRUNCATE"
CREATE TABLE UESCAPE (x INT);
-- error 42601: syntax error: near "UESCAPE"
CREATE TABLE UNION (x INT);
-- error 42601: syntax error: near "UNION"
CREATE TABLE UNIQUE (x INT);
-- error 42601: syntax error: near "UNIQUE"
CREATE TABLE UNKNOWN (x INT);
-- error 42601: syntax error: near "UNKNOWN"
CREATE TABLE UNNEST (x INT);
-- error 42601: syntax error: near "UNNEST"
CREATE TABLE UPDATE (x INT);
-- error 42601: syntax error: near "UPDATE"
CREATE TABLE UPPER (x INT);
-- error 42601: syntax error: near "UPPER"
CREATE TABLE USER (x INT);
-- error 42601: syntax error: near "USER"
CREATE TABLE USING (x INT);
-- error 42601: syntax error: near "USING"
CREATE TABLE VALUE (x INT);
-- error 42601: syntax error: near "VALUE"
CREATE TABLE VALUES (x INT);
-- error 42601: syntax error: near "VALUES"
CREATE TABLE VALUE_OF (x INT);
-- error 42601: syntax error: near "VALUE_OF"
CREATE TABLE VAR_POP (x INT);
-- error 42601: syntax error: near "VAR_POP"
CREATE TABLE VAR_SAMP (x INT);
-- error 42601: syntax error: near "VAR_SAMP"
CREATE TABLE VARBINARY (x INT);
-- error 42601: syntax error: near "VARBINARY"
CREATE TABLE VARCHAR (x INT);
-- error 42601: syntax error: near "VARCHAR"
CREATE TABLE VARYING (x INT);
-- error 42601: syntax error: near "VARYING"
CREATE TABLE VERSIONING (x INT);
-- error 42601: syntax error: near "VERSIONING"
CREATE TABLE WHEN (x INT);
-- error 42601: syntax error: near "WHEN"
CREATE TABLE WHENEVER (x INT);
-- error 42601: syntax error: near "WHENEVER"
CREATE TABLE WHERE (x INT);
-- error 42601: syntax error: near "WHERE"
CREATE TABLE WIDTH_BUCKET (x INT);
-- error 42601: syntax error: near "WIDTH_BUCKET"
CREATE TABLE WINDOW (x INT);
-- error 42601: syntax error: near "WINDOW"
CREATE TABLE WITH (x INT);
-- error 42601: syntax error: near "WITH"
CREATE TABLE WITHIN (x INT);
-- error 42601: syntax error: near "WITHIN"
CREATE TABLE WITHOUT (x INT);
-- error 42601: syntax error: near "WITHOUT"
CREATE TABLE YEAR (x INT);
-- error 42601: syntax error: near "YEAR"
CREATE TABLE abs (x INT);
-- error 42601: syntax error: near "ABS"
CREATE TABLE foo (ABS INT);
-- error 42601: syntax error: near "ABS"
CREATE TABLE foo (abs int);
-- error 42601: syntax error: near "ABS"
|
CREATE DATABASE IF NOT EXISTS gcloud_trade;
USE gcloud_trade;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for tb_trade_info
-- 商品交易订单
-- ----------------------------
DROP TABLE IF EXISTS `tb_trade_info`;
CREATE TABLE `tb_trade_info` (
`id` BIGINT(30) PRIMARY KEY COMMENT '主键(yyyyMMddhhmmss + 门店ID + 4位随机数)',
`company_id` BIGINT(30) NOT NULL COMMENT '公司ID',
`store_id` BIGINT(30) NOT NULL COMMENT '门店ID',
`trade_no` BIGINT(30) NOT NULL COMMENT '交易编号(yyyyMMddhhmmss + 门店ID + 4位随机数)',
`trade_out_no` VARCHAR(30) NOT NULL COMMENT '交易编号(外部)',
`trade_status` VARCHAR(32) DEFAULT '' COMMENT '交易状态。可选值: ', -- TRADE_NO_CREATE_PAY(没有创建支付宝交易) * WAIT_BUYER_PAY(等待买家付款) * SELLER_CONSIGNED_PART(卖家部分发货) * WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) * WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) * TRADE_BUYER_SIGNED(买家已签收,货到付款专用) * TRADE_FINISHED(交易成功) * TRADE_CLOSED(付款以后用户退款成功,交易自动关闭) * TRADE_CLOSED_BY_TAOBAO(付款以前,卖家或买家主动关闭交易) * PAY_PENDING(国际信用卡支付付款确认中) * WAIT_PRE_AUTH_CONFIRM(0元购合约中)',
`trade_type` VARCHAR(16) DEFAULT 'fixed' COMMENT '交易类型fixed(一口价) auction(拍卖) guarantee_trade(一口价、拍卖) auto_delivery(自动发货)',
`trade_from` VARCHAR(16) DEFAULT 'WAP' COMMENT '交易内部来源:WAP(手机);HITAO(嗨淘);TOP(TOP平台);store(普通淘宝);JHS(聚划算)一笔订单可能同时有以上多个标记,则以逗号分隔',
`title` VARCHAR(256) DEFAULT '' COMMENT '交易标题,以店铺名作为此标题的值',
`is_brand_sale` TINYINT(1) DEFAULT 1 COMMENT '是否品牌销售0否 1是',
`shipping_type` VARCHAR(16) DEFAULT 'picked'COMMENT '创建交易时的物流方式 可选值:picked(自提) free(卖家包邮),post(平邮),express(快递),ems(EMS),virtual(虚拟发货),25(次日必达),26(预约配送)。',
`trade_memo` VARCHAR(250) DEFAULT NULL COMMENT '交易备注',
`price` DOUBLE(12,2) DEFAULT 0 COMMENT '商品价格。精确到2位小数;单位:元',
`quantity` INT(11) DEFAULT 0 COMMENT '交易数量',
`total_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '商品金额(商品价格乘以数量的总金额)精确到2位小数,单位:元',
`discount_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '优惠金额(免运费、限时打折时为空)精确到2位小数,单位:元',
`point_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '积分兑换金额',
`real_point_fee` BIGINT(20) DEFAULT 0 COMMENT '消耗积分',
`adjust_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '卖家手工调整金额,精确到2位小数,单位:元',
`commission_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '佣金',
`post_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '快递费用',
`pay_no` VARCHAR(32) DEFAULT ''COMMENT '支付流水号',
`payment` DOUBLE(12,2) DEFAULT 0 COMMENT '实付金额(total_fee+commission_fee+post_fee) - (discount_fee+point_fee+adjust_fee)',
`invoice_name` VARCHAR(128) DEFAULT NULL COMMENT '发票抬头',
`invoice_type` VARCHAR(2) DEFAULT '' COMMENT '发票类型(水果,图书)',
`invoice_kind` VARCHAR(2) DEFAULT '' COMMENT '发票类型( 1 电子发票 2 纸质发票 )',
`end_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '结束时间',
`pay_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '付款时间。格式:yyyy-MM-dd HH:mm:ss。订单的付款时间即为物流订单的创建时间。',
`consign_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '发货时间,当卖家对订单进行了多次发货,子订单的发货时间和主订单的发货时间可能不一样了,那么就需要以子订单的时间为准。',
`created` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`enable_status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '0否 1是',
KEY `inx_company` (`company_id`),
KEY `inx_store_id` (`store_id`),
KEY `inx_company_store` (`company_id`, `store_id`),
KEY `inx_company_store_trade` (`company_id`, `store_id`, `trade_no`),
KEY `inx_company_store_created` (`company_id`, `store_id`,`created`),
KEY `inx_company_store_pay_time` (`company_id`, `store_id`,`pay_time`),
KEY `inx_company_store_end_time` (`company_id`, `store_id`,`end_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for tb_trade_express
-- 商品交易快递
-- ----------------------------
DROP TABLE IF EXISTS `tb_trade_express`;
CREATE TABLE `tb_trade_express` (
`id` BIGINT(30) PRIMARY KEY COMMENT '主键',
`company_id` BIGINT(30) DEFAULT NULL COMMENT '公司ID',
`store_id` BIGINT(30) DEFAULT NULL COMMENT '门店ID',
`trade_no` BIGINT(30) NOT NULL COMMENT '交易编号',
`trade_out_no` BIGINT(30) NOT NULL COMMENT '交易编号(外部)',
`buyer_message` VARCHAR(250) DEFAULT NULL COMMENT '买家留言',
`buyer_nick` VARCHAR(64) DEFAULT NULL COMMENT '买家昵称',
`buyer_area` VARCHAR(128) DEFAULT NULL COMMENT '买家城市',
`buyer_email` VARCHAR(128) DEFAULT NULL COMMENT '买家email',
`seller_alipay_no`VARCHAR(64) DEFAULT NULL COMMENT '卖家支付宝账号',
`seller_mobile` VARCHAR(32) DEFAULT NULL COMMENT '卖家座机',
`seller_phone` VARCHAR(32) DEFAULT NULL COMMENT '卖家电话',
`seller_name` VARCHAR(64) DEFAULT NULL COMMENT '卖家名称',
`seller_email` VARCHAR(128) DEFAULT NULL COMMENT '卖家Email',
`seller_nick` VARCHAR(64) DEFAULT NULL COMMENT '卖家昵称',
`seller_memo` VARCHAR(256) DEFAULT NULL COMMENT '卖家名称',
`seller_flag` tinyint(4) DEFAULT NULL COMMENT '卖家备注旗帜',
`receiver_name` VARCHAR(64) DEFAULT NULL COMMENT '收货人名称',
`receiver_state` VARCHAR(64) DEFAULT NULL COMMENT '收货人的所在省份',
`receiver_city` VARCHAR(64) DEFAULT NULL COMMENT '收货人的所在城市',
`receiver_district` VARCHAR(64) DEFAULT NULL COMMENT '收货人的所在地区',
`receiver_address` VARCHAR(256) DEFAULT NULL COMMENT '收货人的所在地址',
`receiver_zip` VARCHAR(16) DEFAULT NULL COMMENT '收货人邮编',
`receiver_mobile`VARCHAR(64) DEFAULT NULL COMMENT '收货人座机',
`receiver_phone` VARCHAR(64) DEFAULT NULL COMMENT '收货人电话',
`created` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`enable_status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '0否 1是',
KEY `inx_company` (`company_id`),
KEY `inx_store_id` (`store_id`),
KEY `inx_company_store` (`company_id`, `store_id`),
KEY `inx_company_store_trade` (`company_id`, `store_id`, `trade_no`),
KEY `inx_company_store_created` (`company_id`, `store_id`, `created`),
KEY `inx_company_store_modified` (`company_id`, `store_id`, `modified`),
KEY `inx_company_store_buyer_nick` (`company_id`, `store_id`, `buyer_nick`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for tb_order_info
-- 商品子交易订单
-- ----------------------------
DROP TABLE IF EXISTS `tb_order_info`;
CREATE TABLE `tb_order_info` (
`id` BIGINT(30) PRIMARY KEY COMMENT '主键',
`company_id` BIGINT(30) DEFAULT NULL COMMENT '公司ID',
`store_id` BIGINT(30) DEFAULT NULL COMMENT '门店ID',
`trade_no` BIGINT(30) NOT NULL COMMENT '交易编号',
`trade_out_no` BIGINT(30) NOT NULL COMMENT '交易编号(外部)',
`order_no` BIGINT(30) NOT NULL COMMENT '交易子订单编号',
`order_out_no` BIGINT(30) NOT NULL COMMENT '交易子订单编号(外部)',
`goods_spu` BIGINT(30) NOT NULL COMMENT '商品SPU',
`goods_sku` BIGINT(30) DEFAULT 0 COMMENT '商品SKU',
`goods_out_spu` VARCHAR(30) DEFAULT '' COMMENT '商品SPU(外部系统)',
`goods_out_sku` VARCHAR(30) DEFAULT '' COMMENT '商品SKU(外部系统)',
`goods_sku_prop` VARCHAR(512) DEFAULT '' COMMENT 'SKU属性',
`item_meal_name` VARCHAR(128) DEFAULT '' COMMENT '套餐的值(SKU组合) ',
`item_meal_id` BIGINT(30) DEFAULT 0 COMMENT '套餐ID(SKU组合) ',
`trade_status` VARCHAR(32) DEFAULT '' COMMENT '交易状态。', -- 可选值: * TRADE_NO_CREATE_PAY(没有创建支付宝交易) * WAIT_BUYER_PAY(等待买家付款) * SELLER_CONSIGNED_PART(卖家部分发货) * WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) * WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) * TRADE_BUYER_SIGNED(买家已签收,货到付款专用) * TRADE_FINISHED(交易成功) * TRADE_CLOSED(付款以后用户退款成功,交易自动关闭) * TRADE_CLOSED_BY_TAOBAO(付款以前,卖家或买家主动关闭交易) * PAY_PENDING(国际信用卡支付付款确认中) * WAIT_PRE_AUTH_CONFIRM(0元购合约中)',
`title` VARCHAR(256) DEFAULT '' COMMENT '交易标题,以店铺名作为此标题的值',
`price` DOUBLE(12,2) DEFAULT 0 COMMENT '商品价格。精确到2位小数;单位:元',
`quantity` INT(11) DEFAULT 0 COMMENT '交易数量',
`total_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '商品金额(商品价格乘以数量的总金额)精确到2位小数,单位:元',
`discount_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '优惠金额(免运费、限时打折时为空)精确到2位小数,单位:元',
`point_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '积分兑换金额',
`real_point_fee` BIGINT(20) DEFAULT 0 COMMENT '消耗积分',
`adjust_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '卖家手工调整金额,精确到2位小数,单位:元',
`commission_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '佣金',
`post_fee` DOUBLE(12,2) DEFAULT 0 COMMENT '快递费用',
`pay_no` VARCHAR(32) DEFAULT ''COMMENT '支付流水号',
`payment` DOUBLE(12,2) DEFAULT 0 COMMENT '实付金额(total_fee+commission_fee+post_fee) - (discount_fee+point_fee+adjust_fee)',
`refund_id` VARCHAR(32) DEFAULT '' COMMENT '退款ID',
`refund_status` VARCHAR(64) DEFAULT '' COMMENT '退款状态。退款状态。可选值 WAIT_SELLER_AGREE(买家已经申请退款,等待卖家同意) WAIT_BUYER_RETURN_GOODS(卖家已经同意退款,等待买家退货) WAIT_SELLER_CONFIRM_GOODS(买家已经退货,等待卖家确认收货) SELLER_REFUSE_BUYER(卖家拒绝退款) CLOSED(退款关闭) SUCCESS(退款成功)',
`is_oversold` TINYINT(1) DEFAULT 0 COMMENT '是否超卖 0 否 1是',
`is_service_order` TINYINT(1) DEFAULT 0 COMMENT '是否是服务订单,0 否 1是',
`snapshot_url` VARCHAR(256) DEFAULT '' COMMENT '订单快照URL',
`pic_path` VARCHAR(256) DEFAULT '' COMMENT '商品图片',
`seller_nick` VARCHAR(64) DEFAULT '' COMMENT '卖家昵称',
`buyer_nick` VARCHAR(64) DEFAULT '' COMMENT '卖家昵称',
`buyer_rate` TINYINT(1) DEFAULT 0 COMMENT '买家是否已评价。可选值:0 否 1是',
`seller_rate` TINYINT(1) DEFAULT 0 COMMENT '卖家是否已评价。可选值:0 否 1是',
`seller_type` VARCHAR(64) DEFAULT 'B' COMMENT '卖家类型,可选值为:B(商城商家),C(普通卖家)',
`end_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '结束时间',
`pay_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '付款时间。格式:yyyy-MM-dd HH:mm:ss。订单的付款时间即为物流订单的创建时间。',
`consign_time` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00' COMMENT '发货时间,当卖家对订单进行了多次发货,子订单的发货时间和主订单的发货时间可能不一样了,那么就需要以子订单的时间为准。',
`created` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00',
`modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`enable_status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '0否 1是',
KEY `inx_company_store_trade` (`company_id`, `store_id`, `trade_no`),
KEY `inx_company_store_created` (`company_id`, `store_id`, `created`),
KEY `inx_company_store_pay_time` (`company_id`, `store_id`, `pay_time`),
KEY `inx_company_store_end_time` (`company_id`, `store_id`, `end_time`),
KEY `inx_company_store_modified` (`company_id`, `store_id`, `modified`),
KEY `inx_company_store_buyer_nick` (`company_id`, `store_id`, `buyer_nick`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
alter table ore_calcs change column character_id esi_char_id bigint not null; |
SELECT FirstName, LastName, 2021 - Birth
FROM Actors
WHERE ActorId IN (SELECT ActorId FROM MovieActors WHERE MovieId IN
(SELECT Id FROM Movies WHERE ReleaseYear > 1980))
ORDER BY Birth
|
-- MABD TP1 SQL avec la base MONDIAL
-- -------------------- binome -------------------------
-- NOM BECIRSPAHIC
-- Prenom LUCAS
-- NOM FERNANDEZ
-- Prenom STEBAN
-- -----------------------------------------------------
-- pour se connecter à oracle:
-- sqlplus E1234567/E1234567@oracle
-- remplacer E12345657 par la lettre E suivie de votre numéro de login
set sqlbl on
set linesize 150
prompt schema de la table Country
desc Country
prompt schema de la table City
desc City
prompt schema de la table IsMember
desc IsMember
prompt schema de la table City
desc City
-- pour afficher un nuplet entier sur une seule ligne
column name format A15
column capital format A15
column province format A20
-- Requete 0
select * from Country where name = 'France';
-- Requete 10
select o.name , COUNT(c.name), SUM(c.population)
from Country c , Organization o, isMember m
where m.country = c.code
and m.organization = o.abbreviation
group by o.name;
-- Requete 11
select o.name , COUNT(c.name), SUM(c.population)
from Country c , Organization o, isMember m
where m.country = c.code
and m.organization = o.abbreviation
group by o.name
having (COUNT(c.name) > 100);
-- Requete 12
select c.name, m.name
from Country c, Mountain m, Encompasses e, Geo_Mountain g
where e.continent = 'America' and e.country = c.code
and g.mountain = m.name and g.country = c.code and
not exists (select * from Mountain m2, Geo_Mountain g2 where g2.mountain = m2.name and
g2.country = c.code and m2.height > m.height);
select c.name, m.name
from Country c, Mountain m, Encompasses e, Geo_Mountain g
where e.continent = 'America' and e.country = c.code and g.mountain = m.name and g.country = c.code and m.height = (select MAX(height) from Mountain m2, Geo_Mountain g2 where
g2.mountain = m2.name and g2.country = c.code);
-- Requete 13
select r.name from river r where r.river = 'Nile';
-- Requete 14
-- Profondeur 1 ou 2
select distinct r.name
from River r, River r2, River r3
where (r.river = 'Nile') or (r.river = r2.name and r2.river = 'Nile')
or (r.river = r2.name and r2.river = r3.name and r3.river='Nile');
-- Requete 15
select SUM(r.length)
from River r, River r2, River r3
where (r.river = 'Nile') or (r.river = r2.name and r2.river = 'Nile') or (r.name = 'Nile')
or (r.river = r2.name and r2.river = r3.name and r3.river='Nile');
-- Requete 16.a
select name, COUNT(*)
from Organization, IsMember
where abbreviation = organization
group by name
having COUNT(*) = (select MAX(COUNT(*))
from Organization o, IsMember m
where o.abbreviation = m.organization
group by o.abbreviation, o.name
);
-- Requete 16.b
select *
from (
select o.name, COUNT(*)
from Organization o, IsMember m
where o.abbreviation = m.organization
group by o.abbreviation, o.name
order by COUNT(*) DESC
)
where rownum < 4;
-- Requete 17
-- Requete 18
-- Requete 19
-- Requete 20
|
insert into migration_history (version, notes)
values ('201506030000', '
1) В документе добавляем новое поле: date_end дата завершения действия документа.
2) Названия видов теперь заканчиваются на _view.
3) Сущность ownership_type переименовываем в legal_form
');
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Изменения таблицы document
comment on column document.date_start
is 'Дата создания документа (дата начала действия документа). Без временной отметки.';
comment on column document.deleted
is 'Флажок: удален ли документ. Равен true, если удален.';
alter table document
add column date_end date null default null;
comment on column document.date_end
is 'Дата конца действия документа. Без временной отметки. Если равен null то документ бесрочный.';
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Организационно-правовая форма (бывшая сущность форма собственности)
drop table if exists ownership_type cascade;
create table legal_form (
legal_form_id serial not null,
title varchar(200) not null,
title_short varchar(100) not null,
constraint legal_form_primary_key primary key (legal_form_id)
);
comment on table legal_form is 'Организационно-правовая форма';
comment on column legal_form.title is 'Наименование';
comment on column legal_form.title_short is 'Сокращенное наименование';
insert into legal_form (title, title_short) values ('Общество с ограниченной ответственностью', 'ООО');
insert into legal_form (title, title_short) values ('Закрытое акционерное общество', 'ЗАО');
insert into legal_form (title, title_short) values ('Государственное бюджетное учреждение культуры города Москвы', 'ГБУК г. Москвы');
insert into legal_form (title, title_short) values ('Муниципальное учреждение здравоохранения', 'МУЗ');
insert into legal_form (title, title_short) values ('Товарищество собственников жилья', 'ТСЖ');
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Восстанавливаем ссылку на форму собственности в таблицы юрлиц
alter table legal
drop column ownership_type_id;
alter table legal
add column legal_form_id integer null default null;
alter table legal
add constraint legal_legal_form foreign key (legal_form_id)
references legal_form (legal_form_id)
on delete cascade on update cascade;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Переименовываем существующие виды в соответствии с новым правилом.
drop view if exists contractor_document;
create view contractor_view as
select
document.document_id,
document.parent_id as document_parent_id,
document.number as document_number,
document.date_start as document_date_start,
document.notes as document_notes,
document.deleted as document_deleted,
contractor.contractor_id,
case_contractor_type(contractor, legal, individual, businessman) as contractor_type,
case_contractor_title(contractor, legal, individual, businessman, ownership_type) as contractor_title
from contractor
left join document on contractor.document_id = document.document_id
left join legal on legal.contractor_id = contractor.contractor_id
left join individual on individual.contractor_id = contractor.contractor_id
left join businessman on businessman.contractor_id = contractor.contractor_id
left join ownership_type on legal.ownership_type_id = ownership_type.ownership_type_id;
drop view if exists legal_contractor;
create view legal_view as
select
contractor_document.document_id,
contractor_document.document_parent_id,
contractor_document.document_number,
contractor_document.document_date_start,
contractor_document.document_notes,
contractor_document.document_deleted,
contractor_document.contractor_id,
contractor_document.contractor_type,
contractor_document.contractor_title,
legal.legal_id,
legal.title as legal_title,
legal.title_short as legal_title_short,
ownership_type.ownership_type_id,
ownership_type.title as ownership_type_title,
ownership_type.title_short as ownership_type_title_short
from legal
left join contractor_document on legal.contractor_id = contractor_document.contractor_id
left join ownership_type on legal.ownership_type_id = ownership_type.ownership_type_id;
drop view if exists individual_contractor;
create view individual_view as
select
contractor_document.document_id,
contractor_document.document_parent_id,
contractor_document.document_number,
contractor_document.document_date_start,
contractor_document.document_notes,
contractor_document.document_deleted,
contractor_document.contractor_id,
contractor_document.contractor_type,
contractor_document.contractor_title,
individual.individual_id,
individual.first_name as individual_first_name,
individual.surname as individual_surname,
individual.patronymic as individual_patronymic
from individual
left join contractor_document on individual.contractor_id = contractor_document.contractor_id;
drop view if exists businessman_contractor;
create view businessman_view as
select
contractor_document.document_id,
contractor_document.document_parent_id,
contractor_document.document_number,
contractor_document.document_date_start,
contractor_document.document_notes,
contractor_document.document_deleted,
contractor_document.contractor_id,
contractor_document.contractor_type,
contractor_document.contractor_title,
individual.individual_id,
individual.first_name as individual_first_name,
individual.surname as individual_surname,
individual.patronymic as individual_patronymic
from businessman
left join contractor_document on businessman.contractor_id = contractor_document.contractor_id
left join individual on individual.contractor_id = contractor_document.contractor_id;
|
ALTER TABLE users
ALTER COLUMN pass TYPE VARCHAR(100);
|
BEGIN TRANSACTION;
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT `UUID` AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID, username AS FirstName, surname AS LastName, '' as Email, '' AS ServiceURLs, created as Created FROM users;
COMMIT;
|
SELECT
SUM(下发名单量) 下发总量, SUM(成功数) 成功总数, round(SUM(成功数)/SUM(下发名单量),4) 平均转化率,
round(SUM(邮件1转化率)/COUNT(*),4) 邮件1平均转化率,
round(SUM(邮件2转化率)/COUNT(*),4) 邮件2平均转化率,
round(SUM(邮件3转化率)/COUNT(*),4) 邮件3平均转化率,
round(SUM(邮件4转化率)/COUNT(*),4) 邮件4平均转化率,
round(SUM(邮件5转化率)/COUNT(*),4) 邮件5平均转化率,
round(SUM(邮件6转化率)/COUNT(*),4) 邮件6平均转化率,
round(SUM(邮件7转化率)/COUNT(*),4) 邮件7平均转化率,
round(SUM(邮件8转化率)/COUNT(*),4) 邮件8平均转化率,
round(SUM(邮件9转化率)/COUNT(*),4) 邮件9平均转化率,
round(SUM(邮件10转化率)/COUNT(*),4) 邮件10平均转化率,
round(SUM(邮件20转化率)/COUNT(*),4) 邮件20平均转化率
FROM
(
SELECT t.姓名, NVL(f."下发名单量", 0) 下发名单量,NVL( s."成功数", 0) 成功数, round(NVL( s."成功数", 0)/下发名单量,4)*100 转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t1."邮件1",0)/s."成功数",4)*100 END) 邮件1转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t2."邮件2",0)/s."成功数",4)*100 END) 邮件2转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t3."邮件3",0)/s."成功数",4)*100 END) 邮件3转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t4."邮件4",0)/s."成功数",4)*100 END) 邮件4转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t5."邮件5",0)/s."成功数",4)*100 END) 邮件5转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t6."邮件6",0)/s."成功数",4)*100 END) 邮件6转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t7."邮件7",0)/s."成功数",4)*100 END) 邮件7转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t8."邮件8",0)/s."成功数",4)*100 END) 邮件8转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t9."邮件9",0)/s."成功数",4)*100 END) 邮件9转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t10."邮件10",0)/s."成功数",4)*100 END) 邮件10转化率,
(CASE NVl(s."成功数",0) WHEN 0 THEN 0 ELSE round(NVl(t20."邮件20",0)/s."成功数",4)*100 END) 邮件20转化率
from (select DISTINCT SALESMANNO,SALESMANNAME 姓名 FROM CALLOUTDATA WHERE SALESMANNO IS NOT NULL AND SALESMANNAME IS NOT NULL) t
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 下发名单量 FROM CALLOUTDATA GROUP BY SALESMANNO) f ON t.SALESMANNO = f.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 成功数 FROM CALLOUTDATA WHERE LINKRESULT = '2' GROUP BY SALESMANNO) s ON t.SALESMANNO = s.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件1 FROM CALLOUTDATA WHERE EMAIL = '1' GROUP BY SALESMANNO) t1 ON t.SALESMANNO = t1.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件2 FROM CALLOUTDATA WHERE EMAIL = '2' GROUP BY SALESMANNO) t2 ON t.SALESMANNO = t2.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件3 FROM CALLOUTDATA WHERE EMAIL = '3' GROUP BY SALESMANNO) t3 ON t.SALESMANNO = t3.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件4 FROM CALLOUTDATA WHERE EMAIL = '4' GROUP BY SALESMANNO) t4 ON t.SALESMANNO = t4.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件5 FROM CALLOUTDATA WHERE EMAIL = '5' GROUP BY SALESMANNO) t5 ON t.SALESMANNO = t5.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件6 FROM CALLOUTDATA WHERE EMAIL = '6' GROUP BY SALESMANNO) t6 ON t.SALESMANNO = t6.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件7 FROM CALLOUTDATA WHERE EMAIL = '7' GROUP BY SALESMANNO) t7 ON t.SALESMANNO = t7.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件8 FROM CALLOUTDATA WHERE EMAIL = '8' GROUP BY SALESMANNO) t8 ON t.SALESMANNO = t8.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件9 FROM CALLOUTDATA WHERE EMAIL = '9' GROUP BY SALESMANNO) t9 ON t.SALESMANNO = t9.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件10 FROM CALLOUTDATA WHERE EMAIL = '10' GROUP BY SALESMANNO) t10 ON t.SALESMANNO = t10.SALESMANNO
LEFT JOIN (select SALESMANNO,count(SALESMANNO) 邮件20 FROM CALLOUTDATA WHERE EMAIL = '20' GROUP BY SALESMANNO) t20 ON t.SALESMANNO = t20.SALESMANNO
)
|
create table question
(
id int auto_increment,
creator int,
title varchar2(64),
description text,
tag varchar2(256),
comment_count int default 0,
view_count int default 0,
like_count int default 0,
gmt_create bigint,
gmt_modified bigint,
constraint question_pk
primary key (id)
);
comment on table question is '问题描述表'; |
/*
Navicat MySQL Data Transfer
Source Server : prd-cbest
Source Server Version : 80016
Source Host : db.haproxy.cbest.gam:36601
Source Database : e_welfare
Target Server Type : MYSQL
Target Server Version : 80016
File Encoding : 65001
Date: 2021-02-02 15:49:40
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for account
-- ----------------------------
DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
`id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'id',
`account_name` varchar(50) DEFAULT NULL COMMENT '员工名称',
`account_code` int(10) DEFAULT NULL COMMENT '员工账号',
`account_type_code` varchar(20) DEFAULT NULL COMMENT '员工类型编码',
`mer_code` varchar(20) DEFAULT NULL COMMENT '所属商户',
`store_code` varchar(20) DEFAULT NULL COMMENT '所属部门',
`account_status` int(11) DEFAULT NULL COMMENT '账号状态(1正常2禁用)',
`staff_status` varchar(20) DEFAULT NULL COMMENT '员工状态',
`binding` int(11) DEFAULT '0' COMMENT '是否绑卡(1绑定0未绑定)',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`account_balance` decimal(15,2) DEFAULT '0.00' COMMENT '账户余额',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`version` int(11) DEFAULT NULL COMMENT '版本',
`phone` varchar(11) DEFAULT NULL COMMENT '手机号',
`max_quota` decimal(15,2) DEFAULT '0.00' COMMENT '最大授权额度',
`surplus_quota` decimal(15,2) DEFAULT '0.00' COMMENT '剩余授权额度',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`change_event_id` bigint(20) DEFAULT '0' COMMENT '员工账号变更记录ID',
`credit` tinyint(1) DEFAULT NULL COMMENT '是否授信',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_account_code` (`account_code`) USING BTREE,
KEY `idx_account_name` (`account_name`) USING BTREE,
KEY `idx_change_event_id` (`change_event_id`) USING BTREE,
KEY `idx_mer_code` (`mer_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='账户信息';
-- ----------------------------
-- Table structure for account_amount_type
-- ----------------------------
DROP TABLE IF EXISTS `account_amount_type`;
CREATE TABLE `account_amount_type` (
`id` bigint(20) NOT NULL COMMENT '自增id',
`account_code` int(10) DEFAULT NULL COMMENT '账户编码',
`mer_account_type_code` varchar(20) DEFAULT NULL COMMENT '商家账户类型',
`account_balance` decimal(11,2) DEFAULT NULL COMMENT '余额',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_account_code_mer_account_type_code` (`account_code`,`mer_account_type_code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for account_bill_detail
-- ----------------------------
DROP TABLE IF EXISTS `account_bill_detail`;
CREATE TABLE `account_bill_detail` (
`id` bigint(20) NOT NULL COMMENT 'id',
`account_code` int(10) DEFAULT NULL COMMENT '员工账号',
`card_id` varchar(20) DEFAULT NULL COMMENT '卡号',
`trans_no` varchar(64) DEFAULT NULL COMMENT '交易流水号',
`store_code` varchar(20) DEFAULT NULL COMMENT '消费门店',
`trans_type` varchar(20) DEFAULT NULL COMMENT '交易类型(消费、退款、充值等)',
`pos` varchar(20) DEFAULT NULL COMMENT 'pos标识',
`channel` varchar(20) DEFAULT NULL COMMENT '充值渠道(第三方充值需要体现:支付宝或者微信)',
`trans_amount` decimal(15,2) DEFAULT NULL COMMENT '交易总金额',
`trans_time` datetime DEFAULT NULL COMMENT '交易时间',
`account_balance` decimal(15,2) DEFAULT NULL COMMENT '账户余额',
`surplus_quota` decimal(15,2) DEFAULT NULL COMMENT '授信余额',
`order_channel` varchar(20) DEFAULT NULL COMMENT '订单渠道',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
KEY `idx_abe_trans_no_trans_type` (`trans_no`,`trans_type`),
KEY `idx_abe_account_code` (`account_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户交易流水明细表';
-- ----------------------------
-- Table structure for account_change_event_record
-- ----------------------------
DROP TABLE IF EXISTS `account_change_event_record`;
CREATE TABLE `account_change_event_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`account_code` bigint(20) DEFAULT NULL COMMENT '员工账号Code\r\n',
`change_type` varchar(255) DEFAULT NULL COMMENT '变更类型',
`change_value` varchar(255) DEFAULT NULL COMMENT '变更类型名称',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7222 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for account_consume_scene
-- ----------------------------
DROP TABLE IF EXISTS `account_consume_scene`;
CREATE TABLE `account_consume_scene` (
`id` bigint(20) unsigned NOT NULL COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`account_type_code` varchar(20) DEFAULT NULL COMMENT '员工类型编码',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`status` int(11) unsigned DEFAULT '1' COMMENT '状态(1正常 2禁用)',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='员工消费场景配置';
-- ----------------------------
-- Table structure for account_consume_scene_store_relation
-- ----------------------------
DROP TABLE IF EXISTS `account_consume_scene_store_relation`;
CREATE TABLE `account_consume_scene_store_relation` (
`id` bigint(20) NOT NULL COMMENT 'id',
`account_consume_scene_id` bigint(20) DEFAULT NULL,
`store_code` varchar(20) DEFAULT NULL COMMENT '门店编码',
`scene_consum_type` varchar(40) DEFAULT NULL COMMENT '消费方式',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
KEY `idx_account_consume_scene_id` (`account_consume_scene_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='员工消费场景关联门店';
-- ----------------------------
-- Table structure for account_deduction_detail
-- ----------------------------
DROP TABLE IF EXISTS `account_deduction_detail`;
CREATE TABLE `account_deduction_detail` (
`id` bigint(20) NOT NULL COMMENT 'id',
`account_code` int(10) DEFAULT NULL COMMENT '员工账号',
`card_id` varchar(20) DEFAULT NULL COMMENT '卡号',
`trans_no` varchar(64) DEFAULT NULL COMMENT '交易流水号',
`related_trans_no` varchar(50) DEFAULT NULL COMMENT '关联交易单号(退款时使用)',
`store_code` varchar(20) DEFAULT NULL COMMENT '消费门店',
`trans_type` varchar(20) DEFAULT NULL COMMENT '交易类型(消费、退款、充值等)',
`pos` varchar(20) DEFAULT NULL COMMENT 'pos标识',
`chanel` varchar(20) DEFAULT NULL COMMENT '渠道(自主充值需要显示来源:支付宝、微信)',
`trans_amount` decimal(18,5) DEFAULT NULL COMMENT '交易总金额',
`reversed_amount` decimal(18,5) DEFAULT NULL COMMENT '已逆向金额',
`trans_time` datetime DEFAULT NULL COMMENT '交易时间',
`pay_code` varchar(20) DEFAULT NULL COMMENT '支付编码',
`mer_account_type` varchar(20) DEFAULT NULL COMMENT '子账户类型(例如餐费、交通费等)',
`account_deduction_amount` decimal(15,2) DEFAULT NULL COMMENT '子账户扣款金额',
`account_amount_type_balance` decimal(15,2) DEFAULT NULL COMMENT '子账户剩余金额',
`mer_deduction_amount` decimal(15,2) DEFAULT NULL COMMENT '商户余额扣款金额',
`mer_deduction_credit_amount` decimal(15,2) DEFAULT NULL COMMENT '商户额度扣款金额',
`self_deduction_amount` decimal(15,2) DEFAULT NULL COMMENT '自费扣款金额',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
KEY `idx_add_store_code` (`store_code`),
KEY `idx_add_trans_no` (`trans_no`),
KEY `idx_add_account_code` (`account_code`),
KEY `idx_add_related_transNo_transType` (`related_trans_no`,`trans_type`),
KEY `idx_add_transNo_transType` (`trans_no`,`trans_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='用户交易流水明细表';
-- ----------------------------
-- Table structure for account_deposit_apply
-- ----------------------------
DROP TABLE IF EXISTS `account_deposit_apply`;
CREATE TABLE `account_deposit_apply` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(32) DEFAULT NULL COMMENT '申请编码',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`recharge_num` int(11) DEFAULT NULL COMMENT '充值账户个数',
`recharge_amount` decimal(15,2) DEFAULT NULL COMMENT '申请充值总额',
`recharge_status` varchar(20) DEFAULT NULL COMMENT '充值状态',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`version` int(11) DEFAULT NULL COMMENT '版本',
`approval_status` varchar(20) DEFAULT NULL COMMENT '审批状态',
`approval_user` varchar(50) DEFAULT NULL COMMENT '审批人',
`approval_time` datetime DEFAULT NULL COMMENT '审批时间',
`approval_remark` varchar(255) DEFAULT NULL COMMENT '审批备注',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志 1-删除、0-未删除',
`apply_remark` varchar(255) DEFAULT NULL COMMENT '申请备注',
`apply_user` varchar(50) DEFAULT NULL COMMENT '申请人',
`approval_opinion` varchar(255) DEFAULT NULL COMMENT '审批意见',
`apply_time` datetime DEFAULT NULL COMMENT '申请时间',
`approval_type` varchar(20) DEFAULT NULL COMMENT '请求类型',
`request_id` varchar(64) DEFAULT NULL COMMENT '请求id',
`mer_account_type_code` varchar(20) DEFAULT NULL COMMENT '商家账户类型',
`channel` varchar(20) DEFAULT NULL COMMENT '渠道',
`mer_account_type_name` varchar(20) DEFAULT NULL COMMENT '商家账户类型名称',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_apply_code` (`apply_code`) USING BTREE,
UNIQUE KEY `UK_request_id` (`request_id`) USING BTREE,
KEY `IDX_approval_time` (`approval_time`) USING BTREE,
KEY `IDX_apply_time` (`apply_time`) USING BTREE,
KEY `IDX_apply_user` (`apply_user`) USING BTREE,
KEY `IDX_approval_user` (`approval_user`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='账户充值申请';
-- ----------------------------
-- Table structure for account_deposit_apply_detail
-- ----------------------------
DROP TABLE IF EXISTS `account_deposit_apply_detail`;
CREATE TABLE `account_deposit_apply_detail` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(32) DEFAULT NULL COMMENT '申请编码',
`account_code` int(10) DEFAULT NULL COMMENT '员工账户',
`recharge_amount` decimal(15,2) DEFAULT NULL COMMENT '充值金额',
`recharge_status` varchar(20) DEFAULT NULL COMMENT '充值状态',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志',
`version` int(11) DEFAULT NULL COMMENT '版本',
`trans_no` varchar(32) DEFAULT NULL COMMENT '流水号',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_Apply_code_Account_code` (`apply_code`,`account_code`) USING BTREE,
UNIQUE KEY `UK_trans_no` (`trans_no`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='充值申请明细';
-- ----------------------------
-- Table structure for account_deposit_record
-- ----------------------------
DROP TABLE IF EXISTS `account_deposit_record`;
CREATE TABLE `account_deposit_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_code` int(10) DEFAULT NULL COMMENT '员工账号',
`mer_code` varchar(20) NOT NULL COMMENT '商户代码',
`pay_type` varchar(32) NOT NULL COMMENT '支付方式',
`pay_trade_no` varchar(50) NOT NULL COMMENT '支付交易号',
`pay_gateway_trade_no` varchar(50) DEFAULT NULL COMMENT '支付重百付交易号',
`pay_channel_trade_no` varchar(50) DEFAULT NULL COMMENT '支付渠道交易号',
`deposit_trade_no` varchar(50) DEFAULT NULL COMMENT '充值交易号',
`deposit_gateway_trade_no` varchar(50) DEFAULT NULL COMMENT '充值重百付交易号',
`deposit_amount` decimal(14,4) NOT NULL COMMENT '充值金额',
`pay_time` datetime DEFAULT NULL COMMENT '支付时间',
`deposit_time` datetime DEFAULT NULL COMMENT '充值时间',
`pay_status` int(11) NOT NULL COMMENT '支付状态',
`recharge_status` int(11) NOT NULL COMMENT '充值状态',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`) USING BTREE,
KEY `idx_account_code` (`account_code`) USING BTREE,
KEY `idx_pay_trade_no` (`pay_trade_no`) USING BTREE,
KEY `idx_deposit_trade_no` (`deposit_trade_no`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1356237869223895042 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='账号充值记录表';
-- ----------------------------
-- Table structure for account_type
-- ----------------------------
DROP TABLE IF EXISTS `account_type`;
CREATE TABLE `account_type` (
`id` bigint(20) NOT NULL COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`type_code` varchar(20) DEFAULT NULL COMMENT '类型编码',
`type_name` varchar(50) DEFAULT NULL COMMENT '类型名称',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='员工类型';
-- ----------------------------
-- Table structure for barcode_salt
-- ----------------------------
DROP TABLE IF EXISTS `barcode_salt`;
CREATE TABLE `barcode_salt` (
`id` bigint(20) NOT NULL COMMENT 'pk',
`valid_period` varchar(50) DEFAULT NULL COMMENT '有效期',
`valid_period_numeric` bigint(20) DEFAULT NULL COMMENT '有效期数字表示',
`salt_value` bigint(8) DEFAULT NULL COMMENT '加盐值',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='条码加盐信息';
-- ----------------------------
-- Table structure for bus_events
-- ----------------------------
DROP TABLE IF EXISTS `bus_events`;
CREATE TABLE `bus_events` (
`record_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`class_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`event_json` mediumtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`user_token` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`created_date` datetime NOT NULL,
`creating_owner` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`processing_owner` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`processing_available_date` datetime DEFAULT NULL,
`processing_state` varchar(14) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT 'AVAILABLE',
`error_count` int(10) unsigned DEFAULT '0',
`search_key1` bigint(20) unsigned DEFAULT NULL,
`search_key2` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`record_id`),
UNIQUE KEY `record_id` (`record_id`),
KEY `idx_bus_where` (`processing_state`,`processing_owner`,`processing_available_date`),
KEY `bus_events_tenant_account_record_id` (`search_key2`,`search_key1`)
) ENGINE=InnoDB AUTO_INCREMENT=2634 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for bus_events_history
-- ----------------------------
DROP TABLE IF EXISTS `bus_events_history`;
CREATE TABLE `bus_events_history` (
`record_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`class_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`event_json` mediumtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`user_token` varchar(36) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`created_date` datetime NOT NULL,
`creating_owner` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`processing_owner` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`processing_available_date` datetime DEFAULT NULL,
`processing_state` varchar(14) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT 'AVAILABLE',
`error_count` int(10) unsigned DEFAULT '0',
`search_key1` bigint(20) unsigned DEFAULT NULL,
`search_key2` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`record_id`),
UNIQUE KEY `record_id` (`record_id`),
KEY `bus_events_history_tenant_account_record_id` (`search_key2`,`search_key1`)
) ENGINE=InnoDB AUTO_INCREMENT=2633 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- ----------------------------
-- Table structure for card_apply
-- ----------------------------
DROP TABLE IF EXISTS `card_apply`;
CREATE TABLE `card_apply` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(20) DEFAULT NULL COMMENT '制卡申请号',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`card_name` varchar(100) DEFAULT NULL COMMENT '卡片名称',
`card_type` varchar(50) DEFAULT NULL COMMENT '卡片类型',
`card_medium` varchar(50) DEFAULT NULL COMMENT '卡片介质',
`card_num` int(11) DEFAULT NULL COMMENT '卡片数量',
`identification_code` varchar(20) DEFAULT NULL COMMENT '识别码方法',
`identification_length` int(11) DEFAULT NULL COMMENT '识别码长度',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`status` int(11) DEFAULT NULL COMMENT '状态: 锁定、激活',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='制卡信息';
-- ----------------------------
-- Table structure for card_info
-- ----------------------------
DROP TABLE IF EXISTS `card_info`;
CREATE TABLE `card_info` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(20) DEFAULT NULL COMMENT '申请编码',
`card_id` varchar(20) NOT NULL COMMENT '卡号',
`card_status` int(5) DEFAULT NULL COMMENT '卡状态',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`account_code` int(10) DEFAULT NULL COMMENT '员工账号',
`version` int(11) DEFAULT NULL COMMENT '版本',
`magnetic_stripe` varchar(64) NOT NULL COMMENT '磁条号',
`written_time` datetime DEFAULT NULL COMMENT '入库时间',
`bind_time` datetime DEFAULT NULL COMMENT '绑定时间',
`enabled` int(2) DEFAULT '1' COMMENT '是否启用',
PRIMARY KEY (`id`),
UNIQUE KEY `uni_ci_magnetic_stripe` (`magnetic_stripe`),
UNIQUE KEY `uni_ci_card_id` (`card_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='卡信息';
-- ----------------------------
-- Table structure for department
-- ----------------------------
DROP TABLE IF EXISTS `department`;
CREATE TABLE `department` (
`id` bigint(20) NOT NULL COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`department_name` varchar(50) DEFAULT NULL COMMENT '部门名称',
`department_code` varchar(20) DEFAULT NULL COMMENT '部门编码',
`department_parent` varchar(20) DEFAULT NULL COMMENT '部门父级',
`department_level` int(11) DEFAULT NULL COMMENT '部门层级',
`department_path` varchar(100) DEFAULT NULL COMMENT '部门路径',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
`external_code` varchar(10) DEFAULT NULL COMMENT '外部编码',
`department_type` varchar(20) DEFAULT NULL COMMENT '部门类型',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_department_code` (`department_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户部门';
-- ----------------------------
-- Table structure for dict
-- ----------------------------
DROP TABLE IF EXISTS `dict`;
CREATE TABLE `dict` (
`id` bigint(20) NOT NULL COMMENT 'id',
`dict_type` varchar(64) DEFAULT NULL COMMENT '码表类型',
`dict_code` varchar(50) DEFAULT NULL COMMENT '编码',
`dict_name` varchar(100) DEFAULT NULL COMMENT '名称',
`status` int(11) DEFAULT NULL COMMENT '状态',
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志',
`sort` int(11) DEFAULT NULL COMMENT '顺序',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_dict_type_dict_code` (`dict_type`,`dict_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='字典';
-- ----------------------------
-- Table structure for file_template
-- ----------------------------
DROP TABLE IF EXISTS `file_template`;
CREATE TABLE `file_template` (
`id` bigint(20) NOT NULL COMMENT 'id',
`file_type` varchar(64) DEFAULT NULL COMMENT '文件类型',
`url` varchar(255) DEFAULT NULL COMMENT '文件下载地址',
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT '0' COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件模板';
-- ----------------------------
-- Table structure for merchant
-- ----------------------------
DROP TABLE IF EXISTS `merchant`;
CREATE TABLE `merchant` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`mer_name` varchar(100) DEFAULT NULL COMMENT '商户名称',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`mer_type` varchar(20) DEFAULT NULL COMMENT '商户类型',
`mer_identity` varchar(255) DEFAULT NULL COMMENT '身份属性',
`mer_cooperation_mode` varchar(255) DEFAULT NULL COMMENT '合作方式',
`self_recharge` varchar(255) DEFAULT NULL COMMENT '员工自主充值',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`status` int(11) DEFAULT NULL COMMENT '状态',
`deleted` tinyint(1) DEFAULT NULL,
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_mer_code` (`mer_code`),
KEY `idx_mer_name` (`mer_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1356442707773845506 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户信息';
-- ----------------------------
-- Table structure for merchant_account_type
-- ----------------------------
DROP TABLE IF EXISTS `merchant_account_type`;
CREATE TABLE `merchant_account_type` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`mer_code` varchar(20) NOT NULL COMMENT '商户代码',
`mer_account_type_code` varchar(20) NOT NULL COMMENT '商户账户类型编码',
`mer_account_type_name` varchar(20) NOT NULL COMMENT '商户账户类型名称',
`deduction_order` int(11) DEFAULT NULL COMMENT '扣款序号',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标识',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
`show_status` int(11) DEFAULT NULL COMMENT '显示状态(默认福利类型(授信额度,自主充值)不需要展示)1展示;0不展示',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_mer_code_mer_account_type_code` (`mer_code`,`mer_account_type_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1356442789915095042 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户福利类型';
-- ----------------------------
-- Table structure for merchant_address
-- ----------------------------
DROP TABLE IF EXISTS `merchant_address`;
CREATE TABLE `merchant_address` (
`id` bigint(20) NOT NULL COMMENT 'id',
`address_name` varchar(100) DEFAULT NULL COMMENT '地址名称',
`address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`address_type` varchar(50) DEFAULT NULL COMMENT '地址类型',
`status` int(11) DEFAULT NULL COMMENT '状态',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`version` int(11) DEFAULT NULL COMMENT '版本',
`related_type` varchar(20) DEFAULT NULL COMMENT '关联类型',
`related_id` bigint(20) DEFAULT NULL COMMENT '关联id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='地址信息';
-- ----------------------------
-- Table structure for merchant_bill_detail
-- ----------------------------
DROP TABLE IF EXISTS `merchant_bill_detail`;
CREATE TABLE `merchant_bill_detail` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`trans_no` varchar(64) DEFAULT NULL COMMENT '交易流水号',
`trans_type` varchar(20) DEFAULT NULL COMMENT '交易类型(消费、退款、添加余额、添加额度等)',
`balance_type` varchar(20) DEFAULT NULL COMMENT '余额类型(余额、可用信用额度、最大额度、充值额度)',
`trans_amount` decimal(15,2) DEFAULT NULL COMMENT '交易金额',
`recharge_limit` decimal(15,2) DEFAULT NULL COMMENT '充值额度',
`current_balance` decimal(15,2) DEFAULT NULL COMMENT '当前余额',
`credit_limit` decimal(15,2) DEFAULT NULL COMMENT '最高信用额度',
`remaining_limit` decimal(15,2) DEFAULT NULL COMMENT '剩余信用额度',
`rebate_limit` decimal(15,2) DEFAULT NULL COMMENT '返利额度',
`self_deposit_balance` decimal(15,2) DEFAULT NULL,
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
KEY `idx_trans_no` (`trans_no`) USING BTREE,
KEY `idx_mer_code` (`mer_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1356501329979498498 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for merchant_credit
-- ----------------------------
DROP TABLE IF EXISTS `merchant_credit`;
CREATE TABLE `merchant_credit` (
`id` bigint(20) NOT NULL COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`recharge_limit` decimal(15,2) DEFAULT NULL COMMENT '充值额度',
`current_balance` decimal(15,2) DEFAULT NULL COMMENT '目前余额',
`credit_limit` decimal(15,2) DEFAULT NULL COMMENT '信用额度',
`remaining_limit` decimal(15,2) DEFAULT NULL COMMENT '剩余信用额度',
`rebate_limit` decimal(15,2) DEFAULT NULL COMMENT '返利余额',
`self_deposit_balance` decimal(15,2) DEFAULT NULL COMMENT '员工自主充值',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户额度信';
-- ----------------------------
-- Table structure for merchant_credit_apply
-- ----------------------------
DROP TABLE IF EXISTS `merchant_credit_apply`;
CREATE TABLE `merchant_credit_apply` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(64) DEFAULT NULL COMMENT '申请编码',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户编码',
`apply_type` varchar(20) DEFAULT NULL COMMENT '申请类型',
`balance` decimal(15,2) DEFAULT NULL COMMENT '金额',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`enclosure` varchar(255) DEFAULT NULL COMMENT '附件',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`approval_status` varchar(20) DEFAULT NULL COMMENT '审批状态',
`approval_user` varchar(20) DEFAULT NULL COMMENT '审批人',
`approval_time` datetime DEFAULT NULL COMMENT '审批时间',
`approval_remark` varchar(255) DEFAULT NULL COMMENT '审批备注',
`version` int(11) DEFAULT NULL COMMENT '版本',
`apply_user` varchar(50) DEFAULT NULL COMMENT '申请人',
`apply_time` datetime DEFAULT NULL COMMENT '申请时间',
`request_id` varchar(64) DEFAULT NULL COMMENT '请求id',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_apply_code` (`apply_code`) USING BTREE,
KEY `idx_approval_time` (`approval_time`) USING BTREE,
KEY `idx_apply_time` (`apply_time`) USING BTREE,
KEY `idx_apply_user` (`apply_user`) USING BTREE,
KEY `idx_approval_user` (`approval_user`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户金额申请';
-- ----------------------------
-- Table structure for merchant_credit_apply_detail
-- ----------------------------
DROP TABLE IF EXISTS `merchant_credit_apply_detail`;
CREATE TABLE `merchant_credit_apply_detail` (
`id` bigint(20) NOT NULL COMMENT 'id',
`apply_code` varchar(20) DEFAULT NULL COMMENT '申请编码',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`type` varchar(20) DEFAULT NULL COMMENT '变动类型',
`amount` decimal(10,0) DEFAULT NULL COMMENT '金额',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户明细记录';
-- ----------------------------
-- Table structure for merchant_rebate_record
-- ----------------------------
DROP TABLE IF EXISTS `merchant_rebate_record`;
CREATE TABLE `merchant_rebate_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rebate_no` int(11) DEFAULT NULL COMMENT '返点记录编号',
`mer_code` varchar(50) DEFAULT NULL COMMENT '商户编号',
`rebate_date` date DEFAULT NULL COMMENT '返点日期',
`rebate_amount` decimal(15,2) DEFAULT NULL COMMENT '返点金额',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for merchant_store_relation
-- ----------------------------
DROP TABLE IF EXISTS `merchant_store_relation`;
CREATE TABLE `merchant_store_relation` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`store_code` varchar(20) DEFAULT NULL COMMENT '门店编码',
`consum_type` varchar(100) DEFAULT NULL COMMENT '消费方式',
`store_alias` varchar(100) DEFAULT NULL COMMENT '门店别名',
`is_rebate` int(11) DEFAULT NULL COMMENT '是否返利',
`rebate_type` varchar(100) DEFAULT NULL COMMENT '返利类型',
`rebate_ratio` decimal(5,2) DEFAULT NULL COMMENT '返利比率',
`ramark` varchar(255) DEFAULT NULL COMMENT '备注',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
`status` int(11) DEFAULT NULL COMMENT '状态',
`sync_status` int(11) DEFAULT NULL COMMENT '同步状态',
PRIMARY KEY (`id`),
KEY `idx_msr_mer_code_store_code` (`mer_code`,`store_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1356442996849471507 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商户消费场景配置';
-- ----------------------------
-- Table structure for mer_deposit_apply_file
-- ----------------------------
DROP TABLE IF EXISTS `mer_deposit_apply_file`;
CREATE TABLE `mer_deposit_apply_file` (
`id` bigint(20) NOT NULL,
`mer_deposit_apply_code` varchar(64) NOT NULL COMMENT '申请编码',
`file_url` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for month_settle
-- ----------------------------
DROP TABLE IF EXISTS `month_settle`;
CREATE TABLE `month_settle` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`settle_no` varchar(50) DEFAULT NULL COMMENT '账单编号',
`settle_month` varchar(20) DEFAULT NULL COMMENT '账单月',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`trans_amount` decimal(15,2) DEFAULT NULL COMMENT '交易金额',
`settle_amount` decimal(15,2) DEFAULT NULL COMMENT '结算金额',
`settle_self_amount` decimal(15,2) DEFAULT NULL COMMENT '结算的自费额度',
`rebate_amount` decimal(15,2) DEFAULT NULL COMMENT '返利金额',
`order_num` int(11) DEFAULT NULL COMMENT '交易笔数',
`rec_status` varchar(20) DEFAULT NULL COMMENT '对账状态(待确认-unconfirmed;已确认-confirmed)',
`settle_status` varchar(20) DEFAULT NULL COMMENT '结算状态(待结算-unsettled;已结算-settled)',
`send_status` varchar(20) DEFAULT NULL COMMENT '发送状态(待发送-unsended;已发送-sended)',
`send_time` datetime DEFAULT NULL COMMENT '发送时间',
`confirm_time` datetime DEFAULT NULL COMMENT '确定时间',
`settle_start_time` date DEFAULT NULL COMMENT '账单开始时间',
`settle_end_time` datetime DEFAULT NULL COMMENT '账单结束时间',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标志',
`settle_statistics_info` text COMMENT '账单账户类型统计信息',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=214 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='月度结算账单';
-- ----------------------------
-- Table structure for order_info
-- ----------------------------
DROP TABLE IF EXISTS `order_info`;
CREATE TABLE `order_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` varchar(20) DEFAULT NULL COMMENT '订单号',
`trans_no` varchar(50) DEFAULT NULL COMMENT '交易流水号',
`return_trans_no` varchar(50) DEFAULT NULL COMMENT '退款流水号',
`goods` longtext COMMENT '商品',
`merchant_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`merchant_name` varchar(50) DEFAULT NULL COMMENT '商户名称',
`store_code` varchar(20) DEFAULT NULL COMMENT '门店编码',
`store_name` varchar(50) DEFAULT NULL COMMENT '门店名称',
`account_code` int(10) DEFAULT NULL COMMENT '账户',
`account_name` varchar(50) DEFAULT NULL COMMENT '账户名称',
`account_mer_code` varchar(20) DEFAULT NULL COMMENT '账户所属商户编码',
`trans_type` varchar(20) DEFAULT NULL COMMENT '交易类型',
`trans_type_name` varchar(20) DEFAULT NULL COMMENT '交易类型名称',
`card_id` int(11) DEFAULT NULL COMMENT '卡号',
`order_amount` decimal(12,2) DEFAULT NULL COMMENT '订单金额',
`order_time` datetime DEFAULT NULL COMMENT '订单时间',
`pay_code` varchar(50) DEFAULT NULL COMMENT '支付编码',
`pay_name` varchar(50) DEFAULT NULL COMMENT '支付名称',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_order_id` (`order_id`) COMMENT '订单id唯一索引'
) ENGINE=InnoDB AUTO_INCREMENT=162622 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for order_trans_relation
-- ----------------------------
DROP TABLE IF EXISTS `order_trans_relation`;
CREATE TABLE `order_trans_relation` (
`id` bigint(20) NOT NULL,
`order_id` varchar(20) DEFAULT NULL COMMENT '订单号',
`trans_no` varchar(20) DEFAULT NULL COMMENT '交易号',
`type` varchar(20) DEFAULT NULL COMMENT '类型(充值订单还是消费订单)',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标记',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for product_info
-- ----------------------------
DROP TABLE IF EXISTS `product_info`;
CREATE TABLE `product_info` (
`product_code` varchar(20) NOT NULL COMMENT '商品编码',
`product_name` varchar(100) DEFAULT NULL COMMENT '商品名称',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`product_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for pull_account_detail_record
-- ----------------------------
DROP TABLE IF EXISTS `pull_account_detail_record`;
CREATE TABLE `pull_account_detail_record` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`del_date` varchar(20) DEFAULT NULL COMMENT '处理日期',
`del_status` varchar(20) DEFAULT NULL COMMENT '处理状态 success-成功 fail-失败',
`try_count` int(10) DEFAULT NULL COMMENT '重试次数',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=816 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='账户交易明细拉取记录表';
-- ----------------------------
-- Table structure for sequence
-- ----------------------------
DROP TABLE IF EXISTS `sequence`;
CREATE TABLE `sequence` (
`id` bigint(20) NOT NULL COMMENT 'pk',
`sequence_type` varchar(30) DEFAULT NULL COMMENT '序列类型',
`prefix` varchar(20) DEFAULT NULL,
`sequence_no` bigint(20) DEFAULT NULL COMMENT '序列号',
`min_sequence` bigint(20) DEFAULT NULL,
`max_sequence` bigint(20) DEFAULT NULL,
`handler_for_max` varchar(100) DEFAULT NULL,
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`deleted` tinyint(1) DEFAULT NULL COMMENT '删除标记',
`version` int(11) DEFAULT NULL COMMENT '版本',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_Sequence_type_Prefix` (`sequence_type`,`prefix`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for settle_detail
-- ----------------------------
DROP TABLE IF EXISTS `settle_detail`;
CREATE TABLE `settle_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`settle_no` varchar(50) DEFAULT NULL COMMENT '账单编号',
`order_id` varchar(50) DEFAULT NULL COMMENT '订单编码',
`trans_no` varchar(50) DEFAULT NULL COMMENT '交易流水号',
`account_code` int(10) DEFAULT NULL COMMENT '账户',
`account_name` varchar(20) DEFAULT NULL COMMENT '账户名称',
`card_id` int(11) DEFAULT NULL COMMENT '卡号',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`mer_name` varchar(50) DEFAULT NULL COMMENT '商户名称',
`store_code` varchar(20) DEFAULT NULL COMMENT '门店编码',
`store_name` varchar(50) DEFAULT NULL COMMENT '门店名称',
`trans_time` datetime DEFAULT NULL COMMENT '交易时间',
`pos` varchar(20) DEFAULT NULL COMMENT 'pos机器编码',
`pay_code` varchar(20) DEFAULT NULL COMMENT '支付编码',
`pay_name` varchar(50) DEFAULT NULL COMMENT '支付名称',
`trans_type` varchar(20) DEFAULT NULL COMMENT '交易类型',
`trans_type_name` varchar(20) DEFAULT NULL COMMENT '交易类型名',
`trans_amount` decimal(15,2) DEFAULT NULL COMMENT '交易金额',
`mer_account_type` varchar(20) DEFAULT NULL COMMENT '福利类型(餐费、交通费等)',
`mer_account_type_name` varchar(20) DEFAULT NULL COMMENT '福利类型(餐费、交通费等)',
`account_amount` decimal(15,2) DEFAULT NULL COMMENT '子账户扣款金额',
`account_balance` decimal(15,2) DEFAULT NULL COMMENT '子账户余额',
`mer_deduction_amount` decimal(20,2) DEFAULT NULL COMMENT '商户余额扣款金额',
`mer_credit_deduction_amount` decimal(15,2) DEFAULT NULL COMMENT '商户信用扣款金额',
`self_deduction_amount` decimal(15,2) DEFAULT NULL COMMENT '自费扣款金额',
`data_type` varchar(20) DEFAULT NULL COMMENT '数据支付类型 welfare-员工卡支付 third-其它三方支付',
`settle_flag` varchar(20) DEFAULT NULL COMMENT '结算标志 settled已结算 unsettled未结算',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
`version` int(11) DEFAULT NULL COMMENT '版本',
`rebate_amount` decimal(15,4) DEFAULT NULL COMMENT '返点标志 unrebated未返点 rebated 已返点',
PRIMARY KEY (`id`),
KEY `idx_trans_time` (`trans_time`) USING BTREE,
KEY `idx_mer_code` (`mer_code`),
KEY `idx_trans_no` (`trans_no`) USING BTREE,
KEY `idx_settle_flag` (`settle_flag`)
) ENGINE=InnoDB AUTO_INCREMENT=16707 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ----------------------------
-- Table structure for supplier_store
-- ----------------------------
DROP TABLE IF EXISTS `supplier_store`;
CREATE TABLE `supplier_store` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`mer_code` varchar(20) DEFAULT NULL COMMENT '商户代码',
`store_code` varchar(20) DEFAULT NULL COMMENT '门店代码',
`store_name` varchar(100) DEFAULT NULL COMMENT '门店名称',
`store_level` int(11) DEFAULT NULL COMMENT '门店层级',
`store_parent` varchar(20) DEFAULT NULL COMMENT '父级门店',
`store_path` varchar(50) DEFAULT NULL COMMENT '门店路径',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`consum_type` varchar(100) DEFAULT NULL COMMENT '消费方式',
`status` int(11) DEFAULT NULL COMMENT '状态',
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志',
`create_user` varchar(50) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_user` varchar(50) DEFAULT NULL COMMENT '更新人',
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
`external_code` varchar(20) DEFAULT NULL COMMENT '外部编码',
`version` int(11) DEFAULT NULL COMMENT '版本',
`cashier_no` varchar(255) DEFAULT NULL COMMENT '虚拟收银机号',
`sync_status` int(11) DEFAULT NULL COMMENT '门店同步到商城状态',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_store_code` (`store_code`) USING BTREE,
UNIQUE KEY `uni_ss_store_code_cashier_no` (`store_code`,`cashier_no`)
) ENGINE=InnoDB AUTO_INCREMENT=1356251253482819587 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='供应商门店';
-- ----------------------------
-- Table structure for temp_account_deposit_apply
-- ----------------------------
DROP TABLE IF EXISTS `temp_account_deposit_apply`;
CREATE TABLE `temp_account_deposit_apply` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`file_id` varchar(64) NOT NULL,
`phone` varchar(32) NOT NULL,
`recharge_amount` decimal(15,2) DEFAULT NULL,
`request_id` varchar(64) NOT NULL,
`account_code` varchar(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_file_id` (`file_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1355830298071756808 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- data
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('1', 'ApprovalStatus', 'AUDIT_SUCCESS', '通过', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('2', 'ApprovalStatus', 'AUDIT_FAILED', '不通过', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('3', 'ApprovalStatus', 'AUDITING', '待审核', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('4', 'Merchant.merCreditType', 'rechargeLimit', '添加充值额度', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('5', 'Merchant.merCreditType', 'currentBalance', '添加余额', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('6', 'Merchant.merCreditType', 'creditLimit', '设置信用额度', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('7', 'Merchant.merCreditType', 'rebateLimit', '消耗返点', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('8', 'Pos.TradeMode', '0', '自定价格', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('9', 'Pos.TradeMode', '1', '固定价格', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('10', 'Pos.TradeMode', '2', '动态价格', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('11', 'Pos.OnlineState', '0', '离线', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('12', 'Pos.OnlineState', '1', '在线', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('13', 'Pos.OnlineState', '2', '活跃', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('14', 'Pos.status', '0', '初始', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('15', 'Pos.status', '1', '可用', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('16', 'Pos.status', '-1', '禁用', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('17', 'Pos.updateRange', '0', '全部更新', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('18', 'Pos.updateRange', '1', '门店更新', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('19', 'Pos.updateRange', '2', '终端更新', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('20', 'Pos.forced', '1', '强制', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('21', 'Pos.forced', '0', '非强制', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('22', 'Pos.available', '1', '有效', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('23', 'Pos.available', '0', '无效', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('24', 'Pos.type', '1', '海信手持pos机', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('25', 'Pos.type', '2', '德卡双屏收银机', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('26', 'Pos.type', '3', '海信自助收银机\n', '1', '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('27', 'MerchantStoreRelation.status', '1', '启用', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('28', 'MerchantStoreRelation.status', '0', '禁用', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('29', 'CardApply.type', 'STORED_VALUE_CARD', '储值卡', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('34', 'CardApply.medium', 'IC_CARD', 'ic卡', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('39', 'CardApply.status', '1', '启用', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('40', 'CardApply.status', '0', '禁用', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('41', 'CardInfo.status', '0', '新增', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('42', 'CardInfo.status', '1', '已写入', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('43', 'CardInfo.status', '2', '已绑定', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('44', 'MerchantStoreRelation.rebate.type', 'EMPLOYEE_CARD_NUMBER', '员工卡号支付', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('45', 'MerchantStoreRelation.rebate.type', 'OTHER_PAY', '其他支付方式', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('46', 'shoppingPlatformUser.status', '0', '锁定', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('47', 'shoppingPlatformUser.status', '1', '正常', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('48', 'shoppingPlatformUser.status', '2', '删除', '1', '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('49', 'Merchant.merIdentity', 'PARTER', '客户', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('50', 'Merchant.merIdentity', 'SUPPLIER', '供应商', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('51', 'Merchant.merCooperationMode', 'PAY_FIRST', '先付费', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('52', 'Merchant.merCooperationMode', 'PAYED', '后付费', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('53', 'Merchant.merType', 'HEADQUARTERS', '总部', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('54', 'Merchant.merType', 'BRANCH_HEADQUARTERS', '分区总部', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('55', 'Merchant.selfRecharge', '1', '是', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('56', 'Merchant.selfRecharge', '0', '否', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('57', 'Department.departmentType', 'DISTRIBUTION_CENTER', '配送中心', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('58', 'Department.departmentType', 'DEPARTMENT', '部门', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('59', 'Department.departmentType', 'GROUP', '小组', NULL, '0', '3');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('60', 'SupplierStore.consumType', 'O2O', 'O2O', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('61', 'SupplierStore.consumType', 'ONLINE_MALL', '线上商城', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('62', 'SupplierStore.consumType', 'SHOP_CONSUMPTION', '到店消费', NULL, '0', '3');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('63', 'SupplierStore.status', '1', '激活', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('64', 'SupplierStore.status', '0', '未激活', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('65', 'MerchantAddress.addressType', 'NORMAL', '普通', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('66', 'MerchantAddress.addressType', 'MAIL_BOX', '快递柜', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('67', 'CardApply.type', 'DISCOUNT_STORED_VALUE_CARD', '折扣储值卡', NULL, '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('68', 'Pos.printable', '0', '不打印', NULL, '0', '1');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('69', 'Pos.printable', '1', '打印', NULL, '0', '2');
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('73', 'CardInfo.enabled', '1', '启用', NULL, '0', NULL);
INSERT INTO `dict` (`id`, `dict_type`, `dict_code`, `dict_name`, `status`, `deleted`, `sort`) VALUES ('74', 'CardInfo.enabled', '0', '禁用', NULL, '0', NULL);
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1', 'merchant_credit_apply', 'MCP', '10', '1', '99999999999999', 'com.welfare.service.sequence.CommonMaxHandler', NULL, '2021-01-20 21:54:08', 'admin', '2021-01-26 10:06:04', '0', '46');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('2', 'deposit', NULL, '10', '1', '9999999', NULL, NULL, '2021-01-20 21:54:08', '15111989630', '2021-01-26 10:24:14', '0', '74');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('4', 'account_type_code', NULL, '10', '1', '9999999', NULL, NULL, '2021-01-20 21:54:08', '15111989650', '2021-01-26 15:19:48', '0', '32');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('5', 'account_code', NULL, '1000000000', '1000000000', '99999999999999', NULL, NULL, '2021-01-20 21:54:08', 'chenyx', '2021-01-26 14:45:26', '0', '3728');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('7', 'account_deposit_apply', 'ADP', '10', '1', '99999999999999', 'com.welfare.service.sequence.CommonMaxHandler', NULL, '2021-01-20 21:54:08', '15111989630', '2021-01-26 10:24:14', '0', '37');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('8', 'mer_code', 'M', '100', '100', '999', 'com.welfare.service.sequence.SinglePrefixAddHandler', NULL, '2021-01-21 09:09:10', 'anonymous', '2021-01-26 14:03:19', '0', '38');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('9', 'department_code', NULL, '10000000', '10000000', '99999999', 'com.welfare.service.sequence.CommonMaxHandler', NULL, '2021-01-21 09:09:10', 'anonymous', '2021-01-26 14:43:34', '0', '43');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('10', 'mer_account_type', NULL, '1000', '1000', '999999', 'com.welfare.service.sequence.CommonMaxHandler', NULL, '2021-01-21 09:09:10', 'anonymous', '2021-01-22 13:41:32', '0', '26');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352072534357741570', 'CARDID', 'M103', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 09:56:27', 'admin', '2021-01-21 15:50:00', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352077971132026882', 'CARDID', 'M110', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 10:18:03', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352083443503403010', 'CARDID', 'M108', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 10:39:48', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352083498482339841', 'CARDID', 'M109', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 10:40:01', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352151464133582849', 'CARDID', 'M106', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 15:10:05', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352161284890832898', 'CARDID', 'M112', '100000000', NULL, NULL, NULL, 'admin', '2021-01-21 15:49:07', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352444082721714178', 'CARDID', 'M115', '100000000', NULL, NULL, NULL, 'admin', '2021-01-22 10:32:51', 'admin', '2021-01-26 15:08:06', '0', '7');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352456294546862081', 'CARDID', 'M114', '100000000', NULL, NULL, NULL, 'admin', '2021-01-22 11:21:23', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352519065401573378', 'mer_account_type', 'M107', '10000', NULL, NULL, NULL, 'min.wu', '2021-01-22 15:30:48', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352520100908122113', 'mer_account_type', 'M118', '10000', NULL, NULL, NULL, 'anonymous', '2021-01-22 15:34:55', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352523051470962689', 'mer_account_type', 'M116', '10001', NULL, NULL, NULL, 'anonymous', '2021-01-22 15:46:39', 'anonymous', '2021-01-22 15:47:02', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352523959420338178', 'mer_account_type', 'M119', '10001', NULL, NULL, NULL, 'anonymous', '2021-01-22 15:50:15', 'anonymous', '2021-01-22 15:50:38', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352529493162737666', 'mer_account_type', 'M101', '10001', NULL, NULL, NULL, 'anonymous', '2021-01-22 16:12:15', 'anonymous', '2021-01-22 16:12:26', '0', '2');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1352876582698770434', 'mer_account_type', 'M126', '10001', NULL, NULL, NULL, 'anonymous', '2021-01-23 15:11:27', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353537223080083458', 'CARDID', 'M124', '100000001', NULL, NULL, NULL, 'admin', '2021-01-25 10:56:36', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353578535120601089', 'mer_account_type', 'M134', '10001', NULL, NULL, NULL, 'anonymous', '2021-01-25 13:40:46', 'anonymous', '2021-01-25 13:40:46', '0', '2');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353583386579763202', 'mer_account_type', 'M133', '10002', NULL, NULL, NULL, 'anonymous', '2021-01-25 14:00:02', 'anonymous', '2021-01-25 14:00:16', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353586815540723714', 'CARDID', 'M132', '100000002', NULL, NULL, NULL, 'admin', '2021-01-25 14:13:40', NULL, NULL, '0', '0');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353594203186462721', 'CARDID', 'M134', '100000004', NULL, NULL, NULL, 'admin', '2021-01-25 14:43:01', 'admin', '2021-01-25 14:47:27', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353608754095259650', 'mer_account_type', 'M132', '10002', NULL, NULL, NULL, 'anonymous', '2021-01-25 15:40:50', 'anonymous', '2021-01-25 15:40:51', '0', '1');
INSERT INTO `sequence` (`id`, `sequence_type`, `prefix`, `sequence_no`, `min_sequence`, `max_sequence`, `handler_for_max`, `create_user`, `create_time`, `update_user`, `update_time`, `deleted`, `version`) VALUES ('1353907634263293954', 'CARDID', 'M136', '100000002', NULL, NULL, NULL, 'admin', '2021-01-26 11:28:29', NULL, NULL, '0', '0');
|
# Host: 127.0.0.1 (Version 5.1.50-community)
# Date: 2018-01-14 14:47:06
# Generator: MySQL-Front 6.0 (Build 2.20)
#
# Structure for table "categorias"
#
DROP TABLE IF EXISTS `categorias`;
CREATE TABLE `categorias` (
`idcategoria` bigint(20) NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) NOT NULL,
PRIMARY KEY (`idcategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
#
# Data for table "categorias"
#
#
# Structure for table "permisos"
#
DROP TABLE IF EXISTS `permisos`;
CREATE TABLE `permisos` (
`id_permisos` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id_permisos`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
#
# Data for table "permisos"
#
INSERT INTO `permisos` VALUES (1,'Administrador'),(2,'Gerente'),(3,'Empleado');
#
# Structure for table "permisos_denegados"
#
DROP TABLE IF EXISTS `permisos_denegados`;
CREATE TABLE `permisos_denegados` (
`id_permneg` int(11) NOT NULL AUTO_INCREMENT,
`id_rolf` bigint(20) DEFAULT NULL,
`id_permisosf` bigint(1) DEFAULT NULL,
PRIMARY KEY (`id_permneg`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
#
# Data for table "permisos_denegados"
#
INSERT INTO `permisos_denegados` VALUES (1,2,1),(2,3,2),(3,3,1);
#
# Structure for table "proveedores"
#
DROP TABLE IF EXISTS `proveedores`;
CREATE TABLE `proveedores` (
`idproveedor` bigint(20) NOT NULL AUTO_INCREMENT,
`nombre` varchar(60) NOT NULL DEFAULT '0',
`direccion` varchar(60) NOT NULL DEFAULT '0',
`ciudad` varchar(30) NOT NULL DEFAULT '0',
`estado` varchar(20) NOT NULL DEFAULT '0',
`telefono` varchar(15) NOT NULL DEFAULT '0',
`extencion` int(11) NOT NULL DEFAULT '0',
`repre` varchar(60) NOT NULL DEFAULT '0',
`emailrepre` varchar(50) NOT NULL DEFAULT '0',
`telrepre` varchar(15) NOT NULL DEFAULT '0',
`status` varchar(20) NOT NULL DEFAULT '0',
`idcategoria` bigint(20) NOT NULL DEFAULT '0',
`id_usuariof` bigint(20) DEFAULT NULL,
PRIMARY KEY (`idproveedor`),
KEY `idcategoriaf` (`idcategoria`),
CONSTRAINT `idcategoriaf` FOREIGN KEY (`idcategoria`) REFERENCES `categorias` (`idcategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
#
# Data for table "proveedores"
#
#
# Structure for table "productos"
#
DROP TABLE IF EXISTS `productos`;
CREATE TABLE `productos` (
`idproductos` bigint(20) NOT NULL,
`nombre` varchar(50) NOT NULL,
`descripcion` varchar(50) NOT NULL,
`tiemporesp` varchar(50) NOT NULL,
`capacidadprod` varchar(50) NOT NULL,
`lugarentrega` varchar(50) NOT NULL,
`idproveedorf` bigint(20) NOT NULL,
PRIMARY KEY (`idproductos`),
KEY `idproveedorf` (`idproveedorf`),
CONSTRAINT `idproveedorf` FOREIGN KEY (`idproveedorf`) REFERENCES `proveedores` (`idproveedor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
#
# Data for table "productos"
#
#
# Structure for table "roles"
#
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
`id_rol` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id_rol`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
#
# Data for table "roles"
#
INSERT INTO `roles` VALUES (1,'Administrador'),(2,'Gerente'),(3,'Empleado'),(4,'Otro');
#
# Structure for table "solicita"
#
DROP TABLE IF EXISTS `solicita`;
CREATE TABLE `solicita` (
`idsolicita` bigint(20) NOT NULL AUTO_INCREMENT,
`comnt` varchar(80) NOT NULL DEFAULT '0',
`idproveedorf2` bigint(20) NOT NULL DEFAULT '0',
`idusuariof` bigint(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`idsolicita`),
KEY `idproveedorf2` (`idproveedorf2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
#
# Data for table "solicita"
#
#
# Structure for table "usuarios"
#
DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE `usuarios` (
`id_us` bigint(20) NOT NULL AUTO_INCREMENT,
`nombre` varchar(60) NOT NULL,
`cuenta` varchar(20) NOT NULL,
`clave` varchar(128) NOT NULL,
`status` varchar(20) DEFAULT NULL,
`id_rolf` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id_us`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
#
# Data for table "usuarios"
#
INSERT INTO `usuarios` VALUES (1,'asd','asd','1e48c4420b7073bc11916c6c1de226bb','Activo','1'),(2,'nombre','cuenta','d9b1d7db4cd6e70935368a1efb10e377','Activo','1'),(3,'Empleado','empleado','202cb962ac59075b964b07152d234b70','Activo','3'),(4,'eva','eva2','202cb962ac59075b964b07152d234b70','Activo','1'),(5,'Gerente','gerente','202cb962ac59075b964b07152d234b70','Activo','2'),(6,'Hermelindo Gomez','herme','202cb962ac59075b964b07152d234b70','Activo','1'),(7,'Leo Castellanos','leo','202cb962ac59075b964b07152d234b70','Activo','1'),(8,'Miguel Valencia','mike','202cb962ac59075b964b07152d234b70','Desactivado','1'),(10,'Santiago Rivera','santi','202cb962ac59075b964b07152d234b70','Activo','1'),(11,'Suker','suker','','Activo','1');
|
create table users(
id int(6) not null auto_increment,
role varchar(20) not null,
fname varchar(60) not null,
lname varchar(60) not null,
middle_name varchar(50),
preffered_name varchar(50),
prefix varchar(20),
suffix varchar(10),
title varchar(60),
dob varchar(10) not null,
gender varchar(10) not null,
vat varchar(20),
nationality varchar(50),
intake_date varchar(10),
business_user varchar(255),
cost_center varchar(255),
legal_entity varchar(20) not null,
affiliation varchar(50) not null,
student_type varchar(50) not null,
entity_legacy_id varchar(12) not null,
coach_legacy_id varchar(12),
company_legacy_id varchar(12),
coach_affiliation varchar(25),
tm_affiliation varchar(25),
neptune_person_id varchar(12),
neptune_coach_id varchar(12),
neptune_customer_id varchar(12),
PRIMARY KEY(id)
)ENGINE=InnoDB; |
-- phpMyAdmin SQL Dump
-- version 4.3.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 18, 2015 at 04:43 PM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `pdfclaims`
--
-- --------------------------------------------------------
--
-- Table structure for table `distances`
--
CREATE TABLE IF NOT EXISTS `distances` (
`location_from` varchar(40) CHARACTER SET latin1 NOT NULL,
`location_to` varchar(40) CHARACTER SET latin1 NOT NULL,
`km` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `distances`
--
INSERT INTO `distances` (`location_from`, `location_to`, `km`) VALUES
('Ang Mo Kio', 'Bedok', 13),
('Bedok', 'City Hall', 12),
('Office', 'Bedok', 5),
('Office', 'Jurong', 9),
('Pasir Ris', 'Jurong', 35);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `distances`
--
ALTER TABLE `distances`
ADD PRIMARY KEY (`location_from`,`location_to`), ADD UNIQUE KEY `location_from` (`location_from`,`location_to`);
/*!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 */;
|
/* Formatted on 5/14/2019 4:54:05 PM (QP5 v5.206) */
-- Start of DDL Script for Table GPLATFORM.GAPI_SERVICES_HOSTS
-- Generated 5/14/2019 4:54:05 PM from GPLATFORM@HSDEV
CREATE TABLE gapi_services_hosts
(
service_id VARCHAR2 (255),
domain VARCHAR2 (255),
CONSTRAINT fk_gapi_service_id FOREIGN KEY (service_id) REFERENCES gapi_services (id)
) |
CREATE TABLE `series` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`description` text NOT NULL,
`published` tinyint(1) NOT NULL DEFAULT '0',
`is_archived` tinyint(1) NOT NULL DEFAULT '0',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
DROP TABLE if exists REVISION cascade;
DROP TABLE if exists NETTOYAGE cascade;
DROP TABLE if exists SITUATION cascade;
DROP TABLE if exists VOITURE cascade;
DROP TABLE if exists EMPLACEMENT cascade;
DROP TABLE if exists CATEGORIE;
DROP TABLE if exists CONDUCTEUR;
DROP TABLE if exists LOCATION;
DROP TABLE if exists VILLE;
DROP TABLE if exists MARQUE;
DROP TABLE if exists RESERVATION;
--
-- Structure de la table CATEGORIE
--
CREATE TABLE CATEGORIE (
numCat VARCHAR(5) NOT NULL,
libelle VARCHAR(20) NOT NULL,
classe VARCHAR(30) NOT NULL,
prixKm FLOAT NOT NULL,
CHECK (prixKm>0),
PRIMARY KEY (numCat)
);
--
-- Contenu de la table CATEGORIE
--
insert into CATEGORIE values ('CAT1', 'Minibus','Classe1',1.29);
insert into CATEGORIE values ('CAT2', 'Monospace/SUV','Classe2',0.87);
insert into CATEGORIE values ('CAT3', 'Berline','Classe3',0.76);
insert into CATEGORIE values ('CAT4', 'Citadine','Classe4',0.58);
--
-- Structure de la table EMPLACEMENT
--
CREATE TABLE EMPLACEMENT (
numEmp VARCHAR (5) NOT NULL,
vide BOOLEAN NOT NULL,
PRIMARY KEY (numEmp)
);
--
-- Contenu de la table EMPLACEMENT
--
insert into EMPLACEMENT values ('E01', '0');
insert into EMPLACEMENT values ('E02', '1');
insert into EMPLACEMENT values ('E03', '0');
insert into EMPLACEMENT values ('E04', '0');
insert into EMPLACEMENT values ('E05', '0');
insert into EMPLACEMENT values ('E06', '1');
insert into EMPLACEMENT values ('E07', '0');
insert into EMPLACEMENT values ('E08', '0');
insert into EMPLACEMENT values ('E09', '0');
insert into EMPLACEMENT values ('E10', '0');
insert into EMPLACEMENT values ('E11', '1');
insert into EMPLACEMENT values ('E12', '1');
insert into EMPLACEMENT values ('E13', '1');
insert into EMPLACEMENT values ('E14', '1');
--
-- Structure de la table MARQUE
--
CREATE TABLE MARQUE (
numM VARCHAR NOT NULL,
nomM VARCHAR (30)NOT NULL,
PRIMARY KEY (numM)
);
--
-- Contenu de la table MARQUE
--
insert into MARQUE values ('M1', 'Peugeot');
insert into MARQUE values ('M2', 'Renault');
insert into MARQUE values ('M3', 'Citroen');
insert into MARQUE values ('M4', 'Fiat');
insert into MARQUE values ('M5', 'BMW');
--
-- Structure de la table VOITURE
--
CREATE TABLE VOITURE (
numIm VARCHAR (10) NOT NULL,
nbKm INTEGER NOT NULL,
nbPlaces INTEGER NOT NULL,
numCat VARCHAR constraint numCat references CATEGORIE(numCat) on delete cascade,
numM VARCHAR constraint numM references MARQUE(numM) on delete cascade,
PRIMARY KEY (numIm)
);
--
-- Contenu de la table VOITURE
--
insert into VOITURE values ('AA-316-BN', 14600,4,'CAT1','M1');
insert into VOITURE values ('BV-528-XR', 11000,5,'CAT2','M2');
insert into VOITURE values ('PR-622-VC', 15000,5,'CAT1','M3');
insert into VOITURE values ('OL-824-PC', 3300,7,'CAT3','M5');
insert into VOITURE values ('MK-928-TA', 9800,7,'CAT2','M3');
insert into VOITURE values ('SX-026-PK', 10000,9,'CAT4','M4');
insert into VOITURE values ('UY-864-PL', 15000,9,'CAT3','M1');
insert into VOITURE values ('HV-432-RX', 6400,9,'CAT4','M4');
--
-- Structure de la table SITUATION
--
CREATE TABLE SITUATION (
numIm VARCHAR constraint numIm references VOITURE(numIm) on delete cascade,
numEmp VARCHAR constraint numEmp references EMPLACEMENT(numEmp) on delete cascade,
PRIMARY KEY (numIm,numEmp) );
--
-- Contenu de la table SITUATION
--
insert into SITUATION values ('AA-316-BN','E01');
insert into SITUATION values ('BV-528-XR','E03');
insert into SITUATION values ('PR-622-VC','E04');
insert into SITUATION values ('OL-824-PC','E05');
insert into SITUATION values ('MK-928-TA','E07');
insert into SITUATION values ('SX-026-PK','E09');
insert into SITUATION values ('UY-864-PL','E08');
insert into SITUATION values ('HV-432-RX','E10');
--
-- Structure de la table NETTOYAGE
--
CREATE TABLE NETTOYAGE (
numN VARCHAR NOT NULL,
dateN DATE,
comN VARCHAR (300),
numIm VARCHAR constraint numIm references VOITURE(numIm) on delete cascade,
PRIMARY KEY (numN,numIm)
);
--
-- Contenu de la table NETTOYAGE
--
insert into NETTOYAGE values ('N001',TO_DATE('02/02/2018','DD/MM/YYYY'),NULL,'HV-432-RX');
insert into NETTOYAGE values ('N002',TO_DATE('21/04/2018','DD/MM/YYYY'),NULL,'MK-928-TA');
insert into NETTOYAGE values ('N003',TO_DATE('06/04/2018','DD/MM/YYYY'),NULL,'PR-622-VC');
insert into NETTOYAGE values ('N004',TO_DATE('13/09/2018','DD/MM/YYYY'),NULL,'BV-528-XR');
insert into NETTOYAGE values ('N005',TO_DATE('15/06/2018','DD/MM/YYYY'),NULL,'UY-864-PL');
--
-- Structure de la table REVISION
--
CREATE TABLE REVISION (
numR VARCHAR NOT NULL,
dateR DATE,
comR VARCHAR (300),
numIm VARCHAR constraint numIm references VOITURE(numIm) on delete cascade,
PRIMARY KEY (numR,numIm)
);
--
-- Contenu de la table REVISION
--
insert into REVISION values ('R1',TO_DATE('28/08/2018','DD/MM/YYYY'),NULL,'AA-316-BN');
insert into REVISION values ('R2',TO_DATE('15/06/2018','DD/MM/YYYY'),NULL,'SX-026-PK');
insert into REVISION values ('R3',TO_DATE('03/04/2018','DD/MM/YYYY'),NULL,'UY-864-PL');
insert into REVISION values ('R4',TO_DATE('05/02/2018','DD/MM/YYYY'),NULL,'SX-026-PK');
insert into REVISION values ('R5',TO_DATE('13/09/2018','DD/MM/YYYY'),NULL,'OL-824-PC');
--
-- Structure de la table VILLE
--
CREATE TABLE VILLE (
cp VARCHAR (10) NOT NULL,
commune VARCHAR (50) NOT NULL,
PRIMARY KEY (cp)
);
--
-- Contenu de la table VILLE
--
insert into VILLE values ('33000','Bordeaux');
insert into VILLE values ('31000','Toulouse');
insert into VILLE values ('59000','Lille');
insert into VILLE values ('69000','Lyon');
insert into VILLE values ('13000','Marseille');
insert into VILLE values ('64000','Pau');
insert into VILLE values ('35000','Rennes');
--
-- Structure de la table CONDUCTEUR
--
CREATE TABLE CONDUCTEUR (
numPermis VARCHAR (20) NOT NULL,
nom VARCHAR (50) NOT NULL,
prenom VARCHAR (30) NOT NULL,
dateNais DATE NOT NULL,
adresse VARCHAR (50) NOT NULL,
mail VARCHAR (30) NOT NULL,
portable VARCHAR (12) NOT NULL,
fixe VARCHAR (12),
numId VARCHAR (30) NOT NULL,
cp VARCHAR constraint cp references VILLE(cp) on delete cascade,
PRIMARY KEY (numPermis)
);
--
-- Contenu de la table CONDUCTEUR
--
insert into CONDUCTEUR values ('C1','Robert','Albert',TO_DATE('06/05/1968','DD/MM/YYYY'),'11 rue Fouchet','robert.albert@gmail.com','0612345678',NULL,'01','33000');
insert into CONDUCTEUR values ('C2','Henri','Berry',TO_DATE('13/09/1988','DD/MM/YYYY'),'46 rue Mout','henry.berry@gmail.com','0612345699',NULL,'02','59000');
insert into CONDUCTEUR values ('C3','Carla','Amstrong',TO_DATE('24/12/1978','DD/MM/YYYY'),'37 rue André','carla.amstrong@gmail.com','0600345699',NULL,'03','69000');
--
-- Structure de la table LOCATION
--
CREATE TABLE LOCATION (
dateDebut DATE NOT NULL,
dateretourPrev DATE NOT NULL,
dateretourEff DATE NOT NULL,
nbKmPrev INTEGER NOT NULL,
nbKmEff INTEGER NOT NULL,
acompte FLOAT,
numPermis VARCHAR constraint numPermis references CONDUCTEUR(numPermis) on delete cascade,
numIm VARCHAR constraint numIm references VOITURE(numIm) on delete cascade,
PRIMARY KEY (numPermis,numIm)
);
--
-- Contenu de la table LOCATION
--
insert into LOCATION values (TO_DATE('12/05/2018','DD/MM/YYYY'),TO_DATE('15/09/2018','DD/MM/YYYY'),TO_DATE('15/09/2018','DD/MM/YYYY'),2000,2150,NULL,'C2','AA-316-BN');
insert into LOCATION values (TO_DATE('12/02/2018','DD/MM/YYYY'),TO_DATE('15/03/2018','DD/MM/YYYY'),TO_DATE('15/04/2018','DD/MM/YYYY'),200,200,NULL,'C3','OL-824-PC');
insert into LOCATION values (TO_DATE('01/01/2018','DD/MM/YYYY'),TO_DATE('01/12/2018','DD/MM/YYYY'),TO_DATE('11/12/2018','DD/MM/YYYY'),100000,100300,NULL,'C1','PR-622-VC');
--
-- Structure de la table RESERVATION
--
CREATE TABLE RESERVATION (
dateDebut DATE NOT NULL,
dateretourPrev DATE NOT NULL,
nbKmPrev INTEGER NOT NULL,
acompte FLOAT,
numPermis VARCHAR constraint numPermis references CONDUCTEUR(numPermis) on delete cascade,
numCat VARCHAR constraint numCat references CATEGORIE(numCat) on delete cascade,
CHECK (nbKmPrev>0),
PRIMARY KEY (numPermis,numCat)
);
--
-- Contenu de la table RESERVATION
--
insert into RESERVATION values (TO_DATE('12/05/2019','DD/MM/YYYY'),TO_DATE('15/09/2019','DD/MM/YYYY'),2000,NULL,'C2','CAT1');
insert into RESERVATION values (TO_DATE('12/05/2020','DD/MM/YYYY'),TO_DATE('15/09/2020','DD/MM/YYYY'),2000,NULL,'C1','CAT1');
|
USE bottega-university;
INSERT INTO
grades(grade, grades_students_id, grades_courses_id)
VALUES
(76, 1, 1),
(82, 1, 2),
(69, 2, 3),
(92, 2, 4),
(88, 2, 5),
(77, 3, 1),
(83, 3, 2),
(74, 3, 5),
(66, 4, 3),
(81, 4, 4),
(79, 5, 2),
(95, 5, 3); |
CREATE TABLE ubuntu (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
code_name NVARCHAR(128) NOT NULL,
version NVARCHAR(64) NOT NULL
);
INSERT INTO ubuntu (code_name, version)
VALUES ('Trusty Tahr', '14.04 LTS');
INSERT INTO ubuntu (code_name, version)
VALUES ('Saucy Salamander', '13.10');
INSERT INTO ubuntu (code_name, version)
VALUES ('Raring Ringtail', '13.04');
INSERT INTO ubuntu (code_name, version)
VALUES ('Quantal Quetzal', '12.10');
INSERT INTO ubuntu (code_name, price)
VALUES ('Precise Pangolin', '12.04 LTS');
INSERT INTO ubuntu (code_name, version)
VALUES ('Oneiric Ocelot', '11.10');
INSERT INTO ubuntu (code_name, version)
VALUES ('Natty Narwhal', '11.04');
INSERT INTO ubuntu (code_name, version)
VALUES ('Maverick Meerkat', '10.10');
INSERT INTO ubuntu (code_name, version)
VALUES ('Lucid Lynx', '10.04 LTS'); |
/*
SQLyog Ultimate v12.3.1 (64 bit)
MySQL - 5.7.24-log : Database - result
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`result` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `result`;
/*Table structure for table `company` */
DROP TABLE IF EXISTS `company`;
CREATE TABLE `company` (
`companyOid` int(5) NOT NULL,
`companyName` varchar(10) NOT NULL,
PRIMARY KEY (`companyOid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `likeman` */
DROP TABLE IF EXISTS `likeman`;
CREATE TABLE `likeman` (
`serialID` varchar(25) NOT NULL,
`manName` varchar(10) DEFAULT NULL,
`manStation` int(5) NOT NULL,
`manAddress` varchar(50) DEFAULT NULL,
`manTel` varchar(11) DEFAULT NULL,
`companyOid` int(5) NOT NULL,
`manType` int(5) NOT NULL,
`operateName` varchar(10) DEFAULT NULL,
`operateDateTime` datetime DEFAULT NULL,
`hot` varchar(20) DEFAULT NULL,
PRIMARY KEY (`serialID`),
KEY `fk_company` (`companyOid`),
KEY `fk_type` (`manType`),
KEY `fk_station` (`manStation`),
CONSTRAINT `fk_company` FOREIGN KEY (`companyOid`) REFERENCES `company` (`companyOid`),
CONSTRAINT `fk_station` FOREIGN KEY (`manStation`) REFERENCES `station` (`manstation`),
CONSTRAINT `fk_type` FOREIGN KEY (`manType`) REFERENCES `type` (`mantype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `station` */
DROP TABLE IF EXISTS `station`;
CREATE TABLE `station` (
`manstation` int(5) NOT NULL AUTO_INCREMENT,
`manstationname` varchar(10) NOT NULL,
PRIMARY KEY (`manstation`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf32;
/*Table structure for table `type` */
DROP TABLE IF EXISTS `type`;
CREATE TABLE `type` (
`mantype` int(5) NOT NULL AUTO_INCREMENT,
`manname` varchar(10) NOT NULL,
PRIMARY KEY (`mantype`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*Table structure for table `user` */
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(10) NOT NULL,
`password` varchar(10) NOT NULL,
`nikename` varchar(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
Create Procedure dbo.[FSU_sp_InsertManualUpdate]
(
@ClientId Int,
@FsuId Int,
@FileName nvarchar(100),
@TargetTool int,
@LocalPath nvarchar(1000)
)
As
Begin
insert into tblInstallationDetail
(ClientID,
FSUID,
FileName,
TargetTool,
LocalPath,
SeverityType,
InstallationDate,
Mode,
Status)
values
(@ClientId,
@FsuId,
@FileName,
@TargetTool,
@LocalPath,
1,
Getdate(),
1,
1)
End
|
CREATE OR REPLACE PROCEDURE PROC_SP_BTS AS
BEGIN
DECLARE
CURSOR C_JOB IS
SELECT BTS.INT_ID,
CITY.PROVINCE_NAME,
CITY.REGION_NAME,
CITY.CITY_NAME,
BTS.VILLAGE_NAME,
BTS.GRID_NUM,
BTS.OPERATE_DEPARTMENT,
BTS.BTS_CODE BTSID,
BTS.NAME AS BTS_NAME,
BTS.NAME_P AS BTS_NAME_P,
BTS.PRO_BTSID,
GETBTSANTTYPE(BTS.INT_ID) ANTTYPE,
BTS.BTS_GRADE,
BTS.LONGITUDE,
BTS.LATITUDE,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
'中兴'
ELSE
'阿朗'
END VENDOR_NAME,
CDMA.VENDOR_BTSTYPE,
BTS.BTS_TYPE,
BTS.BTS_STATE,
BTS.BTS_ADDR,
CASE CDMA.BTSCLASS
WHEN 4 THEN
'DO'
WHEN 5 THEN
'1X+DO'
WHEN 2 THEN
'1X'
ELSE
''
END SYS_TYPE,
(SELECT CELL.NID
FROM CDMAUSER.C_CELL CELL
WHERE CELL.RELATED_BTS = CDMA.INT_ID
AND ROWNUM = 1) NID,
(SELECT CELL.SID
FROM CDMAUSER.C_CELL CELL
WHERE CELL.RELATED_BTS = CDMA.INT_ID
AND ROWNUM = 1) SID,
GETMSCIDBYREGION(CITY.REGION_NAME) MSCID,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
CDMA.BSC_NAME
ELSE
GETMSCIDBYREGION(CITY.REGION_NAME) || '.' || CDMA.DCSID
END BSCID,
BTS.RNC_ATTRIB,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
'无'
ELSE
TO_CHAR(CTLC.CARRIER_LIST1_SMODULE_ID1)
END SM_ATTRIB,
CASE
WHEN CDMA.VENDOR_ID = 10 THEN
(SELECT SOFT_VERSION
FROM CDMAUSER.C_BSC BSC
WHERE BSC.INT_ID = CDMA.RELATED_BSC)
ELSE
BTS.BSC_SOFTVERSION
END SOFT_VERSION,
(SELECT COUNT(*)
FROM C_TCO_PRO_CELL CELL
WHERE CELL.RELATED_BTSID = BTS.INT_ID) SECTOR_NUM,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
CDMA.CELL_CARRIER_NUM_1X
ELSE
BTS.BTS_MODEL_1X
END CELL_CARRIER_NUM_1X,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
CDMA.CELL_CARRIER_NUM_DO
ELSE
BTS.BTS_MODEL_DO
END CELL_CARRIER_NUM_DO,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
CDMA.NUMCE
ELSE
BTS.CHANNEL_NUM_1X
END NUMCE,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
CDMA.NUMCEDO
ELSE
BTS.CHANNEL_NUM_DO
END NUMCEDO,
BTS.NBR_2M_1X,
BTS.NBR_2M_DO,
CDMA.NBR_2M,
(SELECT CELL.LAC
FROM CDMAUSER.C_CELL CELL
WHERE CELL.RELATED_BTS = CDMA.INT_ID
AND ROWNUM = 1) LAC,
(SELECT CELL.LAC
FROM CDMAUSER.C_CELL CELL
WHERE CELL.RELATED_BTS = CDMA.INT_ID
AND ROWNUM = 1) REG_ZONE,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
(SELECT MAX(JCELL.TOTAL_ZONES)
FROM (SELECT CELL.RELATED_BTS, CCELL.TOTAL_ZONES
FROM CDMAUSER.C_CELL CELL
LEFT JOIN CDMAUSER.C_TZX_PAR_CELL CCELL
ON CELL.INT_ID = CCELL.INT_ID) JCELL
WHERE JCELL.RELATED_BTS = CDMA.INT_ID)
ELSE
(SELECT MAX(CTLC.TOTZONES)
FROM CDMAUSER.C_TLC_PAR_BTS CTLC
WHERE CTLC.INT_ID = BTS.INT_ID)
END TOTZONES,
CASE
WHEN CDMA.VENDOR_ID = 7 THEN
(SELECT MAX(JCELL.ZONE_TIMER)
FROM (SELECT CELL.RELATED_BTS, CCELL.ZONE_TIMER
FROM CDMAUSER.C_CELL CELL
LEFT JOIN CDMAUSER.C_TZX_PAR_CELL CCELL
ON CELL.INT_ID = CCELL.INT_ID) JCELL
WHERE JCELL.RELATED_BTS = CDMA.INT_ID)
ELSE
(SELECT MAX(CTLC.ZONE_TMR)
FROM CDMAUSER.C_TLC_PAR_BTS CTLC
WHERE CTLC.INT_ID = CDMA.INT_ID)
END ZONE_TMR,
GETBTSBORDERSECTOR(CDMA.INT_ID) BORDER_SECTOR,
BTS.CIRCUITROOM_SHARE,
BTS.ROOM_PROPERTY,
BTS.TOWER_MAST_SHARE,
BTS.PYLON_PROPERTY,
BTS.PYLON_TYPE,
BTS.DATA_RENEWAL_DATE OPERATIONTIME,
B.DISPLAY_NAME AS OPERATIONUSERNAME,
BTS.REMARK,
CITY.REGION_ID,
CITY.CITY_ID
FROM C_TCO_PRO_BTS BTS
LEFT JOIN C_TCO_USER_V2 B
ON BTS.OPERATIONUSERID = B.USER_ID
LEFT JOIN CDMAUSER.C_BTS CDMA
ON CDMA.INT_ID = BTS.INT_ID
LEFT JOIN CDMAUSER.C_TLC_PAR_BTS CTLC
ON CDMA.INT_ID = CTLC.INT_ID
LEFT JOIN C_REGION_CITY CITY
ON CITY.CITY_ID = BTS.CITY_ID;
--定义一个游标变量v_cinfo c_emp%ROWTYPE ,该类型为游标c_emp中的一行数据类型
C_ROW C_JOB%ROWTYPE;
BEGIN
FOR C_ROW IN C_JOB LOOP
BEGIN
INSERT INTO HD_C_PRO_BTS
(INT_ID,
PROVINCE_NAME,
REGION_NAME,
CITY_NAME,
VILLAGE_NAME,
GRID_NUM,
OPERATE_DEPARTMENT,
BTSID,
BTS_NAME,
BTS_NAME_P,
PRO_BTSID,
ANTTYPE,
BTS_GRADE,
LONGITUDE,
LATITUDE,
VENDOR_NAME,
VENDOR_BTSTYPE,
BTS_TYPE,
BTS_STATE,
BTS_ADDR,
SYS_TYPE,
NID,
SID,
MSCID,
BSCID,
RNC_ATTRIB,
SM_ATTRIB,
SOFT_VERSION,
SECTOR_NUM,
CELL_CARRIER_NUM_1X,
CELL_CARRIER_NUM_DO,
NUMCE,
NUMCEDO,
NBR_2M_1X,
NBR_2M_DO,
NBR_2M,
LAC,
REG_ZONE,
TOTZONES,
ZONE_TMR,
BORDER_SECTOR,
CIRCUITROOM_SHARE,
ROOM_PROPERTY,
TOWER_MAST_SHARE,
PYLON_PROPERTY,
PYLON_TYPE,
OPERATIONTIME,
OPERATIONUSERNAME,
REMARK,
REGION_ID,
CITY_ID,
HD_TIME)
VALUES
(C_ROW.INT_ID,
C_ROW.PROVINCE_NAME,
C_ROW.REGION_NAME,
C_ROW.CITY_NAME,
C_ROW.VILLAGE_NAME,
C_ROW.GRID_NUM,
C_ROW.OPERATE_DEPARTMENT,
C_ROW.BTSID,
C_ROW.BTS_NAME,
C_ROW.BTS_NAME_P,
C_ROW.PRO_BTSID,
C_ROW.ANTTYPE,
C_ROW.BTS_GRADE,
C_ROW.LONGITUDE,
C_ROW.LATITUDE,
C_ROW.VENDOR_NAME,
C_ROW.VENDOR_BTSTYPE,
C_ROW.BTS_TYPE,
C_ROW.BTS_STATE,
C_ROW.BTS_ADDR,
C_ROW.SYS_TYPE,
C_ROW.NID,
C_ROW.SID,
C_ROW.MSCID,
C_ROW.BSCID,
C_ROW.RNC_ATTRIB,
C_ROW.SM_ATTRIB,
C_ROW.SOFT_VERSION,
C_ROW.SECTOR_NUM,
C_ROW.CELL_CARRIER_NUM_1X,
C_ROW.CELL_CARRIER_NUM_DO,
C_ROW.NUMCE,
C_ROW.NUMCEDO,
C_ROW.NBR_2M_1X,
C_ROW.NBR_2M_DO,
C_ROW.NBR_2M,
C_ROW.LAC,
C_ROW.REG_ZONE,
C_ROW.TOTZONES,
C_ROW.ZONE_TMR,
C_ROW.BORDER_SECTOR,
C_ROW.CIRCUITROOM_SHARE,
C_ROW.ROOM_PROPERTY,
C_ROW.TOWER_MAST_SHARE,
C_ROW.PYLON_PROPERTY,
C_ROW.PYLON_TYPE,
C_ROW.OPERATIONTIME,
C_ROW.OPERATIONUSERNAME,
C_ROW.REMARK,
C_ROW.REGION_ID,
C_ROW.CITY_ID,
SYSDATE);
COMMIT;
END;
END LOOP;
END;
END PROC_SP_BTS;
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mer. 18 déc. 2019 à 15:54
-- Version du serveur : 10.1.37-MariaDB
-- Version de PHP : 7.2.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 */;
--
-- Base de données : `cmspoo`
--
-- --------------------------------------------------------
--
-- Structure de la table `content`
--
CREATE TABLE `content` (
`id` int(11) NOT NULL,
`filename` varchar(160) NOT NULL,
`titre` varchar(160) NOT NULL,
`contenuPage` text NOT NULL,
`photo` varchar(160) NOT NULL,
`datePublication` datetime NOT NULL,
`categorie` varchar(160) NOT NULL,
`template` varchar(160) NOT NULL,
`id_user` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `content`
--
INSERT INTO `content` (`id`, `filename`, `titre`, `contenuPage`, `photo`, `datePublication`, `categorie`, `template`, `id_user`) VALUES
(1, 'index', 'Accueil', 'COUCOU BIENVENUE SUR MON SITE', '', '0000-00-00 00:00:00', '', '', 0),
(2, 'updateFilenanme', 'updateTitre', 'updateCOntenu', 'updatePhoto', '2019-12-18 14:47:31', 'updateCategorie', 'updateTemplate', 1),
(3, 'blog', 'BLOG', 'LES DERNIERS ARTICLES DE MON BLOG', 'dsfdsf', '2019-12-18 14:50:09', 'sdfqsd', 'template-blog', 0),
(5, 'admin', 'MA PAGE ADMIN', 'MA PAGE ADMIN', '', '0000-00-00 00:00:00', '', 'template-admin', 0),
(11, 'test502', 'titre1502', 'contenu1502', 'hkjhkhkj', '2019-12-18 15:03:08', 'blog', '', 3),
(12, 'test1456', 'titre1456', 'contenu1456', 'hkjhkjhkj', '2019-12-18 14:57:11', 'blog', '', 3),
(13, 'harry-potter', 'Harry Potter', 'C\'est un roman', 'sdfgds', '2019-12-18 15:05:12', 'blog', '', 4),
(14, 'matilda', 'Matilda', 'TRES BIEN COMME ROMAN', 'kjfdh', '2019-12-18 15:16:44', 'blog', '', 3);
-- --------------------------------------------------------
--
-- Structure de la table `content_user`
--
CREATE TABLE `content_user` (
`id` int(11) NOT NULL,
`id_content` int(11) NOT NULL,
`id_user` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `content_user`
--
INSERT INTO `content_user` (`id`, `id_content`, `id_user`) VALUES
(2, 14, 4),
(3, 13, 3),
(4, 14, 3);
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`email` varchar(160) NOT NULL,
`login` varchar(160) NOT NULL,
`password` varchar(160) NOT NULL,
`level` int(11) NOT NULL,
`dateCreation` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`id`, `email`, `login`, `password`, `level`, `dateCreation`) VALUES
(3, 'test1428@mail.me', 'rambo', '$2y$10$1aEb.U/mJDywzIy2I1.ZouKg9uSUMo3EQREZpAxdCZCz4/ublFWCW', 10, '2019-12-18 14:28:22'),
(4, 'test1504@mail.me', 'jk rowling', '$2y$10$LJbDiQEvvveFBzePnhIkCu0q8MxNMZo1NWntKNNwMrSZEEUw3Bee2', 10, '2019-12-18 15:04:38');
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `content`
--
ALTER TABLE `content`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `content_user`
--
ALTER TABLE `content_user`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `content`
--
ALTER TABLE `content`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT pour la table `content_user`
--
ALTER TABLE `content_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pour la table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
Select * from (
Select grup, univer, spec, ayani, id, p_ball as ball from ixtisas
Union
Select grup, univer, spec, ayani, id, b_ball as ball from ixtisas) as T where grup = 1 and ball < 600 order by ball desc limit 15;
|
connect sys as sysdba
/*Pop-Up for password
/*Connected*/
create user book_store identified by obs123;
/*User Created*/
/*Giving certain priveledges to user*/
grant connect to book_store;
grant create session to book_store;
grant create sequence to book_store;
grant unlimited tablespace to book_store;
grant create table to book_store;
disconnect;
|
SQL_UP = """
CREATE TABLE `demo_table_work` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
`author` varchar(40) NOT NULL,
`submission_date` date DEFAULT NULL,
PRIMARY KEY (`id`)
);
"""
SQL_DOWN = """
DROP TABLE demo_table_work;
"""
|
INSERT INTO Accounts(PersonId, Balance) VALUES
(2, 5000),
(4, 8500.55),
(1, 1222.80),
(3, 55.23),
(5, 8999) |
-- REMOVE ALL FROM TABLES
DELETE FROM dbo.Participants;
DELETE FROM dbo.TaskResults;
DELETE FROM dbo.TestResults;
DELETE FROM dbo.Tasks;
DELETE FROM dbo.Tests;
--RESET AUTO INCREMENT IDS
DBCC CHECKIDENT ('[Participants]', RESEED, 0);
DBCC CHECKIDENT ('[TaskResults]', RESEED, 0);
DBCC CHECKIDENT ('[Tasks]', RESEED, 0);
DBCC CHECKIDENT ('[TestResults]', RESEED, 0);
DBCC CHECKIDENT ('[Tests]', RESEED, 0);
INSERT INTO dbo.Tests VALUES ('http://www.nhs.uk');
INSERT INTO dbo.Tasks VALUES (1, 'Find the address of your nearest hospital.');
INSERT INTO dbo.Tasks VALUES (1, 'You are looking after someone who has chickenpox and they have a low fever. Find out if they should take paracetamol or ibuprofen.');
INSERT INTO dbo.Tasks VALUES (1, 'Sign up to the NHS newsletter.');
INSERT INTO dbo.Tasks VALUES (1, 'Find out where you can renew your European Health Insurance card.');
INSERT INTO dbo.Participants VALUES (1, 'Eval1'); -- Accounts for user evaluation
INSERT INTO dbo.Participants VALUES (1, 'Eval2');
INSERT INTO dbo.Participants VALUES (1, 'Eval3');
INSERT INTO dbo.Participants VALUES (1, 'Eval4');
INSERT INTO dbo.Participants VALUES (1, 'Eval5');
INSERT INTO dbo.Participants VALUES (1, 'Eval6');
INSERT INTO dbo.Participants VALUES (1, 'Test1'); -- Test 1
INSERT INTO dbo.Participants VALUES (1, 'Test2'); -- Test 2
INSERT INTO dbo.Participants VALUES (1, 'Demo1'); -- Demo 1
INSERT INTO dbo.Participants VALUES (1, 'Demo2'); -- Demo 2
INSERT INTO dbo.Tests VALUES ('http://www.google.co.uk');
INSERT INTO dbo.Tasks VALUES (2, 'Navigate to the first link that appears when searching for "Java".');
INSERT INTO dbo.Tasks VALUES (2, 'Find the address of the Google HQ.');
INSERT INTO dbo.Tasks VALUES (2, 'Find an image of an iPhone 7.');
INSERT INTO dbo.Participants VALUES (2, 'RG-02');
INSERT INTO dbo.Participants VALUES (2, 'ML-02');
|
CREATE TABLE cook (
id IDENTITY,
name VARCHAR(50),
location VARCHAR(255),
image_url VARCHAR(50),
is_active BOOLEAN,
CONSTRAINT pk_cook_id PRIMARY KEY (id)
);
CREATE TABLE user_detail (
id IDENTITY,
first_name VARCHAR(50),
last_name VARCHAR(50),
role VARCHAR(50),
enabled BOOLEAN,
password VARCHAR(60),
email VARCHAR(100),
contact_number VARCHAR(15),
CONSTRAINT pk_user_id PRIMARY KEY(id)
);
CREATE TABLE product (
id IDENTITY,
code VARCHAR(20),
name VARCHAR(50),
description VARCHAR(255),
unit_price DECIMAL(10,2),
quantity INT,
is_active BOOLEAN,
cook_id INT,
purchases INT DEFAULT 0,
views INT DEFAULT 0,
CONSTRAINT pk_product_id PRIMARY KEY (id),
CONSTRAINT fk_product_cook_id FOREIGN KEY (cook_id) REFERENCES cook (id),
);
INSERT INTO user_detail
(first_name, last_name, role, enabled, password, email, contact_number)
VALUES ('Fahmid', 'Fahmid', 'ADMIN', true, '$2a$06$ORtBskA2g5Wg0HDgRE5ZsOQNDHUZSdpJqJ2.PGXv0mKyEvLnKP7SW', 'fahmidjobs@gmail.com', '9892399470');
INSERT INTO user_detail
(first_name, last_name, role, enabled, password, email, contact_number)
VALUES ('Parsia', 'Sultana', 'SUPPLIER', true, '$2a$06$bzYMivkRjSxTK2LPD8W4te6jjJa795OwJR1Of5n95myFsu3hgUnm6', 'ps@gmail.com', '7678087217');
INSERT INTO user_detail
(first_name, last_name, role, enabled, password, email, contact_number)
VALUES ('Momi', 'Aunty', 'SUPPLIER', true, '$2a$06$i1dLNlXj2uY.UBIb9kUcAOxCigGHUZRKBtpRlmNtL5xtgD6bcVNOK', 'ma@gmail.com', '7877777777');
INSERT INTO user_detail
(first_name, last_name, role, enabled, password, email, contact_number)
VALUES ('Samir', 'Nasri', 'USER', true, '$2a$06$4mvvyO0h7vnUiKV57IW3oudNEaKPpH1xVSdbie1k6Ni2jfjwwminq', 'sn@gmail.com', '7777777777');
INSERT INTO Product (code, name, description, unit_price, quantity, is_active, cook_id, purchases, views)
VALUES ('PRDABC123DEFX', 'Mutton Biryani', 'This is very delicious item of Mutton and basmati Rice!',200, 5, true, 3, 0, 0 );
INSERT INTO product (code, name, description, unit_price, quantity, is_active, cook_id, purchases, views)
VALUES ('PRDDEF123DEFX', 'Chicken Biryani', 'Chicken Dum Biryani With Slow Cooking', 150, 2, true, 1, 0, 0 );
INSERT INTO product (code, name, description, unit_price, quantity, is_active, cook_id, purchases, views)
VALUES ('PRDPQR123WGTX', 'Mutton Pulao', 'This is popular dish in Assam', 200, 5, true, 2, 0, 0 );
INSERT INTO product (code, name, description, unit_price, quantity, is_active, cook_id , purchases, views)
VALUES ('PRDMNO123PQRX', 'Mutton Paya Including Rotis', 'This is a dish which is slow cooked and used the bone marrow part adds to the taste', 300, 3, true, 2, 0, 0 );
INSERT INTO product (code, name, description, unit_price, quantity, is_active, cook_id, purchases, views)
VALUES ('PRDABCXYZDEFX', 'Shawarma', 'This is one of the best laptop series from dell that can be used!', 100, 5 ,true , 3, 0, 0 );
ALTER TABLE COOK ADD LATITUDE DECIMAL(15,6);
ALTER TABLE COOK ADD LONGITUDE DECIMAL(15,6);
CREATE TABLE LatitudeLongitude(
id IDENTITY,
latitude DECIMAL(15,6),
longitude DECIMAL(15,6),
CONSTRAINT pk_location_id PRIMARY KEY (id),
);
INSERT INTO LatitudeLongitude(latitude,longitude)
VALUES(19.069591,73.076253);
INSERT INTO LatitudeLongitude(latitude,longitude)
VALUES(18.979866,73.118733);
INSERT INTO LatitudeLongitude(latitude,longitude)
VALUES(18.979902,73.117052);
INSERT INTO LatitudeLongitude(latitude,longitude)
VALUES(18.981853,73.120748);
CREATE TABLE OrderDetail(
id IDENTITY,
username VARCHAR(20),
address VARCHAR(50),
dish_name VARCHAR(20),
cook_name VARCHAR(20),
unit_price DECIMAL(15,6),
quantity INT,
total_price DECIMAL(15,6),
CONSTRAINT pk_order_id PRIMARY KEY (id),
);
CREATE TABLE cook (
id INTEGER auto_increment PRIMARY KEY,
name VARCHAR(50),
location VARCHAR(255),
image_url VARCHAR(50),
is_active BOOLEAN
);
INSERT INTO `homecooks`.`cook` (`id`, `name`, `location`, `image_url`, `is_active`) VALUES ('1', 'Mrs Parsia', 'Proviso', 'ck_1.png', 'TRUE');
INSERT INTO `homecooks`.`cook` (`id`, `name`, `location`, `image_url`, `is_active`) VALUES ('2', 'Mrs Khan', 'Cosmo', 'ck_2.png', 'TRUE');
CREATE TABLE Product (
id INTEGER auto_inrement PRIMARY KEY,
code VARCHAR(20),
name VARCHAR(50),
description VARCHAR(255),
unit_price DECIMAL(10,2),
quantity INT,
is_active BOOLEAN,
cook_id INT,
purchases INT DEFAULT 0,
views INT DEFAULT 0,
CONSTRAINT fk_product_cook_id FOREIGN KEY (cook_id) REFERENCES c
ook (id),
);
DELETE FROM `mefahmid_homecooks`.`Product` WHERE `Product`.`id` = 7;
DELETE FROM `mefahmid_homecooks`.`Product` WHERE `Product`.`id` = 8;
DELETE FROM `mefahmid_homecooks`.`Product` WHERE `Product`.`id` = 9;
DELETE FROM `mefahmid_homecooks`.`Product` WHERE `Product`.`id` = 10;
CREATE TABLE OrderDetail(
id INTEGER auto_inrement PRIMARY KEY,
username VARCHAR(20),
address VARCHAR(50),
dish_name VARCHAR(20),
cook_name VARCHAR(20),
unit_price DECIMAL(15,6),
quantity INT,
total_price DECIMAL(15,6)
);
|
/*
Name: Listing Views through article body
Data source: 4
Created By: Admin
Last Update At: 2016-11-21T20:04:41.577692+00:00
*/
SELECT Listing,
MG_LA.street_address +','+ MG_LA.city+','+MG_LA.zip_code + MG_LA.country Listing_address,
MG_HL.agent_name as Agent,
nvl(MG_HL.brokerage_name,"") as Brokerage,
sum(Views) as Views
FROM
(SELECT post_prop20 AS Listing,page_url,
COUNT(*) AS Views,
/*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}}')
and post_prop10 = 'article_body'
group by Listing,page_url
)c
/*List of valid listings (active/no active)*/
JOIN each (select * from [djomniture:devspark.MG_Listing_Address])AS MG_LA ON c.Listing = MG_LA.id
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL ON c.Listing = MG_HL.Listing_id
group by Listing,Listing_address, Agent, Brokerage
order by Views desc
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.2.6-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
CREATE OR REPLACE VIEW `vw_work_order_level_data` AS select `metric`.`barrier_element_id`
, `data`.`functional_location`
, `data`.`facility_id`
, `fac`.`barrier_type_id`
, `fac`.`barrier_metric_id`
, `fac`.`rag_status`
, `data`.`planner_group_id`
, `data`.`abc_indicator_id`
, `data`.`work_order_number`
, `data`.`work_order_description`
, `data`.`order_type`
, `data`.`user_status`
, `data`.`awaiting_deferrment`
, `data`.`deferred`
, `data`.`work_centre`
, `data`.`latest_allowable_finish_date`
, `data`.`maint_activ_type`
, sysdate() created_at
, sysdate() updated_at
from `barrier`.sap_work_order_data `data`
left join `barrier`.barrier_metric `metric`
on `data`.barrier_metrics = metric.name and metric.current_flag = 1
left join `barrier`.performance_standard ps
on `data`.performance_standard_id = ps.id and ps.current_flag = 1
inner join `barrier`.facility_level_data `fac`
on `data`.facility_id = fac.facility_id
and `metric`.id = fac.barrier_metric_id
and `ps`.barrier_type_id = fac.barrier_type_id and fac.current_flag = 1 ;
|
-- aku80 / 14.01.2011
-- MM
-- alter table users
alter table users
add FIRSTNAME VARCHAR2(100 CHAR);
alter table users
add LASTNAME VARCHAR2(100 CHAR);
alter table users
add EMAIL VARCHAR2(150 CHAR);
alter table users
add PHONE VARCHAR2(150 CHAR);
alter table users
add ORGANIZATION_UNIT VARCHAR2(150 CHAR); |
-- Drop database if exists DBTonysKinal2019063;
create database DBTonysKinal2019063;
use DBTonysKinal2019063;
-- =========================== CREACION DE TABLAS ===========================
-- Creando tabla Tipo_Plato
DELIMITER $$
create procedure sp_Crear_Tipo_Plato()
BEGIN
create table Tipo_Plato(codigoTipoPlato int auto_increment not null primary key NOT NULL,
descripcionTipo varchar(100) NOT NULL);
END $$
DELIMITER ;
-- Creando tabla Producto
DELIMITER $$
create procedure sp_Crear_Producto()
BEGIN
create table Producto(codigoProducto int auto_increment not null primary key,
nombreProducto varchar(150),
cantidad int);
END $$
DELIMITER ;
-- Creando tabla Tipo_Empleado
DELIMITER $$
create procedure sp_Crear_Tipo_Empleado()
BEGIN
create table TipoEmpleado(codigoTipoEmpleado int auto_increment not null primary key,
descripcion varchar(100));
END $$
DELIMITER ;
-- Creando tabla Empleado
DELIMITER $$
create procedure sp_Crear_Empleado()
BEGIN
create table Empleado(codigoEmpleado int auto_increment not null primary key,
numeroEmpleado int,
apellidosEmpleado varchar(150),
nombreEmpleado varchar(150),
direccion varchar(150),
telefonoContacto varchar(10),
gradoCocinero varchar(50),
codigoTipoEmpleado int,
foreign key(codigoTipoEmpleado) references TipoEmpleado(codigoTipoEmpleado) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Empresa
DELIMITER $$
create procedure sp_Crear_Empresa()
BEGIN
create table Empresa(codigoEmpresa int auto_increment not null primary key,
nombreEmpresa varchar(150),
direccion varchar(150),
telefono varchar(10));
END $$
DELIMITER ;
-- Creando tabla Presupuesto
DELIMITER $$
create procedure sp_Crear_Presupuesto()
BEGIN
create table Presupuesto(codigoPresupuesto int auto_increment not null primary key,
fecha_Solicitud date,
cantidadPresupuesto decimal(10,2),
codigoEmpresa int,
foreign key(codigoEmpresa) references Empresa(codigoEmpresa) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Servicio
DELIMITER $$
create procedure sp_Crear_Servicio()
BEGIN
create table Servicio(codigoServicio int auto_increment not null primary key,
fecha_Servicio date,
tipo_Servicio varchar(100),
horaServicio time,
lugarServicio varchar(100),
telefonoContacto varchar(10),
codigoEmpresa int,
foreign key(codigoEmpresa) references Empresa(codigoEmpresa) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Servicio_has_Empleado
DELIMITER $$
create procedure sp_Crear_Servicio_has_Empleado()
BEGIN
create table Servicio_Has_Empleado(
Servicios_codigoServicio int not null auto_increment,
codigoServicio int not null,
codigoEmpleado int not null,
fechaEvento date not null,
horaEvento time,
lugarEvento varchar(150) not null,
primary key PK_Servicios_codigoServicio (Servicios_codigoServicio),
foreign key(codigoServicio) references Servicio(codigoServicio) ON DELETE CASCADE,
foreign key(codigoEmpleado) references Empleado(codigoEmpleado) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Plato
DELIMITER $$
create procedure sp_Crear_Plato()
BEGIN
create table Plato(codigoPlato int auto_increment not null primary key,
cantidad int,
nombrePlato varchar(50),
descripcionPlato varchar(150),
precioPlato decimal(10,2),
codigoTipoPlato int,
foreign key(codigoTipoPlato) references Tipo_Plato(codigoTipoPlato) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Producto_has_Plato
DELIMITER $$
create procedure sp_Crear_Producto_has_Plato()
BEGIN
create table Producto_Has_Plato(
Producto_codigoProducto int not null,
codigoPlato int not null,
codigoProducto int not null,
primary key PK_Productos_codigoProducto (Producto_codigoProducto),
foreign key(codigoProducto) references Producto(codigoProducto) ON DELETE CASCADE,
foreign key(codigoPlato) references Plato(codigoPlato) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Creando tabla Servicio_has_Plato
DELIMITER $$
create procedure sp_Crear_Servicio_has_Plato()
BEGIN
create table Servicio_Has_Plato(
Servicios_codigoServicio int not null,
codigoPlato int not null,
codigoServicio int not null,
primary key PK_Servicios_codigoServicio (Servicios_codigoServicio),
foreign key(codigoServicio) references Servicio(codigoServicio) ON DELETE CASCADE,
foreign key(codigoPlato) references Plato(codigoPlato) ON DELETE CASCADE);
END $$
DELIMITER ;
-- Llamando a los "sp"
call sp_Crear_Tipo_Plato();
call sp_Crear_Producto();
call sp_Crear_Tipo_Empleado();
call sp_Crear_Empleado();
call sp_Crear_Empresa();
call sp_Crear_Presupuesto();
call sp_Crear_Servicio();
call sp_Crear_Servicio_has_Empleado();
call sp_Crear_Plato();
call sp_Crear_Producto_has_Plato();
call sp_Crear_Servicio_has_Plato();
-- ALTER USER 'root'@'localhost' identified WITH mysql_native_password BY 'root';
|
ALTER TABLE user_account ADD UNIQUE (email); |
--
-- Copyright 2010-2016 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- // First migration.
-- ========== ========== ========== ========== ========== ========== ==========
-- DB1, DB2, DB3 - DBA
--
-- NOTE: view creations in a seperate file
-- NOTE: function creations in a seperate file
-- NOTE: procedure creations in a seperate file
-- NOTE: event creations in a seperate file
-- ========== ========== ========== ========== ========== ========== ==========
SET FOREIGN_KEY_CHECKS = 0;
-- DROP DATABASE IF EXISTS DBA;
CREATE DATABASE DBA
DEFAULT CHARACTER SET = utf8
DEFAULT COLLATE = utf8_unicode_ci;
USE DBA;
-- ========== ========== ========== ========== ========== ========== ==========
CREATE TABLE events_statements (
SCHEMA_NAME varchar(64) NOT NULL DEFAULT '',
DIGEST varchar(32) NOT NULL DEFAULT '',
DIGEST_TEXT longtext,
COUNT_STAR BIGINT unsigned NOT NULL,
SUM_TIMER_WAIT BIGINT unsigned NOT NULL,
MIN_TIMER_WAIT BIGINT unsigned NOT NULL,
AVG_TIMER_WAIT BIGINT unsigned NOT NULL,
MAX_TIMER_WAIT BIGINT unsigned NOT NULL,
SUM_LOCK_TIME BIGINT unsigned NOT NULL,
SUM_ERRORS BIGINT unsigned NOT NULL,
SUM_WARNINGS BIGINT unsigned NOT NULL,
SUM_ROWS_AFFECTED BIGINT unsigned NOT NULL,
SUM_ROWS_SENT BIGINT unsigned NOT NULL,
SUM_ROWS_EXAMINED BIGINT unsigned NOT NULL,
SUM_CREATED_TMP_DISK_TABLES BIGINT unsigned NOT NULL,
SUM_CREATED_TMP_TABLES BIGINT unsigned NOT NULL,
SUM_SELECT_FULL_JOIN BIGINT unsigned NOT NULL,
SUM_SELECT_FULL_RANGE_JOIN BIGINT unsigned NOT NULL,
SUM_SELECT_RANGE BIGINT unsigned NOT NULL,
SUM_SELECT_RANGE_CHECK BIGINT unsigned NOT NULL,
SUM_SELECT_SCAN BIGINT unsigned NOT NULL,
SUM_SORT_MERGE_PASSES BIGINT unsigned NOT NULL,
SUM_SORT_RANGE BIGINT unsigned NOT NULL,
SUM_SORT_ROWS BIGINT unsigned NOT NULL,
SUM_SORT_SCAN BIGINT unsigned NOT NULL,
SUM_NO_INDEX_USED BIGINT unsigned NOT NULL,
SUM_NO_GOOD_INDEX_USED BIGINT unsigned NOT NULL,
FIRST_SEEN timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
LAST_SEEN timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
SNAPSHOT_TIME timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (SCHEMA_NAME,DIGEST,SNAPSHOT_TIME)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ========== ========== ========== ========== ========== ========== ==========
CREATE TABLE objects (
id INT unsigned NOT NULL AUTO_INCREMENT,
obj_schema varchar(64) COLLATE utf8_bin NOT NULL,
obj_name varchar(64) COLLATE utf8_bin NOT NULL,
obj_type enum('TABLE','VIEW') COLLATE utf8_bin NOT NULL,
created date NOT NULL,
dropped date DEFAULT NULL,
PRIMARY KEY (id),
KEY objects_ix1 (obj_schema,obj_name,created) COMMENT 'help sorting by schema.name',
KEY objects_ix2 (obj_schema,obj_name,dropped,obj_type) COMMENT 'help searching in track_objects_check_found function and track_objects_main procedure'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=1 STATS_AUTO_RECALC=1 STATS_SAMPLE_PAGES=50 COMMENT='When were the objects (TABLE and VIEW) created & dropped? Note: collation is set for case sensitivity. Tables a and A are different';
-- ========== ========== ========== ========== ========== ========== ==========
SET FOREIGN_KEY_CHECKS = 1;
-- //@UNDO
DROP TABLE objects;
DROP TABLE events_statements;
|
CREATE PROCEDURE EDITAR_COMPUTADORA
@ID_COMP int,
@NUMERO int,
@ESTADO VARCHAR(20)
AS
BEGIN
UPDATE COMPUTADORA
SET NUMERO=@NUMERO,
ESTADO=@ESTADO
WHERE ID_COMP=@ID_COMP
END |
CREATE TABLE `subjects` (
`subject_id` INTEGER NOT NULL AUTO_INCREMENT,
`subject_name` VARCHAR(100) NOT NULL,
`subject_status` VARCHAR(10) NOT NULL DEFAULT 'Active',
`last_updated_by` INTEGER NOT NULL,
`last_updated_on` DATE,
PRIMARY KEY (`subject_id`)
)
ENGINE = InnoDB;
ALTER TABLE `subjects` ADD `subject_code` VARCHAR(100) NULL DEFAULT NULL AFTER `subject_name`;
CREATE TABLE `exam_details` (
`exam_id` INTEGER NOT NULL AUTO_INCREMENT,
`exam_title` VARCHAR(150) NOT NULL,
`exam_code` VARCHAR(100) NOT NULL,
`exam_date` DATE,
`exam_start_time` VARCHAR(50),
`exam_end_time` VARCHAR(50),
`exam_duration` INTEGER,
`last_updated_on` DATETIME,
`last_updated_by` INTEGER,
PRIMARY KEY (`exam_id`)
)
ENGINE = InnoDB;
CREATE TABLE `question_paper_details` (
`qpd_id` INTEGER NOT NULL AUTO_INCREMENT,
`subject_id` INTEGER NOT NULL,
`sub_subject_id` INTEGER,
`exam_id` INTEGER NOT NULL,
`no_of_questions` INTEGER NOT NULL DEFAULT 0,
`exam_duration` INTEGER NOT NULL,
`created_by` INTEGER,
`created_on` DATETIME,
`last_updated_by` INTEGER,
`last_updated_on` DATETIME,
PRIMARY KEY (`qpd_id`)
)
ENGINE = InnoDB;
CREATE TABLE `questions_list` (
`question_id` INTEGER NOT NULL AUTO_INCREMENT,
`qpd_id` INTEGER NOT NULL,
`question_text` TINYTEXT,
`no_of_choices` INTEGER NOT NULL DEFAULT 4,
`last_updated_on` DATETIME,
PRIMARY KEY (`question_id`)
)
ENGINE = InnoDB;
CREATE TABLE `choices_list` (
`choice_id` INTEGER NOT NULL AUTO_INCREMENT,
`choice_desc` VARCHAR(250),
`question_id` INTEGER,
`last_updated_on` DATETIME,
PRIMARY KEY (`choice_id`)
)
ENGINE = InnoDB;
CREATE TABLE `answer_table` (
`answer_id` INTEGER NOT NULL AUTO_INCREMENT,
`choice_id` INTEGER NOT NULL,
`question_id` INTEGER NOT NULL,
`last_updated_on` DATETIME,
PRIMARY KEY (`answer_id`)
)
ENGINE = InnoDB;
INSERT INTO `perm_master` (`perm_id`, `perm_code`, `perm_desc`, `perm_order`, `perm_label`, `perm_parent`, `perm_class`, `perm_url`, `perm_status`, `perm_attr`, `perm_icon`, `last_updated_id`, `last_updated_date`)
VALUES (NULL, 'SUBJECTS_LIST', 'Subjects list', '4', '4', '2', NULL, 'subjects-list', 'Active', NULL, NULL, NULL, current_timestamp());
INSERT INTO `role_perm` (`role_perm_id`, `role_id`, `perm_id`, `status`, `last_updated_id`, `last_updated_date`, `access_perm`)
VALUES (NULL, '1', '5', 'Active', '1', current_timestamp(), '1'); |
ALTER TABLE cadaster ALTER COLUMN type TYPE varchar(255) USING type::varchar;
|
/*
Navicat Premium Data Transfer
Source Server : WSL
Source Server Type : MySQL
Source Server Version : 80018
Source Host : wslhost:3306
Source Schema : bi_ye_she_ji
Target Server Type : MySQL
Target Server Version : 80018
File Encoding : 65001
Date: 10/02/2020 13:48:05
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,自增',
`user_id` bigint(20) NOT NULL COMMENT '用户账号',
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码(MD5加密)',
`user_type` int(5) NOT NULL COMMENT '用户类型',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '手机号',
`sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '性别(男 / 女)',
`building_id` int(5) NOT NULL COMMENT '管理的公寓楼ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for announcement
-- ----------------------------
DROP TABLE IF EXISTS `announcement`;
CREATE TABLE `announcement` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`time` datetime(0) NOT NULL,
`text` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for building
-- ----------------------------
DROP TABLE IF EXISTS `building`;
CREATE TABLE `building` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`admin_id` int(20) NOT NULL,
`floor_num` int(20) NOT NULL COMMENT '层数',
`room_size` int(20) NOT NULL COMMENT '房间可住几人',
`capacity` int(20) NOT NULL COMMENT '可容纳人数',
`live_num` int(20) NOT NULL COMMENT '已入住人数',
`first_room_num` int(20) NOT NULL COMMENT '第一层房间数',
`other_room_num` int(20) NOT NULL COMMENT '其它层房间数',
`isfull` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '是否满员',
`admin_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公寓管理员name',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10019 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for counselor
-- ----------------------------
DROP TABLE IF EXISTS `counselor`;
CREATE TABLE `counselor` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,自增',
`user_id` bigint(20) NOT NULL COMMENT '用户账号',
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码(MD5加密)',
`user_type` int(5) NOT NULL COMMENT '用户类型',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '手机号',
`sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '性别(男 / 女)',
`institution` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '所属学院',
`management` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '管理的专业与班级ID,如:23-1,12-3',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`room_num` int(20) NOT NULL COMMENT '房间编号',
`floor` int(20) NOT NULL,
`live` int(10) NOT NULL DEFAULT 0 COMMENT '已入住人数',
`size` int(10) NOT NULL,
`class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属班级',
`college_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属学院',
`building_id` int(20) NOT NULL,
`type` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`isfull` int(5) NOT NULL COMMENT '是否满员(0:否)',
`ok` int(5) NOT NULL COMMENT '是否禁住(0:否)',
`note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2362 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID,自增',
`user_id` bigint(20) NOT NULL COMMENT '用户账号(学号)',
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户密码(MD5加密,初始为身份证后六位)',
`user_type` int(5) NOT NULL COMMENT '用户类型',
`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名(学生姓名)',
`phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '手机号',
`sex` varchar(5) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '性别(男 / 女)',
`college_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '所属学院',
`major_and_class` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '所学专业',
`building_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '所在公寓楼',
`room_num` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '所在寝室',
`card` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '身份证号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mar. 06 oct. 2020 à 08:03
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `vsttreservation`
--
-- --------------------------------------------------------
--
-- Structure de la table `res_creneaux`
--
DROP TABLE IF EXISTS `res_creneaux`;
CREATE TABLE IF NOT EXISTS `res_creneaux` (
`id_creneau` int(11) NOT NULL AUTO_INCREMENT,
`Nom` varchar(35) NOT NULL,
`Salle` enum('Coppée','Tcheuméo') NOT NULL DEFAULT 'Coppée',
`Jour` tinyint(4) NOT NULL,
`Heure_Debut` time NOT NULL,
`Heure_Fin` time NOT NULL,
`Libre` enum('Oui','Non') NOT NULL DEFAULT 'Non',
`id_ouvreur` int(11) NOT NULL DEFAULT 0,
`Nbr_Place` int(11) NOT NULL DEFAULT 12,
`Ord` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id_creneau`),
KEY `id_ouvreur` (`id_ouvreur`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `res_creneaux`
--
INSERT INTO `res_creneaux` (`id_creneau`, `Nom`, `Salle`, `Jour`, `Heure_Debut`, `Heure_Fin`, `Libre`, `id_ouvreur`, `Nbr_Place`, `Ord`) VALUES
(1, 'Libre', 'Coppée', 1, '18:30:00', '20:00:00', 'Oui', 9317315, 10, 0),
(2, 'Loisir', 'Coppée', 1, '20:00:00', '21:00:00', 'Non', 93396, 12, 11),
(3, 'Equipe 9 et 10', 'Coppée', 1, '21:00:00', '22:30:00', 'Non', 93396, 12, 11),
(4, 'Libre', 'Coppée', 2, '18:30:00', '20:30:00', 'Oui', 0, 10, 0),
(5, 'Equipe 1, 2 et 3', 'Coppée', 2, '20:30:00', '22:30:00', 'Non', 7712599, 12, 0),
(6, 'Equipe 3 à 9', 'Coppée', 3, '19:00:00', '20:30:00', 'Non', 865607, 10, 31),
(7, 'Equipe 3 à 9', 'Coppée', 3, '20:30:00', '22:00:00', 'Non', 865607, 12, 31),
(8, 'Libre', 'Tcheuméo', 2, '20:00:00', '22:00:00', 'Oui', 0, 10, 0),
(9, 'Libre', 'Tcheuméo', 6, '18:00:00', '19:00:00', 'Oui', 0, 10, 0),
(10, 'Libre', 'Coppée', 7, '15:00:00', '16:30:00', 'Oui', 9317315, 10, 1),
(11, 'Libre', 'Coppée', 7, '16:30:00', '18:00:00', 'Oui', 0, 10, 1),
(12, 'Libre', 'Coppée', 7, '18:00:00', '19:30:00', 'Oui', 0, 10, 1),
(13, 'Libre', 'Coppée', 7, '19:30:00', '21:00:00', 'Oui', 0, 10, 1),
(15, 'Débutant', 'Coppée', 6, '10:00:00', '11:30:00', 'Non', 9317315, 12, 0);
-- --------------------------------------------------------
--
-- Structure de la table `res_licenciers`
--
DROP TABLE IF EXISTS `res_licenciers`;
CREATE TABLE IF NOT EXISTS `res_licenciers` (
`id_licencier` int(11) NOT NULL,
`Civilite` enum('Mr','Mme') NOT NULL DEFAULT 'Mr',
`Nom` varchar(35) NOT NULL,
`Surnom` varchar(35) DEFAULT NULL,
`Prenom` varchar(35) NOT NULL,
`Classement` int(11) NOT NULL DEFAULT 5,
`Equipe` tinyint(4) NOT NULL DEFAULT 0,
`Telephone` varchar(14) NOT NULL DEFAULT '01.01.01.01.01',
`Email` varchar(50) NOT NULL DEFAULT 'pas.saisie@faux',
`Ouvreur` enum('Oui','Non') NOT NULL DEFAULT 'Non',
`Admin` varchar(10) NOT NULL DEFAULT 'Non',
`Actif` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`id_licencier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `res_licenciers`
--
INSERT INTO `res_licenciers` (`id_licencier`, `Civilite`, `Nom`, `Surnom`, `Prenom`, `Classement`, `Equipe`, `Telephone`, `Email`, `Ouvreur`, `Admin`, `Actif`) VALUES
(93396, 'Mr', 'DALLE PIAGGE', '', 'Yves', 0, 7, '06.80.77.48.00', 'pas.saisie@faux', 'Oui', '4pP4RER+TL', 1),
(93413, 'Mr', 'GRANDIN', 'NANAR', 'Bernard', 0, 0, '06.01.02.03.05', 'pas.saisie@faux', 'Non', '', 1),
(93728, 'Mr', 'LAMOLINAIRIE', '', 'Henrique', 0, 0, '', '', 'Non', '', 1),
(773840, 'Mr', 'CONCHON', '', 'Sylvain', 5, 3, '06.72.80.88.00', 'beuhaaar@yahoo.fr', 'Non', '', 1),
(865607, 'Mr', 'WILMUS', '', 'Franck', 15, 3, '06.62.55.94.72', 'pas.saisie@faux', 'Oui', '', 1),
(931327, 'Mr', 'VALADE', '', 'Patrick', 0, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(933602, 'Mr', 'LABOUREAU', '', 'Pierre', 0, 7, '06.71.28.37.86', 'bureau@vstt.com', 'Oui', 'e9j>WMhy3z', 1),
(933604, 'Mr', 'PALUYAN', '', 'Ari', 0, 3, '06.48.28.98.96', 'bureau@vstt.com', 'Non', '', 1),
(935669, 'Mr', 'DUVAL', '', 'Jérôme', 0, 0, '06.03.23.06.04', 'pas.saisie@faux', 'Oui', '', 1),
(935871, 'Mr', 'BOULANGER', '', 'Frédéric', 0, 7, '06.78.92.23.52', 'pas.saisie@faux', 'Non', '', 1),
(935888, 'Mr', 'ANDRIEU', '', 'Luc', 5, 5, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(936887, 'Mr', 'MAYOUTE', '', 'Cedric', 5, 3, '06.86.52.66.26', 'pas.saisie@faux', 'Non', '', 1),
(936927, 'Mme', 'AUBIN', '', 'Marie-agnès', 5, 7, '06.19.76.04.29', 'bureau@vstt.com', 'Non', '', 1),
(937183, 'Mr', 'TORVAL', '', 'Eddie', 5, 5, '07.86.03.60.50', 'pas.saisie@faux', 'Non', '', 1),
(937876, 'Mr', 'DESBOIS', '', 'Sébastien', 0, 0, '', '', 'Oui', 'i9pWJ[Wc9K', 1),
(938125, 'Mme', 'AUBIN', '', 'Janine', 0, 0, '', '', 'Non', '', 1),
(938219, 'Mr', 'GICQUEL', '', 'Erwann', 5, 2, '01.01.01.01.01', 'acbtennisdetable@alicepro.fr', 'Non', '', 1),
(938986, 'Mr', 'IMAQUE', '', 'Stéphane', 5, 5, '07.87.75.40.85', 'pas.saisie@faux', 'Non', '', 1),
(939644, 'Mr', 'LECOCQ', '', 'Xavier', 0, 6, '06.01.02.03.04', 'pas.saisie@faux', 'Non', '>LecocqXa<', 1),
(939804, 'Mr', 'QUINQUIS', '', 'Dominique', 5, 4, '06.72.95.67.41', 'pas.saisie@faux', 'Non', '', 1),
(949068, 'Mr', 'JOLY', '', 'Christophe', 0, 2, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(951246, 'Mr', 'MACHET', '', 'Thierry', 0, 1, '07.89.01.50.86', 't.machet@wanadoo.fr', 'Non', '', 1),
(957044, 'Mr', 'COLOMER', '', 'Thierry', 0, 0, '01.39.95.07.57', 'pas.saisie@faux', 'Non', '', 1),
(3726084, 'Mr', 'YE', '', 'Julien', 5, 9, '06.46.49.14.50', 'pure_yf@yahoo.fr', 'Non', '', 1),
(7711698, 'Mr', 'CHARDIN', 'GuiGui', 'Guillaume', 18, 1, '06.63.08.65.56', 'pas.saisie@faux', 'Oui', '', 1),
(7712599, 'Mr', 'DE LA BARRERA', '', 'Romain', 16, 1, '06.77.19.07.59', 'romain_77500@hotmail.fr', 'Oui', '', 1),
(7712701, 'Mme', 'CONSTANT MORAND', '', 'Caroline', 5, 9, '01.01.01.01.01', 'speedy-caro@orange.fr', 'Non', '', 1),
(7714816, 'Mr', 'JEAN BAPTISTE', '', 'Jerome', 5, 0, '06.17.12.08.19', 'pas.saisie@faux', 'Non', '', 1),
(7717097, 'Mr', 'JOLY', '', 'Clément', 5, 1, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(7727498, 'Mr', 'STAUBER', '', 'Julien', 5, 2, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9311514, 'Mr', 'BARTHELEMY', '', 'Stéphane', 0, 8, '06.01.81.68.30', 'bureau@vstt.com', 'Oui', '#Stephane>', 1),
(9311718, 'Mr', 'MERELLE', '', 'Jacques', 0, 8, '06.89.55.31.03', 'pas.saisie@faux', 'Non', '', 1),
(9311926, 'Mr', 'LELIEUX', '', 'Jérôme', 0, 7, '06.10.65.49.88', 'j.lelieux@berim.fr', 'Non', '', 1),
(9312434, 'Mr', 'NICOLAS', '', 'Jean-françois', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9312573, 'Mr', 'QUINQUIS', '', 'Erwann', 5, 1, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9312604, 'Mr', 'CARON', '', 'Donovan', 0, 1, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9312607, 'Mr', 'SAINTON', '', 'Nicolas', 5, 4, '06.86.82.21.03', 'pas.saisie@faux', 'Non', '', 1),
(9312611, 'Mr', 'ESNAULT', '', 'Jérémy', 0, 4, '06.01.02.03.05', 'pas.saisie@faux', 'Non', '', 1),
(9312623, 'Mr', 'DINOT', '', 'Samuel', 0, 1, '01.01.01.01.01', 'pas.saisie@faux', 'Oui', '', 1),
(9312754, 'Mr', 'GIORDANO', '', 'Christophe', 0, 0, '', '', 'Non', '', 1),
(9312902, 'Mr', 'CHAPUS-MINETTO', '', 'Brigitte', 0, 0, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9313033, 'Mr', 'PEETERS', '', 'Marie-laure', 0, 0, '', '', 'Non', '', 1),
(9313532, 'Mr', 'GROSCOT', '', 'Jose', 0, 0, '', '', 'Non', '', 1),
(9313773, 'Mr', 'LEMOINE', '', 'Alexandre', 0, 2, '06.33.17.78.47', 'lemoine.alexandre@live.fr', 'Oui', '', 1),
(9313882, 'Mr', 'HALIN', '', 'Marcel', 0, 0, '', '', 'Non', '', 1),
(9314069, 'Mr', 'SALMON', '', 'Dominique', 0, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9314199, 'Mr', 'ROBERT', '', 'Philippe', 0, 0, '', '', 'Non', '', 1),
(9314255, 'Mr', 'BOSSÉ', '', 'Arthur', 0, 0, '', '', 'Non', '', 1),
(9314351, 'Mr', 'PUTIGNY', '', 'Tony', 5, 2, '06.20.78.33.58', 'pas.saisie@faux', 'Non', '', 1),
(9314691, 'Mr', 'DRUART', '', 'Anthony', 0, 8, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9315171, 'Mr', 'LOUISE', '', 'Norbert', 0, 0, '', '', 'Non', '', 1),
(9315195, 'Mr', 'DEHAINE', '', 'François', 0, 0, '', '', 'Non', '', 1),
(9315215, 'Mr', 'GIBON', '', 'Florian', 0, 0, '', '', 'Non', '', 1),
(9315622, 'Mr', 'CARON', '', 'Patricia', 0, 0, '', '', 'Non', '', 1),
(9315851, 'Mr', 'SAGUES', '', 'David', 0, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9315906, 'Mr', 'CHALET', '', 'Sébastien', 0, 0, '', '', 'Non', '', 1),
(9315950, 'Mr', 'ZANNONI', '', 'Florent', 0, 0, '', '', 'Non', '', 1),
(9316145, 'Mr', 'BILLARD', '', 'Bruno', 0, 0, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9316334, 'Mr', 'PAPP', '', 'Ladislau', 0, 3, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9316339, 'Mr', 'DOINEAU', '', 'Lucas', 0, 0, '', '', 'Non', '', 1),
(9316466, 'Mr', 'MICHEL', '', 'Antoine', 0, 0, '06.07.68.82.13', 'pas.saisie@faux', 'Non', '', 1),
(9316502, 'Mr', 'GALEA', '', 'Jean pierre', 0, 0, '', '', 'Non', '', 1),
(9316613, 'Mr', 'SILLOU', '', 'Elisa', 0, 0, '', '', 'Non', '', 1),
(9316851, 'Mr', 'ITIM', '', 'Akima', 0, 0, '', '', 'Non', '', 1),
(9316954, 'Mr', 'BACHIR', '', 'Julian-khan', 0, 4, '06.71.72.29.14', 'pas.saisie@faux', 'Non', '', 1),
(9316991, 'Mr', 'DONET', '', 'Sylvain', 0, 0, '', '', 'Non', '', 1),
(9317005, 'Mr', 'LAUGIER', '', 'Louis', 0, 0, '', '', 'Non', '', 1),
(9317312, 'Mr', 'DOINEAU', '', 'Maxence', 0, 0, '', '', 'Non', '', 1),
(9317315, 'Mr', 'CHAUTARD', 'PAT', 'Patrick', 0, 9, '06.75.07.60.71', 'patrick.chautard@free.fr', 'Oui', '#Henri1957', 1),
(9317599, 'Mr', 'DUMONT', '', 'Corentin', 0, 0, '', '', 'Non', '', 1),
(9317703, 'Mr', 'OUK', '', 'Vibol', 0, 5, '01.01.01.01.01', 'pas.saisie@faux', 'Oui', '', 1),
(9317979, 'Mr', 'NOIRET', '', 'Quentin', 0, 0, '', '', 'Non', '', 1),
(9318103, 'Mr', 'GEORGE', '', 'Fabrice', 0, 8, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9318106, 'Mr', 'BOIRIE', '', 'Julien', 0, 0, '', '', 'Non', '', 1),
(9318235, 'Mr', 'PELOILLE', '', 'Baptiste', 0, 6, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9318237, 'Mr', 'RICHARD', '', 'Antoine', 0, 9, '', 'pas.saisie@faux', 'Non', '', 1),
(9318245, 'Mr', 'PORTEFIN', '', 'Camille', 0, 0, '', '', 'Non', '', 1),
(9318258, 'Mr', 'TAMISIER', '', 'Flavien', 0, 0, '', '', 'Non', '', 1),
(9318263, 'Mr', 'TRAISNEL', '', 'Charles', 0, 0, '', '', 'Non', '', 1),
(9318307, 'Mr', 'IANKOVSKAIA', '', 'Svetlana', 0, 0, '', '', 'Non', '', 1),
(9318400, 'Mr', 'LADRECH', '', 'Tiago', 0, 0, '', '', 'Non', '', 1),
(9318443, 'Mr', 'FICHOU', '', 'Sebastien', 0, 9, '', 'pas.saisie@faux', 'Oui', '#Fichou443', 1),
(9318450, 'Mme', 'DALLE PIAGGE', '', 'Martine', 0, 0, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9318676, 'Mr', 'DAMASSE', '', 'Robert', 0, 0, '', '', 'Non', '', 1),
(9318738, 'Mr', 'LELIEUX', '', 'Arthur', 0, 0, '', '', 'Non', '', 1),
(9318846, 'Mr', 'CAUMONT', '', 'Basile', 0, 0, '', '', 'Non', '', 1),
(9318949, 'Mr', 'DESPLANCHES', '', 'Matthias', 0, 0, '', '', 'Non', '', 1),
(9318950, 'Mr', 'LELOUP', '', 'Jean-yves', 0, 0, '', '', 'Non', '', 1),
(9318953, 'Mr', 'CARALP', '', 'Martine', 0, 0, '', '', 'Non', '', 1),
(9318954, 'Mr', 'BOURDERIOUX', '', 'Hugo', 0, 0, '06.08.27.36.32', 'pas.saisie@faux', 'Non', '', 1),
(9319088, 'Mr', 'VILLATA', '', 'Armand', 0, 0, '', '', 'Non', '', 1),
(9319381, 'Mr', 'LELIEUX', '', 'Thomas', 0, 0, '', '', 'Non', '', 1),
(9319466, 'Mr', 'BOURSE', '', 'Léo', 0, 0, '', '', 'Non', '', 1),
(9319470, 'Mr', 'DELOR', '', 'Noam', 0, 0, '', '', 'Non', '', 1),
(9319471, 'Mr', 'CALMON-BERDAH', '', 'Logan', 0, 0, '', '', 'Non', '', 1),
(9319472, 'Mr', 'GERBIER', '', 'Thibault', 0, 0, '', '', 'Non', '', 1),
(9319474, 'Mr', 'AOUADI', '', 'Selyan', 0, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9319478, 'Mr', 'QUINIOU', '', 'Gaël', 0, 0, '', '', 'Non', '', 1),
(9319482, 'Mr', 'DEMANGE', '', 'Louis', 0, 0, '', '', 'Non', '', 1),
(9319483, 'Mr', 'VIALLARD', '', 'Pierre', 0, 0, '', '', 'Non', '', 1),
(9319592, 'Mr', 'SAVARY', '', 'Hugo', 0, 0, '', '', 'Non', '', 1),
(9319594, 'Mr', 'BONNET', '', 'Gabrielle', 0, 0, '', '', 'Non', '', 1),
(9319595, 'Mr', 'PONTUERT-DELUCQ', '', 'Manoë', 0, 0, '', '', 'Non', '', 1),
(9319598, 'Mr', 'EVEN', '', 'Maxime', 0, 0, '', '', 'Non', '', 1),
(9319599, 'Mr', 'DJAIZ', '', 'Evan', 0, 0, '', '', 'Non', '', 1),
(9319674, 'Mr', 'AMPHOUX', '', 'Eric', 0, 0, '', '', 'Non', '', 1),
(9319676, 'Mr', 'GOURDES', '', 'Maxime', 0, 0, '', '', 'Non', '', 1),
(9319808, 'Mr', 'LEFRANC', '', 'Hugo', 0, 0, '', '', 'Non', '', 1),
(9319959, 'Mr', 'MARTHAN', '', 'Stéphane', 0, 0, '', '', 'Non', '', 1),
(9319960, 'Mr', 'LELONG', '', 'Jules', 0, 0, '', '', 'Non', '', 1),
(9319961, 'Mme', 'ANTUNES-HOUNE', '', 'Laura', 0, 0, '', '', 'Non', '', 1),
(9319963, 'Mr', 'DIDELOT', '', 'Yannis', 0, 0, '', '', 'Non', '', 1),
(9319964, 'Mr', 'MARCHAL', '', 'Félix', 0, 0, '', '', 'Non', '', 1),
(9319965, 'Mr', 'JOUANNE', '', 'Louis', 0, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9319966, 'Mr', 'GALIZZI', '', 'Juliano', 0, 0, '', '', 'Non', '', 1),
(9319967, 'Mr', 'CHRISTOPHE', '', 'Nathalie', 0, 0, '', '', 'Non', '', 1),
(9319968, 'Mr', 'CHRISTOPHE', '', 'Baptiste', 0, 0, '', '', 'Non', '', 1),
(9319969, 'Mr', 'POZLEWICZ', '', 'Stéphane', 0, 8, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9320072, 'Mr', 'HERROUX', '', 'Kilian', 0, 9, '', 'pas.saisie@faux', 'Non', '', 1),
(9320073, 'Mr', 'BAUMAN', '', 'Eric', 0, 0, '', '', 'Non', '', 1),
(9320074, 'Mr', 'MARCULESCU', '', 'Eric', 0, 0, '', '', 'Non', '', 1),
(9320075, 'Mr', 'KALLOU', '', 'Salim', 0, 0, '', '', 'Non', '', 1),
(9320076, 'Mr', 'BONNAFOUS', '', 'Louis', 0, 0, '', '', 'Non', '', 1),
(9320077, 'Mr', 'JOLIVET', '', 'Léna', 0, 0, '', '', 'Non', '', 1),
(9320078, 'Mr', 'PHUNG', '', 'Léo', 0, 0, '', '', 'Non', '', 1),
(9320079, 'Mr', 'MARTIGNON', '', 'Delphine', 0, 0, '', '', 'Non', '', 1),
(9320080, 'Mr', 'DA SILVA', '', 'Maxime', 0, 0, '', '', 'Non', '', 1),
(9320142, 'Mr', 'LE GAL', '', 'Patrick', 0, 0, '', '', 'Non', '', 1),
(9320143, 'Mr', 'HADDAD', '', 'Aurore', 0, 0, '', '', 'Non', '', 1),
(9320144, 'Mr', 'DALLEAU-PONTHUS', '', 'Lucas', 0, 0, '', '', 'Non', '', 1),
(9320145, 'Mr', 'BONNET', '', 'Nathan', 0, 0, '', '', 'Non', '', 1),
(9320146, 'Mr', 'ALTMANN-ILIC', '', 'Ilan', 0, 5, '', '', 'Non', '', 1),
(9320147, 'Mr', 'FIGUEIREDO', '', 'Alexandra', 0, 0, '', '', 'Non', '', 1),
(9320148, 'Mr', 'BONNET', '', 'Matthéo', 0, 0, '', '', 'Non', '', 1),
(9320149, 'Mr', 'DONET-ST GES', '', 'Timéo', 0, 0, '', '', 'Non', '', 1),
(9320150, 'Mr', 'LE HOLLOCO', '', 'Jean-antoine', 0, 8, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9320151, 'Mr', 'RIZZO', '', 'Paul', 0, 0, '', '', 'Non', '', 1),
(9320152, 'Mr', 'PAGET', '', 'Eric', 0, 0, '', '', 'Non', '', 1),
(9320153, 'Mr', 'CHARRUA', '', 'Claudio', 0, 0, '', '', 'Non', '', 1),
(9320600, 'Mr', 'DIOT', '', 'Thomas', 5, 5, '06.61.57.00.54', 'pas.saisie@faux', 'Non', '', 1),
(9320765, 'Mr', 'BLANDEL', '', 'Josselin', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9321187, 'Mr', 'SCHMITT', '', 'Aurélien', 5, 0, '01.01.01.01.01', 'pas.saisie@faux', 'Non', '', 1),
(9321237, 'Mr', 'IM', '', 'Tony', 5, 0, '06.12.40.64.24', 'pas.saisie@faux', 'Non', '', 1),
(9321343, 'Mr', 'DE OLIVEIRA', '', 'Theo', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9321348, 'Mr', 'BELCOURT', '', 'Maxime', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9322006, 'Mr', 'ANTZ', '', 'Achille', 5, 9, '01.01.01.01.01', 'Mf.faivre@wanadoo.fr', 'Non', '', 1),
(9322795, 'Mr', 'MARDAYMOOTOO', '', 'Veniten', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9322804, 'Mr', 'DIONNET', '', 'Benjamin', 5, 0, '06.25.77.44.83', 'pas.saisie@faux', 'Non', '', 1),
(9322808, 'Mr', 'DJENA', '', 'Haron', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1),
(9322809, 'Mr', 'BOURDERIOUX', '', 'Florent', 5, 0, '06.08.27.36.32', 'pas.saisie@faux', 'Non', '', 1),
(9322810, 'Mr', 'SCHMITT', '', 'Martin', 5, 0, '06.01.02.03.04', 'pas.saisie@faux', 'Non', '', 1),
(9322900, 'Mr', 'TREVIL VIGNOCAN', '', 'Jaden', 5, 0, '0643.33.03.53', 'pas.saisie@faux', 'Non', '', 1),
(9322901, 'Mr', 'LE GARS', '', 'Mathis', 5, 0, '06.71.63.47.62', 'pas.saisie@faux', 'Non', '', 1),
(9322902, 'Mr', 'CARDUCCI', '', 'Antonin', 5, 0, '06.20.31.48.58', 'pas.saisie@faux', 'Non', '', 1),
(9322903, 'Mr', 'DEMART', '', 'Yam', 5, 0, '06-25-29-31-24', 'pas.saisie@faux', 'Non', '', 1),
(9322904, 'Mr', 'GWERARD', '', 'Arthur', 5, 0, '06.81.52.63.25', 'pas.saisie@faux', 'Non', '', 1),
(9323235, 'Mr', 'COTTIN', '', 'Noé', 5, 0, '', 'pas.saisie@faux', 'Non', '', 1);
-- --------------------------------------------------------
--
-- Structure de la table `res_prioritaires`
--
DROP TABLE IF EXISTS `res_prioritaires`;
CREATE TABLE IF NOT EXISTS `res_prioritaires` (
`id_prioritaire` int(11) NOT NULL AUTO_INCREMENT,
`id_creneau` int(11) NOT NULL,
`id_licencier` int(11) NOT NULL,
PRIMARY KEY (`id_prioritaire`),
KEY `id_creneau` (`id_creneau`),
KEY `id_licencier` (`id_licencier`)
) ENGINE=MyISAM AUTO_INCREMENT=42 DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `res_prioritaires`
--
INSERT INTO `res_prioritaires` (`id_prioritaire`, `id_creneau`, `id_licencier`) VALUES
(1, 3, 9317315),
(2, 7, 9317315),
(41, 3, 93396),
(40, 2, 93396),
(15, 5, 7711698),
(12, 6, 93413),
(13, 5, 93728),
(14, 7, 93728),
(16, 5, 9313773),
(17, 7, 933602),
(18, 6, 7712599),
(19, 7, 9317703),
(20, 5, 951246),
(21, 5, 933604),
(22, 5, 938219),
(23, 5, 9312573),
(24, 5, 9312604),
(25, 5, 7714816),
(26, 2, 9321187),
(27, 2, 9312902),
(28, 2, 9318450),
(29, 2, 9316145),
(30, 2, 9316613),
(31, 15, 9322810),
(32, 15, 9322809),
(33, 15, 9322903),
(34, 15, 9322804),
(35, 15, 9322904),
(36, 15, 9322901),
(37, 15, 9322900);
-- --------------------------------------------------------
--
-- Structure de la table `res_reservations`
--
DROP TABLE IF EXISTS `res_reservations`;
CREATE TABLE IF NOT EXISTS `res_reservations` (
`id_reservation` int(11) NOT NULL AUTO_INCREMENT,
`id_creneau` int(11) NOT NULL,
`iDate` int(11) NOT NULL COMMENT 'Date au format YYNNN NNN Numéro de jour dans l''année',
`id_licencier` int(11) NOT NULL,
`Ouvreur` enum('Oui','Non') NOT NULL DEFAULT 'Non',
PRIMARY KEY (`id_reservation`) USING BTREE,
KEY `id_creneau` (`id_creneau`),
KEY `id_licencier` (`id_licencier`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `res_reservations`
--
INSERT INTO `res_reservations` (`id_reservation`, `id_creneau`, `iDate`, `id_licencier`, `Ouvreur`) VALUES
(1, 7, 20267, 9317315, 'Non'),
(2, 7, 20266, 9317315, 'Oui'),
(3, 10, 20263, 9317315, 'Oui'),
(4, 12, 20263, 9317315, 'Oui'),
(6, 10, 20263, 9317315, 'Non'),
(7, 11, 20263, 9317315, 'Non'),
(11, 6, 20266, 9317315, 'Oui'),
(12, 15, 20269, 9317315, 'Oui'),
(13, 15, 20276, 9322810, 'Non'),
(14, 15, 20276, 9322804, 'Non'),
(15, 15, 20276, 9322809, 'Non'),
(16, 15, 20276, 9322900, 'Non'),
(17, 15, 20276, 9322901, 'Non'),
(18, 15, 20276, 9322902, 'Non'),
(19, 15, 20276, 9322903, 'Non'),
(20, 15, 20276, 9322904, 'Non'),
(21, 15, 20276, 9317315, 'Oui');
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 */;
|
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `mahasiswa`;
CREATE TABLE `mahasiswa` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nama` varchar(255) NOT NULL,
`alamat` varchar(255) NOT NULL,
`lat` varchar(20) DEFAULT NULL,
`lng` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `mahasiswa` (`id`, `nama`, `alamat`, `lat`, `lng`) VALUES
(1, 'Agus Prasetiyo', 'Dsn. Seminang Ds. Sumberagung RT 12 RW 04 Kecamatan Wates', '-7.8429186', '112.1648699'),
(2, 'Muhammad Irfan Ardiansyah', 'Dsn.belik, Ds.Bendung Kec,Jetis Kab.Mojokerto', '-7.3970841', '112.4268654'),
(3, 'Avida Endriani', 'Bratang Gede 40b Surabaya', '-7.299123', '112.7497633'),
(4, 'Tegar Sukmawan', 'RUMDIS LAPAS PORONG BLOK E.4 KEBONAGUNG PORONG', '-7.5524935', '112.6695501'),
(5, 'Muhammad Wahyu Ramadhan', 'Wisma Sarinadi Jln.Volly Blok S/3', '-7.4457326', '112.7050352'),
(6, 'Putri Alrorizki', 'Dsn. Balongsuruh RT/RW 01/02 Ds. Balonggemek Kec. Megaluh / 61457', '-7.5010276', '112.1565052'),
(7, 'Ardani Duwi Nurhidayat', 'Dsn.sidowangi Ds.Mojolebak Kec.Jetis Kab.Mojokerto', '-7.4052426', '112.4108928'),
(8, 'Alfiyah', 'Ds Bringkang, Dsn Buyuk Rt 12 Rw 06', '-7.2825461', '112.5618896'),
(9, 'Siti Farahdiba Rahmadewi', 'JL. Kebraon 5 NO.41/60222 Surabaya', '-7.3312834', '112.6915697'),
(10, 'Dina Dwi Maharani', 'JL KARANG REJO BARU 15 Surabaya', '-7.302423', '112.7283272'),
(11, 'Melia Fitriawati', 'Jl. Kyai Mojo No. 6 RT. 4 RW. 2 Kel. Mlilir Kec. Dolopo Kab. Madiun', '-7.7725856', '111.5107273'),
(12, 'Gian Rachmat Pradipta', 'Jalan Petemon 2A / 58 Kode Pos: 60252', '-7.2631763', '112.7186082'),
(13, 'Aulia Oktavella Purnamasari', 'DUKUH GEMOL 1B NO.18B RT.02 RW.03 KELURAHAN JAJARTUNGGAL KECAMATAN WIYUNG SURABAYA 60229', '-7.3094395', '112.6967538'),
(14, 'Khoirina Safitri', 'Jalan Pahlawan, Kalianyar Gang II lamongan', '-7.1264226', '112.4039525'),
(15, 'Yosua Setiawan Roesmahardika', 'DK. Gogor 3 No. 3 Jajartunggal Wiyung, Surabaya / 60229', '73.094395', '112.6967538'),
(16, 'Reza Gusty Erlangga', 'Jl. Karangan no. 263 (Belakang Kodam), Kelurahan Sawunggaling, Kecamatan Wonokromo, Surabaya 60242', '-7.2941667', '112.7207973'),
(17, 'Mochammad Ikram', 'JL. Raya Mastrip Warugunung No.21 RT.02 RW.01 Surabaya 60221', '-7.3501025', '112.6714782'),
(18, 'Paramita Daniswari', 'Jl. BRATANG GEDE 6D / 11A SURABAYA', '-7.3001329', '112.7493071'),
(19, 'Maulana Aji Satrio', 'Perum. Permata Puri Jl. Wato-Wato BXIV/15 Ngaliyan 50181', '-7.0022747', '110.3492079'),
(20, 'Nabillah Citra Chaesari', 'BUMI CITRA FAJAR JL. SEKAWAN ELOK RAYA B4-49 / 61216', '74.565403', '112.7268222'),
(21, 'Muhamad Munawir', 'Ds. Kuro, Kec. Karangbinangun, Kab. Lamongan', '-7.0337417', '112.4295182'),
(22, 'Anis Friyanti', 'Jl. Kadit Suwoko RT 1 RW 3 Pucangro, Kec. Kalitengah, Kab. Lamongan', '-7.0212918', '112.3587183'),
(23, 'Eduardus Adi Jala Prasetya', 'Perum tni-al blok i9/no 12a sugihwaras, candi, sidoarjo', '-7.4798874', '112.6951512'),
(24, 'Moh. Fajar', 'RT.08/rw.02 dsn.gabus ds.tambakploso kec.turi', '-7.0869497', '112.3781403'),
(25, 'Teesa Wijayanti', 'jalan pandugo baru x/z-11', '-7.3192021', '112.7842297'),
(26, 'Tyas Puji Pertiwi', 'rt 32 rw 05 kelurahan plaosan, kecamatan plaosan', '-7.669156', '111.2130678'),
(27, 'Fitria Purnamasari', 'bratang wetan 3 / 41', '-7.2979549', '112.7526379'),
(28, 'Chorry Iga Setyaningrum', 'Ds. Pagerwojo RT 25 RW 06/61211', '-7.4378238', '112.6995657'),
(29, 'Elya Intan Pratiwi', 'jalan sunan giri no. 79', '-7.169742', '112.6339686'),
(30, 'Mohammad Rizal Fahmi Dwi Putra', 'Ds Pangkatrejo RT o2 RW 01, Kec Maduran, Kab Lamongan/62261', '-7.0050652', '112.2365109'),
(31, 'Agung Kurniawan', 'Dsn.Unggahan Rt.03 RW.08 Ds.Banjaragung Kec.Puri', '-7.4930699', '112.4276593'),
(32, 'Akbar Nadzif', 'JALAN ARJUNO 48 RT 06 RW 01 KEBONAN -PASIRIAN, KABUPATEN LUMAJANG ', '-8.033912', '113.2321523'),
(33, 'Tatik Rahmawati', 'DSN. SAMBONG RT. 04 RW. 02 DS. SUMBERJO KEC. PLANDAAN 61456', '-7.4290381', '112.0689644'),
(34, 'Ulinnuha Nabilah', 'WONOCOLO IX/68 RT 01 RW 01 TAMAN / 61257', '73.468485', '112.6907091'),
(35, 'Bey Aryo Abiantoro', 'jl. ratulangi no.22 Klitik, Geneng', '-7.4415241', '111.4198102'),
(36, 'Firdausi Afifah', 'CELEP SELATAN NOMOR 204B RT 10 RW 3, 61215', '-7.464982', '112.7149823'),
(37, 'Lazarus Tharub Widijanto', 'KAMPUNG BARU RT/RW 18/09 DESA SUKODADI KECAMATAN PAITON / 67291', '-7.7185396', '113.4938453'),
(38, 'Indra Tirta Nugraha', 'JALAN PAHLAWAN NO. 49 KECAMATAN MOJOSARI 61382', '-7.5251735', '112.5553651'),
(39, 'Kevin Andrean Haryadi', 'Duku IV / CA-303 Pondok Tjandra Indah, Waru', '-7.3433516', '112.7664297'),
(40, 'Lutfi Khuril Maula', 'PERUMAHAN KAHURIPAN NIRWANA CA8/10 SIDOARJO', '-7.436595', '112.6927383'),
(41, 'Novan Andhy Trianto', 'JL. Kapten Kasihin H.S I/5, Nganjuk / 64415', '-7.6013426', '111.8866598'),
(42, 'Tridianto Rahmanda Putra', 'Jl. Banjar Melati II/4B', '-7.3043677', '112.6365722'),
(43, 'Nova Rizqi Laili', 'Sooko Indah Jalan Arwana Blok G-89 RT/RW 02/14 Kecamatan Sooko ', '-7.4969187', '112.4261749'),
(44, 'Ifa Nurdiana', 'perum bumi mulyo permai A/21 candi sidoarjo', '-7.4852947', '112.6969793');
-- 2017-04-18 07:35:57
|
select title from books where title like "%Stories%";
select title,pages from books order by pages desc limit 1;
select concat(title," - ",released_year) as "summary" from books order by released_year desc limit 3;
select title,author_lname from books where author_lname like "% %";
select title,released_year,stock_quantity from books order by stock_quantity asc limit 3;
select title,author_lname from books order by author_lname,title;
select concat(upper("my favorite author is "),upper(author_fname)," ",upper(author_lname)) as "yell" from books order by author_lname; |
START TRANSACTION;
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `banco` ADD `cnpj` VARCHAR(14) NOT NULL AFTER `agencia`;
ALTER TABLE `banco` ADD CONSTRAINT `Fk_BancoCondominio` FOREIGN KEY (`cnpj`) REFERENCES `condominio`(`cnpj`) ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE `cazulo`.`banco` DROP PRIMARY KEY, ADD PRIMARY KEY (`operacao`, `conta`, `agencia`, `cnpj`) USING BTREE;
SET FOREIGN_KEY_CHECKS=1;
COMMIT;
|
-- 蔵書
INSERT INTO 蔵書.品目
(書籍番号, タイトル, 著者)
VALUES
('masuda-2017','現場で役立つシステム設計の原則','増田 亨'),
('evans-2011','ドメイン駆動設計','エリックエヴァンス'),
('fowler-2017','リファクタリング','マーチンファウラー'),
('kanzaki-2019','RDRA 2.0 ハンドブック','神崎 善治')
;
INSERT INTO 蔵書.蔵書
(蔵書番号, 書籍番号)
VALUES
(1, 'masuda-2017'),
(2, 'evans-2011'),
(3, 'evans-2011'),
(4, 'fowler-2017'),
(5, 'fowler-2017'),
(6, 'kanzaki-2019')
;
-- 会員
INSERT INTO 会員.会員
(会員番号, 氏名, 会員種別)
VALUES
(220, '成田 明','小中学生'),
(403, '今井 春香', '一般')
;
-- 貸出
INSERT INTO 貸出.貸出
(蔵書番号, 会員番号, 貸出日)
VALUES
(2, 403, CURRENT_DATE - 10),
(6, 403, CURRENT_DATE - 20),
(1, 220, CURRENT_DATE - 7)
;
|
-- Your SQL goes here
create table user (
id serial primary key,
user_id varchar(36) not null,
username text not null,
public_key text not null,
next_public_key text not null
) |
create table endereco (
id int not null AUTO_INCREMENT,
logradouro varchar(30),
numero varchar(6),
complemento varchar(20),
cidade varchar(20),
uf varchar(12),
cep varchar(9),
primary key (id)
);
insert into endereco (id, logradouro, numero, complemento, cidade, uf, cep)
values (1,'avenida jp', 's/n', 'nova primavera','Rio de Janeiro', 'rj', '6500000');
insert into endereco (id, logradouro, numero, complemento, cidade, uf, cep)
values (2,'Parque botanico', '134','condominio rio sul','Rio de Janeiro', 'RJ','65055-000');
|
-- finding leap Year
create or replace function is_leap(y int) returns int begin declare t int; set t = 0; if y%400 =0 then return 1; end if; if y % 100 = 0 then return 0; end if; if y%4 = 0 then return 1; end if; return t; end |
-- Elapsed days between two years (excluding y1 and y2)
create or replace function ydays(y1 int,y2 int) returns int begin declare ydays int; set ydays = 0; set y1 = y1 + 1; set y2 = y2 -1; ll: LOOP if y1 > y2 then leave ll; else if is_leap(y1) = 1 then set ydays = ydays + 366; else set ydays = ydays + 365; end if; set y1 = y1 + 1; iterate ll; end if; END LOOP; return ydays; end |
-- no of days in month
create or replace function no_of_days_in_month(i int,year int) returns int begin if i = 1 or i = 3 or i = 5 or i = 7 or i = 8 or i = 10 or i = 12 then return 31; end if; if i =4 or i = 6 or i = 9 or i = 11 then return 30; end if; if i = 2 and is_leap(year) then return 29; else return 28; end if; end |
create or replace function m_l(d date) returns int begin declare mdays,m int; set m = month(d) + 1; set mdays = 0; ll:LOOP if m > 12 then leave ll; else set mdays = mdays + no_of_days_in_month(m,year(d)); set m = m + 1; iterate ll; end if; END LOOP; return mdays; end |
create or replace function m_s(d date) returns int begin declare mdays,m int; set m = 1; set mdays = day(d); ll:LOOP if m >= month(d) then leave ll; else set mdays = mdays + no_of_days_in_month(m,year(d)); set m = m + 1; iterate ll; end if; END LOOP; return mdays; end |
--Age Function
create or replace function age(dob date) returns int begin declare now date; set now = now(); return floor( (ydays(year(dob),year(now)) + m_l(dob) + m_s(now)) /365 ); end |
-- Much Simpler Function. Needs to understand looping and declaration
create or replace function age_x(dob date) returns int begin declare n date; declare days int; set days = 0; set n = now(); ll : LOOP if dob > n then leave ll; else set dob = date_add(dob, INTERVAL 1 day); set days = days + 1; iterate ll; end if; END LOOP; return days - 1; end
-- While Loop
create or replace function age_x(dob date) returns int begin declare n date; declare days int; set days = 0; set n = now(); ll : while dob < n do set dob = date_add(dob, INTERVAL 1 day); set days = days + 1; end while; return days; end |
-- Listing functions
show function status;
-- Seeing Function Definition
show create function m_s |
|
CREATE TABLE LanguageCodes (
LangID char(3) NOT NULL, -- Three-letter code
CountryID char(2) NOT NULL, -- Main country where used
LangStatus char(1) NOT NULL, -- L(iving), N(early extinct),
-- E(xtinct)
Name varchar(75) NOT NULL); -- Primary name in that country
CREATE TABLE CountryCodes (
CountryID char(2) NOT NULL, -- Two-letter code from ISO3166
Name varchar(75) NOT NULL ); -- Country name
CREATE TABLE LanguageIndex (
LangID char(3) NOT NULL, -- Three-letter code for language
CountryID char(2) NOT NULL, -- Country where this name is used
NameType char(2) NOT NULL, -- L(anguage), LA(lternate),
-- D(ialect), DA(lternate)
Name varchar(75) NOT NULL ); -- The name
CREATE TABLE ChangeHistory (
LangID char(3) NOT NULL, -- The code that has changed
Date date NOT NULL, -- Date change was released
Action char(1) NOT NULL, -- C(reated), E(xtended),
-- U(pdated), R(etired)
Description varchar(200) NOT NULL ); -- Description of change
LOAD DATA INFILE "ChangeHistory.tab" INTO TABLE
ChangeHistory(LangID, Action, Date, Description);
LOAD DATA INFILE "LanguageCodes.tab" INTO TABLE LanguageCodes;
LOAD DATA INFILE "LanguageIndex.tab" INTO TABLE LanguageIndex;
LOAD DATA INFILE "CountryCodes.tab" INTO TABLE CountryCodes;
|
SELECT * FROM transaction_data
LIMIT 10;
SELECT full_name, email FROM transaction_data
WHERE zip = 20252;
SELECT full_name, email FROM transaction_data
WHERE full_name = "Art Vandelay"
OR full_name LIKE "% der %";
SELECT ip_address, email FROM transaction_data
WHERE ip_address LIKE "10.%";
SELECT email FROM transaction_data
WHERE email LIKE "%temp_email.com";
SELECT * FROM transaction_data
WHERE ip_address LIKE "120.%"
AND full_name LIKE "John%"; |
/*
Creates the neccessary entries for TaskTypes and TimeTypes
*/
/*
Task Type:
*/
IF NOT EXISTS(SELECT TOP(1) [Name] FROM TimeManagement.TaskType)
BEGIN
DBCC CHECKIDENT ('[TimeManagement].[TaskType]', RESEED, 1)
INSERT INTO[TimeManagement].TaskType VALUES ( 'Development');
INSERT INTO[TimeManagement].TaskType VALUES ( 'Purchase & Logistics');
INSERT INTO[TimeManagement].TaskType VALUES ( 'Electrical Design');
INSERT INTO[TimeManagement].TaskType VALUES ( 'Network & Fiber Technology');
INSERT INTO[TimeManagement].TaskType VALUES ( 'LiDAR');
INSERT INTO[TimeManagement].TaskType VALUES ( 'Department');
INSERT INTO[TimeManagement].TaskType VALUES ( 'Technical Support');
END
/*
Time Type:
*/
IF NOT EXISTS(SELECT TOP(1) [Name] FROM TimeManagement.TimeType)
BEGIN
DBCC CHECKIDENT ('[TimeManagement].[TimeType]', RESEED, 1)
INSERT INTO[TimeManagement].TimeType VALUES ( 'Not Assigned');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Intern');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Extern');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Illness');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Training');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Vacation');
INSERT INTO[TimeManagement].TimeType VALUES ( 'Other');
END |
alter table message add raw character varying not null default ''; |
CREATE DATABASE IF NOT EXISTS `bookshop` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `bookshop`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: localhost Database: bookshop
-- ------------------------------------------------------
-- Server version 5.0.51b-community-nt-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this server
--
--
-- Table structure for table `zoo`
--
DROP TABLE IF EXISTS `zoo`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `zoo` (
`name` varchar(20) default NULL,
`type` varchar(20) default NULL,
`sex` char(1) default NULL,
`birth` date default NULL,
`death` date default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `zoo`
--
LOCK TABLES `zoo` WRITE;
/*!40000 ALTER TABLE `zoo` DISABLE KEYS */;
INSERT INTO `zoo` VALUES ('Slim','snake','f','2000-12-25',NULL),('Clipper','snake','m','2001-01-18',NULL),('Jane','lion','f','2002-05-09','2003-04-05'),('Joey','lion','m','2003-01-08',NULL),('Tuna','tiger','f','2003-03-15',NULL),('Susu','tiger','f','2003-03-15','2003-03-31'),('Mike','tiger','m','2003-03-15',NULL),('Olive','bear','f','2003-03-15',NULL);
/*!40000 ALTER TABLE `zoo` 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 2014-09-14 16:53:41
|
Run the four queries below in `psql postgres`
INSERT INTO bookmarks (url) VALUES
('http://www.makersacademy.com');
INSERT INTO bookmarks (url) VALUES
('http:/www.destroyallsoftware.com');
INSERT INTO bookmarks (url) VALUES
('http://www.twitter.com');
INSERT INTO bookmarks (url) VALUES
('http://www.google.com');
|
SELECT
ar.Name AS 'Artist',
SUM(il.Quantity) AS 'Tracks Sold'
FROM Artist ar
JOIN Album al ON ar.ArtistId = al.ArtistId
JOIN Track t ON al.AlbumId = t.AlbumId
JOIN InvoiceLine il ON t.TrackId = il.TrackId
GROUP BY ar.Name
ORDER BY SUM(il.Quantity) DESC
LIMIT 3; |
-- LABORATORY WORK 3
-- BY Mitrokhin_Oleksii
/*1. Написати PL/SQL код, що додає постачальників, щоб сумарна кількість усіх постачальників була 7. Ключі постачальників v1….vn.
Решта значень обов’язкових полів відповідає полям постачальника з ключем BRS01.
10 балів*/
/*2. Написати PL/SQL код, що по вказаному ключу замовника виводить у консоль його ім'я та визначає його статус.
Якщо він купив більше 10 продуктів - статус = "yes"
Якщо він купив менше 10 продуктів - статус = "no"
Якщо він немає замовлення - статус = "unknown*/
DISTINCT
customer_id int(15),
customer_name %customers.cust_name,
customer_status char(10)
begin
customer_id := '1000000001'
select
cust_id,
customer_name := cust_name,
sum (quantity) as cust_items
from
customers left join orders
on customers.cust_id = orders.cust_id
join orderitems
on orders.order_num = ordritems.order_num
group by customets.cust_id, customers.cust_name
where cust_id = customer_id
if (cust_items > 10) then
customer_status := 'yes'
else if (cust_items < 10) then
customer_status := 'no'
else if (cust_items == NULL) then
customer_status := 'unknown'
end if
DBSN(customer_id,customer_name, customer_status)
end
/*3. Створити представлення та використати його у двох запитах:
3.1. Вивести ім’я покупця та загальну кількість купленим ним товарів.
3.2. Вивести ім'я постачальника за загальну суму, на яку він продав своїх товарів.
6 балів.*/
VIEW CUST_ITEMS
(select
cust_name,
cust_id,
vend_id,
vend_name,
sum(quantity) as cust_items,
sum(orderitems.quantity*orderitems.item_price) as vendor_debet
from
customers join orders
on customers.cust_id = orders.cust_id
join orderitems
on orders.order_num = orderitems.order_num
join products
on orderitems.prod_id = products.prod_id
join vendors
on products.vend_id = vendors.vend_id
group by customers.cust_id, customers.cust_name, vendors.vend_id, vendors.vend_name);
select
cust_name,
cust_items
from cust_items;
select
vend_name,
vend_name
from cust_items;
|
SET FOREIGN_KEY_CHECKS = 0;
DROP DATABASE IF EXISTS unidad9_anexo;
CREATE DATABASE unidad9_anexo CHARACTER SET utf8mb4;
USE unidad9_anexo;
CREATE TABLE alumno (
id INT UNSIGNED PRIMARY KEY,
nombre VARCHAR(100) NOT NULL,
apellido1 VARCHAR(100) NOT NULL,
apellido2 VARCHAR(100),
fecha_nacimiento DATE NOT NULL,
es_repetidor ENUM('sí', 'no') DEFAULT 'no',
telefono VARCHAR(9)
);
CREATE TABLE ciclo (
id INT UNSIGNED PRIMARY KEY,
nombre VARCHAR(150) NOT NULL,
codigo VARCHAR(10) NOT NULL
);
CREATE TABLE modulo (
id INT UNSIGNED PRIMARY KEY,
codigo VARCHAR(10) NOT NULL,
nombre VARCHAR(100) NOT NULL,
ects INT NOT NULL,
curso ENUM('1', '2') NOT NULL,
ciclo_id INT UNSIGNED,
FOREIGN KEY(ciclo_id) REFERENCES ciclo(id)
ON DELETE SET NULL
ON UPDATE CASCADE
);
CREATE TABLE curso_academico (
id INT UNSIGNED PRIMARY KEY,
anyo_inicio INT NOT NULL,
anyo_fin INT NOT NULL
);
CREATE TABLE matricula (
id INT UNSIGNED PRIMARY KEY,
id_alumno INT UNSIGNED,
id_modulo INT UNSIGNED,
id_curso INT UNSIGNED,
FOREIGN KEY (id_alumno) REFERENCES alumno (id)
ON DELETE SET NULL
ON UPDATE CASCADE,
FOREIGN KEY (id_modulo) REFERENCES modulo (id)
ON DELETE RESTRICT
ON UPDATE RESTRICT,
FOREIGN KEY (id_curso) REFERENCES curso_academico (id)
ON DELETE SET NULL
ON UPDATE CASCADE
);
CREATE TABLE instituto (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(150) NOT NULL,
direccion VARCHAR(200) NOT NULL
);
-- Inserciones de alumnos
INSERT INTO alumno VALUES(1, 'María', 'Sánchez', 'Pérez', '1990/12/01', 'no', NULL);
INSERT INTO alumno VALUES(2, 'Juan', 'Sáez', 'Vega', '1998/04/02', 'no', 618253876);
INSERT INTO alumno VALUES(3, 'Pepe', 'Ramírez', 'Gea', '1988/01/03', 'no', NULL);
INSERT INTO alumno VALUES(4, 'Lucía', 'Sánchez', 'Ortega', '1993/06/13', 'sí', 678516294);
INSERT INTO alumno VALUES(5, 'Paco', 'Martínez', 'López', '1995/11/24', 'no', 692735409);
INSERT INTO alumno VALUES(6, 'Irene', 'Gutiérrez', 'Sánchez', '1991/03/28', 'sí', NULL);
INSERT INTO alumno VALUES(7, 'Cristina', 'Fernández', 'Ramírez', '1996/09/17', 'no', 628349590);
INSERT INTO alumno VALUES(8, 'Antonio', 'Carretero', 'Ortega', '1994/05/20', 'sí', 612345633);
INSERT INTO alumno VALUES(9, 'Manuel', 'Domínguez', 'Hernández', '1999/07/08', 'no', NULL);
INSERT INTO alumno VALUES(10, 'Daniel', 'Moreno', 'Ruiz', '1998/02/03', 'no', NULL);
INSERT INTO ciclo VALUES (1, 'Sistemas microinformáticos y redes', 'SMR');
INSERT INTO ciclo VALUES (2, 'Administración de Sistemas Informáticos y Redes', 'ASIR');
INSERT INTO ciclo VALUES (3, 'Desarrollo de Aplicaciones Multiplataforma', 'DAM');
INSERT INTO ciclo VALUES (4, 'Desarrollo de Aplicaciones Web', 'DAW');
INSERT INTO modulo VALUES(1, 'BD', 'Bases de Datos', 128, '1', 4);
INSERT INTO modulo VALUES(2, 'LMSGI', 'Lenguajes de marcas y sistemas de gestión de información', 128, '1', 4);
INSERT INTO modulo VALUES(3, 'ED', 'Entornos de Desarrollo', 128, '1', 4);
INSERT INTO modulo VALUES(4, 'PRO', 'Programación', 128, '1', 4);
INSERT INTO curso_academico VALUES (1, 2017, 2018);
INSERT INTO curso_academico VALUES (2, 2018, 2019);
INSERT INTO curso_academico VALUES (3, 2019, 2020);
INSERT INTO matricula VALUES
(1, 1, 1, 3),
(2, 1, 2, 3),
(3, 1, 3, 3),
(4, 2, 1, 3),
(5, 2, 2, 3),
(6, 2, 3, 3),
(7, 3, 1, 3),
(8, 3, 2, 3),
(9, 3, 3, 3),
(10, 4, 1, 2),
(11, 4, 2, 2),
(12, 4, 3, 2),
(13, 5, 1, 2),
(14, 5, 2, 2),
(15, 5, 3, 2),
(16, 6, 1, 2),
(17, 6, 2, 2),
(18, 6, 3, 2),
(19, 1, 4, 3),
(20, 2, 4, 3),
(21, 3, 4, 3);
SET FOREIGN_KEY_CHECKS = 1; |
insert into usr(id, created, email, password, role, status, updated, username) VALUES
(2, '2020-05-05', 'test@gmail.com', '$2a$08$fL7u5xcvsZl78su29x1ti.dxI.9rYO8t0q5wk2ROJ.1cdR53bmaVG', 'ROLE_USER', 'Active', '2020-05-05', 'test'); |
--Procedure to drop all views from DB
CREATE OR REPLACE PROCEDURE DROP_ALL_VIEWS AS
BEGIN
FOR i IN (SELECT view_name FROM user_views)
LOOP
EXECUTE IMMEDIATE('DROP VIEW ' || user || '.' || i.view_name);
END LOOP;
END DROP_ALL_VIEWS;
-- dynamicall creates a view displaying the total number of books, cds,
-- and movies in a given collection. The parameter is the id of the collection
CREATE OR REPLACE PROCEDURE PROC_MAKE_TOT_VIEW
(
PARAM1 IN NUMBER
) AS
sql_stmt VARCHAR2(1000);
BEGIN
sql_stmt := 'CREATE OR REPLACE VIEW coll_enum_'||PARAM1||' (total) AS
SELECT COUNT(b.title) AS total
FROM books b, collections c, coll_book clb
WHERE c.id = ' || PARAM1 || 'AND c.id = clb.c_id AND
clb.book_id = b.id
UNION ALL
SELECT COUNT(cd.title)
FROM cds cd, collections c, coll_cd clcd
WHERE c.id = ' || PARAM1 || ' AND c.id = clcd.c_id AND
clcd.cd_id = cd.id
UNION ALL
SELECT COUNT(m.title)
FROM movies m, collections c, coll_movie clm
WHERE c.id = ' || PARAM1 || ' AND c.id = clm.c_id AND
clm.m_id = m.id';
EXECUTE IMMEDIATE sql_stmt;
END PROC_MAKE_TOT_VIEW;
-- remove all references to the collection whose id is passed as a parameter
CREATE OR REPLACE PROCEDURE PROC_DEL_COL_REFS
(
V_C_ID IN VARCHAR2
) AS
BEGIN
DELETE FROM coll_book
WHERE c_id = v_c_id;
DELETE FROM coll_cd
WHERE c_id = v_c_id;
DELETE FROM coll_movie
WHERE c_id = v_c_id;
END PROC_DEL_COL_REFS; |
-- select columns id and name from Students, aliased as s.
-- the left join keyword returns all tables from the left table (table 1), and the matching
-- records from the right table (table 2).
-- the left join clause allows you to query data from multiple tables.
-- because we need to reference columns in another table, we will use a left join to do this.
-- we left join the Departments table, aliased as d, on s.department_id being identical to d.id.
-- we also want d.id to not exist, which will give us the id and name of students who are enrolled
-- in courses that no longer exist.
Select s.id,
s.name
from Students s
left join Departments d on s.department_id = d.id
where d.id is Null |
/*
DESCRIPTION:
Initial field mapping and prelimilary data cleaning for BIS job applications data
INPUTS:
dob_jobapplications
OUTPUTS:
_INIT_BIS_devdb (
uid text,
job_number text,
job_type text,
job_desc text,
_occ_initial text,
_occ_proposed text,
stories_init numeric,
stories_prop text,
zoningsft_init numeric,
zoningsft_prop numeric,
classa_init numeric,
classa_prop numeric,
_job_status text,
date_lastupdt text,
date_filed text,
date_statusd text,
date_statusp text,
date_statusr text,
date_statusx text,
zoningdist1 text,
zoningdist2 text,
zoningdist3 text,
specialdist1 text,
specialdist2 text,
landmark text,
ownership text,
owner_name text,
owner_biznm text,
owner_address text,
owner_zipcode text,
owner_phone text,
height_init text,
height_prop text,
constructnsf text,
enlargement text,
enlargementsf text,
costestimate text,
loftboardcert text,
edesignation text,
curbcut text,
tracthomes text,
address_numbr text,
address_street text,
address text,
bin text,
bbl text,
boro text,
x_withdrawal text,
existingzoningsqft text,
proposedzoningsqft text,
buildingclass text,
otherdesc text
)
*/
DROP TABLE IF EXISTS _INIT_BIS_devdb;
WITH
-- identify relevant_jobs
JOBNUMBER_relevant as (
SELECT ogc_fid
FROM dob_jobapplications
WHERE jobdocnumber = '01'
AND
(
jobtype ~* 'A1|DM|NB'
OR
(jobtype = 'A2'
AND sprinkler is NULL
AND lower(jobdescription) LIKE '%combin%'
AND lower(jobdescription) NOT LIKE '%sprinkler%'
)
)
AND gid = 1
) SELECT
distinct
ogc_fid::text as uid,
jobnumber::text as job_number,
-- Job Type recoding
(CASE
WHEN jobtype = 'A1' THEN 'Alteration'
WHEN jobtype = 'DM' THEN 'Demolition'
WHEN jobtype = 'NB' THEN 'New Building'
WHEN jobtype = 'A2' THEN 'Alteration (A2)'
ELSE jobtype
END ) as job_type,
(CASE WHEN jobdescription !~ '[a-zA-Z]'
THEN NULL ELSE jobdescription END) as job_desc,
-- removing '.' for existingoccupancy
-- and proposedoccupancy (3 records affected)
replace(existingoccupancy, '.', '') as _occ_initial,
replace(proposedoccupancy, '.', '') as _occ_proposed,
-- set 0 -> null for jobtype = A1 or DM
(CASE WHEN jobtype ~* 'A1|DM'
THEN nullif(existingnumstories, '0')::numeric
ELSE NULL
END) as stories_init,
-- set 0 -> null for jobtype = A1 or NB
(CASE WHEN jobtype ~* 'A1|NB'
THEN nullif(proposednumstories, '0')::numeric
ELSE NULL
END) as stories_prop,
-- set 0 -> null for jobtype = A1 or DM\
(CASE WHEN jobtype ~* 'A1|DM'
THEN nullif(existingzoningsqft, '0')::numeric
ELSE existingzoningsqft::numeric
END) as zoningsft_init,
-- set 0 -> null for jobtype = A1 or DM
(CASE WHEN jobtype ~* 'A1|DM'
THEN nullif(proposedzoningsqft, '0')::numeric
ELSE proposedzoningsqft::numeric
END) as zoningsft_prop,
-- if existingdwellingunits is not a number then null
(CASE WHEN jobtype ~* 'NB' THEN 0
ELSE (CASE WHEN existingdwellingunits ~ '[^0-9]' THEN NULL
ELSE existingdwellingunits::numeric END)
END) as classa_init,
-- if proposeddwellingunits is not a number then null
(CASE WHEN jobtype ~* 'DM' THEN 0
ELSE (CASE WHEN proposeddwellingunits ~ '[^0-9]' THEN NULL
ELSE proposeddwellingunits::numeric END)
END) as classa_prop,
-- one to one mappings
jobstatusdesc as _job_status,
latestactiondate as date_lastupdt,
prefilingdate as date_filed,
fullypaid as date_statusd,
approved as date_statusp,
fullypermitted as date_statusr,
signoffdate as date_statusx,
zoningdist1 as ZoningDist1,
zoningdist2 as ZoningDist2,
zoningdist3 as ZoningDist3,
specialdistrict1 as SpecialDist1,
specialdistrict2 as SpecialDist2,
(CASE WHEN landmarked = 'Y' THEN 'Yes'
ELSE NULL END) as Landmark,
ownership_translate(
cityowned,
ownertype,
nonprofit
) as ownership,
ownerlastname||', '||ownerfirstname as owner_name,
ownerbusinessname as Owner_BizNm,
ownerhousestreetname as Owner_Address,
zip as Owner_ZipCode,
ownerphone as Owner_Phone,
(CASE WHEN jobtype ~* 'A1|DM'
THEN NULLIF(existingheight, '0')
END)::numeric as Height_Init,
(CASE WHEN jobtype ~* 'A1|NB'
THEN NULLIF(proposedheight, '0')
END)::numeric as Height_Prop,
totalconstructionfloorarea as ConstructnSF,
(CASE
WHEN (horizontalenlrgmt = 'Y' AND verticalenlrgmt <> 'Y')
THEN 'Horizontal'
WHEN (horizontalenlrgmt <> 'Y' AND verticalenlrgmt = 'Y')
THEN 'Vertical'
WHEN (horizontalenlrgmt = 'Y' AND verticalenlrgmt = 'Y')
THEN 'Horizontal and Vertical'
END) as enlargement,
enlargementsqfootage as EnlargementSF,
initialcost as CostEstimate,
(CASE WHEN loftboard = 'Y' THEN 'Yes'
ELSE NULL END) as LoftBoardCert,
(CASE WHEN littlee = 'Y' THEN 'Yes'
WHEN littlee = 'H' THEN 'Yes'
ELSE NULL END) as eDesignation,
(CASE WHEN curbcut = 'X' THEN 'Yes'
ELSE NULL END) as CurbCut,
cluster as TractHomes,
regexp_replace(
trim(housenumber),
'(^|)0*', '', '') as address_numbr,
trim(streetname) as address_street,
regexp_replace(
trim(housenumber),
'(^|)0*', '', '')||' '||trim(streetname) as address,
bin as bin,
LEFT(bin, 1)||lpad(block, 5, '0')||lpad(RIGHT(lot,4), 4, '0') as bbl,
CASE WHEN borough ~* 'Manhattan' THEN '1'
WHEN borough ~* 'Bronx' THEN '2'
WHEN borough ~* 'Brooklyn' THEN '3'
WHEN borough ~* 'Queens' THEN '4'
WHEN borough ~* 'Staten Island' THEN '5'
END as boro,
-- Add dummy columns for union to now applications for _init_devdb
existingzoningsqft as zsf_init,
proposedzoningsqft as zsf_prop,
NULL::text as zug_init,
NULL::text as zug_prop,
NULL::numeric as zsfr_prop,
NULL::numeric as zsfc_prop,
NULL::numeric as zsfcf_prop,
NULL::numeric as zsfm_prop,
NULL::numeric as prkngprop,
-- End Dummy columns
buildingclass as bldg_class,
otherdesc as desc_other,
specialactionstatus as x_withdrawal,
ST_SetSRID(ST_Point(
longitude::double precision,
latitude::double precision),4326) as dob_geom
INTO _INIT_BIS_devdb
FROM dob_jobapplications
WHERE ogc_fid in (select ogc_fid from JOBNUMBER_relevant);
|
mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2011-10-24 14:04:48 |
+---------------------+
1 row in set (0.00 sec)
mysql> SELECT SHA('hello world!');
+------------------------------------------+
| SHA('hello world!') |
+------------------------------------------+
| 430ce34d020724ed75a196dfc2ad67c77772d169 |
+------------------------------------------+
1 row in set (0.00 sec)
-- Here we have a password column stored in a database. The password attempt is the value that the user has entered. We can match this against a user email. If this query returns a row then we know we have a match.
SELECT first_name, last_name
FROM 'Users'
WHERE 'password' = SHA('password_attempt')
AND 'email' = 'someone@somewhere.com';
-- Next we are inserting in to the same user table this time we will use the NOW() function to create the signup date for the user. We know when ever the record is created will be the signup date so its safe to assume.
INSERT INTO 'Users' (first_name, last_name, email, password, signup_date)
VALUES ('john', 'smith', 'john@smith.com', NOW()); |
-- @description parquet insert vary pagesize/rowgroupsize
-- @created 2013-08-09 20:33:16
-- @modified 2013-08-09 20:33:16
-- @tags HAWQ parquet
--start_ignore
drop table if exists pTable1;
drop table if exists pTable3_from;
drop table if exists pTable3_to;
drop table if exists pTable4_from;
drop table if exists pTable4_to;
drop table if exists pTable5_from;
drop table if exists pTable5_to;
--end_ignore
--value/record size equal to pagesize/rowgroupsize
create table pTable1 (a1 char(10485760), a2 char(10485760), a3 char(10485760), a4 char(10485760), a5 char(10485760), a6 char(10485760), a7 char(10485760), a8 char(10485760), a9 char(10485760), a10 char(10485760)) with(appendonly=true, orientation=parquet, pagesize=10485760, rowgroupsize=104857600);
insert into pTable1 values ( ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)), ('a'::char(10485760)) );
--single column, one data page contains several values, one rwo group contains several groups
create table pTable3_from ( a1 text ) with(appendonly=true, orientation=parquet);
insert into pTable3_from values(repeat('parquet',100));
insert into pTable3_from values(repeat('parquet',20));
insert into pTable3_from values(repeat('parquet',30));
create table pTable3_to ( a1 text ) with(appendonly=true, orientation=parquet, pagesize=1024, rowgroupsize=1025);
insert into pTable3_to select * from pTable3_from;
select count(*) from pTable3_to;
--multiple columns, multiple rows combination
create table pTable4_from ( a1 text , a2 text) with(appendonly=true, orientation=parquet);
insert into pTable4_from values(repeat('parquet',200), repeat('pq',200));
insert into pTable4_from values(repeat('parquet',50), repeat('pq',200));
create table pTable4_to ( a1 text, a2 text ) with(appendonly=true, orientation=parquet, pagesize=2048, rowgroupsize=4096);
insert into pTable4_to select * from pTable4_from;
select count(*) from pTable4_to;
--large data insert, several column values in one page, several rows in one rowgroup
create table pTable5_from (a1 char(1048576), a2 char(2048576), a3 char(3048576), a4 char(4048576), a5 char(5048576), a6 char(6048576), a7 char(7048576), a8 char(8048576), a9 char(9048576), a10 char(9)) with(appendonly=true, orientation=parquet, pagesize=10485760, rowgroupsize=90874386);
insert into pTable5_from values ( ('a'::char(1048576)), ('a'::char(2048576)), ('a'::char(3048576)), ('a'::char(4048576)), ('a'::char(5048576)), ('a'::char(6048576)), ('a'::char(7048576)), ('a'::char(8048576)), ('a'::char(9048576)), ('a'::char(9)) );
create table pTable5_to (a1 char(1048576), a2 char(2048576), a3 char(3048576), a4 char(4048576), a5 char(5048576), a6 char(6048576), a7 char(7048576), a8 char(8048576), a9 char(9048576), a10 char(9)) with(appendonly=true, orientation=parquet, pagesize=10485760, rowgroupsize=17437200);
insert into pTable5_to select * from pTable5_from;
select count(a10) from pTable5_to; |
INSERT INTO burgers (burger_name) VALUES ("Jalapeno Burger"), ("Big Mac"), ("Plain Burger");
SELECT * FROM burgers;
|
--------------------------------------------------------
-- DDL for Table MOBILEUM_ASP_IBHW
--------------------------------------------------------
CREATE TABLE MOBILEUM_ASP_IBHW
( PAIS CHAR(3 CHAR),
FECHA DATE,
CNT_LLAMADAS NUMBER,
CNT_POLITICA_RESTRICCION NUMBER,
CNT_BOLQ_REL_TIPO_GEST NUMBER,
CNT_BLOQ_RAN_REL NUMBER,
CNT_PERMITIERON_CONTINUAR NUMBER,
CNT_CONECTADAS_VOICE_MAIL NUMBER,
CNT_CONECTADA_ANUNCIO_SWITCH NUMBER
)
NOCOMPRESS NOLOGGING
TABLESPACE TBS_SUMMARY ;
COMMENT ON TABLE MOBILEUM_ASP_IBHW IS 'Sumarizaciones del MOBILEUM_ASP a nivel IBHW';
--------------------------------------------------------
-- Constraints for Table MOBILEUM_ASP_IBHW
--------------------------------------------------------
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_CONECTADA_ANUNCIO_SWITCH NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_CONECTADAS_VOICE_MAIL NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_PERMITIERON_CONTINUAR NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_BLOQ_RAN_REL NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_BOLQ_REL_TIPO_GEST NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_POLITICA_RESTRICCION NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (CNT_LLAMADAS NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (FECHA NOT NULL ENABLE);
ALTER TABLE MOBILEUM_ASP_IBHW MODIFY (PAIS NOT NULL ENABLE);
|
■問題文
貸し出し記録テーブル(rental)上、returned列が9(紛失)であるレコードについて、
対応する書籍情報テーブル(books)上の書籍情報を削除してみましょう。
■実行文
# 書籍情報テーブルのデータを削除する
DELETE FROM
books
# 貸し出し記録テーブル上returned列が9(紛失)である書籍情報の場合のみ削除する
WHERE
isbn IN
(
SELECT
isbn
FROM
rental
WHERE
returned = '9'
)
;
■返却値
mysql> DELETE FROM
-> books
-> WHERE
-> isbn IN
-> (
-> SELECT
-> isbn
-> FROM
-> rental
-> WHERE
-> returned = '9'
-> )
-> ;
Query OK, 2 rows affected (0.06 sec)
【Before】
mysql> select count(*) from books;
+----------+
| count(*) |
+----------+
| 13 |
+----------+
1 row in set (0.03 sec)
mysql> select * from books where isbn in (select isbn from rental where returned='9');
+---------------+------------------------+-------+-----------+--------------+-------------+
| isbn | title | price | publish | publish_date | category_id |
+---------------+------------------------+-------+-----------+--------------+-------------+
| 4-0010-0000-0 | ハムスターの観察未分類 | 818 | WINGS出版 | 2010-11-01 | XXXXX |
| 4-8833-0000-2 | SQLプチブックSQL | 1310 | 日経BP | 2010-11-30 | XXXXX |
+---------------+------------------------+-------+-----------+--------------+-------------+
2 rows in set (0.03 sec)
【After】
mysql> select count(*) from books;
+----------+
| count(*) |
+----------+
| 11 |
+----------+
1 row in set (0.00 sec)
mysql> select * from books where isbn in (select isbn from rental where returned='9');
Empty set (0.00 sec) |
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username TEXT UNIQUE,
password TEXT,
admin BOOLEAN DEFAULT false
);
CREATE TABLE reviews (
id SERIAL PRIMARY KEY,
content TEXT,
user_id INTEGER REFERENCES users,
sent_at TIMESTAMP,
restaurant_id INTEGER REFERENCES restaurants,
stars INTEGER
);
CREATE TABLE restaurants (
id SERIAL PRIMARY KEY,
restaurant TEXT
);
|
USE bottega_university_project_schema;
-- groups students by courses
SELECT grades_course_id, grades.grades_student_id, students.students_name
FROM grades
RIGHT JOIN students ON grades.grades_student_id = students.students_id
ORDER BY grades.grades_course_id; |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.2 (Debian 12.2-4)
-- Dumped by pg_dump version 13.1 (Debian 13.1-1+b1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: category; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.category (
id integer NOT NULL,
name character varying(255) NOT NULL
);
ALTER TABLE public.category OWNER TO postgres;
--
-- Name: category_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.category_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.category_id_seq OWNER TO postgres;
--
-- Name: doctrine_migration_versions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.doctrine_migration_versions (
version character varying(191) NOT NULL,
executed_at timestamp(0) without time zone DEFAULT NULL::timestamp without time zone,
execution_time integer
);
ALTER TABLE public.doctrine_migration_versions OWNER TO postgres;
--
-- Name: user; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."user" (
id integer NOT NULL,
email character varying(180) NOT NULL,
roles json NOT NULL,
password character varying(255) NOT NULL,
firstname character varying(255) NOT NULL,
lastname character varying(255) NOT NULL
);
ALTER TABLE public."user" OWNER TO postgres;
--
-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.user_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_id_seq OWNER TO postgres;
--
-- Data for Name: category; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.category (id, name) FROM stdin;
1 T-shirts
2 Echarpes
3 Manteaux
4 Bonets
\.
--
-- Data for Name: doctrine_migration_versions; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.doctrine_migration_versions (version, executed_at, execution_time) FROM stdin;
DoctrineMigrations\\Version20210110153604 2021-01-10 16:36:31 243
DoctrineMigrations\\Version20210110164741 2021-01-10 17:48:05 41
DoctrineMigrations\\Version20210124160221 2021-01-24 17:02:46 322
\.
--
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."user" (id, email, roles, password, firstname, lastname) FROM stdin;
1 kwenol@yahoo.fr [] $argon2id$v=19$m=65536,t=4,p=1$HBNggjHMO0NpJhfkrC1xJw$+CtnAGendTV4g/FVtCc1HNGkiDKshwD3xcn3RwznGOI Loic Bastien Tchos
\.
--
-- Name: category_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.category_id_seq', 4, true);
--
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.user_id_seq', 1, true);
--
-- Name: category category_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.category
ADD CONSTRAINT category_pkey PRIMARY KEY (id);
--
-- Name: doctrine_migration_versions doctrine_migration_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.doctrine_migration_versions
ADD CONSTRAINT doctrine_migration_versions_pkey PRIMARY KEY (version);
--
-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_pkey PRIMARY KEY (id);
--
-- Name: uniq_8d93d649e7927c74; Type: INDEX; Schema: public; Owner: postgres
--
CREATE UNIQUE INDEX uniq_8d93d649e7927c74 ON public."user" USING btree (email);
--
-- PostgreSQL database dump complete
--
|
--Data Analysis
--#1: List the following details of each employee: employee number, last name, first name, sex, and salary.
--Merge employee table and salary table and pull requested fields
select employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary
from salaries
inner join employees on
employees.emp_no = salaries.emp_no;
--#2: List the first name, last name, and hire date for employees who were hired in 1986
select first_name, last_name, hire_date from employees
where hire_date like '%1986';
--#3: List the manager of each department with the following information:
--department number, department name, the manager's employee number, last name, first name
--inner join three tables https://www.w3schools.com/sql/sql_join_inner.asp
select departments.dept_no, departments.dept_name, dept_manager.emp_no, employees.last_name, employees.first_name
from dept_manager
inner join departments on
departments.dept_no = dept_manager.dept_no
inner join employees on
dept_manager.emp_no = employees.emp_no
--#4: List the department of each employee with the following information: employee number, last name, first name, and department name.
select employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
from dept_employee
inner join employees on
employees.emp_no = dept_employee.emp_no
inner join departments on
dept_employee.dept_no = departments.dept_no
--#5: List first name, last name, and sex for employees whose first name is "Hercules" and last names begin with "B."
select first_name, last_name, sex from employees
where first_name = 'Hercules' and last_name like '%B%';
--#6: List all employees in the Sales department, including their employee number, last name, first name, and department name.
select employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
from dept_employee
inner join employees on
employees.emp_no = dept_employee.emp_no
inner join departments on
dept_employee.dept_no = departments.dept_no
where dept_name = 'Sales';
--#6: List all employees in the Sales and Development departments,
--including their employee number, last name, first name, and department name.
select employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
from dept_employee
inner join employees on
employees.emp_no = dept_employee.emp_no
inner join departments on
dept_employee.dept_no = departments.dept_no
where dept_name = 'Sales' or dept_name = 'Development';
--#8: In descending order, list the frequency count of employee last names,
--i.e., how many employees share each last name.
select last_name, count(last_name) as "Last Name Count"
from Employees
group by last_name
order by "Last Name Count" desc;
|
UPDATE products
SET description= $2
WHERE id = $1;
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-06-2017 a las 22:04:15
-- Versión del servidor: 5.7.14
-- Versión de PHP: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `productores`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2017_06_26_193427_create_producers_table', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `producers`
--
CREATE TABLE `producers` (
`id` int(10) UNSIGNED NOT NULL,
`rfc` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`razon_social` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`apellido_paterno` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`apellido_materno` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`nombre` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fecha_nacimiento` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sexo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`img_fierro` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`curp` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ine` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`telefono_fijo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`telefono_movil` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`domicilio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`estado` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`municipio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`localidad` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rancho_predio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`upp` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tipo_propiedad` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`hectareas` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`descripcion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`titulo_patente` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fecha_registro` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ultima_actualizacion` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`tipo_credencial` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`actividad_secundaria` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`folio_productor` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bovinos` int(11) DEFAULT NULL,
`becerras` int(11) DEFAULT NULL,
`becerros` int(11) DEFAULT NULL,
`vaquillas` int(11) DEFAULT NULL,
`toretes` int(11) DEFAULT NULL,
`toros` int(11) DEFAULT NULL,
`vacas` int(11) DEFAULT NULL,
`ovinos` int(11) DEFAULT NULL,
`porcinos` int(11) DEFAULT NULL,
`caprinos` int(11) DEFAULT NULL,
`colmenas` int(11) DEFAULT NULL,
`equinos` int(11) DEFAULT NULL,
`aves` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indices de la tabla `producers`
--
ALTER TABLE `producers`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT de la tabla `producers`
--
ALTER TABLE `producers`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED 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 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 09, 2021 at 08:08 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `loginform`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`fullname` varchar(50) NOT NULL,
`username` text NOT NULL,
`password` text NOT NULL,
`words` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `fullname`, `username`, `password`, `words`) VALUES
(1, '', 'senny', 'nicoria', ''),
(2, 'se', 'se', 'se', '<br>sdf'),
(3, 'se', 'se', 'se', '<br>sdf'),
(4, 'qwe', 'qwe', 'qwe', ''),
(5, 'se', 'qwe', 'qwe', ''),
(6, '1', '1', '1', ''),
(7, '2', '2', '2', ''),
(8, '3213', 'qwe123', '123', ''),
(9, 'asd', 'asd', 'asd', '1<br>2<br>3<br>4<br>5<br>6<br>hai<br>hai'),
(10, 'John', 'doe', 'qweqwe', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- 一级菜单
insert into sys_menu values('400', 'Inventory Management', '0', '20', '#', 'M', '0', '', 'fa fa-archive font12', 'admin', '2018-03-01', 'admin', '2018-03-01', 'Inventory Management');
-- 二级菜单
insert into sys_menu values('410', 'Stock In', '400', '1', '/inventory/inStock', 'C', '0', 'inventory:inStock:view', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', 'In Stock');
insert into sys_menu values('420', 'Stock Out', '400', '2', '/inventory/outStock', 'C', '0', 'inventory:outStock:view', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', 'Out Stock');
insert into sys_menu values('430', 'Inventory List', '400', '3', '/inventory/queryinventory', 'C', '0', 'inventory:queryinventory:view', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', 'Inventory');
insert into sys_menu values('440', 'Sell Return', '400', '4', '/inventory/salesReturn', 'C', '0', 'inventory:salesReturn:view', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', 'resell Stock');
insert into sys_menu values('450', 'Replenishment', '400', '5', '/inventory/queryproduct', 'C', '0', 'inventory:queryproduct:view', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', 'QueryProduct');
insert into sys_menu values('411', 'Query', '410', '1', '#', 'F', '0', 'inventory:inStock:list', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('412', 'Add', '410', '2', '#', 'F', '0', 'inventory:inStock:add', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
-- insert into sys_menu values('413', 'Edit', '410', '3', '#', 'F', '0', 'inventory:inStock:edit', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('414', 'Remove', '410', '4', '#', 'F', '0', 'inventory:inStock:remove', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('415', 'Save', '410', '5', '#', 'F', '0', 'inventory:inStock:save', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('416', 'Detail', '410', '3', '#', 'F', '0', 'inventory:inStock:detail', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('421', 'Query', '420', '1', '#', 'F', '0', 'inventory:outStock:list', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('422', 'Add', '420', '2', '#', 'F', '0', 'inventory:outStock:add', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
-- insert into sys_menu values('423', 'Edit', '420', '3', '#', 'F', '0', 'inventory:outStock:edit', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('424', 'Remove', '420', '4', '#', 'F', '0', 'inventory:outStock:remove', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('425', 'Save', '420', '5', '#', 'F', '0', 'inventory:outStock:save', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('426', 'Detail', '420', '3', '#', 'F', '0', 'inventory:outStock:detail', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('431', 'Query', '430', '1', '#', 'F', '0', 'inventory:queryinventory:list', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('432', 'Detail', '430', '1', '#', 'F', '0', 'inventory:queryinventory:detail', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('451', 'Query', '450', '1', '#', 'F', '0', 'inventory:queryproduct:list', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('452', 'BatchDemand', '450', '2', '#', 'F', '0', 'inventory:queryproduct:batchDemand', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('441', 'Query', '440', '1', '#', 'F', '0', 'inventory:salesReturn:list', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('442', 'Add', '440', '2', '#', 'F', '0', 'inventory:salesReturn:add', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
-- insert into sys_menu values('443', 'Edit', '440', '3', '#', 'F', '0', 'inventory:salesReturn:edit', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('444', 'Remove', '440', '4', '#', 'F', '0', 'inventory:salesReturn:remove', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('445', 'Save', '440', '5', '#', 'F', '0', 'inventory:salesReturn:save', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
insert into sys_menu values('446', 'Detail', '440', '3', '#', 'F', '0', 'inventory:salesReturn:detail', '#', 'admin', '2018-03-01', 'admin', '2018-03-01', '');
-- 将按钮权限赋予role
insert into sys_role_menu values ('1', '400');
insert into sys_role_menu values ('1', '410');
insert into sys_role_menu values ('1', '411');
insert into sys_role_menu values ('1', '412');
insert into sys_role_menu values ('1', '414');
insert into sys_role_menu values ('1', '415');
insert into sys_role_menu values ('1', '416');
insert into sys_role_menu values ('1', '420');
insert into sys_role_menu values ('1', '421');
insert into sys_role_menu values ('1', '422');
insert into sys_role_menu values ('1', '424');
insert into sys_role_menu values ('1', '425');
insert into sys_role_menu values ('1', '426');
insert into sys_role_menu values ('1', '430');
insert into sys_role_menu values ('1', '431');
insert into sys_role_menu values ('1', '432');
insert into sys_role_menu values ('1', '440');
insert into sys_role_menu values ('1', '441');
insert into sys_role_menu values ('1', '442');
insert into sys_role_menu values ('1', '444');
insert into sys_role_menu values ('1', '445');
insert into sys_role_menu values ('1', '446');
insert into sys_role_menu values ('1', '450');
insert into sys_role_menu values ('1', '451');
insert into sys_role_menu values ('1', '452');
drop table if exists inv_inventory_in;
create table inv_inventory_in
(
sn int(11) unsigned NOT NULL AUTO_INCREMENT,
item_code varchar(20) not null comment 'Item Code',
batch varchar(100) not null ,
warehouse varchar(100) not null ,
position varchar(100) not null ,
price_purchase double(16,2) not null ,
price_fob_ontario double(16,2) not null ,
quantity double(16,3) not null ,
irradiation varchar(100) null ,
tpc varchar(100) null ,
vendor_id int(11) not null ,
customer_id int(11) null ,
status int(1) not null comment '状态(0正常 1停用)',
stock_in_date timestamp default current_timestamp comment '创建时间',
create_by varchar(64) default '' comment '创建者',
create_time timestamp default current_timestamp comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time timestamp default current_timestamp comment '更新时间',
remark varchar(500) default '' comment '备注',
primary key (sn)
) engine=innodb default charset=utf8;
drop table if exists inv_inventory_out;
create table inv_inventory_out
(
sn int(11) unsigned NOT NULL AUTO_INCREMENT,
item_code varchar(20) not null comment 'Item Code',
inventory_sn int(11) not null ,
batch varchar(100) not null ,
warehouse varchar(100) not null ,
position varchar(100) not null ,
quantity double(16,3) not null ,
price_sale double(16,2) null ,
po_code varchar(20) null ,
irradiation varchar(100) null ,
tpc varchar(100) null ,
vendor_id int(11) not null ,
customer_id int(11) null ,
status int(1) not null comment '状态(0正常 1停用)',
stockout_date varchar(10) default '' comment '出库时间',
create_by varchar(64) default '' comment '创建者',
create_time timestamp default current_timestamp comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time timestamp default current_timestamp comment '更新时间',
remark varchar(500) default '' comment '备注',
primary key (sn)
) engine=innodb default charset=utf8;
drop table if exists inv_sales_return;
create table inv_sales_return
(
sn int(11) unsigned NOT NULL AUTO_INCREMENT,
item_code varchar(20) not null comment 'Item Code',
stockout_sn int(11) not null ,
batch varchar(100) not null ,
warehouse varchar(100) not null ,
position varchar(100) not null ,
quantity double(16,3) not null ,
irradiation varchar(100) null ,
tpc varchar(100) null ,
vendor_id int(11) not null ,
customer_id int(11) null ,
status int(1) not null comment '状态(0正常 1停用)',
return_date varchar(10) default '' comment '出库时间',
create_by varchar(64) default '' comment '创建者',
create_time timestamp default current_timestamp comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time timestamp default current_timestamp comment '更新时间',
remark varchar(500) default '' comment '备注',
primary key (sn)
) engine=innodb default charset=utf8;
drop table if exists inv_inventory;
create table inv_inventory
(
sn int(11) unsigned NOT NULL AUTO_INCREMENT,
item_code varchar(20) not null comment 'Item Code',
batch varchar(100) not null ,
warehouse varchar(100) not null ,
position varchar(100) not null ,
price_purchase double(16,2) not null ,
price_fob_ontario double(16,2) not null ,
quantity double(16,3) not null ,
irradiation varchar(100) null ,
tpc varchar(100) null ,
vendor_id int(11) not null ,
customer_id int(11) null ,
status int(1) not null comment '状态(0正常 1停用)',
stock_in_date timestamp default current_timestamp comment '创建时间',
create_by varchar(64) default '' comment '创建者',
create_time timestamp default current_timestamp comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time timestamp default current_timestamp comment '更新时间',
remark varchar(500) default '' comment '备注',
primary key (sn)
) engine=innodb default charset=utf8;
drop table if exists sys_attachment;
create table sys_attachment
(
attachment_id int(11) unsigned NOT NULL AUTO_INCREMENT,
attachment_name varchar(100) not null ,
attachment_uuid varchar(100) not null ,
main_sn int(11) not null,
main_type varchar(100) not null,
create_by varchar(64) default '' comment '创建者',
create_time timestamp default current_timestamp comment '创建时间',
update_by varchar(64) default '' comment '更新者',
update_time timestamp default current_timestamp comment '更新时间',
remark varchar(500) default '' comment '备注',
primary key (attachment_id)
) engine=innodb default charset=utf8;
|
alter table genomic_align_group change group_id group_id bigint(20) unsigned NOT NULL auto_increment;
delete from meta where meta_key="schema_version";
insert into meta (meta_key,meta_value) values ("schema_version",36);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.