text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- ホスト: localhost
-- 生成日時: 2020 年 6 月 15 日 17:18
-- サーバのバージョン: 10.4.11-MariaDB
-- PHP のバージョン: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- データベース: `gsacf_l03_12`
--
-- --------------------------------------------------------
--
-- テーブルの構造 `cource_table`
--
CREATE TABLE `cource_table` (
`cource_id` int(12) NOT NULL,
`cource_txt` text COLLATE utf8_unicode_ci NOT NULL,
`cource_gap` int(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- テーブルのデータのダンプ `cource_table`
--
INSERT INTO `cource_table` (`cource_id`, `cource_txt`, `cource_gap`) VALUES
(1, '東京DEV', 0),
(2, '東京LAB', 7),
(3, '福岡DEV', 10),
(4, '福岡LAB', 13);
--
-- ダンプしたテーブルのインデックス
--
--
-- テーブルのインデックス `cource_table`
--
ALTER TABLE `cource_table`
ADD PRIMARY KEY (`cource_id`);
--
-- ダンプしたテーブルのAUTO_INCREMENT
--
--
-- テーブルのAUTO_INCREMENT `cource_table`
--
ALTER TABLE `cource_table`
MODIFY `cource_id` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
drop database bookmall;
select * from member;
select * from category;
select * from book;
select * from cart;
select * from orders;
select * from orderbook;
delete from category;
drop table category;
|
create TABLE product
( prod_id number(4) primary key,
prod_name varchar2(25),
prod_expiry_date date not null
); |
SELECT f.code_insee||f.id_voie||f.cle_rivoli fantoir,
nature_voie||' '||libelle_voie voie,
c.voie_osm,
ST_X(c.geometrie),
ST_Y(c.geometrie),
COALESCE(s.id_statut,0)
FROM fantoir_voie f
JOIN (SELECT fantoir FROM cumul_voies WHERE insee_com = '__com__'
EXCEPT
SELECT fantoir FROM cumul_adresses WHERE insee_com = '__com__' AND voie_osm != '')r
ON f.code_insee||f.id_voie||f.cle_rivoli = r.fantoir
JOIN cumul_voies c
ON r.fantoir = c.fantoir
LEFT OUTER JOIN (SELECT fantoir,id_statut
FROM (SELECT *,rank() OVER (PARTITION BY fantoir ORDER BY timestamp_statut DESC) rang
FROM statut_fantoir
WHERE insee_com = '__com__')r
WHERE rang = 1) s
ON r.fantoir = s.fantoir
WHERE f.code_insee = '__com__'
ORDER BY 3;
|
DROP TABLE IF EXISTS DATA;
CREATE TABLE DATA(
id VARCHAR(40) NOT NULL PRIMARY KEY,
dataType VARCHAR(80) NOT NULL,
contentType VARCHAR(40) NOT NULL,
data MEDIUMBLOB NOT NULL, -- max 16 MB
name VARCHAR (255),
INDEX dataType (dataType)
);
DROP TABLE IF EXISTS SESSION;
CREATE TABLE SESSION(
SESSION_ID VARCHAR(255) NOT NULL PRIMARY KEY,
CREATED DATETIME,
INDEX CREATED (CREATED)
); |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
create table if not exists flyway_schema_history
(
installed_rank uuid default uuid_generate_v4() not null
constraint flyway_schema_history_pk
primary key,
version varchar(50),
description varchar(200) not null,
type varchar(20) not null,
script varchar(1000) not null,
checksum integer,
installed_by varchar(100) not null,
installed_on timestamp default now() not null,
execution_time integer not null,
success boolean not null
);
create index if not exists flyway_schema_history_s_idx
on flyway_schema_history (success);
create table if not exists tbl_director
(
id_director uuid default uuid_generate_v4() not null
constraint tbl_director_pk
primary key,
firstname_director varchar(255),
lastname_director varchar(255),
description_director varchar(255),
url_director varchar(255),
img_director varchar(255)
);
create table if not exists tbl_content
(
id_content uuid default uuid_generate_v4() not null
constraint tbl_content_pk
primary key,
name_content varchar(255) not null,
description_content varchar(255),
released_content date,
visible_content boolean,
type_content integer not null,
url_content varchar(255),
img_content varchar(255)
);
create table if not exists tbl_genre
(
id_genre uuid default uuid_generate_v4() not null
constraint tbl_genre_pk
primary key,
name_genre varchar(255) not null,
url_genre varchar(255)
);
create table if not exists tbl_genre_content
(
id_genre uuid default uuid_generate_v4() not null
constraint tbl_genre_content_tbl_genre_id_genre_fk
references tbl_genre,
id_content uuid default uuid_generate_v4() not null
constraint tbl_genre_content_tbl_content_id_content_fk
references tbl_content
);
create table if not exists tbl_actor
(
id_actor uuid default uuid_generate_v4() not null
constraint tbl_actor_pk
primary key,
firstname_actor varchar(255),
lastname_actor varchar(255),
description_actor varchar(255),
url_actor varchar(255),
img_actor varchar(255)
);
create table if not exists tbl_actor_content
(
id_actor uuid default uuid_generate_v4() not null
constraint tbl_actor_content_tbl_actor_id_actor_fk
references tbl_actor,
id_content uuid default uuid_generate_v4() not null
constraint tbl_actor_content_tbl_media_id_content_fk
references tbl_content
);
create table if not exists tbl_user
(
id_user uuid default uuid_generate_v4() not null
constraint tbl_user_pk
primary key,
login_user varchar(255) not null,
password_user varchar(255) not null,
name_user varchar(255) not null,
email_user varchar(255)
);
create unique index if not exists tbl_user_login_user_uindex
on tbl_user (login_user);
create table if not exists tbl_role
(
id_role uuid default uuid_generate_v4() not null
constraint tbl_role_pk
primary key,
name_role varchar(255) not null
);
create table if not exists tbl_role_user
(
id_role uuid default uuid_generate_v4() not null
constraint tbl_role_user_tbl_role_id_role_fk
references tbl_role,
id_user uuid default uuid_generate_v4() not null
constraint tbl_role_user_tbl_user_id_user_fk
references tbl_user
);
create table if not exists tbl_history
(
id_history uuid default uuid_generate_v4() not null
constraint tbl_history_pk
primary key,
id_user uuid not null
constraint tbl_history_tbl_user_id_user_fk
references tbl_user,
id_content uuid not null
constraint tbl_history_tbl_content_id_content_fk
references tbl_content (id_content),
date_history date default now() not null
);
create table if not exists tbl_season
(
id_season uuid default uuid_generate_v4() not null
constraint tbl_season_pk
primary key,
id_content uuid not null
constraint tbl_season_tbl_content_id_content_fk
references tbl_content (id_content),
number_season integer not null,
description_season varchar(255)
);
create table if not exists tbl_comment
(
id_comment uuid default uuid_generate_v4() not null
constraint tbl_comment_pk
primary key,
id_user uuid not null
constraint tbl_comment_tbl_user_id_user_fk
references tbl_user,
id_entity uuid default uuid_generate_v4() not null,
text_comment varchar(255) not null,
date_comment date default now() not null
);
create table if not exists tbl_director_content
(
id_director uuid default uuid_generate_v4() not null
constraint tbl_director_content_tbl_director_id_director_fk
references tbl_director,
id_content uuid default uuid_generate_v4() not null
constraint tbl_director_content_tbl_content_id_content_fk
references tbl_content (id_content)
);
create table if not exists tbl_episode
(
id_episode uuid default uuid_generate_v4() not null
constraint tbl_episode_pk
primary key,
id_season uuid not null
constraint tbl_episode_tbl_season_id_season_fk
references tbl_season,
number_episode integer not null,
name_episode varchar(255) not null,
description_episode varchar(255),
img_episode varchar(255)
);
-- Добавление ролей
insert into tbl_role(id_role, name_role)
values ('30cd0855-daa0-4611-8b9b-2b91b9defdde', 'ROLE_ADMIN');
insert into tbl_role(id_role, name_role)
values ('06ff9230-c3dd-44bb-aaf3-ef2ef4991c3f', 'ROLE_USER');
-- Добавление админа (admin admin)
insert into tbl_user(id_user, login_user, password_user, name_user)
values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', 'admin', '$2a$10$5rAOMKmVsh9.NlzXTLLbq.XwouGdg3dwohvb5/HDn692YfdrLthO2', 'vladimir');
-- Связка пользователя с ролью
insert into tbl_role_user (id_role, id_user)
values ('30cd0855-daa0-4611-8b9b-2b91b9defdde', 'ef39e14f-8e9e-4bd6-894f-3b7e99cf8089');
-- Заполнение таблицы content
-- Сериалы
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('1740acb5-a8c6-43f8-b8e1-faa74c92ea4a','Игра престолов', 'тут описание', '2020-05-27', true, 0,'igra-prestolov');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('8d0f77af-0679-4b53-a0ac-5f655c991ef0','Пустыня смерти', 'тут описание', '2020-05-17', true, 0,'pustynya-smerti');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('68c2769d-2e9f-4dd7-b322-1d5124a05bef','Сопрано', 'тут описание', '2020-05-17', true, 0,'soprano');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('1c6b8365-7b92-4772-9406-458ca0e7f4ab','Рик и морти', 'тут описание', '2020-05-17', true, 0,'rik-i-morti');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('47725759-864e-4d4d-a601-dd52d1506e2a','Мир дикого запада', 'тут описание', '2020-05-17', true, 0,'mir-dikogo-zapada');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('8e3287b6-35f6-4a1d-81e8-47df3cf1f793','Убивая Еву', 'тут описание', '2020-05-17', true, 0,'ubivaya-yevu');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('51bf778e-46e5-4f01-8c31-e6bb0de53a7c','Шепот', 'тут описание', '2020-05-17', true, 0,'shepot');
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('f3b18f94-67f5-43b8-a452-71b62f5e3230','Южный парк', 'тут описание', '2020-05-17', true, 0,'yuzhnyy-park');
--Фильмы
insert into tbl_content(id_content ,name_content, description_content, released_content, visible_content, type_content, url_content) values ('86a38fc4-a9a6-45e8-a6c8-08aac7949f25','Интерстеллар', 'тут описание', '2020-05-27', true, 1,'interstellar');
-- Заполенение Жанров
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('295c4a70-f4ca-4e49-8cd7-3542c53f4925','аниме','anime');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('57ebe16d-f03c-4042-8383-af34d6eb5797','биографический','biograficheskiy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('2873a8ec-cbdd-4d3c-947f-f78d598862fc','боевик','boyevik');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('5f90ff46-8310-498f-824c-cc4acdb1d056','вестерн','vestern');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('a06e6e92-4eec-480d-8f21-3e4bed9689da','военный','voyennyy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('befbffe3-ac6b-4674-825e-6daff22b4445','детектив','detektiv');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('17cbcddf-3c26-48a0-9f00-a70642339c00','детский','detskiy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('63964689-8f8c-4f11-9817-32a6c9dc1c6a','документальный','dokumentalnyy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('a9e52f5e-f93c-4d08-864a-ad98d291a7c8','драма','drama');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('d5a2b664-4065-4d16-aff4-5fcac7fd132a','исторический','istoricheskiy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('545f2219-c2b9-4091-9aec-1f52396bf2b0','кинокомикс','kinokomiks');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('cb682ebe-bebf-4bcf-9533-584f746086f0','комедия','komediya');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('522d65dd-9415-409b-b80f-849d937e20b6','концерт','kontsert');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('97af4963-8e4b-4472-ad2c-f2bdf894663b','короткометражный','korotkometrazhnyy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('983cb528-6018-4ae0-a1a8-d19d17e93d36','криминал','kriminal');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('b52879d8-6e13-45f6-8414-3e7b31e635d2','мелодрама','melodrama');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('9ff50344-2240-45a3-9cbc-5f54fddefee4','мистика','mistika');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('50cd1c82-ac85-4af6-b255-5a025f0fa101','музыка','muzyka');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('9f73d230-bd23-444c-a9c8-51cfe7efa96f','мультфильм','multfilm');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('83bad475-9608-4076-ab75-0dba46f7191b','мюзикл','myuzikl');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('d87bcaa3-8845-4e99-b5f7-ead063826737','научный','nauchnyy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('af140e6a-0c8b-4f53-859f-6a028c4a94bd','приключения','priklyucheniya');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('d1440361-4090-49da-8e05-ae44d35dc049','реалити-шоу','realiti-shou');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('3a7deea6-aeab-496c-82be-58349c03998e','семейный','semeynyy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('052cc798-4aa9-4e3a-8412-44513f47c114','спорт','sport');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('3e3fc3bd-7d85-494d-8322-77e0f817a57d','ток-шоу','tok-shou');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('9bb0f262-d837-4734-b269-d83733de435a','триллер','triller');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('bbe924ec-4d60-40eb-b2ba-c02bcfacab99','ужасы','uzhasy');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('d1427e89-5737-4c34-bcef-a4848101179b','фантастика','fantastika');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('2a27990a-61ce-4898-b522-80445d6d59ff','фильм-нуар','film-nuar');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('249a3e23-b911-4dc3-ad1a-b7bbc0be3cd7','фэнтези','fentezi');
insert into tbl_genre(id_genre ,name_genre, url_genre) values ('411cc4ce-3c78-41da-81d4-4aa9135514d6','эротика','erotika');
-- Связка жанров и контента
insert into tbl_genre_content(id_genre, id_content) values ('295c4a70-f4ca-4e49-8cd7-3542c53f4925','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_genre_content(id_genre, id_content) values ('57ebe16d-f03c-4042-8383-af34d6eb5797','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_genre_content(id_genre, id_content) values ('2873a8ec-cbdd-4d3c-947f-f78d598862fc','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_genre_content(id_genre, id_content) values ('5f90ff46-8310-498f-824c-cc4acdb1d056','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_genre_content(id_genre, id_content) values ('a06e6e92-4eec-480d-8f21-3e4bed9689da','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_genre_content(id_genre, id_content) values ('befbffe3-ac6b-4674-825e-6daff22b4445','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_genre_content(id_genre, id_content) values ('17cbcddf-3c26-48a0-9f00-a70642339c00','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_genre_content(id_genre, id_content) values ('63964689-8f8c-4f11-9817-32a6c9dc1c6a','f3b18f94-67f5-43b8-a452-71b62f5e3230');
insert into tbl_genre_content(id_genre, id_content) values ('a9e52f5e-f93c-4d08-864a-ad98d291a7c8','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_genre_content(id_genre, id_content) values ('d5a2b664-4065-4d16-aff4-5fcac7fd132a','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_genre_content(id_genre, id_content) values ('545f2219-c2b9-4091-9aec-1f52396bf2b0','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_genre_content(id_genre, id_content) values ('cb682ebe-bebf-4bcf-9533-584f746086f0','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_genre_content(id_genre, id_content) values ('522d65dd-9415-409b-b80f-849d937e20b6','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_genre_content(id_genre, id_content) values ('97af4963-8e4b-4472-ad2c-f2bdf894663b','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_genre_content(id_genre, id_content) values ('983cb528-6018-4ae0-a1a8-d19d17e93d36','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_genre_content(id_genre, id_content) values ('b52879d8-6e13-45f6-8414-3e7b31e635d2','f3b18f94-67f5-43b8-a452-71b62f5e3230');
insert into tbl_genre_content(id_genre, id_content) values ('295c4a70-f4ca-4e49-8cd7-3542c53f4925','f3b18f94-67f5-43b8-a452-71b62f5e3230');
insert into tbl_genre_content(id_genre, id_content) values ('57ebe16d-f03c-4042-8383-af34d6eb5797','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_genre_content(id_genre, id_content) values ('2873a8ec-cbdd-4d3c-947f-f78d598862fc','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_genre_content(id_genre, id_content) values ('5f90ff46-8310-498f-824c-cc4acdb1d056','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_genre_content(id_genre, id_content) values ('a06e6e92-4eec-480d-8f21-3e4bed9689da','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_genre_content(id_genre, id_content) values ('befbffe3-ac6b-4674-825e-6daff22b4445','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_genre_content(id_genre, id_content) values ('17cbcddf-3c26-48a0-9f00-a70642339c00','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_genre_content(id_genre, id_content) values ('63964689-8f8c-4f11-9817-32a6c9dc1c6a','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_genre_content(id_genre, id_content) values ('a9e52f5e-f93c-4d08-864a-ad98d291a7c8','f3b18f94-67f5-43b8-a452-71b62f5e3230');
insert into tbl_genre_content(id_genre, id_content) values ('d5a2b664-4065-4d16-aff4-5fcac7fd132a','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_genre_content(id_genre, id_content) values ('545f2219-c2b9-4091-9aec-1f52396bf2b0','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_genre_content(id_genre, id_content) values ('cb682ebe-bebf-4bcf-9533-584f746086f0','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_genre_content(id_genre, id_content) values ('522d65dd-9415-409b-b80f-849d937e20b6','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_genre_content(id_genre, id_content) values ('97af4963-8e4b-4472-ad2c-f2bdf894663b','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_genre_content(id_genre, id_content) values ('983cb528-6018-4ae0-a1a8-d19d17e93d36','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_genre_content(id_genre, id_content) values ('b52879d8-6e13-45f6-8414-3e7b31e635d2','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
-- Заполнение актеров
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('b2154a81-f5d7-4c63-963b-7580065fccd9', 'Василий', 'Медведев', 'Очень хороший человек и актеров','vasiliy-medvedev');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('4590fe12-ad94-4b07-a474-0b63daad377b', 'Григорич', 'Путин', 'Очень хороший человек и актеров','grigorich-putin');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('3c59fb86-baa8-4f47-9cd1-4a8b28f35ba4', 'Сергей', 'Рогозин', 'Очень хороший человек и актеров','sergey-rogozin');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('925d3d6d-712e-4248-8886-ae53dcffed93', 'Андрей', 'Собянин', 'Очень хороший человек и актеров','andrey-sobyanin');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('f08fc5cb-bba6-4d2e-baaf-35f431b95ef9', 'Кира', 'Лавров', 'Очень хороший человек и актеров','kira-lavrov');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('96c623da-7691-4f91-80a4-fbe8a7e53e11', 'Сема', 'Топвый', 'Очень хороший человек и актеров','sema-topvyy');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('452c769d-3b26-4ddc-82dd-84715e629c99', 'Евген', 'Нолан', 'Очень хороший человек и актеров','yevgen-nolan');
insert into tbl_actor (id_actor, firstname_actor, lastname_actor, description_actor, url_actor) VALUES ('8da0729b-7bcc-4e00-b83f-9d25be64b6d1', 'Маша', 'Симосян', 'Очень хороший человек и актеров','masha-simosyan');
-- Связка актеров и контента
insert into tbl_actor_content(id_actor, id_content) VALUES ('b2154a81-f5d7-4c63-963b-7580065fccd9','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_actor_content(id_actor, id_content) VALUES ('4590fe12-ad94-4b07-a474-0b63daad377b','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_actor_content(id_actor, id_content) VALUES ('3c59fb86-baa8-4f47-9cd1-4a8b28f35ba4','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_actor_content(id_actor, id_content) VALUES ('925d3d6d-712e-4248-8886-ae53dcffed93','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_actor_content(id_actor, id_content) VALUES ('f08fc5cb-bba6-4d2e-baaf-35f431b95ef9','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_actor_content(id_actor, id_content) VALUES ('96c623da-7691-4f91-80a4-fbe8a7e53e11','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_actor_content(id_actor, id_content) VALUES ('452c769d-3b26-4ddc-82dd-84715e629c99','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_actor_content(id_actor, id_content) VALUES ('8da0729b-7bcc-4e00-b83f-9d25be64b6d1','f3b18f94-67f5-43b8-a452-71b62f5e3230');
insert into tbl_actor_content(id_actor, id_content) VALUES ('8da0729b-7bcc-4e00-b83f-9d25be64b6d1','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_actor_content(id_actor, id_content) VALUES ('452c769d-3b26-4ddc-82dd-84715e629c99','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_actor_content(id_actor, id_content) VALUES ('96c623da-7691-4f91-80a4-fbe8a7e53e11','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_actor_content(id_actor, id_content) VALUES ('f08fc5cb-bba6-4d2e-baaf-35f431b95ef9','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_actor_content(id_actor, id_content) VALUES ('925d3d6d-712e-4248-8886-ae53dcffed93','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_actor_content(id_actor, id_content) VALUES ('3c59fb86-baa8-4f47-9cd1-4a8b28f35ba4','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_actor_content(id_actor, id_content) VALUES ('4590fe12-ad94-4b07-a474-0b63daad377b','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_actor_content(id_actor, id_content) VALUES ('b2154a81-f5d7-4c63-963b-7580065fccd9','f3b18f94-67f5-43b8-a452-71b62f5e3230');
-- заполнение режжисера
insert into tbl_director(id_director, firstname_director, lastname_director, description_director, url_director)
values ('cc959d7b-ba6a-4458-be47-6e8cca63bafb', 'Алексей', 'Петров', 'Андройд и учитель Нолана, собрал все в мире нагрды и снял лучшие фильмы', 'alex-petrov');
-- связка режиисера и контента
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','8d0f77af-0679-4b53-a0ac-5f655c991ef0');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','68c2769d-2e9f-4dd7-b322-1d5124a05bef');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','1c6b8365-7b92-4772-9406-458ca0e7f4ab');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','47725759-864e-4d4d-a601-dd52d1506e2a');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','8e3287b6-35f6-4a1d-81e8-47df3cf1f793');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','51bf778e-46e5-4f01-8c31-e6bb0de53a7c');
insert into tbl_director_content(id_director, id_content) VALUES ('cc959d7b-ba6a-4458-be47-6e8cca63bafb','f3b18f94-67f5-43b8-a452-71b62f5e3230');
-- заполнение сезонов (игра престолов)
insert into tbl_season (id_season, id_content, number_season, description_season) values ('57d12cd4-ec35-42c1-9b88-22ea330c2b10','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a', 1 , 'Откровенно фиговый сезон');
insert into tbl_season (id_season, id_content, number_season, description_season) values ('1b71c4be-5361-4e2c-94e9-93caf73eecaf','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a', 2 , 'Та же шляпа');
insert into tbl_season (id_season, id_content, number_season, description_season) values ('5e291fb1-6962-4a06-9d82-970d46b3833c','1740acb5-a8c6-43f8-b8e1-faa74c92ea4a', 3 , 'Этот сезон точно интереснее предыдущих');
-- заполнение эпизодов по сезонам (игра престолов)
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('742da102-b403-4934-9f3c-b74a5ce07860','57d12cd4-ec35-42c1-9b88-22ea330c2b10', 1, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('0ca26d11-f2b6-4955-a617-d9bd390b4713','57d12cd4-ec35-42c1-9b88-22ea330c2b10', 2, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('83580aa6-01f2-4d31-8f5d-ece408ce334f','57d12cd4-ec35-42c1-9b88-22ea330c2b10', 3, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('473cb191-5152-468a-adf0-3f690c087ea9','1b71c4be-5361-4e2c-94e9-93caf73eecaf', 1, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('ced70d3c-1d08-4456-84e4-20e3d3500594','1b71c4be-5361-4e2c-94e9-93caf73eecaf', 2, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('d9da9647-38c6-430b-b8ab-b366a08cffdb','1b71c4be-5361-4e2c-94e9-93caf73eecaf', 3, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('68cc52a9-c495-4912-881a-d021f7d8bf0e','5e291fb1-6962-4a06-9d82-970d46b3833c', 1, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('d2ccf26a-bdac-4251-90a1-a45cf90ff297','5e291fb1-6962-4a06-9d82-970d46b3833c', 2, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
insert into tbl_episode(id_episode, id_season, number_episode, name_episode, description_episode) values ('e719e33e-7bcb-49b4-a9f7-a8ce09463b6b','5e291fb1-6962-4a06-9d82-970d46b3833c', 3, 'Lorem', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');
-- добавление комментариев к фильму
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
insert into tbl_comment (id_user, id_entity, text_comment, date_comment) values ('ef39e14f-8e9e-4bd6-894f-3b7e99cf8089', '86a38fc4-a9a6-45e8-a6c8-08aac7949f25', 'Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', '2020-05-27');
|
USE Louisvilleky;
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Animal Bite",1);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Bite",2);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Burn from heat",3);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Chest Pain",4);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Contusion/Bruise",5);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Cut or Laceration",6);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Cut, laceration or scratches",7);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Sprain (ligament)",8);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Sprain or Strain",9);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Sudden Illness",10);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Fracture",11);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Wound from a weapon",12);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Foreign Body",13);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Foreign Body (splinter)",14);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Human Bite",15);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Infection",16);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Other",17);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Bloodborne Disease",18);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Bloodborne Pathogen Exposure",19);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Concussion-Brain, cerebral",20);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Contact dermatitis (Rash, Poison Ivy)",21);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Inflammation",22);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Inhilation of an unknown substance",23);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Respiratory Disorders",24);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Respiratory Irritation",25);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Puncture",26);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("NULL",27);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Dislocation",28);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Burn",29);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Burn from chemical",30);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Heat Illness",31);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Multiple injuries",32);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Multiple natures",33);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Inflamation",34);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Irritation",35);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Strain (muscle/tendon)",36);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Tear of muscle/tendon/ligament",37);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Crushing",38);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Cumulative Injury",39);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Eye Injury",40);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Hernia",41);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Hyperextension",42);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Dehydration",43);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Insect Bite",44);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Poisoning - Chemical",45);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Scratches, abrasions-superficial",46);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Electric Shock, electrocution",47);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Insect Sting",48);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Poisoning - animal / insect",49);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Carpal Tunnel",50);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Exhaustion",51);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Tendonitis",52);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Chemical Exposure",53);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Cold Illness",54);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Privacy",55);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Exposure to Substance",56);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Amputation or enucleation",57);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Stress",58);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Hernia, rupture",59);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Bacteria",60);
INSERT INTO OSHA_TYPE (OSHA_Description,OSHA_Type_id) VALUES ("Asthma",61);
|
CREATE TABLE flowcell_lane_qc_history (
flowcell_lane_qc_history_id int(10) unsigned NOT NULL AUTO_INCREMENT,
flowcell_lane_qc_id int(10) unsigned NOT NULL,
flowcell_id int(10) unsigned NOT NULL,
lane int(2) NOT NULL,
comments text,
status_id int(10) unsigned NOT NULL,
archive_status_id int(10) DEFAULT NULL,
archive_file_name varchar(255) DEFAULT NULL,
date_created timestamp NULL DEFAULT NULL,
user_and_ip varchar(200) NOT NULL,
PRIMARY KEY (flowcell_lane_qc_history_id),
KEY flowcell_id (flowcell_id,lane)
)
|
set statistics io on
set statistics time on
select orders.orderid, orders.orderdate, customers.country
from orders join customers on customers.customerid = orders.customerid
where
(year(orders.orderdate) >= 1996 and month(orders.orderdate) >= 10) and
(customers.country = 'Canada' or customers.country = 'France')
create clustered index ind1_c on customers(customerid)
create clustered index ind2_c on orders(customerid)
create nonclustered index ind1_n on customers(country)
create nonclustered index ind2_n on orders(orderdate) include (orderid)
select orders.orderid, orders.orderdate, customers.country
from orders join customers on customers.customerid = orders.customerid
where
((year(orders.orderdate) >= 1996 and month(orders.orderdate) >= 10) or (year(orders.orderdate) >= 1997)) and
(customers.country = 'Canada' or customers.country = 'France')
orders.orderdate >= '19961001'
drop index customers.ind1_n
drop index orders.ind2_n
drop index customers.ind1_c
drop index orders.ind2_c
--без индексов 5 мс и 58 операций
--с индексами 2 мс и 16 операций
|
ALTER TABLE hr.`locations` CHANGE `STREET_ADDRESS` `ADDRESS` VARCHAR(40);
ALTER TABLE hr.`regions` CHANGE `REGION_NAME` `REGION` VARCHAR(25);
ALTER TABLE hr.`countries` CHANGE `COUNTRY_NAME` `COUNTRY` VARCHAR(40);
|
DROP PROCEDURE CPI.AEG_CREATE_ACCT_ENTRIES_Y;
CREATE OR REPLACE PROCEDURE CPI.AEG_Create_Acct_Entries_Y
(aeg_sl_cd GIAC_ACCT_ENTRIES.sl_cd%TYPE,
aeg_module_id GIAC_MODULE_ENTRIES.module_id%TYPE,
aeg_item_no GIAC_MODULE_ENTRIES.item_no%TYPE,
aeg_iss_cd GIAC_DIRECT_PREM_COLLNS.b140_iss_cd%TYPE,
aeg_bill_no GIAC_DIRECT_PREM_COLLNS.b140_prem_seq_no%TYPE,
aeg_line_cd GIIS_LINE.line_cd%TYPE,
aeg_type_cd GIPI_POLBASIC.type_cd%TYPE,
aeg_acct_amt GIAC_DIRECT_PREM_COLLNS.collection_amt%TYPE,
aeg_gen_type GIAC_ACCT_ENTRIES.generation_type%TYPE,
p_msg_alert OUT VARCHAR2,
p_giop_gacc_branch_cd GIAC_ACCT_ENTRIES.gacc_gibr_branch_cd%TYPE,
p_giop_gacc_fund_cd GIAC_ACCT_ENTRIES.gacc_gfun_fund_cd%TYPE,
p_giop_gacc_tran_id GIAC_ACCT_ENTRIES.gacc_tran_id%TYPE) IS
ws_gl_acct_category GIAC_ACCT_ENTRIES.gl_acct_category%TYPE;
ws_gl_control_acct GIAC_ACCT_ENTRIES.gl_control_acct%TYPE;
ws_gl_sub_acct_1 GIAC_ACCT_ENTRIES.gl_sub_acct_1%TYPE;
ws_gl_sub_acct_2 GIAC_ACCT_ENTRIES.gl_sub_acct_2%TYPE;
ws_gl_sub_acct_3 GIAC_ACCT_ENTRIES.gl_sub_acct_3%TYPE;
ws_gl_sub_acct_4 GIAC_ACCT_ENTRIES.gl_sub_acct_4%TYPE;
ws_gl_sub_acct_5 GIAC_ACCT_ENTRIES.gl_sub_acct_5%TYPE;
ws_gl_sub_acct_6 GIAC_ACCT_ENTRIES.gl_sub_acct_6%TYPE;
ws_gl_sub_acct_7 GIAC_ACCT_ENTRIES.gl_sub_acct_7%TYPE;
ws_pol_type_tag GIAC_MODULE_ENTRIES.pol_type_tag%TYPE;
ws_intm_type_level GIAC_MODULE_ENTRIES.intm_type_level%TYPE;
ws_old_new_acct_level GIAC_MODULE_ENTRIES.old_new_acct_level%TYPE;
ws_line_dep_level GIAC_MODULE_ENTRIES.line_dependency_level%TYPE;
ws_dr_cr_tag GIAC_MODULE_ENTRIES.dr_cr_tag%TYPE;
ws_acct_intm_cd GIIS_INTM_TYPE.acct_intm_cd%TYPE;
ws_line_cd GIIS_LINE.line_cd%TYPE;
-- ws_iss_cd GIPI_POLBASIC.iss_cd%TYPE;
ws_old_acct_cd GIAC_ACCT_ENTRIES.gl_sub_acct_2%TYPE;
ws_new_acct_cd GIAC_ACCT_ENTRIES.gl_sub_acct_2%TYPE;
pt_gl_sub_acct_1 GIAC_ACCT_ENTRIES.gl_sub_acct_1%TYPE;
pt_gl_sub_acct_2 GIAC_ACCT_ENTRIES.gl_sub_acct_2%TYPE;
pt_gl_sub_acct_3 GIAC_ACCT_ENTRIES.gl_sub_acct_3%TYPE;
pt_gl_sub_acct_4 GIAC_ACCT_ENTRIES.gl_sub_acct_4%TYPE;
pt_gl_sub_acct_5 GIAC_ACCT_ENTRIES.gl_sub_acct_5%TYPE;
pt_gl_sub_acct_6 GIAC_ACCT_ENTRIES.gl_sub_acct_6%TYPE;
pt_gl_sub_acct_7 GIAC_ACCT_ENTRIES.gl_sub_acct_7%TYPE;
ws_debit_amt GIAC_ACCT_ENTRIES.debit_amt%TYPE;
ws_credit_amt GIAC_ACCT_ENTRIES.credit_amt%TYPE;
ws_gl_acct_id GIAC_ACCT_ENTRIES.gl_acct_id%TYPE;
ws_sl_type_cd giac_acct_entries.sl_type_cd%TYPE;
v_old_iss_cd GIAC_DIRECT_PREM_COLLNS.b140_iss_cd%TYPE;
BEGIN
--msg_alert('AEG CREATE ACCT ENTRIES...','I',FALSE);
/**************************************************************************
* *
* Populate the GL Account Code used in every transactions. *
* *
**************************************************************************/
BEGIN
SELECT gl_acct_category, gl_control_acct,
gl_sub_acct_1 , gl_sub_acct_2 ,
gl_sub_acct_3 , gl_sub_acct_4 ,
gl_sub_acct_5 , gl_sub_acct_6 ,
gl_sub_acct_7 , pol_type_tag ,
nvl(intm_type_level,0) , nvl(old_new_acct_level,0),
dr_cr_tag , nvl(line_dependency_level,0)
,sl_type_cd
INTO ws_gl_acct_category, ws_gl_control_acct,
ws_gl_sub_acct_1 , ws_gl_sub_acct_2 ,
ws_gl_sub_acct_3 , ws_gl_sub_acct_4 ,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6 ,
ws_gl_sub_acct_7 , ws_pol_type_tag ,
ws_intm_type_level , ws_old_new_acct_level,
ws_dr_cr_tag , ws_line_dep_level
,ws_sl_type_cd
FROM giac_module_entries
WHERE module_id = aeg_module_id
AND item_no = aeg_item_no;
EXCEPTION
WHEN no_data_found THEN
p_msg_Alert := 'No data found in giac_module_entries.';
END;
/**************************************************************************
* *
* Validate the INTM_TYPE_LEVEL value which indicates the segment of the *
* GL account code that holds the intermediary type. *
* *
**************************************************************************/
IF ws_intm_type_level != 0 THEN
BEGIN
SELECT DISTINCT(c.acct_intm_cd)
INTO ws_acct_intm_cd
FROM gipi_comm_invoice a,
giis_intermediary b,
giis_intm_type c
WHERE a.intrmdry_intm_no = b.intm_no
AND b.intm_type = c.intm_type
AND a.iss_cd = aeg_iss_cd
AND a.prem_seq_no = aeg_bill_no;
EXCEPTION
WHEN no_data_found THEN
p_msg_Alert := 'No data found in giis_intm_type.';
END;
AEG_Check_Level_Y(ws_intm_type_level, ws_acct_intm_cd , ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3, ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6, ws_gl_sub_acct_7);
END IF;
/**************************************************************************
* *
* Validate the LINE_DEPENDENCY_LEVEL value which indicates the segment of *
* the GL account code that holds the line number. *
* *
**************************************************************************/
IF ws_line_dep_level != 0 THEN
BEGIN
SELECT acct_line_cd
INTO ws_line_cd
FROM giis_line
WHERE line_cd = aeg_line_cd;
EXCEPTION
WHEN no_data_found THEN
p_msg_Alert := 'No data found in giis_line.';
END;
AEG_Check_Level_Y(ws_line_dep_level, ws_line_cd , ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3, ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6, ws_gl_sub_acct_7);
END IF;
/**************************************************************************
* *
* Validate the OLD_NEW_ACCT_LEVEL value which indicates the segment of *
* the GL account code that holds the old and new account values. *
* *
**************************************************************************/
IF ws_old_new_acct_level != 0 THEN
BEGIN
BEGIN
SELECT param_value_v
INTO v_old_iss_cd
FROM giac_parameters
WHERE param_name = 'OLD_ISS_CD';
END;
BEGIN
SELECT param_value_n
INTO ws_old_acct_cd
FROM giac_parameters
WHERE param_name = 'OLD_ACCT_CD';
END;
BEGIN
SELECT param_value_n
INTO ws_new_acct_cd
FROM giac_parameters
WHERE param_name = 'NEW_ACCT_CD';
END;
IF aeg_iss_cd = v_old_iss_cd THEN
AEG_Check_Level_Y(ws_old_new_acct_level, ws_old_acct_cd , ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3, ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6, ws_gl_sub_acct_7);
ELSE
AEG_Check_Level_Y(ws_old_new_acct_level, ws_new_acct_cd , ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3, ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6, ws_gl_sub_acct_7);
END IF;
EXCEPTION
WHEN no_data_found THEN
p_msg_Alert := 'No data found in giac_parameters.';
END;
END IF;
/**************************************************************************
* *
* Check the POL_TYPE_TAG which indicates if the policy type GL code *
* segments will be attached to this GL account. *
* *
**************************************************************************/
IF ws_pol_type_tag = 'Y' THEN
BEGIN
SELECT NVL(gl_sub_acct_1,0), NVL(gl_sub_acct_2,0),
NVL(gl_sub_acct_3,0), NVL(gl_sub_acct_4,0),
NVL(gl_sub_acct_5,0), NVL(gl_sub_acct_6,0),
NVL(gl_sub_acct_7,0)
INTO pt_gl_sub_acct_1, pt_gl_sub_acct_2,
pt_gl_sub_acct_3, pt_gl_sub_acct_4,
pt_gl_sub_acct_5, pt_gl_sub_acct_6,
pt_gl_sub_acct_7
FROM giac_policy_type_entries
WHERE line_cd = aeg_line_cd
AND type_cd = aeg_type_cd;
IF pt_gl_sub_acct_1 != 0 THEN
ws_gl_sub_acct_1 := pt_gl_sub_acct_1;
END IF;
IF pt_gl_sub_acct_2 != 0 THEN
ws_gl_sub_acct_2 := pt_gl_sub_acct_2;
END IF;
IF pt_gl_sub_acct_3 != 0 THEN
ws_gl_sub_acct_3 := pt_gl_sub_acct_3;
END IF;
IF pt_gl_sub_acct_4 != 0 THEN
ws_gl_sub_acct_4 := pt_gl_sub_acct_4;
END IF;
IF pt_gl_sub_acct_5 != 0 THEN
ws_gl_sub_acct_5 := pt_gl_sub_acct_5;
END IF;
IF pt_gl_sub_acct_6 != 0 THEN
ws_gl_sub_acct_6 := pt_gl_sub_acct_6;
END IF;
IF pt_gl_sub_acct_7 != 0 THEN
ws_gl_sub_acct_7 := pt_gl_sub_acct_7;
END IF;
EXCEPTION
WHEN no_data_found THEN
p_msg_Alert := 'No data found in giac_policy_type_entries.';
END;
END IF;
/**************************************************************************
* *
* Check if the accounting code exists in GIAC_CHART_OF_ACCTS table. *
* *
**************************************************************************/
AEG_Check_Chart_Of_Accts_Y(ws_gl_acct_category, ws_gl_control_acct, ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3 , ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6 , ws_gl_sub_acct_7,
ws_gl_acct_id , aeg_iss_cd , aeg_bill_no ,
p_msg_alert);
/****************************************************************************
* *
* If the accounting code exists in GIAC_CHART_OF_ACCTS table, validate the *
* debit-credit tag to determine whether the positive amount will be debited *
* or credited. *
* *
****************************************************************************/
IF ws_dr_cr_tag = 'D' THEN
IF aeg_acct_amt > 0 THEN
ws_debit_amt := ABS(aeg_acct_amt);
ws_credit_amt := 0;
ELSE
ws_debit_amt := 0;
ws_credit_amt := ABS(aeg_acct_amt);
END IF;
ELSE
IF aeg_acct_amt > 0 THEN
ws_debit_amt := 0;
ws_credit_amt := ABS(aeg_acct_amt);
ELSE
ws_debit_amt := ABS(aeg_acct_amt);
ws_credit_amt := 0;
END IF;
END IF;
/****************************************************************************
* *
* Check if the derived GL code exists in GIAC_ACCT_ENTRIES table for the *
* same transaction id. Insert the record if it does not exists else update *
* the existing record. *
* *
****************************************************************************/
AEG_Insert_Update_Acct_Y(ws_gl_acct_category, ws_gl_control_acct, ws_gl_sub_acct_1,
ws_gl_sub_acct_2 , ws_gl_sub_acct_3 , ws_gl_sub_acct_4,
ws_gl_sub_acct_5 , ws_gl_sub_acct_6 , ws_gl_sub_acct_7,
aeg_sl_cd , ws_sl_type_cd , aeg_gen_type,
ws_gl_acct_id , ws_debit_amt , ws_credit_amt,
p_giop_gacc_branch_cd, p_giop_gacc_fund_cd, p_giop_gacc_tran_id);
END;
/
|
-- Add migration script here
CREATE TABLE IF NOT EXISTS previews (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title VARCHAR(256),
description VARCHAR(255),
domain VARCHAR(255),
url VARCHAR(255) NOT NULL UNIQUE,
image_url VARCHAR(255),
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
-- Overdue Items
-- You must not change the next 2 lines or the table definition.
SET SEARCH_PATH TO Library, public;
DROP TABLE IF EXISTS q2 cascade;
create table q2 (
branch CHAR(5),
email TEXT,
title TEXT,
overdue INT
);
-- Do this for each of the views that define your intermediate steps.
-- (But give them better names!) The IF EXISTS avoids generating an error
-- the first time this file is imported.
DROP VIEW IF EXISTS check_out_information CASCADE;
DROP VIEW IF EXISTS return_information CASCADE;
DROP VIEW IF EXISTS overdue_information CASCADE;
-- Define views for your intermediate steps here:
-- Find all branches in the ward “Parkdale-High Park”, and all check_out information
-- in those branches. (branch, patron, title, checkout_time, htype)
CREATE VIEW check_out_information AS
SELECT Checkout.id AS checkout_id, Checkout.library AS branch, Holding.title AS title,
Checkout.checkout_time AS checkout_time, htype, Patron.email AS email
FROM Checkout, Ward, LibraryBranch, Patron, Holding
WHERE Checkout.library = LibraryBranch.code AND LibraryBranch.ward = Ward.id
AND Ward.name = 'Parkdale-High Park'
AND Checkout.patron = Patron.card_number AND Checkout.holding = Holding.id;
-- Find all overdue items with their corresponding information (Left join)
-- (branch, patron, title, time_diff, htype)
CREATE VIEW return_information AS
SELECT branch AS branch, title, email, CURRENT_DATE - DATE(check_out_information.checkout_time) AS overdue, htype
FROM check_out_information
LEFT JOIN Return
ON check_out_information.checkout_id = Return.checkout
WHERE Return.return_time IS NULL;
-- Find if items are overdue
CREATE VIEW overdue_information AS
SELECT branch, email, title, (CASE
WHEN htype IN ('books', 'audiobooks') THEN overdue - 21
ELSE overdue - 7
END) AS overdue
FROM return_information
WHERE ((htype IN ('books', 'audiobooks') AND overdue > 21)
OR (htype IN ('music', 'movies', 'magazines and newspapers') AND overdue > 7));
-- Your query that answers the question goes below the "insert into" line:
insert into q2
SELECT * FROM overdue_information;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50714
Source Host : localhost:3306
Source Database : springboot-shiro
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2019-03-12 14:39:49
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`url` varchar(256) DEFAULT NULL COMMENT 'url地址',
`urlDescription` varchar(64) DEFAULT NULL COMMENT 'url描述',
`requestMode` varchar(10) DEFAULT NULL COMMENT '请求方式',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of permission
-- ----------------------------
INSERT INTO `permission` VALUES ('1', '/user/user', '查询用户', 'GET');
INSERT INTO `permission` VALUES ('2', '/role/role', '查询角色', 'GET');
INSERT INTO `permission` VALUES ('3', '/permission/permission', '查询权限', 'GET');
INSERT INTO `permission` VALUES ('4', '/role/role', '添加角色', 'POST');
INSERT INTO `permission` VALUES ('5', '/role/role/*', '删除角色', 'DELETE');
INSERT INTO `permission` VALUES ('6', '/role/role', '修改角色', 'PUT');
INSERT INTO `permission` VALUES ('7', '/role/role/*', '跳入角色修改页面', 'GET');
INSERT INTO `permission` VALUES ('8', '/role/add', '跳入角色添加页面', 'GET');
INSERT INTO `permission` VALUES ('9', '/user/user', '添加用户', 'POST');
INSERT INTO `permission` VALUES ('10', '/user/user/*', '删除用户', 'DELETE');
INSERT INTO `permission` VALUES ('11', '/user/user', '修改用户', 'PUT');
INSERT INTO `permission` VALUES ('12', '/user/user/*', '跳入用户修改页面', 'GET');
INSERT INTO `permission` VALUES ('13', '/user/add', '跳入用户添加页面', 'GET');
INSERT INTO `permission` VALUES ('14', '/permission/permission/*', '跳入权限修改页面', 'GET');
INSERT INTO `permission` VALUES ('15', '/permission/add', '跳入权限添加页面', 'GET');
INSERT INTO `permission` VALUES ('16', '/user/role_echo', '角色回显', 'GET');
INSERT INTO `permission` VALUES ('17', '/user/addRole', '给用户添加角色', 'POST');
INSERT INTO `permission` VALUES ('18', '/role/permission_echo', '权限回显', 'GET');
INSERT INTO `permission` VALUES ('19', '/role/addPermission', '给角色添加权限', 'POST');
INSERT INTO `permission` VALUES ('20', '/permission/permission/*', '删除权限', 'DELETE');
INSERT INTO `permission` VALUES ('21', '/permission/permission', '修改权限', 'PUT');
INSERT INTO `permission` VALUES ('22', '/permission/permission', '添加权限', 'POST');
INSERT INTO `permission` VALUES ('23', '/login/jumpRole', '跳入角色页面', 'GET');
INSERT INTO `permission` VALUES ('24', '/login/jumpUser', '跳入用户页面', 'GET');
INSERT INTO `permission` VALUES ('25', '/login/jumpPermission', '跳入权限页面', 'GET');
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`rolename` varchar(32) DEFAULT NULL COMMENT '角色名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role
-- ----------------------------
INSERT INTO `role` VALUES ('1', 'admin');
INSERT INTO `role` VALUES ('2', 'add');
INSERT INTO `role` VALUES ('3', 'role');
INSERT INTO `role` VALUES ('4', '邹想云');
-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID',
`pid` bigint(20) DEFAULT NULL COMMENT '权限ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role_permission
-- ----------------------------
INSERT INTO `role_permission` VALUES ('1', '1');
INSERT INTO `role_permission` VALUES ('1', '2');
INSERT INTO `role_permission` VALUES ('1', '3');
INSERT INTO `role_permission` VALUES ('1', '4');
INSERT INTO `role_permission` VALUES ('1', '5');
INSERT INTO `role_permission` VALUES ('1', '6');
INSERT INTO `role_permission` VALUES ('1', '7');
INSERT INTO `role_permission` VALUES ('1', '8');
INSERT INTO `role_permission` VALUES ('1', '9');
INSERT INTO `role_permission` VALUES ('1', '10');
INSERT INTO `role_permission` VALUES ('1', '11');
INSERT INTO `role_permission` VALUES ('1', '12');
INSERT INTO `role_permission` VALUES ('1', '13');
INSERT INTO `role_permission` VALUES ('1', '14');
INSERT INTO `role_permission` VALUES ('1', '15');
INSERT INTO `role_permission` VALUES ('1', '16');
INSERT INTO `role_permission` VALUES ('1', '17');
INSERT INTO `role_permission` VALUES ('1', '18');
INSERT INTO `role_permission` VALUES ('1', '19');
INSERT INTO `role_permission` VALUES ('1', '20');
INSERT INTO `role_permission` VALUES ('1', '21');
INSERT INTO `role_permission` VALUES ('1', '22');
INSERT INTO `role_permission` VALUES ('1', '23');
INSERT INTO `role_permission` VALUES ('1', '24');
INSERT INTO `role_permission` VALUES ('1', '25');
INSERT INTO `role_permission` VALUES ('4', '20');
INSERT INTO `role_permission` VALUES ('4', '4');
INSERT INTO `role_permission` VALUES ('4', '9');
INSERT INTO `role_permission` VALUES ('4', '8');
INSERT INTO `role_permission` VALUES ('4', '24');
INSERT INTO `role_permission` VALUES ('4', '21');
INSERT INTO `role_permission` VALUES ('4', '1');
INSERT INTO `role_permission` VALUES ('4', '3');
INSERT INTO `role_permission` VALUES ('4', '23');
INSERT INTO `role_permission` VALUES ('4', '13');
INSERT INTO `role_permission` VALUES ('4', '15');
INSERT INTO `role_permission` VALUES ('4', '12');
INSERT INTO `role_permission` VALUES ('4', '25');
INSERT INTO `role_permission` VALUES ('4', '14');
INSERT INTO `role_permission` VALUES ('4', '2');
INSERT INTO `role_permission` VALUES ('4', '7');
INSERT INTO `role_permission` VALUES ('4', '18');
INSERT INTO `role_permission` VALUES ('4', '17');
INSERT INTO `role_permission` VALUES ('4', '22');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(20) DEFAULT NULL COMMENT '用户昵称',
`email` varchar(128) DEFAULT NULL COMMENT '邮箱|登录帐号',
`password` varchar(32) DEFAULT NULL COMMENT '密码',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
`status` bigint(1) DEFAULT '1' COMMENT '1:有效,0:禁止登录',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('1', 'admin', 'tzh_java@126.com', '123456', '2017-05-10 20:22:59', '2019-03-12 06:12:51', '1');
INSERT INTO `user` VALUES ('2', 'liucong', 'yc_java@126.com', '123456', '2019-03-05 14:02:56', '2019-03-11 09:20:41', '1');
INSERT INTO `user` VALUES ('4', 'test', 'test@126.com', '123456', '2019-03-06 12:09:30', '2019-03-11 03:11:52', '1');
INSERT INTO `user` VALUES ('12', '邹想云', 'zxy_java@126.com', '123456', '2019-03-11 09:23:20', '2019-03-12 06:11:45', '1');
-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
`uid` bigint(20) DEFAULT NULL COMMENT '用户ID',
`rid` bigint(20) DEFAULT NULL COMMENT '角色ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES ('1', '1');
INSERT INTO `user_role` VALUES ('1', '2');
INSERT INTO `user_role` VALUES ('2', '2');
INSERT INTO `user_role` VALUES ('5', '2');
INSERT INTO `user_role` VALUES ('5', '1');
INSERT INTO `user_role` VALUES ('5', '3');
INSERT INTO `user_role` VALUES ('6', '4');
INSERT INTO `user_role` VALUES ('8', '6');
INSERT INTO `user_role` VALUES ('4', '3');
INSERT INTO `user_role` VALUES ('10', '4');
INSERT INTO `user_role` VALUES ('12', '4');
|
delete from HtmlLabelIndex where id=25235
/
delete from HtmlLabelInfo where indexid=25235
/
INSERT INTO HtmlLabelIndex values(25235,'用户自定义条件')
/
delete from HtmlLabelIndex where id=25236
/
delete from HtmlLabelInfo where indexid=25236
/
INSERT INTO HtmlLabelIndex values(25236,'文档主目录')
/
delete from HtmlLabelIndex where id=25241
/
delete from HtmlLabelInfo where indexid=25241
/
INSERT INTO HtmlLabelIndex values(25241,'相关部门')
/
delete from HtmlLabelIndex where id=25244
/
delete from HtmlLabelInfo where indexid=25244
/
INSERT INTO HtmlLabelIndex values(25244,'文档审批者')
/
delete from HtmlLabelIndex where id=25246
/
delete from HtmlLabelInfo where indexid=25246
/
INSERT INTO HtmlLabelIndex values(25246,'所有条件')
/
delete from HtmlLabelIndex where id=25239
/
delete from HtmlLabelInfo where indexid=25239
/
INSERT INTO HtmlLabelIndex values(25239,'文档语言')
/
delete from HtmlLabelIndex where id=25238
/
delete from HtmlLabelInfo where indexid=25238
/
INSERT INTO HtmlLabelIndex values(25238,'文档子目录')
/
delete from HtmlLabelIndex where id=25243
/
delete from HtmlLabelInfo where indexid=25243
/
INSERT INTO HtmlLabelIndex values(25243,'文档最后修改者')
/
delete from HtmlLabelIndex where id=25240
/
delete from HtmlLabelInfo where indexid=25240
/
INSERT INTO HtmlLabelIndex values(25240,'相关员工')
/
delete from HtmlLabelIndex where id=25245
/
delete from HtmlLabelInfo where indexid=25245
/
INSERT INTO HtmlLabelIndex values(25245,'文档归档者')
/
delete from HtmlLabelIndex where id=25237
/
delete from HtmlLabelInfo where indexid=25237
/
INSERT INTO HtmlLabelIndex values(25237,'文档分目录')
/
delete from HtmlLabelIndex where id=25242
/
delete from HtmlLabelInfo where indexid=25242
/
INSERT INTO HtmlLabelIndex values(25242,'文档创建者')
/
INSERT INTO HtmlLabelInfo VALUES(25235,'用户自定义条件',7)
/
INSERT INTO HtmlLabelInfo VALUES(25235,'User Define Condition',8)
/
INSERT INTO HtmlLabelInfo VALUES(25235,'用戶自定義條件',9)
/
INSERT INTO HtmlLabelInfo VALUES(25236,'文档主目录',7)
/
INSERT INTO HtmlLabelInfo VALUES(25236,'Doc Main Category',8)
/
INSERT INTO HtmlLabelInfo VALUES(25236,'文檔主目錄',9)
/
INSERT INTO HtmlLabelInfo VALUES(25237,'文档分目录',7)
/
INSERT INTO HtmlLabelInfo VALUES(25237,'Doc Sub Category',8)
/
INSERT INTO HtmlLabelInfo VALUES(25237,'文檔分目錄',9)
/
INSERT INTO HtmlLabelInfo VALUES(25238,'文档子目录',7)
/
INSERT INTO HtmlLabelInfo VALUES(25238,'Doc Sec Category',8)
/
INSERT INTO HtmlLabelInfo VALUES(25238,'文檔子目錄',9)
/
INSERT INTO HtmlLabelInfo VALUES(25239,'文档语言',7)
/
INSERT INTO HtmlLabelInfo VALUES(25239,'Document Lanuage',8)
/
INSERT INTO HtmlLabelInfo VALUES(25239,'文檔語言',9)
/
INSERT INTO HtmlLabelInfo VALUES(25240,'相关员工',7)
/
INSERT INTO HtmlLabelInfo VALUES(25240,'Relative Employee',8)
/
INSERT INTO HtmlLabelInfo VALUES(25240,'相關員工',9)
/
INSERT INTO HtmlLabelInfo VALUES(25241,'相关部门',7)
/
INSERT INTO HtmlLabelInfo VALUES(25241,'Relative Department',8)
/
INSERT INTO HtmlLabelInfo VALUES(25241,'相關部門',9)
/
INSERT INTO HtmlLabelInfo VALUES(25242,'文档创建者',7)
/
INSERT INTO HtmlLabelInfo VALUES(25242,'Doc Creater',8)
/
INSERT INTO HtmlLabelInfo VALUES(25242,'文檔創建者',9)
/
INSERT INTO HtmlLabelInfo VALUES(25243,'文档最后修改者',7)
/
INSERT INTO HtmlLabelInfo VALUES(25243,'Doc Last Modifier',8)
/
INSERT INTO HtmlLabelInfo VALUES(25243,'文檔最後修改者',9)
/
INSERT INTO HtmlLabelInfo VALUES(25244,'文档审批者',7)
/
INSERT INTO HtmlLabelInfo VALUES(25244,'Doc Approver',8)
/
INSERT INTO HtmlLabelInfo VALUES(25244,'文檔審批者',9)
/
INSERT INTO HtmlLabelInfo VALUES(25245,'文档归档者',7)
/
INSERT INTO HtmlLabelInfo VALUES(25245,'Doc Archiver',8)
/
INSERT INTO HtmlLabelInfo VALUES(25245,'文檔歸檔者',9)
/
INSERT INTO HtmlLabelInfo VALUES(25246,'所有条件',7)
/
INSERT INTO HtmlLabelInfo VALUES(25246,'All Condition',8)
/
INSERT INTO HtmlLabelInfo VALUES(25246,'所有條件',9)
/ |
SELECT *
FROM AuthSession
WHERE token = '<%= token %>' |
create database if not exists db_asp;
use db_asp;
Create Table if not exists tbl_user (
user_id int primary key auto_increment ,
user_name varchar(80) Not null,
user_email varchar(80) Not null,
user_password varchar(80) Not null,
user_img varchar(255),
user_lvl varchar(2) Not null
);
Create table if not exists tbl_category(
category_id int primary key auto_increment,
category_name varchar(50)
);
Create Table if not exists tbl_product (
prod_id int primary key auto_increment ,
prod_name varchar(80) Not null,
prod_desc varchar(200) Not null,
prod_brand varchar(80) Not null,
prod_price varchar(255) Not null,
prod_quant int not null,
prod_img varchar(255),
prod_min_quant int,
fk_category int
);
Create Table if not exists tbl_pet (
pet_id int primary key auto_increment ,
pet_name varchar(80) Not null,
pet_owner varchar(80) Not null,
pet_tell varchar(80) Not null,
pet_size varchar(50) Not null,
pet_desc varchar (100)
);
Create Table if not exists tbl_agenda (
agenda_id int primary key auto_increment ,
agenda_date varchar(80) Not null,
agenda_cli varchar(80) Not null,
agenda_hour varchar(80) Not null,
agenda_desc varchar(40) not null,
fk_pet_id int not null
);
create table if not exists tbl_pos(
pos_id int primary key auto_increment,
pos_quant_order int,
fk_product_id int
);
SELECT left(agenda_date,10) as agenda_date,agenda_id, tbl_pet.pet_name, agenda_cli,right(agenda_hour,8) as agenda_hour,agenda_desc FROM db_asp.tbl_agenda
join tbl_pet where tbl_pet.pet_id = fk_pet_id ;
create view img
as SELECT REPLACE(user_img, "~/", "../"),user_id from tbl_user;
create view Allproduct
as SELECT prod_id,prod_name,prod_desc,prod_brand,prod_price,prod_quant,prod_min_quant,fk_category,category_id,category_name,
REPLACE(prod_img, "~/", "../") as img
FROM db_asp.tbl_product
join tbl_category
on tbl_product.fk_category = tbl_category.category_id;
create view Pos
as SELECT pos.fk_product_id,prod.prod_name,prod.prod_price,pos.pos_quant_order,pos.pos_id FROM tbl_pos as pos
join tbl_product as prod
on pos.fk_product_id = prod.prod_id;
ALTER TABLE tbl_product
ADD FOREIGN KEY (fk_category) REFERENCES tbl_category (category_id);
ALTER TABLE tbl_agenda
ADD FOREIGN KEY (fk_pet_id) REFERENCES tbl_pet(pet_id);
INSERT INTO `db_asp`.`tbl_user` (`user_name`, `user_email`, `user_password`, `user_img`, `user_lvl`) VALUES ('Carlos Almeida', 'carlos@gmail.com', 'Carlos00', '~/Images/acf0d438-ebe6-4af8-bb62-bf08a5d59592_2.jpg', '1');
INSERT INTO `db_asp`.`tbl_category` (`category_name`) VALUES ('Comida');
INSERT INTO `db_asp`.`tbl_product` (`prod_name`, `prod_desc`, `prod_brand`, `prod_price`, `prod_quant`, `prod_img`, `prod_min_quant`, `fk_category`) VALUES ('Ração Golden Fórmula Light para Cães Adultos - 15kg', 'Linha: Premium', 'Golden', '134', '100', '~/Images/de1f8195-25d8-4760-adf9-e9cf9df2ad42_racao.jpg', '20', '1');
-- TRUNCATE TABLE tbl_pos;
-- drop database db_asp;
-- drop table tbl_product;
-- drop user 'gladia'@'localhost';
CREATE USER 'gladia'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON db_asp.* TO 'gladia'@'localhost' WITH GRANT OPTION; |
DROP PROCEDURE CPI.CREATE_ITEMDS_BY_ITEMPERILDS;
CREATE OR REPLACE PROCEDURE CPI.CREATE_ITEMDS_BY_ITEMPERILDS(
p_dist_no giuw_pol_dist.dist_no%TYPE,
p_itemds_sw VARCHAR2
) IS
v_dist_spct giuw_itemds_dtl.dist_spct%TYPE;
BEGIN
/**
** Created by: Niknok Orio
** Date Created: 08 15, 2011
** Reference by: GIUTS999 - Populate missing distribution records
*/
--CREATED BY BETH March 28,2001
-- create missing records in giuw_itemds and giuw_itemds_dtl
-- using existing records in giuw_itemperilds and giuw_itemperilds_dtl
-- as basis of creation.
--delete existing records in table giuw_itemds and giuw_itemds_dtl
-- since it will be recreated
DELETE giuw_itemds_dtl
WHERE dist_no = p_dist_no;
IF p_itemds_sw = 'N' THEN
DELETE giuw_itemds
WHERE dist_no = p_dist_no;
END IF;
--get all combination of dist_seq_no and item_no from table giuw_itemperilds
--summarized amounts of TSI, premium and ann_tsi
FOR A IN (SELECT c060.dist_seq_no, c060.item_no,
SUM(DECODE(a170.peril_type,'B',c060.tsi_amt,0)) tsi,
SUM(c060.prem_amt) prem,
SUM(DECODE(a170.peril_type,'B',c060.ann_tsi_amt,0)) ann_tsi
FROM giuw_itemperilds c060, giis_peril a170
WHERE c060.dist_no = p_dist_no
AND c060.line_cd = a170.line_cd
AND c060.peril_cd = a170.peril_cd
GROUP BY c060.dist_seq_no, c060.item_no)
LOOP
--insert records in giuw_perilds for every record combination
--of dist_seq_no, item_no in giuw_itemperilds
IF p_itemds_sw = 'N' THEN
INSERT INTO giuw_itemds
(dist_no, dist_seq_no, item_no,
tsi_amt, prem_amt, ann_tsi_amt)
VALUES (p_dist_no, a.dist_seq_no, a.item_no,
a.tsi, a.prem, a.ann_tsi);
END IF;
--get summarized amounts for per share_cd and item_no
--from table giuw_itemperilds_dtl
FOR B IN (SELECT c070.line_cd, c070.share_cd, c070.item_no,
SUM(DECODE (a170.peril_type,'B',c070.dist_tsi,0) )tsi, SUM(c070.dist_prem) prem,
SUM(DECODE (a170.peril_type,'B',c070.ann_dist_tsi,0)) ann_tsi
FROM giuw_itemperilds_dtl c070, giis_peril a170
WHERE c070.dist_no = p_dist_no
AND c070.dist_seq_no = a.dist_seq_no
AND c070.item_no = a.item_no
AND c070.line_cd = a170.line_cd
AND c070.peril_cd = a170.peril_cd
GROUP BY c070.line_cd, c070.share_cd, c070.item_no)
LOOP
--to get dist_spct divide amount per share_cd by total_amount
--by item and dist_seq_no and multiply it by 100
IF NVL(a.tsi,0) <> 0 AND NVL(b.tsi,0) <> 0 THEN
v_dist_spct := (b.tsi/a.tsi) * 100;
ELSIF NVL(a.prem,0) <> 0 AND NVL(b.prem,0) <> 0 THEN
v_dist_spct := (b.prem/a.prem) * 100;
ELSE
v_dist_spct := 0;
END IF;
--insert records in giuw_itemds_dtl for every combination of dist_seq_no,
--item_no and share_cd retrieved
INSERT INTO giuw_itemds_dtl
(dist_no, dist_seq_no, line_cd, share_cd, item_no,
dist_spct, dist_tsi, dist_prem, ann_dist_tsi, dist_grp)
VALUES(p_dist_no, a.dist_seq_no, b.line_cd, b.share_cd, b.item_no,
v_dist_spct, b.tsi, b.prem, b.ann_tsi, 1);
END LOOP;
END LOOP;
END;
/
|
--sections
select * from ebcc.rpt_wiz_sections where report_name = 'dlEolcItem'
--fields in a report section
select * from ebcc.rpt_wiz_fields where report_name = 'dlFiStep'
--and section_name = 'secEolInf'
order by field_order
--field definition
select * from ebcc.rpt_wiz_field_def where field_name in (select field_name from ebcc.rpt_wiz_virtual where virtual_field = 'eolMesObjData')
order by field_name
--virtual field
select * from ebcc.rpt_wiz_virtual where virtual_field = 'fiBillingSchedule' order by field_order
select * from ebcc.rpt_wiz_virtual order by virtual_field, field_order
select * from ebcc.rpt_wiz_virtual where virtual_field = 'eolMesObjData' order by virtual_field,field_order
select * from ebcc.rpt_wiz_virtual where field_name = 'ecwiPoNum'
select * from ebcc.rpt_wiz_virtual where field_name = 'ecwsPoNum'
select * from ebcc.rpt_wiz_field_def where field_name = 'eoliDecConcludeDate'
select * from ebcc.rpt_wiz_fields where field_name ='eolcsPoNum'
select * from ebcc.rpt_wiz_fields where report_name = 'dlEolItem'
insert into ebcc.rpt_wiz_field_def
values('ewPoNum', 'STR', 'eol_work', 'po_number', null, null, null),
('ewiPoNum', 'STR', 'eol_item_info', 'po_number', null, null, null),
('ewsPoNum', 'STR', 'eol_supp_info', 'po_number', null, null, null),
--download report
('eoliPoNum', 'STR', 'eol_item_info', 'po_number', null, null, null),
('eolsPoNum', 'STR', 'eol_supp_info', 'po_number', null, null, null),
insert into ebcc.rpt_wiz_virtual
values
--item level
('ewiObjData', 'ewPoNum', 34),
('ewiObjData', 'ewiPoNum', 35),
('eolMesObjData', 'ewPoNum', 34),
('eolMesObjData', 'ewiPoNum', 35),
--supplement level
('ewsObjData', 'ewPoNum', 24),
('ewsObjData', 'ewsPoNum', 25),
--supplement decision at asset level
('ewsiObjData', 'ewPoNum', 24),
('ewsiObjData', 'ewsPoNum', 25),
|
INSERT INTO main.uf VALUES (1, 'AC', 'Acre', NULL, NULL);
INSERT INTO main.uf VALUES (2, 'AL', 'Alagoas', NULL, NULL);
INSERT INTO main.uf VALUES (3, 'AM', 'Amazonas', NULL, NULL);
INSERT INTO main.uf VALUES (4, 'AP', 'Amapá', NULL, NULL);
INSERT INTO main.uf VALUES (5, 'BA', 'Bahia', NULL, NULL);
INSERT INTO main.uf VALUES (6, 'CE', 'Ceará', NULL, NULL);
INSERT INTO main.uf VALUES (7, 'DF', 'Distrito Federal', NULL, NULL);
INSERT INTO main.uf VALUES (8, 'ES', 'Espírito Santo', NULL, NULL);
INSERT INTO main.uf VALUES (9, 'GO', 'Goiás', NULL, NULL);
INSERT INTO main.uf VALUES (10, 'MA', 'Maranhão', NULL, NULL);
INSERT INTO main.uf VALUES (11, 'MG', 'Minas Gerais', NULL, NULL);
INSERT INTO main.uf VALUES (12, 'MS', 'Mato Grosso do Sul', NULL, NULL);
INSERT INTO main.uf VALUES (13, 'MT', 'Mato Grosso', NULL, NULL);
INSERT INTO main.uf VALUES (14, 'PA', 'Pará', NULL, NULL);
INSERT INTO main.uf VALUES (15, 'PB', 'Paraíba', NULL, NULL);
INSERT INTO main.uf VALUES (16, 'PE', 'Pernambuco', NULL, NULL);
INSERT INTO main.uf VALUES (17, 'PI', 'Piauí', NULL, NULL);
INSERT INTO main.uf VALUES (18, 'PR', 'Paraná', NULL, NULL);
INSERT INTO main.uf VALUES (19, 'RJ', 'Rio de Janeiro', NULL, NULL);
INSERT INTO main.uf VALUES (20, 'RN', 'Rio Grande do Norte', NULL, NULL);
INSERT INTO main.uf VALUES (21, 'RO', 'Rondônia', NULL, NULL);
INSERT INTO main.uf VALUES (22, 'RR', 'Roraima', NULL, NULL);
INSERT INTO main.uf VALUES (23, 'RS', 'Rio Grande do Sul', NULL, NULL);
INSERT INTO main.uf VALUES (24, 'SC', 'Santa Catarina', NULL, NULL);
INSERT INTO main.uf VALUES (25, 'SE', 'Sergipe', NULL, NULL);
INSERT INTO main.uf VALUES (26, 'SP', 'São Paulo', NULL, NULL);
INSERT INTO main.uf VALUES (27, 'TO', 'Tocantins', NULL, NULL);
|
select first_name,last_name,salary,0.15*salary as "PF" from employees |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 28-08-2013 a las 00:28:50
-- Versión del servidor: 5.5.27
-- Versión de PHP: 5.4.7
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: `tupan`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cliente`
--
CREATE TABLE IF NOT EXISTS `cliente` (
`Id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`Nombre` varchar(50) NOT NULL,
`Apellido` varchar(50) NOT NULL,
`Email` varchar(50) NOT NULL,
`Direccion` varchar(100) NOT NULL,
`Telefono` varchar(50) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id` (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pedido`
--
CREATE TABLE IF NOT EXISTS `pedido` (
`Id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`Id_Cliente` int(4) NOT NULL,
`Fecha_Envio` date NOT NULL,
`Envio` tinyint(1) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id` (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pedido_producto`
--
CREATE TABLE IF NOT EXISTS `pedido_producto` (
`Id_Pedido` int(4) NOT NULL,
`Id_Producto` int(4) NOT NULL,
`Cantidad` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `producto`
--
CREATE TABLE IF NOT EXISTS `producto` (
`Id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`Nombre` varchar(50) NOT NULL,
`Descripcion` text NOT NULL,
`Precio` int(4) NOT NULL,
`Unidad` varchar(3) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `Id` (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 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 */;
|
SELECT 'Upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' ';
SOURCE 041-HIVE-16556.mysql.sql;
SOURCE 042-HIVE-16575.mysql.sql;
SOURCE 043-HIVE-16922.mysql.sql;
SOURCE 044-HIVE-16997.mysql.sql;
UPDATE VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1;
SELECT 'Finished upgrading MetaStore schema from 2.3.0 to 3.0.0' AS ' ';
|
--
-- 表的结构 `ims_superdesk_jd_vop_order_submit_order_sku`
--
CREATE TABLE IF NOT EXISTS `ims_superdesk_jd_vop_order_submit_order_sku` (
`id` int(11) NOT NULL,
`jdOrderId` varchar(32) NOT NULL COMMENT 'jdOrderId',
`skuId` int(11) NOT NULL COMMENT 'skuId',
`num` int(11) NOT NULL COMMENT '数量',
`category` int(11) NOT NULL COMMENT '分类',
`price` decimal(10,2) NOT NULL COMMENT '售价',
`name` varchar(512) NOT NULL,
`tax` int(11) NOT NULL,
`taxPrice` decimal(10,2) NOT NULL COMMENT '税额',
`nakedPrice` decimal(10,2) NOT NULL COMMENT '裸价',
`type` int(11) NOT NULL COMMENT 'type为 0普通、1附件、2赠品',
`oid` int(11) NOT NULL COMMENT 'oid为主商品skuid,如果本身是主商品,则oid为0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ims_superdesk_jd_vop_order_submit_order_sku`
--
ALTER TABLE `ims_superdesk_jd_vop_order_submit_order_sku`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ims_superdesk_jd_vop_order_submit_order_sku`
--
ALTER TABLE `ims_superdesk_jd_vop_order_submit_order_sku`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
|
select m.FMASTERID product_id,
m.FNUMBER product_no,
ml.FNAME,
base.F_XJ_ALIAS alias,
base.F_XJ_CATEGORY category,
base.F_XJ_CLASS class,
base.F_XJ_CLASS3 class3,
base.F_XJ_CLASS4 class4,
base.F_XJ_CLASS4 class4,
base.F_XJ_Style style,
base.F_XJ_GOLDMATERIAL goldmaterial,
base.F_XJ_REFSIZE size,
base.F_XJ_PROCESSINGCHANGES processingchanges,
base.F_XJ_CERTIFICATESNO certificatesno,
base.F_XJ_THEME theme,
base.F_XJ_FIT fitgroup,
base.F_XJ_FORM manner,
m.FMODIFYDATE modifydate
from t_BD_Material m
inner join T_BD_MATERIAL_L ml on m.FMASTERID=ml.FMATERIALID and ml.FLOCALEID=2052
inner join t_BD_MaterialBase base on m.FMASTERID=base.FMATERIALID
where base.FISSALE=1
and m.FDOCUMENTSTATUS='C'
and m.FFORBIDSTATUS='A'
and base.F_XJ_GOODSTYPE=2
order by modifydate;
select gw.* from XJ_T_GoodsWeight gw
inner join T_BD_MATERIAL m on gw.FMATERIALID=m.FMASTERID
inner join t_BD_MaterialBase base on m.FMASTERID=base.FMATERIALID
where base.FISSALE=1
and m.FDOCUMENTSTATUS='C'
and m.FFORBIDSTATUS='A'
and base.F_XJ_GOODSTYPE=2;
select c.FID id,FNAME name from XJ_t_Category c
inner join XJ_t_Category_L cl on c.FID=cl.FID
where FDOCUMENTSTATUS='C'
and FFORBIDSTATUS='A'
and c.F_XJ_LASTCLASS=0;
select a.FID mid,a.FENTRYID id, FDATAVALUE name from T_BAS_ASSISTANTDATAENTRY a
inner join T_BAS_ASSISTANTDATAENTRY_L al on a.FENTRYID=al.FENTRYID
where a.FID='005056c000089b2311e49642de9fb429';
select gw.FMATERIALID gw.XJ_T_GoodsWeight from XJ_T_GoodsWeight gw
inner join T_BD_MATERIAL m on gw.FMATERIALID=m.FMASTERID
inner join t_BD_MaterialBase base on m.FMASTERID=base.FMATERIALID
where base.FISSALE=1
and m.FDOCUMENTSTATUS='C'
and m.FFORBIDSTATUS='A'
and base.F_XJ_GOODSTYPE=2 |
show session variables like '%collation_connection%';
show databases;
|
# Sequel Pro dump
# Version 2492
# http://code.google.com/p/sequel-pro
#
# Host: localhost (MySQL 5.1.57)
# Database: dev_bs_project
# Generation Time: 2011-06-19 22:22:42 -0500
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_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 */;
# Dump of table photos
# ------------------------------------------------------------
DROP TABLE IF EXISTS `photos`;
CREATE TABLE `photos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`img_src` varchar(255) NOT NULL,
`user_id` int(11) NOT NULL,
`caption` text NOT NULL,
`credit` varchar(25) NOT NULL,
`is_approved` tinyint(1) NOT NULL DEFAULT '0',
`insert_ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`twitter_screenname` varchar(25) NOT NULL,
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`insert_ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# Dump of table votes
# ------------------------------------------------------------
DROP TABLE IF EXISTS `votes`;
CREATE TABLE `votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`photo_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`vote` tinyint(4) NOT NULL,
`insert_ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!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 */;
|
UPDATE recurtype
SET recurtype_donecheck = 'incdt_status IN (''R'', ''L'')'
WHERE recurtype_type = 'INCDT';
|
-- 2.1
SELECT DISTINCT Fname
FROM EMPLOYEE JOIN DEPARTMENT ON Dno = Dnumber
WHERE Dname = 'Research';
-- 2.2
SELECT DISTINCT EMP.Fname
FROM EMPLOYEE MGR JOIN DEPARTMENT ON MGR.Ssn = Mgr_ssn
JOIN EMPLOYEE EMP ON MGR.Ssn = EMP.Super_ssn
WHERE Dname = 'Research';
-- 2.3
SELECT DISTINCT Fname
FROM EMPLOYEE JOIN DEPARTMENT ON Ssn = Mgr_ssn
WHERE Ssn NOT IN (SELECT Essn FROM WORKS_ON);
-- 2.4
SELECT Pname, SUM(Hours) AS Total_hours
FROM PROJECT JOIN WORKS_ON ON Pnumber = Pno
GROUP BY Pname;
-- 2.5
SELECT DISTINCT Fname
FROM EMPLOYEE JOIN WORKS_ON ON Ssn = Essn
WHERE Ssn NOT IN (
SELECT Essn
FROM PROJECT JOIN WORKS_ON ON Pnumber = Pno
WHERE Plocation = 'Houston'
);
-- 2.6
SELECT DISTINCT Fname
FROM EMPLOYEE JOIN WORKS_ON WORKS_ON_OUT ON Ssn = Essn
WHERE NOT EXISTS (
SELECT Pnumber
FROM PROJECT LEFT JOIN (SELECT * FROM WORKS_ON WORKS_ON_IN WHERE WORKS_ON_OUT.Essn = WORKS_ON_IN.Essn) AS EMP_PRJ
ON Pnumber = EMP_PRJ.Pno
WHERE Plocation = 'Houston' AND EMP_PRJ.Pno IS NULL
);
-- 2.7
SELECT Fname, Salary
FROM EMPLOYEE
WHERE (Dno, Salary) IN (
SELECT Dno, Max(Salary)
FROM EMPLOYEE
GROUP BY Dno
);
-- 2.8
SELECT Dname
FROM EMPLOYEE JOIN DEPARTMENT ON Dno = Dnumber
GROUP BY Dname
HAVING COUNT(*) >= 3;
-- 2.9
SELECT SUPERVISEE.Fname, SUPERVISEE.Bdate, SUPERVISOR.Fname, SUPERVISOR.Bdate
FROM EMPLOYEE SUPERVISEE JOIN EMPLOYEE SUPERVISOR ON SUPERVISEE.Super_ssn = SUPERVISOR.Ssn
WHERE SUPERVISEE.Bdate <= SUPERVISOR.Bdate;
|
delete from HtmlLabelIndex where id=23786
/
delete from HtmlLabelInfo where indexid=23786
/
INSERT INTO HtmlLabelIndex values(23786,'音频来源')
/
INSERT INTO HtmlLabelInfo VALUES(23786,'音频来源',7)
/
INSERT INTO HtmlLabelInfo VALUES(23786,'Audio Src',8)
/
INSERT INTO HtmlLabelInfo VALUES(23786,'音頻來源',9)
/
delete from HtmlLabelIndex where id=23804
/
delete from HtmlLabelInfo where indexid=23804
/
INSERT INTO HtmlLabelIndex values(23804,'双列式')
/
INSERT INTO HtmlLabelInfo VALUES(23804,'双列式',7)
/
INSERT INTO HtmlLabelInfo VALUES(23804,'Double Column Mode',8)
/
INSERT INTO HtmlLabelInfo VALUES(23804,'雙列式',9)
/
|
drop table if exists Course_Student;
drop table if exists Student;
drop table if exists Course;
drop table if exists Teacher;
create table Teacher (
id int primary key not null auto_increment,
first_name varchar(45) not null,
last_name varchar(45) not null,
designation varchar(45) not null );
create table Course (
id int primary key not null auto_increment,
name varchar(45) not null,
credits int not null,
Teacher_id int null,
CONSTRAINT FK_Teacher FOREIGN KEY (Teacher_id) REFERENCES Teacher(id) );
create table Student (
id int primary key not null auto_increment,
first_name varchar(45) not null,
last_name varchar(45) not null,
enrolled_since long not null );
create table Course_Student (
course_id int not null,
student_id int not null,
primary key(course_id, student_id),
constraint Fk_Course foreign key (course_id) references Course(id), constraint Fk_Student foreign key (student_id) references Student(id) );
|
SELECT setMetric('OpenMFGServerVersion', '3.0.0Beta');
|
SELECT SUM(DISTINCT HYBRIS.ORDERS.P_TOTALPRICE)
FROM HYBRIS.PAYMENTINFOS
JOIN HYBRIS.ORDERS ON HYBRIS.ORDERS.P_USER = HYBRIS.PAYMENTINFOS.P_USER
JOIN HYBRIS.ENUMERATIONVALUES ON HYBRIS.PAYMENTINFOS.P_CREDITCARDTYPE = HYBRIS.ENUMERATIONVALUES.PK
WHERE P_CREDITCARDTYPE IS NOT NULL AND HYBRIS.ORDERS.P_TIMESLOTDELIVERYSTARTDATE BETWEEN '01.08.18 00:00:00,000000000' AND '21.08.18 00:00:00,000000000'
AND HYBRIS.PAYMENTINFOS.P_CREDITCARDNUMBER NOT LIKE '4%' AND HYBRIS.ORDERS.P_DELIVERYCOST = 0
AND HYBRIS.ORDERS.P_STATUS = 8796095479899 AND HYBRIS.ORDERS.P_PAYMENTMODE = 8796093055017 AND HYBRIS.ORDERS.P_DEVICE = 8796146532443
ORDER BY HYBRIS.ORDERS.P_TIMESLOTDELIVERYSTARTDATE; |
INSERT INTO programas (nombre, codigo, idCampoDetallado, idTitulacion) VALUES
('EDUCACION', 'A', 51, 124),
('PSICOPEDAGOGIA', 'A', 52, 190),
('EDUCACION INICIAL', 'A', 53, 127),
('DESARROLLO INFANTIL INTEGRAL', 'B', 53, 139),
('EDUCACION BASICA', 'A', 54, 125),
('EDUCACION ESPECIAL', 'B', 54, 126),
('EDUCACION INTERCULTURAL BILINGÜE', 'C', 54, 128),
('PEDAGOGIA DE LAS CIENCIAS', 'A', 55, 182),
('PEDAGOGIA DE LAS CIENCIAS', 'B', 55, 178),
('PEDAGOGIA DE LAS CIENCIAS', 'C', 55, 175),
('PEDAGOGIA DE LAS CIENCIAS', 'D', 55, 173),
('PEDAGOGIA DE LAS CIENCIAS', 'E', 55, 183),
('PEDAGOGIA DE LAS CIENCIAS', 'F', 55, 177),
('PEDAGOGIA DE LAS CIENCIAS', 'G', 55, 176),
('PEDAGOGIA DE LAS CIENCIAS', 'H', 55, 174),
('PEDAGOGIA DE LAS ARTES', 'I', 55, 180),
('PEDAGOGIA DE LAS ARTES', 'J', 55, 181),
('PEDAGOGIA DE LAS ARTES', 'K', 55, 179),
('PEDAGOGIA DE LOS IDIOMAS NACIONALES Y EXTRANJEROS', 'L', 55, 184),
('TECNICAS AUDIOVISUALES', 'A', 12, 197),
('ANIMACION DIGITAL', 'B', 12, 112),
('PRODUCCION PARA MEDIOS DE COMUNICACION', 'C', 12, 186),
('DISEÑO TEXTIL E INDUMENTARIA', 'A', 13, 143),
('DISEÑO GRAFICO', 'B', 13, 142),
('DISEÑO DE INTERIORES', 'C', 13, 141),
('DISEÑO DE PRODUCTOS', 'D', 13, 187),
('ARTES PLASTICAS', 'A', 14, 118),
('CURADURIA', 'B', 14, 137),
('ARTES ESCENICAS', 'A', 15, 115),
('ARTES MUSICALES', 'B', 15, 117),
('CINE', 'C', 15, 131),
('TEOLOGIA', 'A', 18, 198),
('HISTORIA', 'A', 19, 160),
('ARQUEOLOGIA', 'B', 19, 114),
('CRITICA E HISTORIA DEL ARTE', 'C', 19, 135),
('FILOSOFIA', 'A', 20, 148),
('IDIOMAS', 'A', 21, 162),
('LITERATURA', 'A', 22, 166),
('LINGÜISTICA ', 'B', 22, 165),
('ECONOMIA', 'A', 40, 144),
('CIENCIAS POLITICAS', 'A', 41, 130),
('RELACIONES INTERNACIONALES', 'B', 41, 192),
('DESARROLLO SOCIAL', 'C', 41, 140),
('PSICOLOGIA', 'A', 42, 189),
('ESTUDIOS CULTURALES', 'A', 43, 147),
('SOCIOLOGIA', 'B', 43, 196),
('ANTROPOLOGIA', 'C', 43, 113),
('TRABAJO SOCIAL', 'D', 43, 201),
('ARTES LIBERALES', 'E', 43, 116),
('GENERO Y DESARROLLO', 'A', 44, 152),
('GEOGRAFIA Y TERRITORIO', 'A', 45, 153),
('PERIODISMO', 'A', 47, 185),
('COMUNICACION', 'B', 47, 133),
('BIBLIOTECOLOGIA, DOCUMENTACION Y ARCHIVO', 'A', 48, 121),
('DERECHO', 'A', 46, 1),
('CONTABILIDA Y AUDITORIA', 'A', 1, 134),
('AUDITORIA Y CONTROL DE GESTION', 'B', 1, 120),
('FINANZAS', 'A', 2, 149),
('ADMINISTRACION PUBLICA', 'A', 3, 111),
('ADMINISTRACION DE EMPRESAS', 'B', 3, 110),
('MERCADOTECNIA', 'A', 4, 168),
('PUBLICIDAD', 'B', 4, 191),
('GESTION DE LA INFORMACION', 'A', 5, 156),
('COMERCIO', 'A', 6, 132),
('GESTION DEL TALENTO HUMANO', 'A', 7, 158),
('BIOLOGIA', 'A', 23, 3),
('BIOTECNOLOGIA', 'B', 23, 63),
('MICROBIOLOGIA', 'C', 23, 169),
('BIOFISICA', 'A', 24, 123),
('BIOFARMACEUTICA', 'A', 25, 122),
('BIOMEDICINA', 'A', 26, 62),
('BIOQUIMICA', 'A', 27, 4),
('GENETICA', 'A', 28, 98),
('BIODIVERSIDAD Y RECURSOS GENETICOS', 'A', 29, 70),
('NEUROCIENCIAS', 'A', 30, 170),
('ECOLOGIA', 'A', 37, 202),
('GESTION AMBIENTAL', 'B', 37, 155),
('RECURSOS NATURALES RENOVABLES', 'A', 38, 87),
('QUIMICA', 'A', 31, 216),
('GEOLOGIA', 'A', 32, 54),
('GEOLOGIA', 'A', 32, 100),
('GEOGRAFIA', 'B', 32, 99),
('HIDROLOGIA', 'C', 32, 101),
('METEOROLOGIA', 'D', 32, 103),
('OCEANOGRAFIA', 'E', 32, 105),
('GEOTECNIA', 'F', 32, 75),
('FISICA', 'A', 33, 53),
('FISICA APLICADA', 'B', 33, 96),
('MATEMATICA', 'A', 34, 211),
('MATEMATICA APLICADA', 'B', 34, 102),
('ESTADISTICA', 'A', 35, 95),
('LOGISTICA Y TRANSPORTE', 'A', 36, 77),
('COMPUTACION', 'A', 103, 72),
('COMPUTACION', 'A', 103, 71),
('TECNOLOGIAS DE LA INFORMACION', 'A', 104, 91),
('SOFTWARE', 'A', 105, 66),
('SISTEMAS DE INFORMACION', 'A', 106, 89),
('POLIMEROS', 'A', 72, 65),
('PETROQUIMICA', 'B', 72, 215),
('QUIMICA APLICADA', 'C', 72, 106),
('INGENIERIA AMBIENTAL', 'A', 73, 60),
('ELECTRICIDAD', 'A', 74, 67),
('ELECTRONICA Y AUTOMATIZACION', 'A', 75, 74),
('ELECTROMECANICA', 'B', 75, 68),
('SONIDO Y ACUSTICA', 'C', 75, 90),
('TELEMATICA', 'D', 75, 94),
('MECANICA', 'A', 76, 80),
('METALURGIA', 'B', 76, 82),
('INGENIERIA AUTOMOTRIZ', 'A', 77, 61),
('INGENIERIA NAVAL', 'B', 77, 104),
('INGENIERIA AERONAUTICA', 'C', 77, 56),
('TECNOLOGIAS NUCLEARES Y ENERGETICAS', 'A', 78, 92),
('MECATRONICA', 'A', 79, 81),
('HIDRAULICA', 'A', 80, 76),
('TELECOMUNICACIONES', 'A', 81, 93),
('NANOTECNOLOGIA', 'A', 82, 84),
('AGROINDUSTRIA', 'A', 64, 57),
('ALIMENTOS', 'B', 64, 69),
('MATERIALES', 'A', 65, 79),
('TEXTILES', 'A', 66, 107),
('MINAS', 'A', 67, 83),
('PETROLEOS', 'B', 67, 85),
('PRODUCCION Y OPERACIONES INDUSTRIALES', 'A', 68, 86),
('SEGURIDAD INDUSTRIAL', 'A', 69, 88),
('DISEÑO INDUSTRIAL Y DE PROCESOS', 'A', 70, 73),
('MANTENIMIENTO INDUSTRIAL', 'A', 71, 78),
('ARQUITECTURA', 'A', 60, 2),
('RESTAURACION Y CONSERVACION DE BIENES CULTURALES', 'B', 60, 217),
('INGENIERIA CIVIL', 'A', 61, 64),
('AGRONOMIA', 'A', 8, 58),
('AGROPECUARIA', 'B', 8, 59),
('ZOOTECNIA', 'C', 8, 108),
('INGENIERIA FORESTAL', 'A', 10, 97),
('ACUICULTURA', 'A', 9, 55),
('MEDICINA VETERINARIA', 'A', 11, 213),
('ODONTOLOGIA', 'A', 85, 214),
('MEDICINA', 'A', 86, 212),
('ENFERMERIA', 'A', 87, 145),
('OBSTETRICIA', 'B', 87, 171),
('IMAGENOLOGIA Y RADIODIAGNOSTICO', 'A', 88, 163),
('NUTRICION Y DIETETICA', 'B', 88, 204),
('OPTOMETRIA', 'C', 88, 172),
('LABORATORIO CLINICO', 'D', 88, 164),
('FISIOTERAPIA', 'A', 89, 150),
('TERAPIA OCUPACIONAL', 'B', 89, 199),
('LOGOPEDIA', 'C', 89, 167),
('BIOQUIMICA Y FARMACIA', 'A', 90, 5),
('ATENCION PRIMARIA DE SALUD', 'A', 91, 119),
('SALUD PUBLICA', 'B', 91, 193),
('TERAPIAS ALTERNATIVAS', 'C', 91, 200),
('PROMOCION DE SALUD', 'D', 91, 188),
('GERONTOLOGIA', 'A', 84, 154),
('HOSPITALIDAD Y HOTELERIA', 'A', 98, 161),
('GASTRONOMIA', 'B', 98, 151),
('CULTURA FISICA', 'A', 99, 136),
('DEPORTE ADAPTADO', 'B', 99, 138),
('ENTRENAMIENTO DEPORTIVO', 'C', 99, 146),
('TURISMO', 'A', 100, 203),
('GESTION DE RIESGOS Y DESASTRES', 'A', 92, 157),
('SALUD Y SEGURIDAD OCUPACIONAL', 'A', 93, 194),
('CIENCIAS MILITARES', 'A', 94, 129),
('CIENCIAS POLICIALES', 'B', 94, 109),
('SEGURIDAD CIUDADANA', 'A', 95, 195),
('GESTION DEL TRANSPORTE', 'A', 97, 159),
('EDUCACION', 'A', 56, 6),
('PSICOPEDAGOGIA', 'A', 57, 6),
('EDUCACION INICIAL', 'A', 58, 6),
('DESARROLLO INFANTIL INTEGRAL', 'B', 58, 7),
('EDUCACION BASICA', 'A', 54, 6),
('EDUCACION ESPECIAL', 'B', 54, 7),
('EDUCACION INTERCULTURAL BILINGÜE', 'C', 54, 8),
('PEDAGOGIA DE LAS CIENCIAS', 'A', 55, 6),
('PEDAGOGIA DE LAS ARTES', 'B', 55, 7),
('PEDAGOGIA DE LOS IDIOMAS', 'C', 55, 8),
('TECNICAS AUDIOVISUALES', 'A', 12, 6),
('ANIMACION DIGITAL', 'B', 12, 7),
('PRODUCCION PARA MEDIOS DE COMUNICACION', 'C', 12, 8),
('DISEÑO TEXTIL E INDUMENTARIA', 'A', 13, 6),
('DISEÑO GRAFICO', 'B', 13, 7),
('DISEÑO DE INTERIORES', 'C', 13, 8),
('DISEÑO DE PRODUCTOS', 'D', 13, 9),
('ARTES PLASTICAS', 'A', 14, 6),
('CURADURIA', 'B', 14, 7),
('ARTES ESCENICAS', 'A', 15, 6),
('ARTES MUSICALES', 'B', 15, 7),
('CINE', 'C', 15, 8),
('TEOLOGIA', 'A', 18, 6),
('HISTORIA', 'A', 19, 6),
('ARQUEOLOGIA', 'B', 19, 7),
('CRITICA E HISTORIA DEL ARTE', 'C', 19, 8),
('FILOSOFIA', 'A', 20, 6),
('IDIOMAS', 'A', 21, 6),
('LITERATURA', 'A', 22, 6),
('LINGÜISTICA', 'B', 22, 7),
('ECONOMIA', 'A', 40, 6),
('CIENCIAS POLITICAS', 'A', 41, 6),
('RELACIONES INTERNACIONALES', 'B', 41, 7),
('DESARROLLO LOCAL', 'C', 41, 8),
('PSICOLOGIA', 'A', 42, 6),
('ESTUDIOS CULTURALES', 'A', 43, 6),
('SOCIOLOGIA', 'B', 43, 7),
('ANTROPOLOGIA', 'C', 43, 8),
('TRABAJO SOCIAL', 'D', 43, 9),
('GENERO Y DESARROLLO', 'A', 44, 6),
('GEOGRAFIA Y TERRITORIO', 'A', 45, 6),
('PERIODISMO', 'A', 47, 6),
('COMUNICACION', 'B', 47, 7),
('BIBLIOTECOLOGIA', 'A', 48, 6),
('DOCUMENTACION Y ARCHIVO', 'B', 48, 7),
('DERECHO', 'A', 46, 6),
('CONTABILIDA Y AUDITORIA', 'A', 1, 6),
('AUDITORIA Y CONTROL DE GESTION', 'B', 1, 7),
('FINANZAS', 'A', 2, 7),
('ADMINISTRACION PUBLICA', 'A', 3, 6),
('ADMINISTRACION DE EMPRESAS', 'B', 3, 7),
('MERCADOTECNIA', 'A', 4, 6),
('PUBLICIDAD', 'B', 4, 7),
('GESTION DE LA INFORMACION', 'A', 5, 6),
('COMERCIO', 'A', 6, 6),
('GESTION DEL TALENTO HUMANO', 'A', 7, 6),
('BIOLOGIA', 'A', 23, 6),
('BIOTECNOLOGIA', 'B', 23, 7),
('MICROBIOLOGIA', 'C', 23, 8),
('BIOFISICA', 'A', 24, 6),
('BIOFARMACEUTICA', 'A', 25, 6),
('BIOMEDICINA', 'A', 26, 6),
('BIOQUIMICA', 'A', 27, 6),
('GENETICA', 'A', 28, 6),
('BIODIVERSIDAD Y RECURSOS GENETICOS', 'A', 29, 6),
('NEUROCIENCIAS', 'A', 30, 6),
('ECOLOGIA', 'A', 37, 6),
('GESTION AMBIENTAL', 'B', 37, 7),
('RECURSOS NATURALES RENOVABLES', 'A', 38, 6),
('QUIMICA', 'A', 31, 6),
('GEOLOGIA', 'A', 32, 6),
('GEOGRAFIA', 'B', 32, 7),
('HIDROLOGIA', 'C', 32, 8),
('METEOROLOGIA', 'D', 32, 9),
('OCEANOGRAFIA', 'E', 32, 10),
('GEOTECNIA', 'F', 32, 11),
('FISICA', 'A', 33, 6),
('MATEMATICA', 'A', 34, 6),
('ESTADISTICA', 'A', 35, 6),
('LOGISTICA Y TRANSPORTE', 'A', 36, 6),
('COMPUTACION', 'A', 103, 6),
('TECNOLOGIAS DE LA INFORMACION', 'A', 104, 6),
('SOFTWARE', 'A', 105, 6),
('SISTEMAS DE INFORMACION', 'A', 106, 6),
('POLIMEROS', 'A', 72, 6),
('PETROQUIMICA', 'B', 72, 7),
('QUIMICA APLICADA', 'C', 72, 8),
('INGENIERIA AMBIENTAL', 'A', 73, 6),
('ELECTRICIDAD', 'A', 74, 6),
('ELECTRONICA Y AUTOMATIZACION', 'A', 75, 6),
('ELECTROMECANICA', 'B', 75, 7),
('SONIDO Y ACUSTICA', 'C', 75, 8),
('TELEMATICA', 'D', 75, 9),
('MECANICA', 'A', 76, 6),
('METALURGIA', 'B', 76, 7),
('DISEÑO Y CONSTRUCCION DE VEHICULOS', 'A', 77, 6),
('DISEÑO Y CONSTRUCCION DE BARCOS', 'B', 77, 7),
('DISEÑO Y CONSTRUCCION DE AERONAVES', 'C', 77, 8),
('TECNOLOGIAS NUCLEARES Y ENERGETICAS', 'A', 78, 6),
('MECATRONICA', 'A', 79, 6),
('HIDRAULICA', 'A', 80, 6),
('TELECOMUNICACIONES', 'A', 81, 6),
('NANOTECNOLOGIA', 'A', 82, 6),
('AGROINDUSTRIA', 'A', 64, 6),
('ALIMENTOS', 'B', 64, 7),
('MATERIALES', 'A', 65, 6),
('TEXTILES', 'A', 66, 7),
('MINAS', 'A', 67, 6),
('PETROLEOS', 'B', 67, 7),
('PRODUCCION Y OPERACIONES INDUSTRIALES', 'A', 68, 6),
('SEGURIDAD INDUSTRIAL', 'A', 69, 6),
('DISEÑO INDUSTRIAL Y DE PROCESOS', 'A', 70, 6),
('MANTENIMIENTO INDUSTRIAL', 'A', 71, 6),
('ARQUITECTURA', 'A', 60, 6),
('RESTAURACION Y CONSERVACION DE BIENES CULTURALES', 'B', 60, 7),
('INGENIERIA CIVIL', 'A', 61, 6),
('AGRONOMIA', 'A', 8, 6),
('AGROPECUARIA', 'B', 8, 7),
('ZOOTECNIA', 'C', 8, 8),
('INGENIERIA FORESTAL', 'A', 10, 6),
('ACUICULTURA', 'A', 9, 6),
('MEDICINA VETERINARIA', 'A', 11, 6),
('ODONTOLOGIA', 'A', 85, 6),
('INMUNOLOGIA', 'M1', 86, 27),
('REPRODUCCION HUMANA', 'M2', 86, 49),
('ANATOMIA', 'M3', 86, 12),
('ANESTESIOLOGIA', 'M4', 86, 13),
('CARDIOLOGIA', 'M5', 86, 14),
('CIRUGIA', 'M6', 86, 15),
('CUIDADOS INTENSIVOS', 'M7', 86, 17),
('DERMATOLOGIA', 'M8', 86, 18),
('ENDOCRINOLOGIA', 'M9', 86, 19),
('EPIDEMIOLOGIA', 'M10', 86, 20),
('FISIATRIA', 'M11', 86, 21),
('GASTROENTERLOGIA', 'M12', 86, 22),
('GERIATRIA', 'M13', 86, 23),
('GINECOLOGIA Y OBSTETRICIA', 'M14', 86, 24),
('HEMATOLOGIA', 'M15', 86, 25),
('IMAGENOLOGIA', 'M16', 86, 26),
('MEDICINA CRITICA', 'M17', 86, 28),
('MEDICINA DEL DEPORTE', 'M18', 86, 29),
('MEDICINA FAMILIAR', 'M19', 86, 30),
('MEDICINA INTERNA', 'M20', 86, 31),
('MEDICINA LEGAL', 'M21', 86, 32),
('MEDICINA PERINATAL', 'M22', 86, 33),
('NEFROLOGIA', 'M23', 86, 34),
('NEONATOLOGIA', 'M24', 86, 35),
('NEUMOLOGIA', 'M25', 86, 36),
('NEUROCIRUGIA', 'M26', 86, 37),
('NEUROLOGIA', 'M27', 86, 38),
('OFTALMOLOGIA', 'M28', 86, 39),
('ONCOLOGIA', 'M29', 86, 40),
('ORTOPEDIA Y TRAUMATOLOGIA', 'M30', 86, 41),
('OTORRINOLARINGOLOGIA', 'M31', 86, 42),
('PATOLOGIA CLINICA', 'M32', 86, 43),
('PEDIATRIA', 'M33', 86, 44),
('PERINATOLOGIA', 'M34', 86, 45),
('PSIQUIATRIA', 'M35', 86, 46),
('RADIOLOGIA', 'M36', 86, 47),
('RADIOTERAPIA', 'M37', 86, 48),
('REUMATOLOGIA', 'M38', 86, 50),
('UROLOGIA', 'M39', 86, 52),
('COLOPROCTOLOGIA', 'M40', 86, 16),
('TERAPIA INTENSIVA', 'M41', 86, 51),
('NUTRICION Y DIETETICA', 'A', 88, 6),
('OPTOMETRIA', 'B', 88, 7),
('LABORATORIO CLINICO', 'C', 88, 8),
('TERAPIA OCUPACIONAL', 'A', 89, 6),
('LOGOPEDIA', 'B', 89, 7),
('BIOQUIMICA Y FARMACIA', 'A', 90, 6),
('ATENCION PRIMARIA DE SALUD', 'A', 91, 6),
('SALUD PUBLICA', 'B', 91, 7),
('TERAPIAS ALTERNATIVAS Y COMPLEMENTARIAS', 'C', 91, 8),
('HOSPITALIDAD Y HOTELERIA', 'A', 98, 6),
('GASTRONOMIA', 'B', 98, 7),
('CULTURA FISICA', 'A', 99, 6),
('DEPORTE ADAPTADO', 'B', 99, 7),
('ENTRENAMIENTO DEPORTIVO', 'C', 99, 8),
('TURISMO', 'A', 100, 6),
('GESTION DE RIESGOS Y DESASTRES', 'A', 92, 6),
('SALUD Y SEGURIDAD OCUPACIONAL', 'A', 93, 6),
('CIENCIAS MILITARES', 'A', 94, 6),
('CIENCIAS POLICIALES', 'B', 94, 7),
('SEGURIDAD CIUDADANA', 'A', 95, 6),
('GESTION DEL TRANSPORTE', 'A', 97, 6),
('EDUCACION', 'A', 56, 205),
('PEDAGOGIA', 'A', 59, 205),
('TECNICAS AUDIOVISUALES', 'A', 12, 205),
('PRODUCCION PARA MEDIOS DE COMUNICACION', 'B', 12, 206),
('DISEÑO', 'A', 13, 205),
('ARTES', 'A', 14, 205),
('ARTES ESCENICAS', 'A', 15, 205),
('ARTES MUSICALES', 'B', 15, 206),
('TEOLOGIA', 'A', 18, 205),
('HISTORIA', 'A', 19, 205),
('ARQUEOLOGIA', 'B', 19, 205),
('FILOSOFIA', 'A', 20, 206),
('IDIOMAS', 'A', 21, 205),
('LITERATURA', 'A', 22, 205),
('LINGÜISTICA', 'B', 22, 205),
('ECONOMIA', 'A', 40, 205),
('CIENCIAS POLITICAS', 'A', 41, 205),
('RELACIONES INTERNACIONALES', 'B', 41, 206),
('DESARROLLO LOCAL', 'C', 41, 207),
('PSICOLOGIA', 'A', 42, 205),
('ESTUDIOS CULTURALES', 'A', 43, 205),
('SOCIOLOGIA', 'B', 43, 206),
('ANTROPOLOGIA', 'C', 43, 207),
('TRABAJO SOCIAL', 'D', 43, 208),
('GENERO Y DESARROLLO', 'A', 44, 205),
('GEOGRAFIA Y TERRITORIO', 'A', 45, 205),
('PERIODISMO', 'A', 47, 205),
('COMUNICACION', 'B', 47, 206),
('BIBLIOTECOLOGIA', 'A', 48, 205),
('DOCUMENTACION Y ARCHIVO', 'B', 48, 205),
('DERECHO', 'A', 46, 205),
('CONTABILIDA Y AUDITORIA', 'A', 1, 205),
('AUDITORIA Y CONTROL DE GESTION', 'B', 1, 206),
('FINANZAS', 'A', 2, 206),
('ADMINISTRACION PUBLICA', 'A', 3, 205),
('ADMINISTRCION DE EMPRESAS', 'B', 3, 206),
('MERCADOTECNIA', 'A', 4, 205),
('PUBLICIDAD', 'B', 4, 206),
('GESTION DE LA INFORMACION', 'A', 5, 205),
('COMERCIO', 'A', 6, 205),
('GESTION DEL TALENTO HUMANO', 'A', 7, 205),
('BIOLOGIA', 'A', 23, 205),
('BIOTECNOLOGIA', 'B', 23, 206),
('MICROBIOLOGIA', 'C', 23, 207),
('BIOFISICA', 'A', 24, 205),
('BIOFARMACEUTICA', 'A', 25, 205),
('BIOMEDICINA', 'A', 26, 205),
('BIOQUIMICA', 'A', 27, 205),
('GENETICA', 'A', 28, 205),
('BIODIVERSIDAD Y RECURSOS GENETICOS', 'A', 29, 206),
('NEUROCIENCIAS', 'A', 30, 205),
('ECOLOGIA', 'A', 37, 205),
('GESTION AMBIENTAL', 'A', 37, 206),
('RECURSOS NATURALES RENOVABLES', 'B', 38, 205),
('GEOLOGIA', 'A', 31, 205),
('GEOGRAFIA', 'A', 32, 205),
('HIDROLOGIA', 'B', 32, 206),
('METEOROLOGIA', 'C', 32, 207),
('METEOROLOGIA', 'D', 32, 208),
('OCEANOGRAFIA', 'E', 32, 209),
('GEOTECNIA', 'F', 32, 210),
('FISICA', 'A', 33, 205),
('MATEMATICA', 'A', 34, 205),
('ESTADISTICA', 'A', 35, 205),
('LOGISTICA Y TRANSPORTE', 'A', 36, 205),
('COMPUTACION', 'A', 103, 205),
('TECNOLOGIAS DE LA INFORMACION', 'A', 104, 205),
('SOFTWARE', 'A', 105, 205),
('SISTEMAS DE INFORMACION', 'A', 106, 205),
('QUIMICA APLICADA', 'A', 72, 205),
('TECNOLOGIAS DE PROTECCION DEL MEDIO AMBIENTE', 'A', 73, 205),
('ELECTRICIDAD', 'A', 74, 205),
('ELECTRONICA Y AUTOMATIZACION', 'A', 75, 205),
('ELECTROMECANICA', 'B', 75, 206),
('SONIDO Y ACUSTICA', 'C', 75, 207),
('TELEMATICA', 'D', 75, 208),
('MECANICA', 'A', 76, 205),
('METALURGIA', 'B', 76, 206),
('DISEÑO Y CONSTRUCCION DE VEHICULOS', 'A', 77, 205),
('DISEÑO Y CONSTRUCCION DE BARCOS', 'B', 77, 206),
('DISEÑO Y CONSTRUCCION DE AERONAVES', 'C', 77, 207),
('TECNOLOGIAS NUCLEARES Y ENERGETICAS', 'A', 78, 205),
('MECATRONICA', 'A', 79, 205),
('HIDRAULICA', 'A', 80, 205),
('TELECOMUNICACIONES', 'A', 81, 205),
('NANOTECNOLOGIA', 'A', 82, 205),
('AGROINDUSTRIA', 'A', 64, 205),
('ALIMENTOS', 'B', 64, 206),
('MATERIALES', 'A', 65, 205),
('TEXTILES', 'A', 66, 206),
('MINAS', 'A', 67, 205),
('PETROLEOS', 'B', 67, 206),
('PRODUCCION Y OPERACIONES INDUSTRIALES', 'A', 68, 205),
('SEGURIDAD INDUSTRIAL', 'A', 69, 205),
('DISEÑO INDUSTRIAL Y DE PROCESOS', 'A', 70, 205),
('MANTENIMIENTO INDUSTRIAL', 'A', 71, 205),
('ARQUITECTURA', 'A', 60, 205),
('RESTAURACION Y CONSERVACION DE BIENES CULTURALES', 'B', 60, 206),
('INGENIERIA CIVIL', 'A', 61, 205),
('AGRONOMIA', 'A', 8, 205),
('AGROPECUARIA', 'B', 8, 206),
('ZOOTECNIA', 'C', 8, 207),
('SILVICULTURA', 'A', 10, 205),
('ACUICULTURA', 'A', 9, 205),
('MEDICINA VETERINARIA', 'A', 11, 205),
('NUTRICION Y DIETETICA', 'A', 88, 205),
('OPTOMETRIA', 'B', 88, 206),
('TERAPIA OCUPACIONAL', 'A', 89, 205),
('LOGOPEDIA', 'B', 89, 206),
('BIOQUIMICA Y FARMACIA', 'A', 90, 205),
('ATENCION PRIMARIA DE SALUD', 'A', 91, 205),
('SALUD PUBLICA', 'B', 91, 206),
('TERAPIAS ALTERNATIVAS Y COMPLEMENTARIAS', 'C', 91, 207),
('HOSPITALIDAD Y HOTELERIA', 'A', 98, 205),
('GASTRONOMIA', 'B', 98, 206),
('CULTURA FISICA', 'A', 99, 205),
('TURISMO', 'A', 100, 205),
('GESTION DE RIESGOS', 'A', 92, 205),
('SALUD Y SEGURIDAD OCUPACIONAL', 'A', 93, 206),
('CIENCIAS MILITARES', 'A', 94, 205),
('CIENCIAS POLICIALES', 'B', 94, 206),
('SEGURIDAD INDUSTRIAL', 'A', 95, 205),
('GESTION DEL TRANSPORTE', 'A', 97, 205),
('EDUCACION', 'A', 56, 205),
('PEDAGOGIA', 'A', 59, 205),
('TECNICAS AUDIOVISUALES', 'A', 12, 205),
('PRODUCCION PARA MEDIOS DE COMUNICACION', 'B', 12, 206),
('DISEÑO', 'A', 13, 205),
('ARTES', 'A', 14, 205),
('ARTES ESCENICAS', 'A', 15, 205),
('ARTES MUSICALES', 'B', 15, 206),
('TEOLOGIA', 'A', 18, 205),
('HISTORIA', 'A', 19, 205),
('ARQUEOLOGIA', 'B', 19, 205),
('FILOSOFIA', 'A', 20, 206),
('IDIOMAS', 'A', 21, 205),
('LITERATURA', 'A', 22, 205),
('LINGÜISTICA', 'B', 22, 205),
('ECONOMIA', 'A', 40, 205),
('CIENCIAS POLITICAS', 'A', 41, 205),
('RELACIONES INTERNACIONALES', 'B', 41, 206),
('DESARROLLO LOCAL', 'C', 41, 207),
('PSICOLOGIA', 'A', 42, 205),
('ESTUDIOS CULTURALES', 'A', 43, 205),
('SOCIOLOGIA', 'B', 43, 206),
('ANTROPOLOGIA', 'C', 43, 207),
('TRABAJO SOCIAL', 'D', 43, 208),
('GENERO Y DESARROLLO', 'A', 44, 205),
('GEOGRAFIA Y TERRITORIO', 'A', 45, 205),
('PERIODISMO', 'A', 47, 205),
('COMUNICACION', 'B', 47, 206),
('BIBLIOTECOLOGIA', 'A', 48, 205),
('DOCUMENTACION Y ARCHIVO', 'B', 48, 205),
('DERECHO', 'A', 46, 205),
('CONTABILIDA Y AUDITORIA', 'A', 1, 205),
('AUDITORIA Y CONTROL DE GESTION', 'B', 1, 206),
('FINANZAS', 'A', 2, 206),
('ADMINISTRACION PUBLICA', 'A', 3, 205),
('ADMINISTRCION DE EMPRESAS', 'B', 3, 206),
('MERCADOTECNIA', 'A', 4, 205),
('PUBLICIDAD', 'B', 4, 206),
('GESTION DE LA INFORMACION', 'A', 5, 205),
('COMERCIO', 'A', 6, 205),
('GESTION DEL TALENTO HUMANO', 'A', 7, 205),
('BIOLOGIA', 'A', 23, 205),
('BIOTECNOLOGIA', 'B', 23, 206),
('MICROBIOLOGIA', 'C', 23, 207),
('BIOFISICA', 'A', 24, 205),
('BIOFARMACEUTICA', 'A', 25, 205),
('BIOMEDICINA', 'A', 26, 205),
('BIOQUIMICA', 'A', 27, 205),
('GENETICA', 'A', 28, 205),
('BIODIVERSIDAD Y RECURSOS GENETICOS', 'A', 29, 206),
('NEUROCIENCIAS', 'A', 30, 205),
('ECOLOGIA', 'A', 37, 205),
('GESTION AMBIENTAL', 'A', 37, 206),
('RECURSOS NATURALES RENOVABLES', 'B', 38, 205),
('GEOLOGIA', 'A', 31, 205),
('GEOGRAFIA', 'A', 32, 205),
('HIDROLOGIA', 'B', 32, 206),
('METEOROLOGIA', 'C', 32, 207),
('METEOROLOGIA', 'D', 32, 208),
('OCEANOGRAFIA', 'E', 32, 209),
('GEOTECNIA', 'F', 32, 210),
('FISICA', 'A', 33, 205),
('MATEMATICA', 'A', 34, 205),
('ESTADISTICA', 'A', 35, 205),
('LOGISTICA Y TRANSPORTE', 'A', 36, 205),
('COMPUTACION', 'A', 103, 205),
('TECNOLOGIAS DE LA INFORMACION', 'A', 104, 205),
('SOFTWARE', 'A', 105, 205),
('SISTEMAS DE INFORMACION', 'A', 106, 205),
('QUIMICA APLICADA', 'A', 72, 205),
('TECNOLOGIAS DE PROTECCION DEL MEDIO AMBIENTE', 'A', 73, 205),
('ELECTRICIDAD', 'A', 74, 205),
('ELECTRONICA Y AUTOMATIZACION', 'A', 75, 205),
('ELECTROMECANICA', 'B', 75, 206),
('SONIDO Y ACUSTICA', 'C', 75, 207),
('TELEMATICA', 'D', 75, 208),
('MECANICA', 'A', 76, 205),
('METALURGIA', 'B', 76, 206),
('DISEÑO Y CONSTRUCCION DE VEHICULOS', 'A', 77, 205),
('DISEÑO Y CONSTRUCCION DE BARCOS', 'B', 77, 206),
('DISEÑO Y CONSTRUCCION DE AERONAVES', 'C', 77, 207),
('TECNOLOGIAS NUCLEARES Y ENERGETICAS', 'A', 78, 205),
('MECATRONICA', 'A', 79, 205),
('HIDRAULICA', 'A', 80, 205),
('TELECOMUNICACIONES', 'A', 81, 205),
('NANOTECNOLOGIA', 'A', 82, 205),
('AGROINDUSTRIA', 'A', 64, 205),
('ALIMENTOS', 'B', 64, 206),
('MATERIALES', 'A', 65, 205),
('TEXTILES', 'A', 66, 206),
('MINAS', 'A', 67, 205),
('PETROLEOS', 'B', 67, 206),
('PRODUCCION Y OPERACIONES INDUSTRIALES', 'A', 68, 205),
('SEGURIDAD INDUSTRIAL', 'A', 69, 205),
('DISEÑO INDUSTRIAL Y DE PROCESOS', 'A', 70, 205),
('MANTENIMIENTO INDUSTRIAL', 'A', 71, 205),
('ARQUITECTURA', 'A', 60, 205),
('RESTAURACION Y CONSERVACION DE BIENES CULTURALES', 'B', 60, 206),
('INGENIERIA CIVIL', 'A', 61, 205),
('AGRONOMIA', 'A', 8, 205),
('AGROPECUARIA', 'B', 8, 206),
('ZOOTECNIA', 'C', 8, 207),
('SILVICULTURA', 'A', 10, 205),
('ACUICULTURA', 'A', 9, 205),
('MEDICINA VETERINARIA', 'A', 11, 205),
('NUTRICION Y DIETETICA', 'A', 88, 205),
('OPTOMETRIA', 'B', 88, 206),
('TERAPIA OCUPACIONAL', 'A', 89, 205),
('LOGOPEDIA', 'B', 89, 206),
('BIOQUIMICA Y FARMACIA', 'A', 90, 205),
('ATENCION PRIMARIA DE SALUD', 'A', 91, 205),
('SALUD PUBLICA', 'B', 91, 206),
('TERAPIAS ALTERNATIVAS Y COMPLEMENTARIAS', 'C', 91, 207),
('HOSPITALIDAD Y HOTELERIA', 'A', 98, 205),
('GASTRONOMIA', 'B', 98, 206),
('CULTURA FISICA', 'A', 99, 205),
('TURISMO', 'A', 100, 205),
('GESTION DE RIESGOS', 'A', 92, 205),
('SALUD Y SEGURIDAD OCUPACIONAL', 'A', 93, 206),
('CIENCIAS MILITARES', 'A', 94, 205),
('CIENCIAS POLICIALES', 'B', 94, 206),
('SEGURIDAD INDUSTRIAL', 'A', 95, 205),
('GESTION DEL TRANSPORTE', 'A', 97, 205); |
CREATE TABLE Stg.[FAA_SavedSearches]
(
SourseSK BIGINT IDENTITY(1,1) NOT NULL
,BinaryId varchar(256)
,TypeCode varchar(256)
,EntityId varchar(256)
,EntityTypeCode varchar(256)
,DateCreatedTimeStamp varchar(256)
,DateUpdatedTimeStamp varchar(256)
,CandidateId varchar(256)
,[Location] varchar(256)
,Keywords varchar(1096)
,WithinDistance varchar(256)
,ApprenticeshipLevel varchar(256)
,RunId bigint default(-1)
,AsDm_CreatedDate datetime2 default(getdate())
,AsDm_UpdatedDate datetime2 default(getdatE())
)
|
CREATE DATABASE WsBook;
DROP TABLE IF EXISTS Prices;
CREATE TABLE Prices
(
BookId VARCHAR(255) NOT NULL,
Price FLOAT(11,1) NOT NULL,
PRIMARY KEY(BookId),
UNIQUE(BookId)
);
DROP TABLE IF EXISTS Orders;
CREATE TABLE Orders
(
OrderId INT NOT NULL AUTO_INCREMENT,
BookId VARCHAR(255) NOT NULL,
UserId INT NOT NULL,
Category VARCHAR(255) NOT NULL,
Amount INT NOT NULL,
OrderTime DATETIME NOT NULL,
Score FLOAT,
Comment TEXT,
PRIMARY KEY(OrderId)
);
|
ALTER TABLE gltrans DISABLE trigger gltransaltertrigger;
UPDATE gltrans SET
gltrans_doctype='JP',
gltrans_notes=overlay(gltrans_notes placing 'Journal' from 1 for 9)
WHERE gltrans_doctype='SL';
ALTER TABLE gltrans ENABLE trigger gltransaltertrigger; |
/* 添加短信权限 */
insert into SystemRights (id,rightdesc,righttype) values (398,'短信收发系统','7')
/
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (398,7,'短信收发系统','短信收发系统')
/
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (398,8,'','')
/
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (3087,'短信管理','SmsManage:View',398)
/
drop table SMS_Message
/
/* 创建短信系统用到的数据库表 */
CREATE TABLE SMS_Message (
id integer NOT NULL ,
message varchar2 (100) ,
recievenumber varchar2 (15) ,
sendnumber varchar2 (15) ,
messagestatus char (1) ,
requestid integer NULL ,
userid integer NULL ,
usertype char (1) ,
messagetype char (1) ,
finishtime char (19)
)
/
/* 增加自动ID所用的索引表记录 */
insert into SequenceIndex(indexdesc,currentid) values('smsid',0)
/
/* 创建所用到的存储过程 */
CREATE or REPLACE PROCEDURE SMS_Message_Insert
(id_1 integer,
message_2 varchar2,
recievenumber_3 varchar2,
sendnumber_4 varchar2,
messagestatus_5 char,
requestid_6 integer,
userid_7 integer,
usertype_8 char,
messagetype_9 char,
finishtime_10 varchar2,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
INSERT INTO SMS_Message
( id,
message,
recievenumber,
sendnumber,
messagestatus,
requestid,
userid,
usertype,
messagetype,
finishtime)
VALUES
( id_1,
message_2,
recievenumber_3,
sendnumber_4,
messagestatus_5,
requestid_6,
userid_7,
usertype_8,
messagetype_9,
finishtime_10);
end;
/
CREATE or REPLACE PROCEDURE SequenceIndex_SelectSmsid
( flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
update SequenceIndex set currentid = currentid+1 where indexdesc='smsid';
open thecursor for
select currentid from SequenceIndex where indexdesc='smsid';
end;
/
INSERT INTO HtmlLabelIndex values(16891,'短信管理')
/
INSERT INTO HtmlLabelInfo VALUES(16891,'短信管理',7)
/
INSERT INTO HtmlLabelInfo VALUES(16891,'',8)
/
/* 修改短信系统用到的数据库表 */
alter table SMS_Message add smsyear char(4)
/
alter table SMS_Message add smsmonth char(2)
/
alter table SMS_Message add smsday char(2)
/
alter table SMS_Message add isdelete char(1)
/
alter table SMS_Message add touserid integer
/
alter table SMS_Message add tousertype char(1)
/
/* 修改所用到的存储过程 */
CREATE or REPLACE PROCEDURE SMS_Message_Insert
(id_1 integer,
message_2 varchar2,
recievenumber_3 varchar2,
sendnumber_4 varchar2,
messagestatus_5 char,
requestid_6 integer,
userid_7 integer,
usertype_8 char,
messagetype_9 char,
finishtime_10 char,
smsyear_11 char,
smsmonth_12 char,
smsday_13 char,
isdelete_14 char,
touserid_15 integer,
tousertype_16 char,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
INSERT INTO SMS_Message
( id,
message,
recievenumber,
sendnumber,
messagestatus,
requestid,
userid,
usertype,
messagetype,
finishtime,
smsyear,
smsmonth,
smsday,
isdelete,
touserid,
tousertype)
VALUES
( id_1,
message_2,
recievenumber_3,
sendnumber_4,
messagestatus_5,
requestid_6,
userid_7,
usertype_8,
messagetype_9,
finishtime_10,
smsyear_11,
smsmonth_12,
smsday_13,
isdelete_14,
touserid_15,
tousertype_16);
end;
/
update SMS_Message set isdelete='0'
/
update SMS_Message set isdelete='1' where messagestatus='3'
/
update SMS_Message set messagetype='2' where messagetype<>'1'
/
INSERT INTO HtmlLabelIndex values(17008,'短信报表')
/
INSERT INTO HtmlLabelIndex values(17009,'短信时间报表')
/
INSERT INTO HtmlLabelInfo VALUES(17008,'短信报表',7)
/
INSERT INTO HtmlLabelInfo VALUES(17008,'',8)
/
INSERT INTO HtmlLabelInfo VALUES(17009,'短信时间报表',7)
/
INSERT INTO HtmlLabelInfo VALUES(17009,'',8)
/
/* 修改短信系统用到的数据库表 */
alter table SMS_Message modify message varchar2(200)
/
/* 修改所用到的存储过程 */
CREATE or REPLACE PROCEDURE SMS_Message_Insert
(id_1 integer,
message_2 varchar2,
recievenumber_3 varchar2,
sendnumber_4 varchar2,
messagestatus_5 char,
requestid_6 integer,
userid_7 integer,
usertype_8 char,
messagetype_9 char,
finishtime_10 char,
smsyear_11 char,
smsmonth_12 char,
smsday_13 char,
isdelete_14 char,
touserid_15 integer,
tousertype_16 char,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
INSERT INTO SMS_Message
( id,
message,
recievenumber,
sendnumber,
messagestatus,
requestid,
userid,
usertype,
messagetype,
finishtime,
smsyear,
smsmonth,
smsday,
isdelete,
touserid,
tousertype)
VALUES
(id_1,
message_2,
recievenumber_3,
sendnumber_4,
messagestatus_5,
requestid_6,
userid_7,
usertype_8,
messagetype_9,
finishtime_10,
smsyear_11,
smsmonth_12,
smsday_13,
isdelete_14,
touserid_15,
tousertype_16);
end;
/
ALTER table SystemSet add smsserver varchar2(50)
/
/* 结束 */
/* 增加群发服务器 */
CREATE or REPLACE PROCEDURE SystemSet_Update
(emailserver_1 varchar2 ,
debugmode_2 char ,
logleaveday_3 smallint ,
defmailuser_4 varchar2 ,
defmailpassword_5 varchar2 ,
pop3server_6 varchar2,
filesystem_7 varchar2,
filesystembackup_8 varchar2,
filesystembackuptime_9 integer ,
needzip_10 char,
needzipencrypt_11 char,
defmailserver_12 varchar2,
defmailfrom_13 varchar2,
defneedauth_14 char,
smsserver_15 varchar2,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
update SystemSet set
emailserver=emailserver_1 ,
debugmode=debugmode_2,
logleaveday=logleaveday_3 ,
defmailuser=defmailuser_4 ,
defmailpassword=defmailpassword_5 ,
pop3server=pop3server_6 ,
filesystem=filesystem_7,
filesystembackup=filesystembackup_8 ,
filesystembackuptime=filesystembackuptime_9 ,
needzip=needzip_10 ,
needzipencrypt=needzipencrypt_11 ,
defmailserver=defmailserver_12 ,
defmailfrom=defmailfrom_13 ,
defneedauth=defneedauth_14 ,
smsserver=smsserver_15;
end;
/
INSERT INTO HtmlLabelIndex values(16953,'短信服务器')
/
INSERT INTO HtmlLabelInfo VALUES(16953,'短信服务器',7)
/
INSERT INTO HtmlLabelInfo VALUES(16953,'',8)
/
|
CREATE DATABASE `mproj10`; |
create schema TIMER;
CREATE TABLE "TIMER"."CLOCK"
(
TMR_ID bigint PRIMARY KEY NOT NULL,
AUD_CREATE timestamp,
AUD_UPDATE timestamp,
TMR_DH_TIMER timestamp,
USER_USR_PIS bigint
)
;
CREATE TABLE "TIMER"."USER"
(
USR_PIS bigint PRIMARY KEY NOT NULL,
AUD_CREATE timestamp,
AUD_UPDATE timestamp,
USR_NM varchar(100),
USR_PW varchar(1000)
)
;
ALTER TABLE "TIMER"."CLOCK"
ADD CONSTRAINT FK1REV8ERGBWNQRX62RFST6C56L
FOREIGN KEY (USER_USR_PIS)
REFERENCES "TIMER"."USER"(USR_PIS)
;
CREATE INDEX SYS_IDX_FK1REV8ERGBWNQRX62RFST6C56L_10163 ON "TIMER"."CLOCK"(USER_USR_PIS)
;
CREATE UNIQUE INDEX SYS_IDX_SYS_PK_10156_10157 ON "TIMER"."CLOCK"(TMR_ID)
;
CREATE UNIQUE INDEX SYS_IDX_SYS_PK_10159_10160 ON "TIMER"."USER"(USR_PIS)
;
|
CREATE TABLE grape.table_operation_whitelist(
schema text NOT NULL,
tablename text NOT NULL,
allowed_operation text NOT NULL,
roles text[],
CONSTRAINT insert_query_pk PRIMARY KEY (schema,tablename,allowed_operation)
);
|
/**
View som returnerer alle gjeldende iverksatte behandlinger
Husk å filtrere på stønadstype ved behov
*/
CREATE OR REPLACE VIEW gjeldende_iverksatte_behandlinger AS
SELECT *
FROM (SELECT b.*,
f.stonadstype,
ROW_NUMBER() OVER (PARTITION BY b.fagsak_id ORDER BY b.opprettet_tid DESC) rn,
f.migrert
FROM behandling b
JOIN fagsak f ON b.fagsak_id = f.id
WHERE b.type != 'BLANKETT'
AND b.resultat IN ('OPPHØRT', 'INNVILGET')
AND b.status = 'FERDIGSTILT') q
WHERE rn = 1; |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 30, 2019 at 04:22 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
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: `gamepedia`
--
-- --------------------------------------------------------
--
-- Table structure for table `accountinfo`
--
CREATE TABLE `accountinfo` (
`UserId` int(11) NOT NULL,
`Username` varchar(20) NOT NULL,
`Password` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `accountinfo`
--
INSERT INTO `accountinfo` (`UserId`, `Username`, `Password`) VALUES
(1, 'ahmad', '123'),
(2, 'ben', '123'),
(3, 'chris', '123'),
(4, 'new', '12'),
(5, 'user_1', '123');
-- --------------------------------------------------------
--
-- Table structure for table `commentinfo`
--
CREATE TABLE `commentinfo` (
`CommentId` int(11) NOT NULL,
`Comment` varchar(100) NOT NULL,
`UserId` int(11) NOT NULL,
`Rating` int(11) NOT NULL,
`Date` date NOT NULL,
`GameId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `commentinfo`
--
INSERT INTO `commentinfo` (`CommentId`, `Comment`, `UserId`, `Rating`, `Date`, `GameId`) VALUES
(1, 'toxic', 1, 4, '2000-10-10', 1),
(2, 'improved bo', 2, 10, '2000-10-10', 2),
(3, 'kid game', 3, 6, '2000-10-10', 3),
(4, 'yes', 2, 7, '2019-02-10', 1),
(5, 'yes yes yse', 1, 7, '0000-00-00', 10),
(6, 'lol', 1, 7, '2019-02-10', 3),
(7, 'nice game', 5, 7, '2019-02-11', 2);
-- --------------------------------------------------------
--
-- Table structure for table `favourites`
--
CREATE TABLE `favourites` (
`FavouritesId` int(11) NOT NULL,
`GameId` int(11) NOT NULL,
`UserId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `favourites`
--
INSERT INTO `favourites` (`FavouritesId`, `GameId`, `UserId`) VALUES
(1, 2, 1),
(2, 3, 1),
(3, 1, 2),
(4, 2, 3),
(11, 1, 1),
(12, 17, 1),
(45, 7, 1),
(46, 2, 5),
(47, 18, 5);
-- --------------------------------------------------------
--
-- Table structure for table `gameinfo`
--
CREATE TABLE `gameinfo` (
`GameId` int(11) NOT NULL,
`Name` varchar(45) NOT NULL,
`Description` text NOT NULL,
`Company` varchar(45) NOT NULL,
`Rating` int(11) NOT NULL,
`Date` date NOT NULL,
`Category` varchar(20) NOT NULL,
`image` varchar(255) NOT NULL,
`video` text NOT NULL,
`GenreId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `gameinfo`
--
INSERT INTO `gameinfo` (`GameId`, `Name`, `Description`, `Company`, `Rating`, `Date`, `Category`, `image`, `video`, `GenreId`) VALUES
(1, 'League of Legends', 'League of Legends (abbreviated LoL) is a multiplayer online battle arena video game developed and published by Riot Games for Microsoft Windows and macOS. The game follows a freemium model and is supported by microtransactions, and was inspired by the War', 'Riot Games', 7, '2009-10-27', 'Most Played', 'images/LoL.jpg', '', 1),
(2, 'Call of Duty : Black Ops 4', 'Call of Duty: Black Ops 4 (stylized as Call of Duty: Black Ops IIII) is a multiplayer first-person shooter developed by Treyarch and published by Activision. It was released worldwide for Microsoft Windows, PlayStation 4, and Xbox One on October 12, 2018.', 'Activision', 9, '2018-10-12', 'New Releases', 'images/b04.jpg', '', 2),
(3, 'Player Unkown\'s Battleground', 'PlayerUnknown\'s Battlegrounds (PUBG) is a 2017 online multiplayer battle royale game developed and published by PUBG Corporation, a subsidiary of South Korean video game company Bluehole. The game is based on previous mods that were created by Brendan \"Pl', 'PUBG Corporation', 8, '2017-12-20', 'Top Rated', 'images/pubg.jpg', 'https://www.youtube.com/embed/hfjazBN0DwA', 2),
(4, 'Overwatch', 'Overwatch is a team-based multiplayer first-person shooter video game developed and published by Blizzard Entertainment, which released on May 24, 2016 for PlayStation 4, Xbox One, and Windows. Described as a \"hero shooter\", Overwatch assigns players into', 'Blizzard Entertainment', 10, '2016-05-24', 'Top Rated', 'images/overwatch.jpg', '', 2),
(5, 'Maplestory', 'MapleStory (Hangul: 메이플스토리; RR: Meipeul Seutori) is a free-to-play, 2D, side-scrolling massively multiplayer online role-playing game, developed by South Korean company Wizet. Several versions of the game are available for specific countries or regions, a', 'Nexon', 9, '2003-04-29', 'Top Rated', 'images/maplestory.jpg', '', 3),
(6, 'Red Dead Redemption 2', 'Red Dead Redemption 2[a] is a Western action-adventure game developed and published by Rockstar Games. It was released on October 26, 2018, for the PlayStation 4 and Xbox One consoles. The third entry in the Red Dead series, it is a prequel to the 2010 ga', 'Rockstar Games', 7, '2018-10-26', 'New Releases', 'images/RDR2.jpg', 'https://www.youtube.com/embed/srUjOl_wBmU', 3),
(7, 'Dota 2', 'Dota 2 is a multiplayer online battle arena (MOBA) video game developed and published by Valve Corporation. The game is a sequel to Defense of the Ancients (DotA), which was a community-created mod for Blizzard Entertainment\'s Warcraft III: Reign of Chaos', 'Valve Corporation', 6, '2013-07-09', 'Top Rated', 'images/Dota2logo.jpg', '', 1),
(8, 'Fifa 19', 'FIFA 19 is a football simulation video game developed by EA Vancouver as part of Electronic Arts\' FIFA series. Announced on 6 June 2018 for its E3 2018 press conference, it was released on 28 September 2018 for PlayStation 3, PlayStation 4, Xbox 360, Xbox', 'EA Sports', 5, '2018-09-28', 'New Releases', 'images/fifa19.jpg', '', 4),
(9, 'NBA 2K18', 'NBA 2K18 is a basketball simulation video game developed by Visual Concepts and published by 2K Sports. It is the 19th installment in the NBA 2K franchise, the successor to NBA 2K17, and the predecessor to NBA 2K19. It was released on September 19, 2017 f', '2k Sports', 6, '2017-09-17', 'New Releases', 'images/nba.jpg', '', 4),
(10, 'Rocket League', 'Rocket League is a vehicular soccer video game developed and published by Psyonix. The game was first released for Microsoft Windows and PlayStation 4 in July 2015, with ports for Xbox One, macOS, Linux, and Nintendo Switch being released later on. In Jun', 'Psynoic', 7, '2015-07-07', 'Most Played', 'images/rocketleague.jpg', '', 4),
(11, 'Heroes of The Storm', 'Heroes of the Storm revolves around online 5-versus-5 matches, operated through Blizzard\'s online gaming service Battle.net. Players can choose from different game modes, which include playing against computer-controlled heroes or other players. Initially', 'Blizzard Entertainment', 5, '2015-07-02', 'Top Rated', 'images/HoTS.jpg', '', 1),
(12, 'World of Warcraft', 'World of Warcraft (WoW) is a massively multiplayer online role-playing game (MMORPG) released in 2004 by Blizzard Entertainment. It is the fourth released game set in the Warcraft fantasy universe.[3] World of Warcraft takes place within the Warcraft worl', 'Blizzard Entertainment', 9, '2004-11-23', 'Top Rated', 'images/WoW.jpg', '', 3),
(13, 'Battlefield V', 'Battlefield V will focus extensively on party-based features and mechanics, scarcity of resources, and removing \"abstractions\" from game mechanics to increase realism.[4] There will be an expanded focus on player customization through the new Company syst', 'EA Sports', 8, '2018-11-20', 'New Releases', 'images/Battlefield.jpg', '', 2),
(14, 'Resident Evil 2', 'Resident Evil 2 is a remake of the original Resident Evil 2 released for the PlayStation in 1998. Unlike the original, which uses tank controls and fixed camera angles, the remake features \"over-the-shoulder\" third-person shooter gameplay similar to Resid', 'CapCom', 6, '2019-01-25', 'New Releases', 'images/RE2.jpg', '', 3),
(15, 'Fortnite', 'Fortnite is an online video game developed by Epic Games and released in 2017. It is available in three distinct game mode versions that otherwise share the same general gameplay and game engine: Fortnite: Save the World, a cooperative shooter-survival ga', 'Epic Games', 7, '2017-07-25', 'Most Played', 'images/fortnite.jpg', '', 2),
(16, 'Minecraft', 'Minecraft is a 2011 sandbox video game created by Swedish game developer Markus Persson and later developed by Mojang. The game allows players to build with a variety of different blocks in a 3D procedurally generated world, requiring creativity from play', 'Mojang', 8, '2011-11-18', 'Most Played', 'images/minecraft.jpg', '', 3),
(17, 'Tom Clancy\'s Rainbow Six Seige', 'Tom Clancy\'s Rainbow Six Siege (often shortened to Rainbow Six Siege) is a tactical shooter video game developed by Ubisoft Montreal and published by Ubisoft. It was released worldwide for Microsoft Windows, PlayStation 4, and Xbox One on December 1, 2015', 'Ubisoft', 9, '2015-12-01', 'Most Played', 'images/r6s.jpg', '', 2),
(18, 'CS:GO', 'Counter-Strike: Global Offensive (CS:GO) is a multiplayer first-person shooter video game developed by Hidden Path Entertainment and Valve Corporation. It is the fourth game in the Counter-Strike series and was released for Microsoft Windows, OS X, Xbox 3', 'Valve Corporation', 6, '2012-08-21', 'Most Played', 'images/csgo.jpg', '', 2);
-- --------------------------------------------------------
--
-- Table structure for table `genres`
--
CREATE TABLE `genres` (
`GenreId` int(11) NOT NULL,
`Genre` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `genres`
--
INSERT INTO `genres` (`GenreId`, `Genre`) VALUES
(1, 'MOBA'),
(2, 'FPS'),
(3, 'RPG'),
(4, 'Sports');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `accountinfo`
--
ALTER TABLE `accountinfo`
ADD PRIMARY KEY (`UserId`);
--
-- Indexes for table `commentinfo`
--
ALTER TABLE `commentinfo`
ADD PRIMARY KEY (`CommentId`),
ADD KEY `CommentId_idx` (`UserId`),
ADD KEY `gameId_idx` (`GameId`);
--
-- Indexes for table `favourites`
--
ALTER TABLE `favourites`
ADD PRIMARY KEY (`FavouritesId`),
ADD KEY `gameId_idx` (`GameId`),
ADD KEY `UserId_idx` (`UserId`);
--
-- Indexes for table `gameinfo`
--
ALTER TABLE `gameinfo`
ADD PRIMARY KEY (`GameId`);
--
-- Indexes for table `genres`
--
ALTER TABLE `genres`
ADD PRIMARY KEY (`GenreId`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `accountinfo`
--
ALTER TABLE `accountinfo`
MODIFY `UserId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `commentinfo`
--
ALTER TABLE `commentinfo`
MODIFY `CommentId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `favourites`
--
ALTER TABLE `favourites`
MODIFY `FavouritesId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT for table `gameinfo`
--
ALTER TABLE `gameinfo`
MODIFY `GameId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `genres`
--
ALTER TABLE `genres`
MODIFY `GenreId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `commentinfo`
--
ALTER TABLE `commentinfo`
ADD CONSTRAINT `GameId` FOREIGN KEY (`GameId`) REFERENCES `gameinfo` (`GameId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `UserId` FOREIGN KEY (`UserId`) REFERENCES `accountinfo` (`UserId`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `favourites`
--
ALTER TABLE `favourites`
ADD CONSTRAINT `GameId3` FOREIGN KEY (`GameId`) REFERENCES `gameinfo` (`GameId`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `UserId4` FOREIGN KEY (`UserId`) REFERENCES `accountinfo` (`UserId`) ON DELETE NO ACTION ON UPDATE NO ACTION;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 3.5.8.1deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Mar 20 Mai 2014 à 18:52
-- Version du serveur: 5.5.34-0ubuntu0.13.04.1
-- Version de PHP: 5.4.9-4ubuntu2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de données: `jee_cookie`
--
-- --------------------------------------------------------
--
-- Structure de la table `Recipe`
--
CREATE TABLE IF NOT EXISTS `Recipe` (
`title` varchar(50) DEFAULT NULL,
`description` varchar(50) DEFAULT NULL,
`expertise` int(11) DEFAULT NULL,
`nbpeople` int(11) DEFAULT NULL,
`duration` int(11) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Contenu de la table `Recipe`
--
INSERT INTO `Recipe` (`title`, `description`, `expertise`, `nbpeople`, `duration`, `type`) VALUES
('Patates', 'Plein de patates au four', 1, 4, 15, 'Patateries'),
('Poisson à la meringue', 'Rien de particulier', 3, 5, 53, 'poissonnerie'),
('Purée', 'Mousline y''a que ca de vrai', 1, 4, 15, 'Patateries'),
('Poisson à la crême', 'Miam', 3, 5, 53, 'poissonnerie'),
('Tomates brulées', 'Le feu ca brûle', 1, 2, 25, 'Dessert'),
('Dinde aux marrons', 'C''est Nauelle', 3, 5, 73, 'gourmandise'),
('Patates encore', 'Plein de patates au feu de bois', 1, 5, 35, 'Patateries'),
('Poisson aux marrons', 'Rien de particulier', 3, 5, 53, 'gourmandise'),
('Roquefort', 'Plus fort que ta mère', 1, 4, 12, 'gourmandise'),
('Poisson au thon ', 'Rien de particulier', 3, 5, 53, 'poissonnerie'),
('Tarte à Tain', 'Plein de patates dans cette tarte', 1, 4, 15, 'Patateries'),
('Tarte à la meringue', 'Rien de particulier mais pas de poisson ici', 3, 15, 53, 'tarte'),
('Tarte aux patates', 'Plein de patates au barbecue', 1, 2, 15, 'Patateries'),
('Une recette originale', 'Rien de bien original', 3, 5, 53, 'osef'),
('Patates', 'Plein de patates au charbon', 1, 2, 85, 'Patateries'),
('Poisson à la sauce blanche', 'Sauce épicée', 3, 5, 23, 'poissonnerie'),
('Patates', 'Plein de patates au four', 1, 4, 15, 'Patateries'),
('Poisson à la meringue', 'Rien de particulier', 3, 5, 53, 'poissonnerie');
-- --------------------------------------------------------
--
-- Structure de la table `User`
--
CREATE TABLE IF NOT EXISTS `User` (
`firstname` varchar(30) DEFAULT NULL,
`lastname` varchar(30) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`login` varchar(30) DEFAULT NULL,
`pwd` varchar(255) DEFAULT NULL,
`email` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Contenu de la table `User`
--
INSERT INTO `User` (`firstname`, `lastname`, `age`, `login`, `pwd`, `email`) VALUES
('baptiste', 'bouchereau', 10, 'babou', 'babou', 'babou@gmail.com'),
('pierre-jean', 'leger', 20, 'pjle', 'pjle', 'pjle@gmail.com');
/*!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 */;
|
drop table title_basics;
drop table title_ratings;
drop table my_ratings;
create table title_basics
(
tconst text,
title_type text,
primary_title text,
original_title text,
is_adult smallint,
start_year int,
end_year int,
runtime_minutes int,
genres text,
constraint title_basics_pk primary key (tconst)
);
create table title_ratings
(
tconst text,
average_rating double precision,
num_votes bigint,
constraint title_ratings_pk primary key (tconst)
);
create table my_ratings
(
tconst text,
rating int,
date_rated date,
title text,
url text,
title_type text,
imdb_rating double precision,
runtime int,
year int,
genres text,
num_votes bigint,
release_date date,
directors text,
constraint title_my_ratings_pk primary key (tconst)
);
\copy title_basics from './title.basics.tsv'with delimiter E'\t' csv header null '\N' quote E'\b';
\copy title_ratings from './title.ratings.tsv'with delimiter E'\t' csv header null '\N' quote E'\b';
\copy my_ratings from './ratings.csv' with csv header null '\N'; |
procedure CREATE_MEMBER_SP (
p_person_ID OUT INTEGER, -- an output parameter
p_person_email IN VARCHAR, -- passed through to CREATE_PERSON_PP
P_person_given_name IN VARCHAR, -- passed through to CREATE_PERSON_PP
p_person_surname IN VARCHAR, -- passed through to CREATE_PERSON_PP
p_person_phone IN VARCHAR, -- passed through to CREATE_PERSON_PP
p_location_country IN VARCHAR, -- passed through to CREATE_LOCATION_PP
p_location_postal_code IN VARCHAR, -- passed through to CREATE_LOCATION_PP
p_location_street1 IN VARCHAR, -- passed through to CREATE_LOCATION_PP
p_location_street2 IN VARCHAR, -- passed through to CREATE_LOCATION_PP
p_location_city IN VARCHAR, -- passed through to CREATE_LOCATION_PP
p_location_administrative_region IN VARCHAR, -- passed through to CREATE_LOCATION_SP
p_member_password IN VARCHAR -- NOT NULL
)
IS
ex_exception EXCEPTION;
ex_error_msg VARCHAR (200);
person_id_out NUMBER;
location_id_out NUMBER;
BEGIN
IF p_member_password IS NULL THEN
ex_error_msg := 'Missing password! Can not be NULL';
RAISE ex_exception;
ELSE
CREATE_PERSON_SP (
person_id_out,
p_person_email,
p_person_given_name,
p_person_surname,
p_person_phone
);
CREATE_LOCATION_SP (
location_id_out,
p_location_country,
p_location_postal_code,
p_location_street1,
p_location_street2,
p_location_city,
p_location_administrative_region
);
INSERT INTO VM_MEMBER
VALUES (
person_id_out,
p_member_password,
location_id_out
);
COMMIT;
DBMS_OUTPUT.PUT_LINE('Member added with person ID: ' || person_id_out || ' and location ID: ' || location_id_out);
END IF;
EXCEPTION
WHEN ex_exception THEN
DBMS_OUTPUT.PUT_LINE(ex_error_msg);
ROLLBACK;
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('An error occured inserting new member!');
dbms_output.put_line('Error code: ' || sqlcode);
dbms_output.put_line('Error message: ' || sqlerrm);
ROLLBACK;
END; |
create table message(message_id integer,contents text,usermoto_id text,usersaki_id text,group_id text);
create table gru(gru_id text,gruname text);
create table note(note_id text,contents text,user_id text,datatime text);
create table album(album_id text,user_id text,group_id text);
create table photo(photo_id text,user_id text,album_id text);
create table user(user_id text,phonenumber integer,username text,mailadress text);
create table read(message_id integer,user_id text);
create table belong(group_id text,user_id text);
create table append(usermoto_id text,usersaki_id text);
create table call(usermoto_id text,usersaki_id text,datatime text);
insert into message values(1,'ありがとう','kane_1','arisa_1','NULL');
insert into message values(2,'お誕生日おめだとう','arisa_2','kotono_3','NULL');
insert into message values(3,'早く元気になってね','arisa_2','kana_1','NULL');
insert into message values(4,'皆に会いたいな','kotono_3','NULL','ばなな_3');
insert into group values('りんご_1','りんご');
insert into group values('いちご_2','いちご');
insert into group values('ばなな_3','ばなな');
insert into note values('note_1','予定調整','kotono_3','2018/1/1');
insert into note values('note_2','夜ごはん','kana_1','2019/2/2');
insert into note values('note_3','ケーキ練の連絡','arisa_2','2019/10/10');
insert into album values('album_1','kana_1','いちご_2');
insert into album values('album_2','arisa_2','りんご_1');
insert into album values('album_3','kotono_3','ばなな_3');
insert into photo values('photo_1','kotono_3','album_3');
insert into photo values('photo_2','kana_1','album_1');
insert into photo values('photo_3','arisa_2','album_2');
insert into user values('kana_1',08011111111,'かな','kana0125@gmai.com');
insert into user values('arisa_2',080222222222,'ありさ','arisa0328@gmai.com');
insert into user values('kotono_3',08033333333,'ことの','kotono1203@gmai.com');
insert read values(1,'arisa_2');
insert read values(2,'kotono_3');
insert read values(3,'kana_1');
insert belong values('りんご_1','arisa_2');
insert belong values('いちご_2','kana_1');
insert belong values('ばなな_3','kotono_3');
insert add values('arisa_2','kana_1');
insert add values('kotono_3','arisa_2');
insert add values('kana_1','kotono_3');
insert call values('kana_1','kotono_3','2018/3/3');
insert call values('arisa_2','kana_1','2017/3/3');
insert call values('kotono_3','arisa_2','2013/2/1');
|
SELECT act.col_id AS Id,
evnt.col_slaeventdict_tasksystype AS TaskType_Id,
act.col_slaaction_slaeventlevel AS SLAEventLevel_Id,
dict_evntlvl.col_name AS SLAEventLevel_Name,
evnt.col_slaevent_dateeventtype AS DateEventLevel_Id,
dict_dateevnttype.col_name AS DateEventLevel_Name,
evnt.col_slaeventdict_slaeventtype AS SLAEventType_Id,
dict_evnttype.col_name AS SLAEventType_Name,
evnt.col_maxattempts AS MaxAttempts,
EXTRACT(SECOND FROM TO_DSINTERVAL(evnt.col_intervalds)) AS Seconds,
EXTRACT(MINUTE FROM TO_DSINTERVAL(evnt.col_intervalds)) AS Minutes,
EXTRACT(HOUR FROM TO_DSINTERVAL(evnt.col_intervalds)) AS Hours,
EXTRACT(DAY FROM TO_DSINTERVAL(evnt.col_intervalds)) AS Days,
EXTRACT(MONTH FROM TO_YMINTERVAL(evnt.col_intervalym)) AS Months,
act.col_description AS Description,
act.col_processorcode AS ProcessorCode,
t1.ParamCodes AS ParamCodes,
t1.ParamValues AS ParamValues,
f_getNameFromAccessSubject(act.col_createdBy) AS CreatedBy_Name,
f_UTIL_getDrtnFrmNow(act.col_createdDate) AS CreatedDuration,
f_getNameFromAccessSubject(act.col_modifiedBy) AS ModifiedBy_Name,
f_UTIL_getDrtnFrmNow(act.col_modifiedDate) AS ModifiedDuration
FROM TBL_SLAACTION act
INNER JOIN TBL_SLAEVENT evnt ON evnt.col_id = act.col_slaactionslaevent
LEFT JOIN TBL_DICT_SLAEVENTLEVEL dict_evntlvl ON dict_evntlvl.col_id = act.col_slaaction_slaeventlevel
LEFT JOIN TBL_DICT_DATEEVENTTYPE dict_dateevnttype ON dict_dateevnttype.col_id = evnt.col_slaevent_dateeventtype
LEFT JOIN TBL_DICT_SLAEVENTTYPE dict_evnttype ON dict_evnttype.col_id = evnt.col_slaeventdict_slaeventtype
LEFT JOIN (SELECT a.col_id,
LISTAGG(TO_CHAR(ap.col_paramcode), '|||') WITHIN GROUP(ORDER BY ap.col_paramcode) AS ParamCodes,
LISTAGG(TO_CHAR(ap.col_paramvalue), '|||') WITHIN GROUP(ORDER BY ap.col_paramvalue) AS ParamValues
FROM TBL_AUTORULEPARAMETER ap
INNER JOIN TBL_SLAACTION a
ON ap.col_autoruleparamslaaction = a.col_id
GROUP BY a.col_id) t1
ON t1.col_id = act.col_id
WHERE (:TaskType_Id IS NULL OR (:TaskType_Id IS NOT NULL AND evnt.col_slaeventdict_tasksystype = :TaskType_Id)) |
DROP TABLE IF EXISTS DIM_BANK;
CREATE TABLE DIM_BANK
(
BANK_ID VARCHAR(50) DEFAULT 0 NOT NULL,
SRC_BANK_ID VARCHAR(50),
BANK_CODE VARCHAR(10),
BANK_NAME VARCHAR(100),
BANK_ACCOUNT_NUMBER VARCHAR(50),
BANK_CURRENCY_CODE VARCHAR(50),
BANK_CHECK_DIGITS INTEGER,
LOAD_DATE VARCHAR(10),
LOAD_ID INTEGER,
CONSTRAINT BANK_ID_DIM__PK PRIMARY KEY(BANK_ID)
);
|
SELECT ICR.LgcyInvestorId
,ICR.LgcyPersonId
,ICR.ContRole
,ICR.ContRank
,ICP.FirstName
,ICP.LastName
,ICP.Gender
,ICS.SpecCat
,ICS.SpecCode
FROM Own2InvContReln ICR
LEFT JOIN Own2InvContProf ICP
ON ICR.LgcyPersonId = ICP.LgcyPersonId
LEFT JOIN Own2InvContSpec ICS
ON ICR.LgcyPersonId = ICS.LgcyPersonId
WHERE ICS.SpecCat != 2
AND ICR.LgcyInvestorId IN
(SELECT OM.LGCYINVESTORID
FROM OWN2OWNERMAP OM
LEFT JOIN RDCINSTRINFO RR
ON RR.GEMPERMID=OM.INSTRID --OWN2 MAPPING
LEFT JOIN OWN2CHOLDDET P -- RETURNS THE CONSOLIDATED HOLDINGS
ON P.OWNERSHIPID=OM.OWNERSHIPID
AND P.HOLDDATE >='2016-06-30' --GIVEN MONTH END
AND P.HOLDDATE <='2020-06-30'
AND P.FILINGTYPECODE = 1 -- 13F
WHERE P.PCTSHOUTHLD IS NOT NULL AND P.PCTSHOUTHLD<>0) |
--
-- Dumping data for table `channelconfig`
--
-- This configuration is not ncessary when running a single channel, so we'll
-- leave it out.
-- INSERT IGNORE INTO `channelconfig` (`channelconfigid`, `channelid`, `name`, `value`) VALUES
-- (1, 2, 'channel.net.port', '7576'),
-- (2, 3, 'channel.net.port', '7577'); |
begin
DBMS_MONITOR.serv_mod_act_trace_disable (
service_name=>'SYS$USERS',
module_name=>'RK_RUNSTAT',
action_name=>'&1'
);
end;
/
|
CREATE TABLE Job (
id bigserial PRIMARY KEY,
external_name VARCHAR(500) not null,
raw_json TEXT not null
);
|
DELETE FROM `wp_attribute` WHERE `model_name`='vote';
DELETE FROM `wp_model` WHERE `name`='vote' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_vote`;
DELETE FROM `wp_attribute` WHERE `model_name`='vote_log';
DELETE FROM `wp_model` WHERE `name`='vote_log' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_vote_log`;
DELETE FROM `wp_attribute` WHERE `model_name`='vote_option';
DELETE FROM `wp_model` WHERE `name`='vote_option' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_vote_option`;
DELETE FROM `wp_attribute` WHERE `model_name`='shop_vote';
DELETE FROM `wp_model` WHERE `name`='shop_vote' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_shop_vote`;
DELETE FROM `wp_attribute` WHERE `model_name`='shop_vote_option';
DELETE FROM `wp_model` WHERE `name`='shop_vote_option' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_shop_vote_option`;
DELETE FROM `wp_attribute` WHERE `model_name`='shop_vote_log';
DELETE FROM `wp_model` WHERE `name`='shop_vote_log' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_shop_vote_log`;
|
USE employees;
-- 1. WRITE a QUERY that RETURNS ALL employees (emp_no), their department number, their START DATE, their END DATE, AND a NEW COLUMN 'is_current_employee' that IS a 1 IF the employee IS still WITH the company AND 0 IF not.
SELECT emp_no,
dept_no,
from_date,
to_date
FROM dept_no
CASE
IF(to_date = '%9999%', TRUE, FALSE) AS current_employee
FROM dept_emp;
SELECT
de.emp_no,
dept_no,
de.from_date,
de.to_date,
CASE
WHEN de.to_date = '9999-01-01' THEN 1
ELSE 0
END AS is_current_employee
FROM dept_emp AS de
JOIN salaries ON de.emp_no = salaries.emp_no
AND salaries.to_date = '9999-01-01';
SELECT
emp_no,
dept_no,
from_date,
to_date,
IF(to_date = '9999-01-01', 1, 0) AS is_current_employee
FROM dept_emp;
-- 2. WRITE a QUERY that RETURNS ALL employee NAMES (previous AND current), AND a NEW COLUMN 'alpha_group' that RETURNS 'A-H', 'I-Q', OR 'R-Z' depending ON the FIRST letter of their LAST name.
SELECT concat(first_name, ' ', last_name) AS employee_name,
CASE
WHEN last_name BETWEEN 'A%' AND 'I%' THEN 'A-H'
WHEN last_name BETWEEN 'I%' AND 'R%' THEN 'I-Q'
else 'R-Z'
END AS alpha_group
FROM employees;
SELECT concat(first_name, ' ', last_name) AS employee_name,
CASE
WHEN last_name BETWEEN 'A' AND 'I' THEN 'A-H'
WHEN last_name BETWEEN 'I' AND 'R' THEN 'I-Q'
ELSE 'R-Z'
END AS alpha_group
FROM employees;
-- 3. How many employees (current OR previous) were born IN EACH decade?
SELECT count(*),
CASE
WHEN birth_date LIKE '195%' THEN 'born_in_50s'
WHEN birth_date LIKE '196%' THEN 'born_in_60s'
END AS decades
FROM employees
GROUP BY decades;
|
-- Delete data from npc_trainer (not using it anymore)
DELETE FROM `npc_trainer` WHERE (`ID` = 136061);
DELETE FROM `creature_trainer` WHERE `CreatureId` = '136061';
INSERT INTO `creature_trainer`(`CreatureId`, `TrainerId`, `MenuId`, `OptionIndex`) VALUES (136061, 1001, 22797, 0);
-- Define trainer
DELETE FROM `trainer` WHERE `Id` = '1001';
INSERT INTO `trainer`(`Id`, `Type`, `Greeting`, `VerifiedBuild`) VALUES (1001, 2, 'Welcome!', 35662);
-- DELETE old spells (there should be none since this is a new trainer id).
DELETE FROM `trainer_spell` WHERE `TrainerId` = '1001';
INSERT INTO `trainer_spell` (`TrainerId`, `SpellId`, `MoneyCost`, `ReqSkillLine`, `ReqSkillRank`, `ReqLevel`) VALUES
('1001', '8613', '10', '0', '0', '0'),
('1001', '257146', '10', '2557', '1', '0'),
('1001', '257149', '10', '2557', '1', '0'),
('1001', '257152', '10', '2557', '1', '0'),
('1001', '265870', '10', '393', '1', '0');
-- Delete data from npc_trainer (not using it anymore)
DELETE FROM `npc_trainer` WHERE (`ID` = 122699);
DELETE FROM `creature_trainer` WHERE `CreatureId` = '122699';
INSERT INTO `creature_trainer`(`CreatureId`, `TrainerId`, `MenuId`, `OptionIndex`) VALUES (122699, 1002, 23355, 0);
-- Define trainer
DELETE FROM `trainer` WHERE `Id` = '1002';
INSERT INTO `trainer`(`Id`, `Type`, `Greeting`, `VerifiedBuild`) VALUES (1002, 2, 'Welcome!', 35662);
-- DELETE old spells (there should be none since this is a new trainer id).
DELETE FROM `trainer_spell` WHERE `TrainerId` = '1002';
INSERT INTO `trainer_spell` (`TrainerId`, `SpellId`, `MoneyCost`, `ReqSkillLine`, `ReqSkillRank`, `ReqLevel`) VALUES
('1002', '8613', '10', '0', '0', '0'),
('1002', '257146', '10', '2557', '1', '0'),
('1002', '257149', '10', '2557', '1', '0'),
('1002', '257152', '10', '2557', '1', '0'),
('1002', '265872', '10', '393', '1', '0');
|
Use Libreria2017
--1)
Select f.nro_factura 'Factura nro', year(fecha) 'Año', sum(cantidad*pre_unitario) 'Importe total',
nom_vendedor +' '+ ape_vendedor 'Vendedor', nom_cliente +' '+ ape_cliente 'Cliente'
from facturas f join detalle_facturas d on d.nro_factura = f.nro_factura
join clientes c on c.cod_cliente = f.cod_cliente
join vendedores v on v.cod_vendedor = f.cod_vendedor
where year(fecha) in (2006, 2007, 2009, 2012)
group by f.nro_factura, nom_vendedor, ape_vendedor, nom_cliente, ape_cliente, year(fecha)
--2)
Select f.nro_factura 'Factura nro', Convert(varchar(12), fecha) 'Fecha',
Descripcion, Cantidad, cantidad*d.pre_unitario 'Importe', nom_cliente+' '+ ape_cliente 'Cliente',
nom_vendedor+' '+ape_vendedor 'Vendedor'
from facturas f join detalle_facturas d on f.nro_factura = d.nro_factura
join articulos a on a.cod_articulo = d.cod_articulo
join clientes c on c.cod_cliente = f.cod_cliente
join vendedores v on v.cod_vendedor = f.cod_vendedor
where abs(datediff(month, getdate(), fecha)) = 2 --Mas sencillo!
--Month(fecha) = Month(DateAdd(month, -1, GetDate()))
-- and Year(fecha) = Year(DateAdd(month, -1, GetDate()))
--3)
Select v.cod_vendedor 'Codigo',nom_vendedor +' '+ ape_vendedor 'Vendedor',
f.nro_factura 'Factura nro', Convert(varchar(12),fecha)'Fecha'
from Facturas f Right Join Vendedores v on v.cod_vendedor = f.cod_vendedor
and year(fecha) = year(getDate())
--4)
Select Descripcion, Cantidad, cantidad*d.pre_unitario 'Importe'
from detalle_facturas d Right Join articulos a on a.cod_articulo = d.cod_articulo
--5)
Select f.nro_factura 'Factura nro', convert(varchar(12), fecha)'Fecha',
d.pre_unitario*cantidad 'Importe total', Descripcion, Cantidad,
nom_vendedor+' '+ape_vendedor 'Vendedor',
nom_cliente+' '+ape_cliente 'Cliente'
from detalle_facturas d join facturas f on d.nro_factura = f.nro_factura
join clientes c on c.cod_cliente = f.cod_cliente
join vendedores v on v.cod_vendedor = f.cod_vendedor
join articulos a on a.cod_articulo = d.cod_articulo
where month(fecha) in (2,3) and year(fecha) in (2006,2007)
and descripcion like '[a-m]%'
order by fecha, nom_cliente, ape_cliente, descripcion
--6)
Select c.cod_cliente 'Codigo de cliente', nom_cliente+' '+ape_cliente 'Cliente',
Convert(varchar(12), Fecha)'Fecha', nro_factura 'Factura nro'
from clientes c left join facturas f on f.cod_cliente = c.cod_cliente
where year(fecha) = 2007
--7)
Select Descripcion, Observaciones, Sum(Cantidad) 'Cantidad', Sum(d.pre_unitario*Cantidad) 'Importe'
from articulos a join detalle_facturas d on a.cod_articulo = d.cod_articulo
join facturas f on f.nro_factura = d.nro_factura
join clientes c on c.cod_cliente = f.cod_cliente
where nom_cliente like 'Elvira%' and ape_cliente like 'Luque'
and year(fecha) = year(getdate())
Group by Descripcion, observaciones
--8)
Select nom_cliente+' '+ape_cliente 'Cliente', Descripcion 'Articulo',
Cantidad, cantidad*d.pre_unitario 'Importe'
From Clientes c join facturas f on c.cod_cliente = f.cod_cliente
join detalle_facturas d on d.nro_factura = f.nro_factura
join articulos a on a.cod_articulo = d.cod_articulo
where ape_cliente like '%p'
order by nom_cliente, ape_cliente, descripcion desc
--9)
Select Distinct Descripcion
from articulos a join detalle_facturas d on d.cod_articulo = a.cod_articulo
join facturas f on f.nro_factura = d.nro_factura
join vendedores v on f.cod_vendedor = v.cod_vendedor
where ape_vendedor in('Ledesma','Mariela')
or (ape_vendedor = 'López' and nom_vendedor = 'Alejandro')
--10)
Select Distinct nom_cliente+' '+ape_cliente 'Cliente', year(fecha) 'Año de compra'
from clientes c left join facturas f on c.cod_cliente = f.cod_cliente
|
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-12-2015 a las 13:58:02
-- Versión del servidor: 5.6.20
-- Versión de PHP: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de datos: `foro3`
--
CREATE DATABASE IF NOT EXISTS `foro3` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci;
USE `foro3`;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `foreros`
--
DROP TABLE IF EXISTS `foreros`;
CREATE TABLE IF NOT EXISTS `foreros` (
`login` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`password` varchar(100) COLLATE utf8_spanish_ci NOT NULL,
`email` varchar(50) COLLATE utf8_spanish_ci NOT NULL,
`bloqueado` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;
--
-- Volcado de datos para la tabla `foreros`
--
INSERT INTO `foreros` (`login`, `password`, `email`, `bloqueado`) VALUES
('usu1', '$1$Dg5.QS0.$jn69c/DGOL4.I7wNr1QqI0', 'usuario1@gmail.com', 0),
('usu2', '$1$1.2..i3.$t88.rn7imzbSr/3sQ8e.x/', 'usuario2@gmail.com', 0);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `mensajes`
--
DROP TABLE IF EXISTS `mensajes`;
CREATE TABLE IF NOT EXISTS `mensajes` (
`id_mensaje` int(11) NOT NULL,
`autor` varchar(20) COLLATE utf8_spanish_ci NOT NULL,
`contenido` varchar(500) COLLATE utf8_spanish_ci NOT NULL,
`fecha` date NOT NULL,
`privado` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1 ;
--
-- RELACIONES PARA LA TABLA `mensajes`:
-- `autor`
-- `foreros` -> `login`
--
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `foreros`
--
ALTER TABLE `foreros`
ADD PRIMARY KEY (`login`);
--
-- Indices de la tabla `mensajes`
--
ALTER TABLE `mensajes`
ADD PRIMARY KEY (`id_mensaje`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `mensajes`
--
ALTER TABLE `mensajes`
MODIFY `id_mensaje` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
#4 - Media de idade de casos confirmados por estado
select d.Estado_sigla,
min(b.nu_idade) as min_idade,
avg(b.nu_idade) as med_idade,
max(b.nu_idade) as max_idade,
count(a.id_registro) as total_casos
from registro as a
left join pessoa as b
on a.Pessoa_id_pessoa =b.id_pessoa
left join unidade as c
on a.unidade_id_unidade_saude=c.id_unidade_saude
left join municipio as d
on c.Municipio_codigo1=d.codigo
where a.classificacao=5
group by d.Estado_sigla
order by d.Estado_sigla |
DROP TABLE UsersToPOIs
DROP TABLE SecurityQuestions
DROP TABLE POIsToReview
DROP TABLE Reviews
DROP TABLE Users
DROP TABLE POIs
DROP TABLE Categories
CREATE TABLE Users
(
userName varchar(10) primary key not null,
CONSTRAINT userNameLength CHECK (DATALENGTH(userName) >= 3 and DATALENGTH(userName) <= 8),
pass varchar(10) not null,
CONSTRAINT passLength CHECK (DATALENGTH(pass) >= 5 and DATALENGTH(pass) <= 10),
fName varchar(50) not null,
CONSTRAINT fname CHECK(fName not like '%[^a-zA-Z]%'),
lName varchar(50) not null,
CONSTRAINT lName CHECK(lName not like '%[^a-zA-Z]%'),
city varchar(50) not null,
country varchar(50) not null,
email varchar(50) not null,
CONSTRAINT email CHECK(email like '%@%' and email like '%.%'),
UNIQUE (userName)
);
CREATE TABLE Categories
(
categoryName nvarchar(50) primary key not null,
UNIQUE (categoryName)
);
CREATE TABLE POIs
(
poiName varchar(50) primary key not null,
CONSTRAINT name CHECK(poiName not like '%[^a-zA-Z]%'),
image varbinary(max),
viewsNum integer DEFAULT 0,
lastReviewID integer DEFAULT -1,
beforeLastReviewID integer DEFAULT -1,
poiRank float DEFAULT 0,
categoryName nvarchar(50) foreign key references Categories(categoryName) ON UPDATE CASCADE ON DELETE no action,
UNIQUE (poiName)
);
CREATE TABLE UsersToPOIs
(
primary key CLUSTERED ( userName, poiName ),
userName varchar(10) foreign key references Users(userName) ON UPDATE CASCADE ON DELETE no action,
poiName varchar(50) foreign key references POIs(poiName) ON UPDATE CASCADE ON DELETE no action,
isFavourite BIT DEFAULT 0
);
CREATE TABLE UsersToCategories(
primary key CLUSTERED ( userName, categoryName ),
userName varchar(10) foreign key references Users(userName) ON UPDATE CASCADE ON DELETE no action,
categoryName nvarchar(50) foreign key references Categories(categoryName) ON UPDATE CASCADE ON DELETE no action,
);
CREATE TABLE Reviews
(
reviewID integer primary key not null IDENTITY,
poiName varchar(50) not null,
reviewDescription nvarchar(max),
reviewRank integer not null,
CONSTRAINT reviewRank CHECK(reviewRank >= 1 and reviewRank <= 5),
);
CREATE TABLE SecurityQuestions
(
ID integer primary key not null IDENTITY,
userName varchar(10) foreign key references Users(userName) not null,
question nvarchar(100) not null,
answer nvarchar(100) not null,
UNIQUE (ID)
);
CREATE TABLE POIsToReview
(
primary key CLUSTERED ( poiName, reviewID ),
poiName varchar(50) foreign key references POIs(poiName) ON UPDATE CASCADE ON DELETE no action,
reviewID integer foreign key references Reviews(reviewID) ON UPDATE CASCADE ON DELETE no action,
);
INSERT INTO Categories (categoryName)
VALUES ('historic')
INSERT INTO POIs (poiName, image, viewsNum, lastReviewID, beforeLastReviewID, categoryName)
VALUES ('merkazhanegev', NULL , 100, 2, 1, 'historic')
INSERT INTO Users (userName, pass, fName, lName, city, country, email)
VALUES ('chen', 'barvaz','chen', 'yanai', 'beersheva', 'israel', 'chen@gmail.com')
INSERT INTO Users (userName, pass, fName, lName, city, country, email)
VALUES ('nitzan', 'sOOki', 'nitzan', 'maarek', 'beersheva', 'israel', 'nitzan@gmail.com')
INSERT INTO Categories (categoryName)
VALUES ('food')
INSERT INTO POIs (poiName, image, viewsNum, lastReviewID, beforeLastReviewID, categoryName)
VALUES ('abudhabi', NULL , 150, 5, 6, 'food') |
alter user hr identified by hr account unlock; |
INSERT INTO Exercise (name, difficulty, defaultKg, description, equipment, muscle, type)
VALUES('Deadlift',7,40.0,'Pull bar up from the ground','bar','glutes','compound'),
('Hip thrust',5,40.0,'thrust','bench','glutes','compound'),
('Kickbacks body weight',3,0.0,'Lean with hands on a wall and kick one leg back','none','glutes','bodyWeight'),
('Pull down',3,20.0,'pull down','pulldownMachine','lats','compound'),
('Hyperextensions',2,0.0,'hyper extend lying facing down','mat','lats','bodyWeight'),
('Pullover',6,10.0,'pull over','bar','lats','isolation'),
('Cable row',4,15.0,'row','cableRow','back','compound'),
('Band row',3,0.0,'row','band','back','compound'),
('Straight arm pull down',4,10.0,'pull bar down','cableMachine','back','isolation'),
('Shoulder press',6,4.0,'press above head','dumbells','shoulders','compound'),
('Lateral raise',2,1.0,'With arms straight, raise dumbells up to each side','dumbells','shoulders','isolation'),
('Lateral raise body weight',1,0.0,'Lateral raise','none','shoulders','bodyWeight'),
('Military press',7,20.0,'Push bar above head','bar','shoulders','compound'),
('Face pull',4,10.0,'Pull cable towards your face','cableMachine','shoulders','isolation'),
('Bench',5,30.0,'Lie on your back on the bench. Lower bar to your chest and push back up','benchPressRack','chest','compound'),
('Push ups body weight',4,0.0,'push up','none','chest','bodyWeight'),
('Knee push ups',3,0.0,'push up','mat','chest','bodyWeight'),
('Dips body weight',5,0.0,'extend arms','dipsBar','chest','bodyWeight'),
('Nordic hamstrings',4,0.0,'hamstring curl','none','hamstrings','bodyWeight'),
('Leg curl',1,15.0,'curl legs','legCurl','hamstrings','isolation'),
('Leg curl body weight',2,0.0,'Lying leg curls','mat','hamstrings','bodyWeight'),
('Back extension body weight',4,0.0,'extend back','backExtension','hamstrings','bodyWeight'),
('Sit-ups',3,0.0,'sit up','none','abs','bodyWeight'),
('Roll out wheel',4,0.0,'roll out','rolloutWheel','abs','isolation'),
('Plank',3,0.0,'plank','mat','abs','bodyWeight'),
('Bicycle',4,0.0,'Cycle with legs lying on your back','mat','abs','bodyWeight'),
('Pikes gymBall',7,0.0,'Pikes with gymBall','gymBall','abs','isolation'),
('Leg raise',3,0.0,'Raise your legs extended lying on your back; isolation','mat','abs','bodyWeight'),
('Biceps curl',2,4.0,'curl','dumbells','biceps','isolation'),
('Squat',7,20.0,'Ass to the grass, bro','rack','quadriceps','compound'),
('KneeLifts',1,0.0,'Lift knee up alternating left and right','none','quadriceps','bodyWeight'),
('Step up body weight',3,0.0,'Step up on the box using alternating legs','stepBox','quadriceps','bodyWeight'),
('Walking lunges body weight',5,0.0,'lunge walking','none','quadriceps','bodyWeight'),
('One-leg squat body weight',7,0.0,'squat to the ground on one leg. Grap pole and squat back up.','pole','quadriceps','bodyWeight'),
('Bench dips body weight',3,0.0,'extend arms','bench','triceps','bodyWeight'),
('Triceps push down',2,12.5,'push down','cableMachine','triceps','isolation'),
('JM-press',6,10.0,'jm-press','bar','triceps','isolation'); |
DELIMITER ;;
CREATE DEFINER=`navyasaiporanki`@`%` PROCEDURE `getUnansweredQuestions`()
BEGIN
select count(text) as questionCount, text, m.moduleName from
(select count(text) as questionCount, text, module from question q join answer a
on q.id = a.questionId where correctAnswer = 0 group by questionId) as questionList
join module m on
m.moduleId = module
group by module having Max(questionCount);
END |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-08-2018 a las 00:50:48
-- Versión del servidor: 10.1.34-MariaDB
-- Versión de PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `sipe`
--
DELIMITER $$
--
-- Procedimientos
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `actualizar_insumo` (IN `nombre` VARCHAR(50), IN `cantidadMin` FLOAT, IN `idTipo` VARCHAR(15), IN `aunFacturar` VARCHAR(2), IN `comentario` VARCHAR(200), IN `id` VARCHAR(15)) UPDATE insumos SET nombreInsumo=nombre,cantidadMinimaInsumo=cantidadMin,idTipoCantidad=idTipo,facturarInsumo=aunFacturar,descripcionInsumo=comentario WHERE idInsumo=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `actualizar_proveedores` (IN `muni` VARCHAR(15), IN `nombre` VARCHAR(30), IN `direccion` VARCHAR(50), IN `telefono` VARCHAR(20), IN `razon` VARCHAR(50), IN `nit` VARCHAR(20), IN `url` VARCHAR(40), IN `postal` VARCHAR(20), IN `email` VARCHAR(50), IN `fax` VARCHAR(20), IN `contactovend` VARCHAR(20), IN `entrega` VARCHAR(6), IN `obser` VARCHAR(500), IN `id` VARCHAR(15)) NO SQL
UPDATE proveedores set idMunicipio=muni,nombreProveedor=nombre,direccionProveedor=direccion,telefonoProveedor=telefono,razonSocial=razon,nitProveedor=nit,urlProveedor=url,codigoPostal=postal,emailProveedor=email,faxProveedor=fax,contactoVendedor=contactovend,idDia=entrega,observaciones=obser WHERE idProveedor=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `autoCompletar` () select idCliente from clientes$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `buscarCliente` (IN `id` VARCHAR(15)) select * from clientes where idCliente=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `buscarInventario` (IN `identificar` VARCHAR(20), IN `nombre` VARCHAR(20)) select * from productos_marcas where idProductoMarca=identificar or NombreProductoMarca=nombre$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `crearCategoria` (IN `idC` VARCHAR(20), IN `nomC` VARCHAR(20)) insert into categorias values(idC,nomC)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `crearUbicacion` (IN `id` VARCHAR(20), IN `nom` VARCHAR(20), IN `can` VARCHAR(20)) insert into ubicaciones values(id,nom,can)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `devoluciones` (IN `numero` VARCHAR(15), IN `nombre` VARCHAR(20), IN `cantidad` INT(20)) BEGIN
declare a,b,c,d,e,f,g,h varchar(20);
select idUbicacion into a from productos_marcas where idProductoMarca=numero;
select idCategotia into b from productos_marcas where idProductoMarca=numero;
select cantidaProductoMarca into c from productos_marcas where idProductoMarca=numero;
select cantidadExistencia into d from productos_marcas where idProductoMarca=numero;
select valorCompraUnidad into e from productos_marcas where idProductoMarca=numero;
select precio_unidad into f from productos_marcas where idProductoMarca=numero;
select precio_cantidad into g from productos_marcas where idProductoMarca=numero;
select valorCompraMayor into h from productos_marcas where idProductoMarca=numero;
insert into productos_marcas values ((CONCAT(numero,'d')),a,b,nombre,(cantidad),(d-cantidad),(cantidad*f),now(),f,g,(g*cantidad),"Devolucion",default);
end$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Entradas` (IN `id` VARCHAR(20)) select fecha, cantidaProductoMarca,precio_unidad,precio_cantidad,detalles from productos_marcas where NombreProductoMarca=id order by fecha$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ingresarProductosMarca` (IN `idP` VARCHAR(20), IN `idU` VARCHAR(20), IN `idC` VARCHAR(20), IN `nombre` VARCHAR(20), IN `cantidad` INT(20), IN `unidad` INT(20), IN `precio` INT(20)) NO SQL
insert into productos_marcas values(id,idC,idU,nombre,cantidad,(cantidad),(cantidad*unidad),now(),unidad,precio,(cantidad*precio),"Compra",default)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertar_cliente` (IN `id` VARCHAR(15), IN `nombre` VARCHAR(30), IN `apellido` VARCHAR(30), IN `telefono` VARCHAR(20), IN `direccion` VARCHAR(50)) BEGIN
declare identificacion varchar(15) default "";
select idCliente into identificacion from clientes where id=idCliente;
if(identificacion=id) then
Select"El cliente a ingresar ya existe ";
ELSE
insert into clientes values(id,nombre,apellido,telefono,direccion);
end if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertar_insumo` (IN `id` VARCHAR(15), IN `nombre` VARCHAR(30), IN `costo` FLOAT(15), IN `cantidad` FLOAT(15), IN `stock` INT(15), IN `tipoCant` VARCHAR(15), IN `facturarSin` VARCHAR(2), IN `comen` VARCHAR(60)) INSERT INTO insumos(idInsumo,nombreInsumo,costoInsumo,cantidadInsumo,cantidadMinimaInsumo,idTipoCantidad,facturarInsumo,descripcionInsumo) VALUES(id,nombre,costo,cantidad,stock,tipoCant,facturarSin,comen)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertar_proveedor` (IN `id` VARCHAR(15), IN `muni` VARCHAR(20), IN `nombre` VARCHAR(30), IN `direccion` VARCHAR(50), IN `telefono` VARCHAR(20), IN `razon` VARCHAR(50), IN `nit` VARCHAR(20), IN `url` VARCHAR(40), IN `postal` VARCHAR(20), IN `email` VARCHAR(50), IN `fax` VARCHAR(20), IN `contacto` VARCHAR(20), IN `diaEn` VARCHAR(20), IN `obser` VARCHAR(500)) INSERT INTO proveedores(idProveedor,idMunicipio,nombreProveedor,direccionProveedor,telefonoProveedor,razonSocial,nitProveedor,urlProveedor,codigoPostal,emailProveedor,faxProveedor,contactoVendedor,idDia,observaciones) VALUES(id,muni,nombre,direccion,telefono,razon,nit,url,postal,email,fax,contacto,diaEn,obser)$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `llamarCategoria` (IN `id` VARCHAR(20)) select nombreCategoria from categorias where idCategoria=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `llamarUbicacion` (IN `id` VARCHAR(20)) select nombreUbicacion from ubicaciones where idUbicacion=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `modificarDatos` (IN `idc` VARCHAR(15), IN `nombrec` VARCHAR(30), IN `apellidoc` VARCHAR(30), IN `telefonoc` VARCHAR(20), IN `direccionc` VARCHAR(50)) NO SQL
update clientes set idCliente=idc,nombreCliente=nombrec,apellidoCliente=apellidoc,telefonoCliente=telefonoc,direccionCliente=direccionc where idCliente=idc$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `modificarProducto` (IN `nombre` VARCHAR(20), IN `cantidad` VARCHAR(20), IN `unidad` VARCHAR(20), IN `precio` VARCHAR(20), IN `recibo` INT) NO SQL
update productos_marcas set NombreProductoMarca=nombre,cantidaProductoMarca=cantidad,precio_unidad=unidad,precio_cantidad=precio,cantidadExistencia=(cantidadExistencia+cantidad),valorCompraUnidad=(unidad*cantidad),valorCompraMayor=(precio*cantidad) where idProductoMarca=recibo$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `mostrarNombreProducto` (IN `id` VARCHAR(20)) select NombreProductoMarca from productos_marcas where idProductoMarca=id$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `mostrarProductosMarca` () select idProductoMarca,idUbicacion,idCategotia,NombreProductoMarca,CantidaProductoMarca,precio_unidad,precio_cantidad from productos_marcas$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `mostrar_clientes` () Select * from clientes$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `mostrar_vista_insumos` () SELECT * FROM vista_mostrar_insumos$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `mostrar_vista_proveedores` () SELECT idProveedor as Codigo,nombreProveedor as Nombre, nitProveedor as Nit,direccionProveedor as Direccion FROM proveedores_vista$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `seleccioarFactura` () select idProductoMarca from productos_marcas$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `seleccionarcategoria` () select idCategoria from categorias$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `seleccionarProducto` (IN `id` VARCHAR(20)) begin
declare x varchar (20);
select idUbicacion into x from productos_marcas where idProductoMarca=id;
if(x>=1) then
select * from productos_marcas where idProductoMarca=id;
ELSE
select"0";
end if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `seleccionarUbicacion` () select idUbicacion from ubicaciones$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `traer_numero_factura_compra` () BEGIN
DECLARE var int;
DECLARE var2 int DEFAULT 0 ;
SELECT idFacturaCompra into var FROM facturas_de_compras;
IF var>=1 THEN
SELECT idFacturaCompra FROM facturas_de_compras;
ELSE
SELECT var2 ;
END if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validarCategoria` (IN `idC` VARCHAR(20), IN `nomC` VARCHAR(20)) BEGIN
declare c varchar(20);
select idCategoria into c from categorias where idCategoria=idC or nombreCategoria=nomC;
if(c>=1) THEN
select"1";
else
select"0";
end if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validarSeleccion` (IN `id` VARCHAR(20)) begin
declare c varchar(20);
select idProductoMarca into c from productos_marcas where idProductoMarca=id;
if(c>=1)THEN
select"1";
else
select"0";
end if;
end$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validarUbicacion` (IN `id` VARCHAR(20), IN `nom` VARCHAR(20), IN `can` VARCHAR(20)) BEGIN
declare c varchar(20);
select idUbicacion into c from ubicaciones where idUbicacion=id or nombreUbicacion=nom or capacidad=can;
if(c>=1) THEN
select "1";
ELSE
select "0";
end if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validar_idInsumo` (IN `codigo` VARCHAR(20)) BEGIN
DECLARE var int;
DECLARE flag int DEFAULT 0;
SELECT idInsumo into var from insumos WHERE idInsumo=codigo;
IF var=codigo THEN
SELECT flag+1;
ELSE
SELECT flag;
END if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validar_idInsumo_trae_el_nombre_del_insumo` (IN `codigo` VARCHAR(20)) BEGIN
DECLARE var int;
DECLARE flag int DEFAULT 0;
SELECT idInsumo into var from insumos WHERE idInsumo=codigo;
IF var=codigo THEN
SELECT nombreInsumo FROM insumos WHERE idInsumo=codigo ;
ELSE
SELECT flag;
END if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validar_idProveedor` (IN `codigo` INT(15)) BEGIN
DECLARE var int;
DECLARE flag int DEFAULT 0;
SELECT idProveedor into var from proveedores WHERE idProveedor=codigo;
IF var=codigo THEN
SELECT flag+1;
ELSE
SELECT flag;
END if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validar_y_traer_nombre_proveedor_con_id` (IN `codigo` VARCHAR(20)) NO SQL
BEGIN
DECLARE var int;
DECLARE flag int DEFAULT 0;
SELECT idProveedor into var from proveedores WHERE idProveedor=codigo;
IF var=codigo THEN
SELECT nombreProveedor,nitProveedor from proveedores WHERE idProveedor=var;
ELSE
SELECT flag;
END if;
END$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `valida_cliente` (IN `id` VARCHAR(15)) BEGIN
declare v varchar(20) default "";
select idCliente into v from clientes where id=idCliente;
if(id=v)THEN
select"1";
ELSE
select"0";
end if;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `bodega`
--
CREATE TABLE `bodega` (
`idBodega` varchar(20) COLLATE utf8_bin NOT NULL,
`nombreBodega` varchar(20) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `bodega`
--
INSERT INTO `bodega` (`idBodega`, `nombreBodega`) VALUES
('1', 'INVENTARIO'),
('2', 'COCINA');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categorias`
--
CREATE TABLE `categorias` (
`idCategoria` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreCategoria` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `categorias`
--
INSERT INTO `categorias` (`idCategoria`, `nombreCategoria`) VALUES
('1222', 'frituras'),
('123', 'solido'),
('125', 'liquido'),
('254', 'géÑerico');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `clientes`
--
CREATE TABLE `clientes` (
`idCliente` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreCliente` varchar(30) COLLATE utf8_bin NOT NULL,
`apellidoCliente` varchar(30) COLLATE utf8_bin NOT NULL,
`telefonoCliente` varchar(20) COLLATE utf8_bin NOT NULL,
`direccionCliente` varchar(50) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `clientes`
--
INSERT INTO `clientes` (`idCliente`, `nombreCliente`, `apellidoCliente`, `telefonoCliente`, `direccionCliente`) VALUES
('112188477', 'uriel', 'ramos', '43524', 'cierto'),
('1121884776', 'fernando', 'parrado', '12345', 'calle38a');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `departamentos`
--
CREATE TABLE `departamentos` (
`idDepartamento` int(11) NOT NULL,
`nombreDepartamento` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `departamentos`
--
INSERT INTO `departamentos` (`idDepartamento`, `nombreDepartamento`) VALUES
(0, 'NINGUNO'),
(5, 'ANTIOQUIA'),
(8, 'ATLANTICO'),
(11, 'BOGOTA'),
(13, 'BOLIVAR'),
(15, 'BOYACA'),
(17, 'CALDAS'),
(18, 'CAQUETA'),
(19, 'CAUCA'),
(20, 'CESAR'),
(23, 'CORDOBA'),
(25, 'CUNDINAMARCA'),
(27, 'CHOCO'),
(41, 'HUILA'),
(44, 'LA GUAJIRA'),
(47, 'MAGDALENA'),
(50, 'META'),
(52, 'NARIÑO'),
(54, 'N. DE SANTANDER'),
(63, 'QUINDIO'),
(66, 'RISARALDA'),
(68, 'SANTANDER'),
(70, 'SUCRE'),
(73, 'TOLIMA'),
(76, 'VALLE DEL CAUCA'),
(81, 'ARAUCA'),
(85, 'CASANARE'),
(86, 'PUTUMAYO'),
(88, 'SAN ANDRES'),
(91, 'AMAZONAS'),
(94, 'GUAINIA'),
(95, 'GUAVIARE'),
(97, 'VAUPES'),
(99, 'VICHADA');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalles_compras`
--
CREATE TABLE `detalles_compras` (
`idDetalleCompra` int(11) NOT NULL,
`idFacturaCompra` int(11) NOT NULL,
`IdProductoMarca` varchar(15) COLLATE utf8_bin NOT NULL,
`idTipoCantidad` varchar(15) COLLATE utf8_bin NOT NULL,
`cantidad` float NOT NULL,
`subtotal` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalles_compras_insumos`
--
CREATE TABLE `detalles_compras_insumos` (
`idDetalleCompraInsumo` int(11) NOT NULL,
`idInsumo` varchar(15) COLLATE utf8_bin NOT NULL,
`idFacturaCompra` int(11) NOT NULL,
`idTipoCantidad` varchar(15) COLLATE utf8_bin NOT NULL,
`cantidad` int(11) NOT NULL,
`subtotal` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalles_recetas`
--
CREATE TABLE `detalles_recetas` (
`idDetalleReceta` int(11) NOT NULL,
`idInsumo` varchar(15) COLLATE utf8_bin NOT NULL,
`idReceta` varchar(15) COLLATE utf8_bin NOT NULL,
`idTipoCantidad` varchar(15) COLLATE utf8_bin NOT NULL,
`cantidadInsumoUtilizado` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `detalles_ventas`
--
CREATE TABLE `detalles_ventas` (
`idDetalleVenta` int(11) NOT NULL,
`idFacturaVenta` int(11) NOT NULL,
`idTipoProductoVenta` int(11) NOT NULL,
`cantidad` int(11) NOT NULL,
`subtotal` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `dias`
--
CREATE TABLE `dias` (
`idDia` varchar(6) COLLATE utf8_bin NOT NULL,
`nombreDia` varchar(20) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `dias`
--
INSERT INTO `dias` (`idDia`, `nombreDia`) VALUES
('0', 'NINGUNO'),
('1', 'LUNES'),
('2', 'MARTES'),
('3', 'MIERCOLES'),
('4', 'JUEVES'),
('5', 'VIERNES'),
('6', 'SABADO'),
('7', 'DOMINGO');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `facturas_de_compras`
--
CREATE TABLE `facturas_de_compras` (
`idFacturaCompra` int(11) NOT NULL,
`idDetalleCompra` int(11) NOT NULL,
`idDetalleCompraInsumo` int(11) NOT NULL,
`idProveedor` varchar(15) COLLATE utf8_bin NOT NULL,
`idTipoCompra` varchar(15) COLLATE utf8_bin NOT NULL,
`fechaCompra` datetime NOT NULL,
`valorTotal` float NOT NULL,
`idBodega` varchar(20) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `factura_ventas`
--
CREATE TABLE `factura_ventas` (
`idFacturaVenta` int(11) NOT NULL,
`idCliente` varchar(15) COLLATE utf8_bin NOT NULL,
`IdVendedor` varchar(15) COLLATE utf8_bin NOT NULL,
`idTipoDePago` varchar(15) COLLATE utf8_bin NOT NULL,
`fechaVenta` datetime NOT NULL,
`valorVenta` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `insumos`
--
CREATE TABLE `insumos` (
`idInsumo` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreInsumo` varchar(50) COLLATE utf8_bin NOT NULL,
`costoInsumo` float NOT NULL,
`cantidadInsumo` float DEFAULT NULL,
`cantidadMinimaInsumo` float DEFAULT NULL,
`idTipoCantidad` varchar(15) COLLATE utf8_bin NOT NULL,
`facturarInsumo` varchar(2) COLLATE utf8_bin NOT NULL,
`descripcionInsumo` varchar(200) COLLATE utf8_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `insumos`
--
INSERT INTO `insumos` (`idInsumo`, `nombreInsumo`, `costoInsumo`, `cantidadInsumo`, `cantidadMinimaInsumo`, `idTipoCantidad`, `facturarInsumo`, `descripcionInsumo`) VALUES
('1102', 'SAL', 1300, 500, 2000, '2', 'SI', 'SAL'),
('1103', 'CARNE', 7000, 1000, 2000, '2', 'SI', 'CARNE'),
('1105', 'TOMATE', 200, 20, 2000, '2', 'SI', 'TOMATE'),
('1106', 'PEPINO', 800, 2000, 2000, '2', 'SI', 'PEPINO'),
('1107', 'CEBOLLA ', 1000, 1000, 2000, '2', 'SI', 'CEBOLLA'),
('1108', 'AZUCAR', 500, 2000, 2000, '2', 'SI', 'AZUCAR'),
('1109', 'AJO', 8000, 24000, 2000, '2', 'SI', 'AJO'),
('1110', 'MASA', 800, 2000, 2000, '1', 'SI', 'MASA');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `municipios`
--
CREATE TABLE `municipios` (
`idMunicipio` varchar(20) COLLATE utf8_bin NOT NULL,
`idDepartamento` int(11) NOT NULL,
`nombreMunicipio` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `municipios`
--
INSERT INTO `municipios` (`idMunicipio`, `idDepartamento`, `nombreMunicipio`) VALUES
('0', 0, 'NINGUNO'),
('1', 5, 'MEDELLIN'),
('10', 5, 'ANORI'),
('100', 5, 'SAN VICENTE'),
('1000', 73, 'VALLE DE SAN JUAN'),
('1001', 73, 'VENADILLO'),
('1002', 73, 'VILLAHERMOSA'),
('1003', 73, 'VILLARRICA'),
('1004', 76, 'CALI'),
('1005', 76, 'ALCALA'),
('1006', 76, 'ANDALUCIA'),
('1007', 76, 'ANSERMANUEVO'),
('1008', 76, 'ARGELIA'),
('1009', 76, 'BOLIVAR'),
('101', 5, 'SANTA BARBARA'),
('1010', 76, 'BUENAVENTURA'),
('1011', 76, 'GUADALAJARA DE BUGA'),
('1012', 76, 'BUGALAGRANDE'),
('1013', 76, 'CAICEDONIA'),
('1014', 76, 'CALIMA'),
('1015', 76, 'CANDELARIA'),
('1016', 76, 'CARTAGO'),
('1017', 76, 'DAGUA'),
('1018', 76, 'EL AGUILA'),
('1019', 76, 'EL CAIRO'),
('102', 5, 'SANTA ROSA DE OSOS'),
('1020', 76, 'EL CERRITO'),
('1021', 76, 'EL DOVIO'),
('1022', 76, 'FLORIDA'),
('1023', 76, 'GINEBRA'),
('1024', 76, 'GUACARI'),
('1025', 76, 'JAMUNDI'),
('1026', 76, 'LA CUMBRE'),
('1027', 76, 'LA UNION'),
('1028', 76, 'LA VICTORIA'),
('1029', 76, 'OBANDO'),
('103', 5, 'SANTO DOMINGO'),
('1030', 76, 'PALMIRA'),
('1031', 76, 'PRADERA'),
('1032', 76, 'RESTREPO'),
('1033', 76, 'RIOFRIO'),
('1034', 76, 'ROLDANILLO'),
('1035', 76, 'SAN PEDRO'),
('1036', 76, 'SEVILLA'),
('1037', 76, 'TORO'),
('1038', 76, 'TRUJILLO'),
('1039', 76, 'TULUA'),
('104', 5, 'EL SANTUARIO'),
('1040', 76, 'ULLOA'),
('1041', 76, 'VERSALLES'),
('1042', 76, 'VIJES'),
('1043', 76, 'YOTOCO'),
('1044', 76, 'YUMBO'),
('1045', 76, 'ZARZAL'),
('1046', 81, 'ARAUCA'),
('1047', 81, 'ARAUQUITA'),
('1048', 81, 'CRAVO NORTE'),
('1049', 81, 'FORTUL'),
('105', 5, 'SEGOVIA'),
('1050', 81, 'PUERTO RONDON'),
('1051', 81, 'SARAVENA'),
('1052', 81, 'TAME'),
('1053', 85, 'YOPAL'),
('1054', 85, 'AGUAZUL'),
('1055', 85, 'CHAMEZA'),
('1056', 85, 'HATO COROZAL'),
('1057', 85, 'LA SALINA'),
('1058', 85, 'MANI'),
('1059', 85, 'MONTERREY'),
('106', 5, 'SONSON'),
('1060', 85, 'NUNCHIA'),
('1061', 85, 'OROCUE'),
('1062', 85, 'PAZ DE ARIPORO'),
('1063', 85, 'PORE'),
('1064', 85, 'RECETOR'),
('1065', 85, 'SABANALARGA'),
('1066', 85, 'SACAMA'),
('1067', 85, 'SAN LUIS DE PALENQUE'),
('1068', 85, 'TAMARA'),
('1069', 85, 'TAURAMENA'),
('107', 5, 'SOPETRAN'),
('1070', 85, 'TRINIDAD'),
('1071', 85, 'VILLANUEVA'),
('1072', 86, 'MOCOA'),
('1073', 86, 'COLON'),
('1074', 86, 'ORITO'),
('1075', 86, 'PUERTO ASIS'),
('1076', 86, 'PUERTO CAICEDO'),
('1077', 86, 'PUERTO GUZMAN'),
('1078', 86, 'LEGUIZAMO'),
('1079', 86, 'SIBUNDOY'),
('108', 5, 'TAMESIS'),
('1080', 86, 'SAN FRANCISCO'),
('1081', 86, 'SAN MIGUEL'),
('1082', 86, 'SANTIAGO'),
('1083', 86, 'VALLE DEL GUAMUEZ'),
('1084', 86, 'VILLAGARZON'),
('1085', 88, 'SAN ANDRES'),
('1086', 88, 'PROVIDENCIA'),
('1087', 91, 'LETICIA'),
('1088', 91, 'EL ENCANTO'),
('1089', 91, 'LA CHORRERA'),
('109', 5, 'TARAZA'),
('1090', 91, 'LA PEDRERA'),
('1091', 91, 'LA VICTORIA'),
('1092', 91, 'MIRITI - PARANA'),
('1093', 91, 'PUERTO ALEGRIA'),
('1094', 91, 'PUERTO ARICA'),
('1095', 91, 'PUERTO NARI?O'),
('1096', 91, 'PUERTO SANTANDER'),
('1097', 91, 'TARAPACA'),
('1098', 94, 'INIRIDA'),
('1099', 94, 'BARRANCO MINAS'),
('11', 5, 'SANTAFE DE ANTIOQUIA'),
('110', 5, 'TARSO'),
('1100', 94, 'MAPIRIPANA'),
('1101', 94, 'SAN FELIPE'),
('1102', 94, 'PUERTO COLOMBIA'),
('1103', 94, 'LA GUADALUPE'),
('1104', 94, 'CACAHUAL'),
('1105', 94, 'PANA PANA'),
('1106', 94, 'MORICHAL'),
('1107', 95, 'SAN JOSE DEL GUAVIARE'),
('1108', 95, 'CALAMAR'),
('1109', 95, 'EL RETORNO'),
('111', 5, 'TITIRIBI'),
('1110', 95, 'MIRAFLORES'),
('1111', 97, 'MITU'),
('1112', 97, 'CARURU'),
('1113', 97, 'PACOA'),
('1114', 97, 'TARAIRA'),
('1115', 97, 'PAPUNAUA'),
('1116', 97, 'YAVARATE'),
('1117', 99, 'PUERTO CARRE?O'),
('1118', 99, 'LA PRIMAVERA'),
('1119', 99, 'SANTA ROSALIA'),
('112', 5, 'TOLEDO'),
('1120', 99, 'CUMARIBO'),
('113', 5, 'TURBO'),
('114', 5, 'URAMITA'),
('115', 5, 'URRAO'),
('116', 5, 'VALDIVIA'),
('117', 5, 'VALPARAISO'),
('118', 5, 'VEGACHI'),
('119', 5, 'VENECIA'),
('12', 5, 'ANZA'),
('120', 5, 'VIGIA DEL FUERTE'),
('121', 5, 'YALI'),
('122', 5, 'YARUMAL'),
('123', 5, 'YOLOMBO'),
('124', 5, 'YONDO'),
('125', 5, 'ZARAGOZA'),
('126', 8, 'BARRANQUILLA'),
('127', 8, 'BARANOA'),
('128', 8, 'CAMPO DE LA CRUZ'),
('129', 8, 'CANDELARIA'),
('13', 5, 'APARTADO'),
('130', 8, 'GALAPA'),
('131', 8, 'JUAN DE ACOSTA'),
('132', 8, 'LURUACO'),
('133', 8, 'MALAMBO'),
('134', 8, 'MANATI'),
('135', 8, 'PALMAR DE VARELA'),
('136', 8, 'PIOJO'),
('137', 8, 'POLONUEVO'),
('138', 8, 'PONEDERA'),
('139', 8, 'PUERTO COLOMBIA'),
('14', 5, 'ARBOLETES'),
('140', 8, 'REPELON'),
('141', 8, 'SABANAGRANDE'),
('142', 8, 'SABANALARGA'),
('143', 8, 'SANTA LUCIA'),
('144', 8, 'SANTO TOMAS'),
('145', 8, 'SOLEDAD'),
('146', 8, 'SUAN'),
('147', 8, 'TUBARA'),
('148', 8, 'USIACURI'),
('149', 11, 'BOGOTA, D.C.'),
('15', 5, 'ARGELIA'),
('150', 13, 'CARTAGENA'),
('151', 13, 'ACHI'),
('152', 13, 'ALTOS DEL ROSARIO'),
('153', 13, 'ARENAL'),
('154', 13, 'ARJONA'),
('155', 13, 'ARROYOHONDO'),
('156', 13, 'BARRANCO DE LOBA'),
('157', 13, 'CALAMAR'),
('158', 13, 'CANTAGALLO'),
('159', 13, 'CICUCO'),
('16', 5, 'ARMENIA'),
('160', 13, 'CORDOBA'),
('161', 13, 'CLEMENCIA'),
('162', 13, 'EL CARMEN DE BOLIVAR'),
('163', 13, 'EL GUAMO'),
('164', 13, 'EL PE?ON'),
('165', 13, 'HATILLO DE LOBA'),
('166', 13, 'MAGANGUE'),
('167', 13, 'MAHATES'),
('168', 13, 'MARGARITA'),
('169', 13, 'MARIA LA BAJA'),
('17', 5, 'BARBOSA'),
('170', 13, 'MONTECRISTO'),
('171', 13, 'MOMPOS'),
('172', 13, 'NOROSI'),
('173', 13, 'MORALES'),
('174', 13, 'PINILLOS'),
('175', 13, 'REGIDOR'),
('176', 13, 'RIO VIEJO'),
('177', 13, 'SAN CRISTOBAL'),
('178', 13, 'SAN ESTANISLAO'),
('179', 13, 'SAN FERNANDO'),
('18', 5, 'BELMIRA'),
('180', 13, 'SAN JACINTO'),
('181', 13, 'SAN JACINTO DEL CAUCA'),
('182', 13, 'SAN JUAN NEPOMUCENO'),
('183', 13, 'SAN MARTIN DE LOBA'),
('184', 13, 'SAN PABLO'),
('185', 13, 'SANTA CATALINA'),
('186', 13, 'SANTA ROSA'),
('187', 13, 'SANTA ROSA DEL SUR'),
('188', 13, 'SIMITI'),
('189', 13, 'SOPLAVIENTO'),
('19', 5, 'BELLO'),
('190', 13, 'TALAIGUA NUEVO'),
('191', 13, 'TIQUISIO'),
('192', 13, 'TURBACO'),
('193', 13, 'TURBANA'),
('194', 13, 'VILLANUEVA'),
('195', 13, 'ZAMBRANO'),
('196', 15, 'TUNJA'),
('197', 15, 'ALMEIDA'),
('198', 15, 'AQUITANIA'),
('199', 15, 'ARCABUCO'),
('2', 5, 'ABEJORRAL'),
('20', 5, 'BETANIA'),
('200', 15, 'BELEN'),
('201', 15, 'BERBEO'),
('202', 15, 'BETEITIVA'),
('203', 15, 'BOAVITA'),
('204', 15, 'BOYACA'),
('205', 15, 'BRICE?O'),
('206', 15, 'BUENAVISTA'),
('207', 15, 'BUSBANZA'),
('208', 15, 'CALDAS'),
('209', 15, 'CAMPOHERMOSO'),
('21', 5, 'BETULIA'),
('210', 15, 'CERINZA'),
('211', 15, 'CHINAVITA'),
('212', 15, 'CHIQUINQUIRA'),
('213', 15, 'CHISCAS'),
('214', 15, 'CHITA'),
('215', 15, 'CHITARAQUE'),
('216', 15, 'CHIVATA'),
('217', 15, 'CIENEGA'),
('218', 15, 'COMBITA'),
('219', 15, 'COPER'),
('22', 5, 'CIUDAD BOLIVAR'),
('220', 15, 'CORRALES'),
('221', 15, 'COVARACHIA'),
('222', 15, 'CUBARA'),
('223', 15, 'CUCAITA'),
('224', 15, 'CUITIVA'),
('225', 15, 'CHIQUIZA'),
('226', 15, 'CHIVOR'),
('227', 15, 'DUITAMA'),
('228', 15, 'EL COCUY'),
('229', 15, 'EL ESPINO'),
('23', 5, 'BRICE?O'),
('230', 15, 'FIRAVITOBA'),
('231', 15, 'FLORESTA'),
('232', 15, 'GACHANTIVA'),
('233', 15, 'GAMEZA'),
('234', 15, 'GARAGOA'),
('235', 15, 'GUACAMAYAS'),
('236', 15, 'GUATEQUE'),
('237', 15, 'GUAYATA'),
('238', 15, 'GsICAN'),
('239', 15, 'IZA'),
('24', 5, 'BURITICA'),
('240', 15, 'JENESANO'),
('241', 15, 'JERICO'),
('242', 15, 'LABRANZAGRANDE'),
('243', 15, 'LA CAPILLA'),
('244', 15, 'LA VICTORIA'),
('245', 15, 'LA UVITA'),
('246', 15, 'VILLA DE LEYVA'),
('247', 15, 'MACANAL'),
('248', 15, 'MARIPI'),
('249', 15, 'MIRAFLORES'),
('25', 5, 'CACERES'),
('250', 15, 'MONGUA'),
('251', 15, 'MONGUI'),
('252', 15, 'MONIQUIRA'),
('253', 15, 'MOTAVITA'),
('254', 15, 'MUZO'),
('255', 15, 'NOBSA'),
('256', 15, 'NUEVO COLON'),
('257', 15, 'OICATA'),
('258', 15, 'OTANCHE'),
('259', 15, 'PACHAVITA'),
('26', 5, 'CAICEDO'),
('260', 15, 'PAEZ'),
('261', 15, 'PAIPA'),
('262', 15, 'PAJARITO'),
('263', 15, 'PANQUEBA'),
('264', 15, 'PAUNA'),
('265', 15, 'PAYA'),
('266', 15, 'PAZ DE RIO'),
('267', 15, 'PESCA'),
('268', 15, 'PISBA'),
('269', 15, 'PUERTO BOYACA'),
('27', 5, 'CALDAS'),
('270', 15, 'QUIPAMA'),
('271', 15, 'RAMIRIQUI'),
('272', 15, 'RAQUIRA'),
('273', 15, 'RONDON'),
('274', 15, 'SABOYA'),
('275', 15, 'SACHICA'),
('276', 15, 'SAMACA'),
('277', 15, 'SAN EDUARDO'),
('278', 15, 'SAN JOSE DE PARE'),
('279', 15, 'SAN LUIS DE GACENO'),
('28', 5, 'CAMPAMENTO'),
('280', 15, 'SAN MATEO'),
('281', 15, 'SAN MIGUEL DE SEMA'),
('282', 15, 'SAN PABLO DE BORBUR'),
('283', 15, 'SANTANA'),
('284', 15, 'SANTA MARIA'),
('285', 15, 'SANTA ROSA DE VITERBO'),
('286', 15, 'SANTA SOFIA'),
('287', 15, 'SATIVANORTE'),
('288', 15, 'SATIVASUR'),
('289', 15, 'SIACHOQUE'),
('29', 5, 'CA?ASGORDAS'),
('290', 15, 'SOATA'),
('291', 15, 'SOCOTA'),
('292', 15, 'SOCHA'),
('293', 15, 'SOGAMOSO'),
('294', 15, 'SOMONDOCO'),
('295', 15, 'SORA'),
('296', 15, 'SOTAQUIRA'),
('297', 15, 'SORACA'),
('298', 15, 'SUSACON'),
('299', 15, 'SUTAMARCHAN'),
('3', 5, 'ABRIAQUI'),
('30', 5, 'CARACOLI'),
('300', 15, 'SUTATENZA'),
('301', 15, 'TASCO'),
('302', 15, 'TENZA'),
('303', 15, 'TIBANA'),
('304', 15, 'TIBASOSA'),
('305', 15, 'TINJACA'),
('306', 15, 'TIPACOQUE'),
('307', 15, 'TOCA'),
('308', 15, 'TOGsI'),
('309', 15, 'TOPAGA'),
('31', 5, 'CARAMANTA'),
('310', 15, 'TOTA'),
('311', 15, 'TUNUNGUA'),
('312', 15, 'TURMEQUE'),
('313', 15, 'TUTA'),
('314', 15, 'TUTAZA'),
('315', 15, 'UMBITA'),
('316', 15, 'VENTAQUEMADA'),
('317', 15, 'VIRACACHA'),
('318', 15, 'ZETAQUIRA'),
('319', 17, 'MANIZALES'),
('32', 5, 'CAREPA'),
('320', 17, 'AGUADAS'),
('321', 17, 'ANSERMA'),
('322', 17, 'ARANZAZU'),
('323', 17, 'BELALCAZAR'),
('324', 17, 'CHINCHINA'),
('325', 17, 'FILADELFIA'),
('326', 17, 'LA DORADA'),
('327', 17, 'LA MERCED'),
('328', 17, 'MANZANARES'),
('329', 17, 'MARMATO'),
('33', 5, 'EL CARMEN DE VIBORAL'),
('330', 17, 'MARQUETALIA'),
('331', 17, 'MARULANDA'),
('332', 17, 'NEIRA'),
('333', 17, 'NORCASIA'),
('334', 17, 'PACORA'),
('335', 17, 'PALESTINA'),
('336', 17, 'PENSILVANIA'),
('337', 17, 'RIOSUCIO'),
('338', 17, 'RISARALDA'),
('339', 17, 'SALAMINA'),
('34', 5, 'CAROLINA'),
('340', 17, 'SAMANA'),
('341', 17, 'SAN JOSE'),
('342', 17, 'SUPIA'),
('343', 17, 'VICTORIA'),
('344', 17, 'VILLAMARIA'),
('345', 17, 'VITERBO'),
('346', 18, 'FLORENCIA'),
('347', 18, 'ALBANIA'),
('348', 18, 'BELEN DE LOS ANDAQUIES'),
('349', 18, 'CARTAGENA DEL CHAIRA'),
('35', 5, 'CAUCASIA'),
('350', 18, 'CURILLO'),
('351', 18, 'EL DONCELLO'),
('352', 18, 'EL PAUJIL'),
('353', 18, 'LA MONTA?ITA'),
('354', 18, 'MILAN'),
('355', 18, 'MORELIA'),
('356', 18, 'PUERTO RICO'),
('357', 18, 'SAN JOSE DEL FRAGUA'),
('358', 18, 'SAN VICENTE DEL CAGUAN'),
('359', 18, 'SOLANO'),
('36', 5, 'CHIGORODO'),
('360', 18, 'SOLITA'),
('361', 18, 'VALPARAISO'),
('362', 19, 'POPAYAN'),
('363', 19, 'ALMAGUER'),
('364', 19, 'ARGELIA'),
('365', 19, 'BALBOA'),
('366', 19, 'BOLIVAR'),
('367', 19, 'BUENOS AIRES'),
('368', 19, 'CAJIBIO'),
('369', 19, 'CALDONO'),
('37', 5, 'CISNEROS'),
('370', 19, 'CALOTO'),
('371', 19, 'CORINTO'),
('372', 19, 'EL TAMBO'),
('373', 19, 'FLORENCIA'),
('374', 19, 'GUACHENE'),
('375', 19, 'GUAPI'),
('376', 19, 'INZA'),
('377', 19, 'JAMBALO'),
('378', 19, 'LA SIERRA'),
('379', 19, 'LA VEGA'),
('38', 5, 'COCORNA'),
('380', 19, 'LOPEZ'),
('381', 19, 'MERCADERES'),
('382', 19, 'MIRANDA'),
('383', 19, 'MORALES'),
('384', 19, 'PADILLA'),
('385', 19, 'PAEZ'),
('386', 19, 'PATIA'),
('387', 19, 'PIAMONTE'),
('388', 19, 'PIENDAMO'),
('389', 19, 'PUERTO TEJADA'),
('39', 5, 'CONCEPCION'),
('390', 19, 'PURACE'),
('391', 19, 'ROSAS'),
('392', 19, 'SAN SEBASTIAN'),
('393', 19, 'SANTANDER DE QUILICHAO'),
('394', 19, 'SANTA ROSA'),
('395', 19, 'SILVIA'),
('396', 19, 'SOTARA'),
('397', 19, 'SUAREZ'),
('398', 19, 'SUCRE'),
('399', 19, 'TIMBIO'),
('4', 5, 'ALEJANDRIA'),
('40', 5, 'CONCORDIA'),
('400', 19, 'TIMBIQUI'),
('401', 19, 'TORIBIO'),
('402', 19, 'TOTORO'),
('403', 19, 'VILLA RICA'),
('404', 20, 'VALLEDUPAR'),
('405', 20, 'AGUACHICA'),
('406', 20, 'AGUSTIN CODAZZI'),
('407', 20, 'ASTREA'),
('408', 20, 'BECERRIL'),
('409', 20, 'BOSCONIA'),
('41', 5, 'COPACABANA'),
('410', 20, 'CHIMICHAGUA'),
('411', 20, 'CHIRIGUANA'),
('412', 20, 'CURUMANI'),
('413', 20, 'EL COPEY'),
('414', 20, 'EL PASO'),
('415', 20, 'GAMARRA'),
('416', 20, 'GONZALEZ'),
('417', 20, 'LA GLORIA'),
('418', 20, 'LA JAGUA DE IBIRICO'),
('419', 20, 'MANAURE'),
('42', 5, 'DABEIBA'),
('420', 20, 'PAILITAS'),
('421', 20, 'PELAYA'),
('422', 20, 'PUEBLO BELLO'),
('423', 20, 'RIO DE ORO'),
('424', 20, 'LA PAZ'),
('425', 20, 'SAN ALBERTO'),
('426', 20, 'SAN DIEGO'),
('427', 20, 'SAN MARTIN'),
('428', 20, 'TAMALAMEQUE'),
('429', 23, 'MONTERIA'),
('43', 5, 'DON MATIAS'),
('430', 23, 'AYAPEL'),
('431', 23, 'BUENAVISTA'),
('432', 23, 'CANALETE'),
('433', 23, 'CERETE'),
('434', 23, 'CHIMA'),
('435', 23, 'CHINU'),
('436', 23, 'CIENAGA DE ORO'),
('437', 23, 'COTORRA'),
('438', 23, 'LA APARTADA'),
('439', 23, 'LORICA'),
('44', 5, 'EBEJICO'),
('440', 23, 'LOS CORDOBAS'),
('441', 23, 'MOMIL'),
('442', 23, 'MONTELIBANO'),
('443', 23, 'MO?ITOS'),
('444', 23, 'PLANETA RICA'),
('445', 23, 'PUEBLO NUEVO'),
('446', 23, 'PUERTO ESCONDIDO'),
('447', 23, 'PUERTO LIBERTADOR'),
('448', 23, 'PURISIMA'),
('449', 23, 'SAHAGUN'),
('45', 5, 'EL BAGRE'),
('450', 23, 'SAN ANDRES SOTAVENTO'),
('451', 23, 'SAN ANTERO'),
('452', 23, 'SAN BERNARDO DEL VIENTO'),
('453', 23, 'SAN CARLOS'),
('454', 23, 'SAN PELAYO'),
('455', 23, 'TIERRALTA'),
('456', 23, 'VALENCIA'),
('457', 25, 'AGUA DE DIOS'),
('458', 25, 'ALBAN'),
('459', 25, 'ANAPOIMA'),
('46', 5, 'ENTRERRIOS'),
('460', 25, 'ANOLAIMA'),
('461', 25, 'ARBELAEZ'),
('462', 25, 'BELTRAN'),
('463', 25, 'BITUIMA'),
('464', 25, 'BOJACA'),
('465', 25, 'CABRERA'),
('466', 25, 'CACHIPAY'),
('467', 25, 'CAJICA'),
('468', 25, 'CAPARRAPI'),
('469', 25, 'CAQUEZA'),
('47', 5, 'ENVIGADO'),
('470', 25, 'CARMEN DE CARUPA'),
('471', 25, 'CHAGUANI'),
('472', 25, 'CHIA'),
('473', 25, 'CHIPAQUE'),
('474', 25, 'CHOACHI'),
('475', 25, 'CHOCONTA'),
('476', 25, 'COGUA'),
('477', 25, 'COTA'),
('478', 25, 'CUCUNUBA'),
('479', 25, 'EL COLEGIO'),
('48', 5, 'FREDONIA'),
('480', 25, 'EL PE?ON'),
('481', 25, 'EL ROSAL'),
('482', 25, 'FACATATIVA'),
('483', 25, 'FOMEQUE'),
('484', 25, 'FOSCA'),
('485', 25, 'FUNZA'),
('486', 25, 'FUQUENE'),
('487', 25, 'FUSAGASUGA'),
('488', 25, 'GACHALA'),
('489', 25, 'GACHANCIPA'),
('49', 5, 'FRONTINO'),
('490', 25, 'GACHETA'),
('491', 25, 'GAMA'),
('492', 25, 'GIRARDOT'),
('493', 25, 'GRANADA'),
('494', 25, 'GUACHETA'),
('495', 25, 'GUADUAS'),
('496', 25, 'GUASCA'),
('497', 25, 'GUATAQUI'),
('498', 25, 'GUATAVITA'),
('499', 25, 'GUAYABAL DE SIQUIMA'),
('5', 5, 'AMAGA'),
('50', 5, 'GIRALDO'),
('500', 25, 'GUAYABETAL'),
('501', 25, 'GUTIERREZ'),
('502', 25, 'JERUSALEN'),
('503', 25, 'JUNIN'),
('504', 25, 'LA CALERA'),
('505', 25, 'LA MESA'),
('506', 25, 'LA PALMA'),
('507', 25, 'LA PE?A'),
('508', 25, 'LA VEGA'),
('509', 25, 'LENGUAZAQUE'),
('51', 5, 'GIRARDOTA'),
('510', 25, 'MACHETA'),
('511', 25, 'MADRID'),
('512', 25, 'MANTA'),
('513', 25, 'MEDINA'),
('514', 25, 'MOSQUERA'),
('515', 25, 'NARI?O'),
('516', 25, 'NEMOCON'),
('517', 25, 'NILO'),
('518', 25, 'NIMAIMA'),
('519', 25, 'NOCAIMA'),
('52', 5, 'GOMEZ PLATA'),
('520', 25, 'VENECIA'),
('521', 25, 'PACHO'),
('522', 25, 'PAIME'),
('523', 25, 'PANDI'),
('524', 25, 'PARATEBUENO'),
('525', 25, 'PASCA'),
('526', 25, 'PUERTO SALGAR'),
('527', 25, 'PULI'),
('528', 25, 'QUEBRADANEGRA'),
('529', 25, 'QUETAME'),
('53', 5, 'GRANADA'),
('530', 25, 'QUIPILE'),
('531', 25, 'APULO'),
('532', 25, 'RICAURTE'),
('533', 25, 'SAN ANTONIO DEL TEQUENDAMA'),
('534', 25, 'SAN BERNARDO'),
('535', 25, 'SAN CAYETANO'),
('536', 25, 'SAN FRANCISCO'),
('537', 25, 'SAN JUAN DE RIO SECO'),
('538', 25, 'SASAIMA'),
('539', 25, 'SESQUILE'),
('54', 5, 'GUADALUPE'),
('540', 25, 'SIBATE'),
('541', 25, 'SILVANIA'),
('542', 25, 'SIMIJACA'),
('543', 25, 'SOACHA'),
('544', 25, 'SOPO'),
('545', 25, 'SUBACHOQUE'),
('546', 25, 'SUESCA'),
('547', 25, 'SUPATA'),
('548', 25, 'SUSA'),
('549', 25, 'SUTATAUSA'),
('55', 5, 'GUARNE'),
('550', 25, 'TABIO'),
('551', 25, 'TAUSA'),
('552', 25, 'TENA'),
('553', 25, 'TENJO'),
('554', 25, 'TIBACUY'),
('555', 25, 'TIBIRITA'),
('556', 25, 'TOCAIMA'),
('557', 25, 'TOCANCIPA'),
('558', 25, 'TOPAIPI'),
('559', 25, 'UBALA'),
('56', 5, 'GUATAPE'),
('560', 25, 'UBAQUE'),
('561', 25, 'VILLA DE SAN DIEGO DE UBATE'),
('562', 25, 'UNE'),
('563', 25, 'UTICA'),
('564', 25, 'VERGARA'),
('565', 25, 'VIANI'),
('566', 25, 'VILLAGOMEZ'),
('567', 25, 'VILLAPINZON'),
('568', 25, 'VILLETA'),
('569', 25, 'VIOTA'),
('57', 5, 'HELICONIA'),
('570', 25, 'YACOPI'),
('571', 25, 'ZIPACON'),
('572', 25, 'ZIPAQUIRA'),
('573', 27, 'QUIBDO'),
('574', 27, 'ACANDI'),
('575', 27, 'ALTO BAUDO'),
('576', 27, 'ATRATO'),
('577', 27, 'BAGADO'),
('578', 27, 'BAHIA SOLANO'),
('579', 27, 'BAJO BAUDO'),
('58', 5, 'HISPANIA'),
('580', 27, 'BOJAYA'),
('581', 27, 'EL CANTON DEL SAN PABLO'),
('582', 27, 'CARMEN DEL DARIEN'),
('583', 27, 'CERTEGUI'),
('584', 27, 'CONDOTO'),
('585', 27, 'EL CARMEN DE ATRATO'),
('586', 27, 'EL LITORAL DEL SAN JUAN'),
('587', 27, 'ISTMINA'),
('588', 27, 'JURADO'),
('589', 27, 'LLORO'),
('59', 5, 'ITAGUI'),
('590', 27, 'MEDIO ATRATO'),
('591', 27, 'MEDIO BAUDO'),
('592', 27, 'MEDIO SAN JUAN'),
('593', 27, 'NOVITA'),
('594', 27, 'NUQUI'),
('595', 27, 'RIO IRO'),
('596', 27, 'RIO QUITO'),
('597', 27, 'RIOSUCIO'),
('598', 27, 'SAN JOSE DEL PALMAR'),
('599', 27, 'SIPI'),
('6', 5, 'AMALFI'),
('60', 5, 'ITUANGO'),
('600', 27, 'TADO'),
('601', 27, 'UNGUIA'),
('602', 27, 'UNION PANAMERICANA'),
('603', 41, 'NEIVA'),
('604', 41, 'ACEVEDO'),
('605', 41, 'AGRADO'),
('606', 41, 'AIPE'),
('607', 41, 'ALGECIRAS'),
('608', 41, 'ALTAMIRA'),
('609', 41, 'BARAYA'),
('61', 5, 'JARDIN'),
('610', 41, 'CAMPOALEGRE'),
('611', 41, 'COLOMBIA'),
('612', 41, 'ELIAS'),
('613', 41, 'GARZON'),
('614', 41, 'GIGANTE'),
('615', 41, 'GUADALUPE'),
('616', 41, 'HOBO'),
('617', 41, 'IQUIRA'),
('618', 41, 'ISNOS'),
('619', 41, 'LA ARGENTINA'),
('62', 5, 'JERICO'),
('620', 41, 'LA PLATA'),
('621', 41, 'NATAGA'),
('622', 41, 'OPORAPA'),
('623', 41, 'PAICOL'),
('624', 41, 'PALERMO'),
('625', 41, 'PALESTINA'),
('626', 41, 'PITAL'),
('627', 41, 'PITALITO'),
('628', 41, 'RIVERA'),
('629', 41, 'SALADOBLANCO'),
('63', 5, 'LA CEJA'),
('630', 41, 'SAN AGUSTIN'),
('631', 41, 'SANTA MARIA'),
('632', 41, 'SUAZA'),
('633', 41, 'TARQUI'),
('634', 41, 'TESALIA'),
('635', 41, 'TELLO'),
('636', 41, 'TERUEL'),
('637', 41, 'TIMANA'),
('638', 41, 'VILLAVIEJA'),
('639', 41, 'YAGUARA'),
('64', 5, 'LA ESTRELLA'),
('640', 44, 'RIOHACHA'),
('641', 44, 'ALBANIA'),
('642', 44, 'BARRANCAS'),
('643', 44, 'DIBULLA'),
('644', 44, 'DISTRACCION'),
('645', 44, 'EL MOLINO'),
('646', 44, 'FONSECA'),
('647', 44, 'HATONUEVO'),
('648', 44, 'LA JAGUA DEL PILAR'),
('649', 44, 'MAICAO'),
('65', 5, 'LA PINTADA'),
('650', 44, 'MANAURE'),
('651', 44, 'SAN JUAN DEL CESAR'),
('652', 44, 'URIBIA'),
('653', 44, 'URUMITA'),
('654', 44, 'VILLANUEVA'),
('655', 47, 'SANTA MARTA'),
('656', 47, 'ALGARROBO'),
('657', 47, 'ARACATACA'),
('658', 47, 'ARIGUANI'),
('659', 47, 'CERRO SAN ANTONIO'),
('66', 5, 'LA UNION'),
('660', 47, 'CHIBOLO'),
('661', 47, 'CIENAGA'),
('662', 47, 'CONCORDIA'),
('663', 47, 'EL BANCO'),
('664', 47, 'EL PI?ON'),
('665', 47, 'EL RETEN'),
('666', 47, 'FUNDACION'),
('667', 47, 'GUAMAL'),
('668', 47, 'NUEVA GRANADA'),
('669', 47, 'PEDRAZA'),
('67', 5, 'LIBORINA'),
('670', 47, 'PIJI?O DEL CARMEN'),
('671', 47, 'PIVIJAY'),
('672', 47, 'PLATO'),
('673', 47, 'PUEBLOVIEJO'),
('674', 47, 'REMOLINO'),
('675', 47, 'SABANAS DE SAN ANGEL'),
('676', 47, 'SALAMINA'),
('677', 47, 'SAN SEBASTIAN DE BUENAVISTA'),
('678', 47, 'SAN ZENON'),
('679', 47, 'SANTA ANA'),
('68', 5, 'MACEO'),
('680', 47, 'SANTA BARBARA DE PINTO'),
('681', 47, 'SITIONUEVO'),
('682', 47, 'TENERIFE'),
('683', 47, 'ZAPAYAN'),
('684', 47, 'ZONA BANANERA'),
('685', 50, 'VILLAVICENCIO'),
('686', 50, 'ACACIAS'),
('687', 50, 'BARRANCA DE UPIA'),
('688', 50, 'CABUYARO'),
('689', 50, 'CASTILLA LA NUEVA'),
('69', 5, 'MARINILLA'),
('690', 50, 'CUBARRAL'),
('691', 50, 'CUMARAL'),
('692', 50, 'EL CALVARIO'),
('693', 50, 'EL CASTILLO'),
('694', 50, 'EL DORADO'),
('695', 50, 'FUENTE DE ORO'),
('696', 50, 'GRANADA'),
('697', 50, 'GUAMAL'),
('698', 50, 'MAPIRIPAN'),
('699', 50, 'MESETAS'),
('7', 5, 'ANDES'),
('70', 5, 'MONTEBELLO'),
('700', 50, 'LA MACARENA'),
('701', 50, 'URIBE'),
('702', 50, 'LEJANIAS'),
('703', 50, 'PUERTO CONCORDIA'),
('704', 50, 'PUERTO GAITAN'),
('705', 50, 'PUERTO LOPEZ'),
('706', 50, 'PUERTO LLERAS'),
('707', 50, 'PUERTO RICO'),
('708', 50, 'RESTREPO'),
('709', 50, 'SAN CARLOS DE GUAROA'),
('71', 5, 'MURINDO'),
('710', 50, 'SAN JUAN DE ARAMA'),
('711', 50, 'SAN JUANITO'),
('712', 50, 'SAN MARTIN'),
('713', 50, 'VISTAHERMOSA'),
('714', 52, 'PASTO'),
('715', 52, 'ALBAN'),
('716', 52, 'ALDANA'),
('717', 52, 'ANCUYA'),
('718', 52, 'ARBOLEDA'),
('719', 52, 'BARBACOAS'),
('72', 5, 'MUTATA'),
('720', 52, 'BELEN'),
('721', 52, 'BUESACO'),
('722', 52, 'COLON'),
('723', 52, 'CONSACA'),
('724', 52, 'CONTADERO'),
('725', 52, 'CORDOBA'),
('726', 52, 'CUASPUD'),
('727', 52, 'CUMBAL'),
('728', 52, 'CUMBITARA'),
('729', 52, 'CHACHAGsI'),
('73', 5, 'NARI?O'),
('730', 52, 'EL CHARCO'),
('731', 52, 'EL PE?OL'),
('732', 52, 'EL ROSARIO'),
('733', 52, 'EL TABLON DE GOMEZ'),
('734', 52, 'EL TAMBO'),
('735', 52, 'FUNES'),
('736', 52, 'GUACHUCAL'),
('737', 52, 'GUAITARILLA'),
('738', 52, 'GUALMATAN'),
('739', 52, 'ILES'),
('74', 5, 'NECOCLI'),
('740', 52, 'IMUES'),
('741', 52, 'IPIALES'),
('742', 52, 'LA CRUZ'),
('743', 52, 'LA FLORIDA'),
('744', 52, 'LA LLANADA'),
('745', 52, 'LA TOLA'),
('746', 52, 'LA UNION'),
('747', 52, 'LEIVA'),
('748', 52, 'LINARES'),
('749', 52, 'LOS ANDES'),
('75', 5, 'NECHI'),
('750', 52, 'MAGsI'),
('751', 52, 'MALLAMA'),
('752', 52, 'MOSQUERA'),
('753', 52, 'NARI?O'),
('754', 52, 'OLAYA HERRERA'),
('755', 52, 'OSPINA'),
('756', 52, 'FRANCISCO PIZARRO'),
('757', 52, 'POLICARPA'),
('758', 52, 'POTOSI'),
('759', 52, 'PROVIDENCIA'),
('76', 5, 'OLAYA'),
('760', 52, 'PUERRES'),
('761', 52, 'PUPIALES'),
('762', 52, 'RICAURTE'),
('763', 52, 'ROBERTO PAYAN'),
('764', 52, 'SAMANIEGO'),
('765', 52, 'SANDONA'),
('766', 52, 'SAN BERNARDO'),
('767', 52, 'SAN LORENZO'),
('768', 52, 'SAN PABLO'),
('769', 52, 'SAN PEDRO DE CARTAGO'),
('77', 5, 'PE?OL'),
('770', 52, 'SANTA BARBARA'),
('771', 52, 'SANTACRUZ'),
('772', 52, 'SAPUYES'),
('773', 52, 'TAMINANGO'),
('774', 52, 'TANGUA'),
('775', 52, 'SAN ANDRES DE TUMACO'),
('776', 52, 'TUQUERRES'),
('777', 52, 'YACUANQUER'),
('778', 54, 'CUCUTA'),
('779', 54, 'ABREGO'),
('78', 5, 'PEQUE'),
('780', 54, 'ARBOLEDAS'),
('781', 54, 'BOCHALEMA'),
('782', 54, 'BUCARASICA'),
('783', 54, 'CACOTA'),
('784', 54, 'CACHIRA'),
('785', 54, 'CHINACOTA'),
('786', 54, 'CHITAGA'),
('787', 54, 'CONVENCION'),
('788', 54, 'CUCUTILLA'),
('789', 54, 'DURANIA'),
('79', 5, 'PUEBLORRICO'),
('790', 54, 'EL CARMEN'),
('791', 54, 'EL TARRA'),
('792', 54, 'EL ZULIA'),
('793', 54, 'GRAMALOTE'),
('794', 54, 'HACARI'),
('795', 54, 'HERRAN'),
('796', 54, 'LABATECA'),
('797', 54, 'LA ESPERANZA'),
('798', 54, 'LA PLAYA'),
('799', 54, 'LOS PATIOS'),
('8', 5, 'ANGELOPOLIS'),
('80', 5, 'PUERTO BERRIO'),
('800', 54, 'LOURDES'),
('801', 54, 'MUTISCUA'),
('802', 54, 'OCA?A'),
('803', 54, 'PAMPLONA'),
('804', 54, 'PAMPLONITA'),
('805', 54, 'PUERTO SANTANDER'),
('806', 54, 'RAGONVALIA'),
('807', 54, 'SALAZAR'),
('808', 54, 'SAN CALIXTO'),
('809', 54, 'SAN CAYETANO'),
('81', 5, 'PUERTO NARE'),
('810', 54, 'SANTIAGO'),
('811', 54, 'SARDINATA'),
('812', 54, 'SILOS'),
('813', 54, 'TEORAMA'),
('814', 54, 'TIBU'),
('815', 54, 'TOLEDO'),
('816', 54, 'VILLA CARO'),
('817', 54, 'VILLA DEL ROSARIO'),
('818', 63, 'ARMENIA'),
('819', 63, 'BUENAVISTA'),
('82', 5, 'PUERTO TRIUNFO'),
('820', 63, 'CALARCA'),
('821', 63, 'CIRCASIA'),
('822', 63, 'CORDOBA'),
('823', 63, 'FILANDIA'),
('824', 63, 'GENOVA'),
('825', 63, 'LA TEBAIDA'),
('826', 63, 'MONTENEGRO'),
('827', 63, 'PIJAO'),
('828', 63, 'QUIMBAYA'),
('829', 63, 'SALENTO'),
('83', 5, 'REMEDIOS'),
('830', 66, 'PEREIRA'),
('831', 66, 'APIA'),
('832', 66, 'BALBOA'),
('833', 66, 'BELEN DE UMBRIA'),
('834', 66, 'DOSQUEBRADAS'),
('835', 66, 'GUATICA'),
('836', 66, 'LA CELIA'),
('837', 66, 'LA VIRGINIA'),
('838', 66, 'MARSELLA'),
('839', 66, 'MISTRATO'),
('84', 5, 'RETIRO'),
('840', 66, 'PUEBLO RICO'),
('841', 66, 'QUINCHIA'),
('842', 66, 'SANTA ROSA DE CABAL'),
('843', 66, 'SANTUARIO'),
('844', 68, 'BUCARAMANGA'),
('845', 68, 'AGUADA'),
('846', 68, 'ALBANIA'),
('847', 68, 'ARATOCA'),
('848', 68, 'BARBOSA'),
('849', 68, 'BARICHARA'),
('85', 5, 'RIONEGRO'),
('850', 68, 'BARRANCABERMEJA'),
('851', 68, 'BETULIA'),
('852', 68, 'BOLIVAR'),
('853', 68, 'CABRERA'),
('854', 68, 'CALIFORNIA'),
('855', 68, 'CAPITANEJO'),
('856', 68, 'CARCASI'),
('857', 68, 'CEPITA'),
('858', 68, 'CERRITO'),
('859', 68, 'CHARALA'),
('86', 5, 'SABANALARGA'),
('860', 68, 'CHARTA'),
('861', 68, 'CHIMA'),
('862', 68, 'CHIPATA'),
('863', 68, 'CIMITARRA'),
('864', 68, 'CONCEPCION'),
('865', 68, 'CONFINES'),
('866', 68, 'CONTRATACION'),
('867', 68, 'COROMORO'),
('868', 68, 'CURITI'),
('869', 68, 'EL CARMEN DE CHUCURI'),
('87', 5, 'SABANETA'),
('870', 68, 'EL GUACAMAYO'),
('871', 68, 'EL PE?ON'),
('872', 68, 'EL PLAYON'),
('873', 68, 'ENCINO'),
('874', 68, 'ENCISO'),
('875', 68, 'FLORIAN'),
('876', 68, 'FLORIDABLANCA'),
('877', 68, 'GALAN'),
('878', 68, 'GAMBITA'),
('879', 68, 'GIRON'),
('88', 5, 'SALGAR'),
('880', 68, 'GUACA'),
('881', 68, 'GUADALUPE'),
('882', 68, 'GUAPOTA'),
('883', 68, 'GUAVATA'),
('884', 68, 'GsEPSA'),
('885', 68, 'HATO'),
('886', 68, 'JESUS MARIA'),
('887', 68, 'JORDAN'),
('888', 68, 'LA BELLEZA'),
('889', 68, 'LANDAZURI'),
('89', 5, 'SAN ANDRES DE CUERQUIA'),
('890', 68, 'LA PAZ'),
('891', 68, 'LEBRIJA'),
('892', 68, 'LOS SANTOS'),
('893', 68, 'MACARAVITA'),
('894', 68, 'MALAGA'),
('895', 68, 'MATANZA'),
('896', 68, 'MOGOTES'),
('897', 68, 'MOLAGAVITA'),
('898', 68, 'OCAMONTE'),
('899', 68, 'OIBA'),
('9', 5, 'ANGOSTURA'),
('90', 5, 'SAN CARLOS'),
('900', 68, 'ONZAGA'),
('901', 68, 'PALMAR'),
('902', 68, 'PALMAS DEL SOCORRO'),
('903', 68, 'PARAMO'),
('904', 68, 'PIEDECUESTA'),
('905', 68, 'PINCHOTE'),
('906', 68, 'PUENTE NACIONAL'),
('907', 68, 'PUERTO PARRA'),
('908', 68, 'PUERTO WILCHES'),
('909', 68, 'RIONEGRO'),
('91', 5, 'SAN FRANCISCO'),
('910', 68, 'SABANA DE TORRES'),
('911', 68, 'SAN ANDRES'),
('912', 68, 'SAN BENITO'),
('913', 68, 'SAN GIL'),
('914', 68, 'SAN JOAQUIN'),
('915', 68, 'SAN JOSE DE MIRANDA'),
('916', 68, 'SAN MIGUEL'),
('917', 68, 'SAN VICENTE DE CHUCURI'),
('918', 68, 'SANTA BARBARA'),
('919', 68, 'SANTA HELENA DEL OPON'),
('92', 5, 'SAN JERONIMO'),
('920', 68, 'SIMACOTA'),
('921', 68, 'SOCORRO'),
('922', 68, 'SUAITA'),
('923', 68, 'SUCRE'),
('924', 68, 'SURATA'),
('925', 68, 'TONA'),
('926', 68, 'VALLE DE SAN JOSE'),
('927', 68, 'VELEZ'),
('928', 68, 'VETAS'),
('929', 68, 'VILLANUEVA'),
('93', 5, 'SAN JOSE DE LA MONTA?A'),
('930', 68, 'ZAPATOCA'),
('931', 70, 'SINCELEJO'),
('932', 70, 'BUENAVISTA'),
('933', 70, 'CAIMITO'),
('934', 70, 'COLOSO'),
('935', 70, 'COROZAL'),
('936', 70, 'COVE?AS'),
('937', 70, 'CHALAN'),
('938', 70, 'EL ROBLE'),
('939', 70, 'GALERAS'),
('94', 5, 'SAN JUAN DE URABA'),
('940', 70, 'GUARANDA'),
('941', 70, 'LA UNION'),
('942', 70, 'LOS PALMITOS'),
('943', 70, 'MAJAGUAL'),
('944', 70, 'MORROA'),
('945', 70, 'OVEJAS'),
('946', 70, 'PALMITO'),
('947', 70, 'SAMPUES'),
('948', 70, 'SAN BENITO ABAD'),
('949', 70, 'SAN JUAN DE BETULIA'),
('95', 5, 'SAN LUIS'),
('950', 70, 'SAN MARCOS'),
('951', 70, 'SAN ONOFRE'),
('952', 70, 'SAN PEDRO'),
('953', 70, 'SAN LUIS DE SINCE'),
('954', 70, 'SUCRE'),
('955', 70, 'SANTIAGO DE TOLU'),
('956', 70, 'TOLU VIEJO'),
('957', 73, 'IBAGUE'),
('958', 73, 'ALPUJARRA'),
('959', 73, 'ALVARADO'),
('96', 5, 'SAN PEDRO'),
('960', 73, 'AMBALEMA'),
('961', 73, 'ANZOATEGUI'),
('962', 73, 'ARMERO'),
('963', 73, 'ATACO'),
('964', 73, 'CAJAMARCA'),
('965', 73, 'CARMEN DE APICALA'),
('966', 73, 'CASABIANCA'),
('967', 73, 'CHAPARRAL'),
('968', 73, 'COELLO'),
('969', 73, 'COYAIMA'),
('97', 5, 'SAN PEDRO DE URABA'),
('970', 73, 'CUNDAY'),
('971', 73, 'DOLORES'),
('972', 73, 'ESPINAL'),
('973', 73, 'FALAN'),
('974', 73, 'FLANDES'),
('975', 73, 'FRESNO'),
('976', 73, 'GUAMO'),
('977', 73, 'HERVEO'),
('978', 73, 'HONDA'),
('979', 73, 'ICONONZO'),
('98', 5, 'SAN RAFAEL'),
('980', 73, 'LERIDA'),
('981', 73, 'LIBANO'),
('982', 73, 'MARIQUITA'),
('983', 73, 'MELGAR'),
('984', 73, 'MURILLO'),
('985', 73, 'NATAGAIMA'),
('986', 73, 'ORTEGA'),
('987', 73, 'PALOCABILDO'),
('988', 73, 'PIEDRAS'),
('989', 73, 'PLANADAS'),
('99', 5, 'SAN ROQUE'),
('990', 73, 'PRADO'),
('991', 73, 'PURIFICACION'),
('992', 73, 'RIOBLANCO'),
('993', 73, 'RONCESVALLES'),
('994', 73, 'ROVIRA'),
('995', 73, 'SALDA?A'),
('996', 73, 'SAN ANTONIO'),
('997', 73, 'SAN LUIS'),
('998', 73, 'SANTA ISABEL'),
('999', 73, 'SUAREZ');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `precios`
--
CREATE TABLE `precios` (
`idPrecio` varchar(11) COLLATE utf8_bin NOT NULL,
`nombreTiopoPrecio` varchar(30) COLLATE utf8_bin NOT NULL,
`precioIva` float NOT NULL,
`descuento` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `productos_elaborados`
--
CREATE TABLE `productos_elaborados` (
`idProductoElaborado` varchar(15) COLLATE utf8_bin NOT NULL,
`idReceta` varchar(15) COLLATE utf8_bin NOT NULL,
`idCategoria` varchar(15) COLLATE utf8_bin NOT NULL,
`idUbicacion` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreProducto` varchar(30) COLLATE utf8_bin NOT NULL,
`cantidaProducto` int(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `productos_marcas`
--
CREATE TABLE `productos_marcas` (
`idProductoMarca` varchar(15) COLLATE utf8_bin NOT NULL,
`idUbicacion` varchar(15) COLLATE utf8_bin NOT NULL,
`idCategotia` varchar(15) COLLATE utf8_bin NOT NULL,
`NombreProductoMarca` varchar(30) COLLATE utf8_bin NOT NULL,
`cantidaProductoMarca` int(11) NOT NULL,
`cantidadExitencia` int(20) NOT NULL,
`valorCompraUnidad` float NOT NULL,
`fecha` date NOT NULL,
`precio_unidad` int(11) NOT NULL,
`precio_cantidad` int(11) NOT NULL,
`valorCompraMayor` float NOT NULL,
`detalles` varchar(100) COLLATE utf8_bin NOT NULL,
`posicion` int(20) NOT NULL,
`tipoProducto` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `productos_marcas`
--
INSERT INTO `productos_marcas` (`idProductoMarca`, `idUbicacion`, `idCategotia`, `NombreProductoMarca`, `cantidaProductoMarca`, `cantidadExitencia`, `valorCompraUnidad`, `fecha`, `precio_unidad`, `precio_cantidad`, `valorCompraMayor`, `detalles`, `posicion`, `tipoProducto`) VALUES
('12', '2', '123', 'papas', 2, 0, 0, '0000-00-00', 24, 320, 0, '', 1, ''),
('123', '4', '123', 'papas', 2, 0, 0, '0000-00-00', 24, 320, 0, '', 2, ''),
('124', '2', '123', 'papas', 2, 0, 0, '0000-00-00', 24, 320, 0, '', 3, ''),
('214', '5', '125', 'chocolate', 10, 0, 0, '0000-00-00', 5000, 4000, 0, '', 4, ''),
('323', '4', '125', 'papas', 2, 0, 0, '0000-00-00', 24, 320, 0, '', 5, ''),
('345', '4', '125', 'papas', 2, 0, 0, '0000-00-00', 24, 320, 0, '', 6, '');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `proveedores`
--
CREATE TABLE `proveedores` (
`idProveedor` varchar(15) COLLATE utf8_bin NOT NULL,
`idMunicipio` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`nombreProveedor` varchar(30) COLLATE utf8_bin NOT NULL,
`direccionProveedor` varchar(50) COLLATE utf8_bin NOT NULL,
`telefonoProveedor` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`razonSocial` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`nitProveedor` varchar(20) COLLATE utf8_bin NOT NULL,
`urlProveedor` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`codigoPostal` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`emailProveedor` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`faxProveedor` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`contactoVendedor` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`idDia` varchar(20) COLLATE utf8_bin DEFAULT NULL,
`observaciones` varchar(500) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `proveedores`
--
INSERT INTO `proveedores` (`idProveedor`, `idMunicipio`, `nombreProveedor`, `direccionProveedor`, `telefonoProveedor`, `razonSocial`, `nitProveedor`, `urlProveedor`, `codigoPostal`, `emailProveedor`, `faxProveedor`, `contactoVendedor`, `idDia`, `observaciones`) VALUES
('22052', '0', 'BRAYAN RODRIGUEZ', 'CALLE 37A ', '3138369712', 'PLASTICOS JIREH DEL LLANO', '1121884892', '', '', 'BRARODHURT@GMAIL.COM', '0000000000', '', '0', ''),
('31032', '12', 'ROSA CARVAJAL', 'CALLE 9 SUR 48', '24567', 'LOS MANGOS ', '541', 'WWW.LOSMANGOS.COM', '17', 'LOSMANGOS@GMAIL.COM', '1254', '12354', '2', ' SADASDASD \n '),
('SADASD', '0', 'ASDASD', 'ASDAS', '', 'SADASD', 'ASDASD', '', '', '', '', '', '0', '');
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `proveedores_vista`
-- (Véase abajo para la vista actual)
--
CREATE TABLE `proveedores_vista` (
`idProveedor` varchar(15)
,`nombreProveedor` varchar(30)
,`nitProveedor` varchar(20)
,`direccionProveedor` varchar(50)
);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `recetas`
--
CREATE TABLE `recetas` (
`idReceta` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreReceta` varchar(30) COLLATE utf8_bin NOT NULL,
`cantidadProductoGenerado` int(6) NOT NULL,
`fechaElaboracion` date NOT NULL,
`descripcionReceta` varchar(400) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipos_de_cantidades`
--
CREATE TABLE `tipos_de_cantidades` (
`idTipoCantidad` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreTipoCantidad` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `tipos_de_cantidades`
--
INSERT INTO `tipos_de_cantidades` (`idTipoCantidad`, `nombreTipoCantidad`) VALUES
('1', 'UND'),
('2', 'GR');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipos_de_compras`
--
CREATE TABLE `tipos_de_compras` (
`idTipoCompra` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreTipoCompra` varchar(20) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `tipos_de_compras`
--
INSERT INTO `tipos_de_compras` (`idTipoCompra`, `nombreTipoCompra`) VALUES
('1', 'EFECTIVO'),
('2', 'CRÉDITO'),
('3', 'CRÉDITO 8 DIAS'),
('4', 'CREDITO 15 DIAS'),
('5', 'CREDITO 30 DIAS'),
('6', 'CREDITO 45 DIAS'),
('7', 'CREDITO 60 DIAS');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipos_de_pagos`
--
CREATE TABLE `tipos_de_pagos` (
`idTipoDePago` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreTipoDePago` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tipo_productos_venta`
--
CREATE TABLE `tipo_productos_venta` (
`idTipoProductoVenta` int(11) NOT NULL,
`idProductoMarca` varchar(15) COLLATE utf8_bin NOT NULL,
`idProductoElaborado` varchar(15) COLLATE utf8_bin NOT NULL,
`idPrecio` varchar(11) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ubicaciones`
--
CREATE TABLE `ubicaciones` (
`idUbicacion` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreUbicacion` varchar(30) COLLATE utf8_bin NOT NULL,
`capacidad` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Volcado de datos para la tabla `ubicaciones`
--
INSERT INTO `ubicaciones` (`idUbicacion`, `nombreUbicacion`, `capacidad`) VALUES
('12', 'mostrador', 11),
('12345', 'casa', 34),
('150', 'prueba', 23345),
('2', 'vitrina', 20),
('4', 'bodega', 50),
('5', 'estanteria', 30);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `vendedores`
--
CREATE TABLE `vendedores` (
`idVendedor` varchar(15) COLLATE utf8_bin NOT NULL,
`nombreVendedor` varchar(30) COLLATE utf8_bin NOT NULL,
`apellidoVendedor` varchar(30) COLLATE utf8_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `vista_mostrar_insumos`
-- (Véase abajo para la vista actual)
--
CREATE TABLE `vista_mostrar_insumos` (
`Codigo` varchar(15)
,`Descripcion` varchar(50)
,`Costo` float
,`Cantidad` float
,`Tipo` varchar(15)
);
-- --------------------------------------------------------
--
-- Estructura Stand-in para la vista `vista_productos_marca`
-- (Véase abajo para la vista actual)
--
CREATE TABLE `vista_productos_marca` (
`idProductoMarca` varchar(15)
,`NombreProductoMarca` varchar(30)
,`cantidaProductoMarca` int(11)
,`precio_unidad` int(11)
);
-- --------------------------------------------------------
--
-- Estructura para la vista `proveedores_vista`
--
DROP TABLE IF EXISTS `proveedores_vista`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `proveedores_vista` AS select `proveedores`.`idProveedor` AS `idProveedor`,`proveedores`.`nombreProveedor` AS `nombreProveedor`,`proveedores`.`nitProveedor` AS `nitProveedor`,`proveedores`.`direccionProveedor` AS `direccionProveedor` from `proveedores` ;
-- --------------------------------------------------------
--
-- Estructura para la vista `vista_mostrar_insumos`
--
DROP TABLE IF EXISTS `vista_mostrar_insumos`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vista_mostrar_insumos` AS select `insumos`.`idInsumo` AS `Codigo`,`insumos`.`nombreInsumo` AS `Descripcion`,`insumos`.`costoInsumo` AS `Costo`,`insumos`.`cantidadInsumo` AS `Cantidad`,`insumos`.`idTipoCantidad` AS `Tipo` from `insumos` ;
-- --------------------------------------------------------
--
-- Estructura para la vista `vista_productos_marca`
--
DROP TABLE IF EXISTS `vista_productos_marca`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vista_productos_marca` AS select `productos_marcas`.`idProductoMarca` AS `idProductoMarca`,`productos_marcas`.`NombreProductoMarca` AS `NombreProductoMarca`,`productos_marcas`.`cantidaProductoMarca` AS `cantidaProductoMarca`,`productos_marcas`.`precio_unidad` AS `precio_unidad` from `productos_marcas` ;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `bodega`
--
ALTER TABLE `bodega`
ADD PRIMARY KEY (`idBodega`);
--
-- Indices de la tabla `categorias`
--
ALTER TABLE `categorias`
ADD PRIMARY KEY (`idCategoria`);
--
-- Indices de la tabla `clientes`
--
ALTER TABLE `clientes`
ADD PRIMARY KEY (`idCliente`);
--
-- Indices de la tabla `departamentos`
--
ALTER TABLE `departamentos`
ADD PRIMARY KEY (`idDepartamento`);
--
-- Indices de la tabla `detalles_compras`
--
ALTER TABLE `detalles_compras`
ADD PRIMARY KEY (`idDetalleCompra`),
ADD KEY `idFacturaCompra` (`idFacturaCompra`),
ADD KEY `IdProductoMarca` (`IdProductoMarca`),
ADD KEY `idTipoCantidad` (`idTipoCantidad`);
--
-- Indices de la tabla `detalles_compras_insumos`
--
ALTER TABLE `detalles_compras_insumos`
ADD PRIMARY KEY (`idDetalleCompraInsumo`),
ADD KEY `idInsumo` (`idInsumo`),
ADD KEY `idFacturaCompra` (`idFacturaCompra`),
ADD KEY `idTipoCantidad` (`idTipoCantidad`);
--
-- Indices de la tabla `detalles_recetas`
--
ALTER TABLE `detalles_recetas`
ADD PRIMARY KEY (`idDetalleReceta`),
ADD KEY `idInsumo` (`idInsumo`),
ADD KEY `idReceta` (`idReceta`),
ADD KEY `idTipoCantidad` (`idTipoCantidad`);
--
-- Indices de la tabla `detalles_ventas`
--
ALTER TABLE `detalles_ventas`
ADD PRIMARY KEY (`idDetalleVenta`),
ADD KEY `idFacturaVenta` (`idFacturaVenta`),
ADD KEY `idTipoProductoVenta` (`idTipoProductoVenta`);
--
-- Indices de la tabla `dias`
--
ALTER TABLE `dias`
ADD PRIMARY KEY (`idDia`);
--
-- Indices de la tabla `facturas_de_compras`
--
ALTER TABLE `facturas_de_compras`
ADD PRIMARY KEY (`idFacturaCompra`),
ADD KEY `idProveedor` (`idProveedor`),
ADD KEY `idTipoCompra` (`idTipoCompra`),
ADD KEY `idBodega` (`idBodega`);
--
-- Indices de la tabla `factura_ventas`
--
ALTER TABLE `factura_ventas`
ADD PRIMARY KEY (`idFacturaVenta`),
ADD KEY `idCliente` (`idCliente`),
ADD KEY `IdVendedor` (`IdVendedor`),
ADD KEY `idTipoDePago` (`idTipoDePago`);
--
-- Indices de la tabla `insumos`
--
ALTER TABLE `insumos`
ADD PRIMARY KEY (`idInsumo`),
ADD KEY `idTipoCantidad` (`idTipoCantidad`);
--
-- Indices de la tabla `municipios`
--
ALTER TABLE `municipios`
ADD PRIMARY KEY (`idMunicipio`),
ADD KEY `idDepartamento` (`idDepartamento`);
--
-- Indices de la tabla `precios`
--
ALTER TABLE `precios`
ADD PRIMARY KEY (`idPrecio`);
--
-- Indices de la tabla `productos_elaborados`
--
ALTER TABLE `productos_elaborados`
ADD PRIMARY KEY (`idProductoElaborado`),
ADD KEY `idReceta` (`idReceta`),
ADD KEY `idCategoria` (`idCategoria`),
ADD KEY `idUbicacion` (`idUbicacion`);
--
-- Indices de la tabla `productos_marcas`
--
ALTER TABLE `productos_marcas`
ADD PRIMARY KEY (`idProductoMarca`),
ADD KEY `idUbicacion` (`idUbicacion`),
ADD KEY `idCategotia` (`idCategotia`),
ADD KEY `posicion` (`posicion`);
--
-- Indices de la tabla `proveedores`
--
ALTER TABLE `proveedores`
ADD PRIMARY KEY (`idProveedor`),
ADD KEY `idMunicipio` (`idMunicipio`),
ADD KEY `idDia` (`idDia`);
--
-- Indices de la tabla `recetas`
--
ALTER TABLE `recetas`
ADD PRIMARY KEY (`idReceta`);
--
-- Indices de la tabla `tipos_de_cantidades`
--
ALTER TABLE `tipos_de_cantidades`
ADD PRIMARY KEY (`idTipoCantidad`);
--
-- Indices de la tabla `tipos_de_compras`
--
ALTER TABLE `tipos_de_compras`
ADD PRIMARY KEY (`idTipoCompra`);
--
-- Indices de la tabla `tipos_de_pagos`
--
ALTER TABLE `tipos_de_pagos`
ADD PRIMARY KEY (`idTipoDePago`);
--
-- Indices de la tabla `tipo_productos_venta`
--
ALTER TABLE `tipo_productos_venta`
ADD PRIMARY KEY (`idTipoProductoVenta`),
ADD KEY `idProductoMarca` (`idProductoMarca`),
ADD KEY `idProductoElaborado` (`idProductoElaborado`),
ADD KEY `idPrecio` (`idPrecio`);
--
-- Indices de la tabla `ubicaciones`
--
ALTER TABLE `ubicaciones`
ADD PRIMARY KEY (`idUbicacion`);
--
-- Indices de la tabla `vendedores`
--
ALTER TABLE `vendedores`
ADD PRIMARY KEY (`idVendedor`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `detalles_compras`
--
ALTER TABLE `detalles_compras`
MODIFY `idDetalleCompra` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `detalles_compras_insumos`
--
ALTER TABLE `detalles_compras_insumos`
MODIFY `idDetalleCompraInsumo` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `detalles_recetas`
--
ALTER TABLE `detalles_recetas`
MODIFY `idDetalleReceta` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `detalles_ventas`
--
ALTER TABLE `detalles_ventas`
MODIFY `idDetalleVenta` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `facturas_de_compras`
--
ALTER TABLE `facturas_de_compras`
MODIFY `idFacturaCompra` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `factura_ventas`
--
ALTER TABLE `factura_ventas`
MODIFY `idFacturaVenta` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `productos_marcas`
--
ALTER TABLE `productos_marcas`
MODIFY `posicion` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT de la tabla `tipo_productos_venta`
--
ALTER TABLE `tipo_productos_venta`
MODIFY `idTipoProductoVenta` int(11) NOT NULL AUTO_INCREMENT;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `detalles_compras`
--
ALTER TABLE `detalles_compras`
ADD CONSTRAINT `detalles_compras_ibfk_1` FOREIGN KEY (`idFacturaCompra`) REFERENCES `facturas_de_compras` (`idFacturaCompra`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_compras_ibfk_2` FOREIGN KEY (`idTipoCantidad`) REFERENCES `tipos_de_cantidades` (`idTipoCantidad`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_compras_ibfk_3` FOREIGN KEY (`IdProductoMarca`) REFERENCES `productos_marcas` (`idProductoMarca`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `detalles_compras_insumos`
--
ALTER TABLE `detalles_compras_insumos`
ADD CONSTRAINT `detalles_compras_insumos_ibfk_2` FOREIGN KEY (`idFacturaCompra`) REFERENCES `facturas_de_compras` (`idFacturaCompra`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_compras_insumos_ibfk_3` FOREIGN KEY (`idTipoCantidad`) REFERENCES `tipos_de_cantidades` (`idTipoCantidad`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_compras_insumos_ibfk_4` FOREIGN KEY (`idInsumo`) REFERENCES `insumos` (`idInsumo`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `detalles_recetas`
--
ALTER TABLE `detalles_recetas`
ADD CONSTRAINT `detalles_recetas_ibfk_1` FOREIGN KEY (`idReceta`) REFERENCES `recetas` (`idReceta`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_recetas_ibfk_3` FOREIGN KEY (`idTipoCantidad`) REFERENCES `tipos_de_cantidades` (`idTipoCantidad`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `detalles_ventas`
--
ALTER TABLE `detalles_ventas`
ADD CONSTRAINT `detalles_ventas_ibfk_1` FOREIGN KEY (`idTipoProductoVenta`) REFERENCES `tipo_productos_venta` (`idTipoProductoVenta`) ON UPDATE CASCADE,
ADD CONSTRAINT `detalles_ventas_ibfk_2` FOREIGN KEY (`idFacturaVenta`) REFERENCES `factura_ventas` (`idFacturaVenta`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `facturas_de_compras`
--
ALTER TABLE `facturas_de_compras`
ADD CONSTRAINT `facturas_de_compras_ibfk_2` FOREIGN KEY (`idTipoCompra`) REFERENCES `tipos_de_compras` (`idTipoCompra`) ON UPDATE CASCADE,
ADD CONSTRAINT `facturas_de_compras_ibfk_3` FOREIGN KEY (`idProveedor`) REFERENCES `proveedores` (`idProveedor`) ON UPDATE CASCADE,
ADD CONSTRAINT `facturas_de_compras_ibfk_4` FOREIGN KEY (`idBodega`) REFERENCES `bodega` (`idBodega`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `factura_ventas`
--
ALTER TABLE `factura_ventas`
ADD CONSTRAINT `factura_ventas_ibfk_1` FOREIGN KEY (`idTipoDePago`) REFERENCES `tipos_de_pagos` (`idTipoDePago`) ON UPDATE CASCADE,
ADD CONSTRAINT `factura_ventas_ibfk_2` FOREIGN KEY (`IdVendedor`) REFERENCES `vendedores` (`idVendedor`) ON UPDATE CASCADE,
ADD CONSTRAINT `factura_ventas_ibfk_3` FOREIGN KEY (`idCliente`) REFERENCES `clientes` (`idCliente`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `municipios`
--
ALTER TABLE `municipios`
ADD CONSTRAINT `municipios_ibfk_1` FOREIGN KEY (`idDepartamento`) REFERENCES `departamentos` (`idDepartamento`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `productos_elaborados`
--
ALTER TABLE `productos_elaborados`
ADD CONSTRAINT `productos_elaborados_ibfk_1` FOREIGN KEY (`idReceta`) REFERENCES `recetas` (`idReceta`) ON UPDATE CASCADE,
ADD CONSTRAINT `productos_elaborados_ibfk_2` FOREIGN KEY (`idUbicacion`) REFERENCES `ubicaciones` (`idUbicacion`) ON UPDATE CASCADE,
ADD CONSTRAINT `productos_elaborados_ibfk_3` FOREIGN KEY (`idCategoria`) REFERENCES `categorias` (`idCategoria`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `productos_marcas`
--
ALTER TABLE `productos_marcas`
ADD CONSTRAINT `productos_marcas_ibfk_1` FOREIGN KEY (`idUbicacion`) REFERENCES `ubicaciones` (`idUbicacion`) ON UPDATE CASCADE,
ADD CONSTRAINT `productos_marcas_ibfk_2` FOREIGN KEY (`idCategotia`) REFERENCES `categorias` (`idCategoria`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `proveedores`
--
ALTER TABLE `proveedores`
ADD CONSTRAINT `proveedores_ibfk_1` FOREIGN KEY (`idMunicipio`) REFERENCES `municipios` (`idMunicipio`) ON UPDATE CASCADE,
ADD CONSTRAINT `proveedores_ibfk_2` FOREIGN KEY (`idDia`) REFERENCES `dias` (`idDia`) ON UPDATE CASCADE;
--
-- Filtros para la tabla `tipo_productos_venta`
--
ALTER TABLE `tipo_productos_venta`
ADD CONSTRAINT `tipo_productos_venta_ibfk_1` FOREIGN KEY (`idProductoElaborado`) REFERENCES `productos_elaborados` (`idProductoElaborado`) ON UPDATE CASCADE,
ADD CONSTRAINT `tipo_productos_venta_ibfk_2` FOREIGN KEY (`idProductoMarca`) REFERENCES `productos_marcas` (`idProductoMarca`) ON UPDATE CASCADE,
ADD CONSTRAINT `tipo_productos_venta_ibfk_3` FOREIGN KEY (`idPrecio`) REFERENCES `precios` (`idPrecio`) ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4315
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.38-0ubuntu0.14.04.1)
# Database: homestead
# Generation Time: 2014-10-09 03:15:42 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table ag_assigned_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_assigned_roles`;
CREATE TABLE `ag_assigned_roles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`role_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `assigned_roles_user_id_foreign` (`user_id`),
KEY `assigned_roles_role_id_foreign` (`role_id`),
CONSTRAINT `assigned_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `ag_roles` (`id`),
CONSTRAINT `assigned_roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `ag_users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_assigned_roles` WRITE;
/*!40000 ALTER TABLE `ag_assigned_roles` DISABLE KEYS */;
INSERT INTO `ag_assigned_roles` (`id`, `user_id`, `role_id`)
VALUES
(1,1,4);
/*!40000 ALTER TABLE `ag_assigned_roles` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_attributes
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_attributes`;
CREATE TABLE `ag_attributes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`gladiator_id` int(10) unsigned NOT NULL,
`power` int(11) NOT NULL,
`speed` int(11) NOT NULL,
`dexterity` int(11) NOT NULL,
`focus` int(11) NOT NULL,
`strength` int(11) NOT NULL,
`stamina` int(11) NOT NULL,
`reflex` int(11) NOT NULL,
`agility` int(11) NOT NULL,
`critical` int(11) NOT NULL,
`initiative` int(11) NOT NULL,
`hit` int(11) NOT NULL,
`doublehit` int(11) NOT NULL,
`block` int(11) NOT NULL,
`recovery` int(11) NOT NULL,
`counter` int(11) NOT NULL,
`dodge` int(11) NOT NULL,
`attack` int(11) NOT NULL,
`defense` int(11) NOT NULL,
`switch` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `attributes_gladiator_id_foreign` (`gladiator_id`),
CONSTRAINT `attributes_gladiator_id_foreign` FOREIGN KEY (`gladiator_id`) REFERENCES `ag_gladiators` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_failed_jobs
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_failed_jobs`;
CREATE TABLE `ag_failed_jobs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8_unicode_ci NOT NULL,
`queue` text COLLATE utf8_unicode_ci NOT NULL,
`payload` text COLLATE utf8_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_first_names
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_first_names`;
CREATE TABLE `ag_first_names` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `first_names_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_first_names` WRITE;
/*!40000 ALTER TABLE `ag_first_names` DISABLE KEYS */;
INSERT INTO `ag_first_names` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(1,'Diego','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(2,'Acco','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(3,'Adcobrovatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(4,'Adiatuanos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(5,'Amminos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(6,'Andecombogios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(7,'Aneirin','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(8,'Arandio','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(9,'Badicandos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(10,'Baeren','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(11,'Barrivendos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(12,'Belenos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(13,'Berdic','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(14,'Boduognatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(15,'Bolgios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(16,'Borvo','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(17,'Brennos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(18,'Brigomaglos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(19,'Brycham','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(20,'Budic','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(21,'Caburos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(22,'Cacumattos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(23,'Cadeyrn','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(24,'Cador','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(25,'Cadwalador','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(26,'Calpornos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(27,'Camulogenos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(28,'Caradog','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(29,'Caratacos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(30,'Caratawc','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(31,'Casticos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(32,'Catamantaloedis','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(33,'Catavignos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(34,'Catuvolcos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(35,'Cavarillos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(36,'Cavarinos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(37,'Ceanatis','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(38,'Celtillos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(39,'Cerethreos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(40,'Cintugnatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(41,'Cocolitanos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(42,'Cogidubnos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(43,'Conan','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(44,'Conconnetodom','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(45,'Convictolitavis','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(46,'Correos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(47,'Cotos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(48,'Critognatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(49,'Cunobelin','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(50,'Cunovindos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(51,'Custennyn','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(52,'Darnos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(53,'Dejotaros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(54,'Dennoros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(55,'Diviciacos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(56,'Divicoi','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(57,'Domnotauros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(58,'Drappes','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(59,'Drustan','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(60,'Dumnacos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(61,'Duratios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(62,'Eathomos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(63,'Enemnogenos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(64,'Enestinos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(65,'Epasnactos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(66,'Eporedemoros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(67,'Erbin','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(68,'Estes','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(69,'Faros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(70,'Fergalos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(71,'Fergusoe','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(72,'Flarn','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(73,'Galba','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(74,'Galligos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(75,'Geraint','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(76,'Glasobrin','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(77,'Gobannitio','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(78,'Gorteyrn','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(79,'Iccios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(80,'Indutiomaros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(81,'Ivomagos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(82,'Kondomos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(83,'Lannildot','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(84,'Liscos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(85,'Litaviccos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(86,'Lucco','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(87,'Lucterios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(88,'Lugort','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(89,'Mabon','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(90,'Maglocunos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(91,'Malac','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(92,'Malacos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(93,'Malbore','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(94,'Malechor','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(95,'Mallis','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(96,'Mandubracios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(97,'Matugenos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(98,'Meriadoc','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(99,'Messianuroc','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(100,'Moggortos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(101,'Morbhe','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(102,'Morbo','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(103,'Moritasgos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(104,'Motios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(105,'Mulgotoros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(106,'Nammeios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(107,'Ollovico','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(108,'Orgetoros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(109,'Orro','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(110,'Pallando','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(111,'Panda','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(112,'Periadoc','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(113,'Piso','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(114,'Praesutagos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(115,'Prasutagos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(116,'Riankiadoc','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(117,'Sedannuae','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(118,'Sedullos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(119,'Segovax','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(120,'Senaculos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(121,'Sennianos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(122,'Suros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(123,'Tancogeistla','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(124,'Tasciovanos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(125,'Tasgetios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(126,'Tauronos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(127,'Taximagulos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(128,'Teutomatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(129,'Tincommios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(130,'Togodumnos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(131,'Tredain','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(132,'Tregemlos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(133,'Troinos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(134,'Troucillos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(135,'Tyranos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(136,'Ulrigos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(137,'Valetiacos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(138,'Vellocatos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(139,'Vertico','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(140,'Vertiscos','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(141,'Verucloetios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(142,'Vindex','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(143,'Vindomorucios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(144,'Viridomaros','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(145,'Viridovix','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(146,'Virssuccios','2014-09-18 01:34:02','2014-09-18 01:34:02'),
(147,'Vortigern','2014-09-18 01:34:02','2014-09-18 01:34:02');
/*!40000 ALTER TABLE `ag_first_names` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_gladiators
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_gladiators`;
CREATE TABLE `ag_gladiators` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`nickname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`nickname_position` int(11) NOT NULL,
`ludus_id` int(10) unsigned NOT NULL,
`age` int(11) NOT NULL,
`style_a_id` int(10) unsigned NOT NULL,
`style_b_id` int(11) DEFAULT NULL,
`level` int(11) NOT NULL,
`xp` int(11) NOT NULL,
`career_length` int(11) NOT NULL,
`sparring_type` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `gladiators_ludus_id_foreign` (`ludus_id`),
KEY `gladiators_style_a_id_foreign` (`style_a_id`),
CONSTRAINT `gladiators_ludus_id_foreign` FOREIGN KEY (`ludus_id`) REFERENCES `ag_ludi` (`id`),
CONSTRAINT `gladiators_style_a_id_foreign` FOREIGN KEY (`style_a_id`) REFERENCES `ag_styles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_lanistae
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_lanistae`;
CREATE TABLE `ag_lanistae` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ludus_id` int(10) unsigned NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `lanistae_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_lanistae` WRITE;
/*!40000 ALTER TABLE `ag_lanistae` DISABLE KEYS */;
INSERT INTO `ag_lanistae` (`id`, `name`, `ludus_id`, `created_at`, `updated_at`)
VALUES
(2,'Wow',7,'2014-08-28 02:05:20','2014-08-28 02:05:20'),
(3,'Frank',8,'2014-08-28 02:05:43','2014-08-28 02:05:43'),
(4,'Joe Dringus',9,'2014-08-28 02:06:10','2014-08-28 02:06:10'),
(5,'Ballzac',10,'2014-10-01 03:45:51','2014-10-01 03:45:51');
/*!40000 ALTER TABLE `ag_lanistae` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_last_names
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_last_names`;
CREATE TABLE `ag_last_names` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `last_names_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_last_names` WRITE;
/*!40000 ALTER TABLE `ag_last_names` DISABLE KEYS */;
INSERT INTO `ag_last_names` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(1,'Tacocina','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(2,'Aduatuca','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(3,'Aler','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(4,'Amminos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(5,'Aquitae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(6,'Arandio','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(7,'Arduenna','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(8,'Arvern','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(9,'Arvernae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(10,'Aulerae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(11,'Banguvae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(12,'Bedhan','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(13,'Belgonica','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(14,'Bibrax','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(15,'Bolgia','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(16,'Bon','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(17,'Bonnonae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(18,'Bragolos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(19,'Breaghan','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(20,'Bregonae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(21,'Brehondin','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(22,'Dellowae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(23,'Domnoe','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(24,'Epoe','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(25,'Exornae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(26,'Helvetae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(27,'Iccios','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(28,'Indutiomaros','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(29,'Insubrae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(30,'Insubre','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(31,'Ivomagos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(32,'Lannildot','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(33,'Lemovicae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(34,'Liscos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(35,'Litaviccos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(36,'Logotorix','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(37,'Lugos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(38,'Mim','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(39,'Moedua','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(40,'Mosa','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(41,'Nervae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(42,'Nogolis','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(43,'Norae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(44,'Nunios','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(45,'Picorae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(46,'Rae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(47,'Rugos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(48,'Saddoe','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(49,'Saraneidae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(50,'Secullae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(51,'Sedannuae','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(52,'Sedullos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(53,'Segovax','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(54,'Sequa','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(55,'Silvoner','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(56,'Sinoa','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(57,'Sucellos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(58,'Tancogeistla','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(59,'Tasciovanos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(60,'Tasgetios','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(61,'Taximagulos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(62,'Telos','2014-09-18 01:35:52','2014-09-18 01:35:52'),
(63,'Vadoron','2014-09-18 01:35:52','2014-09-18 01:35:52');
/*!40000 ALTER TABLE `ag_last_names` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_ludi
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_ludi`;
CREATE TABLE `ag_ludi` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_id` int(11) unsigned NOT NULL,
`avatar` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`money` int(11) NOT NULL,
`region_id` int(11) unsigned NOT NULL,
`favor` int(11) NOT NULL,
`slots_gladiator` int(11) NOT NULL,
`slots_trainer` int(11) NOT NULL,
`earnings` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`wins_overall` int(11) NOT NULL,
`wins_active` int(11) NOT NULL,
`losses_overall` int(11) NOT NULL,
`losses_active` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `luduses_name_unique` (`name`),
KEY `luduses_region_id_foreign` (`region_id`),
KEY `luduses_user_id_foreign` (`user_id`),
CONSTRAINT `luduses_region_id_foreign` FOREIGN KEY (`region_id`) REFERENCES `ag_regions` (`id`),
CONSTRAINT `luduses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `ag_users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_ludi` WRITE;
/*!40000 ALTER TABLE `ag_ludi` DISABLE KEYS */;
INSERT INTO `ag_ludi` (`id`, `name`, `user_id`, `avatar`, `money`, `region_id`, `favor`, `slots_gladiator`, `slots_trainer`, `earnings`, `rank`, `wins_overall`, `wins_active`, `losses_overall`, `losses_active`, `created_at`, `updated_at`)
VALUES
(7,'Doge',1,'',1000,1,0,5,0,0,0,0,0,0,0,'2014-08-28 02:05:20','2014-08-28 02:05:20'),
(9,'Dinguses',1,'',1000,4,0,5,0,0,0,0,0,0,0,'2014-08-28 02:06:10','2014-08-28 02:06:10');
/*!40000 ALTER TABLE `ag_ludi` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_migrations
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_migrations`;
CREATE TABLE `ag_migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_migrations` WRITE;
/*!40000 ALTER TABLE `ag_migrations` DISABLE KEYS */;
INSERT INTO `ag_migrations` (`migration`, `batch`)
VALUES
('2014_08_07_025643_confide_setup_users_table',1),
('2014_08_07_030102_create_failed_jobs_table',1),
('2014_08_14_015504_entrust_setup_tables',2),
('2014_08_14_025158_create_luduses_table',3),
('2014_08_14_030416_create_regions_table',4),
('2014_08_14_031823_add_foreignkeys_to_luduses_table',5),
('2014_08_28_012106_create_lanistas_table',6),
('2014_08_28_023223_add_timestamps_to_styles_table',8),
('2014_08_28_023723_add_foreigns_to_styles_table',9),
('2014_08_28_021212_create_gladiators_table',10),
('2014_08_28_024749_add_all_to_gladiators_table',10),
('2014_09_10_010938_create_attributes_table',11),
('2014_09_10_013252_create_temp_gladiators_table',12),
('2014_09_10_014834_create_temp_attributes_table',12),
('2014_09_18_012744_create_firstNames_table',13),
('2014_09_18_012924_create_lastNames_table',13),
('2014_10_09_023531_add_region_id_to_temp_gladiators_table',14),
('2014_10_09_024545_add_career_max_to_temp_gladiators_table',15);
/*!40000 ALTER TABLE `ag_migrations` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_password_reminders
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_password_reminders`;
CREATE TABLE `ag_password_reminders` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_password_reminders` WRITE;
/*!40000 ALTER TABLE `ag_password_reminders` DISABLE KEYS */;
INSERT INTO `ag_password_reminders` (`email`, `token`, `created_at`)
VALUES
('timothyrowan@me.com','af8aabf621efcb9209d8929fb4877643','2014-08-07 03:17:57');
/*!40000 ALTER TABLE `ag_password_reminders` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_permission_role
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_permission_role`;
CREATE TABLE `ag_permission_role` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`permission_id` int(10) unsigned NOT NULL,
`role_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `permission_role_permission_id_foreign` (`permission_id`),
KEY `permission_role_role_id_foreign` (`role_id`),
CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `ag_permissions` (`id`),
CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `ag_roles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_permissions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_permissions`;
CREATE TABLE `ag_permissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `permissions_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_regions
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_regions`;
CREATE TABLE `ag_regions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_regions` WRITE;
/*!40000 ALTER TABLE `ag_regions` DISABLE KEYS */;
INSERT INTO `ag_regions` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(1,'Persia','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(2,'Rome','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(3,'Greece','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(4,'Gaul','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(5,'Germania','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(6,'Iberia','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(7,'Carthage','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(8,'Egypt','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(9,'Nubia','2014-08-14 03:10:49','2014-08-14 03:10:49'),
(10,'Hibernia','2014-08-14 03:10:49','2014-08-14 03:10:49');
/*!40000 ALTER TABLE `ag_regions` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_roles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_roles`;
CREATE TABLE `ag_roles` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `roles_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_roles` WRITE;
/*!40000 ALTER TABLE `ag_roles` DISABLE KEYS */;
INSERT INTO `ag_roles` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(3,'Standard','2014-08-14 02:04:26','2014-08-14 02:04:26'),
(4,'Admin','2014-08-14 02:04:26','2014-08-14 02:04:26');
/*!40000 ALTER TABLE `ag_roles` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_skill_genres
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_skill_genres`;
CREATE TABLE `ag_skill_genres` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Genre Name',
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `ag_skill_genres` WRITE;
/*!40000 ALTER TABLE `ag_skill_genres` DISABLE KEYS */;
INSERT INTO `ag_skill_genres` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(1,'Shield','2014-08-28 02:45:12','2014-08-28 02:45:12'),
(2,'Net','2014-08-28 02:45:12','2014-08-28 02:45:12'),
(3,'Dual Wield','2014-08-28 02:45:12','2014-08-28 02:45:12'),
(4,'Pet','2014-08-28 02:45:12','2014-08-28 02:45:12');
/*!40000 ALTER TABLE `ag_skill_genres` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_styles
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_styles`;
CREATE TABLE `ag_styles` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Style Name',
`weight` varchar(1) NOT NULL DEFAULT '' COMMENT 'Style Weight',
`weapon_genre_id` int(11) unsigned NOT NULL COMMENT 'Weapon Preference',
`skill_genre_id` int(11) unsigned NOT NULL COMMENT 'Skill Preference',
`pwr_multi` int(3) NOT NULL COMMENT 'OFF: Power',
`spd_multi` int(3) NOT NULL COMMENT 'OFF: Speed',
`dex_multi` int(3) NOT NULL COMMENT 'OFF: Dexterity',
`foc_multi` int(3) NOT NULL COMMENT 'OFF: Focus',
`str_multi` int(3) NOT NULL COMMENT 'DEF: Strength',
`stm_multi` int(3) NOT NULL COMMENT 'DEF: Stamina',
`ref_multi` int(3) NOT NULL COMMENT 'DEF: Reflex',
`agi_multi` int(3) NOT NULL COMMENT 'DEF: Agility',
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `styles_weapon_genre_id_foreign` (`weapon_genre_id`),
KEY `styles_skill_genre_id_foreign` (`skill_genre_id`),
CONSTRAINT `styles_skill_genre_id_foreign` FOREIGN KEY (`skill_genre_id`) REFERENCES `ag_skill_genres` (`id`),
CONSTRAINT `styles_weapon_genre_id_foreign` FOREIGN KEY (`weapon_genre_id`) REFERENCES `ag_weapon_genres` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `ag_styles` WRITE;
/*!40000 ALTER TABLE `ag_styles` DISABLE KEYS */;
INSERT INTO `ag_styles` (`id`, `name`, `weight`, `weapon_genre_id`, `skill_genre_id`, `pwr_multi`, `spd_multi`, `dex_multi`, `foc_multi`, `str_multi`, `stm_multi`, `ref_multi`, `agi_multi`, `created_at`, `updated_at`)
VALUES
(1,'Murmillo','H',1,1,125,100,100,200,125,100,200,100,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(2,'Spartanus','M',2,1,200,125,100,100,100,200,100,125,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(3,'Germanus','H',3,1,200,100,100,125,200,125,100,100,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(4,'Retiarius','M',2,2,100,125,200,100,100,100,125,200,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(5,'Laquearius','L',4,2,100,200,125,100,100,100,200,125,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(6,'Praedator','L',3,2,125,100,200,100,200,100,125,100,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(7,'Cerauno','H',3,3,100,200,100,125,100,125,200,100,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(8,'Scissor','L',4,3,100,200,125,100,100,100,125,200,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(9,'Dimachaerus','M',1,3,200,125,100,100,100,200,100,125,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(10,'Venator','H',2,4,100,100,125,200,200,125,100,100,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(11,'Beastiarii','L',4,4,100,100,200,125,125,100,100,200,'2014-08-28 02:45:20','2014-08-28 02:45:20'),
(12,'Molossus','M',1,4,125,100,100,200,125,200,100,100,'2014-08-28 02:45:20','2014-08-28 02:45:20');
/*!40000 ALTER TABLE `ag_styles` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_temp_attributes
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_temp_attributes`;
CREATE TABLE `ag_temp_attributes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`gladiator_id` int(10) unsigned NOT NULL,
`power` int(11) NOT NULL,
`speed` int(11) NOT NULL,
`dexterity` int(11) NOT NULL,
`focus` int(11) NOT NULL,
`strength` int(11) NOT NULL,
`stamina` int(11) NOT NULL,
`reflex` int(11) NOT NULL,
`agility` int(11) NOT NULL,
`critical` int(11) NOT NULL,
`initiative` int(11) NOT NULL,
`hit` int(11) NOT NULL,
`doublehit` int(11) NOT NULL,
`block` int(11) NOT NULL,
`recovery` int(11) NOT NULL,
`counter` int(11) NOT NULL,
`dodge` int(11) NOT NULL,
`attack` int(11) NOT NULL,
`defense` int(11) NOT NULL,
`switch` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `temp_attributes_gladiator_id_foreign` (`gladiator_id`),
CONSTRAINT `temp_attributes_gladiator_id_foreign` FOREIGN KEY (`gladiator_id`) REFERENCES `ag_temp_gladiators` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_temp_gladiators
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_temp_gladiators`;
CREATE TABLE `ag_temp_gladiators` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`selected` tinyint(1) NOT NULL DEFAULT '0',
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`nickname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`nickname_position` int(11) DEFAULT NULL,
`region_id` int(10) unsigned NOT NULL,
`ludus_id` int(10) unsigned NOT NULL,
`age` int(11) NOT NULL,
`style_a_id` int(10) unsigned NOT NULL,
`style_b_id` int(11) DEFAULT NULL,
`level` int(11) NOT NULL DEFAULT '1',
`xp` int(11) NOT NULL DEFAULT '0',
`sparring_type` int(11) NOT NULL,
`career_length` int(11) NOT NULL DEFAULT '0',
`career_max` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `temp_gladiators_ludus_id_foreign` (`ludus_id`),
KEY `temp_gladiators_style_a_id_foreign` (`style_a_id`),
KEY `temp_gladiators_region_id_foreign` (`region_id`),
CONSTRAINT `temp_gladiators_ludus_id_foreign` FOREIGN KEY (`ludus_id`) REFERENCES `ag_ludi` (`id`),
CONSTRAINT `temp_gladiators_region_id_foreign` FOREIGN KEY (`region_id`) REFERENCES `ag_regions` (`id`),
CONSTRAINT `temp_gladiators_style_a_id_foreign` FOREIGN KEY (`style_a_id`) REFERENCES `ag_styles` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
# Dump of table ag_users
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_users`;
CREATE TABLE `ag_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`confirmation_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`confirmed` tinyint(1) NOT NULL DEFAULT '0',
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
UNIQUE KEY `users_username_unique` (`username`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
LOCK TABLES `ag_users` WRITE;
/*!40000 ALTER TABLE `ag_users` DISABLE KEYS */;
INSERT INTO `ag_users` (`id`, `username`, `email`, `password`, `confirmation_code`, `remember_token`, `confirmed`, `first_name`, `last_name`, `created_at`, `updated_at`)
VALUES
(1,'timothyrowan','timothyrowan@me.com','$2y$10$75UgUE2xxxRgbqnautVrC./WecAhUZsf/Wwku8mY7NS2jSwBUnnRm','426f08d15bf7398a0fe3ad0209b1808b','4iqRLK9hiwZOc7ZHdIVhsy6AAMqbWtPdzIbvDlmkQTBTmCHQTCuqcwE0sxAu',1,'Timothy','Rowan','2014-08-07 03:13:35','2014-10-01 03:01:34');
/*!40000 ALTER TABLE `ag_users` ENABLE KEYS */;
UNLOCK TABLES;
# Dump of table ag_weapon_genres
# ------------------------------------------------------------
DROP TABLE IF EXISTS `ag_weapon_genres`;
CREATE TABLE `ag_weapon_genres` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Genre Name',
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
LOCK TABLES `ag_weapon_genres` WRITE;
/*!40000 ALTER TABLE `ag_weapon_genres` DISABLE KEYS */;
INSERT INTO `ag_weapon_genres` (`id`, `name`, `created_at`, `updated_at`)
VALUES
(1,'Sword','2014-08-28 02:45:03','2014-08-28 02:45:03'),
(2,'Spear','2014-08-28 02:45:03','2014-08-28 02:45:03'),
(3,'Axe','2014-08-28 02:45:03','2014-08-28 02:45:03'),
(4,'Handblade','2014-08-28 02:45:03','2014-08-28 02:45:03');
/*!40000 ALTER TABLE `ag_weapon_genres` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
#Closing month and year, change it to the intended closing month and year
SET @month = 12;
SET @year = 2017;
SET @depreBulkBangunan = 24352052195;#Desember
############################################################################################################################################
####################################################### Monthly Closing ####################################################################
############################################################################################################################################
SET @faryear = CONCAT("FAR",@year);
SET @addition_period = LAST_DAY(CONCAT(CAST(@year AS CHAR(4)),"-", CAST(@month AS CHAR(2)),"-", "1"));
TRUNCATE TABLE far_addition_monthly;
#Import the addition far to far_addition_monthly
UPDATE `far_addition_monthly` SET `addition_period` = @addition_period, source = @faryear, source_detail = @faryear;
CALL `fill_categoryId_byTableName`("far_addition_monthly");
CALL `fill_dpis_monthAndyear_by_tableName`("far_addition_monthly");
CALL `calculate_depre_from_1996_to_parameterYear`(@year,"far_addition_monthly");
CALL `calculate_depre_monthly_for_a_year`(@year, "far_addition_monthly");
CALL `recalculate_akum_upto`(@year-1, "far_addition_monthly");
CALL `insert_table_from_to`("far_addition_monthly", "far_depre");
UPDATE far_depre SET source_detail2=source WHERE source_detail2 ='';
UPDATE `far_depre` SET kelompok_aset = get_kelompok_aset(category_id) WHERE kelompok_aset IS NULL;
TRUNCATE TABLE manual;
#Import the manual to manual table
UPDATE `manual` SET `addition_period` = @addition_period, source = "Manual", source_detail = "Manual";
CALL `fill_categoryId_byTableName`("manual");
CALL `fill_dpis_monthAndyear_by_tableName`("manual");
UPDATE manual SET category_id = "ARO" WHERE asset_id IN(
#Fill these with ARO asset number
);
CALL `calculate_depre_from_1996_to_parameterYear`(@year,"manual");
CALL `calculate_depre_monthly_for_a_year`(@year, "manual");
CALL `recalculate_akum_upto`(@year-1, "manual");
TRUNCATE TABLE intangible_asset;
#Import the intangible asset to intangible_asset table
UPDATE `intangible_asset` SET `addition_period` = @addition_period, source_detail = source;
CALL `fill_categoryId_byTableName`("intangible_asset");
CALL `fill_dpis_monthAndyear_by_tableName`("intangible_asset");
CALL `calculate_depre_from_1996_to_parameterYear`(@year,"intangible_asset");
CALL `calculate_depre_monthly_for_a_year`(@year, "intangible_asset");
CALL `recalculate_akum_upto`(@year-1, "intangible_asset");
TRUNCATE TABLE `write_off`;
#Import the write off to write_off table
UPDATE write_off SET give_up_date = @addition_period;
CALL `write_off_mapping`(@month,@year);
SELECT * FROM control_bulk_2005;
SELECT * FROM mapping_write_off;
CALL `update_write_off_date`(@month,@year);
CALL `fill_categoryId_byTableName`("mapping_write_off");
CALL `fill_dpis_monthAndyear_by_tableName`("mapping_write_off");
CALL `calculate_depre_from_1996_to_parameterYear`(@year,"mapping_write_off");
CALL `calculate_depre_by_month_year_tableName`(@month-1,@year,"mapping_write_off");
CALL `update_depre_nbv_wo_by_month_year`(@month-1,@year);
CALL `recalculate_akum_upto`(@year-1, "mapping_write_off");
CALL `insert_table_from_to`("mapping_write_off", "write_off_depre");
CALL `calculateChargingDepre`(@year);
#Create pivot table for each category_id
CALL `get_pivot_all`(@month,@year);
DROP TABLE IF EXISTS pivotManual;
CALL `get_pivot_manual`(@month, @year, "pivotManual");
DROP TABLE IF EXISTS pivotIntangibleAsset;
CALL `get_pivot_intangible_asset`(@month, @year, "pivotIntangibleAsset");
#Pivot WO Tower
SELECT source_detail, SUM(cost) AS cost FROM far_depre WHERE write_off_date = @addition_period AND asset_number IN
(SELECT asset_number FROM write_off_depre WHERE tower > 0 AND give_up_date = @addition_period) GROUP BY source_detail;
#Display SL0608 pivot by year
SET @stmt = CONCAT("select source_detail, sum(cost) as cost,sum(akum_upto_prev_year) as akum_upto_prev_year, sum(dm",@month,"_",@year,") as dm",@month,"_",@year," from far_depre where source = 'SL0608' and write_off_date is null group by source_detail;");
PREPARE stmt FROM @smt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
#Pivot bulk 2005
DROP TABLE IF EXISTS pivotBulk2005;
#This amount is used as parameter in prepare_file_upload @akum_bulk
SET @stmt = CONCAT('set @depreTowerBulk = (select sum(dm',@month,'_',@year,') from far_depre where source_detail = "Tower 2005");');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @bulk2005 = 4358183121883;
SET @stmt = CONCAT('create table pivotBulk2005 as SELECT SUM(cost)+ @bulk2005 AS cost_2005, @depreBulkBangunan + @depreTowerBulk as dm',@month,'_',@year,' FROM far_depre WHERE source="bulk_2005";');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
############################################################################################################################################
##################################################### New Year Calculation #################################################################
############################################################################################################################################
USE cit_asset;
SET @year = 2018;
CALL `calculate_depre_monthly_for_a_year`(@year, "far_depre");
CALL `calculate_depreTower_year`(@year, "far_depre");
CALL `calculate_depre_monthly_for_a_year`(@year, "far_depre");
CALL `recalculate_akum_upto`(@year-1, "far_depre");
CALL `drop_dm_nm_for_year`(@year-1, "far_depre");
SET GLOBAL innodb_lock_wait_timeout = 5000; |
delete from HtmlLabelIndex where id=27637
/
delete from HtmlLabelInfo where indexid=27637
/
INSERT INTO HtmlLabelIndex values(27637,'高层领导')
/
INSERT INTO HtmlLabelInfo VALUES(27637,'高层领导',7)
/
INSERT INTO HtmlLabelInfo VALUES(27637,'Senior leadership',8)
/
INSERT INTO HtmlLabelInfo VALUES(27637,'高層領導',9)
/
delete from HtmlLabelIndex where id=27638
/
delete from HtmlLabelInfo where indexid=27638
/
INSERT INTO HtmlLabelIndex values(27638,'非高层领导')
/
INSERT INTO HtmlLabelInfo VALUES(27638,'非高层领导',7)
/
INSERT INTO HtmlLabelInfo VALUES(27638,'Non-senior leadership',8)
/
INSERT INTO HtmlLabelInfo VALUES(27638,'非高層領導',9)
/
delete from HtmlLabelIndex where id=27641
/
delete from HtmlLabelInfo where indexid=27641
/
INSERT INTO HtmlLabelIndex values(27641,'全天')
/
INSERT INTO HtmlLabelInfo VALUES(27641,'全天',7)
/
INSERT INTO HtmlLabelInfo VALUES(27641,'all day',8)
/
INSERT INTO HtmlLabelInfo VALUES(27641,'全天',9)
/
|
delete from HtmlLabelIndex where id=21635
/
delete from HtmlLabelInfo where indexid=21635
/
INSERT INTO HtmlLabelIndex values(21635,'如选,创建文档字段只显示新建,不显示选择和清除')
/
delete from HtmlLabelIndex where id=21634
/
delete from HtmlLabelInfo where indexid=21634
/
INSERT INTO HtmlLabelIndex values(21634,'是否只能新建正文')
/
INSERT INTO HtmlLabelInfo VALUES(21634,'是否只能新建正文',7)
/
INSERT INTO HtmlLabelInfo VALUES(21634,'The only new body',8)
/
INSERT INTO HtmlLabelInfo VALUES(21635,'如选,创建文档字段只显示新建,不显示选择和清除',7)
/
INSERT INTO HtmlLabelInfo VALUES(21635,'If elected, to create new documents show only field, do not show selection and removal',8)
/
|
create database repositorios;
use repositorios;
CREATE TABLE IF NOT EXISTS `repositorios` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`nome` varchar(100) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
INSERT INTO repositorios (id, nome) VALUES (1,'repositorio 1'),(2,'repositorio 2'),(3,'repositorio 3'); |
SELECT teachers.name AS teacher, students.name AS student, assignments.name AS assignment, (completed_at - started_at) AS duration
FROM assistance_requests
JOIN teachers ON teachers.id=teacher_id
JOIN students ON students.id=student_id
JOIN assignments ON assignments.id=assignment_id
ORDER BY duration;
|
delete from HtmlLabelIndex where id=28152
/
delete from HtmlLabelInfo where indexid=28152
/
INSERT INTO HtmlLabelIndex values(28152,'当前CSS样式已被模板引用,确认删除吗?')
/
INSERT INTO HtmlLabelInfo VALUES(28152,'当前CSS样式已被模板引用,确认删除吗?',7)
/
INSERT INTO HtmlLabelInfo VALUES(28152,'This css-style has be quoted. Sure to delete?',8)
/
INSERT INTO HtmlLabelInfo VALUES(28152,'當前CSS樣式已被模闆引用,确認删除嗎?',9)
/ |
DELETE FROM PARTICIPANTS
WHERE
KNOWLEDGE_ID = ?
AND USER_ID = ?
;
|
SELECT --BASIC DATA
sc.id AS ID,
sc.col_id AS COL_ID,
sc.caseid AS CaseId,
sc.extsysid AS ExtSysId,
sc.integtarget_id AS IntegTarget_Id,
sc.summary AS SUMMARY,
sc.description AS Description,
sc.createdby AS CreatedBy,
sc.createddate AS CreatedDate,
sc.modifiedby AS ModifiedBy,
sc.modifieddate AS ModifiedDate,
sc.dateassigned AS DateAssigned,
sc.dateclosed AS DateClosed,
sc.manualworkduration AS ManualWorkDuration,
sc.manualdateresolved AS ManualDateResolved,
sc.resolutiondescription AS ResolutionDescription,
sc.draft AS Draft,
sc.casefrom AS CaseFrom,
--CASE TYPE
sc.casesystype_id AS CaseSysType_Id,
sc.casesystype_name AS CaseSysType_Name,
sc.casesystype_code AS CaseSysType_Code,
sc.casesystype_iconcode AS CaseSysType_IconCode,
sc.casesystype_colorcode AS CaseSysType_ColorCode,
sc.casesystype_usedatamodel AS CaseSysType_UseDataModel,
sc.casesystype_isdraftmodeavail AS CaseSysType_IsDraftModeAvail,
--WORKITEM
sc.workitem_id AS Workitem_Id,
sc.workitem_activity AS Workitem_Activity,
sc.workitem_workflow AS Workitem_Workflow,
--PRIORITY
sc.priority_id AS Priority_Id,
sc.priority_name AS Priority_Name,
sc.priority_value AS Priority_Value,
--CASE STATE
sc.casestate_id AS CaseState_Id,
sc.casestate_name AS CaseState_name,
sc.casestate_isstart AS CaseState_ISSTART,
sc.casestate_isresolve AS CaseState_ISRESOLVE,
sc.casestate_isfinish AS CaseState_ISFINISH,
sc.casestate_isassign AS CaseState_ISASSIGN,
sc.casestate_isfix AS CaseState_ISFIX,
sc.casestate_isinprocess AS CaseState_ISINPROCESS,
sc.casestate_isdefaultoncreate AS CaseState_ISDEFAULTONCREATE,
--OWNERSHIP
sc.workbasket_id AS Workbasket_id,
sc.workbasket_name AS Workbasket_name,
sc.owner_caseworker_name AS Owner_CaseWorker_Name,
sc.workbasket_type_name AS Workbasket_type_name,
sc.workbasket_type_code AS Workbasket_type_code,
--RESOLUTION
sc.resolutioncode_id AS ResolutionCode_Id,
sc.resolutioncode_name AS ResolutionCode_Name,
sc.resolutioncode_code AS ResolutionCode_Code,
sc.resolutioncode_icon AS ResolutionCode_Icon,
sc.resolutioncode_theme AS ResolutionCode_Theme,
--sc.hoursspent AS HoursSpent,
--MILESTONE
/*sc.milestone_id AS Milestone_Id,
sc.milestone_name AS Milestone_Name,
sc.milestone_code AS Milestone_Code,*/
sc.ms_stateid AS MS_StateId,
sc.ms_statename AS MS_StateName,
--Goal SLA
sc.GoalSlaEventTypeId, sc.GoalSlaEventTypeCode, sc.GoalSlaEventTypeName, sc.GoalSlaDateTime,
F_util_getdrtnfrmnow(sc.GoalSlaDateTime) AS GoalSlaDuration,
--DeadLine (DLine) SLA
sc.DLineSlaEventTypeId, sc.DLineSlaEventTypeCode, sc.DLineSlaEventTypeName, sc.DLineSlaDateTime,
F_util_getdrtnfrmnow(sc.DLineSlaDateTime) AS DLineSlaDuration,
--CALCULATED FIELDS
f_getNameFromAccessSubject (sc.createdby) AS CreatedBy_Name,
f_UTIL_getDrtnFrmNow (sc.createddate) AS CreatedDuration,
f_getNameFromAccessSubject (sc.modifiedby) AS ModifiedBy_Name,
f_UTIL_getDrtnFrmNow (sc.modifieddate) AS ModifiedDuration
FROM vw_dcm_simplecaselist sc
INNER JOIN
tbl_ac_casetypeviewcache ctvc
ON sc.CaseSysType_Id = ctvc.col_casetypeviewcachecasetype
AND ctvc.col_accesssubjectcode =
SYS_CONTEXT ('CLIENTCONTEXT', 'AccessSubject') |
SELECT A.TZ_APP_INS_ID,ROUND(RAND()*9999) SJS
FROM PS_TZ_CLPS_KSH_TBL A
WHERE NOT EXISTS (
SELECT 'Y' FROM (
SELECT M.TZ_CLASS_ID,M.TZ_APPLY_PC_ID,M.TZ_APP_INS_ID
FROM (SELECT C.TZ_CLASS_ID,C.TZ_APPLY_PC_ID,C.TZ_APP_INS_ID,COUNT(1) ZDPWS
FROM PS_TZ_CP_PW_KS_TBL B,PS_TZ_CLPS_KSH_TBL C
WHERE C.TZ_CLASS_ID=B.TZ_CLASS_ID AND C.TZ_APPLY_PC_ID=B.TZ_APPLY_PC_ID AND C.TZ_APP_INS_ID=B.TZ_APP_INS_ID
GROUP BY C.TZ_CLASS_ID,C.TZ_APPLY_PC_ID,C.TZ_APP_INS_ID) M
WHERE M.ZDPWS>=?
) X
WHERE X.TZ_CLASS_ID=A.TZ_CLASS_ID AND X.TZ_APPLY_PC_ID=A.TZ_APPLY_PC_ID AND X.TZ_APP_INS_ID=A.TZ_APP_INS_ID)
AND NOT EXISTS (
SELECT 'Y' FROM (
SELECT D.TZ_CLASS_ID,D.TZ_APPLY_PC_ID,D.TZ_APP_INS_ID
FROM PS_TZ_CP_PW_KS_TBL D,PS_TZ_CLPS_PW_TBL E,PS_TZ_CLPS_KSH_TBL F
WHERE D.TZ_CLASS_ID=F.TZ_CLASS_ID AND D.TZ_APPLY_PC_ID=F.TZ_APPLY_PC_ID AND D.TZ_APP_INS_ID=F.TZ_APP_INS_ID
AND D.TZ_CLASS_ID=E.TZ_CLASS_ID AND D.TZ_APPLY_PC_ID=E.TZ_APPLY_PC_ID AND D.TZ_PWEI_OPRID=E.TZ_PWEI_OPRID
AND E.TZ_PWZBH=? ) Y
WHERE Y.TZ_CLASS_ID=A.TZ_CLASS_ID AND Y.TZ_APPLY_PC_ID=A.TZ_APPLY_PC_ID AND Y.TZ_APP_INS_ID=A.TZ_APP_INS_ID
)
AND A.TZ_CLASS_ID=? AND A.TZ_APPLY_PC_ID=?
ORDER BY SJS
LIMIT 0,1 |
SET SERVEROUTPUT ON
DECLARE
v_exist NUMBER := 0;
BEGIN
SELECT 1
INTO v_exist
FROM all_tab_cols
WHERE table_name = 'GIAC_ALMA_EXT'
AND column_name = 'EFF_DATE'
AND owner = 'CPI';
IF v_exist = 1
THEN
DBMS_OUTPUT.put_line
('Column EFF_DATE already exist on table GIAC_ALMA_EXT.');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
EXECUTE IMMEDIATE 'ALTER TABLE giac_alma_ext ADD (eff_date VARCHAR2 (8))';
DBMS_OUTPUT.put_line
('Successfully added column EFF_DATE to table GIAC_ALMA_EXT.');
END; |
use telco;
SELECT *
FROM customers;
# Gender is about equal
SELECT distinct(gender),
count(gender)
FROM customers
GROUP BY gender;
# There is more customer retention than churn
SELECT distinct(Churn),
count(Churn) as 'count'
FROM customers
GROUP BY Churn;
# Top 10 customers by TotalCharges
SELECT customerID,
MonthlyCharges,
TotalCharges
FROM customers
ORDER BY TotalCharges DESC
LIMIT 10;
# top 10 customers mostly have extras and only 1 has Churned
SELECT customerID,
PhoneService,
MultipleLines,
InternetService,
OnlineSecurity,
OnlineBackup,
DeviceProtection,
TechSupport,
StreamingTV,
StreamingMovies,
Contract,
TotalCharges,
Churn
FROM customers
ORDER BY TotalCharges DESC
LIMIT 10 |
create sequence PLE_PROCEDIMENT_SEQ start 1 increment 1;
create sequence PLE_UNITATORGANICA_SEQ start 1 increment 1;
create table PLE_PROCEDIMENT (
ID int8 not null,
CODISIA varchar(8) not null,
NOM varchar(50) not null,
UNITATORGANICAID int8 not null,
constraint PLE_PROCEDIMENT_PK primary key (ID)
);
create table PLE_UNITATORGANICA (
ID int8 not null,
CODIDIR3 varchar(9) not null,
DATACREACIO date not null,
ESTAT int4 not null,
NOM varchar(50) not null,
constraint PLE_UNITAT_PK primary key (ID)
);
create index PLE_PROCEDIMENT_PK_I on PLE_PROCEDIMENT (ID);
create index PLE_PROCEDIMENT_CODISIA_UK_I on PLE_PROCEDIMENT (CODISIA);
create index PLE_PROCEDIMENT_UNITAT_FK_I on PLE_PROCEDIMENT (UNITATORGANICAID);
alter table PLE_PROCEDIMENT
add constraint PLE_PROCEDIMENT_CODISIA_UK unique (CODISIA);
create index PLE_UNITAT_PK_I on PLE_UNITATORGANICA (ID);
create index PLE_UNITAT_CODIDIR3_UK_I on PLE_UNITATORGANICA (CODIDIR3);
alter table PLE_UNITATORGANICA
add constraint PLE_UNITAT_CODIDIR3_UK unique (CODIDIR3);
alter table PLE_PROCEDIMENT
add constraint PLE_PROCEDIMENT_UNITAT_FK
foreign key (UNITATORGANICAID)
references PLE_UNITATORGANICA;
|
INSERT INTO burgers (burgerName, devoured) VALUES ('bacon cheese burger', false);
INSERT INTO burgers (burgerName, devoured) VALUES ('chicken burger', false);
INSERT INTO burgers (burgerName, devoured) VALUES ('veggie burger', false);
|
SELECT COUNT(*) FROM LOGIN_HISTORIES
WHERE DELETE_FLAG = 0;
|
/*
case 와 pivot 이해
정원혁 / 2014.11. 재작성
*/
use pubs
select stor_id, year(ord_date) as yr, qty
from sales
order by 1, 2
/*
case when 조건 then 참 else 거짓 end
case 조건 when 조건값 then 참 else 거짓 end
*/
select stor_id, year(ord_date) as yr, qty
, case
when qty>=50 then 'A'
when qty>=20 then 'B'
else 'C'
end as 등급
from sales
order by 1, 2
select stor_id, year(ord_date) as yr, qty
from sales
order by 1, 2
select stor_id
, case year(ord_date) when 1992 then qty else 0 end as y92
, case year(ord_date) when 1993 then qty else 0 end as y93
, case year(ord_date) when 1994 then qty else 0 end as y94
from sales
select stor_id
, sum( case year(ord_date) when 1992 then qty else 0 end ) as y92
, sum( case year(ord_date) when 1993 then qty else 0 end ) as y93
, sum( case year(ord_date) when 1994 then qty else 0 end ) as y94
from sales
group by stor_id
select stor_id, isnull([1992],0) as [1992],[1993],[1994]
from
(
select stor_id, year(ord_date) as yr, qty
from sales
) src
PIVOT (
sum(qty) for yr IN ([1992],[1993],[1994])
) pvt
|
SET VERIFY OFF
SET FEEDBACK OFF
COL dummy NOPRINT
COL module FOR a50
COL rank_bg HEAD "RANK MODULE" FOR 999
COL percentage HEAD "%" FOR 990d00
COMPUTE SUM OF bg ON dummy
COMPUTE SUM OF percentage ON dummy
BREAK ON dummy SKIP PAGE
ACCEPT pBegin PROMPT "Type begin date (ddmmyyyy) [01012015]: "
ACCEPT pEnd PROMPT "Type end date (ddmmyyyy) [NULL]: "
REPHEADER LEFT COL 9 '**********************************' SKIP 1 -
COL 9 '* TOP 5 MODULOS POR BUFFER GETS *' SKIP 1 -
COL 9 '**********************************' SKIP 2
SELECT module
, rank
, ROUND(RATIO_TO_REPORT (BG) OVER (PARTITION BY bg_total) * 100,2) percentage
, bg
, bg_total
FROM (
SELECT module
, RANK() OVER (ORDER BY SUM(buffer_gets_delta) DESC) RANK
, SUM(buffer_gets_delta) BG
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
--AND a.module LIKE '%MAP_Q_TRANSACOES%'
--AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN NVL(TO_DATE('&pBegin','DDMMYYYY'),TO_DATE('01012015','DDMMYYYY'))
AND NVL(TRUNC(TO_DATE('&&pEnd','DDMMYYYY'))+1,SYSDATE)
GROUP BY module
),
(
SELECT SUM(buffer_gets_delta) BG_TOTAL
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
--AND a.module LIKE '%MAP_Q_TRANSACOES%'
--AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN NVL(TO_DATE('&pBegin','DDMMYYYY'),TO_DATE('01012015','DDMMYYYY'))
AND NVL(TRUNC(TO_DATE('&&pEnd','DDMMYYYY'))+1,SYSDATE)
)
GROUP BY module, rank, bg, bg_total
HAVING rank < 6
ORDER BY 2
/
REPHEADER LEFT COL 9 '******************************************' SKIP 1 -
COL 9 '* TOP SQL_ID DOS MODULOS POR BUFFER GETS *' SKIP 1 -
COL 9 '******************************************' SKIP 2
SELECT a.module DUMMY
, a.module
, c.rank_bg
, sql_id
, RANK() OVER (PARTITION BY a.module ORDER BY SUM(buffer_gets_delta) DESC) "RANK SQL_ID"
, ROUND(RATIO_TO_REPORT (SUM(buffer_gets_delta)) OVER (PARTITION BY a.module) * 100,2) percentage
, SUM(buffer_gets_delta) BG
, ROUND(SUM(buffer_gets_delta)/SUM(executions_delta)) "BG/EXEC"
, SUM(executions_delta) EXECS
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
, ( SELECT module
, rank() over (order by (SUM(buffer_gets_delta)) desc) rank_bg
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
--AND a.module LIKE '%MAP_Q_TRANSACOES%'
--AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN NVL(TO_DATE('&pBegin','DDMMYYYY'),TO_DATE('01012015','DDMMYYYY'))
AND NVL(TRUNC(TO_DATE('&&pEnd','DDMMYYYY'))+1,SYSDATE)
GROUP BY module
) c
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
--AND a.module LIKE '%MAP_Q_TRANSACOES%'
--AND a.module NOT IN ('DBMS_SCHEDULER')
AND a.module = c.module
AND b.end_interval_time BETWEEN NVL(TO_DATE('&pBegin','DDMMYYYY'),TO_DATE('01012015','DDMMYYYY'))
AND NVL(TRUNC(TO_DATE('&&pEnd','DDMMYYYY'))+1,SYSDATE)
GROUP BY a.module, c.rank_bg, sql_id
HAVING rank_bg < 6
ORDER BY 3, 2, 5
SET VERIFY ON
/*
COL teste FOR 990d00
CLEAR BREAK
SELECT module
, RANK() OVER (ORDER BY SUM(buffer_gets_delta) DESC) RANK
, SUM(buffer_gets_delta) BG
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
AND a.module LIKE '%R'
AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN TO_DATE('01/04/2012 00:00','DD/MM/YYYY HH24:MI')
AND TO_DATE('15/04/2012 00:00','DD/MM/YYYY HH24:MI')
GROUP BY module
ORDER BY 2
/
SELECT module
, RANK() OVER (ORDER BY SUM(buffer_gets_delta) DESC) RANK
, SUM(buffer_gets_delta) BG
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
AND a.module LIKE '%F'
AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN TO_DATE('01/04/2012 00:00','DD/MM/YYYY HH24:MI')
AND TO_DATE('15/04/2012 00:00','DD/MM/YYYY HH24:MI')
GROUP BY module
ORDER BY 2
/
BREAK ON module SKIP PAGE
SELECT module
, sql_id
, RANK() OVER (PARTITION BY module ORDER BY SUM(buffer_gets_delta) DESC) RANK
, ROUND(RATIO_TO_REPORT (SUM(buffer_gets_delta)) OVER (PARTITION BY module) * 100,2) "%"
, SUM(buffer_gets_delta) BG
, ROUND(SUM(buffer_gets_delta)/SUM(executions_delta)) "BG/EXEC"
, SUM(executions_delta) EXECS
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
AND a.module LIKE '%R'
AND a.module NOT IN ('DBMS_SCHEDULER')
AND b.end_interval_time BETWEEN TO_DATE('01/04/2012 00:00','DD/MM/YYYY HH24:MI')
AND TO_DATE('15/04/2012 00:00','DD/MM/YYYY HH24:MI')
GROUP BY module, sql_id
ORDER BY 1, 3
/
SELECT module
, sql_id
, RANK() OVER (PARTITION BY module ORDER BY SUM(buffer_gets_delta) DESC) RANK
, ROUND(RATIO_TO_REPORT (SUM(buffer_gets_delta)) OVER (PARTITION BY module) * 100,2) TESTE
, SUM(buffer_gets_delta) BG
, ROUND(SUM(buffer_gets_delta)/SUM(executions_delta)) "BG/EXEC"
, SUM(executions_delta) EXECS
FROM dba_hist_sqlstat a
, dba_hist_snapshot b
WHERE a.dbid = b.dbid
AND a.snap_id = b.snap_id
AND a.executions_delta > 0
AND a.module LIKE '%F'
AND b.end_interval_time BETWEEN TO_DATE('01/04/2012 00:00','DD/MM/YYYY HH24:MI')
AND TO_DATE('15/04/2012 00:00','DD/MM/YYYY HH24:MI')
GROUP BY module, sql_id
ORDER BY 1, 3
/
*/ |
## Update SP to add a User if it was already removed once ##
USE `${DB_MAIN}`;
DROP procedure IF EXISTS `Team_AddUser`;
DELIMITER $$
USE `${DB_MAIN}`$$
CREATE PROCEDURE `Team_AddUser`(
pTeamId INT,
pUserId INT,
pDataRoleId INT
)
BEGIN
DECLARE varDataRoleId INT UNSIGNED;
DECLARE varTeamId INT UNSIGNED;
SET varDataRoleId = (select Id from UserDataRole where TeamId=pTeamId and DataRoleId=pDataRoleId and UserId=pUserId);
IF varDataRoleId is null then
SET varDataRoleId = (select Id from UserDataRole where TeamId=pTeamId and UserId=pUserId);
#User is not a member of the team
IF varDataRoleId is null then
INSERT INTO UserDataRole(UserId, DataRoleId, TeamId, CreatedAt, `Status`)
VALUES (pUserId, pDataRoleId, pTeamId, NOW(), 1);
SET varDataRoleId =(SELECT LAST_INSERT_ID());
ELSE
#Change the role in the team to the selected one
UPDATE UserDataRole SET DataRoleId = pDataRoleId WHERE (TeamId = pTeamId AND UserId = pUserId);
END IF;
ELSE
UPDATE UserDataRole
SET `Status` = 1
WHERE Id=varDataRoleId;
END IF;
select 'Role Assigned' message;
END$$
DELIMITER ; |
exec sp_changepublication
@publication = 'Publication',
@property = 'allow_anonymous',
@value = 'false'
exec sp_changepublication
@publication = 'Publication',
@property = 'immediate_sync',
@value = 'false'
|
CREATE TABLE IF NOT EXISTS Log_type(
ID serial primary key,
Ltype VARCHAR(450) NOT NULL);
INSERT INTO Log_type (ID, Ltype) VALUES
(1, 'Duplicate')
, (2, 'sql error')
, (3, 'Device_not_auth')
, (4, 'info_DATA')
, (5, 'login_failed')
, (6, 'login_sucess')
, (7, 'report_IP')
, (8, 'page_priviledge')
, (9, 'web_service_priviledge')
, (10, 'blocked_ip')
, (11, 'login_blocked_three_times')
, (12, 'Device_auth')
, (13, 'Group_Closed')
, (14, 'NO_page_priviledge')
, (15, 'NO_web_service_priviledge')
, (16, 'email_login_failed')
, (17, 'blocked_email')
, (18, 'email_status')
, (19, 'user_blocked')
, (20, 'user_not_Active')
, (21, 'blocked_telephone')
, (22, 'telephone_status')
, (23, 'telephone_login_failed')
, (24, 'username_login_failed')
, (25, 'no_user_no_email_no_tele')
, (26, 'Device_blocked')
, (27, 'password_wrong')
, (28, 'password_correct')
, (29, 'User_auth')
, (30, 'User_not_auth')
, (31, 'User_not_login')
, (32, 'User_creation')
, (33, 'account_creation')
, (34, 'Currency')
, (35, 'flow type')
, (36, 'Account')
, (37, 'Transfer');
|
DELETE FROM HtmlLabelIndex WHERE id=19990
/
DELETE FROM HtmlLabelInfo WHERE indexid=19990
/
INSERT INTO HtmlLabelIndex values(19990,'确认是否提交?')
/
INSERT INTO HtmlLabelInfo VALUES(19990,'确认是否提交?',7)
/
INSERT INTO HtmlLabelInfo VALUES(19990,'sure to submit?',8)
/
DELETE FROM HtmlLabelIndex WHERE id=19991
/
DELETE FROM HtmlLabelInfo WHERE indexid=19991
/
INSERT INTO HtmlLabelIndex values(19991,'确认是否退回?')
/
INSERT INTO HtmlLabelInfo VALUES(19991,'确认是否退回?',7)
/
INSERT INTO HtmlLabelInfo VALUES(19991,'sure to back?',8)
/
DELETE FROM HtmlLabelIndex WHERE id=19992
/
DELETE FROM HtmlLabelInfo WHERE indexid=19992
/
INSERT INTO HtmlLabelIndex values(19992,'确认是否转发?')
/
INSERT INTO HtmlLabelInfo VALUES(19992,'确认是否转发?',7)
/
INSERT INTO HtmlLabelInfo VALUES(19992,'sure to transmit?',8)
/
|
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 01, 2015 at 08:17 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `softdev_calanno_flordeliza_ourspace`
--
-- --------------------------------------------------------
--
-- Table structure for table `myaddress`
--
CREATE TABLE IF NOT EXISTS `myaddress` (
`id` int(11) NOT NULL,
`firstname` varchar(30) NOT NULL,
`middlename` varchar(30) NOT NULL,
`lastname` varchar(30) NOT NULL,
`gender` varchar(1) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`home_address` varchar(50) DEFAULT NULL,
`landline` varchar(20) DEFAULT NULL,
`cellphone` varchar(20) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `myaddress`
--
INSERT INTO `myaddress` (`id`, `firstname`, `middlename`, `lastname`, `gender`, `created_at`, `home_address`, `landline`, `cellphone`) VALUES
(1, 'Flordeliza', 'M', 'Calanno', 'F', '2015-03-01 07:15:55', '467 4th street brgy. katuparan Taguig City', '888888', '09156861883');
-- --------------------------------------------------------
--
-- Table structure for table `mycomment`
--
CREATE TABLE IF NOT EXISTS `mycomment` (
`id` int(11) NOT NULL,
`myaddress_id` int(11) NOT NULL,
`author` varchar(255) NOT NULL,
`body` longtext NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mycomment`
--
INSERT INTO `mycomment` (`id`, `myaddress_id`, `author`, `body`, `created_at`) VALUES
(1, 1, 'Flor Calanno', 'This is a test in midterm Exam.', '2015-03-01 07:16:40');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `myaddress`
--
ALTER TABLE `myaddress`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mycomment`
--
ALTER TABLE `mycomment`
ADD PRIMARY KEY (`id`), ADD KEY `mycomment_ibfk_1` (`myaddress_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `myaddress`
--
ALTER TABLE `myaddress`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `mycomment`
--
ALTER TABLE `mycomment`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `mycomment`
--
ALTER TABLE `mycomment`
ADD CONSTRAINT `mycomment_ibfk_1` FOREIGN KEY (`myaddress_id`) REFERENCES `myaddress` (`id`);
/*!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 */;
|
use tinnitus_talks;
drop table activities; |
update ACT_GE_PROPERTY set VALUE_ = '6.8.1.0' where NAME_ = 'eventsubscription.schema.version';
|
-- Copyright (c) 2023 Oracle and/or its affiliates.
--
-- Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
--
-- Author: OIG Development
--
-- Description: Script file for CREATING synonym of procedures/packages using previously created OimUserAppstablesSynonyms
--
-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
prompt Connecting &USERNAME;
accept Databasename prompt"Enter the name of the database ::";
connect &USERNAME/&USERPWD@&Databasename;
prompt create or replace synonym OIM_FND_USER_TCA_PKG for APPS.OIM_FND_USER_TCA_PKG;
create or replace synonym OIM_FND_USER_TCA_PKG for APPS.OIM_FND_USER_TCA_PKG;
prompt create or replace synonym OIM_FND_GLOBAL for APPS.OIM_FND_GLOBAL;
create or replace synonym OIM_FND_GLOBAL for APPS.OIM_FND_GLOBAL;
prompt create or replace synonym WF_LOCAL_SYNCH for APPS.WF_LOCAL_SYNCH;
create or replace synonym WF_LOCAL_SYNCH for APPS.WF_LOCAL_SYNCH;
|
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 30, 2019 at 11:18 AM
-- Server version: 5.7.25-0ubuntu0.18.04.2
-- PHP Version: 7.0.33-2+ubuntu18.04.1+deb.sury.org+2+will+reach+end+of+life+in+april+2019
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `slack_app`
--
-- --------------------------------------------------------
--
-- Table structure for table `commands`
--
CREATE TABLE `commands` (
`id` int(5) NOT NULL,
`user_name` varchar(30) NOT NULL,
`user_id` varchar(30) NOT NULL,
`team_id` varchar(30) NOT NULL,
`team_domain` varchar(255) DEFAULT NULL,
`channel_id` varchar(30) NOT NULL,
`channel_name` varchar(255) DEFAULT NULL,
`response_url` varchar(255) NOT NULL,
`timestamp` varchar(13) DEFAULT NULL,
`command` varchar(255) NOT NULL,
`text` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `commands`
--
ALTER TABLE `commands`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `commands`
--
ALTER TABLE `commands`
MODIFY `id` int(5) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE IF NOT EXISTS public.organizations
(
organization_id text COLLATE pg_catalog."default" NOT NULL,
name text COLLATE pg_catalog."default",
contact_name text COLLATE pg_catalog."default",
contact_email text COLLATE pg_catalog."default",
contact_phone text COLLATE pg_catalog."default",
CONSTRAINT organizations_pkey PRIMARY KEY (organization_id)
) TABLESPACE pg_default;
ALTER TABLE public.organizations
OWNER to postgres;
CREATE TABLE IF NOT EXISTS public.licenses
(
license_id text COLLATE pg_catalog."default" NOT NULL,
organization_id text COLLATE pg_catalog."default" NOT NULL,
description text COLLATE pg_catalog."default",
product_name text COLLATE pg_catalog."default" NOT NULL,
license_type text COLLATE pg_catalog."default" NOT NULL,
comment text COLLATE pg_catalog."default",
CONSTRAINT licenses_pkey PRIMARY KEY (license_id),
CONSTRAINT licenses_organization_id_fkey FOREIGN KEY (organization_id)
REFERENCES public.organizations (organization_id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
) TABLESPACE pg_default;
ALTER TABLE public.licenses
OWNER to postgres; |
create or replace view `woven-passkey-328019`.`dbt_vbruninhu`.`stg_humanresources_employeepayhistory`
OPTIONS()
as with
source_data as (
select
businessentityid
, ratechangedate
, rate
, payfrequency
-- , modifieddate
from `woven-passkey-328019`.`querry_adventureworks20211025`.`humanresources_employeepayhistory`
)
select * from source_data;
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 04-05-2019 a las 00:12:37
-- Versión del servidor: 5.7.26
-- Versión de PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `promo_dbs`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `admins`
--
CREATE TABLE `admins` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `admins`
--
INSERT INTO `admins` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Super Admin', 'super@admin.com', '$2y$04$sJbJqpv7TH5RrgTPq0raburfQ6g1XOQtgd59Dgz.VCGlr8f5gUvm6', 'b6Gm1gtNKZsN4cGi88YFIlPfmtUAmzLrvLoULoju1prUOvoS78UTHrERsOoB', '2018-12-06 21:30:29', '2018-12-06 21:30:29');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `admin_role`
--
CREATE TABLE `admin_role` (
`id` int(10) UNSIGNED NOT NULL,
`role_id` int(10) UNSIGNED NOT NULL,
`admin_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `admin_role`
--
INSERT INTO `admin_role` (`id`, `role_id`, `admin_id`) VALUES
(1, 1, 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `events`
--
CREATE TABLE `events` (
`id` int(10) UNSIGNED NOT NULL,
`img` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` longtext COLLATE utf8mb4_unicode_ci,
`initial_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`final_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `events`
--
INSERT INTO `events` (`id`, `img`, `title`, `description`, `initial_date`, `final_date`, `created_at`, `updated_at`) VALUES
(4, NULL, 'Multiopt Event', '<p>Lorem ipsum dolor sit amet</p>', '2019-03-26 05:15:01', '2019-07-31 05:15:00', '2019-03-26 06:15:35', '2019-04-01 16:09:24'),
(5, NULL, 'Single Event', '<p>Lorem ipsum dolor sit amet</p>', '2019-03-26 05:15:35', '2019-03-31 05:15:00', '2019-03-26 06:16:09', '2019-03-26 06:16:09'),
(6, NULL, 'No question event', '<p>Lorem ipsum dolor sit amet</p>', '2019-03-26 05:16:09', '2019-03-31 05:16:00', '2019-03-26 06:16:28', '2019-03-26 06:16:28'),
(19, '1554118732kisslogo.png', 'teste andre', '<p>teste andre</p>', '2019-04-01 12:37:44', '2019-04-30 12:37:00', '2019-04-01 12:38:52', '2019-04-01 12:38:52'),
(20, '155412036101.png', 'Teste', '<p>Texte texte texte</p>', '2019-04-01 13:05:31', '2019-05-31 13:05:00', '2019-04-01 13:06:02', '2019-04-01 13:06:02'),
(21, NULL, 'teste andre 2', '<p>teste2</p>', '2019-04-01 13:06:15', '2019-04-23 13:06:00', '2019-04-01 13:06:39', '2019-04-01 13:06:39'),
(22, NULL, 'teste 3', '<p>teste3</p>', '2019-04-01 13:12:10', '2019-04-14 13:12:00', '2019-04-01 13:13:14', '2019-04-01 13:13:14');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(64, '2014_10_12_000000_create_users_table', 1),
(65, '2014_10_12_100000_create_password_resets_table', 1),
(66, '2017_03_06_023521_create_admins_table', 1),
(67, '2017_03_06_053834_create_admin_role_table', 1),
(68, '2018_03_06_023523_create_roles_table', 1),
(69, '2018_11_21_175832_create_events_table', 1),
(70, '2018_11_21_175911_create_participants_table', 1),
(71, '2019_03_20_062431_create_questions_table', 2),
(72, '2019_03_20_062635_add_answer_field_to_participants_table', 2);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `participants`
--
CREATE TABLE `participants` (
`id` int(10) UNSIGNED NOT NULL,
`event_id` int(10) UNSIGNED NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`answer` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `participants`
--
INSERT INTO `participants` (`id`, `event_id`, `user_id`, `created_at`, `updated_at`, `answer`) VALUES
(1, 6, 2, '2019-03-28 21:47:10', '2019-03-28 21:47:10', ''),
(2, 5, 2, '2019-03-28 21:47:23', '2019-03-28 21:47:23', '5'),
(5, 4, 2, '2019-03-29 19:12:01', '2019-03-29 19:12:01', 'Rojo'),
(6, 21, 3, '2019-04-01 13:06:58', '2019-04-01 13:06:58', 'teste concluido kiss fm'),
(7, 19, 3, '2019-04-01 13:07:04', '2019-04-01 13:07:04', 'kiss fm'),
(8, 22, 3, '2019-04-01 13:13:26', '2019-04-01 13:13:26', 'kiss fm');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `questions`
--
CREATE TABLE `questions` (
`id` int(10) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`event_id` int(10) UNSIGNED NOT NULL,
`title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`opt_1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`opt_2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`opt_3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`opt_4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`opt_5` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`multiopt` tinyint(1) NOT NULL,
`answer` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `questions`
--
INSERT INTO `questions` (`id`, `created_at`, `updated_at`, `event_id`, `title`, `opt_1`, `opt_2`, `opt_3`, `opt_4`, `opt_5`, `multiopt`, `answer`) VALUES
(1, '2019-03-26 06:15:35', '2019-04-01 17:27:04', 4, 'Color favorito', 'azul', 'Azur', 'verdinho', 'Verde', 'Blanco', 1, ''),
(2, '2019-03-26 06:16:09', '2019-03-26 06:16:09', 5, '¿Cuanto es 2+2?', 'Rojo', 'Azul', 'Amarillo', 'Verde', 'Blanco', 0, ''),
(11, '2019-04-01 12:38:52', '2019-04-01 17:23:57', 19, 'qual radio rock sp', 'radio kiss fm', 'outras', '', '', '', 1, ''),
(12, '2019-04-01 13:06:02', '2019-04-01 17:25:10', 20, 'teste?', 'kiss', 'fm', '', '', '', 1, ''),
(13, '2019-04-01 13:06:39', '2019-04-01 13:06:39', 21, 'qual melhor radiorock?', '', '', '', '', '', 0, ''),
(14, '2019-04-01 13:13:14', '2019-04-01 17:17:43', 22, 'qual melhor radio?', 'radio kiss fm', 'outras', '', '', '', 1, '');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `roles`
--
CREATE TABLE `roles` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `roles`
--
INSERT INTO `roles` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'super', '2018-12-06 21:30:29', '2018-12-06 21:30:29');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`district` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`street` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`complement` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`zip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`date_of_birth` timestamp NULL DEFAULT NULL,
`rg` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `name`, `phone`, `city`, `state`, `district`, `street`, `complement`, `number`, `zip`, `date_of_birth`, `rg`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'David Guilarte', '(41) 4792-2235', 'Andalucia', 'ES', 'Gercie', 'panorama 32', 'Perlemare', '12', '3610', '1993-05-07 04:30:00', '4554554544', 'davidguilarte7@gmail.com', NULL, '$2y$10$hWQ4Da3hk/mHNcI0v4IcQeqQkiYbG1ApKI9WNun1sP0OEuL64st1i', 'FAMXHCwrSewERvEKcGZaoP7EVRN2POwX5y6uvGt8zTWSQfEbJWpTnXxgSbyo', '2019-03-26 06:05:54', '2019-03-26 06:05:54'),
(2, 'Otavio Luciano', '(30) 90444-4666', 'Bauru', 'SP', 'Vila Nove de Julho', 'Rua Aurélio Duarte', NULL, '307', '17052-560', '1995-04-27 04:00:00', '545455454545', 'teste@teste.fox', NULL, '$2y$10$ByN2eZnbZ7G2bv1u69mM6.3vk8amxvA3.2EA0o/dh7Xq8dR377h7K', NULL, '2019-03-28 21:46:54', '2019-03-28 21:46:54'),
(3, 'andre', '(11) 9999-9999', 'São Paulo', 'SP', 'Bela Vista', 'Avenida Paulista', 'teste', '2', '01310-300', '2012-12-12 05:00:00', '9999999999', 'andre@kissfm.com.br', NULL, '$2y$10$qG9Dko7YiMdL63GoCdMxUeBXCLiz0VRwW5Bquh5pallR.A6GeCU92', NULL, '2019-04-01 12:43:02', '2019-04-01 12:43:02');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `admins_email_unique` (`email`);
--
-- Indices de la tabla `admin_role`
--
ALTER TABLE `admin_role`
ADD PRIMARY KEY (`id`),
ADD KEY `admin_role_admin_id_foreign` (`admin_id`);
--
-- Indices de la tabla `events`
--
ALTER TABLE `events`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `participants`
--
ALTER TABLE `participants`
ADD PRIMARY KEY (`id`),
ADD KEY `participants_event_id_foreign` (`event_id`),
ADD KEY `participants_user_id_foreign` (`user_id`);
--
-- Indices de la tabla `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indices de la tabla `questions`
--
ALTER TABLE `questions`
ADD PRIMARY KEY (`id`),
ADD KEY `questions_event_id_foreign` (`event_id`);
--
-- Indices de la tabla `roles`
--
ALTER TABLE `roles`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `roles_name_unique` (`name`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `admins`
--
ALTER TABLE `admins`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `admin_role`
--
ALTER TABLE `admin_role`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `events`
--
ALTER TABLE `events`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT de la tabla `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=73;
--
-- AUTO_INCREMENT de la tabla `participants`
--
ALTER TABLE `participants`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT de la tabla `questions`
--
ALTER TABLE `questions`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT de la tabla `roles`
--
ALTER TABLE `roles`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `admin_role`
--
ALTER TABLE `admin_role`
ADD CONSTRAINT `admin_role_admin_id_foreign` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `participants`
--
ALTER TABLE `participants`
ADD CONSTRAINT `participants_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `participants_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Filtros para la tabla `questions`
--
ALTER TABLE `questions`
ADD CONSTRAINT `questions_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
USE booking;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS clients;
DROP TABLE IF EXISTS practitioners;
DROP TABLE IF EXISTS treatments;
DROP TABLE IF EXISTS bookings;
DROP TABLE IF EXISTS freqs;
DROP TABLE IF EXISTS avails;
DROP TABLE IF EXISTS blocked_periods;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS notes;
SET FOREIGN_KEY_CHECKS = 1;
|
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50714
Source Host : localhost:3306
Source Schema : vote
Target Server Type : MySQL
Target Server Version : 50714
File Encoding : 65001
Date: 06/05/2019 03:53:12
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for record
-- ----------------------------
DROP TABLE IF EXISTS `record`;
CREATE TABLE `record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID索引',
`theme_id` int(11) NOT NULL COMMENT '投票主题ID',
`create_time` datetime(0) DEFAULT NULL COMMENT '投票时间',
`user_id` int(11) DEFAULT NULL COMMENT '投票用户',
`user_ip` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '投票用户的IP',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of record
-- ----------------------------
INSERT INTO `record` VALUES (2, 4, '2019-05-06 03:36:44', 0, '122.190.210.252');
INSERT INTO `record` VALUES (3, 4, '2019-05-06 03:41:03', 2, '122.190.210.254');
INSERT INTO `record` VALUES (4, 4, '2019-05-06 03:43:07', 0, '122.190.210.255');
INSERT INTO `record` VALUES (5, 4, '2019-05-06 03:43:13', 0, '122.190.210.256');
INSERT INTO `record` VALUES (6, 4, '2019-05-06 03:43:19', 0, '122.190.210.257');
INSERT INTO `record` VALUES (7, 4, '2019-05-06 03:49:17', 0, '122.190.210.253');
-- ----------------------------
-- Table structure for theme
-- ----------------------------
DROP TABLE IF EXISTS `theme`;
CREATE TABLE `theme` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`theme_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '投票主题名称',
`theme_content` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '主题说明',
`creater_id` int(11) DEFAULT NULL COMMENT '创建者ID',
`create_time` datetime(0) DEFAULT NULL COMMENT '创建时间',
`end_time` datetime(0) DEFAULT NULL COMMENT '截止时间',
`state` int(11) DEFAULT NULL COMMENT '主题状态( 0: 待开启 1: 投票中 2: 已完成 3: 已取消)',
`votes_max` int(11) DEFAULT NULL COMMENT '限制总投票数',
`options_count` int(11) DEFAULT NULL COMMENT '选项数量',
`options_type` int(11) DEFAULT NULL COMMENT '选择类型( 0: 单选 1: 可多选)',
`choose_max` int(11) DEFAULT NULL COMMENT '多选最大选择数',
`voted_total` int(11) DEFAULT NULL COMMENT '已投票总数',
`options_content` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'JSON存储选项内容/已投票数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of theme
-- ----------------------------
INSERT INTO `theme` VALUES (4, '您一般在什么时间睡觉?', '本投票用以调查统计各位的睡觉时间,每人尽可投票一次,本投票秉承公平公正,数据仅供私下研究学习,我们将保障您的隐私安全。', 2, '2019-05-06 00:00:00', '2019-05-31 00:00:00', 2, 6, 6, 0, 1, 6, '[{\"name\":\"晚上8点或更早\",\"number\":1},{\"name\":\"晚上8点-9点30\",\"number\":1,\"key\":1557084908438},{\"name\":\"晚上9点30-10点30\",\"number\":1,\"key\":1557084939120},{\"name\":\"晚上10点30-11点30\",\"number\":0,\"key\":1557084945621},{\"name\":\"晚上11点30-凌晨1点\",\"number\":1,\"key\":1557084954960},{\"name\":\"凌晨1点后\",\"number\":2,\"key\":1557084970449}]');
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '索引ID',
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '真实姓名',
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录密码',
`token_expired_time` int(11) DEFAULT NULL COMMENT '令牌更新时间',
`token` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '临时令牌',
`created_at` int(11) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES (1, 'admin', '管理员', '7c4a8d09ca3762af61e59520943dc26494f8941b', 1528881894, '281d0febbeb57f872fb407c7e0a86ff1cbcff962', 1528880094);
INSERT INTO `user` VALUES (2, 'chenlian', '陈炼', '7c4a8d09ca3762af61e59520943dc26494f8941b', 1556962930, '3d8ddcdf7616fc51618a641a50d5bf0323ed157c', 1556961130);
SET FOREIGN_KEY_CHECKS = 1;
|
/* return the customer information of those from the midwest*/
select *
from customer
where c_regionkey IN ('Mid West') |
delete from HtmlLabelIndex where id=20888
/
delete from HtmlLabelInfo where indexid=20888
/
delete from HtmlLabelIndex where id=20889
/
delete from HtmlLabelInfo where indexid=20889
/
INSERT INTO HtmlLabelIndex values(20888,'已经设置了自定义会议地点')
/
INSERT INTO HtmlLabelIndex values(20889,'已经选择了会议地点')
/
INSERT INTO HtmlLabelInfo VALUES(20888,'已经设置了自定义会议地点',7)
/
INSERT INTO HtmlLabelInfo VALUES(20888,'Already Customize Meeting Address',8)
/
INSERT INTO HtmlLabelInfo VALUES(20889,'已经选择了会议地点',7)
/
INSERT INTO HtmlLabelInfo VALUES(20889,'Selected Meeting Address',8)
/
UPDATE license set cversion = '4.000.0907'
/ |
CREATE VIEW dbo.report_orientations_v
AS
SELECT ref_type, ref_value, ref_name
FROM dbo.sys_ref
WHERE (ref_type = 'RO')
|
DROP TABLE IF EXISTS tbUczniowie;
CREATE TABLE tbUczniowie (
id INTEGER PRIMARY KEY AUTOINCREMENT,
imie TEXT,
nazwisko TEXT,
plec INTEGER,
idKlasa INTEGER NOT NULL REFERENCES tbklasy(id),
egzHum NUMERIC NOT NULL DEFAULT 0,
egzMat NUMERIC NOT NULL DEFAULT 0,
egzJez NUMERIC NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS tbKlasy;
CREATE TABLE tbKlasy (
id INTEGER PRIMARY KEY AUTOINCREMENT,
klasa TEXT,
rokNaboru INTEGER,
rokMatury INTEGER
);
DROP TABLE IF EXISTS tbPrzedmioty;
CREATE TABLE tbPrzedmioty (
id INTEGER PRIMARY KEY AUTOINCREMENT,
przedmiot TEXT,
nazwiskoNaucz TEXT,
imieNaucz TEXT,
plecNaucz INTEGER
);
DROP TABLE IF EXISTS tbOceny;
CREATE TABLE tbOceny (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ocena NUMERIC,
datad DATE,
idUczen INTEGER NOT NULL,
idPrzedmiot INTEGER NOT NULL,
FOREIGN KEY (idUczen) REFERENCES tbUczniowie(id),
FOREIGN KEY (idPrzedmiot) REFERENCES tbPrzedmioty(id)
);
INSERT INTO tbKlasy(id, klasa, rokNaboru, rokMatury) VALUES (NULL, '1B', 2015, 2018);
INSERT INTO tbKlasy(id, klasa, rokNaboru, rokMatury) VALUES (NULL,'1A', 2015, 2018);
INSERT INTO tbUczniowie(id, imie, nazwisko, plec, idklasa, egzHum, egzMat, egzJez) VALUES (NULL, 'Adam', 'Kowalski', 0, 1, 80.6, 50, 90.5);
INSERT INTO tbUczniowie(id, imie, nazwisko, plec, idklasa, egzHum, egzMat, egzJez) VALUES (NULL, 'Ilona', 'Nowak', 1, 2, 50.6, 78.9, 80);
INSERT INTO tbUczniowie(id, imie, nazwisko, plec, idklasa, egzHum, egzMat, egzJez) VALUES (NULL, 'Jaś', 'Fasola', 0, 2, 70.7, 67.7, 90);
INSERT INTO tbPrzedmioty(id, przedmiot, nazwiskoNaucz, imieNaucz, plecNaucz) VALUES (NULL, 'bologia', 'Henryszewski', 'Robert', 0);
INSERT INTO tbPrzedmioty(id, przedmiot, nazwiskoNaucz, imieNaucz, plecNaucz) VALUES (NULL, 'fizyka', 'Ignaczak', 'Jolanta', 1);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 4.5, '2015-10-01', 1, 1);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 3, '2015-09-29', 1, 2);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 4, '2015-09-25', 2, 1);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 3.5, '2015-10-05', 2, 2);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 5, '2015-09-29', 3, 1);
INSERT INTO tbOceny(id, ocena, datad, idUczen, idPrzedmiot) VALUES (NULL, 2, '2015-10-02', 3, 2);
|
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 01-Fev-2019 às 08:13
-- Versão do servidor: 10.1.30-MariaDB
-- PHP Version: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `projeto_erp_pronto`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `pis`
--
CREATE TABLE `pis` (
`id_pis` int(16) NOT NULL,
`codigo_pis` varchar(16) NOT NULL,
`desc_pis` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `pis`
--
INSERT INTO `pis` (`id_pis`, `codigo_pis`, `desc_pis`) VALUES
(1, '01', '01: Operação tributável (BC = Operação alíq. normal (cumul./não cumul.)'),
(2, '02', '02: Operação tributável (BC = valor da operação (alíquota diferenciada)'),
(3, '03', '03: Operação tributável (BC = quant. x alíq. por unidade de produto)'),
(4, '04', '04: Operação tributável (tributação monofásica, alíquota zero)'),
(5, '06', '06: Operação tributável (alíquota zero)'),
(6, '07', '07: Operação isenta da contribuição'),
(7, '08', '08: Operação sem incidência da contribuição'),
(8, '09', '09: Operação com suspensão da contribuição'),
(9, '49', '49: Outras Operações de Saída'),
(10, '50', '50: Direito a Crédito. Vinculada Exclusivamente a Receita Tributada no Mercado Interno'),
(11, '51', '51: Direito a Crédito. Vinculada Exclusivamente a Receita Não Tributada no Mercado Interno'),
(12, '52', '52: Direito a Crédito. Vinculada Exclusivamente a Receita de Exportação'),
(13, '53', '53: Direito a Crédito. Vinculada a Receitas Tributadas e Não-Tributadas no Mercado Interno'),
(14, '54', '54: Direito a Crédito. Vinculada a Receitas Tributadas no Mercado Interno e de Exportação'),
(15, '55', '55: Direito a Crédito. Vinculada a Receitas Não-Trib. no Mercado Interno e de Exportação'),
(16, '56', '56: Direito a Crédito. Vinculada a Rec. Trib. e Não-Trib. Mercado Interno e Exportação'),
(17, '60', '60: Créd. Presumido. Aquisição Vinc. Exclusivamente a Receita Tributada no Mercado Interno'),
(18, '61', '61: Créd. Presumido. Aquisição Vinc. Exclusivamente a Rec. Não-Trib. no Mercado Interno'),
(19, '62', '62: Créd. Presumido. Aquisição Vinc. Exclusivamente a Receita de Exportação'),
(20, '63', '63: Créd. Presumido. Aquisição Vinc. a Rec. Trib. e Não-Trib. no Mercado Interno'),
(21, '64', '64: Créd. Presumido. Aquisição Vinc. a Rec. Trib. no Mercado Interno e de Exportação'),
(22, '65', '65: Créd. Presumido. Aquisição Vinc. a Rec. Não-Trib. Mercado Interno e Exportação'),
(23, '66', '66: Créd. Presumido. Aquisição Vinc. a Rec. Trib. e Não-Trib. Mercado Interno e Exportação'),
(24, '67', '67: Crédito Presumido - Outras Operações'),
(25, '70', '70: Operação de Aquisição sem Direito a Crédito'),
(26, '71', '71: Operação de Aquisição com Isenção'),
(27, '72', '72: Operação de Aquisição com Suspensão'),
(28, '73', '73: Operação de Aquisição a Alíquota Zero'),
(29, '74', '74: Operação de Aquisição sem Incidência da Contribuição'),
(30, '75', '75: Operação de Aquisição por Substituição Tributária'),
(31, '98', '98: Outras Operações de Entrada'),
(32, '99', '99: Outras operações');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `pis`
--
ALTER TABLE `pis`
ADD PRIMARY KEY (`id_pis`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `pis`
--
ALTER TABLE `pis`
MODIFY `id_pis` int(16) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
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 */;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.