text stringlengths 6 9.38M |
|---|
-- dba_scheduler_jobs.sql
-- one perspective of the scheduler
@clears
set linesize 300 trimspool on
set pagesize 100
col start_date format a20
col owner format a20
col job_name format a30
col program_name format a20
col enabled format a3 head 'ENA|BLE'
col start_date format a21 head 'START DATE'
col next_run_date format a21 head 'NEXT RUN DATE'
col last_start_date format a21 head 'LAST START DATE'
col repeat_interval format a15 head 'REPEAT INTERVAL' word_wrapped
col last_run_duration format a14 head 'LAST RUN|DURATION|DD:HH:MM:SS'
col run_count format 99,999,999 head 'RUN|COUNT'
col retry_count format 999999 head 'RETRY|COUNT'
col max_runs format 999,999 head 'MAX|RUNS'
col job_action format a15 head 'CODE' word_wrapped
select
owner
, job_name
--, program_name
, to_char(cast(start_date as date),'mm/dd/yy-hh24:mi:ss')
|| ' ' || extract (timezone_abbr from start_date )
start_date
--, state
, case enabled
when 'TRUE' then 'YES'
when 'FALSE' then 'NO'
end enabled
-- last_run_duration is an interval
, lpad(nvl(extract (day from last_run_duration ),'00'),2,'0')
|| ':' || lpad(nvl(extract (hour from last_run_duration ),'00'),2,'0')
|| ':' || lpad(nvl(extract (minute from last_run_duration ),'00'),2,'0')
|| ':' || ltrim(to_char(nvl(extract (second from last_run_duration ),0),'09.90'))
last_run_duration
, to_char(cast(next_run_date as date),'mm/dd/yy-hh24:mi:ss')
|| ' ' || extract (timezone_abbr from next_run_date )
next_run_date
, to_char(cast(last_start_date as date),'mm/dd/yy-hh24:mi:ss')
|| ' ' || extract (timezone_abbr from last_start_date )
last_start_date
, run_count
--, max_runs
, retry_count
, job_action
, repeat_interval
, state
from DBA_SCHEDULER_JOBS
--where owner = user
where owner != 'SYS'
order by owner
/
|
DROP VIEW IF EXISTS hospital_compare.hip_knee;
CREATE VIEW hip_knee AS
SELECT a.ProviderNumber as provider_id,
a.HospitalName as ajc_hospital_name,
b.address,
b.City as city,
b.State as state,
b.zip_code,
b.county_name,
/* Rate of readmission after hip/knee surgery */
b.compared_to_national as readmissions_category,
b.footnote as readmissions_notes,
b.denominator as readmissions_patients,
b.score as readmissions_rate,
b.lower_estimate as readmissions_lower,
b.higher_estimate as readmissions_upper,
/* Rate of complications for hip/knee replacement patients */
c.compared_to_national as complications_category,
c.footnote as complications_notes,
c.denominator as complications_patients,
c.score as complications_rate,
c.lower_estimate as complications_lower,
c.higher_estimate as complications_upper
FROM hospital_compare.hospital_names a
LEFT JOIN hospital_compare.readmissions_deaths_hosp b
ON b.provider_id = a.ProviderNumber
AND b.measure_id = 'READM_30_HIP_KNEE'
LEFT JOIN hospital_compare.complications_hosp c
ON c.provider_id = a.ProviderNumber
AND c.measure_id = 'COMP_HIP_KNEE';
|
--alteracao de limite - visao sintetica
select gem.cd_gem as codigo_grupo, gem.nm_gem as grupo,
grt.cd_grt as codigo_gerente, grt.nm_grt as gerente,
emp.cd_emp as codigo_empresa, emp.nm_emp as empresa,
tlt.cd_tlt as codigo_tipo_limite, tlt.nm_tlt as tipo_limite,
count(distinct crt.cd_crt) as qtde,
sum(case when hlm.vl_cnc_lmt_atl = 0 and gem.cd_gem = 249 and hlm.dt_inc_usr >= to_date('2019-08-30', 'yyyy-mm-dd') + interval '18 hours' then hlm.vl_cnc_lmt_ant - hlm.vl_cnc_lmt_atl else 0 end) as reducao_zerados,
sum(case when hlm.vl_cnc_lmt_atl > 0 or gem.cd_gem <> 249 or hlm.dt_inc_usr < to_date('2019-08-30', 'yyyy-mm-dd') + interval '18 hours' then hlm.vl_cnc_lmt_ant - hlm.vl_cnc_lmt_atl else 0 end) as reducao_contratos,
sum(hlm.vl_cnc_lmt_ant - hlm.vl_cnc_lmt_atl) as reducao_total
from sc_opr.tbl_hlm hlm
inner join sc_opr.tbl_crt crt on hlm.cd_crt = crt.cd_crt
inner join sc_cad.tbl_ctr ctr on crt.cd_ctr = ctr.cd_ctr
inner join sc_cad.tbl_emp emp on ctr.cd_emp = emp.cd_emp
inner join sc_cad.tbl_gem gem on emp.cd_gem = gem.cd_gem
inner join sc_cad.tbl_grt grt on ctr.cd_grt = grt.cd_grt
inner join sc_opr.tbl_tlt tlt on tlt.cd_tlt = hlm.cd_tlt
where hlm.dt_inc_usr >= '2019-08-30'
--and hlm.vl_cnc_lmt_atl > 0
group by gem.cd_gem, grt.cd_grt, emp.cd_emp, tlt.cd_tlt, grt.nm_grt, gem.nm_gem, emp.nm_emp, tlt.nm_tlt
having sum(hlm.vl_cnc_lmt_atl) - sum(hlm.vl_cnc_lmt_ant) < 0
order by grupo, gerente, empresa;
--alteracao de limite - visao analitica
select gem.cd_gem as codigo_grupo, gem.nm_gem as grupo,
grt.cd_grt as codigo_gerente, grt.nm_grt as gerente,
emp.cd_emp as codigo_empresa, emp.nm_emp as empresa,
tlt.cd_tlt as codigo_tipo_limite, tlt.nm_tlt as tipo_limite,
crt.cd_crt as cartao,
hlm.dt_usr_inc as data_alteracao,
hlm.vl_cnc_lmt_ant as limite_anterior,
hlm.vl_cnc_lmt_atl as novo_limite
from sc_opr.tbl_hlm hlm
inner join sc_opr.tbl_crt crt on hlm.cd_crt = crt.cd_crt
inner join sc_cad.tbl_ctr ctr on crt.cd_ctr = ctr.cd_ctr
inner join sc_cad.tbl_emp emp on ctr.cd_emp = emp.cd_emp
inner join sc_cad.tbl_gem gem on emp.cd_gem = gem.cd_gem
inner join sc_cad.tbl_grt grt on ctr.cd_grt = grt.cd_grt
inner join sc_opr.tbl_tlt tlt on tlt.cd_tlt = hlm.cd_tlt
where hlm.dt_inc_usr >= '2019-08-30'
and hlm.vl_cnc_lmt_atl < hlm.vl_cnc_lmt_ant
order by grupo, gerente, empresa, cartao;
|
--run scripts to test sql statements
--used for league_by_id
select *
from league
join course on course.course_id = league.course_id
join address on course.address_id = course.address_id
where league.league_id = ? limit 1;
--come back to this
select distinct *
from user_round
join users on users.user_id = user_round.user_id
join user_league on users.user_id = user_league.user_id
join league on user_league.league_id = league.league_id
join round on user_round.round_id = round.round_id
join course on course.course_id = round.course_id
where user_league.league_id = 2;
select *
from user_round
join round on round.round_id = user_round.round_id
join users on user_round.user_id = users.user_id
where user_round.user_id = 5;
--one gigantic join just filtering the info we want
select *
from user_league
join users on users.user_id = user_league.user_id
join league on league.league_id = user_league.league_id
join user_round on user_round.user_id = users.user_id
join round on user_round.round_id = round.round_id
where user_league.user_id = 5;
select * from user_round
join round on round.round_id = user_round.round_id
join users on user_round.user_id = users.user_id
join user_league on user_league.user_id = users.user_id
join league on league.league_id = user_league.league_id
where user_league.league_id = 1;
insert into user_league(user_id,league_id) values (5,1);
--need all the leagues the user is in and their scores grouped
--this doesnt work either, I need ALL users that matches user_id for the league.
--FUCK
select *
from users
join user_round on user_round.user_id = users.user_id
join user_league on user_league.user_id = users.user_id
join league on league.league_id = user_league.league_id
where league.league_id = 2;
--split it into multiple calls, idk any other way
--get league id's for user
select league_id from user_league where user_id = 4;
--loop through league ID's
--store user_id's and use that for calls?
select user_id, league_name, score_type from user_league
join league on league.league_id = user_league.league_id where user_league.league_id = 2;
--get all rounds played by league
select *
from round
where league_id = 2;
--loop through round_ids
--get user_id and score from results
--need to filter out users that are not in user_league
select user_round.user_id, user_round.score, users.username, users.first_name, users.last_name from user_round
join users on user_round.user_id = users.user_id
where round_id = ?;
--in this example only users 3 and 5 are in the selected league
update users set role = 'ADMIN' where username = 'admin';
update users set role = 'GOLFER' where username = 'user';
insert into league(league_name,score_type,course_id) values ('postgres ftw', 'why isnt this working', 25);
insert into user_round(round_id,user_id) values(5,5);
--get all rounds that do not have a score
select * from user_round where user_id = 5 and score is null;
--returns round_id's
--take round ID's from first call
--get course information about that round
--loop through and add round
select * from round where round.round_id = 5;
delete from user_round where user_id = 5 and score is null;
insert into round(course_id, tee_date) values (15,'2021-10-10') returning round_id;
select *
from user_round
join users on users.user_id = user_round.user_id
join round on user_round.round_id = round.round_id
where user_round.user_id = 12;
select * from users
where first_name is not null;
select * from user_round where score is null;
select distinct(course.course_name), *
from round
join user_round on round.round_id = user_round.round_id
join course on round.course_id = course.course_id
where tee_date > now() and user_round.user_id = 12;
delete from user_round where round_id = 16;
|
select `nation`, `o_year`, sum(`amount`) as `sum_profit`
from (select `n_name` as `nation`, extract(year from `o_orderdate`) as `o_year`, `l_extendedprice` * (1 - `l_discount`) - `ps_supplycost` * `l_quantity` as `amount`
from `nation`
where `s_suppkey` = `l_suppkey` and `ps_suppkey` = `l_suppkey` and `ps_partkey` = `l_partkey` and `p_partkey` = `l_partkey` and `o_orderkey` = `l_orderkey` and `s_nationkey` = `n_nationkey` and `p_name` like '%green%') as `profit`
group by `nation`, `o_year`
order by `nation`, `o_year` desc |
# patch_52_53_b.sql
#
# title: external_db type enum
#
# description:
# Add the enum value 'ENSEMBL' to the external_db.type column (primarily for eFG)
ALTER TABLE external_db MODIFY type ENUM('ARRAY', 'ALT_TRANS', 'MISC', 'LIT', 'PRIMARY_DB_SYNONYM', 'ENSEMBL');
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_52_53_b.sql|external_db_type_enum');
|
CREATE TABLE COMPLEX (
COMPLEXNAME CHAR(25) NOT NULL,
COMPLEXABOUT VARCHAR(2000),
PUBNAME VARCHAR(30),
PUBDATE VARCHAR(20),
AUTHOR VARCHAR(30),
PRIMARY KEY ( COMPLEXNAME ),
CONSTRAINT "Complex_Singleton" CHECK ( COMPLEXNAME IN 'The Smithsonian Institute' )
);
CREATE TABLE PROPERTY (
PRNAME VARCHAR(100) NOT NULL,
PRDESCRIPTION VARCHAR(1000),
PROPERTYTYPE VARCHAR(15),
VISITINFO VARCHAR(1000),
PRLINK VARCHAR(1000),
PRSTREET VARCHAR(15),
PRCITY VARCHAR(15),
PRSTATE VARCHAR(15),
HIGHLIGHTS VARCHAR(100),
PRMAP BFILE,
FLOORPLAN BFILE,
TRANSPORTATION VARCHAR(1000),
PARKING VARCHAR(100),
ESTABLISHMENTNAME VARCHAR(30),
CURRENTRESTRICTIONS VARCHAR(150),
ACCESSIBILITY VARCHAR(100),
COMPLEXNAME CHAR(25) NOT NULL,
PRIMARY KEY ( PRNAME ),
FOREIGN KEY ( COMPLEXNAME )
REFERENCES COMPLEX ( COMPLEXNAME ),
CONSTRAINT "Property_Complex_Singleton" CHECK ( COMPLEXNAME IN 'The Smithsonian Institute' ),
CONSTRAINT "Property_Type_Values" CHECK ( PROPERTYTYPE IN ( 'Cultural Center', 'Research Center', 'Zoo', 'Garden', 'Gallery',
'Museum' ) )
);
CREATE TABLE "COLLECTION OBJECT" (
OBJECTRECORDID INTEGER NOT NULL,
OBJECTNAME VARCHAR(30),
OBJECTTYPE VARCHAR(30),
OBJECTDESCRIPTION VARCHAR(1000),
OBJECTKEYWORDS VARCHAR(1000),
PRNAME VARCHAR(100) NOT NULL,
PRIMARY KEY ( OBJECTRECORDID ),
FOREIGN KEY ( PRNAME )
REFERENCES PROPERTY ( PRNAME ),
CONSTRAINT "Object_Type_Values" CHECK ( OBJECTTYPE IN ( 'cultural artifact', 'scientific artifact', 'historical artifact', 'animal',
'plant' ) )
);
CREATE TABLE PERSON (
FIRSTNAME VARCHAR(15) NOT NULL,
LASTNAME VARCHAR(30) NOT NULL,
PERSTREET VARCHAR(15) NOT NULL,
PERCITY VARCHAR(15),
PERSTATE VARCHAR(30),
PERPOSTALCODE CHAR(5),
EMAILADDRESS VARCHAR(50),
CREDITCARDNUMBER CHAR(16),
EXPIRATION VARCHAR(15),
SECCODE CHAR(3),
PRIMARY KEY ( FIRSTNAME,
LASTNAME,
PERSTREET )
);
CREATE TABLE VISIT (
FIRSTNAME VARCHAR(15) NOT NULL,
LASTNAME VARCHAR(30) NOT NULL,
PERSTREET VARCHAR(15) NOT NULL,
PRNAME VARCHAR(100) NOT NULL,
PRIMARY KEY ( FIRSTNAME,
LASTNAME,
PERSTREET,
PRNAME ),
FOREIGN KEY ( FIRSTNAME,
LASTNAME,
PERSTREET )
REFERENCES PERSON ( FIRSTNAME,
LASTNAME,
PERSTREET ),
FOREIGN KEY ( PRNAME )
REFERENCES PROPERTY ( PRNAME )
);
CREATE TABLE "MEMBER" (
MEMBERNUMBER INTEGER NOT NULL,
MEMBERLEVEL VARCHAR(30),
COMPLEXNAME CHAR(25) NOT NULL,
PRIMARY KEY ( MEMBERNUMBER ),
FOREIGN KEY ( COMPLEXNAME )
REFERENCES COMPLEX ( COMPLEXNAME ),
CONSTRAINT "Member_Complex_Singleton" CHECK ( COMPLEXNAME IN 'The Smithsonian Institute' )
);
CREATE TABLE DONATION (
MEMBERNUMBER INTEGER NOT NULL,
COMPLEXNAME CHAR(25) NOT NULL,
AMOUNTDONATED REAL,
PRIMARY KEY ( MEMBERNUMBER,
COMPLEXNAME ),
FOREIGN KEY ( MEMBERNUMBER )
REFERENCES "MEMBER" ( MEMBERNUMBER ),
FOREIGN KEY ( COMPLEXNAME )
REFERENCES COMPLEX ( COMPLEXNAME ),
CONSTRAINT "Donation_Complex_Singleton" CHECK ( COMPLEXNAME IN 'The Smithsonian Institute' )
);
CREATE TABLE EVENT (
EVNUMBER INTEGER NOT NULL,
EVNAME VARCHAR(20),
EVDATE VARCHAR(20),
LOCATION VARCHAR(30),
ADMISSIONCOST REAL,
COSPONSOR VARCHAR(20),
VENUE VARCHAR(30),
EVDETAILS VARCHAR(1000),
NOTE VARCHAR(150),
EVLINK VARCHAR(1000),
PRNAME VARCHAR(100) NOT NULL,
PRIMARY KEY ( EVNUMBER ),
FOREIGN KEY ( PRNAME )
REFERENCES PROPERTY ( PRNAME ),
CONSTRAINT "Event_Venue_Date" UNIQUE ( EVDATE,
VENUE )
);
CREATE TABLE EXHIBITION (
EXNUMBER INTEGER NOT NULL,
EXDESCRIPTION VARCHAR(1000),
EVNUMBER INTEGER NOT NULL,
PRIMARY KEY ( EXNUMBER ),
FOREIGN KEY ( EVNUMBER )
REFERENCES EVENT ( EVNUMBER )
);
CREATE TABLE DISPLAYS (
OBJECTRECORDID INTEGER NOT NULL,
EXNUMBER INTEGER NOT NULL,
PRIMARY KEY ( OBJECTRECORDID,
EXNUMBER ),
FOREIGN KEY ( OBJECTRECORDID )
REFERENCES "COLLECTION OBJECT" ( OBJECTRECORDID ),
FOREIGN KEY ( EXNUMBER )
REFERENCES EXHIBITION ( EXNUMBER )
);
CREATE TABLE "EDUCATION INITIATIVE" (
EDNAME VARCHAR(100) NOT NULL,
EDDESCRIPTION VARCHAR(1000),
PRNAME VARCHAR(100) NOT NULL,
PRIMARY KEY ( EDNAME ),
FOREIGN KEY ( PRNAME )
REFERENCES PROPERTY ( PRNAME )
); |
CREATE SCHEMA arduinoProject;
CREATE TABLE arduinoProject.environment(
id SERIAL PRIMARY KEY ,
description VARCHAR(64) NOT NULL
);
CREATE TABLE arduinoProject.users(
id SERIAL PRIMARY KEY,
usr_fullname VARCHAR(256) NOT NULL,
usr_contact VARCHAR(64) NOT NULL,
username VARCHAR(64) UNIQUE NOT NULL,
pswd VARCHAR(64) NOT NULL,
active BOOLEAN DEFAULT 't'
);
CREATE TABLE arduinoProject.physical_quantity(
id SERIAL PRIMARY KEY,
description VARCHAR(32) NOT NULL,
unity VARCHAR(32) NOT NULL
);
CREATE TABLE arduinoProject.measures(
id SERIAL PRIMARY KEY,
id_user INT,
id_environment INT,
id_pquantity INT,
read_value NUMERIC(5,2) NOT NULL CHECK (read_value > 0),
CONSTRAINT fk_user FOREIGN KEY (id_user) REFERENCES arduinoProject.users (id),
CONSTRAINT fk_envrmt FOREIGN KEY (id_environment) REFERENCES arduinoProject.environment (id),
CONSTRAINT fk_pqnty FOREIGN KEY (id_pquantity) REFERENCES arduinoProject.physical_quantity (id)
);
CREATE TABLE arduinoProject.history (
id SERIAL PRIMARY KEY,
id_msr INT,
record_date TIMESTAMP,
action TEXT,
CONSTRAINT fk_msr FOREIGN KEY (id_msr) REFERENCES arduinoProject.measures (id)
)
DROP TABLE arduinoproject.history;
DROP TABLE arduinoproject.measures;
DROP TABLE arduinoproject.physical_quantity;
DROP TABLE arduinoproject.teste ;
DROP TABLE arduinoproject.users;
DROP TABLE arduinoproject.environment ;
INSERT INTO arduinoproject.users(usr_fullname, usr_contact, username, pswd)
VALUES ('Thiago Pereira de Oliveira', 'thiago@ufu.br', 'thiagopo', 'admin'),
('Paulo Camargos Silva', 'paulo@ufu.br', 'paulocs','123456'),
('Pablo Nunes', 'pablo@ufu.br', 'pablon','senha'),
('Marcio Cunha', 'marcio@ufu.br', 'marioc', 'password123');
SELECT * FROM arduinoproject.measures;
SELECT * FROM arduinoproject.environment;
SELECT * FROM arduinoproject.physical_quantity;
SELECT read_value FROM arduinoproject.measures;
DELETE FROM arduinoproject.environment;
DELETE FROM arduinoproject.measures;
DELETE FROM arduinoproject.physical_quantity;
UPDATE arduinoproject.physical_quantity SET description='Humidity' WHERE id=2;
SELECT m.id AS id_measure, u.usr_fullname , m.read_value, p.unity, e.description
FROM arduinoproject.measures m
INNER JOIN arduinoproject.users u ON m.id_user = u.id
INNER JOIN arduinoproject.physical_quantity p ON m.id_pquantity = p.id
INNER JOIN arduinoproject.environment e ON m.id_environment = e.id
ORDER BY m.id ASC;
ALTER TABLE arduinoproject.measures
DROP CONSTRAINT measures_read_value_check;
ALTER TABLE arduinoproject.measures ADD CONSTRAINT
measures_read_value_check CHECK (read_value > -1);
|
SELECT * FROM db_general_1617.BOOK; |
DROP TABLE IF EXISTS publisher;
DROP TABLE IF EXISTS books;
DROP TABLE IF EXISTS subjects;
DROP TABLE IF EXISTS books_subjects;
CREATE TABLE publisher(
id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
name TEXT UNIQUE NOT NULL,
country TEXT NOT NULL
);
CREATE TABLE books(
id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
title TEXT,
publisher INTEGER,
FOREIGN KEY (publisher) REFERENCES publisher(id)
);
CREATE TABLE subjects(
id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
name TEXT NOT NULL
);
CREATE TABLE books_subjects(
book INTEGER,
subject INTEGER,
FOREIGN KEY (book) REFERENCES books(id),
FOREIGN KEY (subject) REFERENCES subjects(id)
);
|
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Machine: 127.0.0.1
-- Gegenereerd op: 19 jan 2016 om 13:41
-- Serverversie: 5.6.17
-- PHP-versie: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Databank: `hann_reservation`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `han_reservations`
--
CREATE TABLE IF NOT EXISTS `han_reservations` (
`res_id` int(11) NOT NULL AUTO_INCREMENT,
`res_name` varchar(255) NOT NULL,
`res_email` varchar(255) NOT NULL,
`res_phone` varchar(10) NOT NULL,
`res_date` varchar(10) NOT NULL,
`res_time` varchar(5) NOT NULL,
`res_persons` int(12) NOT NULL,
`res_children` int(11) NOT NULL,
`res_status` int(1) NOT NULL,
PRIMARY KEY (`res_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=180 ;
--
-- Gegevens worden geëxporteerd voor tabel `han_reservations`
--
INSERT INTO `han_reservations` (`res_id`, `res_name`, `res_email`, `res_phone`, `res_date`, `res_time`, `res_persons`, `res_children`, `res_status`) VALUES
(1, 'Damaris Roth', 'damaris@roth.nl', '0681155697', '2016-05-26', '18:30', 6, 0, 1),
(2, 'Ninah Bax', 'ninah@bax', '0612369874', '2016-08-24', '17:30', 2, 0, 0),
(142, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-16', '12:00', 3, 0, 1),
(143, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-16', '11:00', 1, 0, 0),
(144, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-23', '12:30', 1, 0, 0),
(158, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-30', '18:00', 1, 0, 2),
(159, 'Wesley', 'wesley@live.nl', '012346789', '2016-03-26', '12:00', 8, 3, 2),
(160, '84694', 'uiuig@iouipohyj.ml', '1654g88gy8', '2016-01-23', '17:00', 1, 0, 0),
(161, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-23', '12:00', 4, 0, 1),
(162, 'Lisan', 'lisan_floor@hotmail.com', '012345678', '2016-04-30', '13:30', 1, 0, 1),
(163, 'Wesley', 'wesley_metl@live.nl', '012369874', '2016-04-09', '12:30', 1, 0, 1),
(164, 'Dimmy', 'dimwes@hotmail.com', '0681155581', '2016-01-16', '13:30', 1, 0, 1),
(166, 'Karin Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-23', '12:00', 1, 0, 1),
(167, 'Dimmy', '0904540@hr.nl', '0162466290', '2016-01-30', '11:00', 4, 2, 0),
(168, 'Maurice', 'dimwes@casema.nl', '123654789', '2016-01-30', '15:30', 2, 0, 0),
(169, 'Bowie', 'dimwes@hotmail.com', '0681155581', '2016-02-13', '13:30', 1, 0, 2),
(170, 'Pann', 'dimwes@hotmail.com', '0681155581', '2016-02-13', '11:00', 1, 0, 2),
(171, 'Pann', 'dimwes@hotmail.com', '0681155581', '2016-02-13', '11:00', 1, 0, 0),
(172, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-04-09', '11:00', 1, 0, 2),
(173, 'Dimmy', 'dimwes@hotmail.com', '0681155581', '2016-02-20', '11:30', 2, 0, 2),
(174, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-02-20', '11:00', 1, 0, 2),
(175, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-02-20', '11:00', 1, 0, 2),
(176, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-02-06', '11:30', 2, 0, 2),
(177, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-02-06', '12:30', 3, 1, 2),
(178, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-02-06', '11:00', 1, 0, 1),
(179, 'Dimmy Marcelissen', 'dimwes@hotmail.com', '0681155581', '2016-01-30', '13:30', 2, 0, 1);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `han_users`
--
CREATE TABLE IF NOT EXISTS `han_users` (
`use_id` int(11) NOT NULL AUTO_INCREMENT,
`use_username` varchar(20) NOT NULL,
`use_password` mediumtext NOT NULL,
PRIMARY KEY (`use_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Gegevens worden geëxporteerd voor tabel `han_users`
--
INSERT INTO `han_users` (`use_id`, `use_username`, `use_password`) VALUES
(2, 'Dimmy', 'test1234'),
(3, 'trudy', 'hannebroeck12');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
create table geo_staging_buildings (
wkt text,
guid text
);
\copy geo_staging_buildings from program 'cmd /c "type C:\Development\LibrariesHacked\librarydata-db\data\os_buildings.csv"' csv header;
insert into geo_building(guid, geom)
select guid, ST_GeomFromText(wkt, 27700)
from geo_staging_buildings;
create unique index idx_geobuilding_id on geo_building (id);
cluster geo_building using idx_geobuilding_id;
create index idx_geobuilding_geom on geo_building using gist (geom);
-- Now, work out library buildings!
insert into geo_building_library(building_id, library_id)
select
distinct b.id, l.id
from geo_building b
join(
select
l.id,
case
when l.unique_property_reference_number is not null then st_setsrid(st_makepoint(u.x_coordinate, u.y_coordinate), 27700)
else st_setsrid(st_makepoint(p.easting, p.northing), 27700)
end as geom
from schemas_libraries l
left join geo_uprn u on u.uprn = l.unique_property_reference_number
left join geo_postcode_lookup p on p.postcode = l.postcode
) l on st_intersects(b.geom, l.geom);
drop table geo_staging_buildings;
|
ALTER TABLE "users" ADD COLUMN "upvotes_count" integer;
ALTER TABLE "markers" ADD COLUMN "upvotes_count" integer;
ALTER TABLE "locations" ADD COLUMN "markers_count" integer;
INSERT INTO schema_migrations (version) VALUES (20140927001312);
|
create database SistemaEscolas;
use SistemaEscolas;
create table alunos
(
aluno_id int primary key identity,
aluno_nome varchar(30) not null,
aluno_email varchar(30) not null,
aluno_telefone varchar(30) not null
);
select * from alunos;
create table professores
(
professor_id int primary key identity,
professor_email varchar(50) not null,
professor_senha varchar(50) not null,
professor_nome varchar(50) not null
);
select * from professores;
create table disciplinas
(
disciplina_id int primary key identity,
disciplina_nome varchar(50) not null,
disciplina_carga varchar(50) not null,
fk_professor_id int foreign key references professores(professor_id)
);
select * from disciplinas
create table matricula_alunos_disciplinas
(
fk_aluno_id int foreign key references alunos(aluno_id),
fk_disciplina_id int foreign key references disciplinas(disciplina_id),
matricula_id int primary key identity
);
select * from alunos;
select * from professores;
select * from disciplinas
select * from matricula_alunos_disciplinas;
insert into alunos(aluno_nome, aluno_email,aluno_telefone) values
('Drieli','drieli@gmail.com','3434-3434'),
('Niscolas','niscolas@gmail.com','1212-1212'),
('Dornellas','dornellas@gmail.com','4444-4444');
insert into professores(professor_email,professor_senha,professor_nome) values
('tsukamoto@gmai.com','5555','Tsukamoto'),
('daniel@gmail.com','4444','Daniel'),
('porchales@gmail.com','3333','Porchales');
insert into disciplinas(disciplina_nome,disciplina_carga,fk_professor_id) values
('matemática','40',1),
('química','40',2),
('biologia','40',3);
insert into matricula_alunos_disciplinas(fk_aluno_id,fk_disciplina_id) values
(1,3),
(2,4),
(3,1);
|
select `n_nationkey`
from `nation`
order by `n_nationkey` desc
fetch next 5 rows only |
CREATE TABLE public.comentario
(
id bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
ordem_servico_id bigint NOT NULL,
descricao text NOT NULL,
data_envio date NOT NULL,
PRIMARY KEY (id),
CONSTRAINT fk_comentario_ordem_servico FOREIGN KEY (ordem_servico_id)
REFERENCES public.ordem_servico (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
);
ALTER TABLE public.comentario
OWNER to postgres; |
@@autotask_sql_setup
select
window_name
, window_next_time at time zone sessiontimezone window_next_time
, window_active
, autotask_status
, optimizer_stats
, segment_advisor
, sql_tune_advisor
, health_monitor
from
dba_autotask_window_clients
order by window_next_time
/
|
UPDATE Spaceships
SET LightSpeedRate+=1
WHERE Id BETWEEN 8 AND 12 |
UPDATE Jobs
SET MechanicId=3,
[Status]='In Progress'
WHERE Status='Pending'
|
/*create sysadmin*/
use courier;
insert into user(fullname,username) values ("sysadmin","sysadmin");
delete from user_role where user_id = 1;
delete from user where id = 1;
update user set id = 1 where username="sysadmin"; |
v_tables(1) := 'CONTACTGROUPS';
v_tables(2) := 'CUSTOM_FIELDS_VAL';
v_tables(3) := 'CUSTOM_FIELDS_DATE_VAL';
v_tables(4) := 'CONTACTS';
v_tables(5) := 'MESSAGE_CONTACTS_BASE';
|
SELECT
row_to_json(item_data) item
FROM (
SELECT
release_group.gid as AlbumId,
release_group.name as AlbumTitle,
artist.gid as ArtistId,
COALESCE(
make_date(
release_group_meta.first_release_date_year,
release_group_meta.first_release_date_month,
release_group_meta.first_release_date_day
),
make_date(
COALESCE(release_group_meta.first_release_date_year, 1),
COALESCE(release_group_meta.first_release_date_month, 1),
COALESCE(release_group_meta.first_release_date_day, 1)
)
) as ReleaseDate
FROM release_group
LEFT JOIN release_group_meta ON release_group_meta.id = release_group.id
LEFT JOIN artist_credit_name ON artist_credit_name.artist_credit = release_group.artist_credit
LEFT JOIN artist ON artist_credit_name.artist = artist.id
JOIN release_group_series ON release_group.id = release_group_series.release_group
JOIN series ON release_group_series.series = series.id
WHERE artist_credit_name.position = 0
AND series.gid = $1
) item_data;
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 20, 2020 at 11:01 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `crud`
--
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
DROP TABLE IF EXISTS `category`;
CREATE TABLE IF NOT EXISTS `category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(100) NOT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`category_id`, `category_name`) VALUES
(1, 'Places'),
(2, 'Flower'),
(3, 'Other'),
(4, 'Animal'),
(5, 'Student'),
(6, 'Employee');
-- --------------------------------------------------------
--
-- Table structure for table `post`
--
DROP TABLE IF EXISTS `post`;
CREATE TABLE IF NOT EXISTS `post` (
`post_id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL,
`date` varchar(30) NOT NULL,
`time` varchar(25) NOT NULL,
`priority` varchar(20) NOT NULL,
`notification` tinyint(1) NOT NULL DEFAULT 0,
`category` int(11) NOT NULL,
`tags` text NOT NULL,
`post_img` varchar(100) DEFAULT NULL,
PRIMARY KEY (`post_id`),
UNIQUE KEY `post_id` (`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `post`
--
INSERT INTO `post` (`post_id`, `title`, `date`, `time`, `priority`, `notification`, `category`, `tags`, `post_img`) VALUES
(1, 'Flower', '2020-03-20', '18:56', 'High', 1, 2, 'Entertainment,Nature,Education', '1584701873-Hydrangeas.jpg'),
(3, 'Light House', '2020-03-20', '21:08', 'Medium', 1, 1, 'Nature,Education', '1584702024-Lighthouse.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tags`
--
DROP TABLE IF EXISTS `tags`;
CREATE TABLE IF NOT EXISTS `tags` (
`tag_id` int(11) NOT NULL AUTO_INCREMENT,
`tag_name` varchar(100) NOT NULL,
PRIMARY KEY (`tag_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tags`
--
INSERT INTO `tags` (`tag_id`, `tag_name`) VALUES
(1, 'Entertainment'),
(2, 'Nature'),
(3, 'Education'),
(4, 'Sports'),
(5, 'Technology');
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 */;
|
-- 06-08-2010 12:47:16 PM CST
-- IsCreatePlan default value=Y
UPDATE AD_Column SET DefaultValue='Y',Updated=TO_DATE('2010-06-08 12:47:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=53382
;
-- Jun 14, 2010 1:50:44 PM COT
-- FR3013401_IsCreatePlan default value=Y
ALTER TABLE PP_Product_Planning MODIFY IsCreatePlan CHAR(1) DEFAULT 'Y'
;
-- Jun 14, 2010 1:50:45 PM COT
-- FR3013401_IsCreatePlan default value=Y
UPDATE PP_Product_Planning SET IsCreatePlan='Y' WHERE IsCreatePlan IS NULL
;
|
-- Committers
SELECT COUNT(*) count
FROM (
SELECT author_name
FROM [puppet.puppet_commits]
GROUP BY author_name
)
|
SELECT
meal_name AS name
, fat
, carbohydrate AS carbs
, protein
, calories
, vitamin_a AS vitamina
, vitamin_c AS vitaminc
, vitamin_d AS vitamind
, vitamin_e AS vitamine
, vitamin_k AS vitamink
, thiamin
, riboflavin
, niacin
, vitamin_b6 AS vitaminb6
, biotin
, folate
, vitamin_b12 AS vitaminb12
, calcium
, copper
, fluoride
, iodine
, iron
, magnesium
, manganese
, phosphorus
, potassium
, selenium
, sodium
, zinc
FROM meals
WHERE totalmealstat_id = ${mealplanId}; |
CREATE TABLE IF NOT EXISTS REG_CLUSTER_LOCK (
REG_LOCK_NAME VARCHAR (20),
REG_LOCK_STATUS VARCHAR (20),
REG_LOCKED_TIME TIMESTAMP,
REG_TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (REG_LOCK_NAME)
);
CREATE TABLE IF NOT EXISTS REG_LOG (
REG_LOG_ID INTEGER AUTO_INCREMENT,
REG_PATH VARCHAR (2000),
REG_USER_ID VARCHAR (31) NOT NULL,
REG_LOGGED_TIME TIMESTAMP NOT NULL,
REG_ACTION INTEGER NOT NULL,
REG_ACTION_DATA VARCHAR (500),
REG_TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (REG_LOG_ID, REG_TENANT_ID)
);
CREATE INDEX IF NOT EXISTS REG_LOG_IND_BY_REG_LOGTIME ON REG_LOG(REG_LOGGED_TIME, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_PATH(
REG_PATH_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_PATH_VALUE VARCHAR(2000) NOT NULL,
REG_PATH_PARENT_ID INT,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_PATH PRIMARY KEY(REG_PATH_ID, REG_TENANT_ID)
);
CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_NAME ON REG_PATH(REG_PATH_VALUE, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_PATH_IND_BY_PARENT_ID ON REG_PATH(REG_PATH_PARENT_ID, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_CONTENT (
REG_CONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_CONTENT_DATA LONGBLOB,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_CONTENT PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_CONTENT_HISTORY (
REG_CONTENT_ID INTEGER NOT NULL,
REG_CONTENT_DATA LONGBLOB,
REG_DELETED SMALLINT,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_CONTENT_HISTORY PRIMARY KEY(REG_CONTENT_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_RESOURCE (
REG_PATH_ID INTEGER NOT NULL,
REG_NAME VARCHAR(256),
REG_VERSION INTEGER NOT NULL AUTO_INCREMENT,
REG_MEDIA_TYPE VARCHAR(500),
REG_CREATOR VARCHAR(31) NOT NULL,
REG_CREATED_TIME TIMESTAMP NOT NULL,
REG_LAST_UPDATOR VARCHAR(31),
REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL,
REG_DESCRIPTION VARCHAR(1000),
REG_CONTENT_ID INTEGER,
REG_TENANT_ID INTEGER DEFAULT 0,
REG_UUID VARCHAR(100) NOT NULL,
CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
);
ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT (REG_CONTENT_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_NAME ON REG_RESOURCE(REG_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_UUID ON REG_RESOURCE(REG_UUID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_TENANT ON REG_RESOURCE(REG_TENANT_ID, REG_UUID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_IND_BY_TYPE ON REG_RESOURCE(REG_TENANT_ID, REG_MEDIA_TYPE);
CREATE TABLE IF NOT EXISTS REG_RESOURCE_HISTORY (
REG_PATH_ID INTEGER NOT NULL,
REG_NAME VARCHAR(256),
REG_VERSION INTEGER NOT NULL,
REG_MEDIA_TYPE VARCHAR(500),
REG_CREATOR VARCHAR(31) NOT NULL,
REG_CREATED_TIME TIMESTAMP NOT NULL,
REG_LAST_UPDATOR VARCHAR(31),
REG_LAST_UPDATED_TIME TIMESTAMP NOT NULL,
REG_DESCRIPTION VARCHAR(1000),
REG_CONTENT_ID INTEGER,
REG_DELETED SMALLINT,
REG_TENANT_ID INTEGER DEFAULT 0,
REG_UUID VARCHAR(100) NOT NULL,
CONSTRAINT PK_REG_RESOURCE_HISTORY PRIMARY KEY(REG_VERSION, REG_TENANT_ID)
);
ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_PATHID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE_HISTORY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_HIST_FK_BY_CONTENT_ID FOREIGN KEY (REG_CONTENT_ID, REG_TENANT_ID) REFERENCES REG_CONTENT_HISTORY (REG_CONTENT_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_NAME ON REG_RESOURCE_HISTORY(REG_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_HISTORY_IND_BY_PATH_ID_NAME ON REG_RESOURCE(REG_PATH_ID, REG_NAME, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_COMMENT (
REG_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_COMMENT_TEXT VARCHAR(500) NOT NULL,
REG_USER_ID VARCHAR(31) NOT NULL,
REG_COMMENTED_TIME TIMESTAMP NOT NULL,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_COMMENT PRIMARY KEY(REG_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_RESOURCE_COMMENT (
REG_COMMENT_ID INTEGER NOT NULL,
REG_VERSION INTEGER,
REG_PATH_ID INTEGER,
REG_RESOURCE_NAME VARCHAR(256),
REG_TENANT_ID INTEGER DEFAULT 0
);
ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE_COMMENT ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_COMMENT_FK_BY_COMMENT_ID FOREIGN KEY (REG_COMMENT_ID, REG_TENANT_ID) REFERENCES REG_COMMENT (REG_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_COMMENT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_COMMENT_IND_BY_VERSION ON REG_RESOURCE_COMMENT(REG_VERSION, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_RATING (
REG_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_RATING INTEGER NOT NULL,
REG_USER_ID VARCHAR(31) NOT NULL,
REG_RATED_TIME TIMESTAMP NOT NULL,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_RATING PRIMARY KEY(REG_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_RESOURCE_RATING (
REG_RATING_ID INTEGER NOT NULL,
REG_VERSION INTEGER,
REG_PATH_ID INTEGER,
REG_RESOURCE_NAME VARCHAR(256),
REG_TENANT_ID INTEGER DEFAULT 0
);
ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE_RATING ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_RATING_FK_BY_RATING_ID FOREIGN KEY (REG_RATING_ID, REG_TENANT_ID) REFERENCES REG_RATING (REG_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_RATING(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_RATING_IND_BY_VERSION ON REG_RESOURCE_RATING(REG_VERSION, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_TAG (
REG_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_TAG_NAME VARCHAR(500) NOT NULL,
REG_USER_ID VARCHAR(31) NOT NULL,
REG_TAGGED_TIME TIMESTAMP NOT NULL,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_TAG PRIMARY KEY(REG_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_RESOURCE_TAG (
REG_TAG_ID INTEGER NOT NULL,
REG_VERSION INTEGER,
REG_PATH_ID INTEGER,
REG_RESOURCE_NAME VARCHAR(256),
REG_TENANT_ID INTEGER DEFAULT 0
);
ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE_TAG ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_TAG_FK_BY_TAG_ID FOREIGN KEY (REG_TAG_ID, REG_TENANT_ID) REFERENCES REG_TAG (REG_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_TAG(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_TAG_IND_BY_VERSION ON REG_RESOURCE_TAG(REG_VERSION, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_PROPERTY (
REG_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_NAME VARCHAR(100) NOT NULL,
REG_VALUE VARCHAR(1000),
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_PROPERTY PRIMARY KEY(REG_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_RESOURCE_PROPERTY (
REG_PROPERTY_ID INTEGER NOT NULL,
REG_VERSION INTEGER,
REG_PATH_ID INTEGER,
REG_RESOURCE_NAME VARCHAR(256),
REG_TENANT_ID INTEGER DEFAULT 0
);
ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
ALTER TABLE REG_RESOURCE_PROPERTY ADD CONSTRAINT IF NOT EXISTS REG_RESOURCE_PROPERTY_FK_BY_TAG_ID FOREIGN KEY (REG_PROPERTY_ID, REG_TENANT_ID) REFERENCES REG_PROPERTY (REG_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_RESOURCE_PROPERTY(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_RESOURCE_PROPERTY_IND_BY_VERSION ON REG_RESOURCE_PROPERTY(REG_VERSION, REG_TENANT_ID);
CREATE TABLE IF NOT EXISTS REG_ASSOCIATION (
REG_ASSOCIATION_ID INTEGER AUTO_INCREMENT,
REG_SOURCEPATH VARCHAR (2000) NOT NULL,
REG_TARGETPATH VARCHAR (2000) NOT NULL,
REG_ASSOCIATION_TYPE VARCHAR (2000) NOT NULL,
REG_TENANT_ID INTEGER DEFAULT 0,
PRIMARY KEY (REG_ASSOCIATION_ID, REG_TENANT_ID)
);
CREATE TABLE IF NOT EXISTS REG_SNAPSHOT (
REG_SNAPSHOT_ID INTEGER NOT NULL AUTO_INCREMENT,
REG_PATH_ID INTEGER NOT NULL,
REG_RESOURCE_NAME VARCHAR (256),
REG_RESOURCE_VIDS LONGBLOB NOT NULL,
REG_TENANT_ID INTEGER DEFAULT 0,
CONSTRAINT PK_REG_SNAPSHOT PRIMARY KEY(REG_SNAPSHOT_ID, REG_TENANT_ID)
);
ALTER TABLE REG_SNAPSHOT ADD CONSTRAINT IF NOT EXISTS REG_SNAPSHOT_FK_BY_PATH_ID FOREIGN KEY (REG_PATH_ID, REG_TENANT_ID) REFERENCES REG_PATH (REG_PATH_ID, REG_TENANT_ID);
CREATE INDEX IF NOT EXISTS REG_SNAPSHOT_IND_BY_PATH_ID_AND_RESOURCE_NAME ON REG_SNAPSHOT(REG_PATH_ID, REG_RESOURCE_NAME, REG_TENANT_ID);
|
-- ---
-- Globals
-- ---
-- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- SET FOREIGN_KEY_CHECKS=0;
-- ---
-- Table 'product'
-- 商品
-- ---
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` INTEGER NOT NULL AUTO_INCREMENT COMMENT '商品ID',
`name` VARCHAR(255) NOT NULL COMMENT '商品名称',
`pic_small` VARCHAR(255) NULL COMMENT '商品图片-小',
`pic_middle` VARCHAR(255) NULL DEFAULT NULL COMMENT '商品图片-中',
`pic_large` VARCHAR(255) NULL DEFAULT NULL COMMENT '商品图片-大',
`description` MEDIUMTEXT NULL DEFAULT NULL COMMENT '商品描述',
PRIMARY KEY (`id`)
);
-- ---
-- Foreign Keys
-- ---
-- ---
-- Table Properties
-- ---
-- ALTER TABLE `product` COLLATE=utf8_bin;
-- ---
-- Test Data
-- ---
INSERT INTO `product` (`id`,`name`,`pic_small`,`pic_middle`,`pic_large`,`description`) VALUES
('1','扫地机器人','pic_small','pic_middle','pic_large','description');
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
`permission_id` int NOT NULL AUTO_INCREMENT,
`name` varchar(30) NULL DEFAULT NULL,
`type` tinyint NULL DEFAULT 1 COMMENT '1=菜单;2=控制器; 3=操作',
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`code` varchar(100) NULL DEFAULT NULL,
PRIMARY KEY (`permission_id`)
);
-- ----------------------------
-- Records of permission
-- ----------------------------
INSERT INTO `permission` VALUES ('1', '管理后台', 1,null, null, 'menu:sm:desktop');
INSERT INTO `permission` VALUES ('2', '用户管理',1, null, null, 'menu:sm:user');
INSERT INTO `permission` VALUES ('3', '权限管理', 1,null, null, 'menu:sm:permission');
INSERT INTO `permission` VALUES ('4', '菜单管理', 1,null, null, 'menu:sm:menu');
INSERT INTO `permission` VALUES ('5', '角色管理', 1,null, null, 'menu:sm:role');
INSERT INTO `permission` VALUES ('6', '操作日志', 1,null, null, 'menu:sm:log');
-- ----------------------------
-- Table structure for `role`
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`role_id` int NOT NULL AUTO_INCREMENT,
`name` char(10) NULL DEFAULT NULL,
`code` varchar(30) NULL DEFAULT NULL,
`status` tinyint NULL DEFAULT NULL,
`create_time` datetime NULL DEFAULT NULL,
`update_time` datetime NULL DEFAULT NULL,
`remark` varchar(255) NULL DEFAULT NULL,
PRIMARY KEY (`role_id`)
);
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', 'admin', 'admin', '1', null, null, null);
INSERT INTO `role` VALUES ('2', 'guest', 'admin', '1', null, null, null);
-- ----------------------------
-- Table structure for `role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`role_id` int(11) DEFAULT NULL,
`permission_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
);
-- ----------------------------
-- Records of role_permission
-- ----------------------------
INSERT INTO `role_permission` VALUES ('1', '1', '1');
INSERT INTO `role_permission` VALUES ('2', '1', '2');
INSERT INTO `role_permission` VALUES ('3', '1', '3');
INSERT INTO `role_permission` VALUES ('4', '1', '4');
INSERT INTO `role_permission` VALUES ('5', '1', '5');
INSERT INTO `role_permission` VALUES ('6', '1', '6');
INSERT INTO `role_permission` VALUES ('7', '2', '1');
-- ----------------------------
-- Table structure for `sys_log`
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`log_id` int(11) NOT NULL AUTO_INCREMENT,
`level` tinyint(3) DEFAULT NULL,
`path` varchar(100) DEFAULT NULL,
`get` text,
`post` text,
`message` varchar(255) DEFAULT NULL,
`ip` varchar(100) DEFAULT NULL,
`user_agent` varchar(200) DEFAULT NULL,
`referer` varchar(100) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`username` varchar(100) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`log_id`)
);
-- ----------------------------
-- Records of sys_log
-- ----------------------------
-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` INTEGER NOT NULL AUTO_INCREMENT,
`username` VARCHAR(30) NULL DEFAULT NULL,
`password` VARCHAR(20) NULL DEFAULT NULL,
`real_name` VARCHAR(50) NULL DEFAULT NULL,
`mobile` VARCHAR(13) NULL DEFAULT NULL,
`phone` VARCHAR(13) NULL DEFAULT NULL,
`email` VARCHAR(50) NULL DEFAULT NULL,
`department` VARCHAR(50) NULL DEFAULT NULL,
`position` VARCHAR(50) NULL DEFAULT NULL,
`last_time` DATETIME NULL DEFAULT NULL,
`role_id` INTEGER NULL DEFAULT NULL,
`is_forbidden` INTEGER NULL DEFAULT NULL,
`status` TINYINT NOT NULL DEFAULT 1,
`create_time` DATETIME NULL DEFAULT NULL,
`update_time` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`user_id`)
);
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', 'admin', '管理员', null, null, null, null, null, null, '1', null, '1', null, null);
INSERT INTO `user` VALUES ('2', 'guest', 'guest', '访客', null, null, null, null, null, null, '2', null, '1', null, null);
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
`menu_id` int NOT NULL AUTO_INCREMENT,
`parent_id` int NULL DEFAULT NULL,
`name` varchar(32) NULL DEFAULT NULL,
`url` varchar(127) NULL DEFAULT NULL,
`icon` varchar(64) NULL DEFAULT NULL,
`sort` tinyint NULL DEFAULT 0,
`status` tinyint NULL DEFAULT 1,
`permission_id` int NULL DEFAULT NULL,
`permission_name` varchar(30) NULL DEFAULT NULL,
PRIMARY KEY (`menu_id`)
);
INSERT INTO `menu` VALUES ('1', '1', '管理后台', null, 'desktop', 1, 1, 1, null);
INSERT INTO `menu` VALUES ('2', '1', '用户管理', '/sm/user', 'user', 1, 1, 2, null);
INSERT INTO `menu` VALUES ('3', '1', '权限管理', '/sm/permission', 'key', 2, 1, 3, null);
INSERT INTO `menu` VALUES ('4', '1', '菜单管理', '/sm/menu', 'navicon', 3, 1, 4, null);
INSERT INTO `menu` VALUES ('5', '1', '角色管理', '/sm/role', 'hand-pointer-o', 4, 1, 5, null);
INSERT INTO `menu` VALUES ('6', '1', '操作日志', '/sm/log', 'search', 5, 1, 6, null); |
CREATE Procedure sp_Print_StockTransferInDetail (@DocSerial int)
As
Select "Item Code" = StockTransferInDetail.Product_Code,
"Item Name" = Items.ProductName, "Batch" = Batch_Number,
"PTS" = CASE Price_Option
WHEN 1 THEN
StockTransferInDetail.PTS
ELSE
Items.PTS
END,
"PTR" = CASE Price_Option
WHEN 1 THEN
StockTransferInDetail.PTR
ELSE
Items.PTR
END,
"ECP" = CASE Price_Option
WHEN 1 THEN
StockTransferInDetail.ECP
ELSE
Items.ECP
END,
"Special Price" = CASE Price_Option
WHEN 1 THEN
StockTransferInDetail.SpecialPrice
ELSE
Items.Company_Price
END,
"DocQty" = StockTransferInDetail.DocumentQuantity,
"DocFreeQty"=StockTransferInDetail.DocumentFreeQty,
"Received Qty" = StockTransferInDetail.QuantityReceived,
"Rejected Qty" = StockTransferInDetail.QuantityRejected,
"Rate" = StockTransferInDetail.Rate,
"Quantity" = StockTransferInDetail.Quantity,
"Amount" = StockTransferInDetail.Amount,
"Expiry" = StockTransferInDetail.Expiry,
"PKD" = StockTransferInDetail.PKD,
"Tax Suffered" = StockTransferInDetail.TaxSuffered,
"Tax Amount" = StockTransferInDetail.TaxAmount,
"Total Amount" = StockTransferInDetail.TotalAmount
From StockTransferInDetail, Items, ItemCategories
Where StockTransferInDetail.DocSerial = @DocSerial And
StockTransferInDetail.Product_Code = Items.Product_Code And
ItemCategories.CategoryID = Items.CategoryID
order by StockTransferInDetail.Product_Code
|
CREATE TABLE grade(
id SERIAL,
name VARCHAR,
PRIMARY KEY (id)
);
INSERT INTO grade(name)
VALUES ('NURSERY'),('L.K.G'),('U.K.G');
ALTER TABLE student
ADD COLUMN grade_id INTEGER; |
USE TelerikAcademy
SELECT COUNT(*) AS EmployeeInSales
FROM Employees e
JOIN Departments d
ON e.DepartmentID = d.DepartmentID
WHERE d.Name = 'Sales' |
--PROBLEM 18
--You are given a table Orders(Id, ProductName, OrderDate) filled with data.
--Consider that the payment for that order must be accomplished within 3 days after
--the order date. Also the delivery date is up to 1 month.
--Write a query to show each productís name, order date, pay and deliver due dates.
SELECT ProductName
,OrderDate
,DATEADD(DAY, 3, OrderDate) AS [Pay Due]
,DATEADD(MONTH, 1, OrderDate) AS [Deliver Due]
FROM Orders |
DROP DATABASE IF EXISTS register_db;
CREATE DATABASE register_db;
USE register_db;
CREATE TABLE Account(
user_name VARCHAR(255) NOT NULL,
user_password VARCHAR(255) NOT NULL,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
);
CREATE TABLE Student(
account_id INTEGER NOT NULL,
code VARCHAR(255) NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
FOREIGN KEY (account_id) REFERENCES Account(id),
UNIQUE(code)
);
CREATE TABLE Lecturer(
account_id INTEGER NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
FOREIGN KEY (account_id) REFERENCES Account(id)
);
CREATE TABLE Assistant(
account_id INTEGER NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id),
FOREIGN KEY (account_id) REFERENCES Account(id)
);
CREATE TABLE Semester(
from_time DATE NOT NULL,
to_time DATE NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
);
CREATE TABLE Module(
id INTEGER NOT NULL AUTO_INCREMENT,
code VARCHAR(20) UNIQUE NOT NULL,
name VARCHAR(100) NOT NULL,
semester_id INTEGER NOT NULL,
PRIMARY KEY (id),
UNIQUE (code, name, semester_id),
FOREIGN KEY (semester_id) REFERENCES Semester(id)
);
CREATE TABLE ModuleSession(
date_of_session DATE NOT NULL,
from_time TIME NOT NULL,
to_time TIME NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
module_id INTEGER NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (module_id ) REFERENCES Module(id)
);
CREATE TABLE Attendance(
student_id INTEGER NOT NULL,
session_id INTEGER NOT NULL,
PRIMARY KEY (student_id, session_id),
FOREIGN KEY (student_id) REFERENCES Student(id),
FOREIGN KEY (session_id ) REFERENCES ModuleSession(id)
);
/* ------------------ */
CREATE TABLE Exam(
date_of_exam DATE NOT NULL,
from_time TIME NOT NULL,
to_time TIME NOT NULL,
deadline DATE NOT NULL,
id INTEGER NOT NULL AUTO_INCREMENT,
module_id INTEGER NOT NULL,
FOREIGN KEY (module_id) REFERENCES Module(id),
PRIMARY KEY (id)
);
CREATE TABLE ModuleList(
student_id INTEGER NOT NULL,
module_id INTEGER NOT NULL,
PRIMARY KEY (student_id, module_id),
FOREIGN KEY (student_id) REFERENCES Student(id),
FOREIGN KEY (module_id) REFERENCES Module(id)
);
CREATE TABLE RegisterList(
student_id INTEGER NOT NULL,
exam_id INTEGER NOT NULL,
PRIMARY KEY (student_id, exam_id),
FOREIGN KEY (student_id) REFERENCES Student(id),
FOREIGN KEY (exam_id ) REFERENCES Exam(id)
);
CREATE TABLE LecturerModule(
lecturer_id INTEGER NOT NULL,
module_id INTEGER NOT NULL,
PRIMARY KEY (lecturer_id, module_id),
FOREIGN KEY (lecturer_id ) REFERENCES Lecturer(id),
FOREIGN KEY (module_id ) REFERENCES Module(id)
);
INSERT INTO Account (user_name, user_password, first_name, last_name)
VALUES
("Wallace", 6945, "Mooney", "Halee"),
("Darrel", 6104, "Burris", "Ferris"),
("Kathleen", 9660, "Mcpherson", "Maile"),
("Riley", 8480, "Heath", "Rhiannon"),
("Lars", 5689, "Bruce", "Susan"),
("Zeph", 7516, "Martinez", "Rose"),
("Price", 5747, "Vance", "Philip"),
("Uta", 8746, "Salazar", "Allistair"),
("Maryam", 6528, "Tyson", "May"),
("Jack", 9948, "Navarro", "Joan"),
("Mya", 948, "Navro", "Jon"),
("Mam", 9588, "Tyn", "My");
INSERT INTO Student (account_id, code)
VALUES
(1, "fHUT4L"),
(3, "7b2bpk"),
(5, "krWMjW"),
(7, "N4kwrb"),
(9, "rQqGW6"),
(11, "rasdf6");
INSERT INTO Lecturer(account_id)
VALUES
(2),
(6),
(12);
INSERT INTO Assistant(account_id)
VALUES
(4),
(6);
INSERT INTO Semester(from_time, to_time)
VALUES
('2012-09-01', '2013-01-31'),
('2013-03-01', '2013-07-31'),
('2013-09-01', '2014-01-31'),
('2014-03-01', '2014-07-31'),
('2014-09-01', '2015-01-31'),
('2015-03-01', '2015-07-31'),
('2015-09-01', '2016-01-31'),
('2016-03-01', '2016-07-31');
INSERT INTO Module(code, name, semester_id)
VALUES
("Pro12", "Programming", 1),
("Sta12", "Statistics", 2),
("Pro13", "Programming", 3),
("Sta13", "Statistics", 4),
("Pro14", "Programming", 5),
("Sta14", "Statistics", 6),
("Pro15", "Programming", 7),
("Sta15", "Statistics", 8);
INSERT INTO ModuleSession(date_of_session, from_time, to_time, module_id)
VALUES
('2012-09-01', '08:45:00', '12:00:00', 1),
('2012-09-01', '13:00:00', '16:15:00', 1),
('2012-11-01', '08:45:00', '12:00:00', 1),
('2012-11-01', '13:00:00', '16:15:00', 1),
('2013-01-01', '08:45:00', '12:00:00', 1),
('2013-01-01', '13:00:00', '16:15:00', 1),
('2015-03-01', '08:45:00', '12:00:00', 2),
('2015-03-01', '13:00:00', '16:15:00', 2),
('2015-05-01', '08:45:00', '12:00:00', 2),
('2015-05-01', '13:00:00', '16:15:00', 2),
('2015-07-01', '08:45:00', '12:00:00', 2),
('2015-07-01', '13:00:00', '16:15:00', 2),
('2012-06-01', '11:59:00', '12:01:00', 2);
INSERT INTO Attendance(student_id, session_id)
VALUES
(1, 1), (1, 2), (1, 3), (1, 4), (1, 7), (1, 8), (1, 10), (1, 12),
(2, 1), (2, 3), (2, 5), (2, 7), (2, 9), (2, 11),
(3, 2), (3, 4), (3, 6), (3, 8), (3, 10), (3, 12),
(4, 2), (4, 4), (4, 5), (4, 8), (4, 9), (4, 11),
(5, 1), (5, 5), (5, 6), (5, 8), (5, 10), (5, 13);
INSERT INTO Exam(date_of_exam, from_time, to_time, deadline, module_id)
VALUES
('2013-02-01', '08:45:00', '12:00:00', '2013-01-20', 1),
('2014-02-01', '08:45:00', '12:00:00', '2014-01-20', 2),
('2015-02-01', '08:45:00', '12:00:00', '2015-01-20', 3),
('2016-02-01', '08:45:00', '12:00:00', '2016-01-20', 4);
INSERT INTO ModuleList(student_id, module_id)
VALUES
(1, 1), (1, 2),
(2, 1), (2, 2),
(3, 1), (3, 2),
(4, 1), (4, 2),
(5, 1), (5, 2);
INSERT INTO RegisterList(student_id, exam_id)
VALUES
(1, 1), (1, 2),
(2, 1),
(3, 1),
(4, 2),
(5, 2);
INSERT INTO LecturerModule(lecturer_id, module_id)
VALUES
(1, 1), (1, 3), (1, 5), (1, 7),
(2, 2), (2, 4), (2, 6), (2, 8);
DELIMITER $$
-- Change delimiter back to default
DELIMITER ;
/*
CALL UpdateModule(1, '123abc', 'test');
CALL GetModules();
INSERT INTO Module(code, name, semester_id)
VALUES ("Pro", "Programming", 1);
CALL DeleteModule(9);
CALL GetLectureModule(1);
CALL GetAttendanceListBySessionId(1);
CALL GetRegisterByExamId(1);
CALL FindStudentAccount('abc', '$#!#@');
CALL FindLecturerAccount('edf', 'D#RS%');
CALL FindAssistantAccount('ghi', 'AAAAA');
CALL GetEnrollmentListByStudent(1);
CALL UpdateExam(1, '2016-01-01', '08:45:00', '12:00:00');
INSERT
INTO Exam(date_of_exam, from_time, to_time, deadline, module_id)
VALUES ('2013-02-01', '08:45:00', '12:00:00', '2013-01-20', 1);
CALL DeleteExam(5);
CALL GetExams();
CALL GetAllRegister();
CALL DeleteModuleOfStudent(1, 1);
CALL GetModuleList();
CALL UpdateStudentCode(1, 'AAA');
CALL DeleteStudent(6);
CALL DeleteLecturer(3);
CALL GetStudentList();
CALL GetLecturerList();
CALL GetModuleById(1);
CALL CreateRegister(2, 2);
CALL DeleteRegister(2, 2);
CALL CreateAttendance(3, 1);
CALL DeleteAttendance(3, 1);
CALL GetExamBySemesterId(1);
CALL GetModulesByStudentId(1);
CALL GetOverlapModule();
CALL GetRegisterByStudentId(1);*/ |
SELECT 'Connect OK.' status FROM DUAL;
|
-- ABS:絶対値
SELECT
m,
ABS(m) AS abs_col
FROM
sampleMath
;
-- MOD:余剰
-- 使えるのは整数型の列のみ
SELECT
n,
p,
MOD(n, p) AS mod_col
FROM
sampleMath
;
-- ROUND:四捨五入
-- ROUND(対象数, 丸め桁数)
SELECT
m,
n,
ROUND(m, n) AS round_col
FROM
sampleMath
; |
2018-10-17 12:00:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.570ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
6.090ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
656.170ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.740ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.560ms
2018-10-17 12:01:12
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
10.010ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.490ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
536.290ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.760ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
8.500ms
2018-10-17 12:02:12
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.370ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.340ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
369.930ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
16.570ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.900ms
2018-10-17 12:03:12
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.280ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.730ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
517.380ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.780ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.610ms
2018-10-17 12:04:12
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
5.010ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
8.670ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
410.400ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
8.080ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.610ms
2018-10-17 12:05:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
5.030ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.890ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
555.510ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.590ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.650ms
2018-10-17 12:06:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.730ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.080ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
489.770ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.900ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.660ms
2018-10-17 12:07:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.290ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.740ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
566.500ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.860ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.450ms
2018-10-17 12:08:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.500ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.290ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
743.900ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.850ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.480ms
2018-10-17 12:09:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
7.930ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.800ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
523.950ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.870ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.440ms
2018-10-17 12:10:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.110ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.750ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
439.530ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.570ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.530ms
2018-10-17 12:11:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
5.050ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.170ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
585.900ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.580ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.530ms
2018-10-17 12:12:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.530ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.220ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
301.490ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.870ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.500ms
2018-10-17 12:13:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.300ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.850ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
800.270ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.570ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.440ms
2018-10-17 12:14:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
9.470ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.190ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
664.390ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.820ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.070ms
2018-10-17 12:15:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.190ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.860ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
610.090ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.670ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.740ms
2018-10-17 12:16:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.090ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.590ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
679.320ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
15.460ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
46.480ms
2018-10-17 12:17:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
8.670ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
4.590ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
403.720ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.780ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.470ms
2018-10-17 12:18:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.360ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.200ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
420.130ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.820ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.810ms
2018-10-17 12:19:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.340ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.850ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
460.120ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.700ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.310ms
2018-10-17 12:20:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.300ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
8.330ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
437.490ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.080ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.060ms
2018-10-17 12:21:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.480ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.290ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
533.300ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
4.640ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.560ms
2018-10-17 12:22:13
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.070ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.820ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
541.840ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.630ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.550ms
2018-10-17 12:23:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.300ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
4.910ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
658.520ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.060ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.570ms
2018-10-17 12:24:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.050ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.330ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
661.980ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.830ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.410ms
2018-10-17 12:25:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.530ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.970ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
849.590ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.750ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.760ms
2018-10-17 12:26:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.400ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
9.140ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
554.900ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.990ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.570ms
2018-10-17 12:27:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
6.890ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.340ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
555.640ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.640ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.620ms
2018-10-17 12:28:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.220ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.930ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
440.010ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.020ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.060ms
2018-10-17 12:29:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.990ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.590ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
606.880ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.110ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.350ms
2018-10-17 12:30:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.680ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.990ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
644.000ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.740ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.890ms
2018-10-17 12:31:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
10.710ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.530ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
485.870ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.620ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.490ms
2018-10-17 12:32:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.970ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.560ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
738.710ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.330ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
4.320ms
2018-10-17 12:33:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
10.820ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.830ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
572.350ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
22.010ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.890ms
2018-10-17 12:34:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.740ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
4.150ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
350.810ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.910ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.620ms
2018-10-17 12:35:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.850ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
5.070ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
492.370ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.870ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.390ms
2018-10-17 12:36:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
60.340ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.550ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
362.750ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
5.910ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
112.690ms
2018-10-17 12:37:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.030ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.560ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
342.140ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.670ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.870ms
2018-10-17 12:38:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.030ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.820ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
470.940ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.920ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.620ms
2018-10-17 12:39:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.190ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.840ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
721.510ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.310ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.750ms
2018-10-17 12:40:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.010ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
11.130ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
503.330ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.540ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.530ms
2018-10-17 12:41:14
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.040ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.940ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
341.820ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.910ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.370ms
2018-10-17 12:42:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
9.060ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.060ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
723.900ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.210ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.500ms
2018-10-17 12:43:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.870ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.180ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
595.010ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.200ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.580ms
2018-10-17 12:44:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.980ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.960ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
482.040ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.350ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.730ms
2018-10-17 12:45:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
2.390ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.970ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
481.190ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.880ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.670ms
2018-10-17 12:46:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.750ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.420ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
676.660ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.770ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.270ms
2018-10-17 12:47:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.500ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
4.730ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
729.050ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.000ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.260ms
2018-10-17 12:48:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.140ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
1.720ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
519.500ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.640ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.700ms
2018-10-17 12:49:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.200ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.210ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
581.440ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
5.050ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
5.910ms
2018-10-17 12:50:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.610ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.810ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
590.750ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.910ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.610ms
2018-10-17 12:51:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.490ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.140ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
637.250ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.000ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.580ms
2018-10-17 12:52:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
9.910ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.120ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
655.720ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
7.120ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.190ms
2018-10-17 12:53:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
4.820ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
7.490ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
685.790ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.750ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.960ms
2018-10-17 12:54:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.280ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
6.130ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
751.310ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
4.460ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.480ms
2018-10-17 12:55:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.620ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.050ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
578.130ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
4.960ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
4.650ms
2018-10-17 12:56:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.190ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.080ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
623.540ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
4.170ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.550ms
2018-10-17 12:57:16
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.360ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.660ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
926.270ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
8.610ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
10.940ms
2018-10-17 12:58:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.570ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
2.110ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
308.050ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
2.780ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
3.080ms
2018-10-17 12:59:15
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.300ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
4.990ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and `begin_time` > 1540310400 group by `lottery_id`
699.390ms
select `id`, `name` from `lotteries` where (`status` = 3) order by `id` asc
3.910ms
select * from `admin_users` where `admin_users`.`id` = 6 limit 1
2.670ms
|
-- phpMyAdmin SQL Dump
-- version 4.4.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 12, 2015 at 10:18 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `DBC`
--
-- --------------------------------------------------------
--
-- Table structure for table `balance`
--
CREATE TABLE IF NOT EXISTS `balance` (
`balance_id` int(5) NOT NULL,
`date` datetime NOT NULL,
`week` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
`expenses_amount` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`donation_amount` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`balance` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `balance`
--
INSERT INTO `balance` (`balance_id`, `date`, `week`, `expenses_amount`, `donation_amount`, `balance`) VALUES
(23, '2014-12-23 09:12:27', '522014', '1744', '2500', '756'),
(24, '2015-01-03 09:12:27', '12015', '744', '3920', '3932'),
(25, '2015-01-10 09:12:27', '22015', '843', '2767', '5856'),
(26, '2015-01-17 09:12:27', '32015', '745', '1620', '6731'),
(27, '2015-01-24 09:12:27', '42015', '1104', '1930', '7557'),
(28, '2015-01-31 19:12:27', '52015', '1430', '2570', '8697'),
(29, '2015-02-07 19:12:27', '62015', '1200', '2305', '9802'),
(30, '2015-02-14 19:12:27', '72015', '1876', '3570', '11496'),
(31, '2015-02-21 19:12:27', '82015', '3501', '4600', '12595'),
(32, '2015-02-28 19:12:27', '92015', '1620', '2700', '13675'),
(34, '2015-03-07 19:12:27', '102015', '6988', '6570', '13257'),
(35, '2015-03-14 19:12:27', '112015', '1670', '4522', '16109'),
(36, '2015-03-21 19:12:27', '122015', '1502', '3470', '18077'),
(37, '2015-03-28 19:12:27', '132015', '2381', '3620', '19316'),
(38, '2015-04-04 19:12:27', '142015', '1820', '4500', '21996'),
(39, '2015-04-11 19:12:27', '152015', '2754', '6330', '25572'),
(40, '2015-04-18 19:12:27', '162015', '3510', '4290', '26352'),
(41, '2015-04-25 19:12:27', '172015', '2641', '2622', '26333'),
(42, '2015-05-02 19:12:27', '182015', '1222', '3065', '28176'),
(43, '2015-05-09 19:12:27', '192015', '6047', '1621', '23750'),
(44, '2015-05-16 19:12:27', '202015', '4363', '15900', '35287'),
(45, '2015-05-23 19:12:27', '212015', '15510', '3932', '23709'),
(46, '2015-05-30 19:12:27', '222015', '820', '7290', '30179'),
(47, '2015-06-06 19:12:27', '232015', '4830', '7300', '32649'),
(48, '2015-06-13 19:12:27', '242015', '2600', '4600', '34649'),
(49, '2015-06-20 19:12:27', '252015', '4231', '17782', '48200'),
(50, '2015-06-27 19:12:27', '262015', '4568', '5924', '49556'),
(51, '2015-07-04 19:12:27', '272015', '15640', '3162', '37078'),
(52, '2015-07-11 19:12:27', '282015', '2975', '19410', '53513'),
(53, '2015-07-18 19:12:27', '292015', '4181', '7040', '56372'),
(54, '2015-07-25 19:12:27', '302015', '3651.33', '8340', '61060.67'),
(55, '2015-07-31 19:12:27', '312015', '1800', '6361', '65621.67'),
(56, '2015-07-31 19:12:27', '322015', '1700', '1003000', '1066921.67'),
(57, '2015-08-23 14:14:49', '342015', '9422', '6590', '1064089.67'),
(58, '2015-07-31 19:12:27', '332015', '', '', '1066921.67'),
(59, '2015-08-26 10:58:12', '352015', '3442', '3234', '1063881.67');
-- --------------------------------------------------------
--
-- Table structure for table `course`
--
CREATE TABLE IF NOT EXISTS `course` (
`course_id` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`course_name` text COLLATE utf8_unicode_ci NOT NULL,
`course_unit` tinyint(2) NOT NULL,
`course_hour` tinyint(2) NOT NULL,
`course_duration` tinyint(2) NOT NULL,
`course_score` int(3) NOT NULL,
`course_note` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `course`
--
INSERT INTO `course` (`course_id`, `course_name`, `course_unit`, `course_hour`, `course_duration`, `course_score`, `course_note`) VALUES
('CH1', 'รากฐานชีวิตคริสเตียน', 8, 8, 8, 33, ''),
('CH2', 'รากฐานชีวิตคริสเตียน 2', 8, 16, 8, 33, ''),
('CH3', 'รากฐานชีวิตคริสเตียน 3', 8, 16, 8, 33, ''),
('CL1', 'ชีวิตคริสเตียน', 8, 16, 8, 33, ''),
('CL2', 'ชีวิตคริสเตียน 2', 8, 16, 8, 33, ''),
('CL3', 'ชีวิตคริสเตียน 3', 8, 16, 8, 33, ''),
('CL4', 'ชีวิตคริสเตียน 4', 8, 16, 8, 33, ''),
('HP1', 'โรงเรียนแห่งความสุข', 8, 8, 8, 33, ''),
('HP2', 'โรงเรียนแห่งความสุข 2', 8, 8, 8, 33, ''),
('TT1', 'ปัญหาชีวิต', 5, 10, 5, 33, ''),
('VI1', 'วิสัยทัศน์ คริสเตียน', 8, 8, 8, 33, ''),
('VI2', 'วิสัยทัศน์ คริสเตียน 2', 8, 8, 8, 33, ''),
('VI3', 'วิสัยทัศน์ คริสเตียน 3', 8, 8, 8, 33, '');
-- --------------------------------------------------------
--
-- Table structure for table `coursedetail`
--
CREATE TABLE IF NOT EXISTS `coursedetail` (
`course_detail_id` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
`course_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`trainer_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`registered` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `coursedetail`
--
INSERT INTO `coursedetail` (`course_detail_id`, `course_id`, `trainer_id`, `start_date`, `end_date`, `registered`) VALUES
('CH10615', 'CH1', 'NAP', '2015-06-06', '2015-08-08', '0000-00-00'),
('CH10815', 'CH1', 'DOI', '2015-08-08', '2015-09-12', '0000-00-00'),
('CH20815', 'CH2', 'KAW', '2015-08-08', '2015-09-12', '0000-00-00'),
('CH30815', 'CH3', 'KIT', '2015-08-08', '2015-09-12', '0000-00-00'),
('CL10815', 'CL1', 'LSD', '2015-08-08', '2015-09-12', '0000-00-00'),
('CL20615', 'CL2', 'PSU', '2015-06-01', '2015-08-01', '0000-00-00'),
('CL20815', 'CL2', 'NAP', '2015-08-08', '2015-09-12', '0000-00-00'),
('HP11015', 'HP1', 'PSU', '2015-10-14', '2015-11-24', '0000-00-00'),
('HP20815', 'HP2', 'NAP', '2015-08-01', '2015-08-27', '0000-00-00'),
('HP20915', 'HP2', 'SUN', '2015-09-16', '2015-11-18', '0000-00-00'),
('TT10315', 'TT1', 'WIE', '2015-03-01', '2015-10-26', '0000-00-00'),
('TT10615', 'TT1', 'PR1', '2015-06-02', '2015-08-01', '0000-00-00'),
('TT10815', 'TT1', 'PR1', '2015-08-06', '2015-09-17', '0000-00-00'),
('VI10815', 'VI1', 'PAL', '2015-08-01', '2015-08-27', '0000-00-00'),
('VI20715', 'VI2', 'TAI', '2015-07-23', '2015-09-16', '0000-00-00'),
('VI31015', 'VI3', 'WIE', '2015-10-21', '2015-12-16', '0000-00-00');
-- --------------------------------------------------------
--
-- Table structure for table `courseregis`
--
CREATE TABLE IF NOT EXISTS `courseregis` (
`regis_id` int(5) NOT NULL,
`course_detail_id` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
`trainer_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`member_idcard` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`course_regisdate` datetime NOT NULL,
`regis_note` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `courseregis`
--
INSERT INTO `courseregis` (`regis_id`, `course_detail_id`, `trainer_id`, `member_idcard`, `course_regisdate`, `regis_note`) VALUES
(2, 'CH10815', 'DOI', '1101401789932', '2015-07-22 12:24:05', ''),
(3, 'CH10815', 'DOI', '1509900986474', '2015-07-22 12:24:08', ''),
(4, 'CH10815', 'DOI', '1559393974183', '2015-07-22 12:24:11', ''),
(5, 'CH10815', 'DOI', '1559333934119', '2015-07-22 12:24:14', ''),
(6, 'CH10815', 'DOI', '1509900980474', '2015-07-22 12:24:18', ''),
(7, 'CH10815', 'DOI', '1559393970989', '2015-07-22 12:24:29', ''),
(8, 'CH10815', 'DOI', '1559393734596', '2015-07-22 12:24:34', ''),
(9, 'CH10815', 'DOI', '1550093974134', '2015-07-22 12:24:39', ''),
(10, 'CH10815', 'DOI', '1559393734185', '2015-07-22 12:24:43', ''),
(11, 'CH20815', 'KAW', '1509900986474', '2015-07-22 12:25:12', ''),
(12, 'CH20815', 'KAW', '1509900980474', '2015-07-22 12:25:16', ''),
(13, 'CH20815', 'KAW', '1559393974183', '2015-07-22 12:25:19', ''),
(14, 'CH20815', 'KAW', '1559333934119', '2015-07-22 12:25:22', ''),
(15, 'CH20815', 'KAW', '1550093974134', '2015-07-22 12:25:27', ''),
(16, 'CH20815', 'KAW', '1559333934189', '2015-07-22 12:25:31', ''),
(17, 'CH20815', 'KAW', '1559396274189', '2015-07-22 12:25:35', ''),
(18, 'CH20815', 'KAW', '1559093934189', '2015-07-22 12:25:41', ''),
(19, 'CH10615', 'NAP', '1509900986474', '2015-07-22 12:47:02', ''),
(20, 'CH10615', 'NAP', '1559393974183', '2015-07-22 12:47:06', ''),
(21, 'CH10615', 'NAP', '1559390074189', '2015-07-22 12:47:11', ''),
(22, 'CH10615', 'NAP', '1559393734185', '2015-07-22 12:47:19', ''),
(23, 'CH10615', 'NAP', '1533939759403', '2015-07-22 12:47:24', ''),
(24, 'CH10615', 'NAP', '1559333934189', '2015-07-22 12:47:30', ''),
(25, 'CH10615', 'NAP', '1559390074471', '2015-07-22 12:47:42', ''),
(26, 'CH10615', 'NAP', '1559393943343', '2015-07-22 12:47:50', ''),
(27, 'CL20615', 'PSU', '1101401789932', '2015-07-22 12:49:17', ''),
(28, 'CL20615', 'PSU', '1559883974329', '2015-07-22 12:49:21', ''),
(29, 'CL20615', 'PSU', '1533939759403', '2015-07-22 12:49:25', ''),
(30, 'CL20615', 'PSU', '1559333934119', '2015-07-22 12:49:31', ''),
(31, 'CL20615', 'PSU', '1559390074471', '2015-07-22 12:49:35', ''),
(32, 'CL20615', 'PSU', '1559396274189', '2015-07-22 12:49:46', ''),
(33, 'CL20615', 'PSU', '1559393934231', '2015-07-22 12:49:50', ''),
(34, 'CL20615', 'PSU', '1559393943343', '2015-07-22 12:49:57', ''),
(35, 'CL20615', 'PSU', '1559392273343', '2015-07-22 12:50:05', ''),
(36, 'CH10815', 'DOI', '1559883974329', '2015-07-24 05:49:00', ''),
(37, 'TT10815', 'PR1', '1550093974134', '2015-08-05 04:00:23', ''),
(38, 'TT10815', 'PR1', '1509900986474', '2015-08-05 04:01:50', ''),
(39, 'TT10815', 'PR1', '1509900980474', '2015-08-05 04:01:59', ''),
(51, 'CH10815', 'DOI', '1559393934231', '2015-08-17 10:35:30', ''),
(52, 'TT10815', 'PR1', '1101401789932', '2015-08-17 10:36:11', ''),
(53, 'TT10815', 'PR1', '1559883974329', '2015-08-17 10:36:14', ''),
(54, 'TT10815', 'PR1', '1559333934119', '2015-08-17 10:36:17', ''),
(55, 'CL20815', 'NAP', '1101401789932', '2015-08-20 10:52:18', ''),
(56, 'HP11015', 'PSU', '1310500117093', '2015-08-20 10:54:58', ''),
(57, 'HP11015', 'PSU', '1101401789932', '2015-08-20 10:55:00', ''),
(58, 'HP11015', 'PSU', '1509900986474', '2015-08-20 10:55:03', '');
-- --------------------------------------------------------
--
-- Table structure for table `donation`
--
CREATE TABLE IF NOT EXISTS `donation` (
`donation_id` int(6) NOT NULL,
`donation_week` int(6) NOT NULL,
`donation_date` datetime NOT NULL,
`dtype_id` tinyint(2) NOT NULL,
`donation_amount` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`donation_note` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `donation`
--
INSERT INTO `donation` (`donation_id`, `donation_week`, `donation_date`, `dtype_id`, `donation_amount`, `donation_note`) VALUES
(21, 522014, '2014-12-25 13:11:13', 1, '1300', ''),
(22, 522014, '2014-12-25 13:11:13', 2, '300', ''),
(23, 522014, '2014-12-25 13:11:13', 4, '800', ''),
(24, 522014, '2014-12-25 13:11:13', 3, '100', ''),
(25, 12015, '2015-01-03 09:12:27', 1, '3150', ''),
(26, 12015, '2015-01-03 09:12:27', 2, '570', ''),
(27, 12015, '2015-01-03 09:12:27', 3, '200', ''),
(28, 22015, '2015-01-10 09:12:27', 1, '1807', ''),
(29, 22015, '2015-01-10 09:12:27', 2, '560', ''),
(30, 22015, '2015-01-10 09:12:27', 4, '100', ''),
(31, 22015, '2015-01-10 09:12:27', 3, '300', ''),
(32, 32015, '2015-01-17 09:12:27', 1, '1200', ''),
(33, 32015, '2015-01-17 09:12:27', 2, '120', ''),
(34, 32015, '2015-01-17 09:12:27', 3, '300', ''),
(35, 42015, '2015-01-24 09:12:27', 1, '1430', ''),
(36, 42015, '2015-01-24 09:12:27', 2, '500', ''),
(37, 52015, '2015-01-31 19:12:27', 2, '160', ''),
(38, 52015, '2015-01-31 19:12:27', 4, '500', ''),
(39, 52015, '2015-01-31 19:12:27', 1, '1910', ''),
(40, 72015, '2015-02-14 19:12:27', 1, '3000', ''),
(41, 72015, '2015-02-14 19:12:27', 2, '570', ''),
(42, 82015, '2015-02-21 19:12:27', 1, '2400', ''),
(43, 82015, '2015-02-21 19:12:27', 2, '1200', ''),
(44, 82015, '2015-02-21 19:12:27', 4, '1000', ''),
(45, 62015, '2015-02-07 19:12:27', 2, '405', ''),
(46, 62015, '2015-02-07 19:12:27', 1, '1900', ''),
(47, 92015, '2015-02-28 19:12:27', 1, '2300', ''),
(48, 92015, '2015-02-28 19:12:27', 3, '400', ''),
(49, 102015, '2015-03-07 19:12:27', 1, '2000', ''),
(50, 102015, '2015-03-07 19:12:27', 3, '570', ''),
(51, 102015, '2015-03-07 19:12:27', 2, '4000', ''),
(52, 112015, '2015-03-14 19:12:27', 1, '3102', ''),
(53, 112015, '2015-03-14 19:12:27', 2, '1020', ''),
(54, 112015, '2015-03-14 19:12:27', 4, '400', ''),
(55, 122015, '2015-03-21 19:12:27', 1, '3160', ''),
(56, 122015, '2015-03-21 19:12:27', 2, '310', ''),
(57, 132015, '2015-03-28 19:12:27', 1, '1300', ''),
(58, 132015, '2015-03-28 19:12:27', 3, '1200', ''),
(59, 132015, '2015-03-28 19:12:27', 2, '800', ''),
(60, 132015, '2015-03-28 19:12:27', 4, '320', ''),
(61, 142015, '2015-04-04 19:12:27', 1, '1300', ''),
(62, 142015, '2015-04-04 19:12:27', 2, '200', ''),
(63, 142015, '2015-04-04 19:12:27', 4, '3000', ''),
(64, 152015, '2015-04-11 19:12:27', 4, '5300', ''),
(65, 152015, '2015-04-11 19:12:27', 2, '630', ''),
(66, 152015, '2015-04-11 19:12:27', 4, '400', ''),
(67, 162015, '2015-04-18 19:12:27', 1, '3290', ''),
(68, 162015, '2015-04-18 19:12:27', 2, '1000', ''),
(69, 172015, '2015-04-25 19:12:27', 1, '2200', ''),
(70, 172015, '2015-04-25 19:12:27', 3, '120', ''),
(71, 172015, '2015-04-25 19:12:27', 2, '302', ''),
(72, 182015, '2015-05-02 19:12:27', 1, '1350', ''),
(73, 182015, '2015-05-02 19:12:27', 2, '413', ''),
(74, 182015, '2015-05-02 19:12:27', 4, '1302', ''),
(75, 192015, '2015-05-09 19:12:27', 1, '1002', ''),
(76, 192015, '2015-05-09 19:12:27', 3, '200', ''),
(77, 192015, '2015-05-09 19:12:27', 2, '419', ''),
(78, 202015, '2015-05-16 19:12:27', 1, '3400', ''),
(79, 202015, '2015-05-16 19:12:27', 2, '300', ''),
(80, 202015, '2015-05-16 19:12:27', 3, '200', ''),
(81, 202015, '2015-05-16 19:12:27', 4, '12000', ''),
(82, 212015, '2015-05-23 19:12:27', 4, '1200', ''),
(83, 212015, '2015-05-23 19:12:27', 3, '900', ''),
(84, 212015, '2015-05-23 19:12:27', 1, '1232', ''),
(85, 212015, '2015-05-23 19:12:27', 2, '600', ''),
(86, 222015, '2015-05-30 19:12:27', 1, '1200', ''),
(87, 222015, '2015-05-30 19:12:27', 2, '390', ''),
(88, 222015, '2015-05-30 19:12:27', 4, '5700', ''),
(89, 232015, '2015-06-06 19:12:27', 1, '4300', ''),
(90, 232015, '2015-06-06 19:12:27', 2, '3000', ''),
(91, 242015, '2015-06-16 19:12:27', 1, '4000', ''),
(92, 242015, '2015-06-16 19:12:27', 2, '200', ''),
(93, 242015, '2015-06-16 19:12:27', 4, '400', ''),
(94, 252015, '2015-06-20 19:12:27', 1, '10060', ''),
(95, 252015, '2015-06-20 19:12:27', 2, '2032', ''),
(96, 252015, '2015-06-20 19:12:27', 3, '5690', ''),
(97, 262015, '2015-06-27 19:12:27', 1, '1570', ''),
(98, 262015, '2015-06-27 19:12:27', 2, '304', ''),
(99, 262015, '2015-06-27 19:12:27', 4, '4050', ''),
(100, 272015, '2015-07-04 19:12:27', 1, '2212', ''),
(101, 272015, '2015-07-04 19:12:27', 2, '420', ''),
(102, 272015, '2015-07-04 19:12:27', 3, '530', ''),
(103, 282015, '2015-07-11 19:12:27', 4, '990', ''),
(104, 282015, '2015-07-11 19:12:27', 3, '420', ''),
(105, 282015, '2015-07-11 19:12:27', 2, '3000', ''),
(106, 282015, '2015-07-11 19:12:27', 1, '15000', ''),
(107, 292015, '2015-07-18 19:12:27', 1, '4450', ''),
(108, 292015, '2015-07-18 19:12:27', 2, '790', ''),
(109, 292015, '2015-07-18 19:12:27', 3, '600', ''),
(110, 292015, '2015-07-18 19:12:27', 4, '1200', ''),
(111, 302015, '2015-07-24 05:56:14', 1, '3200', ''),
(112, 302015, '2015-07-24 05:57:08', 4, '2000', ''),
(113, 302015, '2015-07-25 19:12:27', 2, '3020', ''),
(114, 302015, '2015-07-25 19:12:27', 3, '120', ''),
(115, 312015, '2015-07-31 19:12:27', 1, '4631', ''),
(116, 312015, '2015-07-31 19:12:27', 2, '1200', ''),
(117, 312015, '2015-07-31 19:12:27', 4, '30', ''),
(118, 312015, '2015-07-31 19:12:27', 3, '500', ''),
(119, 322015, '2015-08-05 04:27:46', 1, '3000', ''),
(120, 322015, '2015-08-05 04:30:37', 4, '1000000', 'อ.ภานุวัฒน์'),
(121, 342015, '2015-08-23 11:54:29', 4, '2000', ''),
(122, 342015, '2015-08-23 11:54:42', 1, '4590', ''),
(123, 352015, '2015-08-26 10:57:29', 3, '3000', ''),
(124, 352015, '2015-08-26 10:57:43', 3, '234', '');
-- --------------------------------------------------------
--
-- Table structure for table `donationtype`
--
CREATE TABLE IF NOT EXISTS `donationtype` (
`dtype_id` tinyint(2) NOT NULL,
`donation_type` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `donationtype`
--
INSERT INTO `donationtype` (`dtype_id`, `donation_type`) VALUES
(1, 'เงินถวายวันอาทิตย์'),
(2, 'เงินถวายสิบลด'),
(3, 'เงินถวายขอบคุณ'),
(4, 'เงินถวายพิเศษ');
-- --------------------------------------------------------
--
-- Table structure for table `expenses`
--
CREATE TABLE IF NOT EXISTS `expenses` (
`expenses_id` int(6) NOT NULL,
`expenses_week` int(6) NOT NULL,
`expenses_date` datetime NOT NULL,
`etype_id` tinyint(2) NOT NULL,
`expenses_amount` varchar(11) COLLATE utf8_unicode_ci NOT NULL,
`expenses_note` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `expenses`
--
INSERT INTO `expenses` (`expenses_id`, `expenses_week`, `expenses_date`, `etype_id`, `expenses_amount`, `expenses_note`) VALUES
(16, 522014, '2014-12-25 13:11:13', 1, '73', ''),
(17, 522014, '2014-12-25 13:11:13', 2, '99', ''),
(18, 522014, '2014-12-25 13:11:13', 3, '441', ''),
(19, 522014, '2014-12-25 13:11:13', 4, '631', ''),
(20, 522014, '2014-12-25 13:11:13', 5, '500', ''),
(21, 12015, '2015-01-03 09:12:27', 5, '670', ''),
(22, 12015, '2015-01-03 09:12:27', 6, '34', ''),
(23, 12015, '2015-01-03 09:12:27', 1, '40', ''),
(24, 22015, '2015-01-10 09:12:27', 1, '40', ''),
(25, 22015, '2015-01-10 09:12:27', 5, '600', ''),
(26, 22015, '2015-01-10 09:12:27', 6, '203', ''),
(27, 32015, '2015-01-17 09:12:27', 1, '45', ''),
(28, 32015, '2015-01-17 09:12:27', 5, '500', ''),
(29, 32015, '2015-01-17 09:12:27', 6, '200', ''),
(30, 42015, '2015-01-24 09:12:27', 1, '70', ''),
(31, 42015, '2015-01-24 09:12:27', 2, '203', ''),
(32, 42015, '2015-01-24 09:12:27', 4, '631', ''),
(33, 42015, '2015-01-24 09:12:27', 6, '200', ''),
(34, 52015, '2015-01-31 19:12:27', 5, '1200', ''),
(35, 52015, '2015-01-31 19:12:27', 1, '90', ''),
(36, 52015, '2015-01-31 19:12:27', 2, '140', ''),
(37, 72015, '2015-02-14 19:12:27', 1, '76', ''),
(38, 72015, '2015-02-14 19:12:27', 5, '1500', ''),
(39, 72015, '2015-02-14 19:12:27', 6, '300', ''),
(40, 82015, '2015-02-21 19:12:27', 1, '320', ''),
(41, 82015, '2015-02-21 19:12:27', 4, '631', ''),
(42, 82015, '2015-02-21 19:12:27', 5, '2100', ''),
(43, 82015, '2015-02-21 19:12:27', 6, '450', ''),
(44, 62015, '2015-02-07 19:12:27', 1, '200', ''),
(45, 62015, '2015-02-07 19:12:27', 5, '1000', ''),
(46, 92015, '2015-02-28 19:12:27', 1, '120', ''),
(47, 92015, '2015-02-28 19:12:27', 5, '300', ''),
(48, 92015, '2015-02-28 19:12:27', 6, '1200', ''),
(49, 102015, '2015-03-07 19:12:27', 2, '780', ''),
(50, 102015, '2015-03-07 19:12:27', 3, '1208', ''),
(51, 102015, '2015-03-07 19:12:27', 5, '1600', ''),
(52, 102015, '2015-03-07 19:12:27', 6, '3400', ''),
(53, 112015, '2015-03-14 19:12:27', 1, '320', ''),
(54, 112015, '2015-03-14 19:12:27', 5, '650', ''),
(55, 112015, '2015-03-14 19:12:27', 6, '700', ''),
(56, 122015, '2015-03-21 19:12:27', 5, '1200', ''),
(57, 122015, '2015-03-21 19:12:27', 1, '302', ''),
(58, 132015, '2015-03-28 19:12:27', 4, '631', ''),
(59, 132015, '2015-03-28 19:12:27', 5, '1300', ''),
(60, 132015, '2015-03-28 19:12:27', 6, '450', ''),
(61, 142015, '2015-04-04 19:12:27', 2, '420', ''),
(62, 142015, '2015-04-04 19:12:27', 1, '300', ''),
(63, 142015, '2015-04-04 19:12:27', 5, '1100', ''),
(64, 152015, '2015-04-11 19:12:27', 1, '300', ''),
(65, 152015, '2015-04-11 19:12:27', 2, '423', ''),
(66, 152015, '2015-04-11 19:12:27', 4, '631', ''),
(67, 152015, '2015-04-11 19:12:27', 5, '1400', ''),
(68, 162015, '2015-04-18 19:12:27', 5, '970', ''),
(69, 162015, '2015-04-18 19:12:27', 3, '2040', ''),
(70, 162015, '2015-04-18 19:12:27', 6, '500', ''),
(71, 172015, '2015-04-25 19:12:27', 4, '631', ''),
(72, 172015, '2015-04-25 19:12:27', 5, '1610', ''),
(73, 172015, '2015-04-25 19:12:27', 1, '400', ''),
(74, 182015, '2015-05-02 19:12:27', 1, '120', ''),
(75, 182015, '2015-05-02 19:12:27', 2, '320', ''),
(76, 182015, '2015-05-02 19:12:27', 5, '782', ''),
(77, 192015, '2015-05-09 19:12:27', 3, '3100', ''),
(78, 192015, '2015-05-09 19:12:27', 5, '1900', ''),
(79, 192015, '2015-05-09 19:12:27', 2, '602', ''),
(80, 192015, '2015-05-09 19:12:27', 6, '445', ''),
(81, 202015, '2015-05-16 19:12:27', 1, '320', ''),
(82, 202015, '2015-05-16 19:12:27', 2, '210', ''),
(83, 202015, '2015-05-16 19:12:27', 4, '631', ''),
(84, 202015, '2015-05-16 19:12:27', 5, '3202', ''),
(85, 212015, '2015-05-23 19:12:27', 5, '2800', ''),
(86, 212015, '2015-05-23 19:12:27', 3, '3310', ''),
(87, 212015, '2015-05-23 19:12:27', 2, '410', ''),
(88, 212015, '2015-05-23 19:12:27', 6, '8990', ''),
(89, 222015, '2015-05-30 19:12:27', 2, '500', ''),
(90, 222015, '2015-05-30 19:12:27', 5, '320', ''),
(91, 222015, '2015-05-30 19:12:27', 1, '239', ''),
(92, 232015, '2015-06-06 19:12:27', 3, '3200', ''),
(93, 232015, '2015-06-06 19:12:27', 1, '656', ''),
(94, 232015, '2015-06-06 19:12:27', 6, '70', ''),
(95, 232015, '2015-06-06 19:12:27', 5, '904', ''),
(96, 242015, '2015-06-13 19:12:27', 3, '2010', ''),
(97, 242015, '2015-06-13 19:12:27', 5, '590', ''),
(98, 252015, '2015-06-20 19:12:27', 4, '631', ''),
(99, 252015, '2015-06-20 19:12:27', 1, '400', ''),
(100, 252015, '2015-06-20 19:12:27', 5, '3200', ''),
(101, 272015, '2015-06-27 19:12:27', 1, '430', ''),
(102, 272015, '2015-06-27 19:12:27', 5, '3210', ''),
(103, 272015, '2015-06-27 19:12:27', 6, '12000', ''),
(104, 262015, '2015-06-27 19:12:27', 5, '703', ''),
(105, 262015, '2015-06-27 19:12:27', 3, '3219', ''),
(106, 262015, '2015-06-27 19:12:27', 2, '629', ''),
(107, 262015, '2015-06-27 19:12:27', 6, '17', ''),
(108, 262015, '2015-06-27 19:12:27', 1, '400', ''),
(109, 282015, '2015-07-11 19:12:27', 4, '631', ''),
(110, 282015, '2015-07-11 19:12:27', 5, '1800', ''),
(111, 282015, '2015-07-11 19:12:27', 2, '421', ''),
(112, 282015, '2015-07-11 19:12:27', 1, '123', ''),
(113, 292015, '2015-07-18 19:12:27', 1, '400', ''),
(114, 292015, '2015-07-18 19:12:27', 2, '760', ''),
(115, 292015, '2015-07-18 19:12:27', 5, '2598', ''),
(116, 292015, '2015-07-18 19:12:27', 6, '423', ''),
(117, 302015, '2015-07-23 14:42:57', 4, '631.33', ''),
(118, 302015, '2015-07-25 19:12:27', 1, '400', ''),
(119, 302015, '2015-07-25 19:12:27', 5, '1980', ''),
(120, 302015, '2015-07-25 19:12:27', 6, '640', ''),
(121, 312015, '2015-07-31 19:12:27', 1, '230', ''),
(122, 312015, '2015-07-31 19:12:27', 6, '670', ''),
(123, 312015, '2015-07-31 19:12:27', 5, '900', ''),
(124, 322015, '2015-08-04 08:40:04', 6, '1200', 'ชั้นวางแฟ้ม 5 ชั้น'),
(125, 322015, '2015-08-05 04:28:18', 5, '500', ''),
(126, 342015, '2015-08-23 11:55:16', 5, '3400', ''),
(127, 342015, '2015-08-23 11:55:22', 3, '2304', ''),
(128, 342015, '2015-08-23 11:55:27', 6, '2300', ''),
(129, 342015, '2015-08-23 11:55:37', 4, '632', ''),
(130, 342015, '2015-08-23 11:55:46', 1, '232', ''),
(131, 342015, '2015-08-23 11:55:54', 2, '554', ''),
(132, 352015, '2015-08-26 10:57:52', 5, '234', ''),
(133, 352015, '2015-08-26 10:57:58', 4, '632', ''),
(134, 352015, '2015-08-26 10:58:04', 6, '2342', ''),
(135, 352015, '2015-08-26 10:58:09', 1, '234', '');
-- --------------------------------------------------------
--
-- Table structure for table `expensestype`
--
CREATE TABLE IF NOT EXISTS `expensestype` (
`etype_id` tinyint(2) NOT NULL,
`expenses_type` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `expensestype`
--
INSERT INTO `expensestype` (`etype_id`, `expenses_type`) VALUES
(1, 'ค่าน้ำดื่ม'),
(2, 'ค่าน้ำประปา'),
(3, 'ค่าไฟฟ้า'),
(4, 'ค่าอินเตอร์เน็ต'),
(5, 'ค่าอาหาร'),
(6, 'ค่าอปุกรณ์สำนักงาน');
-- --------------------------------------------------------
--
-- Table structure for table `member`
--
CREATE TABLE IF NOT EXISTS `member` (
`member_id` int(5) NOT NULL,
`member_idcard` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`member_nametitle` tinyint(1) NOT NULL,
`member_fname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`member_lname` varchar(31) COLLATE utf8_unicode_ci NOT NULL,
`member_cnumber` varchar(31) COLLATE utf8_unicode_ci NOT NULL,
`member_email` varchar(127) COLLATE utf8_unicode_ci NOT NULL,
`member_birthday` date NOT NULL,
`member_address` text COLLATE utf8_unicode_ci NOT NULL,
`member_regisdate` date NOT NULL,
`membergroup_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `member`
--
INSERT INTO `member` (`member_id`, `member_idcard`, `member_nametitle`, `member_fname`, `member_lname`, `member_cnumber`, `member_email`, `member_birthday`, `member_address`, `member_regisdate`, `membergroup_id`) VALUES
(1, '1310500117093', 3, 'จันทิมา', 'จารุแพทย์', '0834923030', 'jinyki@hotmail.com', '2008-10-10', '143 หมู่ 2 ตำบล บ้านโฮ่ง อำเภอ บ้านโฮ่ง ลำพูน 51130', '2015-07-10', ''),
(2, '1101401789932', 1, 'เสมอพงษ์', 'สืบทอง', '0828484839', 'samotilo@gmail.com', '2006-09-09', '345 หมู่ 17 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(3, '1509900986474', 1, 'จักรกฤษ', 'ปันตา', '0983883744', 'jukkitpun@gmail.com', '2005-09-08', '211 หมู่ 3 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(4, '1509900980474', 1, 'พีระ', 'คำแก้วตา', '0884773822', 'loddayny@hotmail.com', '2005-08-08', '34 หมู่ 3 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(5, '1559393974183', 3, 'กิตติยา', 'สมจันทร์', '0938474392', 'toyaitlo@gmail.com', '2000-04-02', '11 หมู่ 13 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(6, '1559333934119', 3, 'พรรนา', 'มะนิตา', '0993764863', 'anusati@gmail.com', '2000-06-11', '131 หมู่ 13 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(7, '1559393967867', 3, 'สมแก้วจันทร์', 'ลักดีงาม', '0934943334', 'kotimay@gmail.com', '2000-12-01', '211 หมู่ 12 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(8, '1559393970989', 3, 'พินารัตณ์', 'แก้วมนี', '0848849339', 'lotmailllo@hotmail.com', '2000-06-21', '11 หมู่ 2 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(9, '1559390074189', 3, 'ปรีรดา', 'แก้วพร', '0839949222', 'loglove31@hotmail.com', '2000-09-01', '145 หมู่ 6 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.เชียงใหม่ 51130', '2015-07-10', ''),
(10, '1550093974134', 1, 'นันรนันท์', 'สมระกา', '0983788293', 'loftsory@gmail.com', '2000-10-25', '71 หมู่ 9 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(11, '1559393734185', 3, 'แก้วมยี', 'พุธทิพย์', '0839993843', 'jatalrrgo@gmail.com', '2000-08-12', '112 หมู่ 9 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(12, '1559883974329', 1, 'สมพรชัย', 'ขมดี', '0829837633', 'dotoro1922@hotmail.com', '2000-05-12', '12 หมู่ 1 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(13, '1559396274189', 3, 'นัทนิสา', 'แสนดวงดี', '0926399475', 'dkit55@hotmail.com', '2002-07-02', '11 หมู่ 15 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(14, '1559333934189', 1, 'กรตีนา', 'เหรมพร', '0923332283', 'lovebk91@hotmail.com', '2000-02-22', '66 หมู่ 16 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(15, '1533939759403', 3, 'กิตติรา', 'สมจันทร์', '0938474392', 'toyaitlo@gmail.com', '2000-04-02', '11 หมู่ 13 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(16, '1559093934189', 3, 'พรนารา', 'มะนิตา', '0993764863', 'anusati@gmail.com', '2000-06-11', '131 หมู่ 13 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(17, '1559350967848', 3, 'สมจันทร์', 'ลักดีงาม', '0934943334', 'kotimay@gmail.com', '2000-12-01', '211 หมู่ 12 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(18, '1559308970981', 3, 'พิรารัตณ์', 'แก้วมนี', '0848849339', 'lotmailllo@hotmail.com', '2000-06-21', '11 หมู่ 2 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(19, '1559390074471', 3, 'ปรีกา', 'แก้วพร', '0839949222', 'loglove31@hotmail.com', '2000-09-01', '145 หมู่ 6 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(20, '1550090544184', 1, 'นันรยา', 'สมระกา', '0983788293', 'loftsory@gmail.com', '2000-10-25', '71 หมู่ 9 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(21, '1559393734596', 3, 'แก้วมา', 'พุธทิพย์', '0839993843', 'jatalrrgo@gmail.com', '2000-08-12', '112 หมู่ 9 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(22, '1559393943343', 1, 'สมพรยา', 'ขมดี', '0829837633', 'dotoro1922@hotmail.com', '2000-05-12', '12 หมู่ 1 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(23, '1559392273343', 3, 'นัทนิมา', 'แสนดวงดี', '0926399475', 'dkit55@hotmail.com', '2002-07-02', '11 หมู่ 15 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', ''),
(24, '1559393934231', 1, 'กรตีดา', 'เหรมพร', '0923332283', 'lovebk91@hotmail.com', '2000-02-22', '66 หมู่ 16 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130', '2015-07-10', '');
-- --------------------------------------------------------
--
-- Table structure for table `trained`
--
CREATE TABLE IF NOT EXISTS `trained` (
`register_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`member_idcard` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`course_id` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
`trainer` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`trained_date` date NOT NULL,
`trained_tscore` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`trained_score` varchar(5) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `trained`
--
INSERT INTO `trained` (`register_id`, `member_idcard`, `course_id`, `trainer`, `trained_date`, `trained_tscore`, `trained_score`) VALUES
('19', '1509900986474', 'CH10615', 'NAP', '2015-08-18', '264', '193'),
('20', '1559393974183', 'CH10615', 'NAP', '2015-08-18', '264', '214'),
('27', '1101401789932', 'CL20615', 'PSU', '2015-08-20', '264', '188'),
('28', '1559883974329', 'CL20615', 'PSU', '2015-08-20', '264', '222'),
('29', '1533939759403', 'CL20615', 'PSU', '2015-08-20', '264', '220'),
('30', '1559333934119', 'CL20615', 'PSU', '2015-08-20', '264', '222'),
('32', '1559396274189', 'CL20615', 'PSU', '2015-08-20', '264', '220'),
('33', '1559393934231', 'CL20615', 'PSU', '2015-08-20', '264', '231'),
('34', '1559393943343', 'CL20615', 'PSU', '2015-08-20', '264', '203'),
('37', '1550093974134', 'TT10815', 'PR1', '2015-08-20', '165', '133'),
('39', '1509900980474', 'TT10815', 'PR1', '2015-08-20', '165', '118');
-- --------------------------------------------------------
--
-- Table structure for table `trained_fail`
--
CREATE TABLE IF NOT EXISTS `trained_fail` (
`register_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`member_idcard` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`course_id` varchar(7) COLLATE utf8_unicode_ci NOT NULL,
`trainer` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`trained_date` date NOT NULL,
`trained_tscore` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`trained_score` varchar(5) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `trained_fail`
--
INSERT INTO `trained_fail` (`register_id`, `member_idcard`, `course_id`, `trainer`, `trained_date`, `trained_tscore`, `trained_score`) VALUES
('38', '1509900986474', 'TT10815', 'PR1', '2015-08-20', '165', '50');
-- --------------------------------------------------------
--
-- Table structure for table `trainer`
--
CREATE TABLE IF NOT EXISTS `trainer` (
`trainer_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`trainer_nametitle` tinyint(2) NOT NULL,
`trainer_fname` varchar(127) COLLATE utf8_unicode_ci NOT NULL,
`trainer_lname` varchar(127) COLLATE utf8_unicode_ci NOT NULL,
`trainer_cnumber` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
`trainer_email` varchar(127) COLLATE utf8_unicode_ci NOT NULL,
`trainer_birthday` date NOT NULL,
`trainer_address` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `trainer`
--
INSERT INTO `trainer` (`trainer_id`, `trainer_nametitle`, `trainer_fname`, `trainer_lname`, `trainer_cnumber`, `trainer_email`, `trainer_birthday`, `trainer_address`) VALUES
('DOI', 3, 'พวงพลอย', 'เล็กศิริ', '0995394332', 'ployavalo@gmail.com', '2005-10-07', '71/44 ม.3 ต.ท่ามะกา อ. ท่ามะกา จ.กาญจนบุรี 71120'),
('KAW', 1, 'แก้วสม', 'ราชมล', '0828853644', 'gotolomo@hotmail.com', '1965-06-22', '15 ม.3 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130'),
('KIT', 2, 'กิตติยา', 'ไชยวรรณ์', '0838947753', 'kitiya43@gmail.com', '1990-10-10', '43 ม.4 ต.โคกโคเฒ่า อ.เมือง จ.สุพรรณบุรี 72000'),
('KOD', 3, 'ประภาพร', 'พรหมเกษ', '0993824722', 'pamkalo@gmail.com', '1989-10-11', '499/11 หมู่ 12 อุดมสุข 42 สุขุมวิท 103 บางนา กรุงเทพ 10260'),
('LSD', 2, 'กนกกาญจน์', 'ปัญสกุล', '0851718482', 'kitapun90@gmail.com', '1986-08-06', '72/7 ม.11 ต.บ้านเลน อ.บางปะอิน จ.พระนครศรีอยุธยา 13160'),
('NAP', 1, 'นากร', 'ปัญญา', '082383992', 'naplue@hotmail.com', '1980-09-08', '45 ม.4 ต.บ้านโฮ่ง อ.บ้านโฮ่ง จ.ลำพูน 51130'),
('PAL', 1, 'พิชญ์พงศ์', 'วิมลรัชตาภรณ์ ', '0823459338', 'grilook@gmail.com', '1975-07-18', '88 ถนนวัดโพธิ์ ซอย9 ตำบลตลาด อำเภอเมืองฯ จังหวัดสุราษฎร์ธานี 84000'),
('PLS', 2, 'ปุษยา', 'แก้วจันทร์', '0829399302', 'punipun@live.com', '1989-11-17', '529/1 ซ.ไสวสุวรรณ ถ.กรุงเทพฯ-นนท์ บางซื่อ กรุงเทพฯ 10800'),
('PR1', 2, 'พริ้มไพร', 'วงชมพู', '0888888888', '8888@gmail.com', '1978-10-11', 'เชียงใหม่'),
('PSU', 1, 'ปัถยา', 'รุจิแสวง', '0924855843', 'kidmanodi@hotmail.com', '1985-10-27', 'ม.2 ต.ห้วยทราย อ.สันกำแพง จ.เชียงใหม่ 50130'),
('SUN', 3, 'สนัสตญา', 'แก้วผงศา', '0983494493', 'sunantaya19@gmail.com', '1987-08-11', '68 หมู่ 3 ต.ป่าแดง อ.เมือง จ.แพร่ 54000'),
('TAI', 1, 'ทักษินันท์', 'มะโนเพชร', '039483722', 'tikoonsawan@gmail.com', '1984-09-27', '49/84 ม.4 ต.เสาธงหิน อ.บางใหญ่ จ.นนทบุรี 11140 '),
('WIE', 2, 'วิญาณี', 'คำแก้วค่ำ', '0983384733', 'viyanee@hotmail.com', '1986-12-06', '99/37 ม.8 ต. เขาคันทรง อ. ศรีราชา จ.ชลบุรี 20110');
-- --------------------------------------------------------
--
-- Table structure for table `trainingscore`
--
CREATE TABLE IF NOT EXISTS `trainingscore` (
`regis_id` int(5) NOT NULL,
`training_unit` tinyint(2) NOT NULL,
`training_date` datetime NOT NULL,
`training_tscore` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
`training_score` varchar(3) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `trainingscore`
--
INSERT INTO `trainingscore` (`regis_id`, `training_unit`, `training_date`, `training_tscore`, `training_score`) VALUES
(19, 1, '2015-07-22 12:51:05', '33', '34'),
(20, 1, '2015-07-22 12:51:11', '33', '24'),
(21, 1, '2015-07-22 12:51:20', '33', '24'),
(22, 1, '2015-07-22 12:51:41', '33', '32'),
(23, 1, '2015-07-22 12:51:47', '33', '32'),
(24, 1, '2015-07-22 12:51:54', '33', '23'),
(25, 1, '2015-07-22 12:52:02', '33', '28'),
(26, 1, '2015-07-22 12:52:08', '33', '23'),
(19, 2, '2015-07-22 12:52:23', '33', '22'),
(20, 2, '2015-07-22 12:52:28', '33', '23'),
(22, 2, '2015-07-22 12:52:33', '33', '23'),
(21, 2, '2015-07-22 12:52:40', '33', '23'),
(23, 2, '2015-07-22 12:52:47', '33', '31'),
(24, 2, '2015-07-22 12:52:55', '33', '28'),
(25, 2, '2015-07-22 12:53:01', '33', '29'),
(26, 2, '2015-07-22 12:53:09', '33', '26'),
(19, 3, '2015-07-22 12:53:47', '33', '27'),
(20, 3, '2015-07-22 12:53:53', '33', '24'),
(21, 3, '2015-07-22 12:54:00', '33', '28'),
(22, 3, '2015-07-22 12:54:06', '33', '24'),
(23, 3, '2015-07-22 12:54:14', '33', '27'),
(24, 3, '2015-07-22 12:54:21', '33', '27'),
(25, 3, '2015-07-22 12:54:41', '33', '24'),
(26, 3, '2015-07-22 12:54:46', '33', '24'),
(19, 4, '2015-07-22 12:55:20', '33', '19'),
(20, 4, '2015-07-22 12:55:26', '33', '19'),
(21, 4, '2015-07-22 12:55:32', '33', '29'),
(22, 4, '2015-07-22 12:55:38', '33', '22'),
(23, 4, '2015-07-22 12:55:44', '33', '23'),
(24, 4, '2015-07-22 12:55:49', '33', '28'),
(25, 4, '2015-07-22 12:55:56', '33', '29'),
(20, 5, '2015-07-22 12:56:07', '33', '32'),
(21, 5, '2015-07-22 12:56:13', '33', '23'),
(22, 5, '2015-07-22 12:56:17', '33', '23'),
(23, 5, '2015-07-22 12:56:24', '33', '33'),
(25, 5, '2015-07-22 12:56:30', '33', '24'),
(19, 5, '2015-07-22 12:56:35', '33', '29'),
(26, 5, '2015-07-22 12:56:44', '33', '24'),
(19, 6, '2015-07-22 12:56:58', '33', '28'),
(20, 6, '2015-07-22 12:57:07', '33', '28'),
(21, 6, '2015-07-22 12:57:13', '33', '32'),
(22, 6, '2015-07-22 12:57:19', '33', '24'),
(23, 6, '2015-07-22 12:57:39', '33', '26'),
(24, 6, '2015-07-22 12:57:44', '33', '24'),
(25, 6, '2015-07-22 12:57:49', '33', '28'),
(26, 6, '2015-07-22 12:57:59', '33', '32'),
(19, 7, '2015-07-22 12:58:35', '33', '12'),
(20, 7, '2015-07-22 12:58:40', '33', '31'),
(21, 7, '2015-07-22 12:58:44', '33', '11'),
(22, 7, '2015-07-22 12:58:50', '33', '24'),
(23, 7, '2015-07-22 12:58:58', '33', '29'),
(24, 7, '2015-07-22 12:59:04', '33', '25'),
(25, 7, '2015-07-22 12:59:19', '33', '14'),
(26, 7, '2015-07-22 12:59:24', '33', '24'),
(27, 1, '2015-07-22 13:01:04', '33', '19'),
(28, 1, '2015-07-22 13:01:11', '33', '31'),
(29, 1, '2015-07-22 13:01:15', '33', '32'),
(30, 1, '2015-07-22 13:01:33', '33', '26'),
(31, 1, '2015-07-22 13:01:53', '33', '27'),
(32, 1, '2015-07-22 13:01:57', '33', '29'),
(33, 1, '2015-07-22 13:02:02', '33', '29'),
(34, 1, '2015-07-22 13:02:07', '33', '29'),
(35, 1, '2015-07-22 13:02:12', '33', '23'),
(27, 2, '2015-07-22 13:02:38', '33', '18'),
(28, 2, '2015-07-22 13:02:44', '33', '31'),
(29, 2, '2015-07-22 13:02:52', '33', '31'),
(30, 2, '2015-07-22 13:02:58', '33', '29'),
(31, 2, '2015-07-22 13:03:07', '33', '28'),
(32, 2, '2015-07-22 13:03:11', '33', '30'),
(33, 2, '2015-07-22 13:03:18', '33', '32'),
(34, 2, '2015-07-22 13:03:28', '33', '23'),
(27, 3, '2015-07-22 13:03:44', '33', '27'),
(28, 3, '2015-07-22 13:03:48', '33', '28'),
(29, 3, '2015-07-22 13:03:53', '33', '23'),
(30, 3, '2015-07-22 13:03:57', '33', '23'),
(31, 3, '2015-07-22 13:04:01', '33', '23'),
(32, 3, '2015-07-22 13:04:05', '33', '29'),
(33, 3, '2015-07-22 13:04:11', '33', '29'),
(34, 3, '2015-07-22 13:04:15', '33', '27'),
(35, 3, '2015-07-22 13:04:19', '33', '28'),
(27, 4, '2015-07-22 13:04:32', '33', '21'),
(28, 4, '2015-07-22 13:05:06', '33', '28'),
(30, 4, '2015-07-22 13:05:11', '33', '29'),
(31, 4, '2015-07-22 13:05:16', '33', '26'),
(32, 4, '2015-07-22 13:05:20', '33', '29'),
(33, 4, '2015-07-22 13:05:25', '33', '29'),
(34, 4, '2015-07-22 13:05:29', '33', '20'),
(35, 4, '2015-07-22 13:05:34', '33', '29'),
(29, 4, '2015-07-22 13:05:39', '33', '27'),
(27, 5, '2015-07-22 13:05:57', '33', '19'),
(28, 5, '2015-07-22 13:06:03', '33', '24'),
(29, 5, '2015-07-22 13:06:08', '33', '22'),
(30, 5, '2015-07-22 13:06:12', '33', '22'),
(31, 5, '2015-07-22 13:06:16', '33', '22'),
(32, 5, '2015-07-22 13:06:20', '33', '22'),
(33, 5, '2015-07-22 13:06:24', '33', '32'),
(34, 5, '2015-07-22 13:06:30', '33', '23'),
(35, 5, '2015-07-22 13:06:36', '33', '23'),
(27, 6, '2015-07-22 13:06:56', '33', '31'),
(28, 6, '2015-07-22 13:07:01', '33', '23'),
(29, 6, '2015-07-22 13:07:07', '33', '23'),
(30, 6, '2015-07-22 13:07:12', '33', '28'),
(31, 6, '2015-07-22 13:07:19', '33', '29'),
(32, 6, '2015-07-22 13:07:24', '33', '29'),
(33, 6, '2015-07-22 13:07:28', '33', '23'),
(34, 6, '2015-07-22 13:07:38', '33', '32'),
(35, 6, '2015-07-22 13:07:45', '33', '30'),
(27, 7, '2015-07-22 13:08:08', '33', '26'),
(28, 7, '2015-07-22 13:08:12', '33', '28'),
(29, 7, '2015-07-22 13:08:18', '33', '30'),
(30, 7, '2015-07-22 13:08:24', '33', '32'),
(31, 7, '2015-07-22 13:08:30', '33', '12'),
(32, 7, '2015-07-22 13:08:37', '33', '20'),
(33, 7, '2015-07-22 13:08:42', '33', '29'),
(34, 7, '2015-07-22 13:08:48', '33', '26'),
(35, 7, '2015-07-22 13:08:54', '33', '29'),
(27, 8, '2015-07-22 13:09:48', '33', '27'),
(28, 8, '2015-07-22 13:09:51', '33', '29'),
(29, 8, '2015-07-22 13:09:58', '33', '32'),
(30, 8, '2015-07-22 13:10:04', '33', '33'),
(32, 8, '2015-07-22 13:10:08', '33', '32'),
(33, 8, '2015-07-22 13:10:12', '33', '28'),
(34, 8, '2015-07-22 13:10:17', '33', '23'),
(35, 8, '2015-07-22 13:10:22', '33', '23'),
(11, 1, '2015-07-24 05:50:41', '33', '31'),
(37, 1, '2015-08-05 04:05:08', '33', '23'),
(38, 1, '2015-08-05 04:05:14', '33', '10'),
(39, 1, '2015-08-05 04:05:20', '33', '12'),
(37, 2, '2015-08-05 04:08:49', '33', '30'),
(38, 2, '2015-08-05 04:08:55', '33', '10'),
(39, 2, '2015-08-05 04:09:29', '33', '30'),
(37, 3, '2015-08-05 04:09:45', '33', '20'),
(38, 3, '2015-08-05 04:09:51', '33', '10'),
(39, 3, '2015-08-05 04:09:57', '33', '23'),
(37, 4, '2015-08-05 04:10:59', '33', '30'),
(38, 4, '2015-08-05 04:11:03', '33', '10'),
(39, 4, '2015-08-05 04:11:09', '33', '20'),
(37, 5, '2015-08-05 04:11:21', '33', '30'),
(38, 5, '2015-08-05 04:11:25', '33', '10'),
(39, 5, '2015-08-05 04:11:29', '33', '33'),
(19, 8, '2015-08-18 10:36:11', '33', '22'),
(20, 8, '2015-08-18 10:36:15', '33', '33'),
(3, 4, '2015-08-21 08:06:45', '33', '33');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`user_id` varchar(31) COLLATE utf8_unicode_ci NOT NULL,
`user_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`usergroup_id` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
`user_status` tinyint(2) NOT NULL,
`user_regisdate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `user_password`, `usergroup_id`, `user_status`, `user_regisdate`) VALUES
('admin', '9admswMG1OYXA=b9dmswMG1OYXA=81c=', 'sa', 11, '2015-05-21 00:00:00'),
('adminam', '9aYWRtaW5hbQ==b9YWRtaW5hbQ==81c=', 'am', 11, '2015-07-20 08:27:33'),
('adminfn', '9aYWRtaW5mbg==b9YWRtaW5mbg==81c=', 'fn', 11, '2015-07-20 08:14:05'),
('adminfn2', '9aYWRtaW5mbjI=b9YWRtaW5mbjI=81c=', 'fn', 11, '2015-07-20 08:36:19'),
('adminfn3', '9aYWRtaW5mbjM=b9YWRtaW5mbjM=81c=', 'fn', 11, '2015-07-20 08:38:48'),
('adminmb', '9aYWRtaW5tYg==b9YWRtaW5tYg==81c=', 'mb', 11, '2015-07-20 08:00:50'),
('adminmb2', '9aQURNSU5NQjI=b9QURNSU5NQjI=81c=', 'mb', 11, '2015-07-20 08:43:56'),
('adminsa2', '9aQURNSU5TQTI=b9QURNSU5TQTI=81c=', 'sa', 11, '2015-07-20 08:51:39'),
('adminsm', '9aYWRtaW5zbQ==b9YWRtaW5zbQ==81c=', 'sm', 11, '2015-07-20 08:08:12'),
('adminsm1', '9aYWRtaW5zbTE=b9YWRtaW5zbTE=81c=', 'sm', 11, '2015-07-20 08:05:55'),
('adminsm2', '9aYWRtaW5zbTI=b9YWRtaW5zbTI=81c=', 'sm', 11, '2015-07-20 08:10:25'),
('adminsm3', '9aYWRtaW5zbTM=b9YWRtaW5zbTM=81c=', 'sm', 11, '2015-07-20 08:32:09'),
('adminsm4', '9aYWRtaW5zbTQ=b9YWRtaW5zbTQ=81c=', 'sm', 11, '2015-07-20 08:41:54'),
('primprai', '9aYWRtaW4=b9YWRtaW4=81c=', 'sm', 11, '2015-08-05 03:32:41');
-- --------------------------------------------------------
--
-- Table structure for table `usergroup`
--
CREATE TABLE IF NOT EXISTS `usergroup` (
`usergroup_id` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`usergroup_th` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`usergroup_en` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `usergroup`
--
INSERT INTO `usergroup` (`usergroup_id`, `usergroup_th`, `usergroup_en`) VALUES
('am', 'ผู้บริหาร', 'Administrator'),
('fn', 'ผู้ดูแลการเงิน', 'Finance Administrator'),
('mb', 'ผู้ดูแลข้อมูลสมาชิก', 'Member Admin'),
('sa', 'ผู้ดูระบบ', 'System Admin'),
('sm', 'ผู้ให้การอบรม', 'Trainer');
-- --------------------------------------------------------
--
-- Table structure for table `userpro`
--
CREATE TABLE IF NOT EXISTS `userpro` (
`user_id` varchar(31) COLLATE utf8_unicode_ci NOT NULL,
`user_nametitle` tinyint(2) NOT NULL,
`user_fname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`user_lname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`user_cnumber` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
`user_email` varchar(127) COLLATE utf8_unicode_ci NOT NULL,
`user_birthday` date NOT NULL,
`user_address` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `userpro`
--
INSERT INTO `userpro` (`user_id`, `user_nametitle`, `user_fname`, `user_lname`, `user_cnumber`, `user_email`, `user_birthday`, `user_address`) VALUES
('admin', 1, 'อานนท์', 'มะโนสกุล', '0830160704', 'kimarnon@aol.com', '1991-03-02', '148/1 ม.1 ตำบลบ้านโฮ่ง อำเภอบ้านโฮ่ง จังหวัดลำพูน 51130'),
('adminam', 1, 'พิชญ์พงศ์', 'วิมลรัชตาภรณ์ ', '0823459338', 'grilook@gmail.com', '1975-07-18', '88 ถนนวัดโพธิ์ ซอย9 ตำบลตลาด อำเภอเมืองฯ จังหวัดสุราษฎร์ธานี 84000'),
('adminfn', 2, 'ปุษยา', 'แก้วจันทร์', '0829399302', 'punipun@live.com', '1989-11-17', '529/1 ซ.ไสวสุวรรณ ถ.กรุงเทพฯ-นนท์ บางซื่อ กรุงเทพฯ 10800'),
('adminfn2', 3, 'สนัสตญา', 'แก้วผงศาอง', '0983494493', 'sunantaya19@gmail.com', '1987-08-11', '68 หมู่ 3 ต.ป่าแดง อ.เมือง จ.แพร่ 54000'),
('adminfn3', 3, 'พวงพลอย', 'เล็กศิริ', '0995394332', 'ployavalo@gmail.com', '2005-10-07', '71/44 ม.3 ต.ท่ามะกา อ. ท่ามะกา จ.กาญจนบุรี 71120'),
('adminmb', 2, 'กนกกาญจน์', 'ปัญสกุล', '0851718482', 'kitapun90@gmail.com', '1986-08-06', '72/7 ม.11 ต.บ้านเลน อ.บางปะอิน จ.พระนครศรีอยุธยา 13160'),
('adminmb2', 3, 'ประภาพร', 'พรหมเกษ', '0993824722', 'pamkalo@gmail.com', '1989-10-11', '499/11 หมู่ 12 อุดมสุข 42 สุขุมวิท 103 บางนา กรุงเทพ 10260'),
('adminsa2', 1, 'อานน', 'มะโนสกุล', '0830160704', 'kimarnon@aol.com', '1991-03-02', 'เชียงใหม่'),
('adminsm', 1, 'ปัถยา', 'รุจิแสวง', '0924855843', 'kidmanodi@hotmail.com', '1985-10-27', 'ม.2 ต.ห้วยทราย อ.สันกำแพง จ.เชียงใหม่ 50130'),
('adminsm1', 2, 'ปีย์วรา', 'จันกานต์', '0929933998', 'peevara@aol.com', '1981-07-09', '188 ถ.หลวงแพ่ง แขวงขุมทอง เขตลาดกระบัง กรุงเทพมหานคร 10520'),
('adminsm2', 2, 'กิตติยา', 'ไชยวรรณ์', '0838947753', 'kitiya43@gmail.com', '1990-10-10', '43 ม.4 ต.โคกโคเฒ่า อ.เมือง จ.สุพรรณบุรี 72000'),
('adminsm3', 2, 'วิญาณี', 'คำแก้วค่ำ', '0983384733', 'viyanee@hotmail.com', '1986-12-06', '99/37 ม.8 ต. เขาคันทรง อ. ศรีราชา จ.ชลบุรี 20110'),
('adminsm4', 1, 'ทักษินันท์', 'มะโนเพชร', '039483722', 'tikoonsawan@gmail.com', '1984-09-27', '49/84 ม.4 ต.เสาธงหิน อ.บางใหญ่ จ.นนทบุรี 11140 '),
('primprai', 2, 'พริ้มไพร', 'วงค์ชมพู', '0888888888', '8888@gmail.com', '2000-08-05', 'เชียงใหม่');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `balance`
--
ALTER TABLE `balance`
ADD PRIMARY KEY (`balance_id`);
--
-- Indexes for table `course`
--
ALTER TABLE `course`
ADD PRIMARY KEY (`course_id`);
--
-- Indexes for table `coursedetail`
--
ALTER TABLE `coursedetail`
ADD PRIMARY KEY (`course_detail_id`);
--
-- Indexes for table `courseregis`
--
ALTER TABLE `courseregis`
ADD PRIMARY KEY (`regis_id`);
--
-- Indexes for table `donation`
--
ALTER TABLE `donation`
ADD PRIMARY KEY (`donation_id`);
--
-- Indexes for table `donationtype`
--
ALTER TABLE `donationtype`
ADD PRIMARY KEY (`dtype_id`);
--
-- Indexes for table `expenses`
--
ALTER TABLE `expenses`
ADD PRIMARY KEY (`expenses_id`);
--
-- Indexes for table `expensestype`
--
ALTER TABLE `expensestype`
ADD PRIMARY KEY (`etype_id`);
--
-- Indexes for table `member`
--
ALTER TABLE `member`
ADD PRIMARY KEY (`member_id`);
--
-- Indexes for table `trained`
--
ALTER TABLE `trained`
ADD PRIMARY KEY (`register_id`);
--
-- Indexes for table `trainer`
--
ALTER TABLE `trainer`
ADD PRIMARY KEY (`trainer_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `usergroup`
--
ALTER TABLE `usergroup`
ADD PRIMARY KEY (`usergroup_id`);
--
-- Indexes for table `userpro`
--
ALTER TABLE `userpro`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `balance`
--
ALTER TABLE `balance`
MODIFY `balance_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=60;
--
-- AUTO_INCREMENT for table `courseregis`
--
ALTER TABLE `courseregis`
MODIFY `regis_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=59;
--
-- AUTO_INCREMENT for table `donation`
--
ALTER TABLE `donation`
MODIFY `donation_id` int(6) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=125;
--
-- AUTO_INCREMENT for table `donationtype`
--
ALTER TABLE `donationtype`
MODIFY `dtype_id` tinyint(2) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `expenses`
--
ALTER TABLE `expenses`
MODIFY `expenses_id` int(6) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=136;
--
-- AUTO_INCREMENT for table `expensestype`
--
ALTER TABLE `expensestype`
MODIFY `etype_id` tinyint(2) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `member`
--
ALTER TABLE `member`
MODIFY `member_id` int(5) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=25;
/*!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 access_site (user_oid,site_id,wzde_write,wzde_publish,wzde_commit,wzde_read,wzde_checkout,wzde_git)
VALUES |
-- MySQL dump 10.13 Distrib 5.7.25, for Linux (x86_64)
--
-- Host: localhost Database: mumsched
-- ------------------------------------------------------
-- Server version 5.7.25-0ubuntu0.18.10.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `courses`
--
DROP TABLE IF EXISTS `courses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `courses` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `courses`
--
LOCK TABLES `courses` WRITE;
/*!40000 ALTER TABLE `courses` DISABLE KEYS */;
/*!40000 ALTER TABLE `courses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `faculty`
--
DROP TABLE IF EXISTS `faculty`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `faculty` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstName` varchar(200) DEFAULT NULL,
`lastName` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `faculty_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `faculty`
--
LOCK TABLES `faculty` WRITE;
/*!40000 ALTER TABLE `faculty` DISABLE KEYS */;
/*!40000 ALTER TABLE `faculty` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `student` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstName` varchar(200) DEFAULT NULL,
`lastName` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `student_id_uindex` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `student`
--
LOCK TABLES `student` WRITE;
/*!40000 ALTER TABLE `student` DISABLE KEYS */;
INSERT INTO `student` VALUES (1,'Jim','Ribeiro'),(2,'Adriano','Mara'),(3,'Moreno','Jan-Batiste'),(4,'Romel','Costa'),(5,'Tola','Tyler'),(6,'Manel','Miqueletti'),(7,'Thiago','Abreu');
/*!40000 ALTER TABLE `student` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-03-05 22:36:58
|
# change the p_value datatype from varchar to double in the variation_annotation table
ALTER TABLE variation_annotation CHANGE p_value p_value DOUBLE;
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL,'patch', 'patch_60_61_k.sql|change the p_value datatype from varchar to double in the variation_annotation table');
|
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: mall
-- ------------------------------------------------------
-- Server version 5.5.36-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `address`
--
DROP TABLE IF EXISTS `address`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`rec_user_name` varchar(45) DEFAULT NULL,
`rec_user_phone` varchar(45) DEFAULT NULL,
`rec_user_address` varchar(200) DEFAULT NULL,
`rec_user_area` varchar(45) DEFAULT NULL,
`is_default` int(11) DEFAULT NULL COMMENT '是否默认地址',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `address`
--
LOCK TABLES `address` WRITE;
/*!40000 ALTER TABLE `address` DISABLE KEYS */;
INSERT INTO `address` VALUES (1,1,'丁玉新','13241115252','北京朝阳区创业新区','天津市',0),(14,1,'丁玉新','13241115253','花家地北里','北京市',0),(17,1,'城小亮','15116323254','大兴','河北省',0);
/*!40000 ALTER TABLE `address` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `advert`
--
DROP TABLE IF EXISTS `advert`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `advert` (
`id` int(11) NOT NULL,
`name` varchar(45) DEFAULT NULL,
`image` varchar(400) DEFAULT NULL COMMENT '图片地址',
`toUrl` varchar(400) DEFAULT NULL COMMENT '地址',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `advert`
--
LOCK TABLES `advert` WRITE;
/*!40000 ALTER TABLE `advert` DISABLE KEYS */;
INSERT INTO `advert` VALUES (1,'a1','static/images/wap/wepbanner.jpg','http://quandashi.com'),(2,'a2','static/images/wepindividuality01.jpg','http://jd.com');
/*!40000 ALTER TABLE `advert` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `goods`
--
DROP TABLE IF EXISTS `goods`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`image` varchar(400) DEFAULT NULL,
`num` int(11) DEFAULT NULL,
`goodsNo` varchar(45) DEFAULT NULL COMMENT '商品编号',
`price` varchar(45) DEFAULT NULL,
`promotionPrice` varchar(45) DEFAULT NULL,
`descripe` varchar(400) DEFAULT NULL,
`isindex` int(11) NOT NULL DEFAULT '0' COMMENT '是否是首页商品1是0否',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `goods`
--
LOCK TABLES `goods` WRITE;
/*!40000 ALTER TABLE `goods` DISABLE KEYS */;
INSERT INTO `goods` VALUES (1,'麻糖','http://www.java1234.com/uploads/allimg/150616/1-15061610353M56.jpg',100,'86型插座5UB01081CC1','10.12','10','好吃不贵',0),(2,'西门子开关插座面板','static/images/wepindividuality01.jpg',100,'86型插座','55','50','西门子开关真是好',1),(3,'西门子开关插座面板','static/images/wepindividuality02.jpg',100,'85型插座','45','44.1','特别好',1);
/*!40000 ALTER TABLE `goods` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order`
--
DROP TABLE IF EXISTS `order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`orderCode` varchar(45) DEFAULT NULL,
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`userId` int(11) DEFAULT NULL,
`recUserName` varchar(45) DEFAULT NULL,
`recUserPhone` varchar(45) DEFAULT NULL,
`recUserAddress` varchar(45) DEFAULT NULL,
`goodsNum` int(11) DEFAULT NULL COMMENT '订单中商品的数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order`
--
LOCK TABLES `order` WRITE;
/*!40000 ALTER TABLE `order` DISABLE KEYS */;
INSERT INTO `order` VALUES (1,NULL,'2017-12-02 10:09:31',1,'丁玉新','13241115253','北京市朝阳区',NULL),(2,NULL,'2017-12-02 10:09:31',1,'丁玉新','13241115253','北京市朝阳区',NULL),(3,NULL,'2017-12-02 10:09:31',1,'丁玉新','13241115253','北京市朝阳区',NULL),(4,'77c868add21547a9b866cb3b3ebdd03c','2017-12-02 10:15:05',1,'丁玉新','13241115253','北京市朝阳区',NULL),(5,'ffd76f098aac42a9abb82e00d6ec2cd8','2017-12-02 10:20:01',1,'丁玉新','13241115253','北京市朝阳区',3);
/*!40000 ALTER TABLE `order` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `order_goods`
--
DROP TABLE IF EXISTS `order_goods`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `order_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`orderCode` varchar(45) DEFAULT NULL,
`goodsName` varchar(45) DEFAULT NULL,
`goodsImg` varchar(45) DEFAULT NULL,
`goodsPrice` varchar(45) DEFAULT NULL,
`goodsPromotionPrice` varchar(45) DEFAULT NULL,
`goodsId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `order_goods`
--
LOCK TABLES `order_goods` WRITE;
/*!40000 ALTER TABLE `order_goods` DISABLE KEYS */;
INSERT INTO `order_goods` VALUES (1,NULL,'开关',NULL,NULL,NULL,NULL),(2,NULL,'开关',NULL,NULL,NULL,NULL),(3,NULL,'开关2',NULL,NULL,NULL,NULL),(4,NULL,'开关2',NULL,NULL,NULL,NULL),(5,NULL,'开关',NULL,NULL,NULL,NULL),(6,NULL,'开关2',NULL,NULL,NULL,NULL),(7,NULL,'开关2',NULL,NULL,NULL,NULL),(8,NULL,'开关',NULL,NULL,NULL,NULL),(9,NULL,'开关2',NULL,NULL,NULL,NULL),(10,NULL,'开关2',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `order_goods` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`usercol` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'dingyuxin',NULL);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-12-02 19:18:28
|
-- aas-calc.sql
-- calculate AAS from AWR
@clear_for_spool
set term off
spool aas-calc.csv
prompt begin_time,end_time,instance_number,elapsed_seconds,AAS
with data as (
-- the values seen in dba_hist_sysmetric_history for AAS are at times suspiciously very high
-- now calculating them from dba_hist_sysmetric_history
-- doing so may take a few minutes - 5 minutes observed on a db with AWR retentionn of 30 days
-- this was a server with 4T RAM and 80 cores.
select begin_time,end_time,instance_number,elapsed_seconds,AAS
from (
select
to_char(begin_interval_time,'yyyy-mm-dd hh24:mi:ss') begin_time
, to_char(end_interval_time,'yyyy-mm-dd hh24:mi:ss') end_time
, instance_number
, elapsed_seconds
, round(db_time / elapsed_seconds,1) aas
from (
select distinct h.snap_id
, h.instance_number
, h.dbid
, s.begin_interval_time
, s.end_interval_time
, count(*) over (partition by h.snap_id, h.instance_number) * 10 db_time
, (extract( day from (s.end_interval_time - s.begin_interval_time) )*24*60*60)+
(extract( hour from (s.end_interval_time - s.begin_interval_time) )*60*60)+
(extract( minute from (s.end_interval_time - s.begin_interval_time) )*60)+
(extract( second from (s.end_interval_time - s.begin_interval_time)))
elapsed_seconds
from dba_hist_active_sess_history h
join dba_hist_snapshot s on s.snap_id = h.snap_id
and s.instance_number = h.instance_number
where (
( h.session_state = 'WAITING' and h.wait_class not in ('Idle') )
or
h.session_state = 'ON CPU'
)
--and rownum <= 200
)
order by 2 desc
)
)
select
begin_time
|| ',' || end_time
|| ',' || instance_number
|| ',' || elapsed_seconds
|| ',' || aas
from data
order by begin_time, instance_number
--where rownum <= 20
/
spool off
set term on
@clears
prompt
prompt results are in aas-calc.csv
prompt
|
SELECT -- REGF 登記主檔-外國人地權登記統計檔 (SREGF)
MOICAD.REGF.RF03 AS "收件年",
MOICAD.REGF.RF04_1 AS "收件字",
MOICAD.REGF.RF04_2 AS "收件號",
MOICAD.REGF.RF40 AS "註記日期",
MOICAD.REGF.ITEM AS "項目代碼",
MOICAD.REGF.RECA AS "土地筆數",
MOICAD.REGF.RF10 AS "土地面積",
MOICAD.REGF.RECD AS "建物筆數",
MOICAD.REGF.RF08 AS "建物面積",
MOICAD.REGF.RE46 AS "鄉鎮市區代碼"
FROM MOICAD.REGF
WHERE MOICAD.REGF.RF40 LIKE '10904%'
-- RAW
--SELECT MOICAD.REGF.*
--FROM MOICAD.REGF
--WHERE (((MOICAD.REGF.RF40) Between '1080801' And '1080831')) |
INSERT INTO core_site(
id,sitename,maincontrollername)
VALUES (1,'vasilopoulos.b2badmin.org','b2b');
update core_site set myid=id;
|
INSERT INTO burgers(burger_name)
values
("The Classic"),
("Double Cheese Burger"),
("Double Bacon Cheese Burger"),
("Veggy Edgy Burger"),
("Aubergine and Aioli Burger"); |
INSERT INTO course_info
(cid,c_name,introduce)
VALUES
('GZYW001','高一语文(上)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW002','高一语文(下)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW003','高二语文(上)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW004','高二语文(下)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW005','高三语文(上)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW006','高三语文(下)','曾经的辉煌,如今的随波逐流,起伏不定'),
('GZYW0107','高3语文文科班(上)','仅文科班读'),
('GZYW0108','高3语文文科班(下)','仅文科班读'),
('GZSX0201','高1数学(上)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0202','高1数学(下)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0203','高2数学(上)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0204','高2数学(下)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0205','高3数学(上)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0206','高3数学(下)','随随便便,轻轻松松,不费吹灰之力'),
('GZSX0207','高3数学理科班(上)','仅理科班读'),
('GZSX0208','高3数学理科班(下)','仅理科班读'),
('GZYY0301','高1英语(上)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0302','高1英语(下)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0303','高2英语(上)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0304','高2英语(下)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0305','高3英语(上)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0306','高3英语(下)','犹如一颗深水炸弹,太难了,真的太难了'),
('GZYY0307','高3英语文科班(上)','仅文科班读'),
('GZYY0308','高3英语文科班(下)','仅文科班读');
|
SET FOREIGN_KEY_CHECKS=0;
/*
Renombrar campos
articulos.fecha_creado -> fecha
articulos_categorias.requierens -> seguimiento
tickets.fecha_ingreso -> fecha
*/
/* Renombrar tablas
alicuotas -> impu_alicuotas
chequeras -> bancos_chequeras
ciudades -> localidades
conceptos -> cajas_conceptos
documentos_tipos -> docu_tipos
marcas -> articulos_marcas
margenes -> articulos_margenes
pvs -> comprob_pvs
situaciones -> impu_situaciones
talonarios -> comprob_talonarios
tipo_doc -> personas_tipodoc
tickets* -> tareas*
sys_plantillas -> docu_plantillas
tarjetas_planes -> formaspago_planes
tarjetas_cupones -> formaspago_cupones
*/
SET FOREIGN_KEY_CHECKS=1;
|
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "26", "2021-08-09 16:16:48");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:16:48");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "26", "25", "2021-08-09 16:16:48", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("24", "26", "NXV1VBP9", "VGxoV01WWkNVRGs9", "I", "2021-08-09 16:16:48");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "24", "0", "27.97", "4", "2021-08-09 16:16:48", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("12", "2021-08-09 16:16:48", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "27", "2021-08-09 16:19:13");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:19:13");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "28", "2021-08-09 16:19:38");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:19:38");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "28", "27", "2021-08-09 16:19:38", "2021-09-09");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "29", "2021-08-09 16:19:49");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:19:49");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "29", "28", "2021-08-09 16:19:49", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("26", "29", "UFN8ZJJ0", "VlVaT09GcEtTakE9", "I", "2021-08-09 16:19:49");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "30", "2021-08-09 16:22:47");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:22:47");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "30", "29", "2021-08-09 16:22:47", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("27", "30", "KNG1UMD7", "UzA1SE1WVk5SRGM9", "I", "2021-08-09 16:22:47");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "31", "2021-08-09 16:23:23");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:23:23");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "31", "30", "2021-08-09 16:23:23", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("28", "31", "SJN4CIK9", "VTBwT05FTkpTems9", "I", "2021-08-09 16:23:23");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "28", "0", "27.97", "4", "2021-08-09 16:23:23", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("13", "2021-08-09 16:23:23", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "32", "2021-08-09 16:28:15");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:28:15");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "32", "31", "2021-08-09 16:28:15", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("29", "32", "CVZ9ULN8", "UTFaYU9WVk1Uamc9", "I", "2021-08-09 16:28:15");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "33", "2021-08-09 16:28:44");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:28:44");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "33", "32", "2021-08-09 16:28:44", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("30", "33", "WVS9ETH3", "VjFaVE9VVlVTRE09", "I", "2021-08-09 16:28:44");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "30", "0", "27.97", "4", "2021-08-09 16:28:44", "2021-09-09");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "34", "2021-08-09 16:29:15");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:29:15");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "34", "33", "2021-08-09 16:29:15", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("31", "34", "JKE2SGI2", "U2t0Rk1sTkhTVEk9", "I", "2021-08-09 16:29:15");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "31", "0", "27.97", "4", "2021-08-09 16:29:15", "2021-09-09");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "35", "2021-08-09 16:29:30");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:29:30");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "35", "34", "2021-08-09 16:29:30", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("32", "35", "XLD4HYK1", "V0V4RU5FaFpTekU9", "I", "2021-08-09 16:29:30");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "32", "0", "27.97", "4", "2021-08-09 16:29:30", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("16", "2021-08-09 16:29:30", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "36", "2021-08-09 16:29:44");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:29:44");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "36", "35", "2021-08-09 16:29:44", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("33", "36", "CTG0IQI2", "UTFSSE1FbFJTVEk9", "I", "2021-08-09 16:29:44");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "33", "0", "27.97", "4", "2021-08-09 16:29:44", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("17", "2021-08-09 16:29:44", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "37", "2021-08-09 16:29:56");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:29:56");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "37", "36", "2021-08-09 16:29:56", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("34", "37", "SJV5AHG8", "VTBwV05VRklSemc9", "I", "2021-08-09 16:29:56");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "34", "0", "27.97", "4", "2021-08-09 16:29:56", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("18", "2021-08-09 16:29:56", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "38", "2021-08-09 16:30:38");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:30:38");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "38", "37", "2021-08-09 16:30:38", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("35", "38", "RLN9CET6", "VWt4T09VTkZWRFk9", "I", "2021-08-09 16:30:38");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "35", "0", "27.97", "4", "2021-08-09 16:30:38", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("19", "2021-08-09 16:30:38", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "39", "2021-08-09 16:30:52");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:30:52");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "39", "38", "2021-08-09 16:30:52", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("36", "39", "AVO9IJY7", "UVZaUE9VbEtXVGM9", "I", "2021-08-09 16:30:52");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "36", "0", "27.97", "4", "2021-08-09 16:30:52", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("20", "2021-08-09 16:30:52", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "40", "2021-08-09 16:31:13");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:31:13");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "40", "39", "2021-08-09 16:31:13", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("37", "40", "ZFL8GDR6", "V2taTU9FZEVValk9", "I", "2021-08-09 16:31:13");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "37", "0", "27.97", "4", "2021-08-09 16:31:13", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("21", "2021-08-09 16:31:13", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "41", "2021-08-09 16:32:04");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:32:04");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "41", "40", "2021-08-09 16:32:04", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("38", "41", "ABJ6FYX6", "UVVKS05rWlpXRFk9", "I", "2021-08-09 16:32:04");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "38", "0", "27.97", "4", "2021-08-09 16:32:04", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("22", "2021-08-09 16:32:04", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "42", "2021-08-09 16:33:20");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:33:20");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "42", "41", "2021-08-09 16:33:20", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("39", "42", "ZPU8TPB7", "V2xCVk9GUlFRamM9", "I", "2021-08-09 16:33:20");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "39", "0", "27.97", "4", "2021-08-09 16:33:20", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("23", "2021-08-09 16:33:20", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "43", "2021-08-09 16:33:58");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:33:58");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "43", "42", "2021-08-09 16:33:58", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("40", "43", "FLR9OKS6", "Umt4U09VOUxVelk9", "I", "2021-08-09 16:33:58");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "40", "0", "27.97", "4", "2021-08-09 16:33:58", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("24", "2021-08-09 16:33:58", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "0");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "44", "2021-08-09 16:44:30");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:44:30");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "44", "43", "2021-08-09 16:44:30", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("41", "44", "PPT5OEO5", "VUZCVU5VOUZUelU9", "I", "2021-08-09 16:44:30");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "41", "0", "27.97", "4", "2021-08-09 16:44:30", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("25", "2021-08-09 16:44:30", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "1");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "61993223355");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue", "45", "2021-08-09 16:45:01");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 16:45:01");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "45", "44", "2021-08-09 16:45:01", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("42", "45", "NQF2FRS1", "VGxGR01rWlNVekU9", "I", "2021-08-09 16:45:01");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "42", "0", "27.97", "4", "2021-08-09 16:45:01", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("26", "2021-08-09 16:45:01", "Inicia o pagamento", "Barbecue Iniciou o pagamento", "1");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "67778338883");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Barbecue novo", "46", "2021-08-09 17:10:05");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Barbearia top 10", "2021-08-09 17:10:05");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "46", "45", "2021-08-09 17:10:05", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("43", "46", "KLG3JFF9", "UzB4SE0wcEdSams9", "I", "2021-08-09 17:10:05");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "43", "0", "27.97", "4", "2021-08-09 17:10:05", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("27", "2021-08-09 17:10:05", "Inicia o pagamento", "Barbecue novo Iniciou o pagamento", "1");
INSERT INTO sisbela100.TB_USUARIO_PERFIL (co_perfil, co_usuario) VALUES ("2", "43");
INSERT INTO sisbela100.TB_CONTATO (ds_email, nu_tel1) VALUES ("barbecue@gmail.com", "23456786655");
INSERT INTO sisbela100.TB_PESSOA (no_pessoa, co_contato, dt_cadastro) VALUES ("Marcio Braga", "47", "2021-08-09 17:14:03");
INSERT INTO sisbela100.TB_EMPRESA (no_fantasia, dt_cadastro) VALUES ("Salão novo Stylo", "2021-08-09 17:14:03");
INSERT INTO TB_ASSINANTE (tp_assinante, co_pessoa, co_empresa, dt_cadastro, dt_expiracao) VALUES ("M", "47", "46", "2021-08-09 17:14:03", "2021-09-09");
INSERT INTO sisbela100.TB_USUARIO (co_assinante, co_pessoa, ds_senha, ds_code, st_status, dt_cadastro) VALUES ("44", "47", "PYE3KGD5", "VUZsRk0wdEhSRFU9", "I", "2021-08-09 17:14:03");
INSERT INTO TB_PLANO_ASSINANTE_ASSINATURA (co_plano_assinante, co_assinante, nu_filiais, nu_valor_assinatura, tp_pagamento, dt_cadastro, dt_expiracao) VALUES ("13", "44", "0", "27.97", "4", "2021-08-09 17:14:03", "2021-09-09");
INSERT INTO TB_HISTORICO_PAG_ASSINATURA (co_plano_assinante_assinatura, dt_cadastro, ds_acao, ds_usuario, st_pagamento) VALUES ("28", "2021-08-09 17:14:03", "Inicia o pagamento", "Marcio Braga Iniciou o pagamento", "1");
INSERT INTO sisbela100.TB_USUARIO_PERFIL (co_perfil, co_usuario) VALUES ("2", "44");
|
insert into employee_dtl (id, name, email) values ('1478ef23-16a3-4265-83d7-92076fa08ef2', 'siva', 'dummy1@nodomain.com');
insert into employee_dtl (id, name, email) values ('c9ac1e2c-cfdd-4719-ba94-c126d57dc035', 'prasad', 'dummy2@nodomain.com');
insert into employee_dtl (id, name, email) values ('5aa45a97-f363-490f-959d-43b633913dd6', 'somarouthu', 'dummy3@nodomain.com');
INSERT INTO users (username, password, enabled) values ('user','pass',true);
INSERT INTO users (username, password, enabled) values ('admin','pass',true);
INSERT INTO authorities (username,authority) values ('user','ROLE_USER');
INSERT INTO authorities (username,authority) values ('admin','ROLE_ADMIN');
INSERT INTO app_users (username, password, enabled, roles) values ('user','pass',true, 'ROLE_USER');
INSERT INTO app_users (username, password, enabled, roles) values ('admin','pass',true, 'ROLE_USER,ROLE_ADMIN'); |
-- SPATIAL QUERIES 02
-- Creating a view with geometries
CREATE OR REPLACE VIEW worlddata.caribe_ct_geom AS
SELECT name, pop_est, geom
FROM worlddata.ne_10m_admin_0_countries
WHERE subregion = 'Caribbean' AND pop_est > 1000000;
/* Reprojecting layer to UTMz29 projection(same Geodetic Reference System: WGS84)
Important: explicit cast to register geometry in geometry_columns
and indexing geometries with GIST index
*/
CREATE TABLE worlddata.morocco_bdr AS
SELECT id, name, ST_Transform(geom, 32629)::geometry(MultiPolygon, 32629) AS geom
FROM worlddata.ne_10m_admin_0_countries
WHERE name = 'Morocco';
CREATE INDEX morocco_bdr_gist
ON worlddata.morocco_bdr USING GIST (geom);
--Spatial relations
CREATE TABLE worlddata.morocco_rivers AS
SELECT rv.id, rv.name, ST_Transform(rv.geom, 32629)::geometry(Multilinestring, 32629) AS geom
FROM worlddata.ne_10m_admin_0_countries AS wc, worlddata.ne_10m_rivers_lake_centerlines AS rv
WHERE ST_Intersects(rv.geom, wc.geom) AND wc.name = 'Morocco';
CREATE INDEX morocco_rivers_gist
ON worlddata.morocco_rivers USING GIST (geom);
|
UPDATE AD_PRINTFORMATITEM_TRL
SET PrintName = (SELECT e.PrintName
FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM pfi
WHERE e.AD_LANGUAGE=AD_PRINTFORMATITEM_TRL.AD_LANGUAGE
AND e.AD_Element_ID=c.AD_Element_ID
AND c.AD_Column_ID=pfi.AD_Column_ID
AND pfi.AD_PrintFormatItem_ID=AD_PRINTFORMATITEM_TRL.AD_PrintFormatItem_ID
)
WHERE EXISTS (SELECT 1
FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM pfi, AD_PRINTFORMAT pf
WHERE e.AD_LANGUAGE=AD_PRINTFORMATITEM_TRL.AD_LANGUAGE
AND e.AD_Element_ID=c.AD_Element_ID
AND c.AD_Column_ID=pfi.AD_Column_ID
AND pfi.AD_PrintFormatItem_ID=AD_PRINTFORMATITEM_TRL.AD_PrintFormatItem_ID
AND pfi.IsCentrallyMaintained='Y'
AND LENGTH(pfi.PrintName) > 0
AND (e.PrintName<>AD_PRINTFORMATITEM_TRL.PrintName
OR AD_PRINTFORMATITEM_TRL.PrintName IS NULL)
AND pf.AD_PrintFormat_ID=pfi.AD_PrintFormat_ID
) |
CREATE TABLE PRODUCTS
(
id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL,
name VARCHAR(255) NOT NULL,
current_price DECIMAL(19, 2) NOT NULL,
last_update TIMESTAMP
); |
CREATE TABLE profissional (
id BIGINT(20) NOT NULL AUTO_INCREMENT,
nome VARCHAR(45) NOT NULL,
rg VARCHAR(12) NOT NULL,
cpf VARCHAR(12) NOT NULL,
email VARCHAR(50) NOT NULL,
telefone VARCHAR(20) NOT NULL,
celular VARCHAR(20) NOT NULL,
logradouro VARCHAR(50) NOT NULL,
numero VARCHAR(6) NOT NULL,
complemento VARCHAR(30),
cidade VARCHAR(25) NOT NULL,
estado VARCHAR(20) NOT NULL,
cep VARCHAR(10) NOT NULL,
PRIMARY KEY (id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(1, 'Andressa Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(2, 'Mariana Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(3, 'Bruna Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(4, 'Fernanda Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(5, 'Giovanna Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(6, 'Maria Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(7, 'Flávia Cristina', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(8, 'Paulo Augusto', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(9, 'Marcos Fernando', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
INSERT INTO profissional(id, nome, rg, cpf, email, telefone, celular , logradouro, numero, complemento, cidade, estado, cep)
VALUES(10, 'Luiz Ricardo', '490974633', '42265878438', 'andressacristina@hotmail.com', '1186788484', '2347877878', 'Rua Mario Trenti', '120', NULL, 'Campinas', 'São Paulo', '13032788');
|
DROP TABLE IF EXISTS `welcome_messages`;
CREATE TABLE `welcome_messages`
(
`id` bigint(20) NOT NULL,
`guild_id` bigint(20) NOT NULL,
`image_url` varchar(255) NOT NULL,
`message` varchar(2048) NOT NULL,
PRIMARY KEY (`id`, `guild_id`)
);
CREATE SEQUENCE `welcome_message_seq`
|
CREATE TABLE truck_speed_events (
eventTime STRING,
eventTimeLong BIGINT,
eventSource STRING,
truckId INT,
driverId INT,
driverName STRING,
routeId INT,
route STRING,
speed INT,
event_time AS CAST(from_unixtime(floor(eventTimeLong/1000)) AS TIMESTAMP(3)),
WATERMARK FOR event_time AS event_time - INTERVAL '5' SECOND
) WITH (
'connector.type' = 'kafka',
'connector.version' = 'universal',
'connector.topic' = 'syndicate-speed-event-json',
'connector.startup-mode' = 'latest-offset',
'connector.properties.bootstrap.servers' = 'kafka-broker-1:9092',
'connector.properties.group.id' = 'flink-sql-truck-speed-consumer',
'format.type' = 'json'
);
|
/* Auto Generated Sql File By VBA */
create table user_table(
_id integer primary key autoincrement,
device_id text unique not null,
account_id text unique not null,
hashed_password text not null,
name text not null,
icon text default null,
title_id integer default null,
prefix_id integer default null,
param_study integer default 0,
param_exercise integer default 0,
param_communication integer default 0,
param_fashion integer default 0,
param_society integer default 0,
param_art integer default 0,
param_level integer default 0,
);
create table title_table(
_id integer primary key autoincrement,
name text ,
icon text );
create table prefix_table(
_id integer primary key autoincrement,
name text );
create table friends_tabel(
_id integer primary key autoincrement,
user_id1 integer not null,
user_id2 integer not null);
create table released_title_table(
_id integer primary key autoincrement,
user_id integer not null,
title_id integer not null);
create table released_prefix_table(
_id integer primary key autoincrement,
user_id integer not null,
prefix_id integer not null);
create table activity_table(
_id integer primary key autoincrement,
content text ,
user_id integer ,
time_stamp integer ,
duration integer ,
date integer ,
category_id integer ,
tag_id integer ,
std_inc integer default 0,
exe_inc integer default 0,
com_inc integer default 0,
fas_inc integer default 0,
soc_inc integer default 0,
art_inc integer default 0);
create table cooperation_table(
_id integer primary key autoincrement,
activity_id1 integer not null,
activity_id2 integer not null);
create table quest_table(
_id integer primary key autoincrement,
user_id integer not null,
quest_id integer not null);
create table friend_table(
_id integer primary key autoincrement,
user1_id integer not null,
user2_id integer not null,
state integer not null);
|
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 21-03-2017 a las 01:02:08
-- Versión del servidor: 5.5.16
-- Versión de PHP: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de datos: `asclepios`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `citas`
--
CREATE TABLE IF NOT EXISTS `citas` (
`id_cita` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_especialidad` int(10) unsigned NOT NULL,
`id_paciente` int(10) unsigned NOT NULL,
`Fecha` date NOT NULL,
`Hora` time NOT NULL,
`Medico` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`Motivo` text COLLATE utf8mb4_spanish2_ci NOT NULL,
`diagnostico` text COLLATE utf8mb4_spanish2_ci,
`prescripcion` text COLLATE utf8mb4_spanish2_ci,
`creado_en` datetime NOT NULL,
`modificado_en` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_cita`),
KEY `id_especialidad` (`id_especialidad`,`id_paciente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish2_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `especialidades`
--
CREATE TABLE IF NOT EXISTS `especialidades` (
`id_especialidad` int(11) unsigned NOT NULL AUTO_INCREMENT,
`especialidad` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
PRIMARY KEY (`id_especialidad`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish2_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pacientes`
--
CREATE TABLE IF NOT EXISTS `pacientes` (
`id_paciente` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_seguro` int(10) unsigned NOT NULL,
`seguro_numero` varchar(128) COLLATE utf8mb4_spanish2_ci NOT NULL,
`seguro_regimen` varchar(128) COLLATE utf8mb4_spanish2_ci NOT NULL,
`cedula` varchar(128) COLLATE utf8mb4_spanish2_ci NOT NULL,
`nombre` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`telefono` varchar(24) COLLATE utf8mb4_spanish2_ci NOT NULL,
`movil` varchar(24) COLLATE utf8mb4_spanish2_ci NOT NULL,
`whatsapp` tinyint(1) NOT NULL,
`email` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`direccion` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`id_provincia` int(11) NOT NULL,
`id_municipio` int(11) NOT NULL,
`creado_en` datetime NOT NULL,
`modificado_en` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_paciente`),
KEY `id_seguro` (`id_seguro`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish2_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `seguros`
--
CREATE TABLE IF NOT EXISTS `seguros` (
`id_seguro` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ARS` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
PRIMARY KEY (`id_seguro`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish2_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuarios`
--
CREATE TABLE IF NOT EXISTS `usuarios` (
`id_usuario` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nombre` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`usuario` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`pass` varchar(255) COLLATE utf8mb4_spanish2_ci NOT NULL,
`rol` tinyint(4) NOT NULL,
`activo` tinyint(1) NOT NULL,
`creado_en` datetime NOT NULL,
`modificado_en` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_usuario`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_spanish2_ci AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- Ejercicio GROUP BY
USE Escuela;
SELECT A.AlumnoID, A.Nombre, A.Apellido, A.Edad, A.Sexo, A.Direccion,
COUNT(I.AlumnoID) AS ClasesMatriculadas
FROM Alumno A
INNER JOIN Inscripcion I ON A.AlumnoID = I.AlumnoID
GROUP BY A.AlumnoID, A.Nombre, A.Apellido, A.Edad, A.Sexo, A.Direccion;
-- Subconsultas
SELECT A.AlumnoID, A.Nombre, A.Apellido, A.Sexo, A.Direccion,
(SELECT COUNT(*) FROM Inscripcion I WHERE I.AlumnoID = A.AlumnoID)
FROM Alumno A;
SELECT A.AlumnoID, A.Nombre, A.Apellido, A.Sexo, A.Direccion,
(SELECT SUM(I.InscripcionID) FROM Inscripcion I WHERE I.AlumnoID = A.AlumnoID)
FROM Alumno A;
SELECT A.AlumnoID, A.Nombre, A.Apellido, A.Sexo, A.Direccion,
(SELECT COUNT(*) FROM Inscripcion I WHERE I.AlumnoID = A.AlumnoID) AS TotalClases,
(SELECT ISNULL(SUM(C.Precio), 0)
FROM Inscripcion I INNER JOIN Clase C ON I.ClaseID = C.ClaseID WHERE I.AlumnoID = A.AlumnoID)
FROM Alumno A;
-- Ejercicio final
CREATE VIEW vAlumnosMatriculados
AS
SELECT A.AlumnoID, A.Nombre, A.Apellido, A.Sexo, A.Direccion,
(SELECT COUNT(*) FROM Inscripcion I WHERE I.AlumnoID = A.AlumnoID) AS TotalClases,
(SELECT ISNULL(SUM(C.Precio), 0)
FROM Inscripcion I INNER JOIN Clase C ON I.ClaseID = C.ClaseID
WHERE I.AlumnoID = A.AlumnoID) AS SumaTotal,
(SELECT ISNULL(AVG(C.Precio), 0)
FROM Inscripcion I INNER JOIN Clase C ON I.ClaseID = C.ClaseID
WHERE I.AlumnoID = A.AlumnoID) AS PromedioPorClase
FROM Alumno A;
INSERT INTO Inscripcion(Fecha, ClaseID, AlumnoID, MaestroID, Hora)
VALUES(GETDATE(), 7, 3, 3, '1400');
SELECT * FROM vAlumnosMatriculados; |
INSERT INTO burgers (name) VALUES ('Spinach & Feta');
INSERT INTO burgers (name) VALUES ('Mushrooms');
INSERT INTO burgers (name)VALUES ('Veggie');
INSERT INTO burgers (name) VALUES('Bacon Cheddar');
INSERT INTO burgers (name) VALUES ('Pickles');
|
#pvp rank R10
update item_template set requiredhonorrank = 0 where requiredhonorrank > 0 and requiredhonorrank < 15;
UPDATE item_template SET requiredhonorrank = 6 WHERE requiredhonorrank = 16;
UPDATE item_template SET requiredhonorrank = 7 WHERE requiredhonorrank = 17;
#bg
UPDATE battleground_template SET MinPlayersPerTeam = 1;
#gm command
UPDATE command SET SECURITY = 2 WHERE SECURITY = 1;
UPDATE command SET SECURITY = 1 WHERE NAME IN ('additem','announce','gm','go','goname','maxskill','revive','kick','namego','modify money','levelup','learn');
##bg medical
UPDATE creature_template SET FactionAlliance = 35, FactionHorde = 35 WHERE Entry = 13116;
UPDATE creature_template SET FactionAlliance = 35, FactionHorde = 35 WHERE Entry = 13117; |
create table Items (
ItemID varchar(10) not null,
Name varchar(200) not null,
Currently decimal(8,2) not null,
Buy_Price decimal(8,2),
First_Bid decimal(8,2) not null,
Number_of_Bids int not null,
Location varchar(50) not null,
Country varchar(20) not null,
Latitude decimal(9,6),
Longitude decimal(9,6),
Started timestamp not null,
Ends timestamp not null,
UserID varchar(30) not null,
Description varchar(4000) not null,
primary key (ItemID)
);
create table ItemCategory (
ItemID varchar(10) not null,
Category varchar(40) not null,
primary key (ItemID, Category)
);
create table Sellers (
UserID varchar(30) not null,
SellerRating int not null,
primary key (UserID)
);
create table Bidders (
UserID varchar(30) not null,
BidderRating int not null,
Location varchar(50),
Country varchar(20),
primary key (UserID)
);
create table Bids (
ItemID varchar(10) not null,
UserID varchar(30) not null,
Time timestamp not null,
Amount decimal(8,2) not null,
primary key (ItemID, UserID, Time)
);
|
DROP DATABASE OKATTER;
CREATE DATABASE OKATTER;
DROP USER IF EXISTS 'okatter-user'@'localhost';
CREATE USER IF NOT EXISTS 'okatter-user'@'localhost' IDENTIFIED BY 'okatter';
ALTER USER 'okatter-user'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD by 'okatter';
GRANT SELECT, INSERT, UPDATE, DELETE ON OKATTER.* TO 'okatter-user'@'localhost';
USE OKATTER;
CREATE TABLE USERS(
ID INT PRIMARY KEY AUTO_INCREMENT,
EMAIL VARCHAR(255) UNIQUE NOT NULL,
PASSWORD VARCHAR(64) NOT NULL,
NAME VARCHAR(64) NOT NULL
);
CREATE TABLE TWEET(
ID INT PRIMARY KEY AUTO_INCREMENT,
TITLE VARCHAR(64) NOT NULL,
BODY VARCHAR(255) NOT NULL,
USER_ID INT NOT NULL,
UPDATE_AT TIMESTAMP NOT NULL,
FOREIGN KEY(USER_ID) REFERENCES USERS(ID)
); |
--修改人:胡双
--修改日期:2012-12-25
--修改内容:VP7396,添加业务类型:承兑汇票
DECLARE
VN_COUNT NUMBER;
BEGIN
SELECT COUNT(*) INTO VN_COUNT FROM ERP_VOUCHER_TYPE WHERE ID = 4;
IF (VN_COUNT < 1) THEN
INSERT INTO ERP_VOUCHER_TYPE
(ID, VOUCHER_TYPE_CODE, VOUCHER_TYPE_NAME)
VALUES
(4, '04', '承兑汇票');
END IF;
COMMIT;
END;
/ |
create table soul
(
id integer PRIMARY KEY AUTO_INCREMENT,
client_id integer not null,
body varchar not null
);
|
--
-- Update sql for MailWizz EMA from version 1.3.5 to 1.3.5.1
--
|
-- Update for 2015-03-12
-- > New table form and form_usage
-- > New column added to table document
USE baiken_fwm_1;
-- Table structure for table `form`
-- CREATE TABLE `form_usage` (
-- `form_usage_id` int(11) NOT NULL AUTO_INCREMENT,
-- `form_usage_type` varchar(25) NOT NULL COMMENT 'A string representation of the specific usage type. Possible values: task, location',
-- `form_usage_value` varchar(25) NOT NULL DEFAULT 0 COMMENT 'A string representation of the specific usage. Possible values: coc, well.',
-- `form_usage_desc` varchar(100) NULL COMMENT 'Describes the meaning of the form_usage',
-- PRIMARY KEY (`form_usage_id`)
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT=1;
-- -- Table structure for table `form`
-- CREATE TABLE `form` (
-- `form_id` int(11) NOT NULL AUTO_INCREMENT,
-- `form_category` varchar(25) NOT NULL DEFAULT 0 COMMENT 'Will store the id column name of the object that relates to the form',
-- `form_category_id_value` int(11) NULL COMMENT 'Will store the id value of the object that relates to the form',
-- `form_usage_id` int(11) NOT NULL COMMENT 'Look up the table form_usage for the meaning of id set',
-- `form_complete` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Form complete or incomplete flag',
-- CONSTRAINT `fk_form_usage` FOREIGN KEY (`form_usage_id`)
-- REFERENCES `form_usage` (`form_usage_id`),
-- PRIMARY KEY (`form_id`)
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT=1;
ALTER TABLE `document`
ADD COLUMN `document_title` varchar(250) NULL DEFAULT 'Caption goes here' COMMENT 'This is the value for a document that is displayed in the HTML as a caption'
;
|
-- 数据库初始化
-- 创建数据库
CREATE DATABASE seckill;
-- 使用数据库
use seckill;
-- 创建表
CREATE TABLE seckill(
`seckill_id` bigint not null AUTO_INCREMENT COMMENT '商品库存id',
`name` varchar(120) not null comment '商品名称',
`number` int not NULL comment '库存数量',
`start_time` TIMESTAMP not NULL comment '秒杀开始时间',
`end_time` TIMESTAMP not NULL comment '秒杀开始时间',
`create_time` TIMESTAMP not null DEFAULT current_timestamp comment '创建时间',
PRIMARY key (seckill_id),
key idx_start_time (start_time),
key idx_end_time(end_time),
key idx_create_time(create_time)
)ENGINE=InnoDB auto_increment=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表';
-- 初始化数据
insert into seckill (name,number,start_time,end_time)
VALUES
('1000元秒杀iPhone X',10,'2018-04-23 00:00:00','2018-04-24 00:00:00'),
('500元秒杀Beats',20,'2018-04-23 00:00:00','2018-04-24 00:00:00'),
('200元秒杀iPad',30,'2018-04-23 00:00:00','2018-04-24 00:00:00'),
('100元秒杀小猪佩奇',40,'2018-04-23 00:00:00','2018-04-24 00:00:00');
-- 秒杀成功明细表
-- 用户认证相关信息
CREATE TABLE success_killed(
`seckill_id` bigint not null auto_increment comment '秒杀商品id',
`user_phone` bigint not null comment '用户手机号',
`state` TINYINT not NULL DEFAULT -1 comment '状态标识:-1:无效 0:成功 1:已付款',
`create_time` TIMESTAMP not null comment '创建时间',
PRIMARY key (seckill_id,user_phone),/*联合主键*/
key idx_create_time(create_time)
)ENGINE=InnoDB auto_increment=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀成功明细表';
-- 连接数据库控制台
-- mysql -uroot -P
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.34-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.5.0.5196
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for intra-baru-mediakit
CREATE DATABASE IF NOT EXISTS `intra-baru-mediakit` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `intra-baru-mediakit`;
-- Dumping structure for table intra-baru-mediakit.advolution
CREATE TABLE IF NOT EXISTS `advolution` (
`id_advolution` int(11) NOT NULL AUTO_INCREMENT,
`nama_advolution` varchar(225) NOT NULL DEFAULT '0',
`url_showreel` varchar(225) NOT NULL DEFAULT '0',
`nama_video` varchar(225) DEFAULT NULL,
`logo` varchar(225) DEFAULT NULL,
PRIMARY KEY (`id_advolution`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.advolution_type
CREATE TABLE IF NOT EXISTS `advolution_type` (
`id_type` int(11) NOT NULL AUTO_INCREMENT,
`id_advolution` int(11) NOT NULL DEFAULT '0',
`nama` varchar(225) NOT NULL DEFAULT '0',
`url_video` varchar(225) NOT NULL DEFAULT '0',
`type_video` enum('benefit','compro') NOT NULL DEFAULT 'benefit',
PRIMARY KEY (`id_type`)
) ENGINE=InnoDB AUTO_INCREMENT=62 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.artis
CREATE TABLE IF NOT EXISTS `artis` (
`id_artis` int(11) NOT NULL AUTO_INCREMENT,
`nama_artis` varchar(100) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_artis`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.benefits
CREATE TABLE IF NOT EXISTS `benefits` (
`id_benefit` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nama_benefit` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`benefit_cover` varchar(225) COLLATE utf8mb4_unicode_ci NOT NULL,
`pic_concept` varchar(35) COLLATE utf8mb4_unicode_ci NOT NULL,
`orders` int(11) DEFAULT NULL,
`create_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_benefit`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.benefit_content
CREATE TABLE IF NOT EXISTS `benefit_content` (
`id_benefit_content` int(11) NOT NULL AUTO_INCREMENT,
`id_benefit` int(10) unsigned NOT NULL DEFAULT '0',
`content_name` varchar(50) NOT NULL,
`content_file` varchar(100) NOT NULL,
`content_type` enum('images','video','file') NOT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`update_user` varchar(50) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_benefit_content`),
KEY `FK_benefit_content_benefits` (`id_benefit`),
CONSTRAINT `FK_benefit_content_benefits` FOREIGN KEY (`id_benefit`) REFERENCES `benefits_ori` (`id_benefit`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.benefit_typespot
CREATE TABLE IF NOT EXISTS `benefit_typespot` (
`id_typespot` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_benefit` int(10) unsigned DEFAULT NULL,
`nama` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`img` varchar(225) COLLATE utf8mb4_unicode_ci NOT NULL,
`deskripsi` text COLLATE utf8mb4_unicode_ci NOT NULL,
`rate` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`durasi` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`format` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`visibility` int(11) NOT NULL,
`stopping_power` int(11) NOT NULL,
`massage_delivery` int(11) NOT NULL,
`create_user` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_typespot`),
KEY `benefit_typespot_id_benefit_foreign` (`id_benefit`),
CONSTRAINT `benefit_typespot_ibfk_1` FOREIGN KEY (`id_benefit`) REFERENCES `intra-portal`.`benefits_old` (`id_benefit`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.benefit_typespot_ori
CREATE TABLE IF NOT EXISTS `benefit_typespot_ori` (
`id_typespot` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_benefit` int(10) unsigned DEFAULT NULL,
`nama` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`deskripsi` text COLLATE utf8mb4_unicode_ci NOT NULL,
`rate` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_typespot`),
KEY `benefit_typespot_id_benefit_foreign` (`id_benefit`),
CONSTRAINT `benefit_typespot_ori_ibfk_1` FOREIGN KEY (`id_benefit`) REFERENCES `benefits_ori` (`id_benefit`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.business_unit
CREATE TABLE IF NOT EXISTS `business_unit` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_unit_id` int(11) DEFAULT NULL,
`unit_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type_unit` varchar(65) COLLATE utf8mb4_unicode_ci DEFAULT 'TV',
`tier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`insert_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam
CREATE TABLE IF NOT EXISTS `cam` (
`id_cam` int(11) NOT NULL AUTO_INCREMENT,
`id_am` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`id_sgm` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_sm` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`pic_am` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_cam_typeactivity` int(11) DEFAULT NULL,
`id_agcy_plan` int(11) DEFAULT NULL,
`id_brand_plan` int(11) DEFAULT NULL,
`id_adv_plan` int(11) DEFAULT NULL,
`subject_plan` varchar(65) CHARACTER SET latin1 DEFAULT NULL,
`description_plan` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`location_plan` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`id_agcy_act` int(11) DEFAULT NULL,
`id_brand_act` int(11) DEFAULT NULL,
`id_adv_act` int(11) DEFAULT NULL,
`subject_act` varchar(65) CHARACTER SET latin1 DEFAULT NULL,
`description_act` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`location_act` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`type` enum('PLAN','REPORT') COLLATE utf8_unicode_ci DEFAULT NULL,
`status` enum('PLAN','ACTUAL') COLLATE utf8_unicode_ci DEFAULT NULL,
`start_date_plan` datetime DEFAULT NULL,
`end_date_plan` datetime DEFAULT NULL,
`start_date_act` datetime DEFAULT NULL,
`end_date_act` datetime DEFAULT NULL,
`potency_revenue` float DEFAULT NULL,
`insert_user` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`update_user` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_cam`),
KEY `TYPE_ACTIVITY` (`id_cam_typeactivity`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_brand
CREATE TABLE IF NOT EXISTS `cam_brand` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`id_brand` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`update_at` datetime NOT NULL,
`deleted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_client
CREATE TABLE IF NOT EXISTS `cam_client` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`id_client_account` varchar(50) DEFAULT NULL,
`id_status` enum('REPORTING','COST') DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_comment
CREATE TABLE IF NOT EXISTS `cam_comment` (
`id_comment` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`user_id` varchar(50) DEFAULT NULL,
`comment` text,
`parent_id` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`update_at` datetime NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_comment`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_cost
CREATE TABLE IF NOT EXISTS `cam_cost` (
`id_cam_cost` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`cost` float DEFAULT NULL,
`title` varchar(50) DEFAULT NULL,
`cost_description` varchar(255) DEFAULT NULL,
`cost_by` varchar(50) DEFAULT NULL,
`gift` enum('Y','N') DEFAULT NULL,
`client` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_cam_cost`),
KEY `ID_CAM` (`id_cam`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_email
CREATE TABLE IF NOT EXISTS `cam_email` (
`id_email` int(11) NOT NULL AUTO_INCREMENT,
`tanggal` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_event
CREATE TABLE IF NOT EXISTS `cam_event` (
`id_cam_event` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type_event` varchar(50) NOT NULL,
`group` varchar(50) NOT NULL,
`type` varchar(50) NOT NULL,
`typeuser` varchar(50) NOT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_cam_event`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_eventdate
CREATE TABLE IF NOT EXISTS `cam_eventdate` (
`id_event_date` int(11) NOT NULL AUTO_INCREMENT,
`id_cam_event` int(11) DEFAULT NULL,
`name_event` varchar(50) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`status` enum('UNIT','GROUP') DEFAULT NULL,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`foto` varchar(200) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_event_date`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_eventdate_gift
CREATE TABLE IF NOT EXISTS `cam_eventdate_gift` (
`id_event_date_gift` int(11) NOT NULL AUTO_INCREMENT,
`id_event_date` int(11) NOT NULL,
`id_gift` int(11) DEFAULT NULL,
`id_hantaran` int(11) DEFAULT NULL,
`tittle` varchar(200) DEFAULT NULL,
`description` text,
`cost` float DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`id_client_level` int(11) DEFAULT NULL,
`id_company_cluster` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_event_date_gift`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_event_client
CREATE TABLE IF NOT EXISTS `cam_event_client` (
`id_event_client` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_client_account` int(11) DEFAULT NULL,
`id_event_date` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`type` enum('PERSONAL','COMPANY') DEFAULT 'PERSONAL',
`type_company` enum('AGC','ADV') DEFAULT NULL,
`status` int(11) DEFAULT '1',
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_event_client`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_event_client_gift
CREATE TABLE IF NOT EXISTS `cam_event_client_gift` (
`id_client_gift` int(11) NOT NULL AUTO_INCREMENT,
`id_event_client` int(11) DEFAULT NULL,
`id_event_date_gift` int(11) DEFAULT NULL,
`id_kado` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`cost` float DEFAULT NULL,
`jumlah` int(11) DEFAULT NULL,
`tanggal_dikirim` date DEFAULT NULL,
`status` enum('UNIT','GROUP') DEFAULT NULL,
`merk` varchar(200) DEFAULT NULL,
`warna` varchar(50) DEFAULT NULL,
`image_gift` varchar(200) DEFAULT NULL,
`image_approve` varchar(200) DEFAULT NULL,
`foto` varchar(200) DEFAULT NULL,
`note` text,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`status_gift` enum('CONFRIM','ACCEPT','RETUR','CANCLE') DEFAULT NULL,
PRIMARY KEY (`id_client_gift`),
KEY `ID_CAM_EVENT` (`id_event_client`),
KEY `ID_GIFT` (`id_event_date_gift`)
) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_gift
CREATE TABLE IF NOT EXISTS `cam_gift` (
`id_gift` int(11) NOT NULL AUTO_INCREMENT,
`name_gift` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_gift`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_hantaran
CREATE TABLE IF NOT EXISTS `cam_hantaran` (
`id_hantaran` int(11) NOT NULL AUTO_INCREMENT,
`type_hantaran` varchar(100) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_hantaran`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_kado
CREATE TABLE IF NOT EXISTS `cam_kado` (
`id_kado` int(11) NOT NULL AUTO_INCREMENT,
`nama_kado` varchar(100) DEFAULT NULL,
`type_kado` enum('BUNGA','KADO','KUE') DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_kado`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_partner
CREATE TABLE IF NOT EXISTS `cam_partner` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`user_id` varchar(200) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_reimbuse
CREATE TABLE IF NOT EXISTS `cam_reimbuse` (
`id_rembuse` int(11) NOT NULL AUTO_INCREMENT,
`id_cam` int(11) DEFAULT NULL,
`user_id` varchar(50) DEFAULT NULL,
`cost_by` float DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`update_at` datetime DEFAULT NULL,
`deleted_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_rembuse`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_request
CREATE TABLE IF NOT EXISTS `cam_request` (
`id_request` int(11) NOT NULL AUTO_INCREMENT,
`id_event_date` int(11) DEFAULT NULL,
`periode` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_request`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_type_activity
CREATE TABLE IF NOT EXISTS `cam_type_activity` (
`id_cam_typeactivity` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name_activity` varchar(50) NOT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_cam_typeactivity`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cam_update
CREATE TABLE IF NOT EXISTS `cam_update` (
`id_update` int(11) NOT NULL AUTO_INCREMENT,
`id_request` int(11) DEFAULT NULL,
`am` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_update`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.channel_ta
CREATE TABLE IF NOT EXISTS `channel_ta` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_channel` int(11) DEFAULT NULL,
`id_ta` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_brand
CREATE TABLE IF NOT EXISTS `cmv_brand` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`brand_id` varchar(15) DEFAULT NULL,
`category_id` varchar(15) DEFAULT NULL,
`brand_name` varchar(95) DEFAULT NULL,
`parent_id` varchar(15) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`img` varchar(225) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8390 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_genre
CREATE TABLE IF NOT EXISTS `cmv_genre` (
`genre_id` int(11) NOT NULL AUTO_INCREMENT,
`genre_name` varchar(225) DEFAULT NULL,
`genre_category_id` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`genre_id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_genre_category
CREATE TABLE IF NOT EXISTS `cmv_genre_category` (
`genre_category_id` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(225) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`genre_category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_target_audience
CREATE TABLE IF NOT EXISTS `cmv_target_audience` (
`ta_id` varchar(10) NOT NULL,
`ta_name` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ta_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_variabel
CREATE TABLE IF NOT EXISTS `cmv_variabel` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`brand_id` varchar(50) NOT NULL,
`subdemo_id` varchar(50) NOT NULL,
`quartal` int(11) NOT NULL,
`tahun` year(4) NOT NULL,
`totals_thousand` float DEFAULT NULL,
`totals_ver` float DEFAULT NULL,
`total_hor` float DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`,`brand_id`,`subdemo_id`,`quartal`,`tahun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_variabel_target_audience
CREATE TABLE IF NOT EXISTS `cmv_variabel_target_audience` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ta_id` varchar(10) DEFAULT NULL,
`quartal` int(11) DEFAULT NULL,
`tahun` year(4) DEFAULT NULL,
`genre_id` int(11) DEFAULT NULL,
`index` float DEFAULT NULL,
`totals_thousand` float DEFAULT NULL,
`totals_ver` float DEFAULT NULL,
`total_hor` float DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5908 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.cmv_variabel_top_program
CREATE TABLE IF NOT EXISTS `cmv_variabel_top_program` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`quartal` int(11) DEFAULT NULL,
`year` int(11) DEFAULT NULL,
`program_name` varchar(200) DEFAULT NULL,
`channel` varchar(200) DEFAULT NULL,
`id_genre` int(11) DEFAULT NULL,
`tvr` float DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1483 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.company_cluster
CREATE TABLE IF NOT EXISTS `company_cluster` (
`ID_COMPANY_CLUSTER` int(11) NOT NULL AUTO_INCREMENT,
`TYPE_COMPANY` enum('AGC','ADV') DEFAULT NULL,
`ID_COMPANY` int(11) DEFAULT NULL,
`CLUSTER` int(11) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`DELETED_AT` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ID_COMPANY_CLUSTER`)
) ENGINE=InnoDB AUTO_INCREMENT=233 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_d_target_account
CREATE TABLE IF NOT EXISTS `db_d_target_account` (
`id_targetaccount` int(11) NOT NULL AUTO_INCREMENT,
`id_produk` int(11) DEFAULT NULL,
`id_agcyptu` int(11) DEFAULT NULL,
`id_agcyptu_run` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_targetaccount`)
) ENGINE=InnoDB AUTO_INCREMENT=4229 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_d_target_account_am
CREATE TABLE IF NOT EXISTS `db_d_target_account_am` (
`id_targetaccount_am` int(11) NOT NULL AUTO_INCREMENT,
`id_targetaccount` int(11) DEFAULT NULL,
`id_am_run` varchar(100) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`ntc` enum('1','0') DEFAULT '0',
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_targetaccount_am`)
) ENGINE=InnoDB AUTO_INCREMENT=10180 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_advertiser
CREATE TABLE IF NOT EXISTS `db_m_advertiser` (
`id_adv` int(11) NOT NULL AUTO_INCREMENT,
`nama_adv` varchar(50) DEFAULT NULL,
`id_typeadv` int(11) unsigned DEFAULT NULL,
`id_demography` int(11) DEFAULT NULL,
`address` text,
`cluster` int(11) DEFAULT NULL,
`id_city` int(11) DEFAULT NULL,
`anniversary` date DEFAULT NULL,
`is_group` enum('Y','N') DEFAULT 'N',
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`delete_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_adv`),
KEY `FK_IDADV` (`id_typeadv`)
) ENGINE=InnoDB AUTO_INCREMENT=2981 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_agencypintu
CREATE TABLE IF NOT EXISTS `db_m_agencypintu` (
`id_agcyptu` int(11) NOT NULL AUTO_INCREMENT,
`nama_agencypintu` varchar(250) DEFAULT NULL,
`id_agcy` int(11) DEFAULT NULL,
`cluster` int(11) DEFAULT NULL,
`anniversary` date DEFAULT NULL,
`id_city` int(11) DEFAULT NULL,
`address` text,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_agcyptu`)
) ENGINE=InnoDB AUTO_INCREMENT=1002 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_brand
CREATE TABLE IF NOT EXISTS `db_m_brand` (
`id_brand` int(11) NOT NULL AUTO_INCREMENT,
`nama_brand` varchar(100) DEFAULT NULL,
`id_category` int(11) DEFAULT NULL,
`id_sector` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`delete_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_brand`)
) ENGINE=InnoDB AUTO_INCREMENT=4370 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_category
CREATE TABLE IF NOT EXISTS `db_m_category` (
`id_category` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name_category` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`insert_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`delete_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_category`)
) ENGINE=InnoDB AUTO_INCREMENT=291 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_channel
CREATE TABLE IF NOT EXISTS `db_m_channel` (
`id_channel` int(11) NOT NULL AUTO_INCREMENT,
`name_channel` varchar(50) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`tier` int(11) DEFAULT NULL,
`group` varchar(100) DEFAULT NULL,
`type` varchar(100) DEFAULT NULL,
`img` varchar(100) DEFAULT NULL,
`website` varchar(100) DEFAULT NULL,
`keterangan` enum('internal','competitor') DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_channel`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_product
CREATE TABLE IF NOT EXISTS `db_m_product` (
`id_produk` int(11) unsigned NOT NULL AUTO_INCREMENT,
`nama_produk` varchar(191) DEFAULT NULL,
`id_category` int(11) unsigned DEFAULT NULL,
`id_sector` int(11) unsigned DEFAULT NULL,
`id_brand` int(11) unsigned DEFAULT NULL,
`id_adv` int(11) unsigned DEFAULT NULL,
`id_ta` int(11) unsigned DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_produk`),
KEY `FK_db_m_produk_db_m_category` (`id_category`),
KEY `FK_db_m_produk_db_m_sector` (`id_sector`),
KEY `FK_db_m_produk_db_m_brand` (`id_brand`),
KEY `FK_db_m_produk_db_m_advertiser` (`id_adv`)
) ENGINE=InnoDB AUTO_INCREMENT=5883 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_m_sector
CREATE TABLE IF NOT EXISTS `db_m_sector` (
`id_sector` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name_sector` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`insert_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_sector`),
KEY `db_m_sector_insert_user_foreign` (`insert_user`),
KEY `db_m_sector_update_user_foreign` (`update_user`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_rating
CREATE TABLE IF NOT EXISTS `db_rating` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`DAYPART` varchar(50) NOT NULL,
`DATE1` date NOT NULL,
`TA` varchar(50) NOT NULL,
`RCTI_TVR` float NOT NULL,
`RCTI_SHARE` float NOT NULL,
`SCTV_TVR` float NOT NULL,
`SCTV_SHARE` float NOT NULL,
`TRANS_TVR` float NOT NULL,
`TRANS_SHARE` float NOT NULL,
`TRANS7_TVR` float NOT NULL,
`TRANS7_SHARE` float NOT NULL,
`IVM_TVR` float NOT NULL,
`IVM_SHARE` float NOT NULL,
`MNCTV_TVR` float NOT NULL,
`MNCTV_SHARE` float NOT NULL,
`GTV_TVR` float NOT NULL,
`GTV_SHARE` float NOT NULL,
`ANTV_TVR` float NOT NULL,
`ANTV_SHARE` float NOT NULL,
`TVONE_TVR` float NOT NULL,
`TVONE_SHARE` float NOT NULL,
`METRO_TVR` float NOT NULL,
`METRO_SHARE` float NOT NULL,
`TVRI_TVR` float NOT NULL,
`TVRI_SHARE` float NOT NULL,
`INEWS_TVR` float DEFAULT NULL,
`INEWS_SHARE` float DEFAULT NULL,
`KOMPAS_TVR` float DEFAULT NULL,
`KOMPAS_SHARE` float DEFAULT NULL,
`NET_TVR` float DEFAULT NULL,
`NET_SHARE` float DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=79491 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_target
CREATE TABLE IF NOT EXISTS `db_target` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`YEAR` int(11) NOT NULL,
`PERIODE` int(11) NOT NULL,
`ID_SM` varchar(100) NOT NULL,
`ID_SGM` varchar(100) NOT NULL,
`ID_AE` varchar(100) NOT NULL,
`NAMA_SM` varchar(100) NOT NULL,
`NAMA_SGM` varchar(100) NOT NULL,
`NAMA_AE` varchar(100) NOT NULL,
`REG_TARGET` decimal(15,3) NOT NULL,
`REG_ACH` decimal(15,3) NOT NULL,
`REG_EFFORT` decimal(15,3) NOT NULL,
`BC_TARGET` decimal(15,3) NOT NULL,
`BC_ACH` decimal(15,3) NOT NULL,
`BI_TARGET` decimal(15,3) NOT NULL,
`BI_ACH` decimal(15,3) NOT NULL,
`RS_TARGET` decimal(15,3) NOT NULL,
`RS_ACT` decimal(15,3) NOT NULL,
`CPRP_TARGET` decimal(15,3) NOT NULL,
`CPRP_REV` decimal(15,3) NOT NULL,
`BARTER_REV` decimal(15,3) NOT NULL,
`BU_ID` int(11) NOT NULL,
`ACTIVE` int(11) DEFAULT '1',
`INSERT_DATE` datetime DEFAULT NULL,
`INSERT_USER` varchar(150) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `ID_AE` (`ID_AE`),
KEY `PERIODE` (`PERIODE`),
KEY `ID_SGM` (`ID_SGM`),
KEY `ID_SM` (`ID_SM`),
KEY `BU_ID` (`BU_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=10123 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_target_account
CREATE TABLE IF NOT EXISTS `db_target_account` (
`ID_TARGETACCOUNT` int(11) NOT NULL AUTO_INCREMENT,
`ID_PRODUK` int(11) DEFAULT NULL,
`ID_AGCYPTU` int(11) DEFAULT NULL,
`ID_AGCYPTU_RUN` int(11) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`TRASH` tinyint(4) DEFAULT '0',
PRIMARY KEY (`ID_TARGETACCOUNT`)
) ENGINE=InnoDB AUTO_INCREMENT=1709 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_target_account_am
CREATE TABLE IF NOT EXISTS `db_target_account_am` (
`ID_TARGETACCOUNT_AM` int(11) NOT NULL AUTO_INCREMENT,
`ID_TARGETACCOUNT` int(11) DEFAULT NULL,
`ID_AM_RUN` varchar(100) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`INSERT_USER` varchar(100) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(100) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`TRASH` tinyint(4) DEFAULT '0',
PRIMARY KEY (`ID_TARGETACCOUNT_AM`)
) ENGINE=InnoDB AUTO_INCREMENT=5125 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.db_weekly
CREATE TABLE IF NOT EXISTS `db_weekly` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`YEAR` int(4) DEFAULT NULL,
`PERIODE` int(2) DEFAULT NULL,
`ADVERTISER` varchar(75) DEFAULT NULL,
`ADVERTISER_GROUP` varchar(75) DEFAULT NULL,
`ADVG_ID` int(11) DEFAULT NULL,
`KET` varchar(50) DEFAULT NULL,
`AGENCY` varchar(255) DEFAULT NULL,
`AP_ID` int(11) DEFAULT NULL,
`AGENCY_MNCTV` varchar(255) DEFAULT NULL,
`AP_ID_MNCTV` int(10) DEFAULT '1',
`AGENCY_GTV` varchar(255) DEFAULT NULL,
`AP_ID_GTV` int(10) DEFAULT '1',
`PRODUK` varchar(100) NOT NULL,
`SECTOR` varchar(100) NOT NULL,
`CATEGORY` varchar(100) NOT NULL,
`RCTI` float NOT NULL,
`SCTV` float NOT NULL,
`TRANS` float NOT NULL,
`TRANS7` float NOT NULL,
`IVM` float NOT NULL,
`MNCTV` float NOT NULL,
`GTV` float NOT NULL,
`ANTV` float NOT NULL,
`TVONE` float NOT NULL,
`METRO` float NOT NULL,
`TVRI` float NOT NULL,
`NETTV` float NOT NULL,
`INEWS` float NOT NULL,
`ALLTV` float NOT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`INSERT_USER` varchar(150) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=64238 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.email_check
CREATE TABLE IF NOT EXISTS `email_check` (
`id_check` int(11) NOT NULL AUTO_INCREMENT,
`id_email` int(11) DEFAULT NULL,
PRIMARY KEY (`id_check`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.favorite
CREATE TABLE IF NOT EXISTS `favorite` (
`id_favorite` int(11) NOT NULL AUTO_INCREMENT,
`id` int(11) DEFAULT NULL,
`id_client_account` int(11) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`type_name` varchar(50) DEFAULT NULL,
`create_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_favorite`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.group_unit
CREATE TABLE IF NOT EXISTS `group_unit` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`logo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`insert_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.level1
CREATE TABLE IF NOT EXISTS `level1` (
`id_level1` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(225) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_level1`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.level2
CREATE TABLE IF NOT EXISTS `level2` (
`id_level2` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(225) DEFAULT NULL,
`id_level1` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_level2`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.linked_social_accounts
CREATE TABLE IF NOT EXISTS `linked_social_accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` varchar(200) DEFAULT NULL,
`provider_name` varchar(200) DEFAULT NULL,
`provider_id` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.login_activities
CREATE TABLE IF NOT EXISTS `login_activities` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_email` varchar(65) DEFAULT NULL,
`user_agent` varchar(191) DEFAULT NULL,
`ip_address` varchar(65) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2481 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.login_attempts
CREATE TABLE IF NOT EXISTS `login_attempts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`ip_address` varchar(40) COLLATE utf8_bin NOT NULL,
`login` varchar(50) COLLATE utf8_bin NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1060 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_flagrate
CREATE TABLE IF NOT EXISTS `mapping_flagrate` (
`id_mapping_flagrate` int(11) unsigned NOT NULL AUTO_INCREMENT,
`code_awal` int(4) NOT NULL DEFAULT '0',
`code_value` int(11) NOT NULL DEFAULT '0',
`code_seasonal_pricing` int(11) NOT NULL DEFAULT '0',
`code_type_order` int(11) NOT NULL DEFAULT '0',
`code_platform` int(11) NOT NULL DEFAULT '0',
`code_unit_revenue` int(11) NOT NULL DEFAULT '0',
`code_program` int(11) NOT NULL DEFAULT '0',
`code_kombinasi_flagrate` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_mapping_flagrate`)
) ENGINE=InnoDB AUTO_INCREMENT=1192 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_master
CREATE TABLE IF NOT EXISTS `mapping_master` (
`id_mapping` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(10) DEFAULT NULL,
`title` varchar(50) DEFAULT NULL,
`description` text,
`id_mapping_master_type` int(11) DEFAULT NULL,
`group_mapping` enum('POTYPE','FLAGRATE','SPOTTYPE') DEFAULT NULL,
`subgroup_mapping` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_mapping`)
) ENGINE=InnoDB AUTO_INCREMENT=520 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_master_type
CREATE TABLE IF NOT EXISTS `mapping_master_type` (
`id_mapping_master_type` int(11) NOT NULL AUTO_INCREMENT,
`type_mapping` varchar(50) DEFAULT NULL,
`digit_code` varchar(50) DEFAULT NULL,
`description` text,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_mapping_master_type`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_po_type
CREATE TABLE IF NOT EXISTS `mapping_po_type` (
`id_mapping_po_type` int(11) NOT NULL AUTO_INCREMENT,
`code_unitorder` int(11) DEFAULT NULL,
`code_client` int(11) DEFAULT NULL,
`code_billcom` int(11) DEFAULT NULL,
`code_invoice` int(11) DEFAULT NULL,
`code_kombinasi_potype` varchar(50) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_mapping_po_type`)
) ENGINE=InnoDB AUTO_INCREMENT=327 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_spot_type
CREATE TABLE IF NOT EXISTS `mapping_spot_type` (
`id_mapping_spot_type` int(11) NOT NULL AUTO_INCREMENT,
`code_typespot` int(11) DEFAULT NULL,
`code_package` int(11) DEFAULT NULL,
`code_kombinasi_spottype` varchar(20) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_mapping_spot_type`)
) ENGINE=InnoDB AUTO_INCREMENT=313 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mapping_subgroup_spottype
CREATE TABLE IF NOT EXISTS `mapping_subgroup_spottype` (
`id_group_spottype` int(11) NOT NULL AUTO_INCREMENT,
`group_name` varchar(50) NOT NULL DEFAULT '0',
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_group_spottype`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.media
CREATE TABLE IF NOT EXISTS `media` (
`id_media` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`type` enum('one','many') DEFAULT NULL,
PRIMARY KEY (`id_media`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.mediakit_email
CREATE TABLE IF NOT EXISTS `mediakit_email` (
`id_email` int(11) NOT NULL AUTO_INCREMENT,
`pengirim` varchar(50) DEFAULT NULL,
`penerima` varchar(50) DEFAULT NULL,
`id` int(11) DEFAULT NULL,
`type_name` varchar(50) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_email`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.media_unit
CREATE TABLE IF NOT EXISTS `media_unit` (
`id_media_unit` int(11) NOT NULL AUTO_INCREMENT,
`id_media` int(11) NOT NULL DEFAULT '0',
`title` varchar(50) DEFAULT NULL,
`video` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id_media_unit`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.media_video
CREATE TABLE IF NOT EXISTS `media_video` (
`id_video` int(11) NOT NULL AUTO_INCREMENT,
`id_media` int(11) NOT NULL DEFAULT '0',
`video` varchar(225) DEFAULT NULL,
PRIMARY KEY (`id_video`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.meeting_progress
CREATE TABLE IF NOT EXISTS `meeting_progress` (
`id_meeting_progress` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(200) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`meeting_date` date DEFAULT NULL,
`file_meeting` varchar(225) DEFAULT NULL,
`cover` varchar(225) DEFAULT NULL,
`type_meeting` enum('progress','update') DEFAULT NULL,
`id_bu` int(11) NOT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_meeting_progress`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.migrations
CREATE TABLE IF NOT EXISTS `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.notification
CREATE TABLE IF NOT EXISTS `notification` (
`chat` text,
`id_bu` int(11) DEFAULT NULL,
`tabs` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.oauth_access_tokens
CREATE TABLE IF NOT EXISTS `oauth_access_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` int(11) DEFAULT NULL,
`client_id` int(11) NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`scopes` text COLLATE utf8mb4_unicode_ci,
`revoked` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_access_tokens_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.oauth_auth_codes
CREATE TABLE IF NOT EXISTS `oauth_auth_codes` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
`scopes` text COLLATE utf8mb4_unicode_ci,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.oauth_clients
CREATE TABLE IF NOT EXISTS `oauth_clients` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`secret` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
`personal_access_client` tinyint(1) NOT NULL,
`password_client` tinyint(1) NOT NULL,
`revoked` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_clients_user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.oauth_personal_access_clients
CREATE TABLE IF NOT EXISTS `oauth_personal_access_clients` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`client_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_personal_access_clients_client_id_index` (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.oauth_refresh_tokens
CREATE TABLE IF NOT EXISTS `oauth_refresh_tokens` (
`id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`revoked` tinyint(1) NOT NULL,
`expires_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.page-views
CREATE TABLE IF NOT EXISTS `page-views` (
`visitable_id` int(11) DEFAULT NULL,
`visitable_type` varchar(50) DEFAULT NULL,
`ip_address` varchar(50) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.password_resets
CREATE TABLE IF NOT EXISTS `password_resets` (
`email` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.permissions
CREATE TABLE IF NOT EXISTS `permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`guard_name` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_advertiser
CREATE TABLE IF NOT EXISTS `portal_advertiser` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_adv` int(11) DEFAULT NULL,
`id_portal` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=518 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_bankfoto
CREATE TABLE IF NOT EXISTS `portal_bankfoto` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_portal` int(11) NOT NULL DEFAULT '0',
`keterangan` text,
`images` varchar(225) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=485 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_berita
CREATE TABLE IF NOT EXISTS `portal_berita` (
`id_portal` int(11) NOT NULL AUTO_INCREMENT,
`id_kategori` int(11) DEFAULT NULL,
`id_sector` int(11) DEFAULT '0',
`id_agcyptu` int(11) DEFAULT '0',
`judul` text,
`slug` text,
`cuplikan` varchar(200) DEFAULT NULL,
`deskripsi` text,
`sumber` varchar(200) DEFAULT NULL,
`cover` varchar(225) DEFAULT NULL,
`video` text,
`type_video` enum('PARIWARA','YOUTUBE') DEFAULT NULL,
`sumber_cover` varchar(100) DEFAULT NULL,
`present` enum('yes','no') DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_portal`)
) ENGINE=InnoDB AUTO_INCREMENT=494 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_berita_ori
CREATE TABLE IF NOT EXISTS `portal_berita_ori` (
`id_portal` int(11) NOT NULL AUTO_INCREMENT,
`id_kategori` int(11) DEFAULT NULL,
`id_sector` int(11) DEFAULT '0',
`id_agcyptu` int(11) DEFAULT '0',
`judul` text,
`slug` text,
`cuplikan` varchar(200) DEFAULT NULL,
`deskripsi` text,
`sumber` varchar(200) DEFAULT NULL,
`cover` varchar(225) DEFAULT NULL,
`video` text,
`sumber_cover` varchar(100) DEFAULT NULL,
`headline` enum('yes','no') DEFAULT NULL,
`present` enum('yes','no') DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_portal`)
) ENGINE=InnoDB AUTO_INCREMENT=270 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_brand
CREATE TABLE IF NOT EXISTS `portal_brand` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_brand` int(11) DEFAULT NULL,
`id_portal` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=583 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_bu
CREATE TABLE IF NOT EXISTS `portal_bu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_portal` int(11) DEFAULT NULL,
`for_bu` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=328 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_kategori
CREATE TABLE IF NOT EXISTS `portal_kategori` (
`id_kategori` int(11) NOT NULL AUTO_INCREMENT,
`nama_kategori` varchar(100) NOT NULL,
`id_bu` varchar(100) NOT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_kategori`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_tag
CREATE TABLE IF NOT EXISTS `portal_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_tag` int(11) DEFAULT NULL,
`id_portal` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1138 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.portal_tag_master
CREATE TABLE IF NOT EXISTS `portal_tag_master` (
`id_tag` int(11) NOT NULL AUTO_INCREMENT,
`id_bu` int(11) NOT NULL DEFAULT '0',
`nama_tag` varchar(225) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`update_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_tag`)
) ENGINE=InnoDB AUTO_INCREMENT=752 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.program_ariana
CREATE TABLE IF NOT EXISTS `program_ariana` (
`id_program_ariana` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(225) DEFAULT NULL,
`id_level2` int(11) DEFAULT NULL,
`id_channel` int(11) DEFAULT NULL,
`daypart1` varchar(50) DEFAULT NULL,
`daypart2` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_program_ariana`)
) ENGINE=InnoDB AUTO_INCREMENT=3362 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.program_gen
CREATE TABLE IF NOT EXISTS `program_gen` (
`id_program_gen` int(11) NOT NULL AUTO_INCREMENT,
`program_name_gen` varchar(225) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_program_gen`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.program_mapping
CREATE TABLE IF NOT EXISTS `program_mapping` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_source` enum('INTRANET','ARIANA','SOCMED','GEN') DEFAULT NULL,
`id_source` int(11) DEFAULT NULL,
`type_mapping` enum('INTRANET','ARIANA','SOCMED','GEN') DEFAULT NULL,
`id_mapping` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`insert_user` varchar(225) DEFAULT NULL,
`update_user` varchar(225) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.program_rating
CREATE TABLE IF NOT EXISTS `program_rating` (
`id` int(11) DEFAULT NULL,
`periode` date DEFAULT NULL,
`id_program_ariana` int(11) DEFAULT NULL,
`id_channel` int(11) DEFAULT NULL,
`id_ta` int(11) DEFAULT NULL,
`duration` float DEFAULT NULL,
`index` float DEFAULT NULL,
`tvr` float DEFAULT NULL,
`thousands` float DEFAULT NULL,
`share` float DEFAULT NULL,
`total_thousands` float DEFAULT NULL,
`pot_thousands` float DEFAULT NULL,
`tot_pot_thousands` float DEFAULT NULL,
`populasi` float DEFAULT NULL,
`tot_populasi` float DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.program_unit
CREATE TABLE IF NOT EXISTS `program_unit` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`business_unit_id` int(10) unsigned DEFAULT NULL,
`program_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`insert_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=337 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.sam
CREATE TABLE IF NOT EXISTS `sam` (
`id_sam` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
`id_ref_sam` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_req_type` int(2) unsigned zerofill DEFAULT NULL,
`id_sub_req_type` int(10) unsigned DEFAULT NULL,
`id_status` int(10) unsigned DEFAULT NULL,
`id_status_progress` int(10) unsigned DEFAULT NULL,
`start_periode` date DEFAULT NULL,
`end_periode` date DEFAULT NULL,
`id_brand` int(10) unsigned DEFAULT NULL,
`brand_variant` varchar(65) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_apu` int(10) unsigned DEFAULT NULL,
`id_advg` int(10) unsigned DEFAULT NULL,
`id_billcom` int(10) unsigned DEFAULT NULL,
`budget` float DEFAULT NULL,
`nett` float DEFAULT NULL,
`pic_am` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pic_sam` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pic_sa` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pic_section` int(11) DEFAULT NULL,
`deadline` datetime DEFAULT NULL,
`deadline_mkt` datetime DEFAULT NULL,
`update_active` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_progress_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_progress_date` datetime DEFAULT NULL,
`approved` enum('Y','N') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`approved_by` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`approved_sgm` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`approved_sm` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`approved_mc` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`approved_date` datetime DEFAULT NULL,
`id_am` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_sm` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_sgm` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_bu` int(10) unsigned DEFAULT NULL,
`via_email` int(11) DEFAULT NULL,
`active` enum('1','0') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`insert_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_sam`),
KEY `sam_id_sub_req_type_foreign` (`id_sub_req_type`),
KEY `sam_update_progress_user_foreign` (`update_progress_user`),
KEY `FK_sam_users` (`pic_am`),
KEY `FK_sam_users_2` (`pic_sam`),
KEY `FK_sam_sam_request_type` (`id_req_type`),
KEY `FK_sam_sam_status` (`id_status`),
KEY `FK_sam_sam_status_2` (`id_status_progress`),
KEY `FK_sam_db_m_brand` (`id_brand`),
KEY `FK_sam_db_m_agencypintu` (`id_apu`),
KEY `FK_sam_db_m_advertiser` (`id_advg`),
KEY `FK_sam_bu` (`id_bu`),
KEY `FK_sam_users_3` (`insert_user`),
KEY `FK_sam_users_4` (`update_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.sam_activity
CREATE TABLE IF NOT EXISTS `sam_activity` (
`id_activity` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_ref_activity` int(10) unsigned DEFAULT NULL,
`id_status` int(10) unsigned DEFAULT NULL,
`id_sam` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_sam_file` varchar(65) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`id_attach_file` int(11) DEFAULT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`time_to_work` int(11) DEFAULT NULL,
`deadline` datetime DEFAULT NULL,
`id_bu` int(10) unsigned DEFAULT NULL,
`id_nodeal` int(10) unsigned DEFAULT NULL,
`insert_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_activity`),
KEY `sam_activity_id_sam_foreign` (`id_sam`),
KEY `sam_activity_id_status_foreign` (`id_status`),
KEY `FK_sam_activity_users` (`insert_user`),
KEY `FK_sam_activity_users_2` (`update_user`),
KEY `FK_sam_activity_bu` (`id_bu`)
) ENGINE=InnoDB AUTO_INCREMENT=226298 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.sam_request_type
CREATE TABLE IF NOT EXISTS `sam_request_type` (
`id_req_type` int(2) unsigned zerofill NOT NULL AUTO_INCREMENT,
`singkatan` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`nama` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`modul` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_req_type`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.sam_status
CREATE TABLE IF NOT EXISTS `sam_status` (
`id_status` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nama_status` varchar(65) COLLATE utf8mb4_unicode_ci NOT NULL,
`id_req_type` int(2) unsigned zerofill NOT NULL,
`relasi_status` int(11) NOT NULL,
`type_status` int(11) DEFAULT NULL,
`dept_status` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`warning` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`time_limit` int(11) NOT NULL,
`stat` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`order` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_status`),
KEY `sam_status_id_req_type_foreign` (`id_req_type`)
) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.ta
CREATE TABLE IF NOT EXISTS `ta` (
`id_ta` int(11) NOT NULL AUTO_INCREMENT,
`ta_name` varchar(50) DEFAULT NULL,
`group_ta` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_ta`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_acd_soal
CREATE TABLE IF NOT EXISTS `tbl_acd_soal` (
`ID_SOAL` int(11) NOT NULL AUTO_INCREMENT,
`ID_QUIZ` int(11) DEFAULT NULL,
`ID_SKILL` int(11) DEFAULT NULL,
`SOAL` text,
`JAWABAN_A` text,
`JAWABAN_B` text,
`JAWABAN_C` text,
`JAWABAN_D` text,
`JENIS_SOAL` varchar(50) DEFAULT NULL,
`KUNCI_JAWABAN` text,
`RUMUS` text,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`TRASH` tinyint(4) DEFAULT '0',
PRIMARY KEY (`ID_SOAL`),
KEY `FK__tbl_acd_quiz` (`ID_QUIZ`)
) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=latin1 COMMENT='Tabel Academy Soal Quiz';
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_action_upload
CREATE TABLE IF NOT EXISTS `tbl_action_upload` (
`ID_UPLOAD` int(11) NOT NULL AUTO_INCREMENT,
`TITLE` varchar(100) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`INSERT_USER` varchar(100) DEFAULT NULL,
`ID_BU` int(2) DEFAULT NULL,
`ID_SECTION` int(3) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ID_UPLOAD`)
) ENGINE=InnoDB AUTO_INCREMENT=2502 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_am
CREATE TABLE IF NOT EXISTS `tbl_am` (
`ID_AM` varchar(50) NOT NULL,
`AM_NAME` varchar(50) DEFAULT NULL,
`ID_SGM` varchar(50) NOT NULL,
`ID_SM` varchar(50) NOT NULL,
`ID_GM` varchar(50) NOT NULL,
`NTC` int(11) NOT NULL,
`ID_BU` int(11) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`INSER_USER` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`ACTIVE` int(11) DEFAULT '1',
`TRASH` tinyint(1) DEFAULT '0',
PRIMARY KEY (`ID_AM`),
KEY `ID_SM` (`ID_SM`),
KEY `ID_SGM` (`ID_SGM`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_am-1
CREATE TABLE IF NOT EXISTS `tbl_am-1` (
`ID_AM` varchar(50) NOT NULL,
`AM_NAME` varchar(50) DEFAULT NULL,
`ID_SGM` varchar(50) NOT NULL,
`ID_SM` varchar(50) NOT NULL,
`ID_GM` varchar(50) NOT NULL,
`NTC` int(11) NOT NULL,
`ID_BU` int(11) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`INSER_USER` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`ACTIVE` int(11) DEFAULT '1',
`TRASH` tinyint(1) DEFAULT '0',
PRIMARY KEY (`ID_AM`),
KEY `ID_SM` (`ID_SM`),
KEY `ID_SGM` (`ID_SGM`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_bu
CREATE TABLE IF NOT EXISTS `tbl_bu` (
`ID_BU` int(11) NOT NULL AUTO_INCREMENT,
`HAVE_CHANNEL` int(11) NOT NULL DEFAULT '0',
`BU_FULL_NAME` varchar(75) NOT NULL,
`BU_SHORT_NAME` varchar(45) NOT NULL,
`IMAGE` varchar(45) NOT NULL,
`INSERT_USER` varchar(50) NOT NULL,
`INSERT_DATE` datetime NOT NULL,
`UPDATE_USER` varchar(50) NOT NULL,
`UPDATE_DATE` date NOT NULL,
`ACTIVE` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`ID_BU`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 COMMENT='Bussiness Unit / Company / Branch';
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_bulan
CREATE TABLE IF NOT EXISTS `tbl_bulan` (
`PERIODE` int(11) NOT NULL AUTO_INCREMENT,
`BULAN` varchar(50) DEFAULT NULL,
PRIMARY KEY (`PERIODE`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_bu_channel_old
CREATE TABLE IF NOT EXISTS `tbl_bu_channel_old` (
`ID_CHANNEL` int(11) NOT NULL AUTO_INCREMENT,
`CHANNEL_NAME` varchar(200) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`ID_CAT_CHANNEL` int(11) DEFAULT NULL,
`INSERT_USER` varchar(200) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(200) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`ACTIVE` int(11) DEFAULT NULL,
PRIMARY KEY (`ID_CHANNEL`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_category_file
CREATE TABLE IF NOT EXISTS `tbl_category_file` (
`id_cat_file` tinyint(5) NOT NULL AUTO_INCREMENT,
`category_file` varchar(50) DEFAULT NULL,
`status` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id_cat_file`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_chat
CREATE TABLE IF NOT EXISTS `tbl_chat` (
`id_chat` int(11) NOT NULL AUTO_INCREMENT,
`text_chat` varchar(50) DEFAULT NULL,
`insert_user` int(11) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`read_date` datetime DEFAULT NULL,
`user_to` int(11) DEFAULT NULL,
`read_stat` tinyint(4) DEFAULT '0',
PRIMARY KEY (`id_chat`)
) ENGINE=InnoDB AUTO_INCREMENT=498 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_city
CREATE TABLE IF NOT EXISTS `tbl_city` (
`ID_CITY` int(11) NOT NULL,
`NAME_CITY` varchar(50) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`DELETED_AT` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ID_CITY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_compare
CREATE TABLE IF NOT EXISTS `tbl_compare` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tablename` varchar(250) DEFAULT NULL,
`replicate` varchar(100) DEFAULT NULL,
`table` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=177 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_content
CREATE TABLE IF NOT EXISTS `tbl_content` (
`id_content` int(11) NOT NULL AUTO_INCREMENT,
`content_title` varchar(225) DEFAULT NULL,
`id_program_periode` int(11) DEFAULT NULL,
`id_master_filetype` int(11) DEFAULT NULL,
`id_filetype` int(11) DEFAULT NULL,
`id_section` int(11) DEFAULT NULL,
`id_sector` int(11) DEFAULT NULL,
`id_benefit` int(10) DEFAULT NULL,
`id_channel` int(10) DEFAULT NULL,
`id_genre` int(10) DEFAULT NULL,
`year_of_file` year(4) DEFAULT NULL,
`month_of_file` int(2) DEFAULT NULL,
`content_desc` text,
`content_file_download` varchar(225) DEFAULT NULL,
`content_headline` int(11) DEFAULT NULL,
`mediakit` tinyint(4) DEFAULT '1',
`portal` tinyint(4) DEFAULT '1',
`content_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`trash` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`delete_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_content`),
KEY `BU_ID` (`id_bu`),
KEY `SECTION_ID` (`id_section`),
KEY `INPUT_USER` (`insert_user`)
) ENGINE=InnoDB AUTO_INCREMENT=53250 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_filetype
CREATE TABLE IF NOT EXISTS `tbl_filetype` (
`id_filetype` int(11) NOT NULL AUTO_INCREMENT,
`filetype_name` varchar(70) NOT NULL,
`folder` varchar(30) NOT NULL DEFAULT 'public',
`id_master_filetype` int(11) NOT NULL DEFAULT '0',
`id_typespot` int(11) NOT NULL DEFAULT '0',
`type` enum('typespot','benefit','other') DEFAULT NULL,
`ext_file` varchar(50) NOT NULL DEFAULT 'free',
`allow_ext` varchar(50) NOT NULL,
`insert_user` varchar(50) NOT NULL,
`update_user` varchar(50) NOT NULL,
`delete_user` varchar(50) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id_filetype`),
KEY `FILE_TYPE_NAME` (`filetype_name`)
) ENGINE=InnoDB AUTO_INCREMENT=260 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_galleryalbum
CREATE TABLE IF NOT EXISTS `tbl_galleryalbum` (
`id_galleryalbum` int(11) NOT NULL AUTO_INCREMENT,
`id_master_filetype` int(11) NOT NULL,
`title` varchar(50) DEFAULT NULL,
`cover_gallery` varchar(50) DEFAULT NULL,
`content_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`description` text,
`id_bu` int(11) NOT NULL,
`insert_user` varchar(50) NOT NULL,
`insert_date` datetime NOT NULL,
`update_user` varchar(50) NOT NULL,
`update_date` datetime NOT NULL,
`mediakit` tinyint(4) DEFAULT '1',
`trash` tinyint(4) DEFAULT '0',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_galleryalbum`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_gallerycontent
CREATE TABLE IF NOT EXISTS `tbl_gallerycontent` (
`id_content` int(11) NOT NULL AUTO_INCREMENT,
`content_title` varchar(100) NOT NULL,
`id_galleryalbum` int(11) DEFAULT NULL,
`year_of_file` char(4) DEFAULT NULL,
`month_of_file` int(2) DEFAULT NULL,
`content_desc` varchar(5000) DEFAULT NULL,
`content_file_download` varchar(200) DEFAULT NULL,
`type_content` enum('images','video') DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime NOT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime NOT NULL,
`id_master_filetype` int(11) DEFAULT NULL,
`id_filetype` int(11) NOT NULL,
`id_section` int(11) NOT NULL,
`id_bu` int(11) NOT NULL,
`mediakit` tinyint(4) DEFAULT '1',
`trash` int(11) DEFAULT '0',
PRIMARY KEY (`id_content`),
KEY `BU_ID` (`id_bu`),
KEY `SECTION_ID` (`id_section`),
KEY `INPUT_USER` (`insert_user`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_gallery_comment
CREATE TABLE IF NOT EXISTS `tbl_gallery_comment` (
`ID_COMMENT` int(11) NOT NULL AUTO_INCREMENT,
`ID_CONTENT` int(11) DEFAULT NULL,
`KOMENTAR` text,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_COMMENT`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_gallery_highlight
CREATE TABLE IF NOT EXISTS `tbl_gallery_highlight` (
`ID_HIGHLIGHT` int(11) NOT NULL AUTO_INCREMENT,
`ID_CONTENT` int(11) DEFAULT NULL,
`HIGHLIGHT_DESC` varchar(500) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_HIGHLIGHT`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_gallery_tag
CREATE TABLE IF NOT EXISTS `tbl_gallery_tag` (
`ID_TAG` int(11) NOT NULL AUTO_INCREMENT,
`ID_CONTENT` int(11) DEFAULT NULL,
`EMAIL` varchar(50) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_TAG`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_master_filetype
CREATE TABLE IF NOT EXISTS `tbl_master_filetype` (
`id_master_filetype` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(50) DEFAULT NULL,
`master_group` varchar(50) DEFAULT NULL,
`description` text,
`type_content` int(11) DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime DEFAULT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime DEFAULT NULL,
`image` varchar(250) DEFAULT NULL,
`active` int(11) DEFAULT '1',
PRIMARY KEY (`id_master_filetype`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_mk_fanof
CREATE TABLE IF NOT EXISTS `tbl_mk_fanof` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`CONTENT_ID` int(11) DEFAULT NULL,
`DATE_SHOW` date DEFAULT NULL,
`START_DATE` date DEFAULT NULL,
`END_DATE` date DEFAULT NULL,
`QTY` int(11) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`TRASH` tinyint(1) DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_mk_highlight
CREATE TABLE IF NOT EXISTS `tbl_mk_highlight` (
`ID_HIGHLIGHT` int(11) NOT NULL AUTO_INCREMENT,
`ID_TA` int(11) DEFAULT NULL,
`ID_CONTENT` int(11) DEFAULT NULL,
`HIGHLIGHT_DESC` varchar(500) DEFAULT NULL,
`NO_URUT` int(11) DEFAULT NULL,
`ID_BU` int(5) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(150) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_HIGHLIGHT`)
) ENGINE=InnoDB AUTO_INCREMENT=825 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_mk_newsupdate
CREATE TABLE IF NOT EXISTS `tbl_mk_newsupdate` (
`ID_NEWSUPDATE` int(11) NOT NULL AUTO_INCREMENT,
`ID_TA` int(11) DEFAULT NULL,
`ID_CONTENT` int(11) DEFAULT NULL,
`NEWSUPDATE_DESC` varchar(500) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_NEWSUPDATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program
CREATE TABLE IF NOT EXISTS `tbl_program` (
`id_program` int(11) NOT NULL AUTO_INCREMENT,
`program_name` varchar(250) NOT NULL,
`id_genre` int(11) NOT NULL,
`id_channel` int(11) NOT NULL,
`id_bu` int(11) NOT NULL,
`master_ta` int(11) NOT NULL DEFAULT '2',
`description` text,
`images` varchar(5000) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`id_type_event` int(11) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`trash` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_program`)
) ENGINE=InnoDB AUTO_INCREMENT=4332 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_ariana_level1
CREATE TABLE IF NOT EXISTS `tbl_program_ariana_level1` (
`id_level1` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(225) DEFAULT NULL,
PRIMARY KEY (`id_level1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_ariana_level2
CREATE TABLE IF NOT EXISTS `tbl_program_ariana_level2` (
`id_level2` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(225) DEFAULT NULL,
PRIMARY KEY (`id_level2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_artis
CREATE TABLE IF NOT EXISTS `tbl_program_artis` (
`id_program_artis` int(11) NOT NULL AUTO_INCREMENT,
`id_program_periode` int(11) NOT NULL,
`id_artis` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`deleted_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`create_user` varchar(50) NOT NULL,
`update_user` varchar(50) NOT NULL,
PRIMARY KEY (`id_program_artis`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_category
CREATE TABLE IF NOT EXISTS `tbl_program_category` (
`id_category` int(11) NOT NULL AUTO_INCREMENT,
`category_name` varchar(50) NOT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_category`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_control
CREATE TABLE IF NOT EXISTS `tbl_program_control` (
`ID_PROGRAM_CONTROL` int(11) NOT NULL AUTO_INCREMENT,
`ID_PROGRAM_PERIODE` int(11) DEFAULT NULL,
`ID_FILETYPE` int(11) DEFAULT NULL,
`INSERT_USER` varchar(100) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_PROGRAM_CONTROL`)
) ENGINE=InnoDB AUTO_INCREMENT=2769 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_event
CREATE TABLE IF NOT EXISTS `tbl_program_event` (
`id_event` int(11) NOT NULL AUTO_INCREMENT,
`event_name` varchar(150) DEFAULT NULL,
`id_type_event` int(11) DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`description` text,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
` update_user` varchar(50) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_event`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_genre
CREATE TABLE IF NOT EXISTS `tbl_program_genre` (
`id_genre` int(11) NOT NULL AUTO_INCREMENT,
`genre_name` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_genre`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_mapping1
CREATE TABLE IF NOT EXISTS `tbl_program_mapping1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_source` int(11) DEFAULT NULL,
`type_source` enum('INTRANET','ARIANA','SOCMED','GEN') DEFAULT NULL,
`id_program_mapping` int(11) DEFAULT NULL,
`type` enum('INTRANET','ARIANA','SOCMED','GEN') DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_ori
CREATE TABLE IF NOT EXISTS `tbl_program_ori` (
`id_program` int(11) NOT NULL AUTO_INCREMENT,
`id_program_unit` int(11) NOT NULL,
`program_name` varchar(250) NOT NULL,
`id_genre` int(11) NOT NULL,
`id_channel` int(11) NOT NULL,
`id_bu` int(11) NOT NULL,
`master_ta` int(11) NOT NULL DEFAULT '2',
`images` varchar(5000) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`id_type_event` int(11) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`trash` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_program`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_periode
CREATE TABLE IF NOT EXISTS `tbl_program_periode` (
`id_program_periode` int(11) NOT NULL AUTO_INCREMENT,
`id_program` int(11) DEFAULT NULL,
`content_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`onair_start_date` date DEFAULT NULL,
`onair_end_date` date DEFAULT NULL,
`date_onair` date DEFAULT NULL,
`id_season` int(11) DEFAULT NULL,
`id_category` int(11) DEFAULT NULL,
`thousand` float DEFAULT NULL,
`index` float DEFAULT NULL,
`share` float DEFAULT NULL,
`tvr` float DEFAULT NULL,
`content_use` int(11) NOT NULL DEFAULT '0',
`content_trailer` int(11) NOT NULL DEFAULT '0',
`description` text,
`benefit` text,
`target` double DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime DEFAULT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime DEFAULT NULL,
`active` tinyint(4) DEFAULT '1',
`portal` tinyint(4) DEFAULT '1',
`mediakit` tinyint(4) DEFAULT '1',
`trash` tinyint(4) DEFAULT '0',
PRIMARY KEY (`id_program_periode`),
KEY `PROGRAM_ID` (`id_program`),
KEY `ID_PROGRAM_SEASON` (`id_season`),
KEY `ID_PROGRAM_CATEGORY` (`id_category`)
) ENGINE=InnoDB AUTO_INCREMENT=4305 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_periode_ori
CREATE TABLE IF NOT EXISTS `tbl_program_periode_ori` (
`id_program_periode` int(11) NOT NULL AUTO_INCREMENT,
`id_program` int(11) DEFAULT NULL,
`content_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`onair_start_date` date DEFAULT NULL,
`onair_end_date` date DEFAULT NULL,
`date_onair` date DEFAULT NULL,
`id_season` int(11) DEFAULT NULL,
`id_category` int(11) DEFAULT NULL,
`content_use` int(11) NOT NULL DEFAULT '0',
`content_trailer` int(11) NOT NULL DEFAULT '0',
`description` text,
`benefit` text,
`target` double DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime DEFAULT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime DEFAULT NULL,
`active` tinyint(4) DEFAULT '1',
`portal` tinyint(4) DEFAULT '1',
`mediakit` tinyint(4) DEFAULT '1',
`trash` tinyint(4) DEFAULT '0',
PRIMARY KEY (`id_program_periode`),
KEY `PROGRAM_ID` (`id_program`),
KEY `ID_PROGRAM_SEASON` (`id_season`),
KEY `ID_PROGRAM_CATEGORY` (`id_category`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_pic
CREATE TABLE IF NOT EXISTS `tbl_program_pic` (
`ID_PROGRAM_PIC` int(11) NOT NULL AUTO_INCREMENT,
`ID_SECTION` int(11) DEFAULT NULL,
`ID_USER` varchar(50) DEFAULT NULL,
`ID_PROGRAM_PERIODE` int(11) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`ID_BU` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`ID_PROGRAM_PIC`)
) ENGINE=InnoDB AUTO_INCREMENT=1288 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_requirement
CREATE TABLE IF NOT EXISTS `tbl_program_requirement` (
`ID_REQUIREMENT` int(11) NOT NULL AUTO_INCREMENT,
`ID_PROGRAM_PERIODE` int(11) DEFAULT NULL,
`ID_FILETYPE` int(11) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_REQUIREMENT`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_season
CREATE TABLE IF NOT EXISTS `tbl_program_season` (
`id_season` int(11) NOT NULL AUTO_INCREMENT,
`season_name` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`active` tinyint(4) DEFAULT '1',
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_season`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_ta
CREATE TABLE IF NOT EXISTS `tbl_program_ta` (
`id_program_ta` int(11) NOT NULL AUTO_INCREMENT,
`id_program` int(11) DEFAULT NULL,
`id_ta` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_program_ta`)
) ENGINE=InnoDB AUTO_INCREMENT=1803 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_tvr
CREATE TABLE IF NOT EXISTS `tbl_program_tvr` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date_show` date DEFAULT NULL,
`id_program_ariana` date DEFAULT NULL,
`id_channel` int(11) DEFAULT NULL,
`tvr` float DEFAULT NULL,
`thousand` float DEFAULT NULL,
`index` float DEFAULT NULL,
`share` float DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_program_type_event
CREATE TABLE IF NOT EXISTS `tbl_program_type_event` (
`id_type_event` int(11) NOT NULL AUTO_INCREMENT,
`type_event_name` varchar(150) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL,
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_type_event`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_rating
CREATE TABLE IF NOT EXISTS `tbl_rating` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`daypart` varchar(50) DEFAULT NULL,
`periode` date DEFAULT NULL,
`ta` varchar(50) DEFAULT NULL,
`channel` varchar(50) DEFAULT NULL,
`tvr` varchar(50) DEFAULT NULL,
`share` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_salestools
CREATE TABLE IF NOT EXISTS `tbl_salestools` (
`id_salestools` int(11) NOT NULL AUTO_INCREMENT,
`id_master_filetype` int(11) DEFAULT NULL,
`title` varchar(50) DEFAULT NULL,
`content_start_date` date DEFAULT NULL,
`onair_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`onair_end_date` date DEFAULT NULL,
`content_use` int(11) NOT NULL DEFAULT '0',
`content_trailer` int(11) NOT NULL DEFAULT '0',
`content_headline` int(11) NOT NULL DEFAULT '0',
`description` varchar(5000) DEFAULT NULL,
`id_bu` int(11) NOT NULL,
`id_channel` int(11) NOT NULL,
`advg_id` int(11) DEFAULT NULL,
`id_ap` int(11) DEFAULT NULL,
`id_am` varchar(50) DEFAULT NULL,
`id_program_periode` int(11) DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime NOT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime NOT NULL,
`active` tinyint(4) DEFAULT '1',
`portal` tinyint(4) DEFAULT '1',
`mediakit` tinyint(4) DEFAULT '1',
`trash` tinyint(4) DEFAULT '0',
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_salestools`),
KEY `CONTENT_USE` (`content_use`)
) ENGINE=InnoDB AUTO_INCREMENT=5798 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_salestools_ori
CREATE TABLE IF NOT EXISTS `tbl_salestools_ori` (
`id_salestools` int(11) NOT NULL AUTO_INCREMENT,
`id_master_filetype` int(11) DEFAULT NULL,
`title` varchar(50) DEFAULT NULL,
`content_start_date` date DEFAULT NULL,
`onair_start_date` date DEFAULT NULL,
`content_end_date` date DEFAULT NULL,
`onair_end_date` date DEFAULT NULL,
`content_use` int(11) NOT NULL DEFAULT '0',
`content_trailer` int(11) NOT NULL DEFAULT '0',
`content_headline` int(11) NOT NULL DEFAULT '0',
`description` varchar(5000) DEFAULT NULL,
`id_bu` int(11) NOT NULL,
`id_channel` int(11) NOT NULL,
`advg_id` int(11) DEFAULT NULL,
`id_ap` int(11) DEFAULT NULL,
`id_am` varchar(50) DEFAULT NULL,
`id_program_periode` int(11) DEFAULT NULL,
`insert_user` varchar(50) NOT NULL,
`created_at` datetime NOT NULL,
`update_user` varchar(50) NOT NULL,
`updated_at` datetime NOT NULL,
`active` tinyint(4) DEFAULT '1',
`portal` tinyint(4) DEFAULT '1',
`mediakit` tinyint(4) DEFAULT '1',
`trash` tinyint(4) DEFAULT '0',
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_salestools`),
KEY `CONTENT_USE` (`content_use`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_salestools_ta
CREATE TABLE IF NOT EXISTS `tbl_salestools_ta` (
` id_salestools_ta` int(11) NOT NULL AUTO_INCREMENT,
`id_salestools` int(11) DEFAULT NULL,
`id_ta` int(11) DEFAULT NULL,
`insert_user` varchar(100) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (` id_salestools_ta`)
) ENGINE=InnoDB AUTO_INCREMENT=16112 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_ta
CREATE TABLE IF NOT EXISTS `tbl_ta` (
`ID` int(11) DEFAULT NULL,
`TA` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_target_audience
CREATE TABLE IF NOT EXISTS `tbl_target_audience` (
`id_ta` int(11) NOT NULL AUTO_INCREMENT,
`ta_name` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`insert_date` datetime DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
`ta` int(11) DEFAULT '1',
`url` varchar(50) DEFAULT NULL,
`image` varchar(250) DEFAULT NULL,
`back` varchar(250) DEFAULT NULL,
`active` tinyint(5) DEFAULT NULL,
`trash` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_ta`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_tv_audience_share
CREATE TABLE IF NOT EXISTS `tbl_tv_audience_share` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`PERIODE` varchar(50) DEFAULT NULL,
`CHANNEL_TV` varchar(50) DEFAULT NULL,
`ASHARE` float DEFAULT NULL,
`TIME_TYPE` varchar(50) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_user
CREATE TABLE IF NOT EXISTS `tbl_user` (
`ID_USER` int(11) NOT NULL AUTO_INCREMENT,
`USER_ID` varchar(50) DEFAULT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(50) DEFAULT NULL,
`name` varchar(50) NOT NULL,
`password_mobile` varchar(191) DEFAULT NULL,
`USER_NAME` varchar(70) NOT NULL,
`FIRST_NAME` varchar(70) NOT NULL,
`LAST_NAME` varchar(70) NOT NULL,
`password` varchar(191) DEFAULT NULL,
`RANDOM_PASSWORD` varchar(191) DEFAULT NULL,
`PASSWORD_BARU` varchar(191) DEFAULT NULL,
`GENDER` varchar(10) DEFAULT NULL,
`IMAGES` varchar(50) DEFAULT NULL,
`POSITION` varchar(25) NOT NULL,
`ID_ROLE` int(11) NOT NULL DEFAULT '1',
`ADMIN` int(11) NOT NULL DEFAULT '0',
`ID_SUBSECTION` varchar(50) DEFAULT NULL,
`ID_SECTION` int(11) DEFAULT NULL,
`ID_DEPARTEMENT` varchar(50) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`LEVEL_DBTARGET` int(11) NOT NULL DEFAULT '0',
`HIT` int(11) DEFAULT '1',
`IP_LOGIN` varchar(50) DEFAULT NULL,
`LAST_ONLINE` datetime DEFAULT NULL,
`ONLINE` tinyint(1) DEFAULT '0',
`ACTIVE` tinyint(1) DEFAULT '1',
`remember_token` varchar(191) DEFAULT '1',
`true_email` enum('Y','N') DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_USER`),
UNIQUE KEY `USER_ID` (`USER_ID`),
KEY `SECTION_ID_idx` (`ID_SECTION`),
KEY `BU_ID` (`ID_BU`)
) ENGINE=InnoDB AUTO_INCREMENT=2429 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_user-1
CREATE TABLE IF NOT EXISTS `tbl_user-1` (
`ID_USER` int(11) NOT NULL AUTO_INCREMENT,
`USER_ID` varchar(50) DEFAULT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`password_mobile` varchar(191) DEFAULT NULL,
`USER_NAME` varchar(70) NOT NULL,
`FIRST_NAME` varchar(70) NOT NULL,
`LAST_NAME` varchar(70) NOT NULL,
`password` varchar(225) DEFAULT NULL,
`RANDOM_PASSWORD` varchar(191) DEFAULT NULL,
`PASSWORD_BARU` varchar(191) DEFAULT NULL,
`GENDER` varchar(10) DEFAULT NULL,
`IMAGES` varchar(50) DEFAULT NULL,
`POSITION` varchar(25) NOT NULL,
`ID_ROLE` int(11) NOT NULL DEFAULT '1',
`ADMIN` int(11) NOT NULL DEFAULT '0',
`ID_SUBSECTION` varchar(50) DEFAULT NULL,
`ID_SECTION` int(11) DEFAULT NULL,
`ID_DEPARTEMENT` varchar(50) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`LEVEL_DBTARGET` int(11) NOT NULL DEFAULT '0',
`HIT` int(11) DEFAULT '1',
`IP_LOGIN` varchar(50) DEFAULT NULL,
`LAST_ONLINE` datetime DEFAULT NULL,
`ONLINE` tinyint(1) DEFAULT '0',
`ACTIVE` tinyint(1) DEFAULT '1',
`remember_token` varchar(191) DEFAULT '1',
`INSERT_USER` varchar(50) DEFAULT NULL,
`deleted_at` varchar(50) DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
PRIMARY KEY (`ID_USER`),
UNIQUE KEY `USER_ID` (`USER_ID`),
KEY `SECTION_ID_idx` (`ID_SECTION`),
KEY `BU_ID` (`ID_BU`)
) ENGINE=InnoDB AUTO_INCREMENT=1883 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient
CREATE TABLE IF NOT EXISTS `tbl_userclient` (
`id_client` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`lastname` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`gender` enum('MR','MRS') COLLATE utf8_bin NOT NULL,
`birth_place` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`birth_date` date DEFAULT NULL,
`address` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_city` int(11) DEFAULT NULL,
`id_religion` int(11) DEFAULT NULL,
`group_religion` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_etnis` int(11) DEFAULT NULL,
`no_passport` varchar(150) COLLATE utf8_bin DEFAULT NULL,
`name_passport` varchar(150) COLLATE utf8_bin DEFAULT NULL,
`expired_passport` date DEFAULT NULL,
`status` enum('NONE','SINGLE','MARRIAGE') COLLATE utf8_bin DEFAULT NULL,
`no_of_children` int(11) DEFAULT NULL,
`no_of_sibling` int(11) DEFAULT NULL,
`order_of_children` int(11) DEFAULT NULL,
`last_education` enum('SD','SMP','SMA','S1','S2','S3') COLLATE utf8_bin DEFAULT NULL,
`photo` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`active` enum('1','0') COLLATE utf8_bin DEFAULT '1',
`insert_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`created_at` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`updated_at` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`deleted_user` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client`),
KEY `RELIGION` (`id_religion`),
KEY `ID_ETNIS` (`id_etnis`),
KEY `ID_CITY` (`id_city`)
) ENGINE=InnoDB AUTO_INCREMENT=3927 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient-1
CREATE TABLE IF NOT EXISTS `tbl_userclient-1` (
`id_client` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`lastname` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`gender` enum('MR','MRS') COLLATE utf8_bin NOT NULL,
`birth_place` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`birth_date` date DEFAULT NULL,
`address` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_city` int(11) DEFAULT NULL,
`id_religion` int(11) DEFAULT NULL,
`group_religion` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_etnis` int(11) DEFAULT NULL,
`no_passport` varchar(150) COLLATE utf8_bin DEFAULT NULL,
`name_passport` varchar(150) COLLATE utf8_bin DEFAULT NULL,
`expired_passport` date DEFAULT NULL,
`status` enum('NONE','SINGLE','MARRIAGE') COLLATE utf8_bin DEFAULT NULL,
`no_of_children` int(11) DEFAULT NULL,
`no_of_sibling` int(11) DEFAULT NULL,
`order_of_children` int(11) DEFAULT NULL,
`last_education` enum('SD','SMP','SMA','S1','S2','S3') COLLATE utf8_bin DEFAULT NULL,
`photo` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`active` enum('1','0') COLLATE utf8_bin DEFAULT '1',
`insert_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`created_at` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`updated_at` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`deleted_user` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client`),
KEY `RELIGION` (`id_religion`),
KEY `ID_ETNIS` (`id_etnis`),
KEY `ID_CITY` (`id_city`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_account
CREATE TABLE IF NOT EXISTS `tbl_userclient_account` (
`id_client_account` int(11) NOT NULL AUTO_INCREMENT,
`id_client` int(11) NOT NULL,
`email` varchar(50) DEFAULT NULL,
`type_company` enum('ADV','AGC') DEFAULT NULL,
`id_company` int(11) DEFAULT NULL,
`position` varchar(50) DEFAULT NULL,
`id_client_level` int(11) DEFAULT NULL,
`password` text,
`remember_token` text,
`password_reset` varchar(50) DEFAULT NULL,
`active` enum('1','0') DEFAULT '1',
`last_ip` varchar(50) DEFAULT NULL,
`last_login` date DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client_account`),
KEY `ID_LEVEL` (`id_client_level`),
KEY `ID_CLIENT` (`id_client`)
) ENGINE=InnoDB AUTO_INCREMENT=3927 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_account-1
CREATE TABLE IF NOT EXISTS `tbl_userclient_account-1` (
`id_client_account` int(11) NOT NULL AUTO_INCREMENT,
`id_client` int(11) NOT NULL,
`email` varchar(50) DEFAULT NULL,
`type_company` enum('ADV','AGC') DEFAULT NULL,
`id_company` int(11) DEFAULT NULL,
`position` varchar(50) DEFAULT NULL,
`id_client_level` int(11) DEFAULT NULL,
`password` varchar(225) DEFAULT NULL,
`remember_token` varchar(191) DEFAULT NULL,
`password_reset` varchar(225) DEFAULT NULL,
`active` enum('1','0') DEFAULT '1',
`last_ip` varchar(50) DEFAULT NULL,
`last_login` date DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client_account`),
KEY `ID_LEVEL` (`id_client_level`),
KEY `ID_CLIENT` (`id_client`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_address
CREATE TABLE IF NOT EXISTS `tbl_userclient_address` (
`id_address` int(11) NOT NULL AUTO_INCREMENT,
`type_company` enum('AGC','ADV') DEFAULT NULL,
`id_company` int(11) DEFAULT NULL,
`address` text,
`id_city` int(11) DEFAULT NULL,
`created_at` datetime NOT NULL,
`update_at` datetime NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_address`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_info
CREATE TABLE IF NOT EXISTS `tbl_userclient_info` (
`id_client_info` int(11) NOT NULL AUTO_INCREMENT,
`id_client` int(11) NOT NULL,
`id_client_infomaster` int(11) NOT NULL,
`value` varchar(200) DEFAULT NULL,
`id_hobby` int(11) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`update_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client_info`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_infomaster
CREATE TABLE IF NOT EXISTS `tbl_userclient_infomaster` (
`id_client_infomaster` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(50) DEFAULT NULL,
`title` varchar(50) DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client_infomaster`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_level
CREATE TABLE IF NOT EXISTS `tbl_userclient_level` (
`id_client_level` int(11) NOT NULL AUTO_INCREMENT,
`name_level` varchar(50) NOT NULL,
`description` varchar(50) NOT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id_client_level`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_picam
CREATE TABLE IF NOT EXISTS `tbl_userclient_picam` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_client_account` int(11) DEFAULT NULL,
`id_am` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`active` enum('1','0') COLLATE utf8_bin DEFAULT '1',
`insert_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5639 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_picsgm
CREATE TABLE IF NOT EXISTS `tbl_userclient_picsgm` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_client_account` int(11) DEFAULT NULL,
`id_sgm` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`id_bu` int(11) DEFAULT NULL,
`active` enum('1','0') COLLATE utf8_bin DEFAULT '1',
`insert_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`update_user` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_tbl_userclient_picsgm_tbl_userclient_account` (`id_client_account`)
) ENGINE=InnoDB AUTO_INCREMENT=15705 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_userclient_product
CREATE TABLE IF NOT EXISTS `tbl_userclient_product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_client_account` int(11) DEFAULT NULL,
`type` enum('ADV','BRAND','PRODUCT') DEFAULT NULL,
`id_type` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`insert_user` varchar(50) DEFAULT NULL,
`update_user` varchar(50) DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_user_department
CREATE TABLE IF NOT EXISTS `tbl_user_department` (
`ID_DEPARTEMENT` tinyint(5) NOT NULL AUTO_INCREMENT,
`DEPARTEMENT_NAME` varchar(100) DEFAULT NULL,
`DEPT_NAME` varchar(100) DEFAULT NULL,
`ID_BU` tinyint(5) DEFAULT NULL,
`INSERT_USER` varchar(100) DEFAULT NULL,
`INSERT_DATE` date DEFAULT NULL,
`UPDATE_USER` varchar(100) DEFAULT NULL,
`UPDATE_DATE` date DEFAULT NULL,
`ACTIVE` tinyint(1) DEFAULT '1',
PRIMARY KEY (`ID_DEPARTEMENT`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.tbl_user_section
CREATE TABLE IF NOT EXISTS `tbl_user_section` (
`ID_SECTION` int(11) NOT NULL AUTO_INCREMENT,
`MKT_MAP` text,
`SECTION_NAME` varchar(50) DEFAULT NULL,
`PRIORITY` int(11) DEFAULT NULL,
`NAMA_SINGKAT` varchar(50) DEFAULT NULL,
`ID_DEPARTEMENT` tinyint(5) DEFAULT NULL,
`ID_BU` int(11) DEFAULT NULL,
`ID_PARENT` int(11) DEFAULT NULL,
`IMAGES` varchar(50) DEFAULT NULL,
`LIST_JOBDESK` varchar(50) DEFAULT NULL,
`INTERCONNECTION` varchar(50) DEFAULT NULL,
`OBJECTIVE` text,
`SECTION_CATEGORY` varchar(100) DEFAULT NULL,
`SECTION_GROUP` varchar(100) DEFAULT NULL,
`INSERT_USER` varchar(50) DEFAULT NULL,
`INSERT_DATE` datetime DEFAULT NULL,
`UPDATE_USER` varchar(50) DEFAULT NULL,
`UPDATE_DATE` datetime DEFAULT NULL,
`ACTIVE` tinyint(1) DEFAULT '1',
PRIMARY KEY (`ID_SECTION`)
) ENGINE=InnoDB AUTO_INCREMENT=183 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.unit_sosmed
CREATE TABLE IF NOT EXISTS `unit_sosmed` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type_sosmed` enum('corporate','program') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`business_program_unit` int(10) unsigned DEFAULT NULL,
`sosmed_id` int(10) unsigned DEFAULT NULL,
`unit_sosmed_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`unit_sosmed_account_id` text COLLATE utf8mb4_unicode_ci,
`target_use` int(10) unsigned DEFAULT NULL,
`status_active` enum('Y','N') COLLATE utf8mb4_unicode_ci DEFAULT 'Y',
`insert_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`update_user` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `unit_sosmed_target_use_foreign` (`target_use`),
CONSTRAINT `unit_sosmed_ibfk_1` FOREIGN KEY (`target_use`) REFERENCES `intra-portal`.`unit_sosmed_target` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1176 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.uploads
CREATE TABLE IF NOT EXISTS `uploads` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`filename` text COLLATE utf8mb4_unicode_ci NOT NULL,
`resized_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
`original_name` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=984 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.users
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Data exporting was unselected.
-- Dumping structure for table intra-baru-mediakit.youtube
CREATE TABLE IF NOT EXISTS `youtube` (
`id_youtube` int(11) NOT NULL AUTO_INCREMENT,
`id_bu` int(11) NOT NULL DEFAULT '0',
`channelId` varchar(225) DEFAULT NULL,
`nama_channel` varchar(150) DEFAULT NULL,
`unit` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id_youtube`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
DECLARE EXTERNAL FUNCTION SAVE_BLOB
BLOB,
CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'SAVE_BLOB' MODULE_NAME 'udfibase.dll';
--
DECLARE EXTERNAL FUNCTION LOAD_BLOB
BLOB,
CSTRING(32767)
RETURNS PARAMETER 1
ENTRY_POINT 'LOAD_BLOB' MODULE_NAME 'udfibase.dll';
--
DECLARE EXTERNAL FUNCTION BLOB_LENGTH
BLOB
RETURNS INTEGER BY VALUE
ENTRY_POINT 'BLOB_LENGTH' MODULE_NAME 'udfibase.dll';
--
DECLARE EXTERNAL FUNCTION DELETE_FILE
CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'DELETE_FILE' MODULE_NAME 'udfibase.dll';
--
CREATE OR ALTER PROCEDURE SEND_EVENT
(
SORTING INTEGER,
FIRST_RECORD INTEGER,
APPLICATION_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32),
INCLUDE_SESSION_ID VARCHAR(32),
EXCLUDE_SESSION_ID VARCHAR(32),
PROTOCOL INTEGER,
NAME VARCHAR(100),
IN_PARAMS BLOB
)
RETURNS (
SUCCESS INTEGER,
OUT_PARAMS BLOB)
AS
DECLARE TEMP BLOB;
DECLARE SESSION_ID VARCHAR(32);
DECLARE IP VARCHAR(20);
DECLARE PORT VARCHAR(10);
DECLARE HOST VARCHAR(100);
DECLARE PATH VARCHAR(100);
DECLARE USE_CRYPTER INTEGER;
DECLARE CRYPTER_ALGORITHM INTEGER;
DECLARE CRYPTER_MODE INTEGER;
DECLARE CRYPTER_KEY VARCHAR(100);
DECLARE USE_COMPRESSOR INTEGER;
DECLARE COMPRESSOR_LEVEL INTEGER;
DECLARE RND VARCHAR(4000);
BEGIN
IF (PROTOCOL=0) THEN
RND=RANDOM_STRING(32);
ELSE
RND=RANDOM_STRING(1024*3); /* for fast reaction */
FOR SELECT SESSION_ID, IP, PORT, HOST, PATH,
USE_CRYPTER, CRYPTER_ALGORITHM, CRYPTER_MODE, CRYPTER_KEY,
USE_COMPRESSOR, COMPRESSOR_LEVEL
FROM GET_EVENT_SESSIONS(:SORTING,:APPLICATION_ID,:ACCOUNT_ID,:PROTOCOL)
WHERE ((:EXCLUDE_SESSION_ID IS NULL) OR (SESSION_ID<>:EXCLUDE_SESSION_ID))
AND ((:INCLUDE_SESSION_ID IS NULL) OR (SESSION_ID=:INCLUDE_SESSION_ID))
INTO :SESSION_ID, :IP, :PORT, :HOST, :PATH,
:USE_CRYPTER, :CRYPTER_ALGORITHM, :CRYPTER_MODE, :CRYPTER_KEY,
:USE_COMPRESSOR, :COMPRESSOR_LEVEL DO BEGIN
SUCCESS=0;
TEMP=CONFIG_WRITE(IN_PARAMS,NAME,'rnd',RND);
TEMP=CONFIG_WRITE(TEMP,NAME,'SessionId',SESSION_ID);
IF (USE_COMPRESSOR=1) THEN
TEMP=COMPRESS_BLOB(TEMP,COMPRESSOR_LEVEL);
IF (USE_CRYPTER=1) THEN
TEMP=ENCODE_BLOB(TEMP,CRYPTER_KEY,CRYPTER_ALGORITHM,CRYPTER_MODE);
IF (PROTOCOL=0) THEN BEGIN
OUT_PARAMS=UDP(IP,PORT,TEMP);
IF ((OUT_PARAMS IS NULL) OR (TRIM(OUT_PARAMS)='')) THEN
SUCCESS=1;
END ELSE BEGIN
OUT_PARAMS=HTTP_POST(IP,PORT,PATH,TEMP);
IF (USE_CRYPTER=1) THEN
OUT_PARAMS=DECODE_BLOB(OUT_PARAMS,CRYPTER_KEY,CRYPTER_ALGORITHM,CRYPTER_MODE);
IF (USE_COMPRESSOR=1) THEN
OUT_PARAMS=DECOMPRESS_BLOB(OUT_PARAMS);
IF (OUT_PARAMS IS NOT NULL) THEN
SUCCESS=CAST(CONFIG_READ(OUT_PARAMS,NAME,'Success','0') AS INTEGER);
END
SUSPEND;
IF (FIRST_RECORD=1) THEN
BREAK;
END
END
--
CREATE OR ALTER PROCEDURE GET_EVENT_SESSIONS
(
SORTING INTEGER,
IN_APPLICATION_ID VARCHAR(32),
IN_ACCOUNT_ID VARCHAR(32),
PROTOCOL INTEGER
)
RETURNS (
SESSION_ID VARCHAR(32),
APPLICATION_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32),
DATE_CHANGE TIMESTAMP,
IP VARCHAR(20),
PORT VARCHAR(10),
HOST VARCHAR(100),
PATH VARCHAR(100),
USE_CRYPTER INTEGER,
CRYPTER_ALGORITHM INTEGER,
CRYPTER_MODE INTEGER,
CRYPTER_KEY VARCHAR(100),
USE_COMPRESSOR INTEGER,
COMPRESSOR_LEVEL INTEGER)
AS
declare variable SQL varchar(2000);
BEGIN
SQL='SELECT SESSION_ID, APPLICATION_ID, ACCOUNT_ID, DATE_CHANGE FROM SESSIONS WHERE ';
IF (IN_APPLICATION_ID IS NULL) THEN
SQL=SQL||'APPLICATION_ID IS NOT NULL ';
ELSE
SQL=SQL||'APPLICATION_ID='''||IN_APPLICATION_ID||''' ';
IF (IN_ACCOUNT_ID IS NULL) THEN
SQL=SQL||'AND ACCOUNT_ID IS NOT NULL ';
ELSE BEGIN
SQL=SQL||'AND (ACCOUNT_ID='''||IN_ACCOUNT_ID||''' OR ';
SQL=SQL||'ACCOUNT_ID IN (SELECT ACCOUNT_ID FROM ACCOUNT_ROLES WHERE ROLE_ID='''||IN_ACCOUNT_ID||''')) ';
END
IF (SORTING=0) THEN
SQL=SQL||'ORDER BY DATE_CHANGE DESC';
IF (SORTING=1) THEN
SQL=SQL||'ORDER BY DATE_CHANGE ASC';
FOR EXECUTE STATEMENT SQL
INTO :SESSION_ID, :APPLICATION_ID, :ACCOUNT_ID, :DATE_CHANGE DO BEGIN
EXECUTE PROCEDURE GET_EVENT_PARAMS (SESSION_ID,PROTOCOL)
RETURNING_VALUES IP, PORT, HOST, PATH,
USE_CRYPTER, CRYPTER_ALGORITHM, CRYPTER_MODE, CRYPTER_KEY,
USE_COMPRESSOR, COMPRESSOR_LEVEL;
IF (IP IS NOT NULL) THEN
SUSPEND;
END
END
--
CREATE OR ALTER PROCEDURE GET_EVENT_PARAMS
(
SESSION_ID VARCHAR(32),
PROTOCOL INTEGER
)
RETURNS
(
IP VARCHAR(20),
PORT VARCHAR(10),
HOST VARCHAR(100),
PATH VARCHAR(100),
USE_CRYPTER INTEGER,
CRYPTER_ALGORITHM INTEGER,
CRYPTER_MODE INTEGER,
CRYPTER_KEY VARCHAR(100),
USE_COMPRESSOR INTEGER,
COMPRESSOR_LEVEL INTEGER
)
AS
DECLARE PARAMS BLOB;
DECLARE SECTION VARCHAR(100);
DECLARE S VARCHAR(1000);
BEGIN
SELECT PARAMS
FROM SESSIONS
WHERE SESSION_ID=:SESSION_ID
INTO :PARAMS;
IF ((PROTOCOL=0) OR (PROTOCOL IS NULL)) THEN
SECTION='ExternalUdpEventServer';
ELSE
SECTION='FirstHttpServerHandlerEvent';
IF (CONFIG_EXISTS(PARAMS,SECTION)=1) THEN BEGIN
S=CONFIG_READ(PARAMS,SECTION,'IP','');
IP=SUB_STRING(CASE WHEN POSITION(';',S)>0 THEN SUBSTRING(S FROM 1 FOR POSITION(';',S)-1) ELSE S END,1,20);
S=CONFIG_READ(PARAMS,SECTION,'Port','');
PORT=SUB_STRING(CASE WHEN POSITION(';',S)>0 THEN SUBSTRING(S FROM 1 FOR POSITION(';',S)-1) ELSE S END,1,10);
HOST=SUB_STRING(CONFIG_READ(PARAMS,SECTION,'Host',''),1,100);
PATH=SUB_STRING(CONFIG_READ(PARAMS,SECTION,'Path',''),1,100);
USE_CRYPTER=CAST(CONFIG_READ(PARAMS,SECTION,'UseCrypter','0') AS INTEGER);
CRYPTER_ALGORITHM=CAST(CONFIG_READ(PARAMS,SECTION,'CrypterAlgorithm','0') AS INTEGER);
CRYPTER_MODE=CAST(CONFIG_READ(PARAMS,SECTION,'CrypterMode','0') AS INTEGER);
CRYPTER_KEY=CONFIG_READ(PARAMS,SECTION,'CrypterKey','');
USE_COMPRESSOR=CAST(CONFIG_READ(PARAMS,SECTION,'UseCompressor','0') AS INTEGER);
COMPRESSOR_LEVEL=CAST(CONFIG_READ(PARAMS,SECTION,'CompressorLevel','0') AS INTEGER);
END
END
--
CREATE OR ALTER PROCEDURE GET_CLIENT_GROUP_PATH
(
CLIENT_GROUP_ID VARCHAR(32),
DELIM VARCHAR(10)
)
RETURNS
(
PATH VARCHAR(4000)
)
AS
DECLARE NAME VARCHAR(100);
DECLARE PRIOR_PATH VARCHAR(1000);
DECLARE PARENT_ID VARCHAR(32);
BEGIN
PARENT_ID=NULL;
SELECT NAME, PARENT_ID
FROM CLIENT_GROUPS
WHERE CLIENT_GROUP_ID=:CLIENT_GROUP_ID
INTO :NAME, :PARENT_ID;
IF (PARENT_ID IS NOT NULL) THEN BEGIN
EXECUTE PROCEDURE GET_CLIENT_GROUP_PATH(PARENT_ID,DELIM)
RETURNING_VALUES PRIOR_PATH;
PATH=PRIOR_PATH||DELIM||NAME;
END ELSE BEGIN
PATH=NAME;
END
END
--
CREATE OR ALTER PROCEDURE GET_CALL_INFO
(
ACCOUNT_ID VARCHAR(32),
ACCOUNT_PHONE VARCHAR(32)
)
RETURNS
(
CALL_ACCOUNT_ID VARCHAR(32),
CALL_NAME VARCHAR(100),
CALL_GROUP VARCHAR(4000),
CALL_DESCRIPTION VARCHAR(250),
CALL_KIND INTEGER
)
AS
DECLARE CALL_PHONE VARCHAR(100);
DECLARE PHONE VARCHAR(100);
DECLARE CNT INTEGER;
DECLARE USER_NAME VARCHAR(100);
DECLARE SURNAME VARCHAR(100);
DECLARE NAME VARCHAR(100);
DECLARE PATRONYMIC VARCHAR(100);
DECLARE DESCRIPTION VARCHAR(250);
DECLARE IS_ROLE INTEGER;
DECLARE FIRM_SMALL_NAME VARCHAR(250);
DECLARE CLIENT_GROUP_ID VARCHAR(32);
BEGIN
CALL_KIND=0; /* Unknown */
CALL_GROUP='Неизвестно';
CALL_PHONE=ACCOUNT_PHONE;
FOR SELECT A.ACCOUNT_ID, A.USER_NAME, A.SURNAME, A.NAME,
A.PATRONYMIC, A.DESCRIPTION, A.IS_ROLE, F.SMALL_NAME
FROM CLIENTS C
JOIN ACCOUNTS A ON A.ACCOUNT_ID=C.CLIENT_ID
LEFT JOIN FIRMS F ON F.FIRM_ID=A.FIRM_ID
LEFT JOIN CLIENT_PHONES CP ON CP.CLIENT_ID=C.CLIENT_ID
WHERE CP.PHONE=:CALL_PHONE
OR A.PHONE=:CALL_PHONE
OR A.ACCOUNT_ID=:ACCOUNT_ID
INTO :ACCOUNT_ID, :USER_NAME, :SURNAME, :NAME,
:PATRONYMIC, :DESCRIPTION, :IS_ROLE, :FIRM_SMALL_NAME DO BEGIN
BREAK;
END
IF (ACCOUNT_ID IS NULL) THEN BEGIN
FOR SELECT A.ACCOUNT_ID, A.USER_NAME, A.SURNAME, A.NAME,
A.PATRONYMIC, A.DESCRIPTION, A.IS_ROLE, F.SMALL_NAME
FROM ACCOUNTS A
LEFT JOIN FIRMS F ON F.FIRM_ID=A.FIRM_ID
WHERE A.PHONE=:CALL_PHONE
INTO :ACCOUNT_ID, :USER_NAME, :SURNAME, :NAME,
:PATRONYMIC, :DESCRIPTION, :IS_ROLE, :FIRM_SMALL_NAME DO BEGIN
BREAK;
END
END ELSE BEGIN
FOR SELECT A.ACCOUNT_ID, A.USER_NAME, A.SURNAME, A.NAME,
A.PATRONYMIC, A.DESCRIPTION, A.IS_ROLE, F.SMALL_NAME
FROM ACCOUNTS A
LEFT JOIN FIRMS F ON F.FIRM_ID=A.FIRM_ID
WHERE A.ACCOUNT_ID=:ACCOUNT_ID
INTO :ACCOUNT_ID, :USER_NAME, :SURNAME, :NAME,
:PATRONYMIC, :DESCRIPTION, :IS_ROLE, :FIRM_SMALL_NAME DO BEGIN
BREAK;
END
END
CALL_ACCOUNT_ID=ACCOUNT_ID;
IF (ACCOUNT_ID IS NOT NULL) THEN BEGIN
CALL_NAME=TRIM(CALL_PHONE);
CALL_DESCRIPTION=NULL;
IF (SURNAME IS NOT NULL) THEN
CALL_DESCRIPTION=TRIM(SURNAME);
IF (NAME IS NOT NULL) THEN
CALL_DESCRIPTION=CALL_DESCRIPTION||' '||TRIM(NAME);
IF (PATRONYMIC IS NOT NULL) THEN
CALL_DESCRIPTION=CALL_DESCRIPTION||' '||TRIM(PATRONYMIC);
IF (USER_NAME IS NOT NULL) THEN
CALL_DESCRIPTION=TRIM(USER_NAME)||' - '||CALL_DESCRIPTION;
IF (FIRM_SMALL_NAME IS NOT NULL) THEN BEGIN
CALL_DESCRIPTION=CALL_DESCRIPTION||' ['||TRIM(FIRM_SMALL_NAME)||']';
END
SELECT COUNT(*)
FROM CLIENTS
WHERE CLIENT_ID=:ACCOUNT_ID
INTO :CNT;
IF (CNT>0) THEN BEGIN
CLIENT_GROUP_ID=NULL;
SELECT CLIENT_GROUP_ID
FROM CLIENTS
WHERE CLIENT_ID=:ACCOUNT_ID
INTO :CLIENT_GROUP_ID;
IF (CLIENT_GROUP_ID IS NOT NULL) THEN BEGIN
CALL_GROUP=NULL;
EXECUTE PROCEDURE GET_CLIENT_GROUP_PATH(CLIENT_GROUP_ID,'/')
RETURNING_VALUES CALL_GROUP;
END
CALL_KIND=1; /* Client */
IF (CALL_GROUP IS NOT NULL) THEN
CALL_GROUP='Клиенты/'||CALL_GROUP;
ELSE
CALL_GROUP='Клиенты';
END ElSE BEGIN
SELECT COUNT(*)
FROM DRIVERS
WHERE DRIVER_ID=:ACCOUNT_ID
INTO :CNT;
IF (CNT>0) THEN BEGIN
CALL_KIND=2; /* Driver */
CALL_GROUP='Водители';
END ELSE BEGIN
SELECT COUNT(*)
FROM DISPATCHERS
WHERE DISPATCHER_ID=:ACCOUNT_ID
INTO :CNT;
IF (CNT>0) THEN BEGIN
CALL_KIND=3; /* Dispatcher */
CALL_GROUP='Диспетчеры';
END ElSE BEGIN
CALL_KIND=4; /* Account */
CALL_GROUP='Учетные записи';
END
END
END
END ELSE BEGIN
CALL_NAME=CALL_PHONE;
END
END
--
CREATE TABLE CALL_RESULTS
(
CALL_RESULT_ID VARCHAR(32) NOT NULL,
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
VISIBLE INTEGER NOT NULL,
PRIORITY INTEGER,
PRIMARY KEY (CALL_RESULT_ID)
)
--
CREATE VIEW S_CALL_RESULTS
AS
SELECT *
FROM CALL_RESULTS
--
CREATE OR ALTER PROCEDURE I_CALL_RESULT
(
CALL_RESULT_ID VARCHAR(32),
NAME VARCHAR(100),
DESCRIPTION VARCHAR(250),
VISIBLE INTEGER,
PRIORITY INTEGER
)
AS
BEGIN
INSERT INTO CALL_RESULTS (CALL_RESULT_ID,NAME,DESCRIPTION,VISIBLE,PRIORITY)
VALUES (:CALL_RESULT_ID,:NAME,:DESCRIPTION,:VISIBLE,:PRIORITY);
END
--
CREATE OR ALTER PROCEDURE U_CALL_RESULT
(
CALL_RESULT_ID VARCHAR(32),
NAME VARCHAR(100),
DESCRIPTION VARCHAR(250),
VISIBLE INTEGER,
PRIORITY INTEGER,
OLD_CALL_RESULT_ID VARCHAR(32)
)
AS
BEGIN
UPDATE CALL_RESULTS
SET CALL_RESULT_ID=:CALL_RESULT_ID,
NAME=:NAME,
DESCRIPTION=:DESCRIPTION,
VISIBLE=:VISIBLE,
PRIORITY=:PRIORITY
WHERE CALL_RESULT_ID=:OLD_CALL_RESULT_ID;
END
--
CREATE OR ALTER PROCEDURE D_CALL_RESULT
(
OLD_CALL_RESULT_ID VARCHAR(32)
)
AS
BEGIN
DELETE FROM CALL_RESULTS
WHERE CALL_RESULT_ID=:OLD_CALL_RESULT_ID;
END;
--
/* Создание таблицы вызовов */
CREATE TABLE CALLS
(
CALL_ID VARCHAR(32) NOT NULL,
CALL_RESULT_ID VARCHAR(32) NOT NULL,
LINE_ID VARCHAR(32) NOT NULL,
DIRECTION INTEGER NOT NULL,
OPERATOR_ID VARCHAR(32),
ORDER_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
CREATOR_ID VARCHAR(32) NOT NULL,
DATE_CREATE TIMESTAMP NOT NULL,
CALLER_ID VARCHAR(32),
CALLER_PHONE VARCHAR(100),
ACCEPTOR_ID VARCHAR(32),
ACCEPTOR_PHONE VARCHAR(100),
DATE_FOUND TIMESTAMP,
DATE_BEGIN TIMESTAMP,
DATE_END TIMESTAMP,
TYPE_END INTEGER,
CALLER_AUDIO BLOB,
ACCEPTOR_AUDIO BLOB,
IN_CHANNEL VARCHAR(100),
OUT_CHANNEL VARCHAR(100),
PRIMARY KEY (CALL_ID),
FOREIGN KEY (CALL_RESULT_ID) REFERENCES CALL_RESULTS (CALL_RESULT_ID),
FOREIGN KEY (OPERATOR_ID) REFERENCES OPERATORS (OPERATOR_ID),
FOREIGN KEY (ORDER_ID) REFERENCES ORDERS (ORDER_ID),
FOREIGN KEY (FIRM_ID) REFERENCES FIRMS (FIRM_ID),
FOREIGN KEY (CREATOR_ID) REFERENCES ACCOUNTS (ACCOUNT_ID),
FOREIGN KEY (CALLER_ID) REFERENCES ACCOUNTS (ACCOUNT_ID),
FOREIGN KEY (ACCEPTOR_ID) REFERENCES ACCOUNTS (ACCOUNT_ID)
)
--
/* Создание просмотра вызовов */
CREATE OR ALTER VIEW S_CALLS
AS
SELECT C.CALL_ID,
C.CALL_RESULT_ID,
C.LINE_ID,
C.DIRECTION,
C.OPERATOR_ID,
C.ORDER_ID,
C.FIRM_ID,
C.CREATOR_ID,
C.DATE_CREATE,
C.CALLER_ID,
C.CALLER_PHONE,
C.ACCEPTOR_ID,
C.ACCEPTOR_PHONE,
C.DATE_FOUND,
C.DATE_BEGIN,
C.DATE_END,
C.TYPE_END,
LOAD_BLOB('E:\Taxi\audio\'||BLOB_TO_STRING(C.CALLER_AUDIO,1,32)) AS CALLER_AUDIO,
LOAD_BLOB('E:\Taxi\audio\'||BLOB_TO_STRING(C.ACCEPTOR_AUDIO,1,32)) AS ACCEPTOR_AUDIO,
C.IN_CHANNEL,
C.OUT_CHANNEL,
CR.NAME AS CALL_RESULT_NAME,
A1.USER_NAME AS CREATOR_USER_NAME,
OP.NAME AS OPERATOR_NAME,
A2.USER_NAME AS CALLER_USER_NAME,
A2.SURNAME AS CALLER_SURNAME,
A2.NAME AS CALLER_NAME,
A2.PATRONYMIC AS CALLER_PATRONYMIC,
A3.USER_NAME AS ACCEPTOR_USER_NAME,
A3.SURNAME AS ACCEPTOR_SURNAME,
A3.NAME AS ACCEPTOR_NAME,
A3.PATRONYMIC AS ACCEPTOR_PATRONYMIC,
F.SMALL_NAME AS FIRM_SMALL_NAME
FROM CALLS C
JOIN ACCOUNTS A1 ON A1.ACCOUNT_ID=C.CREATOR_ID
LEFT JOIN CALL_RESULTS CR ON CR.CALL_RESULT_ID=C.CALL_RESULT_ID
LEFT JOIN OPERATORS OP ON OP.OPERATOR_ID=C.OPERATOR_ID
LEFT JOIN ACCOUNTS A2 ON A2.ACCOUNT_ID=C.CALLER_ID
LEFT JOIN ACCOUNTS A3 ON A3.ACCOUNT_ID=C.ACCEPTOR_ID
LEFT JOIN FIRMS F ON F.FIRM_ID=C.FIRM_ID
--
/* Создание процедуры добавления вызова */
CREATE OR ALTER PROCEDURE I_CALL
(
CALL_ID VARCHAR(32),
CALL_RESULT_ID VARCHAR(32),
LINE_ID VARCHAR(32),
DIRECTION INTEGER,
OPERATOR_ID VARCHAR(32),
ORDER_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
CREATOR_ID VARCHAR(32),
DATE_CREATE TIMESTAMP,
CALLER_ID VARCHAR(32),
CALLER_PHONE VARCHAR(100),
ACCEPTOR_ID VARCHAR(32),
ACCEPTOR_PHONE VARCHAR(100),
DATE_FOUND TIMESTAMP,
DATE_BEGIN TIMESTAMP,
DATE_END TIMESTAMP,
TYPE_END INTEGER,
CALLER_AUDIO BLOB,
ACCEPTOR_AUDIO BLOB,
IN_CHANNEL VARCHAR(100),
OUT_CHANNEL VARCHAR(100)
)
AS
DECLARE PATH VARCHAR(50)='E:\Taxi\audio\';
DECLARE S VARCHAR(32);
DECLARE TEMP_CALLER_AUDIO BLOB;
DECLARE TEMP_ACCEPTOR_AUDIO BLOB;
BEGIN
S=GET_UNIQUE_ID();
TEMP_CALLER_AUDIO=NULL;
IF (BLOB_LENGTH(CALLER_AUDIO)>0) THEN BEGIN
IF (SAVE_BLOB(CALLER_AUDIO,PATH||S)=0) THEN
TEMP_CALLER_AUDIO=STRING_TO_BLOB(S);
END
S=GET_UNIQUE_ID();
TEMP_ACCEPTOR_AUDIO=NULL;
IF (BLOB_LENGTH(ACCEPTOR_AUDIO)>0) THEN BEGIN
IF (SAVE_BLOB(ACCEPTOR_AUDIO,PATH||S)=0) THEN
TEMP_ACCEPTOR_AUDIO=STRING_TO_BLOB(S);
END
INSERT INTO CALLS (CALL_ID,CALL_RESULT_ID,LINE_ID,DIRECTION,OPERATOR_ID,
ORDER_ID,FIRM_ID,CREATOR_ID,DATE_CREATE,CALLER_ID,CALLER_PHONE,
ACCEPTOR_ID,ACCEPTOR_PHONE,DATE_FOUND,DATE_BEGIN,DATE_END,TYPE_END,
CALLER_AUDIO,ACCEPTOR_AUDIO,IN_CHANNEL,OUT_CHANNEL)
VALUES (:CALL_ID,:CALL_RESULT_ID,:LINE_ID,:DIRECTION,:OPERATOR_ID,
:ORDER_ID,:FIRM_ID,:CREATOR_ID,:DATE_CREATE,:CALLER_ID,:CALLER_PHONE,
:ACCEPTOR_ID,:ACCEPTOR_PHONE,:DATE_FOUND,:DATE_BEGIN,:DATE_END,:TYPE_END,
:TEMP_CALLER_AUDIO,:TEMP_ACCEPTOR_AUDIO,:IN_CHANNEL,:OUT_CHANNEL);
END;
--
/* Создание процедуры изменения вызова */
CREATE OR ALTER PROCEDURE U_CALL
(
CALL_ID VARCHAR(32),
CALL_RESULT_ID VARCHAR(32),
LINE_ID VARCHAR(32),
DIRECTION INTEGER,
OPERATOR_ID VARCHAR(32),
ORDER_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
CREATOR_ID VARCHAR(32),
DATE_CREATE TIMESTAMP,
CALLER_ID VARCHAR(32),
CALLER_PHONE VARCHAR(100),
ACCEPTOR_ID VARCHAR(32),
ACCEPTOR_PHONE VARCHAR(100),
DATE_FOUND TIMESTAMP,
DATE_BEGIN TIMESTAMP,
DATE_END TIMESTAMP,
TYPE_END INTEGER,
CALLER_AUDIO BLOB,
ACCEPTOR_AUDIO BLOB,
IN_CHANNEL VARCHAR(100),
OUT_CHANNEL VARCHAR(100),
OLD_CALL_ID VARCHAR(32)
)
AS
DECLARE PATH VARCHAR(50)='E:\Taxi\audio\';
DECLARE S1 VARCHAR(32);
DECLARE S2 VARCHAR(32);
DECLARE TEMP_CALLER_AUDIO BLOB;
DECLARE TEMP_ACCEPTOR_AUDIO BLOB;
BEGIN
SELECT FIRST 1
BLOB_TO_STRING(C.CALLER_AUDIO,1,32),
BLOB_TO_STRING(C.ACCEPTOR_AUDIO,1,32)
FROM CALLS C
WHERE CALL_ID=:OLD_CALL_ID
INTO :S1, S2;
IF ((S1 IS NULL) OR (S1='')) THEN
S1=GET_UNIQUE_ID();
TEMP_CALLER_AUDIO=NULL;
IF (BLOB_LENGTH(CALLER_AUDIO)>0) THEN BEGIN
IF (SAVE_BLOB(CALLER_AUDIO,PATH||S1)=0) THEN
TEMP_CALLER_AUDIO=STRING_TO_BLOB(S1);
END ELSE
DELETE_FILE(PATH||S1);
IF ((S2 IS NULL) OR (S2='')) THEN
S2=GET_UNIQUE_ID();
TEMP_ACCEPTOR_AUDIO=NULL;
IF (BLOB_LENGTH(ACCEPTOR_AUDIO)>0) THEN BEGIN
IF (SAVE_BLOB(ACCEPTOR_AUDIO,PATH||S2)=0) THEN
TEMP_ACCEPTOR_AUDIO=STRING_TO_BLOB(S2);
END ELSE
DELETE_FILE(PATH||S2);
UPDATE CALLS
SET CALL_ID=:CALL_ID,
CALL_RESULT_ID=:CALL_RESULT_ID,
LINE_ID=:LINE_ID,
DIRECTION=:DIRECTION,
OPERATOR_ID=:OPERATOR_ID,
ORDER_ID=:ORDER_ID,
FIRM_ID=:FIRM_ID,
CREATOR_ID=:CREATOR_ID,
DATE_CREATE=:DATE_CREATE,
CALLER_ID=:CALLER_ID,
CALLER_PHONE=:CALLER_PHONE,
ACCEPTOR_ID=:ACCEPTOR_ID,
ACCEPTOR_PHONE=:ACCEPTOR_PHONE,
DATE_FOUND=:DATE_FOUND,
DATE_BEGIN=:DATE_BEGIN,
DATE_END=:DATE_END,
TYPE_END=:TYPE_END,
CALLER_AUDIO=:TEMP_CALLER_AUDIO,
ACCEPTOR_AUDIO=:TEMP_ACCEPTOR_AUDIO,
IN_CHANNEL=:IN_CHANNEL,
OUT_CHANNEL=:OUT_CHANNEL
WHERE CALL_ID=:OLD_CALL_ID;
END;
--
/* Создание процедуры удаления вызова */
CREATE OR ALTER PROCEDURE D_CALL
(
OLD_CALL_ID VARCHAR(32)
)
AS
DECLARE PATH VARCHAR(50)='E:\Taxi\audio\';
DECLARE S1 VARCHAR(32);
DECLARE S2 VARCHAR(32);
BEGIN
SELECT FIRST 1
BLOB_TO_STRING(CALLER_AUDIO,1,32),
BLOB_TO_STRING(ACCEPTOR_AUDIO,1,32)
FROM CALLS
WHERE CALL_ID=:OLD_CALL_ID
INTO :S1, :S2;
DELETE_FILE(PATH||S1);
DELETE_FILE(PATH||S2);
DELETE FROM CALLS
WHERE CALL_ID=:OLD_CALL_ID;
END;
--
CREATE OR ALTER PROCEDURE GET_CALL_PARAMS
(
SESSION_ID VARCHAR(32),
PROTOCOL INTEGER
)
RETURNS
(
CLIENT_IP VARCHAR(20),
CLIENT_PORT VARCHAR(10),
CLIENT_LISTEN_IP VARCHAR(20),
CLIENT_HOST VARCHAR(100),
CLIENT_PATH VARCHAR(100),
CLIENT_USE_CRYPTER INTEGER,
CLIENT_CRYPTER_ALGORITHM INTEGER,
CLIENT_CRYPTER_MODE INTEGER,
CLIENT_CRYPTER_KEY VARCHAR(100),
CLIENT_USE_COMPRESSOR INTEGER,
CLIENT_COMPRESSOR_LEVEL INTEGER,
SERVER_SESSION_ID VARCHAR(32),
SERVER_IP VARCHAR(20),
SERVER_PORT VARCHAR(10),
SERVER_LISTEN_IP VARCHAR(20),
SERVER_HOST VARCHAR(100),
SERVER_PATH VARCHAR(100),
SERVER_USE_CRYPTER INTEGER,
SERVER_CRYPTER_ALGORITHM INTEGER,
SERVER_CRYPTER_MODE INTEGER,
SERVER_CRYPTER_KEY VARCHAR(100),
SERVER_USE_COMPRESSOR INTEGER,
SERVER_COMPRESSOR_LEVEL INTEGER
)
AS
BEGIN
EXECUTE PROCEDURE GET_EVENT_PARAMS (SESSION_ID,PROTOCOL)
RETURNING_VALUES CLIENT_IP, CLIENT_PORT, CLIENT_LISTEN_IP, CLIENT_HOST, CLIENT_PATH,
CLIENT_USE_CRYPTER, CLIENT_CRYPTER_ALGORITHM, CLIENT_CRYPTER_MODE,
CLIENT_CRYPTER_KEY, CLIENT_USE_COMPRESSOR, CLIENT_COMPRESSOR_LEVEL;
FOR SELECT SESSION_ID, IP, PORT, LISTEN_IP, HOST, PATH,
USE_CRYPTER, CRYPTER_ALGORITHM, CRYPTER_MODE,
CRYPTER_KEY, USE_COMPRESSOR, COMPRESSOR_LEVEL
FROM GET_EVENT_SESSIONS (0,'A35F5701A7AA920E40812A71A690910D',NULL,:PROTOCOL)
INTO SERVER_SESSION_ID, SERVER_IP, SERVER_PORT, SERVER_LISTEN_IP, SERVER_HOST, SERVER_PATH,
SERVER_USE_CRYPTER, SERVER_CRYPTER_ALGORITHM, SERVER_CRYPTER_MODE,
SERVER_CRYPTER_KEY, SERVER_USE_COMPRESSOR, SERVER_COMPRESSOR_LEVEL DO BEGIN
BREAK;
END
END
--
CREATE OR ALTER PROCEDURE TRANSFORM_PHONE
(
IN_PHONE VARCHAR(100)
)
RETURNS
(
OUT_PHONE VARCHAR(100)
)
AS
DECLARE PREFIX VARCHAR(100);
DECLARE L INTEGER;
BEGIN
OUT_PHONE=NULL;
IF (IN_PHONE IS NOT NULL) THEN BEGIN
L=STRING_LENGTH(IN_PHONE);
IF (L>7) THEN BEGIN
IF (L<=12) THEN BEGIN
IF (L=12) THEN BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,2);
IF (PREFIX='+7') THEN
OUT_PHONE=IN_PHONE;
END ELSE BEGIN
IF (L>=10) THEN BEGIN
IF (L=10) THEN BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,3);
IF (PREFIX='391') THEN
OUT_PHONE=SUB_STRING(IN_PHONE,4,L);
ELSE
OUT_PHONE='+7'||IN_PHONE;
END ELSE BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,4);
IF (PREFIX='8391') THEN
OUT_PHONE=SUB_STRING(IN_PHONE,5,L);
ELSE BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,2);
IF (PREFIX='89') THEN
OUT_PHONE='+7'||SUB_STRING(IN_PHONE,2,L);
ELSE BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,1);
IF (PREFIX='7') THEN
OUT_PHONE='+'||IN_PHONE;
ELSE
OUT_PHONE=IN_PHONE;
END
END
END
END
END
END
END ELSE BEGIN
IF (L=7) THEN
OUT_PHONE=IN_PHONE;
ELSE BEGIN
IF (L=6) THEN
OUT_PHONE='2'||IN_PHONE;
END
END
END
END
--
CREATE OR ALTER PROCEDURE GET_OPERATOR
(
PHONE VARCHAR(100)
)
RETURNS
(
OPERATOR_ID VARCHAR(32),
RANGE_MIN BIGINT,
RANGE_MAX BIGINT,
PHONE_NUM BIGINT
)
AS
DECLARE RANGES VARCHAR(32000);
DECLARE RANGE VARCHAR(1000);
DECLARE POS INTEGER;
DECLARE FLAG INTEGER;
DECLARE AOPERATOR_ID VARCHAR(32);
DECLARE ARANGE_MIN BIGINT;
DECLARE ARANGE_MAX BIGINT;
DECLARE APHONE_NUM BIGINT;
BEGIN
OPERATOR_ID=NULL;
FLAG=0;
IF (PHONE IS NOT NULL) THEN BEGIN
PHONE=TRIM(REPLACE_STRING(PHONE,'+',''));
APHONE_NUM=CAST(PHONE AS BIGINT);
FOR SELECT OPERATOR_ID, CAST(BLOB_TO_STRING(RANGES,1,32000) AS VARCHAR(32000))
FROM OPERATORS
WHERE ENABLED=1
ORDER BY PRIORITY
INTO :AOPERATOR_ID, :RANGES DO BEGIN
IF (RANGES IS NOT NULL) THEN BEGIN
POS=-1;
WHILE (POS<>0) DO BEGIN
POS=POSITION(CHR(13)||CHR(10),RANGES);
IF (POS>0) THEN BEGIN
RANGE=SUB_STRING(RANGES,1,POS-1);
RANGES=SUB_STRING(RANGES,POS+2,32000);
END ELSE
RANGE=SUB_STRING(RANGES,1,1000);
EXECUTE PROCEDURE GET_RANGE(RANGE)
RETURNING_VALUES ARANGE_MIN, ARANGE_MAX;
IF ((APHONE_NUM>=ARANGE_MIN) AND (APHONE_NUM<=ARANGE_MAX)) THEN BEGIN
FLAG=1;
BREAK;
END
END
END
IF (FLAG=1) THEN BEGIN
OPERATOR_ID=:AOPERATOR_ID;
RANGE_MIN=ARANGE_MIN;
RANGE_MAX=ARANGE_MAX;
PHONE_NUM=APHONE_NUM;
BREAK;
END
END
END
END
--
CREATE OR ALTER PROCEDURE INCOMING_CALL_CHECK
(
CALLER_PHONE VARCHAR(100),
CHANNEL VARCHAR(100)
)
RETURNS
(
ACCOUNT_ID VARCHAR(32),
PHONE VARCHAR(100),
OPERATOR_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
CHECKED INTEGER
)
AS
DECLARE CNT INTEGER;
DECLARE RANGE_MIN BIGINT;
DECLARE RANGE_MAX BIGINT;
DECLARE PHONE_NUM BIGINT;
BEGIN
CHECKED=0;
IF (CHANNEL IS NOT NULL) THEN BEGIN
FIRM_ID=NULL;
IF (CHANNEL='CallServerSipChannel2026672') THEN
FIRM_ID='C49DF004D660BBAF434839044848F5B8';
IF (CHANNEL='CallServerSipChannel2904021') THEN
FIRM_ID='81DCAB751C23A5C942A41C19FE3FC78E';
END
IF ((CALLER_PHONE IS NOT NULL) AND (CALLER_PHONE<>'Anonymous')) THEN BEGIN
EXECUTE PROCEDURE TRANSFORM_PHONE (CALLER_PHONE)
RETURNING_VALUES PHONE;
EXECUTE PROCEDURE GET_OPERATOR (PHONE)
RETURNING_VALUES OPERATOR_ID, RANGE_MIN, RANGE_MAX, PHONE_NUM;
SELECT FIRST 1
ACCOUNT_ID
FROM ACCOUNTS
WHERE PHONE=:PHONE
INTO :ACCOUNT_ID;
IF (ACCOUNT_ID IS NULL) THEN BEGIN
SELECT FIRST 1
CLIENT_ID
FROM CLIENT_PHONES
WHERE PHONE=:PHONE
INTO :ACCOUNT_ID;
END
SELECT COUNT(*)
FROM BLACKS
WHERE PHONE=:PHONE
INTO :CNT;
IF (CNT=0) THEN BEGIN
CHECKED=1;
END
END
END
--
CREATE OR ALTER PROCEDURE OUTGOING_CALL_CHECK
(
CALLER_ID VARCHAR(32),
ACCEPTOR_PHONE VARCHAR(100)
)
RETURNS
(
ACCOUNT_ID VARCHAR(32),
PHONE VARCHAR(100),
OPERATOR_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
CHECKED INTEGER
)
AS
DECLARE CNT INTEGER;
DECLARE RANGE_MIN BIGINT;
DECLARE RANGE_MAX BIGINT;
DECLARE PHONE_NUM BIGINT;
BEGIN
CHECKED=0;
SELECT FIRST 1
FIRM_ID
FROM ACCOUNTS
WHERE ACCOUNT_ID=:CALLER_ID
INTO :FIRM_ID;
IF (ACCEPTOR_PHONE IS NOT NULL) THEN BEGIN
EXECUTE PROCEDURE TRANSFORM_PHONE (ACCEPTOR_PHONE)
RETURNING_VALUES PHONE;
EXECUTE PROCEDURE GET_OPERATOR (PHONE)
RETURNING_VALUES OPERATOR_ID, RANGE_MIN, RANGE_MAX, PHONE_NUM;
SELECT FIRST 1
ACCOUNT_ID
FROM ACCOUNTS
WHERE PHONE=:PHONE
INTO :ACCOUNT_ID;
IF (ACCOUNT_ID IS NULL) THEN BEGIN
SELECT FIRST 1
CLIENT_ID
FROM CLIENT_PHONES
WHERE PHONE=:PHONE
INTO :ACCOUNT_ID;
END
CHECKED=1;
END
END
--
CREATE OR ALTER PROCEDURE GET_CALL_SESSIONS
(
CALL_ID VARCHAR(32)
)
RETURNS (
SESSION_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32)
)
AS
DECLARE DIRECTION INTEGER;
DECLARE APPLICATION_ID VARCHAR(32);
DECLARE FIRM_ID VARCHAR(32);
DECLARE PARAMS BLOB;
DECLARE ENABLED INTEGER;
BEGIN
SELECT DIRECTION, FIRM_ID
FROM CALLS
WHERE CALL_ID=:CALL_ID
INTO :DIRECTION, :FIRM_ID;
IF (DIRECTION IS NOT NULL) THEN BEGIN
IF (DIRECTION=0) THEN BEGIN
SESSION_ID=NULL;
APPLICATION_ID='A35F5701A7AA920E40812A71A690910D';
FOR SELECT GS.SESSION_ID, GS.ACCOUNT_ID, S.PARAMS
FROM GET_EVENT_SESSIONS(0,:APPLICATION_ID,NULL,NULL) GS
JOIN DISPATCHERS D ON D.DISPATCHER_ID=GS.ACCOUNT_ID
JOIN ACCOUNTS A ON A.ACCOUNT_ID=D.DISPATCHER_ID
JOIN SESSIONS S ON S.SESSION_ID=GS.SESSION_ID
WHERE A.FIRM_ID=:FIRM_ID
UNION ALL
SELECT GS.SESSION_ID, GS.ACCOUNT_ID, S.PARAMS
FROM GET_EVENT_SESSIONS(0,:APPLICATION_ID,NULL,NULL) GS
JOIN DISPATCHERS D ON D.DISPATCHER_ID=GS.ACCOUNT_ID
JOIN ACCOUNTS A ON A.ACCOUNT_ID=D.DISPATCHER_ID
JOIN SESSIONS S ON S.SESSION_ID=GS.SESSION_ID
WHERE A.FIRM_ID<>:FIRM_ID
UNION ALL
SELECT GS.SESSION_ID, GS.ACCOUNT_ID, S.PARAMS
FROM GET_EVENT_SESSIONS(0,:APPLICATION_ID,NULL,NULL) GS
JOIN DISPATCHERS D ON D.DISPATCHER_ID=GS.ACCOUNT_ID
JOIN ACCOUNTS A ON A.ACCOUNT_ID=D.DISPATCHER_ID
JOIN SESSIONS S ON S.SESSION_ID=GS.SESSION_ID
WHERE A.FIRM_ID IS NULL
INTO :SESSION_ID, :ACCOUNT_ID, :PARAMS DO BEGIN
ENABLED=CAST(CONFIG_READ(PARAMS,'TaxiPhoneForm','Enabled','0') AS INTEGER);
IF (ENABLED=1) THEN
SUSPEND;
END
END
END
END
--
CREATE OR ALTER PROCEDURE CODE_MAKE_ORDER
(
SESSION_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32),
IN_MESSAGE_ID VARCHAR(32)
)
AS
DECLARE CONTACT VARCHAR(100);
DECLARE SENDER_ID VARCHAR(32);
DECLARE S VARCHAR(70);
DECLARE CNT INTEGER;
DECLARE CONST_VALUE VARCHAR(4000);
DECLARE ORDER_NUM VARCHAR(10);
DECLARE ACTION_ID VARCHAR(32);
DECLARE RATE_ID VARCHAR(32);
DECLARE CAR_TYPE_ID VARCHAR(32);
DECLARE CLIENT_ID VARCHAR(32);
DECLARE STREET_ID VARCHAR(32);
DECLARE HOUSE VARCHAR(10);
DECLARE FLAT VARCHAR(10);
DECLARE PORCH VARCHAR(10);
DECLARE ADDRESS_DESC VARCHAR(250);
DECLARE LOCKED INTEGER;
DECLARE ORDER_ID VARCHAR(32);
DECLARE TYPE_MESSAGE INTEGER;
DECLARE DEST_PORT INTEGER;
DECLARE FIRM_ID VARCHAR(32);
DECLARE RND INTEGER;
DECLARE TYPE_ACCEPT INTEGER;
BEGIN
SELECT CONTACT, SENDER_ID, TYPE_MESSAGE
FROM IN_MESSAGES
WHERE IN_MESSAGE_ID=:IN_MESSAGE_ID
INTO :CONTACT, :SENDER_ID, TYPE_MESSAGE;
SELECT COUNT(*)
FROM BLACKS
WHERE UPPER(PHONE)=UPPER(:CONTACT)
INTO :CNT;
IF ((CONTACT IS NOT NULL) AND (CNT=0)) THEN BEGIN
SELECT LOCKED, CLIENT_ID, STREET_ID, HOUSE, FLAT, PORCH, ADDRESS_DESC
FROM CLIENTS C
JOIN ACCOUNTS A ON A.ACCOUNT_ID=C.CLIENT_ID
WHERE C.CLIENT_ID=:SENDER_ID
INTO :LOCKED, :CLIENT_ID, :STREET_ID, :HOUSE, :FLAT, :PORCH, :ADDRESS_DESC;
IF ((CLIENT_ID IS NULL) OR ((CLIENT_ID IS NOT NULL) AND (LOCKED<>1))) THEN BEGIN
SELECT CONST_VALUE FROM GET_CONST_VALUE('CB66FC06A78BB69D430EB7BD1AFA13FA') INTO :S;
EXECUTE PROCEDURE GET_TYPE_MESSAGE(SENDER_ID,TYPE_MESSAGE)
RETURNING_VALUES TYPE_MESSAGE, DEST_PORT;
IF ((S IS NOT NULL) AND (TYPE_MESSAGE IS NOT NULL)) THEN BEGIN
STREET_ID='FA27330C653381FA4EDE11ECF0959DD6'; /* Красноярск - .*/
HOUSE=NULL;
FLAT=NULL;
PORCH=NULL;
ADDRESS_DESC=NULL;
EXECUTE PROCEDURE GET_ORDER_NUM
RETURNING_VALUES :ORDER_NUM;
ACTION_ID='E019DBDE7D55BEC34D12A709EE3FEB0B'; /* Создание */
RATE_ID=NULL;
FOR SELECT RATE_ID
FROM RATES
ORDER BY PRIORITY
INTO :RATE_ID DO BEGIN
BREAK;
END
CAR_TYPE_ID=NULL;
FOR SELECT CAR_TYPE_ID
FROM CAR_TYPES
ORDER BY PRIORITY
INTO :CAR_TYPE_ID DO BEGIN
BREAK;
END
IF ((RATE_ID IS NOT NULL) AND (CAR_TYPE_ID IS NOT NULL)) THEN BEGIN
ORDER_ID=GET_UNIQUE_ID();
FIRM_ID='C49DF004D660BBAF434839044848F5B8'; /* АТакси */
RND=RANDOM(10);
IF (RND=8) THEN
FIRM_ID='81DCAB751C23A5C942A41C19FE3FC78E'; /* Прорыв */
TYPE_ACCEPT=0;
IF (TYPE_MESSAGE IN (0,1)) THEN
TYPE_ACCEPT=1;
INSERT INTO ORDERS (ORDER_ID,ACTION_ID,RATE_ID,CAR_TYPE_ID,WHO_ACCEPT_ID,
CLIENT_ID,STREET_ID,HOUSE,FLAT,PORCH,DESCRIPTION,
ORDER_NUM,PHONE,DATE_ACCEPT,DATE_ARRIVAL,TYPE_ACCEPT,
TYPE_PROCESS,BEFORE_PERIOD,DATE_BEGIN,FINISHED,FIRM_ID)
VALUES (:ORDER_ID,:ACTION_ID,:RATE_ID,:CAR_TYPE_ID,:ACCOUNT_ID,
:CLIENT_ID,:STREET_ID,:HOUSE,:FLAT,:PORCH,:ADDRESS_DESC,
:ORDER_NUM,:CONTACT,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,:TYPE_ACCEPT,
1,30,CURRENT_TIMESTAMP,0,:FIRM_ID);
UPDATE IN_MESSAGES
SET ORDER_ID=:ORDER_ID
WHERE IN_MESSAGE_ID=:IN_MESSAGE_ID;
S=REPLACE_STRING(S,'%ORDER_NUM',ORDER_NUM);
INSERT INTO OUT_MESSAGES (OUT_MESSAGE_ID,CREATOR_ID,RECIPIENT_ID,DATE_CREATE,
TEXT_OUT,DATE_OUT,TYPE_MESSAGE,CONTACT,DESCRIPTION,
PRIORITY,LOCKED,DATE_BEGIN,ORDER_ID,DEST_PORT,FIRM_ID)
VALUES (GET_UNIQUE_ID(),:ACCOUNT_ID,:SENDER_ID,CURRENT_TIMESTAMP,
:S,NULL,:TYPE_MESSAGE,:CONTACT,NULL,
1,NULL,CURRENT_TIMESTAMP,:ORDER_ID,:DEST_PORT,:FIRM_ID);
END
END
END
END
END
--
CREATE OR ALTER PROCEDURE GET_CALL_SERVER_SESSION_ID
(
PROTOCOL INTEGER
)
RETURNS
(
SERVER_SESSION_ID VARCHAR(32)
)
AS
BEGIN
FOR SELECT SESSION_ID
FROM GET_EVENT_SESSIONS (0,'E1CA5F4E6E49A2324F78E8D3A7B7659B',NULL,:PROTOCOL)
INTO :SERVER_SESSION_ID DO BEGIN
BREAK;
END
END
--
CREATE OR ALTER PROCEDURE OUTGOING_PHONE_PREPARE
(
IN_PHONE VARCHAR(100),
CHANNEL VARCHAR(100)
)
RETURNS
(
OUT_PHONE VARCHAR(100)
)
AS
DECLARE PREFIX VARCHAR(100);
DECLARE L INTEGER;
BEGIN
OUT_PHONE=IN_PHONE;
IF (CHANNEL IS NOT NULL) THEN BEGIN
L=STRING_LENGTH(IN_PHONE);
IF (L>2) THEN BEGIN
PREFIX=SUB_STRING(IN_PHONE,1,2);
IF (PREFIX='+7') THEN
OUT_PHONE='8'||SUB_STRING(IN_PHONE,3,L);
END
END
END
--
ALTER TABLE ACCOUNTS
ADD PHONE_INTERNAL VARCHAR(100)
--
CREATE OR ALTER VIEW S_ACCOUNTS
AS
SELECT A.*,
F.SMALL_NAME AS FIRM_SMALL_NAME
FROM ACCOUNTS A
LEFT JOIN FIRMS F ON F.FIRM_ID=A.FIRM_ID
--
CREATE OR ALTER PROCEDURE I_ACCOUNT
(
ACCOUNT_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
DATE_CREATE TIMESTAMP,
USER_NAME VARCHAR(100),
"PASSWORD" VARCHAR(100),
DESCRIPTION VARCHAR(250),
DB_USER_NAME VARCHAR(100),
DB_PASSWORD VARCHAR(100),
IS_ROLE INTEGER,
LOCKED INTEGER,
AUTO_CREATED INTEGER,
SURNAME VARCHAR(100),
NAME VARCHAR(100),
PATRONYMIC VARCHAR(100),
PHONE VARCHAR(100),
EMAIL VARCHAR(100),
PHOTO BLOB,
JOB_TITLE VARCHAR(250),
PHONE_INTERNAL VARCHAR(100)
)
AS
BEGIN
INSERT INTO ACCOUNTS (ACCOUNT_ID,FIRM_ID,DATE_CREATE,USER_NAME,"PASSWORD",DESCRIPTION,DB_USER_NAME,DB_PASSWORD,
IS_ROLE,LOCKED,AUTO_CREATED,SURNAME,NAME,PATRONYMIC,PHONE,EMAIL,PHOTO,JOB_TITLE,PHONE_INTERNAL)
VALUES (:ACCOUNT_ID,:FIRM_ID,:DATE_CREATE,:USER_NAME,:"PASSWORD",:DESCRIPTION,:DB_USER_NAME,:DB_PASSWORD,
:IS_ROLE,:LOCKED,:AUTO_CREATED,:SURNAME,:NAME,:PATRONYMIC,:PHONE,:EMAIL,:PHOTO,:JOB_TITLE,:PHONE_INTERNAL);
END
--
CREATE OR ALTER PROCEDURE U_ACCOUNT
(
ACCOUNT_ID VARCHAR(32),
FIRM_ID VARCHAR(32),
DATE_CREATE TIMESTAMP,
USER_NAME VARCHAR(100),
"PASSWORD" VARCHAR(100),
DESCRIPTION VARCHAR(250),
DB_USER_NAME VARCHAR(100),
DB_PASSWORD VARCHAR(100),
IS_ROLE INTEGER,
LOCKED INTEGER,
AUTO_CREATED INTEGER,
SURNAME VARCHAR(100),
NAME VARCHAR(100),
PATRONYMIC VARCHAR(100),
PHONE VARCHAR(100),
EMAIL VARCHAR(100),
PHOTO BLOB,
JOB_TITLE VARCHAR(250),
PHONE_INTERNAL VARCHAR(100),
OLD_ACCOUNT_ID VARCHAR(32)
)
AS
BEGIN
UPDATE ACCOUNTS
SET ACCOUNT_ID=:ACCOUNT_ID,
FIRM_ID=:FIRM_ID,
DATE_CREATE=:DATE_CREATE,
USER_NAME=:USER_NAME,
"PASSWORD"=:"PASSWORD",
DESCRIPTION=:DESCRIPTION,
DB_USER_NAME=:DB_USER_NAME,
DB_PASSWORD=:DB_PASSWORD,
IS_ROLE=:IS_ROLE,
LOCKED=:LOCKED,
AUTO_CREATED=:AUTO_CREATED,
SURNAME=:SURNAME,
NAME=:NAME,
PATRONYMIC=:PATRONYMIC,
PHONE=:PHONE,
EMAIL=:EMAIL,
PHOTO=:PHOTO,
JOB_TITLE=:JOB_TITLE,
PHONE_INTERNAL=:PHONE_INTERNAL
WHERE ACCOUNT_ID=:OLD_ACCOUNT_ID;
END
--
CREATE OR ALTER VIEW S_DISPATCHERS
AS
SELECT D.*,
A.PHONE,
A.DESCRIPTION,
A.USER_NAME,
A."PASSWORD",
A.DATE_CREATE,
A.LOCKED,
A.SURNAME,
A.NAME,
A.PATRONYMIC,
A.FIRM_ID,
A.PHONE_INTERNAL,
CL.NAME AS CALC_NAME,
F.SMALL_NAME AS FIRM_SMALL_NAME
FROM DISPATCHERS D
JOIN ACCOUNTS A ON A.ACCOUNT_ID=D.DISPATCHER_ID
LEFT JOIN CALCS CL ON CL.CALC_ID=D.CALC_ID
LEFT JOIN FIRMS F ON F.FIRM_ID=A.FIRM_ID
--
CREATE OR ALTER PROCEDURE I_DISPATCHER
(
DISPATCHER_ID VARCHAR(32),
CALC_ID VARCHAR(32),
PHONE VARCHAR(100),
PHONE_HOME VARCHAR(100),
PHONE_INTERNAL VARCHAR(100),
DESCRIPTION VARCHAR(250),
PASSPORT VARCHAR(250),
PLACE_BIRTH VARCHAR(250),
DATE_BIRTH DATE,
ADDRESS_RESIDENCE VARCHAR(250),
ADDRESS_ACTUAL VARCHAR(250),
USER_NAME VARCHAR(100),
LOCKED INTEGER,
SURNAME VARCHAR(100),
NAME VARCHAR(100),
PATRONYMIC VARCHAR(100),
"PASSWORD" VARCHAR(100),
FIRM_ID VARCHAR(32)
)
AS
DECLARE ROLE_ID VARCHAR(32);
BEGIN
INSERT INTO ACCOUNTS(ACCOUNT_ID,FIRM_ID,DATE_CREATE,USER_NAME,LOCKED,SURNAME,NAME,PATRONYMIC,
IS_ROLE,PHONE,DESCRIPTION,"PASSWORD",PHONE_INTERNAL)
VALUES (:DISPATCHER_ID,:FIRM_ID,CURRENT_TIMESTAMP,:USER_NAME,:LOCKED,:SURNAME,:NAME,:PATRONYMIC,
0,:PHONE,:DESCRIPTION,:"PASSWORD",:PHONE_INTERNAL);
INSERT INTO DISPATCHERS (DISPATCHER_ID,CALC_ID,PHONE_HOME,
PASSPORT,PLACE_BIRTH,DATE_BIRTH,
ADDRESS_RESIDENCE,ADDRESS_ACTUAL)
VALUES (:DISPATCHER_ID,:CALC_ID,:PHONE_HOME,
:PASSPORT,:PLACE_BIRTH,:DATE_BIRTH,
:ADDRESS_RESIDENCE,:ADDRESS_ACTUAL);
ROLE_ID='FF7F332564F795C8411BF28652B22BEA'; /* Диспетчеры */
INSERT INTO ACCOUNT_ROLES (ROLE_ID,ACCOUNT_ID)
VALUES (:ROLE_ID,:DISPATCHER_ID);
END
--
CREATE OR ALTER PROCEDURE U_DISPATCHER
(
DISPATCHER_ID VARCHAR(32),
CALC_ID VARCHAR(32),
PHONE VARCHAR(100),
PHONE_HOME VARCHAR(100),
PHONE_INTERNAL VARCHAR(100),
DESCRIPTION VARCHAR(250),
PASSPORT VARCHAR(250),
PLACE_BIRTH VARCHAR(250),
DATE_BIRTH DATE,
ADDRESS_RESIDENCE VARCHAR(250),
ADDRESS_ACTUAL VARCHAR(250),
USER_NAME VARCHAR(100),
LOCKED INTEGER,
SURNAME VARCHAR(100),
NAME VARCHAR(100),
PATRONYMIC VARCHAR(100),
"PASSWORD" VARCHAR(100),
FIRM_ID VARCHAR(32),
OLD_DISPATCHER_ID VARCHAR(32)
)
AS
BEGIN
UPDATE ACCOUNTS
SET ACCOUNT_ID=:DISPATCHER_ID,
FIRM_ID=:FIRM_ID,
USER_NAME=:USER_NAME,
"PASSWORD"=:"PASSWORD",
LOCKED=:LOCKED,
SURNAME=:SURNAME,
NAME=:NAME,
PATRONYMIC=:PATRONYMIC,
IS_ROLE=0,
PHONE=:PHONE,
DESCRIPTION=:DESCRIPTION,
PHONE_INTERNAL=:PHONE_INTERNAL
WHERE ACCOUNT_ID=:OLD_DISPATCHER_ID;
UPDATE DISPATCHERS
SET DISPATCHER_ID=:DISPATCHER_ID,
CALC_ID=:CALC_ID,
PHONE_HOME=:PHONE_HOME,
PASSPORT=:PASSPORT,
PLACE_BIRTH=:PLACE_BIRTH,
DATE_BIRTH=:DATE_BIRTH,
ADDRESS_RESIDENCE=:ADDRESS_RESIDENCE,
ADDRESS_ACTUAL=:ADDRESS_ACTUAL
WHERE DISPATCHER_ID=:OLD_DISPATCHER_ID;
END
--
CREATE OR ALTER PROCEDURE APPLY_CALL_RESULT
(
CALL_ID VARCHAR(32),
CALL_RESULT_ID VARCHAR(32),
ORDER_ID VARCHAR(32)
)
AS
BEGIN
UPDATE CALLS
SET CALL_RESULT_ID=:CALL_RESULT_ID,
ORDER_ID=:ORDER_ID
WHERE CALL_ID=:CALL_ID;
END
--
CREATE OR ALTER PROCEDURE I_BLACK
(
BLACK_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32),
STREET_ID VARCHAR(32),
HOUSE VARCHAR(10),
FLAT VARCHAR(10),
DATE_CREATE TIMESTAMP,
PHONE VARCHAR(100),
DESCRIPTION VARCHAR(250)
)
AS
DECLARE CNT INTEGER;
BEGIN
SELECT COUNT(*)
FROM BLACKS
WHERE PHONE=:PHONE
INTO :CNT;
IF (CNT>0) THEN
EXCEPTION E 'Телефон уже существует';
INSERT INTO BLACKS (BLACK_ID,ACCOUNT_ID,STREET_ID,HOUSE,FLAT,
DATE_CREATE,PHONE,DESCRIPTION)
VALUES (:BLACK_ID,:ACCOUNT_ID,:STREET_ID,:HOUSE,:FLAT,
:DATE_CREATE,:PHONE,:DESCRIPTION);
END
--
CREATE OR ALTER PROCEDURE CREATE_ORDER_HISTORY
(
SESSION_ID VARCHAR(32),
OLD_ORDER_ID VARCHAR(32),
NEW_ORDER_ID VARCHAR(32),
ACCOUNT_ID VARCHAR(32),
ACTION_ID VARCHAR(32),
RESULT_ID VARCHAR(32),
TYPE_PROCESS INTEGER,
DATE_BEGIN TIMESTAMP,
WITH_DEPENDS INTEGER,
WITH_EVENT INTEGER
)
AS
BEGIN
INSERT INTO ORDERS (ORDER_ID,PARENT_ID,ACTION_ID,RATE_ID,CAR_TYPE_ID,
WHO_ACCEPT_ID,STREET_ID,ZONE_ID,CAR_ID,
WHO_PROCESS_ID,RESULT_ID,PARK_ID,SOURCE_ID,DISCOUNT_ID,
DRIVER_ID,ORDER_NUM,PHONE,HOUSE,FLAT,PORCH,
DATE_ACCEPT,DATE_ARRIVAL,DATE_BEGIN,DATE_END,CUSTOMER,
DESCRIPTION,COST_RATE,COST_FACT,TYPE_ACCEPT,
TYPE_PROCESS,DATE_HISTORY,WHO_HISTORY_ID,BEFORE_PERIOD,
FINISHED,LOCKED,CLIENT_ID,COST_GROSS,FIRM_ID)
SELECT :NEW_ORDER_ID,NULL,:ACTION_ID,RATE_ID,CAR_TYPE_ID,
WHO_ACCEPT_ID,STREET_ID,ZONE_ID,CAR_ID,
NULL,:RESULT_ID,PARK_ID,SOURCE_ID,DISCOUNT_ID,
DRIVER_ID,ORDER_NUM,PHONE,HOUSE,FLAT,PORCH,
DATE_ACCEPT,DATE_ARRIVAL,:DATE_BEGIN,NULL,CUSTOMER,
DESCRIPTION,COST_RATE,COST_FACT,TYPE_ACCEPT,
:TYPE_PROCESS,NULL,NULL,BEFORE_PERIOD,FINISHED,LOCKED,CLIENT_ID,COST_GROSS,FIRM_ID
FROM ORDERS
WHERE ORDER_ID=:OLD_ORDER_ID;
IF (WITH_DEPENDS IS NOT NULL) THEN BEGIN
INSERT INTO ROUTES (ROUTE_ID,ORDER_ID,ZONE_ID,STREET_ID,HOUSE,
FLAT,PORCH,DISTANCE,COST,PERIOD,AMOUNT,PRIORITY)
SELECT GET_UNIQUE_ID(),:NEW_ORDER_ID,ZONE_ID,STREET_ID,HOUSE,
FLAT,PORCH,DISTANCE,COST,PERIOD,AMOUNT,PRIORITY
FROM ROUTES
WHERE ORDER_ID=:OLD_ORDER_ID;
INSERT INTO ORDER_SERVICES (ORDER_ID,SERVICE_ID,COST,
DESCRIPTION,AMOUNT,PRIORITY)
SELECT :NEW_ORDER_ID,SERVICE_ID,COST,
DESCRIPTION,AMOUNT,PRIORITY
FROM ORDER_SERVICES
WHERE ORDER_ID=:OLD_ORDER_ID;
END
UPDATE ORDERS
SET PARENT_ID=:NEW_ORDER_ID,
DATE_HISTORY=CURRENT_TIMESTAMP,
WHO_HISTORY_ID=:ACCOUNT_ID
WHERE ORDER_ID=:OLD_ORDER_ID;
UPDATE ORDERS
SET PARENT_ID=:NEW_ORDER_ID
WHERE PARENT_ID=:OLD_ORDER_ID;
UPDATE IN_MESSAGES
SET ORDER_ID=:NEW_ORDER_ID
WHERE ORDER_ID=:OLD_ORDER_ID;
UPDATE OUT_MESSAGES
SET ORDER_ID=:NEW_ORDER_ID
WHERE ORDER_ID=:OLD_ORDER_ID;
UPDATE CALLS
SET ORDER_ID=:NEW_ORDER_ID
WHERE ORDER_ID=:OLD_ORDER_ID;
IF (WITH_EVENT IS NOT NULL) THEN
EXECUTE PROCEDURE EVENT_REFRESH_ORDER('A35F5701A7AA920E40812A71A690910D',NULL,SESSION_ID,0,
OLD_ORDER_ID,NEW_ORDER_ID,TYPE_PROCESS,NULL);
END
--
CREATE OR ALTER PROCEDURE I_ORDER
(
SESSION_ID VARCHAR(32),
ORDER_ID VARCHAR(32),
ACTION_ID VARCHAR(32),
RATE_ID VARCHAR(32),
CAR_TYPE_ID VARCHAR(32),
WHO_ACCEPT_ID VARCHAR(32),
STREET_ID VARCHAR(32),
ZONE_ID VARCHAR(32),
PARENT_ID VARCHAR(32),
CAR_ID VARCHAR(32),
WHO_PROCESS_ID VARCHAR(32),
RESULT_ID VARCHAR(32),
PARK_ID VARCHAR(32),
SOURCE_ID VARCHAR(32),
DISCOUNT_ID VARCHAR(32),
DRIVER_ID VARCHAR(32),
ORDER_NUM VARCHAR(10),
PHONE VARCHAR(100),
HOUSE VARCHAR(10),
FLAT VARCHAR(10),
PORCH VARCHAR(10),
DATE_ACCEPT TIMESTAMP,
DATE_ARRIVAL TIMESTAMP,
DATE_BEGIN TIMESTAMP,
DATE_END TIMESTAMP,
CUSTOMER VARCHAR(250),
DESCRIPTION VARCHAR(250),
COST_RATE NUMERIC(15,2),
COST_FACT NUMERIC(15,2),
TYPE_ACCEPT INTEGER,
TYPE_PROCESS INTEGER,
DATE_HISTORY TIMESTAMP,
WHO_HISTORY_ID VARCHAR(32),
BEFORE_PERIOD INTEGER,
FINISHED INTEGER,
LOCKED VARCHAR(32),
CLIENT_ID VARCHAR(32),
COST_GROSS NUMERIC(15,2),
FIRM_ID VARCHAR(32),
CALL_ID VARCHAR(32)
)
AS
BEGIN
INSERT INTO ORDERS (ORDER_ID,ACTION_ID,RATE_ID,CAR_TYPE_ID,WHO_ACCEPT_ID,
STREET_ID,ZONE_ID,PARENT_ID,
CAR_ID,WHO_PROCESS_ID,RESULT_ID,PARK_ID,
SOURCE_ID,DISCOUNT_ID,DRIVER_ID,ORDER_NUM,PHONE,
HOUSE,FLAT,PORCH,
DATE_ACCEPT,DATE_ARRIVAL,DATE_BEGIN,DATE_END,CUSTOMER,
DESCRIPTION,COST_RATE,COST_FACT,TYPE_ACCEPT,
TYPE_PROCESS,DATE_HISTORY,WHO_HISTORY_ID,BEFORE_PERIOD,
FINISHED,LOCKED,CLIENT_ID,COST_GROSS,FIRM_ID)
VALUES (:ORDER_ID,:ACTION_ID,:RATE_ID,:CAR_TYPE_ID,:WHO_ACCEPT_ID,
:STREET_ID,:ZONE_ID,:PARENT_ID,
:CAR_ID,:WHO_PROCESS_ID,:RESULT_ID,:PARK_ID,
:SOURCE_ID,:DISCOUNT_ID,:DRIVER_ID,:ORDER_NUM,:PHONE,
:HOUSE,:FLAT,:PORCH,
:DATE_ACCEPT,:DATE_ARRIVAL,:DATE_BEGIN,:DATE_END,:CUSTOMER,
:DESCRIPTION,:COST_RATE,:COST_FACT,:TYPE_ACCEPT,
:TYPE_PROCESS,:DATE_HISTORY,:WHO_HISTORY_ID,:BEFORE_PERIOD,
:FINISHED,:LOCKED,:CLIENT_ID,:COST_GROSS,:FIRM_ID);
UPDATE CALLS
SET ORDER_ID=:ORDER_ID
WHERE CALL_ID=:CALL_ID;
END
--
CREATE OR ALTER PROCEDURE GET_INCOMING_GRANTED
(
ACCOUNT_ID VARCHAR(32),
TYPE_MESSAGE INTEGER
)
RETURNS
(
GRANTED INTEGER
)
AS
DECLARE CNT INTEGER;
DECLARE IN_MESSAGE INTEGER;
DECLARE IN_QUERY INTEGER;
DECLARE IN_CALL INTEGER;
BEGIN
GRANTED=1;
SELECT COUNT(*)
FROM DRIVERS
WHERE DRIVER_ID=:ACCOUNT_ID
INTO :CNT;
IF (CNT>0) THEN BEGIN
SELECT M.IN_MESSAGE, M.IN_QUERY, M.IN_CALL
FROM DRIVERS D
LEFT JOIN METHODS M ON M.METHOD_ID=D.METHOD_ID
WHERE D.DRIVER_ID=:ACCOUNT_ID
INTO :IN_MESSAGE, :IN_QUERY, :IN_CALL;
IF ((TYPE_MESSAGE=0) AND (IN_MESSAGE IS NOT NULL)) THEN
GRANTED=IN_MESSAGE;
IF ((TYPE_MESSAGE=1) AND (IN_QUERY IS NOT NULL)) THEN
GRANTED=IN_QUERY;
IF ((TYPE_MESSAGE=2) AND (IN_CALL IS NOT NULL)) THEN
GRANTED=IN_CALL;
END ELSE BEGIN
SELECT COUNT(*)
FROM CLIENTS
WHERE CLIENT_ID=:ACCOUNT_ID
INTO :CNT;
IF (CNT>0) THEN BEGIN
SELECT M.IN_MESSAGE, M.IN_QUERY, M.IN_CALL
FROM CLIENTS C
LEFT JOIN METHODS M ON M.METHOD_ID=C.METHOD_ID
WHERE C.CLIENT_ID=:ACCOUNT_ID
INTO :IN_MESSAGE, :IN_QUERY, :IN_CALL;
IF ((TYPE_MESSAGE=0) AND (IN_MESSAGE IS NOT NULL)) THEN
GRANTED=IN_MESSAGE;
IF ((TYPE_MESSAGE=1) AND (IN_QUERY IS NOT NULL)) THEN
GRANTED=IN_QUERY;
IF ((TYPE_MESSAGE=2) AND (IN_CALL IS NOT NULL)) THEN
GRANTED=IN_CALL;
END
END
END
--
|
DROP DATABASE IF EXISTS malwares;
CREATE DATABASE malwares;
USE malwares;
DROP TABLE IF EXISTS malware;
CREATE TABLE malware (
url text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES malware WRITE;
LOAD DATA LOCAL INFILE '/docker-entrypoint-initdb.d/urls.txt' INTO TABLE malware;
UNLOCK TABLES;
|
-- https://www.question-defense.com/2009/01/09/how-to-dump-the-data-from-one-postgresql-table
-- pg_dump -a -t table_name -f file_name routing
|
ALTER TABLE user_account ADD column verification_code varchar(64); |
DROP TABLE Apples ;
CREATE TABLE AppleMul
(
UserID int unique NOT NULL ,
Multiplier int NOT NULL ,
PRIMARY KEY (UserID)
)
CHARACTER SET utf8 COLLATE utf8_general_ci;
|
-- gis_test.zog_geometry definition
-- Drop table
-- DROP TABLE gis_test.zog_geometry;
CREATE TABLE gis_test.zog_geometry (
id numeric NOT NULL,
geometry geometry NULL,
srid int4 NULL,
geometry_type varchar NULL
);
CREATE INDEX zog_geometry_id_idx ON gis_test.zog_geometry (id); |
DROP DATABASE IF EXISTS STREAMING;
CREATE DATABASE STREAMING;
USE STREAMING;
CREATE TABLE endereco (
enderecoId INT AUTO_INCREMENT PRIMARY KEY,
logradouro VARCHAR (50),
bairro VARCHAR (40),
numero INTEGER (6),
cep VARCHAR(8)
);
CREATE TABLE cadastro (
cadastroId INT AUTO_INCREMENT PRIMARY KEY,
nome VARCHAR (200) NOT NULL,
sobrenome VARCHAR (200) NOT NULL,
dataNascimento DATE NOT NULL,
email VARCHAR (100) NOT NULL,
cpf VARCHAR (14),
enderecoId INT NOT NULL,
FOREIGN KEY (enderecoId) REFERENCES endereco(enderecoId)
);
CREATE TABLE categoria (
categoriaId INT AUTO_INCREMENT PRIMARY KEY,
nome VARCHAR (200)
);
CREATE TABLE filme (
filmeId INT AUTO_INCREMENT PRIMARY KEY,
titulo VARCHAR (200) NOT NULL,
subtitulo VARCHAR (150),
duracao_min INT NOT NULL,
sinopse VARCHAR (5000),
categoriaId INT NOT NULL,
classificacaoIndicativa VARCHAR (30),
FOREIGN KEY (categoriaId) REFERENCES categoria(categoriaId)
);
CREATE TABLE serie (
serieId INT AUTO_INCREMENT PRIMARY KEY,
titulo VARCHAR (200) NOT NULL,
subtitulo VARCHAR (150),
episodios INT,
sinopse VARCHAR (5000),
categoriaId INT NOT NULL,
classificacaoIndicativa VARCHAR (30),
FOREIGN KEY (categoriaId) REFERENCES categoria(categoriaId)
);
CREATE TABLE filmeCategoriaRelacao (
filmeId INT,
categoriaId INT,
PRIMARY KEY (filmeId, categoriaId),
FOREIGN KEY (filmeId) REFERENCES filme(filmeId) ON DELETE CASCADE,
FOREIGN KEY (categoriaId) REFERENCES categoria(categoriaId)
);
CREATE TABLE serieCategoriaRelacao (
serieId INT,
categoriaId INT,
PRIMARY KEY (serieId, categoriaId),
FOREIGN KEY (serieId) REFERENCES serie(serieId) ON DELETE CASCADE,
FOREIGN KEY (categoriaId) REFERENCES categoria(categoriaId)
);
|
/*
That request shows Jira project of last issue activity to understand the frequency
*/
SELECT DISTINCT p.pkey as "KEY",
p.pname as "Project Name",
MAX(i.UPDATED) as "Last Ticket Updated",
pc.cname as "CATEGORY"
FROM jiraissue i
INNER JOIN project p ON p.ID = i.PROJECT
INNER JOIN nodeassociation na ON na.source_node_id=p.id
INNER JOIN projectcategory pc ON na.sink_node_id=pc.id
WHERE na.sink_node_entity='ProjectCategory' and na.association_type='ProjectCategory'
GROUP BY i.PROJECT, p.pname, p.pkey, pc.cname
ORDER BY MAX(i.UPDATED) ASC, p.pname |
SELECT OL.prod_cat, OH.ord_no, OH.inv_no, inv_dt, item_no, item_desc_1 , qty_to_ship, unit_price , qty_to_ship*unit_price AS [Total]
FROM oehdrhst_sql AS OH INNER JOIN oelinhst_sql OL ON OH.inv_no = OL.inv_no
WHERE rtrim(ltrim(OH.cus_no)) in ('1575') AND inv_dt >= '03/01/2013' AND unit_price > 0 |
CREATE VIEW [TimeManagement].[VI_TimePerOrdernumber]
AS SELECT
SUM([Time]) as [timeSum],
[Number]
FROM [TimeManagement].[TimeRegistration]
JOIN [TimeManagement].[Users] on [TimeRegistration].[FK_UserId] = [Users].[PK_Id]
JOIN [TimeManagement].[Projects] on [TimeRegistration].[FK_ProjectId] = [Projects].[PK_Id]
Join TimeManagement.OrderNumber on TimeRegistration.FK_OrderId = OrderNumber.PK_Id
GROUP BY [FK_ProjectId], [Number]
|
--조건으로 검색 => where
--대소비교
select first_name, salary from employees where salary > 10000;
select first_name, salary from employees where salary >= 10000;
select first_name, salary from employees where 3000 > salary;
select first_name, salary from employees where salary <= 10000;
--같다
select first_name, salary from employees where salary = 10000;
--같지 않다 !=, <> 둘다 같은 기능
select first_name, salary from employees where salary != 10000;
select first_name, salary from employees where salary <> 10000;
--실습 사원번호가 150이상인 사람의 사번, 성, 입사일을 출력
describe employees;
select employee_id as 사번, last_name as 성, hire_date as 입사일 from employees
where employee_id >= 150;
--문자열 조건
select first_name, hire_date from employees where first_name = 'Steven';
--사전표기 순서대로 대소비교를 할 수 있다.
select first_name from employees where first_name < 'Alex';
select first_name from employees where first_name < 'B';
--이름의 맨 앞 글자가 H보다 사전순으로 뒤에 위치한 모든 사원의 정보 조회
select first_name from employees where first_name > 'Hz';
select first_name from employees where first_name >= 'I';
--null비교
--select first_name, salary from employees where commission_pct = null; 이거아님
select first_name, salary from employees where commission_pct is null;
select first_name, salary from employees where commission_pct is not null;
--실습 : 매니저가 없는 사원들의 모든 정보를 조회
desc employees;
select * from employees where manager_id is null;
--다중조건
-- select * from employees where salary > 5000 && salary <= 10000; 이거 아님
select * from employees where salary > 5000 and salary <= 10000;
select * from employees where salary > 5000 or salary <= 10000;
--실습 월급이 10000 이상, 15000미만인 사원의 모든 정보를 조회
select * from employees where salary >= 10000 and salary < 15000;
--실습2 : 월급이 5000미만이거나 20000이상인 사원들의 정보 조회
select * from employees where salary < 5000 or salary >= 20000;
select * from employees where hire_date >= '03/01/01';
--실습3 : 입사가 05년 이후면서 06년 이전에 사원들의 정보 조회
select * from employees where hire_date >= '05/01/01' and hire_date < '06/01/01';
--실습 : job_id가 'Sa_man'이거나 'it_prog'인 사원의 모든 정보 조회
select * from employees where job_id = 'SA_MAN' or job_id = 'IT_PROG';
--실습2 : 이름의 맨 앞글자가 H인 사원들의 모든 정보 조회
select * from employees where first_name >= 'H' and first_name < 'I';
--In : 동비교를 할때 or을 사용해야 할 경우 효율적
select * from employees where job_id in('SA_MAN', 'IT_PROG', 'HR_REP');
--실습 : 사번이 100, 102, 104, 106번인 사원의 모든 정보 조회
select * from employees where employee_id in(100, 102, 104, 106);
select * from employees where employee_id = 100 or employee_id = 102 or employee_id = 104 or employee_id = 106;
--between : 대소비교시 and를 사용할 경우
select * from employees where salary >= 5000 and salary <= 6000;
select * from employees where salary between 5000 and 6000;
--실습 05년도에 입사한 사원의 모든 정보 조회(between사용)
select * from employees where hire_date between '05/01/01' and '05/12/31';
--like % -> 임의의 여러 문자
--like _ -> 임의의 한 문자
select * from employees where first_name like 'H%';
select * from employees where first_name like 'Ha%';
select * from employees where first_name like 'H____'; --자리수가 h제외 4글자
--실습 : 이름이 a로 끝나는 사원의 모든 정보를 조회
select * from employees where first_name like '%a';
--실습2 : 이름이 h로 시작하면서 6글자 이상인 사원의 모든 정보를 조회
select * from employees where first_name like 'H_____%';
--실습 이름에 o가 들어가면서 이름이 a로 끝나는 사원의 정보를 조회
select * from employees where first_name like '%o%a';
select * from employees where phone_number like '011%';
--실습 전화번호가 6으로 시작해서 중간에 2가 들어가고 9로 끝나는 사원 조회
select * from employees where phone_number like '6%2%9';
--실습 전화번호에 44가 들어가는 사원 조회
select * from employees where phone_number like '%44%';
--실습 전화번호가 4개의 그룹으로 이루어진 사원 조회
select * from employees where phone_number like '%.%.%.%';
--not
select * from employees where job_id not in('SA_MAN', 'IT_PROG', 'HR_REP');
--실습 위의 결과를 or 또는 and를 활용해서 똑같이 조회하세요.
select * from jobs;
select * from employees where job_id != 'SA_MAN' and job_id != 'IT_PROG' and job_id !='HR_REP';
--not like
select * from employees where phone_number not like '%44%';
--실습 : 44가 중간에만 들어있는 사원의 모든 정보를 조회
select * from employees where phone_number like '%44%' and phone_number not like '44%' and phone_number not like '%44';
--order by
select * from employees;
desc employees;
--오름차순
select * from employees order by salary; -- asc는 끝에 붙여도되고 안붙여도 기본값 오름차순
--내림차순
select * from employees order by salary desc;
--실습 월급이 15000달러 이상인 사원들의 모든 정보를 입사일이 빠른 순으로 조회
select * from employees where salary >= 15000 order by hire_date;
--같은 조건하에서 2순위 정렬을 하고 싶다면 : hire_date 우선정렬 hire_date가 같을 때 first_name정렬
select * from employees order by hire_date, first_name desc;
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 01, 2018 at 04:34 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sl_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`custid` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`custid`, `name`, `email`, `password`) VALUES
(1, 'Hassan', 'hassan@gmail.com', 'asdf1234'),
(2, 'azam', 'azam@gmail.com', 'asdf1234'),
(3, 'shahrukh', 'shahrukh@gmail.com', 'asdf1234'),
(4, 'daniyal', 'daniyal@gmail.com', 'asdf1234');
-- --------------------------------------------------------
--
-- Table structure for table `hall`
--
CREATE TABLE `hall` (
`hallid` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`price` int(11) NOT NULL,
`address` varchar(100) DEFAULT NULL,
`images_count` int(11) DEFAULT NULL,
`availability` date DEFAULT NULL,
`ownerid` int(11) NOT NULL,
`city` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `hall`
--
INSERT INTO `hall` (`hallid`, `name`, `price`, `address`, `images_count`, `availability`, `ownerid`, `city`) VALUES
(1, 'Haveli', 25000, 'Opposite some scheme 3, Highway, Islamabad', 5, NULL, 1, 'Islamabad'),
(2, 'Fortress', 29000, 'Plot no 93, Expressway , Rawalpindi', 7, NULL, 2, 'Rawalpindi'),
(3, 'Orchid Marqee', 15000, 'Plot no 34, Orchid scheme , Islamabad', 7, NULL, 3, 'Islamabad');
-- --------------------------------------------------------
--
-- Table structure for table `imgresource`
--
CREATE TABLE `imgresource` (
`imgid` int(11) NOT NULL,
`path` varchar(100) DEFAULT NULL,
`hallid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `owner`
--
CREATE TABLE `owner` (
`ownerid` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `owner`
--
INSERT INTO `owner` (`ownerid`, `name`, `email`, `password`) VALUES
(1, 'Owner1', 'owner1@yahoo.com', 'asdf1234'),
(2, 'Owner2', 'owner2@gmail.com', 'asdf1234'),
(3, 'Owner3', 'owner3@live.com', 'asdf1234'),
(4, 'Owner4', 'owner4@outlook.com', 'asdf1234');
-- --------------------------------------------------------
--
-- Table structure for table `reviews`
--
CREATE TABLE `reviews` (
`reviewid` int(11) NOT NULL,
`review` varchar(1000) DEFAULT NULL,
`stars` float NOT NULL,
`custid` int(11) NOT NULL,
`hallid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`role` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `password`, `role`) VALUES
(1, 'faizy02', '1234', 'admin'),
(2, 'faisal', '1234', 'admin');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`custid`);
--
-- Indexes for table `hall`
--
ALTER TABLE `hall`
ADD PRIMARY KEY (`hallid`),
ADD KEY `ownerId` (`ownerid`);
--
-- Indexes for table `imgresource`
--
ALTER TABLE `imgresource`
ADD PRIMARY KEY (`imgid`),
ADD KEY `hallId` (`hallid`) USING BTREE;
--
-- Indexes for table `owner`
--
ALTER TABLE `owner`
ADD PRIMARY KEY (`ownerid`);
--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
ADD PRIMARY KEY (`reviewid`),
ADD KEY `cust_Id` (`custid`),
ADD KEY `hallId` (`hallid`) USING BTREE;
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
MODIFY `custid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `hall`
--
ALTER TABLE `hall`
MODIFY `hallid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `owner`
--
ALTER TABLE `owner`
MODIFY `ownerid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
MODIFY `reviewid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `hall`
--
ALTER TABLE `hall`
ADD CONSTRAINT `hall_ibfk_1` FOREIGN KEY (`ownerId`) REFERENCES `owner` (`ownerId`);
--
-- Constraints for table `imgresource`
--
ALTER TABLE `imgresource`
ADD CONSTRAINT `imgresource_ibfk_1` FOREIGN KEY (`hallid`) REFERENCES `owner` (`ownerId`);
--
-- Constraints for table `reviews`
--
ALTER TABLE `reviews`
ADD CONSTRAINT `reviews_ibfk_1` FOREIGN KEY (`custid`) REFERENCES `customer` (`custid`);
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 */;
|
--7
SELECT C.IDCASA, COUNT(DISTINCT E.DNI) AS NUMEMPMONIT
FROM CASA C, EMPLEADO E, PLAN P
WHERE C.IDCASA=E.IDCASA AND P.CASA=E.IDCASA AND E.DNI=P.MONITOR
GROUP BY C.IDCASA
ORDER BY C.IDCASA; |
create view v_tech_location as select * from t_location;
|
CREATE PROCEDURE sp_get_NewStockDestruction
AS
SELECT DocumentID FROM DocumentNumbers WHERE DocType = 31
|
-- AQUI SERAO EXIBIDAS AS PERGUNTAS QUE SERÃO RESPONDIDAS
-- ATRAVÉS DE CONSULTAS SQL DO BANCO DE DADOS CHINOOK
1. Quais são os quatro melhores clientes alemães?
O melhor cliente é considerado como aquele que gastou mais.
SELECT Invoice.Customerid,Customer.FirstName,
sum(InvoiceLine.Quantity*InvoiceLine.UnitPrice)
FROM Invoice
join Customer
on Customer.Customerid=Invoice.Customerid
join InvoiceLine
on Invoice.Invoiceid=InvoiceLine.InvoiceId
where Customer.Country='Germany'
group by 1
order by 3 desc
LIMIT 4;
2. Determine todos os clientes que compram mais do que 21
dólares no total do gênero rock.
SELECT distinct Customer.Email,Customer.FirstName,
Customer.LastName,Genre.GenreId,sum(InvoiceLine.Quantity*InvoiceLine.UnitPrice)
FROM Invoice
join Customer
on Customer.Customerid=Invoice.Customerid
join InvoiceLine
on Invoice.Invoiceid=InvoiceLine.InvoiceId
join Track
on Track.TrackId=InvoiceLine.TrackId
join Genre
on Genre.GenreId=Track.GenreId
where Genre.Name='Rock'
group by 2
having sum(InvoiceLine.Quantity*InvoiceLine.UnitPrice)> 21.
order by 5 desc
--limit, top, sum()
3. Quais foram os top 5 compositores para o gênero Rock que
mais venderam em quantidade? Faça a sua tabela com colunas
contendo o compositor e a quantidade vendida.
select distinct Track.Composer,sum(InvoiceLine.Quantity)
from Track
join InvoiceLine
on Track.TrackId = InvoiceLine.TrackId
join Genre
on Genre.GenreId=Track.GenreId
where Genre.Name='Rock'
group by 1
order by 2 desc
limit 7
-- coloquei 7 em limit porque há um null e J. C. Fogerty aparece
-- duas vezes, que é devido a um espaço deletado em uma forma de escrever
-- o nome dele na database. Então, o correto é colocar J. C. Fogerty
-- em segundo com 35 (19+16).
-- usar Playlist e PlaylistTrack
4. Qual tipo de playlist tem mais faturas?
Dê como resultado o tipo de playlist que tem mais faturas
e o seu correspondente total de faturas.
Mostre os cinco primeiros.
select Playlist.Name,count(Invoice.Total)
from Track
join PlaylistTrack
on Track.TrackId=PlaylistTrack.TrackId
join Playlist
on PlaylistTrack.PlaylistId=Playlist.PlaylistId
join InvoiceLine
on InvoiceLine.TrackId=Track.TrackId
join Invoice
on Invoice.InvoiceId=InvoiceLine.InvoiceId
group by 1
order by 2 desc
limit 5
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 06-06-2017 a las 19:29:17
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `FisFinder`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Feedback`
--
CREATE TABLE `Feedback` (
`ID` int(6) NOT NULL,
`id_Perfil` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Perfil`
--
CREATE TABLE `Perfil` (
`ID` varchar(12) CHARACTER SET latin1 COLLATE latin1_spanish_ci NOT NULL,
`Nro_IMG` int(5) NOT NULL DEFAULT '0',
`Nro_VIDEO` int(5) NOT NULL DEFAULT '0',
`Nro_ECC` int(5) NOT NULL DEFAULT '0',
`Nro_TEXTO` int(5) NOT NULL DEFAULT '0',
`Min_IMG` int(5) NOT NULL DEFAULT '0',
`Min_VIDEO` int(5) NOT NULL DEFAULT '0',
`Min_ECC` int(5) NOT NULL DEFAULT '0',
`Min_TEXTO` int(5) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `Perfil`
--
INSERT INTO `Perfil` (`ID`, `Nro_IMG`, `Nro_VIDEO`, `Nro_ECC`, `Nro_TEXTO`, `Min_IMG`, `Min_VIDEO`, `Min_ECC`, `Min_TEXTO`) VALUES
('ACOMODADOR', 0, 0, 0, 0, 0, 0, 0, 0),
('ASIMILADOR', 4, 0, 0, 89, 0, 0, 0, 0),
('CONVERGENTE', 0, 0, 0, 0, 0, 0, 0, 0),
('DIVERGENTE', 1, 1, 1, 1, 0, 0, 0, 0);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Preferencias_WEB`
--
CREATE TABLE `Preferencias_WEB` (
`Nombre_Sitio` varchar(30) NOT NULL,
`Tipo` int(1) NOT NULL,
`Motivo` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `Feedback`
--
ALTER TABLE `Feedback`
ADD PRIMARY KEY (`ID`);
--
-- Indices de la tabla `Perfil`
--
ALTER TABLE `Perfil`
ADD PRIMARY KEY (`ID`) USING BTREE;
--
-- Indices de la tabla `Preferencias_WEB`
--
ALTER TABLE `Preferencias_WEB`
ADD PRIMARY KEY (`Nombre_Sitio`);
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 */;
|
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE publishers DROP INDEX idx_ero;
ALTER TABLE publishers CHANGE ero r18 BOOLEAN NOT NULL DEFAULT 0;
ALTER TABLE publishers ADD INDEX idx_r18(r18);
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE publishers DROP INDEX idx_r18;
ALTER TABLE publishers CHANGE r18 ero BOOLEAN NOT NULL DEFAULT 0;
ALTER TABLE publishers ADD INDEX idx_ero(ero);
|
SELECT CASE WHEN exposed_group.dsp_user_id IS NOT NULL THEN 'Exposed' ELSE 'Not Exposed' END AS groupss
,COUNT(1) AS total_searches
,SUM(CASE WHEN regexp_like(LOWER(keywords), /*keywords*/) THEN 1 ELSE 0 END) AS brandsearch
,NDV(appnexus_user_id) AS users --Change if necessary
FROM edb.edb_keyword
LEFT OUTER JOIN (
SELECT dsp_user_id
,trunc(max(sf_event_ts), 'dd') as imps
FROM edb.edb_captify_standard_feed
WHERE dsp_source_id = 1 --Change if necessary
AND dsp_user_id IS NOT NULL
AND dsp_user_id != ''
AND dsp_user_id != '0'
AND dsp_user_id > '1' --Only needed for Appnexus
AND line_item_id = --LI
AND insertion_order_id = --IO
AND sf_event_date >= --Date
GROUP BY dsp_user_id
) exposed_group ON exposed_group.dsp_user_id = edb.edb_keyword.appnexus_user_id /*Change if necessary*/
AND adddate(exposed_group.imps, 30) >= trunc(edb.edb_keyword.search_event_ts, 'dd') --Optional - gives a 30-day window for exposed user to make search
WHERE search_event_date >= --Date
AND source_id = 4
AND captify_region = --Country
AND property_id NOT IN (11394, 11643, 11947, 11948, 11843, 11502, 11841, 11504, 11503, 11507, 11505, 11506, 11867, 11868, 11501, 11842,11840, 11946, 11488)
AND LENGTH(keywords) >= 1
AND LENGTH(keywords) <= 256
AND LENGTH(keywords) - LENGTH(TRANSLATE(keywords, ' ', '')) + 1 <= 13
AND keywords IS NOT NULL
AND keywords NOT ilike '%,%'
AND category_id IS NOT NULL
AND appnexus_user_id IS NOT NULL --Change if necessary
AND appnexus_user_id != '0' --Change if necessary
AND appnexus_user_id != '' --Change if necessary
AND appnexus_user_id > '1' --Only needed for Appnexus
GROUP BY CASE WHEN exposed_group.dsp_user_id IS NOT NULL THEN 'Exposed' ELSE 'Not Exposed' END |
select count(fv) as cnt
from (
select first_value(c2) over(partition by c2 order by c1) as fv
from dfs.`window/3668.parquet`
)
where fv = 'e' |
/*
MySQL Backup
Source Server Version: 5.6.35
Source Database: warehouse
Date: 2018/3/23 09:47:10
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `material`
-- ----------------------------
DROP TABLE IF EXISTS `material`;
CREATE TABLE `material` (
`mid` int(11) NOT NULL AUTO_INCREMENT,
`material_id` char(50) NOT NULL,
`material_name` char(50) NOT NULL,
`c_name` char(50) DEFAULT NULL,
`information` char(255) NOT NULL,
`number` int(11) DEFAULT NULL,
`price` decimal(10,2) NOT NULL,
PRIMARY KEY (`mid`),
KEY `material_name` (`material_name`),
KEY `material_id` (`material_id`),
KEY `c_name` (`c_name`)
) ENGINE=InnoDB AUTO_INCREMENT=341 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for `users`
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`uname` char(50) NOT NULL,
`upwd` char(50) NOT NULL,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `material` VALUES ('1','0001','物料1','类别1','物料信息1','10','10.00'), ('2','0002','物料2','类别2','物料信息2','10','10.00'), ('3','0003','物料3','类别1','物料信息3','10','10.00'), ('4','0003','物料3','类别1','物料信息3','10','10.00'), ('5','0003','物料3','类别1','物料信息3','10','10.00'), ('6','0002','物料2','类别2','物料信息2','10','10.00'), ('7','0001','物料1','类别1','物料信息1','10','10.00'), ('8','0002','物料2','类别2','物料信息2','10','10.00'), ('9','0001','物料1','类别1','物料信息1','10','10.00'), ('10','0004','物料4','类别4','物料信息4','20','20.00'), ('11','0005','物料5','类别5','物料信息5','20','20.00'), ('12','0006','物料6','类别6','物料信息6','20','20.00'), ('13','0007','物料7','类别7','物料信息7','30','30.00'), ('14','0008','物料8','类别8','物料信息8','30','30.00');
INSERT INTO `users` VALUES ('1','root','root'), ('2','00','00');
|
ALTER TABLE `operation`
ADD `state` tinyint NULL AFTER `message`,
COMMENT=''; |
CREATE DATABASE temp_relaciones_uno_a_varios_cascada CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
use temp_relaciones_uno_a_varios_cascada;
# Consumidores clientes
create table customers(
customerId int(10) not null auto_increment,
customerPhone varchar(32),
emailAddress varchar(128),
PRIMARY KEY (customerId)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='customers';
# Direcciones
create table addresses(
addressId int(10) not null auto_increment,
customerId int(10),
address_line_1 varchar(128),
address_line_2 varchar(128),
PRIMARY KEY (addressId),
FOREIGN KEY (customerId)
REFERENCES customers(customerId)
ON UPDATE CASCADE
ON DELETE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='addresses';
SET FOREIGN_KEY_CHECKS = 1;
insert into customers values (1,'615231533','davidberruezo@davidberruezo.com');
insert into customers values (2,'615231534','davidberruezo33@gmail.com');
insert into customers values (3,'615231535','davidberruezo@hotmail.com');
insert into addresses values (1,1,'vallirana','vallirana');
insert into addresses values (2,1,'malgrat','malgrat');
insert into addresses values (3,1,'rossello','rossello');
# Test delete on cascade
delete from customers where customerId=1;
|
create table boarding_passes (
code text,
row int,
seat int,
seat_id int generated always as (row * 8 + seat) stored
);
-- HERE WE GO
-- Generate all pairs (0..127,0..8) and derive their boarding pass number
-- This is our precompute table so the problem-solving becomes "just" a lookup
insert into boarding_passes with
row_number(row) as ( select 0 union all select row+1 from row_number limit 128 ),
seat_number(seat) as ( select 0 union all select seat+1 from seat_number LIMIT 8 )
select
-- Row number
case when row & 64 then "B" else "F" end
|| case when row & 32 then "B" else "F" end
|| case when row & 16 then "B" else "F" end
|| case when row & 8 then "B" else "F" end
|| case when row & 4 then "B" else "F" end
|| case when row & 2 then "B" else "F" end
|| case when row % 2 then "B" else "F" end
-- Seat number
|| case when seat & 4 then "R" else "L" end
|| case when seat & 2 then "R" else "L" end
|| case when seat % 2 then "R" else "L" end,
row,
seat
from
row_number,
seat_number;
-- Load data
create table test_passes(code TEXT);
.mode csv
.import 05_input.txt test_passes
-- Part 1
select max(seat_id)
from boarding_passes bp
join test_passes tp on (bp.code = tp.code);
-- Part 2
create temporary table test_seat_ids as
select
bp.seat_id
from
boarding_passes bp,
test_passes tp
where
tp.code = bp.code;
select
seat_id
from
boarding_passes
where
row not in (0, 127)
and
seat_id not in (select * from test_seat_ids)
and
seat_id - 1 in (select * from test_seat_ids)
and
seat_id + 1 in (select * from test_seat_ids);
|
SELECT *
INTO DAT.CollegeReady
FROM
(
SELECT
SchoolYear
,YearID
,StudentID
,StudentName
,GradeLevel
,WhenAssessedGradeLevel
,SchoolName
,SchoolNameAbbreviated
,NthYearUplift
,CASE
--6/5, 6/9 LBJ change tenure
WHEN NthYearUplift > 2 THEN 1
--
ELSE 0
END AS 'Minimum3YearTenure'
,Test AS 'Assessment'
,AssessmentCategory
,[Subject]
,SubjectGroup
,SpringTestScore
,CASE
WHEN [College ReadyFall] = 'College Ready' THEN 1
WHEN [College ReadyFall] = 'Level 3: Advanced' THEN 1
WHEN [College ReadyFall] IS NULL THEN NULL
ELSE 0
END AS MetCollegeReadyFall
,CASE
WHEN [College ReadyWinter] = 'College Ready' THEN 1
WHEN [College ReadyWinter] = 'Level 3: Advanced' THEN 1
WHEN [College ReadyWinter] IS NULL THEN NULL
ELSE 0
END AS MetCollegeReadyWinter
,CASE
WHEN [College ReadySpring] = 'College Ready' THEN 1
WHEN [College ReadySpring] = 'Level 3: Advanced' THEN 1
WHEN [College ReadySpring] IS NULL THEN NULL
ELSE 0
END AS MetCollegeReadySpring
,[College ReadyFall] AS 'CollegeReadyFallLevel'
,[College ReadyWinter] AS 'CollegeReadyWinterLevel'
,[College ReadySpring] AS 'CollegeReadySpringLevel'
,CASE
WHEN [National NormFall] = 'At or Above National Norm' THEN 1
WHEN [National NormFall] IS NULL THEN NULL
ELSE 0
END AS MetNationalNormFall
,CASE
WHEN [National NormWinter] = 'At or Above National Norm' THEN 1
WHEN [National NormWinter] IS NULL THEN NULL
ELSE 0
END AS MetNationalNormWinter
,CASE
WHEN [National NormSpring] = 'At or Above National Norm' THEN 1
WHEN [National NormSpring] IS NULL THEN NULL
ELSE 0
END AS MetNationalNormSpring
,[National NormFall] AS 'NationalNormFallLevel'
,[National NormWinter] AS 'NationalNormWinterLevel'
,[National NormSpring] AS 'NationalNormSpringLevel'
FROM
(
SELECT
st.studentid AS StudentID
,st.studentname AS StudentName
,st.gradelevel AS GradeLevel
,st.schoolname AS SchoolName
,st.SchoolNameAbbreviated AS SchoolNameAbbreviated
,st.NthYearUplift AS NthYearUplift
,a.WhenAssessedGradeLevel
,a.SchoolYear
,a.yearid
,a.test
,ast.AssessmentCategory
,acs.description AS [Subject]
,[acsg].shortdescription AS [SubjectGroup]
--,a.termname AS TermName
--,CASE
-- WHEN a.test IN ('STAAR','EOC') THEN 'College Ready'
-- ELSE
-- apl.leveltype
-- END AS LevelType
--concatenate LevelType and Term for PIVOT
,CONCAT
(CASE WHEN a.test in ('STAAR','EOC') THEN 'College Ready'
WHEN a.LevelType = 'National Norm Percentile' THEN 'National Norm'
ELSE apl.leveltype
END,a.termname)
AS LevelTypeTermName
-- 12/7/15 lbj fix: added a.yearid to partition
-- 5/25/16 LBJ the below score will be the scale score for MAP since the MAX() between RITScore and Percentile will always be RITScore
,MAX(CASE WHEN a.TermName = 'Spring' THEN TestScore END)
OVER (PARTITION BY a.yearid, a.studentid, a.test, a.[subject])
AS SpringTestScore
,CASE
WHEN a.test = 'STAAR' THEN a.[Level]
WHEN a.test = 'EOC' THEN a.[Level]
ELSE apl.PerformanceLevel
END AS PerformanceLevel
FROM
(
SELECT
Student.*
-- calculate nth year at Uplift
-- 5/17/16 lbj don't need to calculate, is in rpt.vstudent
--DENSE_RANK() OVER (PARTITION BY studentid ORDER BY yearid) AS NthYearUplift
FROM
(
SELECT DISTINCT
s.SchoolYear
,s.yearid
,s.StudentID
,StudentName
,GradeLevel
,SchoolName
,SchoolNameAbbreviated
-- 5/17/16 lbj added nth year below
,NthYearUplift
FROM
RPT.vStudent s INNER JOIN
DAT.SnapshotDate d ON s.yearid = d.yearid
WHERE
-- grade level as of fall snapshot
d.SnapshotDate between schoolentrydate AND schoolexitdate AND
s.SchoolNameAbbreviated <> 'Lee PS'
) Student
) AS st INNER JOIN
(SELECT
*
-- for MAP, get national norm using percentile rather than scale score
,CASE WHEN [TestScoreType] = 'Percentile' AND [Test] = 'MAP' THEN 'National Norm Percentile'
WHEN [TestScoreType] = 'Percentile' THEN 'National Norm'
ELSE 'College Ready' END AS LevelType
FROM
rpt.vStudentAssessment
WHERE
TestScoreType IN ('Scale Score','Percentile')
--and studentid = '816101696'
) a ON a.studentid = st.studentid AND a.[SchoolYear] = st.SchoolYear INNER JOIN
dat.academicsubject acs ON acs.shortdescription = a.[Subject] INNER JOIN
dat.academicsubjectgroup acsg ON acs.academicsubjectgroup = acsg.codevalue INNER JOIN
dat.Assessment ast ON ast.assessmenttitle = a.test LEFT JOIN
dat.assessmentperformancelevel apl ON a.test = apl.AssessmentTitle AND a.[subject] = apl.AssessmentSubject AND ISNULL(a.WhenAssessedGradeLevel,st.gradelevel) BETWEEN apl.LowestAssessedGradeLevel AND apl.AssessedGradeLevel
-- 11/3 LBJ: use hardcoded year of 25 for 2015 norms
--AND a.yearid BETWEEN apl.StartYearID AND apl.EndYearID AND a.testscore BETWEEN apl.MinimumScore AND apl.MaximumScore
AND 25 BETWEEN apl.StartYearID AND apl.EndYearID AND a.testscore BETWEEN apl.MinimumScore AND apl.MaximumScore
AND a.termname = apl.termname AND a.leveltype = apl.leveltype AND apl.LevelType IN ('College Ready','National Norm','National Norm Percentile')
WHERE
a.test IN ('MAP','Explore','PLAN','ACT','STAAR','EOC') --,'SAT')
-- filter out MAP tests for grades 9-12
AND CONCAT(a.test,st.gradelevel) NOT IN ('MAP9','MAP10','MAP11','MAP12')
-- 5/25/16
AND CONCAT(a.test,apl.leveltype) NOT IN ('MAPNational Norm')
AND CONCAT(a.test, a.leveltype) NOT IN ('ExploreNational Norm','PlanNational Norm','ACTNational Norm')
-- 12/17/15 lbj removed filter for STAAR math
-- filter out STAAR tests for 2014-2015
--AND CONCAT(a.test,a.[subject],a.yearid) <> 'STAARMath24'
) AS q
PIVOT
(
MAX(PerformanceLevel)
FOR LevelTypeTermName IN ([College ReadyFall],[College ReadyWinter],[College ReadySpring],[National NormFall],[National NormWinter],[National NormSpring])
) AS qpivot
) AS CRquery;
|
CREATE PROCEDURE [sp_ser_saveJobCardCheckList]
(@SerialNo int,
@CheckListID [nvarchar](50),
@CheckListItemID [nvarchar](50),
@FieldType [int],
@FieldValue [nvarchar](255))
AS INSERT INTO [JobCardCheckList]
( [SerialNo],
[CheckListID],
[CheckListItemID],
[FieldType],
[FieldValue])
VALUES
(@SerialNo,
@CheckListID,
@CheckListItemID,
@FieldType,
@FieldValue)
|
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: localhost Database: marthagoshen
-- ------------------------------------------------------
-- Server version 5.7.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
SET NAMES utf8 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `tenant`
--
DROP TABLE IF EXISTS `tenant`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `tenant` (
`id` int(7) NOT NULL AUTO_INCREMENT,
`email` varchar(75) NOT NULL,
`firstname` varchar(50) NOT NULL,
`lastname` varchar(20) NOT NULL,
`password` varchar(30) NOT NULL,
`contact` varchar(11) NOT NULL,
`building` varchar(10) DEFAULT NULL,
`unit` varchar(6) DEFAULT NULL,
`tenantPic` blob,
PRIMARY KEY (`id`),
UNIQUE KEY `firstname_UNIQUE` (`firstname`),
UNIQUE KEY `email_UNIQUE` (`email`),
KEY `building_idx` (`building`(1)),
KEY `unitid_idx` (`unit`),
CONSTRAINT `unit` FOREIGN KEY (`unit`) REFERENCES `unit` (`unitid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tenant`
--
LOCK TABLES `tenant` WRITE;
/*!40000 ALTER TABLE `tenant` DISABLE KEYS */;
INSERT INTO `tenant` VALUES (1,'easd','fsasd','fsdf','sfdff','845132','a','1',NULL),(2,'dsd','sfs','sfsf','sfsf','2342','a','2',NULL);
/*!40000 ALTER TABLE `tenant` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-06-18 9:51:30
|
CREATE TABLE Practitioner
(
-- Mangler Identifier: Identifier (0..*)
id uniqueidentifier NOT NULL PRIMARY KEY,
active bit,
gender nvarchar(255),
birthDate date,
-- humanName
-- telecom
-- address
-- attachment
-- communication
);
CREATE TABLE PractitionerHumanName -- Skal være: PractitionerName
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_HumanName uniqueidentifier NOT NULL FOREIGN KEY REFERENCES HumanName(id),
CONSTRAINT PK_PractitionerHumanName PRIMARY KEY (id_Practitioner, id_HumanName)
);
CREATE TABLE PractitionerTelecom
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_ContactPoint uniqueidentifier NOT NULL FOREIGN KEY REFERENCES contactPoint(id),
CONSTRAINT PK_PractitionerTelecom PRIMARY KEY (id_Practitioner, id_ContactPoint)
);
CREATE TABLE PractitionerAddress
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_Address uniqueidentifier NOT NULL FOREIGN KEY REFERENCES [Address](id),
CONSTRAINT PK_PractitionerAddress PRIMARY KEY (id_Practitioner, id_Address)
);
CREATE TABLE PractitionerAttachment
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_Attachment uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Attachment(id),
CONSTRAINT PK_PractitionerAttachment PRIMARY KEY (id_Practitioner, id_Attachment)
);
CREATE TABLE PractitionerCommunication
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_CodeableConcept uniqueidentifier NOT NULL FOREIGN KEY REFERENCES CodeableConcept(id),
CONSTRAINT PK_PractitionerCommunication PRIMARY KEY (id_Practitioner, id_CodeableConcept)
);
--- HJELPETABELL OG TILHØRENDE LINK ---
-- Denne er endret fra master. Het tidligere "Qualification" og var lagret som basetable.
CREATE TABLE PractitionerQualification_HT
(
id uniqueidentifier NOT NULL PRIMARY KEY,
startPeriod date,
endPeriod date,
code_CodeableConcept uniqueidentifier NOT NULL FOREIGN KEY REFERENCES CodeableConcept(id),
issuer_Reference uniqueidentifier FOREIGN KEY REFERENCES Reference(id),
);
CREATE TABLE PractitionerQualification
(
id_Practitioner uniqueidentifier NOT NULL FOREIGN KEY REFERENCES Practitioner(id),
id_PractitionerQualification_HT uniqueidentifier NOT NULL FOREIGN KEY REFERENCES PractitionerQualification_HT(id),
CONSTRAINT PK_PractitionerQualification PRIMARY KEY (id_Practitioner, id_PractitionerQualification_HT)
);
|
@clears
col constraint_name format a30
col table_name format a30
col constype format a10
col owner format a15 head 'OWNER'
set line 100
set echo off
set verify off
col cowner new_value uowner noprint
prompt
prompt Show disabled constraints for which user?
prompt ( partial names ok )
prompt
set feed off term off
select '&1' cowner from dual;
set term on feed on
break on owner skip 1 on table_name skip 1
select
owner,
table_name ,
constraint_name,
decode(constraint_type,
'C','CHECK',
'P','PRIMARY',
'U','UNIQUE',
'R','REFERENCE',
'V','VIEW/CHK',
'!ERR!'
) constype
from all_constraints
where owner like upper('%&uowner%')
and status = 'DISABLED'
order by owner, table_name, constraint_name
/
undef 1
|
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_GetDocumentDetailsByObject]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[prc_CWI_GetDocumentDetailsByObject]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[prc_CWI_GetDocumentDetailsByObject]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/*******************************************************************
* PROCEDURE: prc_CWI_GetDocumentDetailsByObject
* Purpose : This PROC would be called to get all the document details for Object
* Invoked from : SupportingDocument.ascx
* CREATED: MohanKumar Sundaram
* MODIFICATION HISTORY
* DATE AUTHOR DESCRIPTION
**********************************************************************
Execution example :
**********************************************************************
exec [prc_CWI_GetDocumentDetailsByObject] @ObjectId=4, @ObjectLookupID =201,@AuthorID=8
**********************************************************************/
CREATE PROCEDURE [dbo].[prc_CWI_GetDocumentDetailsByObject]
@ObjectId bigint,
@ObjectLookupID int,
@AuthorId int
AS
BEGIN
SET NOCOUNT ON;
SELECT
SD.Id,
SD.Title,
SD.ObjectID,
SD.ObjectLookupID as CategoryID,
SD.DocCategoryId,
LU.LookupName as ''DocumentCategory'',
U.Names as ''Author'',
SD.[Version],
SD.Summary,
SD.IsShared,
SD.FilePath,
SD.CreatedOn,
SD.ModifiedBy,
SD.ModifiedOn,
SD.CreatedBy AuthorID,
LU.Id as LookupId,
ISNULL(Tags,'''') Tags
FROM
CWI_SupportingDocument AS SD
INNER JOIN CWI_User AS U
ON SD.CreatedBy=U.ID
LEFT JOIN CWI_DocCategory DC
ON DC.Id = SD.DocCategoryId
LEFT JOIN [Lookup] as LU
ON DC.DoctypeLookupID=LU.Id
WHERE
SD.ObjectLookupID= @ObjectLookupID
AND SD.ObjectID= @ObjectId
AND SD.IsDelete=0
ORDER BY SD.ModifiedOn DESC
END
'
END
GO
|
-- Quantos episodios tiveram no total?
select count(Episode) from data;
|
/* Ajout de donnée dans la table "type" */
INSERT INTO
`type`(`name`)
VALUES
('Acier'),
('Insecte'),
('Fée'),
('Plante'),
('Psy'),
('Roche'),
('Combat'),
('Eau'),
('Ténèbres'),
('Dragon'),
('Électrique'),
('Poison'),
('Vol'),
('Feu'),
('Glace'),
('Normal'),
('Sol'),
('Spectre');
/* Ajout de donnée dans la table "region" */
INSERT INTO
`region`(`name`)
VALUES
('Kanto'),
('Johto'),
('Hoenn'),
('Sinnoh'),
('Unys'),
('Kalos'),
('Alola'),
('Galar');
/* Ajout de donnée dans la table "city" */
INSERT INTO
`city`(`name`, `arena`, `fk_region_id`)
VALUES
('Frimapic', '1', '4'),
('Bourg Palette', '0', '1'),
('Vestigion', '1', '4'),
('Acajou', '1', '2'),
('Entrelasque', '0', '5'),
('Akala', '0', '7'),
('Atalanopolis', '1', '3'),
('Oliville', '1', '2'),
('Vaguelone', '0', '5'),
('Corrifey', '1', '8'),
('Paddoxton', '0', '8'),
('Charbourg', '1', '4'),
('Bourg Croquis', '0', '6'),
('Verchamps', '1', '4'),
('Lavandia', '1', '3'),
('Voilaroc', '1', '4'),
('Yantreizh', '1', '6'),
('Romant-sous-Bois', '1', '6'),
('Ogoesse', '1', '5'),
('Greenbury', '1', '8'),
('La Frescale', '0', '6'),
('Mérouville', '1', '3'),
('Célestia', '0', '4'),
('Céladopole', '1', '1'),
('Neuvartault', '1', '6'),
('Port Tempères', '1', '6'),
('Rotonbourg', '0', '5'),
('Kickenham', '1', '8'),
('Janusia','1', '5'),
('Roche-sur-Gliffe', '0', '6'),
('Jadielle', '1', '1'),
('Pacifiville', '0', '3'),
("Cromlac'h", "0", "6"),
('Algatia', '1', '3'),
('Argenta', '1', '1'),
('Brasswick', '0', '8'),
('Renouet', '0', '5'),
('Azuria', '1', '1'),
('Bourg Geon', '0', '2'),
("Cramois'Île", "1", "1"),
('Éternara', '0', '3'),
('Amaillide', '0', '5'),
('Ondes-sur-mer', '1', '5'),
('Papeloa', '1', '5'),
('Quarellis', '0', '6'),
('Mauville', '1', '2'),
('Ludester', '1', '8'),
('Féli-Cité', '0', '4'),
('Flusselles', '1', '6'),
('Auffrac-les-Congères', '1', '6'),
('Nénucrique', '0', '3'),
('Carmin-sur-Mer', '1', '1'),
('Village Myokara', '1', '3'),
('Ebenelle', '1', '2'),
('Bonville', '0', '4'),
('Arabelle', '0', '5'),
('Lavanville', '0', '1'),
('Fort-Vanitas', '0', '6'),
('Clémenti-Ville', '1', '3'),
('Floraville', '0', '4'),
('Safrania', '1', '1'),
('Volucité', '1', '5'),
('Port Yoneuve', '1', '5'),
('Parmanie', '1', '1'),
('Littorella', '0', '4'),
('Ville Griotte', '0', '2'),
('Rosyères', '0', '3'),
('Ula-Ula', '0', '7'),
('Smashings', '1', '8'),
('Winscor', '0', '8'),
('Écorcia', '1', '2'),
('Doublonville', '1', '2'),
('Bourg-en-Vol', '0', '3'),
('Rosalia', '1', '2'),
('Maillard', '1', '5'),
('Mele-Mele', '0', '7'),
('Irisia', '1', '2'),
('Relifac-le-Haut', '1', '6'),
('Vergazon', '0', '3'),
('Bonaugure', '0', '4'),
('Méanville', '1', '5'),
('Paradis Æther', '0', '7'),
('Hameau Gelé', '0', '8'),
('Poivressel', '0', '3'),
('Ville Noire', '0', '5'),
('Unionpolis', '1', '4'),
('Illumis', '1', '6'),
('Motorby', '1', '8'),
('Poni', '0', '7'),
('Parsemille', '1', '5'),
('Old Chister', '1', '8'),
('Cimetronelle', '1', '3'),
('Flocombe', '1', '5'),
('Batisques', '0', '6'),
('Skifford', '1', '8'),
('Autéquia', '0', '3'),
('Mozheim', '0', '6'),
('Joliberges', '1', '4'),
('Pavonnay', '1', '5'),
('Vermilava', '1', '3'),
('Rivamar', '1', '4');
/* Ajout de donnée dans la table "dresseur" */
INSERT INTO
`dresseur` (`first_name`, `last_name`, `year`, `sexe`, `badge`, `arena_champions`, `fk_city_id`)
VALUES
('Jérôme', 'Thiollet', '1972-08-11', 'M', NULL, '0', 93),
('Iqra', 'Tariq', '1993-10-22', 'F', '2', '0', 82),
('Ajuro', 'Takahashi', '1998-12-09', 'M', NULL, '1', 97),
('Thomas', 'Quiniou', '2000-02-21', 'M', '8', '0', 25),
('Nhi', 'Pham', '1995-01-01', 'F', '56', '0', 76),
('Quentin', 'Marbois', '1995-07-20', 'M', '8', '0', 5),
('Maurice', 'Manouana', '1998-10-12', 'M', NULL, '1', 38),
('Samuel', 'Kamsler', '1997-05-01', 'M', '2', '0', 56),
('Laurent', 'Gautron', '1973-02-18', 'M', '12', '0', 98),
('Maxime', 'Diard', '1992-07-25', 'M', NULL, '1', 23),
('Ajitzi', 'Carmona', '1995-03-21', 'M', '32', '0', 68),
('Gael', 'Cantet', '1990-08-23', 'M', NULL, '0', 50),
('Bertrand', 'Bouland', '1988-12-02', 'M', '56', '0', 75),
('Guillaume', 'Bosis', '1983-10-20', 'M', '25', '0', 35),
('Enzo', 'Bernard', '1992-06-21', 'M', '46', '0', 70),
('Fatoumata', 'Barry', '1991-01-20', 'F', NULL, '1', 14),
('Manon', 'Alcuna', '1989-09-16', 'F', '9', '0', 3),
('Benoist', 'Lawniczak', '1976-06-23', 'M', '56', '1', 69),
('Anthony', 'Dupont', '1993-09-04', 'M', '1', '0', 76),
('Mickaël', 'Auger', '1978-09-12', 'M', '56', '1', 14),
('David', 'Breyault', '1992-12-02', 'M', '56', '1', 1);
/* Ajout de donnée dans la table "color" */
INSERT INTO
`color`(`name`)
VALUES
('rouge'),
('bleu'),
('jaune'),
('vert'),
('noir'),
('blanc'),
('rose'),
('orange'),
('violet'),
('marron'),
('purple'),
('gris'),
('brun');
/* Ajout de donnée dans la table "rarety" */
INSERT INTO
`rarety`(`name` )
VALUES
('Commun'),
('Peu Commun'),
('Rare'),
('Unique'),
('Inexistant');
/* Ajout de donnée dans la table "generation" */
INSERT INTO
`first_seen`(`generation`)
VALUES
('1'),
('2'),
('3'),
('4'),
('5'),
('6'),
('7'),
('8');
/* Ajout de donnée dans la table "talent" */
INSERT INTO `talent`
(
`name`,
`description`
)
VALUES
("Phobique", "Lorsque le Pokémon doté du talent Phobique est touché par une capacité de type Ténèbres, Insecte ou Spectre, sa Vitesse est augmentée d'un niveau. Depuis Pokémon Épée et Bouclier, le talent Intimidation du Pokémon ennemi active Phobique et monte donc sa Vitesse d'un niveau"),
("Télépathe", "Un Pokémon doté de ce talent est totalement immunisé aux capacités de ses partenaires en Combat Duo et Trio. Par exemple, si un partenaire utilise Surf en Combat Duo, le Pokémon doté du talent Télépathe n'est pas touché par l'attaque.Il faut noter que les dégâts infligés aux adversaires par le Pokémon partenaire restent inchangés."),
('Light Metal', 'Un Pokémon doté de Light Metal a une masse divisée par deux, impactant ainsi la puissance des capacités prenant en compte le poids du Pokémon.Ainsi, les dégâts causés par les attaques Nœud Herbe et Balayage à son encontre sont réduits. Il en va de même avec les capacités Tacle Feu et Tacle Lourd qui causent moins de dommages à son adversaire.'),
("Regard Vif", "Un Pokémon doté de ce talent ne peut pas perdre de Précision. À partir de la sixième génération, l'augmentation de l'Esquive adverse est également ignorée."),
("Lunatique", "À la fin de chaque tour, une des statistiques du Pokémon doté du talent Lunatique augmente de deux niveaux, tandis qu'une autre diminue d'un niveau. Depuis Pokémon Épée et Bouclier, le talent ne permet plus de modifier la Précision ni l'Esquive.Si une statistique est déjà augmentée à son maximum, Lunatique ne tentera pas de l'augmenter davantage. Inversement, une statistique ne peut pas être baissée si elle est déjà au minimum."),
("Attention", "Un Pokémon doté de ce talent ne peut pas être apeuré. Depuis Pokémon Épée et Bouclier, il n'est plus non plus affecté par le talent Intimidation du Pokémon ennemi.La capacité Mitra-Poing n'est pas affectée par ce talent : le Pokémon peut toujours être déconcentré s'il est touché avant de porter son coup.)"),
("Symbiose", "En Combat Duo ou Multi, si un Pokémon allié du Pokémon doté du talent Symbiose consomme son objet tenu, comme une Baie, alors le Pokémon avec Symbiose lui donnera l'objet que lui-même tient.Il ne peut toutefois pas transférer un Cristal Z ou une Méga-Gemme. Il ne peut pas non plus donner un objet spécifique à un Pokémon, comme une Plaque pour Arceus, une ROM pour Silvallié, ou encore, par exemple, l'Orbe Rouge de Groudon."),
("Moiteur", "Un Pokémon doté de Moiteur bloque les capacités d'auto-destruction. Ainsi, Destruction, Explosion, Caboche-Kaboum et Explo-Brume sont inefficaces. Elles ne peuvent pas non plus être utilisées par les porteurs de ce talent. Le talent Boom Final n'a également aucun effet. Cependant, Moiteur ne bloque ni Souvenir, ni Vœu Soin."),
('Agitation', 'Un Pokémon doté de ce talent voit son Attaque augmentée de 50 %, mais en contrepartie, sa Précision diminue de 20 % pour les capacités physiques uniquement (elle reste inchangée pour les attaques spéciales).'),
("Gluco-voile", "Un Pokémon doté de ce talent ne peut pas s'endormir pendant le combat. Par conséquent, il ne peut pas utiliser la capacité Repos.En Combat Duo ou Multi, les Pokémon alliés ne peuvent pas non plus s'endormir tant que le détenteur de Gluco-Voile est présent sur le terrain. Si un allié est affecté par Bâillement, et que le détenteur de Gluco-Voile arrive sur le terrain, alors l'allié ne s'endormira pas."),
("Colérique", "Un Pokémon doté de ce talent voit sa statistique d'Attaque augmenter au maximum (soit +6) s'il est touché par un coup critique. Le talent s'active aussi si le coup critique est effectué sur un clone"),
("Turbo", "Un Pokémon doté de Turbo voit sa statistique de Vitesse augmenter d'un niveau entre chaque tour.Si le Pokémon est posé sur le terrain lors d'un switch non provoqué par un K.O., l'effet de Turbo ne s'active pas le tour où il a été posé."),
("Motorisé", "Un Pokémon doté de Motorisé est totalement insensible aux capacités de type Électrik, aussi bien en terme de dégâts infligés que d'effets.En parallèle, chaque fois qu'il est touché par une capacité de ce type, il bénéficie d'une augmentation d'un niveau en Vitesse."),
('Hydratation', 'Un Pokémon doté de ce talent voit toutes ses altérations principales de statut (brûlure, gel, paralysie, empoisonnement et sommeil) soignées quand il pleut.'),
("Acharné", "Si un adversaire utilise une capacité ou un talent réduisant une statistique contre un Pokémon doté de ce talent, ce dernier voit son Attaque augmenter de deux niveaux.Acharné n'immunise cependant pas à la diminution de statistiques (même s'il s'agit de l'Attaque). Elle ne s'active pas non plus si la diminution est initiée par le Pokémon doté du talent, par l'un de ses alliés dans un Match Double ou Triple ou par une Toile Gluante qui est arrivé du côté du Pokémon possédant le talent grâce à Change-Côté."),
('Sans Limite', 'Si un Pokémon doté de ce talent utilise une capacité ayant des effets secondaires, cette capacité verra sa puissance de base augmenter de 30 %, mais les effets secondaires seront annulés en contrepartie.'),
("Pickpocket", "Lorsqu'un Pokémon doté du talent Pickpocket se fait toucher par une capacité directe, il vole l'objet tenu de son adversaire."),
("Paratonnerre", "Si un Pokémon adverse utilise une capacité de type Électrik lors d'un Combat Duo, alors celle-ci se dirige forcément vers le Pokémon doté de Paratonnerre. Cependant, si l'attaque doit toucher les deux Pokémon, alors celle-ci touchera quand même les deux Pokémon."),
("Force Soleil", "Un Pokémon doté de ce talent voit sa statistique d'Attaque Spéciale augmenter de 50 % lorsque le climat est ensoleillé. En parallèle, il perd 1/8 de ses PV maximums à la fin de chaque tour."),
("Impassible", "Un Pokémon doté de ce talent voit sa statistique de Vitesse augmenter d'un niveau (soit 50 % d'amélioration par rapport à la statistique de départ), lorsqu'il est apeuré.");
/* Ajout de donnée dans la table "pokemon" */
INSERT INTO `pokemon`
(
`name`,
`number`,
`taille`,
`poids`,
`rate_female`,
`rate_male`,
`fk_color_id`,
`fk_rarety_id`,
`fk_first_seen_id`,
`fk_talent_id`
)
VALUES
('Silvallié' , 773, 2.3, 100.5, 0, 0, 12, 5, 7, NULL),
('Snubbull', 209, 0.6, 7.8, 75, 25, 7, 3, 2, 1),
('Mushana', 518, 1.1, 60.5, 50, 50, 7, 2, 5, 2),
('Terhal', 374, 0.6, 95.2, 0, 0, 2, 4, 3, 3),
('Chaglam', 431, 0.5, 3.9, 75, 25, 12, 1, 4, 4),
('Queulorior', 235, 1.2, 58, 50, 50, 6, 2, 2, 5),
('Tiboudet', 749, 1, 110, 50, 50, 13, 2, 7, 6),
('Moufouette', 434, 0.4, 19.2, 50, 50, 9, 1, 4, 4),
('Flabébé', 669, 0.1, 0.1, 100, 50, 6, 3, 6, 7),
('Parasect', 047, 1, 29.5, 50, 50, 1, 3, 1, 8),
('Victini', 494, 0.4, 4, 0, 0, 3, 4, 5, NULL),
('Nidorino', 033, 0.9, 19.5, 0, 100, 9, 3, 1, 9),
('Sucreine', 763, 1.2, 21.4, 100, 0, 9, 5, 7, 10),
('Mascaïman', 551, 0.7, 15.2, 50, 50, 13, 1, 5, 11),
('Scobolide', 544, 1.2, 58.5, 50, 50, 12, 2, 5, 12),
('Motisma', 479, 0.3, 0.3, 0, 0, 1, 4, 4, NULL),
('Emolga', 587, 0.4, 5, 50, 50, 6, 3, 5, 13),
('Couaneton ', 580, 0.5, 5.5, 50, 50, 2, 3, 5, 14),
('Type:0', 772, 1.9, 120.5, 0, 0, 12, 4, 7, NULL),
('Granbull', 210, 1.4, 48.7, 75, 25, 9, 5, 2, 1),
('Munna', 517, 0.6, 23.3, 50, 50, 7, 2, 5, 2),
('Métang', 375, 1.2, 202.5, 0, 0, 2, 5, 3, 3),
('Métalosse', 376, 1.6, 550, 0, 0, 2, 5, 3, 3),
('Chaffreux', 432, 1, 43.8, 75, 25, 12, 1, 4, 15),
('Bourrinos', 750, 2.5, 920, 50, 50, 13, 2, 7, 6),
('Moufflair', 435, 1, 38, 50, 50, 9, 2, 4, 4),
('Floette', 670, 0.2, 0.9, 100, 0, 6, 5, 6, 7),
('Florges', 671, 1.1, 10, 100, 0, 6, 5, 6, 7),
('Paras', 046, 0.3, 5.4, 50, 50, 1, 2, 1, 8),
('Nidoran', 032, 0.5, 9, 0, 100, 9, 1, 1, 9),
('Nidoking', 034, 1.4, 62, 0, 100, 9, 5, 1, 16),
('Candine', 762, 0.7, 8.2, 100, 0, 9, 5, 7, 10),
('Croquine', 761, 0.3, 3.2, 100, 0, 9, 2, 7, 10),
('Escroco', 552, 1, 33.4, 50, 50, 13, 1, 5, 11),
('Crocorible', 553, 1.5, 96.3, 50, 50, 1, 5, 5, 11),
('Venipatte', 543, 0.4, 5.3, 50, 50, 1, 2, 5, 12),
('Brutapode', 545, 2.5, 200.5, 50, 50, 1, 5, 5, 12),
('Lakmécygne', 580, 1.3, 24.2, 50, 50, 6, 3, 5, 14),
('Zeraora', 807, 1.5, 44.5, 0, 0, 3, 5, 7, NULL),
('Golgopathe', 689, 1.3, 96, 50, 50, 13, 5, 6, 16),
('Opermine', 688, 0.5, 31, 50, 50, 13, 2, 6, 16),
('Pikachu', 025, 0.4, 6, 50, 50, 3, 1, 1, 17),
('Salamèche', 004, 0.6, 8.5, 12.5, 87.5, 1, 4, 1, 18),
('Pichu', 172, 0.3, 2, 50, 50, 3, 5, 2, 17),
('Reptincel', 005, 1.1, 19, 12.5, 87.5, 1, 5, 1, 18),
('Raichu', 026, 0.8, 30, 50, 50, 3, 3, 1, 17),
('Dracaufeu', 006, 1.7, 90.5, 12.5, 87.5, 1, 5, 1, 18),
('Insécateur', 123, 1.5, 56, 50, 50, 4, 2, 1, 19),
('Cizayox', 212, 1.8, 118, 50, 50, 1, 5, 2, 3);
/* Ajout de donnée dans la table "Evolution" */
INSERT INTO `pokemon_evolution`
(
`pokemon_id`,
`description`,
`pokemon_cible_id`
)
VALUES
(1, 'Sous-évolution', 19),
(19, 'Évolution', 1),
(2, 'Évolution', 20),
(20, 'Sous-évolution', 2),
(3, 'Sous-évolution', 21),
(21, 'Évolution', 3),
(4, 'Évolution', 22),
(22, 'Sous-évolution', 4),
(22, 'Évolution', 23),
(23, 'Sous-évolution', 22),
(5, 'Évolution', 24),
(24, 'Sous-évolution', 5),
(7, 'Évolution', 25),
(25, 'Sous-évolution', 7),
(8, 'Évolution', 26),
(26, 'Sous-évolution', 8),
(9, 'Évolution', 27),
(27, 'Sous-évolution', 9),
(27, 'Évolution', 28),
(28, 'Sous-évolution', 27),
(10, 'Sous-évolution', 29),
(29, 'Évolution', 10),
(12, 'Sous-évolution', 30),
(12, 'Évolution', 31),
(30, 'Évolution', 12),
(31, 'Sous-évolution', 30),
(13, 'Sous-évolution', 32),
(32, 'Évolution', 13),
(32, 'Sous-évolution', 33),
(33, 'Évolution', 32),
(14, 'Évolution', 34),
(34, 'Sous-évolution', 14),
(34, 'Évolution', 35),
(35, 'Sous-évolution', 34),
(15, 'Sous-évolution', 36),
(15, 'Évolution', 37),
(36, 'Évolution', 15),
(37, 'Sous-évolution', 36),
(18, 'Évolution', 38),
(38, 'Sous-évolution', 18),
(40, 'Sous-évolution', 41),
(41, 'Évolution', 40),
(42, 'Sous-évolution', 44),
(42, 'Évolution', 46),
(43, 'Évolution', 45),
(44, 'Évolution', 42),
(45, 'Évolution', 47),
(45, 'Sous-évolution', 43),
(46, 'Sous-évolution', 42),
(47, 'Sous-évolution', 45),
(48, 'Évolution', 49),
(49, 'Sous-évolution', 48);
/* Ajout de donnée dans la table "weakness_stronger" */
INSERT INTO `weakness_stronger`
(
`type_id`,
`description`,
`type_cible_id`
)
VALUES
(1, 'Fort', 3),
(1, 'Faible', 7),
(1, 'Fort', 15),
(1, 'Faible', 14),
(1, 'Fort', 6),
(1, 'Faible', 17),
(2, 'Fort', 4),
(2, 'Faible', 14),
(2, 'Fort', 5),
(2, 'Faible', 6),
(2, 'Fort', 9),
(2, 'Faible', 13),
(3, 'Fort', 7),
(3, 'Faible', 1),
(3, 'Fort', 10),
(3, 'Faible', 12),
(3, 'Fort', 9),
(4, 'Fort', 8),
(4, 'Faible', 14),
(4, 'Fort', 6),
(4, 'Faible', 15),
(4, 'Fort', 17),
(4, 'Faible', 2),
(5, 'Fort', 7),
(5, 'Faible', 2),
(5, 'Fort', 12),
(5, 'Faible', 18),
(5, 'Faible', 9),
(6, 'Fort', 14),
(6, 'Faible', 1),
(6, 'Fort', 15),
(6, 'Faible', 7),
(6, 'Fort', 2),
(6, 'Faible', 8),
(6, 'Fort', 13),
(6, 'Faible', 4),
(6, 'Faible', 17),
(7, 'Fort', 1),
(7, 'Faible', 3),
(7, 'Fort', 15),
(7, 'Faible', 5),
(7, 'Fort', 16),
(7, 'Faible', 13),
(7, 'Fort', 6),
(7, 'Fort', 9),
(8, 'Fort', 14),
(8, 'Faible', 11),
(8, 'Fort', 6),
(8, 'Faible', 4),
(8, 'Fort', 17),
(9, 'Fort', 6),
(9, 'Faible', 7),
(9, 'Fort', 18),
(9, 'Faible', 3),
(9, 'Faible', 2),
(10, 'Faible', 3),
(10, 'Faible', 15),
(11, 'Fort', 8),
(11, 'Faible', 17),
(11, 'Fort', 13),
(12, 'Fort', 3),
(12, 'Faible', 5),
(12, 'Fort', 4),
(12, 'Faible', 17),
(13, 'Fort', 7),
(13, 'Faible', 11),
(13, 'Fort', 2),
(13, 'Faible', 15),
(13, 'Fort', 4),
(13, 'Faible', 6),
(14, 'Fort', 1),
(14, 'Faible', 8),
(14, 'Fort', 15),
(14, 'Faible', 6),
(14, 'Fort', 2),
(14, 'Faible', 17),
(14, 'Fort', 4),
(15, 'Fort', 10),
(15, 'Faible', 1),
(15, 'Fort', 4),
(15, 'Faible', 7),
(15, 'Fort', 17),
(15, 'Faible', 14),
(15, 'Fort', 13),
(15, 'Faible', 6),
(16, 'Faible', 7),
(17, 'Fort', 1),
(17, 'Faible', 8),
(17, 'Fort', 11),
(17, 'Faible', 15),
(17, 'Fort', 14),
(17, 'Faible', 4),
(17, 'Fort', 12),
(17, 'Fort', 6),
(18, 'Fort', 5),
(18, 'Faible', 9);
/* Ajout de donnée dans la table "type_pokemon" */
INSERT INTO `type_pokemon`
(
`pokemon_id`,
`type_id`
)
VALUES
(1, 16),
(2, 3),
(3, 5),
(4, 1),
(4, 5),
(5, 16),
(6, 16),
(7, 17),
(8, 12),
(8, 9),
(9, 3),
(10, 2),
(10, 4),
(11, 5),
(11, 14),
(12, 12),
(13, 4),
(14, 17),
(14, 9),
(15, 2),
(15, 12),
(16, 11),
(17, 11),
(17, 13),
(18, 8),
(18, 13),
(19, 16),
(20, 3),
(21, 5),
(22, 1),
(22, 5),
(23, 1),
(23, 5),
(24, 16),
(25, 17),
(26, 9),
(26, 12),
(27, 3),
(28, 3),
(29, 2),
(29, 4),
(30, 12),
(31, 12),
(31, 17),
(32, 4),
(33, 4),
(34, 17),
(34, 9),
(35, 17),
(35, 9),
(36, 2),
(36, 12),
(37, 2),
(37, 12),
(38, 8),
(38, 13),
(39, 11),
(40, 8),
(40, 6),
(41, 8),
(41, 6),
(42, 11),
(43, 14),
(44, 11),
(45, 14),
(46, 11),
(47, 14),
(47, 13),
(48, 2),
(48, 13),
(49, 2),
(49, 1);
/* Ajout de donnée dans la table "region_pokemon" */
INSERT INTO `region_pokemon`
(
`region_id`,
`pokemon_id`
)
VALUES
(7, 1),
(8, 1),
(2, 2),
(3, 2),
(6, 2),
(7, 2),
(5, 3),
(8, 3),
(3, 4),
(5, 4),
(7, 4),
(8, 4),
(4, 5),
(2, 6),
(3, 6),
(6, 6),
(7, 6),
(7, 7),
(8, 7),
(4, 8),
(6, 8),
(8, 8),
(6, 9),
(7, 9),
(1, 10),
(2, 10),
(3, 10),
(7, 10),
(5, 11),
(1, 12),
(2, 12),
(3, 12),
(6, 12),
(8, 12),
(7, 13),
(8, 13),
(5, 14),
(6, 14),
(7, 14),
(8, 14),
(5, 15),
(6, 15),
(8, 15),
(4, 16),
(6, 16),
(8, 16),
(5, 17),
(6, 17),
(7, 17),
(8, 17),
(5, 18),
(6, 18),
(7, 19),
(8, 19),
(2, 20),
(3, 20),
(6, 20),
(7, 20),
(5, 21),
(8, 21),
(3, 22),
(5, 22),
(7, 22),
(8, 22),
(3, 23),
(5, 23),
(7, 23),
(8, 23),
(4, 24),
(7, 25),
(8, 25),
(4, 26),
(6, 26),
(8, 26),
(6, 27),
(7, 27),
(6, 28),
(7, 28),
(1, 29),
(2, 29),
(3, 29),
(7, 29),
(1, 30),
(2, 30),
(3, 30),
(6, 30),
(8, 30),
(1, 31),
(2, 31),
(3, 31),
(6, 31),
(8, 31),
(7, 32),
(8, 32),
(7, 33),
(8, 33),
(5, 34),
(6, 34),
(7, 34),
(8, 34),
(5, 35),
(6, 35),
(7, 35),
(8, 35),
(5, 36),
(6, 36),
(8, 36),
(5, 37),
(6, 37),
(8, 37),
(5, 38),
(6, 38),
(7, 39),
(6, 40),
(8, 40),
(6, 41),
(8, 41),
(1, 42),
(2, 42),
(3, 42),
(4, 42),
(6, 42),
(7, 42),
(8, 42),
(1, 43),
(2, 43),
(3, 43),
(6, 43),
(8, 43),
(2, 44),
(3, 44),
(4, 44),
(6, 44),
(7, 44),
(8, 44),
(1, 45),
(2, 45),
(3, 45),
(6, 45),
(8, 45),
(1, 46),
(2, 46),
(3, 46),
(4, 46),
(6, 46),
(7, 46),
(8, 46),
(1, 47),
(2, 47),
(3, 47),
(6, 47),
(8, 47),
(1, 48),
(2, 48),
(3, 48),
(4, 48),
(6, 48),
(7, 48),
(2, 49),
(3, 49),
(4, 49),
(6, 49),
(7, 49),
(8, 49);
/* Ajout de donnée dans la table "pokemon_dresseur" */
INSERT INTO `pokemon_dresseur`
(
`dresseur_id`,
`pokemon_id`
)
VALUES
(1, 21),
(1, 2),
(1, 1),
(1, 29),
(1, 13),
(2, 18),
(2, 37),
(3, 36),
(3, 33),
(3, 46),
(3, 18),
(3, 17),
(4, 30),
(4, 12),
(4, 32),
(5, 23),
(5, 27),
(5, 10),
(5, 42),
(5, 9),
(5, 6),
(6, 27),
(6, 16),
(6, 9),
(6, 28),
(6, 25),
(7, 9),
(7, 36),
(7, 34),
(7, 16),
(7, 3),
(7, 24),
(8, 29),
(8, 13),
(8, 20),
(8, 29),
(8, 11),
(8, 33),
(9, 29),
(9, 36),
(10, 1),
(10, 43),
(10, 31),
(10, 42),
(10, 25),
(11, 3),
(11, 41),
(11, 2),
(11, 34),
(11, 45),
(11, 8),
(12, 41),
(12, 34),
(13, 47) ,
(13, 23),
(13, 30),
(13, 36),
(14, 24),
(14, 19),
(14, 42),
(14, 18),
(14, 11),
(14, 35),
(15, 5),
(15, 29),
(15, 15),
(15, 41),
(15, 11),
(15, 6),
(16, 4),
(16, 30),
(16, 1),
(16, 15),
(16, 11),
(17, 23),
(17, 8),
(17, 30),
(17, 43),
(17, 44),
(17, 6),
(18, 10),
(18, 30),
(18, 47),
(18, 33),
(18, 40),
(18, 31),
(20, 28),
(20, 12),
(20, 37),
(20, 7),
(20, 19),
(20, 14),
(21, 44),
(21, 47),
(21, 23),
(21, 31),
(21, 48),
(21, 38);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.