text stringlengths 6 9.38M |
|---|
DROP TABLE IF EXISTS ACCOUNT_TYPE;
CREATE TABLE ACCOUNT_TYPE
(
ACCOUNT_TYPE_ID VARCHAR(50) DEFAULT 0 NOT NULL,
ACCOUNT_TYPE_CODE VARCHAR(10),
ACCOUNT_TYPE_DESC VARCHAR(500),
LOAD_DATE VARCHAR(10),
LOAD_ID INTEGER,
CONSTRAINT ACCOUNT_TYPE_ID_PK PRIMARY KEY(ACCOUNT_TYPE_ID)
);
|
drop table if exists #Dates
;
select top (datediff(d, '20140331', getdate()) + 1)
dateadd(d, row_number() over (order by so.id), '20140331') - 1 as Dt
into #Dates
from sys.sysobjects so
cross join sys.sysobjects so1
;
with AllProducts as
(
select
op.ClientId
,op.ProductId
,op.Amount
,case when TariffId = 4 then 2 else 1 end as ProductType
from bi.OldProducts op
where (op.DatePaid < '20180225' or op.DatePaid is null)
and op.DateStarted < '20180225'
union
select
p.clientId
,p.productid
,p.Amount
,p.ProductType
from prd.vw_product p
where p.status > 2
)
,OldProductsCount as
(
select
cast(p.DateStarted as date) as Dt
,count(*) as TotalCredits
,count(case when right(p.ContractNumber, 3) = '001' then 1 end) as FirstCredits
,count(case when p.TariffId != 4 then 1 end) as STCount
,count(case when p.TariffId = 4 then 1 end) as LTCount
,sum(case when p.TariffId != 4 then p.Amount else 0 end) as STSum
,sum(case when p.TariffId = 4 then p.Amount else 0 end) as LTSum
from bi.OldProducts p
where p.ProductId != 352699
and (DatePaid < '20180225' or DatePaid is null)
and p.DateStarted < '20180225'
and not exists
(
select 1 from prd.vw_product vp
where vp.productid = p.ProductId
and vp.status < 3
)
and p.Status not in (5, 8)
and p.ClientId > 160 and ClientId not in (160, 224, 194, 190, 1770)
group by cast(p.DateStarted as date)
)
,OldPayments as
(
select
cast(opp.DateCreated as date) as Dt
,sum(Amount) as PaidAmnt
,sum(PercentAmount)
+ sum(CommissionAmount)
+ sum(PenaltyAmount)
+ sum(TransactionCosts)
+ sum(LongPrice) as PaidOther
,sum(case
when ops.Status = 3 and datediff(d, ops.DateStarted, opp.DateCreated) + 1 between 1 and 3
then opp.Amount + opp.PercentAmount + opp.CommissionAmount + opp.PenaltyAmount + opp.LongPrice + opp.TransactionCosts else 0 end) as PaidOverdue1_3
,sum(case
when ops.Status = 3 and datediff(d, ops.DateStarted, opp.DateCreated) + 1 between 4 and 7
then opp.Amount + opp.PercentAmount + opp.CommissionAmount + opp.PenaltyAmount + opp.LongPrice + opp.TransactionCosts else 0 end) as PaidOverdue4_7
,sum(case
when ops.Status = 3 and datediff(d, ops.DateStarted, opp.DateCreated) + 1 between 8 and 14
then opp.Amount + opp.PercentAmount + opp.CommissionAmount + opp.PenaltyAmount + opp.LongPrice + opp.TransactionCosts else 0 end) as PaidOverdue8_14
,sum(case
when ops.Status = 3 and datediff(d, ops.DateStarted, opp.DateCreated) + 1 between 15 and 30
then opp.Amount + opp.PercentAmount + opp.CommissionAmount + opp.PenaltyAmount + opp.LongPrice + opp.TransactionCosts else 0 end) as PaidOverdue15_30
,sum(case
when ops.Status = 3 and datediff(d, ops.DateStarted, opp.DateCreated) + 1 >= 31
then opp.Amount + opp.PercentAmount + opp.CommissionAmount + opp.PenaltyAmount + opp.LongPrice + opp.TransactionCosts else 0 end) as PaidOverdue31Plus
from bi.OldProductPayments opp
outer apply
(
select top 1
ops.Status
,ops.DateStarted
from bi.OldProductStatus ops
where ops.ProductId = opp.ProductId
and ops.DateStarted < opp.DateCreated
order by ops.DateStarted desc
) ops
where opp.DateCreated < '20180225'
group by cast(opp.DateCreated as date)
)
,NewProductsCount as
(
select
cast(p.StartedOn as date) as Dt
,count(*) as TotalCredits
,count(case when ap.ProductId = p.ProductId then 1 end) as FirstCredits
,count(case when p.productType = 1 then 1 end) as STCount
,count(case when p.productType = 2 then 1 end) as LTCount
,sum(case when p.productType = 1 then p.Amount else 0 end) as STSum
,sum(case when p.productType = 2 then p.Amount else 0 end) as LTSum
from prd.vw_product p
outer apply
(
select top 1 ap.ProductId
from AllProducts ap
where ap.ClientId = p.ClientId
order by p.ProductId
) ap
where p.StartedOn >= '20180225'
and p.status > 2
group by cast(p.StartedOn as date)
)
,NewPayments as
(
select
Date as Dt
,sum(case when left(mm.accNumber, 5) = '48801' then mm.SumKtNt end) as PaidAmnt
,sum(case when left(mm.accNumber, 5) in ('48802', '48803', N'Штраф') then mm.SumKtNt else 0 end) as PaidOther
,sum(case
when sl.status = 4 and left(mm.accNumber, 5) in ('48801', '48802', '48803', N'Штраф')
and datediff(d, sl.StartedOn, mm.Date) + 1 between 1 and 3 then mm.SumKtNt else 0 end) as PaidOverdue1_3
,sum(case
when sl.status = 4 and left(mm.accNumber, 5) in ('48801', '48802', '48803', N'Штраф')
and datediff(d, sl.StartedOn, mm.Date) + 1 between 4 and 7 then mm.SumKtNt else 0 end) as PaidOverdue4_7
,sum(case
when sl.status = 4 and left(mm.accNumber, 5) in ('48801', '48802', '48803', N'Штраф')
and datediff(d, sl.StartedOn, mm.Date) + 1 between 8 and 14 then mm.SumKtNt else 0 end) as PaidOverdue8_14
,sum(case
when sl.status = 4 and left(mm.accNumber, 5) in ('48801', '48802', '48803', N'Штраф')
and datediff(d, sl.StartedOn, mm.Date) + 1 between 15 and 30 then mm.SumKtNt else 0 end) as PaidOverdue15_30
,sum(case
when sl.status = 4 and left(mm.accNumber, 5) in ('48801', '48802', '48803', N'Штраф')
and datediff(d, sl.StartedOn, mm.Date) + 1 >= 31 then mm.SumKtNt else 0 end) as PaidOverdue31Plus
from acc.vw_mm mm
outer apply
(
select top 1 sl.Status, sl.StartedOn
from prd.vw_statusLog sl
where sl.ProductType = mm.ProductType
and sl.ProductId = mm.ProductId
and sl.StartedOn < dateadd(s, 59 + 59 * 60 + 3600 * 23, mm.Date)
order by sl.StartedOn desc
) sl
where mm.isDistributePayment = 1
and mm.Date >= '20180225'
group by Date
)
,ProductsCount as
(
select *
from NewProductsCount
union
select *
from OldProductsCount
)
,Payments as
(
select *
from NewPayments
union
select *
from OldPayments
)
select
d.Dt
,isnull(pc.TotalCredits, 0) as TotalCredits
,isnull(pc.FirstCredits, 0) as FirstCredits
,isnull(pc.STCount, 0) as STCount
,isnull(pc.LTCount, 0) as LTCount
,isnull(pc.STSum, 0) as STSum
,isnull(pc.LTSum, 0) as LTSum
,isnull(p.PaidAmnt, 0) as PaidAmnt
,isnull(p.PaidOther, 0) as PaidOther
,isnull(p.PaidOverdue1_3, 0) as PaidOverdue1_3
,isnull(p.PaidOverdue4_7, 0) as PaidOverdue4_7
,isnull(p.PaidOverdue8_14, 0) as PaidOverdue8_14
,isnull(p.PaidOverdue15_30, 0) as PaidOverdue15_30
,isnull(p.PaidOverdue31Plus, 0) as PaidOverdue31Plus
from #Dates d
left join ProductsCount pc on pc.Dt = d.Dt
left join Payments p on p.Dt = d.Dt |
insert into CMDS_M_RCP_IMPTT_NOTI values('01','公');
insert into CMDS_M_RCP_IMPTT_NOTI values('02','長');
insert into CMDS_M_RCP_IMPTT_NOTI values('03','長処');
insert into CMDS_M_RCP_IMPTT_NOTI values('04','後保');
insert into CMDS_M_RCP_IMPTT_NOTI values('07','老併');
insert into CMDS_M_RCP_IMPTT_NOTI values('08','老健');
insert into CMDS_M_RCP_IMPTT_NOTI values('09','施');
insert into CMDS_M_RCP_IMPTT_NOTI values('10','第三');
insert into CMDS_M_RCP_IMPTT_NOTI values('11','薬治');
insert into CMDS_M_RCP_IMPTT_NOTI values('12','器治');
insert into CMDS_M_RCP_IMPTT_NOTI values('13','先進');
insert into CMDS_M_RCP_IMPTT_NOTI values('14','制超');
insert into CMDS_M_RCP_IMPTT_NOTI values('16','長2');
insert into CMDS_M_RCP_IMPTT_NOTI values('17','上位');
insert into CMDS_M_RCP_IMPTT_NOTI values('18','一般');
insert into CMDS_M_RCP_IMPTT_NOTI values('19','低所');
insert into CMDS_M_RCP_IMPTT_NOTI values('20','二割');
insert into CMDS_M_RCP_IMPTT_NOTI values('21','高半');
insert into CMDS_M_RCP_IMPTT_NOTI values('22','多上');
insert into CMDS_M_RCP_IMPTT_NOTI values('23','多一');
insert into CMDS_M_RCP_IMPTT_NOTI values('24','多低');
insert into CMDS_M_RCP_IMPTT_NOTI values('25','出産');
insert into CMDS_M_RCP_IMPTT_NOTI values('26','区 ア');
insert into CMDS_M_RCP_IMPTT_NOTI values('27','区 イ');
insert into CMDS_M_RCP_IMPTT_NOTI values('28','区 ウ');
insert into CMDS_M_RCP_IMPTT_NOTI values('29','区 エ');
insert into CMDS_M_RCP_IMPTT_NOTI values('30','区 オ');
insert into CMDS_M_RCP_IMPTT_NOTI values('31','多 ア');
insert into CMDS_M_RCP_IMPTT_NOTI values('32','多 イ');
insert into CMDS_M_RCP_IMPTT_NOTI values('33','多 ウ');
insert into CMDS_M_RCP_IMPTT_NOTI values('34','多 エ');
insert into CMDS_M_RCP_IMPTT_NOTI values('35','多 オ');
insert into CMDS_M_RCP_IMPTT_NOTI values('36','加 治');
insert into CMDS_M_RCP_IMPTT_NOTI values('40','50/100');
commit;
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.16
-- Dumped by pg_dump version 10.16
-- Started on 2021-07-04 06:59:40
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 1 (class 3079 OID 12924)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 2845 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 200 (class 1259 OID 27182)
-- Name: Categories; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Categories" (
"Id" integer NOT NULL,
"Name" text,
"Description" text
);
ALTER TABLE public."Categories" OWNER TO postgres;
--
-- TOC entry 199 (class 1259 OID 27180)
-- Name: Categories_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
ALTER TABLE public."Categories" ALTER COLUMN "Id" ADD GENERATED BY DEFAULT AS IDENTITY (
SEQUENCE NAME public."Categories_Id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- TOC entry 202 (class 1259 OID 27260)
-- Name: Orders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Orders" (
"Id" integer NOT NULL,
"CreationTime" timestamp without time zone NOT NULL,
"IsCompleted" boolean NOT NULL
);
ALTER TABLE public."Orders" OWNER TO postgres;
--
-- TOC entry 201 (class 1259 OID 27258)
-- Name: Orders_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
ALTER TABLE public."Orders" ALTER COLUMN "Id" ADD GENERATED BY DEFAULT AS IDENTITY (
SEQUENCE NAME public."Orders_Id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- TOC entry 203 (class 1259 OID 27265)
-- Name: ProductOrders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."ProductOrders" (
"ProductId" integer NOT NULL,
"OrderId" integer NOT NULL,
"Amount" integer NOT NULL
);
ALTER TABLE public."ProductOrders" OWNER TO postgres;
--
-- TOC entry 198 (class 1259 OID 27164)
-- Name: Products; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Products" (
"Id" integer NOT NULL,
"Name" text,
"CategoryId" integer DEFAULT 0 NOT NULL,
"Description" text,
"Price" integer DEFAULT 0 NOT NULL
);
ALTER TABLE public."Products" OWNER TO postgres;
--
-- TOC entry 197 (class 1259 OID 27162)
-- Name: Products_Id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
ALTER TABLE public."Products" ALTER COLUMN "Id" ADD GENERATED BY DEFAULT AS IDENTITY (
SEQUENCE NAME public."Products_Id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- TOC entry 196 (class 1259 OID 27157)
-- Name: __EFMigrationsHistory; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL
);
ALTER TABLE public."__EFMigrationsHistory" OWNER TO postgres;
--
-- TOC entry 2834 (class 0 OID 27182)
-- Dependencies: 200
-- Data for Name: Categories; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Categories" ("Id", "Name", "Description") FROM stdin;
4 Видеокарты Видеокарты
5 Материнские платы Материнские платы
6 Модули памяти Модули памяти
7 SSD накопители SSD накопители
8 Стиральные машины Стиральные машины
9 Мониторы Мониторы
10 Процессоры Процессоры
11 Ноутбуки Ноутбуки
12 Смартфоны Смартфоны
13 Холодильники Холодильники
\.
--
-- TOC entry 2836 (class 0 OID 27260)
-- Dependencies: 202
-- Data for Name: Orders; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Orders" ("Id", "CreationTime", "IsCompleted") FROM stdin;
6 2021-06-22 14:40:00 t
7 2021-06-22 15:44:00 t
8 2021-06-24 11:10:00 t
9 2021-06-25 16:50:00 t
10 2021-06-26 09:10:00 t
11 2021-06-26 12:30:00 t
12 2021-06-28 11:14:00 t
13 2021-06-28 16:43:00 t
14 2021-06-29 11:50:00 t
15 2021-06-29 15:08:00 t
16 2021-06-30 13:06:00 f
\.
--
-- TOC entry 2837 (class 0 OID 27265)
-- Dependencies: 203
-- Data for Name: ProductOrders; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."ProductOrders" ("ProductId", "OrderId", "Amount") FROM stdin;
14 12 3
15 12 6
5 13 1
11 14 1
11 15 2
6 6 1
5 7 3
9 8 1
15 8 2
5 8 1
11 8 1
13 9 5
15 9 10
7 9 5
5 9 2
14 10 2
12 11 3
8 11 3
11 12 3
12 12 3
9 12 3
7 12 3
6 12 3
5 12 3
\.
--
-- TOC entry 2832 (class 0 OID 27164)
-- Dependencies: 198
-- Data for Name: Products; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."Products" ("Id", "Name", "CategoryId", "Description", "Price") FROM stdin;
10 Процессор AMD Ryzen 5 3600, OEM Процессор AMD Ryzen 5 3600, OEM 10 Ядро: Matisse\nГнездо процессора: SocketAM4 14590
11 Процессор AMD Ryzen 5 2600, OEM 10 Ядро: Pinnacle Ridge\nГнездо процессора: SocketAM4 10690
12 Процессор INTEL Core i5 10400F, OEM 10 Ядро: Comet Lake\nГнездо процессора: LGA 1200 11990
13 Процессор AMD Athlon 3000G, OEM 10 Ядро: Picasso\nГнездо процессора: SocketAM4\nКоличество ядер: 2 6490
14 Модуль памяти PATRIOT PSD34G13332 DDR3 - 4ГБ 6 Форм-фактор: DIMM\nКоличество контактов: 240-pin 1790
15 Модуль памяти CRUCIAL CT8G4DFRA266 DDR4 - 8ГБ 6 Форм-фактор: DIMM\nКоличество контактов: 288-pin 3390
6 Видеокарта GIGABYTE NVIDIA GeForce RTX 3070 4 Видеочипсет: NVIDIA GeForce RTX 3070 111990
5 Видеокарта PALIT NVIDIA GeForce RTX 3060 4 Видеочипсет: NVIDIA GeForce RTX 3060 75990
7 Материнская плата ASROCK A320M-DVS R4.0 5 Гнездо процессора: SocketAM4\nЧипсет: AMD A320 3680
8 Материнская плата GIGABYTE B450M S2H 5 Гнездо процессора: SocketAM4 4910
9 Материнская плата ASROCK B450M PRO4 5 Гнездо процессора: SocketAM4 5730
\.
--
-- TOC entry 2830 (class 0 OID 27157)
-- Dependencies: 196
-- Data for Name: __EFMigrationsHistory; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."__EFMigrationsHistory" ("MigrationId", "ProductVersion") FROM stdin;
20210613220556_Product 5.0.7
20210620002547_Categories 5.0.7
20210701023054_Orders 5.0.7
20210703204140_Price 5.0.7
20210704014432_NoImage 5.0.7
\.
--
-- TOC entry 2846 (class 0 OID 0)
-- Dependencies: 199
-- Name: Categories_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Categories_Id_seq"', 13, true);
--
-- TOC entry 2847 (class 0 OID 0)
-- Dependencies: 201
-- Name: Orders_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Orders_Id_seq"', 16, true);
--
-- TOC entry 2848 (class 0 OID 0)
-- Dependencies: 197
-- Name: Products_Id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Products_Id_seq"', 15, true);
--
-- TOC entry 2700 (class 2606 OID 27189)
-- Name: Categories PK_Categories; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Categories"
ADD CONSTRAINT "PK_Categories" PRIMARY KEY ("Id");
--
-- TOC entry 2702 (class 2606 OID 27264)
-- Name: Orders PK_Orders; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Orders"
ADD CONSTRAINT "PK_Orders" PRIMARY KEY ("Id");
--
-- TOC entry 2705 (class 2606 OID 27269)
-- Name: ProductOrders PK_ProductOrders; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."ProductOrders"
ADD CONSTRAINT "PK_ProductOrders" PRIMARY KEY ("OrderId", "ProductId");
--
-- TOC entry 2698 (class 2606 OID 27171)
-- Name: Products PK_Products; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Products"
ADD CONSTRAINT "PK_Products" PRIMARY KEY ("Id");
--
-- TOC entry 2695 (class 2606 OID 27161)
-- Name: __EFMigrationsHistory PK___EFMigrationsHistory; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."__EFMigrationsHistory"
ADD CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId");
--
-- TOC entry 2703 (class 1259 OID 27280)
-- Name: IX_ProductOrders_ProductId; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX "IX_ProductOrders_ProductId" ON public."ProductOrders" USING btree ("ProductId");
--
-- TOC entry 2696 (class 1259 OID 27205)
-- Name: IX_Products_CategoryId; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX "IX_Products_CategoryId" ON public."Products" USING btree ("CategoryId");
--
-- TOC entry 2707 (class 2606 OID 27270)
-- Name: ProductOrders FK_ProductOrders_Orders_OrderId; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."ProductOrders"
ADD CONSTRAINT "FK_ProductOrders_Orders_OrderId" FOREIGN KEY ("OrderId") REFERENCES public."Orders"("Id") ON DELETE CASCADE;
--
-- TOC entry 2708 (class 2606 OID 27275)
-- Name: ProductOrders FK_ProductOrders_Products_ProductId; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."ProductOrders"
ADD CONSTRAINT "FK_ProductOrders_Products_ProductId" FOREIGN KEY ("ProductId") REFERENCES public."Products"("Id") ON DELETE RESTRICT;
--
-- TOC entry 2706 (class 2606 OID 27207)
-- Name: Products FK_Products_Categories_CategoryId; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Products"
ADD CONSTRAINT "FK_Products_Categories_CategoryId" FOREIGN KEY ("CategoryId") REFERENCES public."Categories"("Id") ON DELETE RESTRICT;
-- Completed on 2021-07-04 06:59:40
--
-- PostgreSQL database dump complete
--
|
__PL/SQL Programming_____________________________
__TRIGGER______________________________________
Types:
DML Triggers
DDL Triggers
System / Database Event Triggers
Instead Of Triggers
Compound Triggers
Schema:
-- this line is mandatory
CREATE OR REPLACE TRIGGER "Trigger_name" -- no quotations
-- when should the trigger jump
{BEFORE|AFTER} /* Triggering_event */ ON table_name
UPDATE [OF column_name]
DELETE
INSERT
-- for each row or whole table
[FOR EACH ROW]
[FOLLOWS another_trigger_name]
[ENABLE/DISABLE]
[WHEN condition]
-- PL/SQL Code to do something
-- read PL-SQL.sql for instructions
DECLARE
declaration statements;
BEGIN
executable statements;
EXCEPTION
exception-handling statements;
END;
Example: This trigger jumps when INSERT / DELETE / UPDATE happens
------------------------------------------------------------------------------------------
CREATE OR REPLACE TRIGGER tr_superheroes
BEFORE INSERT OR DELETE OR UPDATE ON superheroes
FOR EACH ROW
ENABLE
When (NEW.cx > ....) -- there is no : here
DECLARE
v_user VARCHAR2(15);
BEGIN
-- it gets the current user from table DUAL
SELECT user INTO v_user FROM DUAL;
IF INSERTING THEN
DBMS_OUTPUT.PUT_LINE('one line inserted by '||v_user);
ELSIF DELETING THEN
DBMS_OUTPUT.PUT_LINE('one line Deleted by '||v_user);
ELSIF UPDATING THEN
DBMS_OUTPUT.PUT_LINE('one line Updated by '||v_user);
END IF;
END;
/
MUST------------------------------------
READ PDFs for more details about
OLD / NEW
:OLD / :NEW
OLD_TABLE / NEW_TABLE |
delete from HtmlLabelIndex where id in (20179,20180,20181)
/
delete from HtmlLabelInfo where indexid in (20179,20180,20181)
/
INSERT INTO HtmlLabelIndex values(20179,'图片上传插件')
/
INSERT INTO HtmlLabelIndex values(20180,'用于实现批量上传图片的功能')
/
INSERT INTO HtmlLabelIndex values(20181,'根据您使用的操作系统版本下载相应的文件,解压缩后点击setup.exe安装。')
/
INSERT INTO HtmlLabelInfo VALUES(20179,'图片上传插件',7)
/
INSERT INTO HtmlLabelInfo VALUES(20179,'Image Uploader',8)
/
INSERT INTO HtmlLabelInfo VALUES(20180,'用于实现批量上传图片的功能',7)
/
INSERT INTO HtmlLabelInfo VALUES(20180,'support batch image uploader, support image thumbnail view and image preview functiond',8)
/
INSERT INTO HtmlLabelInfo VALUES(20181,'根据您使用的操作系统版本下载相应的文件,解压缩后点击setup.exe安装。',7)
/
INSERT INTO HtmlLabelInfo VALUES(20181,'Extract the zip file.',8)
/ |
SELECT DISTINCT [] as 'CitizenID'
,[] as 'Event'
,FORMAT([],'yyyy/MM/dd HH:mm:ss') as 'Start'
,FORMAT([],'yyyy/MM/dd HH:mm:ss') as 'End'
,[] as 'EventExtraFeature'
,DATEDIFF(DAY, [], []) as 'DurationDays'
,[] as 'CaseID'
,[] as 'Discriminator'
FROM [] |
-- Clean Up
DROP TABLE Airline CASCADE CONSTRAINTS;
DROP TABLE Flight CASCADE CONSTRAINTS;
DROP TABLE Plane CASCADE CONSTRAINTS;
DROP TABLE Price CASCADE CONSTRAINTS;
DROP TABLE Customer CASCADE CONSTRAINTS;
DROP TABLE Reservation CASCADE CONSTRAINTS;
DROP TABLE Reservation_detail CASCADE CONSTRAINTS;
DROP TABLE Current_date CASCADE CONSTRAINTS;
DROP TABLE Reservation_details_audit CASCADE CONSTRAINTS;
--Create Tables
CREATE TABLE Airline (
airline_id varchar(5),
airline_name varchar(50),
airline_abbreviation varchar(10),
year_founded int,
CONSTRAINT airline_pk PRIMARY KEY(airline_id) DEFERRABLE
);
CREATE TABLE Plane (
plane_type char(4),
manufacture varchar(10),
plane_capacity int NOT NULL, --Every plane must have a capacity
last_service date,
year int,
owner_id varchar(5),
CONSTRAINT plane_pk PRIMARY KEY(plane_type,owner_id) DEFERRABLE,
CONSTRAINT plane_fk FOREIGN KEY(owner_id) REFERENCES Airline
(airline_id) INITIALLY DEFERRED DEFERRABLE
);
--All flights should have arrival/departure cities, therefore they cannot
--be NULL.
--If an airline is shut down, then all of its flights should be deleted.
--Therefore, we will cascade on delete for the airline_id
CREATE TABLE Flight (
flight_number varchar(3),
airline_id varchar(5),
plane_type char(4),
departure_city varchar(3) NOT NULL,
arrival_city varchar(3) NOT NULL,
departure_time varchar(4),
arrival_time varchar(4),
weekly_schedule varchar(7),
CONSTRAINT flight_pk PRIMARY KEY(flight_number) DEFERRABLE,
CONSTRAINT flight_fk1 FOREIGN KEY(plane_type,airline_id) REFERENCES Plane
(plane_type,owner_id) INITIALLY DEFERRED DEFERRABLE,
CONSTRAINT flight_fk2 FOREIGN KEY(airline_id) REFERENCES Airline
(airline_id) ON DELETE CASCADE INITIALLY DEFERRED DEFERRABLE,
CONSTRAINT sameCity CHECK (departure_city != arrival_city),
CONSTRAINT flightTime CHECK (departure_time < arrival_time)
);
--As stated previously, all flights must have arrival/departure cities.
--If an airline is shut down, then we must remove all the pricing for that
--airlines flights.
CREATE TABLE Price (
departure_city varchar(3) NOT NULL,
arrival_city varchar(3) NOT NULL,
airline_id varchar(5),
high_price int,
low_price int,
CONSTRAINT price_pk PRIMARY KEY(departure_city, arrival_city,airline_id)
DEFERRABLE,
CONSTRAINT price_fk FOREIGN KEY(airline_id) REFERENCES Airline
(airline_id) ON DELETE CASCADE INITIALLY DEFERRED DEFERRABLE
);
--Credit card information is required to book flights. Therefore, it cannot be
--null. Also, customers must give their first and last name.
--At least one form of communication should be mandatory in the case of an
--emergency or flight change. So, I arbitrarily chose phone number.
CREATE TABLE Customer (
cid varchar(9),
salutation varchar(3),
first_name varchar(30) NOT NULL,
last_name varchar(30) NOT NULL,
credit_card_num varchar(16) NOT NULL,
credit_card_expire date NOT NULL,
street varchar(30),
city varchar(30),
state varchar(2),
phone varchar(10) NOT NULL,
email varchar(30),
frequent_miles varchar(5),
CONSTRAINT customer_pk PRIMARY KEY(cid) DEFERRABLE,
CONSTRAINT salutation_check CHECK(salutation IN ('Mr','Mrs','Ms'))
DEFERRABLE
);
--We should never omit the date the reservation is made for booking purposes.
--Also when a brand new reservation is made we cannot assume it has been
--ticketed, since the reservation was just made.
CREATE TABLE Reservation (
reservation_number varchar(5),
cid varchar(9),
cost int DEFAULT 0,
start_city varchar(3) NOT NULL,
end_city varchar(3) NOT NULL,
credit_card_num varchar(16),
reservation_date date NOT NULL,
ticketed varchar(1) DEFAULT 'N',
CONSTRAINT reservation_pk PRIMARY KEY(reservation_number)
DEFERRABLE,
CONSTRAINT reservation_fk FOREIGN KEY(cid) REFERENCES Customer
(cid) INITIALLY DEFERRED DEFERRABLE
);
--If a reservation is deleted, we need to also delete its corresponding details. Therefore,
--we cascade on delete on the reservation_number.
CREATE TABLE Reservation_detail (
reservation_number varchar(5),
flight_number varchar(3),
flight_date date,
leg int DEFAULT 0,
CONSTRAINT reservation_detail_pk PRIMARY KEY(reservation_number,
leg) DEFERRABLE,
CONSTRAINT reservation_detail_fk1 FOREIGN KEY(reservation_number)
REFERENCES Reservation (reservation_number) ON DELETE CASCADE INITIALLY DEFERRED DEFERRABLE,
CONSTRAINT reservation_detail_fk2 FOREIGN KEY(flight_number)
REFERENCES Flight (flight_number) INITIALLY DEFERRED DEFERRABLE
);
CREATE TABLE Current_date (
c_date date NOT NULL --The date cannot be null
);
--Audit table for Reservation_detail. This table will be utilized in the cancel
--reservation trigger. For this table I will not maintain foreign key constraints
--since it is essentially a temporary table only used for the trigger.
CREATE TABLE Reservation_details_audit (
reservation_number varchar(5),
flight_number varchar(3),
flight_date date,
leg int DEFAULT 0,
CONSTRAINT reservation_detail_audit_pk PRIMARY KEY(reservation_number,
leg) DEFERRABLE
);
--View to keep track of the number of reservations per flight
CREATE OR REPLACE VIEW flight_seats_reserved(flight_number,reservations)
AS
SELECT flight_number, COUNT(*)
FROM Reservation_detail
GROUP BY flight_number;
commit;
--Triggers
CREATE OR REPLACE TRIGGER adjustTicket
BEFORE UPDATE OF high_price,low_price ON Price
FOR EACH ROW
DECLARE
CURSOR resv_cur(price_airline_id varchar) IS
SELECT *
FROM ((Reservation NATURAL JOIN Reservation_detail)
NATURAL LEFT JOIN Flight)
WHERE Flight.airline_id = price_airline_id AND
Reservation.ticketed = 'N'
FOR UPDATE OF cost;
resv_rec resv_cur%ROWTYPE;
BEGIN
--This cursor will contain all the unticketed reservations
--and their flight information for the airline that the
--price change has been issued to. The filtering out
--of departure and arrivale cities will happen later.
IF NOT resv_cur%ISOPEN THEN
OPEN resv_cur(:NEW.airline_id);
END IF;
LOOP
FETCH resv_cur INTO resv_rec;
EXIT WHEN resv_cur%NOTFOUND;
--Filtering of the departure/arrival city flights
--we need to possibly change.
IF resv_rec.start_city = :NEW.departure_city AND
resv_rec.end_city = :NEW.arrival_city THEN
--Determine how to update the cost of the reservation
IF resv_rec.cost = :OLD.high_price AND
:OLD.high_price != :NEW.high_price THEN
--Update cost of reservation to be the new
--high price
UPDATE Reservation SET cost = :NEW.high_price
WHERE CURRENT OF resv_cur;
ELSIF resv_rec.cost = :OLD.low_price AND
:OLD.low_price != :NEW.low_price THEN
--Update cost of reservation to be the new
--low price
UPDATE Reservation SET cost = :NEW.low_price
WHERE CURRENT OF resv_cur;
END IF;
END IF;
END LOOP;
END;
/
CREATE OR REPLACE TRIGGER planeUpgrade
BEFORE INSERT ON Reservation_detail
FOR EACH ROW
DECLARE
CURSOR airlines_planes(airline_ID varchar,curr_capacity int) IS
SELECT *
FROM Plane
WHERE owner_id = airline_ID AND plane_capacity > curr_capacity
ORDER BY plane_capacity ASC;
plane_rec airlines_planes%ROWTYPE;
airline varchar(5);
capacity int;
seats_reserved int;
BEGIN
--Gets the current plane's capacity and the airline for the
--flight and stores in variables
findPlaneCapacity(:NEW.flight_number,capacity,airline);
--Gets how many people currently have tickets for the plane
seats_reserved := seatsReserved(:NEW.flight_number);
--The current plane cannot hold the current number of people
--who have a reservation on the plane. We must upgrade.
IF capacity <= seats_reserved THEN
--Open cursor necessary to get a bigger plane
IF NOT airlines_planes%ISOPEN
THEN OPEN airlines_planes(airline,capacity);
END IF;
FETCH airlines_planes INTO plane_rec;
--If there is nothing in the cursor, that means the flight is already using
--the largest plane possible.
IF airlines_planes%NOTFOUND THEN
ROLLBACK;
END IF;
--Will continue here since something is in the cursor.
--Update the flight with the new, higher capacity plane
--type.
UPDATE Flight
SET plane_type = plane_rec.plane_type
WHERE flight_number = :NEW.flight_number;
COMMIT;
END IF;
END;
/
CREATE OR REPLACE FUNCTION seatsReserved(f_num varchar)
RETURN int
IS
seats_reserved int;
BEGIN
SELECT reservations INTO seats_reserved
FROM flight_seats_reserved FSR
WHERE FSR.flight_number = f_num;
RETURN seats_reserved;
--This catches the case where a flight currently has no reservations
--so the seats_reserved would have to be 0 and the trigger would not
--have to do anything.
EXCEPTION
WHEN NO_DATA_FOUND THEN
seats_reserved := 0;
RETURN seats_reserved;
END;
/
CREATE OR REPLACE PROCEDURE findPlaneCapacity(f_num IN varchar, capacity OUT int, airline OUT varchar)
IS
BEGIN
SELECT plane_capacity, airline_id
INTO capacity, airline
FROM Flight F LEFT OUTER JOIN Plane P
ON F.plane_type = P.plane_type AND F.airline_id = P.owner_id
WHERE F.flight_number = f_num;
END;
/
--Helper trigger. This trigger stores the flight numbers associated with reservations
--that were cancelled due to the cancelReservation trigger. The flight numbers will be
--stored into the table reservation_details_audit.
CREATE OR REPLACE TRIGGER trackReservationDeletion
BEFORE DELETE ON Reservation_detail
FOR EACH ROW
BEGIN
INSERT INTO Reservation_details_audit(reservation_number,flight_number,flight_date,leg)
VALUES(:OLD.reservation_number,:OLD.flight_number,:OLD.flight_date,:OLD.leg);
END;
/
CREATE OR REPLACE TRIGGER cancelReservation
AFTER UPDATE ON Current_date
FOR EACH ROW
DECLARE
curr_date date;
CURSOR flights_to_check IS
SELECT *
FROM Flight F
WHERE F.flight_number IN (SELECT DISTINCT flight_number
FROM Reservation_details_audit)
FOR UPDATE OF plane_type;
flight_rec flights_to_check%ROWTYPE;
flight_reserved_seats int;
CURSOR planes_cursor(airline_ID varchar) IS
SELECT *
FROM Plane
WHERE owner_id = airline_ID
ORDER BY plane_capacity ASC;
planes_rec planes_cursor%ROWTYPE;
BEGIN
--Pull the current time and place in a local variable to
--manipulate.
SELECT :NEW.c_date INTO curr_date
FROM Current_date;
--Compare the current time with 12 hours before the flight date.
--If the current time is 12 or less hours before a reservations flight
--and its not ticketed, then the reservation is cancelled.
DELETE FROM Reservation R
WHERE EXISTS(SELECT *
FROM Reservation_detail RD
WHERE RD.reservation_number = R.reservation_number AND
curr_date >= RD.flight_date - 12/24 AND R.ticketed = 'N');
--Possibly change planes for flights that can now fit in a smaller
--plane. Flights to be checked are stored via their flight number
--in the reservation_details_audit table.
--Open the necessary cursors to determine if a smaller plane is needed
IF NOT flights_to_check%ISOPEN
THEN OPEN flights_to_check;
END IF;
--This loop goes through all the flights we need to check for
--a smaller plane
LOOP
FETCH flights_to_check INTO flight_rec;
EXIT WHEN flights_to_check%NOTFOUND;
--Open the planes_cursor using the airline_id from the flight, so
--we only compare against planes the airline owns.
IF NOT planes_cursor%ISOPEN
THEN OPEN planes_cursor(flight_rec.airline_id);
END IF;
--Get the total number of people on that flight
SELECT reservations INTO flight_reserved_seats
FROM flight_seats_reserved FSR
WHERE FSR.flight_number = flight_rec.flight_number;
--Loop to compare the capacity of the planes against the number
--of people on the flight.
LOOP
FETCH planes_cursor INTO planes_rec;
EXIT WHEN planes_cursor%NOTFOUND;
--If this is true, then that means the plane we are
--currently using is the smallest plane we can use.
IF flight_rec.plane_type = planes_rec.plane_type
THEN EXIT;
END IF;
--We have found a smaller plane to use, so we set the new plane
--type in the Flight table using our cursor's current location.
IF flight_reserved_seats <= planes_rec.plane_capacity THEN
UPDATE Flight SET plane_type = planes_rec.plane_type
WHERE CURRENT OF flights_to_check;
COMMIT;
END IF;
END LOOP;
END LOOP;
--This catches the case where a flight currently has no reservations
--so the flight_seats_reserved would have to be 0. Moved outside loop
--due to error (DEBUG)
EXCEPTION
WHEN NO_DATA_FOUND THEN
flight_reserved_seats := 0;
END;
/
|
-- Average Temperature calculator
SELECT city, AVG(value) as avg_temp FROM temperatures GROUP BY city ORDER BY avg_temp DESC;
|
--------------------------------------------------------
-- DDL for Synonymn DUAL
--------------------------------------------------------
CREATE OR REPLACE PUBLIC SYNONYM "DUAL" FOR "DUAL";
|
CREATE TABLE carrier (
id CHAVE NOT NULL,
id_reference CHAVE NOT NULL,
id_tax_rules_group CHAVE,
name CHARACTER VARYING(64) NOT NULL,
url CHARACTER VARYING(255),
active BOOLEAN NOT NULL,
deleted BOOLEAN NOT NULL,
shipping_handling BOOLEAN NOT NULL,
range_behavior BOOLEAN NOT NULL,
is_module BOOLEAN NOT NULL,
is_free BOOLEAN NOT NULL,
shipping_external BOOLEAN NOT NULL,
need_range BOOLEAN NOT NULL,
external_module_name CHARACTER VARYING(64),
shipping_method INTEGER NOT NULL,
position INTEGER NOT NULL,
max_width INTEGER,
max_height INTEGER,
max_depth INTEGER,
max_weight DECIMAL(20, 6),
grade INTEGER,
CONSTRAINT pk_carrier PRIMARY KEY (id)
); |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
INSERT INTO `Robotica`.`Departamentos`(`nombred`, `numd`, `dnigte`, `inicgte`)
VALUES ('Dirección', 1, 88866555, '2011-06-16 00:00:00'),
('Administración', 4, 98765432, '2010-01-01 00:00:00'),
('Investigación', 5, 33344555, '2009-05-22 00:00:00'),
('Ventas', 2, 33344555, '2012-06-01 00:00:00'),
('I+D', 9, 90908077, '2009-08-08 00:00:00'),
('RRHH', 10, 90908077, '2010-10-08 00:00:00');
INSERT INTO `Robotica`.`Dependientes`(`dniempl`, `nombre`, `sexo`, `fechanac`, `parentesco`)
VALUES (98765432, 'Manuel', 'M', '1980-02-29 00:00:00', 'Cónyuge'),
(33344555, 'Alicia', 'F', '2012-04-05 00:00:00', 'Hija'),
(12345678, 'Alicia', 'F', '2008-12-31 00:00:00', 'Hija'),
(12345678, 'Elizabeth', 'F', '1975-05-05 00:00:00', 'Cónyuge'),
(33344555, 'Nobita', 'M', '1984-05-03 00:00:00', 'Cónyuge'),
(33344555, 'Federico', 'M', '2008-07-03 00:00:00', 'Hijo'),
(12345678, 'Miguel', 'M', '2010-01-01 00:00:00', 'Hijo'),
(33344555, 'Teodoro', 'M', '2010-10-25 00:00:00', 'Hijo');
INSERT INTO `Robotica`.`Empleados`(`dni`, `nombre`, `tratamiento`, `apellidos`, `fechanac`, `direccion`, `sexo`, `salario`, `dnisuper`, `numd`)
VALUES (12345678, 'Belén', 'Srta.', 'Silva', '1975-01-09 00:00:00', 'c/Larga 731, Cádiz', 'F', 3000, 33344555, 5),
(33344555, 'Federico', 'Sr.', 'Vizcarra', '1955-12-06 00:00:00', 'c/Corta 1638, Mairena', 'M', 1400, 88866555, 5),
(45345345, 'Josefa', 'Sra.', 'Esparza', '1992-07-31 00:00:00', 'c/Rosas 1, Sevilla', 'F', 2500, 33344555, 5),
(66688444, 'Ramón', 'D.', 'Nieto', '1990-09-15 00:00:00', 'avd. Espiga 85, Carmona', 'M', 1800, 33344555, 5),
(88866555, 'Jaime', 'D.', 'Botello', '1989-11-10 00:00:00', 'c/Sierpes 50, Sevilla', 'M', 1550, NULL, 1),
(98765432, 'Sonia', 'Sra.', 'Valdés', '1970-06-20 00:00:00', 'c/Cervantes 29, Tomares', 'F', 2400, 88866555, 4),
(98798798, 'Victor', 'Sr.', 'Hernández', '1974-03-29 00:00:00', 'Paseo de las Encinas 63, Valencina', 'M', 2150, 98765432, 4),
(99988777, 'Alicia', 'Dr.', 'Zapata', '1993-07-19 00:00:00', 'c/Castillo 21, Huelva', 'F', 1250, 98765432, 4),
(90908077, 'Narcisa', 'Exc.', 'Aspiradora', '1973-07-19 00:00:00', 'c/Cocodrilo 12, Sevilla', 'F', 1500, 98765432, 4),
(91918177, 'Claudia', 'Dª.', 'Pérez', '2000-07-19 00:00:00', 'c/Procrastinador 99, Santiponce', 'F', 1950, 98765432, 9);
INSERT INTO `Robotica`.`Lugares_dptos`(`numd`, `lugar`)
VALUES (1, 'Sevilla'),
(4, 'Santiago'),
(5, 'Huelva'),
(5, 'Sevilla'),
(5, 'Camas'),
(2, 'Santiponce'),
(9, 'Valencina');
INSERT INTO `Robotica`.`Proyectos`(`nombrep`, `nump`, `lugarp`, `numd`)
VALUES ('ProductoX', 1, 'Madrid', 5),
('ProductoY', 2, 'Soria', 5),
('ProductoZ', 3, 'Huelva', 5),
('Automatización', 10, 'Sevilla', 4),
('Reorganización', 20, 'Huelva', 1),
('Nuevas prestaciones', 30, 'Santiago', 4),
('Nave espacial', 4, 'Camas', 2),
('Buscaminas', 99, 'Valencina', 9);
INSERT INTO `Robotica`.`Trabaja_en`(`dni`, `nump`, `horas`)
VALUES (12345678, 1, 32.5),
(12345678, 2, 7.5),
(33344555, 2, 10.0),
(33344555, 3, 10.0),
(33344555, 10, 10.0),
(33344555, 20, 10.0),
(45345345, 1, 20.0),
(45345345, 2, 20.0),
(66688444, 3, 40.0),
(88866555, 20, NULL),
(98765432, 20, 15.0),
(98765432, 30, 20.0),
(98798798, 10, 35.0),
(98798798, 30, 5.0),
(99988777, 10, 10.0),
(99988777, 30, 30.0),
(99988777, 4, 10.0),
(12345678, 4, 10.0),
(91918177, 99, 40.0);
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
/**
* Author: juangu
* Created: 16-feb-2017
*/
-- COMO ROOT PARA CREAR LA BBDD Y EL USUARIO
-- Mostrar los CHARSETs instalados:
SHOW CHARACTER SET;
-- Mostrar COLLATIONS instalados:
SHOW COLLATION;
-- CREAMOS LA BBDD PARA UTF-8 COLLATION EN ESPAÑOL
CREATE DATABASE gestion_academica
CHARACTER SET utf8 COLLATE utf8_spanish_ci;
-- CREAMOS EL USUARIO
DROP USER damuser23;
CREATE USER damuser23 IDENTIFIED BY 'damuser';
-- DAMOS PERMISOS EN LA BBDD PARA EL NUEVO USUARIO
grant all privileges on gestion_academica.* to 'damuser23'@'%' identified by 'damuser';
grant all privileges on gestion_academica.* to 'damuser23'@'localhost' identified by 'damuser';
flush privileges;
-- COMO USUARIO PARA CREAR LAS TABLAS Y POBLAR DE DATOS
DROP TABLE IF EXISTS ALUM_ASIG;
DROP TABLE IF EXISTS PROF_ASIG;
DROP TABLE IF EXISTS ALUMNO;
DROP TABLE IF EXISTS PROFESOR;
DROP TABLE IF EXISTS ASIGNATURA;
CREATE TABLE ALUMNO (
id INT AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(25) NOT NULL ,
apellido VARCHAR(50) NOT NULL ) ;
CREATE TABLE PROFESOR (
id INT AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(25) NOT NULL ,
apellido VARCHAR(50) NOT NULL );
CREATE TABLE ASIGNATURA (
id INT AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(25) NOT NULL ,
curso SMALLINT,
ciclo VARCHAR(50));
CREATE TABLE ALUM_ASIG (
ASIGNATURA INT,
ALUMNO INT,
FALTAS INT,
PRIMARY KEY(ASIGNATURA,ALUMNO),
FOREIGN KEY (ALUMNO) REFERENCES ALUMNO(id) ,
FOREIGN KEY (ASIGNATURA) REFERENCES ASIGNATURA(id) );
CREATE TABLE PROF_ASIG (
ASIGNATURA INT,
PROFESOR INT,
HORAS_SEMANALES INT,
PRIMARY KEY(ASIGNATURA, PROFESOR),
FOREIGN KEY (PROFESOR) REFERENCES PROFESOR(id),
FOREIGN KEY (ASIGNATURA) REFERENCES ASIGNATURA(id));
INSERT INTO ALUMNO VALUES (
NULL,
'PEPE',
'PEREZ');
INSERT INTO PROFESOR VALUES (
NULL,
'JUAN',
'GUTIERREZ');
INSERT INTO ASIGNATURA VALUES (
NULL,
'Acceso a Datos',
2,
'DAM'
);
-- INSERT INTO PROF_ASIG VALUES ();
-- INSERT INTO PROF_ASIG VALUES ();
|
/*
hanbai_tanka_all列に、商品全体の平均販売単価を計算する
*/
SELECT shohin_id, shohin_mei, shohin_bunrui, hanbai_tanka, (SELECT AVG(hanbai_tanka) FROM Shohin) AS hanbai_tanka_all FROM Shohin;
-- hanbai_tanka全体の平均を求めるには、SELECT文を()で囲う |
select count(*)
from tbl_accounts
where is_ldapuser = 0
|
ALTER TABLE ADM_TPROC2 ADD CONSTRAINT FK_ADM_TPROC2_ADM_TNIVE
FOREIGN KEY (PROC_NIVE) REFERENCES ADM_TNIVE (NIVE_NIVE)
;
|
ALTER TABLE "public"."projects" ADD COLUMN "foldersCount" integer NOT NULL DEFAULT 0;
|
INSERT INTO public.ingredient (id, name, price) VALUES (1, 'aglio', null);
INSERT INTO public.ingredient (id, name, price) VALUES (2, 'asparagi', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (3, 'basilico', null);
INSERT INTO public.ingredient (id, name, price) VALUES (4, 'bocconcini di mozzarella', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (5, 'bresaola', null);
INSERT INTO public.ingredient (id, name, price) VALUES (6, 'brie', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (7, 'capperi ', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (8, 'carciofi', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (9, 'cipolla', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (10, 'cornicione ripieno di mozzarella', null);
INSERT INTO public.ingredient (id, name, price) VALUES (11, 'crema tartufata', null);
INSERT INTO public.ingredient (id, name, price) VALUES (12, 'crocchette di patate', null);
INSERT INTO public.ingredient (id, name, price) VALUES (13, 'curry', null);
INSERT INTO public.ingredient (id, name, price) VALUES (14, 'danese', null);
INSERT INTO public.ingredient (id, name, price) VALUES (15, 'friarielli', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (16, 'funghi', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (17, 'funghi chiodini', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (18, 'funghi freschi', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (19, 'funghi porcini', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (20, 'funghi trifolati', null);
INSERT INTO public.ingredient (id, name, price) VALUES (21, 'gamberetti', 2.50);
INSERT INTO public.ingredient (id, name, price) VALUES (22, 'gorgonzola', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (23, 'gorgonzola piccante', null);
INSERT INTO public.ingredient (id, name, price) VALUES (24, 'grana', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (25, 'grana a scaglie', null);
INSERT INTO public.ingredient (id, name, price) VALUES (26, 'latteria', null);
INSERT INTO public.ingredient (id, name, price) VALUES (27, 'mascarpone', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (28, 'melanzane al funghetto', null);
INSERT INTO public.ingredient (id, name, price) VALUES (29, 'melanzane fritte', null);
INSERT INTO public.ingredient (id, name, price) VALUES (30, 'mozzarella', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (31, 'mozzarella bufala', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (32, 'olio', null);
INSERT INTO public.ingredient (id, name, price) VALUES (33, 'olio extravergine di oliva', null);
INSERT INTO public.ingredient (id, name, price) VALUES (34, 'olive', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (35, 'olive verdi', null);
INSERT INTO public.ingredient (id, name, price) VALUES (36, 'origano', null);
INSERT INTO public.ingredient (id, name, price) VALUES (37, 'pancetta', null);
INSERT INTO public.ingredient (id, name, price) VALUES (38, 'pancetta arrosta', null);
INSERT INTO public.ingredient (id, name, price) VALUES (39, 'pancetta stufata', null);
INSERT INTO public.ingredient (id, name, price) VALUES (40, 'panna', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (41, 'patatine fritte', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (42, 'pecorino a scaglie', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (43, 'pepe', null);
INSERT INTO public.ingredient (id, name, price) VALUES (44, 'peperoni', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (45, 'peperoni fritti', null);
INSERT INTO public.ingredient (id, name, price) VALUES (46, 'pomodoro', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (47, 'pomodoro fresco', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (48, 'porchetta', null);
INSERT INTO public.ingredient (id, name, price) VALUES (49, 'prosciutto', null);
INSERT INTO public.ingredient (id, name, price) VALUES (50, 'prosciutto cotto', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (51, 'prosciutto crudo', null);
INSERT INTO public.ingredient (id, name, price) VALUES (52, 'provola affumicata', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (53, 'radicchio di Treviso', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (54, 'ricotta', 1.00);
INSERT INTO public.ingredient (id, name, price) VALUES (55, 'ricotta affumicata a scaglie', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (56, 'rosmarino', null);
INSERT INTO public.ingredient (id, name, price) VALUES (57, 'rucola', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (58, 'salame friulano', null);
INSERT INTO public.ingredient (id, name, price) VALUES (59, 'salame ungherese', null);
INSERT INTO public.ingredient (id, name, price) VALUES (60, 'salamino piccante', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (61, 'salmone affumicato', 2.50);
INSERT INTO public.ingredient (id, name, price) VALUES (62, 'salsiccia', null);
INSERT INTO public.ingredient (id, name, price) VALUES (63, 'salsiccia fresca', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (64, 'sesamo', null);
INSERT INTO public.ingredient (id, name, price) VALUES (65, 'speck', null);
INSERT INTO public.ingredient (id, name, price) VALUES (66, 'stracchino', null);
INSERT INTO public.ingredient (id, name, price) VALUES (67, 'tonno', 2.00);
INSERT INTO public.ingredient (id, name, price) VALUES (68, 'uovo', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (69, 'uovo sodo', null);
INSERT INTO public.ingredient (id, name, price) VALUES (70, 'verdure miste', null);
INSERT INTO public.ingredient (id, name, price) VALUES (71, 'wurstel', 1.50);
INSERT INTO public.ingredient (id, name, price) VALUES (72, 'patate al forno', null);
INSERT INTO public.ingredient (id, name, price) VALUES (73, 'acciughe', null);
INSERT INTO public.ingredient (id, name, price) VALUES (74, 'hamburgher', null);
INSERT INTO public.ingredient (id, name, price) VALUES (75, 'formaggio', null);
INSERT INTO public.ingredient (id, name, price) VALUES (76, 'ketchup', null);
INSERT INTO public.ingredient (id, name, price) VALUES (77, 'salsa rosa', null);
INSERT INTO public.ingredient (id, name, price) VALUES (78, 'maionese', null);
INSERT INTO public.ingredient (id, name, price) VALUES (79, 'insalata', null);
INSERT INTO public.ingredient (id, name, price) VALUES (80, 'Impasto alle Olive', 1.00); |
/*cheat sheet*/
/*comma is used for the list only*/
/*--1. Creat/drop data base:
create database databasename*/
create database day9_fa
drop database day9_fa
/*--2. Create/drop table: */
create table tablename
(
column_name_1 data_type <option for constraints>,
column_name_2 data_type
)
/*Alter is only for restructure and does not change the records */
Alter table table_name_that_exist
drop column column_name
add column column_name
alter column column_name
/*update, insert and delete is used to change the records of a table (even one cell) */
update tablename
set column_name= some_value
where row_selector_condition
delete from table_name
where row_selected_condition
Insert into tablename ()
values ()
/* select is used to retrive values of a table*/
select column_list from table
/*we can add a condition option too*/
select column_list from table
where row_selection_condition
/* we can have the order by option as well*/
select column_list from table
<where row_selection_condition>
order by column_name
/* the column at the begining of the select needed to be included in the group by*/
/* the list of column in the selected part should be part of aggregate function or the group by function */
select specific_column, aggregatefn1(any column), aggregatefn2(any column),.. from table_name
<where row_selection_condition>
group by specific_column
having row_selection_condition
order by column_list
/*finding the product name, total quentity that been sold, and available
we need to specify the product_details.id since we have the id in both side
The list of column in the selected part should be part of aggregate function or the group by function so if
we want to add something in the select, we needed to add it in the group by*/
use mynewdb
select product_details.id, name, QntyAvail, sum(qty) as Total_sold
from Product_Details join Product_Sales
on Product_Details.ID = product_sales.ProductID
group by Product_Details.ID, name, QntyAvail
/*cheat sheet*/
/*comma is used for the list only*/
/*--1. Creat/drop data base:
create database databasename*/
create database day9_fa
drop database day9_fa
/*--2. Create/drop table: */
create table tablename
(
column_name_1 data_type <option for constraints>,
column_name_2 data_type
)
/*Alter is only for restructure and does not change the records */
Alter table table_name_that_exist
drop column column_name
add column column_name
alter column column_name
/*update, insert and delete is used to change the records of a table (even one cell) */
update tablename
set column_name= some_value
where row_selector_condition
delete from table_name
where row_selected_condition
Insert into tablename ()
values ()
/* select is used to retrive values of a table*/
select column_list from table
/*we can add a condition option too*/
select column_list from table
where row_selection_condition
/* we can have the order by option as well*/
select column_list from table
<where row_selection_condition>
order by column_name
/* the column at the begining of the select needed to be included in the group by*/
/* the list of column in the selected part should be part of aggregate function or the group by function */
select specific_column, aggregatefn1(any column), aggregatefn2(any column),.. from table_name
<where row_selection_condition>
group by specific_column
having row_selection_condition
order by column_list
/*finding the product name, total quentity that been sold, and available
we need to specify the product_details.id since we have the id in both side
The list of column in the selected part should be part of aggregate function or the group by function so if
we want to add a column (something) in the select, we needed to add it in the group by*/
use mynewdb
select product_details.id, name, QntyAvail, sum(qty) as Total_sold
from Product_Details join Product_Sales
on Product_Details.ID = product_sales.ProductID
group by Product_Details.ID, name, QntyAvail
/*showing the big sold items*/
/* we CANNOT have the aggregated function after where condition*/
select name, sum(qty) as Total_sold
from Product_Details join Product_Sales
on Product_Details.ID = product_sales.ProductID
group by name
having sum(Product_Sales.Qty)>100
order by Total_sold
select name, sum(qty) as Total_sold
from Product_Details join Product_Sales
on Product_Details.ID = product_sales.ProductID
group by name
having sum(Product_Sales.Qty)>100
order by Total_sold
|
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 29, 2016 at 05:13 PM
-- Server version: 5.5.8
-- PHP Version: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `kafala`
--
-- --------------------------------------------------------
--
-- Table structure for table `employee`
--
CREATE TABLE IF NOT EXISTS `employee` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`type` int(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ;
--
-- Dumping data for table `employee`
--
INSERT INTO `employee` (`id`, `name`, `username`, `password`, `type`) VALUES
(21, 'nn2', 'un2', 's', 1),
(24, 'rrrrrr', 'rrrrr', 'rrrrrrr', 3);
-- --------------------------------------------------------
--
-- Table structure for table `experience`
--
CREATE TABLE IF NOT EXISTS `experience` (
`qualifier_name` varchar(500) NOT NULL,
`organizaton` varchar(500) NOT NULL,
`date` date NOT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`preacherID` varchar(10) NOT NULL,
UNIQUE KEY `id_2` (`id`),
KEY `id` (`id`),
KEY `preacherID` (`preacherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `experience`
--
-- --------------------------------------------------------
--
-- Table structure for table `family`
--
CREATE TABLE IF NOT EXISTS `family` (
`family_id` int(11) NOT NULL,
`state` varchar(50) NOT NULL,
`warranty_organization` int(11) NOT NULL,
`father_first_name` varchar(50) NOT NULL,
`father_middle_name` varchar(50) NOT NULL,
`father_last_name` varchar(50) NOT NULL,
`father_4th_name` varchar(50) NOT NULL,
`birth_date` date NOT NULL,
`sex` varchar(6) NOT NULL,
`social_state` int(50) NOT NULL,
`father_dead_date` date NOT NULL,
`fatjer_dead_cause` varchar(50) NOT NULL,
`father_work` varchar(50) NOT NULL,
`supporter_first_name` varchar(50) NOT NULL,
`supporter_meddle_name` varchar(50) NOT NULL,
`supporter_last_name` varchar(50) NOT NULL,
`supporter_4th_name` varchar(50) NOT NULL,
`supporter_birth_date` date NOT NULL,
`supporter_sex` varchar(6) NOT NULL,
`supporter_state` varchar(50) NOT NULL,
`supporter_relation` varchar(50) NOT NULL,
`supporter_work` varchar(50) NOT NULL,
`residence_state` int(11) NOT NULL,
`city` varchar(50) NOT NULL,
`District` varchar(50) NOT NULL,
`section` int(11) NOT NULL,
`house_no` int(11) NOT NULL,
`phone1` int(11) NOT NULL,
`phone2` int(11) NOT NULL,
`male_memebers_no` int(11) NOT NULL,
`female_memebers_no` int(11) NOT NULL,
`memebr_id` int(11) NOT NULL,
`data_entery_name` varchar(50) NOT NULL,
`data_entery_date` date NOT NULL,
`head_dep_name` varchar(50) NOT NULL,
`head_dep_date` date NOT NULL,
UNIQUE KEY `family_id` (`family_id`),
KEY `memebr_id` (`memebr_id`),
KEY `id` (`family_id`),
KEY `warranty_organization` (`warranty_organization`),
KEY `residence_state` (`residence_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `family`
--
-- --------------------------------------------------------
--
-- Table structure for table `family_member`
--
CREATE TABLE IF NOT EXISTS `family_member` (
`family_id` int(11) NOT NULL,
`member_id` int(11) NOT NULL,
KEY `family_id` (`family_id`),
KEY `member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `family_member`
--
-- --------------------------------------------------------
--
-- Table structure for table `f_member`
--
CREATE TABLE IF NOT EXISTS `f_member` (
`member_id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`sex` varchar(50) NOT NULL,
`birth_date` varchar(50) NOT NULL,
`relation` varchar(50) NOT NULL,
`study_level` varchar(50) NOT NULL,
`health_state` varchar(50) NOT NULL,
`familyID` int(11) NOT NULL,
KEY `id` (`member_id`),
KEY `familyID` (`familyID`),
KEY `member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `f_member`
--
-- --------------------------------------------------------
--
-- Table structure for table `orphan`
--
CREATE TABLE IF NOT EXISTS `orphan` (
`id` varchar(100) NOT NULL,
`state` varchar(50) NOT NULL,
`warranty_organization` int(11) NOT NULL,
`first_name` varchar(50) NOT NULL,
`meddle_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`last_4th_name` varchar(50) NOT NULL,
`birth_date` date NOT NULL,
`sex` varchar(6) NOT NULL,
`mother_first_name` varchar(50) NOT NULL,
`mother_middle_name` varchar(50) NOT NULL,
`mother_last_name` varchar(50) NOT NULL,
`mother_4th_name` varchar(50) NOT NULL,
`mother_Birth_date` date NOT NULL,
`mother_state` varchar(5) NOT NULL,
`father_dead_date` date NOT NULL,
`father_dead_cause` varchar(100) NOT NULL,
`father_work` varchar(100) NOT NULL,
`residence_state` int(11) NOT NULL,
`city` varchar(100) NOT NULL,
`District` varchar(100) NOT NULL,
`section` int(10) NOT NULL,
`house_no` int(50) NOT NULL,
`phone1` int(20) NOT NULL,
`phone2` int(20) NOT NULL,
`sisters_no` int(20) NOT NULL,
`brothers_no` int(20) NOT NULL,
`sibiling` varchar(50) NOT NULL,
`studing_state` varchar(50) NOT NULL,
`nonstuding_cause` varchar(50) NOT NULL,
`school_name` varchar(50) NOT NULL,
`level` int(10) NOT NULL,
`year` int(10) NOT NULL,
`quran_parts` int(10) NOT NULL,
`health_state` varchar(50) NOT NULL,
`ill_cause` varchar(50) NOT NULL,
`data_entery_name` varchar(50) NOT NULL,
`data_entery_date` date NOT NULL,
`head_dep_name` varchar(50) NOT NULL,
`head_dep_date` int(11) NOT NULL,
UNIQUE KEY `id` (`id`),
KEY `warranty_organization` (`warranty_organization`),
KEY `residence_state` (`residence_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `orphan`
--
-- --------------------------------------------------------
--
-- Table structure for table `preacher`
--
CREATE TABLE IF NOT EXISTS `preacher` (
`id` varchar(10) NOT NULL,
`type` int(11) NOT NULL,
`state` varchar(50) NOT NULL,
`warranty_organization` int(11) NOT NULL,
`first_name` varchar(50) NOT NULL,
`meddle_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`last_4th_name` varchar(50) NOT NULL,
`birth_date` date NOT NULL,
`sex` varchar(6) NOT NULL,
`male_memebers_no` int(10) NOT NULL,
`female_memebers_no` int(10) NOT NULL,
`residence_state` int(11) NOT NULL,
`city` varchar(50) NOT NULL,
`District` varchar(50) NOT NULL,
`section` int(10) NOT NULL,
`house_no` int(10) NOT NULL,
`phone1` int(11) NOT NULL,
`phone2` int(11) NOT NULL,
`qualify_name` varchar(50) NOT NULL,
`qualify_date` varchar(50) NOT NULL,
`qualify_rating` varchar(50) NOT NULL,
`quran_parts` int(11) NOT NULL,
`Issuer` varchar(50) NOT NULL,
`current_work` varchar(50) NOT NULL,
`Joining_Date` date NOT NULL,
`health_state` varchar(50) NOT NULL,
`ill_cause` varchar(50) NOT NULL,
`data_entery_name` varchar(50) NOT NULL,
`data_entery_date` date NOT NULL,
`head_dep_name` varchar(50) NOT NULL,
`head_dep_date` date NOT NULL,
UNIQUE KEY `id` (`id`),
KEY `residence_state` (`residence_state`),
KEY `warranty_organization` (`warranty_organization`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `preacher`
--
-- --------------------------------------------------------
--
-- Table structure for table `sibiling`
--
CREATE TABLE IF NOT EXISTS `sibiling` (
`id` varchar(100) NOT NULL,
`name` varchar(50) NOT NULL,
`sex` varchar(50) NOT NULL,
`birth_date` date NOT NULL,
`state` varchar(50) NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `sibiling`
--
-- --------------------------------------------------------
--
-- Table structure for table `sponsor`
--
CREATE TABLE IF NOT EXISTS `sponsor` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`numberOFSponsored` int(11) NOT NULL,
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `sponsor`
--
-- --------------------------------------------------------
--
-- Table structure for table `sponsorship`
--
CREATE TABLE IF NOT EXISTS `sponsorship` (
`id` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`saving` int(11) NOT NULL,
`date` date NOT NULL,
`sponsor` int(11) NOT NULL,
`month_no` int(11) NOT NULL,
KEY `sponsor` (`sponsor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf32;
--
-- Dumping data for table `sponsorship`
--
-- --------------------------------------------------------
--
-- Table structure for table `state`
--
CREATE TABLE IF NOT EXISTS `state` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `state`
--
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE IF NOT EXISTS `student` (
`id` varchar(100) NOT NULL,
`state` varchar(50) NOT NULL,
`warranty_organization` int(11) NOT NULL,
`first_name` varchar(50) NOT NULL,
`meddle_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`last_4th_name` varchar(50) NOT NULL,
`birth_date` date NOT NULL,
`sex` varchar(6) NOT NULL,
`father_dead_date` date NOT NULL,
`father_dead_cause` varchar(100) NOT NULL,
`father_work` varchar(100) NOT NULL,
`sisters_no` int(20) NOT NULL,
`brothers_no` int(20) NOT NULL,
`residence_state` int(11) NOT NULL,
`city` varchar(100) NOT NULL,
`District` varchar(100) NOT NULL,
`section` int(20) NOT NULL,
`house_no` int(20) NOT NULL,
`phone1` int(20) NOT NULL,
`phone2` int(20) NOT NULL,
`school_name` varchar(100) NOT NULL,
`uni_name` varchar(100) NOT NULL,
`level` int(20) NOT NULL,
`year` int(20) NOT NULL,
`last_result` varchar(100) NOT NULL,
`quran_parts` int(20) NOT NULL,
`study_year_no` int(20) NOT NULL,
`study_date_start` year(4) NOT NULL,
`expected_grad` year(4) NOT NULL,
`health_state` varchar(50) NOT NULL,
`ill_cause` varchar(50) NOT NULL,
`data_entery_name` varchar(50) NOT NULL,
`data_entery_date` date NOT NULL,
`head_dep_name` varchar(50) NOT NULL,
`head_dep_date` date NOT NULL,
UNIQUE KEY `id_2` (`id`),
KEY `id` (`id`),
KEY `warranty_organization` (`warranty_organization`),
KEY `residence_state` (`residence_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `student`
--
--
-- Constraints for dumped tables
--
--
-- Constraints for table `experience`
--
ALTER TABLE `experience`
ADD CONSTRAINT `experience_ibfk_1` FOREIGN KEY (`preacherID`) REFERENCES `preacher` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `family`
--
ALTER TABLE `family`
ADD CONSTRAINT `family_id` FOREIGN KEY (`memebr_id`) REFERENCES `family_member` (`family_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `family_state_id` FOREIGN KEY (`residence_state`) REFERENCES `state` (`id`),
ADD CONSTRAINT `sponsorship_id` FOREIGN KEY (`warranty_organization`) REFERENCES `sponsor` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `f_member`
--
ALTER TABLE `f_member`
ADD CONSTRAINT `f_member_ibfk_1` FOREIGN KEY (`familyID`) REFERENCES `family` (`family_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `member_id` FOREIGN KEY (`member_id`) REFERENCES `family_member` (`member_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `orphan`
--
ALTER TABLE `orphan`
ADD CONSTRAINT `sponsorship_organization` FOREIGN KEY (`warranty_organization`) REFERENCES `sponsor` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `state_id` FOREIGN KEY (`residence_state`) REFERENCES `state` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `preacher`
--
ALTER TABLE `preacher`
ADD CONSTRAINT `preacher_sponsor_id` FOREIGN KEY (`warranty_organization`) REFERENCES `sponsor` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `preacher_state_id` FOREIGN KEY (`residence_state`) REFERENCES `state` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `sponsorship`
--
ALTER TABLE `sponsorship`
ADD CONSTRAINT `sponsorship_fk` FOREIGN KEY (`sponsor`) REFERENCES `sponsor` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE;
--
-- Constraints for table `student`
--
ALTER TABLE `student`
ADD CONSTRAINT `student_sponsor_id` FOREIGN KEY (`warranty_organization`) REFERENCES `sponsor` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `student_state_id` FOREIGN KEY (`residence_state`) REFERENCES `state` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
with
s01 as
(select s.DateEventValue, s.TaskId, s.SlaEventId, s.RowNumber
from
(
select (case when dec.col_datevalue is not null then dec.col_datevalue else sysdate end) as DateEventValue, tsk.col_id as TaskId, se.col_id as SlaEventId,
row_number() over (partition by tsk.col_id order by (case when dec.col_datevalue is not null then dec.col_datevalue else sysdate end) asc) as RowNumber
from tbl_task tsk
inner join tbl_slaevent se on tsk.col_id = se.col_slaeventtask
inner join tbl_case cs on tsk.col_casetask = cs.col_id
inner join tbl_dateevent des on tsk.col_id = des.col_dateeventtask and se.col_slaevent_dateeventtype = des.col_dateevent_dateeventtype
left join tbl_dateevent dec on tsk.col_id = dec.col_dateeventtask and dec.col_datename = 'DATE_TASK_CLOSED' where se.col_isprimary = 1) s
where s.RowNumber = 1),
s02 as
(select s.DateEventValue, s.TaskId, s.SlaEventId, s.RowNumber
from
(
select (case when dec.col_datevalue is not null then dec.col_datevalue else sysdate end) as DateEventValue, tsk.col_id as TaskId, se.col_id as SlaEventId,
row_number() over (partition by tsk.col_id order by (case when dec.col_datevalue is not null then dec.col_datevalue else sysdate end) desc) as RowNumber
from tbl_task tsk
inner join tbl_slaevent se on tsk.col_id = se.col_slaeventtask
inner join tbl_case cs on tsk.col_casetask = cs.col_id
inner join tbl_dateevent des on tsk.col_id = des.col_dateeventtask and se.col_slaevent_dateeventtype = des.col_dateevent_dateeventtype
left join tbl_dateevent dec on tsk.col_id = dec.col_dateeventtask and dec.col_datename = 'DATE_TASK_CLOSED' where se.col_isprimary = 1) s
where s.RowNumber = 1),
s11 as
(select s.SlaEventId, s.TaskId, s.TaskName, s.TaskTitle, s.CaseId, s.TaskParentId, s.TaskWorkitemId,
s.SlaEventTypeId, s.SlaEventTypeCode, s.SlaEventTypeName, s.SlaEventTypeIntervalDS, s.SlaEventTypeIntervalYM, s.SlaEventLevelId, s.SlaEventLevelCode, s.SlaEventLevelName,
s.DateEventTypeId, s.DateEventTypeCode, s.DateEventTypeName, s.DateEventId, s.DateEventName, s.DateEventValue, s.DateEventPerformedBy, s.DateTimeEventValue, s.SlaDateTime, s.SlaDaysLeft,
s.RowNumber
from
(select se2.col_id as SlaEventId,
tsk2.col_id as TaskId, tsk2.col_name as TaskName, tsk2.col_taskid as TaskTitle, tsk2.col_casetask as CaseId, tsk2.col_parentid as TaskParentId,
twi2.col_id as TaskWorkitemId,
setp2.col_id as SlaEventTypeId, setp2.col_code as SlaEventTypeCode, setp2.col_name as SlaEventTypeName,
setp2.col_intervalds as SlaEventTypeIntervalDS, setp2.col_intervalym as SlaEventTypeIntervalYM,
sel2.col_id as SlaEventLevelId, sel2.col_code as SlaEventLevelCode, sel2.col_name as SlaEventLevelName,
det2.col_id as DateEventTypeId, det2.col_code as DateEventTypeCode, det2.col_name as DateEventTypeName,
de2.col_id as DateEventId, de2.col_datename as DateEventName, de2.col_datevalue as DateEventValue, de2.col_performedby as DateEventPerformedBy,
cast (de2.col_datevalue as timestamp) as DateTimeEventValue,
(cast(de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/ as timestamp)) as SlaDateTime,
greatest(((de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/) - cast(s01.DateEventValue as timestamp)), to_dsinterval('0 0' || ':' || '0' || ':' || '0')) as SlaDaysLeft,
row_number() over (partition by tsk2.col_id order by (case
when (((de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/) - s01.DateEventValue) > 0)
then ((de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/) - s01.DateEventValue)
else 999999
end) asc) as RowNumber
from tbl_slaevent se2
inner join tbl_task tsk2 on se2.col_slaeventtask = tsk2.col_id
inner join tbl_tw_workitem twi2 on tsk2.col_tw_workitemtask = twi2.col_id
inner join tbl_case cs2 on tsk2.col_casetask = cs2.col_id
inner join tbl_dict_slaeventtype setp2 on se2.col_slaeventdict_slaeventtype = setp2.col_id
inner join tbl_dict_slaeventlevel sel2 on se2.col_slaevent_slaeventlevel = sel2.col_id
inner join tbl_dict_dateeventtype det2 on se2.col_slaevent_dateeventtype = det2.col_id
inner join tbl_dateevent de2 on tsk2.col_id = de2.col_dateeventtask and se2.col_slaevent_dateeventtype = de2.col_dateevent_dateeventtype
inner join s01 on tsk2.col_id = s01.TaskId and se2.col_id = s01.SlaEventId) s
where s.RowNumber = 1),
s12 as
(select s.SlaEventId, s.TaskId, s.TaskName, s.TaskTitle, s.CaseId, s.TaskParentId, s.TaskWorkitemId,
s.SlaEventTypeId, s.SlaEventTypeCode, s.SlaEventTypeName, s.SlaEventTypeIntervalDS, s.SlaEventTypeIntervalYM, s.SlaEventLevelId, s.SlaEventLevelCode, s.SlaEventLevelName,
s.DateEventTypeId, s.DateEventTypeCode, s.DateEventTypeName, s.DateEventId, s.DateEventName, s.DateEventValue, s.DateEventPerformedBy, s.DateTimeEventValue, s.SlaDateTime, s.SlaDaysLeft,
s.RowNumber
from
(select se2.col_id as SlaEventId,
tsk2.col_id as TaskId, tsk2.col_name as TaskName, tsk2.col_taskid as TaskTitle, tsk2.col_casetask as CaseId, tsk2.col_parentid as TaskParentId,
twi2.col_id as TaskWorkitemId,
setp2.col_id as SlaEventTypeId, setp2.col_code as SlaEventTypeCode, setp2.col_name as SlaEventTypeName,
setp2.col_intervalds as SlaEventTypeIntervalDS, setp2.col_intervalym as SlaEventTypeIntervalYM,
sel2.col_id as SlaEventLevelId, sel2.col_code as SlaEventLevelCode, sel2.col_name as SlaEventLevelName,
det2.col_id as DateEventTypeId, det2.col_code as DateEventTypeCode, det2.col_name as DateEventTypeName,
de2.col_id as DateEventId, de2.col_datename as DateEventName, de2.col_datevalue as DateEventValue, de2.col_performedby as DateEventPerformedBy,
cast (de2.col_datevalue as timestamp) as DateTimeEventValue,
(cast(de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/ as timestamp)) as SlaDateTime,
greatest((cast(s02.DateEventValue as timestamp) - (de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/)), to_dsinterval('0 0' || ':' || '0' || ':' || '0')) as SlaDaysLeft,
row_number() over (partition by tsk2.col_id order by (case
when ((s02.DateEventValue - (de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/) ) > 0)
then (s02.DateEventValue - (de2.col_datevalue +
(case when se2.col_intervalds is not null then to_dsinterval(se2.col_intervalds) else to_dsinterval('0 0' || ':' || '0' || ':' || '0') end) /** (se2.col_attemptcount + 1)*/ +
(case when se2.col_intervalym is not null then to_yminterval(se2.col_intervalym) else to_yminterval('0-0') end) /** (se2.col_attemptcount + 1)*/))
else 999999
end) asc) as RowNumber
from tbl_slaevent se2
inner join tbl_task tsk2 on se2.col_slaeventtask = tsk2.col_id
inner join tbl_tw_workitem twi2 on tsk2.col_tw_workitemtask = twi2.col_id
inner join tbl_case cs2 on tsk2.col_casetask = cs2.col_id
inner join tbl_dict_slaeventtype setp2 on se2.col_slaeventdict_slaeventtype = setp2.col_id
inner join tbl_dict_slaeventlevel sel2 on se2.col_slaevent_slaeventlevel = sel2.col_id
inner join tbl_dict_dateeventtype det2 on se2.col_slaevent_dateeventtype = det2.col_id
inner join tbl_dateevent de2 on tsk2.col_id = de2.col_dateeventtask and se2.col_slaevent_dateeventtype = de2.col_dateevent_dateeventtype
inner join s02 on tsk2.col_id = s02.TaskId and se2.col_id = s02.SlaEventId) s
where s.RowNumber = 1)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
select NextSlaEventId, NextTaskId, NextTaskName, NextTaskTitle,
NextCaseId, NextTaskParentId, NextTaskWorkitemId,
(case when NextSlaDateTime > s01DateEventValue then NextSlaDateTime else null end) as NextSlaDateTime,
NextSlaDaysLeft,
NextSlaDateTimeFrom, NextSlaDaysFrom,
(case when NextSlaMonths > 0 then NextSlaMonths else 0 end) as NextSlaMonths,
(case when extract(day from NextSlaDaysFrom) > 0 then extract(day from NextSlaDaysFrom) else 0 end) as NextSlaDays,
(case when extract(hour from NextSlaDaysFrom) > 0 then extract(hour from NextSlaDaysFrom) else 0 end) as NextSlaHours,
(case when extract(minute from NextSlaDaysFrom) > 0 then extract(minute from NextSlaDaysFrom) else 0 end) as NextSlaMinutes,
(case when extract(second from NextSlaDaysFrom) > 0 then extract(second from NextSlaDaysFrom) else 0 end) as NextSlaSeconds,
NextSlaEventTypeId, NextSlaEventTypeCode, NextSlaEventTypeName,
NextSlaEventTypeIntervalDS, NextSlaEventTypeIntervalYM,
NextSlaEventLevelId, NextSlaEventLevelCode, NextSlaEventLevelName,
NextDateEventTypeId, NextDateEventTypeCode, NextDateEventTypeName,
NextDateEventId, NextDateEventName, NextDateEventValue, NextDateEventPerformedby,
NextDateTimeEventValue,
PrevSlaEventId, PrevTaskId, PrevTaskName, PrevTaskTitle,
PrevCaseId, PrevTaskParentId, PrevTaskWorkitemId,
(case when PrevSlaDateTime < s02DateEventValue then PrevSlaDateTime else null end) as PrevSlaDateTime,
PrevSlaDaysLeft,
PrevSlaDateTimeFrom, PrevSlaDaysFrom,
(case when PrevSlaMonths > 0 then PrevSlaMonths else 0 end) as PrevSlaMonths,
(case when extract(day from PrevSlaDaysFrom) > 0 then extract(day from PrevSlaDaysFrom) else 0 end) as PrevSlaDays,
(case when extract(hour from PrevSlaDaysFrom) > 0 then extract(hour from PrevSlaDaysFrom) else 0 end) as PrevSlaHours,
(case when extract(minute from PrevSlaDaysFrom) > 0 then extract(minute from PrevSlaDaysFrom) else 0 end) as PrevSlaMinutes,
(case when extract(second from PrevSlaDaysFrom) > 0 then extract(second from PrevSlaDaysFrom) else 0 end) as PrevSlaSeconds,
PrevSlaEventTypeId, PrevSlaEventTypeCode, PrevSlaEventTypeName,
PrevSlaEventTypeIntervalDS, PrevSlaEventTypeIntervalYM,
PrevSlaEventLevelId, PrevSlaEventLevelCode, PrevSlaEventLevelName,
PrevDateEventTypeId, PrevDateEventTypeCode, PrevDateEventTypeName,
PrevDateEventId, PrevDateEventName, PrevDateEventValue, PrevDateEventPerformedBy,
PrevDateTimeEventValue
from
(select s1.SlaEventId as NextSlaEventId, s1.TaskId as NextTaskId, s1.TaskName as NextTaskName, s1.TaskTitle as NextTaskTitle,
s1.CaseId as NextCaseId, s1.TaskParentId as NextTaskParentId, s1.TaskWorkitemId as NextTaskWorkitemId, s1.SlaDateTime as NextSlaDateTime, s1.SlaDaysLeft as NextSlaDaysLeft,
add_months(sysdate, trunc(months_between(s1.SlaDateTime, sysdate))) as NextSlaDateTimeFrom,
trunc(months_between(s1.SlaDateTime, sysdate)) as NextSlaMonths,
s1.SlaDateTime - add_months(sysdate, trunc(months_between(s1.SlaDateTime, sysdate))) as NextSlaDaysFrom,
s1.SlaEventTypeId as NextSlaEventTypeId, s1.SlaEventTypeCode as NextSlaEventTypeCode, s1.SlaEventTypeName as NextSlaEventTypeName,
s1.SlaEventTypeIntervalDS as NextSlaEventTypeIntervalDS, s1.SlaEventTypeIntervalYM as NextSlaEventTypeIntervalYM,
s1.SlaEventLevelId as NextSlaEventLevelId, s1.SlaEventLevelCode as NextSlaEventLevelCode, s1.SlaEventLevelName as NextSlaEventLevelName,
s1.DateEventTypeId as NextDateEventTypeId, s1.DateEventTypeCode as NextDateEventTypeCode, s1.DateEventTypeName as NextDateEventTypeName,
s1.DateEventId as NextDateEventId, s1.DateEventName as NextDateEventName, s1.DateEventValue as NextDateEventValue, s1.DateEventPerformedBy as NextDateEventPerformedby,
s1.DateTimeEventValue as NextDateTimeEventValue,
s1.s01DateEventValue as s01DateEventValue,
s2.SlaEventId as PrevSlaEventId, s2.TaskId as PrevTaskId, s2.TaskName as PrevTaskName, s2.TaskTitle as PrevTaskTitle,
s2.CaseId as PrevCaseId, s2.TaskParentId as PrevTaskParentId, s2.TaskWorkitemId as PrevTaskWorkitemId, s2.SlaDateTime as PrevSlaDateTime, s2.SlaDaysLeft as PrevSlaDaysLeft,
trunc(months_between(sysdate, s2.SlaDateTime)) as PrevSlaMonths,
add_months(s2.SlaDateTime, trunc(months_between(sysdate, s2.SlaDateTime))) as PrevSlaDateTimeFrom,
cast(sysdate as timestamp) - add_months(s2.SlaDateTime, trunc(months_between(sysdate, s2.SlaDateTime))) as PrevSlaDaysFrom,
s2.SlaEventTypeId as PrevSlaEventTypeId, s2.SlaEventTypeCode as PrevSlaEventTypeCode, s2.SlaEventTypeName as PrevSlaEventTypeName,
s2.SlaEventTypeIntervalDS as PrevSlaEventTypeIntervalDS, s2.SlaEventTypeIntervalYM as PrevSlaEventTypeIntervalYM,
s2.SlaEventLevelId as PrevSlaEventLevelId, s2.SlaEventLevelCode as PrevSlaEventLevelCode, s2.SlaEventLevelName as PrevSlaEventLevelName,
s2.DateEventTypeId as PrevDateEventTypeId, s2.DateEventTypeCode as PrevDateEventTypeCode, s2.DateEventTypeName as PrevDateEventTypeName,
s2.DateEventId as PrevDateEventId, s2.DateEventName as PrevDateEventName, s2.DateEventValue as PrevDateEventValue, s2.DateEventPerformedBy as PrevDateEventPerformedBy,
s2.DateTimeEventValue as PrevDateTimeEventValue,
s2.s02DateEventValue as s02DateEventValue
from
(select s11.SlaEventId, s11.TaskId, s11.TaskName, s11.TaskTitle, s11.CaseId, s11.TaskParentId, s11.TaskWorkitemId, s11.SlaDateTime, s11.SlaDaysLeft,
trunc(months_between(s11.SlaDateTime, sysdate)) as trancated,
s11.SlaEventTypeId, s11.SlaEventTypeCode, s11.SlaEventTypeName, s11.SlaEventTypeIntervalDS, s11.SlaEventTypeIntervalYM, s11.SlaEventLevelId, s11.SlaEventLevelCode, s11.SlaEventLevelName,
s11.DateEventTypeId, s11.DateEventTypeCode, s11.DateEventTypeName, s11.DateEventId, s11.DateEventName, s11.DateEventValue, s11.DateEventPerformedBy, s11.DateTimeEventValue,
s01.DateEventValue as s01DateEventValue
from s11
left join s01 on s11.TaskId = s01.TaskId and s11.SlaEventId = s01.SlaEventId) s1
left join
(select s12.SlaEventId, s12.TaskId, s12.TaskName, s12.TaskTitle, s12.CaseId, s12.TaskParentId, s12.TaskWorkitemId, s12.SlaDateTime, s12.SlaDaysLeft,
s12.SlaEventTypeId, s12.SlaEventTypeCode, s12.SlaEventTypeName, s12.SlaEventTypeIntervalDS, s12.SlaEventTypeIntervalYM, s12.SlaEventLevelId, s12.SlaEventLevelCode, s12.SlaEventLevelName,
s12.DateEventTypeId, s12.DateEventTypeCode, s12.DateEventTypeName, s12.DateEventId, s12.DateEventName, s12.DateEventValue, s12.DateEventPerformedBy, s12.DateTimeEventValue,
s02.DateEventValue as s02DateEventValue
from s12
left join s02 on s12.TaskId = s02.TaskId and s12.SlaEventId = s02.SlaEventId) s2 on s1.TaskId = s2.TaskId) |
UPDATE Roles SET
Name = @Name
WHERE
ID = @ID; |
REM tabldemo.sql
REM Version 1.0, last updated 7/17/97
REM This procedure outputs the data in students in an HTML table, as
REM described in Chapter 19 of _Oracle8 PL/SQL Programming_ by Scott Urman.
CREATE OR REPLACE PROCEDURE TableDemo AS
CURSOR c_Students IS
SELECT *
FROM students
ORDER BY ID;
BEGIN
HTP.htmlOpen;
HTP.headOpen;
HTP.title('Table Demo');
HTP.headClose;
HTP.bodyOpen;
HTP.tableOpen(cborder => 'BORDER=1');
-- Loop over the students, and for each one output two table
-- rows, which look something like:
-- +--------------------------------+
-- | | first_name last_name |
-- | ID +---------+-----------------+
-- | | major | current_credits |
-- +----+---------+-----------------+
FOR v_StudentRec in c_Students LOOP
HTP.tableRowOpen;
HTP.tableData(crowspan => 2,
cvalue => HTF.bold(v_StudentRec.ID));
HTP.tableData(ccolspan => 2,
calign => 'CENTER',
cvalue => v_StudentRec.first_name || ' ' ||
v_StudentRec.last_name);
HTP.tableRowClose;
HTP.tableRowOpen;
HTP.tableData(cvalue => 'Major: ' || v_StudentRec.major);
HTP.tableData(cvalue => 'Credits: ' || v_StudentRec.current_credits);
HTP.tableRowClose;
END LOOP;
HTP.tableClose;
OWA_UTIL.signature('TableDemo');
HTP.bodyClose;
HTP.htmlClose;
END TableDemo;
/
|
-- Old Table Design by MySQL
/**
* Author: TiramiAsu
* Created: Jun 4, 2019
*/
/*
n型態: 用於萬國碼(不同語系的國家不會亂碼)
var: 可變動長度(可大於設定的 n ,沒有 var 型態如果超過 n 會出錯)
字串型態/儲存大小(bytes)
char(n)/ n : 資料必須 <= n : 一定長度,且只會有英數字
varchar(n)/ n+2 : 資料可 > n : 長度可變動,且只會有英數字
nchar(n)/ 2*n : 資料必須 <= n : 一定長度,且可能會用非英數以外的字元
nvarchar(n)/ 2*n+2: 資料可 > n : 長度可變動,且可能會用非英數以外的字元
讀取效能: 高(nchar,char) > (nvarchar, varchar)低
儲存空間: 大(nvarchar,nchar) > (varchar,char)小
*/
CREATE TABLE ICCustomers(
c_ID int(12) not null primary key auto_increment,
c_Code char(20) not null, # 單純英文數字
c_Name nvarchar(20) not null, # 可能有其他語系名字
c_Phone nvarchar(16) not null, # +886-977-989-898,可能沒打符號會<16
c_Point int(12) not null, # 點數: 單純數字
c_Remark text(255)
);
CREATE TABLE Employees(
e_ID int(12) not null primary key auto_increment,
e_Code char(20) not null, # 單純英文數字
e_Name nvarchar(20) not null, # 可能有其他語系名字
e_Phone nvarchar(12) not null, # +886-977-989-898,可能沒打符號會<16
e_Position varchar(20) not null, # 職務: 單純英文
e_Remark text(255)
);
CREATE TABLE Products(
p_ID int(12) not null primary key auto_increment,
p_Code char(20) not null, # 單純英文數字
p_Name nvarchar(20) not null, # 可能有其他語系名字
p_Price decimal(9,3) not null,
p_Cost decimal(9,3) not null,
p_Unit nvarchar(5) not null,
p_Status nchar(5) not null, # 狀態: 停售/販售中
p_Remark text(255)
);
CREATE TABLE Orders(
o_ID int(12) not null primary key auto_increment,
e_ID int(12) not null,
c_ID int(12) not null,
o_Date date not null,
o_Time time not null,
o_Remark text(255)
);
CREATE TABLE OrderDetails( # 未設 Primary Key
e_ID int(12) not null,
c_ID int(12) not null,
od_Price decimal(9,3) not null,
od_Unit nvarchar(5) not null,
od_Quantity int(12) not null,
od_Remark text(255)
);
CREATE TABLE TimeCard( # 未設 Primary Key
e_ID int(12) not null,
tc_Date date not null,
tc_GoTime time not null,
tc_OffTime time not null,
tc_Remark text(255)
);
/*
utf8: 編碼最大長度: 1-3位元
utf8mb4(most bytes 4) : 編碼最大長度1-4位元
速度: utf8mb4_general_ci > utf8mb4_unicode_ci
精確度: utf8mb4_unicode_ci > utf8mb4_general_ci
*/
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; |
CREATE TABLE IF NOT EXISTS product_image (
ID serial primary key,
image_id INT NOT NULL,
Product_main_Product INT NOT NULL);
INSERT INTO product_image (ID, image_id, Product_main_Product) VALUES
(1, 1, 1)
,(2, 2, 1)
, (3, 3, 1)
, (4, 4, 1);
|
CREATE table IF NOT EXISTS Pending_Requests (
UID uuid REFERENCES jobseeker(uid) ON DELETE CASCADE,
Job_ID serial REFERENCES job(Job_ID) ON DELETE CASCADE,
Num_Times_Viewed int not null,
PRIMARY KEY (UID, Job_ID)
); |
create or replace procedure LeftMenuConfig_Insert_All(flag out integer,
msg out varchar2) as
id_1 integer;
defaultIndex_1 integer;
userId integer;
CURSOR hrmCompany_cursor IS
SELECT id FROM HrmCompany order by id;
CURSOR leftMenuInfo_cursor IS
SELECT id, defaultIndex FROM LeftMenuInfo;
CURSOR hrmSubCompany_cursor IS
SELECT id FROM HrmSubCompany order by id;
CURSOR hrmResourceManager_cursor IS
SELECT id FROM HrmResourceManager order by id;
CURSOR hrmResource_cursor IS
SELECT id FROM HrmResource order by id;
begin
/*总部*/
OPEN hrmCompany_cursor;
LOOP
FETCH hrmCompany_cursor
INTO userId;
EXIT WHEN hrmCompany_cursor%NOTFOUND;
OPEN leftMenuInfo_cursor;
LOOP
FETCH leftMenuInfo_cursor
INTO id_1, defaultIndex_1;
EXIT WHEN leftMenuInfo_cursor%NOTFOUND;
INSERT INTO LeftMenuConfig
(userId,
infoId,
visible,
viewIndex,
resourceid,
resourcetype,
locked,
lockedById,
useCustomName)
VALUES
(0, id_1, 1, defaultIndex_1, userId, '1', 0, 0, 0);
END LOOP;
CLOSE leftMenuInfo_cursor;
END LOOP;
CLOSE hrmCompany_cursor;
/*分部*/
OPEN hrmSubCompany_cursor;
LOOP
FETCH hrmSubCompany_cursor
INTO userId;
EXIT WHEN hrmSubCompany_cursor%NOTFOUND;
OPEN leftMenuInfo_cursor;
LOOP
FETCH leftMenuInfo_cursor
INTO id_1, defaultIndex_1;
EXIT WHEN leftMenuInfo_cursor%NOTFOUND;
INSERT INTO LeftMenuConfig
(userId,
infoId,
visible,
viewIndex,
resourceid,
resourcetype,
locked,
lockedById,
useCustomName)
VALUES
(0, id_1, 1, defaultIndex_1, userId, '2', 0, 0, 0);
END LOOP;
CLOSE leftMenuInfo_cursor;
END LOOP;
CLOSE hrmSubCompany_cursor;
/*系统管理员*/
OPEN hrmResourceManager_cursor;
LOOP
FETCH hrmResourceManager_cursor
INTO userId;
EXIT WHEN hrmResourceManager_cursor%NOTFOUND;
OPEN leftMenuInfo_cursor;
LOOP
FETCH leftMenuInfo_cursor
INTO id_1, defaultIndex_1;
EXIT WHEN leftMenuInfo_cursor%NOTFOUND;
INSERT INTO LeftMenuConfig
(userId,
infoId,
visible,
viewIndex,
resourceid,
resourcetype,
locked,
lockedById,
useCustomName)
VALUES
(userId, id_1, 1, defaultIndex_1, userId, '3', 0, 0, 0);
END LOOP;
CLOSE leftMenuInfo_cursor;
END LOOP;
CLOSE hrmResourceManager_cursor;
/*用户*/
OPEN hrmResource_cursor;
LOOP
FETCH hrmResource_cursor
INTO userId;
EXIT WHEN hrmResource_cursor%NOTFOUND;
OPEN leftMenuInfo_cursor;
LOOP
FETCH leftMenuInfo_cursor
INTO id_1, defaultIndex_1;
EXIT WHEN leftMenuInfo_cursor%NOTFOUND;
INSERT INTO LeftMenuConfig
(userId,
infoId,
visible,
viewIndex,
resourceid,
resourcetype,
locked,
lockedById,
useCustomName)
VALUES
(userId, id_1, 1, defaultIndex_1, userId, '3', 0, 0, 0);
END LOOP;
CLOSE leftMenuInfo_cursor;
END LOOP;
CLOSE hrmResource_cursor;
flag := 1;
msg := 'ok';
end;
/ |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 03, 2020 at 08:27 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_tourism`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_admin`
--
CREATE TABLE `tbl_admin` (
`admin_id` int(11) NOT NULL,
`admin_name` text NOT NULL,
`admin_email` varchar(255) NOT NULL,
`admin_contact` varchar(20) NOT NULL,
`admin_type` int(11) NOT NULL,
`admin_profile_photo` varchar(255) DEFAULT NULL,
`admin_password` varchar(100) DEFAULT NULL,
`salt` varchar(100) DEFAULT NULL,
`last_login` date DEFAULT NULL,
`status` tinyint(1) NOT NULL,
`click` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_admin`
--
INSERT INTO `tbl_admin` (`admin_id`, `admin_name`, `admin_email`, `admin_contact`, `admin_type`, `admin_profile_photo`, `admin_password`, `salt`, `last_login`, `status`, `click`) VALUES
(1, 'Sanjok', 'sanzokgyawali123@gmail.com', '9812927525', 1, NULL, 'be605a9f27928547ffeb4e9b261839b52f5ca512', '5e379343d4f6b', '2020-01-21', 1, 4),
(54, 'Hotel Yak & Yeti', 'yakyeti@gmail.com', '98007777', 2, '5e3793d7d0bae.jpg', '3794ec8219135e315e1f97ecbb699afbd53b3e43', '5e3793d7d0b8d', '2020-02-03', 1, 35),
(55, 'Hotel Radisson', 'radisson@gmail.com', '980077734', 2, '5e3794021a4ec.jpg', 'c02d80326004fc0a63215919de8ffe79d0e6939e', '5e3794021a4d3', '2020-02-03', 1, 1),
(56, 'Hotel Shanker', 'shanker@gmail.com', '980077737', 2, '5e37943a388ba.jpg', '944b1f977940cce677e3181605cc1219d3804363', '5e37943a388a4', '2020-02-03', 1, 0),
(57, 'Hotel Green park', 'greenpark@gmail.com', '980077756', 2, '5e3794b42e01c.jpg', '3c1dadd2bb44c115222adab089f68888e8b74586', '5e3794b42e004', '2020-02-03', 1, 0),
(58, 'Kesara Resort', 'kesararesort@gmail.com', '980077745', 2, '5e3794d49a9f6.jpg', '29b74ff3ea10ed0ccc8594c97361547a127efa2f', '5e3794d49a9d9', '2020-02-03', 1, 0),
(59, 'Galaxy Guest House', 'galaxyguesthouse@gmail.com', '980077756', 2, '5e37951328ef1.jpg', 'e2a1805d7506433571570648e777e068fe4b4c57', '5e37951328eda', '2020-02-03', 1, 0),
(60, 'Hotel Bodhi Redsun', 'bodhiredsun@gmail.com', '9800777598', 2, '5e37953c84f9e.jpeg', '3da91a670a72cda86b7e25090c2eef5f45bb6ccf', '5e37953c84f88', '2020-02-03', 1, 0),
(61, 'Hotel Tulip', 'tulip@gmail.com', '985705674', 2, '5e37956e1430a.jpg', '776cab393e41d037c32b0d5e1292624d1941f52f', '5e37956e142f3', '2020-02-03', 1, 0),
(62, 'Club Denovo Hotel', 'clubdenovo@gmail.com', '98670578', 2, '5e37958ddd4d1.jpg', '03557aedc41a6e132eca49ad6d5d7397e290bfb7', '5e37958ddd4ba', '2020-02-03', 1, 0),
(63, 'Hotel Grand Shambhala', 'grand@gmail.com', '98706858', 2, '5e3795bd3c459.jpg', '530867738288377814f1621c73f10e39b0b185aa', '5e3795bd3c443', '2020-02-03', 1, 0),
(64, 'Hotel Mustang Monalisa', 'monalisa@gmail.con', '98786959', 2, '5e3795ddf0f0f.jpg', '07674642bc106a3dfdb3ddf161d2dcf6c68b9229', '5e3795ddf0efa', '2020-02-03', 1, 0),
(65, 'Atithi Resort & Spa', 'atithi@gmail.com', '98768949', 2, '5e3796280f957.jpg', '03f0a6efce1ce9976944cdf62dba370c6fe2e1f6', '5e3796280f93b', '2020-02-03', 1, 0),
(66, 'Hotel Zostel', 'zostel@gmail.com', '98475234', 2, '5e379644113b7.jpg', '24791a0abdc777e20313ea8746ce9c00c7bead94', '5e3796441139c', '2020-02-03', 1, 0),
(67, 'Hotel Pokhara Grande', 'grande@gmail.com', '9848545', 2, '5e3796656f56b.jpg', '05298d224d2af32839dc0bcf57ba121f0acafd3b', '5e3796656f554', '2020-02-03', 1, 0),
(71, 'Jon Snow', 'Jondai@gmail.com', '9800777206', 3, '5e37994f80288.jpeg', '1160fe218431a38a071d77f932ac43a719a05744', '5e37994f80273', '2020-02-03', 1, 1),
(72, 'Daenerys Targaryan', 'madktmoh@gmail.com', '980077767', 3, '5e37998198475.jpg', '89e84489e2660fe28eef4098bf5e4cb0693fc1e7', '5e3799819845d', '2020-02-03', 1, 0),
(73, 'Tyrion Laninster', 'tyrionsmallboy@gmail.com', '984545252', 3, '5e3799a35c034.jpg', '52dbe2746c6aedcb5f74b173daf6cc208a2ede8a', '5e3799a35c01e', '2020-02-03', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_available`
--
CREATE TABLE `tbl_available` (
`id` int(11) NOT NULL,
`admin_email` varchar(100) DEFAULT NULL,
`route_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_available`
--
INSERT INTO `tbl_available` (`id`, `admin_email`, `route_id`) VALUES
(4, 'hoteltulip@gmail.com', 6),
(7, 'asian@gmail.com', 10),
(8, 'yakyeti@gmail.com', 18),
(9, 'radisson@gmail.com', 18),
(10, 'tyrionsmallboy@gmail.com', 18),
(11, 'Jondai@gmail.com', 18);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_comment`
--
CREATE TABLE `tbl_comment` (
`id` int(11) NOT NULL,
`comment` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`route_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_comment`
--
INSERT INTO `tbl_comment` (`id`, `comment`, `email`, `name`, `route_id`) VALUES
(2, 'hency', 'hancy@hancy.com', 'Hancy kto moh', 5),
(3, 'lnshjdjasdhsajdnsadbjsajnd', 'bibek@dkjhashdjksa', 'Bibek', 5),
(4, 'jhsahhjashjkdhsajkdhjkashjkdsa', 'hello@jdshjdajshk', 'hello', 5),
(5, 'JHHBSADHASHDHAJSHDA', 'HGJSHASB@DBHJASHDB', 'sanbsbHBA', 5),
(6, 'JHHBSADHASHDHAJSHDA', 'HGJSHASB@DBHJASHDB', 'sanbsbHBA', 5),
(7, 'hkjdasjbdbjkashjkd', 'hjkfsjhkahjs@hgjdahsdhashd.huhudhaus', 'vshdshb', 5),
(8, 'hjdhjdahjhjajhads', 'gjdshgdsa@jhsjhdshjas.com', 'dhsmgdhgjhgs', 5),
(9, 'kjhdahjahkjdhkjsadhkjashkdja', 'hello@jdsjdajjajkashkj', 'hello', 5),
(10, 'kjhdahjahkjdhkjsadhkjashkdja', 'hello@jdsjdajjajkashkj', 'hello', 5),
(11, 'hello world', 'krishnagopal0112@gmail.com', 'bibek', 5);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_donate`
--
CREATE TABLE `tbl_donate` (
`id` int(11) NOT NULL,
`donate_name` varchar(255) NOT NULL,
`ref_code` varchar(30) NOT NULL,
`email` varchar(100) NOT NULL,
`contact` varchar(100) NOT NULL,
`event_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_donate`
--
INSERT INTO `tbl_donate` (`id`, `donate_name`, `ref_code`, `email`, `contact`, `event_id`) VALUES
(1, 'INGO', '123VBP', 'sanzokgyawali123@gmail.com', '9812927525', 1),
(2, 'Sanjok', '2245', 'sanzokgyawali123@gmail.com', '9812927525', 4),
(3, 'Sanjok', '225', 'sanzokgyawali123@gmail.com', '9812927525', 5);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_event`
--
CREATE TABLE `tbl_event` (
`event_id` int(11) NOT NULL,
`event_title` varchar(200) NOT NULL,
`start_date_time` datetime DEFAULT NULL,
`end_date_time` datetime DEFAULT NULL,
`event_description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_event`
--
INSERT INTO `tbl_event` (`event_id`, `event_title`, `start_date_time`, `end_date_time`, `event_description`) VALUES
(6, 'EDUCATION FOR ALL.', '2020-02-23 05:00:00', '2020-02-23 19:00:00', '<p>EDUCATION for all is a programme, organized by Youth from butwal to educate and aware the children who are from remote areas.</p>\r\n'),
(7, 'Inauguration of Tilottama Peace Park.', '2020-02-28 10:00:00', '2020-02-28 16:00:00', '<p>Tillotama Peace Park is recently built in this Tilottama Municipality which Inauguration Programme is going to be held on this coming FEB28th.</p>\r\n');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_gallery`
--
CREATE TABLE `tbl_gallery` (
`id` int(11) NOT NULL,
`title` varchar(100) NOT NULL,
`photo` varchar(100) NOT NULL,
`route_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `tbl_message`
--
CREATE TABLE `tbl_message` (
`id` int(11) NOT NULL,
`rec` varchar(100) NOT NULL,
`sen` varchar(100) NOT NULL,
`message` text DEFAULT NULL,
`message_datetime` datetime DEFAULT NULL,
`status` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_message`
--
INSERT INTO `tbl_message` (`id`, `rec`, `sen`, `message`, `message_datetime`, `status`) VALUES
(1, 'hello@hello.com', 'hoteltulip@gmail.com', 'I would like to know you can you provide me the details', '2020-02-02 03:00:00', 0),
(2, 'hoteltulip@gmail.com', 'hdsahdhshdsa@hdsjhdjhas', 'Hello Nepal', '2020-02-02 04:00:00', 0),
(3, 'hoteltulip@gmail.com', 'hoteltulip@gmail.com', '<p>dhsahdjsajhhjkashjkahksjsahjkd</p>\r\n', '0000-00-00 00:00:00', 0),
(4, 'hoteltulip@gmail.com', 'hoteltulip@gmail.com', '<p>djsdhashjdsajkdsa</p>\r\n', '2020-02-02 17:11:41', 0),
(5, 'hoteltulip@gmail.com', 'hoteltulip@gmail.com', '<p>djsdhashjdsajkdsa</p>\r\n', '2020-02-02 17:13:24', 0),
(12, 'asian@gmail.com', 'ndasn@ndansjdnj', 'nkdanjkdnkasnjda', '2020-02-03 04:24:39', 0),
(13, 'asian@gmail.com', 'ndasn@ndansjdnj', 'nkdanjkdnkasnjda', '2020-02-03 04:26:01', 0),
(14, 'asian@gmail.com', 'ndasn@ndansjdnj', 'nkdanjkdnkasnjda', '2020-02-03 04:26:12', 0);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_place`
--
CREATE TABLE `tbl_place` (
`place_id` int(11) NOT NULL,
`place_name` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`remarks` varchar(100) DEFAULT NULL,
`venue_photo` varchar(100) DEFAULT NULL,
`click` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_place`
--
INSERT INTO `tbl_place` (`place_id`, `place_name`, `address`, `remarks`, `venue_photo`, `click`) VALUES
(3, 'Lumbini', 'Lumbini Rupandehi', 'It is the birthplace of lord buddha.', '5e36a000979cd.jpg', NULL),
(6, 'Mustang', 'Mustang, Nepal', 'Mustang District (Nepali: मुस्ताङ जिल्लाAbout this soundListen (help·info)) is one of the seventy-se', '5e37a49348324.jpg', NULL),
(8, 'Pokhara', 'Pokhara, Nepal', 'Pokhara is a city on Phewa Lake, in central Nepal. It’s known as a gateway to the Annapurna Circuit,', '5e37a5410ecd4.jpg', NULL),
(9, 'Illam', 'Illam, Nepal', 'Ilam is one of four urban municipalities of Ilam District, which lies in the Mahabharata hilly range', '5e37a5aee3cc6.jpg', NULL),
(10, 'Butwal', 'Butwal, Nepal', 'Butwal officially Butwal Sub-Metropolitan is one of the twin cities of rapidly growing Butwal-Bhaira', '5e37a6d8f1428.jpg', NULL),
(12, 'Kathmandu', 'Kathmandu, Nepal', 'Kathmandu is the capital city of Nepal. ', '5e37b9fd61710.jpg', NULL),
(13, 'Chitwan National Park', 'Chitwan, Nepal', 'Chitwan National Park is a preserved area in the Terai Lowlands of south-central Nepal, known for it', '5e37ba514a018.jpg', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_researcher`
--
CREATE TABLE `tbl_researcher` (
`id` int(11) NOT NULL,
`traveller_name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_researcher`
--
INSERT INTO `tbl_researcher` (`id`, `traveller_name`) VALUES
(1, 'Sanjok Gyawali'),
(2, 'Sanjok Gyawali'),
(3, 'Sanjok Gyawali'),
(4, 'Sanjok Gyawali'),
(5, ''),
(6, 'Sanjok Gyawali'),
(7, 'Bhalwari City'),
(8, 'Bhalwari City'),
(9, 'Bhalwari City'),
(10, 'Bhalwari City'),
(11, 'Bhalwari City'),
(12, 'Sudan'),
(13, 'Sudan'),
(14, ''),
(15, 'Asmita'),
(16, 'Dhiren'),
(17, 'Dhiren'),
(18, 'Dhiren'),
(19, 'Krishna Gopal Chaudhary'),
(20, 'Krishna Gopal Chaudhary'),
(21, 'Krishna Gopal Chaudhary'),
(22, 'Krishna Gopal Chaudhary'),
(23, 'Krishna Gopal Chaudhary'),
(24, 'Krishna Gopal Chaudhary'),
(25, 'Bibek'),
(26, 'Sanjok Gyawali'),
(27, 'Dhiren'),
(28, 'Dhiren'),
(29, 'Dhiren'),
(30, 'Bhalwari City'),
(31, 'Krishna Gopal Chaudhary'),
(32, 'Asmita'),
(33, 'dnjsadanjsnbadnsj'),
(34, 'hello'),
(35, 'hello'),
(36, 'hello'),
(37, 'hello'),
(38, 'hello'),
(39, 'hello'),
(40, 'Bibek Adhikari'),
(41, 'smith'),
(42, 'Dhiren'),
(43, 'Dhiren'),
(44, 'Dhiren'),
(45, 'Dhiren'),
(46, 'Dhiren'),
(47, 'Dhiren'),
(48, 'Dhiren'),
(49, 'Dhiren'),
(50, 'Dhiren'),
(51, 'Dhiren'),
(52, 'Dhiren'),
(53, 'Bibek Adhikari'),
(54, 'Bibek Adhikari'),
(55, 'Bibek Adhikari'),
(56, 'yak'),
(57, 'bibek adhikari'),
(58, 'gfffgfhgfhg'),
(59, 'Sanju'),
(60, 'Bhalwari City'),
(61, 'Bhalwari City'),
(62, 'Bhalwari City'),
(63, 'Bhalwari City'),
(64, 'Krishna Gopal Chaudhary');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_route`
--
CREATE TABLE `tbl_route` (
`id` int(11) NOT NULL,
`dest_name` varchar(100) NOT NULL,
`start_name` varchar(100) NOT NULL,
`route_desc` text NOT NULL,
`adv_routes` text NOT NULL,
`des_routes` text NOT NULL,
`other_places` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_route`
--
INSERT INTO `tbl_route` (`id`, `dest_name`, `start_name`, `route_desc`, `adv_routes`, `des_routes`, `other_places`) VALUES
(11, 'Mustang', 'Butwal', '<p>Butwal - Mugling</p>\r\n\r\n<p>Mugling - Pokhara</p>\r\n\r\n<p>Pokhara - Beni</p>\r\n\r\n<p>Beni - Mustang</p>\r\n', '', '', ''),
(13, 'Lumbini', 'Butwal', '<p>Lumbini - Bhairahawa</p>\r\n\r\n<p>Bhairahawa - Butwal</p>\r\n', '', '', ''),
(17, 'Illam', 'Mustang', '<table border=\"2\">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <p>Mustang - Beni</p>\r\n\r\n <p>Beni - Pokhara</p>\r\n\r\n <p>Pokhara - Mugling</p>\r\n\r\n <p>Mugling - Kathmandu</p>\r\n\r\n <p>Kathmandu - Illam</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n', '', '', ''),
(18, 'Kathmandu', 'Butwal', '<p>Butwal - Narayangardh</p>\r\n\r\n<p>Narayangardh - Mugling</p>\r\n\r\n<p>Mugling - Kathmandu</p>\r\n', '<p>This Route is faster than the Route that goes through Palpa - Pokhara to Kathmandu.</p>\r\n\r\n<p>Safe Road.</p>\r\n', '<p>Traffic rate is High.</p>\r\n', '<p>Chitwan</p>\r\n\r\n<p>Lumbini</p>\r\n\r\n<p>Jalbire (Lamo Jharana)</p>\r\n');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_start`
--
CREATE TABLE `tbl_start` (
`id` int(11) NOT NULL,
`place_name` varchar(100) NOT NULL,
`address` varchar(100) NOT NULL,
`remarks` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tbl_start`
--
INSERT INTO `tbl_start` (`id`, `place_name`, `address`, `remarks`) VALUES
(7, 'Butwal', 'Butwal, Nepal', 'Butwal is lies in TERAI.'),
(8, 'Lumbini', 'Lumbini Rupandehi', 'Lumbini is the birth place of Gautam Buddha.'),
(9, 'Chitwan National Park', 'Chitwan, Nepal', 'Chitwan National Park is a preserved area in the Terai Lowlands of south-central Nepal, known for it'),
(10, 'Mustang', 'Mustang, Nepal', 'Mustang District (Nepali: मुस्ताङ जिल्लाAbout this soundListen (help·info)) is one of the seventy-se'),
(11, 'Kathmandu', 'Kathmandu, Nepal', 'Kathmandu is the capital city of Nepal. '),
(12, 'Pokhara', 'Pokhara, Nepal', 'Pokhara is a city on Phewa Lake, in central Nepal. It’s known as a gateway to the Annapurna Circuit,'),
(13, 'Mustang', 'Mustang, Nepal', 'Mustang District (Nepali: मुस्ताङ जिल्लाAbout this soundListen (help·info)) is one of the seventy-se'),
(14, 'Butwal', 'Kathmandu, Nepal', 'Kathmandu is the capital city of Nepal. ');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
ADD PRIMARY KEY (`admin_id`),
ADD UNIQUE KEY `admin_email` (`admin_email`);
--
-- Indexes for table `tbl_available`
--
ALTER TABLE `tbl_available`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_comment`
--
ALTER TABLE `tbl_comment`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_donate`
--
ALTER TABLE `tbl_donate`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_event`
--
ALTER TABLE `tbl_event`
ADD PRIMARY KEY (`event_id`);
--
-- Indexes for table `tbl_gallery`
--
ALTER TABLE `tbl_gallery`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_message`
--
ALTER TABLE `tbl_message`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_place`
--
ALTER TABLE `tbl_place`
ADD PRIMARY KEY (`place_id`);
--
-- Indexes for table `tbl_researcher`
--
ALTER TABLE `tbl_researcher`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_route`
--
ALTER TABLE `tbl_route`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_start`
--
ALTER TABLE `tbl_start`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=74;
--
-- AUTO_INCREMENT for table `tbl_available`
--
ALTER TABLE `tbl_available`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_comment`
--
ALTER TABLE `tbl_comment`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_donate`
--
ALTER TABLE `tbl_donate`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tbl_event`
--
ALTER TABLE `tbl_event`
MODIFY `event_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `tbl_gallery`
--
ALTER TABLE `tbl_gallery`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_message`
--
ALTER TABLE `tbl_message`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `tbl_place`
--
ALTER TABLE `tbl_place`
MODIFY `place_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `tbl_researcher`
--
ALTER TABLE `tbl_researcher`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;
--
-- AUTO_INCREMENT for table `tbl_route`
--
ALTER TABLE `tbl_route`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `tbl_start`
--
ALTER TABLE `tbl_start`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
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 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 29, 2017 at 07:59 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: `dudoffhoa`
--
-- --------------------------------------------------------
--
-- Table structure for table `tblstaff`
--
CREATE TABLE IF NOT EXISTS `tblstaff` (
`staffid` int(11) NOT NULL,
`email` varchar(100) NOT NULL,
`staff_code` varchar(20) DEFAULT NULL,
`position_id` int(11) DEFAULT NULL,
`staff_manager` varchar(255) DEFAULT NULL,
`fullname` varchar(255) DEFAULT NULL,
`firstname` varchar(50) DEFAULT NULL,
`lastname` varchar(50) DEFAULT NULL,
`gender` int(11) DEFAULT '1',
`date_birth` date DEFAULT NULL,
`place_birth` varchar(255) DEFAULT NULL,
`permanent_residence` varchar(255) DEFAULT NULL,
`current_address` varchar(255) DEFAULT NULL,
`passport_id` varchar(15) DEFAULT NULL,
`issued_by` varchar(255) DEFAULT NULL,
`issued_on` date DEFAULT NULL,
`hobbies` varchar(255) DEFAULT NULL,
`height` int(11) DEFAULT NULL,
`weight` int(11) DEFAULT NULL,
`marial_status` varchar(50) DEFAULT NULL,
`emergency_contact` text,
`education` text,
`foreign_languge_skills` text,
`other_certificates` text,
`facebook` mediumtext,
`linkedin` mediumtext,
`phonenumber` varchar(30) DEFAULT NULL,
`skype` varchar(50) DEFAULT NULL,
`password` varchar(250) NOT NULL,
`datecreated` datetime NOT NULL,
`profile_image` varchar(300) DEFAULT NULL,
`last_ip` varchar(40) DEFAULT NULL,
`last_login` datetime DEFAULT NULL,
`last_password_change` datetime DEFAULT NULL,
`new_pass_key` varchar(32) DEFAULT NULL,
`new_pass_key_requested` datetime DEFAULT NULL,
`admin` int(11) NOT NULL DEFAULT '0',
`role` int(11) DEFAULT NULL,
`rule` int(11) DEFAULT NULL,
`active` int(11) NOT NULL DEFAULT '1',
`default_language` varchar(40) DEFAULT NULL,
`direction` varchar(3) DEFAULT NULL,
`media_path_slug` varchar(300) DEFAULT NULL,
`is_not_staff` int(11) DEFAULT '0',
`hourly_rate` decimal(11,2) DEFAULT '0.00',
`salary` decimal(15,0) DEFAULT NULL,
`email_signature` text,
`bank_account` varchar(255) DEFAULT NULL,
`internal_phone` varchar(255) DEFAULT NULL,
`date_work` date DEFAULT NULL,
`place_work` int(11) DEFAULT NULL
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tblstaff`
--
INSERT INTO `tblstaff` (`staffid`, `email`, `staff_code`, `position_id`, `staff_manager`, `fullname`, `firstname`, `lastname`, `gender`, `date_birth`, `place_birth`, `permanent_residence`, `current_address`, `passport_id`, `issued_by`, `issued_on`, `hobbies`, `height`, `weight`, `marial_status`, `emergency_contact`, `education`, `foreign_languge_skills`, `other_certificates`, `facebook`, `linkedin`, `phonenumber`, `skype`, `password`, `datecreated`, `profile_image`, `last_ip`, `last_login`, `last_password_change`, `new_pass_key`, `new_pass_key_requested`, `admin`, `role`, `rule`, `active`, `default_language`, `direction`, `media_path_slug`, `is_not_staff`, `hourly_rate`, `salary`, `email_signature`, `bank_account`, `internal_phone`, `date_work`, `place_work`) VALUES
(1, 'amin@admin.com', NULL, NULL, NULL, 'admin', '', '', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '$2a$08$9uFKA7CEZjqLO3zSOQfPBul5FwOw8Xwj6pJs4onV4gHAn9Tlcv762', '2017-03-30 09:24:10', NULL, '192.168.1.3', '2017-07-29 08:17:13', NULL, NULL, NULL, 1, NULL, 1, 1, 'vietnamese', NULL, NULL, 0, '0.00', NULL, NULL, NULL, NULL, NULL, NULL),
(2, 'buiphamthanhthuy@gmail.com', 'NV-00002', 0, '["1"]', 'Tan Nguyen', 'Tân', 'Nguyễn', 1, '0000-00-00', '', '', '', '', '', '0000-00-00', '', 0, 0, 'single', '', NULL, NULL, NULL, 'tannguyen', '', '0909365456', '', '$2a$08$GMPg1TJgHJsyM9Oa1bp4veWqPqkglBTxdmU.OkFTM8lJ9OS8oLwRe', '2017-03-31 00:37:49', NULL, '::1', '2017-03-31 00:42:57', NULL, NULL, NULL, 0, 1, 2, 1, 'vietnamese', '', 'tan-nguyễn', 0, '200.00', '0', '', '', '', '0000-00-00', 1),
(3, 'ngocha@gmail.com', 'NV-00003', 0, 'null', 'Ngoc ha', 'Ngọc', 'Hà', 1, '0000-00-00', '', '', '', '', '', '0000-00-00', '', 0, 0, 'single', '', NULL, NULL, NULL, '', '', '0909321456', '', '$2a$08$9uFKA7CEZjqLO3zSOQfPBul5FwOw8Xwj6pJs4onV4gHAn9Tlcv762', '2017-03-31 00:49:22', '2016-09-19-13.jpg', '::1', '2017-07-07 15:48:58', NULL, NULL, NULL, 0, 2, 3, 1, 'vietnamese', '', 'ngọc-ha', 0, '200.00', '0', '', '', '', '0000-00-00', 1),
(4, 'thuy@gmail.com', 'NV00004', 4, '["3"]', 'Thuy linh', 'Thùy', 'Linh', 1, '2017-06-30', 'HCM', 'HCM', 'HCM', '321348455', 'HCM', '2017-06-30', '', 0, 0, 'single', '12345', NULL, NULL, NULL, '', '', '09123456789', '', '$2a$08$mxYDHk1OwXmcx7QVbtKDTeKprQua5DSEDZTLEhpg65wYscNF2RY86', '2017-03-31 00:50:39', NULL, '::1', '2017-04-03 12:57:20', NULL, NULL, NULL, 0, 2, 4, 1, 'vietnamese', '', 'thuy-linh', 0, '150.00', '100', '', '1234', '5678', '2017-06-30', 1),
(5, 'tvtan06@gmail.com', 'NV-00005', NULL, '["2"]', 'Tran Van Tan', 'Tran Van', ' Tan', 0, '2017-06-29', 'HCM', 'HCM', 'HCM', '123345', 'HCM', '2017-06-29', '', 0, 0, 'single', '12342435', NULL, NULL, NULL, NULL, NULL, '0939701693', NULL, '$2a$08$XmWgJQjif5lqJaQ52GrdQu1JwqbSC/3r1Qhvm8pn/JsecZhHVwOfK', '2017-06-29 17:08:57', NULL, NULL, NULL, '2017-06-29 17:31:13', NULL, NULL, 0, 1, 3, 1, NULL, NULL, 'tran-van-tan', 0, '0.00', '0', '', '1234', '', '0000-00-00', 0),
(6, 'ttktien@gmail.com', 'NV-00014', 0, 'null', 'Tran Kieu Tien', 'Tran Thij Kieu', ' Tien', 1, '2017-06-30', 'HCM', 'HCM', 'HCM', '123456', 'HCM', '2017-06-30', '', 0, 0, 'single', '12345', NULL, NULL, NULL, NULL, NULL, '0974497157', NULL, '$2a$08$j910DGb36PHhwxkO5/liBe1ekdF.8TNG8JzISyNHPn6YqvNW3Ed.S', '2017-06-30 08:14:55', NULL, NULL, NULL, NULL, NULL, NULL, 0, 1, 3, 1, NULL, NULL, 'tran-thij-kieu-tien', 0, '0.00', '500', '', '1234', '4321', '2017-06-30', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tblstaff`
--
ALTER TABLE `tblstaff`
ADD PRIMARY KEY (`staffid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tblstaff`
--
ALTER TABLE `tblstaff`
MODIFY `staffid` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: sql206.byetcluster.com
-- Generation Time: Nov 19, 2020 at 09:22 AM
-- Server version: 5.6.48-88.0
-- PHP Version: 7.2.22
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: `epiz_24258648_kbvm`
--
-- --------------------------------------------------------
--
-- Table structure for table `admission`
--
CREATE TABLE `admission` (
`name` varchar(100) NOT NULL,
`fname` varchar(100) NOT NULL,
`mname` varchar(100) NOT NULL,
`gender` varchar(10) DEFAULT NULL,
`email` varchar(200) NOT NULL,
`mobile` varchar(20) NOT NULL,
`class` varchar(10) NOT NULL,
`subject` varchar(200) NOT NULL,
`hobbies` varchar(200) NOT NULL,
`country` varchar(100) NOT NULL,
`address` varchar(300) NOT NULL,
`password` varchar(20) NOT NULL,
`image` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admission`
--
INSERT INTO `admission` (`name`, `fname`, `mname`, `gender`, `email`, `mobile`, `class`, `subject`, `hobbies`, `country`, `address`, `password`, `image`) VALUES
('Sachin Prajapati', 'Radhelal', 'gyanvati', 'on', 'sachinprajapati599@gmail.com', '8604980059', '12', ' PCM', '', 'India', 'Village and Post Kusumbhi District Unnao', '1234', 0x73612e706e67);
-- --------------------------------------------------------
--
-- Table structure for table `complaint`
--
CREATE TABLE `complaint` (
`name` varchar(100) NOT NULL,
`gmail` varchar(200) NOT NULL,
`mobile` int(20) NOT NULL,
`complaint` varchar(500) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `complaint`
--
INSERT INTO `complaint` (`name`, `gmail`, `mobile`, `complaint`) VALUES
('Sachin Prajapati', '', 0, 'good'),
('vikas', '', 0, 'best'),
('', '', 0, ''),
('Sachin Prajapati', 'sachinprajapati599@gmail.com', 2147483647, 'good'),
('naman', 'sachinprajapati599@gmail.com', 12345678, 'best 6'),
('naman', 'sachinprajapati599@gmail.com', 2147483647, 'good good good ');
-- --------------------------------------------------------
--
-- Table structure for table `contactus`
--
CREATE TABLE `contactus` (
`name` varchar(100) NOT NULL,
`reason` varchar(150) NOT NULL,
`email` varchar(100) NOT NULL,
`mobile` varchar(20) NOT NULL,
`address` varchar(200) NOT NULL,
`city` varchar(50) NOT NULL,
`state` varchar(50) NOT NULL,
`zip` varchar(10) NOT NULL,
`problem` varchar(250) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contactus`
--
INSERT INTO `contactus` (`name`, `reason`, `email`, `mobile`, `address`, `city`, `state`, `zip`, `problem`) VALUES
('Sachin Prajapati', 'Kbvm web', 'sachinprajapati599@gmail.com', '8604980059', 'Village and Post Kusumbhi District Unnao', 'Unnao', 'Uttar Pradesh', '209859', 'hello web designer');
-- --------------------------------------------------------
--
-- Table structure for table `enquiry`
--
CREATE TABLE `enquiry` (
`name` varchar(100) NOT NULL,
`gender` varchar(10) DEFAULT NULL,
`email` varchar(100) NOT NULL,
`mobile` varchar(20) NOT NULL,
`reason` varchar(500) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `enquiry`
--
INSERT INTO `enquiry` (`name`, `gender`, `email`, `mobile`, `reason`) VALUES
('', '', 'sachinprajapati599@gmail.com', '', 'good web'),
('', '', 'sachinprajapati599@gmail.com', '', 'good web'),
('Sachin Prajapati', '', 'sachinprajapati599@gmail.com', '8604980059', 'good bro'),
('Sachin Prajapati', '', 'sachinprajapati599@gmail.com', '8604980059', ''),
('Sachin Prajapati', '', 'sachinprajapati599@gmail.com', '8604980059', ''),
('Sachin Prajapati', '', 'sachinprajapati599@gmail.com', '8604980059', ''),
('Shivam', '', 'sachinprajapati599@gmail.com', '8956321478', ''),
('Shivam', '', 'sachinprajapati599@gmail.com', '8956321478', '');
-- --------------------------------------------------------
--
-- Table structure for table `suggetion`
--
CREATE TABLE `suggetion` (
`name` varchar(100) NOT NULL,
`gmail` text NOT NULL,
`mobile` int(20) NOT NULL,
`suggetion` varchar(500) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `suggetion`
--
INSERT INTO `suggetion` (`name`, `gmail`, `mobile`, `suggetion`) VALUES
('', '', 0, ''),
('', '', 0, ''),
('', '', 0, ''),
('', '', 0, ''),
('vikas', '', 0, 'good'),
('Sachin Prajapati', 'sachinprajapati599@gmail.com', 2147483647, 'hello its suggetion'),
('Anish', 'sachinprajapati599@gmail.com', 2147483647, 'good bro'),
('Anish', 'sachinprajapati599@gmail.com', 2147483647, 'good bro'),
('Atul', 'sachinprajapati599@gmail.com', 2147483647, 'good good good'),
('Shivam', 'sachinprajapati599@gmail.com', 2147483647, 'hello nice'),
('ankit', 'test@gmail.com', 1234569870, 'testing '),
('Sachin Prajapati', 'sachinprajapati599@gmail.com', 2147483647, 'Good');
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
select last_name, count(emp_no) from employees
group by last_name
order by count DESC |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.3_3306
Source Server Version : 50130
Source Host : 192.168.1.3:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50130
File Encoding : 65001
Date: 2017-09-15 11:13:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `loginrecord`
-- ----------------------------
DROP TABLE IF EXISTS `loginrecord`;
CREATE TABLE `loginrecord` (
`user_id` bigint(20) NOT NULL COMMENT '用户id',
`login_date` datetime DEFAULT NULL COMMENT '登录时间记录',
`login_site` varchar(120) DEFAULT NULL,
KEY `user_id` (`user_id`) USING BTREE,
CONSTRAINT `loginrecord_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user_info` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户登录记录信息';
-- ----------------------------
-- Records of loginrecord
-- ----------------------------
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 16:41:56', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:37:51', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:40:38', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:48:09', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:49:56', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:50:21', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 17:55:14', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-13 18:02:02', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:01:17', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:05:18', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:06:09', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:06:41', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:07:02', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:09:18', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:09:20', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:10:05', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:10:07', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:13:51', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:15:31', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:16:48', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:19:43', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:19:44', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:19:44', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:20:11', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:21:04', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:21:23', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:22:33', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:23:05', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:25:17', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:29:29', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:57:01', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 09:58:20', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:00:07', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:04:53', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:12:35', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:19:20', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:19:39', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:20:02', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:21:33', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:21:42', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:24:12', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:28:03', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:31:13', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:31:27', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:32:26', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:32:59', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 10:49:37', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:06:26', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:07:04', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:42:56', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:49:28', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:49:32', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:49:34', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:49:45', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:50:00', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:50:35', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:53:20', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:55:30', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:55:50', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:55:53', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:56:25', null);
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:56:31', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:56:53', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 11:58:03', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:00:21', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:02:15', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:03:31', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:04:46', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:05:08', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:07:29', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:08:07', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:08:27', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 12:37:29', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:11:44', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:20:10', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:21:26', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:22:17', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:22:26', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 13:22:41', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 14:11:38', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 14:55:13', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 14:59:34', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 15:01:12', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 15:01:57', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 15:08:09', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 16:15:06', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 16:26:53', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-14 16:56:01', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-15 09:27:44', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-15 10:10:55', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-15 10:14:07', '中国广东省广州市');
INSERT INTO `loginrecord` VALUES ('1', '2017-09-15 11:10:11', '中国广东省广州市');
-- ----------------------------
-- Table structure for `right_info`
-- ----------------------------
DROP TABLE IF EXISTS `right_info`;
CREATE TABLE `right_info` (
`right_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单编码(主键)',
`right_parent_code` bigint(20) DEFAULT NULL COMMENT '父菜单编码',
`right_type` varchar(20) DEFAULT NULL COMMENT '菜单类型',
`right_text` varchar(50) DEFAULT NULL COMMENT '菜单文本',
`right_url` varchar(100) DEFAULT NULL COMMENT '菜单访问路径',
`right_tip` varchar(50) DEFAULT NULL COMMENT '菜单提示',
`ispatent` int(1) DEFAULT '0' COMMENT '是否含有子菜单0表示没有1表示有',
PRIMARY KEY (`right_code`),
KEY `right_parent_code` (`right_parent_code`),
CONSTRAINT `right_info_ibfk_1` FOREIGN KEY (`right_parent_code`) REFERENCES `right_info` (`right_code`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='菜单表:营销管理、客户管理、服务管理、统计报表、基础数据和权限管理六个模块;';
-- ----------------------------
-- Records of right_info
-- ----------------------------
INSERT INTO `right_info` VALUES ('1', null, '1', '系统管理', null, null, '0');
INSERT INTO `right_info` VALUES ('2', null, '1', '营销管理', null, null, '0');
INSERT INTO `right_info` VALUES ('3', null, '1', '客户管理', null, null, '0');
INSERT INTO `right_info` VALUES ('4', null, '1', '服务管理', null, null, '0');
INSERT INTO `right_info` VALUES ('5', null, '1', '统计报表', null, null, '0');
INSERT INTO `right_info` VALUES ('6', null, '1', '基本数据', null, null, '0');
INSERT INTO `right_info` VALUES ('7', null, '1', '权限管理', null, null, '1');
INSERT INTO `right_info` VALUES ('8', '7', '2', '用户管理', null, null, '0');
-- ----------------------------
-- Table structure for `role_info`
-- ----------------------------
DROP TABLE IF EXISTS `role_info`;
CREATE TABLE `role_info` (
`role_id` bigint(20) NOT NULL AUTO_INCREMENT,
`role_name` varchar(50) NOT NULL COMMENT '角色名称',
`role_desc` varchar(50) DEFAULT NULL COMMENT '角色描述',
`role_flag` int(11) DEFAULT NULL COMMENT '角色状态(1或0,1表示可用)',
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='角色表:系统管理员、销售主管、客户经理和高管;';
-- ----------------------------
-- Records of role_info
-- ----------------------------
INSERT INTO `role_info` VALUES ('1', 'Admin', '系统管理员', '1');
INSERT INTO `role_info` VALUES ('2', 'SalesExecutive', '销售主管', '1');
INSERT INTO `role_info` VALUES ('3', 'AccountManager', '客户经理', '1');
INSERT INTO `role_info` VALUES ('4', 'HRManager', '人事主管', '1');
-- ----------------------------
-- Table structure for `role_right_info`
-- ----------------------------
DROP TABLE IF EXISTS `role_right_info`;
CREATE TABLE `role_right_info` (
`rf_id` bigint(20) NOT NULL AUTO_INCREMENT,
`rf_role_id` bigint(20) NOT NULL COMMENT '角色编号(外键role表role_id)',
`rf_right_code` bigint(20) NOT NULL,
PRIMARY KEY (`rf_id`),
KEY `rf_role_id` (`rf_role_id`),
KEY `rf_right_code` (`rf_right_code`),
CONSTRAINT `rf_right_code` FOREIGN KEY (`rf_right_code`) REFERENCES `right_info` (`right_code`),
CONSTRAINT `rf_role_id` FOREIGN KEY (`rf_role_id`) REFERENCES `role_info` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='权限表:角色对应菜单';
-- ----------------------------
-- Records of role_right_info
-- ----------------------------
INSERT INTO `role_right_info` VALUES ('1', '1', '1');
INSERT INTO `role_right_info` VALUES ('2', '1', '2');
INSERT INTO `role_right_info` VALUES ('3', '1', '3');
INSERT INTO `role_right_info` VALUES ('4', '1', '4');
INSERT INTO `role_right_info` VALUES ('5', '1', '5');
INSERT INTO `role_right_info` VALUES ('6', '1', '6');
INSERT INTO `role_right_info` VALUES ('7', '1', '7');
-- ----------------------------
-- Table structure for `user_info`
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '唯一标示',
`username` varchar(8) DEFAULT NULL COMMENT '用户登陆名',
`password` varchar(32) DEFAULT NULL COMMENT '登陆密码',
`name` varchar(8) DEFAULT NULL COMMENT '名字',
`himg` varchar(254) DEFAULT NULL COMMENT '用户头像',
`role_id` bigint(20) DEFAULT NULL COMMENT '角色',
PRIMARY KEY (`id`),
KEY `role_id` (`role_id`),
CONSTRAINT `user_info_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `role_info` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user_info
-- ----------------------------
INSERT INTO `user_info` VALUES ('1', 'admin', 'e10adc3949ba59abbe56e057f20f883e', '管理员', null, '1');
INSERT INTO `user_info` VALUES ('2', 'a123', 'e10adc3949ba59abbe56e057f20f883e', 'Monmy', null, '2');
|
drop database if exists ukeessdb;
create database if not exists ukeessdb;
USE ukeessdb;
-- Employees
drop table if exists employees;
create table if not exists employees(
id int not null auto_increment primary key ,
employees_name varchar(255) not null ,
emp_Active varchar(255) not null,
emp_dpID int not null
)
ENGINE = InnoDB;
-- Departments
drop table if exists departments;
create table if not exists departments(
id int not null auto_increment primary key ,
department_name varchar(255) not null
)
ENGINE = InnoDB;
INSERT into employees values (1,'Liza','YES',5);
INSERT into employees values (2,'Erik','YES',6);
INSERT into employees values (3,'Don','YES',7);
INSERT into employees values (4,'Peter','NO',8);
insert into departments values (5,'HR');
insert into departments values (6,'Tech');
insert into departments values (7,'Finance');
insert into departments values (8,'Tech');
|
create table pay_config
(
app_id varchar(255) default '' not null comment '小程序appid',
mch_id varchar(255) default '' not null comment '微信支付的商户id',
`key` varchar(255) default '' not null comment '微信支付的商户密钥',
app_secret varchar(255) default '' not null comment '小程序secret',
apiclient_cert varchar(255) default '' not null comment '支付商户证书',
apiclient_key varchar(255) default '' not null comment '支付商户证书密钥'
)
engine = MyISAM;
INSERT INTO coldchain_sys_admin.pay_config (app_id, mch_id, `key`, app_secret, apiclient_cert, apiclient_key) VALUES ('wx3c44179d820eb2ee ', '1566458161', 'NTS32SDSD9ERM2313CD88923DSDHJSDS ', '', '', ''); |
CREATE DATABASE IF NOT EXISTS apiKipow;
USE apiKipow;
CREATE TABLE company (
id int(255) auto_increment not null,
title varchar(255),
logo varchar(255),
created_at datetime DEFAULT null,
updated_at datetime DEFAULT null,
CONSTRAINT pk_company PRIMARY KEY (id)
) ENGINE=InnoDb;
CREATE TABLE user (
id int(255) auto_increment not null,
role varchar(20),
name varchar(255),
surname varchar(255),
password varchar(255),
created_at datetime DEFAULT null,
updated_at datetime DEFAULT null,
remember_token varchar(255),
CONSTRAINT pk_user PRIMARY KEY (id)
)ENGINE=InnoDb;
CREATE TABLE userCompany (
user_id int(255) not null,
company_id int(255) not null,
created_at datetime DEFAULT null,
updated_at datetime DEFAULT null,
CONSTRAINT pk_userCompany PRIMARY KEY (user_id, company_id),
CONSTRAINT fk_userCompanyUser FOREIGN KEY (user_id) REFERENCES user (id),
CONSTRAINT fk_userCompanyCompany FOREIGN KEY (company_id) REFERENCES company (id)
)ENGINE = InnoDb; |
CREATE TABLE posts (id INTEGER PRIMARY KEY, image_id NUMERIC, thumbnail_id NUMERIC, score NUMERIC, rating NUMERIC, img_w NUMERIC, img_h NUMERIC, created NUMERIC, view_count NUMERIC, edit_count NUMERIC, source TEXT, `comment` TEXT);
CREATE TABLE images (id INTEGER PRIMARY KEY, image BLOB);
CREATE TABLE thumbnails (id INTEGER PRIMARY KEY, thumbnail BLOB);
CREATE TABLE tags (id INTEGER PRIMARY KEY, tag TEXT, type NUMERIC);
CREATE TABLE post_tags (id INTEGER PRIMARY KEY, post NUMERIC, tag NUMERIC);
CREATE TABLE aliases (id INTEGER PRIMARY KEY, alias TEXT, tag NUMERIC);
CREATE TABLE tag_colors (id INTEGER PRIMARY KEY, rgb NUMERIC, console TEXT);
CREATE TABLE ratings (id INTEGER PRIMARY KEY, description TEXT);
CREATE TABLE properties (id INTEGER PRIMARY KEY, `key` TEXT, `value` TEXT);
CREATE TABLE properties_system (id INTEGER PRIMARY KEY, `key` TEXT, `value` TEXT);
CREATE TABLE tag_types (id INTEGER PRIMARY KEY, description TEXT);
CREATE TABLE tags_if (id INTEGER PRIMARY KEY, `if` TEXT, `then` TEXT);
INSERT INTO `tag_colors` (`id`, `rgb`, `console`) VALUES
(1, 00003436539, 'Cyan'),
(2, 00003451444, 'Green'),
(3, 00012058808, 'Magenta'),
(4, 00012058676, 'DarkRed'),
(5, 00016756224, 'Yellow');
INSERT INTO `tag_types` (`id`, `description`) VALUES
(1, 'General'),
(2, 'Character'),
(3, 'Copyright'),
(4, 'Artist'),
(5, 'Personal');
INSERT INTO `ratings` (`id`, `description`) VALUES
(1, 'Safe'),
(2, 'Rating 2'),
(3, 'Rating 3'),
(4, 'Rating 4'),
(5, 'Rating 5'),
(6, 'Explicit');
INSERT INTO `properties` (`key`, `value`) VALUES
('BooruName', 'Booru'),
('BooruCreator', 'TEAM-ALPHA'),
('StandardSearch', 'rating=1'),
('ThumbsPerPage', '20'),
('ThumbsSize', '180'),
('ImageEditor', '');
INSERT INTO `properties_system` (`key`, `value`) VALUES
('DatabaseVersion', '1');
|
DECLARE
v_Id INTEGER;
v_Ids NVARCHAR2(32767);
v_result NUMBER;
BEGIN
:ErrorCode := 0;
:ErrorMessage := '';
:affectedRows := 0;
v_Ids := :Ids;
v_Id := :Id;
:SuccessResponse := EMPTY_CLOB();
--Input params check
IF (v_Id IS NULL AND v_Ids IS NULL) THEN
v_result := LOC_i18n(
MessageText => 'Id can not be empty',
MessageResult => :ErrorMessage);
:ErrorCode := 101;
RETURN;
END IF;
IF(v_Id IS NOT NULL) THEN
v_Ids := TO_CHAR(v_id);
END IF;
DELETE tbl_ltr_lettertemplate
WHERE col_id IN (SELECT TO_NUMBER(COLUMN_VALUE) AS id FROM TABLE(ASF_SPLIT(v_Ids, ',')));
--get affected rows
:affectedRows := SQL%ROWCOUNT;
v_result := LOC_I18N(
MessageText => 'Deleted {{MESS_COUNT}} Letter Templates',
MessageResult => :SuccessResponse,
MessageParams => NES_TABLE(Key_Value('MESS_COUNT', :affectedRows)));
END; |
CREATE DATABASE IF NOT EXISTS default;
USE default;
CREATE TABLE `ampr`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/ampr'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='490618',
'transient_lastDdlTime'='1442318700')
;
CREATE TABLE `app`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='147575',
'transient_lastDdlTime'='1442318678')
;
CREATE TABLE `app_ad_click_detail`(
`media` string,
`date_id` string,
`channel` string,
`ad_buy_user_num` int,
`ad_buy_order_num` int,
`ad_buy_commodity_num` int,
`ad_buy_order_amount` bigint,
`ad_buy_profit` bigint,
`is_newuser` int)
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_ad_click_detail'
TBLPROPERTIES (
'transient_lastDdlTime'='1447927378')
;
CREATE TABLE `app_ad_click_detail_plus`(
`media` string,
`date_id` string,
`channel` string,
`ad_user_id` int,
`ad_order_id` int,
`ad_commodity_num` int,
`ad_order_amount` bigint,
`ad_gross_profit` bigint,
`ad_order_status` string,
`ad_order_time` string,
`ad_ship_time` string,
`is_newuser` int)
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_ad_click_detail_plus'
TBLPROPERTIES (
'transient_lastDdlTime'='1448429275')
;
CREATE TABLE `app_brand_sold_month`(
`brand_id` int,
`brand_name_en` string,
`year` int,
`month` int,
`in_nums` int,
`sales_rate_30` float,
`sales_rate_60` float,
`sales_rate_90` float,
`time_id` string)
PARTITIONED BY (
`date_id` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/sales/app_brand_sold_month'
TBLPROPERTIES (
'transient_lastDdlTime'='1441337187')
;
CREATE TABLE `app_prod_sales_top50_week_tmp`(
`product_skn` bigint,
`max_sort_id` int,
`max_sort_name` string,
`product_name` string,
`brand_name_en` string,
`is_myself_brand` int,
`gender` smallint,
`online_time` bigint,
`retail_price` float,
`sum_skn_nums` bigint,
`sum_sales_price` float,
`discount_rate` float,
`gross_profit_rate` float,
`sold_out_7` float,
`gross_profit_7` float,
`sold_out_14` float,
`gross_profit_14` float,
`sold_out_30` float,
`gross_profit_30` float,
`sold_out_60` float,
`gross_profit_60` float,
`sold_out_90` float,
`gross_profit_90` float,
`time_id` string,
`date_id` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_prod_sales_top50_week_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='6',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='0',
'transient_lastDdlTime'='1452639721')
;
CREATE TABLE `app_skn_cchange_price_week_01`(
`id` int,
`brand_name` string,
`product_skn` int,
`sales_price` float,
`lw_sales_price` float)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_01'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='13733',
'rawDataSize'='1483164',
'totalSize'='78094',
'transient_lastDdlTime'='1441673930')
;
CREATE TABLE `app_skn_cchange_price_week_02`(
`product_skn` int,
`is_down` int,
`is_up` int,
`is_equal` int,
`is_cnt_7` int,
`down_sales_price1` float,
`down_sales_price` float,
`up_sales_price1` float,
`up_sales_price` float)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_02'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='166994',
'rawDataSize'='6011784',
'totalSize'='37104',
'transient_lastDdlTime'='1441619330')
;
CREATE TABLE `app_skn_cchange_price_week_03`(
`product_skn` int,
`is_cnt_14` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_03'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='166994',
'rawDataSize'='1335952',
'totalSize'='7603',
'transient_lastDdlTime'='1441619591')
;
CREATE TABLE `app_skn_cchange_price_week_04`(
`id` int,
`brand_name` string,
`cnt_skn` int,
`cnt_is_up` int,
`is_up_percent` float,
`is_up_ratio` float,
`cnt_is_down` int,
`is_down_percent` float,
`is_down_ratio` float,
`is_cnt_7` int,
`is_cnt_14` int,
`trade_percent` float)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_04'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='462',
'rawDataSize'='62832',
'totalSize'='9090',
'transient_lastDdlTime'='1441677039')
;
CREATE TABLE `app_skn_cchange_price_week_05`(
`id` int,
`brand_name` string,
`lw_cnt_skn` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_05'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='454',
'rawDataSize'='45400',
'totalSize'='4329',
'transient_lastDdlTime'='1441677772')
;
CREATE TABLE `app_skn_cchange_price_week_06`(
`brand_name` string,
`cnt_skn` int,
`cnt_is_up` int,
`is_up_percent` float,
`is_up_ratio` float,
`cnt_is_down` int,
`is_down_percent` float,
`is_down_ratio` float,
`is_cnt_7` int,
`is_cnt_14` int,
`skn_ratio` float,
`trade_percent` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_cchange_price_week_06'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='462',
'rawDataSize'='62832',
'totalSize'='9232',
'transient_lastDdlTime'='1441678308')
;
CREATE TABLE `app_skn_change_price_week_02`(
`product_skn` int,
`is_down` int,
`is_up` int,
`is_equal` int,
`is_cnt_7` int,
`down_sales_price1` float,
`down_sales_price` float,
`up_sales_price1` float,
`up_sales_price` float)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_skn_change_price_week_02'
TBLPROPERTIES (
'transient_lastDdlTime'='1441618923')
;
CREATE TABLE `app_sms_day`(
`sms_operator` string,
`phone_num` bigint,
`sms_flag` string,
`sms_tex` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_sms_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1446629710')
;
CREATE TABLE `app_sms_day_ready`(
`sms_operator` string,
`phone_num` bigint,
`sms_sent_flag` int,
`sms_type` int,
`sms_content` string)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_sms_day_ready'
TBLPROPERTIES (
'transient_lastDdlTime'='1446712767')
;
CREATE TABLE `app_vi_efficient`(
`date_id` bigint,
`brand` string,
`week_newskn_num` int,
`stored_onskn_num` int,
`stored_onskn_amount` double,
`order_push_avgtime` double,
`push_instorage_avgtime` double,
`instorage_out_avgtime` double)
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/app_vi_efficient'
TBLPROPERTIES (
'transient_lastDdlTime'='1455774763')
;
CREATE TABLE `area`(
`id` bigint,
`code` bigint,
`caption` string,
`is_support` string,
`is_delivery` string)
COMMENT 'Imported by sqoop on 2015/05/08 16:55:23'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/area'
TBLPROPERTIES (
'transient_lastDdlTime'='1431075326')
;
CREATE TABLE `base_goods`(
`product_skc` bigint,
`product_skn` bigint,
`goods_name` string,
`goods_color_image` string,
`color_id` int,
`create_time` bigint,
`factory_code` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:35:37'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/base_goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901340')
;
CREATE TABLE `base_product`(
`product_skn` bigint,
`product_name` string,
`brand_id` int,
`shop_id` int,
`max_sort_id` int,
`middle_sort_id` int,
`small_sort_id` int,
`size_max_sort_id` int,
`size_middle_sort_id` int,
`size_small_sort_id` int,
`series_id` bigint,
`gender` string,
`models` string,
`material` string,
`is_limited` string,
`is_advance` string,
`is_main_push` string,
`is_promotional_gifts` string,
`attribute` tinyint,
`remarks` string,
`create_time` bigint,
`edit_time` bigint,
`founder` int,
`replenishment_factor` double,
`soldout_rate` double,
`retail_price` double,
`sales_price` double,
`stock` int,
`stockout_rate` double,
`expect_arrival_time` int,
`goods_years` int,
`goods_season` int,
`product_style` string,
`product_elements` string,
`product_tag` string,
`grade` string,
`brand_folder` int)
COMMENT 'Imported by sqoop on 2015/05/06 16:36:17'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/base_product'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901380')
;
CREATE TABLE `base_single`(
`product_sku` bigint,
`product_skn` bigint,
`product_skc` int,
`factory_code` string,
`size_id` int,
`create_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:37:12'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/base_single'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901434')
;
CREATE EXTERNAL TABLE `bdl_user_browse_action_day`(
`date_id` bigint,
`uid` bigint,
`search_cnt` int,
`login_cnt` int,
`add_chart_cnt` int,
`collection_cnt` int,
`order_cnt` int,
`pay_cnt` int,
`weekday` string,
`st` string)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/user/bdl_user_browse_action_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1439522135')
;
CREATE EXTERNAL TABLE `bdl_user_goods_attr_day`(
`date_id` bigint,
`uid` bigint,
`sort_cnt` string,
`brand_cnt` string,
`goods_years_cnt` string,
`goods_season_cnt` string,
`size_cnt` string,
`term` string,
`product_tag_cnt` string,
`brand_sort_cnt` string,
`color_cnt` string,
`grade_ord_cnt` string,
`product_elements` string,
`attr_ord_cnt` string,
`seasons` string,
`spec_ord_cnt` string,
`ord_attr_cnt` string)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/user/bdl_user_goods_attr_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1439521899')
;
CREATE EXTERNAL TABLE `bdl_user_sale_attr_day`(
`date_id` bigint,
`uid` bigint,
`order_num` bigint,
`total` double,
`avg_total` double,
`max_total` double,
`min_total` double,
`buy_num` bigint,
`avg_buy_num` bigint,
`max_buy_num` bigint,
`min_buy_num` bigint,
`first_down` string,
`last_down` string,
`first_pay` string,
`last_pay` string,
`return_sum` bigint,
`return_total` double,
`exchange_sum` bigint,
`exchange_total` double,
`cancel_sum` bigint,
`cancel_total` double,
`weekday` string,
`st` string,
`years` string,
`quanters` string,
`addr_cnt` string,
`mob_cnt` string)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/user/bdl_user_sale_attr_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1439521836')
;
CREATE EXTERNAL TABLE `bdl_user_set_prom_attr_day`(
`date_id` bigint,
`uid` bigint,
`device_model` string,
`os` string,
`os_version` string,
`yoho_coin_num` int,
`yoho_coin_num_used` int,
`coupon_sum` int,
`coupon_amount` double,
`coupon_amount_ratio` double,
`reden_ord_cnt` int,
`reden_sum` double)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/user/bdl_user_set_prom_attr_tmp_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1439781560')
;
CREATE EXTERNAL TABLE `bdl_user_social_attr_day`(
`date_id` bigint,
`uid` bigint,
`qq` string,
`mobile` string,
`operator` string,
`phone` string,
`code_address` bigint,
`code` bigint,
`province` string,
`county` string,
`district` string,
`full_address` string,
`birthday` string,
`income` string,
`age` bigint,
`sex` string,
`xinzuo` string,
`source` string,
`app` string,
`user_level` string,
`payment` string)
PARTITIONED BY (
`par_dt` bigint)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/yoho/user/bdl_user_social_attr_day'
TBLPROPERTIES (
'transient_lastDdlTime'='1439521761')
;
CREATE TABLE `brand`(
`id` int,
`brand_name` string,
`brand_name_cn` string,
`brand_name_en` string,
`brand_sign` string,
`brand_domain` string,
`parent_id` int,
`brand_alif` string,
`brand_initials` string,
`brand_ico` string,
`brand_types` int,
`brand_type_id` int,
`brand_certificate` string,
`brand_url` string,
`brand_intro` string,
`brand_outline` string,
`status` tinyint,
`create_time` bigint,
`join_hands` int,
`remark` string,
`is_shipping` int)
COMMENT 'Imported by sqoop on 2015/05/08 12:06:31'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/brand'
TBLPROPERTIES (
'transient_lastDdlTime'='1431057994')
;
CREATE TABLE `brand_folder`(
`id` int,
`brand_id` int,
`brand_sort_name` string,
`brand_sort_ico` string,
`parent_id` int,
`order_by` int,
`status` tinyint)
COMMENT 'Imported by sqoop on 2015/05/08 12:07:33'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/brand_folder'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058056')
;
CREATE TABLE `brands`(
`id` int,
`brand_name` string,
`brand_name_cn` string,
`brand_name_en` string,
`brand_sign` string,
`brand_domain` string,
`parent_id` int,
`brand_alif` string,
`brand_initials` string,
`brand_ico` string,
`brand_type_id` int,
`brand_certificate` string,
`brand_url` string,
`brand_intro` string,
`brand_outline` string,
`status` tinyint)
COMMENT 'Imported by sqoop on 2015/09/22 14:47:22'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/brands'
TBLPROPERTIES (
'transient_lastDdlTime'='1442904445')
;
CREATE TABLE `buyer_brand`(
`pid` int,
`brand_id` int,
`belong` tinyint)
COMMENT 'Imported by sqoop on 2015/05/06 16:39:14'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/buyer_brand'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901557')
;
CREATE TABLE `dim_batch_tmp`(
`batch_key` string,
`product_sku` int,
`product_skn` int,
`product_skc` int,
`batch_id` int,
`create_time` string,
`date_key` int,
`purchase_price` float,
`input_tax_rate` float,
`supplier_key` int,
`sell_type` int,
`is_shelves` int,
`soldtime_key` int,
`in_nums` int,
`in_price` float,
`in_retail_price` float,
`out_nums` int,
`out_price` float,
`out_retail_price` float)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/dim_batch_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='2',
'numRows'='900534',
'rawDataSize'='112660198',
'totalSize'='113560732',
'transient_lastDdlTime'='1450317240')
;
CREATE TABLE `dim_online_time_tmp`(
`product_skc` int,
`product_skn` bigint,
`online_time` string,
`time_range_number` int,
`time_range_key` int,
`status` tinyint,
`date_key` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/dim_online_time_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='1425762',
'transient_lastDdlTime'='1445570608')
;
CREATE TABLE `dim_time_range`(
`time_range_key` int,
`time_range_name` string,
`begin_num` int,
`end_num` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact.db/dim_time_range'
TBLPROPERTIES (
'transient_lastDdlTime'='1438082732')
;
CREATE TABLE `exchange_goods`(
`id` bigint,
`uid` bigint,
`init_order_code` bigint,
`source_order_code` bigint,
`order_code` bigint,
`exchange_mode` tinyint,
`exchange_request_type` tinyint,
`applicant` bigint,
`audit_pid` int,
`consignee_name` string,
`mobile` string,
`address` string,
`reject` tinyint,
`remark` string,
`express_name` string,
`express_number` string,
`status` tinyint,
`create_time` bigint,
`old_erp_id` bigint)
COMMENT 'Imported by sqoop on 2015/05/08 17:21:29'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/exchange_goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1431076891')
;
CREATE TABLE `exchange_goods_list`(
`id` bigint,
`init_order_code` bigint,
`source_order_code` bigint,
`order_code` bigint,
`change_purchase_id` bigint,
`product_skn` bigint,
`product_skc` bigint,
`product_sku` bigint,
`goods_type` tinyint,
`source_product_skc` bigint,
`source_product_sku` bigint,
`order_goods_id` bigint,
`init_order_goods_id` bigint,
`last_price` double,
`exchange_reason` tinyint,
`remark` string,
`status` tinyint,
`create_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/08 17:23:15'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/exchange_goods_list'
TBLPROPERTIES (
'transient_lastDdlTime'='1431076998')
;
CREATE TABLE `fact_ageing_temp`(
`product_sku` int,
`batch_id` int,
`nums` int,
`ageing_price` float,
`retail_price` float,
`date_key` int,
`ageing_num` int,
`ageing_key` int,
`sell_key` string)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_ageing_temp'
TBLPROPERTIES (
'transient_lastDdlTime'='1444295030')
;
CREATE TABLE `fact_app_download_tmp`(
`c` int,
`uid1` int,
`source_client` string,
`client_id` string,
`source_id` int,
`source_host` string,
`create_time` string,
`source_create_time` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_app_download_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='3882',
'rawDataSize'='207456',
'totalSize'='211338',
'transient_lastDdlTime'='1445939526')
;
CREATE TABLE `fact_order_source_tmp`(
`dateid` bigint,
`source_client` string,
`unionid` int,
`source_channel` string,
`source_media` string,
`source_type` string,
`source_is_pay` string,
`uid1` bigint,
`customer_type` string,
`order_code` bigint,
`payment_status` tinyint,
`payment` tinyint,
`payment_status_name` string,
`order_client` string,
`order_num` int,
`order_amount` decimal(10,0),
`send_order_code` bigint,
`send_order_num` int,
`send_order_amount` decimal(10,0),
`send_channel` string,
`send_client` string,
`create_time` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_order_source_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='10',
'numRows'='12161',
'rawDataSize'='1692350',
'totalSize'='172020953',
'transient_lastDdlTime'='1446013746')
;
CREATE TABLE `fact_sales_out_in_storage`(
`product_sku` int,
`batch_id` int,
`batch_val` string,
`supplier_key` int,
`type_key` int,
`sell_key` int,
`discount` int,
`order_type` int,
`predict_arrival_time` string,
`order_code` bigint,
`price_range_key` int,
`time_range_key` int,
`time_range_number` int,
`sold_range_number` int,
`create_time` bigint,
`soldtime_key` int,
`out_nums` int,
`sales_price` float,
`out_retail_price` float,
`sales_gross_profit` float,
`out_purchase_tax_price` float,
`purchase_price` float,
`sales_purchase_price` float,
`hhin_nums` int,
`hhreturned_price` float,
`hhin_retail_price` float,
`hhreturned_purchase_price` float,
`thin_nums` int,
`threturned_price` float,
`thin_retail_price` float,
`threturned_gross_profit` float,
`threturned_purchase_price` float,
`thin_purchase_tax_price` float,
`input_tax_rate` float)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact.db/fact_sales_out_in_storage'
TBLPROPERTIES (
'transient_lastDdlTime'='1440662385')
;
CREATE TABLE `fact_search_viewnum1`(
`date_key` int,
`pv_total` int,
`pv_nofilter` int,
`pv_filter` int,
`pv_detial` int,
`uv_total` int)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_search_viewnum1'
TBLPROPERTIES (
'transient_lastDdlTime'='1447137777')
;
CREATE TABLE `fact_search_viewnum2`(
`date_key` date,
`pv_total` int,
`pv_nofilter` int,
`pv_filter` int,
`pv_detial` int,
`uv_total` int)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_search_viewnum2'
TBLPROPERTIES (
'transient_lastDdlTime'='1447139398')
;
CREATE TABLE `fact_user_source_tmp`(
`dateid` bigint,
`uid1` bigint,
`unionid` int,
`source_type` string,
`source_is_pay` string,
`source` string,
`create_time` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\u0001'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/fact_user_source_tmp'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='9',
'numRows'='3594928',
'rawDataSize'='231364025',
'totalSize'='234958953',
'transient_lastDdlTime'='1445938401')
;
CREATE TABLE `goods`(
`id` bigint,
`product_id` bigint,
`factory_sn` string,
`goods_name` string,
`color_id` int,
`color_name` string,
`color_image` string,
`is_down` string,
`match_explain` string,
`view_num` bigint,
`status` tinyint,
`is_default` string,
`product_skc` int,
`first_shelve_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:42:35'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901757')
;
CREATE TABLE `idfa`(
`uid` bigint,
`idfa` string,
`os` string)
COMMENT 'created by dujinyuan on 2016/01/24'
PARTITIONED BY (
`data` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/idfa'
TBLPROPERTIES (
'transient_lastDdlTime'='1452490964')
;
CREATE TABLE `like_brand`(
`uid` bigint,
`brand` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:45:56'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/like_brand'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901959')
;
CREATE TABLE `m`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/m'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='18923',
'transient_lastDdlTime'='1442318651')
;
CREATE EXTERNAL TABLE `ods_orders`(
`id` string,
`order_code` bigint,
`uid` string,
`user_level` string,
`parent_order_code` string,
`is_account_settled` string,
`order_amount` decimal(10,2),
`last_order_amount` decimal(10,2),
`express_number` string,
`channels_orders_code` string,
`order_type` int,
`attribute` string,
`is_purchase` string,
`is_booking` string,
`invoice_type` string,
`invoice_payable` string,
`yoho_coin_num` string,
`payment_status` string,
`payment_type` string,
`payment` string,
`bank_code` string,
`shipping_manner` string,
`shipping_cost` string,
`express_id` string,
`consignee_name` string,
`phone` string,
`mobile` string,
`email` string,
`province` string,
`city` string,
`district` string,
`area_code` string,
`address` string,
`zip_code` string,
`landmarks` string,
`remark` string,
`receipt_time` string,
`exchange_type` string,
`exchange_status` string,
`refund_status` string,
`order_status` string,
`is_contact` string,
`is_print_price` string,
`is_pda_verify` string,
`is_urgent` string,
`how_deal` string,
`order_referer` string,
`arrive_time` string,
`shipment_time` string,
`create_time` int,
`receiving_time` string,
`check_time` string,
`delivery_time` string,
`cancel_time` string,
`update_time` string,
`mark_time` string,
`store_house` string,
`check_pid` string,
`occupy` string,
`admin_name` string,
`locking` string,
`activities_id` string,
`new_user_orders` string)
PARTITIONED BY (
`year` string,
`month` string,
`day` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/ods_orders'
TBLPROPERTIES (
'transient_lastDdlTime'='1430983439')
;
CREATE EXTERNAL TABLE `ods_web_click`(
`dateid` string,
`al` string,
`appkey` string,
`clientid` string,
`cookiesenabled` string,
`firstscreentime` string,
`loadfinishtime` string,
`flashversion` string,
`host` string,
`language` string,
`port` string,
`refererurl` string,
`screendepth` string,
`systemversion` string,
`sy` string,
`url` string,
`uid` string,
`vid` string,
`screenwidthxscreenheight` string,
`windowwidthxwindowheight` string,
`long` string,
`lat` string,
`createtime` string,
`colletcthost` string,
`ip` string,
`ua` string,
`uri` string)
PARTITIONED BY (
`year` string,
`month` string,
`day` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/ods_web_click'
TBLPROPERTIES (
'transient_lastDdlTime'='1435832351')
;
CREATE TABLE `order_vip_discount`(
`id` int,
`order_code` int,
`product_skn` int,
`product_skc` int,
`product_sku` int,
`buy_number` int,
`sale_price` double,
`last_price` double,
`user_level` int,
`vip_discount` double,
`discount_price` double,
`create_time` int)
COMMENT 'Imported by sqoop on 2015/10/13 09:37:35'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/order_vip_discount'
TBLPROPERTIES (
'transient_lastDdlTime'='1444700258')
;
CREATE TABLE `orders`(
`id` bigint,
`order_code` bigint,
`uid` bigint,
`user_level` tinyint,
`parent_order_code` bigint,
`is_account_settled` string,
`order_amount` double,
`last_order_amount` double,
`express_number` string,
`channels_orders_code` string,
`order_type` tinyint,
`attribute` tinyint,
`is_purchase` string,
`is_booking` string,
`invoice_type` tinyint,
`invoice_payable` string,
`yoho_coin_num` int,
`payment_status` tinyint,
`payment_type` tinyint,
`payment` tinyint,
`bank_code` string,
`shipping_manner` tinyint,
`shipping_cost` double,
`express_id` tinyint,
`consignee_name` string,
`phone` string,
`mobile` string,
`email` string,
`province` string,
`city` string,
`district` string,
`area_code` int,
`address` string,
`zip_code` int,
`landmarks` string,
`remark` string,
`receipt_time` tinyint,
`exchange_type` tinyint,
`exchange_status` tinyint,
`refund_status` tinyint,
`order_status` int,
`is_contact` string,
`is_print_price` string,
`is_pda_verify` string,
`is_urgent` string,
`how_deal` string,
`order_referer` string,
`arrive_time` bigint,
`shipment_time` bigint,
`create_time` bigint,
`receiving_time` bigint,
`check_time` bigint,
`delivery_time` int,
`cancel_time` bigint,
`update_time` bigint,
`mark_time` bigint,
`store_house` bigint,
`check_pid` bigint,
`occupy` bigint,
`admin_name` string,
`locking` int,
`activities_id` int,
`new_user_orders` string)
COMMENT 'Imported by sqoop on 2015/05/08 17:23:44'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/orders'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077026')
;
CREATE TABLE `orders_accessory`(
`order_code` bigint,
`is_new` string,
`unionid` int,
`union_name` string,
`redenvelopes_number` double,
`create_time` int)
COMMENT 'Imported by sqoop on 2015/05/08 17:26:53'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/orders_accessory'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077216')
;
CREATE TABLE `orders_coupons`(
`id` bigint,
`order_code` bigint,
`coupon_id` int,
`coupon_code` string,
`coupon_amount` double,
`coupon_adjust_amount` double,
`coupon_title` string)
COMMENT 'Imported by sqoop on 2015/05/08 17:27:04'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/orders_coupons'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077227')
;
CREATE TABLE `orders_goods`(
`id` bigint,
`uid` bigint,
`order_code` bigint,
`buy_number` int,
`product_skc` bigint,
`product_skn` bigint,
`product_sku` bigint,
`size_id` int,
`size_name` string,
`color_id` tinyint,
`color_name` string,
`goods_type` tinyint,
`brand_id` bigint,
`sale_price` double,
`last_price` double,
`real_price` double,
`get_yoho_coin` int,
`fit_promotions` string,
`is_post` string)
COMMENT 'Imported by sqoop on 2015/05/05 17:46:51'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/orders_goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1430819214')
;
CREATE TABLE `orders_promotion`(
`id` bigint,
`order_code` bigint,
`promotion_title` string,
`promotion_id` bigint,
`cutdown_amount` double)
COMMENT 'Imported by sqoop on 2015/05/08 17:27:25'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/orders_promotion'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077248')
;
CREATE EXTERNAL TABLE `orders_type`(
`id` bigint,
`order_type` bigint,
`order_type_name` string)
COMMENT 'Created by dujinyuan on 20150915'
PARTITIONED BY (
`date_id` bigint)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/data/erp/erp_orders/order_type'
TBLPROPERTIES (
'transient_lastDdlTime'='1442284038')
;
CREATE TABLE `out_in_storage`(
`id` bigint,
`orders_code` bigint,
`requisition_form_id` bigint,
`type` tinyint,
`product_skn` bigint,
`product_skc` bigint,
`product_sku` bigint,
`batch_id` bigint,
`nums` int,
`purchase_price` double,
`input_tax_rate` double,
`storehouse_id` int,
`founder` int,
`last_price` double,
`purchase_discount` double,
`create_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:30:48'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/out_in_storage'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901051')
;
CREATE TABLE `pc`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/pc'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='286379',
'transient_lastDdlTime'='1442318643')
;
CREATE TABLE `product`(
`id` bigint,
`erp_product_id` bigint,
`product_name` string,
`cn_alphabet` string,
`phrase` string,
`sales_phrase` string,
`brand_id` int,
`max_sort_id` int,
`middle_sort_id` int,
`small_sort_id` int,
`series_id` bigint,
`gender` string,
`style` string,
`pattern` string,
`material` string,
`is_new` string,
`is_limited` string,
`is_hot` string,
`is_special` string,
`is_sales` string,
`is_replenishment` tinyint,
`is_advance` string,
`is_retrieval` string,
`is_auditing` string,
`is_recommend` string,
`is_promotion` int,
`attribute` tinyint,
`seasons` string,
`salable_time` string,
`first_shelve_time` bigint,
`shelve_time` bigint,
`expect_arrival_time` bigint,
`create_time` bigint,
`arrival_time` bigint,
`edit_time` bigint,
`auditing_time` bigint,
`is_down` string,
`status` tinyint,
`is_edit` tinyint,
`vip_discount_type` tinyint,
`storage` int,
`is_outlets` string,
`folder_id` int,
`sell_channels` string,
`elements` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:44:24'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/product'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901867')
;
CREATE TABLE `product_elements`(
`id` int,
`elements_name` string,
`status` int,
`create_time` int)
COMMENT 'Imported by sqoop on 2015/05/08 12:09:05'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/product_elements'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058148')
;
CREATE TABLE `product_price`(
`product_skn` bigint,
`retail_price` double,
`sales_price` double,
`vip_price` double,
`vip1_price` double,
`vip2_price` double,
`vip3_price` double,
`vip_discount_type` tinyint,
`purchase_price` double,
`purchase_discount` double,
`cost_price` double,
`return_coin` int,
`founder` int)
COMMENT 'Imported by sqoop on 2015/05/08 12:09:35'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/product_price'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058178')
;
CREATE TABLE `product_sort`(
`id` int,
`sort_name` string,
`sort_initials` string,
`parent_id` int,
`order_by` int,
`gender` tinyint,
`sort_code` string,
`sort_level` int,
`is_hot` string,
`status` tinyint)
COMMENT 'Imported by sqoop on 2015/05/08 12:10:34'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/product_sort'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058237')
;
CREATE TABLE `product_style`(
`id` int,
`style_name` string,
`sort` tinyint,
`status` tinyint)
COMMENT 'Imported by sqoop on 2015/05/08 12:11:04'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/product_style'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058267')
;
CREATE TABLE `profile`(
`id` bigint,
`username` string,
`truename` string,
`staff_code` string,
`email` string,
`password` string,
`purview_list` string,
`phone` string,
`dept_id` int,
`role_id` int,
`create_time` bigint,
`status` tinyint,
`nickcode` string)
COMMENT 'Imported by sqoop on 2015/05/06 14:07:37'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/profile'
TBLPROPERTIES (
'transient_lastDdlTime'='1430892460')
;
CREATE TABLE `reg`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/reg'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='92651',
'transient_lastDdlTime'='1442318664')
;
CREATE TABLE `requisition_form`(
`id` bigint,
`supplier_id` bigint,
`brand_id` int,
`parent_brand_id` int,
`shop` int,
`sell_type` tinyint,
`storeroom_id` int,
`payment_mode` tinyint,
`buying_type` tinyint,
`input_tax_rate` double,
`discount` double,
`settle_accounts_nums` tinyint,
`predict_arrival_time` bigint,
`predict_sales_cycle` int,
`is_packing_list` string,
`is_pack` string,
`status` tinyint,
`audit_status` tinyint,
`first_audit_person` int,
`second_audit_person` int,
`contract_number` string,
`founder` int,
`is_complete` string,
`remarks` string,
`create_time` bigint,
`update_time` bigint,
`is_lock` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:39:51'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/requisition_form'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901594')
;
CREATE TABLE `requisition_form_goods`(
`id` bigint,
`requisition_form_id` bigint,
`product_skn` bigint,
`product_skc` bigint,
`factory_code` string,
`sell_type` tinyint,
`product_sku` bigint,
`buying_nums` bigint,
`retail_price` double,
`purchase_price` double,
`purchase_discount` double,
`sales_price` double,
`input_tax_rate` double,
`weight` double,
`cost_price` double,
`predict_arrival_time` bigint,
`remarks` string,
`check_lock` int,
`checking_num` bigint,
`arrival_time` bigint,
`create_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:40:32'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/requisition_form_goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901635')
;
CREATE TABLE `returned_goods`(
`id` bigint,
`uid` bigint,
`init_order_code` bigint,
`source_order_code` bigint,
`order_code` bigint,
`consignee_name` string,
`mobile` string,
`address` string,
`express_name` string,
`express_number` string,
`return_amount_mode` tinyint,
`return_type` tinyint,
`return_mode` tinyint,
`return_shipping_cost` double,
`return_amount` double,
`real_returned_amount` double,
`is_return_coupon` string,
`return_yoho_coin` int,
`audit_pid` int,
`applicant` bigint,
`remark` string,
`change_purchase_id` bigint,
`return_request_type` tinyint,
`payee_name` string,
`area_code` string,
`province` string,
`city` string,
`county` string,
`bank_name` string,
`bank_card` string,
`alipay_account` string,
`alipay_name` string,
`is_all_arrival` tinyint,
`reject` tinyint,
`reject_reason` string,
`inventory_pid` int,
`status` tinyint,
`create_time` bigint,
`is_ok` string)
COMMENT 'Imported by sqoop on 2015/05/08 17:27:36'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/returned_goods'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077259')
;
CREATE TABLE `returned_goods_list`(
`id` bigint,
`return_request_id` bigint,
`order_code` bigint,
`product_skn` bigint,
`product_skc` bigint,
`product_sku` bigint,
`order_goods_id` bigint,
`init_order_goods_id` bigint,
`last_price` double,
`goods_type` tinyint,
`returned_reason` tinyint,
`requisition_form_id` bigint,
`batch_id` bigint,
`seat_code_string` string,
`imperfect` string,
`remark` string,
`status` tinyint,
`create_time` bigint,
`update_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/08 17:27:47'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/returned_goods_list'
TBLPROPERTIES (
'transient_lastDdlTime'='1431077270')
;
CREATE TABLE `sch`(
`catalog_name` string,
`schema_name` string,
`default_character_set_name` string,
`default_collation_name` string,
`sql_path` string)
COMMENT 'Imported by sqoop on 2015/05/05 15:45:32'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sch'
TBLPROPERTIES (
'transient_lastDdlTime'='1430811935')
;
CREATE TABLE `schemata`(
`catalog_name` string,
`schema_name` string,
`default_character_set_name` string,
`default_collation_name` string,
`sql_path` string)
COMMENT 'Imported by sqoop on 2015/05/05 15:44:41'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/schemata'
TBLPROPERTIES (
'transient_lastDdlTime'='1430811884')
;
CREATE TABLE `search_demond`(
`date_key` int,
`lpv` int,
`spv` int,
`luv` int,
`suv` int,
`lc` int,
`sc` int)
PARTITIONED BY (
`date_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/search_demond'
TBLPROPERTIES (
'transient_lastDdlTime'='1446434942')
;
CREATE TABLE `shift_logs`(
`id` bigint,
`product_skn` bigint,
`product_skc` bigint,
`product_sku` bigint,
`shift_nums` int,
`storehouse_id` int,
`storehouse_area_code` int,
`layer_code` tinyint,
`shelf_code` bigint,
`seat_code` int,
`seat_code_string` string,
`property` tinyint,
`batch_id` bigint,
`create_time` bigint,
`requisition_form_id` bigint,
`shift_status` tinyint,
`founder` int,
`arrival_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:31:32'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/shift_logs'
TBLPROPERTIES (
'transient_lastDdlTime'='1430901095')
;
CREATE TABLE `size`(
`id` int,
`size_name` string,
`sort_id` int,
`attribute_id` string,
`order_by` int)
COMMENT 'Imported by sqoop on 2015/05/08 12:11:36'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/size'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058299')
;
CREATE TABLE `sna_all`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sna_all'
TBLPROPERTIES (
'transient_lastDdlTime'='1442383355')
;
CREATE TABLE `sname_00_app_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sname_00_app_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='143844',
'transient_lastDdlTime'='1442382876')
;
CREATE TABLE `sname_00_wap_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sname_00_wap_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='9408',
'transient_lastDdlTime'='1442382933')
;
CREATE TABLE `sname_00_web_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sname_00_web_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='137784',
'transient_lastDdlTime'='1442382997')
;
CREATE TABLE `sname_all`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sname_all'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='3',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='291036',
'transient_lastDdlTime'='1442383482')
;
CREATE TABLE `sname_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/sname_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='885724',
'transient_lastDdlTime'='1442379929')
;
CREATE TABLE `storage`(
`product_sku` bigint,
`product_skn` bigint,
`product_skc` bigint,
`factory_code` string,
`size_id` int,
`storage_num` bigint,
`create_time` bigint)
COMMENT 'Imported by sqoop on 2015/05/08 12:12:23'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/storage'
TBLPROPERTIES (
'transient_lastDdlTime'='1431058346')
;
CREATE TABLE `supplier`(
`id` bigint,
`supplier_code` string,
`supplier_name` string,
`business_license` string,
`legal_person` string,
`linkman` string,
`phone` string,
`fax` string,
`email` string,
`url` string,
`tax_certificate` string,
`bank_name` string,
`bank_account` string,
`category` tinyint,
`create_time` bigint,
`update_time` bigint,
`static` tinyint,
`is_lock` int)
COMMENT 'Imported by sqoop on 2015/10/08 16:45:05'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/supplier'
TBLPROPERTIES (
'transient_lastDdlTime'='1444293908')
;
CREATE TABLE `t`(
`number` string,
`a` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/t'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'last_modified_by'='hadoop',
'last_modified_time'='1444900496',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='248',
'transient_lastDdlTime'='1444900496')
;
CREATE TABLE `tables`(
`table_catalog` string,
`table_schema` string,
`table_name` string,
`table_type` string,
`engine` string,
`version` bigint,
`row_format` string,
`table_rows` bigint,
`avg_row_length` bigint,
`data_length` bigint,
`max_data_length` bigint,
`index_length` bigint,
`data_free` bigint,
`auto_increment` bigint,
`create_time` string,
`update_time` string,
`check_time` string,
`table_collation` string,
`checksum` bigint,
`create_options` string,
`table_comment` string)
COMMENT 'Imported by sqoop on 2015/05/05 17:41:31'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tables'
TBLPROPERTIES (
'transient_lastDdlTime'='1430818894')
;
CREATE TABLE `tables_ddl`(
`table_catalog` string,
`table_schema` string,
`table_name` string,
`table_type` string,
`engine` string,
`version` bigint,
`row_format` string,
`table_rows` bigint,
`avg_row_length` bigint,
`data_length` bigint,
`max_data_length` bigint,
`index_length` bigint,
`data_free` bigint,
`auto_increment` bigint,
`create_time` string,
`update_time` string,
`check_time` string,
`table_collation` string,
`checksum` bigint,
`create_options` string,
`table_comment` string)
COMMENT 'Imported by sqoop on 2015/05/05 16:10:34'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tables_ddl'
TBLPROPERTIES (
'transient_lastDdlTime'='1430813437')
;
CREATE TABLE `testd_`(
`id` string,
`name` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/testd_'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='15',
'transient_lastDdlTime'='1443092046')
;
CREATE TABLE `tmp_app_prod_salse_to50_week_01`(
`product_sku` int,
`batch_val` string,
`batch_id` int,
`out_nums` bigint,
`sales_price` double,
`out_retail_price` double,
`purchase_price` double,
`out_7_nums` bigint,
`sales_7_price` double,
`purchase_7_price` double,
`out_14_nums` bigint,
`sales_14_price` double,
`purchase_14_price` double,
`out_30_nums` bigint,
`sales_30_price` double,
`purchase_30_price` double,
`out_60_nums` bigint,
`sales_60_price` double,
`purchase_60_price` double,
`out_90_nums` bigint,
`sales_90_price` double,
`purchase_90_price` double)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tmp_app_prod_salse_to50_week_01'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='27336',
'rawDataSize'='6668400',
'totalSize'='898264',
'transient_lastDdlTime'='1439897032')
;
CREATE TABLE `tmp_fact_requisition_out_in_storage`(
`product_sku` int,
`out_nums` int,
`in_nums` int,
`in_price` double,
`out_price` double,
`in_retail_price` double,
`out_retail_price` double,
`type` int,
`sell_type` int,
`predict_arrival_time` string,
`date_key` string,
`batch_id` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tmp_fact_requisition_out_in_storage'
TBLPROPERTIES (
'transient_lastDdlTime'='1446177003')
;
CREATE TABLE `tmp_storage_today`(
`product_skn` bigint,
`storage_num_today` bigint,
`max_sort_id` int)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tmp_storage_today'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='225489',
'rawDataSize'='4509780',
'totalSize'='556895',
'transient_lastDdlTime'='1454415435')
;
CREATE TABLE `tmp_thanksgiving`(
`tg_skn` int,
`is_sale` string,
`gross_profit` double)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/tmp_thanksgiving'
TBLPROPERTIES (
'transient_lastDdlTime'='1448268989')
;
CREATE TABLE `uid`(
`uid` bigint)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/uid'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='220725',
'transient_lastDdlTime'='1456204890')
;
CREATE TABLE `uid_18`(
`uid` bigint COMMENT 'change column type')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/uid_18'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='false',
'last_modified_by'='hadoop',
'last_modified_time'='1445998607',
'numFiles'='1',
'numRows'='-1',
'rawDataSize'='-1',
'totalSize'='3909',
'transient_lastDdlTime'='1445998607')
;
CREATE TABLE `uid_day_visit`(
`uid` bigint,
`day_visit` bigint)
PARTITIONED BY (
`date_id` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/uid_day_visit'
TBLPROPERTIES (
'transient_lastDdlTime'='1456280899')
;
CREATE TABLE `uid_month_visit`(
`uid` bigint,
`month_visit` bigint)
PARTITIONED BY (
`month` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/uid_month_visit'
TBLPROPERTIES (
'transient_lastDdlTime'='1456213142')
;
CREATE TABLE `user_base`(
`uid` bigint,
`username` string,
`nickname` string,
`gender` string,
`birthday` string,
`char_id` string,
`head_ico` string,
`income` tinyint,
`profession` tinyint)
COMMENT 'Imported by sqoop on 2015/05/06 16:46:46'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_base'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902008')
;
CREATE TABLE `user_blacklist`(
`uid` bigint,
`remark` string,
`create_time` bigint,
`status` tinyint,
`ip` bigint)
COMMENT 'Imported by sqoop on 2015/05/06 16:47:25'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_blacklist'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902048')
;
CREATE TABLE `user_contacts`(
`uid` bigint,
`qq` string,
`msn` string,
`mobile` string,
`phone` string,
`code_address` bigint,
`full_address` string,
`zip_code` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:48:10'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_contacts'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902092')
;
CREATE TABLE `user_habits`(
`uid` bigint,
`shopping` string,
`dress` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:49:08'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_habits'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902151')
;
CREATE TABLE `user_openid`(
`id` bigint,
`uid` bigint,
`open_id` string,
`refer_id` int,
`bind_time` bigint,
`share_bind` string)
COMMENT 'Imported by sqoop on 2015/05/06 16:49:52'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_openid'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902195')
;
CREATE TABLE `user_profile`(
`uid` bigint,
`email` string,
`mobile` string,
`password` string,
`user_source` tinyint,
`create_time` bigint,
`user_channel` int,
`status` tinyint)
COMMENT 'Imported by sqoop on 2015/05/06 16:50:43'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_profile'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902246')
;
CREATE TABLE `user_vip`(
`uid` bigint,
`vip_level` tinyint,
`start_time` bigint,
`year_cost` double,
`total_cost` double)
COMMENT 'Imported by sqoop on 2015/05/06 16:51:19'
PARTITIONED BY (
`par_dt` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/user_vip'
TBLPROPERTIES (
'transient_lastDdlTime'='1430902282')
;
CREATE TABLE `username_00_app_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/username_00_app_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='936',
'transient_lastDdlTime'='1442383082')
;
CREATE TABLE `username_00_wap_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/username_00_wap_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='9713',
'transient_lastDdlTime'='1442383142')
;
CREATE TABLE `username_00_web_final`(
`number` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/username_00_web_final'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='140502',
'transient_lastDdlTime'='1442383232')
;
CREATE TABLE `yoho_uid`(
`uid` string,
`time` date,
`enter` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='144965',
'transient_lastDdlTime'='1442893818')
;
CREATE TABLE `yoho_uid18_temp0`(
`order_code` bigint,
`issale` string,
`ispick_up_goods` string,
`createtime` string,
`order_type` tinyint,
`payment` tinyint,
`order_status` int,
`product_skn` bigint,
`product_skc` bigint,
`brand_id` bigint,
`buy_number` int,
`last_price` double,
`uid` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid18_temp0'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='3296',
'transient_lastDdlTime'='1443148279')
;
CREATE TABLE `yoho_uid18_temp2`(
`product_skn` bigint,
`product_skc` bigint,
`brand_id` bigint,
`buy_number` int,
`uid` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid18_temp2'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='13605',
'transient_lastDdlTime'='1443073301')
;
CREATE TABLE `yoho_uid18_temp3`(
`order_code` bigint,
`issale` string,
`ispick_up_goods` string,
`createtime` string,
`order_type` tinyint,
`payment` tinyint,
`order_status` int,
`product_skn` bigint,
`product_skc` bigint,
`brand_id` bigint,
`buy_number` int,
`last_price` double)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid18_temp3'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='19620',
'transient_lastDdlTime'='1443086071')
;
CREATE TABLE `yoho_uid18_temp7`(
`order_code` bigint,
`issale` string,
`ispick_up_goods` string,
`createtime` string,
`order_type` tinyint,
`payment` tinyint,
`order_status` int,
`product_skn` bigint,
`product_skc` bigint,
`brand_id` bigint,
`buy_number` int,
`last_price` double,
`uid` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid18_temp7'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='7791',
'transient_lastDdlTime'='1443110110')
;
CREATE TABLE `yoho_uid19_20_temp4`(
`order_code` bigint,
`issale` string,
`ispick_up_goods` string,
`createtime` string,
`order_type` tinyint,
`payment` tinyint,
`order_status` int,
`product_skn` bigint,
`product_skc` bigint,
`brand_id` bigint,
`buy_number` int,
`last_price` double,
`uid` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid19_20_temp4'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='18082',
'transient_lastDdlTime'='1443147521')
;
CREATE TABLE `yoho_uid_t`(
`uid` string,
`time` string,
`enter` string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://yoho/hive/warehouse/yoho_uid_t'
TBLPROPERTIES (
'COLUMN_STATS_ACCURATE'='true',
'numFiles'='1',
'numRows'='0',
'rawDataSize'='0',
'totalSize'='144965',
'transient_lastDdlTime'='1442894094')
;
|
use sakila;
select first_name,last_name,address
from staff
join address on staff.address_id = address.address_id; |
SELECT Count(IsOfficial)
FROM countrylanguage
WHERE CountryCode = 'IND'
AND
IsOfficial = 'T' |
-- PAGE OUTDATED. REFER TO databaseCreation.js
CREATE DATABASE CloakdDb;
CREATE TABLE public.user(
id SERIAL PRIMARY KEY NOT NULL,
role VARCHAR(50) NOT NULL,
address VARCHAR(100) NOT NULL,
email VARCHAR(50) NOT NULL,
secret VARCHAR(50) NOT NULL,
fname VARCHAR(50) NOT NULL,
lname VARCHAR(50) NOT NULL,
phone VARCHAR(50) NOT NULL,
unarmed BOOLEAN,
armed BOOLEAN,
unarmed_exp VARCHAR(50),
armed_exp VARCHAR(50),
dpsst VARCHAR(50),
business_id INT,
business_name VARCHAR(50),
county VARCHAR(50),
CONSTRAINT user_business_id_fkey FOREIGN KEY (business_id)
REFERENCES public.user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
CREATE TABLE public.job(
id SERIAL PRIMARY KEY NOT NULL,
customer_id INT NOT NULL,
business_id INT,
officer_id INT,
contact_fname VARCHAR(50) NOT NULL,
contact_lname VARCHAR(50) NOT NULL,
contact_phone VARCHAR(50) NOT NULL,
is_completed VARCHAR(50) NOT NULL,
description VARCHAR(50) NOT NULL,
duties VARCHAR(50) NOT NULL,
location VARCHAR(50) NOT NULL,
hours VARCHAR(50) NOT NULL,
created_on TIMESTAMP without time zone,
CONSTRAINT jobs_business_id_fkey FOREIGN KEY (business_id)
REFERENCES public.user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT jobs_customer_id_fkey FOREIGN KEY (customer_id)
REFERENCES public.user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT jobs_officer_id_fkey FOREIGN KEY (officer_id)
REFERENCES public.user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);
-- maybe optional ----------------------------------
CREATE TABLE public.security_business(
id SERIAL PRIMARY KEY NOT NULL,
address VARCHAR(50) NOT NULL,
business_name VARCHAR(50) NOT NULL,
county VARCHAR(50) NOT NULL,
contact_email VARCHAR(50) NOT NULL,
contact_fname VARCHAR(50),
contact_lname VARCHAR(50),
contact_phone VARCHAR(50),
);
-- optional ------------------------------------------
CREATE TABLE public.officer
(
id SERIAL PRIMARY KEY NOT NULL,
dpsst VARCHAR(50) NOT NULL,
business_id integer,
email VARCHAR(50),
fname VARCHAR(50) NOT NULL,
lname VARCHAR(50) NOT NULL,
phone VARCHAR(50),
unarmed boolean,
armed boolean,
unarmed_exp VARCHAR(50),
armed_exp VARCHAR(50),
CONSTRAINT officer_business_id_fkey FOREIGN KEY (business_id)
REFERENCES public.user (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
); |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 19, 2021 at 01:31 PM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
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: `banking_app`
--
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`Name` text NOT NULL,
`Email` varchar(50) NOT NULL,
`Ph_No` bigint(20) NOT NULL,
`Balance` double NOT NULL,
`Id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`Name`, `Email`, `Ph_No`, `Balance`, `Id`) VALUES
('Anakha Anie Jose', 'anakhaaniejose2001@gmail.com', 7306353263, 13100, 1),
('Megha Anie Jose', 'anniejose678@gmail.com', 8076567834, 23500, 2),
('Meenakshy Balakrishnan', 'meemub2000@gmail.com', 8076567834, 999100, 3),
('Shalin Binoy', 'shalinbinoy@gmail.com', 1234567891, 0, 4),
('Sheyon Binoy', 'SheyonBinoy@gmail.com', 79807768, 10000, 5),
('Laveena Herman', 'laveen123@gmail.com', 3456789723, 100000, 6),
('Kim Taehyung', 'kth@gmail.com', 5647238890, 511000, 7),
('Zera Elizebeth', 'elizebeth2001@gmail.com', 6789455556, 8199, 8),
('Nitya Menon', 'nyth@gmail.com', 8790984796, 7787, 9),
('Ricky Steve', 'steve222@gmail.com', 7869970692, 7786, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `transferhistory`
--
CREATE TABLE `transferhistory` (
`Sender` text NOT NULL,
`Receiver` text NOT NULL,
`Amount` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `transferhistory`
--
INSERT INTO `transferhistory` (`Sender`, `Receiver`, `Amount`) VALUES
('Megha Anie Jose', 'Anakha anie Jose', 3000),
('Shalin Binoy', 'Sheyon Binoy', 500),
('Anakha Anie Jose', 'Meenakshy Balakrishnan', 100),
('Meenakshy Balakrishnan', 'Megha Anie Jose', 600),
('Megha Anie Jose', 'Anakha Anie Jose', 200),
('Meenakshy Balakrishnan', 'Anakha Anie Jose', 100),
('Shalin Binoy', 'Kim Taehyung', 10000),
('Meenakshy Balakrishnan', 'Zera Elizebeth', 200),
('Meenakshy Balakrishnan', 'Zera Elizebeth', 100),
('Anakha Anie Jose', 'Kim Taehyung', 1000),
('Megha Anie Jose', 'Anakha Anie Jose', 100);
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 */;
|
delete from HtmlLabelIndex where id=27156
/
delete from HtmlLabelInfo where indexid=27156
/
INSERT INTO HtmlLabelIndex values(27156,'触发来源')
/
INSERT INTO HtmlLabelInfo VALUES(27156,'触发来源',7)
/
INSERT INTO HtmlLabelInfo VALUES(27156,'Trigger source',8)
/
INSERT INTO HtmlLabelInfo VALUES(27156,'觸發來源',9)
/
delete from HtmlLabelIndex where id=27955
/
delete from HtmlLabelInfo where indexid=27955
/
INSERT INTO HtmlLabelIndex values(27955,'触发条件')
/
INSERT INTO HtmlLabelInfo VALUES(27955,'触发条件',7)
/
INSERT INTO HtmlLabelInfo VALUES(27955,'Trigger conditions',8)
/
INSERT INTO HtmlLabelInfo VALUES(27955,'觸發條件',9)
/
delete from HtmlLabelIndex where id=27957
/
delete from HtmlLabelInfo where indexid=27957
/
INSERT INTO HtmlLabelIndex values(27957,'触发条件设置')
/
INSERT INTO HtmlLabelInfo VALUES(27957,'触发条件设置',7)
/
INSERT INTO HtmlLabelInfo VALUES(27957,'set trigger conditions',8)
/
INSERT INTO HtmlLabelInfo VALUES(27957,'觸發條件設置',9)
/ |
SELECT
A.USERID,
A.USERNAME,
A.HASH,
A.USER_LEVEL
FROM USER A
WHERE A.USER_STATUS='A'
AND A.EMAIL=?
AND A.EFFDT = (SELECT MAX(A1.EFFDT)
FROM USER A1
WHERE A1.USERID = A.USERID
AND A1.EFFDT <= NOW()) |
SELECT
USERS.*
,USER_GROUPS.GROUP_ROLE
FROM
USERS INNER JOIN USER_GROUPS
ON (USERS.USER_ID = USER_GROUPS.USER_ID
AND USERS.DELETE_FLAG = 0)
WHERE
USER_GROUPS.GROUP_ID = ?
ORDER BY
USERS.USER_ID
LIMIT ? OFFSET ?
|
create table profesores
(
nIdProfesor int auto_increment
primary key,
sNombre varchar(255) not null,
sApellido varchar(255) null
);
|
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 08, 2019 at 10:50 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `iaoadmin`
--
-- --------------------------------------------------------
--
-- Table structure for table `accounts`
--
CREATE TABLE `accounts` (
`id` int(11) NOT NULL,
`username` varchar(100) NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(20) NOT NULL,
`password` varchar(255) NOT NULL,
`hash` varchar(255) NOT NULL,
`ip_address` varchar(255) NOT NULL,
`sign_up_date` datetime NOT NULL,
`profile_pic` varchar(255) NOT NULL,
`folder` varchar(255) NOT NULL,
`active` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `accounts`
--
INSERT INTO `accounts` (`id`, `username`, `firstname`, `lastname`, `email`, `phone`, `password`, `hash`, `ip_address`, `sign_up_date`, `profile_pic`, `folder`, `active`) VALUES
(1, 'crosby', 'caleb', 'crosby adainoo', 'calcronoo@gmail.com', '+233571357788', '$2y$10$zGFdBVXfWjd2LeiMUF68H.ZLmp2CP0bgsd4WRo/A6abxaZKaivwoO', 'eda80a3d5b344bc40f3bc04f65b7a357', '::1', '2018-06-25 15:18:08', '', '', 0),
(2, 'Gyedu Francis', 'Francis', 'Gyedu', 'gyedukynes816@gmail.com', '0206712827/ 05514004', '$2y$10$iwyLZj1XLSsXaC3F.1.NPeSOgj.6MbkPO1PubPfhh35hZhaQkeIMG', 'b1eec33c726a60554bc78518d5f9b32c', '192.168.43.107', '2018-07-04 15:23:08', '', '', 0),
(7, 'korg', 'Kanyo', 'ICGC', 'kanyo@gmail.com', '0571357788', '$2y$10$98lIvzSno56Xvi/gJ8dI.esZqJ8RWfNfKMXUy31V25QiLXheHs4mO', '07871915a8107172b3b5dc15a6574ad3', '::1', '2018-10-06 12:59:40', '', 'users/Kanyo', 0);
-- --------------------------------------------------------
--
-- Table structure for table `app_logs`
--
CREATE TABLE `app_logs` (
`id` int(11) NOT NULL,
`userfirstname` varchar(255) NOT NULL,
`useraction` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `calendar`
--
CREATE TABLE `calendar` (
`id` int(11) NOT NULL,
`caldesc` text NOT NULL,
`startdate` varchar(20) NOT NULL,
`enddate` varchar(20) NOT NULL,
`notifydate` varchar(255) NOT NULL,
`calsch` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `calendar`
--
INSERT INTO `calendar` (`id`, `caldesc`, `startdate`, `enddate`, `notifydate`, `calsch`) VALUES
(50, 'Hello bro', '01/12/2019', '', '01/11/2019', 'Institutional Affiliation Office'),
(51, 'Mapped trip', '01/14/2019', '', '01/13/2019', 'Institutional Affiliation Office'),
(52, 'Craded', '01/12/2019', '', '01/11/2019', 'Institutional Affiliation Office');
-- --------------------------------------------------------
--
-- Table structure for table `filelist`
--
CREATE TABLE `filelist` (
`id` int(11) NOT NULL,
`filename` varchar(255) NOT NULL,
`fileshorthand` varchar(255) NOT NULL,
`filerefno` varchar(255) NOT NULL,
`fileno` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `filelist`
--
INSERT INTO `filelist` (`id`, `filename`, `fileshorthand`, `filerefno`, `fileno`) VALUES
(1, 'IAO General', 'General', 'UCC/IAO/GEN/30/Vol.25/', '30'),
(2, 'IAO Account', 'Account File', 'UCC/IAO/AC/29/Vol.25/', '29'),
(3, 'Special Advancement', 'Special Advance', 'UCC/IAO/SA/Vol.1/65/', '65'),
(4, 'Payment General', 'Payment', 'UCC/IAO/PG/Vol.4/44/', '44'),
(5, 'Training Workshop', 'Workshop File', 'UCC/IAO/TRW/74/Vol.1/', '74'),
(6, 'Payment Plan', 'Payment Plan', 'UCC/IAO/PP/67/Vol.1/', '67'),
(7, 'Imprest', 'Imprest File', 'UCC/IAO/IMP/Vol.1/66/', '66'),
(8, 'Graduations', 'Graduation File', 'UCC/IAO/GD/71/Vol.1/', '71'),
(9, 'Notice', 'Notice File', 'UCC/IAO/NOTICE/77/Vol.1/', '77'),
(10, 'Memo', 'Memo File', 'UCC/IAO/MEMO/80/Vol.1/', '80'),
(11, 'Budget', 'Budget File', 'UCC/IAO/BUDGET/81/Vol.1/', '81'),
(12, 'Non Admitted Students', 'Non Admitted Students', 'UCC/IAO/NAS/2/Vol.1/', '2'),
(13, 'Report on Monitoring', 'Monitoring File', 'UCC/IAO/MONITORING/64/Vol.1/', '64');
-- --------------------------------------------------------
--
-- Table structure for table `letters`
--
CREATE TABLE `letters` (
`id` int(11) NOT NULL,
`scanned_letter` varchar(255) NOT NULL,
`letter_title` varchar(255) NOT NULL,
`letter_refno` varchar(255) NOT NULL,
`letter_deadline` varchar(255) NOT NULL,
`letter_date` varchar(255) NOT NULL,
`letter_school` varchar(255) NOT NULL,
`schlogo` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `letters`
--
INSERT INTO `letters` (`id`, `scanned_letter`, `letter_title`, `letter_refno`, `letter_deadline`, `letter_date`, `letter_school`, `schlogo`) VALUES
(8, 'letters/5b60569533ff1_SOA_KUMASI.jpg', 'Pre and Post Examination Moderation Exercises: School of Anaesthesia, Kumasi', 'UCC/IAO/SOA/116/Vol.1/08', '13/08/2018', '31/07/2018', 'School of Anaesthesia, Kumasi', 'schools/5b3cd55b51fbf_optics.jpg'),
(9, 'letters/5b6ec8fac05cf_Screenshot_20180811-092747.png', 'Beauty', 'UCC', '12/08/2018', '11/08/2018', 'St. Margaret College', 'schools/5b4c6f2b8500a_st_margaret.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `moderators`
--
CREATE TABLE `moderators` (
`id` int(11) NOT NULL,
`mName` varchar(255) NOT NULL,
`mNumber` varchar(25) NOT NULL,
`mDepartment` varchar(255) NOT NULL,
`mEmail` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `moderators`
--
INSERT INTO `moderators` (`id`, `mName`, `mNumber`, `mDepartment`, `mEmail`) VALUES
(1, 'Dr. George K. Aggrey', '0203005004', 'Computer Sci. & Info. Tech.', 'ggeorgeey@hotmail.com'),
(2, 'Dr. Welborn A. Marful', '0268608170', 'Computer Sci. & Info. Tech.', 'wmarful@ucc.edu.gh'),
(3, 'Mr. Elliot Attipoe', '0243879458', 'Computer Sci. & Info. Tech.', 'eattipoe@ucc.edu.gh'),
(4, 'Dr. Edem Bakah', '0207049403', 'French', 'unknown@test.com'),
(5, 'Dr. M. K. Kodah', '0244879794', 'French', 'mkodah@ucc.edu.gh'),
(6, 'Mr. Alexander Kwame', '0242344259', 'French', 'unknown@test.com'),
(7, 'Dr. Felix Kwame Opoku', '0244974205', 'Human Resource Management', 'unknown@test.com'),
(8, 'Dr. Aborampah Mensah', '0208633658', 'Management', 'unknown@test.com'),
(9, 'Mrs. Elizabeth Annan-Prah', '0244660242', 'Human Resource Management', 'unknown@test.com'),
(10, 'Mrs. Edna Okorley', '0208181244', 'Human Resource Management', 'unknown@test.com'),
(11, 'Mr. Kofi Akotoye', '0249220273', 'Computer Sci. & Info. Tech.', 'fokotoye@ucc.edu.gh'),
(12, 'Dr. Samuel Kweku Agyei', '0277655161', 'Finance', 'sagyei@ucc.edu.gh'),
(13, '**Salomey Ofori Appiah', '0244936753', 'Human Resource Management', 'salomey.ofori@ucc.edu.gh'),
(14, 'Dr. Martin Anokye', '0249523517', 'Mathematics & Statistics', 'martin.anokye@ucc.edu.gh'),
(15, 'Sandra Freda Wood', '0244895182', 'Communication Studies', 'sandra.wood@ucc.edu.gh'),
(16, 'Dr. Eugene Milledzi', '0206723189', 'Education & Psychology', 'emilledzi@ucc.edu.gh'),
(17, 'Dr. Clement Lamboi Arthur', '0242637977', 'Accounting', 'carthur@ucc.edu.gh'),
(18, 'Dr. Mark Armah', '0207066734', 'Economics', 'marmah@ucc.edu.gh'),
(19, 'Isaac Kwadwo Anim', '0504141957', 'Accounting', 'ianim@ucc.edu.gh'),
(20, 'Dr. Andrews Yalley', '0265549416', 'Marketing & Supply Chain Management', 'unknown@test.com'),
(21, 'Dr. Alex Yaw Adom', '0509540215', 'Management', 'alex.adom@ucc.edu.gh'),
(22, 'Isaac Tetteh Kwao', '0243011907', 'Human Resource Management', 'lordgentle09@yahoo.com'),
(23, 'Dr. Isaac Buabeng', '0501042479', 'Basic Education', 'ibuabeng@ucc.edu.gh'),
(24, 'Gertrude Afiba Torto', '0244983443', 'Basic Education', 'gertrude.torto@ucc.edu.gh'),
(25, 'Prof. Clement Agezo', '0244974793', 'Basic Education', 'cagezo@ucc.edu.gh'),
(26, 'Lebbaeus Asamaisi', '0242122281', 'Education & Psychology', 'lebbaeusa@gmail.com'),
(27, 'Rev. Prof. Seth Asare-Danso', '0244573688', 'Arts Education', 'sasaredanso@ucc.edu.gh'),
(28, 'Dr. Eric Koka', '0243374637', 'Sociology & Anthropology', 'ekoka@ucc.edu.gh'),
(29, 'Alex Darteh Afrifa', '0208181339', 'Hospital', 'alex.afrifa@ucc.edu.gh'),
(30, 'Mr. Anthony Adu-Asare Idun', '0543818894', 'Finance', 'aidun@ucc.edu.gh'),
(31, 'Mr. Samuel Assabil', '0207223885', 'Mathematics & Statistics', 'samuel.assabil@ucc.edu.gh'),
(32, 'Anukware Togh-Tchimavor', '0264489450', 'French', 'unknown@test.com'),
(33, 'Stephen Kwame Owusu-Amoh', '0244608653', 'Communication Studies', 'stephen.owusu-amoah@ucc.edu.gh'),
(34, 'Franklin Kome Amoo', '0204939339', 'Computer Sci. & Info. Tech.', 'amoo.franklin@ucc.edu.gh'),
(35, 'Dr. Edmond Yeboah Nyamah', '0541909787', 'Marketing & Supply Chain Management', 'edmund.nyamah@ucc.edu.gh'),
(36, 'Isaac Armah-Mensah', '0266238196', 'Computer Sci. & Info. Tech.', 'iamensah@ucc.edu.gh'),
(37, 'Stephen Asante', '0244475648', 'Accounting', 'sasante@ucc.edu.gh'),
(38, 'Dr. Issahaku Adam', '0209027416', 'Hospitality & Tourism Management', 'issahaku.adam@ucc.edu.gh'),
(39, 'Kassimu Issau ', '0243588260', 'Marketing & Supply Chain Management', 'kissau@ucc.edu.gh'),
(40, 'Dr. N. Osei Owusu', '0502560234', 'Management', 'nowusu@ucc.edu.gh'),
(41, 'Dr. Alex Yaw Adom', '0509540215', 'Management', 'alex.adom@ucc.edu.gh'),
(42, 'Daniel Okyere Darko', '0244763015', 'English', 'dan.okyere-darko@ucc.edu.gh'),
(43, 'Dr. Stephen E. Hiamey', '0201288650', 'Hospitality & Tourism Management', 'stephen.hiamey@ucc.edu.gh'),
(44, 'Dominic Owusu', '0208405853', 'Marketing & Supply Chain Management', 'dowusu@ucc.edu.gh'),
(45, 'Dr. Nana Yaw Oppong', '0248188393', 'Human Resource Management', 'noppong@ucc.edu.gh'),
(46, 'Dr. Francis Kwaw Andoh', '0248999779', 'Economics', 'fandoh@ucc.edu.gh'),
(47, 'Emmanuel Yaw Arhin', '0242209828', 'Accounting', 'earhin@ucc.edu.gh'),
(48, 'S. H. M. Aikins', '0244245944', 'Agricultural Engineering', 'stevenaikins@yahoo.com'),
(49, 'Prof. Daniel Okae-Anti', '0244721136', 'Soil Science', 'dokae-anti@ucc.edu.gh'),
(50, 'Dr. Emmanuel Afutu', '0545166242', 'Crop Science', 'emmanuel.afutu@ucc.edu.gh'),
(51, 'Dr. Samuel K. N. Dadzie', '0546994879', 'Agricultural Economics & Extension', 'sdadzie@ucc.edu.gh'),
(52, 'Frank Kuckucher Ackah', '0242652706', 'Crop Science', 'frank.ackah@ucc.edu.gh'),
(53, 'Dr. R. S. Amoah', '0502020751', 'Agricultural Engineering', 'ramoah@ucc.edu.gh'),
(54, 'Dr. Wincharles Coker', '0554690869', 'Communication Studies', 'wcoker@ucc.edu.gh'),
(55, 'Dr. Alexander T. K. Nuer', '0269784902', 'Agricultural Economics & Extension', 'alexander.nuer@ucc.edu.gh'),
(56, 'Mr. Moses Kwadzo', '0208480015', 'Agricultural Economics & Extension', 'moses.kwadzo@ucc.edu.gh'),
(57, 'Dr. Edward A. Ampofo', '0540399336', 'Soil Science', 'akwasi.ampofo@ucc.edu.gh'),
(58, 'Dr. Josiah W. Tachie-Menson', '0244512825', 'Crop Science', 'jtachie-menson@ucc.edu.gh'),
(59, 'Ebenezer Gyamera', '0246606130', 'Animal Science', 'ebenezer.gyamera1@ucc.edu.gh'),
(60, 'Dr. Julius Kofi Hagan', '0243253220', 'Animal Science', 'jhagan1@ucc.edu.gh'),
(61, 'Dr. Moses Teye', '0204335500', 'Animal Science', 'moses.teye@ucc.edu.gh'),
(62, 'Dr. Kingsley J. Taah', '0265170207', 'Crop Science', 'ktaah@ucc.edu.gh'),
(63, 'Samuel Akuamoah-Boateng', '0208165878', 'Agricultural Economics & Extension', 'sakuamoah.boateng@ucc.edu.gh'),
(64, 'Marcelinus Dery', '0204544617', 'Communication Studies', 'marcelinus.dery@ucc.edu.gh'),
(65, 'Dr. Albert Obeng Mensah', '0244804621', 'Agricultural Economics & Extension', 'aobeng.mensah@ucc.edu.gh'),
(66, 'Dr. Jerry Paul Ninnoni', '0554028222', 'Nursing & Midwifery', 'jerry.ninnoni@ucc.edu.gh'),
(67, 'Dr. Prince Amoah Barnie', '0244479476', 'Biomedical Science', 'pamoah-barnie@ucc.edu.gh'),
(68, 'Obed U. Lasim', '0242539351', 'Health Information Management', 'olasim@ucc.edu.gh'),
(69, 'Dr. Ernest Teye', '0243170302', 'Agricultural Engineering', 'ernest.teye@ucc.edu.gh'),
(70, 'Dr. Grace C. Van der Puije', '0249874915', 'Crop Science', 'gvanderpuije@ucc.edu.gh'),
(71, 'Prof. Ernest Ekow Abano', '50542404334', 'Agricultural Engineering', 'eabano@ucc.edu.gh'),
(72, 'Dr. Owusu Boampong', '0244882852', 'Institue for Development Studies', 'owusu.boampong@ucc.edu.gh'),
(73, 'Innocent S. K. Acquah', '0249539547', 'Marketing & Supply Chain Management', 'iacquah@ucc.edu.gh'),
(74, 'Dr. Otuo Serebour Agyemang', '0205383442', 'Finance', 'unknown@test.com'),
(75, 'Dr. Edward Amartefio', '0244980052', 'C. E. S. E. D.', 'eamarteifio@ucc.edu.gh'),
(76, 'Dr. Edmond Yeboah Nyamah', '0541909787', 'Marketing & Supply Chain Management', 'edmond.nyamah@ucc.edu.gh'),
(77, 'Prof. John Gatsi', '0246435952', 'Finance', 'jgatsi@ucc.edu.gh'),
(78, 'Dr. Bernard Wiafe Akaadom', '0202341500', 'MAthematics & I.C.T. Education', 'bernard.akaadom@ucc.edu.gh'),
(79, 'Dr. Samuel Essien-Baidoo', '0507408825', 'Medical Laboratory Science', 'sessien-baidoo@ucc.edu.gh'),
(80, 'Yaa Boahemaa Gyasi', '0242582175', 'Nursing & Midwifery', 'yaa.gyasi@ucc.edu.gh'),
(81, 'Dr. Nancy Ebu Enyan', '0541145193', 'Nursing & Midwifery', 'nebu@ucc.edu.gh'),
(82, 'Mrs. Dorothy E. Addo-Mensah', '0209082050', 'Nursing & Midwifery', 'dorothy.oddo-menson@ucc.edu.gh'),
(83, 'Mrs. Christiana Okantey', '0208152433', 'Nursing & Midwifery', 'christiana.okantey@ucc.edu.gh'),
(84, 'Evelyn Asamoah Ampofo', '0208131658', 'Nursing & Midwifery', 'evelyn.ampofo@ucc.edu.gh'),
(85, 'Dr. Andrews Adjei Druye', '0503187902', 'Nursing & Midwifery', 'adjeidruye@yahoo.com'),
(86, 'Matthew Alidza', '0244897884', 'Center for African & International Studies', 'malidza@ucc.edu.gh'),
(87, 'Owusu Xornam Atta', '0208281110', 'Theatre & Film Studies', 'xornam.owusu@ucc.edu.gh'),
(88, 'Dr. Eric Opoku-Mensah', '0243604199', 'Communication Studies', 'eric.opokumensah@ucc.edu.gh'),
(89, 'Rev. Dr. Philip Arthur Gborsong', '0244987308', 'Communication Studies', 'pgborsong@ug.edu.com'),
(90, 'Mr. Richard T. Torto', '0208164021', 'Communication Studies', 'rtorto@ucc.edu.gh'),
(91, 'Mr. William Kudom Gyasi', '0243374729', 'Communication Studies', 'william.ghasi@ucc.edu.gh'),
(92, 'Mr. Theophilus Attram Nartey', '0244380055', 'Communication Studies', 'tnartey@ucc.edu.gh'),
(93, 'Mrs. Rita Akele Twumasi', '0241144498', 'Communication Studies', 'rakeletwumasi@ucc.edu.gh'),
(94, 'Mr. Martin Kabang-Fu Segtub', '0208992629', 'Communication Studies', 'msegtub@ucc.edu.gh'),
(95, 'Mr. Marcelinus Dery', '0242625587', 'Communication Studies', 'marcelinus.dery@ucc.edu.gh'),
(96, 'Mr. Michael Yao Wodui Serwornou', '0244949841', 'Communication Studies', 'michael.serwornoo@ucc.edu.gh'),
(97, 'Ms. Josephine Brew – Daniels', '0574276204', 'Communication Studies', 'josehine.daniels@ucc.edu.gh'),
(98, 'Mrs. Eunice Ashun Annan', '0285229611', 'Communication Studies', 'eunice.eshun@ucc.edu.gh'),
(99, 'Ms. Christina Araba Baiden', '0243221964', 'Communication Studies', 'christina.baiden@ucc.edu.gh'),
(100, 'Mrs. Judith Owusu Peprah', '0243525603', 'Communication Studies', 'judith.peprah@ucc.edu.gh'),
(101, 'Mr. Osei Yaw Akoto', '0243405089', 'Communication Studies', 'oseiyaw.akoto@ucc.edu.gh'),
(102, 'Mr. Stephen Jantuah Boakye', '0264200977', 'Communication Studies', 'stephen.jantuah@ucc.edu.gh'),
(103, 'Mr. Samuel Cudjoe', '0246541286', 'Communication Studies', 'samuel.cudjoe@ucc.edu.gh'),
(104, 'Mrs. Araba Tawiah Duku-Coleman', '0205414444', 'Communication Studies', 'aduku-coleman@ucc.edu.gh');
-- --------------------------------------------------------
--
-- Table structure for table `notification`
--
CREATE TABLE `notification` (
`id` int(11) NOT NULL,
`subject` varchar(255) NOT NULL,
`noti_text` varchar(255) NOT NULL,
`schlogo` varchar(255) NOT NULL,
`letter_image` varchar(255) NOT NULL,
`status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `notification`
--
INSERT INTO `notification` (`id`, `subject`, `noti_text`, `schlogo`, `letter_image`, `status`) VALUES
(16, 'IAO Notification Platform', 'Notify Dzifa', '4th October, 2018', '', 0),
(17, 'IAO Notification Platform', 'Test two', '4th October, 2018', '', 0),
(18, 'IAO Notification Platform', 'Hello bro', '12th January, 2019', '', 0),
(19, 'IAO Notification Platform', 'Craded', '12th January, 2019', '', 0);
-- --------------------------------------------------------
--
-- Table structure for table `schools`
--
CREATE TABLE `schools` (
`id` int(11) NOT NULL,
`schlogo` varchar(255) NOT NULL,
`schname` varchar(255) NOT NULL,
`schpobox` varchar(255) NOT NULL,
`schloc` varchar(255) NOT NULL,
`schshorthand` varchar(255) NOT NULL,
`schmail` varchar(255) NOT NULL,
`schtel` varchar(255) NOT NULL,
`schrefno` varchar(255) NOT NULL,
`schfileno` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `schools`
--
INSERT INTO `schools` (`id`, `schlogo`, `schname`, `schpobox`, `schloc`, `schshorthand`, `schmail`, `schtel`, `schrefno`, `schfileno`) VALUES
(1, 'schools/5b3296f446716_csir.jpg', 'CSIR College of Science and Technology', 'P. O. Box M 32', 'Accra, Ghana', 'CSIR', 'efoli@hotmail.com', '+233(0)302777651-4, 774772', 'UCC/IAO/CSIR/40/Vol.2/', '40'),
(2, 'schools/5b35508304373_anglican.PNG', 'Anglican University College of Techology', 'P. O. Box TN 1167', 'Nungua - Teshie<br>Accra - Ghana', 'Anglican', 'ask@angutech.edu.gh', '', 'UCC/IAO/AUCT/57/Vol.1/', '57'),
(3, 'schools/5b36686d1bff5_nurse-14-300x213.jpg', 'Ophthalmic Nursing School', 'P. O. Box KB 1015', 'Korle-Bu, Accra', 'Ophthalmic', 'ebeneze.ae@gmail.com', '+233(0)302661869', 'UCC/IAO/OPNS/118/Vol.1/', '118P'),
(4, 'schools/5b3b45e6622c4_epuc.PNG', 'Evangelical Presbyterian University College', 'P. O. Box HP 678', 'Ho-Volta Region', 'EPUC', 'info@epuc.edu.gh', '+233362026498', 'UCC/IAO/EPUC/11/Vol.4/', '11'),
(5, 'schools/5b3b469fc70ae_perez.PNG', 'Perez University College', 'P. O. Box 323', 'Winneba', 'Perez', 'info@perez.edu.gh', '+233(0)332091007; +233(0)332094906', 'UCC/IAO/PEREZ/14/Vol.3/', '14'),
(6, 'schools/5b3b4783ec9bf_dominion.jpg', 'Dominion University College', 'P. O. Box PMB 69', 'Cantoment, Accra', 'Dominion', 'ra.atunwey@duc.edu.gh', '+2333029677559', 'UCC/IAO/DUC/7/Vol.3/', '7'),
(7, 'schools/5b3b48ccc5df1_all_nations.png', 'All Nations University College', 'P. O. Box KF 1908', 'Koforidua, E/R Ghana', 'All Nations', 'registrar@anuc.edu.gh', '+233(0)201742690', 'UCC/IAO/ANU/136/Vol.1/', '136P'),
(8, 'schools/5b3b49c0ecc39_academic_city.png', 'Academic City College', 'Abena Ateaa Towers <br> Ring Road Central<br>P. O. Box AD 421', 'Adabraka - Accra', 'Academic City', 'info@accghana.com', '+233263011389, +233302253630', 'UCC/IAO/ACC/46/Vol.2/', '46'),
(9, 'schools/5b3b4e4fcf87c_Pentecost-Univeristy-College.png', 'Pentecost University College', 'P. O. Box KN 1739', 'Kaneshie, Accra-Ghana', 'Pentecost', 'info@pentvars.edu.gh', '', 'UCC/IAO/PUC/73/Vol.1/', '73'),
(10, 'schools/5b3b70a206d47_bimarks.jpg', 'Bimarks College of Business And Health Sciences', 'P. O. Box SW 834', 'Agona Swedru, Central Region', 'Bimarks', 'demakintosh@yahoo.com', '+233(0)332095776', 'UCC/IAO/BCBH/32/Vol.2/', '32'),
(11, 'schools/5b3ca7a6d7c2b_nmtck.jpg', 'Nursing and Midwifery Training Council - Koforidua', 'P. O. Box KF 142', 'Koforidua', 'Nursing Training Koforidua', 'nmtck@outlook.com', '', 'UCC/IAO/NMTCK/85/Vol.1/', '85'),
(12, 'schools/5b3cb1e13d705_marshals.jpg', 'Marshalls University College', 'P. O. Box KB 781', 'Korle-Bu, Accra', 'Marshalls', 'brimpong@marshalls.edu.gh', '+233242561005; +233575161055', 'UCC/IAO/MSHC/24/Vol.2/', '24'),
(13, 'schools/5b3cb330c2188_regent.jpg', 'Regent University College of Science and Technology', 'P. O. Box DS 1636', 'Dansoman - Accra', 'Regent File', 'registrar@regent.edu.gh', '+233(0)303939900; +233(0)266839961', 'UCC/IAO/RUCST/79/Vol.1/', '79'),
(14, 'schools/logo.jpg', 'Community College', 'P. O. Box AX 763', 'Takoradi', 'Community', 'info@cuctakoradi.edu.gh', '+233(0)312026016', 'UCC/IAO/IAO/CUCT/19/Vol.3/', '19'),
(15, 'schools/5b3cd55b51fbf_optics.jpg', 'School of Dispensing Optics, Oyoko', 'P. O. Box 139', 'Effiduase-Ashanti Region', 'Oyoko', 'gabfaraday74@gmail.com', '+233(0)322492862; +233(0)322492875', 'UCC/IAO/SDO/105/Vol.1/', '105P'),
(16, 'schools/joyce.PNG', 'Joyce Ababio College of Creative Design', 'P. O. Box CT 1097', 'Cantoment, Accra', 'Joyce Ababio', 'registrar@jaccd.edu.gh', '+233(0)235682600 / (0)302797471', 'UCC/IAO/JACCD/25/Vol.1/', '25'),
(17, 'schools/5b3cd896e0b82_christian_service.jpg', 'Christian Service University College', 'P. O. Box 3110', 'Kumasi', 'Christian Service', 'fsakina@csuc.edu.gh', '+233(0)32202878, +233(0)244244953', 'UCC/IAO/CSUC/49/Vol.1/', '49'),
(18, 'schools/5b3ce0484ecd1_community.png', 'Public Health Nursing School', 'P. O. Box KB 84', 'Korle-Bu, Accra', 'Public Health', 'phnskorlebu@yahoo.com', '+233(0)302660966; +233(0)208156463', 'UCC/IAO/PHNS/112/Vol.1/', '112P'),
(19, 'schools/yendi.jpg', 'Yendi College of Health Sciences', 'P. O. Box 137', 'Yendi', 'Yendi', 'joegboglu@yahoo.com', '+233(0)2444585668', 'UCC/IAO/YCHS/96/P/Vol.1/', '96P'),
(20, 'schools/ear_nose.png', 'Ear, Nose and Throat Nursing School', 'P. O. Box KS 511', 'Adum-Kumasi', 'Ear, Nose and Throat', 'ent.school@yahoo.com', '+233(0)322045017', 'UCC/IAO/ENT/108/Vol.1/', '108P'),
(21, 'schools/5b3f31d5eaf73_pantang.png', 'Nurses Training College - Pantang', 'P. O. Box 1236', 'Legon - Accra', 'Pantang', 'fnsatimba@yahoo.com', '+233(0)244922843; +233(0)202011860', 'UCC/IAO/NTCP/107/Vol.1/', '107P'),
(22, 'schools/5b3f70930c95d_ashesi.png', 'Ashesi University', '1 University Avenue', 'Berekuso - Eastern Region', 'Ashesi', 'jsquaye@ashesi.edu.gh', '+233(0)302610330/1', 'UCC/IAO/ASUC/4/Vol.5/', '4'),
(23, 'schools/5b439ac25a0dd_modal.PNG', 'Modal College Sogakope', 'P. O. Box SK 172', 'Sogakope - Volta Region', 'Modal', 'admin@modalcollege.com', '+233(0)552482220', 'UCC/IAO/MCS/82/Vol.1/', '82'),
(24, 'schools/shiv_india.png', 'Shiv-India Institute of Management and Technology', 'P. O. Box CT 7066', 'Cantoment, Accra', 'Shiv India', 'sraju1977@gmail.com', '+233(0)570801624', 'UCC/IAO/68/SIIMT/Vol.1/', '68'),
(25, 'schools/Mountview.jpg', 'Mountview College', 'P. O. Box 224', 'Dunkwa - Offin, Central Region', 'Mountview', 'info@mountview.edu.gh', '+233(0)208893859; +233(0)240616354', 'UCC/IAO/MVC/75/Vol.1/', '75'),
(26, 'schools/5b4c667de65b7_moh.jpg', 'Ministry of Health Schools', 'MSF Belgique ASBL <br>Medical Academy, Ghana <br> Rue de L'Ardre', 'IOSO Brussels, B'enit, 46, Belgium', 'Health Schools', 'findout', '', 'UCC/IAO/MHS/Vol.1/72/', '72'),
(27, 'schools/5b4c6baea9b3a_community.png', 'Nana Afia Kobi Nursing Training College', 'P. O. Box 17480', 'Kumasi', 'Nana Afia Kobi', 'findout', '+233(0)322045164; +233(0)249833730', 'UCC/IAO/NAKNTC/78/Vol.1/', '78'),
(28, 'schools/5b4c6cad0cd4f_community.png', 'Institute of Development and Tehnology Management', 'P. O. Box AD 494', 'Adisadel, Cape Coast', 'IDT', 'jaamicah@yahoo.com', '+233(0)208123530', 'UCC/IAO/IDTM/132/P/Vol.1/', '132P'),
(29, 'schools/5b4c6e5e08d0c_nmc.png', 'Nursing and Midwifery Training Council of Ghana', 'P. O. Box MB 44', 'Accra - Ghana', 'NMC File', 'info@nmcgh.org', '+233(0)302522909/10', 'UCC/IAO/NMC/83/Vol.1/', '83'),
(30, 'schools/5b4c6f2b8500a_st_margaret.jpg', 'St. Margaret College', 'P. O. Box KS 5903', 'Feyiase - Kumasi', 'St. Margaret', 'registrar@smuc.edu.gh', '+233(0)322392584', 'UCC/IAO/SMC/76/Vol.1/', '76'),
(31, 'schools/5b4c70466fd58_nduom.PNG', 'Nduom School of Business and Technology', 'P. O. Box EL 33', 'Elmina', 'Nduom', 'deroy.andrew@gngnana.edu.gh', '+233(0)501545002; +233(0)501481243', 'UCC/IAO/NSBT/69/Vol.1/', '69'),
(32, 'schools/5b4c71a08a1a7_st_nic.jpg', 'St. Nicholas Seminary', 'P. O. Box AD 162', 'John Mensah Sabah Road, Cape Coast', 'St. Nicholas', 'info@snsanglican.org', '', 'UCC/IAO/SNS/001/Vol.2/', '1'),
(33, 'schools/5b4ccc8a58698_kwadaso.PNG', 'Kwadaso Agricultural College', 'Private Post Bag <br>Academy Post Office', 'Kwadaso - Kumasi', 'Kwadaso', 'externalaffairskac@yahoo.com', '+23303220501034', 'UCC/IAO/KWAC/5/Vol.1/', '5'),
(34, 'schools/5b4ccdcbe7373_maranatha.png', 'Maranatha University College', 'P. O. Box AN 10320', 'Accra North, Ghana', 'Maranatha', 'admin@muc.edu.gh', '+23321417581', 'UCC/IAO/MAUC/6/Vol.2/', '6'),
(35, 'schools/5b50519abc31f_ho.PNG', 'Ho Technical University', 'P. O. Box HP 217', 'Ho-Volta Region, Ghana', 'Ho Poly', 'registrar@htu.edu.gh', '+233362027421', 'UCC/IAO/HTU/12/Vol.2/', '12'),
(36, 'schools/5b50526b199be_zenith.PNG', 'Zenith University College', 'P. O. Box TF511', 'Trade Fair, La <br>Accra-Ghana', 'Zenith', 'mails@zenithcollegeghana.org', '+2330302784849', 'UCC/IAO/ZUC/13/Vol.4/', '13'),
(37, 'schools/5b505b84875db_christ_apostilic.PNG', 'Christ Apostolic University College', 'P. O. Box KS 15113', 'Kumasi, Ghana', 'Christ Apostolic', 'info@csuc.edu.gh', '+233506444464', 'UCC/IAO/CAUC/15/Vol.3/', '15'),
(38, 'schools/5b508e4433295_eti.PNG', 'Entrepreneurship Training Institute', 'P. O. Box AN 10476', 'Accra', 'ETI', 'infoeti2005@yahoo.com', '+233(0)244136384', 'UCC/IAO/ETI/10/Vol.2/', '10'),
(39, 'schools/5b509f13b3d4c_gbuc.jpg', 'Ghana Baptist University College', 'Private Mail Bag', 'Kumasi - Ghana', 'Ghana Baptist', 'gbuc2006@yahoo.com', '+233(0)322080195; +233(0)322044011', 'UCC/IAO/GBUC/9/Vol.5/', '9'),
(40, 'schools/5b50a055cfcee_baldwin.PNG', 'Baldwin College', 'P. O. Box 19872', 'Accra, North', 'Baldwin', 'domowusu82@yahoo.com', '+233265968229', 'UCC/IAO/BC/60/Vol.1/', '60'),
(41, 'schools/5b50aea313ea5_od.jpg', 'Organisation Development Institute', 'P. O. Box WY 1718', 'Kwabenya, Accra', 'OD Institute', 'noble.odinstitute@gmail.com', '+233(0)24313997; +233(0)30294583', 'UCC/IAO/OD/21/Vol.2/', '21'),
(42, 'schools/5b50afc06559b_kings.jpg', 'Kings University College', 'P. O. Box CT 10010', 'Cantoment, Accra', 'Kings File', 'enquiries@kuc.edu.gh', '+233(0)302917672-3; +233(0)201651924', 'UCC/IAO/KUC/20/Vol.3/', '20'),
(43, 'schools/5b50bda1112be_community.png', 'Ministry of Food & Agriculture Institutions', 'P. O. Box MB 37', 'Accra', 'MOFA', 'mofahrdmd@gmail.com', '+233(0)302665598 / 687229', 'UCC/IAO/MFA/42/Vol.2/', '42'),
(44, 'schools/mucg.png', 'Methodist University College Ghana', 'P. O. Box DC 940', 'Dansoman - Accra', 'MUCG', 'yvonnemintah@yahoo.com', '+233(0)307021268; +233(0)557674758', 'UCC/IAO/MUCG/33/Vol.2/', '33'),
(45, 'schools/5b50c0ea0f067_cucg.png', 'Catholic University College of Ghana, Fiapre', 'P. O. Box 363', 'Sunyani, Brong Ahafo Region', 'Catholic', 'emmanuel_kaba@yahoo.com', '+233(0)352094657 / 91559 / 94658', 'UCC/IAO/CUCG/17/Vol.5/', '17'),
(46, 'schools/5b574cfca398f_community.png', 'SS Peter and Paul Pastorial and Social Institute', 'P. O. Box 52', 'Wa, Upper West Region', 'SS Peter and Paul', 'registrar.psiwa@gmail.com', '+233(0)392022596', 'UCC/IAO/SSPP/8/Vol.2/', '8'),
(47, 'schools/5b5845d7472d0_Wisconsin_logo_small_-_PNG.png', 'Wisconsin International University College, Ghana', 'P. O. Box LG751', 'Legon, Accra - Ghana', 'Wisconsin', 'info@wiuc-ghana.edu.gh', '+233(0)302504391; +233(0)302504399', 'UCC/IAO/WIUC/3/Vol.3/', '3'),
(48, 'schools/ranselliot.jpg', 'Rans-Elliot School of Nursing', 'P. O. Box KF 451', 'Koforidua', 'Rans Elliot', 'ranselliot.edu@gmail.com', '+233(0)247749078', 'UCC/IAO/RESN/73/Vol.1/', '73P'),
(49, 'schools/potters.PNG', 'Potters International College', 'P. O. Box TD 530', 'Takoradi, Ghana', 'Potters', 'potters.col@gmail.com', '+233(0)244998608; +233(0)234262220', 'UCC/IAO/PCSN/138/P/Vol.1/', '138P'),
(50, 'schools/5b60577b6856b_community.png', 'School of Anaesthesia, Kumasi', 'P. O. Box 17621', 'Kumasi', 'KATH', 'richabundant@gmail.com', '+233(0)322021556', 'UCC/IAO/SOA/116/Vol.1/', '116P'),
(51, 'schools/5b6058d0741f4_community.png', 'School of Anaesthesia, Ridge', 'P O Box 473', 'GPO Accra, Ghana', 'Ridge', 'evans.narh@gmail.com', '+233 303 228315', 'UCC/IAO/SOA/110/Vol.1/', '110P');
-- --------------------------------------------------------
--
-- Table structure for table `settings`
--
CREATE TABLE `settings` (
`id` int(11) NOT NULL,
`notifymail` varchar(255) NOT NULL,
`ccnotifymail` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `settings`
--
INSERT INTO `settings` (`id`, `notifymail`, `ccnotifymail`) VALUES
(1, 'ifcia@ucc.edu.gh', '');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_customer`
--
CREATE TABLE `tbl_customer` (
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `accounts`
--
ALTER TABLE `accounts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `app_logs`
--
ALTER TABLE `app_logs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `calendar`
--
ALTER TABLE `calendar`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `filelist`
--
ALTER TABLE `filelist`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `letters`
--
ALTER TABLE `letters`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `moderators`
--
ALTER TABLE `moderators`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `notification`
--
ALTER TABLE `notification`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `schools`
--
ALTER TABLE `schools`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_customer`
--
ALTER TABLE `tbl_customer`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `accounts`
--
ALTER TABLE `accounts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `app_logs`
--
ALTER TABLE `app_logs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `calendar`
--
ALTER TABLE `calendar`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;
--
-- AUTO_INCREMENT for table `filelist`
--
ALTER TABLE `filelist`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `letters`
--
ALTER TABLE `letters`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `moderators`
--
ALTER TABLE `moderators`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=105;
--
-- AUTO_INCREMENT for table `notification`
--
ALTER TABLE `notification`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `schools`
--
ALTER TABLE `schools`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=52;
--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `tbl_customer`
--
ALTER TABLE `tbl_customer`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
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 TABLE IF EXISTS `#__zptl_radio_channels`;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50721
Source Host : localhost:3306
Source Database : cloud-pay
Target Server Type : MYSQL
Target Server Version : 50721
File Encoding : 65001
Date: 2018-09-05 00:08:51
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for sys_login
-- ----------------------------
DROP TABLE IF EXISTS `sys_login`;
CREATE TABLE `sys_login` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`last_login_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后登录时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of sys_login
-- ----------------------------
INSERT INTO `sys_login` VALUES ('1', '1', '2018-08-03 15:15:05');
INSERT INTO `sys_login` VALUES ('2', '1', '2018-08-03 15:37:20');
INSERT INTO `sys_login` VALUES ('3', '1', '2018-08-03 15:40:14');
INSERT INTO `sys_login` VALUES ('4', '1', '2018-08-03 15:41:50');
INSERT INTO `sys_login` VALUES ('5', '1', '2018-08-03 15:43:45');
INSERT INTO `sys_login` VALUES ('6', '1', '2018-08-03 18:22:09');
INSERT INTO `sys_login` VALUES ('7', '1', '2018-09-01 22:04:17');
INSERT INTO `sys_login` VALUES ('8', '1', '2018-09-02 11:44:53');
INSERT INTO `sys_login` VALUES ('9', '1', '2018-09-02 12:44:27');
INSERT INTO `sys_login` VALUES ('10', '1', '2018-09-02 18:27:57');
INSERT INTO `sys_login` VALUES ('11', '1', '2018-09-02 18:29:41');
INSERT INTO `sys_login` VALUES ('12', '1', '2018-09-02 18:34:49');
INSERT INTO `sys_login` VALUES ('13', '1', '2018-09-02 18:36:21');
INSERT INTO `sys_login` VALUES ('14', '1', '2018-09-02 18:38:28');
INSERT INTO `sys_login` VALUES ('15', '1', '2018-09-02 18:43:35');
INSERT INTO `sys_login` VALUES ('16', '1', '2018-09-02 18:46:38');
INSERT INTO `sys_login` VALUES ('17', '1', '2018-09-02 18:54:09');
INSERT INTO `sys_login` VALUES ('18', '1', '2018-09-02 18:54:45');
INSERT INTO `sys_login` VALUES ('19', '1', '2018-09-02 18:55:48');
INSERT INTO `sys_login` VALUES ('20', '1', '2018-09-02 18:57:55');
INSERT INTO `sys_login` VALUES ('21', '1', '2018-09-02 21:12:16');
INSERT INTO `sys_login` VALUES ('22', '1', '2018-09-02 21:18:36');
INSERT INTO `sys_login` VALUES ('23', '1', '2018-09-02 21:19:30');
INSERT INTO `sys_login` VALUES ('24', '1', '2018-09-02 21:20:49');
INSERT INTO `sys_login` VALUES ('25', '1', '2018-09-02 21:31:30');
INSERT INTO `sys_login` VALUES ('26', '1', '2018-09-02 21:32:51');
INSERT INTO `sys_login` VALUES ('27', '1', '2018-09-02 21:33:33');
INSERT INTO `sys_login` VALUES ('28', '1', '2018-09-02 21:39:31');
INSERT INTO `sys_login` VALUES ('29', '1', '2018-09-02 21:44:06');
INSERT INTO `sys_login` VALUES ('30', '1', '2018-09-02 21:46:18');
INSERT INTO `sys_login` VALUES ('31', '1', '2018-09-02 21:48:49');
INSERT INTO `sys_login` VALUES ('32', '1', '2018-09-02 21:50:20');
INSERT INTO `sys_login` VALUES ('33', '1', '2018-09-02 21:51:50');
INSERT INTO `sys_login` VALUES ('34', '1', '2018-09-02 21:59:45');
INSERT INTO `sys_login` VALUES ('35', '1', '2018-09-02 22:00:40');
INSERT INTO `sys_login` VALUES ('36', '1', '2018-09-02 22:25:54');
INSERT INTO `sys_login` VALUES ('37', '1', '2018-09-02 22:56:25');
INSERT INTO `sys_login` VALUES ('38', '1', '2018-09-02 22:58:34');
INSERT INTO `sys_login` VALUES ('39', '1', '2018-09-02 22:59:55');
INSERT INTO `sys_login` VALUES ('40', '1', '2018-09-02 23:02:07');
INSERT INTO `sys_login` VALUES ('41', '1', '2018-09-02 23:12:39');
INSERT INTO `sys_login` VALUES ('42', '1', '2018-09-02 23:13:27');
INSERT INTO `sys_login` VALUES ('43', '1', '2018-09-02 23:27:09');
INSERT INTO `sys_login` VALUES ('44', '1', '2018-09-02 23:27:56');
INSERT INTO `sys_login` VALUES ('45', '1', '2018-09-02 23:30:38');
INSERT INTO `sys_login` VALUES ('46', '1', '2018-09-02 23:33:23');
INSERT INTO `sys_login` VALUES ('47', '1', '2018-09-02 23:36:04');
INSERT INTO `sys_login` VALUES ('48', '1', '2018-09-02 23:40:12');
INSERT INTO `sys_login` VALUES ('49', '1', '2018-09-02 23:40:58');
INSERT INTO `sys_login` VALUES ('50', '1', '2018-09-02 23:41:57');
INSERT INTO `sys_login` VALUES ('51', '1', '2018-09-02 23:41:58');
INSERT INTO `sys_login` VALUES ('52', '1', '2018-09-02 23:46:13');
INSERT INTO `sys_login` VALUES ('53', '1', '2018-09-02 23:51:49');
INSERT INTO `sys_login` VALUES ('54', '1', '2018-09-02 23:51:49');
INSERT INTO `sys_login` VALUES ('55', '1', '2018-09-04 23:55:49');
INSERT INTO `sys_login` VALUES ('56', '1', '2018-09-05 00:00:27');
INSERT INTO `sys_login` VALUES ('57', '1', '2018-09-05 00:03:43');
INSERT INTO `sys_login` VALUES ('58', '1', '2018-09-05 00:06:22');
-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
`menu_id` int(11) NOT NULL,
`parent_id` int(11) DEFAULT NULL,
`menu_name` varchar(50) DEFAULT NULL,
`menu_url` varchar(50) DEFAULT '#',
`menu_type` enum('2','1') DEFAULT '2' COMMENT '1 -- 系统菜单,2 -- 业务菜单',
`menu_icon` varchar(50) DEFAULT '#',
`sort_num` int(11) DEFAULT '1',
`user_id` int(11) DEFAULT '1' COMMENT '创建这个菜单的用户id',
`is_del` int(11) DEFAULT '0' COMMENT '1-- 删除状态,0 -- 正常',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT INTO `sys_menu` VALUES ('1', '0', '系统管理', '#', '1', 'fa fa-gears', '1', '1', '0', '2017-09-08 16:15:24', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('2', '1', '菜单管理', 'menu/list', '1', '#', '1', '1', '0', '2017-09-12 11:28:09', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('3', '1', '角色管理', 'role/list', '1', null, '2', '1', '0', '2017-09-07 17:58:52', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('4', '1', '用户管理', 'user/list', '1', '', '3', '1', '0', '2017-09-12 09:44:48', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('5', '0', '商户管理', '#', '2', 'fa fa-tasks', '2', '1', '0', '2018-07-30 19:12:51', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('6', '5', '商户列表', '/member/list', '2', '', '1', '1', '0', '2018-07-31 14:19:35', '2017-09-07 14:52:41');
INSERT INTO `sys_menu` VALUES ('7', '0', '资金/对账管理', '#', '2', 'fa fa-tasks', '5', '1', '0', '2018-09-02 18:36:07', '2018-09-02 18:31:29');
INSERT INTO `sys_menu` VALUES ('8', '7', '对账', '/recon/list', '2', ' fa-balance-scale', '1', '1', '0', '2018-09-02 18:32:45', '2018-09-02 18:32:12');
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`role_id` int(11) NOT NULL AUTO_INCREMENT,
`role_name` varchar(50) DEFAULT NULL COMMENT '角色名',
`role_desc` varchar(255) DEFAULT NULL,
`rights` varchar(255) DEFAULT '0' COMMENT '最大权限的值',
`add_qx` varchar(255) DEFAULT '0',
`del_qx` varchar(255) DEFAULT '0',
`edit_qx` varchar(255) DEFAULT '0',
`query_qx` varchar(255) DEFAULT '0',
`user_id` varchar(10) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES ('1', '管理员', '管理员权限', '510', '384', '384', '510', '510', '1', '2018-09-02 18:34:31');
INSERT INTO `sys_role` VALUES ('2', 'tyro', '随便创建的随便创建的随便创建的随便创建的随便创建的随便创建的随便创建的随便创建的随便创建的随便创建的', '510', '2', '1', '4', '126', '1', '2018-09-02 21:40:31');
INSERT INTO `sys_role` VALUES ('3', 'test', '是测试角色这个是测试角色这个是测试角色这个是测试角色这个是测试角色', '510', '382', '382', '382', '126', '1', '2018-09-02 21:40:34');
INSERT INTO `sys_role` VALUES ('4', '查看', '可以查看所有的东西', '510', '0', '0', '0', '126', '1', '2018-09-02 21:40:38');
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL,
`nick_name` varchar(50) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
`pic_path` varchar(200) DEFAULT '/images/logo.png',
`status` enum('unlock','lock') DEFAULT 'unlock',
`sessionId` varchar(50) DEFAULT NULL,
`create_time` datetime DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES ('1', 'admin', '管理员', 'd033e22ae348aeb5660fc2140aec35850c4da997', 'http://www.lrshuai.top/upload/user/20170612/05976238.png', 'unlock', 'B961476B58D9977B58BDC97E54717C10', '2017-08-18 13:57:32');
INSERT INTO `sys_user` VALUES ('2', 'tyro', 'tyro', '481c63e8b904bb8399f1fc1dfdb77cb40842eb6f', '/upload/show/user/82197046.png', 'unlock', null, '2017-09-12 14:03:39');
INSERT INTO `sys_user` VALUES ('3', 'asdf', 'asdf', '3da541559918a808c2402bba5012f6c60b27661c', '/upload/show/user/85610497.png', 'unlock', null, '2017-09-13 14:49:10');
-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`role_id` int(11) DEFAULT NULL,
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT INTO `sys_user_role` VALUES ('2', '2', '3', '2017-09-08 17:12:58');
INSERT INTO `sys_user_role` VALUES ('13', '3', '3', '2017-09-14 14:30:02');
INSERT INTO `sys_user_role` VALUES ('14', '1', '1', '2018-09-02 18:33:24');
-- ----------------------------
-- Table structure for t_amount_limit
-- ----------------------------
DROP TABLE IF EXISTS `t_amount_limit`;
CREATE TABLE `t_amount_limit` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`type` int(1) DEFAULT NULL COMMENT '限制类型',
`merchant_id` int(11) DEFAULT NULL COMMENT '商户id',
`period` int(1) DEFAULT NULL COMMENT '统计周期',
`amount_limit` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='限额配置信息';
-- ----------------------------
-- Records of t_amount_limit
-- ----------------------------
-- ----------------------------
-- Table structure for t_bank
-- ----------------------------
DROP TABLE IF EXISTS `t_bank`;
CREATE TABLE `t_bank` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`bank_code` varchar(255) DEFAULT NULL COMMENT '联行号',
`bank_name` varchar(255) DEFAULT NULL COMMENT '银行名称',
`modifer` varchar(255) DEFAULT NULL COMMENT '修改人',
`modify_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='联行号信息';
-- ----------------------------
-- Records of t_bank
-- ----------------------------
-- ----------------------------
-- Table structure for t_channel
-- ----------------------------
DROP TABLE IF EXISTS `t_channel`;
CREATE TABLE `t_channel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`channel_name` varchar(100) DEFAULT NULL COMMENT '渠道名称',
`channel_merchant_id` varchar(50) DEFAULT NULL COMMENT '渠道商户号',
`channel_type` int(1) DEFAULT NULL COMMENT '渠道类型',
`fee_type` int(1) DEFAULT NULL COMMENT '费率类型',
`fee` decimal(10,2) DEFAULT NULL COMMENT '费率',
`creator` varchar(100) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`channel_code` varchar(50) DEFAULT NULL,
`modifer` varchar(255) DEFAULT NULL COMMENT '修改人',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='渠道信息';
-- ----------------------------
-- Records of t_channel
-- ----------------------------
INSERT INTO `t_channel` VALUES ('1', '渤海', '2018090200000343', '1', '1', '0.02', '1', '2018-09-02 17:16:50', 'bohai', '1', '2018-09-02 17:17:01');
INSERT INTO `t_channel` VALUES ('2', '华夏', '2018090200000345', '1', '1', '1.00', null, '2018-09-02 21:56:53', 'huaxia', '1', '2018-09-02 21:57:02');
-- ----------------------------
-- Table structure for t_merchant_applu_fee_conf
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_applu_fee_conf`;
CREATE TABLE `t_merchant_applu_fee_conf` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`version` int(3) DEFAULT NULL COMMENT '版本号',
`merchant_id` int(11) DEFAULT NULL COMMENT '商户ID',
`pay_fee_type` int(1) DEFAULT NULL COMMENT '代付费率类型(1按比例,2按笔)',
`pay_fee` decimal(10,2) DEFAULT NULL COMMENT '代付费率',
`loan_fee_type` int(1) DEFAULT NULL COMMENT '垫资费率类型(1按比例,2按笔)',
`loan_fee` decimal(10,2) DEFAULT NULL COMMENT '垫资费率',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户/机构申请费率配置';
-- ----------------------------
-- Records of t_merchant_applu_fee_conf
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_apply_attachement_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_apply_attachement_info`;
CREATE TABLE `t_merchant_apply_attachement_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`version` int(3) DEFAULT NULL COMMENT '版本号',
`merchant_id` int(11) DEFAULT NULL,
`attachement_type` int(1) DEFAULT NULL COMMENT '附件类型(1营业执照,2银行卡,3身份证,4协议)',
`attachement_path` varchar(255) DEFAULT NULL COMMENT '附件路径',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户申请附件信息';
-- ----------------------------
-- Records of t_merchant_apply_attachement_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_apply_bank_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_apply_bank_info`;
CREATE TABLE `t_merchant_apply_bank_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`version` int(3) DEFAULT NULL COMMENT '版本号',
`merchant_id` int(11) DEFAULT NULL COMMENT '所属商户ID',
`bank_name` varchar(100) DEFAULT NULL COMMENT '开户银行名称',
`bank_id` int(11) DEFAULT NULL COMMENT '联行号ID',
`bank_card_no` varchar(30) DEFAULT NULL COMMENT '银行卡号',
`bank_account_type` int(1) DEFAULT NULL COMMENT '账户类型(1企业,2个人)',
`bank_account_name` varchar(100) DEFAULT NULL COMMENT '户名',
`cert_type` int(1) DEFAULT NULL COMMENT '证件类型(1身份证)',
`cert_no` varchar(30) DEFAULT NULL COMMENT '证件号码',
`mobile_no` varchar(12) DEFAULT NULL COMMENT '手机号码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户申请银行卡信息';
-- ----------------------------
-- Records of t_merchant_apply_bank_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_apply_base_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_apply_base_info`;
CREATE TABLE `t_merchant_apply_base_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`version` int(3) DEFAULT NULL COMMENT '版本号',
`org_id` int(11) DEFAULT NULL COMMENT '所属机构ID',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`short_name` varchar(255) DEFAULT NULL COMMENT '简称',
`type` int(1) DEFAULT NULL COMMENT '类型(1代理商,2第三方支付,3垫资商,4企业商户,5个人商户)',
`industry_category` varchar(255) DEFAULT NULL COMMENT '行业类别',
`legal` varchar(100) DEFAULT NULL COMMENT '法人',
`city` varchar(100) DEFAULT NULL COMMENT '所属城市',
`address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(12) DEFAULT NULL COMMENT '手机号码',
`status` int(1) DEFAULT NULL COMMENT '申请状态(1待审核,2审核通过,3审核不通过)',
`creator` varchar(100) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`modifer` varchar(100) DEFAULT NULL COMMENT '修改人',
`modify_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户申请基本信息';
-- ----------------------------
-- Records of t_merchant_apply_base_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_attachement_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_attachement_info`;
CREATE TABLE `t_merchant_attachement_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchant_id` int(11) DEFAULT NULL,
`attachement_type` int(1) DEFAULT NULL COMMENT '附件类型(1营业执照,2银行卡,3身份证,4协议)',
`attachement_path` varchar(255) DEFAULT NULL COMMENT '附件路径',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户附件信息';
-- ----------------------------
-- Records of t_merchant_attachement_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_bank_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_bank_info`;
CREATE TABLE `t_merchant_bank_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchant_id` int(11) DEFAULT NULL COMMENT '所属商户ID',
`bank_name` varchar(100) DEFAULT NULL COMMENT '开户银行名称',
`bank_id` int(11) DEFAULT NULL COMMENT '联行号ID',
`bank_card_no` varchar(30) DEFAULT NULL COMMENT '银行卡号',
`bank_account_type` int(1) DEFAULT NULL COMMENT '账户类型(1企业,2个人)',
`bank_account_name` varchar(100) DEFAULT NULL COMMENT '户名',
`cert_type` int(1) DEFAULT NULL COMMENT '证件类型(1身份证)',
`cert_no` varchar(30) DEFAULT NULL COMMENT '证件号码',
`mobile_no` varchar(12) DEFAULT NULL COMMENT '手机号码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户银行卡信息';
-- ----------------------------
-- Records of t_merchant_bank_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_base_info
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_base_info`;
CREATE TABLE `t_merchant_base_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`org_id` int(11) DEFAULT NULL COMMENT '所属机构ID',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`short_name` varchar(255) DEFAULT NULL COMMENT '简称',
`type` int(1) DEFAULT NULL COMMENT '类型(1代理商,2第三方支付,3垫资商,4企业商户,5个人商户)',
`industry_category` varchar(255) DEFAULT NULL COMMENT '行业类别',
`legal` varchar(100) DEFAULT NULL COMMENT '法人',
`city` varchar(100) DEFAULT NULL COMMENT '所属城市',
`address` varchar(255) DEFAULT NULL COMMENT '详细地址',
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
`mobile` varchar(12) DEFAULT NULL COMMENT '手机号码',
`creator` varchar(100) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`modifer` varchar(100) DEFAULT NULL COMMENT '修改人',
`modify_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户基本信息';
-- ----------------------------
-- Records of t_merchant_base_info
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_fee_conf
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_fee_conf`;
CREATE TABLE `t_merchant_fee_conf` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`merchant_id` int(11) DEFAULT NULL COMMENT '商户ID',
`pay_fee_type` int(1) DEFAULT NULL COMMENT '代付费率类型(1按比例,2按笔)',
`pay_fee` decimal(10,2) DEFAULT NULL COMMENT '代付费率',
`loan_fee_type` int(1) DEFAULT NULL COMMENT '垫资费率类型(1按比例,2按笔)',
`loan_fee` decimal(10,2) DEFAULT NULL COMMENT '垫资费率',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商户/机构费率配置';
-- ----------------------------
-- Records of t_merchant_fee_conf
-- ----------------------------
-- ----------------------------
-- Table structure for t_merchant_route_conf
-- ----------------------------
DROP TABLE IF EXISTS `t_merchant_route_conf`;
CREATE TABLE `t_merchant_route_conf` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`type` int(1) DEFAULT NULL COMMENT '主体类型',
`channel_id` int(11) DEFAULT NULL COMMENT '渠道ID',
`merchant_id` int(11) DEFAULT NULL COMMENT '商户ID',
`loaning` int(1) DEFAULT NULL COMMENT '是否垫资(0不垫资,1垫资)',
`loaning_org_id` int(11) DEFAULT NULL COMMENT '垫资机构ID',
`loaning_amount` decimal(10,2) DEFAULT NULL COMMENT '垫资金额',
`status` int(1) DEFAULT NULL COMMENT '状态(0冻结,1正常)',
`creator` varchar(100) DEFAULT NULL COMMENT '创建人',
`create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`modifer` varchar(100) DEFAULT NULL COMMENT '最后修改人',
`modify_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='路由配置表';
-- ----------------------------
-- Records of t_merchant_route_conf
-- ----------------------------
-- ----------------------------
-- Table structure for t_recon
-- ----------------------------
DROP TABLE IF EXISTS `t_recon`;
CREATE TABLE `t_recon` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID自增',
`ACCOUNT_DATE` date DEFAULT NULL COMMENT '记账日期(交易日期)',
`CHANNEL_ID` int(11) DEFAULT NULL COMMENT '渠道表ID',
`TRADE_TOTAL` int(11) DEFAULT NULL COMMENT '订单总笔数',
`TRADE_AMT_TOTAL` decimal(10,2) DEFAULT NULL COMMENT '订单总笔数',
`EXCEPTION_TOTAL` int(11) DEFAULT NULL COMMENT '异常总笔数',
`RECON_STATUS` int(1) DEFAULT NULL COMMENT '对账状态:0-未对账,1-对账成功,2-对账失败,3-对账中',
`FAIL_RESON` varchar(255) DEFAULT NULL COMMENT '失败原因',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_recon
-- ----------------------------
INSERT INTO `t_recon` VALUES ('1', '2018-09-04', '1', null, null, null, '3', '2001:对账文件不存在', '2018-09-02 17:18:57');
INSERT INTO `t_recon` VALUES ('2', '2018-08-31', '1', '1000', '9445332.24', null, '2', '2001:对账文件不存在', '2018-09-02 19:11:41');
INSERT INTO `t_recon` VALUES ('3', '2018-08-30', '1', null, null, null, '2', '2001:对账文件不存在', '2018-09-02 19:11:39');
INSERT INTO `t_recon` VALUES ('4', '2018-09-02', '1', null, null, null, '2', '2001:对账文件不存在', '2018-09-02 22:00:43');
INSERT INTO `t_recon` VALUES ('5', '2018-09-02', '2', null, null, null, '2', '渠道不存在', '2018-09-02 22:00:43');
-- ----------------------------
-- Table structure for t_recon_channel_bohai
-- ----------------------------
DROP TABLE IF EXISTS `t_recon_channel_bohai`;
CREATE TABLE `t_recon_channel_bohai` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID主键',
`SINGLE_OR_BATCH` enum('batch','single') DEFAULT 'single' COMMENT '单笔或批量表示',
`INSTID` varchar(32) DEFAULT NULL COMMENT '机构标识',
`TRADE_ORDER_NO` varchar(32) DEFAULT NULL COMMENT '交易流水',
`PAYER_ACCOUNT` varchar(50) DEFAULT NULL COMMENT '付款人账号',
`PAYER_NAME` varchar(50) DEFAULT NULL COMMENT '付款人账户名',
`PAYEE_ACCOUNT` varchar(50) DEFAULT NULL COMMENT '收款人账号',
`PAYEE_NAME` varchar(50) DEFAULT NULL COMMENT '收款人账户名',
`BANK_CODE` varchar(10) DEFAULT NULL COMMENT '收付款人接收行号',
`TRADE_AMOUNT` decimal(10,2) DEFAULT NULL,
`TRADE_STATUS` int(1) DEFAULT NULL COMMENT '交易状态(1-成功,2-失败)',
`TRADE_STATUS_DESC` varchar(255) DEFAULT NULL COMMENT '交易状态信息',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_recon_channel_bohai
-- ----------------------------
-- ----------------------------
-- Table structure for t_recon_exception_trade
-- ----------------------------
DROP TABLE IF EXISTS `t_recon_exception_trade`;
CREATE TABLE `t_recon_exception_trade` (
`ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID自增长',
`ORDER_NO` varchar(32) NOT NULL COMMENT '交易订单号',
`EXCEPTION_REASON` varchar(255) DEFAULT NULL COMMENT '异常原因',
`CREATE_TIME` datetime DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of t_recon_exception_trade
-- ----------------------------
-- ----------------------------
-- Table structure for t_trade
-- ----------------------------
DROP TABLE IF EXISTS `t_trade`;
CREATE TABLE `t_trade` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`order_no` varchar(32) DEFAULT NULL COMMENT '订单号',
`merchant_id` int(11) DEFAULT NULL COMMENT '商户id',
`trade_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '交易时间',
`trade_amount` decimal(10,2) DEFAULT NULL COMMENT '交易金额',
`status` int(1) DEFAULT NULL COMMENT '状态(1处理中,2成功,3失败)',
`channel_id` int(11) DEFAULT NULL COMMENT '渠道ID',
`return_code` varchar(255) DEFAULT NULL COMMENT '返回码',
`return_info` varchar(255) DEFAULT NULL COMMENT '返回信息',
`payer_id` int(11) DEFAULT NULL COMMENT '付款方ID',
`payee_name` varchar(255) DEFAULT NULL COMMENT '收款人姓名',
`payee_bank_card` varchar(255) DEFAULT NULL COMMENT '收款人银行账号',
`payee_bank_code` varchar(255) DEFAULT NULL COMMENT '收款人联行号',
`trade_confirm_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '交易确认时间',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`settle_status` int(1) DEFAULT NULL COMMENT '结算状态(0:未导出,1已导出)',
`recon_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '对账日期(格式yyyymmdd)',
`recon_status` int(1) DEFAULT NULL COMMENT '对账状态(1成功,2失败)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='交易信息表';
-- ----------------------------
-- Records of t_trade
-- ----------------------------
|
create or replace function computeTotal (p_orderid in char)
return number
is
l_total decimal(7,2) := 0.0;
l_itemid char(5);
l_numitems integer;
l_shipping decimal (4,2);
l_custid char(5);
begin
select custid into l_custid from itemorder where p.orderid = itemorder.orderid;
select itemid into l_itemid from itemorder where p_orderid = itemorder.orderid;
select price into l_total from storeitems where l_itemid = storeitems.itemid;
select noofitems into l_numitems from itemorder where p_orderid = itemorder.orderid;
select shippingFee into l_shipping from itemorder where p_orderid = itemorder.orderid;
/*multiply by order size*/
l_total := l_total * l_numitems;
/*add shipping costs*/
l_total := l_total + l_shipping;
/*7.25% sales tax*/
l_total := l_total + l_total * 0.0725;
/*dbms_output.put_line('tot ' || l_total);*/
if l_total > 100 and (select count(*) from goldcustomers where l_custid = goldcustomers.custid) then
l_total = l_total - 0.1 * l_total;
end if;
return l_total;
end;
/
show errors;
|
-- Create a states DB and insert a table
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
USE hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS states(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(256) NOT NULL); |
alter table field add column type_param text;
|
create database aluno_representante;
use aluno_representante;
create table Projeto (
idProjeto int primary key auto_increment,
nomeProjeto varchar(45),
descricaoProjeto varchar(100)
);
create table Aluno (
ra char(8) primary key,
nomeAluno varchar(45),
telefoneCelular varchar(14),
fkProjeto int,
foreign key (fkProjeto) references projeto(idProjeto),
fkRepresentante char(8),
foreign key (fkRepresentante) references aluno(ra)
);
create table Acompanhante (
fkAluno char(8),
foreign key (fkAluno) references aluno(ra),
idAcompanhante int,
primary key (idAcompanhante, fkAluno),
nomeAcompanhante varchar(45),
relacionamentoAluno varchar(30)
);
insert into projeto values
(null, 'IGNIS', 'Prevenção de Incêndios'),
(null, 'Lumos', 'Iluminação correta de escritórios'),
(null, 'Horizon', 'Facilitar o acesso a tecnologia');
insert into aluno values
('01211011', 'Bianca Vediner', '11 98726-3013', 1, null),
('01211001', 'Bruno Luis', '11 98546-3257', 1, null),
('01211130', 'Vitoria Teixeira', '11 92543-1425', 2, null),
('01211030', 'Gabriel Vidal', '11 92456-9745', 3, null),
('01211025', 'Gabrielle Fideles', '11 94523-1523', 2, null);
insert into aluno values
('01217444', 'Carlos Montani', '11 98723-4562', null, null),
('01216572', 'Fernanda Cardoso', '11 98723-4562', null, null),
('01219235', 'Paulo Almeida', '11 95632-5662', null, null);
update aluno set fkRepresentante = '01217444' where ra in ('01211001', '01211030', '01211025');
update aluno set fkRepresentante = '01216572' where ra = '01211011';
update aluno set fkRepresentante = '01219235' where ra = '01211130';
insert into acompanhante values
('01211011', 1, 'Lucas Chavier', 'Namorado'),
('01211030', 1, 'Julia Alves', 'Namorada'),
('01211025', 1, 'Rafael Rodrigues', 'Namorado'),
('01211001', 1, 'Gabriela Santos', 'Irmão'),
('01211130', 2, 'Rosangela Guedes', 'Mãe'),
('01211130', 3, 'Alberto Guedes', 'Pai');
select * from projeto;
select * from aluno;
select * from acompanhante;
select * from aluno inner join projeto
on fkProjeto = idProjeto;
select * from acompanhante inner join aluno
on fkAluno = ra;
select * from aluno as alunos inner join aluno as representantes
on alunos.fkRepresentante = representantes.ra;
select * from aluno inner join projeto
on fkProjeto = idProjeto
where nomeProjeto = 'Lumos';
select * from acompanhante inner join aluno
on fkAluno = ra
inner join projeto
on fkProjeto = idProjeto; |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: reviews; Type: TABLE; Schema: public; Owner: Guest; Tablespace:
--
CREATE TABLE reviews (
id integer NOT NULL,
description character varying,
date_created timestamp without time zone,
room_id integer,
user_id integer,
rating character varying
);
ALTER TABLE reviews OWNER TO "Guest";
--
-- Name: reviews_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
--
CREATE SEQUENCE reviews_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE reviews_id_seq OWNER TO "Guest";
--
-- Name: reviews_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
--
ALTER SEQUENCE reviews_id_seq OWNED BY reviews.id;
--
-- Name: rooms; Type: TABLE; Schema: public; Owner: Guest; Tablespace:
--
CREATE TABLE rooms (
id integer NOT NULL,
type character varying,
address character varying,
url character varying
);
ALTER TABLE rooms OWNER TO "Guest";
--
-- Name: rooms_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
--
CREATE SEQUENCE rooms_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE rooms_id_seq OWNER TO "Guest";
--
-- Name: rooms_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
--
ALTER SEQUENCE rooms_id_seq OWNED BY rooms.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: Guest; Tablespace:
--
CREATE TABLE users (
id integer NOT NULL,
name character varying,
password character varying
);
ALTER TABLE users OWNER TO "Guest";
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
--
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE users_id_seq OWNER TO "Guest";
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
--
ALTER SEQUENCE users_id_seq OWNED BY users.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
--
ALTER TABLE ONLY reviews ALTER COLUMN id SET DEFAULT nextval('reviews_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
--
ALTER TABLE ONLY rooms ALTER COLUMN id SET DEFAULT nextval('rooms_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
--
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
--
-- Data for Name: reviews; Type: TABLE DATA; Schema: public; Owner: Guest
--
COPY reviews (id, description, date_created, room_id, user_id, rating) FROM stdin;
4 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum do 2016-05-19 15:14:02.786 15 31 4.png
5 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru 2016-05-19 15:15:36.648 16 32 2.png
6 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru 2016-05-19 15:16:38.487 17 33 3.png
7 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 2016-05-19 15:18:05.967 18 34 3.png
8 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo volu 2016-05-19 15:19:33.121 19 35 2.png
9 "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipi 2016-05-19 15:20:52.399 20 36 \N
10 At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit 2016-05-19 15:22:09.91 21 37 5.png
11 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo 2016-05-19 15:48:05.375 22 38 1.png
12 Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro qu 2016-05-19 15:48:56.415 23 39 5.png
13 At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiore 2016-05-19 15:50:04.736 24 40 2.png
14 At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumqueuibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiore 2016-05-19 15:51:37.847 25 41 2.png
15 Test 2016-05-20 09:15:53.153 26 45 1.png
\.
--
-- Name: reviews_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
--
SELECT pg_catalog.setval('reviews_id_seq', 15, true);
--
-- Data for Name: rooms; Type: TABLE DATA; Schema: public; Owner: Guest
--
COPY rooms (id, type, address, url) FROM stdin;
15 apartment 2101 NE 8th ave at Tillamook, Portland https://portland.craigslist.org/mlt/roo/5594685912.html
16 loft SE 41st at SE Morrison https://portland.craigslist.org/mlt/roo/5594642856.html
17 apartment SW 5th Ave at College Street, Portland
18 loft 434 SW College St http://all4desktop.com/data_images/original/4240860-bedroom.jpg
19 apartment Brazee ct at 138 th pl, Portland http://globe-views.com/dreams/bedroom.html
20 loft 164 th avenue, Porland https://upload.wikimedia.org/wikipedia/commons/c/cf/Hotel-suite-bedroom.jpg
21 apartment Stark and Sundial at Sundial, Porland http://tremendouswallpapers.com/wp-content/uploads/2014/12/deluxe-bedroom-1920x1080.jpg
22 apartment NE 154th at Ward Road http://photos2.zillowstatic.com/i_f/ISlio5u5uktg270000000000.jpg
23 apartment 107 N Cook St, Portland http://livinator.com/wp-content/uploads/2015/11/hgtv21.jpg
24 apartment SE foster rd at Harold St, Portland http://www.simplycleanhome.com/wp-content/uploads/2014/06/blog-post-10-image.jpg
25 apartment 8604 SW Scoffins, Portland http://cdn.home-designing.com/wp-content/uploads/2014/09/artist-bedroom-attic.jpeg
26 apartment 2101 NE 8th ave at Tillamook, Portland
\.
--
-- Name: rooms_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
--
SELECT pg_catalog.setval('rooms_id_seq', 26, true);
--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: Guest
--
COPY users (id, name, password) FROM stdin;
30 Fernanda 234567
31 Fernanda 234567
32 Fernanda Lowe
33 Fernanda Lowe
34 Fernanda 234567
35 Fe_lowe@hotmail.com Lowe
36 Fernanda 234567
37 Fernanda 234567
38 Fernanda Lowe
39 Fernanda 234567
40 Fernanda Lowe
41 Fe_lowe@hotmail.com Lowe
42 Fernanda Lowe
43 Fernanda Lowe
44 Fernanda Fernanda
45 Fernanda acsfqwfcds
\.
--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
--
SELECT pg_catalog.setval('users_id_seq', 45, true);
--
-- Name: reviews_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace:
--
ALTER TABLE ONLY reviews
ADD CONSTRAINT reviews_pkey PRIMARY KEY (id);
--
-- Name: rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace:
--
ALTER TABLE ONLY rooms
ADD CONSTRAINT rooms_pkey PRIMARY KEY (id);
--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace:
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: public; Type: ACL; Schema: -; Owner: epicodus
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM epicodus;
GRANT ALL ON SCHEMA public TO epicodus;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
|
CREATE DATABASE bootcampx;
|
delete from HtmlLabelIndex where id=21393
/
delete from HtmlLabelInfo where indexid=21393
/
INSERT INTO HtmlLabelIndex values(21393,'节点属性')
/
INSERT INTO HtmlLabelInfo VALUES(21393,'节点属性',7)
/
INSERT INTO HtmlLabelInfo VALUES(21393,'Node attribute',8)
/
delete from HtmlLabelIndex where id=21394
/
delete from HtmlLabelInfo where indexid=21394
/
INSERT INTO HtmlLabelIndex values(21394,'分叉起始点')
/
INSERT INTO HtmlLabelInfo VALUES(21394,'分叉起始点',7)
/
INSERT INTO HtmlLabelInfo VALUES(21394,'Bifurcation starting point',8)
/
delete from HtmlLabelIndex where id=21395
/
delete from HtmlLabelInfo where indexid=21395
/
INSERT INTO HtmlLabelIndex values(21395,'分叉中间点')
/
INSERT INTO HtmlLabelInfo VALUES(21395,'分叉中间点',7)
/
INSERT INTO HtmlLabelInfo VALUES(21395,'Bifurcation intermediate point',8)
/
delete from HtmlLabelIndex where id=21396
/
delete from HtmlLabelInfo where indexid=21396
/
INSERT INTO HtmlLabelIndex values(21396,'通过分支数合并')
/
INSERT INTO HtmlLabelInfo VALUES(21396,'通过分支数合并',7)
/
INSERT INTO HtmlLabelInfo VALUES(21396,'Through several branches of the merger',8)
/
delete from HtmlLabelIndex where id=21397
/
delete from HtmlLabelInfo where indexid=21397
/
INSERT INTO HtmlLabelIndex values(21397,'指定通过分支合并')
/
INSERT INTO HtmlLabelInfo VALUES(21397,'指定通过分支合并',7)
/
INSERT INTO HtmlLabelInfo VALUES(21397,'Through designated branches of the merger',8)
/
delete from HtmlLabelIndex where id=21398
/
delete from HtmlLabelInfo where indexid=21398
/
INSERT INTO HtmlLabelIndex values(21398,'必须通过')
/
INSERT INTO HtmlLabelInfo VALUES(21398,'必须通过',7)
/
INSERT INTO HtmlLabelInfo VALUES(21398,'Must pass',8)
/
delete from HtmlLabelIndex where id=21399
/
delete from HtmlLabelInfo where indexid=21399
/
INSERT INTO HtmlLabelIndex values(21399,'等待合并')
/
INSERT INTO HtmlLabelInfo VALUES(21399,'等待合并',7)
/
INSERT INTO HtmlLabelInfo VALUES(21399,'Wait for the merger',8)
/
|
-- phpMyAdmin SQL Dump
-- version 4.2.7
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 16-10-2014 a las 05:15:12
-- Versión del servidor: 5.5.34
-- Versión de PHP: 5.5.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de datos: `Adhesivos_new`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `ClientesProovedores`
--
CREATE TABLE IF NOT EXISTS `ClientesProovedores` (
`id` int(10) unsigned NOT NULL,
`rfc` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`razonsocial` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`calle` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`noexterior` int(11) NOT NULL,
`nointerior` int(11) NOT NULL,
`colonia` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`delegacionmunicipio` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ciudad` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`estado` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`cp` int(11) NOT NULL,
`referenciasubicacion` text COLLATE utf8_unicode_ci NOT NULL,
`contacto` int(10) unsigned NOT NULL,
`tipo` enum('Cliente','Proveedor') 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `CobroPendientes`
--
CREATE TABLE IF NOT EXISTS `CobroPendientes` (
`id` int(10) unsigned NOT NULL,
`tipo` enum('Factura-e','Factura','Nota') COLLATE utf8_unicode_ci NOT NULL,
`folio` int(11) NOT NULL,
`monto` float(8,2) NOT NULL,
`fechapago` date NOT NULL,
`noreferenciacheque` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Compra`
--
CREATE TABLE IF NOT EXISTS `Compra` (
`id` int(10) unsigned NOT NULL,
`tipo` enum('Factura-e','Factura','Nota') COLLATE utf8_unicode_ci NOT NULL,
`foliofactura` int(11) NOT NULL,
`fecha` date NOT NULL,
`hora` time NOT NULL,
`descuento` float(8,2) NOT NULL,
`formapago` int(10) unsigned NOT NULL,
`condicionpago` int(10) unsigned NOT NULL,
`comprador` int(10) unsigned NOT NULL,
`proveedor` int(10) unsigned NOT NULL,
`nopedido` int(11) NOT NULL,
`observacionesgenerales` text COLLATE utf8_unicode_ci NOT NULL,
`concepto` int(10) unsigned NOT NULL,
`subtotal` float(8,2) NOT NULL,
`iva` float(8,2) NOT NULL,
`total` float(8,2) NOT NULL,
`status` tinyint(1) 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Concepto`
--
CREATE TABLE IF NOT EXISTS `Concepto` (
`id` int(10) unsigned NOT NULL,
`producto` int(10) unsigned NOT NULL,
`cantidad` int(11) NOT NULL,
`descuento` int(11) NOT NULL,
`noenvases` int(11) NOT NULL,
`facturapor` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`preciobase` float(8,2) NOT NULL,
`preciounitario` float(8,2) NOT NULL,
`subtotalconcepto` float(8,2) 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `CondicionPago`
--
CREATE TABLE IF NOT EXISTS `CondicionPago` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`diascredito` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `CorteInventario`
--
CREATE TABLE IF NOT EXISTS `CorteInventario` (
`id` int(10) unsigned NOT NULL,
`fecha` date NOT NULL,
`hora` time NOT NULL,
`observaciones` text COLLATE utf8_unicode_ci NOT NULL,
`producto` int(10) unsigned NOT NULL,
`cantidadcontada` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `DatosContacto`
--
CREATE TABLE IF NOT EXISTS `DatosContacto` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`apppaterno` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`appmaterno` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`genero` enum('masculino','femenino') COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`telefonos` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `FormasPago`
--
CREATE TABLE IF NOT EXISTS `FormasPago` (
`id` int(10) unsigned NOT NULL,
`nombre` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Gasto`
--
CREATE TABLE IF NOT EXISTS `Gasto` (
`id` int(10) unsigned NOT NULL,
`monto` float(8,2) NOT NULL,
`fecha` date NOT NULL,
`rubro` int(10) unsigned NOT NULL,
`rfc` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`concepto` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`usuario` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Inventario`
--
CREATE TABLE IF NOT EXISTS `Inventario` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`clave` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`fecha` date NOT NULL,
`cantidad` int(11) NOT NULL,
`comprado` int(11) NOT NULL,
`vendido` int(11) NOT NULL,
`total` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE IF NOT EXISTS `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`migration`, `batch`) VALUES
('2014_09_07_174928_create_Presentacion_table', 1),
('2014_09_07_174949_create_Usuarios_table', 1),
('2014_09_07_175006_create_RubrosGasto_table', 1),
('2014_09_07_175021_create_FormasPago_table', 1),
('2014_09_07_175034_create_CondicionPago_table', 1),
('2014_09_07_175107_create_CobroPendientes_table', 1),
('2014_09_07_175121_create_Telefonos_table', 1),
('2014_09_07_175145_create_Inventario_table', 1),
('2014_09_07_191415_create_Pendientes_table', 1),
('2014_09_07_192100_create_Producto_table', 1),
('2014_09_07_192113_create_Gasto_table', 1),
('2014_09_07_192128_create_PrecioEnvase_table', 1),
('2014_09_07_192153_create_DatosContacto_table', 1),
('2014_09_07_195040_create_PrecioProducto_table', 1),
('2014_09_07_195102_create_CorteInventario_table', 1),
('2014_09_07_202539_create_Concepto_table', 1),
('2014_09_07_202707_create_ClientesProovedores_table', 1),
('2014_09_07_203222_create_Venta_table', 1),
('2014_09_07_203240_create_Compra_table', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Pendientes`
--
CREATE TABLE IF NOT EXISTS `Pendientes` (
`id` int(10) unsigned NOT NULL,
`fecha_limite` date NOT NULL,
`descripcion` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`estado` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`respuesta` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`responsable` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `PrecioEnvase`
--
CREATE TABLE IF NOT EXISTS `PrecioEnvase` (
`id` int(10) unsigned NOT NULL,
`presentacion` int(10) unsigned NOT NULL,
`fecha` date NOT NULL,
`divisa` enum('pesos','dlls') COLLATE utf8_unicode_ci NOT NULL,
`preciocompra` float(8,2) NOT NULL,
`precioventa` float(8,2) 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `PrecioProducto`
--
CREATE TABLE IF NOT EXISTS `PrecioProducto` (
`id` int(10) unsigned NOT NULL,
`producto` int(10) unsigned NOT NULL,
`fecha` date NOT NULL,
`divisa` enum('pesos','dlls') COLLATE utf8_unicode_ci NOT NULL,
`preciocompra` float(8,2) NOT NULL,
`precioventa` float(8,2) 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Presentacion`
--
CREATE TABLE IF NOT EXISTS `Presentacion` (
`id` int(10) unsigned NOT NULL,
`nombre` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Producto`
--
CREATE TABLE IF NOT EXISTS `Producto` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`clave` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`descripcion` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`medida` enum('Peso','Volumen','Pieza') COLLATE utf8_unicode_ci NOT NULL,
`presentacion` int(10) unsigned NOT NULL,
`cantidad` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `RubrosGasto`
--
CREATE TABLE IF NOT EXISTS `RubrosGasto` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`descripcion` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Telefonos`
--
CREATE TABLE IF NOT EXISTS `Telefonos` (
`id` int(10) unsigned NOT NULL,
`telefono` int(11) NOT NULL,
`celular` int(11) NOT NULL,
`nextel` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Usuarios`
--
CREATE TABLE IF NOT EXISTS `Usuarios` (
`id` int(10) unsigned NOT NULL,
`nombre` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`direccion` text COLLATE utf8_unicode_ci NOT NULL,
`noexterior` int(11) NOT NULL,
`nointerior` int(11) NOT NULL,
`colonia` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`delegacionmunicipio` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`ciudad` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`estado` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`cp` int(11) NOT NULL,
`refereniasubicacion` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`telefono` int(11) NOT NULL,
`tipousuario` enum('admin','user') COLLATE utf8_unicode_ci NOT NULL,
`nombreusuario` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Venta`
--
CREATE TABLE IF NOT EXISTS `Venta` (
`id` int(10) unsigned NOT NULL,
`tipo` enum('Factura-e','Factura','Nota') COLLATE utf8_unicode_ci NOT NULL,
`folio` int(11) NOT NULL,
`fecha` date NOT NULL,
`fecha_vencimiento` date NOT NULL,
`fecha_ultimo_cobro` date NOT NULL,
`hora` time NOT NULL,
`descuento_global` float(8,2) NOT NULL,
`cliente` int(10) unsigned NOT NULL,
`cuenta_bancaria` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`forma_pago` int(10) unsigned NOT NULL,
`condicion_pago` int(10) unsigned NOT NULL,
`vendedor` int(10) unsigned NOT NULL,
`observaciones_generales` text COLLATE utf8_unicode_ci NOT NULL,
`concepto` int(10) unsigned NOT NULL,
`no_pedido` int(11) NOT NULL,
`fecha_embarque` date NOT NULL,
`direccion_embarque` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`observaciones_embarque` text COLLATE utf8_unicode_ci NOT NULL,
`subtotal` float(8,2) NOT NULL,
`iva` float(8,2) NOT NULL,
`total` float(8,2) NOT NULL,
`total_cobrado` float(8,2) NOT NULL,
`estatus` tinyint(1) NOT NULL,
`cancelado` tinyint(1) 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `ClientesProovedores`
--
ALTER TABLE `ClientesProovedores`
ADD PRIMARY KEY (`id`), ADD KEY `clientesproovedores_contacto_foreign` (`contacto`);
--
-- Indices de la tabla `CobroPendientes`
--
ALTER TABLE `CobroPendientes`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Compra`
--
ALTER TABLE `Compra`
ADD PRIMARY KEY (`id`), ADD KEY `compra_formapago_foreign` (`formapago`), ADD KEY `compra_condicionpago_foreign` (`condicionpago`), ADD KEY `compra_comprador_foreign` (`comprador`), ADD KEY `compra_proveedor_foreign` (`proveedor`), ADD KEY `compra_concepto_foreign` (`concepto`);
--
-- Indices de la tabla `Concepto`
--
ALTER TABLE `Concepto`
ADD PRIMARY KEY (`id`), ADD KEY `concepto_producto_foreign` (`producto`);
--
-- Indices de la tabla `CondicionPago`
--
ALTER TABLE `CondicionPago`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `CorteInventario`
--
ALTER TABLE `CorteInventario`
ADD PRIMARY KEY (`id`), ADD KEY `corteinventario_producto_foreign` (`producto`);
--
-- Indices de la tabla `DatosContacto`
--
ALTER TABLE `DatosContacto`
ADD PRIMARY KEY (`id`), ADD KEY `datoscontacto_telefonos_foreign` (`telefonos`);
--
-- Indices de la tabla `FormasPago`
--
ALTER TABLE `FormasPago`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Gasto`
--
ALTER TABLE `Gasto`
ADD PRIMARY KEY (`id`), ADD KEY `gasto_rubro_foreign` (`rubro`), ADD KEY `gasto_usuario_foreign` (`usuario`);
--
-- Indices de la tabla `Inventario`
--
ALTER TABLE `Inventario`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Pendientes`
--
ALTER TABLE `Pendientes`
ADD PRIMARY KEY (`id`), ADD KEY `pendientes_responsable_foreign` (`responsable`);
--
-- Indices de la tabla `PrecioEnvase`
--
ALTER TABLE `PrecioEnvase`
ADD PRIMARY KEY (`id`), ADD KEY `precioenvase_presentacion_foreign` (`presentacion`);
--
-- Indices de la tabla `PrecioProducto`
--
ALTER TABLE `PrecioProducto`
ADD PRIMARY KEY (`id`), ADD KEY `precioproducto_producto_foreign` (`producto`);
--
-- Indices de la tabla `Presentacion`
--
ALTER TABLE `Presentacion`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Producto`
--
ALTER TABLE `Producto`
ADD PRIMARY KEY (`id`), ADD KEY `producto_presentacion_foreign` (`presentacion`);
--
-- Indices de la tabla `RubrosGasto`
--
ALTER TABLE `RubrosGasto`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Telefonos`
--
ALTER TABLE `Telefonos`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Usuarios`
--
ALTER TABLE `Usuarios`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `Venta`
--
ALTER TABLE `Venta`
ADD PRIMARY KEY (`id`), ADD KEY `venta_concepto_foreign` (`concepto`), ADD KEY `venta_cliente_foreign` (`cliente`), ADD KEY `venta_forma_pago_foreign` (`forma_pago`), ADD KEY `venta_condicion_pago_foreign` (`condicion_pago`), ADD KEY `venta_vendedor_foreign` (`vendedor`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `ClientesProovedores`
--
ALTER TABLE `ClientesProovedores`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `CobroPendientes`
--
ALTER TABLE `CobroPendientes`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Compra`
--
ALTER TABLE `Compra`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Concepto`
--
ALTER TABLE `Concepto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `CondicionPago`
--
ALTER TABLE `CondicionPago`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `CorteInventario`
--
ALTER TABLE `CorteInventario`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `DatosContacto`
--
ALTER TABLE `DatosContacto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `FormasPago`
--
ALTER TABLE `FormasPago`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Gasto`
--
ALTER TABLE `Gasto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Inventario`
--
ALTER TABLE `Inventario`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Pendientes`
--
ALTER TABLE `Pendientes`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `PrecioEnvase`
--
ALTER TABLE `PrecioEnvase`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `PrecioProducto`
--
ALTER TABLE `PrecioProducto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Presentacion`
--
ALTER TABLE `Presentacion`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Producto`
--
ALTER TABLE `Producto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `RubrosGasto`
--
ALTER TABLE `RubrosGasto`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Telefonos`
--
ALTER TABLE `Telefonos`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Usuarios`
--
ALTER TABLE `Usuarios`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `Venta`
--
ALTER TABLE `Venta`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `ClientesProovedores`
--
ALTER TABLE `ClientesProovedores`
ADD CONSTRAINT `clientesproovedores_contacto_foreign` FOREIGN KEY (`contacto`) REFERENCES `DatosContacto` (`id`);
--
-- Filtros para la tabla `Compra`
--
ALTER TABLE `Compra`
ADD CONSTRAINT `compra_concepto_foreign` FOREIGN KEY (`concepto`) REFERENCES `Concepto` (`id`),
ADD CONSTRAINT `compra_comprador_foreign` FOREIGN KEY (`comprador`) REFERENCES `ClientesProovedores` (`id`),
ADD CONSTRAINT `compra_condicionpago_foreign` FOREIGN KEY (`condicionpago`) REFERENCES `CondicionPago` (`id`),
ADD CONSTRAINT `compra_formapago_foreign` FOREIGN KEY (`formapago`) REFERENCES `FormasPago` (`id`),
ADD CONSTRAINT `compra_proveedor_foreign` FOREIGN KEY (`proveedor`) REFERENCES `ClientesProovedores` (`id`);
--
-- Filtros para la tabla `Concepto`
--
ALTER TABLE `Concepto`
ADD CONSTRAINT `concepto_producto_foreign` FOREIGN KEY (`producto`) REFERENCES `Producto` (`id`);
--
-- Filtros para la tabla `CorteInventario`
--
ALTER TABLE `CorteInventario`
ADD CONSTRAINT `corteinventario_producto_foreign` FOREIGN KEY (`producto`) REFERENCES `Producto` (`id`);
--
-- Filtros para la tabla `DatosContacto`
--
ALTER TABLE `DatosContacto`
ADD CONSTRAINT `datoscontacto_telefonos_foreign` FOREIGN KEY (`telefonos`) REFERENCES `Telefonos` (`id`);
--
-- Filtros para la tabla `Gasto`
--
ALTER TABLE `Gasto`
ADD CONSTRAINT `gasto_usuario_foreign` FOREIGN KEY (`usuario`) REFERENCES `Usuarios` (`id`),
ADD CONSTRAINT `gasto_rubro_foreign` FOREIGN KEY (`rubro`) REFERENCES `RubrosGasto` (`id`);
--
-- Filtros para la tabla `Pendientes`
--
ALTER TABLE `Pendientes`
ADD CONSTRAINT `pendientes_responsable_foreign` FOREIGN KEY (`responsable`) REFERENCES `Usuarios` (`id`);
--
-- Filtros para la tabla `PrecioEnvase`
--
ALTER TABLE `PrecioEnvase`
ADD CONSTRAINT `precioenvase_presentacion_foreign` FOREIGN KEY (`presentacion`) REFERENCES `Presentacion` (`id`);
--
-- Filtros para la tabla `PrecioProducto`
--
ALTER TABLE `PrecioProducto`
ADD CONSTRAINT `precioproducto_producto_foreign` FOREIGN KEY (`producto`) REFERENCES `Producto` (`id`);
--
-- Filtros para la tabla `Producto`
--
ALTER TABLE `Producto`
ADD CONSTRAINT `producto_presentacion_foreign` FOREIGN KEY (`presentacion`) REFERENCES `Presentacion` (`id`);
--
-- Filtros para la tabla `Venta`
--
ALTER TABLE `Venta`
ADD CONSTRAINT `venta_vendedor_foreign` FOREIGN KEY (`vendedor`) REFERENCES `Usuarios` (`id`),
ADD CONSTRAINT `venta_cliente_foreign` FOREIGN KEY (`cliente`) REFERENCES `ClientesProovedores` (`id`),
ADD CONSTRAINT `venta_concepto_foreign` FOREIGN KEY (`concepto`) REFERENCES `Concepto` (`id`),
ADD CONSTRAINT `venta_condicion_pago_foreign` FOREIGN KEY (`condicion_pago`) REFERENCES `CondicionPago` (`id`),
ADD CONSTRAINT `venta_forma_pago_foreign` FOREIGN KEY (`forma_pago`) REFERENCES `FormasPago` (`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 */;
|
DROP PROCEDURE IF EXISTS get_comment_images;
DELIMITER ;;
CREATE DEFINER=web@localhost PROCEDURE get_comment_images(IN $cid INT)
COMMENT 'get images for a given node'
BEGIN
SELECT id, name, path FROM images WHERE cid = $cid ORDER BY id ASC;
END ;;
DELIMITER ;
|
delete from HtmlLabelIndex where id=19436
/
delete from HtmlLabelInfo where indexid=19436
/
INSERT INTO HtmlLabelIndex values(19436,'本分部及下级分部')
/
INSERT INTO HtmlLabelInfo VALUES(19436,'本分部及下级分部',7)
/
INSERT INTO HtmlLabelInfo VALUES(19436,'the subcompany and lower subcompany',8)
/
INSERT INTO HtmlLabelInfo VALUES(19436,'本分部及下級分部',9)
/
delete from HtmlLabelIndex where id=27189
/
delete from HtmlLabelInfo where indexid=27189
/
INSERT INTO HtmlLabelIndex values(27189,'本分部及上级分部')
/
INSERT INTO HtmlLabelInfo VALUES(27189,'本分部及上级分部',7)
/
INSERT INTO HtmlLabelInfo VALUES(27189,'The Division and the superior division',8)
/
INSERT INTO HtmlLabelInfo VALUES(27189,'本分部及上級分部',9)
/ |
delete from HtmlLabelIndex where id=24098
/
delete from HtmlLabelInfo where indexid=24098
/
INSERT INTO HtmlLabelIndex values(24098,'缴库日期')
/
INSERT INTO HtmlLabelInfo VALUES(24098,'缴库日期',7)
/
INSERT INTO HtmlLabelInfo VALUES(24098,'Return date',8)
/
INSERT INTO HtmlLabelInfo VALUES(24098,'缴库日期',9)
/
delete from HtmlLabelIndex where id=24092
/
delete from HtmlLabelInfo where indexid=24092
/
INSERT INTO HtmlLabelIndex values(24092,'净值')
/
delete from HtmlLabelIndex where id=24091
/
delete from HtmlLabelInfo where indexid=24091
/
INSERT INTO HtmlLabelIndex values(24091,'申请报废日期')
/
INSERT INTO HtmlLabelInfo VALUES(24091,'申请报废日期',7)
/
INSERT INTO HtmlLabelInfo VALUES(24091,'Date of application for retirement',8)
/
INSERT INTO HtmlLabelInfo VALUES(24091,'申請報廢日期',9)
/
INSERT INTO HtmlLabelInfo VALUES(24092,'净值',7)
/
INSERT INTO HtmlLabelInfo VALUES(24092,'Net',8)
/
INSERT INTO HtmlLabelInfo VALUES(24092,'净值',9)
/
delete from HtmlLabelIndex where id=24093
/
delete from HtmlLabelInfo where indexid=24093
/
INSERT INTO HtmlLabelIndex values(24093,'残值')
/
INSERT INTO HtmlLabelInfo VALUES(24093,'残值',7)
/
INSERT INTO HtmlLabelInfo VALUES(24093,'Residual',8)
/
INSERT INTO HtmlLabelInfo VALUES(24093,'残值',9)
/
delete from HtmlLabelIndex where id=24097
/
delete from HtmlLabelInfo where indexid=24097
/
INSERT INTO HtmlLabelIndex values(24097,'原使用人')
/
INSERT INTO HtmlLabelInfo VALUES(24097,'原使用人',7)
/
INSERT INTO HtmlLabelInfo VALUES(24097,'The original user',8)
/
INSERT INTO HtmlLabelInfo VALUES(24097,'原使用人',9)
/
|
--Manuel A. Bolanos-Tapia
--Question 1
CREATE OR REPLACE PROCEDURE COUNTRY_DEMOGRAPHICS
(p_name IN OUT countries.country_name%type,
c_location OUT countries.location%type,
c_capitol OUT countries.capitol%type,
c_population OUT countries.population%type,
c_airports OUT countries.airports%type,
c_climate OUT countries.climate%type,
c_error OUT VARCHAR2)
AS
lv_name countries.country_name%type;
lv_loc countries.location%type;
lv_cap countries.capitol%type;
lv_pop countries.population%type;
lv_air countries.airports%type;
lv_cli countries.climate%type;
BEGIN
select country_name, location, capitol, population, airports, climate
into lv_name, lv_loc, lv_cap, lv_pop, lv_air, lv_cli
from countries
where UPPER(country_name) = UPPER(p_name);
if lv_name = p_name then
p_name := lv_name;
c_location := lv_loc;
c_capitol := lv_cap;
c_population := lv_pop;
c_airports := lv_air;
c_climate := lv_cli;
c_error := ' ';
ELSE c_error := 'something went wrong';
end if;
exception
when no_data_found then
c_error:='Country Does Not Exist';
END COUNTRY_DEMOGRAPHICS;
DECLARE
lv_name countries.country_name%type;
lv_location countries.location%type;
lv_capitol countries.capitol%type;
lv_population countries.population%type;
lv_airports countries.airports%type;
lv_climate countries.climate%type;
lv_error VARCHAR(30);
BEGIN
lv_name:='&country';
country_demographics(lv_name,lv_location,lv_capitol,lv_population,lv_airports,lv_climate,lv_error);
DBMS_OUTPUT.PUT_LINE(lv_error);
DBMS_OUTPUT.PUT_LINE('Country Name: '||lv_name);
DBMS_OUTPUT.PUT_LINE('Location: '||lv_location);
DBMS_OUTPUT.PUT_LINE('Capitol: '||lv_capitol);
DBMS_OUTPUT.PUT_LINE('Population: '||lv_population);
DBMS_OUTPUT.PUT_LINE('Airports: '||lv_airports);
DBMS_OUTPUT.PUT_LINE('Climate: '||lv_climate);
END;
--Question 2
--Question 3
CREATE OR REPLACE PROCEDURE CALC_AIRPORTS_PER_PERSON
(a_name IN countries.country_name%type,
a_airport OUT NUMBER,
a_error OUT VARCHAR2)
AS
lv_airports countries.airports%type;
lv_pop countries.population%type;
BEGIN
select airports, population
into lv_airports, lv_pop
from countries
where UPPER(country_name) = UPPER(a_name);
a_airport := (lv_airports/lv_pop);
exception
when NO_DATA_FOUND then
a_error := 'There was no data found';
END CALC_AIRPORTS_PER_PERSON;
DECLARE
lv_name countries.country_name%type;
lv_airport NUMBER(12,2);
lv_error VARCHAR2(30);
BEGIN
lv_name := '&Country';
calc_airports_per_person(lv_name, lv_airport, lv_error);
DBMS_OUTPUT.PUT_LINE('Country: '||lv_name);
DBMS_OUTPUT.PUT_LINE('Airports per Person: '||lv_airport);
END;
--Question 4
CREATE OR REPLACE PROCEDURE ADD_SPOKEN_LANGUAGE
(s_cid IN spoken_languages.country_id%type,
s_lid IN spoken_languages.language_id%type,
s_off in SPOKEN_LANGUAGES.official%type,
s_com in spoken_languages.comments%type)
AS
BEGIN
insert into SPOKEN_LANGUAGES (country_id, language_id, official, comments)
values (s_cid, s_lid, s_off, s_com);
END ADD_SPOKEN_LANGUAGE;
DECLARE
lv_cid SPOKEN_LANGUAGES.COUNTRY_ID%type;
lv_lid SPOKEN_LANGUAGES.LANGUAGE_ID%type;
lv_off SPOKEN_LANGUAGES.OFFICIAL%type;
lv_com SPOKEN_LANGUAGES.COMMENTS%type;
BEGIN
lv_cid := '&Country';
lv_lid := '&Language';
lv_off := '&Official';
lv_com := '&Comments';
add_spoken_language(lv_cid,lv_lid,lv_off,lv_com);
END; |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 23, 2021 at 12:03 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sms`
--
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
DROP TABLE IF EXISTS `student`;
CREATE TABLE IF NOT EXISTS `student` (
`reg_number` varchar(255) NOT NULL,
`course_name` varchar(255) NOT NULL,
`first_name` varchar(255) NOT NULL,
`second_name` varchar(255) NOT NULL,
`email_address` varchar(255) NOT NULL,
`physical_address` varchar(255) NOT NULL,
`mobile_number` varchar(255) NOT NULL,
`gender` varchar(255) NOT NULL,
`date_of_birth` varchar(255) NOT NULL,
PRIMARY KEY (`reg_number`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `student`
--
INSERT INTO `student` (`reg_number`, `course_name`, `first_name`, `second_name`, `email_address`, `physical_address`, `mobile_number`, `gender`, `date_of_birth`) VALUES
('ENC 221-347/2030', 'Law', 'Carmilla', 'Dunkin', 'camie@students.ac.ke', 'Buruburu,Nairobi', '076969666', 'female', '01/08/2006'),
('ENC221-579/2030', 'Animal Husbandry', 'Charlotte', 'Okech', 'akothee@gmail.com', 'Narok', '0734567890', 'Female', '01/08/1999'),
('ENE 221-600.2021', 'Medicine', 'Nathan', 'Kangogo', 'nathan@students.ac.ke', 'Nairobi,Nairobi', '0733668811', 'male', '01/04/1995'),
('ENE 347-0100/2021', 'Criminology', 'Austine', 'David', 'austo@students.co.ke', 'Kahawa,Kiambu', '0788995522', 'male', '01/06/1996'),
('ENE221-0555/2018', 'Biosystems Engineering', 'Samuel', 'Odawo', 'odawo267@gmail.com', 'Thika,Kiambu', '0722448899', 'male', '01/03/1995'),
('ENE221-340/2021', 'Telecomms', 'sheila', 'Ndunge', 'sheila2students.ac.ke', 'Kathonzweni,Ukambani', '0712345678', 'female', '01/01/1995'),
('ENE221-507/2018', 'Computer Science', 'Jacob', 'Oyim', 'oyim254@gamil.com', 'Juja,Kiambu', '0722478956', 'male', '01/02/1995'),
('HRD 224-0100/2024', 'Artificial Intelligence', 'Janet', 'Henry', 'janet@students.ac.ke', 'Ruiru,Kiambu', '0789563425', 'female', '01/6/1996');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`username`, `password`) VALUES
('sheila', 'sheila2000'),
('nathan', 'nathan2000');
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE DATABASE enriquevs;
USE enriquevs;
CREATE TABLE Track (
Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(200) NOT NULL,
Length INT(3)
);
CREATE TABLE Album (
Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(200) NOT NULL,
TrackId INT,
FOREIGN KEY (TrackId) REFERENCES Track(Id)
);
CREATE TABLE Artist (
Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(200) NOT NULL,
AlbumId INT,
FOREIGN KEY (AlbumId) REFERENCES Album(Id)
);
CREATE TABLE Collection (
Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(200) NOT NULL,
ArtistId INT,
FOREIGN KEY (ArtistId) REFERENCES Artist(Id)
);
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 13, 2020 at 07:06 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `dufma`
--
-- --------------------------------------------------------
--
-- Table structure for table `dufma_investment`
--
CREATE TABLE `dufma_investment` (
`s/n` int(10) NOT NULL,
`name_investor` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`category` varchar(255) NOT NULL,
`dura_invest` int(255) NOT NULL,
`unit` int(10) NOT NULL,
`v_unit` int(255) NOT NULL,
`roi` int(255) NOT NULL,
`roi_starts` varchar(255) NOT NULL,
`m_uic` varchar(255) NOT NULL,
`adv_ticket` varchar(255) NOT NULL,
`erp` varchar(255) NOT NULL,
`investor_feature` varchar(255) NOT NULL,
`live_training` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`confirm_password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `dufma_investment`
--
INSERT INTO `dufma_investment` (`s/n`, `name_investor`, `email`, `phone`, `category`, `dura_invest`, `unit`, `v_unit`, `roi`, `roi_starts`, `m_uic`, `adv_ticket`, `erp`, `investor_feature`, `live_training`, `password`, `confirm_password`) VALUES
(45, 'gbenda', 'adex@gmail.com', '09022233344', 'Silver', 1, 1, 25000, 20, '20%', '25, 000', '2', '2', 'Investor feature', '', '', ''),
(46, 'sulaimon ogundimu', 'abolajic@gmail.com', '08039412009', 'Silver', 1, 1, 25000, 20, '20%', '25, 000', '2', '2', 'Investor feature', '', '', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `dufma_investment`
--
ALTER TABLE `dufma_investment`
ADD PRIMARY KEY (`s/n`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `dufma_investment`
--
ALTER TABLE `dufma_investment`
MODIFY `s/n` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;
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 */;
|
-- Upgrade script for disks.
UPDATE disks
SET disk_alias = vm_name || '_DISK' || disks.internal_drive_mapping
FROM vm_static, images, vm_device
WHERE vm_device.vm_id = vm_static.vm_guid
AND vm_device.device_id = images.image_group_id
AND disks.disk_id = images.image_group_id
AND disks.disk_alias IS NULL;
|
CREATE TABLE users (
id SERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
username VARCHAR(50) NOT NULL UNIQUE,
password TEXT NOT NULL,
email TEXT NOT NULL UNIQUE CHECK (POSITION('@' IN email) > 1),
profile_picture TEXT,
date_of_birth DATE,
goal INTEGER,
genre_interest TEXT[],
pw_reset_token TEXT,
pw_reset_token_exp TIMESTAMP,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE ratings_and_reviews (
id SERIAL PRIMARY KEY,
rating REAL NOT NULL CHECK (rating > 0 AND rating <= 5),
review_title VARCHAR(150) NOT NULL,
review_body TEXT, --VARCHAR(500) -- optional limiting of characters
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
book_id TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
-- PRIMARY KEY (book_id, user_id) -- making sure users can only review a book once
);
CREATE TABLE reviews_replies (
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
rating_id INTEGER REFERENCES ratings_and_reviews(id) ON DELETE CASCADE,
reply_body TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE lists (
id SERIAL PRIMARY KEY,
list_name VARCHAR(50) NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
image TEXT,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE list_contents (
id SERIAL PRIMARY KEY,
list_id INTEGER REFERENCES lists(id) ON DELETE CASCADE,
book_id TEXT NOT NULL,
added_on TIMESTAMP DEFAULT NOW()
);
CREATE TABLE liked_authors (
id SERIAL PRIMARY KEY,
author_id TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE
);
CREATE TABLE forums (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
description TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
forum_id INTEGER REFERENCES forums(id) ON DELETE CASCADE,
post TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
vote INTEGER,
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE forums_replies (
id SERIAL PRIMARY KEY,
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE,
reply_body TEXT NOT NULL,
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP DEFAULT NOW()
); |
DROP PROCEDURE IF EXISTS `DBExerciseFileTypeGetSheetExerciseFileTypes`;
CREATE PROCEDURE `DBExerciseFileTypeGetSheetExerciseFileTypes` (IN esid INT)
READS SQL DATA
begin
SET @s = concat("
select SQL_CACHE
EX.EFT_id, EX.EFT_text, EX.E_id
from
ExerciseFileType EX
join Exercise E on (EX.E_id = E.E_id)
where
E.ES_id = '",esid,"';");
PREPARE stmt1 FROM @s;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
end; |
use gimnasio;
-- tabla provincia
Insert Into Provincia (Nombre) Values ('Buenos Aires');
-- tabla ciudad
Insert Into Ciudad (Nombre, provincia_id) Values ('Buenos Aires', 1);
Insert Into Ciudad (Nombre, provincia_id) Values ('Ramos Mejia', 1);
Insert Into Ciudad (Nombre, provincia_id) Values ('San Justo', 1);
-- tabla usuario select * from usuario;
insert into usuario(nick, password,rol)
value('admin','admin','admin');
insert into usuario(nick, password, rol)
value('mati', 'mati', 'socio');
insert into usuario(nick, password, rol)
value('lopez', 'lopez', 'socio');
insert into usuario(nick, password, rol)
value('ale', 'ale', 'socio');
insert into usuario(nick, password, rol)
value('op1', 'op1', 'operador');
insert into usuario(nick, password, rol)
value('op2', 'op2', 'operador');
insert into usuario(nick, password, rol)
value('op3', 'op3', 'operador');
-- tabla Operador
insert into Operador(apellido, nombre, usuario_id)
values('Alvarez', 'Miguel',5);
insert into Operador(apellido, nombre, usuario_id)
values('Martinez', 'Veronica',6);
insert into Operador(apellido, nombre, usuario_id)
values('Emma', 'Lee',7);
-- tabla sucursal
insert into Sucursal(calle, codPostal, nombre, numcalle, pais, ciudad_id, operador_id, provincia_id, lat, lng)
values('Avenida de mayo', '1704','Sucursal Ramos Mejia','1800','Argentina', 2, 1, 1, -34.65915,-58.5643008);
insert into Sucursal(calle, codPostal, nombre, numcalle, pais, ciudad_id, operador_id, provincia_id, lat, lng)
values('Maipu', '1006','Sucursal Centro','850','Argentina', 1, 2, 1,-34.5981557,-58.3790881);
insert into Sucursal(calle, codPostal, nombre, numcalle, pais, ciudad_id, operador_id, provincia_id, lat, lng)
values('Alvarado', '1704','Sucursal Alvarado','900','Argentina', 2, null, 1, -34.654, -58.5695);
insert into Sucursal(calle, codPostal, nombre, numcalle, pais, ciudad_id, operador_id, provincia_id, lat, lng)
values('Florencio Varela', '1704','Sucursal Florencio Varela','1903','Argentina', 3, null, 1, -34.6699, -58.5626);
-- update de tabla operador
update operador set sucursal_id= 1 where id = 1;
update operador set sucursal_id= 2 where id = 2;
-- tabla pase
insert into Pase(cantidadActividades, nombre, precio)
values(2,'Plan Inicial', 700);
insert into Pase(cantidadActividades, nombre, precio)
values(3,'Plan Basico', 800);
insert into Pase(cantidadActividades, nombre, precio)
values(10,'Plan Plus', 1200);
insert into Pase(cantidadActividades, nombre, precio)
values(null,'Plan Premiun', 1700);
insert into Pase(cantidadActividades, nombre, precio)
values(0,'Vacio', 0);
-- tabla socio
insert into Socio(apellido, dni, domicilioCalle, domicilioDepto, domicilioNumero, mail, nombre, telefono, ciudad_id, pase_id,sucursal_id, usuario_id)
values('Suarez', '29941591','oro',null,'1813', 'matisuarez@gmail.com', 'Matias', '1544896790',1, 1, 1, 2);
insert into Socio(apellido, dni, domicilioCalle, domicilioDepto, domicilioNumero, mail, nombre, telefono, ciudad_id, pase_id, sucursal_id, usuario_id)
values('Lopez', '40345678','suipacha',null,'300', 'jlopez@gmail.com', 'Julieta','1593457123',1, 4, 2, 3);
insert into Socio(apellido, dni, domicilioCalle, domicilioDepto, domicilioNumero, mail, nombre, telefono, ciudad_id, pase_id,sucursal_id, usuario_id)
values('Casus', '29941591','coro',null,'813', 'ale@gmail.com', 'Alejandra', '1544833390',1, 1, 1, 4);
-- tabla beneficio
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En cualquier producto de nuestra tienda','20% OFF','Adidas',4);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('Valido unicamente para indumentaria (no zapatillas)','20% OFF','Nike',4);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En todos los productos exceptuando lentes de contacto descartables y soluciones','30% OFF','Lof',4);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En mesas restaurante y sobre cubierto en salones privados para eventos','25% OFF','America Resto',4);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En plan de salud plata','15% OFF','Medife',4);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En cualquier producto de nuestra tienda','10% OFF','Adidas',3);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En mesas restaurante y sobre cubierto en salones privados para eventos','15% OFF','America Resto',3);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En plan de salud clasico','10% OFF','Medife',3);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('Solo valido para mesas restaurante','10% OFF','America Resto',2);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En planes de salud basico','5% OFF','Medife',2);
insert into Beneficio (descripcion, descuento, nombre, pase_id)
values('En mesas restaurante','5% OFF','America Resto',1);
-- tabla actividad
insert into actividad(nombre, descripcion) values ('Pilates', 'El método Pilates es un sistema de ejercicios apto para todas las edades y condiciones físicas, orientado a la flexibilidad y tonificación corporal, modelando la figura y estilizando la musculatura.');
insert into actividad(nombre, descripcion) values ('Natacion', 'Genera un importante fortalecimiento cordiopulmonar, reduciendo el riesgo de enfermedades cardiovasculares y estimulando la circulación sanguínea.');
insert into actividad(nombre, descripcion) values ('Yoga','Esta clase basada en la disciplina india, incluye posturas de yoga, ejercicios de respiración y relajación con el objetivo de brindarle atención a tu cuerpo y a tu mente.');
insert into actividad(nombre, descripcion) values ('Spinning','Mejora el sistema cardiovascular y pulmonar. Disminuye la grasa corporal, ya que ayuda a quemar muchas calorías.');
insert into Actividad(nombre, descripcion) values ('Crossfit', 'Preparate para romper tus límites. Crossfit es el entrenamiento diseñado a la medida de tu cuerpo: +Agilidad +Fuerza +Resistencia +Coordinación');
insert into Actividad(nombre, descripcion) values ('Cardio Funcional' ,'Mejora la salud del corazón, aumenta la capacidad de usar oxígeno y la capacidad pulmonar.');
insert into Actividad(nombre, descripcion) values ('Boxeo','Orientado a mejorar las capacidades físicas para lograr un mejor rendimiento. Tiene como principal objetivo el entrenamiento del movimiento del cuerpo en todos sus ejes y en sus rangos de movimiento natural.');
insert into Actividad(nombre, descripcion) values ('Fitness', 'Brinda mayor elasticidad a la musculatura, mejorando la postura y aliviando dolores musculares, de espalda, al fortalecer el anillo muscular a nivel de la columna lumbar.');
insert into Actividad(nombre, descripcion) values ('Zumba','Esta entretenida clase propone distintos ritmos bailables latinos como el axé, brasilero, etc.');
insert into Actividad(nombre, descripcion) values ('Musculacion', 'Mejora la fuerza y resistencia, desarrollando armónicamente todos los grupos musculares, previniendo lesiones.');
-- tabla profesor
insert into profesor(apellido, nombre)
values('Lopez','Maria');
insert into profesor(apellido, nombre)
values('Fernandez','Juan');
insert into profesor(apellido, nombre)
values('Rodriguez','Laura');
insert into profesor(apellido, nombre)
values('Castro','Diego');
insert into profesor(apellido, nombre)
values('Diaz','Luciano');
-- tabla sucursal actividad
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (5, 0,'Lunes','10','11',1,1,2);
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (2, 0,'Martes','8','9',2,2,2);
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (5, 0,'Miercoles','20','21',1,3,1);
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (2, 0,'Lunes','9','10',2,4,1);
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (10, 0,'Viernes','15','16',3,5,1);
insert into sucursalactividad (cupo, cupoActual, dia, horaDesde, horaHasta, actividad_id,profesor_id, sucursal_id)
values (15, 0,'Sabado','11','12',4,1,1);
-- tabla pago
insert into pago(fecha,importe,socio_idSocio,fechaVencimiento)
values('20180502', 1200.00,1,'20180602');
insert into pago(fecha,importe,socio_idSocio,fechaVencimiento)
values('20180505', 800.00,1,'20180605');
insert into pago(fecha,importe,socio_idSocio,fechaVencimiento)
values('20180615', 500.00,2,'20180715');
insert into pago(fecha,importe,socio_idSocio,fechaVencimiento)
values('20180625', 400.00,1,'20180725');
insert into pago(fecha,importe,socio_idSocio,fechaVencimiento)
values('20180425', 400.00,3,'20180525');
-- tabla pase_beneficio (ingreso para cuando se corre script a mano)
insert into pase_beneficio (pase_id, listaBeneficios_id)
values(1,11);
insert into pase_beneficio (pase_id, listaBeneficios_id)
values(2,9), (2,10);
insert into pase_beneficio (pase_id, listaBeneficios_id)
values(3,6),(3,7),(3,8);
insert into pase_beneficio (pase_id, listaBeneficios_id)
values(4,1),(4,2),(4,3),(4,4),(4,5);
-- table sucursal_socio(ingreso para cuando se corre script a mano)
insert into sucursal_socio (sucursal_id, listaSocios_idSocio)
value (1,1),(2,2);
-- Descuentos
insert into descuento (meses,descuento,porcentaje)
value(1,0,0.0);
insert into descuento (meses,descuento,porcentaje)
value(3,5,0.95);
insert into descuento (meses,descuento,porcentaje)
value(6,10,0.90);
insert into descuento (meses,descuento,porcentaje)
value(12,15,0.85);
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 05, 2019 at 02:43 AM
-- Server version: 5.7.27-0ubuntu0.16.04.1
-- PHP Version: 7.0.33-0ubuntu0.16.04.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `karnett`
--
-- --------------------------------------------------------
--
-- Table structure for table `consultation`
--
CREATE TABLE `consultation` (
`id` int(11) NOT NULL,
`intitule` varchar(255) NOT NULL,
`date` date NOT NULL,
`heure` time NOT NULL,
`diagnostic` text NOT NULL,
`personne` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `hopital`
--
CREATE TABLE `hopital` (
`id` int(11) NOT NULL,
`nom` varchar(255) NOT NULL,
`adresse` varchar(255) NOT NULL,
`contact` varchar(255) NOT NULL,
`mail` varchar(255) NOT NULL,
`BoitePostal` varchar(25) NOT NULL,
`Fax` varchar(255) NOT NULL,
`logo` varchar(255) NOT NULL,
`statut` enum('active','inactive') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `hopital`
--
INSERT INTO `hopital` (`id`, `nom`, `adresse`, `contact`, `mail`, `BoitePostal`, `Fax`, `logo`, `statut`) VALUES
(2, 'DENTEC', 'Dakar', '338258787', 'dentec@mail.com', '360', '1', 'logo', 'active');
-- --------------------------------------------------------
--
-- Table structure for table `migration`
--
CREATE TABLE `migration` (
`version` varchar(180) NOT NULL,
`apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `migration`
--
INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1567825870),
('m130524_201442_init', 1567825879),
('m190124_110200_add_verification_token_column_to_user_table', 1567825879);
-- --------------------------------------------------------
--
-- Table structure for table `personne`
--
CREATE TABLE `personne` (
`id` int(11) NOT NULL,
`nom` varchar(255) NOT NULL,
`prenom` varchar(255) NOT NULL,
`sexe` enum('M','F') NOT NULL,
`groupesanguin` enum('O+','O-','A+','A−','B+','B-','AB+','AB-') NOT NULL,
`naissance` date NOT NULL,
`matrimoniale` varchar(255) NOT NULL,
`profession` varchar(255) NOT NULL,
`specialite` varchar(255) NOT NULL,
`telephone` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`adresses` varchar(255) NOT NULL,
`date` datetime NOT NULL,
`TypePersonne` int(11) NOT NULL,
`service` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `prescription`
--
CREATE TABLE `prescription` (
`id` int(11) NOT NULL,
`date` datetime NOT NULL,
`description` text NOT NULL,
`Observation` text NOT NULL,
`typeprescription` int(11) NOT NULL,
`consultation` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `rdv`
--
CREATE TABLE `rdv` (
`id` int(11) NOT NULL,
`intitule` varchar(255) NOT NULL,
`date` date NOT NULL,
`heure` time NOT NULL,
`message` text NOT NULL,
`hopital` int(11) NOT NULL,
`personne` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `role`
--
CREATE TABLE `role` (
`id` int(11) NOT NULL,
`libelle` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `service`
--
CREATE TABLE `service` (
`id` int(11) NOT NULL,
`nom` varchar(255) NOT NULL,
`hopital` int(11) NOT NULL,
`statut` enum('active','inactive') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `service`
--
INSERT INTO `service` (`id`, `nom`, `hopital`, `statut`) VALUES
(2, 'Dialyse', 2, 'active');
-- --------------------------------------------------------
--
-- Table structure for table `typepersonne`
--
CREATE TABLE `typepersonne` (
`id` int(11) NOT NULL,
`libelle` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `typeprescrition`
--
CREATE TABLE `typeprescrition` (
`id` int(11) NOT NULL,
`libelle` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` smallint(6) NOT NULL DEFAULT '10',
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
`verification_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`profil` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `created_at`, `updated_at`, `verification_token`, `profil`) VALUES
(1, 'admin', 'O1r46Ac3lhcf54Y48K2QbTJ0LJS8-BFG', '$2y$13$pjX4Y6DVrKLacOp51Zeb8uvWLJMBlL87SJeiYeccD7gKz35FRmBAy', '7O96Bes9qz54KuNtX0tItPhQb5XyC5An_1572089206', 'rajerr2013@gmail.com', 10, 1567826024, 1572089206, 'Or08vKZXarAZVrrzH_7HwHdhPtHN-deL_1567826024', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `consultation`
--
ALTER TABLE `consultation`
ADD PRIMARY KEY (`id`),
ADD KEY `personne` (`personne`);
--
-- Indexes for table `hopital`
--
ALTER TABLE `hopital`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migration`
--
ALTER TABLE `migration`
ADD PRIMARY KEY (`version`);
--
-- Indexes for table `personne`
--
ALTER TABLE `personne`
ADD PRIMARY KEY (`id`),
ADD KEY `service` (`service`),
ADD KEY `TypePersonne` (`TypePersonne`);
--
-- Indexes for table `prescription`
--
ALTER TABLE `prescription`
ADD PRIMARY KEY (`id`),
ADD KEY `typeprescription` (`typeprescription`),
ADD KEY `consultation` (`consultation`);
--
-- Indexes for table `rdv`
--
ALTER TABLE `rdv`
ADD PRIMARY KEY (`id`),
ADD KEY `service` (`hopital`),
ADD KEY `personne` (`personne`);
--
-- Indexes for table `role`
--
ALTER TABLE `role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `service`
--
ALTER TABLE `service`
ADD PRIMARY KEY (`id`),
ADD KEY `code_hopital` (`hopital`);
--
-- Indexes for table `typepersonne`
--
ALTER TABLE `typepersonne`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `typeprescrition`
--
ALTER TABLE `typeprescrition`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `password_reset_token` (`password_reset_token`),
ADD KEY `personne` (`profil`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `consultation`
--
ALTER TABLE `consultation`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `hopital`
--
ALTER TABLE `hopital`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `personne`
--
ALTER TABLE `personne`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `prescription`
--
ALTER TABLE `prescription`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rdv`
--
ALTER TABLE `rdv`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `role`
--
ALTER TABLE `role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `service`
--
ALTER TABLE `service`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `typepersonne`
--
ALTER TABLE `typepersonne`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `typeprescrition`
--
ALTER TABLE `typeprescrition`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `consultation`
--
ALTER TABLE `consultation`
ADD CONSTRAINT `consultation_ibfk_1` FOREIGN KEY (`personne`) REFERENCES `personne` (`id`);
--
-- Constraints for table `personne`
--
ALTER TABLE `personne`
ADD CONSTRAINT `personne_ibfk_1` FOREIGN KEY (`service`) REFERENCES `service` (`id`),
ADD CONSTRAINT `personne_ibfk_2` FOREIGN KEY (`TypePersonne`) REFERENCES `typepersonne` (`id`);
--
-- Constraints for table `prescription`
--
ALTER TABLE `prescription`
ADD CONSTRAINT `prescription_ibfk_1` FOREIGN KEY (`consultation`) REFERENCES `consultation` (`id`),
ADD CONSTRAINT `prescription_ibfk_2` FOREIGN KEY (`typeprescription`) REFERENCES `typeprescrition` (`id`);
--
-- Constraints for table `rdv`
--
ALTER TABLE `rdv`
ADD CONSTRAINT `rdv_ibfk_2` FOREIGN KEY (`personne`) REFERENCES `personne` (`id`),
ADD CONSTRAINT `rdv_ibfk_3` FOREIGN KEY (`hopital`) REFERENCES `hopital` (`id`);
--
-- Constraints for table `service`
--
ALTER TABLE `service`
ADD CONSTRAINT `service_ibfk_1` FOREIGN KEY (`hopital`) REFERENCES `hopital` (`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 */;
|
CREATE TABLE BOARD (
seq INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
title VARCHAR(255) NOT NULL ,
content VARCHAR(1000) NOT NULL ,
writer VARCHAR(10) NOT NULL ,
password INT NOT NULL ,
regDate TIMESTAMP NOT NULL ,
cnt INT NOT NULL
); |
DELETE FROM student;
DELETE FROM school_class;
ALTER SEQUENCE global_seq RESTART WITH 1;
INSERT INTO school_class(id, name, user_id) VALUES
(1, '1А', 100002),
(2, '1Б', 100002),
(3, '1В', 100002);
SELECT setval('global_seq', max(id))
FROM school_class;
INSERT INTO student(id, name, surname, class_id) VALUES
(4, 'Vasya', 'Petrov', 1),
(5, 'Ivan', 'Ivanov', 1),
(6, 'Alex', 'Semenov', 1),
(7, 'David', 'Tsvetkov', 2),
(8, 'Petr', 'Petrov', 2),
(9, 'Daniil', 'Svetlov', 3);
SELECT setval('global_seq', max(id))
FROM student;
ALTER TABLE school_class
ALTER COLUMN user_id SET NOT NULL; |
SELECT dropIfExists('FUNCTION', 'postPurchaseOrder(INTEGER)', 'public');
SELECT dropIfExists('TRIGGER', 'ipsitembeforetrigger');
SELECT dropIfExists('FUNCTION', '_ipsitembeforetrigger()');
|
DECLARE
v_Id INTEGER;
v_Ids NVARCHAR2(32767);
v_listNotAllowDelete NVARCHAR2(32767);
v_tempName NVARCHAR2(255);
count_ NUMBER;
v_countDeletedRecords INTEGER;
v_isDetailedInfo BOOLEAN;
v_ErrorMessage NCLOB;
v_MessageParams NES_TABLE := NES_TABLE();
v_result NUMBER;
BEGIN
:SuccessResponse := '';
:ErrorCode := 0;
:ErrorMessage := '';
:affectedRows := 0;
v_Id := :Id;
v_Ids := :Ids;
count_ := 0;
v_countDeletedRecords := 0;
IF (v_Id IS NULL AND v_Ids IS NULL)
THEN
v_result := LOC_I18N(
MessageText => 'Id can not be empty',
MessageResult => :ErrorMessage
);
:ErrorCode := 101;
RETURN;
END IF;
IF (v_Id IS NOT NULL)
THEN
v_Ids := TO_CHAR(v_Id);
v_isDetailedInfo := FALSE;
ELSE
v_isDetailedInfo := TRUE;
END IF;
FOR REC IN (SELECT COLUMN_VALUE AS id
FROM TABLE (ASF_SPLIT(v_Ids, ',')))
LOOP
SELECT SUM(cnt)
INTO count_
FROM (SELECT COUNT(*) AS cnt
FROM TBL_CASE
WHERE COL_STP_RESOLUTIONCODECASE = REC.ID
UNION ALL
SELECT COUNT(*)
FROM TBL_TASK
WHERE COL_TASKSTP_RESOLUTIONCODE = REC.ID
UNION ALL
SELECT COUNT(*)
FROM TBL_TASKSYSTYPERESOLUTIONCODE
WHERE COL_TBL_STP_RESOLUTIONCODE = REC.ID
UNION ALL
SELECT COUNT(*)
FROM TBL_CASESYSTYPERESOLUTIONCODE
WHERE col_casetyperesolutioncode = REC.ID);
IF (count_ > 0) THEN
BEGIN
SELECT COL_NAME
INTO v_tempName
FROM TBL_STP_RESOLUTIONCODE
WHERE COL_ID = REC.ID;
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
END;
IF (v_tempName IS NOT NULL) THEN
v_listNotAllowDelete := v_listNotAllowDelete || ', ' || v_tempName;
END IF;
CONTINUE;
END IF;
DELETE TBL_STP_RESOLUTIONCODE
WHERE COL_ID = REC.ID;
v_countDeletedRecords := v_countDeletedRecords + 1;
END LOOP;
--get removed rows
:affectedRows := SQL % ROWCOUNT;
IF (v_listNotAllowDelete IS NOT NULL)
THEN
v_listNotAllowDelete := SUBSTR(v_listNotAllowDelete, 2, LENGTH(v_listNotAllowDelete));
:ErrorCode := 102;
IF (v_isDetailedInfo) THEN
v_ErrorMessage := 'Count of deleted Resolution Codes: {{MESS_COUNT}}'
|| '<br>You can''t delete Resolution Code(s): {{MESS_LIST_NOT_DELETED}}'
|| '<br>There exists a Case Type or Task Type that uses this Resolution Code'
|| '<br>Remove the link and try again...';
v_MessageParams.EXTEND(2);
v_MessageParams(1) := KEY_VALUE('MESS_COUNT', v_countDeletedRecords);
v_MessageParams(2) := KEY_VALUE('MESS_LIST_NOT_DELETED', v_listNotAllowDelete);
ELSE
v_ErrorMessage := 'You can''t delete this Resolution Code.'
|| '<br>There exists a Case Type or Task Type that uses this Resolution Code'
|| '<br>Remove the link and try again...';
END IF;
v_result := LOC_I18N(
MessageText => v_ErrorMessage,
MessageResult => :ErrorMessage,
MessageParams => v_MessageParams
);
ELSE
v_result := LOC_I18N(
MessageText => 'Deleted {{MESS_COUNT}} items',
MessageResult => :SuccessResponse,
MessageParams => NES_TABLE(KEY_VALUE('MESS_COUNT', v_countDeletedRecords))
);
END IF;
END; |
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.41-community-nt
/*!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' */;
--
-- Create schema online_store_management
--
CREATE DATABASE IF NOT EXISTS online_store_management;
USE online_store_management;
--
-- Definition of table `customer`
--
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
`customer_id` int(10) unsigned NOT NULL auto_increment,
`customer_fname` varchar(50) NOT NULL,
`customer_lname` varchar(50) NOT NULL,
`date_of_birth` date NOT NULL,
`customer_gender` varchar(30) NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`customer_user_name` varchar(100) NOT NULL,
`address_1` varchar(200) NOT NULL,
`address_2` varchar(200) NOT NULL,
`city` varchar(45) NOT NULL,
`state` varchar(45) NOT NULL,
`zip` varchar(45) NOT NULL,
`phone_number` varchar(15) NOT NULL,
`customer_image` varchar(100) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer`
--
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
INSERT INTO `customer` (`customer_id`,`customer_fname`,`customer_lname`,`date_of_birth`,`customer_gender`,`email`,`password`,`customer_user_name`,`address_1`,`address_2`,`city`,`state`,`zip`,`phone_number`,`customer_image`) VALUES
(1,'Kakib','Khan','1992-04-16','Male','kakib123@gmail.com','rakib123','Kakib Khan','Lokkhipur, Noakhali','Dhaka','Dhaka','Bangladesh','1262','01683046684','abc'),
(8,'Arif','Khan','1992-04-16','Maleds','arif123@gmail.com','arif123','Arif khan','Julekha Medicine','Horina,','Dhaka','Bangladesh','1262','01683046684','abc'),
(9,'Kakib','Khan','1990-04-01','Male','rarkar@gmail.com','rakib123','Rakib Khan','Lokkhipur, Noakhali','Dhaka','Dhaka','Bangladesh','1262','01683046684','abc'),
(10,'Hasan','Khan','1992-04-16','Male','razwar@gmail.com','rakib123','Hasan Khan','Julekha Medicine','Horina, Dhanua Bazar','Dhaka','Bangladesh','1262','01683046684','abc');
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
--
-- Definition of table `order_items`
--
DROP TABLE IF EXISTS `order_items`;
CREATE TABLE `order_items` (
`order_items_id` int(10) unsigned NOT NULL auto_increment,
`order_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`price` double NOT NULL,
`quantity` int(10) unsigned NOT NULL,
`discount_price` double NOT NULL,
`total_price` double NOT NULL,
`net_price` double NOT NULL,
`delivary_zone` varchar(45) NOT NULL,
`address` varchar(150) NOT NULL,
`customer_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`order_items_id`),
KEY `FK_order_items_1` (`order_id`),
KEY `FK_order_items_2` (`product_id`),
KEY `FK_order_items_3` (`customer_id`),
CONSTRAINT `FK_order_items_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`order_id`),
CONSTRAINT `FK_order_items_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`),
CONSTRAINT `FK_order_items_3` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `order_items`
--
/*!40000 ALTER TABLE `order_items` DISABLE KEYS */;
INSERT INTO `order_items` (`order_items_id`,`order_id`,`product_id`,`price`,`quantity`,`discount_price`,`total_price`,`net_price`,`delivary_zone`,`address`,`customer_id`) VALUES
(3,1,1,10,4,3,55,4343,'rfger55555555','eferf',1),
(4,1,3,3003,4,33,12012,11979,'rfger55555555','eferf',1),
(5,3,1,80000,4,33,320000,319967,'ddd','eferf5555555555555',1),
(7,1,1,80000,35,33,2800000,2799967,'rfger55555555','eferf5555555555555',9);
/*!40000 ALTER TABLE `order_items` ENABLE KEYS */;
--
-- Definition of trigger `order_items_after_insert`
--
DROP TRIGGER /*!50030 IF EXISTS */ `order_items_after_insert`;
DELIMITER $$
CREATE DEFINER = `root`@`localhost` TRIGGER `order_items_after_insert` AFTER INSERT ON `order_items` FOR EACH ROW BEGIN
update product
set product_quantity=product_quantity-new.quantity;
END $$
DELIMITER ;
--
-- Definition of table `orders`
--
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`order_id` int(10) unsigned NOT NULL auto_increment,
`customer_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`create_date` date NOT NULL,
`order_status` varchar(45) NOT NULL,
`order_sub_total` int(10) unsigned NOT NULL,
PRIMARY KEY (`order_id`),
KEY `FK_orders_1` (`customer_id`),
KEY `FK_orders_2` (`product_id`),
CONSTRAINT `FK_orders_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`),
CONSTRAINT `FK_orders_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orders`
--
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
INSERT INTO `orders` (`order_id`,`customer_id`,`product_id`,`create_date`,`order_status`,`order_sub_total`) VALUES
(1,1,1,'2018-04-06','Allow',2),
(3,8,1,'2018-07-12','yes',1);
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
--
-- Definition of table `payment`
--
DROP TABLE IF EXISTS `payment`;
CREATE TABLE `payment` (
`payment_id` int(10) unsigned NOT NULL auto_increment,
`customer_id` int(10) unsigned NOT NULL,
`payment_status` varchar(100) NOT NULL,
`payment_date` date NOT NULL,
`total_payment` double NOT NULL,
`discount` double NOT NULL,
`order_items_id` int(10) unsigned NOT NULL,
`payment_type` varchar(45) NOT NULL,
`delivary_charge` double NOT NULL,
PRIMARY KEY (`payment_id`),
KEY `FK_payment_1` (`customer_id`),
KEY `FK_payment_2` (`order_items_id`),
CONSTRAINT `FK_payment_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`),
CONSTRAINT `FK_payment_2` FOREIGN KEY (`order_items_id`) REFERENCES `order_items` (`order_items_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `payment`
--
/*!40000 ALTER TABLE `payment` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment` ENABLE KEYS */;
--
-- Definition of table `pro_category`
--
DROP TABLE IF EXISTS `pro_category`;
CREATE TABLE `pro_category` (
`category_id` int(10) unsigned NOT NULL auto_increment,
`category_name` varchar(100) NOT NULL,
`description` varchar(200) NOT NULL,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pro_category`
--
/*!40000 ALTER TABLE `pro_category` DISABLE KEYS */;
INSERT INTO `pro_category` (`category_id`,`category_name`,`description`) VALUES
(1,'Electronic Device','Good Qualitity'),
(2,'Cloth','Good Qualitities'),
(8,'Food !','Dry food'),
(10,'Furniture','Good Qualitities');
/*!40000 ALTER TABLE `pro_category` ENABLE KEYS */;
--
-- Definition of table `pro_sub_category`
--
DROP TABLE IF EXISTS `pro_sub_category`;
CREATE TABLE `pro_sub_category` (
`sub_category_id` int(10) unsigned NOT NULL auto_increment,
`category_id` int(10) unsigned NOT NULL,
`sub_category_name` varchar(100) NOT NULL,
`description` varchar(200) NOT NULL,
PRIMARY KEY (`sub_category_id`),
KEY `FK_pro_sub_category_1` (`category_id`),
CONSTRAINT `FK_pro_sub_category_1` FOREIGN KEY (`category_id`) REFERENCES `pro_category` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pro_sub_category`
--
/*!40000 ALTER TABLE `pro_sub_category` DISABLE KEYS */;
INSERT INTO `pro_sub_category` (`sub_category_id`,`category_id`,`sub_category_name`,`description`) VALUES
(1,1,'Mobile','Smat'),
(2,2,'shirt','mens'),
(3,10,'Table1','well rrrr');
/*!40000 ALTER TABLE `pro_sub_category` ENABLE KEYS */;
--
-- Definition of table `product`
--
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`product_id` int(10) unsigned NOT NULL auto_increment,
`category_id` int(10) unsigned NOT NULL,
`sub_category_id` int(10) unsigned NOT NULL,
`product_name` varchar(100) NOT NULL,
`manufacture` varchar(100) NOT NULL,
`product_quantity` int(10) unsigned NOT NULL,
`product_pur_price` double NOT NULL,
`product_sel_price` double NOT NULL,
`description` varchar(200) NOT NULL,
`product_image` varchar(100) NOT NULL,
`featured` varchar(45) NOT NULL,
`create_date` date NOT NULL,
PRIMARY KEY (`product_id`),
KEY `FK_product_1` (`category_id`),
KEY `FK_product_2` (`sub_category_id`),
CONSTRAINT `FK_product_1` FOREIGN KEY (`category_id`) REFERENCES `pro_category` (`category_id`),
CONSTRAINT `FK_product_2` FOREIGN KEY (`sub_category_id`) REFERENCES `pro_sub_category` (`sub_category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product`
--
/*!40000 ALTER TABLE `product` DISABLE KEYS */;
INSERT INTO `product` (`product_id`,`category_id`,`sub_category_id`,`product_name`,`manufacture`,`product_quantity`,`product_pur_price`,`product_sel_price`,`description`,`product_image`,`featured`,`create_date`) VALUES
(1,1,1,'iPhone-11','Linax',1,70000,80000,'good','abc','1','2018-07-19'),
(3,10,3,'T12','ygyu2',74,2003,3003,'Smatt tab2','wwe','122','2018-07-21'),
(4,10,2,'hghg','ghgh',11,200,300,'ghghg','ww','ghgh','2018-07-18');
/*!40000 ALTER TABLE `product` ENABLE KEYS */;
--
-- Definition of table `users_registration`
--
DROP TABLE IF EXISTS `users_registration`;
CREATE TABLE `users_registration` (
`user_id` int(10) unsigned NOT NULL auto_increment,
`user_name` varchar(50) NOT NULL,
`user_fname` varchar(50) NOT NULL,
`user_lname` varchar(50) NOT NULL,
`user_gender` varchar(45) NOT NULL,
`date_of_birth` date NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`address_1` varchar(200) NOT NULL,
`address_2` varchar(200) NOT NULL,
`state` varchar(45) NOT NULL,
`city` varchar(45) NOT NULL,
`zip` varchar(45) NOT NULL,
`phone_number` varchar(15) NOT NULL,
`create_date` date NOT NULL,
`user_image` varchar(200) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users_registration`
--
/*!40000 ALTER TABLE `users_registration` DISABLE KEYS */;
INSERT INTO `users_registration` (`user_id`,`user_name`,`user_fname`,`user_lname`,`user_gender`,`date_of_birth`,`email`,`password`,`address_1`,`address_2`,`state`,`city`,`zip`,`phone_number`,`create_date`,`user_image`) VALUES
(4,'Kabir Khan','kabir','Khan','male','1990-09-08','k@gmail.com','123','dhaka','chandpur','bd','dd','1234','01687569226','2018-09-04','eee'),
(5,'Arif Hossain','Arif','Hossain','Male','2000-07-08','arif@gmail.com','arif123','Dhaka','Chandpur','DH','Dhaka','1262','01683046684','2018-06-30','123');
/*!40000 ALTER TABLE `users_registration` ENABLE KEYS */;
/*!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 */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
Select * ,UCASE(city) from sakila.city |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 26 Nov 2016 pada 04.42
-- Versi Server: 5.6.20
-- PHP Version: 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 */;
--
-- Database: `ci_crud`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `pegawai`
--
CREATE TABLE IF NOT EXISTS `pegawai` (
`id_pegawai` int(11) NOT NULL,
`nama_pegawai` varchar(100) NOT NULL,
`alamat` varchar(100) NOT NULL,
`jk` enum('laki-laki','perempuan') NOT NULL,
`id_posisi` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
--
-- Dumping data untuk tabel `pegawai`
--
INSERT INTO `pegawai` (`id_pegawai`, `nama_pegawai`, `alamat`, `jk`, `id_posisi`) VALUES
(1, 'Ardi Rosela', 'Jakarta', 'laki-laki', 4),
(2, 'Rani Aprilia', 'Jakarta', 'perempuan', 1),
(3, 'Bejo Sugiantoro', 'Surabaya', 'laki-laki', 3),
(4, 'Dendy Ramadhian Siregar', 'Medan', 'laki-laki', 1),
(5, 'Annisa Fatma Puspa', 'Yogjakarta', 'laki-laki', 1),
(6, 'Boby Maheda', 'Malang', 'laki-laki', 2),
(7, 'Sulis Budi Harsono', 'Kediri', 'laki-laki', 2),
(8, 'Sela Aprilia', 'Blitar', 'perempuan', 2),
(9, 'Lukcy Setiawan', 'Nganjuk', 'laki-laki', 2),
(10, 'Rudi Santoso', 'Nganjuk', 'laki-laki', 3),
(11, 'Fellandia Dewi', 'Nganjuk', 'perempuan', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `posisi`
--
CREATE TABLE IF NOT EXISTS `posisi` (
`id_posisi` int(11) NOT NULL,
`nama_posisi` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data untuk tabel `posisi`
--
INSERT INTO `posisi` (`id_posisi`, `nama_posisi`) VALUES
(1, 'marketing'),
(2, 'progammer'),
(3, 'Produk'),
(4, 'Sales');
-- --------------------------------------------------------
--
-- Struktur dari tabel `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`name_user` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data untuk tabel `user`
--
INSERT INTO `user` (`id`, `username`, `password`, `name_user`) VALUES
(1, 'admin', 'admin', 'admin');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `pegawai`
--
ALTER TABLE `pegawai`
ADD PRIMARY KEY (`id_pegawai`);
--
-- Indexes for table `posisi`
--
ALTER TABLE `posisi`
ADD PRIMARY KEY (`id_posisi`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `pegawai`
--
ALTER TABLE `pegawai`
MODIFY `id_pegawai` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `posisi`
--
ALTER TABLE `posisi`
MODIFY `id_posisi` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
/*!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 PROCEDURE CPI.CHECK_OP_TEXT_2_Y;
CREATE OR REPLACE PROCEDURE CPI.check_op_text_2_y (
v_b160_tax_cd NUMBER,
v_tax_name VARCHAR2,
v_tax_amt NUMBER,
v_currency_cd NUMBER,
v_convert_rate NUMBER,
p_giop_gacc_tran_id giac_direct_prem_collns.gacc_tran_id%TYPE,
p_gen_type giac_modules.generation_type%TYPE,
p_seq_no IN OUT NUMBER
)
IS
v_exist VARCHAR2 (1);
BEGIN
BEGIN
SELECT 'X'
INTO v_exist
FROM giac_op_text
WHERE gacc_tran_id = p_giop_gacc_tran_id
AND SUBSTR (item_text, 1, 5) =
LTRIM (TO_CHAR (v_b160_tax_cd, '09'))
|| '-'
|| LTRIM (TO_CHAR (v_currency_cd, '09'));
UPDATE giac_op_text
SET item_amt = NVL (item_amt, 0) + NVL (v_tax_amt, 0),
foreign_curr_amt =
NVL (foreign_curr_amt, 0)
+ NVL (v_tax_amt / v_convert_rate, 0)
WHERE gacc_tran_id = p_giop_gacc_tran_id
AND item_gen_type = p_gen_type
AND SUBSTR (item_text, 1, 5) =
LTRIM (TO_CHAR (v_b160_tax_cd, '09'))
|| '-'
|| LTRIM (TO_CHAR (v_currency_cd, '09'));
EXCEPTION
WHEN NO_DATA_FOUND
THEN
BEGIN
p_seq_no := p_seq_no + 1;
INSERT INTO giac_op_text
(gacc_tran_id, item_gen_type, item_seq_no,
item_amt,
item_text,
print_seq_no, currency_cd, user_id, last_update,
foreign_curr_amt
)
VALUES (p_giop_gacc_tran_id, p_gen_type, p_seq_no,
v_tax_amt,
LTRIM (TO_CHAR (v_b160_tax_cd, '09'))
|| '-'
|| LTRIM (TO_CHAR (v_currency_cd, '09'))
|| '-'
|| v_tax_name,
p_seq_no, v_currency_cd, NVL(giis_users_pkg.app_user, USER), SYSDATE,
v_tax_amt / v_convert_rate
);
END;
END;
END;
/
|
/*根据包装代码删除包装*/
delete from cs_package where code in (:codes) |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 29, 2019 at 04:43 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `tubes`
--
-- --------------------------------------------------------
--
-- Table structure for table `daftar`
--
CREATE TABLE `daftar` (
`id_daftar` int(11) NOT NULL,
`nama` varchar(50) NOT NULL,
`username` varchar(60) NOT NULL,
`email` varchar(60) NOT NULL,
`password` varchar(20) NOT NULL,
`status` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `daftar`
--
INSERT INTO `daftar` (`id_daftar`, `nama`, `username`, `email`, `password`, `status`) VALUES
(1, 'Rivaldo Ludovicus Sembiring', 'CucuFiraun', 'ravenclawgrifindor@yahoo.com', 'd93591bdf7860e1e4ee2', 1),
(2, 'Telkom Dormitory', 'CucuFiraun', 'ravenclawgrifindor@yahoo.com', 'd93591bdf7860e1e4ee2', 1),
(3, 'GoniGoni', '1301174445', 'rivaldoludovicussembiring@yahoo.co.id', 'e10adc3949ba59abbe56', 1),
(4, 'Rivaldo Ludovicus Sembiring', '1301174445', 'rivaldoludovicus20@gmail.com', '827ccb0eea8a706c4c34', 1),
(5, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(6, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(7, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(8, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(9, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(10, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(11, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(12, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(13, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(14, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(15, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(16, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(17, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(18, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(19, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(20, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(21, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(22, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(23, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(24, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(25, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(26, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(27, 'GoniGoni', 'ray1234', 'ravenclawgrifindor@yahoo.com', 'fcea920f7412b5da7be0', 1),
(28, 'fafafafafafa', 'gaergadega', 'alvinda.julian@gmail.com', '9f05aa4202e4ce8d6a72', 1),
(29, 'fara', 'gaergadega', 'kkk@gmail.com', 'farah', 1);
-- --------------------------------------------------------
--
-- Table structure for table `foto`
--
CREATE TABLE `foto` (
`id` int(11) NOT NULL,
`nama_foto` varchar(250) DEFAULT NULL,
`token` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `timbulan`
--
CREATE TABLE `timbulan` (
`id` int(11) NOT NULL,
`judul` varchar(255) NOT NULL,
`deskripsi` varchar(500) NOT NULL,
`kota` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `timbulan`
--
INSERT INTO `timbulan` (`id`, `judul`, `deskripsi`, `kota`) VALUES
(5, 'fwef', 'fwefwe', 'fwefew'),
(6, 'tqteq', 'tqetqqe', 'teqw');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `daftar`
--
ALTER TABLE `daftar`
ADD PRIMARY KEY (`id_daftar`);
--
-- Indexes for table `foto`
--
ALTER TABLE `foto`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `timbulan`
--
ALTER TABLE `timbulan`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `daftar`
--
ALTER TABLE `daftar`
MODIFY `id_daftar` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `foto`
--
ALTER TABLE `foto`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `timbulan`
--
ALTER TABLE `timbulan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
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 TABLE IF EXISTS `zaypay_payment`;
CREATE TABLE `zaypay_payment` (
`payID` bigint(30) NOT NULL,
`account_id` int(20) NOT NULL,
`status` varchar(255) NOT NULL,
PRIMARY KEY (`payID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
CREATE TABLE webbrowser (
id CHAVE NOT NULL,
name CHARACTER VARYING(64),
CONSTRAINT pk_webbrowser PRIMARY KEY (id)
); |
CREATE TABLE [AsData_PL].[RP_SubmittedApplicationAnswers](
[Id] [int] PRIMARY KEY NOT NULL,
[ApplicationId] [uniqueidentifier] NULL,
[SequenceNumber] [Int] NULL,
[SectionNumber] [Int] NULL,
[PageId] [nvarchar](25) NULL,
[QuestionId] [nvarchar](25) NULL,
[QuestionType] [nvarchar](25) NULL,
[Answer] [nvarchar](max) NULL,
[ColumnHeading] [nvarchar](100) NULL,
[RowNumber] [int] NULL,
[ColumnNumber] [int] NULL,
[AsDm_UpdatedDateTime] [datetime2](7) default getdate() NULL
) |
CREATE TABLE game_participations(
id SERIAL PRIMARY KEY,
user_id INTEGER REFERENCES users(id) NOT NULL,
game_id INTEGER REFERENCES games(id) NOT NULL,
start_time TIMESTAMP WITH TIME ZONE,
end_time TIMESTAMP WITH TIME ZONE,
CONSTRAINT UC_COMPLETION UNIQUE (user_id, game_id)
)
|
CREATE DATABASE miphp CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'php'@'localhost' identified by '123qwe';
GRANT ALL PRIVILEGES ON miphp.* TO php@localhost;
FLUSH PRIVILEGES;
exit;
|
delete from HtmlLabelIndex where id =20040
/
delete from HtmlLabelIndex where id =20041
/
delete from HtmlLabelInfo where indexid=20040
/
delete from HtmlLabelInfo where indexid=20041
/
INSERT INTO HtmlLabelIndex values(20040,'Excel文件导入失败,请检查Excel文件格式是否正确!')
/
INSERT INTO HtmlLabelIndex values(20041,'文件不存在!')
/
INSERT INTO HtmlLabelInfo VALUES(20040,'Excel文件导入失败,请检查Excel文件格式是否正确!',7)
/
INSERT INTO HtmlLabelInfo VALUES(20040,'Excel File Imported Error,Please Check File!',8)
/
INSERT INTO HtmlLabelInfo VALUES(20041,'文件不存在!',7)
/
INSERT INTO HtmlLabelInfo VALUES(20041,'File is not existed!',8)
/
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Окт 19 2020 г., 20:08
-- Версия сервера: 8.0.19
-- Версия PHP: 7.2.29
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 */;
--
-- База данных: `coursedb`
--
-- --------------------------------------------------------
--
-- Структура таблицы `courses`
--
CREATE TABLE `courses` (
`id` int NOT NULL,
`title` varchar(250) NOT NULL,
`description` text NOT NULL,
`price` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Дамп данных таблицы `courses`
--
INSERT INTO `courses` (`id`, `title`, `description`, `price`) VALUES
(1, 'HTML5 & CSS3', 'Base course for html and css, begginer level', 500),
(2, 'Javascript & JQuery', 'Javascript & JQuery, introduction to programming, uper begginer level', 800),
(3, 'Angular & React', 'Angular and React SPA frameworks for modern development', 1500);
--
-- Индексы сохранённых таблиц
--
--
-- Индексы таблицы `courses`
--
ALTER TABLE `courses`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `courses`
--
ALTER TABLE `courses`
MODIFY `id` int 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 */;
|
CREATE TABLE cw (
Name varchar(20),
Constellation varchar(20),
Decommission varchar(20),
Track varchar(20),
Control varchar(20),
Health varchar(20)
); |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.26 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5723
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for dropee
CREATE DATABASE IF NOT EXISTS `dropee` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `dropee`;
-- Dumping structure for table dropee.dropee
CREATE TABLE IF NOT EXISTS `dropee` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`row` int(11) NOT NULL,
`column` int(11) NOT NULL,
`text` varchar(360) NOT NULL DEFAULT '',
`color` varchar(50) DEFAULT '',
`style` varchar(360) DEFAULT '',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- Dumping data for table dropee.dropee: 5 rows
/*!40000 ALTER TABLE `dropee` DISABLE KEYS */;
INSERT INTO `dropee` (`id`, `row`, `column`, `text`, `color`, `style`, `created_at`, `updated_at`) VALUES
(1, 1, 2, 'Dropee.com ', '#38c172', 'background-color: red; text-transform: uppercase;', '2020-10-25 12:28:42', '2020-10-25 12:28:45'),
(2, 1, 4, 'Build Trust', '', '', NULL, NULL),
(3, 2, 3, 'SaaS enabled marketplace', '', '', NULL, NULL),
(4, 3, 1, 'B2B Marketplace', '', '', NULL, NULL),
(5, 4, 4, 'Provide Transparency', '', '', NULL, NULL);
/*!40000 ALTER TABLE `dropee` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
CREATE DATABASE IF NOT EXISTS `agent` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `agent`;
-- --------------------------------------------------------
--
-- Table structure for table `books`
--
DROP TABLE IF EXISTS `agent`;
CREATE TABLE IF NOT EXISTS `agent` (
`agent_name` varchar(64) NOT NULL,
`agent_id` varchar (10) NOT NULL,
`agent_nric` varchar(9) NOT NULL,
`agent_password` varchar(100) NOT NULL,
PRIMARY KEY (`agent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `agentcustomer`;
CREATE TABLE IF NOT EXISTS `agentcustomer` (
`agent_id` varchar (10) NOT NULL,
`cust_nric` varchar (9) NOT NULL,
PRIMARY KEY(`agent_id`, `cust_nric`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `agent` (`agent_name`,`agent_id`,`agent_nric`,`agent_password`) VALUES
('Samuel','001',"S1234567A", 'sam123'),
('Leonard','002',"S1234567B",'leo123'),
('Dave','003',"S1234567C", 'dave123');
COMMIT;
INSERT INTO `agentcustomer` (`agent_id`,`cust_nric`)
VALUES ('001','S9121381P'),
('001','S9753582E'),
('001','S9832585S'),
('002','S9881237B'),
('002','S9816407C'),
('002','S9054355M');
COMMIT;
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 03, 2021 at 02:48 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `jktrans`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`email` varchar(11) NOT NULL,
`username` varchar(12) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `email`, `username`, `password`) VALUES
(2, 'ngurahganau', 'ganauntaran', '$2y$10$koNJIy6x3JowsRoRsoOAl.gZdGn3iGvIcfkxc/ArDl5SCpwf48M0a');
-- --------------------------------------------------------
--
-- Table structure for table `note`
--
CREATE TABLE `note` (
`id` int(11) NOT NULL,
`sp` varchar(6) NOT NULL,
`colli` varchar(11) NOT NULL,
`berat` float NOT NULL,
`franco` tinyint(1) NOT NULL,
`confrankert` float NOT NULL,
`penerima` varchar(255) NOT NULL,
`status` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `note`
--
INSERT INTO `note` (`id`, `sp`, `colli`, `berat`, `franco`, `confrankert`, `penerima`, `status`) VALUES
(2, '29672', '5', 255, 1, 240000, 'CV. Protex ', 'Diterima'),
(3, '29673', '12', 1600, 1, 693000, 'Sinar Mulya', 'Diterima');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `note`
--
ALTER TABLE `note`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `note`
--
ALTER TABLE `note`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
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 */;
|
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table order_entry (
id bigint not null,
type varchar(255),
carrier varchar(255),
entity_code varchar(255),
seat_type varchar(255),
ref_url varchar(255),
created_at timestamp,
matched_at timestamp,
price integer,
quantity integer,
constraint pk_order_entry primary key (id))
;
create sequence order_entry_seq;
# --- !Downs
SET REFERENTIAL_INTEGRITY FALSE;
drop table if exists order_entry;
SET REFERENTIAL_INTEGRITY TRUE;
drop sequence if exists order_entry_seq;
|
CREATE TABLE productcarrier (
id CHAVE NOT NULL,
id_product CHAVE NOT NULL,
id_carrier_reference CHAVE NOT NULL,
id_shop CHAVE NOT NULL,
CONSTRAINT pk_productcarrier PRIMARY KEY (id)
); |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3307
-- Generation Time: 2020-10-29 14:41:17
-- 服务器版本: 5.7.14
-- PHP Version: 5.6.25
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: `climb`
--
CREATE DATABASE IF NOT EXISTS `climb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `climb`;
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE `user` (
`ID` int(10) NOT NULL COMMENT '用户标号',
`Username` varchar(10) NOT NULL COMMENT '用户账号名',
`Password` char(32) NOT NULL COMMENT '用户密码',
`CardID` char(20) NOT NULL COMMENT '身份证号',
`Realname` varchar(10) NOT NULL COMMENT '真实姓名',
`Address` varchar(40) NOT NULL COMMENT '收货地址',
`Postcode` char(10) NOT NULL COMMENT '邮政编码',
`Tel` varchar(20) NOT NULL COMMENT '手机号码',
`Email` varchar(40) NOT NULL COMMENT '邮件地址'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `user`
--
INSERT INTO `user` (`ID`, `Username`, `Password`, `CardID`, `Realname`, `Address`, `Postcode`, `Tel`, `Email`) VALUES
(1, 'sevenn', 'e10adc3949ba59abbe56e057f20f883e', '440783199803071227', '谢雯静', '广东省广州市', '529311', '12345678911', '123@qq.com'),
(2, 'katrina', '3a715498b51a468e87e07820b3e72734', '440783199803071221', '潘春杏', '广州市', '593612', '12345678900', '258@qq.com'),
(3, 'tom', 'e10adc3949ba59abbe56e057f20f883e', '440783199910102020', '汤姆', '广州市', '666666', '14725836933', '12356@qq.com'),
(4, '毛毛', 'c5fde9de2d29789a81d1bc0f16292048', '441226199903240022', '毛小毛', '广东肇庆1路', '526600', '13822661919', '2269656266@qq.com');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`ID`),
ADD UNIQUE KEY `user_info` (`ID`,`Username`,`CardID`),
ADD UNIQUE KEY `Email` (`Email`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `user`
--
ALTER TABLE `user`
MODIFY `ID` int(10) NOT NULL AUTO_INCREMENT COMMENT '用户标号', AUTO_INCREMENT=5;
/*!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 dbo.LiveDemo (
LiveDemoId INT IDENTITY NOT NULL,
Declaration nvarchar(1000) NULL,
CONSTRAINT PK_LiveDemo PRIMARY KEY CLUSTERED (LiveDemoId)
);
|
CREATE SCHEMA IF NOT EXISTS pgtools;
SET search_path = pgtools, public;
CREATE OR REPLACE VIEW streaming_timedelay AS (
SELECT
CASE
WHEN (pg_last_xlog_receive_location() = pg_last_xlog_replay_location()) THEN (0)::double precision
ELSE date_part('epoch'::text, (now() - pg_last_xact_replay_timestamp()))
END AS time_delay
);
|
drop table if exists `user`;
create table `user`(
id identity,
username varchar(30) not null,
password varchar(50) not null,
name varchar(13),
email varchar(30),
phone varchar(30)
);
drop table if exists `authority`;
create table `authority` (
id identity,
name varchar(30) NOT NULL
);
drop table if exists `user_authority`;
create table `user_authority` (
user_id bigint(20) NOT NULL ,
authority_id bigint(20) NOT NULL ,
FOREIGN KEY (user_id) references `user`(id),
FOREIGN KEY (authority_id) references `authority`(id)
) |
/* CREATE TABLES */
CREATE TABLE IF NOT EXISTS "NodeModules" (
"id" INTEGER NOT NULL UNIQUE,
"Title" TEXT NOT NULL,
"Homepage_URL" TEXT,
"Repo_URL" TEXT,
"Repo_Type" TEXT,
"Description" TEXT,
"License" TEXT,
"Is_WP_Dependency" INTEGER NOT NULL DEFAULT 0,
"Author_Name" TEXT,
"Author_EmailAddress" TEXT,
"Author_URL" TEXT,
"_deleted" INTEGER NOT NULL DEFAULT 0,
"_scanned" INTEGER DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "NodeModules_NodeModules" (
"nodemodule_parent_id" INTEGER NOT NULL,
"nodemodule_child_id" INTEGER NOT NULL,
PRIMARY KEY("nodemodule_parent_id","nodemodule_child_id")
);
CREATE TABLE IF NOT EXISTS "Plugins_NodeModules" (
"plugin_id" INTEGER NOT NULL,
"nodemodule_id" INTEGER NOT NULL,
PRIMARY KEY("plugin_id","nodemodule_id")
);
CREATE TABLE IF NOT EXISTS "Themes_NodeModules" (
"theme_id" INTEGER NOT NULL,
"nodemodule_id" INTEGER NOT NULL,
PRIMARY KEY("theme_id","nodemodule_id")
);
CREATE TABLE IF NOT EXISTS "Options" (
"id" INTEGER NOT NULL UNIQUE,
"name" TEXT NOT NULL,
"value" TEXT,
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Plugins" (
"id" INTEGER NOT NULL UNIQUE,
"Title" TEXT NOT NULL,
"Folder_Name" TEXT,
"Description" TEXT,
"url" TEXT,
_deleted INTEGER NOT NULL DEFAULT 0,
is_internal INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Sites" (
"id" INTEGER NOT NULL UNIQUE,
"Title" TEXT NOT NULL,
"URL" INTEGER,
"Admin_URL" TEXT,
"Host" TEXT,
"PHP_Version_Major" INTEGER,
"PHP_Version_Minor" INTEGER,
"PHP_Version_Patch" INTEGER,
"WordPress_Version_Major" INTEGER,
"WordPress_Version_Minor" INTEGER,
"WordPress_Version_Patch" INTEGER,
"Has_2Factor" INTEGER NOT NULL DEFAULT 0,
"Description" TEXT,
"SSL_Expiry" INTEGER,
"SSL_Provider" TEXT,
"Email_From_Name" TEXT,
"Email_From_Address" TEXT,
"Admin_Address" TEXT,
Last_Reviewed TEXT,
_deleted INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Sites_Plugins" (
"Site_id" INTEGER NOT NULL,
"Plugin_id" INTEGER NOT NULL,
"Is_Active" INTEGER DEFAULT 0,
"Can_Update" INTEGER DEFAULT 0,
PRIMARY KEY("Site_id","Plugin_id")
);
CREATE TABLE IF NOT EXISTS "Sites_Themes" (
"Site_id" INTEGER NOT NULL,
"Theme_id" INTEGER NOT NULL,
"Is_Primary" INTEGER DEFAULT 0,
"Can_Update" INTEGER DEFAULT 0,
PRIMARY KEY("Site_id","Theme_id")
);
CREATE TABLE IF NOT EXISTS "Sites_Users" (
"Site_id" INTEGER NOT NULL,
"User_id" INTEGER NOT NULL,
"Username" TEXT NOT NULL,
"Role" TEXT NOT NULL,
PRIMARY KEY("Site_id","User_id")
);
CREATE TABLE IF NOT EXISTS "Themes" (
"id" INTEGER NOT NULL UNIQUE,
"Title" TEXT NOT NULL,
"Folder_Name" TEXT,
"Description" TEXT,
"Parent_ID" INTEGER,
_deleted INTEGER NOT NULL DEFAULT 0,
is_internal INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Users" (
"id" INTEGER NOT NULL UNIQUE,
"EmailAddress" TEXT,
"Name_First" TEXT,
"Name_Last" TEXT,
"Is_Active" INTEGER NOT NULL DEFAULT 1,
_deleted INTEGER NOT NULL DEFAULT 0,
is_employee INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);
/* DEFAULT DATA */
INSERT INTO Options (
name,
value
)
VALUES (
'review_ttl_days',
40
);
/* CREATE VIEWS */
DROP VIEW IF EXISTS vPlugins;
CREATE VIEW vPlugins AS
SELECT
Plugins.id,
Plugins.Title,
Plugins.Description,
Plugins.Folder_Name,
Plugins.url,
Plugins.is_internal,
(
Plugins.Title
|| ' ' || Plugins.Folder_Name
|| ' ' || Plugins.Description
) AS search_text,
(
SELECT
COUNT(*)
FROM
Sites_Plugins sp
INNER JOIN
Sites s
ON
sp.Site_id = s.id
AND s._deleted = 0
WHERE
sp.plugin_id = Plugins.id
) as sites_count
FROM
Plugins
WHERE
Plugins._deleted = 0
;
DROP VIEW IF EXISTS vSites;
CREATE VIEW vSites as
SELECT
Sites.id,
Sites.Title,
Sites.URL,
Sites.Admin_URL,
Sites.Host,
Sites.Description,
Sites.PHP_Version_Major,
Sites.PHP_Version_Minor,
Sites.PHP_Version_Patch,
Sites.WordPress_Version_Major,
Sites.WordPress_Version_Minor,
Sites.WordPress_Version_Patch,
Sites.SSL_Expiry,
Sites.SSL_Provider,
Sites.Email_From_Name,
Sites.Email_From_Address,
Sites.Admin_Address,
Sites.Has_2Factor,
Sites.Last_Reviewed,
(
SELECT COUNT(*)
FROM
Sites_Plugins
INNER JOIN
Plugins
ON
Sites_Plugins.Plugin_id = Plugins.id
AND Plugins._deleted = 0
WHERE
Sites_Plugins.Site_id = Sites.id
) AS Plugins_Installed,
(
SELECT COUNT(*)
FROM
Sites_Plugins
INNER JOIN
Plugins
ON
Sites_Plugins.Plugin_id = Plugins.id
AND Plugins._deleted = 0
WHERE
Sites_Plugins.Site_id = Sites.id
AND Sites_Plugins.Is_Active = 1
) AS Plugins_Active,
(
SELECT COUNT(*)
FROM
Sites_Themes
INNER JOIN
Themes
ON
Sites_Themes.Theme_id = Themes.id
AND Themes._deleted = 0
WHERE
Sites_Themes.Site_id = Sites.id
) AS Themes_Installed,
(
SELECT
Themes.Title
FROM
Themes
INNER JOIN
Sites_Themes
ON
Sites_Themes.Theme_id = Themes.id
AND Sites_Themes.Site_id = Sites.id
AND Sites_Themes.Is_Primary = 1
WHERE
Themes._deleted = 0
) AS Primary_Theme,
(
SELECT COUNT(*)
FROM
Sites_Users
INNER JOIN
Users
ON
Sites_Users.User_id = Users.id
AND Users._deleted = 0
WHERE
Sites_Users.Site_id = Sites.id
) AS Users_Count,
Sites.PHP_Version_Major || '.' || Sites.PHP_Version_Minor || '.' || Sites.PHP_Version_Patch as PHP_Version,
Sites.WordPress_Version_Major || '.' || Sites.WordPress_Version_Minor || '.' || Sites.WordPress_Version_Patch as WordPress_Version,
(
CASE
when ROUND(julianday('now') - julianday(Sites.Last_Reviewed)) > (SELECT value FROM Options WHERE name='review_ttl_days') THEN 1
ELSE 0
END
) AS LastReview_IsExpired,
ROUND(julianday('now') - julianday(Sites.Last_Reviewed)) AS LastReview_DaysSince,
(
Sites.title
|| ' ' || Sites.host
|| ' ' || Sites.url
|| ' ' || Sites.description
) AS search_text
FROM
Sites
WHERE
_deleted = 0
;
DROP VIEW IF EXISTS vSites_Plugins;
CREATE VIEW vSites_Plugins AS
SELECT
Sites_Plugins.Site_id,
Sites_Plugins.Plugin_id,
Sites.Title AS Site_Title,
Plugins.Title AS Plugin_Title,
Sites_Plugins.Is_Active,
Sites_Plugins.Can_Update
FROM
Sites_Plugins
INNER JOIN
Sites
ON
Sites_Plugins.Site_id = Sites.id
AND Sites._deleted = 0
INNER JOIN
Plugins
ON
Sites_Plugins.Plugin_id = Plugins.id
AND Plugins._deleted = 0
;
DROP VIEW IF EXISTS vSites_Themes;
CREATE VIEW vSites_Themes AS
SELECT
Sites_Themes.Site_id,
Sites_Themes.Theme_id,
Sites.Title AS Site_Title,
Themes.Title AS Theme_Title,
Sites_Themes.Is_Primary,
Sites_Themes.Can_Update,
PThemes.Title AS Parent_Title
FROM
Sites_Themes
INNER JOIN
Sites
ON
Sites_Themes.Site_id = Sites.id
AND Sites._deleted = 0
INNER JOIN
Themes
ON
Sites_Themes.Theme_id = Themes.id
AND Themes._deleted = 0
LEFT OUTER JOIN
Themes PThemes
ON
Themes.Parent_id = PThemes.id
and PThemes._deleted = 0
;
DROP VIEW IF EXISTS vSites_Users;
CREATE VIEW vSites_Users AS
SELECT
Sites_Users.Site_id,
Sites_Users.User_id,
Sites.Title AS Site_Title,
Users.EmailAddress,
Users.Name_First,
Users.Name_Last,
Sites_Users.Username,
Sites_Users.Role,
Users.Is_Active,
Users.is_employee
FROM
Sites_Users
INNER JOIN
Sites
ON
Sites_Users.Site_id = Sites.id
AND Sites._deleted = 0
INNER JOIN
Users
ON
Sites_Users.User_id = Users.id
AND Users._deleted = 0
;
DROP VIEW IF EXISTS vThemes;
CREATE VIEW vThemes AS
SELECT
Themes.*
FROM
Themes
WHERE
Themes._deleted = 0
;
DROP VIEW IF EXISTS vUsers;
CREATE VIEW vUsers AS
SELECT
Users.*
FROM
Users
WHERE
Users._deleted = 0
;
DROP VIEW IF EXISTS vNodeModules;
CREATE VIEW vNodeModules AS
SELECT
NodeModules.*,
(
SELECT
COUNT(*)
FROM
NodeModules_NodeModules
INNER JOIN
NodeModules nParents
ON
NodeModules_NodeModules.nodemodule_parent_id = nParents.id
AND nParents._deleted = 0
WHERE
NodeModules_NodeModules.nodemodule_child_id = NodeModules.id
) AS Parents_Count,
(
SELECT
COUNT(*)
FROM
NodeModules_NodeModules
INNER JOIN
NodeModules nChildren
ON
NodeModules_NodeModules.nodemodule_child_id = nChildren.id
AND nChildren._deleted = 0
WHERE
NodeModules_NodeModules.nodemodule_parent_id = NodeModules.id
) AS Children_Count,
(
NodeModules.title || ' '
|| NodeModules.description || ' '
|| NodeModules.author_name
) AS search_text
FROM
NodeModules
WHERE
_deleted = 0
;
DROP VIEW IF EXISTS vNodeModules_NodeModules;
CREATE VIEW vNodeModules_NodeModules AS
SELECT
nm_nm.*,
nmParents.title AS parent_title,
nmChildren.title AS child_title
FROM
NodeModules_NodeModules nm_nm
INNER JOIN
NodeModules nmParents
ON
nm_nm.nodemodule_parent_id = nmParents.id
AND nmParents._deleted = 0
INNER JOIN
NodeModules nmChildren
ON
nm_nm.nodemodule_child_id = nmChildren.id
AND nmChildren._deleted = 0
;
DROP VIEW IF EXISTS vPlugins_NodeModules;
CREATE VIEW vPlugins_NodeModules AS
SELECT
pnm.*,
p.Title as plugin_title,
nm.Title as nodemodule_title
FROM
Plugins_NodeModules pnm
INNER JOIN
Plugins p
ON
pnm.plugin_id = p.id
and p._deleted - 0
INNER JOIN
NodeModules nm
ON
pnm.nodemodule_id = nm.id
AND nm._deleted = 0
;
DROP VIEW IF EXISTS vThemes_NodeModules;
CREATE VIEW vThemes_NodeModules AS
SELECT
tnm.*,
t.Title as theme_title,
nm.Title as nodemodule_title
FROM
Themes_NodeModules tnm
INNER JOIN
Themes t
ON
tnm.theme_id = t.id
and t._deleted - 0
INNER JOIN
NodeModules nm
ON
tnm.nodemodule_id = nm.id
AND nm._deleted = 0
;
|
-- ********* INNER JOIN ***********
-- Let's find out who made payment 16666:
SELECT * FROM payment where payment_id=16666;
-- Ok, that gives us a customer_id, but not the name. We can use the customer_id to get the name FROM the customer table
SELECT * FROM payment
join customer on customer.customer_id = payment.customer_id
where payment_id=16666;
-- We can see that the * pulls back everything from both tables. We just want everything from payment and then the first and last name of the customer:
SELECT payment.*, customer.first_name, customer.last_name FROM payment
join customer on customer.customer_id = payment.customer_id
where payment_id=16666;
--using alias
SELECT p.*, c.first_name, c.last_name FROM payment as p
join customer c on c.customer_id =p.customer_id
where payment_id=16666;
-- But when did they return the rental? Where would that data come from? From the rental table, so let's join that.
SELECT p.*, c.first_name, c.last_name,r.return_date FROM payment AS p
JOIN customer c ON c.customer_id =p.customer_id
JOIN rental r ON r.rental_id = p.rental_id
WHERE payment_id=16666;
select * from rental where rental_id=251;
--alternate path (causes duplicates due to bad data .. multiple dates for 1 payment)
SELECT p.*, c.first_name, c.last_name,r.return_date FROM payment as p
join customer c on c.customer_id =p.customer_id
join rental r on r.customer_id= p.customer_id
where payment_id=16666;
-- What did they rent? Film id can be gotten through inventory.
SELECT p.*, c.first_name, c.last_name,f.title,r.return_date FROM payment as p
join customer c on c.customer_id =p.customer_id
join rental r on r.rental_id= p.rental_id
join inventory i on i.inventory_id = r.inventory_id
join film f on f.film_id = i.film_id
where payment_id=16666;
-- What if we wanted to know who acted in that film?
SELECT p.*, c.first_name, c.last_name,f.title,r.return_date,a.first_name, a.last_name FROM payment as p
join customer c on c.customer_id =p.customer_id
join rental r on r.rental_id= p.rental_id
join inventory i on i.inventory_id = r.inventory_id
join film f on f.film_id = i.film_id
join film_actor fa on i.film_id=fa.film_id
join actor a on fa.actor_id=a.actor_id
where payment_id=16666;
-- What if we wanted a list of all the films and their categories ordered by film title
select f.film_id, f.title, c.category_id, c.name from film f
join film_category fc ON f.film_id = fc.film_id
join category c on fc.category_id = c.category_id
order by title;
-- Show all the 'Comedy' films ordered by film title
select f.film_id, f.title, c.category_id, c.name from film f
join film_category fc ON f.film_id = fc.film_id
join category c on fc.category_id = c.category_id
where c.name ='Comedy'
order by title;
-- Finally, let's count the number of films under each category
select f.title, count(f.title), c.name from film f
join film_category fc ON f.film_id = fc.film_id
join category c on fc.category_id = c.category_id
group by f.title, c.name
order by c.name;
select count(f.title), c.name from film f
join film_category fc ON f.film_id = fc.film_id
join category c on fc.category_id = c.category_id
group by c.name
order by c.name;
-- ********* LEFT JOIN ***********
-- (There aren't any great examples of left joins in the "dvdstore" database, so the following queries are for the "world" database)
-- A Left join, selects all records from the "left" table and matches them with records from the "right" table if a matching record exists.
-- Let's display a list of all countries and their capitals, if they have some.
select country.name, city.name FROM country
join city on city.id=country.capital;
--left join
select country.name, city.name FROM country
left join city on city.id=country.capital;
--extra example
select countrylanguage.language, country.name from countrylanguage
join country on country.code= countrylanguage.countrycode;
-- Only 232 rows
-- But we're missing entries:
-- There are 239 countries. So how do we show them all even if they don't have a capital?
-- That's because if the rows don't exist in both tables, we won't show any information for it. If we want to show data FROM the left side table everytime, we can use a different join:
-- *********** UNION *************
-- Back to the "dvdstore" database...
-- Gathers a list of all first names used by actors and customers
-- By default removes duplicates
select first_name from actor
union
select first_name from customer;
select first_name from actor
union
select email from customer;
-- Gather the list, but this time note the source table with 'A' for actor and 'C' for customer
select first_name, 'A' as source from actor
union
select first_name, 'C' as source from customer
where first_name like 'E%'; |
-----------------------------------------------------------
--
-- Mysql 测试数据库
--
--
-----------------------------------------------------------
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- 数据库: `test`
--
-- --------------------------------------------------------
--
-- 表的结构 `TableName`
--
CREATE TABLE IF NOT EXISTS `tablename` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(255) NOT NULL,
`Value` int(11) NOT NULL,
`Time` date NOT NULL,
`Content` text NOT NULL,
`Sort` int(11) NOT NULL,
`ModelId` int(11) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- 数据 `TableName`
--
INSERT INTO `TableName` (`ID`, `Name`, `Value`, `Time`, `Content`, `Sort`, `ModelId`) VALUES
(1, '898', 5, '2010-01-01', '内容1', 1, 1),
(2, '2', 4, '2010-05-11', '内容2', 2, 2),
(3, '3', 5, '2010-01-01', '内容3', 3, 3),
(4, '4', 6, '2010-01-01', '内容', 4, 4),
(5, '7', 5, '2010-01-01', '内容5', 5, 5),
(6, '6', 2, '2007-01-01', '内容6', 6, 6),
(7, '7', 2, '2006-01-02', '内容7', 7, 7);
|
SELECT * FROM test_form;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.