blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
8cdcc9b96ec98dd01125e6e298558004f345970c | SQL | tnelson2016/mysql-query-exam | /answers.sql | UTF-8 | 2,414 | 4.3125 | 4 | [] | no_license | /*
1) Select a distinct list of ordered airports codes. Be sure to name the column correctly. Be sure to order the results correctly.
*/
SELECT DISTINCT departAirport as Airports from flight;
/*
2)Provide a list of delayed flights departing from San Francisco (SFO).
*/
SELECT name, flightNumber, scheduledDepartDateTime, arriveAirport, status From flight INNER JOIN airline ON airline.id WHERE status = 'delayed' AND departAirport = "SFO" AND name = 'Delta';
/*
3.Provide a distinct list of cities that American airlines departs from.
*/
SELECT Distinct departAirport as Cities From flight INNER JOIN airline ON airline.id WHERE airlineID = '1';
/*
4. Provide a distinct list of airlines that conducts flights departing from ATL.
/*
SELECT DISTINCT airline.name as Airline from flight JOIN airline on airline.ID WHERE airline.id BETWEEN 1 and 2;
/*
5.Provide a list of airlines, flight numbers, departing airports, and arrival airports where flights departed on time.
*/
SELECT name, flightNumber, departAirport, arriveAirport From flight INNER JOIN airline ON airline.id WHERE scheduledDepartDateTime = actualDepartDateTime and name = 'delta';
/*
6. Provide a list of airlines, flight numbers, gates, status, and arrival times arriving into Charlotte (CLT) on 10-30-2017. Order your results by the arrival time.
/*
SELECT airline.name as Airline, flight.flightNumber as Flight, flight.Gate as Gate, time(scheduledArriveDateTime) as Arrival, flight.status as status From flight INNER JOIN airline ON airline.id WHERE arriveAirport = "CLT" AND Status = "scheduled"; and scheduledArriveDateTime = '2017-10-30' ORDER By time(scheduledArriveDateTime) ASC;
/*
7. List the number of reservations by flight number. Order by reservations in descending order.
*/
Select Distinct flight.flightNumber as Flight, reservation.passengerID as reservation from Flight Inner Join reservation ON reservation.passengerID BETWEEN 1 and 15 Order By reservation Desc;
/*
8. List the average ticket cost for coach by airline and route. Order by AverageCost in descending order.
*/
/*
9.Which route is the longest?
/*
SELECT (flight.departAirport),(flight.arriveAirport),(flight.miles) from flight WHERE flight.miles = '2290';
Select reservation.passengerID, passenger.firstName, passenger.lastName, flight.miles from passenger INNer Join flight ON flight.miles WHERE reservation. passengerID Between 1 and 15 ORDER By DESC; | true |
e72057532cf54aa1ac5829020028b796c478f93a | SQL | josepitteloud/VESPA | /ad_hoc/BB Churn process/Original code/Proc_FORECAST_Loop_Table_2_Weekly_Actions.sql | UTF-8 | 16,458 | 3.609375 | 4 | [] | no_license | Create variable Counter integer; Set Counter = 1;
Create variable multiplier bigint;
Create variable multiplier_2 bigint;
-- First you need to impersonate CITeam
Setuser CITeam;
-- Drop procedure if exists CITeam.Forecast_Loop_Table_2_Actions;
Create procedure CITeam.Forecast_Loop_Table_2_Actions(IN Counter integer,IN Rate_Multiplier float)
SQL Security INVOKER
BEGIN
Declare multiplier bigint;
Declare multiplier_2 bigint;
Set multiplier = DATEPART(millisecond,now())+1;
Set multiplier_2 = DATEPART(millisecond,now())+2;
--------------------------------------------------------------------------------------------------------------
-- Predicted rates -------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
--- cuscan rates ----
update Forecast_Loop_Table_2 as a
set pred_TA_Call_Cust_rate = Coalesce(b.pred_TA_Call_Cust_rate,0)
,pred_Web_Chat_TA_Cust_rate = Coalesce(b.pred_Web_Chat_TA_Cust_rate,0)
,pred_TA_DTV_Offer_Applied_rate = Coalesce(b.pred_TA_DTV_Offer_Applied_rate,0)
,pred_NonTA_DTV_Offer_Applied_rate = Coalesce(b.pred_NonTA_DTV_Offer_Applied_rate,0)
from Forecast_Loop_Table_2 as a
left join
cuscan_predicted_values as b
on (a.subs_week_of_year = b.subs_week or (a.subs_week_of_year = 53 and b.subs_week = 52))
and replace(a.cuscan_forecast_segment,'_SkyQ','_Original') = b.cuscan_forecast_segment;
------ TA trend ------
update Forecast_Loop_Table_2 as a
set pred_TA_Call_Cust_YoY_Trend = Coalesce(d.Grad_Coeff * 4 * (Cast(counter-1 as integer)/52+1),0)
from Forecast_Loop_Table_2 as a
left join
Fcast_Regr_Coeffs as d
on replace(a.cuscan_forecast_segment,'_SkyQ','_Original') = d.fcast_segment
-- and d.LV = Forecast_Start_Wk
and d.Metric = 'TA_Call_Customers';
------ TA cum ----
update Forecast_Loop_Table_2 as a
Set cum_TA_Call_Cust_rate = pred_TA_Call_Cust_rate + pred_TA_Call_Cust_YoY_Trend;
------ WC cum-----
update Forecast_Loop_Table_2 as a
Set cum_Web_Chat_TA_Cust_rate = cum_TA_Call_Cust_rate + pred_Web_Chat_TA_Cust_rate;
------ WC trend ------
update Forecast_Loop_Table_2 as a
set pred_Web_Chat_TA_Cust_YoY_Trend = Coalesce(d.Grad_Coeff * 4 * (Cast(counter-1 as integer)/52+1),0)
from Forecast_Loop_Table_2 as a
left join
Fcast_Regr_Coeffs as d
on replace(a.cuscan_forecast_segment,'_SkyQ','_Original') = d.fcast_segment
-- and d.LV = Forecast_Start_Wk
and d.Metric = 'Web_Chat_TA_Customers';
-------WC cum ------
update Forecast_Loop_Table_2 as a
Set cum_Web_Chat_TA_Cust_Trend_rate = cum_Web_Chat_TA_Cust_rate + pred_Web_Chat_TA_Cust_YoY_Trend ;
------ DTV Offer trend ------
update Forecast_Loop_Table_2 as a
set pred_TA_DTV_Offer_Applied_YoY_Trend = Coalesce(d.Grad_Coeff * 4 * (Cast(counter-1 as integer)/52+1),0)
from Forecast_Loop_Table_2 as a
left join
Fcast_Regr_Coeffs as d
on replace(a.cuscan_forecast_segment,'_SkyQ','_Original') = d.fcast_segment
-- and d.LV = Forecast_Start_Wk
and d.Metric = 'TA_DTV_Offer_Applied';
------ DTV Offer trend ------
update Forecast_Loop_Table_2 as a
set pred_NonTA_DTV_Offer_Applied_YoY_Trend = Coalesce(d.Grad_Coeff * 4 * (Cast(counter-1 as integer)/52+1),0)
from Forecast_Loop_Table_2 as a
left join
Fcast_Regr_Coeffs as d
on a.Cuscan_forecast_segment = d.fcast_segment
-- and d.LV = Forecast_Start_Wk
and d.Metric = 'NonTA_DTV_Offer_Applied';
-- syscan rates -----
update Forecast_Loop_Table_2 as a
set pred_DTV_AB_rate = Coalesce(c.pred_DTV_AB_rate,0)
from Forecast_Loop_Table_2 as a
left join
syscan_predicted_values as c
on (a.subs_week_of_year = c.subs_week or (a.subs_week_of_year = 53 and c.subs_week = 52))
and a.syscan_forecast_segment = c.syscan_forecast_segment;
------ AB_DTV trend ------
update Forecast_Loop_Table_2 as a
set pred_DTV_YoY_Trend = Coalesce(d.Grad_Coeff * 4 * (Cast(counter-1 as integer)/52+1),0)
from Forecast_Loop_Table_2 as a
left join
Fcast_Regr_Coeffs as d
on a.syscan_forecast_segment = d.fcast_segment
-- and d.LV = Forecast_Start_Wk
and d.Metric = 'DTV_AB';
---- AB cum ------
update Forecast_Loop_Table_2 as a
set cum_DTV_AB_rate = pred_DTV_AB_rate ;
update Forecast_Loop_Table_2 as a
set cum_DTV_AB_trend_rate = cum_DTV_AB_rate + pred_dtv_YoY_Trend;
--------------------------------------------------------------------------------------------------------------
-- TA/WC Volumes, Saves & Offers Applied --------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
-- 3.06 Allocate customers randomly based on rates --
update Forecast_Loop_Table_2 as a
set
TA_Call_Cust = case when rand_action_Cuscan /*pct_cuscan_count*/ <= cum_TA_Call_Cust_rate * Rate_Multiplier
then 1
else 0
end
,WC_Call_Cust = case when rand_action_Cuscan /*pct_cuscan_count*/ > cum_TA_Call_Cust_rate * Rate_Multiplier
and rand_action_Cuscan /*pct_cuscan_count*/ <= cum_Web_Chat_TA_Cust_rate * Rate_Multiplier
then 1
else 0
end
;
-- TA
update Forecast_Loop_Table_2 as a
set TA_Call_Count = b.total_calls
,TA_Saves = b.TA_Saved
,DTV_Offer_Applied = b.TA_DTV_Offer_Applied
-- ,TA_Non_Saves = case when pct_cuscan_count <= pred_TA_Not_Saved_rate then 1 else 0 end
from Forecast_Loop_Table_2 as a
inner join
TA_Call_Dist as b
on a.CusCan_Forecast_Segment = b.CusCan_Forecast_Segment
and a.rand_TA_Vol between b.TA_Lower_Pctl and b.TA_Upper_Pctl
where TA_Call_Cust > 0;
-- WebChat
update Forecast_Loop_Table_2 as a
set
WC_Call_Count = b.total_WCs
,WC_Saves = b.Webchat_TA_Saved
-- select count(*)
from Forecast_Loop_Table_2 as a
inner join
WC_Dist as b
on b.Subs_week = a.subs_week_of_year
and Prev_WC_Vol_Percentile <= rand_WC_Vol
and rand_WC_Vol <= WC_Vol_Percentile
and Prev_WC_Save_Vol_Percentile <= rand_WC_Save_Vol
and rand_WC_Save_Vol <= WC_Save_Vol_Percentile
where WC_Call_Cust > 0;
--------------------------------------------------------------------------------------------------------------
-- Pending Cancels -------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
--- pred DTV_PC ----
Update Forecast_Loop_Table_2 as a
Set pred_TA_DTV_PC_rate = b.TA_DTV_PC_Conv_Rate
,pred_TA_Sky_Plus_Save_rate = b.TA_SkyPlus_Save_Rate
,pred_WC_DTV_PC_rate = b.WC_DTV_PC_Conv_Rate
,pred_WC_Sky_Plus_Save_rate = b.WC_SkyPlus_Save_Rate
,pred_Other_DTV_PC_rate = Coalesce(b.Other_DTV_PC_Conv_Rate,0)
from Forecast_Loop_Table_2 as a
inner join
TA_DTV_PC_Vol as b
on a.cuscan_forecast_segment = b.cuscan_forecast_segment;
--- cum DTV_PC ----
update Forecast_Loop_Table_2 as a
set cum_TA_DTV_PC_rate = pred_TA_DTV_PC_rate + pred_TA_Sky_Plus_Save_rate
,cum_WC_DTV_PC_rate = pred_WC_DTV_PC_rate + pred_WC_Sky_Plus_Save_rate
;
---- DTV_PC counts
Drop table if exists #TA_PC_Pctl;
Select cuscan_forecast_segment,account_number,TA_Call_Cust,WC_Call_Cust,TA_Saves,WC_Saves,DTV_Offer_Applied,
Row_number() over(partition by cuscan_forecast_segment order by TA_Saves,DTV_Offer_Applied, WC_Saves) Segment_Rnk,
Count(*) over(partition by cuscan_forecast_segment) Total_Accs,
Cast(Segment_Rnk as float)/Total_Accs as CusCan_Segment_Pctl
into #TA_PC_Pctl
from Forecast_Loop_Table_2
where TA_Call_Cust > 0 and DTV_Status_Code not in ('AB','PC')
;
update Forecast_Loop_Table_2 as a
set
TA_DTV_PC = case when CusCan_Segment_Pctl <= pred_TA_DTV_PC_rate and a.TA_Call_Cust > 0
then 1
else 0
end
,TA_Sky_Plus_Save = case when CusCan_Segment_Pctl > pred_TA_DTV_PC_rate
and CusCan_Segment_Pctl < cum_TA_DTV_PC_rate
and a.TA_Call_Cust >0
then 1
else 0
end
from Forecast_Loop_Table_2 as a
inner join
#TA_PC_Pctl pc
on pc.account_number = a.account_number;
Drop table if exists #TA_PC_Pctl;
Select cuscan_forecast_segment,account_number,TA_Call_Cust,WC_Call_Cust,TA_Saves,WC_Saves,DTV_Offer_Applied,
Row_number() over(partition by cuscan_forecast_segment order by TA_Saves,WC_Saves,DTV_Offer_Applied) Segment_Rnk,
Count(*) over(partition by cuscan_forecast_segment) Total_Accs,
Cast(Segment_Rnk as float)/Total_Accs as CusCan_Segment_Pctl
into #WC_PC_Pctl
from Forecast_Loop_Table_2
where WC_Call_Cust > 0 and DTV_Status_Code not in ('AB','PC')
;
update Forecast_Loop_Table_2 as a
set WC_DTV_PC = case when rand_WC_DTV_PC_Vol <= pred_WC_DTV_PC_rate and a.WC_Call_Cust > 0
then 1
else 0
end
,WC_Sky_Plus_Save = case when rand_WC_DTV_PC_Vol > pred_WC_DTV_PC_rate
and rand_WC_DTV_PC_Vol < cum_WC_DTV_PC_rate
and a.WC_Call_Cust >0
then 1
else 0
end
from Forecast_Loop_Table_2 as a
inner join
#WC_PC_Pctl pc
on pc.account_number = a.account_number;
update Forecast_Loop_Table_2 as a
set Other_DTV_PC = 1
where a.TA_Call_Cust = 0 and a.WC_Call_Cust = 0 and a.DTV_Offer_Applied = 0
and rand_Other_DTV_PC_Vol <= pred_Other_DTV_PC_rate
;
Update Forecast_Loop_Table_2
Set rand_action_Syscan = Case when TA_Call_Cust + WC_Call_Cust > 0 then 1
else null
end;
Update Forecast_Loop_Table_2
Set rand_action_Syscan = rand(number(*)*multiplier+4)
where rand_action_Syscan is null;
-- the low ranking customers will be the ones with no TA / WC
Drop table if exists #SysCan_Rank;
Select
account_number
,rand_action_Syscan
,sum(TA_Call_Cust+WC_Call_Cust) over(partition by Syscan_Forecast_segment) SysCan_Seg_CusCan_Actions
,count(*) over(partition by Syscan_Forecast_segment) Total_Cust_In_SysCan_Segment
,cast(rank() over(partition by Syscan_Forecast_segment order by rand_action_Syscan) as float) as SysCan_Group_rank
,cast(rank() over(partition by Syscan_Forecast_segment order by rand_action_Syscan) as float)/cast(Syscan_segment_count as float) as pct_syscan_count
,case when TA_Call_Cust+WC_Call_Cust = 0
and rand_action_Syscan <= pred_dtv_AB_rate*Total_Cust_In_SysCan_Segment/(Total_Cust_In_SysCan_Segment-SysCan_Seg_CusCan_Actions)
then 1
else 0
end as DTV_AB
into #SysCan_Rank
from Forecast_Loop_Table_2;
commit;
create hg index idx_1 on #SysCan_Rank(account_number);
-- Update Forecast_Loop_Table_2
-- Set SysCan_Group_rank = b.SysCan_Group_rank,
-- pct_syscan_count = b.pct_syscan_count
-- from Forecast_Loop_Table_2 a
-- inner join
-- #SysCan_Rank b
-- on a.account_number = b.account_number;
update Forecast_Loop_Table_2 as a
set DTV_AB = 1
from Forecast_Loop_Table_2 as a
inner join
#SysCan_Rank b
on b.account_number = a.account_number
and b.DTV_AB = 1
;
Update Forecast_Loop_Table_2 as a
Set DTV_Offer_Applied = 1
where --TA_Call_Cust = 1 and rand_TA_DTV_Offer_Applied <= pred_TA_DTV_Offer_Applied_rate + pred_TA_DTV_Offer_Applied_YoY_Trend
--or
TA_Call_Cust = 0 and rand_NonTA_DTV_Offer_Applied <= pred_NonTA_DTV_Offer_Applied_rate + pred_NonTA_DTV_Offer_Applied_YoY_Trend
;
Update Forecast_Loop_Table_2
Set DTV_Status_Code_EoW = AB.Next_Status_Code,
DTV_Offer_Applied = AB.AB_ReAC_Offer_Applied
from Forecast_Loop_Table_2 base
inner join
IntraWk_AB_Pct AB
on base.rand_Intrawk_DTV_AB between AB.IntaWk_AB_Lower_Pctl and AB.IntaWk_AB_Upper_Pctl
where DTV_AB > 0;
Update Forecast_Loop_Table_2 base
Set DTV_Status_Code_EoW = PC.Next_Status_Code,
DTV_Offer_Applied = PC.PC_ReAC_Offer_Applied
from Forecast_Loop_Table_2 base
inner join
IntraWk_PC_Pct PC
on base.rand_Intrawk_DTV_PC between PC.IntaWk_PC_Lower_Pctl and PC.IntaWk_PC_Upper_Pctl
where TA_DTV_PC > 0
or
WC_DTV_PC > 0
or
TA_Sky_Plus_Save > 0
or
WC_Sky_Plus_Save > 0
or
Other_DTV_PC > 0;
Update Forecast_Loop_Table_2 base
Set DTV_Status_Code_EoW = PC.Status_Code_EoW,
DTV_Offer_Applied = PC.PC_ReAC_Offer_Applied
from Forecast_Loop_Table_2 base
inner join
PC_PL_Status_Change_Dist PC
on base.rand_DTV_PC_Status_Change between PC.PC_Percentile_Lower_Bound and PC.PC_Percentile_Upper_Bound
and Case when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=0 then 'Churn in next 1 wks'
when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=1 then 'Churn in next 2 wks'
when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=2 then 'Churn in next 3 wks'
when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=3 then 'Churn in next 4 wks'
when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=4 then 'Churn in next 5 wks'
when (cast(base.DTV_PC_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7>=5 then 'Churn in next 6+ wks'
-- when (cast(PC_Future_Sub_Effective_Dt as integer) - cast(End_Date as integer))/7>5 then '6+_Wks_To_Churn'
end = PC.Wks_To_Intended_Churn
where DTV_Status_Code = 'PC'
and
(TA_DTV_PC = 0
and
WC_DTV_PC = 0
and
TA_Sky_Plus_Save = 0
and
WC_Sky_Plus_Save = 0
and
Other_DTV_PC = 0)
;
Update Forecast_Loop_Table_2 base
Set DTV_Status_Code_EoW = AB.Status_Code_EoW,
DTV_Offer_Applied = AB.AB_ReAC_Offer_Applied
from Forecast_Loop_Table_2 base
inner join
AB_PL_Status_Change_Dist AB
on base.rand_DTV_PC_Status_Change between AB.AB_Percentile_Lower_Bound and AB.AB_Percentile_Upper_Bound
and Case when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=0 then 'Churn in next 1 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=1 then 'Churn in next 2 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=2 then 'Churn in next 3 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=3 then 'Churn in next 4 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=4 then 'Churn in next 4 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=5 then 'Churn in next 6 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=6 then 'Churn in next 7 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=7 then 'Churn in next 8 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7=8 then 'Churn in next 9 wks'
when (cast(base.DTV_AB_Future_Sub_Effective_Dt as integer) - cast(base.End_Date as integer))/7>=9 then 'Churn in next 10+ wks'
-- when (cast(PC_Future_Sub_Effective_Dt as integer) - cast(End_Date as integer))/7>5 then '6+_Wks_To_Churn'
end = AB.Wks_To_Intended_Churn
where DTV_Status_Code = 'AB' and DTV_AB = 0;
Update Forecast_Loop_Table_2 base
Set CusCan = 1
where DTV_Status_Code_EoW = 'PO';
Update Forecast_Loop_Table_2 base
Set SysCan = 1
where DTV_Status_Code_EoW = 'SC';
END;
-- Grant execute rights to the members of CITeam
grant execute on CITeam.Forecast_Loop_Table_2_Actions to CITeam;
-- Change back to your account
Setuser;
-- Test it
Call CITeam.Forecast_Loop_Table_2_Actions(10);
| true |
304c832d792127aed9f17e537a772a6c2f266feb | SQL | dragosconst/proiect-SGBD | /Tantaru_Dragos-Constantin_SQL.sql | UTF-8 | 16,840 | 3.625 | 4 | [] | no_license | -- Un subprogram care determina in care librarii se gaseste cartea introdusa ca parametru si ce abonamente o includ.
CREATE OR REPLACE PROCEDURE ex6 (v_nume_carte carti.denumire%TYPE )IS
TYPE string_tabel IS TABLE OF VARCHAR2(60) INDEX BY PLS_INTEGER;
TYPE number_tabel IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
v_id_carte carti.carte_id%TYPE := NULL;
v_librarii string_tabel;
v_abonamente string_tabel;
v_pret abonamente.plata_lunara%TYPE;
BEGIN
SELECT carte_id INTO v_id_carte
FROM carti
WHERE v_nume_carte = carti.denumire;
SELECT l.denumire BULK COLLECT INTO v_librarii
FROM librarii l, se_afla_in sai
WHERE sai.carte_id = v_id_carte AND sai.librarie_id = l.librarie_id;
DBMS_OUTPUT.put(v_nume_carte || ' se gaseste in librariile: ');
FOR i IN 1..v_librarii.last LOOP
DBMS_OUTPUT.put(v_librarii(i) || ' ');
END LOOP;
DBMS_OUTPUT.NEW_LINE();
SELECT a.abonament_id BULK COLLECT INTO v_abonamente
FROM abonamente a, carte_inclusa ci
WHERE ci.carte_id = v_id_carte AND ci.abonament_id = a.abonament_id;
IF v_abonamente.count = 0 THEN
DBMS_OUTPUT.PUT_LINE('Cartea nu este inclusa in niciun abonament.');
ELSE
DBMS_OUTPUT.PUT(v_nume_carte || ' este inclusa in format digital in abonamentele: ');
FOR i in 1..v_abonamente.last LOOP
SELECT a.plata_lunara INTO v_pret
FROM abonamente a
WHERE a.abonament_id = v_abonamente(i);
DBMS_OUTPUT.PUT('abonamentul ' || v_abonamente(i) || ' cu pretul ' || v_pret || ', ');
END LOOP;
DBMS_OUTPUT.NEW_LINE();
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Cartea nu exista.');
END;
/
--O procedura care cauta angajatii cu vechime data ca parametru dintr-o librarie data de asemenea ca parametru si le mareste
--salariul cu 15%.
CREATE OR REPLACE PROCEDURE ex7 (vechime NUMBER,
cod_librarie librarii.librarie_id%TYPE)
IS
CURSOR c (pvec NUMBER, pcod librarii.librarie_id%TYPE) IS
SELECT a.angajat_id, a.nume, a.prenume, a.manager_id
FROM angajati a, lucreaza_in li
WHERE TRUNC ((SYSDATE) - a.data_angajarii) / 365.5 >= pvec AND li.angajat_id = a.angajat_id AND li.librarie_id = pcod;
BEGIN
FOR i in c(vechime, cod_librarie) LOOP
IF i.manager_id IS NOT NULL THEN
UPDATE angajati
SET salariu = salariu + salariu * 15 / 100
WHERE angajat_id = i.angajat_id;
DBMS_OUTPUT.PUT_LINE('A fost marit salariul anagajtului\ei ' || i.nume || ' ' || i.prenume || ' .');
END IF;
END LOOP;
END;
/
CREATE OR REPLACE TYPE int_table IS VARRAY(3) OF NUMBER;
/
--Dandu-se denumirea unui job, vrem un sir de numere ce reprezinta
--cati angajati au job-ul respectiv in fiecare librarie.
CREATE OR REPLACE FUNCTION f8 (job_name jobs.denumire%TYPE)
RETURN int_table
IS
v_job_id angajati.job_id%TYPE;
v_check NUMBER;
v_old_lib_val NUMBER := -1;
v_counter NUMBER := 1;
v_found_job NUMBER := 0;
retval int_table := int_table(0,0,0);
BEGIN
SELECT job_id INTO v_job_id
FROM jobs
WHERE denumire = job_name;
SELECT COUNT(*) INTO v_check -- verific daca exista angajati cu job-ul dat
FROM angajati a
WHERE a.job_id = v_job_id;
IF v_check = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista angajati cu job-ul dat.');
END IF;
FOR i IN (SELECT l.librarie_id, a.job_id, COUNT(*) c
FROM angajati a, lucreaza_in li, librarii l
WHERE a.angajat_id = li.angajat_id AND li.librarie_id = l.librarie_id
GROUP BY l.librarie_id, a.job_id
ORDER BY l.librarie_id) LOOP
IF v_old_lib_val = -1 THEN -- prima intrare in for
v_old_lib_val := i.librarie_id;
END IF;
IF i.librarie_id != v_old_lib_val THEN -- am ajuns in gruparea pentru urmatoarea librarie
v_counter := v_counter + 1;
v_old_lib_val := i.librarie_id;
IF v_found_job = 0 THEN
retval(v_counter - 1) := 0;
END IF;
v_found_job := 0;
END IF;
IF i.job_id = v_job_id THEN
v_found_job := 1;
retval(v_counter) := i.c;
END IF;
END LOOP;
RETURN retval;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista jobul dat');
END;
/
--Vreau sa obtin o lista cu toti membrii care au abonamente cu carti din libraria data in procedura.
--Lista contine si numele abonamentului despre care este vorba.
CREATE OR REPLACE PROCEDURE p9 (lib_name librarii.denumire%TYPE)
IS
TYPE nume IS RECORD (abonament_id abonamente.abonament_id%TYPE,
nume membri.nume%TYPE,
prenume membri.prenume%TYPE);
TYPE name_table IS TABLE OF nume INDEX BY PLS_INTEGER;
v_lib_id librarii.librarie_id%TYPE;
flag NUMBER := 0;
v_data name_table;
BEGIN
SELECT librarie_id INTO v_lib_id
FROM librarii
WHERE denumire = lib_name;
SELECT a.abonament_id, m.nume, m.prenume BULK COLLECT INTO v_data
FROM membri m, abonamente a, carte_inclusa ci, carti c, se_afla_in sai
WHERE sai.librarie_id = v_lib_id AND sai.carte_id = c.carte_id AND c.carte_id = ci.carte_id AND ci.abonament_id = a.abonament_id AND m.abonament_id = a.abonament_id
GROUP BY a.abonament_id, m.nume, m.prenume;
IF v_data.count = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista membrii cu abonamente care includ carti in libraria ceruta.');
END IF;
FOR i in 1..v_data.last LOOP
DBMS_OUTPUT.PUT_LINE('Abonamentul ' || v_data(i).abonament_id || ', detinut de membrul ' || v_data(i).nume || ' ' || v_data(i).prenume || '.');
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista libraria ceruta.');
END;
/
--Nu e permis sa fie schimbati membrii in timpul weekend-ului sau in afara orelor de program.
CREATE OR REPLACE TRIGGER T10
BEFORE INSERT OR DELETE OR UPDATE ON Membri
BEGIN
IF (TO_CHAR(SYSDATE, 'D') = 1 OR TO_CHAR(SYSDATE, 'D') = 7)
OR TO_CHAR(SYSDATE, 'HH24') NOT BETWEEN 8 AND 21 THEN
RAISE_APPLICATION_ERROR(-20001, 'Nu se pot face modificari la tabelul membrilor in acest interval orar');
END IF;
END;
/
--Cand pretul unei carti este schimbat, vrem ca schimbarea sa fie reflectata si in abonament, in cazul in care scumpim cartea
--Daca scoatem o carte din stoc, vom ieftini abonamentul cu procentajul pe care pretul cartii il reprezenta din intregul pachet al abonamentului.
--Pt a evita trigger mutating, vom folosi o colectie intr-un pachet, care este intializata cu un trigger la nivel de comanda.
CREATE OR REPLACE PACKAGE trig_help
AS
TYPE abo IS TABLE OF abonamente%ROWTYPE INDEX BY PLS_INTEGER;
TYPE car IS TABLE OF carti%ROWTYPE INDEX BY PLS_INTEGER;
TYPE ci IS TABLE OF carte_inclusa%ROWTYPE INDEX BY PLS_INTEGER;
abonamente_c abo;
carte_c car;
carte_inclusa_c ci;
end;
/
CREATE OR REPLACE TRIGGER T11_HELP
BEFORE UPDATE OR DELETE ON carti
BEGIN
SELECT * BULK COLLECT INTO trig_help.abonamente_c
FROM abonamente;
SELECT * BULK COLLECT INTO trig_help.carte_c
FROM carti;
SELECT * BULK COLLECT INTO trig_help.carte_inclusa_c
FROM carte_inclusa;
END;
/
CREATE OR REPLACE TRIGGER T11
BEFORE UPDATE OR DELETE ON carti
FOR EACH ROW
DECLARE
buffr number;
v_pret_total NUMBER(4);
v_pret_carte NUMBER(4);
v_crestere_prop NUMBER(4);
BEGIN
IF UPDATING THEN
IF :NEW.carte_id != :OLD.carte_id THEN
RAISE_APPLICATION_ERROR(-20001,'Nu este permisa schimbarea cheiilor primare din tabelul Carte');
END IF;
FOR i in 1..trig_help.abonamente_c.last LOOP
v_pret_total := 0;
IF :NEW.pret > :OLD.pret THEN -- ne intereseaza sa modificam doar daca pretul cartii e crescut
FOR j in 1..trig_help.carte_c.last LOOP
buffr := 0;
SELECT COUNT(*) INTO buffr --nu o sa avem mutating, pt ca id-ul cartii nu se schimba
FROM carte_inclusa ci
WHERE ci.abonament_id = trig_help.abonamente_c(i).abonament_id AND ci.carte_id = trig_help.carte_c(j).carte_id;
IF buffr > 0 THEN
v_pret_total := v_pret_total + trig_help.carte_c(j).pret; -- deoarece valorile sunt luate cu un trigger before, e ca si cum am apela :OLD pt valoarea schimbata
END IF;
END LOOP;
v_crestere_prop := :NEW.pret / :OLD.pret;
UPDATE abonamente -- crestem proportia
SET plata_lunara = plata_lunara + (:NEW.pret / v_pret_total) * plata_lunara
WHERE abonament_id = trig_help.abonamente_c(i).abonament_id;
END IF;
END LOOP;
ELSE --DELETING
FOR i in 1..trig_help.abonamente_c.last LOOP
v_pret_total := 0;
FOR j in 1..trig_help.carte_c.last LOOP
buffr := 0;
-- trebuie sa folosim colectia din pachet, deoarece id-ul cartii este scos si din carte_inclusa
FOR k in 1..trig_help.carte_inclusa_c.last LOOP
IF trig_help.carte_inclusa_c(k).abonament_id = trig_help.abonamente_c(i).abonament_id
AND trig_help.carte_inclusa_c(k).carte_id = trig_help.carte_c(j).carte_id THEN
buffr := 1;
END IF;
END LOOP;
IF buffr > 0 THEN
v_pret_total := v_pret_total + trig_help.carte_c(j).pret; -- deoarece valorile sunt luate cu un trigger before, e ca si cum am apela :OLD pt valoarea schimbata
END IF;
END LOOP;
UPDATE abonamente -- crestem proportia
SET plata_lunara = plata_lunara - (:OLD.pret / v_pret_total) * plata_lunara
WHERE abonament_id = trig_help.abonamente_c(i).abonament_id;
END LOOP;
END IF;
END;
/
--Voi face un audit, pentru a avea un istoric al comenzilor facute pe baza de date.
CREATE TABLE audit_lib
(utilizator VARCHAR2(50),
nume_bd VARCHAR2(50),
eveniment VARCHAR2(50),
nume_obiect VARCHAR2(50),
data DATE);
CREATE OR REPLACE TRIGGER T12
AFTER CREATE OR DROP OR ALTER ON SCHEMA
BEGIN
INSERT INTO audit_lib
VALUES (SYS.LOGIN_USER, SYS.DATABASE_NAME, SYS.SYSEVENT,
SYS.DICTIONARY_OBJ_NAME, SYSDATE);
END;
/
CREATE OR REPLACE PACKAGE proiect AS
TYPE int_table IS VARRAY(3) OF NUMBER;
PROCEDURE ex6 (v_nume_carte carti.denumire%TYPE);
PROCEDURE ex7 (vechime NUMBER,
cod_librarie librarii.librarie_id%TYPE);
FUNCTION f8 (job_name jobs.denumire%TYPE)
RETURN int_table;
PROCEDURE p9 (lib_name librarii.denumire%TYPE);
END proiect;
/
CREATE OR REPLACE PACKAGE BODY proiect AS
PROCEDURE ex6 (v_nume_carte carti.denumire%TYPE )IS
TYPE string_tabel IS TABLE OF VARCHAR2(60) INDEX BY PLS_INTEGER;
TYPE number_tabel IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
v_id_carte carti.carte_id%TYPE := NULL;
v_librarii string_tabel;
v_abonamente string_tabel;
v_pret abonamente.plata_lunara%TYPE;
BEGIN
SELECT carte_id INTO v_id_carte
FROM carti
WHERE v_nume_carte = carti.denumire;
SELECT l.denumire BULK COLLECT INTO v_librarii
FROM librarii l, se_afla_in sai
WHERE sai.carte_id = v_id_carte AND sai.librarie_id = l.librarie_id;
DBMS_OUTPUT.put(v_nume_carte || ' se gaseste in librariile: ');
FOR i IN 1..v_librarii.last LOOP
DBMS_OUTPUT.put(v_librarii(i) || ' ');
END LOOP;
DBMS_OUTPUT.NEW_LINE();
SELECT a.abonament_id BULK COLLECT INTO v_abonamente
FROM abonamente a, carte_inclusa ci
WHERE ci.carte_id = v_id_carte AND ci.abonament_id = a.abonament_id;
IF v_abonamente.count = 0 THEN
DBMS_OUTPUT.PUT_LINE('Cartea nu este inclusa in niciun abonament.');
ELSE
DBMS_OUTPUT.PUT(v_nume_carte || ' este inclusa in format digital in abonamentele: ');
FOR i in 1..v_abonamente.last LOOP
SELECT a.plata_lunara INTO v_pret
FROM abonamente a
WHERE a.abonament_id = v_abonamente(i);
DBMS_OUTPUT.PUT('abonamentul ' || v_abonamente(i) || ' cu pretul ' || v_pret || ', ');
END LOOP;
DBMS_OUTPUT.NEW_LINE();
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Cartea nu exista.');
END ex6;
PROCEDURE ex7 (vechime NUMBER,
cod_librarie librarii.librarie_id%TYPE)
IS
CURSOR c (pvec NUMBER, pcod librarii.librarie_id%TYPE) IS
SELECT a.angajat_id, a.nume, a.prenume, a.manager_id
FROM angajati a, lucreaza_in li
WHERE TRUNC ((SYSDATE) - a.data_angajarii) / 365.5 >= pvec AND li.angajat_id = a.angajat_id AND li.librarie_id = pcod;
BEGIN
FOR i in c(vechime, cod_librarie) LOOP
IF i.manager_id IS NOT NULL THEN
UPDATE angajati
SET salariu = salariu + salariu * 15 / 100
WHERE angajat_id = i.angajat_id;
DBMS_OUTPUT.PUT_LINE('A fost marit salariul anagajtului\ei ' || i.nume || ' ' || i.prenume || ' .');
END IF;
END LOOP;
END ex7;
FUNCTION f8 (job_name jobs.denumire%TYPE)
RETURN int_table
IS
v_job_id angajati.job_id%TYPE;
v_check NUMBER;
v_old_lib_val NUMBER := -1;
v_counter NUMBER := 1;
v_found_job NUMBER := 0;
retval int_table := int_table(0,0,0);
BEGIN
SELECT job_id INTO v_job_id
FROM jobs
WHERE denumire = job_name;
SELECT COUNT(*) INTO v_check -- verific daca exista angajati cu job-ul dat
FROM angajati a
WHERE a.job_id = v_job_id;
IF v_check = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista angajati cu job-ul dat.');
END IF;
FOR i IN (SELECT l.librarie_id, a.job_id, COUNT(*) c
FROM angajati a, lucreaza_in li, librarii l
WHERE a.angajat_id = li.angajat_id AND li.librarie_id = l.librarie_id
GROUP BY l.librarie_id, a.job_id
ORDER BY l.librarie_id) LOOP
IF v_old_lib_val = -1 THEN -- prima intrare in for
v_old_lib_val := i.librarie_id;
END IF;
IF i.librarie_id != v_old_lib_val THEN -- am ajuns in gruparea pentru urmatoarea librarie
v_counter := v_counter + 1;
v_old_lib_val := i.librarie_id;
IF v_found_job = 0 THEN
retval(v_counter - 1) := 0;
END IF;
v_found_job := 0;
END IF;
IF i.job_id = v_job_id THEN
v_found_job := 1;
retval(v_counter) := i.c;
END IF;
END LOOP;
RETURN retval;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista jobul dat');
END f8;
PROCEDURE p9 (lib_name librarii.denumire%TYPE)
IS
TYPE nume IS RECORD (abonament_id abonamente.abonament_id%TYPE,
nume membri.nume%TYPE,
prenume membri.prenume%TYPE);
TYPE name_table IS TABLE OF nume INDEX BY PLS_INTEGER;
v_lib_id librarii.librarie_id%TYPE;
flag NUMBER := 0;
v_data name_table;
BEGIN
SELECT librarie_id INTO v_lib_id
FROM librarii
WHERE denumire = lib_name;
SELECT a.abonament_id, m.nume, m.prenume BULK COLLECT INTO v_data
FROM membri m, abonamente a, carte_inclusa ci, carti c, se_afla_in sai
WHERE sai.librarie_id = v_lib_id AND sai.carte_id = c.carte_id AND c.carte_id = ci.carte_id AND ci.abonament_id = a.abonament_id AND m.abonament_id = a.abonament_id
GROUP BY a.abonament_id, m.nume, m.prenume;
IF v_data.count = 0 THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista membrii cu abonamente care includ carti in libraria ceruta.');
END IF;
FOR i in 1..v_data.last LOOP
DBMS_OUTPUT.PUT_LINE('Abonamentul ' || v_data(i).abonament_id || ', detinut de membrul ' || v_data(i).nume || ' ' || v_data(i).prenume || '.');
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-20000, 'Nu exista libraria ceruta.');
END p9;
END proiect;
/ | true |
4b9c438436c9b30eac3797aa1e72661a056f4e6f | SQL | HerrAugust/ServiceOrientedApplication | /SQL/bank.sql | UTF-8 | 2,104 | 3.6875 | 4 | [] | no_license | DROP DATABASE IF EXISTS bank;
CREATE DATABASE IF NOT EXISTS bank;
GRANT ALL PRIVILEGES ON bank.* TO 'bank'@'localhost' IDENTIFIED BY 'bank';
USE `bank`;
CREATE TABLE `addresses` (
`id` INT(6) NOT NULL AUTO_INCREMENT,
`street` VARCHAR(50) NOT NULL,
`city` VARCHAR(50) NOT NULL,
`country` VARCHAR(50) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `accounts` (
`id` INT(6) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL UNIQUE,
`password` VARCHAR(50) NOT NULL,
`firstname` VARCHAR(50) NOT NULL,
`lastname` VARCHAR(50) NOT NULL,
`amount` DOUBLE NOT NULL,
`address` INT(6) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`address`) REFERENCES `addresses`(`id`)
);
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("Montefiore", "Sart-Tilmant", "Belgium");
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("", "Paris", "France");
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("", "Barcelona", "Spain");
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("", "Roma", "Italy");
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("", "Berlin", "Germany");
INSERT INTO `addresses`(`street`, `city`, `country`) VALUES ("", "Athenes", "Greece");
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test0", "test0", "test0", "test0", 0, 1);
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test1", "test1", "test1", "test1", 100, 2);
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test2", "test2", "test2", "test2", 200, 3);
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test3", "test3", "test3", "test3", 300, 4);
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test4", "test4", "test4", "test4", 400, 5);
INSERT INTO `accounts`(`username`, `password`, `firstname`, `lastname`, `amount`, `address`) VALUES ("test5", "test5", "test5", "test5", 500, 6);
| true |
61bd590be50ec27aa250a1befecc8c0a0b163b7d | SQL | complitex/flexpay | /eirc/etc/sql/update/2009_01_12.sql | UTF-8 | 598 | 3.09375 | 3 | [] | no_license | alter table eirc_quittance_packets_tbl
drop index eirc_quittance_packets_tbl_payment_id,
drop foreign key eirc_quittance_packets_tbl_payment_id;
alter table eirc_quittance_packets_tbl
change column payment_id payment_point_id bigint not null comment 'Payment point reference';
alter table eirc_quittance_packets_tbl
add index eirc_quittance_packets_tbl_payment_id (payment_point_id),
add constraint eirc_quittance_packets_tbl_payment_id
foreign key (payment_point_id)
references eirc_payment_points_tbl (id);
update common_version_tbl set last_modified_date='2009-01-12', date_version=0;
| true |
f271a726effbc9396f571a40d37360a4690a170c | SQL | lizcolores/codewars-sql | /BugFixing.sql | UTF-8 | 281 | 3.921875 | 4 | [] | no_license | SELECT
DISTINCT(j.job_title),
CAST(ROUND(SUM(j.salary)/COUNT(p), 2) AS float) as average_salary,
COUNT(p.id) as total_people,
CAST(ROUND(SUM(j.salary), 2) AS float) as total_salary
FROM people p
JOIN job j
ON p.id = j.people_id
GROUP BY j.job_title
ORDER BY average_salary desc;
| true |
a69e295289c8f5ce3726c2b59a314e4b41b297da | SQL | R2RITO/MPD-EM2015 | /Scripts - Originals/CA_Trap.sql | UTF-8 | 445 | 2.609375 | 3 | [] | no_license | CREATE OR REPLACE FUNCTION CA_Trap (CT_Domain VARCHAR2, CT_Label VARCHAR2)
RETURN Trapezoid_Objtyp
is
UD_reg UDLinLab_tab%rowtype;
CT_T Trapezoid_Objtyp;
BEGIN
SELECT * INTO UD_reg
FROM UDLinLab_tab
WHERE User_name=user AND Label=CT_Label AND Dom_name=CT_Domain;
CT_T:=UD_reg.Trapezoid;
RETURN CT_T;
EXCEPTION when NO_DATA_FOUND THEN
CT_T:= CA_UserDefault(CT_Domain,CT_Label);
RETURN CT_T;
END;
/ | true |
e60af1919301894bce95d413ca458ceb04854d9f | SQL | ironartisan/tams | /src/main/resources/db/migration/V1.2__CreatePaper.sql | UTF-8 | 1,646 | 3.359375 | 3 | [] | no_license |
# 创建教改论文表
create table paper
(
ppno int(6) not null COMMENT '论文编号',
ppname varchar(50) null COMMENT '论文名称',
author int(11) null COMMENT '作者',
journal varchar(50) null COMMENT '期刊',
pubdate bigint(11) null COMMENT '出版日期',
rank varchar(50) null COMMENT '等级:SCI(006)、EI(JA)(007)、EI(CA)(008),核心(009)、计算机教育(010),一般(011)',
rankno int(3) not null COMMENT '等级编号',
ppurl varchar(100) null COMMENT '论文图片地址',
isconfirmed tinyint(1) NULL DEFAULT NULL COMMENT '是否被确认',
constraint paper_pk
primary key (ppno)
);
# 插入论文信息
insert into paper values(300001,"论文1",2012012010,"",1567343905303,"SCI",006,"",0);
insert into paper values(300002,"论文2",2012012011,"",1567343905303,"EI(JA)",007,"",0);
insert into paper values(300003,"论文3",2012012010,"",1567343905303,"EI(CA)",008,"",0);
insert into paper values(300004,"论文4",2012012013,"",1567343905303,"核心",009,"",0);
insert into paper values(300005,"论文5",2012012016,"",1567343905303,"计算机教育",010,"",0);
insert into paper values(300006,"论文6",2012012011,"",1567343905303,"SCI",006,"",0);
insert into paper values(300007,"论文7",2012012011,"",1567343905303,"一般",011,"",0);
insert into paper values(300008,"论文8",2012012010,"",1567343905303,"SCI",006,"",0);
insert into paper values(300009,"论文9",2012012012,"",1567343905303,"SCI",006,"",0);
insert into paper values(300010,"论文10",2012012013,"",1567343905303,"SCI",006,"",0);
insert into paper values(300011,"论文11",2012012014,"",1567343905303,"SCI",006,"",0);
| true |
69bfdc68b2f21a7620df48186dc7554c853a0f92 | SQL | yifeng2019uwb/DataCampAndCodePractice | /Data-Analyst-with-SQL-Server/01-Introduction-to-SQL-Server/04-You're-got-power/11-Ultimate-Power.sql | UTF-8 | 1,264 | 4.5 | 4 | [] | no_license | /*
Ultimate Power
Sometimes you might want to 'save' the results of a query so you can do some more work with the data. You can do that by creating a temporary table that remains in the database until SQL Server is restarted. In this final exercise, you'll select the longest track from every album and add that into a temporary table which you'll create as part of the query.
*/
/*
Create a temporary table called maxtracks. Make sure the table name starts with #.
Join album to artist using artist_id, and track to album using album_id.
Run the final SELECT statement to retrieve all the columns from your new table.
*/
SELECT album.title AS album_title,
artist.name as artist,
MAX(track.milliseconds / (1000 * 60) % 60 ) AS max_track_length_mins
-- Name the temp table #maxtracks
INTO #maxtracks
FROM album
-- Join album to artist using artist_id
INNER JOIN artist ON album.artist_id = artist.artist_id
-- Join track to album using album_id
INNER JOIN track ON track.album_id = album.album_id
GROUP BY artist.artist_id, album.title, artist.name,album.album_id
-- Run the final SELECT query to retrieve the results from the temporary table
SELECT album_title, artist, max_track_length_mins
FROM #maxtracks
ORDER BY max_track_length_mins DESC, artist;
| true |
70f9e1d6479e7edd3b34c05032e1db16152c78e7 | SQL | seat-project-2016/Python-Api-Code- | /seatdriversapp.sql | UTF-8 | 4,383 | 3.34375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 10, 2016 at 02:20 PM
-- 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: `seatdriversapp`
--
-- --------------------------------------------------------
--
-- Table structure for table `driver`
--
CREATE TABLE IF NOT EXISTS `driver` (
`id` int(11) NOT NULL,
`name` varchar(128) NOT NULL,
`phone_number` varchar(16) NOT NULL,
`registered_date` datetime NOT NULL,
`status` varchar(64) DEFAULT NULL,
`reason` varchar(128) DEFAULT NULL,
`status_changed_date` datetime NOT NULL,
`user_id` int(11) NOT NULL,
`profile_image` text,
`device_id` text NOT NULL,
`os_type` varchar(16) NOT NULL,
`auth_code` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `driverdetails`
--
CREATE TABLE IF NOT EXISTS `driverdetails` (
`id` int(11) NOT NULL,
`proofname` varchar(128) NOT NULL,
`image` text NOT NULL,
`expiry_dl` datetime NOT NULL,
`dl_details` text,
`expiry_rc` datetime NOT NULL,
`rc_details` text,
`expiry_tax_paid` datetime NOT NULL,
`tax_paid_details` text,
`expiry_insurance` datetime NOT NULL,
`insurance_details` text,
`driver_id` int(11) NOT NULL,
`driver_user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL,
`name` varchar(128) NOT NULL,
`phone_number` varchar(16) NOT NULL,
`email_Id` varchar(128) NOT NULL,
`user_role_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `userrole`
--
CREATE TABLE IF NOT EXISTS `userrole` (
`id` int(11) NOT NULL,
`role` varchar(128) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `userrole`
--
INSERT INTO `userrole` (`id`, `role`) VALUES
(1, 'Driver');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `driver`
--
ALTER TABLE `driver`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `phone_number` (`phone_number`), ADD KEY `user_id` (`user_id`), ADD KEY `user_id_2` (`user_id`), ADD KEY `user_id_3` (`user_id`);
--
-- Indexes for table `driverdetails`
--
ALTER TABLE `driverdetails`
ADD PRIMARY KEY (`id`), ADD KEY `driver_id` (`driver_id`,`driver_user_id`), ADD KEY `driver_user_id` (`driver_user_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `phone_number` (`phone_number`), ADD KEY `user_role_id` (`user_role_id`);
--
-- Indexes for table `userrole`
--
ALTER TABLE `userrole`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `driver`
--
ALTER TABLE `driver`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `driverdetails`
--
ALTER TABLE `driverdetails`
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 for table `userrole`
--
ALTER TABLE `userrole`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `driver`
--
ALTER TABLE `driver`
ADD CONSTRAINT `driver_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `driverdetails`
--
ALTER TABLE `driverdetails`
ADD CONSTRAINT `driverdetails_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `driver` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`user_role_id`) REFERENCES `userrole` (`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 */;
| true |
445d273b52fa9e007bbb6e324cac9b7bffbe3432 | SQL | mannhuynh/PLSQL-by-Khaled-Part1 | /Section 13 - Woking with Packages/chapter-13-part-1.sql | UTF-8 | 3,652 | 3.625 | 4 | [] | no_license | drop table customer;
create table customer
(cust_id number,
name varchar2(100),
birthday date
);
--case 1 ( 2 procedure differ in number of parameters
create or replace package overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date);
procedure add_cust(p_id number,p_name varchar2);
end;
-------
create or replace package body overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date)
is
begin
insert into customer (cust_id,name,birthday)
values (p_id,p_name,p_bd);
commit;
end;
procedure add_cust(p_id number,p_name varchar2)
is
begin
insert into customer (cust_id,name)
values (p_id,p_name);
commit;
end;
end;
execute overload_proc.add_cust(1,'jack','1-jan-90');
select * from customer;
execute overload_proc.add_cust(2,'ford');
select * from customer;
-------------------------------------------------
--case 2 ( 2 procedure same number of parameters, differ in type)
create or replace package overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date);
procedure add_cust(p_id number,p_name varchar2);
procedure add_cust(p_name varchar2,p_id number);
end;
-------
create or replace package body overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date)
is
begin
insert into customer (cust_id,name,birthday)
values (p_id,p_name,p_bd);
commit;
end;
procedure add_cust(p_id number,p_name varchar2)
is
begin
insert into customer (cust_id,name)
values (p_id,p_name);
commit;
end;
procedure add_cust(p_name varchar2,p_id number)
is
begin
insert into customer (name,cust_id)
values (p_name,p_id);
commit;
end;
end;
execute overload_proc.add_cust('ali',3);
select * from customer;
-------------------------------------------------------------------
--case 3 ( 2 procedure same number of parameters, same family)
create or replace package overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date);
procedure add_cust(p_id integer,p_name varchar2,p_bd date);
end;
create or replace package body overload_proc
is
procedure add_cust(p_id number,p_name varchar2,p_bd date)
is
begin
insert into customer (cust_id,name,birthday)
values (p_id,p_name,p_bd);
commit;
end;
procedure add_cust(p_id integer,p_name varchar2,p_bd date)
is
begin
insert into customer (cust_id,name,birthday)
values (p_id,p_name,p_bd);
commit;
end;
end;
execute overload_proc.add_cust(10.6,'dina','1-jan-90');
------------------------------------------------------------------
--function case 1
create or replace package overload_funcion
is
function f1 (p1 number) return number;
function f1 (p1 number) return varchar2;
end;
create or replace package body overload_funcion
is
function f1 (p1 number) return number
is
begin
return p1;
end;
function f1 (p1 number) return varchar2
is
begin
return p1||'hi';
end;
end;
select overload_funcion.f1(1) from dual;
-------------------------------------------------------
--function case 2
create or replace package overload_funcion
is
function f1 (p1 number) return number;
function f1 (p1 varchar2) return varchar2;
end;
create or replace package body overload_funcion
is
function f1 (p1 number) return number
is
begin
return p1;
end;
function f1 (p1 varchar2) return varchar2
is
begin
return p1||'hi';
end;
end;
select overload_funcion.f1(1) from dual;
select overload_funcion.f1('1') from dual;
| true |
ef7f8653015e6ce8b0a283afb3e7c602495ee561 | SQL | JailtonDPaula13/controle_de_ativos | /passos acesso/steps.sql | UTF-8 | 830 | 3.046875 | 3 | [] | no_license | --primeiro passo criara tablespace
CREATE TABLESPACE TS_ATV
DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\TS_ATIVOS.DBF'
SIZE 50M AUTOEXTEND ON NEXT 10M MAXSIZE 200M;
--segundo criar usuário
CREATE USER JAILTON --nomenclatura do LOGIN
IDENTIFIED BY JD1 --definição da senha de acesso
DEFAULT TABLESPACE TS_ATV --TABLESPACE o qual deseja do acesso
;
--terceiro passo acesso a criar DB
GRANT CREATE SESSION TO JAILTON WITH ADMIN OPTION;
--quarto passo criar grant
grant create table to JAILTON with admin option;
grant create tablespace to JAILTON with admin option;
grant create sequence to jailton with admin option;
grant create procedure to jailton with admin option;
grant create view to jailton with admin option;
grant create trigger to jailton with admin option;
GRANT UNLIMITED TABLESPACE TO JAILTON WITH ADMIN OPTION; | true |
e21a916f6269534d2a647a7dcee6551b5026aab2 | SQL | ujjwalmishra/sociat | /api/schema.sql | UTF-8 | 2,313 | 3.546875 | 4 | [
"MIT"
] | permissive | CREATE EXTENSION postgis;
CREATE TABLE "User" (
"id" serial NOT NULL UNIQUE,
"email" varchar(255) NOT NULL UNIQUE,
"address" varchar(255),
"full_name" varchar(50) NOT NULL,
"area" integer NOT NULL,
"location" integer NOT NULL,
CONSTRAINT "User_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Location" (
"id" serial NOT NULL,
"location" geometry(point, 4326) NOT NULL,
"area" integer NOT NULL,
CONSTRAINT "Location_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Post" (
"id" serial NOT NULL,
"content" TEXT,
"area" integer NOT NULL,
CONSTRAINT "Post_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Media" (
"id" serial NOT NULL,
"type" VARCHAR(20) NOT NULL,
"link" VARCHAR(255) NOT NULL,
"post" integer NOT NULL,
CONSTRAINT "Media_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Comment" (
"id" serial NOT NULL,
"text" TEXT NOT NULL,
"user" integer NOT NULL,
"post" integer NOT NULL,
CONSTRAINT "Comment_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Reaction" (
"id" serial NOT NULL,
"type" VARCHAR(255) NOT NULL,
"post" integer NOT NULL,
CONSTRAINT "Reaction_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "Area" (
"id" serial NOT NULL,
"name" VARCHAR(255) NOT NULL,
"area" geometry(polygon, 4326) NOT NULL,
"parent" integer NOT NULL,
CONSTRAINT "Area_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
ALTER TABLE "User" ADD CONSTRAINT "User_fk0" FOREIGN KEY ("area") REFERENCES "Area"("id");
ALTER TABLE "User" ADD CONSTRAINT "User_fk1" FOREIGN KEY ("location") REFERENCES "Location"("id");
ALTER TABLE "Location" ADD CONSTRAINT "Location_fk0" FOREIGN KEY ("area") REFERENCES "Area"("id");
ALTER TABLE "Post" ADD CONSTRAINT "Post_fk0" FOREIGN KEY ("area") REFERENCES "Location"("id");
ALTER TABLE "Media" ADD CONSTRAINT "Media_fk0" FOREIGN KEY ("post") REFERENCES "Post"("id");
ALTER TABLE "Comment" ADD CONSTRAINT "Comment_fk0" FOREIGN KEY ("user") REFERENCES "User"("id");
ALTER TABLE "Comment" ADD CONSTRAINT "Comment_fk1" FOREIGN KEY ("post") REFERENCES "Post"("id");
ALTER TABLE "Reaction" ADD CONSTRAINT "Reaction_fk0" FOREIGN KEY ("post") REFERENCES "Post"("id");
ALTER TABLE "Area" ADD CONSTRAINT "Area_fk0" FOREIGN KEY ("parent") REFERENCES "Area"("id");
| true |
0254af158d99feb37e51ff539ce2d4adfea7dc46 | SQL | citraput/HackerRank-SQL | /23-Type_Of_Triangle.sql | UTF-8 | 273 | 2.984375 | 3 | [] | no_license | SELECT CASE
WHEN A + B <= C OR A + C <= B OR B + C <= A THEN 'Not A Triangle'
WHEN A = B AND A = C AND B = C THEN 'Equilateral'
WHEN A != B AND A != C AND B != C THEN 'Scalene'
WHEN A = B OR A = C OR B = C THEN 'Isosceles'
END AS 'Type'
FROM TRIANGLES;
| true |
fbf7a07f3a47f17344bb7f0ad3aa45413f6a692d | SQL | fengruo/NetShopping | /src/shopping.sql | UTF-8 | 8,830 | 3.453125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50716
Source Host : 127.0.0.1:3306
Source Database : shopping
Target Server Type : MYSQL
Target Server Version : 50716
File Encoding : 65001
Date: 2017-11-03 21:41:01
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for adminuser
-- ----------------------------
DROP TABLE IF EXISTS `adminuser`;
CREATE TABLE `adminuser` (
`adminname` varchar(20) NOT NULL DEFAULT '',
`adminpwd` varchar(20) DEFAULT NULL,
PRIMARY KEY (`adminname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of adminuser
-- ----------------------------
INSERT INTO `adminuser` VALUES ('admin', 'admin');
INSERT INTO `adminuser` VALUES ('luofeng', '951231');
-- ----------------------------
-- Table structure for goodsegory
-- ----------------------------
DROP TABLE IF EXISTS `goodsegory`;
CREATE TABLE `goodsegory` (
`egoryid` char(10) NOT NULL,
`egoryname` varchar(20) DEFAULT NULL,
`cades` text,
PRIMARY KEY (`egoryid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of goodsegory
-- ----------------------------
INSERT INTO `goodsegory` VALUES ('1', '印刷品', '');
INSERT INTO `goodsegory` VALUES ('2', '运动商品', null);
INSERT INTO `goodsegory` VALUES ('3', '电子商品', null);
-- ----------------------------
-- Table structure for lineitem
-- ----------------------------
DROP TABLE IF EXISTS `lineitem`;
CREATE TABLE `lineitem` (
`orderid` int(11) NOT NULL,
`GoodsNo` varchar(30) NOT NULL,
`quantity` int(11) NOT NULL,
`unitprice` decimal(10,2) NOT NULL,
PRIMARY KEY (`orderid`,`GoodsNo`),
KEY `GoodsNo` (`GoodsNo`),
CONSTRAINT `lineitem_ibfk_1` FOREIGN KEY (`orderid`) REFERENCES `orders` (`orderid`) ON UPDATE CASCADE,
CONSTRAINT `lineitem_ibfk_2` FOREIGN KEY (`GoodsNo`) REFERENCES `my_goods` (`GoodsNo`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of lineitem
-- ----------------------------
INSERT INTO `lineitem` VALUES ('16121514', '001', '1', '10.00');
INSERT INTO `lineitem` VALUES ('16121515', '001', '1', '10.00');
INSERT INTO `lineitem` VALUES ('16121545', '003 ', '330', '20.00');
-- ----------------------------
-- Table structure for mail
-- ----------------------------
DROP TABLE IF EXISTS `mail`;
CREATE TABLE `mail` (
`sendid` int(20) NOT NULL AUTO_INCREMENT,
`orderid` int(20) NOT NULL,
`sendtime` datetime DEFAULT NULL,
`sendaddress` varchar(150) DEFAULT NULL,
`sendstatus` tinyint(2) DEFAULT NULL,
PRIMARY KEY (`sendid`),
KEY `orderid` (`orderid`),
CONSTRAINT `mail_ibfk_1` FOREIGN KEY (`orderid`) REFERENCES `orders` (`orderid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of mail
-- ----------------------------
-- ----------------------------
-- Table structure for message
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`content` varchar(2000) DEFAULT NULL,
`time` datetime DEFAULT NULL,
`userid` int(11) DEFAULT NULL,
`mail` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `userid` (`userid`),
CONSTRAINT `message_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `reguser` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of message
-- ----------------------------
INSERT INTO `message` VALUES ('1', '123', '123456', '2016-12-24 13:41:15', '1', '12356');
INSERT INTO `message` VALUES ('2', 'liu', '马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明马永明', '2016-12-24 13:41:15', '13', '');
INSERT INTO `message` VALUES ('3', 'b', 'b', '2016-12-24 14:18:16', '1', null);
INSERT INTO `message` VALUES ('4', '2', '2', '2016-12-24 14:18:30', '1', null);
INSERT INTO `message` VALUES ('5', '3', '3', '2016-12-24 14:18:39', '1', null);
INSERT INTO `message` VALUES ('6', '1', '1', '2016-12-24 14:18:50', '1', null);
INSERT INTO `message` VALUES ('7', '哈哈', '哈哈', '2016-12-24 15:56:11', '13', '');
INSERT INTO `message` VALUES ('8', '颠三倒四', '是多少多少', '2016-12-24 15:58:16', '13', '');
-- ----------------------------
-- Table structure for my_goods
-- ----------------------------
DROP TABLE IF EXISTS `my_goods`;
CREATE TABLE `my_goods` (
`GoodsNo` varchar(30) NOT NULL,
`GoodsName` varchar(40) NOT NULL,
`egoryid` char(10) NOT NULL,
`Content` varchar(3000) DEFAULT NULL,
`unitprice` float DEFAULT NULL,
`Amount` int(11) DEFAULT NULL,
`Leav_number` int(11) DEFAULT NULL,
`RegTime` date NOT NULL,
PRIMARY KEY (`GoodsNo`),
KEY `egoryid` (`egoryid`),
CONSTRAINT `my_goods_ibfk_1` FOREIGN KEY (`egoryid`) REFERENCES `goodsegory` (`egoryid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of my_goods
-- ----------------------------
INSERT INTO `my_goods` VALUES ('001', '深思', '1', '杂志', '10', '500', '456', '2016-12-15');
INSERT INTO `my_goods` VALUES ('002', '四级题库', '1', '考试', '20', '500', '459', '2016-12-16');
INSERT INTO `my_goods` VALUES ('003', '故事书', '1', '休闲', '20', '500', '180', '2016-12-15');
INSERT INTO `my_goods` VALUES ('101', '足球', '2', '踢', '10', '200', '196', '2016-12-15');
INSERT INTO `my_goods` VALUES ('102', '篮球', '2', '拍', '20', '200', '180', '2016-12-15');
INSERT INTO `my_goods` VALUES ('103', '乒乓球', '2', '打', '20', '500', '489', '2016-12-15');
INSERT INTO `my_goods` VALUES ('201', '手表', '3', '时间', '100', '20', '20', '2016-12-15');
INSERT INTO `my_goods` VALUES ('202', '电脑', '3', '学习', '5000', '20', '10', '2016-12-15');
INSERT INTO `my_goods` VALUES ('203', '电视', '3', '娱乐', '2000', '20', '20', '2016-12-15');
-- ----------------------------
-- Table structure for orders
-- ----------------------------
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`orderid` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`orderdate` datetime NOT NULL,
`totalprice` decimal(10,2) DEFAULT NULL,
`status` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`orderid`),
KEY `userid` (`userid`),
CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `reguser` (`userid`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16121547 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of orders
-- ----------------------------
INSERT INTO `orders` VALUES ('16121514', '13', '2016-12-16 11:02:14', '10.00', '1');
INSERT INTO `orders` VALUES ('16121515', '13', '2016-12-16 11:04:08', '10.00', '1');
INSERT INTO `orders` VALUES ('16121545', '13', '2016-12-18 13:48:10', '12140.00', '1');
INSERT INTO `orders` VALUES ('16121546', '13', '2017-01-02 15:23:12', '200.00', '1');
-- ----------------------------
-- Table structure for reguser
-- ----------------------------
DROP TABLE IF EXISTS `reguser`;
CREATE TABLE `reguser` (
`userid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(20) DEFAULT NULL,
`password` varchar(20) DEFAULT NULL,
`sex` varchar(2) DEFAULT NULL,
`phone` varchar(25) DEFAULT NULL,
`address` varchar(150) DEFAULT NULL,
`regtime` date DEFAULT NULL,
PRIMARY KEY (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of reguser
-- ----------------------------
INSERT INTO `reguser` VALUES ('1', '落枫', '951231', '男', '18737619879', '汝州', '2016-12-15');
INSERT INTO `reguser` VALUES ('13', '张三', '123456', '男', '123456780', '信阳光山', '2016-12-15');
DROP TRIGGER IF EXISTS `userbuy`;
DELIMITER ;;
CREATE TRIGGER `userbuy` BEFORE INSERT ON `lineitem` FOR EACH ROW BEGIN
UPDATE my_goods SET Leav_number =Leav_number-new.quantity WHERE GoodsNo = new.GoodsNo;
END
;;
DELIMITER ;
DROP TRIGGER IF EXISTS `orderbuy`;
DELIMITER ;;
CREATE TRIGGER `orderbuy` BEFORE INSERT ON `lineitem` FOR EACH ROW BEGIN
UPDATE orders SET totalprice =totalprice+new.quantity*new.unitprice WHERE orderid = new.orderid;
END
;;
DELIMITER ;
DROP TRIGGER IF EXISTS `up_li`;
DELIMITER ;;
CREATE TRIGGER `up_li` AFTER INSERT ON `lineitem` FOR EACH ROW begin
update lineitem set quantity=quantity+new.quantity where orderid=new.orderid;
end
;;
DELIMITER ;
DROP TRIGGER IF EXISTS `del_li`;
DELIMITER ;;
CREATE TRIGGER `del_li` AFTER DELETE ON `lineitem` FOR EACH ROW begin
update my_goods set Leav_number=Leav_number+old.quantity where my_goods.GoodsNo=old.GoodsNo;
update orders set totalprice=totalprice-old.quantity*old.unitprice where orders.orderid=old.orderid;
end
;;
DELIMITER ;
| true |
c7d1052bfdad44e388df2c3c56d14c5dc6f0e3e8 | SQL | sduslu/twu-biblioteca-svenja | /TWU_Biblioteca_SQL/q2.sql | UTF-8 | 149 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | SELECT COUNT(name)
FROM member
WHERE member.id NOT IN (
SELECT member.id
FROM checkout_item, member
WHERE checkout_item.member_id = member.id
);
| true |
170355fdc7f05947e67f0cbfdff7fb837d834156 | SQL | nearmap/dbt_marketo | /models/intermediate/marketo__email_stats__by_program.sql | UTF-8 | 693 | 3.703125 | 4 | [] | no_license | with email_sends as (
select *
from {{ ref('marketo__email_sends') }}
), aggregated as (
select
program_id,
count(*) as count_sends,
sum(count_opens) as count_opens,
sum(count_bounces) as count_bounces,
sum(count_clicks) as count_clicks,
sum(count_deliveries) as count_deliveries,
sum(count_unsubscribes) as count_unsubscribes,
count(distinct case when was_opened = True then email_send_id end) as count_unique_opens,
count(distinct case when was_clicked = True then email_send_id end) as count_unique_clicks
from email_sends
where program_id is not null
group by 1
)
select *
from aggregated | true |
3379edc7d9e3958ac9f04fa9bf93d99aebcca714 | SQL | dabarc/DabarcStrategyNewDesignMabe | /DabarcStrategyNewDesign/dabarc/Stored Procedures/sp_XREF_DeletedRowOfXREF.sql | UTF-8 | 769 | 2.53125 | 3 | [] | no_license | CREATE PROCEDURE [dabarc].[sp_XREF_DeletedRowOfXREF](
@xref_id int,
@deleted_user nvarchar(15)
) AS
----------------------------------------------------------------------------
-- hay que validar si no se usar en un ODBC
----------------------------------------------------------------------------
IF (SELECT COUNT(*) FROM dabarc.t_XREF_REP WHERE xref_id = @xref_id AND delete_user IS NOT NULL) > 0
BEGIN
RAISERROR('Esta referencia ya esta alimnada.', 16, 1);
--RAISERROR (50023,
-- 16, -- Severity.
-- 1, -- State.
-- '',
-- '') -- Second substitution argument.
RETURN;
END
UPDATE dabarc.t_XREF_REP
SET delete_date = GETDATE(),
delete_user = @deleted_user
WHERE xref_id = @xref_id
| true |
f7d545b8440741e014d8beb62382b78cdfbf8c12 | SQL | wongak/xrmoddir | /resources/mysql/xrmoddir.sql | UTF-8 | 4,388 | 3.609375 | 4 | [
"MIT"
] | permissive | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Table `users`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `users` ;
CREATE TABLE IF NOT EXISTS `users` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(75) NULL,
`created` DATETIME NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `username_UNIQUE` (`username` ASC))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `user_passwords`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `user_passwords` ;
CREATE TABLE IF NOT EXISTS `user_passwords` (
`user_id` INT UNSIGNED NOT NULL,
`timestamp` BIGINT UNSIGNED NOT NULL,
`password` VARCHAR(255) NULL,
PRIMARY KEY (`user_id`, `timestamp`),
CONSTRAINT `fk_user_passwords_user_id`
FOREIGN KEY (`user_id`)
REFERENCES `users` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mods`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mods` ;
CREATE TABLE IF NOT EXISTS `mods` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(75) NULL,
`created` DATETIME NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `title_UNIQUE` (`title` ASC))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mod_users`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mod_users` ;
CREATE TABLE IF NOT EXISTS `mod_users` (
`mod_id` INT UNSIGNED NOT NULL,
`user_id` INT UNSIGNED NOT NULL,
`timestamp` BIGINT UNSIGNED NOT NULL,
`role` VARCHAR(45) NULL,
PRIMARY KEY (`mod_id`, `user_id`, `timestamp`),
INDEX `fk_mod_users_user_id_idx` (`user_id` ASC),
INDEX `roles` (`role` ASC),
CONSTRAINT `fk_mod_users_mod_id`
FOREIGN KEY (`mod_id`)
REFERENCES `mods` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE,
CONSTRAINT `fk_mod_users_user_id`
FOREIGN KEY (`user_id`)
REFERENCES `users` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mod_metadata`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `mod_metadata` ;
CREATE TABLE IF NOT EXISTS `mod_metadata` (
`mod_id` INT UNSIGNED NOT NULL,
`timestamp` BIGINT UNSIGNED NOT NULL,
`url` VARCHAR(255) NULL,
`author` VARCHAR(75) NULL,
`date` VARCHAR(75) NULL,
`description` TEXT NULL,
`modid` VARCHAR(125) NULL,
`modname` TEXT NULL,
`version` INT UNSIGNED NULL,
`save` TINYINT(1) NULL,
`enabled` TINYINT(1) NULL,
PRIMARY KEY (`mod_id`, `timestamp`),
INDEX `url` (`url` ASC),
INDEX `modid` (`modid` ASC),
CONSTRAINT `fk_mod_metadata_mod_id`
FOREIGN KEY (`mod_id`)
REFERENCES `mods` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `user_metadata`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `user_metadata` ;
CREATE TABLE IF NOT EXISTS `user_metadata` (
`user_id` INT UNSIGNED NOT NULL,
`timestamp` BIGINT UNSIGNED NOT NULL,
`email` VARCHAR(255) NULL,
`active` TINYINT(1) NULL,
PRIMARY KEY (`user_id`, `timestamp`),
INDEX `email` (`email` ASC),
CONSTRAINT `fk_user_metadata_user_id`
FOREIGN KEY (`user_id`)
REFERENCES `users` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `user_tokens`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `user_tokens` ;
CREATE TABLE IF NOT EXISTS `user_tokens` (
`token` CHAR(64) NOT NULL,
`created` DATETIME NOT NULL,
`user_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`token`),
INDEX `created` (`created` ASC),
INDEX `fk_user_tokens_user_id_idx` (`user_id` ASC),
CONSTRAINT `fk_user_tokens_user_id`
FOREIGN KEY (`user_id`)
REFERENCES `users` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
e581fa0448cb4ae66ad556195961fb11ace4256d | SQL | alexbartley/SOCO-Test | /104909/CONTENT_REPO/Views/DEV_TAXABILITY_SEARCH_V.sql | UTF-8 | 4,983 | 3.421875 | 3 | [] | no_license | CREATE OR REPLACE FORCE VIEW content_repo.dev_taxability_search_v ("ID",reference_code,calculation_method_id,basis_percent,recoverable_percent,recoverable_amount,start_date,end_date,entered_by,entered_date,status,status_modified_date,rid,nkid,next_rid,jurisdiction_id,jurisdiction_nkid,jurisdiction_rid,jurisdiction_official_name,all_taxes_apply,applicability_type_id,charge_type_id,unit_of_measure,ref_rule_order,default_taxability,product_tree_id,commodity_id,commodity_nkid,commodity_rid,commodity_name,commodity_code,h_code,conditions,tax_type,tax_applicabilities,verification,change_count,commodity_tree_id,is_local,legal_statement,canbedeleted,maxstatus) AS
SELECT
jta.id
, jta.reference_code
, jta.calculation_method_id
, jta.basis_percent
, jta.recoverable_percent
, jta.recoverable_amount
, jta.start_date
, jta.end_date
, jta.entered_by
, jta.entered_date
, jta.status
, jta.status_modified_date
, jta.rid
, jta.nkid
, jta.next_rid
, jta.jurisdiction_id
, jta.jurisdiction_nkid
, j.rid jurisdiction_rid
, j.official_name jurisdiction_official_name
, jta.all_taxes_apply
, jta.applicability_type_id
, jta.charge_type_id --case when jta.related_charge = '1' then 1 when jta.allocated_charges = 1 then 2 else null end
, jta.unit_of_measure
, jta.ref_rule_order
, CASE WHEN jta.default_taxability = 'D' THEN 1 ELSE 0 END default_taxability
, jta.product_tree_id
, jta.commodity_id
, com.nkid commodity_nkid
, com.rid commodity_rid
, com.name commodity_name
, com.commodity_code
, com.h_code
, (
SELECT CASE
WHEN COUNT(*) > 0 THEN 'Y'
WHEN COUNT(*) <= 0 THEN 'N'
END
FROM TRAN_TAX_QUALIFIERS tc
WHERE tc.juris_tax_applicability_nkid = jta.nkid -- tc.juris_tax_applicability_id = jta.id -- changed to NKID 04/25/16 dlg
) conditions
, jta.tax_type
, ta.tax_applicabilities
, ver.verification
, vcc.change_count
, coalesce(jta.product_tree_id, com.product_tree_id) as commodity_tree_id
, CASE WHEN jta.is_local = 'Y' THEN 1 ELSE 0 END is_local
, CASE WHEN attribute_id = 24 AND jtaa.next_rid IS NULL THEN jtaa.VALUE ELSE NULL END legal_statement
, canBeDeleted
, sts.maxstatus
FROM juris_tax_applicabilities jta
-- Attributes
LEFT JOIN juris_tax_app_attributes jtaa
ON ( jtaa.juris_tax_applicability_nkid = jta.nkid ) -- changed to NKID 04/26/16 dlg
-- Applicable taxes --
LEFT JOIN (
select juris_tax_applicability_nkid, listagg(reference_code, ',') within group (order by reference_code) as tax_applicabilities
from (
select distinct jti.reference_code, tat.juris_tax_applicability_nkid
from tax_applicability_taxes tat
JOIN juris_tax_impositions jti on jti.id = tat.juris_tax_imposition_id
)
group by (
juris_tax_applicability_nkid
)
) ta on ta.juris_tax_applicability_nkid = jta.nkid
-- Jurisdiction --
LEFT JOIN jurisdictions j on j.nkid = jta.jurisdiction_nkid and j.next_rid is null
-- Commodity --
LEFT JOIN commodities com on com.id = jta.commodity_id
-- Taxability verification
LEFT JOIN -- change after new data load - 04/25/16 dlg
(SELECT jtacv.rid,
CASE MIN(ast.ui_order)
WHEN 1 THEN 'R1'
WHEN 2 THEN 'R2'
WHEN 4 THEN 'FR'
ELSE 'Pending'
END
AS verification
FROM juris_tax_app_chg_vlds jtacv
JOIN assignment_types ast ON ast.id = jtacv.assignment_type_id
GROUP BY jtacv.rid) ver
ON (ver.rid = jta.rid
AND jta.next_rid IS NULL -- change after new data load - 04/25/16 dlg
AND jta.status <> 2) -- change after new data load - 04/25/16 dlg
-- Taxability change count
-- Allow to delete
-- This might have to change to nkid and additional flags for collections
/*JOIN (SELECT rid, COUNT (*) change_count
FROM (SELECT * FROM juris_tax_app_chg_logs)
GROUP BY rid) vcc
ON vcc.rid = jta.rid
*/
JOIN (Select lg.rid,
case when
max(rev.status) over (partition by lg.rid) > 0 then 0 else 1 end canBeDeleted,
rev.status,
COUNT (*) change_count
FROM juris_tax_app_chg_logs lg
join juris_tax_app_revisions rev on (lg.rid = rev.id)
GROUP BY lg.rid, rev.status ) vcc
ON (vcc.rid = jta.rid)
-- 04/30/16 --
JOIN (SELECT rid
,MAX(status) over (partition by lg.rid) maxstatus
FROM juris_tax_app_chg_logs lg
) sts
ON (sts.rid = jta.rid); | true |
c6f0774a17cc0f91fb98e9b1dac50da53faf2542 | SQL | gennova/Yudori | /9 oktober 2017.sql | UTF-8 | 153,214 | 3 | 3 | [] | no_license | /*
SQLyog Community v12.4.3 (64 bit)
MySQL - 10.1.25-MariaDB : Database - yudori
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`yudori` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `yudori`;
/*Table structure for table `akunutama` */
DROP TABLE IF EXISTS `akunutama`;
CREATE TABLE `akunutama` (
`idakun` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodeakun` varchar(20) NOT NULL,
`namaakun` varchar(30) DEFAULT NULL,
PRIMARY KEY (`idakun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `akunutama` */
/*Table structure for table `angsuran` */
DROP TABLE IF EXISTS `angsuran`;
CREATE TABLE `angsuran` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`kodeangsuran` varchar(20) NOT NULL,
`kodebp` varchar(20) NOT NULL,
`idpelanggan` int(5) DEFAULT NULL,
`pembayar` varchar(30) DEFAULT NULL,
`jumlah` int(10) NOT NULL,
`penerima` varchar(20) DEFAULT NULL,
`tanggal` varchar(20) DEFAULT NULL,
`keterangan` text,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`akun` varchar(20) DEFAULT '11510201',
`dk` varchar(2) DEFAULT 'K',
PRIMARY KEY (`id`,`kodeangsuran`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `angsuran` */
insert into `angsuran`(`id`,`kodeangsuran`,`kodebp`,`idpelanggan`,`pembayar`,`jumlah`,`penerima`,`tanggal`,`keterangan`,`timestamp`,`akun`,`dk`) values
(1,'KA0908170001','BP010817001',8,'Bu Mimin',129000,'Ayu Admin','2017-04-08','','2017-08-09 15:26:47','11510201','K');
/*Table structure for table `bantucetakand` */
DROP TABLE IF EXISTS `bantucetakand`;
CREATE TABLE `bantucetakand` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodebp` varchar(30) NOT NULL,
`kodeans` varchar(30) NOT NULL,
`tanggal` varchar(30) NOT NULL,
`jumlah` int(10) NOT NULL,
`angsuran1` varchar(30) DEFAULT NULL,
`angsuran2` varchar(30) DEFAULT NULL,
`angsuran3` varchar(30) DEFAULT NULL,
`angsuran4` varchar(30) DEFAULT NULL,
`angsuran5` varchar(30) DEFAULT NULL,
`angsuran6` varchar(30) DEFAULT NULL,
`angsuran7` varchar(30) DEFAULT NULL,
`angsuran8` varchar(30) DEFAULT NULL,
`angsuran9` varchar(30) DEFAULT NULL,
`angsuran10` varchar(30) DEFAULT NULL,
`lunas` varchar(10) NOT NULL DEFAULT 'belum',
`trace` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`tglangsuran1` varchar(30) DEFAULT NULL,
`tglangsuran2` varchar(30) DEFAULT NULL,
`tglangsuran3` varchar(30) DEFAULT NULL,
`tglangsuran4` varchar(30) DEFAULT NULL,
`tglangsuran5` varchar(30) DEFAULT NULL,
`tglangsuran6` varchar(30) DEFAULT NULL,
`tglangsuran7` varchar(30) DEFAULT NULL,
`tglangsuran8` varchar(30) DEFAULT NULL,
`tglangsuran9` varchar(30) DEFAULT NULL,
`tglangsuran10` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `bantucetakand` */
insert into `bantucetakand`(`id`,`kodebp`,`kodeans`,`tanggal`,`jumlah`,`angsuran1`,`angsuran2`,`angsuran3`,`angsuran4`,`angsuran5`,`angsuran6`,`angsuran7`,`angsuran8`,`angsuran9`,`angsuran10`,`lunas`,`trace`,`tglangsuran1`,`tglangsuran2`,`tglangsuran3`,`tglangsuran4`,`tglangsuran5`,`tglangsuran6`,`tglangsuran7`,`tglangsuran8`,`tglangsuran9`,`tglangsuran10`) values
(1,'BP010817001','KA0908170001','2017-04-08',129000,' ','100000',' ',' ',' ',' ',' ',' ',' ',' ','belum','2017-08-09 15:26:47',' ','2017-06-07',' ',' ',' ',' ',' ',' ',' ',' ');
/*Table structure for table `barang` */
DROP TABLE IF EXISTS `barang`;
CREATE TABLE `barang` (
`idbarang` int(3) NOT NULL AUTO_INCREMENT,
`namabarang` varchar(100) NOT NULL,
`idharga` int(10) NOT NULL,
PRIMARY KEY (`idbarang`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
/*Data for the table `barang` */
insert into `barang`(`idbarang`,`namabarang`,`idharga`) values
(1,'Yudori Noodles Maker',1),
(2,'Yudori Alsyva',2),
(3,'Yudori 8 Pcs Fancy Set',3),
(4,'Yudori 8 Pcs Tulip Set',4),
(5,'Yudori Blender Ez Blend',5),
(6,'Yudori Chopper 1.8 L',6),
(7,'Yudori Griddle 2 in 1',7),
(8,'Yudori Chopper 1.8 L + Yudori Noodle Maker',8),
(9,'Yudori Chopper 1.8 L + Yudori 8 Pcs Fancy set',9),
(10,'Yudori Chopper 1.8 L + Yudori 8 Pcs Tulip set',10),
(11,'Yudori Ez Blender + Yudori Gridle 2 in 1',11),
(12,'Yudori Chopper 1.8 L + Yudori Griddle 2 in 1',12),
(14,'Yudori Griddle 2 in 1 + Alsyva',14),
(15,'Yudori Chopper 1.8 L + Alsyva',15);
/*Table structure for table `bkmb` */
DROP TABLE IF EXISTS `bkmb`;
CREATE TABLE `bkmb` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodekmb` varchar(20) NOT NULL,
`nama` varchar(30) NOT NULL,
`alamat` text,
`keterangan` text,
`detailketerangan` text,
`tanggal` varchar(20) DEFAULT NULL,
`idbarang` int(5) NOT NULL,
`jumlah` int(10) DEFAULT NULL,
`statusbarang` varchar(20) NOT NULL,
`trace` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`,`kodekmb`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `bkmb` */
/*Table structure for table `bstu` */
DROP TABLE IF EXISTS `bstu`;
CREATE TABLE `bstu` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodebstu` varchar(30) NOT NULL,
`nama` varchar(30) NOT NULL,
`uraian` text,
`jumlah` int(10) NOT NULL,
`keterangan` text,
`trace` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` varchar(10) NOT NULL,
`jenisbstu` varchar(30) NOT NULL,
`diserahkan` varchar(30) NOT NULL,
`kodeakun` varchar(30) DEFAULT NULL,
`tanggal` varchar(30) DEFAULT NULL,
PRIMARY KEY (`id`,`kodebstu`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `bstu` */
/*Table structure for table `buktipesanan` */
DROP TABLE IF EXISTS `buktipesanan`;
CREATE TABLE `buktipesanan` (
`idpesanan` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodebp` varchar(15) NOT NULL,
`idpesananfaktur` varchar(15) DEFAULT NULL,
`namapelanggan` varchar(100) DEFAULT NULL,
`alamatpelanggan` text,
`telepon` varchar(20) DEFAULT NULL,
`idsales` int(5) NOT NULL,
`komisisales` int(10) DEFAULT NULL,
`jenisorder` varchar(20) DEFAULT NULL,
`tglpesanan` varchar(15) DEFAULT NULL,
`tglpenagihan` varchar(15) DEFAULT NULL,
`tglpengiriman` varchar(15) DEFAULT NULL,
`total` int(10) NOT NULL,
`UM` int(10) NOT NULL,
`sisa` int(10) DEFAULT NULL,
`sisaberjalan` int(5) DEFAULT NULL,
`idpelanggan` int(10) NOT NULL,
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`statusbp` varchar(10) DEFAULT 'belum',
`angsuran` varchar(10) NOT NULL,
`hargatunai` int(10) NOT NULL DEFAULT '0',
`statuskirim` varchar(15) NOT NULL DEFAULT 'belum',
PRIMARY KEY (`idpesanan`,`kodebp`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `buktipesanan` */
insert into `buktipesanan`(`idpesanan`,`kodebp`,`idpesananfaktur`,`namapelanggan`,`alamatpelanggan`,`telepon`,`idsales`,`komisisales`,`jenisorder`,`tglpesanan`,`tglpenagihan`,`tglpengiriman`,`total`,`UM`,`sisa`,`sisaberjalan`,`idpelanggan`,`timestamp`,`statusbp`,`angsuran`,`hargatunai`,`statuskirim`) values
(1,'BP010817001','009493','Bu Mimin','MA Al Ashor','081575098081',6,1,'DROP A1','2017-04-08','2017-05-17','2017-04-08',929000,129000,8,2,7,'2017-08-01 15:34:33','belum','100000',0,'belum');
/*Table structure for table `detailangsuran` */
DROP TABLE IF EXISTS `detailangsuran`;
CREATE TABLE `detailangsuran` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`noans` varchar(30) NOT NULL,
`nobp` varchar(30) NOT NULL,
`tgl` varchar(30) NOT NULL,
`angsuranke` varchar(30) DEFAULT '1',
`jumlah` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `detailangsuran` */
insert into `detailangsuran`(`id`,`noans`,`nobp`,`tgl`,`angsuranke`,`jumlah`) values
(1,'KA0908170001','BP010817001','2017-05-17','Angsuran 1',100000),
(2,'KA0908170001','BP010817001','2017-06-07','Angsuran 2',100000);
/*Table structure for table `detailbstu` */
DROP TABLE IF EXISTS `detailbstu`;
CREATE TABLE `detailbstu` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nama` varchar(30) NOT NULL,
`uraian` text,
`keterangan` text,
`jumlah` int(10) NOT NULL,
`kodebstu` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `detailbstu` */
/*Table structure for table `detailpesanan` */
DROP TABLE IF EXISTS `detailpesanan`;
CREATE TABLE `detailpesanan` (
`idorder` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodebarang` int(11) DEFAULT NULL,
`namabarang` varchar(50) DEFAULT NULL,
`unit` int(5) DEFAULT NULL,
`harga` int(10) DEFAULT NULL,
`total` int(10) DEFAULT NULL,
`idpesanan` int(10) DEFAULT NULL,
`kodebp` varchar(20) NOT NULL,
`idpelanggan` int(10) DEFAULT NULL,
PRIMARY KEY (`idorder`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `detailpesanan` */
insert into `detailpesanan`(`idorder`,`kodebarang`,`namabarang`,`unit`,`harga`,`total`,`idpesanan`,`kodebp`,`idpelanggan`) values
(1,6,'Yudori Chopper 1.8 L',1,929000,929000,1,'BP010817001',7);
/*Table structure for table `hargabarang` */
DROP TABLE IF EXISTS `hargabarang`;
CREATE TABLE `hargabarang` (
`idharga` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idbarang` int(10) NOT NULL,
`hargatunai` int(10) NOT NULL,
`hargadrop` int(10) NOT NULL,
`hargaindent` int(10) NOT NULL,
`UM` int(10) NOT NULL,
`hargapromositunai` int(10) NOT NULL,
`tanggal` varchar(20) NOT NULL,
`sisa` int(10) DEFAULT '0',
`sisa1` int(10) NOT NULL,
`sisa2` int(10) NOT NULL,
`tglberlakumulai` varchar(100) DEFAULT NULL,
`tglberlakuakhir` varchar(100) DEFAULT NULL,
`aktif` char(1) DEFAULT 'Y',
PRIMARY KEY (`idharga`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
/*Data for the table `hargabarang` */
insert into `hargabarang`(`idharga`,`idbarang`,`hargatunai`,`hargadrop`,`hargaindent`,`UM`,`hargapromositunai`,`tanggal`,`sisa`,`sisa1`,`sisa2`,`tglberlakumulai`,`tglberlakuakhir`,`aktif`) values
(1,1,2500000,2939000,2760000,329000,2500000,'',0,9,290000,'2017-04-25','2017-10-31','Y'),
(2,2,1580000,1584000,1580000,189000,1580000,'',0,9,155000,'2017-04-25','2017-10-31','Y'),
(3,3,1050000,1239000,1125000,159000,1050000,'',0,9,120000,'2017-04-25','2017-10-31','Y'),
(4,4,1250000,1429000,1300000,169000,1250000,'',0,9,140000,'2017-04-25','2017-10-31','Y'),
(5,5,990000,1099000,1050000,139000,990000,'',0,8,120000,'2017-04-25','2017-10-31','Y'),
(6,6,750000,929000,825000,129000,750000,'',0,8,100000,'2017-04-25','2017-10-31','Y'),
(7,7,490000,579000,540000,139000,490000,'',0,4,110000,'2017-04-25','2017-10-31','Y'),
(8,8,3150000,3539000,3300000,389000,3150000,'',0,9,350000,'2017-04-25','2017-10-31','Y'),
(9,9,1690000,1839000,1770000,219000,1690000,'',0,9,180000,'2017-04-25','2017-10-31','Y'),
(10,10,1890000,1980000,2069000,269000,1890000,'',0,9,200000,'2017-04-25','2017-10-31','Y'),
(11,11,1400000,1584000,1500000,189000,1400000,'',0,9,155000,'2017-04-25','2017-10-31','Y'),
(12,12,1200000,1200000,1200000,150000,1200000,'',0,7,150000,'2017-04-25','2017-10-31','Y'),
(13,13,1950000,2010000,2010000,249000,1950000,'',0,9,200000,'2017-04-25','2017-10-31','Y'),
(14,14,1800000,1939000,1845000,229000,1800000,'',0,9,190000,'2017-04-25','2017-10-31','Y'),
(15,15,1950000,2049000,2010000,249000,1950000,'',0,9,200000,'2017-04-25','2017-10-31','Y');
/*Table structure for table `kas` */
DROP TABLE IF EXISTS `kas`;
CREATE TABLE `kas` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
PRIMARY KEY (`id`,`kodekas`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*Data for the table `kas` */
insert into `kas`(`id`,`kodekas`,`kodekasmanual`,`tanggal`,`total`) values
(1,'KO2908170001','-','2017-08-29',450000),
(2,'KO0609170002','','2017-09-06',350500),
(3,'KO0609170003','','2017-09-06',430000),
(4,'KO0609170004','','2017-09-06',800000),
(5,'KO0609170005','','2017-09-06',345000);
/*Table structure for table `kas_besar` */
DROP TABLE IF EXISTS `kas_besar`;
CREATE TABLE `kas_besar` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
PRIMARY KEY (`id`,`kodekas`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `kas_besar` */
insert into `kas_besar`(`id`,`kodekas`,`kodekasmanual`,`tanggal`,`total`) values
(1,'KO1809170001','-','2017-09-19',0),
(2,'KO1809170002','-','2017-09-19',0);
/*Table structure for table `kas_besar_detail` */
DROP TABLE IF EXISTS `kas_besar_detail`;
CREATE TABLE `kas_besar_detail` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
`jeniskas` varchar(20) NOT NULL,
`uraian` text,
`kodeakun` varchar(15) NOT NULL,
PRIMARY KEY (`id`,`kodekas`)
) ENGINE=InnoDB AUTO_INCREMENT=1241 DEFAULT CHARSET=latin1;
/*Data for the table `kas_besar_detail` */
insert into `kas_besar_detail`(`id`,`kodekas`,`kodekasmanual`,`tanggal`,`total`,`jeniskas`,`uraian`,`kodeakun`) values
(1,'KO1809170001','-','2017-07-01',2681800,'Masuk','Saldo Pindahan',''),
(2,'KO1809170001','-','2017-07-01',160000,'Keluar','BSTUK 005172/Bbm Imam 18-22 / 29-30 Jun',''),
(3,'KO1809170001','-','2017-07-01',2450000,'Keluar','Setoran Bank',''),
(4,'KO1809170001','-','2017-07-03',800000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(5,'KO1809170001','-','2017-07-03',800000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(6,'KO1809170001','-','2017-07-03',750000,'Masuk','BSTUM 005173/Imam 7 K',''),
(7,'KO1809170001','-','2017-07-03',200000,'Masuk','BSTUM 005174/Imam 2 K',''),
(8,'KO1809170001','-','2017-07-03',250000,'Masuk','BSTUM 005175/Heri 2 K',''),
(9,'KO1809170001','-','2017-07-04',900000,'Keluar','Setoran Bank',''),
(10,'KO1809170001','-','2017-07-04',169000,'Masuk','BP 009592/Dian/Indri/Angsuran Presto 8 lt',''),
(11,'KO1809170001','-','2017-07-04',300000,'Masuk','BP 009590/Nanik/Indri/Indent Ez Blend',''),
(12,'KO1809170001','-','2017-07-04',269000,'Masuk','BP 005731/Guntoro/Lenny/Ansguran chopper + tulip 8 set',''),
(13,'KO1809170001','-','2017-07-04',150000,'Masuk','BP 007705/Lia/Yayuk/Angsuran chopper + gridle',''),
(14,'KO1809170001','-','2017-07-04',820000,'Masuk','BSTUM 005176/Imam 8 K',''),
(15,'KO1809170001','-','2017-07-04',100000,'Masuk','BP 008243/Supriyati/Ari/Tunai chopper',''),
(16,'KO1809170001','-','2017-07-04',100000,'Masuk','BP 008241/Ratno/Anik/Tunai chopper',''),
(17,'KO1809170001','-','2017-07-04',100000,'Masuk','BP 008244/Nur H/Anik/Tunai chopper',''),
(18,'KO1809170001','-','2017-07-05',200000,'Keluar','BSTUK 005177/Komisi mingguan ning 20 order',''),
(19,'KO1809170001','-','2017-07-05',30000,'Keluar','BSTUK 005178/Komisi mingguan tresye 3 order',''),
(20,'KO1809170001','-','2017-07-05',800000,'Keluar','Supply Ke Kas Operasional',''),
(21,'KO1809170001','-','2017-07-05',999800,'Keluar','Setoran Bank',''),
(22,'KO1809170001','-','2017-07-05',129000,'Masuk','BP 005732/Edy/Lenny/Angsuran chopper',''),
(23,'KO1809170001','-','2017-07-05',170000,'Masuk','BP 007448/Sigit/Tressye/Angsuran Alsyva',''),
(24,'KO1809170001','-','2017-07-05',200000,'Masuk','BSTUM 005178-9/Angsuran 2 K',''),
(25,'KO1809170001','-','2017-07-05',1065000,'Masuk','BSTUM 005197/Imam 10 K',''),
(26,'KO1809170001','-','2017-07-05',23000000,'Masuk','Supply Pusat ( Salary staff dan sales Jun\'17 )',''),
(27,'KO1809170001','-','2017-07-05',15700000,'Keluar','Salary Staff Jun \'17',''),
(28,'KO1809170001','-','2017-07-05',8255200,'Keluar','Komisi Sales ( Uang hadir dan Insentif )',''),
(29,'KO1809170001','-','2017-07-05',480000,'Keluar','Pembayaran paket barang 31 koli ( Panca Kobra )',''),
(30,'KO1809170001','-','2017-07-05',1000000,'Masuk','BSTUM 005198/Pelunasan order tressye',''),
(31,'KO1809170001','-','2017-07-05',500000,'Keluar','BSTUK 005199/Komisi 20 % tresye',''),
(32,'KO1809170001','-','2017-07-05',300000,'Masuk','BSTUM 005200/Angsuran agung ( mobil )',''),
(33,'KO1809170001','-','2017-07-05',245000,'Keluar','Service kampas rem GM B 1873 UKL',''),
(34,'KO1809170001','-','2017-07-05',980000,'Keluar','Setoran Bank',''),
(35,'KO1809170001','-','2017-07-05',1000000,'Masuk','BSTUM 005199/Heri 3 K',''),
(36,'KO1809170001','-','2017-07-05',2150000,'Masuk','BSTUM 004201/Pelunasan Order Tresye',''),
(37,'KO1809170001','-','2017-07-05',630000,'Keluar','BSTUK 004202/Komisi 20 % tresye',''),
(38,'KO1809170001','-','2017-07-05',1350000,'Masuk','BSTUM 004203/Pelunasan order wiwid dan ari',''),
(39,'KO1809170001','-','2017-07-05',300000,'Keluar','BSTUK 004204/Komisi 20 % ari dan wiwid',''),
(40,'KO1809170001','-','2017-07-06',3073800,'Keluar','Setoran Bank',''),
(41,'KO1809170001','-','2017-07-06',1556000,'Masuk','BSTUM 005200/Heri 9 K',''),
(42,'KO1809170001','-','2017-07-06',500000,'Masuk','BP 008501/Wulan/Tresye/Tunai alsyva',''),
(43,'KO1809170001','-','2017-07-06',1960000,'Masuk','BSTUM 003601/Pelunasan Order Tresye',''),
(44,'KO1809170001','-','2017-07-06',632000,'Keluar','BSTUK 003602/Komisi 20 % tresye',''),
(45,'KO1809170001','-','2017-07-06',200000,'Keluar','BSTUK 003602/Komisi tambahan alsyva',''),
(46,'KO1809170001','-','2017-07-06',985000,'Masuk','BSTUM 003501/Imam 8 K',''),
(47,'KO1809170001','-','2017-07-06',4150000,'Keluar','Setoran Bank',''),
(48,'KO1809170001','-','2017-07-06',1800000,'Masuk','BSTUM 003603/Pelunasan Order ( ari , yayuk . Wiwid )',''),
(49,'KO1809170001','-','2017-07-07',500000,'Masuk','BP 007447/Wulan/Tresye/Tunai noodle',''),
(50,'KO1809170001','-','2017-07-07',300000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(51,'KO1809170001','-','2017-07-07',300000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(52,'KO1809170001','-','2017-07-07',600000,'Masuk','BSTUM 003604/Pelunasan Order Tresye',''),
(53,'KO1809170001','-','2017-07-07',6000000,'Masuk','BP 008601/Roni//Ning/Tunai chopper 8 unit',''),
(54,'KO1809170001','-','2017-07-07',1200000,'Masuk','BP 008601/Roni//Ning/Tunai chopper + gridle',''),
(55,'KO1809170001','-','2017-07-07',1440000,'Keluar','BSTUK 003605/Komisi 20 % ning',''),
(56,'KO1809170001','-','2017-07-07',1000000,'Keluar','BSTUK 003606/Komisi OR P\'Gito ( Bu Wiwid )',''),
(57,'KO1809170001','-','2017-07-07',1295000,'Masuk','BSTUM 003502/Heri 8 K',''),
(58,'KO1809170001','-','2017-07-07',900000,'Masuk','BSTUM 003503/Imam 9 K',''),
(59,'KO1809170001','-','2017-07-07',432000,'Keluar','Dinas Perjalanan Pak Sodikin dan Pak Gito ( Jogja )',''),
(60,'KO1809170001','-','2017-07-07',9931000,'Keluar','Setoran Bank',''),
(61,'KO1809170001','-','2017-07-07',2000000,'Masuk','BSTUM 003607/Pelunasan order ari dan yayuk',''),
(62,'KO1809170001','-','2017-07-07',600000,'Keluar','BSTUK 003608/Komisi 20 % ari dan yayuk',''),
(63,'KO1809170001','-','2017-07-07',700000,'Masuk','BSTUM 003609/Pelunasan order tyas',''),
(64,'KO1809170001','-','2017-07-07',300000,'Keluar','BSTUK 003610/Komisi 20 % tyas',''),
(65,'KO1809170001','-','2017-07-08',330000,'Keluar','BSTUK 003611/Komisi mingguan yayuk 33 order',''),
(66,'KO1809170001','-','2017-07-08',50000,'Keluar','BSTUK 003612/Komisi mingguan wiwid 5 order',''),
(67,'KO1809170001','-','2017-07-08',880000,'Keluar','Halal Biahal Kantor ( Sales dan staff )',''),
(68,'KO1809170001','-','2017-07-08',140000,'Masuk','BP 005734/Palupi/Tuti/Angsuran gridle',''),
(69,'KO1809170001','-','2017-07-08',130000,'Masuk','BP 007559/Dodi/Tuti/Tunai chopper',''),
(70,'KO1809170001','-','2017-07-08',130000,'Masuk','BP 007560/Suyuti/Tuti/Tunai chopper',''),
(71,'KO1809170001','-','2017-07-08',130000,'Masuk','BP 007561/Didi/Tuti/Tunai chopper',''),
(72,'KO1809170001','-','2017-07-08',1775000,'Masuk','BSTUM 003504/Imam 11 K',''),
(73,'KO1809170001','-','2017-07-08',150000,'Keluar','BSTUK 003615/Komisi 20 % yayuk',''),
(74,'KO1809170001','-','2017-07-08',80000,'Keluar','BSTUK 003613/Uang makan driver tarjo',''),
(75,'KO1809170001','-','2017-07-08',80000,'Keluar','BSTUK 003614/Uang makan driver nano',''),
(76,'KO1809170001','-','2017-07-10',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(77,'KO1809170001','-','2017-07-10',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(78,'KO1809170001','-','2017-07-10',9800000,'Masuk','Supply Kas Pusat ( Komisi sales dan Staff Jun\'17 )',''),
(79,'KO1809170001','-','2017-07-10',2546000,'Keluar','Setoran Bank',''),
(80,'KO1809170001','-','2017-07-10',1371000,'Masuk','BSTUM 003506/Imam 12 K',''),
(81,'KO1809170001','-','2017-07-10',200000,'Masuk','BSTUM 003505/Angsuran 2 k',''),
(82,'KO1809170001','-','2017-07-10',4545200,'Keluar','Komisi sales ( sawulan dan A1 )',''),
(83,'KO1809170001','-','2017-07-10',5326353,'Keluar','Komisi staff ( instentif )',''),
(84,'KO1809170001','-','2017-07-10',150000,'Masuk','BP 007566/Rina/Lenny/Angsuran chopper + gridle',''),
(85,'KO1809170001','-','2017-07-10',150000,'Masuk','BP 007565/Sunu/Lenny/Angsuran chopper + gridle',''),
(86,'KO1809170001','-','2017-07-10',150000,'Masuk','BP 007564/Dina/Lenny/Angsuran chopper + gridle',''),
(87,'KO1809170001','-','2017-07-10',150000,'Masuk','BP 007563/Marjono/Tuti/Angsuran chopper + gridle',''),
(88,'KO1809170001','-','2017-07-10',150000,'Masuk','BP 007562/Suparmi/Tuti/Angsuran chopper + gridle',''),
(89,'KO1809170001','-','2017-07-10',200000,'Masuk','BP 007303/Marsini/yayuk/Tunai chopper',''),
(90,'KO1809170001','-','2017-07-10',100000,'Masuk','BP 007302/Sukirno/Wiwid/Tunai chopper',''),
(91,'KO1809170001','-','2017-07-10',329000,'Masuk','BP 008551/Budi/Indri/Angsuran noodle',''),
(92,'KO1809170001','-','2017-07-10',100000,'Masuk','BP 008503/Retno/Tyas/Tunai chopper',''),
(93,'KO1809170001','-','2017-07-10',250000,'Masuk','BP 008506/Irma/Tresye/Tunai tulip 8 set',''),
(94,'KO1809170001','-','2017-07-10',189000,'Masuk','BP 007625/Rusmawati/Tyas/Angsuran Alsyva',''),
(95,'KO1809170001','-','2017-07-10',189000,'Masuk','BP 008505/Kristin/Tresye/Angsuran Alsyva',''),
(96,'KO1809170001','-','2017-07-10',200000,'Masuk','BSTUM 003633/Pelunasan wiwid',''),
(97,'KO1809170001','-','2017-07-10',200000,'Masuk','BSTUM 003634/Pelunasan tresye',''),
(98,'KO1809170001','-','2017-07-10',100000,'Keluar','BSTUK 003631/Komisi mingguan tyas 10 order',''),
(99,'KO1809170001','-','2017-07-10',3800000,'Keluar','Setoran Bank',''),
(100,'KO1809170001','-','2017-07-11',189000,'Masuk','BP 007624/Siti/Tyas/Angsuran alsyva',''),
(101,'KO1809170001','-','2017-07-11',300000,'Masuk','BP 008508/Sumiyati/Tresye/Tunai chopper + tulip 8 set',''),
(102,'KO1809170001','-','2017-07-11',2470000,'Masuk','BSTUM 003507/Heri 12 K',''),
(103,'KO1809170001','-','2017-07-11',1325000,'Masuk','BSTUM 003508/Imam 10 K',''),
(104,'KO1809170001','-','2017-07-11',1750000,'Masuk','BSTUM 003636/Pelunasan tyas dan tresye',''),
(105,'KO1809170001','-','2017-07-11',650000,'Keluar','BSTUK 003639/Komisi 20 % tyas dan tresye',''),
(106,'KO1809170001','-','2017-07-11',130000,'Keluar','BSTUK 003637/Bbm kolektor imam 3 - 8 jul',''),
(107,'KO1809170001','-','2017-07-11',250000,'Masuk','BSTUM 003638/Angsuran kit alsyva',''),
(108,'KO1809170001','-','2017-07-11',5600000,'Keluar','Setoran Bank',''),
(109,'KO1809170001','-','2017-07-11',1250000,'Masuk','BSTUM 003640/Pelunasan order wiwid dan anik',''),
(110,'KO1809170001','-','2017-07-11',250000,'Masuk','BP 007305/Eni/Anik/Angsuran chopper + tulip 8 set',''),
(111,'KO1809170001','-','2017-07-11',250000,'Masuk','BP 007304/Wahyu/Anik/Angsuran chopper + tulip 8 set',''),
(112,'KO1809170001','-','2017-07-11',100000,'Masuk','BP 007524/Yohan/Ari/Tunai chopper',''),
(113,'KO1809170001','-','2017-07-11',150000,'Masuk','BP 007568/Sigit/Tuti/Angsuran chopper + gridle',''),
(114,'KO1809170001','-','2017-07-11',150000,'Masuk','BP 007569/Agus/Lenny/Angsuran chopper + gridle',''),
(115,'KO1809170001','-','2017-07-12',2160447,'Keluar','Setoran Bank',''),
(116,'KO1809170001','-','2017-07-12',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(117,'KO1809170001','-','2017-07-12',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(118,'KO1809170001','-','2017-07-12',2660000,'Masuk','BSTUM 003509/Heri 13 K',''),
(119,'KO1809170001','-','2017-07-12',1230000,'Masuk','BSTUM 003510/Imam 13 K',''),
(120,'KO1809170001','-','2017-07-12',3850000,'Keluar','Setoran Bank',''),
(121,'KO1809170001','-','2017-07-12',329000,'Masuk','BP 008553/Esty/Lenny/Angsuran noodle',''),
(122,'KO1809170001','-','2017-07-12',3150000,'Masuk','BP 008554/Oky/Indri/Tunai chopper + noodle',''),
(123,'KO1809170001','-','2017-07-12',100000,'Masuk','BP 007309/Evi/Anik/Tunai chopper',''),
(124,'KO1809170001','-','2017-07-12',200000,'Masuk','BP 007312/Puput/Wiwid/Tunai tulip 8 set',''),
(125,'KO1809170001','-','2017-07-12',200000,'Masuk','BP 007526/Handayani/Ari/Tunai chopper',''),
(126,'KO1809170001','-','2017-07-12',200000,'Masuk','BP 007525/Wasilatul/Ari/Tunai chopper',''),
(127,'KO1809170001','-','2017-07-12',200000,'Masuk','BP 007527/Zulaikah/Ari/Tunai chopper',''),
(128,'KO1809170001','-','2017-07-12',100000,'Masuk','BP 008155/Sinta/Anik/Tunai chopper',''),
(129,'KO1809170001','-','2017-07-12',100000,'Masuk','BP 008156/Ismainiwati/Wiwid/Tunai chopper',''),
(130,'KO1809170001','-','2017-07-12',189000,'Masuk','BP 007630/Tria/Tyas/Ansguran alsyva',''),
(131,'KO1809170001','-','2017-07-12',150000,'Masuk','BP 008511/Tutik/Tressye/Angsuran chopper + gridle',''),
(132,'KO1809170001','-','2017-07-12',150000,'Masuk','BP 008510/Norma/Tyas/Ansguran chopper + gridle',''),
(133,'KO1809170001','-','2017-07-12',630000,'Keluar','BSTUK 003644/Komisi 20 % indri',''),
(134,'KO1809170001','-','2017-07-12',200000,'Masuk','BSTUM 003641/Penambahan Dp BP 007524 a.n Johan / chopper',''),
(135,'KO1809170001','-','2017-07-12',1220000,'Masuk','BSTUM 003642/Pelunasan order tresye',''),
(136,'KO1809170001','-','2017-07-12',790000,'Masuk','BSTUM 003643/Pelunasan order anik',''),
(137,'KO1809170001','-','2017-07-12',616000,'Keluar','BSTUK 003644/Komisi 20 % tresye',''),
(138,'KO1809170001','-','2017-07-12',150000,'Keluar','BSTUK 003644/Komisi 20 % anik',''),
(139,'KO1809170001','-','2017-07-12',5922000,'Keluar','Setoran Bank',''),
(140,'KO1809170001','-','2017-07-13',1000000,'Masuk','BSTUM 003512/Imam 8 K',''),
(141,'KO1809170001','-','2017-07-13',1000000,'Masuk','BP 008555/Erwin/Indri/Tunai chopper + noodle',''),
(142,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008556/Inul/Indri/Angsuran chopper + gridle',''),
(143,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008602/Yulinda/Ning/Angsuran chopper + gridle',''),
(144,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008603/Darno/Ning/Angsuran chopper + gridle',''),
(145,'KO1809170001','-','2017-07-13',100000,'Masuk','BSTUM 003511/Angsuran 1 K',''),
(146,'KO1809170001','-','2017-07-13',2550000,'Keluar','Setoran Bank',''),
(147,'KO1809170001','-','2017-07-13',710000,'Masuk','BSTUM 003513/Imam 5 K',''),
(148,'KO1809170001','-','2017-07-13',1635000,'Masuk','BSTUM 003514/Heri 16 K',''),
(149,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008521/Indah/Tyas/Angsuran chopper + gridle',''),
(150,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008522/Juriyah/Tyas/Angsuran chopper + gridle',''),
(151,'KO1809170001','-','2017-07-13',150000,'Masuk','BP 008515/Sri R/Tressye/Angsuran chopper + gridle',''),
(152,'KO1809170001','-','2017-07-13',159000,'Masuk','BP 008513/Sri R/Tressye/Angsuran suggo cook',''),
(153,'KO1809170001','-','2017-07-13',1250000,'Masuk','BSTUM 003645/Pelunasan order anik dan wiwid',''),
(154,'KO1809170001','-','2017-07-13',50000,'Keluar','BSTUK 003646/Komisi mingguan 5 order',''),
(155,'KO1809170001','-','2017-07-14',3754000,'Keluar','Setoran Bank',''),
(156,'KO1809170001','-','2017-07-14',250000,'Masuk','BP 008607/Nia/Ning/Tunai noodle',''),
(157,'KO1809170001','-','2017-07-14',250000,'Masuk','BP 008608/Nuri/Ning/Tunai noodle',''),
(158,'KO1809170001','-','2017-07-14',189000,'Masuk','BP 008604/Griyadi/Ning/Angsuran chopper + fancy suggo',''),
(159,'KO1809170001','-','2017-07-14',1120000,'Masuk','BSTUM 003516/Imam 9 K',''),
(160,'KO1809170001','-','2017-07-14',1800000,'Keluar','Setoran Bank',''),
(161,'KO1809170001','-','2017-07-14',1350000,'Masuk','BSTUM 003649/Pelunasan order wiwid',''),
(162,'KO1809170001','-','2017-07-14',300000,'Keluar','BSTUK 003650/Komisi 20 % wiwid',''),
(163,'KO1809170001','-','2017-07-14',130000,'Keluar','BSTUK 003648/Um driver Agung 3 - 15 Jul',''),
(164,'KO1809170001','-','2017-07-14',1160000,'Masuk','BSTUM 003517/Heri 9 K',''),
(165,'KO1809170001','-','2017-07-14',400000,'Masuk','BSTUM 003301/Tambahan DP tulip BP 007527 dan BP 007525',''),
(166,'KO1809170001','-','2017-07-15',1120000,'Masuk','BSTUM 003518/Imam 10 K',''),
(167,'KO1809170001','-','2017-07-15',60000,'Keluar','BSTUK 003519/Komisi mingguan indri 6 order',''),
(168,'KO1809170001','-','2017-07-15',50000,'Keluar','BSTUK 003520/Komisi mingguan lenny 5 order',''),
(169,'KO1809170001','-','2017-07-15',200000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(170,'KO1809170001','-','2017-07-15',200000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(171,'KO1809170001','-','2017-07-15',3450000,'Keluar','Setoran Bank',''),
(172,'KO1809170001','-','2017-07-15',965000,'Masuk','BSTUM 003519/Heri 8 K',''),
(173,'KO1809170001','-','2017-07-15',471000,'Keluar','Dinas Perjalanan Pak Sodikin Pekalongan',''),
(174,'KO1809170001','-','2017-07-15',180000,'Keluar','Oli B 1139 FFA Shell Helix Hx 5 15/50',''),
(175,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 007573/Yani/Tuti/Angsuran chopper + gridle',''),
(176,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 007574/Susi/Tuti/Angsuran chopper + gridle',''),
(177,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 007572/Sadiyah/lenny/Angsuran chopper + gridle',''),
(178,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 007571/Kuswanti/Lenny/Angsuran chopper + gridle',''),
(179,'KO1809170001','-','2017-07-15',60000,'Keluar','BSTUK 003301/Um driver nano 10 - 15 jul',''),
(180,'KO1809170001','-','2017-07-15',300000,'Masuk','BP 008516/Supriyanto/Tresye/Tunai chopper + gridle',''),
(181,'KO1809170001','-','2017-07-15',329000,'Masuk','BP 008515/Nita/Tresye/Angsuran noodle',''),
(182,'KO1809170001','-','2017-07-15',500000,'Masuk','BP 008517/Supriyanto/Tyas/Tunai noodle',''),
(183,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 008523/Pujiningsih/Tyas/Angsuran chopper + noodle',''),
(184,'KO1809170001','-','2017-07-15',150000,'Masuk','BP 008524/Kumaeroh/Tyas/Tunai chopper',''),
(185,'KO1809170001','-','2017-07-17',1300000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(186,'KO1809170001','-','2017-07-17',1300000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(187,'KO1809170001','-','2017-07-17',80000,'Keluar','BSTUK 003302/Komisi mingguan indri 8 order',''),
(188,'KO1809170001','-','2017-07-17',1550000,'Masuk','BSTUM 003303/Pelunasan order tyas',''),
(189,'KO1809170001','-','2017-07-17',450000,'Keluar','BSTUK 003304/Komisi 20 % tyas',''),
(190,'KO1809170001','-','2017-07-17',1015000,'Masuk','BSTUM 003520/Heri 11 K',''),
(191,'KO1809170001','-','2017-07-17',1810000,'Masuk','BSTUM 003521/Imam 17 K',''),
(192,'KO1809170001','-','2017-07-17',6100000,'Keluar','Setoran Bank',''),
(193,'KO1809170001','-','2017-07-17',200000,'Masuk','BSTUM 003307/Tambahan DP BP 008508 Sumiyati',''),
(194,'KO1809170001','-','2017-07-17',130000,'Keluar','BSTUK 003305/Bbm Imam 10-17 Jul',''),
(195,'KO1809170001','-','2017-07-17',80000,'Keluar','BSTUK 003306/Komisi mingguan Tressye 8 order',''),
(196,'KO1809170001','-','2017-07-17',389000,'Masuk','BP 007628/Heny/Tyas/Angsuran chopper + noodle',''),
(197,'KO1809170001','-','2017-07-17',159000,'Masuk','BP 008159/Agung/Anik/Angsuran fancy suggo',''),
(198,'KO1809170001','-','2017-07-18',3500000,'Masuk','BSTUM 003309/Pelunasan order Ning 6',''),
(199,'KO1809170001','-','2017-07-18',900000,'Keluar','BSTUK 003310/Komisi 20 % ning',''),
(200,'KO1809170001','-','2017-07-18',1880000,'Masuk','BSTUM 003523-24/Imam 16 K',''),
(201,'KO1809170001','-','2017-07-18',169000,'Masuk','BP 008605/Giyadi/Ning/Angsuran Tulip 8 set',''),
(202,'KO1809170001','-','2017-07-18',250000,'Masuk','BP 008606/Herni/Ning/Tunai noodle',''),
(203,'KO1809170001','-','2017-07-18',500000,'Masuk','BP 008618/Saripah/Ning/Tunai noodle + chopper',''),
(204,'KO1809170001','-','2017-07-18',500000,'Masuk','BP 008616/Pratiwi/Ning/Tunai noodle + chopper',''),
(205,'KO1809170001','-','2017-07-18',500000,'Masuk','BP 008619/Ida/Ning/Tunai noodle',''),
(206,'KO1809170001','-','2017-07-18',500000,'Masuk','BP 008617/Yuly/ning/Tunai noodle',''),
(207,'KO1809170001','-','2017-07-18',269000,'Masuk','BP 008557/Yoen/Indri/Angsuran chopper + tulip 8 set',''),
(208,'KO1809170001','-','2017-07-18',5690000,'Masuk','BSTUM 003525-27/Heri 40 K',''),
(209,'KO1809170001','-','2017-07-18',20000,'Keluar','BSTUK 003311/Komisi mingguan tuti 2 order',''),
(210,'KO1809170001','-','2017-07-18',13400000,'Keluar','Setoran Bank',''),
(211,'KO1809170001','-','2017-07-18',389000,'Masuk','BP 008519/Yayuk/Tyas/Angsuran chopper + noodle',''),
(212,'KO1809170001','-','2017-07-18',150000,'Masuk','BP 007626/Supriyanto/Tyas/Angsuran chopper + gridle',''),
(213,'KO1809170001','-','2017-07-18',169000,'Masuk','BP 008518/Nita/Tressye/Angsuran tulip 8 set',''),
(214,'KO1809170001','-','2017-07-18',150000,'Masuk','BP 008525/Nita/Tresye/Tunai chopper',''),
(215,'KO1809170001','-','2017-07-19',434500,'Keluar','Perjalanan Dinas P\'Sodikin dan P\'Gito Jogja',''),
(216,'KO1809170001','-','2017-07-19',100000,'Masuk','BP 008620/Aminah/Ning/Tunai chopper',''),
(217,'KO1809170001','-','2017-07-19',990000,'Masuk','BSTUM 003528/Imam 9 K',''),
(218,'KO1809170001','-','2017-07-19',2790000,'Masuk','BSTUM 003531-32/Heri 22 K',''),
(219,'KO1809170001','-','2017-07-19',3600000,'Masuk','BSTUM 003312/Pelunasan order ning',''),
(220,'KO1809170001','-','2017-07-19',1050000,'Keluar','BSTUK 003313/Komisi 20 % ning',''),
(221,'KO1809170001','-','2017-07-19',345000,'Keluar','Service Van mobil + denso GM B 1873 UKL',''),
(222,'KO1809170001','-','2017-07-19',159000,'Masuk','BP 007629/Deny/Tressye/Angsuran Fancy 8 set',''),
(223,'KO1809170001','-','2017-07-19',6350000,'Keluar','Setoran Bank',''),
(224,'KO1809170001','-','2017-07-19',150000,'Masuk','BP 008161/Retno/Anik/Tunai chopper',''),
(225,'KO1809170001','-','2017-07-19',300000,'Masuk','BP 008162/Retno/Yayuk/Tunai noodle',''),
(226,'KO1809170001','-','2017-07-20',1000000,'Masuk','BP 008558/Yami/Indri/Indent noodle',''),
(227,'KO1809170001','-','2017-07-20',1560000,'Masuk','BSTUM 003535/Heri 13 K',''),
(228,'KO1809170001','-','2017-07-20',3545000,'Masuk','BSTUM 003533/Imam 26 K',''),
(229,'KO1809170001','-','2017-07-20',150000,'Masuk','BP 007580/Hanny/Lenny/Angsur chopper + gridle',''),
(230,'KO1809170001','-','2017-07-20',150000,'Masuk','BP 007576/Anis/Lenny/Angsur chopper + gridle',''),
(231,'KO1809170001','-','2017-07-20',150000,'Masuk','BP 007579/Ana/Lenny/Angsur chopper + gridle',''),
(232,'KO1809170001','-','2017-07-20',150000,'Masuk','BP 007578/Rina/Tuti/Angsur chopper + gridle',''),
(233,'KO1809170001','-','2017-07-20',150000,'Masuk','BP 007577/Harni/Tuti/Angsur chopper + gridle',''),
(234,'KO1809170001','-','2017-07-20',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(235,'KO1809170001','-','2017-07-20',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(236,'KO1809170001','-','2017-07-21',7305000,'Keluar','Setoran Bank',''),
(237,'KO1809170001','-','2017-07-21',1725000,'Masuk','BSTUM 003536/Heri 12 K',''),
(238,'KO1809170001','-','2017-07-21',75000,'Masuk','BSTUM 003539/Angsuran 1 K',''),
(239,'KO1809170001','-','2017-07-21',2490000,'Masuk','BSTUM 003537/Imam 19 K',''),
(240,'KO1809170001','-','2017-07-21',250000,'Masuk','BP 008520/Sampen/Tyas/Tunai chopper + gridle',''),
(241,'KO1809170001','-','2017-07-21',100000,'Masuk','BP 007320/Fatiyah/Totok/Tunai chopper',''),
(242,'KO1809170001','-','2017-07-21',129000,'Masuk','BP 007323/Tutik/Totok/Angsuran chopper',''),
(243,'KO1809170001','-','2017-07-21',129000,'Masuk','BP 007321/Izatul/Wiwid/Angsuran chopper',''),
(244,'KO1809170001','-','2017-07-21',159000,'Masuk','BP 007322/Siti N/Wiwid/Angsuran fancy 8 set',''),
(245,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007585/Woro/Lenny/Tunai chopper',''),
(246,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007582/Purwanti/Lenny/Tunai chopper',''),
(247,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007586/Irianti/Lenny/Tunai chopper',''),
(248,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007581/Yayuk/Tuti/Tunai chopper',''),
(249,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007583/Purwanti/Tuti/Tunai chopper',''),
(250,'KO1809170001','-','2017-07-21',200000,'Masuk','BP 007587/Cahyaning/Tuti/Tunai tulip 8 set',''),
(251,'KO1809170001','-','2017-07-21',400000,'Masuk','BSTUM 003314/Tambahan DP BP 007447 Wulan',''),
(252,'KO1809170001','-','2017-07-21',784500,'Keluar','Perjalanan Dinas P\'Sodikin dan P\'Gito Pekalongan',''),
(253,'KO1809170001','-','2017-07-21',1900000,'Masuk','BSTUM 003315/Pelunasan order yayuk dan wiwid',''),
(254,'KO1809170001','-','2017-07-21',450000,'Keluar','BSTUK 003316/Komisi 20 % yayuk dan wiwid',''),
(255,'KO1809170001','-','2017-07-21',17000,'Keluar','Biaya Adm Bank',''),
(256,'KO1809170001','-','2017-07-22',8033000,'Keluar','Setoran Bank',''),
(257,'KO1809170001','-','2017-07-22',159000,'Masuk','BP 008624/Eko/Ning/Angsuran fancy 8 set',''),
(258,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 008623/Mira/Ning/Angsuran chopper + gridle',''),
(259,'KO1809170001','-','2017-07-22',1100000,'Masuk','BSTUM 003542/Heri 9 K',''),
(260,'KO1809170001','-','2017-07-22',1915000,'Masuk','BSTUM 003540/Imam 17 K',''),
(261,'KO1809170001','-','2017-07-22',150000,'Keluar','BSTUK 003317/Bbm Imam 17-22 Jul',''),
(262,'KO1809170001','-','2017-07-22',42500,'Keluar','BSTUK 003318/Perjalanan Dinas Pak gito ( tiket kreta Pkg )',''),
(263,'KO1809170001','-','2017-07-22',3150000,'Keluar','Setoran Bank',''),
(264,'KO1809170001','-','2017-07-22',219000,'Masuk','BP 008559/Anik/Indri/Angsuran chopper + fancy 8 set',''),
(265,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 005736/Dini/Lenny/Angsuran chopper + gridle',''),
(266,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007570/Solichin/Lenny/Angsuran chopper + gridle',''),
(267,'KO1809170001','-','2017-07-22',129000,'Masuk','BP 007575/Joko/Lenny/Angsuran chopper',''),
(268,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007590/Siti/Tuti/Angsuran chopper + gridle',''),
(269,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007591/Eni/Tuti/Angsuran chopper + gridle',''),
(270,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007637/Wahyu/Tyas/Angsuran chopper + gridle',''),
(271,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007636/Umi/Tyas/Angsuran chopper + gridle',''),
(272,'KO1809170001','-','2017-07-22',150000,'Masuk','BP 007621/Firma/Tyas/Angsuran chopper + gridle',''),
(273,'KO1809170001','-','2017-07-22',129000,'Masuk','BP 007620/Anik/Tyas/Angsuran chopper',''),
(274,'KO1809170001','-','2017-07-22',60000,'Keluar','BSTUK 003319/Um driver Nano 17 - 22 Jul',''),
(275,'KO1809170001','-','2017-07-22',80000,'Keluar','BSTUK 003320/Um driver Agung 16 - 23 Jul',''),
(276,'KO1809170001','-','2017-07-22',130000,'Keluar','BSTUK 003321/Um driver Tarjo 9-21 / 23 Jul',''),
(277,'KO1809170001','-','2017-07-24',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(278,'KO1809170001','-','2017-07-24',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(279,'KO1809170001','-','2017-07-24',129000,'Masuk','BP 007595/Istiono/Tuti/Angsuran chopper',''),
(280,'KO1809170001','-','2017-07-24',129000,'Masuk','BP 007594/Rochimin/Tuti/Angsuran chopper',''),
(281,'KO1809170001','-','2017-07-24',150000,'Masuk','BP 007592/Subiyanti/Tuti/Angsuran chopper + gridle',''),
(282,'KO1809170001','-','2017-07-24',150000,'Masuk','BP 007593/Anik/Tuti/Angsuran chopper + gridle',''),
(283,'KO1809170001','-','2017-07-24',1950000,'Masuk','BSTUM 003322/Pelunasan order chopper Lenny',''),
(284,'KO1809170001','-','2017-07-24',450000,'Keluar','BSTUK 003323/Komisi 20 % lenny',''),
(285,'KO1809170001','-','2017-07-24',1360000,'Masuk','BSTUM 003543/Imam 11 K',''),
(286,'KO1809170001','-','2017-07-24',3790000,'Masuk','BSTUM 003544/Heri 28 K',''),
(287,'KO1809170001','-','2017-07-24',150000,'Masuk','BP 007640/Jiyarti/Tyas/Angsuran chopper + gridle',''),
(288,'KO1809170001','-','2017-07-24',150000,'Masuk','BP 007639/Paula/Tyas/Angsuran chopper + gridle',''),
(289,'KO1809170001','-','2017-07-24',250000,'Keluar','BSTUK 003324/Um P\'Gito Dinas Pkg 25-29 Jul',''),
(290,'KO1809170001','-','2017-07-24',8400000,'Keluar','Setoran Bank',''),
(291,'KO1809170001','-','2017-07-24',45000,'Keluar','Paket Barang Baraka Ke Pkg',''),
(292,'KO1809170001','-','2017-07-24',100000,'Masuk','BP 007532/Wahyu/Ari/Tunai chopper',''),
(293,'KO1809170001','-','2017-07-24',200000,'Masuk','BP 007531/Tri Puji/Ari/Tunai chopper',''),
(294,'KO1809170001','-','2017-07-24',200000,'Masuk','BP 007530/Sri/Ari/Tunai chopper',''),
(295,'KO1809170001','-','2017-07-24',100000,'Masuk','BP 008166/Nur/Anik/Tunai chopper',''),
(296,'KO1809170001','-','2017-07-24',100000,'Masuk','BP 008167/Ferry/Yayuk/Tunai gridle',''),
(297,'KO1809170001','-','2017-07-25',200000,'Masuk','BP 008626/Siswanto/Ning/Tunai chopper',''),
(298,'KO1809170001','-','2017-07-25',150000,'Masuk','BP 008651/Rifai/Lenny/Angsuran chopper + gridle',''),
(299,'KO1809170001','-','2017-07-25',500000,'Masuk','BSTUM 003326/Pelunasan Order Tyas',''),
(300,'KO1809170001','-','2017-07-25',60000,'Keluar','BSTUK 003325/Komisi mingguan tuti 6 order',''),
(301,'KO1809170001','-','2017-07-25',1900000,'Masuk','BSTUM 003548-49/Imam 16 K',''),
(302,'KO1809170001','-','2017-07-25',2280000,'Masuk','BSTUM 003546-47/Heri 19 K',''),
(303,'KO1809170001','-','2017-07-25',5370000,'Keluar','Setoran Bank',''),
(304,'KO1809170001','-','2017-07-25',180000,'Keluar','Oli Shell B 1700 PFI Helix Hx 5 15/50',''),
(305,'KO1809170001','-','2017-07-25',200000,'Masuk','BSTUM 003327/Tambahan DP Tulip BP 007526 Handayani',''),
(306,'KO1809170001','-','2017-07-25',1050000,'Masuk','BSTUM 003328/Pelunasan order tresye',''),
(307,'KO1809170001','-','2017-07-25',450000,'Keluar','BSTUK 003329/Komisi 20 % tresye',''),
(308,'KO1809170001','-','2017-07-25',2050000,'Masuk','BSTUM 003330/Pelunasan order anik , ari dan yayuk',''),
(309,'KO1809170001','-','2017-07-25',2375000,'Masuk','BSTUM 003331/Pelunasan Order Ari dan yayuk',''),
(310,'KO1809170001','-','2017-07-25',750000,'Keluar','BSTUK 003332/Komisi 20 % yayuk dan ari',''),
(311,'KO1809170001','-','2017-07-26',4689500,'Keluar','Setoran Bank',''),
(312,'KO1809170001','-','2017-07-26',2500000,'Masuk','BP 008561/Agustien/Indri/Tunai noodle',''),
(313,'KO1809170001','-','2017-07-26',200000,'Masuk','BP 008560/Harmini/Indri/Tunai tulip 8 set',''),
(314,'KO1809170001','-','2017-07-26',500000,'Keluar','BSTUK 003335/Komisi 20 % indri',''),
(315,'KO1809170001','-','2017-07-26',3460000,'Masuk','BSTUM 003550/002801/Heri 22 K',''),
(316,'KO1809170001','-','2017-07-26',1690000,'Masuk','BSTUM 002802-03/Imam 16 K',''),
(317,'KO1809170001','-','2017-07-26',150000,'Masuk','BSTUM 002804/Angsuran 1 K',''),
(318,'KO1809170001','-','2017-07-26',159000,'Masuk','BP 008529/Wiwik/Tresye/Angsuran fancy 8 set',''),
(319,'KO1809170001','-','2017-07-26',159000,'Masuk','BP 008528/Reni/Tresye/Angsuran fancy 8 set',''),
(320,'KO1809170001','-','2017-07-26',300000,'Masuk','BP 008527/Ririn/Tresye/Tunai chopper',''),
(321,'KO1809170001','-','2017-07-26',8118000,'Keluar','Setoran Bank',''),
(322,'KO1809170001','-','2017-07-26',159000,'Masuk','BP 008535/Tina/Yayuk/Angsuran fancy 8 set',''),
(323,'KO1809170001','-','2017-07-27',1100000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(324,'KO1809170001','-','2017-07-27',1100000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(325,'KO1809170001','-','2017-07-27',169000,'Masuk','BP 008563/Wiyanti/Indri/Tunai tulip 8 set',''),
(326,'KO1809170001','-','2017-07-27',169000,'Masuk','BP 008562/Wiyantii/Indri/Angsuran tulip 8 set',''),
(327,'KO1809170001','-','2017-07-27',1050000,'Masuk','BSTUM 003336/Pelunasan indri tulip',''),
(328,'KO1809170001','-','2017-07-27',250000,'Keluar','BSTUK 003337/Komisi 20 % indri',''),
(329,'KO1809170001','-','2017-07-27',2535000,'Masuk','BSTUM 002807-08/Heri 24 K',''),
(330,'KO1809170001','-','2017-07-27',2940000,'Masuk','BSTUM 002805-06/Imam 23 K',''),
(331,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008630/Nur/Tuti/Angsuran chopper',''),
(332,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008631/Agnes/Tuti/Angsuran chopper',''),
(333,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008632/Niken/Lenny/Angsuran chopper',''),
(334,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008633/Neni/Lenny/Angsuran chopper',''),
(335,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008634/Tri/Ning/Angsuran chopper',''),
(336,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008635/Mujinem/Ning/Angsuran chopper',''),
(337,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008636/Sutarti/Ning/Angsuran chopper',''),
(338,'KO1809170001','-','2017-07-27',200000,'Keluar','BSTUK 003338/Dinas Perjalanan P\'Iik Jogja',''),
(339,'KO1809170001','-','2017-07-27',7460000,'Keluar','Setoran Bank',''),
(340,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008530/Peni/Tressye/Angsuran chopper',''),
(341,'KO1809170001','-','2017-07-27',129000,'Masuk','BP 008530/Peni/Tressye/Angsuran chopper',''),
(342,'KO1809170001','-','2017-07-28',1250000,'Masuk','BSTUM 002811/Imam 15 K',''),
(343,'KO1809170001','-','2017-07-28',2325000,'Masuk','BSTUM 002809-10/Heri 17 K',''),
(344,'KO1809170001','-','2017-07-28',150000,'Masuk','BP 010179/Giyati/Tyas/Angsuran chopper + griddle',''),
(345,'KO1809170001','-','2017-07-28',150000,'Masuk','BP 010180/Wiwik/Tyas/Angsuran chopper + griddle',''),
(346,'KO1809170001','-','2017-07-28',8000000,'Masuk','Supply Kas Pusat ( Komisi Lunas Dan OR Bu Tuti )',''),
(347,'KO1809170001','-','2017-07-28',329000,'Masuk','BP 008564/Rini/Indri/Angsuran noodle',''),
(348,'KO1809170001','-','2017-07-28',1081000,'Masuk','BSTUM 003339/Pelunasan order indri tulip',''),
(349,'KO1809170001','-','2017-07-28',250000,'Keluar','BSTUK 003340/Komisi 20 % indri',''),
(350,'KO1809170001','-','2017-07-28',1000000,'Keluar','BSTUK 003341/Komisi OR Bu Tuti ( Bu tyas )',''),
(351,'KO1809170001','-','2017-07-28',7080250,'Keluar','Komisi Lunas Smr Mei - Jun\'17',''),
(352,'KO1809170001','-','2017-07-28',50000,'Keluar','BSTUK 003342/Cuci Kolong Mobil D 1176 MP',''),
(353,'KO1809170001','-','2017-07-28',5150000,'Keluar','Setoran Bank',''),
(354,'KO1809170001','-','2017-07-28',129000,'Masuk','BP 007325/Utami/Lenny/Angsuran chopper ',''),
(355,'KO1809170001','-','2017-07-28',169000,'Masuk','BP 007326/Andi/Lenny/Angsuran tulip 8 set',''),
(356,'KO1809170001','-','2017-07-28',329000,'Masuk','BP 007333/Sulis/Wiwid/Angsuran noodle',''),
(357,'KO1809170001','-','2017-07-28',129000,'Masuk','BP 007328/Dian/Wiwid/Angsuran chopper',''),
(358,'KO1809170001','-','2017-07-28',329000,'Masuk','BP 007331/Desi/Wiwid/Angsuran noodle',''),
(359,'KO1809170001','-','2017-07-28',129000,'Masuk','BP 007324/Endang/Anik/Angsuran chopper',''),
(360,'KO1809170001','-','2017-07-29',90000,'Keluar','BSTUK 003343/Komisi mingguan wiwid 9 order',''),
(361,'KO1809170001','-','2017-07-29',100000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(362,'KO1809170001','-','2017-07-29',100000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(363,'KO1809170001','-','2017-07-29',150000,'Masuk','BP 007635/Kristina/Tyas/Angsuran chopper + gridle',''),
(364,'KO1809170001','-','2017-07-29',300000,'Masuk','BP 008534/Handayani/Tresye/Tunai chopper + noodle',''),
(365,'KO1809170001','-','2017-07-29',129000,'Masuk','BP 008533/Tiwi/Tresye/Angsuran chopper ',''),
(366,'KO1809170001','-','2017-07-29',129000,'Masuk','BP 008532/Nanik/Tresye/Angsuran chopper',''),
(367,'KO1809170001','-','2017-07-29',129000,'Masuk','BP 008531/Badi/Tresye/Angsuran chopper',''),
(368,'KO1809170001','-','2017-07-29',160000,'Keluar','BSTUK 003344/Bbm kolektor Imam 24 - 29 Jul',''),
(369,'KO1809170001','-','2017-07-29',230000,'Keluar','BSTUK 003345/Komisi mingguan tyas 23 order',''),
(370,'KO1809170001','-','2017-07-29',80000,'Keluar','BSTUK 003347/Komisi mingguan tuti 8 order',''),
(371,'KO1809170001','-','2017-07-29',1150000,'Masuk','BSTUM 002812/Imam 9 K',''),
(372,'KO1809170001','-','2017-07-29',60000,'Keluar','BSTUK 003346/Um driver nano 24-29 Jul',''),
(373,'KO1809170001','-','2017-07-29',2600000,'Keluar','Setoran Bank',''),
(374,'KO1809170001','-','2017-07-29',100000,'Masuk','BP 007714/Harman/Yayuk/Tunai gridle',''),
(375,'KO1809170001','-','2017-07-29',30000,'Keluar','BSTUK 003349/Komisi mingguan ari 3 order',''),
(376,'KO1809170001','-','2017-07-29',70000,'Keluar','BSTUK 003348/Um driver Tarjo 24-28/30-31 Jul',''),
(377,'KO1809170001','-','2017-07-29',1259000,'Masuk','BSTUM 002814/Angsuran 15 K',''),
(378,'KO1809170001','-','2017-07-29',935000,'Masuk','BSTUM 002813/Heri 9 K',''),
(379,'KO1809170001','-','2017-07-31',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(380,'KO1809170001','-','2017-07-31',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(381,'KO1809170001','-','2017-07-31',2202750,'Keluar','Setoran Bank',''),
(382,'KO1809170001','-','2017-07-31',129000,'Masuk','BP 007567/Sri/Tuti/Angsuran chopper',''),
(383,'KO1809170001','-','2017-07-31',100000,'Masuk','BP 008452/Asih/Tuti/Tunai chopper',''),
(384,'KO1809170001','-','2017-07-31',100000,'Masuk','BP 008453/Nurul/Tuti/Tunai chopper',''),
(385,'KO1809170001','-','2017-07-31',100000,'Masuk','BP 008454/Neta/Tuti/Tunai chopper',''),
(386,'KO1809170001','-','2017-07-31',750000,'Masuk','BP 008638/Galuh/Ning/Tunai chopper',''),
(387,'KO1809170001','-','2017-07-31',150000,'Masuk','BP 008622/Emy/Ning/Angsuran chopper + gridle',''),
(388,'KO1809170001','-','2017-07-31',100000,'Masuk','BP 008451/Suyem/Ning/Tunai chopper',''),
(389,'KO1809170001','-','2017-07-31',100000,'Masuk','BP 007598/Ristiyanti/Lenny/Tunai chopper',''),
(390,'KO1809170001','-','2017-07-31',300000,'Masuk','BP 008401/Narno/Tresye/Tunai gridle',''),
(391,'KO1809170001','-','2017-07-31',129000,'Masuk','BP 007645/Rini/Tyas/Angsuran chopper',''),
(392,'KO1809170001','-','2017-07-31',129000,'Masuk','BP 007643/Kiki/Tyas/Angsuran chopper',''),
(393,'KO1809170001','-','2017-07-31',150000,'Masuk','BP 007644/Sri/Tyas/Angsuran chopper+gridle',''),
(394,'KO1809170001','-','2017-07-31',800000,'Masuk','BSTUM 002853/Penambahan DP BP 008161 dan 008162',''),
(395,'KO1809170001','-','2017-07-31',300000,'Keluar','BSTUK 002858/Komisi mingguan ning 30 order',''),
(396,'KO1809170001','-','2017-07-31',250000,'Keluar','BSTUK 002861/Um Pak gito Dinas Pkg 01 - 05 Ags',''),
(397,'KO1809170001','-','2017-07-31',42500,'Keluar','BSTUK 002861/Tiket Kreta Pkg Pak Gito',''),
(398,'KO1809170001','-','2017-07-31',150000,'Keluar','BSTUK 002855/Komisi tunai 20 % bu ning',''),
(399,'KO1809170001','-','2017-07-31',560000,'Keluar','BSTUK -00433107 Biaya Paket Baraka',''),
(400,'KO1809170001','-','2017-07-31',2240000,'Masuk','BSTUM 002815-16/Imam 19 K',''),
(401,'KO1809170001','-','2017-07-31',1950000,'Masuk','BSTUM 002817-18-Heri 16 K',''),
(402,'KO1809170001','-','2017-07-31',350000,'Masuk','BSTUM 002819/Angsuran 4 K',''),
(403,'KO1809170001','-','2017-07-31',6250000,'Keluar','Setoran Bank',''),
(404,'KO1809170001','-','2017-07-31',2138000,'Masuk','BSTUM 002821/Heri 14 K',''),
(405,'KO1809170001','-','2017-07-31',690000,'Masuk','BSTUM 002822/Angsuran 3 K',''),
(406,'KO1809170001','-','2017-07-31',600000,'Masuk','BSTUM 002820/Imam 7 K',''),
(407,'KO1809170001','-','2017-07-31',269000,'Masuk','BP 007332/Cipta/Wiwid/Angsuran chopper + tulip 8 set',''),
(408,'KO1809170001','-','2017-07-31',129000,'Masuk','BP 007330/Farida/Wiwid/Angsuran chopper',''),
(409,'KO1809170001','-','2017-07-31',129000,'Masuk','BP 007329/Ari/Wiwid/Angsuran chopper',''),
(410,'KO1809170001','-','2017-07-31',294000,'Keluar','BSTUK 002862/Komisi 15 % lenny',''),
(890,'KO1809170002','-','2017-08-10',6750000,'Masuk','BSTUM 002918/Pelunasan order ning',''),
(891,'KO1809170002','-','2017-08-10',1500000,'Keluar','BSTUK 002919/Komisi 20 % ning',''),
(892,'KO1809170002','-','2017-08-10',3775000,'Masuk','BSTUM 002839-40/Heri 16 K',''),
(893,'KO1809170002','-','2017-08-10',240000,'Keluar','BSTUK 002920/Komisi 20 % lenny',''),
(894,'KO1809170002','-','2017-08-10',9200000,'Keluar','Setoran Bank',''),
(895,'KO1809170002','-','2017-08-10',100000,'Masuk','BP 008411/Afri/Tyas/Tunai chopper 2 in 1',''),
(896,'KO1809170002','-','2017-08-10',199000,'Masuk','BP 007649/Ricco/Tyas/Angsuran fancy stove',''),
(897,'KO1809170002','-','2017-08-10',199000,'Masuk','BP 008412/Betty/Tyas/Tunai Fancy stove',''),
(898,'KO1809170002','-','2017-08-10',200000,'Masuk','BP 008407/Ratna/Tyas/Tunai presto elektrik',''),
(899,'KO1809170002','-','2017-08-11',300000,'Keluar','BSTUK 002921/Santunan Kematian ( keluarga sales )',''),
(900,'KO1809170002','-','2017-08-11',229000,'Masuk','BP 008413/Narti/Tyas/Angsuran elektrik presto',''),
(901,'KO1809170002','-','2017-08-11',1400000,'Masuk','BSTUM 002841/Imam 12 K',''),
(902,'KO1809170002','-','2017-08-11',1155000,'Masuk','BSTUM 002842/Heri 10 K',''),
(903,'KO1809170002','-','2017-08-11',229000,'Masuk','BP 008571/Agustin/Indri/Tunai Presto Elektrik',''),
(904,'KO1809170002','-','2017-08-11',199000,'Masuk','BP 008570/Retno/Indri/Tuai Fancy Stove',''),
(905,'KO1809170002','-','2017-08-11',4900000,'Masuk','Supply Pusat ( Komisi Staff )',''),
(906,'KO1809170002','-','2017-08-11',4930905,'Keluar','Komisi Staff Smr',''),
(907,'KO1809170002','-','2017-08-11',3650000,'Keluar','Setoran Bank',''),
(908,'KO1809170002','-','2017-08-11',400000,'Masuk','BP 008351/Lany/Tressye/Tunai Noodle',''),
(909,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008707/Sorutun/Tuti/Angsuran chopper',''),
(910,'KO1809170002','-','2017-08-11',129000,'Masuk','BP 008663/Ainun/Lenny/Angsuran chopper',''),
(911,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008671/Narni/Lenny/Angsuran chopper + gridle',''),
(912,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008706/Putri/Tuti/Angsuran chopper + gridle',''),
(913,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008702/Ari/Tuti/Tunai chopper',''),
(914,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008701/Endah/Tuti/Tunai chopper',''),
(915,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008703/Sari/Tuti/Tunai chopper',''),
(916,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008704/Rini/Tuti/Tunai chopper',''),
(917,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008705/Atik/Tuti/Tunai chopper',''),
(918,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008665/Widya/Lenny/Tunai chopper',''),
(919,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008666/Arum/Lenny/Tunai chopper',''),
(920,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008667/Oky/Lenny/Tunai chopper',''),
(921,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008668/Tuti/Lenny/Tunai chopper',''),
(922,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008669/Mus/Lenny/Tunai chopper',''),
(923,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008665/Widya/Lenny/Tunai chopper',''),
(924,'KO1809170002','-','2017-08-11',1650000,'Keluar','BSTUK 002924/Komisi 20 % lenny dan tuti',''),
(925,'KO1809170002','-','2017-08-11',150000,'Keluar','BSTUK 002925/Dinas Perj Agung ( ambil chopper Pkg )',''),
(926,'KO1809170002','-','2017-08-11',621000,'Masuk','BSTUM 002922/Pelunasan order tui ( jogja )',''),
(927,'KO1809170002','-','2017-08-11',150000,'Keluar','BSTUK 002923/Komisi 20 % chopper',''),
(928,'KO1809170002','-','2017-08-11',100000,'Keluar','BSTUK 002926/Dinas Perjalanan P\'Sodikin Pkg',''),
(929,'KO1809170002','-','2017-08-11',50000,'Masuk','BSTUM 002927/Sisa Dinas Perj P\'Gito',''),
(930,'KO1809170002','-','2017-08-11',7950000,'Keluar','Setoran Bank',''),
(931,'KO1809170002','-','2017-08-12',1795000,'Masuk','BSTUM 002843-44/Imam 17 K',''),
(932,'KO1809170002','-','2017-08-12',8000000,'Masuk','Supply Pusat ( Komisi A1 dan Sawulan Sales )',''),
(933,'KO1809170002','-','2017-08-12',6535500,'Keluar','Komisi A1 Sales',''),
(934,'KO1809170002','-','2017-08-12',2176300,'Keluar','Komisi Sawulan Sales',''),
(935,'KO1809170002','-','2017-08-12',1100000,'Keluar','Setoran Bank',''),
(936,'KO1809170002','-','2017-08-12',650000,'Masuk','BSTUM 002936/Pelunasan order lenny',''),
(937,'KO1809170002','-','2017-08-12',150000,'Keluar','BSTUK 002937/Komisi 20 % lenny',''),
(938,'KO1809170002','-','2017-08-12',1860000,'Masuk','BSTUM 002938/Pelunasan order tuti',''),
(939,'KO1809170002','-','2017-08-12',450000,'Keluar','BSTUK 002939/Komisi 20 % tuti',''),
(940,'KO1809170002','-','2017-08-14',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(941,'KO1809170002','-','2017-08-14',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(942,'KO1809170002','-','2017-08-14',300000,'Masuk','BSTUM 002940/Angsuran mobil ( agung ) lunas',''),
(943,'KO1809170002','-','2017-08-14',1110000,'Keluar','Setoran Bank',''),
(944,'KO1809170002','-','2017-08-14',159000,'Masuk','BP 008572/Indri/Indri/Angsuran fancy 8 set',''),
(945,'KO1809170002','-','2017-08-14',1105000,'Masuk','BSTUM 002845/Imam 9 K',''),
(946,'KO1809170002','-','2017-08-14',1235000,'Masuk','BSTUM 002846/Heri 10 K',''),
(947,'KO1809170002','-','2017-08-14',1271000,'Masuk','BSTUM 002941/Pelunasan order indri',''),
(948,'KO1809170002','-','2017-08-14',300000,'Keluar','BSTUK 002942/Komisi 20 % indri',''),
(949,'KO1809170002','-','2017-08-14',135000,'Keluar','BSTUK 002944/Bbm kolektor Imam 7-12 Ags',''),
(950,'KO1809170002','-','2017-08-14',1075000,'Keluar','BSTUK 002945/Biaya Paket TNT ( spare part )',''),
(951,'KO1809170002','-','2017-08-14',550000,'Masuk','BSTUM 002946/Pelunasan order Tyas',''),
(952,'KO1809170002','-','2017-08-14',150000,'Keluar','BSTUK 002947/Komisi 20 % tyas',''),
(953,'KO1809170002','-','2017-08-14',392000,'Masuk','BP 008708/Agung/Gridle ( Lunas )',''),
(954,'KO1809170002','-','2017-08-14',1600000,'Masuk','BSTUM 002950/Pelunasan order tuti',''),
(955,'KO1809170002','-','2017-08-14',400000,'Keluar','BSTUK 002951/Komisi 20 % tuti',''),
(956,'KO1809170002','-','2017-08-14',139000,'Masuk','BP 008462/Agustina/Tuti/Angsuran chopper 2 in 1',''),
(957,'KO1809170002','-','2017-08-14',139000,'Masuk','BP 008464/Umi/Lenny/Angsuran Chopper 2 in 1',''),
(958,'KO1809170002','-','2017-08-14',400000,'Masuk','BP 008465/Amin/Tuti/Tunai chopper',''),
(959,'KO1809170002','-','2017-08-14',5925000,'Keluar','Setoran Bank',''),
(960,'KO1809170002','-','2017-08-14',1700000,'Masuk','BSTUM 002952/Pelunasan order lenny',''),
(961,'KO1809170002','-','2017-08-14',300000,'Keluar','BSTUK 002953/Komisi 20 % lenny',''),
(962,'KO1809170002','-','2017-08-15',2940000,'Masuk','BSTUM 002955/Pelunasan order Tressye',''),
(963,'KO1809170002','-','2017-08-15',768000,'Keluar','BSTUK 002957/Komisi 20 % tressye',''),
(964,'KO1809170002','-','2017-08-15',3577000,'Keluar','Setoran Bank',''),
(965,'KO1809170002','-','2017-08-15',5050000,'Masuk','BSTUM 002847-48/Heri 25 K',''),
(966,'KO1809170002','-','2017-08-15',500000,'Keluar','BSTUK 002959/Komisi 20 % Indri',''),
(967,'KO1809170002','-','2017-08-15',820000,'Keluar','BSTUK 002960/Pembelian ban B 1320 KMT ( 2 baru , 1 bekas )',''),
(968,'KO1809170002','-','2017-08-15',2250000,'Keluar','Komisi / Bonus Staff ( driver dan kolektor )',''),
(969,'KO1809170002','-','2017-08-15',3275000,'Masuk','BSTUM 002849-50/Imam 25 K',''),
(970,'KO1809170002','-','2017-08-15',60000,'Keluar','BSTUK 002962/Um driver Nano 7-12 Ags',''),
(971,'KO1809170002','-','2017-08-15',4650000,'Keluar','Setoran Bank',''),
(972,'KO1809170002','-','2017-08-15',150000,'Masuk','BP 008463/Asih/Tuti/Tunai chopper 2 in 1',''),
(973,'KO1809170002','-','2017-08-15',150000,'Masuk','BP 008672/Puji/Lenny/Tunai chopper 2 in 1',''),
(974,'KO1809170002','-','2017-08-16',329000,'Masuk','BP 008415/Yayuk/Tressye/Angsuran nodle',''),
(975,'KO1809170002','-','2017-08-16',150000,'Masuk','BP 008538/Ana/Tyas/Tunai gridle',''),
(976,'KO1809170002','-','2017-08-16',169000,'Masuk','BP 008539/Ton/Tressye/Angsuran tulip set',''),
(977,'KO1809170002','-','2017-08-16',169000,'Masuk','BP 008540/Mila/Tyas/Angsuran tulip set',''),
(978,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008675/Musnah/Tuti/Angsuran chopper 2 in 1',''),
(979,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008676/Dul/Lenny/Angsuran chopper 2 In 1',''),
(980,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008674/Kunardi/Lenny/Angsuran chopper 2 in 1',''),
(981,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008673/Yen/Tuti/Angsuran chopper 2 In 1',''),
(982,'KO1809170002','-','2017-08-16',1720000,'Masuk','BSTUM 003001/Imam 10 K',''),
(983,'KO1809170002','-','2017-08-16',3280000,'Masuk','BSTUM 003002-03/Heri 28 K',''),
(984,'KO1809170002','-','2017-08-16',200000,'Keluar','BSTUK 002967/Uang Tali kasih ( Bu yayuk )',''),
(985,'KO1809170002','-','2017-08-16',6518000,'Keluar','Setoran Bank',''),
(986,'KO1809170002','-','2017-08-16',800000,'Masuk','BSTUM 003004/Imam 8 K',''),
(987,'KO1809170002','-','2017-08-18',650000,'Keluar','BSTUK 002968/Service Mobil Agung ( radiator bocor )',''),
(988,'KO1809170002','-','2017-08-18',700000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(989,'KO1809170002','-','2017-08-18',700000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(990,'KO1809170002','-','2017-08-18',1380000,'Masuk','BSTUM 003005/Imam 13 K',''),
(991,'KO1809170002','-','2017-08-18',520000,'Keluar','Paket Baraka ( 20 presto , 36 gridle , kompor 10 )',''),
(992,'KO1809170002','-','2017-08-18',985000,'Keluar','Setoran Bank',''),
(993,'KO1809170002','-','2017-08-18',17000,'Keluar','Adm BCA',''),
(994,'KO1809170002','-','2017-08-18',850000,'Masuk','BSTUM 002969/Pelunasan order ari',''),
(995,'KO1809170002','-','2017-08-18',2200000,'Masuk','BSTUM 002972/Pelunasan order anik',''),
(996,'KO1809170002','-','2017-08-18',1900000,'Masuk','BSTUM 002973/Pelunasan order tresye',''),
(997,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002974/Komisi 20 % tyas',''),
(998,'KO1809170002','-','2017-08-18',600000,'Keluar','BSTUK 002974/Komisi 20 % anik',''),
(999,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002974/Komisi 20 % ari',''),
(1000,'KO1809170002','-','2017-08-18',1000000,'Masuk','BSTUM 002975/Pelunasan order tressye',''),
(1001,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002976/Komisi 20 % tressye',''),
(1002,'KO1809170002','-','2017-08-18',1900000,'Masuk','BSTUM 0030006/Heri 13 K',''),
(1003,'KO1809170002','-','2017-08-19',50000,'Keluar','BSTUK 002971/Um driver Nano 14-19 Ags',''),
(1004,'KO1809170002','-','2017-08-19',60000,'Keluar','BSTUK 002970/Um driver tarjo 13-19 Ags',''),
(1005,'KO1809170002','-','2017-08-19',6240000,'Keluar','Setoran Bank',''),
(1006,'KO1809170002','-','2017-08-19',490000,'Masuk','BP 008576/Mia/Indri/Tunai griddle',''),
(1007,'KO1809170002','-','2017-08-19',159000,'Masuk','BP 008573/Lis/Indri/Angsuran fancy 8 set',''),
(1008,'KO1809170002','-','2017-08-19',139000,'Masuk','BP 008574/Nanik/Indri/Angsuran griddle',''),
(1009,'KO1809170002','-','2017-08-19',1420000,'Masuk','BSTUM 003007/Imam 11 K',''),
(1010,'KO1809170002','-','2017-08-19',160000,'Keluar','BSTUK 002977/Um driver agung 1-19 ags',''),
(1011,'KO1809170002','-','2017-08-19',150000,'Keluar','BSTUK 002978/Bbm kolektor imam 14-19 ags',''),
(1012,'KO1809170002','-','2017-08-19',98000,'Keluar','BSTUK 002979/Komisi 20 % indri',''),
(1013,'KO1809170002','-','2017-08-19',150000,'Masuk','BP 008417/Santi/Tyas/Tunai chopper',''),
(1014,'KO1809170002','-','2017-08-19',1950000,'Keluar','Setoran Bank',''),
(1015,'KO1809170002','-','2017-08-19',199000,'Masuk','BP 008416/Sumiyati/Tressye/Angsuran fancy stove',''),
(1016,'KO1809170002','-','2017-08-19',229000,'Masuk','BP 008541/Anik/Tressye/Angsuran presto elektrik',''),
(1017,'KO1809170002','-','2017-08-19',1800000,'Masuk','BSTUM 002980/Pelunasan Order Wiwid',''),
(1018,'KO1809170002','-','2017-08-21',2236000,'Keluar','Setoran Bank',''),
(1019,'KO1809170002','-','2017-08-21',1500000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1020,'KO1809170002','-','2017-08-21',1500000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1021,'KO1809170002','-','2017-08-21',100000,'Masuk','BP 008677/Heru/Tuti/Tunai chopper',''),
(1022,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008678/Sufi/Lenny/Tunai tulip 8 set',''),
(1023,'KO1809170002','-','2017-08-21',1410000,'Masuk','BSTUM 003008/Imam 10 K',''),
(1024,'KO1809170002','-','2017-08-21',1560000,'Masuk','BSTUM 002982/Pelunasan order lenny',''),
(1025,'KO1809170002','-','2017-08-21',3250000,'Keluar','Setoran Bank',''),
(1026,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008543/Novi/Tyas/Tunai presto elektrik',''),
(1027,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008542/Meilia/Tressye/Tunai presto elektrik',''),
(1028,'KO1809170002','-','2017-08-21',1250000,'Masuk','BSTUM 003009/Heri 10 K',''),
(1029,'KO1809170002','-','2017-08-21',100000,'Keluar','BSTUK 002983/Dinas Perj P\'Dikin Kudus',''),
(1030,'KO1809170002','-','2017-08-22',1570000,'Keluar','Setoran Bank',''),
(1031,'KO1809170002','-','2017-08-22',3840000,'Masuk','BSTUM 003010-003011/Heri 28 K',''),
(1032,'KO1809170002','-','2017-08-22',2060000,'Masuk','BSTUM 003012/Imam 15 K',''),
(1033,'KO1809170002','-','2017-08-22',130000,'Keluar','BSTUK 002984/Komisi mingguan tyas 13 order',''),
(1034,'KO1809170002','-','2017-08-22',5750000,'Keluar','Setoran Bank',''),
(1035,'KO1809170002','-','2017-08-22',199000,'Masuk','BP 008679/Dwi/Lenny/Angsuran Fancy stove',''),
(1036,'KO1809170002','-','2017-08-23',2210000,'Masuk','BSTUM 003013-14/Imam 17 K',''),
(1037,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008577/Navi/Indri/Angsuran Ez Blend',''),
(1038,'KO1809170002','-','2017-08-23',80000,'Keluar','BSTUK 002985/Komisi mingguan indri 8 order',''),
(1039,'KO1809170002','-','2017-08-23',1550000,'Keluar','Setoran Bank',''),
(1040,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008680/Yanti/Lenny/Angsuran gridle',''),
(1041,'KO1809170002','-','2017-08-23',100000,'Masuk','BP 008681/Shendy/Lenny/Tunai griddle',''),
(1042,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008468/Mulyana/Lenny/Angsuran chopper 2 in 1',''),
(1043,'KO1809170002','-','2017-08-23',2500000,'Masuk','BSTUM 002986/Pelunasan order Ari',''),
(1044,'KO1809170002','-','2017-08-23',600000,'Keluar','BSTUK 002987/Komisi 20 % ari',''),
(1045,'KO1809170002','-','2017-08-24',2316000,'Keluar','Setoran Bank',''),
(1046,'KO1809170002','-','2017-08-24',1500000,'Masuk','BSTUM 003015/Imam 13 K',''),
(1047,'KO1809170002','-','2017-08-24',2995000,'Masuk','BSTUM 003016-14/Heri 24 K',''),
(1048,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 010802/Marni/Tyas/Tunai chopper',''),
(1049,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 0010801/Ruri/Tyas/Tunai chopper',''),
(1050,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 010803/Darmi/Tyas/Tunai chopper',''),
(1051,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 010805/Rina/Tressye/Tunai chopper',''),
(1052,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 010804/Nanik/Tressye/Tunai chopper',''),
(1053,'KO1809170002','-','2017-08-24',150000,'Masuk','BP 008683/Aniati/Lenny/Tunai chopper 2 in 1',''),
(1054,'KO1809170002','-','2017-08-24',80000,'Keluar','BSTUK 002988/Komisi mingguan tuti 8 order',''),
(1055,'KO1809170002','-','2017-08-24',5350000,'Keluar','Setoran Bank',''),
(1056,'KO1809170002','-','2017-08-24',250000,'Masuk','BSTUM 002989/Penambahan DP chopper 10805 & 10804',''),
(1057,'KO1809170002','-','2017-08-24',229000,'Masuk','BP 008467/Siti/Tuti/Angsuran Presto elektrik',''),
(1058,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 008682/Suyati/Tuti/Tunai chopper 2 in 1',''),
(1059,'KO1809170002','-','2017-08-24',290000,'Masuk','BP 008578/Wahyu/Indri/Angsuran noodle',''),
(1060,'KO1809170002','-','2017-08-24',700000,'Masuk','BSTUM 002990/Pelunasan order Ari',''),
(1061,'KO1809170002','-','2017-08-25',800000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1062,'KO1809170002','-','2017-08-25',800000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1063,'KO1809170002','-','2017-08-25',1584000,'Keluar','Setoran Bank',''),
(1064,'KO1809170002','-','2017-08-25',1200000,'Masuk','BSTUM 002991/Pelunasan order Ning',''),
(1065,'KO1809170002','-','2017-08-25',229000,'Masuk','BP 008424/Pin/Tressye/Angsuran Presto elektrik',''),
(1066,'KO1809170002','-','2017-08-25',150000,'Masuk','BP 008423/Wahyu/Tressye/Angsuran chopper + gridle',''),
(1067,'KO1809170002','-','2017-08-25',150000,'Masuk','BP 008422/Umi/Tyas/Angsuran chopper + gridle',''),
(1068,'KO1809170002','-','2017-08-25',400000,'Masuk','BP 010811/Lastri/Tyas/Tunai presto elektrik',''),
(1069,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 008684/Yuni/Lenny/Tunai chopper 2 in 1',''),
(1070,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 008685/Halim/Tuti/Tunai chopper 2 in 1',''),
(1071,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 005048/Asih/Tuti/Tunai chopper 2 in 2',''),
(1072,'KO1809170002','-','2017-08-25',2495000,'Masuk','BSTUM 003018-19/Heri 14 K',''),
(1073,'KO1809170002','-','2017-08-25',2740000,'Masuk','BSTUM 003020-21/Imam 21 K',''),
(1074,'KO1809170002','-','2017-08-25',7650000,'Keluar','Setoran Bank',''),
(1075,'KO1809170002','-','2017-08-25',750000,'Masuk','BSTUM 002995/Pelunasan order ari',''),
(1076,'KO1809170002','-','2017-08-25',120000,'Keluar','BSTUK 002993/Komisi mingguan indri 12 order',''),
(1077,'KO1809170002','-','2017-08-25',60000,'Keluar','BSTUK 002994/Um driver nano 21-26 ags',''),
(1078,'KO1809170002','-','2017-08-26',1960000,'Masuk','BSTUM 003022-23/Heri19 K',''),
(1079,'KO1809170002','-','2017-08-26',2000000,'Masuk','BSTUM 003024/Imam 15 K',''),
(1080,'KO1809170002','-','2017-08-26',150000,'Keluar','BSTUK 002995/Bbm Imam 21-26 ags',''),
(1081,'KO1809170002','-','2017-08-26',4360000,'Keluar','Setoran Bank',''),
(1082,'KO1809170002','-','2017-08-26',100000,'Masuk','BP 008686/Wahyu/Lenny/Tunai chopper 2 in 1',''),
(1083,'KO1809170002','-','2017-08-26',100000,'Masuk','BP 008687/Imed/Lenny/Tunai chopper 2 in 1',''),
(1084,'KO1809170002','-','2017-08-28',70000,'Keluar','BSTUK 002996/Um driver agung 21-27 Ags',''),
(1085,'KO1809170002','-','2017-08-28',500000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1086,'KO1809170002','-','2017-08-28',500000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1087,'KO1809170002','-','2017-08-28',159000,'Masuk','BP 08582/Irma/Indri/Angsuran fancy 8 set',''),
(1088,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008580/Asti/Indri/Angsuran noodle',''),
(1089,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008581/Candra/Indri/Angsuran noodle',''),
(1090,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008579/Eny/Indri/Angsuran chopper',''),
(1091,'KO1809170002','-','2017-08-28',129000,'Masuk','BP 010809/Endah/Tyas/Angsuran chopper',''),
(1092,'KO1809170002','-','2017-08-28',950500,'Keluar','BSTUK 002997/Dinas Perjalanan Pak Sodikin',''),
(1093,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008575/Cusiah/Indri/Angsuran noodle',''),
(1094,'KO1809170002','-','2017-08-28',800000,'Masuk','BSTUM 002997/Pelunasan order ning',''),
(1095,'KO1809170002','-','2017-08-28',300000,'Keluar','BSTUK 002998/Komisi 20 % ning',''),
(1096,'KO1809170002','-','2017-08-28',100000,'Masuk','BP 005050/Siti/Tuti/Tunai chopper 2 in 1',''),
(1097,'KO1809170002','-','2017-08-28',1505000,'Masuk','BSTUM 003027/Imam 12 K',''),
(1098,'KO1809170002','-','2017-08-28',2630000,'Masuk','BSTUM 003025-26/Heri 20 K',''),
(1099,'KO1809170002','-','2017-08-28',6450000,'Keluar','Setoran Bank',''),
(1100,'KO1809170002','-','2017-08-28',150000,'Masuk','BP 008425/Susila/Tressye/Angsuran chopper + gridle',''),
(1101,'KO1809170002','-','2017-08-28',2600000,'Masuk','BSTUM 003000/Pelunasan order Ari',''),
(1102,'KO1809170002','-','2017-08-28',290000,'Keluar','BSTUK 002999/Komisi mingguan lenny 29 order',''),
(1103,'KO1809170002','-','2017-08-28',90000,'Keluar','BSTUK 002999/bonus tambahan chopper 2 in 1 ( 9 order )',''),
(1104,'KO1809170002','-','2017-08-29',2372500,'Keluar','Setoran Bank',''),
(1105,'KO1809170002','-','2017-08-29',4200000,'Masuk','Supply Pusat ( Komisi Sawulan Ketupat )',''),
(1106,'KO1809170002','-','2017-08-29',2700000,'Masuk','Supply Pusat ( Komisi Lunas )',''),
(1107,'KO1809170002','-','2017-08-29',2700000,'Masuk','BSTUM 003029-30/Imam 20 K',''),
(1108,'KO1809170002','-','2017-08-29',1925000,'Masuk','BSTUM 003028/Heri 17 K',''),
(1109,'KO1809170002','-','2017-08-29',650000,'Masuk','BSTUM 003051/Pelunasan Order lenny',''),
(1110,'KO1809170002','-','2017-08-29',1290000,'Masuk','BSTUM 003055/Pelunasan Order tresye',''),
(1111,'KO1809170002','-','2017-08-29',150000,'Keluar','BSTUK 003054/Komisi 20 % lenny',''),
(1112,'KO1809170002','-','2017-08-29',630000,'Keluar','BSTUK 003056/Komisi 20 % tressye',''),
(1113,'KO1809170002','-','2017-08-29',4200000,'Keluar','Komisi sawulan ketupat sales',''),
(1114,'KO1809170002','-','2017-08-29',4522500,'Keluar','Komisi Lunas Sales Ags',''),
(1115,'KO1809170002','-','2017-08-29',52500,'Keluar','BSTUM 86281385/Pulsa paket XL',''),
(1116,'KO1809170002','-','2017-08-29',3900000,'Keluar','Setoran Bank',''),
(1117,'KO1809170002','-','2017-08-29',229000,'Masuk','BP 008585/Siti/Indri/Angsuran presto elektrik',''),
(1118,'KO1809170002','-','2017-08-29',229000,'Masuk','BP 008583/Dina/Indri/Angsuran presto elektrik',''),
(1119,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008689/Siti/Lenny/Tunai chopper 2 in 1',''),
(1120,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008688/Umi/Lenny/Tunai chopper 2 in 1',''),
(1121,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008691/Tuti/Lastri/Tunai chopper 2 in 1',''),
(1122,'KO1809170002','-','2017-08-30',3500000,'Masuk','BSTUM 003031-3032/Imam 28 K',''),
(1123,'KO1809170002','-','2017-08-30',2880000,'Masuk','BSTUM 0030033-3034/Heri 22 K',''),
(1124,'KO1809170002','-','2017-08-30',650000,'Masuk','BSTUM 003058/Pelunasan order lenny',''),
(1125,'KO1809170002','-','2017-08-30',150000,'Keluar','BSTUK 003059/Komisi 20 % lenny',''),
(1126,'KO1809170002','-','2017-08-30',850000,'Keluar','BSTUK 003060/Pembayaran paket UPS',''),
(1127,'KO1809170002','-','2017-08-30',6790000,'Keluar','Setoran Bank',''),
(1128,'KO1809170002','-','2017-08-01',3735500,'Masuk','Saldo Pindahan',''),
(1129,'KO1809170002','-','2017-08-01',3685500,'Keluar','Setoran Bank',''),
(1130,'KO1809170002','-','2017-08-01',2150000,'Masuk','BSTUM 002863/Pelunasan order indri',''),
(1131,'KO1809170002','-','2017-08-01',630000,'Keluar','BSTUK 002864/Komisi 20 % indri',''),
(1132,'KO1809170002','-','2017-08-01',1800000,'Masuk','BSTUM 002865/Pelunasan order Tuti',''),
(1133,'KO1809170002','-','2017-08-01',1050000,'Masuk','BSTUM 002867/Pelunasan orer lenny',''),
(1134,'KO1809170002','-','2017-08-01',550000,'Keluar','BSTUK 002866/Komisi 20 % tuti dan lenny',''),
(1135,'KO1809170002','-','2017-08-01',3780000,'Keluar','Setoran Bank',''),
(1136,'KO1809170002','-','2017-08-01',100000,'Masuk','BP 008652/Tumini/Lenny/Tunai chopper',''),
(1137,'KO1809170002','-','2017-08-01',159000,'Masuk','BP 008654/Ida/Lenny/Angsuran fancy 8 set',''),
(1138,'KO1809170002','-','2017-08-01',380000,'Masuk','BSTUM 002824/Imam 3 K',''),
(1139,'KO1809170002','-','2017-08-02',250000,'Masuk','BSTUM 002825/Imam 2 K',''),
(1140,'KO1809170002','-','2017-08-02',90000,'Keluar','BSTUK 54013-0208 Paket Baraka Jogja',''),
(1141,'KO1809170002','-','2017-08-02',80000,'Keluar','BSTUK 002868/Um driver agung 24-31 Jul',''),
(1142,'KO1809170002','-','2017-08-02',700000,'Keluar','Setoran Bank',''),
(1143,'KO1809170002','-','2017-08-02',500000,'Masuk','BP 008455/Hayati/Tuti/Tunai chopper ( Herpus )',''),
(1144,'KO1809170002','-','2017-08-02',100000,'Masuk','BP 008456/Herni/Tuti/Tunai chopper',''),
(1145,'KO1809170002','-','2017-08-02',100000,'Masuk','BP 008457/Kus/Tuti/Tunai chopper',''),
(1146,'KO1809170002','-','2017-08-02',150000,'Masuk','BP 008402/Sumiyati/Tyas/Angsuran chopper + gridle',''),
(1147,'KO1809170002','-','2017-08-02',550000,'Masuk','BSTUM 002869/Pelunasan order tuti',''),
(1148,'KO1809170002','-','2017-08-02',150000,'Keluar','BSTUK 002870/Komisi 20 % tuti',''),
(1149,'KO1809170002','-','2017-08-02',485000,'Keluar','BSTUK 002871/Bbm kolektor Heri 21 hari',''),
(1150,'KO1809170002','-','2017-08-02',65000,'Keluar','BSTUK 002871/Komisi mingguan heri',''),
(1151,'KO1809170002','-','2017-08-03',1100000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1152,'KO1809170002','-','2017-08-03',1100000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1153,'KO1809170002','-','2017-08-03',950000,'Masuk','BSTUM 002826/Imam 8 K',''),
(1154,'KO1809170002','-','2017-08-03',509000,'Keluar','Biaya Reimbursment Pak Sodikin',''),
(1155,'KO1809170002','-','2017-08-03',1200000,'Keluar','Setoran Bank',''),
(1156,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 007716/Iwan/Yayuk/Tunai chopper',''),
(1157,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 007715/Gatot/Yayuk/Tunai griddle',''),
(1158,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008658/Retno/Lenny/Tunai chopper',''),
(1159,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008657/Dwi Budi/Lenny/Tunai chopper',''),
(1160,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008655/Inaya/Lenny/Tunai chopper',''),
(1161,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008408/Rona Yuli/Tressye/Angsuran Fancy 8 set + chopper',''),
(1162,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008409/Isaman/Tresye/Angsuran Fancy 8 set + chopper',''),
(1163,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008405/Tatik/Tyas/Fancy 8 set + chopper',''),
(1164,'KO1809170002','-','2017-08-03',129000,'Masuk','BP 008404/Yuli/Tyas/Angsuran chopper',''),
(1165,'KO1809170002','-','2017-08-03',1450000,'Masuk','BSTUM 002872/Pelunasan Order lenny',''),
(1166,'KO1809170002','-','2017-08-03',450000,'Keluar','BSTUK 002873/Komisi 20 % lenny',''),
(1167,'KO1809170002','-','2017-08-04',2286000,'Keluar','Setoran Bank',''),
(1168,'KO1809170002','-','2017-08-04',330000,'Masuk','BSTUM 002827/Imam 2 K',''),
(1169,'KO1809170002','-','2017-08-04',100000,'Masuk','BP 007720/Suep/Yayuk/Tunai chopper',''),
(1170,'KO1809170002','-','2017-08-04',189000,'Masuk','BP 007719/Ita/Totok/Angsuran gridle + fancy 8 set',''),
(1171,'KO1809170002','-','2017-08-04',100000,'Masuk','BP 007721/Fitri/Yayuk/Tunai gridle',''),
(1172,'KO1809170002','-','2017-08-04',650000,'Masuk','BSTUM 002876/Pelunasan order tuti',''),
(1173,'KO1809170002','-','2017-08-04',150000,'Keluar','BSTUK 002878/Komisi 20 % tuti',''),
(1174,'KO1809170002','-','2017-08-04',240000,'Keluar','BSTUK 002877/Komisi mingguan lenny 24 order',''),
(1175,'KO1809170002','-','2017-08-04',50000,'Keluar','BSTUK 002875/Um driver Tarjo 1-5 Ags',''),
(1176,'KO1809170002','-','2017-08-04',70000,'Keluar','BSTUK 002874/Komisi mingguan yayuk 7 Order',''),
(1177,'KO1809170002','-','2017-08-04',20000,'Keluar','BSTUK 002874/Komisi mingguan totok 2 order',''),
(1178,'KO1809170002','-','2017-08-04',70000,'Keluar','BSTUK 002874/Komisi mingguan anik 7 order',''),
(1179,'KO1809170002','-','2017-08-04',140000,'Keluar','BSTUK 002879/Komisi mingguan indri 14 order',''),
(1180,'KO1809170002','-','2017-08-05',705000,'Masuk','BSTUM 002828/Imam 6 K',''),
(1181,'KO1809170002','-','2017-08-05',25000000,'Masuk','Supply Pusat ( Salary staff dan Komisi Sales )',''),
(1182,'KO1809170002','-','2017-08-05',16600000,'Keluar','Salary Staff Smr',''),
(1183,'KO1809170002','-','2017-08-05',9070100,'Keluar','Salary Sales ',''),
(1184,'KO1809170002','-','2017-08-05',60000,'Keluar','BSTUK 002879/Um driver Nano 31 Jul - 5 Ags',''),
(1185,'KO1809170002','-','2017-08-05',300000,'Masuk','BSTUM 002882/Angsuran KIT Chopper',''),
(1186,'KO1809170002','-','2017-08-05',100000,'Keluar','BSTUK 002884/Komisi mingguan tuti 10 Order',''),
(1187,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008458/Suraniningsih/Tuti/Angsuran chopper',''),
(1188,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008459/Sri Suwarti/Tuti/Angsuran chopper',''),
(1189,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008460/Sri Lestari/Tuti/Angsuran chopper',''),
(1190,'KO1809170002','-','2017-08-05',750000,'Masuk','BP 007599/Ristiyanti/Lenny/Tunai chopper',''),
(1191,'KO1809170002','-','2017-08-05',1300000,'Masuk','BSTUM 002883/Pelunasan order lenny',''),
(1192,'KO1809170002','-','2017-08-05',450000,'Keluar','BSTUK 002889/Komisi 20 % lenny',''),
(1193,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002888/Penjualan Hp Inv Jogja ( Irpan )',''),
(1194,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002888/Penjualan Hp Inv Smr ( Gito )',''),
(1195,'KO1809170002','-','2017-08-05',1350000,'Masuk','BSTUM 002887/Pelunasan order Ning',''),
(1196,'KO1809170002','-','2017-08-05',338000,'Keluar','BSTUK 002890/Komisi 20 % ning',''),
(1197,'KO1809170002','-','2017-08-05',4200000,'Keluar','Setoran Bank',''),
(1198,'KO1809170002','-','2017-08-05',2680000,'Masuk','BSTUM 002892/Pelunasan Order Tresye',''),
(1199,'KO1809170002','-','2017-08-05',700000,'Masuk','BSTUM 002895/Pelunasan order wiwid',''),
(1200,'KO1809170002','-','2017-08-05',816000,'Keluar','BSTUK 002893/Komisi 20 % tresye',''),
(1201,'KO1809170002','-','2017-08-05',100000,'Keluar','BSTUK 002893/Komisi tambahan alsyva',''),
(1202,'KO1809170002','-','2017-08-05',300000,'Keluar','BSTUK 002896/Komisi 20 % wiwid',''),
(1203,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002829/Imam 2 K',''),
(1204,'KO1809170002','-','2017-08-07',1916900,'Keluar','Setoran Bank',''),
(1205,'KO1809170002','-','2017-08-07',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1206,'KO1809170002','-','2017-08-07',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1207,'KO1809170002','-','2017-08-07',329000,'Masuk','BP 008410/Lis/Tyas/Angsuran noodle',''),
(1208,'KO1809170002','-','2017-08-07',1185000,'Masuk','BSTUM 002830/Imam 10 K',''),
(1209,'KO1809170002','-','2017-08-07',350000,'Masuk','BSTUK 002831/Angsuran 3 K',''),
(1210,'KO1809170002','-','2017-08-07',200000,'Masuk','BSTUM 002898/Tambahan DP 007611 a,n Suwarni',''),
(1211,'KO1809170002','-','2017-08-07',60000,'Keluar','BSTUK 002897/Bbm Imam 3Ags/5-7 Ags',''),
(1212,'KO1809170002','-','2017-08-07',300000,'Keluar','BSTUK 002899/Iuran Warga 17 Agustus',''),
(1213,'KO1809170002','-','2017-08-07',150000,'Keluar','BSTUK 002898/Komisi mingguan tresye 15 order',''),
(1214,'KO1809170002','-','2017-08-07',1500000,'Keluar','Setoran Bank',''),
(1215,'KO1809170002','-','2017-08-07',390000,'Masuk','BSTUM 002832/Heri 3 K',''),
(1216,'KO1809170002','-','2017-08-07',150000,'Masuk','BSTUM 002833/Imam 1 K',''),
(1217,'KO1809170002','-','2017-08-08',1135000,'Masuk','BSTUM 002834/Imam 8 K',''),
(1218,'KO1809170002','-','2017-08-08',1650000,'Masuk','BSTUM 002835/Heri 10 K',''),
(1219,'KO1809170002','-','2017-08-08',242500,'Keluar','BSTUK 002910/Per Dinas P\'Gito Pkg 9-12 Ags',''),
(1220,'KO1809170002','-','2017-08-08',3100000,'Keluar','Setoran Bank',''),
(1221,'KO1809170002','-','2017-08-08',1000000,'Masuk','BSTUM 002912/Pelunasan order tresye',''),
(1222,'KO1809170002','-','2017-08-08',250000,'Keluar','BSTUK 002913/Komisi 20 % tresye',''),
(1223,'KO1809170002','-','2017-08-09',436500,'Keluar','BSTUK 002914/Dinas Perj Pak Sodikin Jogja 7-8 Ags',''),
(1224,'KO1809170002','-','2017-08-09',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1225,'KO1809170002','-','2017-08-09',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1226,'KO1809170002','-','2017-08-09',229000,'Masuk','BP 008568/Rini/Indri/Angsuran Presto elektrik',''),
(1227,'KO1809170002','-','2017-08-09',229000,'Masuk','BP 008566/Aneng/Indri/Angsuran Presto elektrik',''),
(1228,'KO1809170002','-','2017-08-09',329000,'Masuk','BP 008567/Edy/Indri/Angsuran Noodle',''),
(1229,'KO1809170002','-','2017-08-09',199000,'Masuk','BP 008565/Tien/Indri/Angsuran Fancy Stove',''),
(1230,'KO1809170002','-','2017-08-09',87500,'Keluar','BSTUK-840710175317 Pembelian Tiket KA PP Smr-Pkg P\'Sodikin',''),
(1231,'KO1809170002','-','2017-08-09',4590000,'Masuk','BSTUM 002836-37/Heri 25 K',''),
(1232,'KO1809170002','-','2017-08-09',1145000,'Masuk','BSTUM 002838/Imam 9 K',''),
(1233,'KO1809170002','-','2017-08-09',94500,'Keluar','BSTUK 002915/Pembeliak Atk kantor',''),
(1234,'KO1809170002','-','2017-08-09',300000,'Masuk','BP 008169/Tyas/Anik/Tunai chopper',''),
(1235,'KO1809170002','-','2017-08-09',50000,'Keluar','BSTUK 002916/Service Mobil ( Las Knalpot Mobil Agung )',''),
(1236,'KO1809170002','-','2017-08-09',7350000,'Keluar','Setoran Bank',''),
(1237,'KO1809170002','-','2017-08-09',150000,'Masuk','BP 005737/Diah/Tuti/Angsuran chopper + gridle',''),
(1238,'KO1809170002','-','2017-08-09',139000,'Masuk','BP 005739/Saum/Lenny/Angsuran gridle',''),
(1239,'KO1809170002','-','2017-08-09',150000,'Masuk','BP 005738/Yuni/Lenny/Angsuran chopper + gridle',''),
(1240,'KO1809170002','-','2017-08-09',50000,'Keluar','BSTUK 002917/Um driver Tarjo 6-10 Ags','');
/*Table structure for table `kas_besar_detail_temp` */
DROP TABLE IF EXISTS `kas_besar_detail_temp`;
CREATE TABLE `kas_besar_detail_temp` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
`jeniskas` varchar(20) NOT NULL,
`uraian` text,
`kodeakun` varchar(15) NOT NULL,
PRIMARY KEY (`id`,`kodekas`)
) ENGINE=InnoDB AUTO_INCREMENT=1241 DEFAULT CHARSET=latin1;
/*Data for the table `kas_besar_detail_temp` */
insert into `kas_besar_detail_temp`(`id`,`kodekas`,`kodekasmanual`,`tanggal`,`total`,`jeniskas`,`uraian`,`kodeakun`) values
(890,'KO1809170002','-','2017-08-10',6750000,'Masuk','BSTUM 002918/Pelunasan order ning',''),
(891,'KO1809170002','-','2017-08-10',1500000,'Keluar','BSTUK 002919/Komisi 20 % ning',''),
(892,'KO1809170002','-','2017-08-10',3775000,'Masuk','BSTUM 002839-40/Heri 16 K',''),
(893,'KO1809170002','-','2017-08-10',240000,'Keluar','BSTUK 002920/Komisi 20 % lenny',''),
(894,'KO1809170002','-','2017-08-10',9200000,'Keluar','Setoran Bank',''),
(895,'KO1809170002','-','2017-08-10',100000,'Masuk','BP 008411/Afri/Tyas/Tunai chopper 2 in 1',''),
(896,'KO1809170002','-','2017-08-10',199000,'Masuk','BP 007649/Ricco/Tyas/Angsuran fancy stove',''),
(897,'KO1809170002','-','2017-08-10',199000,'Masuk','BP 008412/Betty/Tyas/Tunai Fancy stove',''),
(898,'KO1809170002','-','2017-08-10',200000,'Masuk','BP 008407/Ratna/Tyas/Tunai presto elektrik',''),
(899,'KO1809170002','-','2017-08-11',300000,'Keluar','BSTUK 002921/Santunan Kematian ( keluarga sales )',''),
(900,'KO1809170002','-','2017-08-11',229000,'Masuk','BP 008413/Narti/Tyas/Angsuran elektrik presto',''),
(901,'KO1809170002','-','2017-08-11',1400000,'Masuk','BSTUM 002841/Imam 12 K',''),
(902,'KO1809170002','-','2017-08-11',1155000,'Masuk','BSTUM 002842/Heri 10 K',''),
(903,'KO1809170002','-','2017-08-11',229000,'Masuk','BP 008571/Agustin/Indri/Tunai Presto Elektrik',''),
(904,'KO1809170002','-','2017-08-11',199000,'Masuk','BP 008570/Retno/Indri/Tuai Fancy Stove',''),
(905,'KO1809170002','-','2017-08-11',4900000,'Masuk','Supply Pusat ( Komisi Staff )',''),
(906,'KO1809170002','-','2017-08-11',4930905,'Keluar','Komisi Staff Smr',''),
(907,'KO1809170002','-','2017-08-11',3650000,'Keluar','Setoran Bank',''),
(908,'KO1809170002','-','2017-08-11',400000,'Masuk','BP 008351/Lany/Tressye/Tunai Noodle',''),
(909,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008707/Sorutun/Tuti/Angsuran chopper',''),
(910,'KO1809170002','-','2017-08-11',129000,'Masuk','BP 008663/Ainun/Lenny/Angsuran chopper',''),
(911,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008671/Narni/Lenny/Angsuran chopper + gridle',''),
(912,'KO1809170002','-','2017-08-11',150000,'Masuk','BP 008706/Putri/Tuti/Angsuran chopper + gridle',''),
(913,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008702/Ari/Tuti/Tunai chopper',''),
(914,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008701/Endah/Tuti/Tunai chopper',''),
(915,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008703/Sari/Tuti/Tunai chopper',''),
(916,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008704/Rini/Tuti/Tunai chopper',''),
(917,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008705/Atik/Tuti/Tunai chopper',''),
(918,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008665/Widya/Lenny/Tunai chopper',''),
(919,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008666/Arum/Lenny/Tunai chopper',''),
(920,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008667/Oky/Lenny/Tunai chopper',''),
(921,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008668/Tuti/Lenny/Tunai chopper',''),
(922,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008669/Mus/Lenny/Tunai chopper',''),
(923,'KO1809170002','-','2017-08-11',750000,'Masuk','BP 008665/Widya/Lenny/Tunai chopper',''),
(924,'KO1809170002','-','2017-08-11',1650000,'Keluar','BSTUK 002924/Komisi 20 % lenny dan tuti',''),
(925,'KO1809170002','-','2017-08-11',150000,'Keluar','BSTUK 002925/Dinas Perj Agung ( ambil chopper Pkg )',''),
(926,'KO1809170002','-','2017-08-11',621000,'Masuk','BSTUM 002922/Pelunasan order tui ( jogja )',''),
(927,'KO1809170002','-','2017-08-11',150000,'Keluar','BSTUK 002923/Komisi 20 % chopper',''),
(928,'KO1809170002','-','2017-08-11',100000,'Keluar','BSTUK 002926/Dinas Perjalanan P\'Sodikin Pkg',''),
(929,'KO1809170002','-','2017-08-11',50000,'Masuk','BSTUM 002927/Sisa Dinas Perj P\'Gito',''),
(930,'KO1809170002','-','2017-08-11',7950000,'Keluar','Setoran Bank',''),
(931,'KO1809170002','-','2017-08-12',1795000,'Masuk','BSTUM 002843-44/Imam 17 K',''),
(932,'KO1809170002','-','2017-08-12',8000000,'Masuk','Supply Pusat ( Komisi A1 dan Sawulan Sales )',''),
(933,'KO1809170002','-','2017-08-12',6535500,'Keluar','Komisi A1 Sales',''),
(934,'KO1809170002','-','2017-08-12',2176300,'Keluar','Komisi Sawulan Sales',''),
(935,'KO1809170002','-','2017-08-12',1100000,'Keluar','Setoran Bank',''),
(936,'KO1809170002','-','2017-08-12',650000,'Masuk','BSTUM 002936/Pelunasan order lenny',''),
(937,'KO1809170002','-','2017-08-12',150000,'Keluar','BSTUK 002937/Komisi 20 % lenny',''),
(938,'KO1809170002','-','2017-08-12',1860000,'Masuk','BSTUM 002938/Pelunasan order tuti',''),
(939,'KO1809170002','-','2017-08-12',450000,'Keluar','BSTUK 002939/Komisi 20 % tuti',''),
(940,'KO1809170002','-','2017-08-14',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(941,'KO1809170002','-','2017-08-14',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(942,'KO1809170002','-','2017-08-14',300000,'Masuk','BSTUM 002940/Angsuran mobil ( agung ) lunas',''),
(943,'KO1809170002','-','2017-08-14',1110000,'Keluar','Setoran Bank',''),
(944,'KO1809170002','-','2017-08-14',159000,'Masuk','BP 008572/Indri/Indri/Angsuran fancy 8 set',''),
(945,'KO1809170002','-','2017-08-14',1105000,'Masuk','BSTUM 002845/Imam 9 K',''),
(946,'KO1809170002','-','2017-08-14',1235000,'Masuk','BSTUM 002846/Heri 10 K',''),
(947,'KO1809170002','-','2017-08-14',1271000,'Masuk','BSTUM 002941/Pelunasan order indri',''),
(948,'KO1809170002','-','2017-08-14',300000,'Keluar','BSTUK 002942/Komisi 20 % indri',''),
(949,'KO1809170002','-','2017-08-14',135000,'Keluar','BSTUK 002944/Bbm kolektor Imam 7-12 Ags',''),
(950,'KO1809170002','-','2017-08-14',1075000,'Keluar','BSTUK 002945/Biaya Paket TNT ( spare part )',''),
(951,'KO1809170002','-','2017-08-14',550000,'Masuk','BSTUM 002946/Pelunasan order Tyas',''),
(952,'KO1809170002','-','2017-08-14',150000,'Keluar','BSTUK 002947/Komisi 20 % tyas',''),
(953,'KO1809170002','-','2017-08-14',392000,'Masuk','BP 008708/Agung/Gridle ( Lunas )',''),
(954,'KO1809170002','-','2017-08-14',1600000,'Masuk','BSTUM 002950/Pelunasan order tuti',''),
(955,'KO1809170002','-','2017-08-14',400000,'Keluar','BSTUK 002951/Komisi 20 % tuti',''),
(956,'KO1809170002','-','2017-08-14',139000,'Masuk','BP 008462/Agustina/Tuti/Angsuran chopper 2 in 1',''),
(957,'KO1809170002','-','2017-08-14',139000,'Masuk','BP 008464/Umi/Lenny/Angsuran Chopper 2 in 1',''),
(958,'KO1809170002','-','2017-08-14',400000,'Masuk','BP 008465/Amin/Tuti/Tunai chopper',''),
(959,'KO1809170002','-','2017-08-14',5925000,'Keluar','Setoran Bank',''),
(960,'KO1809170002','-','2017-08-14',1700000,'Masuk','BSTUM 002952/Pelunasan order lenny',''),
(961,'KO1809170002','-','2017-08-14',300000,'Keluar','BSTUK 002953/Komisi 20 % lenny',''),
(962,'KO1809170002','-','2017-08-15',2940000,'Masuk','BSTUM 002955/Pelunasan order Tressye',''),
(963,'KO1809170002','-','2017-08-15',768000,'Keluar','BSTUK 002957/Komisi 20 % tressye',''),
(964,'KO1809170002','-','2017-08-15',3577000,'Keluar','Setoran Bank',''),
(965,'KO1809170002','-','2017-08-15',5050000,'Masuk','BSTUM 002847-48/Heri 25 K',''),
(966,'KO1809170002','-','2017-08-15',500000,'Keluar','BSTUK 002959/Komisi 20 % Indri',''),
(967,'KO1809170002','-','2017-08-15',820000,'Keluar','BSTUK 002960/Pembelian ban B 1320 KMT ( 2 baru , 1 bekas )',''),
(968,'KO1809170002','-','2017-08-15',2250000,'Keluar','Komisi / Bonus Staff ( driver dan kolektor )',''),
(969,'KO1809170002','-','2017-08-15',3275000,'Masuk','BSTUM 002849-50/Imam 25 K',''),
(970,'KO1809170002','-','2017-08-15',60000,'Keluar','BSTUK 002962/Um driver Nano 7-12 Ags',''),
(971,'KO1809170002','-','2017-08-15',4650000,'Keluar','Setoran Bank',''),
(972,'KO1809170002','-','2017-08-15',150000,'Masuk','BP 008463/Asih/Tuti/Tunai chopper 2 in 1',''),
(973,'KO1809170002','-','2017-08-15',150000,'Masuk','BP 008672/Puji/Lenny/Tunai chopper 2 in 1',''),
(974,'KO1809170002','-','2017-08-16',329000,'Masuk','BP 008415/Yayuk/Tressye/Angsuran nodle',''),
(975,'KO1809170002','-','2017-08-16',150000,'Masuk','BP 008538/Ana/Tyas/Tunai gridle',''),
(976,'KO1809170002','-','2017-08-16',169000,'Masuk','BP 008539/Ton/Tressye/Angsuran tulip set',''),
(977,'KO1809170002','-','2017-08-16',169000,'Masuk','BP 008540/Mila/Tyas/Angsuran tulip set',''),
(978,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008675/Musnah/Tuti/Angsuran chopper 2 in 1',''),
(979,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008676/Dul/Lenny/Angsuran chopper 2 In 1',''),
(980,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008674/Kunardi/Lenny/Angsuran chopper 2 in 1',''),
(981,'KO1809170002','-','2017-08-16',139000,'Masuk','BP 008673/Yen/Tuti/Angsuran chopper 2 In 1',''),
(982,'KO1809170002','-','2017-08-16',1720000,'Masuk','BSTUM 003001/Imam 10 K',''),
(983,'KO1809170002','-','2017-08-16',3280000,'Masuk','BSTUM 003002-03/Heri 28 K',''),
(984,'KO1809170002','-','2017-08-16',200000,'Keluar','BSTUK 002967/Uang Tali kasih ( Bu yayuk )',''),
(985,'KO1809170002','-','2017-08-16',6518000,'Keluar','Setoran Bank',''),
(986,'KO1809170002','-','2017-08-16',800000,'Masuk','BSTUM 003004/Imam 8 K',''),
(987,'KO1809170002','-','2017-08-18',650000,'Keluar','BSTUK 002968/Service Mobil Agung ( radiator bocor )',''),
(988,'KO1809170002','-','2017-08-18',700000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(989,'KO1809170002','-','2017-08-18',700000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(990,'KO1809170002','-','2017-08-18',1380000,'Masuk','BSTUM 003005/Imam 13 K',''),
(991,'KO1809170002','-','2017-08-18',520000,'Keluar','Paket Baraka ( 20 presto , 36 gridle , kompor 10 )',''),
(992,'KO1809170002','-','2017-08-18',985000,'Keluar','Setoran Bank',''),
(993,'KO1809170002','-','2017-08-18',17000,'Keluar','Adm BCA',''),
(994,'KO1809170002','-','2017-08-18',850000,'Masuk','BSTUM 002969/Pelunasan order ari',''),
(995,'KO1809170002','-','2017-08-18',2200000,'Masuk','BSTUM 002972/Pelunasan order anik',''),
(996,'KO1809170002','-','2017-08-18',1900000,'Masuk','BSTUM 002973/Pelunasan order tresye',''),
(997,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002974/Komisi 20 % tyas',''),
(998,'KO1809170002','-','2017-08-18',600000,'Keluar','BSTUK 002974/Komisi 20 % anik',''),
(999,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002974/Komisi 20 % ari',''),
(1000,'KO1809170002','-','2017-08-18',1000000,'Masuk','BSTUM 002975/Pelunasan order tressye',''),
(1001,'KO1809170002','-','2017-08-18',300000,'Keluar','BSTUK 002976/Komisi 20 % tressye',''),
(1002,'KO1809170002','-','2017-08-18',1900000,'Masuk','BSTUM 0030006/Heri 13 K',''),
(1003,'KO1809170002','-','2017-08-19',50000,'Keluar','BSTUK 002971/Um driver Nano 14-19 Ags',''),
(1004,'KO1809170002','-','2017-08-19',60000,'Keluar','BSTUK 002970/Um driver tarjo 13-19 Ags',''),
(1005,'KO1809170002','-','2017-08-19',6240000,'Keluar','Setoran Bank',''),
(1006,'KO1809170002','-','2017-08-19',490000,'Masuk','BP 008576/Mia/Indri/Tunai griddle',''),
(1007,'KO1809170002','-','2017-08-19',159000,'Masuk','BP 008573/Lis/Indri/Angsuran fancy 8 set',''),
(1008,'KO1809170002','-','2017-08-19',139000,'Masuk','BP 008574/Nanik/Indri/Angsuran griddle',''),
(1009,'KO1809170002','-','2017-08-19',1420000,'Masuk','BSTUM 003007/Imam 11 K',''),
(1010,'KO1809170002','-','2017-08-19',160000,'Keluar','BSTUK 002977/Um driver agung 1-19 ags',''),
(1011,'KO1809170002','-','2017-08-19',150000,'Keluar','BSTUK 002978/Bbm kolektor imam 14-19 ags',''),
(1012,'KO1809170002','-','2017-08-19',98000,'Keluar','BSTUK 002979/Komisi 20 % indri',''),
(1013,'KO1809170002','-','2017-08-19',150000,'Masuk','BP 008417/Santi/Tyas/Tunai chopper',''),
(1014,'KO1809170002','-','2017-08-19',1950000,'Keluar','Setoran Bank',''),
(1015,'KO1809170002','-','2017-08-19',199000,'Masuk','BP 008416/Sumiyati/Tressye/Angsuran fancy stove',''),
(1016,'KO1809170002','-','2017-08-19',229000,'Masuk','BP 008541/Anik/Tressye/Angsuran presto elektrik',''),
(1017,'KO1809170002','-','2017-08-19',1800000,'Masuk','BSTUM 002980/Pelunasan Order Wiwid',''),
(1018,'KO1809170002','-','2017-08-21',2236000,'Keluar','Setoran Bank',''),
(1019,'KO1809170002','-','2017-08-21',1500000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1020,'KO1809170002','-','2017-08-21',1500000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1021,'KO1809170002','-','2017-08-21',100000,'Masuk','BP 008677/Heru/Tuti/Tunai chopper',''),
(1022,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008678/Sufi/Lenny/Tunai tulip 8 set',''),
(1023,'KO1809170002','-','2017-08-21',1410000,'Masuk','BSTUM 003008/Imam 10 K',''),
(1024,'KO1809170002','-','2017-08-21',1560000,'Masuk','BSTUM 002982/Pelunasan order lenny',''),
(1025,'KO1809170002','-','2017-08-21',3250000,'Keluar','Setoran Bank',''),
(1026,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008543/Novi/Tyas/Tunai presto elektrik',''),
(1027,'KO1809170002','-','2017-08-21',200000,'Masuk','BP 008542/Meilia/Tressye/Tunai presto elektrik',''),
(1028,'KO1809170002','-','2017-08-21',1250000,'Masuk','BSTUM 003009/Heri 10 K',''),
(1029,'KO1809170002','-','2017-08-21',100000,'Keluar','BSTUK 002983/Dinas Perj P\'Dikin Kudus',''),
(1030,'KO1809170002','-','2017-08-22',1570000,'Keluar','Setoran Bank',''),
(1031,'KO1809170002','-','2017-08-22',3840000,'Masuk','BSTUM 003010-003011/Heri 28 K',''),
(1032,'KO1809170002','-','2017-08-22',2060000,'Masuk','BSTUM 003012/Imam 15 K',''),
(1033,'KO1809170002','-','2017-08-22',130000,'Keluar','BSTUK 002984/Komisi mingguan tyas 13 order',''),
(1034,'KO1809170002','-','2017-08-22',5750000,'Keluar','Setoran Bank',''),
(1035,'KO1809170002','-','2017-08-22',199000,'Masuk','BP 008679/Dwi/Lenny/Angsuran Fancy stove',''),
(1036,'KO1809170002','-','2017-08-23',2210000,'Masuk','BSTUM 003013-14/Imam 17 K',''),
(1037,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008577/Navi/Indri/Angsuran Ez Blend',''),
(1038,'KO1809170002','-','2017-08-23',80000,'Keluar','BSTUK 002985/Komisi mingguan indri 8 order',''),
(1039,'KO1809170002','-','2017-08-23',1550000,'Keluar','Setoran Bank',''),
(1040,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008680/Yanti/Lenny/Angsuran gridle',''),
(1041,'KO1809170002','-','2017-08-23',100000,'Masuk','BP 008681/Shendy/Lenny/Tunai griddle',''),
(1042,'KO1809170002','-','2017-08-23',139000,'Masuk','BP 008468/Mulyana/Lenny/Angsuran chopper 2 in 1',''),
(1043,'KO1809170002','-','2017-08-23',2500000,'Masuk','BSTUM 002986/Pelunasan order Ari',''),
(1044,'KO1809170002','-','2017-08-23',600000,'Keluar','BSTUK 002987/Komisi 20 % ari',''),
(1045,'KO1809170002','-','2017-08-24',2316000,'Keluar','Setoran Bank',''),
(1046,'KO1809170002','-','2017-08-24',1500000,'Masuk','BSTUM 003015/Imam 13 K',''),
(1047,'KO1809170002','-','2017-08-24',2995000,'Masuk','BSTUM 003016-14/Heri 24 K',''),
(1048,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 010802/Marni/Tyas/Tunai chopper',''),
(1049,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 0010801/Ruri/Tyas/Tunai chopper',''),
(1050,'KO1809170002','-','2017-08-24',200000,'Masuk','BP 010803/Darmi/Tyas/Tunai chopper',''),
(1051,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 010805/Rina/Tressye/Tunai chopper',''),
(1052,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 010804/Nanik/Tressye/Tunai chopper',''),
(1053,'KO1809170002','-','2017-08-24',150000,'Masuk','BP 008683/Aniati/Lenny/Tunai chopper 2 in 1',''),
(1054,'KO1809170002','-','2017-08-24',80000,'Keluar','BSTUK 002988/Komisi mingguan tuti 8 order',''),
(1055,'KO1809170002','-','2017-08-24',5350000,'Keluar','Setoran Bank',''),
(1056,'KO1809170002','-','2017-08-24',250000,'Masuk','BSTUM 002989/Penambahan DP chopper 10805 & 10804',''),
(1057,'KO1809170002','-','2017-08-24',229000,'Masuk','BP 008467/Siti/Tuti/Angsuran Presto elektrik',''),
(1058,'KO1809170002','-','2017-08-24',100000,'Masuk','BP 008682/Suyati/Tuti/Tunai chopper 2 in 1',''),
(1059,'KO1809170002','-','2017-08-24',290000,'Masuk','BP 008578/Wahyu/Indri/Angsuran noodle',''),
(1060,'KO1809170002','-','2017-08-24',700000,'Masuk','BSTUM 002990/Pelunasan order Ari',''),
(1061,'KO1809170002','-','2017-08-25',800000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1062,'KO1809170002','-','2017-08-25',800000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1063,'KO1809170002','-','2017-08-25',1584000,'Keluar','Setoran Bank',''),
(1064,'KO1809170002','-','2017-08-25',1200000,'Masuk','BSTUM 002991/Pelunasan order Ning',''),
(1065,'KO1809170002','-','2017-08-25',229000,'Masuk','BP 008424/Pin/Tressye/Angsuran Presto elektrik',''),
(1066,'KO1809170002','-','2017-08-25',150000,'Masuk','BP 008423/Wahyu/Tressye/Angsuran chopper + gridle',''),
(1067,'KO1809170002','-','2017-08-25',150000,'Masuk','BP 008422/Umi/Tyas/Angsuran chopper + gridle',''),
(1068,'KO1809170002','-','2017-08-25',400000,'Masuk','BP 010811/Lastri/Tyas/Tunai presto elektrik',''),
(1069,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 008684/Yuni/Lenny/Tunai chopper 2 in 1',''),
(1070,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 008685/Halim/Tuti/Tunai chopper 2 in 1',''),
(1071,'KO1809170002','-','2017-08-25',100000,'Masuk','BP 005048/Asih/Tuti/Tunai chopper 2 in 2',''),
(1072,'KO1809170002','-','2017-08-25',2495000,'Masuk','BSTUM 003018-19/Heri 14 K',''),
(1073,'KO1809170002','-','2017-08-25',2740000,'Masuk','BSTUM 003020-21/Imam 21 K',''),
(1074,'KO1809170002','-','2017-08-25',7650000,'Keluar','Setoran Bank',''),
(1075,'KO1809170002','-','2017-08-25',750000,'Masuk','BSTUM 002995/Pelunasan order ari',''),
(1076,'KO1809170002','-','2017-08-25',120000,'Keluar','BSTUK 002993/Komisi mingguan indri 12 order',''),
(1077,'KO1809170002','-','2017-08-25',60000,'Keluar','BSTUK 002994/Um driver nano 21-26 ags',''),
(1078,'KO1809170002','-','2017-08-26',1960000,'Masuk','BSTUM 003022-23/Heri19 K',''),
(1079,'KO1809170002','-','2017-08-26',2000000,'Masuk','BSTUM 003024/Imam 15 K',''),
(1080,'KO1809170002','-','2017-08-26',150000,'Keluar','BSTUK 002995/Bbm Imam 21-26 ags',''),
(1081,'KO1809170002','-','2017-08-26',4360000,'Keluar','Setoran Bank',''),
(1082,'KO1809170002','-','2017-08-26',100000,'Masuk','BP 008686/Wahyu/Lenny/Tunai chopper 2 in 1',''),
(1083,'KO1809170002','-','2017-08-26',100000,'Masuk','BP 008687/Imed/Lenny/Tunai chopper 2 in 1',''),
(1084,'KO1809170002','-','2017-08-28',70000,'Keluar','BSTUK 002996/Um driver agung 21-27 Ags',''),
(1085,'KO1809170002','-','2017-08-28',500000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1086,'KO1809170002','-','2017-08-28',500000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1087,'KO1809170002','-','2017-08-28',159000,'Masuk','BP 08582/Irma/Indri/Angsuran fancy 8 set',''),
(1088,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008580/Asti/Indri/Angsuran noodle',''),
(1089,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008581/Candra/Indri/Angsuran noodle',''),
(1090,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008579/Eny/Indri/Angsuran chopper',''),
(1091,'KO1809170002','-','2017-08-28',129000,'Masuk','BP 010809/Endah/Tyas/Angsuran chopper',''),
(1092,'KO1809170002','-','2017-08-28',950500,'Keluar','BSTUK 002997/Dinas Perjalanan Pak Sodikin',''),
(1093,'KO1809170002','-','2017-08-28',329000,'Masuk','BP 008575/Cusiah/Indri/Angsuran noodle',''),
(1094,'KO1809170002','-','2017-08-28',800000,'Masuk','BSTUM 002997/Pelunasan order ning',''),
(1095,'KO1809170002','-','2017-08-28',300000,'Keluar','BSTUK 002998/Komisi 20 % ning',''),
(1096,'KO1809170002','-','2017-08-28',100000,'Masuk','BP 005050/Siti/Tuti/Tunai chopper 2 in 1',''),
(1097,'KO1809170002','-','2017-08-28',1505000,'Masuk','BSTUM 003027/Imam 12 K',''),
(1098,'KO1809170002','-','2017-08-28',2630000,'Masuk','BSTUM 003025-26/Heri 20 K',''),
(1099,'KO1809170002','-','2017-08-28',6450000,'Keluar','Setoran Bank',''),
(1100,'KO1809170002','-','2017-08-28',150000,'Masuk','BP 008425/Susila/Tressye/Angsuran chopper + gridle',''),
(1101,'KO1809170002','-','2017-08-28',2600000,'Masuk','BSTUM 003000/Pelunasan order Ari',''),
(1102,'KO1809170002','-','2017-08-28',290000,'Keluar','BSTUK 002999/Komisi mingguan lenny 29 order',''),
(1103,'KO1809170002','-','2017-08-28',90000,'Keluar','BSTUK 002999/bonus tambahan chopper 2 in 1 ( 9 order )',''),
(1104,'KO1809170002','-','2017-08-29',2372500,'Keluar','Setoran Bank',''),
(1105,'KO1809170002','-','2017-08-29',4200000,'Masuk','Supply Pusat ( Komisi Sawulan Ketupat )',''),
(1106,'KO1809170002','-','2017-08-29',2700000,'Masuk','Supply Pusat ( Komisi Lunas )',''),
(1107,'KO1809170002','-','2017-08-29',2700000,'Masuk','BSTUM 003029-30/Imam 20 K',''),
(1108,'KO1809170002','-','2017-08-29',1925000,'Masuk','BSTUM 003028/Heri 17 K',''),
(1109,'KO1809170002','-','2017-08-29',650000,'Masuk','BSTUM 003051/Pelunasan Order lenny',''),
(1110,'KO1809170002','-','2017-08-29',1290000,'Masuk','BSTUM 003055/Pelunasan Order tresye',''),
(1111,'KO1809170002','-','2017-08-29',150000,'Keluar','BSTUK 003054/Komisi 20 % lenny',''),
(1112,'KO1809170002','-','2017-08-29',630000,'Keluar','BSTUK 003056/Komisi 20 % tressye',''),
(1113,'KO1809170002','-','2017-08-29',4200000,'Keluar','Komisi sawulan ketupat sales',''),
(1114,'KO1809170002','-','2017-08-29',4522500,'Keluar','Komisi Lunas Sales Ags',''),
(1115,'KO1809170002','-','2017-08-29',52500,'Keluar','BSTUM 86281385/Pulsa paket XL',''),
(1116,'KO1809170002','-','2017-08-29',3900000,'Keluar','Setoran Bank',''),
(1117,'KO1809170002','-','2017-08-29',229000,'Masuk','BP 008585/Siti/Indri/Angsuran presto elektrik',''),
(1118,'KO1809170002','-','2017-08-29',229000,'Masuk','BP 008583/Dina/Indri/Angsuran presto elektrik',''),
(1119,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008689/Siti/Lenny/Tunai chopper 2 in 1',''),
(1120,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008688/Umi/Lenny/Tunai chopper 2 in 1',''),
(1121,'KO1809170002','-','2017-08-30',100000,'Masuk','BP 008691/Tuti/Lastri/Tunai chopper 2 in 1',''),
(1122,'KO1809170002','-','2017-08-30',3500000,'Masuk','BSTUM 003031-3032/Imam 28 K',''),
(1123,'KO1809170002','-','2017-08-30',2880000,'Masuk','BSTUM 0030033-3034/Heri 22 K',''),
(1124,'KO1809170002','-','2017-08-30',650000,'Masuk','BSTUM 003058/Pelunasan order lenny',''),
(1125,'KO1809170002','-','2017-08-30',150000,'Keluar','BSTUK 003059/Komisi 20 % lenny',''),
(1126,'KO1809170002','-','2017-08-30',850000,'Keluar','BSTUK 003060/Pembayaran paket UPS',''),
(1127,'KO1809170002','-','2017-08-30',6790000,'Keluar','Setoran Bank',''),
(1128,'KO1809170002','-','2017-08-01',3735500,'Masuk','Saldo Pindahan',''),
(1129,'KO1809170002','-','2017-08-01',3685500,'Keluar','Setoran Bank',''),
(1130,'KO1809170002','-','2017-08-01',2150000,'Masuk','BSTUM 002863/Pelunasan order indri',''),
(1131,'KO1809170002','-','2017-08-01',630000,'Keluar','BSTUK 002864/Komisi 20 % indri',''),
(1132,'KO1809170002','-','2017-08-01',1800000,'Masuk','BSTUM 002865/Pelunasan order Tuti',''),
(1133,'KO1809170002','-','2017-08-01',1050000,'Masuk','BSTUM 002867/Pelunasan orer lenny',''),
(1134,'KO1809170002','-','2017-08-01',550000,'Keluar','BSTUK 002866/Komisi 20 % tuti dan lenny',''),
(1135,'KO1809170002','-','2017-08-01',3780000,'Keluar','Setoran Bank',''),
(1136,'KO1809170002','-','2017-08-01',100000,'Masuk','BP 008652/Tumini/Lenny/Tunai chopper',''),
(1137,'KO1809170002','-','2017-08-01',159000,'Masuk','BP 008654/Ida/Lenny/Angsuran fancy 8 set',''),
(1138,'KO1809170002','-','2017-08-01',380000,'Masuk','BSTUM 002824/Imam 3 K',''),
(1139,'KO1809170002','-','2017-08-02',250000,'Masuk','BSTUM 002825/Imam 2 K',''),
(1140,'KO1809170002','-','2017-08-02',90000,'Keluar','BSTUK 54013-0208 Paket Baraka Jogja',''),
(1141,'KO1809170002','-','2017-08-02',80000,'Keluar','BSTUK 002868/Um driver agung 24-31 Jul',''),
(1142,'KO1809170002','-','2017-08-02',700000,'Keluar','Setoran Bank',''),
(1143,'KO1809170002','-','2017-08-02',500000,'Masuk','BP 008455/Hayati/Tuti/Tunai chopper ( Herpus )',''),
(1144,'KO1809170002','-','2017-08-02',100000,'Masuk','BP 008456/Herni/Tuti/Tunai chopper',''),
(1145,'KO1809170002','-','2017-08-02',100000,'Masuk','BP 008457/Kus/Tuti/Tunai chopper',''),
(1146,'KO1809170002','-','2017-08-02',150000,'Masuk','BP 008402/Sumiyati/Tyas/Angsuran chopper + gridle',''),
(1147,'KO1809170002','-','2017-08-02',550000,'Masuk','BSTUM 002869/Pelunasan order tuti',''),
(1148,'KO1809170002','-','2017-08-02',150000,'Keluar','BSTUK 002870/Komisi 20 % tuti',''),
(1149,'KO1809170002','-','2017-08-02',485000,'Keluar','BSTUK 002871/Bbm kolektor Heri 21 hari',''),
(1150,'KO1809170002','-','2017-08-02',65000,'Keluar','BSTUK 002871/Komisi mingguan heri',''),
(1151,'KO1809170002','-','2017-08-03',1100000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1152,'KO1809170002','-','2017-08-03',1100000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1153,'KO1809170002','-','2017-08-03',950000,'Masuk','BSTUM 002826/Imam 8 K',''),
(1154,'KO1809170002','-','2017-08-03',509000,'Keluar','Biaya Reimbursment Pak Sodikin',''),
(1155,'KO1809170002','-','2017-08-03',1200000,'Keluar','Setoran Bank',''),
(1156,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 007716/Iwan/Yayuk/Tunai chopper',''),
(1157,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 007715/Gatot/Yayuk/Tunai griddle',''),
(1158,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008658/Retno/Lenny/Tunai chopper',''),
(1159,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008657/Dwi Budi/Lenny/Tunai chopper',''),
(1160,'KO1809170002','-','2017-08-03',100000,'Masuk','BP 008655/Inaya/Lenny/Tunai chopper',''),
(1161,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008408/Rona Yuli/Tressye/Angsuran Fancy 8 set + chopper',''),
(1162,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008409/Isaman/Tresye/Angsuran Fancy 8 set + chopper',''),
(1163,'KO1809170002','-','2017-08-03',219000,'Masuk','BP 008405/Tatik/Tyas/Fancy 8 set + chopper',''),
(1164,'KO1809170002','-','2017-08-03',129000,'Masuk','BP 008404/Yuli/Tyas/Angsuran chopper',''),
(1165,'KO1809170002','-','2017-08-03',1450000,'Masuk','BSTUM 002872/Pelunasan Order lenny',''),
(1166,'KO1809170002','-','2017-08-03',450000,'Keluar','BSTUK 002873/Komisi 20 % lenny',''),
(1167,'KO1809170002','-','2017-08-04',2286000,'Keluar','Setoran Bank',''),
(1168,'KO1809170002','-','2017-08-04',330000,'Masuk','BSTUM 002827/Imam 2 K',''),
(1169,'KO1809170002','-','2017-08-04',100000,'Masuk','BP 007720/Suep/Yayuk/Tunai chopper',''),
(1170,'KO1809170002','-','2017-08-04',189000,'Masuk','BP 007719/Ita/Totok/Angsuran gridle + fancy 8 set',''),
(1171,'KO1809170002','-','2017-08-04',100000,'Masuk','BP 007721/Fitri/Yayuk/Tunai gridle',''),
(1172,'KO1809170002','-','2017-08-04',650000,'Masuk','BSTUM 002876/Pelunasan order tuti',''),
(1173,'KO1809170002','-','2017-08-04',150000,'Keluar','BSTUK 002878/Komisi 20 % tuti',''),
(1174,'KO1809170002','-','2017-08-04',240000,'Keluar','BSTUK 002877/Komisi mingguan lenny 24 order',''),
(1175,'KO1809170002','-','2017-08-04',50000,'Keluar','BSTUK 002875/Um driver Tarjo 1-5 Ags',''),
(1176,'KO1809170002','-','2017-08-04',70000,'Keluar','BSTUK 002874/Komisi mingguan yayuk 7 Order',''),
(1177,'KO1809170002','-','2017-08-04',20000,'Keluar','BSTUK 002874/Komisi mingguan totok 2 order',''),
(1178,'KO1809170002','-','2017-08-04',70000,'Keluar','BSTUK 002874/Komisi mingguan anik 7 order',''),
(1179,'KO1809170002','-','2017-08-04',140000,'Keluar','BSTUK 002879/Komisi mingguan indri 14 order',''),
(1180,'KO1809170002','-','2017-08-05',705000,'Masuk','BSTUM 002828/Imam 6 K',''),
(1181,'KO1809170002','-','2017-08-05',25000000,'Masuk','Supply Pusat ( Salary staff dan Komisi Sales )',''),
(1182,'KO1809170002','-','2017-08-05',16600000,'Keluar','Salary Staff Smr',''),
(1183,'KO1809170002','-','2017-08-05',9070100,'Keluar','Salary Sales ',''),
(1184,'KO1809170002','-','2017-08-05',60000,'Keluar','BSTUK 002879/Um driver Nano 31 Jul - 5 Ags',''),
(1185,'KO1809170002','-','2017-08-05',300000,'Masuk','BSTUM 002882/Angsuran KIT Chopper',''),
(1186,'KO1809170002','-','2017-08-05',100000,'Keluar','BSTUK 002884/Komisi mingguan tuti 10 Order',''),
(1187,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008458/Suraniningsih/Tuti/Angsuran chopper',''),
(1188,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008459/Sri Suwarti/Tuti/Angsuran chopper',''),
(1189,'KO1809170002','-','2017-08-05',129000,'Masuk','BP 008460/Sri Lestari/Tuti/Angsuran chopper',''),
(1190,'KO1809170002','-','2017-08-05',750000,'Masuk','BP 007599/Ristiyanti/Lenny/Tunai chopper',''),
(1191,'KO1809170002','-','2017-08-05',1300000,'Masuk','BSTUM 002883/Pelunasan order lenny',''),
(1192,'KO1809170002','-','2017-08-05',450000,'Keluar','BSTUK 002889/Komisi 20 % lenny',''),
(1193,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002888/Penjualan Hp Inv Jogja ( Irpan )',''),
(1194,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002888/Penjualan Hp Inv Smr ( Gito )',''),
(1195,'KO1809170002','-','2017-08-05',1350000,'Masuk','BSTUM 002887/Pelunasan order Ning',''),
(1196,'KO1809170002','-','2017-08-05',338000,'Keluar','BSTUK 002890/Komisi 20 % ning',''),
(1197,'KO1809170002','-','2017-08-05',4200000,'Keluar','Setoran Bank',''),
(1198,'KO1809170002','-','2017-08-05',2680000,'Masuk','BSTUM 002892/Pelunasan Order Tresye',''),
(1199,'KO1809170002','-','2017-08-05',700000,'Masuk','BSTUM 002895/Pelunasan order wiwid',''),
(1200,'KO1809170002','-','2017-08-05',816000,'Keluar','BSTUK 002893/Komisi 20 % tresye',''),
(1201,'KO1809170002','-','2017-08-05',100000,'Keluar','BSTUK 002893/Komisi tambahan alsyva',''),
(1202,'KO1809170002','-','2017-08-05',300000,'Keluar','BSTUK 002896/Komisi 20 % wiwid',''),
(1203,'KO1809170002','-','2017-08-05',200000,'Masuk','BSTUM 002829/Imam 2 K',''),
(1204,'KO1809170002','-','2017-08-07',1916900,'Keluar','Setoran Bank',''),
(1205,'KO1809170002','-','2017-08-07',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1206,'KO1809170002','-','2017-08-07',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1207,'KO1809170002','-','2017-08-07',329000,'Masuk','BP 008410/Lis/Tyas/Angsuran noodle',''),
(1208,'KO1809170002','-','2017-08-07',1185000,'Masuk','BSTUM 002830/Imam 10 K',''),
(1209,'KO1809170002','-','2017-08-07',350000,'Masuk','BSTUK 002831/Angsuran 3 K',''),
(1210,'KO1809170002','-','2017-08-07',200000,'Masuk','BSTUM 002898/Tambahan DP 007611 a,n Suwarni',''),
(1211,'KO1809170002','-','2017-08-07',60000,'Keluar','BSTUK 002897/Bbm Imam 3Ags/5-7 Ags',''),
(1212,'KO1809170002','-','2017-08-07',300000,'Keluar','BSTUK 002899/Iuran Warga 17 Agustus',''),
(1213,'KO1809170002','-','2017-08-07',150000,'Keluar','BSTUK 002898/Komisi mingguan tresye 15 order',''),
(1214,'KO1809170002','-','2017-08-07',1500000,'Keluar','Setoran Bank',''),
(1215,'KO1809170002','-','2017-08-07',390000,'Masuk','BSTUM 002832/Heri 3 K',''),
(1216,'KO1809170002','-','2017-08-07',150000,'Masuk','BSTUM 002833/Imam 1 K',''),
(1217,'KO1809170002','-','2017-08-08',1135000,'Masuk','BSTUM 002834/Imam 8 K',''),
(1218,'KO1809170002','-','2017-08-08',1650000,'Masuk','BSTUM 002835/Heri 10 K',''),
(1219,'KO1809170002','-','2017-08-08',242500,'Keluar','BSTUK 002910/Per Dinas P\'Gito Pkg 9-12 Ags',''),
(1220,'KO1809170002','-','2017-08-08',3100000,'Keluar','Setoran Bank',''),
(1221,'KO1809170002','-','2017-08-08',1000000,'Masuk','BSTUM 002912/Pelunasan order tresye',''),
(1222,'KO1809170002','-','2017-08-08',250000,'Keluar','BSTUK 002913/Komisi 20 % tresye',''),
(1223,'KO1809170002','-','2017-08-09',436500,'Keluar','BSTUK 002914/Dinas Perj Pak Sodikin Jogja 7-8 Ags',''),
(1224,'KO1809170002','-','2017-08-09',1000000,'Masuk','Supply Kas Pusat Ke Kas Operasional',''),
(1225,'KO1809170002','-','2017-08-09',1000000,'Keluar','Supply Kas Pusat Ke Kas Operasional',''),
(1226,'KO1809170002','-','2017-08-09',229000,'Masuk','BP 008568/Rini/Indri/Angsuran Presto elektrik',''),
(1227,'KO1809170002','-','2017-08-09',229000,'Masuk','BP 008566/Aneng/Indri/Angsuran Presto elektrik',''),
(1228,'KO1809170002','-','2017-08-09',329000,'Masuk','BP 008567/Edy/Indri/Angsuran Noodle',''),
(1229,'KO1809170002','-','2017-08-09',199000,'Masuk','BP 008565/Tien/Indri/Angsuran Fancy Stove',''),
(1230,'KO1809170002','-','2017-08-09',87500,'Keluar','BSTUK-840710175317 Pembelian Tiket KA PP Smr-Pkg P\'Sodikin',''),
(1231,'KO1809170002','-','2017-08-09',4590000,'Masuk','BSTUM 002836-37/Heri 25 K',''),
(1232,'KO1809170002','-','2017-08-09',1145000,'Masuk','BSTUM 002838/Imam 9 K',''),
(1233,'KO1809170002','-','2017-08-09',94500,'Keluar','BSTUK 002915/Pembeliak Atk kantor',''),
(1234,'KO1809170002','-','2017-08-09',300000,'Masuk','BP 008169/Tyas/Anik/Tunai chopper',''),
(1235,'KO1809170002','-','2017-08-09',50000,'Keluar','BSTUK 002916/Service Mobil ( Las Knalpot Mobil Agung )',''),
(1236,'KO1809170002','-','2017-08-09',7350000,'Keluar','Setoran Bank',''),
(1237,'KO1809170002','-','2017-08-09',150000,'Masuk','BP 005737/Diah/Tuti/Angsuran chopper + gridle',''),
(1238,'KO1809170002','-','2017-08-09',139000,'Masuk','BP 005739/Saum/Lenny/Angsuran gridle',''),
(1239,'KO1809170002','-','2017-08-09',150000,'Masuk','BP 005738/Yuni/Lenny/Angsuran chopper + gridle',''),
(1240,'KO1809170002','-','2017-08-09',50000,'Keluar','BSTUK 002917/Um driver Tarjo 6-10 Ags','');
/*Table structure for table `kasdetail` */
DROP TABLE IF EXISTS `kasdetail`;
CREATE TABLE `kasdetail` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
`jeniskas` varchar(20) NOT NULL,
`uraian` text,
`kodeakun` varchar(15) NOT NULL,
PRIMARY KEY (`id`,`kodekas`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*Data for the table `kasdetail` */
insert into `kasdetail`(`id`,`kodekas`,`kodekasmanual`,`tanggal`,`total`,`jeniskas`,`uraian`,`kodeakun`) values
(1,'KO0609170002','','2017-07-03',105000,'Keluar','Bbm ( Mobil Agung )','1112'),
(1,'KO0609170003','','2017-07-04',105000,'Keluar','Bbm ( Mobil Tarjo )','1112'),
(1,'KO0609170004','','2017-07-05',800000,'Masuk','Supply Kas Besar','1112'),
(1,'KO0609170005','','2017-07-05',105000,'Masuk','Bbm ( mobil agung )','1112'),
(1,'KO2908170001','-','2017-07-01',450000,'Masuk','Supply Kas Pusat ke Kas Opr','1112'),
(2,'KO0609170002','','2017-07-03',105000,'Keluar','Bbm ( Mobil Nano )','1112'),
(2,'KO0609170003','','2017-07-04',20000,'Keluar','Transportasi Operasional','1112'),
(2,'KO0609170005','','2017-07-05',105000,'Masuk','Bbm ( Mobil Nano )','1112'),
(3,'KO0609170002','','2017-07-03',140500,'Keluar','Bahan Demo dan Ayam ','1112'),
(3,'KO0609170003','','2017-07-04',98000,'Keluar','Ayam ( Demo )','1112'),
(3,'KO0609170005','','2017-07-05',135000,'Masuk','Ayam ( Demo )','1112'),
(4,'KO0609170003','','2017-07-04',12000,'Keluar','Isi Ulang Galon','1112'),
(5,'KO0609170003','','2017-07-04',195000,'Keluar','Bahan Demo Harian','1112');
/*Table structure for table `kasdetail_temp` */
DROP TABLE IF EXISTS `kasdetail_temp`;
CREATE TABLE `kasdetail_temp` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodekas` varchar(30) NOT NULL,
`kodekasmanual` varchar(50) NOT NULL DEFAULT '-',
`tanggal` varchar(30) NOT NULL,
`total` int(10) NOT NULL,
`jeniskas` varchar(20) NOT NULL,
`uraian` text,
`kodeakun` varchar(15) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `kasdetail_temp` */
/*Table structure for table `komisi` */
DROP TABLE IF EXISTS `komisi`;
CREATE TABLE `komisi` (
`idkomisi` int(5) unsigned NOT NULL AUTO_INCREMENT,
`idpesanan` int(5) NOT NULL,
`idsales` int(5) DEFAULT NULL,
`komisi` int(5) DEFAULT NULL,
PRIMARY KEY (`idkomisi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `komisi` */
/*Table structure for table `komisisales` */
DROP TABLE IF EXISTS `komisisales`;
CREATE TABLE `komisisales` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodebp` varchar(30) NOT NULL,
`idsales` int(5) NOT NULL,
`idpesanan` int(5) NOT NULL,
`totaljual` double DEFAULT NULL,
`komisibp` double DEFAULT '0' COMMENT '1 % bp',
`komisia1` double DEFAULT '0' COMMENT '5 % tgl 10',
`komisilunas` double DEFAULT '0' COMMENT '5 % tgl 20',
`komisitunai` double DEFAULT '0' COMMENT '20 % pelunasan',
`komisibprupiah` double DEFAULT '0',
`komisia1rupiah` double DEFAULT '0',
`komisilunasrupiah` double DEFAULT '0',
`komisitunasirupiah` double DEFAULT '0',
`statuskomisibp` varchar(40) DEFAULT NULL,
`statuskomisia1` varchar(40) DEFAULT NULL,
`statuskomisilunas` varchar(40) DEFAULT NULL,
`statuskomisitunasi` varchar(40) DEFAULT NULL,
`statusbereskomisi` varchar(10) DEFAULT 'belum',
`totalkomisi` double DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `komisisales` */
insert into `komisisales`(`id`,`kodebp`,`idsales`,`idpesanan`,`totaljual`,`komisibp`,`komisia1`,`komisilunas`,`komisitunai`,`komisibprupiah`,`komisia1rupiah`,`komisilunasrupiah`,`komisitunasirupiah`,`statuskomisibp`,`statuskomisia1`,`statuskomisilunas`,`statuskomisitunasi`,`statusbereskomisi`,`totalkomisi`) values
(1,'BP010817001',6,1,929000,1.0764262648008611,0,0,0,10000,0,0,0,'2017-08-09',NULL,NULL,NULL,'belum',10000);
/*Table structure for table `pelanggan` */
DROP TABLE IF EXISTS `pelanggan`;
CREATE TABLE `pelanggan` (
`idpelanggan` int(5) unsigned NOT NULL AUTO_INCREMENT,
`mankodepelanggan` varchar(30) NOT NULL,
`namapelanggan` varchar(100) NOT NULL,
`alamat` text,
`telepon` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idpelanggan`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
/*Data for the table `pelanggan` */
insert into `pelanggan`(`idpelanggan`,`mankodepelanggan`,`namapelanggan`,`alamat`,`telepon`) values
(1,'','Bu Supriyati','Jl Wonodri Kopen Barat III RT 4 / 11 Semarang',''),
(2,'','Pak Ratno','Jl Wonodri Kopen Barat III Rt 4 / 11 Semarang','085715173117'),
(3,'','Bu Nur Hidayat','Jl Wonodri Kopen Barat III Rt 4 / 11 Semarang',''),
(4,'','Bu Lia','Asrama Brimob lantai II / 5 Banyumanik','082227116380'),
(5,'','Bu Guntoro','Perum Bukit Jatisari blok A10 ','081325668326'),
(6,'','Bu Dian','Borobudur V Rt 3 Rw 12 Kembang arum','085290817702'),
(7,'','Bu Mimin','MA Al Ashor','081575098081'),
(8,'','Bu Mimin','MA Al Ashor','081575098081');
/*Table structure for table `pelunasan` */
DROP TABLE IF EXISTS `pelunasan`;
CREATE TABLE `pelunasan` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`kodebp` varchar(30) NOT NULL,
`tanggal` varchar(30) NOT NULL,
`keterangan` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `pelunasan` */
/*Table structure for table `sales` */
DROP TABLE IF EXISTS `sales`;
CREATE TABLE `sales` (
`idsales` int(5) NOT NULL AUTO_INCREMENT,
`namasales` varchar(20) NOT NULL,
`alamat` text,
`telepon` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idsales`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*Data for the table `sales` */
insert into `sales`(`idsales`,`namasales`,`alamat`,`telepon`) values
(1,'Ning','Semarang','085727682969'),
(2,'Lenny','Semarang ','085701272252'),
(3,'Tuti','Semarang','082133288862'),
(4,'Indri','Semarang','081329231998'),
(5,'Tressye','Semarang','081326072429'),
(6,'Tyas','Semarang','081329648896'),
(7,'Ari','Semarang','081327748587'),
(8,'Yayuk','Semarang','085866299171'),
(9,'Anik','Semarang','081805880599'),
(10,'Wiwid','Semarang','');
/*Table structure for table `stokbarang` */
DROP TABLE IF EXISTS `stokbarang`;
CREATE TABLE `stokbarang` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`idbarang` int(5) NOT NULL,
`stok` int(10) NOT NULL,
`tanggal` varchar(30) NOT NULL DEFAULT 'CURDATE()',
`keterangan` varchar(30) NOT NULL,
`kategori` varchar(30) NOT NULL,
`trace` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `stokbarang` */
/*Table structure for table `subakun` */
DROP TABLE IF EXISTS `subakun`;
CREATE TABLE `subakun` (
`idsubakun` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodesubakun` varchar(20) NOT NULL,
`namasubakun` varchar(30) NOT NULL,
`idakun` int(5) NOT NULL,
PRIMARY KEY (`idsubakun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `subakun` */
/*Table structure for table `subakun3` */
DROP TABLE IF EXISTS `subakun3`;
CREATE TABLE `subakun3` (
`idsubakun3` int(5) unsigned NOT NULL AUTO_INCREMENT,
`kodesubakun3` varchar(20) NOT NULL,
`namasubakun3` varchar(30) NOT NULL,
`idsubakun` int(5) NOT NULL,
`idakun` int(5) NOT NULL,
PRIMARY KEY (`idsubakun3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `subakun3` */
/*Table structure for table `tempbstu` */
DROP TABLE IF EXISTS `tempbstu`;
CREATE TABLE `tempbstu` (
`id` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nama` varchar(30) NOT NULL,
`uraian` text,
`keterangan` text,
`jumlah` int(10) NOT NULL,
`kodebstu` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `tempbstu` */
/*Table structure for table `test` */
DROP TABLE IF EXISTS `test`;
CREATE TABLE `test` (
`iduser` int(5) NOT NULL AUTO_INCREMENT,
`namauser` varchar(20) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`level` int(10) NOT NULL,
PRIMARY KEY (`iduser`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `test` */
/*Table structure for table `urutangsuran` */
DROP TABLE IF EXISTS `urutangsuran`;
CREATE TABLE `urutangsuran` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutangsuran` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutangsuran`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `urutangsuran` */
insert into `urutangsuran`(`idurut`,`nourutangsuran`) values
(1,'KA0908170001');
/*Table structure for table `urutbkm` */
DROP TABLE IF EXISTS `urutbkm`;
CREATE TABLE `urutbkm` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutbkm` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutbkm`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `urutbkm` */
/*Table structure for table `urutbstu` */
DROP TABLE IF EXISTS `urutbstu`;
CREATE TABLE `urutbstu` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutbstu` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutbstu`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `urutbstu` */
/*Table structure for table `urutkas` */
DROP TABLE IF EXISTS `urutkas`;
CREATE TABLE `urutkas` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutkas` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutkas`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*Data for the table `urutkas` */
insert into `urutkas`(`idurut`,`nourutkas`) values
(6,'KO2908170001'),
(7,'KO0609170001'),
(8,'KO0609170002'),
(9,'KO0609170003'),
(10,'KO0609170004'),
(11,'KO0609170005');
/*Table structure for table `urutkasbesar` */
DROP TABLE IF EXISTS `urutkasbesar`;
CREATE TABLE `urutkasbesar` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutkas` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutkas`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `urutkasbesar` */
insert into `urutkasbesar`(`idurut`,`nourutkas`) values
(1,'KO1809170002');
/*Table structure for table `urutpesnan` */
DROP TABLE IF EXISTS `urutpesnan`;
CREATE TABLE `urutpesnan` (
`idurut` int(5) unsigned NOT NULL AUTO_INCREMENT,
`nourutpesanan` varchar(20) NOT NULL,
PRIMARY KEY (`idurut`,`nourutpesanan`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `urutpesnan` */
insert into `urutpesnan`(`idurut`,`nourutpesanan`) values
(1,'BP010817001');
/*Table structure for table `user` */
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`iduser` int(5) NOT NULL AUTO_INCREMENT,
`namauser` varchar(20) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`level` varchar(10) NOT NULL,
PRIMARY KEY (`iduser`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `user` */
/* Procedure structure for procedure `displayKasBesar` */
/*!50003 DROP PROCEDURE IF EXISTS `displayKasBesar` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`yudori`@`%` PROCEDURE `displayKasBesar`(in tgl_awal varchar(50),in tgl_akhir varchar(50))
BEGIN
declare init int(5);
SELECT @s:=0 into init;
SELECT *,@d:=IF(jeniskas="Masuk",total,0) AS Debit,@k:=IF(jeniskas="Keluar",total,0) AS Kredit,@s:=@s+@d-@k AS Saldo
FROM kas_besar_detail WHERE tanggal BETWEEN tgl_awal AND tgl_akhir ORDER BY tanggal ASC;
END */$$
DELIMITER ;
/* Procedure structure for procedure `displayKasOperasional` */
/*!50003 DROP PROCEDURE IF EXISTS `displayKasOperasional` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`yudori`@`%` PROCEDURE `displayKasOperasional`(IN tgl_awal VARCHAR(50),IN tgl_akhir VARCHAR(50))
BEGIN
DECLARE init INT(5);
SELECT @s:=0 INTO init;
SELECT *,@d:=IF(jeniskas="Masuk",total,0) AS Debit,@k:=IF(jeniskas="Keluar",total,0) AS Kredit,@s:=@s+@d-@k AS Saldo
FROM kasdetail WHERE tanggal BETWEEN tgl_awal AND tgl_akhir ORDER BY tanggal ASC;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spCetakLaporanKasBesar` */
/*!50003 DROP PROCEDURE IF EXISTS `spCetakLaporanKasBesar` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spCetakLaporanKasBesar`(IN tanggalnya VARCHAR(100))
BEGIN
TRUNCATE kas_besar_detail_temp;
INSERT INTO kas_besar_detail_temp (kodekas,tanggal,total,jeniskas,uraian,kodeakun) SELECT angsuran.kodeangsuran,angsuran.tanggal,angsuran.jumlah,'Masuk',CONCAT('UM ',pelanggan.namapelanggan,' ',angsuran.kodebp),'1112' FROM angsuran JOIN buktipesanan ON angsuran.kodebp = buktipesanan.kodebp
JOIN pelanggan ON buktipesanan.idpelanggan = pelanggan.idpelanggan WHERE angsuran.tanggal=tanggalnya;
INSERT INTO kas_besar_detail_temp (kodekas,tanggal,total,jeniskas,uraian,kodeakun) SELECT detailangsuran.noans,detailangsuran.tgl,detailangsuran.jumlah,'Masuk',CONCAT(detailangsuran.angsuranke,' ',pelanggan.namapelanggan) AS uraian,'1112' FROM detailangsuran
JOIN angsuran ON detailangsuran.noans=angsuran.kodeangsuran
JOIN buktipesanan ON detailangsuran.nobp = buktipesanan.kodebp
JOIN pelanggan ON buktipesanan.idpelanggan = pelanggan.idpelanggan WHERE detailangsuran.tgl=tanggalnya;
INSERT INTO kas_besar_detail_temp SELECT * FROM kas_besar_detail WHERE tanggal=tanggalnya;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spCetakLaporanKasBesarBulanan2` */
/*!50003 DROP PROCEDURE IF EXISTS `spCetakLaporanKasBesarBulanan2` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spCetakLaporanKasBesarBulanan2`(IN tanggalnya VARCHAR(100), IN tanggalnyaakhir VARCHAR(100))
BEGIN
TRUNCATE kas_besar_detail_temp;
INSERT INTO kas_besar_detail_temp (kodekas,tanggal,total,jeniskas,uraian,kodeakun) SELECT angsuran.kodeangsuran,angsuran.tanggal,angsuran.jumlah,'Masuk',CONCAT('UM ',pelanggan.namapelanggan,' ',angsuran.kodebp),'1112' FROM angsuran JOIN buktipesanan ON angsuran.kodebp = buktipesanan.kodebp
JOIN pelanggan ON buktipesanan.idpelanggan = pelanggan.idpelanggan WHERE angsuran.tanggal BETWEEN tanggalnya AND tanggalnyaakhir;
INSERT INTO kas_besar_detail_temp (kodekas,tanggal,total,jeniskas,uraian,kodeakun) SELECT detailangsuran.noans,detailangsuran.tgl,detailangsuran.jumlah,'Masuk',CONCAT(detailangsuran.angsuranke,' ',pelanggan.namapelanggan) AS uraian,'1112' FROM detailangsuran
JOIN angsuran ON detailangsuran.noans=angsuran.kodeangsuran
JOIN buktipesanan ON detailangsuran.nobp = buktipesanan.kodebp
JOIN pelanggan ON buktipesanan.idpelanggan = pelanggan.idpelanggan WHERE detailangsuran.tgl BETWEEN tanggalnya AND tanggalnyaakhir;
INSERT INTO kas_besar_detail_temp SELECT * FROM kas_besar_detail WHERE tanggal BETWEEN tanggalnya AND tanggalnyaakhir;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spDeleteBp` */
/*!50003 DROP PROCEDURE IF EXISTS `spDeleteBp` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spDeleteBp`(IN KODENYA VARCHAR(30))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
DELETE FROM buktipesanan WHERE kodebp = KODENYA;
DELETE FROM detailpesanan WHERE kodebp = KODENYA;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertBarang` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertBarang` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertBarang`(
IN NAMA VARCHAR(100),
IN TUNAI INT(10),
IN HDROP INT(10),
IN INDEN INT(10),
IN UM INT(10),
IN SISA INT(10),
IN HPROMO INT(10),
IN SISA1 INT(10),
IN SISA2 INT(10),
IN TGLMULAI VARCHAR(30),
IN TGLAKHIR VARCHAR(30),
IN AKTIF VARCHAR(2))
BEGIN
DECLARE TEMPIDHARGA INT(10);
DECLARE IDBARANGTEMP INT(10);
DECLARE `_rollback` BOOL DEFAULT 0;
INSERT INTO barang(namabarang) VALUES (NAMA);
SELECT idbarang FROM barang WHERE namabarang=NAMA INTO IDBARANGTEMP;
INSERT INTO HARGABARANG(`idbarang`,`hargatunai`,`hargadrop`,`hargaindent`,`UM`,sisa,`hargapromositunai`,`sisa1`,`sisa2`,`tglberlakumulai`,`tglberlakuakhir`,`aktif`)
VALUES(IDBARANGTEMP,TUNAI,HDROP,INDEN,UM,SISA,HPROMO,SISA1,SISA2,TGLMULAI,TGLAKHIR,AKTIF);
SELECT MAX(IDHARGA) AS IDH FROM HARGABARANG WHERE idbarang=IDBARANGTEMP LIMIT 1 INTO TEMPIDHARGA;
UPDATE BARANG SET idharga=IDBARANGTEMP WHERE idbarang=IDBARANGTEMP;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertBSTU` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertBSTU` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertBSTU`(IN KODENYA VARCHAR(30),IN NAMANYA VARCHAR(30),IN JUMLAHNYA INT(10),
IN STATUSNYA VARCHAR(30),IN JENISNYA VARCHAR(20), IN SERAHNYA VARCHAR(20),IN TANGGALNYA VARCHAR(30))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO bstu (`kodebstu`,`nama`,`jumlah`,`status`,`jenisbstu`,`diserahkan`,tanggal) VALUES
(KODENYA,NAMANYA,JUMLAHNYA,STATUSNYA,JENISNYA,SERAHNYA,TANGGALNYA);
INSERT INTO detailbstu (nama,uraian,keterangan,jumlah,kodebstu) SELECT nama,uraian,keterangan,jumlah,kodebstu FROM tempbstu;
TRUNCATE tempbstu;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertKas` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertKas` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertKas`(IN KODEKAS VARCHAR(50),IN KODEKASMANUAL VARCHAR(50))
BEGIN
DECLARE totalkeluaran INT(10);
DECLARE tglsekarang VARCHAR(30);
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
SELECT SUM(total) FROM kasdetail_temp INTO totalkeluaran;
SELECT CURDATE() INTO tglsekarang;
INSERT INTO kasdetail SELECT * FROM kasdetail_temp;
INSERT INTO kas (`kodekas`,`kodekasmanual`,`tanggal`,`total`) VALUES (KODEKAS,KODEKASMANUAL,tglsekarang,totalkeluaran);
TRUNCATE kasdetail_temp;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertKasBesarTemp` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertKasBesarTemp` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertKasBesarTemp`(IN KODEKAS VARCHAR(50),IN KODEKASMANUAL VARCHAR(50),IN TANGGALNYA VARCHAR(50),IN TOTAL INT(10),
IN JENISNYA VARCHAR(30),IN URAIAN TEXT,IN KODEAKUNNYA VARCHAR(20))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO kas_besar_detail_temp(`kodekas`,`kodekasmanual`,`tanggal`,`total`,`jeniskas`,`uraian`,`kodeakun`) VALUES (KODEKAS,KODEKASMANUAL,TANGGALNYA,TOTAL,JENISNYA,URAIAN,KODEAKUNNYA);
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertKasTemp` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertKasTemp` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertKasTemp`(IN KODEKAS VARCHAR(50),IN KODEKASMANUAL VARCHAR(50),IN TANGGALNYA VARCHAR(50),IN TOTAL INT(10),
IN JENISNYA VARCHAR(30),IN URAIAN TEXT,IN KODEAKUNNYA VARCHAR(20))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO kasdetail_temp(`kodekas`,`kodekasmanual`,`tanggal`,`total`,`jeniskas`,`uraian`,`kodeakun`) VALUES (KODEKAS,KODEKASMANUAL,TANGGALNYA,TOTAL,JENISNYA,URAIAN,KODEAKUNNYA);
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertHargaBarang` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertHargaBarang` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertHargaBarang`(
IN NAMA VARCHAR(20),
IN HT INT(10),
IN HD INT(10),
IN UM INT(10),
IN HPI INT(10),
IN HI INT(10),
IN SISA1 INT(10),
IN SISA2 INT(10),
IN HAKTIF INT(10),
IN TGLBERLAKU VARCHAR(20),
IN TGLBERLAKUAKHIR VARCHAR(20),
IN KODEBARANGS INT(10))
BEGIN
DECLARE kodeaktif INT(10);
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
UPDATE hargabarang SET aktif='N' WHERE idbarang = KODEBARANGS;
INSERT INTO hargabarang(`idbarang`,`hargatunai`,`hargadrop`,`hargaindent`,`UM`,`hargapromositunai`,`tglberlakumulai`,`tglberlakuakhir`,`sisa1`,`sisa2`)
VALUES (KODEBARANGS,HT,HD,HI,UM,HPI,TGLBERLAKU,TGLBERLAKUAKHIR,SISA1,SISA2);
SELECT MAX(idharga) AS latest FROM hargabarang WHERE idbarang=KODEBARANGS INTO kodeaktif;
UPDATE barang SET idharga = kodeaktif WHERE idbarang=KODEBARANGS;
UPDATE hargabarang SET aktif='Y' WHERE idharga = kodeaktif;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertKasBesar` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertKasBesar` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertKasBesar`(IN KODEKAS VARCHAR(50),IN KODEKASMANUAL VARCHAR(50))
BEGIN
DECLARE totalkeluaran INT(10);
DECLARE tglsekarang VARCHAR(30);
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
SELECT SUM(total) FROM kas_besar_detail_temp INTO totalkeluaran;
SELECT CURDATE() INTO tglsekarang;
INSERT INTO kas_besar_detail SELECT * FROM kas_besar_detail_temp;
INSERT INTO kas_besar (`kodekas`,`kodekasmanual`,`tanggal`,`total`) VALUES (KODEKAS,KODEKASMANUAL,tglsekarang,totalkeluaran);
TRUNCATE kas_besar_detail_temp;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertKMB` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertKMB` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertKMB`(IN KODE VARCHAR(30),IN NAMA VARCHAR(30),IN ALAMATNYA VARCHAR(30),IN KET TEXT, IN KET2 TEXT,IN TGL VARCHAR(29),
IN IDBARANG INT(5), IN JUMLAH INT(5),IN STATUSBARANG VARCHAR(20))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO BKMB (`kodekmb`,`nama`,`alamat`,`keterangan`,`detailketerangan`,`tanggal`,`idbarang`,`jumlah`,`statusbarang`)
VALUES (KODE,NAMA,ALAMATNYA,KET,KET2,TGL,IDBARANG,JUMLAH,STATUSBARANG);
INSERT INTO stokbarang(idbarang,stok,tanggal,keterangan,kategori) SELECT IDBARANG,0-JUMLAH,TGL,KODE,'KM' FROM BKMB WHERE statusbarang='keluar' AND kodekmb=KODE;
INSERT INTO stokbarang(idbarang,stok,tanggal,keterangan,kategori) SELECT IDBARANG,JUMLAH,TGL,KODE,'KM' FROM BKMB WHERE statusbarang='masuk' AND kodekmb=KODE;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertPelunasan` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertPelunasan` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertPelunasan`(IN KODENYA VARCHAR(30),IN TANGGALNYA VARCHAR(30),IN KETERANGANNYA TEXT)
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO pelunasan (kodebp,tanggal,keterangan) VALUES (KODENYA,TANGGALNYA,KETERANGANNYA);
UPDATE buktipesanan SET statusbp ="LUNAS" WHERE kodebp = KODENYA;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spInsertPesanan` */
/*!50003 DROP PROCEDURE IF EXISTS `spInsertPesanan` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spInsertPesanan`(IN KODE VARCHAR(25),IN KODEMANUALBP VARCHAR(20),IN KODEMANUALPEL VARCHAR(20),IN NAMA VARCHAR(25) , IN ALAMAT TEXT ,IN TELP VARCHAR(20) ,
IN IDSALES INT(5) , IN KOMSALES INT(5) ,IN JENISORDER VARCHAR(15) , IN TGLPESANAN VARCHAR(20) ,IN TGLTAGIH VARCHAR(20) ,
IN TGLKIRIM VARCHAR(20) ,IN ANGSURANNYA INT(10),IN TOTAL INT(10) ,IN UM INT(10) ,IN SISA INT(10),IN TUNAI INT(10),IN STATUSKIRIM VARCHAR(10))
BEGIN
DECLARE idpesanannya INT(10);
DECLARE idpelanggannya INT(10);
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO buktipesanan(`kodebp`,`idpesananfaktur`,`namapelanggan`,`alamatpelanggan`,`telepon`,
`idsales`,`komisisales`,`jenisorder`,`tglpesanan`,`tglpenagihan`,`tglpengiriman`,
`total`,`UM`,`sisa`,`angsuran`,sisaberjalan,hargatunai) VALUES (KODE,KODEMANUALBP,NAMA,ALAMAT,TELP,IDSALES,KOMSALES,JENISORDER,TGLPESANAN,TGLTAGIH,TGLKIRIM,
TOTAL,UM,SISA,ANGSURANNYA,0,TUNAI);
INSERT INTO detailpesanan (kodebarang,namabarang,unit,harga,total,idpesanan,kodebp)
SELECT kodebarang,namabarang,unit,harga,total,idpesanan,kodebp FROM ordertemp;
SELECT idpesanan FROM buktipesanan WHERE kodebp=KODE INTO idpesanannya;
INSERT INTO pelanggan (mankodepelanggan,namapelanggan,alamat,telepon) VALUES (KODEMANUALPEL,NAMA,ALAMAT,TELP);
SELECT idpelanggan FROM pelanggan WHERE namapelanggan=NAMA AND alamat=ALAMAT INTO idpelanggannya;
UPDATE buktipesanan SET idpelanggan = idpelanggannya WHERE kodebp=KODE;
UPDATE detailpesanan SET idpesanan=idpesanannya, idpelanggan=idpelanggannya WHERE kodebp = KODE;
INSERT INTO komisisales (kodebp,idsales,idpesanan,komisibp,komisibprupiah,totaljual,statuskomisibp,totalkomisi) VALUES (KODE,IDSALES,idpesanannya,1,((1/100)*TUNAI),TOTAL,TGLPESANAN,((1/100)*TUNAI));
/* Simpan ke daftar stok, status kirim belum
INSERT INTO stokbarang(idbarang,stok,tanggal,keterangan,kategori) SELECT detailpesanan.kodebarang,0-detailpesanan.unit,buktipesanan.tglpesanan,buktipesanan.kodebp,'BP' FROM detailpesanan JOIN buktipesanan ON detailpesanan.kodebp=buktipesanan.kodebp WHERE detailpesanan.kodebp=KODE;
*/
TRUNCATE TABLE `ordertemp`;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spTest` */
/*!50003 DROP PROCEDURE IF EXISTS `spTest` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spTest`()
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo',1);
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo',2);
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo',3);
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo',4);
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo',5);
INSERT INTO test (`namauser`,`level`) VALUES ('ppopo');
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spUpdateAngsuran` */
/*!50003 DROP PROCEDURE IF EXISTS `spUpdateAngsuran` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spUpdateAngsuran`(IN kodebpnya VARCHAR(20))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
UPDATE buktipesanan SET sisaberjalan = (sisaberjalan + 1) WHERE kodebp=kodebpnya;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spUpdatePesanan` */
/*!50003 DROP PROCEDURE IF EXISTS `spUpdatePesanan` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spUpdatePesanan`(
IN KODE VARCHAR(25),
IN KODEMANUALBP VARCHAR(20),
IN KODEMANUALPEL VARCHAR(20),
IN NAMA VARCHAR(25),
IN ALAMAT TEXT,
IN TELP VARCHAR(20),
IN IDSALES INT(5),
IN KOMSALES INT(5) ,
IN JENISORDER VARCHAR(15) ,
IN TGLPESANAN VARCHAR(20) ,
IN TGLTAGIH VARCHAR(20),
IN TGLKIRIM VARCHAR(20),
IN ANGSURANS INT(10),
IN TOTALS INT(10),
IN UMS INT(10),
IN SISAS INT(10),
IN HARGATUNAIS INT(10))
BEGIN
DECLARE idpesanannya INT(10);
DECLARE idpelanggannya INT(10);
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
UPDATE buktipesanan SET
`idpesananfaktur`=KODEMANUALBP,
`namapelanggan`=NAMA,
`alamatpelanggan`=ALAMAT,
`telepon`=TELP,
`idsales`=IDSALES,
`komisisales`=KOMSALES,
`jenisorder`=JENISORDER,
`tglpesanan`=TGLPESANAN,
`tglpenagihan`=TGLTAGIH,
`tglpengiriman`=TGLKIRIM
/*
Update Jenis Order, tidak usah merubah
--------------------------------------
`angsuran`=ANGSURANS,
`total`=TOTALS,
`UM`=UMS,
`sisa`=SISAS,
`hargatunai`=HARGATUNAIS */ WHERE kodebp=KODE;
TRUNCATE TABLE `ordertemp`;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/* Procedure structure for procedure `spUpdatetunai` */
/*!50003 DROP PROCEDURE IF EXISTS `spUpdatetunai` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `spUpdatetunai`()
BEGIN
DECLARE v_finished INTEGER DEFAULT 0;
DECLARE kodebpnya VARCHAR(30);
DECLARE tunainya INT(10) DEFAULT 0;
DECLARE cur1 CURSOR FOR SELECT barang.hargatunai FROM barang JOIN detailpesanan ON barang.idbarang=detailpesanan.kodebarang
JOIN buktipesanan ON detailpesanan.kodebp=buktipesanan.kodebp;
DECLARE cur2 CURSOR FOR SELECT kodebp FROM buktipesanan;
DECLARE CONTINUE HANDLER
FOR NOT FOUND SET v_finished = 1;
OPEN cur1;
OPEN cur2;
get_email: LOOP
FETCH cur1 INTO tunainya;
FETCH cur2 INTO kodebpnya;
IF v_finished = 1 THEN
LEAVE get_email;
END IF;
UPDATE buktipesanan SET hargatunai=tunainya WHERE kodebp=kodebpnya;
END LOOP get_email;
CLOSE cur1;
CLOSE cur2;
END */$$
DELIMITER ;
/* Procedure structure for procedure `sqlInsertKMBBuktiPesanan` */
/*!50003 DROP PROCEDURE IF EXISTS `sqlInsertKMBBuktiPesanan` */;
DELIMITER $$
/*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `sqlInsertKMBBuktiPesanan`(IN KODE VARCHAR(30),IN NAMA VARCHAR(30),IN ALAMATNYA VARCHAR(30),IN KET TEXT, IN KET2 TEXT,IN TGL VARCHAR(29),
IN IDBARANG INT(5), IN JUMLAH INT(5),IN STATUSBARANG VARCHAR(20))
BEGIN
DECLARE `_rollback` BOOL DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET `_rollback` = 1;
START TRANSACTION;
INSERT INTO BKMB (`kodekmb`,`nama`,`alamat`,`keterangan`,`detailketerangan`,`tanggal`,`idbarang`,`jumlah`,`statusbarang`)
VALUES (KODE,NAMA,ALAMATNYA,KET,KET2,TGL,IDBARANG,JUMLAH,STATUSBARANG);
INSERT INTO stokbarang(idbarang,stok,tanggal,keterangan,kategori) SELECT IDBARANG,0-JUMLAH,TGL,KODE,'BP' FROM BKMB WHERE statusbarang='keluar' AND kodekmb=KODE;
INSERT INTO stokbarang(idbarang,stok,tanggal,keterangan,kategori) SELECT IDBARANG,JUMLAH,TGL,KODE,'BP' FROM BKMB WHERE statusbarang='masuk' AND kodekmb=KODE;
UPDATE buktipesanan SET statuskirim='sudah' WHERE kodebp=KODE;
IF `_rollback` THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
END */$$
DELIMITER ;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
| true |
9c34365a5f85545276aabff70f7ca6575ce794e8 | SQL | bitslayer42/warranty | /src/MakingMopar.sql | UTF-8 | 7,654 | 3.734375 | 4 | [] | no_license | ALTER VIEW MakingMopar AS
-- Use this to create the data format to use on the website SORT IS IMPORTANT!
/*
select * from MakingMopar -- where term = '8/125K' and Class = 'b' And Ded = '200'
ORDER BY Class, PlanType, CAST(Ded AS INT),
CAST(dbo.NumericPart(LEFT(Term,CHARINDEX('/',Term))) AS INT), --years
CAST(dbo.NumericPart(REPLACE(RIGHT(Term,LEN(Term)-CHARINDEX('/',Term)),'K','')) AS INT)
*/
SELECT top 100 percent Class, Term, PlanType, CAST(Ded AS INT) Ded, ProdID, WooID, ProdIDS, WooIDS, CAST(Amt AS INT) Amt, CAST(MSRP AS INT) MSRP, '' ProdSel, '' WooSel, '' AmtSel FROM (
SELECT 'a' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(mp.Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(mp.PlanType='Powertrain Care Plus','PCP',
IIF(mp.PlanType='Added Care Plus','ACP',
IIF(mp.PlanType='Maximum Care','MC',
IIF(mp.PlanType='Maximum Care Unlimited','MCU',
IIF(mp.PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
A_ProdID AS ProdID,
A_WooID AS WooID,
A_ProdIDs AS ProdIDS,
A_WooIDs AS WooIDS,
A_Class AS Amt,
A_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'b' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
B_ProdID AS ProdID,
B_WooID AS WooID,
B_ProdIDs AS ProdIDS,
B_WooIDs AS WooIDS,
B_Class AS Amt,
B_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'c' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
C_ProdID AS ProdID,
C_WooID AS WooID,
C_ProdIDs AS ProdIDS,
C_WooIDs AS WooIDS,
C_Class AS Amt,
C_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'd' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
D_ProdID AS ProdID,
D_WooID AS WooID,
D_ProdIDs AS ProdIDS,
D_WooIDs AS WooIDS,
D_Class AS Amt,
D_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'e' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
E_ProdID AS ProdID,
E_WooID AS WooID,
E_ProdIDs AS ProdIDS,
E_WooIDs AS WooIDS,
E_Class AS Amt,
E_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'f' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
F_ProdID AS ProdID,
F_WooID AS WooID,
F_ProdIDs AS ProdIDS,
F_WooIDs AS WooIDS,
F_Class AS Amt,
F_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'g' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
G_ProdID AS ProdID,
G_WooID AS WooID,
G_ProdIDs AS ProdIDS,
G_WooIDs AS WooIDS,
G_Class AS Amt,
G_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION
SELECT 'h' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
H_ProdID AS ProdID,
H_WooID AS WooID,
H_ProdIDs AS ProdIDS,
H_WooIDs AS WooIDS,
H_Class AS Amt,
H_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION --special class I is E + 550
SELECT 'i' AS Class, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(Term,',000 Miles','K'),' ',''),'Years',''),'LifetimeMaximumCare/Cost','LMCC'),'UnlimitedMiles/Cost','UMC') AS Term,
IIF(PlanType='Powertrain Care Plus','PCP',
IIF(PlanType='Added Care Plus','ACP',
IIF(PlanType='Maximum Care','MC',
IIF(PlanType='Maximum Care Unlimited','MCU',
IIF(PlanType='Lifetime Plans','LP',
''))))) AS PlanType,
mp.Deductible Ded,
I_ProdID AS ProdID,
I_WooID AS WooID,
I_ProdIDs AS ProdIDS,
I_WooIDs AS WooIDS,
I_Class AS Amt,
I_MSRP AS MSRP
FROM MoparPlans mp
LEFT JOIN MoparWooIDs wid
ON mp.[Option] = wid.[Option]
LEFT JOIN MoparWooIDsSurcharge wis
ON mp.[Option] = wis.[Option]
UNION ALL --Blanks to line up rows
select Class, yr + '/' + ml + 'K' AS Term, 'PCP' AS [PlanType], Ded,'','','','','','' FROM (
SELECT 'a' AS Class
UNION SELECT 'b'
UNION SELECT 'c'
UNION SELECT 'd'
UNION SELECT 'e'
UNION SELECT 'f'
UNION SELECT 'g'
UNION SELECT 'h'
UNION SELECT 'i'
) AS one
CROSS JOIN (
select '5' yr union select '6' union select '7' union select '8'
) as two
cross join (
select '60' ml union select '70'
) as three
cross join (
select '0' Ded union select '100' union select '200'
) as four
) AS inr
WHERE WooID IS NOT NULL
ORDER BY Class, PlanType, CAST(Ded AS INT),
CAST(dbo.NumericPart(LEFT(Term,CHARINDEX('/',Term))) AS INT), --years
CAST(dbo.NumericPart(REPLACE(RIGHT(Term,LEN(Term)-CHARINDEX('/',Term)),'K','')) AS INT) --miles
| true |
bc6111376c05b186cfab879d7564b3bcac8e48a1 | SQL | MIoTMartinMoro/DII_PMulticapa | /localidad.sql | UTF-8 | 354 | 2.921875 | 3 | [] | no_license |
CREATE DATABASE IF NOT EXISTS `miot`;
USE `miot`;
DROP TABLE IF EXISTS `localidad`;
CREATE TABLE `localidad` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) NOT NULL,
`latitud` int(11) NOT NULL,
`longitud` int(11) NOT NULL,
`activo` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre_UNIQUE` (`nombre`)
);
commit;
| true |
526a1eb9866becab2fa281f70dfb81862e06e7f2 | SQL | architanasit/InsuranceApp | /sql/insurence.sql | UTF-8 | 5,891 | 3.640625 | 4 | [] | no_license | DROP TABLE IF EXISTS offers CASCADE;
commit;
DROP TABLE IF EXISTS coupons CASCADE;
commit;
DROP TABLE IF EXISTS policy CASCADE;
commit;
DROP TABLE IF EXISTS quotes CASCADE;
commit;
DROP TABLE IF EXISTS claims CASCADE;
commit;
DROP TABLE IF EXISTS masterinfo CASCADE;
commit;
DROP TABLE IF EXISTS ref_city CASCADE;
commit;
DROP TABLE IF EXISTS ref_state CASCADE;
commit;
DROP TABLE IF EXISTS ref_country CASCADE;
commit;
DROP TABLE IF EXISTS user_info CASCADE;
commit;
CREATE TABLE user_info (
customer_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'customer id auto-increment',
INDEX (customer_id),
customer_user_id VARCHAR(2000) NOT NULL COMMENT 'user id',
customer_name VARCHAR(60) NOT NULL COMMENT 'Customer Name',
customer_email VARCHAR(60) NOT NULL COMMENT 'customers email address',
customer_password VARCHAR(60) NOT NULL COMMENT 'customer password' ,
customer_dob DATE NOT NULL COMMENT 'DOB of the customer',
customer_isRemembered BOOLEAN NOT NULL COMMENT 'is Customer remembered or not',
customer_sessionkey VARCHAR(60) NOT NULL COMMENT 'session key',
customer_secans VARCHAR(20000) NOT NULL COMMENT 'secret answer to the question',
PRIMARY KEY (customer_id)
)engine=InnoDB; commit;
CREATE TABLE policy(
policy_number BIGINT NOT NULL AUTO_INCREMENT COMMENT 'policy number for the customer',
INDEX (policy_number),
cust_id MEDIUMINT NOT NULL COMMENT 'Foreign key reference to user_info->customer_id',
policy_period_from DATE NOT NULL COMMENT 'policy period from this date on',
policy_period_to DATE NOT NULL,
balance BIGINT NOT NULL COMMENT 'shows the remaining balance, 0 if paid in full',
FOREIGN KEY (cust_id) REFERENCES user_info (customer_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY (policy_number)
)engine = InnoDB; commit;
CREATE TABLE offers(
offer_id BIGINT NOT NULL AUTO_INCREMENT COMMENT 'id of the offer',
INDEX (offer_id),
offer_name VARCHAR(2000) NOT NULL COMMENT 'name of the offer',
offer_desc VARCHAR(20000) NOT NULL COMMENT 'describe the offer details',
exp_date DATE NOT NULL COMMENT 'when the offer is suppose to expire',
insert_date DATE NOT NULL COMMENT 'when the offer was inserted in the DB',
offer_image VARCHAR(2000) NOT NULL COMMENT 'link to the image saved for that offer',
PRIMARY KEY (offer_id)
)engine = InnoDB; commit;
CREATE TABLE coupons(
coupon_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'primary key for coupons',
INDEX (coupon_id),
coupon_desc VARCHAR(20000) NOT NULL COMMENT 'description of the coupon',
exp_date DATE NOT NULL COMMENT 'when the coupon is suppose to expire',
insert_date DATE NOT NULL COMMENT 'when the coupon was inserted in the DB',
coupon_image VARCHAR(2000) NOT NULL COMMENT 'link to the image for that coupon',
PRIMARY KEY (coupon_id)
)engine = InnoDB; commit;
CREATE TABLE quotes(
quotes_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'primary key for quotes',
INDEX (quotes_id),
quotes_user_id MEDIUMINT NOT NULL COMMENT 'foreign key referenced to the user_info',
quotes_date DATE NOT NULL COMMENT 'date that the quote was generated on',
quotes_type VARCHAR(20) NOT NULL COMMENT 'type of the quote, car, house etc',
quotes_premium MEDIUMINT NOT NULL COMMENT 'monthly or yearly premium',
quotes_desc VARCHAR(20000) NOT NULL COMMENT 'details of the policy',
FOREIGN KEY (quotes_user_id) REFERENCES user_info (customer_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY (quotes_id)
)engine = InnoDB; commit;
CREATE TABLE claims(
claims_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'primary key for the table',
INDEX (claims_id),
claims_user_id MEDIUMINT NOT NULL COMMENT 'foreign key reference to the user_info',
claims_DT DATETIME NOT NULL COMMENT 'date and time of the accident',
claims_location VARCHAR(2000) NOT NULL COMMENT 'location of the accident',
claims_police_response BOOLEAN NOT NULL COMMENT 'if police responded or not',
claims_desc VARCHAR(20000) NOT NULL COMMENT 'description of the accident',
claims_injury VARCHAR(20000) NOT NULL COMMENT 'description of the injuries',
claims_otherInfo VARCHAR(20000) NOT NULL COMMENT 'additional info about accident',
FOREIGN KEY (claims_user_id) REFERENCES user_info (customer_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY (claims_id)
)engine = InnoDB; commit;
CREATE TABLE ref_country(
country_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'id of the country',
INDEX(country_id),
country_name VARCHAR(2000) NOT NULL COMMENT 'the name of the country',
PRIMARY KEY (country_id)
)engine = InnoDB; commit;
CREATE TABLE ref_state(
state_id MEDIUMINT NOT NULL AUTO_INCREMENT COMMENT 'id of the state',
INDEX(state_id),
state_name VARCHAR(2000) NOT NULL COMMENT 'name of the state',
state_country_key MEDIUMINT NOT NULL COMMENT 'foreign key reference to country_id',
FOREIGN KEY (state_country_key) REFERENCES ref_country (country_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY (state_id)
)engine = InnoDB; commit;
CREATE TABLE ref_city(
city_id BIGINT NOT NULL COMMENT 'zip code of the city',
INDEX(city_id),
city_name VARCHAR(2000) NOT NULL COMMENT 'name of the city',
city_state_key MEDIUMINT NOT NULL COMMENT 'foreign reference key to state_id',
FOREIGN KEY (city_state_key) REFERENCES ref_state (state_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY(city_id)
)engine = InnoDB; commit;
CREATE TABLE masterinfo (
location_name VARCHAR(20) NOT NULL COMMENT 'name of Branch',
city_id_key BIGINT NOT NULL COMMENT 'foreign reference key to the city_id',
num INT NOT NULL COMMENT' phone number of Agent Location',
address VARCHAR(50) NOT NULL COMMENT ' address of location',
email VARCHAR(20) NOT NULL COMMENT 'email id of agent',
longitude MEDIUMINT NOT NULL COMMENT 'longitude of the location for maping',
latitude MEDIUMINT NOT NULL COMMENT 'latitude of the location for mapping',
FOREIGN KEY (city_id_key) REFERENCES ref_city (city_id) ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY ( location_name)
) engine=InnoDB; commit; | true |
b0d7daceb4b4b3f8d32426f651c7ee93fa253232 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day26/select1142.sql | UTF-8 | 178 | 2.6875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-25T11:42:00Z' AND timestamp<'2017-11-26T11:42:00Z' AND temperature>=42 AND temperature<=98
| true |
d90ab2d2471c580c147159f4fdc8e5482d013840 | SQL | computationalmystic/Zephyr-group12 | /ERD/Sprint2.sql | UTF-8 | 1,296 | 3.609375 | 4 | [] | no_license | Create Table Users(
UserID int not null,
UserName varchar(255),
UserPassword varchar(255),
AccessLevel varchar(255),
Primary key (UserID)
);
Create Table Room (
RoomNum int not null,
RoomType Varchar (255),
UserID int,
Foreign key (UserID) references Users(UserID),
primary key (RoomNum)
);
Create Table Thermostat(
ThermostatID int,
RoomNum int,
ThermostatMode varchar(255),
Temperature int,
Foreign key (RoomNum) references Room(RoomNum),
primary key (ThermostatID)
);
Create Table SmokeSensor (
SensorID int not null,
SensorIP varchar(255),
RoomNum int,
SmokeDetected varchar(255),
isActivated varchar (255),
Foreign key (RoomNum) references Room(RoomNum),
Primary key (SensorID)
);
Create Table MotionSensor (
SensorID int not null,
SensorIP varchar(255),
RoomNum int,
IntruderDetected varchar(255),
isActivated varchar (255),
Foreign key (RoomNum) references Room(RoomNum),
Primary key (SensorID)
);
Create Table TempSensor (
SensorID int not null,
SensorIP varchar(255),
RoomNum int,
Foreign key (RoomNum) references Room(RoomNum),
Primary key (SensorID)
);
Create Table Alarm (
AlarmID int not null,
Timeout int,
Primary key (AlarmID)
);
Create Table RoomStatus (
StatusID int,
RoomNum int,
Temperature int,
Primary key (StatusID),
Foreign key (RoomNum) references Room(RoomNum)
); | true |
418db164f4ac5897c846319239b8fe8aca6ee935 | SQL | neurotech/edumate-extensions | /sql/reports/global_reportable-courses.sql | UTF-8 | 2,897 | 4.78125 | 5 | [] | no_license | WITH unique_classes AS (
SELECT
(CASE WHEN class_type_id = 2 THEN 'Home Rooms' ELSE ('Year ' || LEFT(course, 2)) END) AS "SORT_ORDER",
course_id,
course,
class_id,
class,
student_id,
start_date,
end_date
FROM view_student_class_enrolment
WHERE
academic_year = YEAR(current date)
AND
class_type_id IN (1,2,9,10,1101,1124)
AND
(start_date <= (current date)
AND
end_date > (current date))
AND
course NOT IN ('Saturday School of Community Languages', 'School-Based Apprenticeship', 'School-Based Traineeship')
AND
course NOT LIKE '% Study%'
),
unique_class_teachers AS (
SELECT
class_teacher.class_id,
class_teacher.teacher_id,
class_teacher.is_primary,
COALESCE(contact.preferred_name, contact.firstname) || ' ' || contact.surname AS "TEACHER"
FROM class_teacher
INNER JOIN teacher ON teacher.teacher_id = class_teacher.teacher_id
INNER JOIN contact ON contact.contact_id = teacher.contact_id
WHERE class_teacher.class_id IN (SELECT DISTINCT class_id FROM unique_classes)
),
unique_class_teachers_aggregate AS (
SELECT
class_id,
LISTAGG(teacher, ', ') WITHIN GROUP(ORDER BY is_primary DESC) AS "TEACHER"
FROM unique_class_teachers
GROUP BY class_id
),
class_sizes AS (
SELECT
class_id,
COUNT(student_id) AS "STUDENTS"
FROM unique_classes
GROUP BY class_id
),
class_rooms AS (
SELECT class_id, room_id
FROM period_class
WHERE
class_id IN (SELECT DISTINCT class_id FROM unique_classes)
AND
(effective_start <= (current date)
AND
effective_end >= (current date))
),
class_rooms_counts AS (
SELECT
class_id,
room_id,
COUNT(room_id) "ROOM_COUNTS"
FROM class_rooms
GROUP BY class_id, room_id
),
class_rooms_aggregate AS (
SELECT
class_rooms_counts.class_id,
LISTAGG(room.code, ', ') WITHIN GROUP(ORDER BY class_rooms_counts.room_counts DESC) AS "ROOMS"
FROM class_rooms_counts
INNER JOIN room ON room.room_id = class_rooms_counts.room_id
WHERE room_counts > 1
GROUP BY class_rooms_counts.class_id
),
combined AS (
SELECT DISTINCT sort_order, class_id FROM unique_classes
)
SELECT
combined.sort_order,
(CASE WHEN (ROW_NUMBER() OVER (PARTITION BY course.course_id)) = 1 THEN course ELSE '' END) AS "COURSE",
class,
unique_class_teachers_aggregate.teacher,
class_sizes.students,
class_rooms_aggregate.rooms
FROM combined
INNER JOIN class ON class.class_id = combined.class_id
INNER JOIN course ON course.course_id = class.course_id
INNER JOIN unique_class_teachers_aggregate ON unique_class_teachers_aggregate.class_id = combined.class_id
INNER JOIN class_sizes ON class_sizes.class_id = combined.class_id
INNER JOIN class_rooms_aggregate ON class_rooms_aggregate.class_id = combined.class_id
ORDER BY combined.sort_order, course.course, class.class | true |
b507e8cfc9862084f3078f127720c506a4da897d | SQL | 896637210/mysql | /cmd_directions.sql | UTF-8 | 3,033 | 3.53125 | 4 | [] | no_license | -- mysql -uroot -proot
-- mysql>_
-- 查看数据库列表
-- show databses;
-- 打开数据库
-- use mysql;
-- 查看数据表列表
-- show tables;
-- 查询数据表
-- SELECT * FORM user;
-- SELECT host, user, password FROM user;
-- [_$a-zA-Z0-9]
-- 创建数据库 CREATE DATABASE ***;
-- CREATE DATABASE myBlog;
-- 快捷键:大写<Ctrl>+<K>,<Ctrl>+<U>,小写<Ctrl>+<K>,<Ctrl>+<L>
-- use myblog;
-- 删除数据库 drop database ***;
-- DROP DATABASE myblog;
-- 创建数据表 CREATE TABLE *** ();
-- 数据类型:
-- 整数:INT() -- INTEGER, SMALLINT, BIGINT, TINYINT
-- 小数:DECIMAL[6, 2], NUMERIC
-- 浮点数:FLOAT
-- 布尔值:BOOL
-- 字符、字符串:CHAR(), VARCHAR(64)
-- 日期、时间:DATE, TIMESTAMP
-- NOT NULL 非空,必须赋值! , NULL 允许空值
-- 主键 PK: PRIMARY KEY
-- CREATE TABLE users (
-- id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-- name VARCHAR(25) NOT NULL,
-- sex VARCHAR(8) NULL,
-- age INT
-- );
-- user
-- pssword
-- 主键 PK!1,2,3,4,5,6,7,8
-- CREATE TABLE users (
-- id INT NOT NULL,
-- name VARCHAR(25) NOT NULL,
-- sex VARCHAR(8) NULL,
-- age INT,
-- PRIMARY KEY (id) -- 主键 PK!
-- );
-- DROP TABLE users;
-- 插入数据:INSERT INTO ***
-- INSERT INTO users (name, sex, age) VALUES ('Alice Wang', 'Female', 18);
-- INSERT INTO users (age, name, sex) VALUES ('William Zhang', 'Male', 36);
-- 编辑、更新数据 UPDATE *** SET *=*, *=* WHERE
-- UPDATE users SET name='William Zhang', sex='Male', age=36;
-- WHERE id=2
-- 修改 id=1 数据为:'Alice Wang', 'Female', 18
-- UPDATE users SET name='Alice Wang', sex='Female', age=18 WHERE id=1;
-- INSERT INTO users (age, name, sex) VALUES ('William Zhang', 'Male', 36);
-- INSERT INTO users SET name='Tony Lin', sex='Male', age=48;
-- 删除数据 DELETE from *** WHERE *=*;
-- DELETE FROM users;
-- 查询 select * from *** order by **
-- SELECT * FROM users ORDER BY id;
-- SELECT * FROM users ORDER BY id DESC;
-- 多行数据插入
-- INSERT INTO users (name, sex, age) VALUES
-- ('Alice Wang', 'Female', 18),
-- ('William Zhang', 'Male', 36),
-- ('Tony Lin', 'Male', 48);
-- 条件查询: SELECT * FROM *** WHERE name='tony' OR name like '%a%';
-- SELECT * FROM users WHERE name like '%a%';
-- 修改数据表结构 ALTER TABLE ???
-- 更改数据表名 ALTER TABLE ***old RENAME TO ***new
-- 添加字段 ADD ** VARCHAR(??);
-- 更改字段结构 MODIFY ** VARCHAR() | INT | DATE | DATETIME | TIMESTAMP
-- ALTER TABLE users ADD mobile VARCHAR(24) NULL;
-- ALTER TABLE users DROP mobile;
-- ALTER TABLE users CHANGE name username;
-- ALTER TABLE user RENAME AS users;
-- 添加日期字段
-- ALTER TABLE users ADD bday TIMESTAMP
-- ALTER TABLE users MODIFY bday TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
-- INSERT INTO users (name, sex, age) VALUES ('Peter Lee', 'Male', '28');
-- 导出sql
-- 导入 source *.sql
-- source d:/host/php/test.sql | true |
77dd86a39172c57b2c3fa54914cd3eb666533596 | SQL | ejimenezdelgado/Aplica_db_martes_1_2018 | /Clase 10/CLASE_10_2.sql | UTF-8 | 7,965 | 2.875 | 3 | [] | no_license | --Se insertan las regiones
INSERT INTO region VALUES(1001, 'Sur de Asia');
INSERT INTO region VALUES(1002, 'Medio Oeste');
INSERT INTO region VALUES(1003, 'Noreste de Europa' );
INSERT INTO region VALUES(1007, 'América del Norte');
-- Se insertan todos los departamentos
INSERT INTO departamento VALUES(30,'Ventas',201,89);
INSERT INTO departamento VALUES(50,'Ventas',201,89);
INSERT INTO departamento VALUES(60,'Ventas',201,89);
INSERT INTO departamento VALUES(61,'Contaduría',201,89);
INSERT INTO departamento VALUES(80,'Finanzas',211,90);
--Se insertan los Histiales d trabajo
INSERT INTO historia_trabajo VALUES(100, '12-01-1987', NULL,1001, 61);
INSERT INTO historia_trabajo VALUES(100, '12-01-1987', NULL,1001, 61);
INSERT INTO historia_trabajo VALUES(100, '12-01-1987',NULL, 1001, 61);
-- Se insertan todos los países
INSERT INTO pais VALUES ('C1', 'Indiana', 1002);
INSERT INTO pais VALUES ('C2', 'USA',0);
INSERT INTO pais VALUES ('C3', 'UK',0);
INSERT INTO pais VALUES ('C4', 'India', 1001);
INSERT INTO pais VALUES ('C5', 'USA', 1007);
INSERT INTO pais VALUES ('C6', 'UK', 1003);
-- Se insertan todos los empleados
INSERT INTO empleado VALUES(100, 'Steven' ,'King', 'SKING', '515-123-4567' , '1987-06-17' , '1001', 24000.00 , 0.00 , 0 , 90);
INSERT INTO empleado VALUES(101, 'Neena', 'Kochhar', 'NKOCHHAR', '515.123.4568', '1987-06-18 ','1001', 17000.00 , 0.00, 100, 90);
INSERT INTO empleado VALUES(102, 'Lex', 'De Haan', 'LDEHAAN', '515.123.4569', '1987-06-19' ,' 1001', 17000.00, 0.00, 100, 90);
INSERT INTO empleado VALUES(103, 'Alexander', 'Hunold', 'AHUNOLD', '590.423.4567', '1987-06-20' ,'1002', 9000.00, 0.00, 102, 60);
INSERT INTO empleado VALUES(104, 'Bruce', 'Ernst', 'BERNST', '590.423.4568 ', '1987-06-21', '1002', 6000.00, 0.00, 103, 60);
INSERT INTO empleado VALUES(105, 'David', 'Austin', 'DAUSTIN', '590.423.4569 ', '1987-06-22' , '1002', 4800.00, 0.00, 103, 60);
INSERT INTO empleado VALUES(106, 'Valli', 'Pataballa', 'VPATABAL', '590.423.4560 ', '1987-06-23' , '1002', 4800.00 , 0.00, 103, 60);
INSERT INTO empleado VALUES(107, 'Diana', 'Lorentz', 'DLORENTZ', '590.423.5567 ', '1987-06-24' ,'1002', 4200.00, 0.00, 103, 60 );
INSERT INTO empleado VALUES(108, 'Nancy', 'Greenberg', 'NGREENBE', '515.124.4569', '1987-06-25 ', '1002 ' , 12000.00 , 0.00 ,101 ,100 );
INSERT INTO empleado VALUES(109, 'Daniel', 'Faviet', 'DFAVIET', '515.124.4169 ', '1987-06-26 ', '1001' , 9000.00 , 0.00 ,108 ,100 );
INSERT INTO empleado VALUES(110, 'John', 'Chen', 'JCHEN', '515.124.4269 ', '1987-06-27 ', '1001', 8200.00 , 0.00 ,108 ,100 );
INSERT INTO empleado VALUES(111, 'Ismael', 'Sciarra', 'ISCIARRA', '515.124.4369', '1987-06-28 ', '1001' , 7700.00 , 0.00 ,108 ,100 );
INSERT INTO empleado VALUES(112, 'Jose Manuel', 'Urman', 'JMURMAN', '515.124.4469', '1987-06-29 ', '1001' , 7800.00 , 0.00 ,108 ,100 );
INSERT INTO empleado VALUES(113, 'Luis', 'Popp', 'LPOPP', '515.124.4567', '1987-06-30 ', '1001' , 6900.00 , 0.00 , 108 , 100 );
INSERT INTO empleado VALUES(114, 'Den', 'Raphaely', 'DRAPHEAL', '515.127.4561 ', '1987-07-01 ', '1001 ' , 11000.00 , 0.00 ,100 ,30 );
INSERT INTO empleado VALUES(115, 'Alexander', 'Khoo', 'AKHOO ' , '515.127.4562 ', '1987-07-02 ', '1002 ' , 3100.00 , 0.00 ,114 ,30 );
INSERT INTO empleado VALUES(116, 'Shelli', 'Baida', 'SBAIDA ' , '515.127.4563 ', '1987-07-03 ', '1002 ' , 2900.00 , 0.00 ,114 ,30 );
INSERT INTO empleado VALUES(117, 'Sigal', 'Tobias', 'STOBIAS' , '515.127.4564 ', '1987-07-04 ', '1002 ' , 2800.00 , 0.00 ,114 ,30 );
INSERT INTO empleado VALUES(118, 'Guy', 'Himuro', 'GHIMURO' , '515.127.4565 ' , '1987-07-05 ', '1002 ' , 2600.00 , 0.00 ,114 ,30 );
INSERT INTO empleado VALUES(119, 'Karen', 'Colmenares', 'KCOLMENA' , '515.127.4566 ' , '1987-07-06 ', '1002 ' , 2500.00 , 0.00 ,114 ,30 );
INSERT INTO empleado VALUES(120, 'Matthew', 'Weiss', 'MWEISS' , '650.123.1234 ' , '1987-07-07 ', '1002' , 8000.00 , 0.00 , 100 , 50 );
INSERT INTO empleado VALUES(121, 'Adam', 'Fripp', 'AFRIPP' , '650.123.2234 ' , '1987-07-08 ', '1002' , 8200.00 , 0.00 , 100 , 50 );
INSERT INTO empleado VALUES(122, 'Payam', 'Kaufling', 'PKAUFLIN' , '650.123.3234 ' , '1987-07-09 ', '1002' , 7900.00 , 0.00 , 100,50 );
INSERT INTO empleado VALUES(123, 'Shanta', 'Vollman', 'SVOLLMAN' , '650.123.4234 ' , '1987-07-10 ', '1002 ' , 6500.00 , 0.00 , 100 ,50 );
INSERT INTO empleado VALUES(124, 'Kevin', 'Mourgos', 'KMOURGOS' , '650.123.5234 ' , '1987-07-11 ', '1002' , 5800.00 , 0.00 , 100 ,50 );
INSERT INTO empleado VALUES(125, 'Julia', 'Nayer', 'JNAYER ' , '650.124.1214 ' , '1987-07-12 ', '1001 ' , 3200.00 , 0.00 , 120 , 50 );
INSERT INTO empleado VALUES(126, 'Irene', 'Mikkilineni', 'IMIKKILI' , '650.124.1224 ' , '1987-07-13 ', '1001 ' , 2700.00 , 0.00 , 120 ,50 );
INSERT INTO empleado VALUES(127, 'James', 'Landry', 'JLANDRY' , '650.124.1334 ' , '1987-07-14 ', '1001 ' , 2400.00 ,0.00 ,120 ,50 );
INSERT INTO empleado VALUES(128, 'Steven', 'Markle', 'SMARKLE' , '650.124.1434 ', '1987-07-15 ', '1001' , 2200.00 ,0.00 ,120 ,50 );
INSERT INTO empleado VALUES(129, 'Laura', 'Bissot', 'LBISSOT' , '650.124.5234 ', '1987-07-16 ', '1001' , 3300.00 ,0.00 ,121 ,50 );
INSERT INTO empleado VALUES(130, 'Mozhe', 'Atkinson', 'MATKINSO' , '650.124.6234 ' , '1987-07-17 ', '1001' , 2800.00 ,0.00 ,121 ,50 );
INSERT INTO empleado VALUES(131, 'James', 'Marlow', 'JAMRLOW' , '650.124.7234 ' , '1987-07-18 ', '1001' , 2500.00 ,0.00 ,121 ,50 );
INSERT INTO empleado VALUES(132, 'TJ', 'Olson', 'TJOLSON' , '650.124.8234 ' , '1987-07-19 ', '1001' , 2100.00 ,0.00 ,121 ,50 );
INSERT INTO empleado VALUES(133, 'Jason', 'Mallin', 'JMALLIN' , '650.127.1934 ' , '1987-07-20 ', '1001' , 3300.00 ,0.00 ,122 ,50 );
INSERT INTO empleado VALUES(134, 'Michael', 'Rogers', 'MROGERS' , '650.127.1834 ' , '1987-07-21 ', '1001' , 2900.00 ,0.00 ,122 ,50 );
INSERT INTO empleado VALUES(135, 'Ki', 'Gee', 'KGEE', '650.127.1734 ' , '1987-07-22 ', '1001' , 2400.00 ,0.00 ,122 ,50 );
INSERT INTO empleado VALUES(136, 'Hazel', 'Philtanker', 'HPHILTAN' , '650.127.1634 ' , '1987-07-23 ', '1001' , 2200.00 ,0.00 ,122 ,50 );
INSERT INTO empleado VALUES(137, 'Renske', 'Ladwig', 'RLADWIG ' , '650.121.1234 ' , '1987-07-24' , '1001' , 3600.00 ,0.00 ,123 ,50 );
INSERT INTO empleado VALUES(138, 'Stephen', 'Stiles', 'SSTILES' , '650.121.2034 ' , '1987-07-25' , '1001' , 3200.00 ,0.00 ,123 ,50 );
INSERT INTO empleado VALUES(139, 'John', 'Seo ', 'JSEO ' , '650.121.2019 ' , '1987-07-26' , '1001' , 2700.00 ,0.00 ,123 ,50 );
INSERT INTO empleado VALUES(140, 'Joshua', 'Patel', 'JPATEL' , '650.121.1834 ' , '1987-07-27' , '1001' , 2500.00 ,0.00 ,123 ,50 );
INSERT INTO empleado VALUES(141, 'Trenna', 'Rajs ', 'TRAJS ' , '650.121.8009 ' , '1987-07-28' , '1001' , 3500.00 ,0.00 ,124 ,50 );
INSERT INTO empleado VALUES(142, 'Curtis', 'Davies', 'CDAVIES' , '650.121.2994 ', '1987-07-29' , '1001' , 3100.00 ,0.00 ,124 ,50 );
INSERT INTO empleado VALUES(143, 'Randall', 'Matos ', 'RMATOS' , '650.121.2874 ', '1987-07-30' , '1001' , 2600.00 ,0.00 ,124 ,50 );
INSERT INTO empleado VALUES(144, 'Peter', 'Vargas', 'PVARGAS' , '650.121.2004', '1987-07-31' , '1001' , 2500.00 ,0.00 ,124 ,50 );
INSERT INTO empleado VALUES(145, 'John', 'Russell', 'JRUSSEL' , '011.44.1344.429268' , '1987-08-01' , '1002' , 14000.00 ,0.40 ,100 ,80 );
-- Se insertan las localizaciones
INSERT INTO locacion VALUES(89, 'Frente al Parque', '21001', 'Quesada', 'Al','C2');
INSERT INTO locacion VALUES(90, 'A un costado de la Plaza', '21009', 'Palmera', 'Al','C2');
INSERT INTO locacion VALUES(91, 'Frente al Cementerio', '322540', 'San Francisco', 'SJ','C2');
--Se insertan los trabajos
INSERT INTO trabajo VALUES('1001','Oficial', 210000.00, 400000.00);
INSERT INTO trabajo VALUES('1002','Recepcionista', 250000.00, 425000.00);
| true |
5dfe63cfcc6c1c50e2bc8836cd35dd65a4367d1d | SQL | nss-day-cohort-48/chinook-anmonzi | /Chinook queries/27_top_media_type.sql | UTF-8 | 249 | 3.59375 | 4 | [] | no_license | SELECT
m.name as MediaType,
COUNT(il.InvoiceId) as NumberSold
FROM InvoiceLine as il
JOIN Track as t
ON il.TrackId = t.TrackId
JOIN MediaType as m
ON t.MediaTypeId = m.MediaTypeId
GROUP BY MediaType
ORDER BY NumberSold DESC
LIMIT 1;
| true |
bf58c5da226e045b4db1a05c9a64c8ff05c19096 | SQL | Muhammadaan/lelang | /db.sql | UTF-8 | 4,650 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 01, 2019 at 03:19 PM
-- Server version: 8.0.15
-- PHP Version: 7.1.16
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: `web_taufik`
--
-- --------------------------------------------------------
--
-- Table structure for table `m_roles`
--
CREATE TABLE `m_roles` (
`id` int(11) NOT NULL,
`nama` varchar(40) NOT NULL,
`akses` text NOT NULL,
`is_deleted` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `m_roles`
--
INSERT INTO `m_roles` (`id`, `nama`, `akses`, `is_deleted`) VALUES
(1, 'Super Admin', '{\"master_roles\":true,\"master_user\":true,\"master_akses\":true,\"master_cabang\":true,\"master_satuan\":true,\"master_kategori\":true,\"master_barang\":true,\"transaksi_pembelian\":true,\"transaksi_penjualan\":true,\"transaksi_penyesuain\":true,\"master_customer\":true,\"transaksi_pemesanan\":true,\"transaksi_kasir\":true,\"transaksi_peminjamanruang\":true,\"master_ruang\":true}', 0),
(5, 'Petugas', '[]', 0),
(6, 'Pemohon', '{\"master_akses\":true,\"master_user\":true,\"master_cabang\":true,\"master_satuan\":true,\"master_kategori\":true,\"master_barang\":true}', 0);
-- --------------------------------------------------------
--
-- Table structure for table `m_ruang`
--
CREATE TABLE `m_ruang` (
`id` int(11) NOT NULL,
`kode` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`nama` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
`is_deleted` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `m_ruang`
--
INSERT INTO `m_ruang` (`id`, `kode`, `nama`, `is_deleted`) VALUES
(2, NULL, 'Ruang Mawar', 0),
(3, NULL, 'Ruang Melati', 0);
-- --------------------------------------------------------
--
-- Table structure for table `m_user`
--
CREATE TABLE `m_user` (
`id` int(11) NOT NULL,
`nama` varchar(100) DEFAULT NULL,
`username` varchar(50) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`m_roles_id` int(5) DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `m_user`
--
INSERT INTO `m_user` (`id`, `nama`, `username`, `password`, `m_roles_id`, `is_deleted`) VALUES
(1, 'Admin', 'admin', '63c8f0854166152eaacc876088a8e6b1729ca2d7', 1, 0),
(2, 'Ainul', 'aan', 'd1157e00ac5fbe3e94261598a634b18a3eb4a78b', 5, 0),
(3, 'ita', 'tia', '277f1f143c2cc4e44c17325baf8aeddc5752bab5', 7, 1);
-- --------------------------------------------------------
--
-- Table structure for table `t_pinjamruang`
--
CREATE TABLE `t_pinjamruang` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`ruang_id` int(2) NOT NULL,
`surat_pemohon` varchar(20) COLLATE utf8mb4_general_ci NOT NULL,
`tanggal` int(11) NOT NULL,
`status` int(11) DEFAULT NULL,
`is_deleted` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT;
--
-- Dumping data for table `t_pinjamruang`
--
INSERT INTO `t_pinjamruang` (`id`, `user_id`, `ruang_id`, `surat_pemohon`, `tanggal`, `status`, `is_deleted`) VALUES
(1, 2, 0, '22341231133', 0, NULL, 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `m_roles`
--
ALTER TABLE `m_roles`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `m_ruang`
--
ALTER TABLE `m_ruang`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `m_user`
--
ALTER TABLE `m_user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `t_pinjamruang`
--
ALTER TABLE `t_pinjamruang`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `m_roles`
--
ALTER TABLE `m_roles`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `m_ruang`
--
ALTER TABLE `m_ruang`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `m_user`
--
ALTER TABLE `m_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `t_pinjamruang`
--
ALTER TABLE `t_pinjamruang`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
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 */;
| true |
909add016de17a5d8d30747920232cc23177c295 | SQL | EricPPerry/CT-Wk4-Homework | /day-1/homework-day-1.sql | UTF-8 | 1,895 | 4.71875 | 5 | [] | no_license | -- 1. How many actors are there with the last name "Wahlberg"?
SELECT COUNT(last_name) AS Wahlbergers
FROM actor
WHERE last_name = 'Wahlberg';
--2. How many payments were made between $3.99 and $5.99?
SELECT COUNT(amount) AS Payments_between_399_599
FROM payment
WHERE amount BETWEEN 3.99 AND 5.99;
--3. What film does the store have the most of? (search in inventory)
--Looks like multiple were tied for most with 8, so there are multiple returns
SELECT film_id, COUNT(film_id)
FROM inventory
GROUP BY film_id
ORDER BY COUNT(film_id) DESC;
--4. How many customers have the name 'William'?
SELECT COUNT(last_name) AS Number_of_Wills
FROM customer
WHERE last_name LIKE 'William';
--5. What store employee (get the id) sold the most rentals?
SELECT staff_id, COUNT(staff_id) AS Rentals_Sold
FROM rental
GROUP BY staff_id
LIMIT 1;
--6. How many different district names are there?
SELECT COUNT(DISTINCT district) AS Num_Different_Districts
FROM address;
--7. What film has the most actors in it?
SELECT film_id AS Film_ID_with_most_actors, COUNT(film_id) AS Number_of_Actors
FROM film_actor
GROUP BY film_id
ORDER BY COUNT(film_id) DESC
LIMIT 1;
--8. From store_id 1, how many customers have a last name ending with 'es'?
SELECT COUNT(customer_id) AS Customers_with_last_names_ending_ES
FROM customer
WHERE store_id=1 AND last_name LIKE '%es';
--9. How many payment amounts (4.99, 5.99, etc.) had a number of rentals above 250
--for customers with ids between 380 and 430 (group by and having > 250)
SELECT DISTINCT amount
FROM payment
WHERE customer_id BETWEEN 380 AND 430
GROUP BY amount
HAVING COUNT(amount)>250;
--10. Within the film table, how many rating categories are there?
SELECT COUNT(DISTINCT rating) AS Num_Rating_Categories
FROM film;
-- And what rating has the most movies total?
SELECT rating, COUNT(rating)
FROM film
GROUP BY rating
ORDER BY COUNT(rating) DESC
LIMIT 1; | true |
0997030c7bc42b9d5827e3e63579fb7df29f4cbb | SQL | subashcs/infrainit | /well-known/ibuild/ibuild.sql | UTF-8 | 25,558 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 21, 2018 at 05:04 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.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: `ibuild`
--
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`u_id` int(11) NOT NULL,
`user_views` varchar(500) CHARACTER SET utf8mb4 NOT NULL,
`total_bought` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`u_id`, `user_views`, `total_bought`) VALUES
(1, 'add your views about the designs of the infrastructures you like', 3),
(9, '', 0);
-- --------------------------------------------------------
--
-- Table structure for table `deleted_items`
--
CREATE TABLE `deleted_items` (
`id` int(11) NOT NULL,
`material_name` varchar(200) NOT NULL,
`category` int(50) NOT NULL,
`available_amnt` int(150) NOT NULL,
`user_id` int(11) NOT NULL,
`price_per_unit` varchar(100) NOT NULL,
`ext_details` varchar(1000) NOT NULL,
`f_image` varchar(500) NOT NULL,
`date` datetime NOT NULL,
`likes` int(11) NOT NULL,
`sales` int(11) NOT NULL,
`manufacturer` varchar(300) NOT NULL,
`deleted_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `deleted_items`
--
INSERT INTO `deleted_items` (`id`, `material_name`, `category`, `available_amnt`, `user_id`, `price_per_unit`, `ext_details`, `f_image`, `date`, `likes`, `sales`, `manufacturer`, `deleted_date`) VALUES
(5, 'Strong bounty bricks', 0, 100000, 2, '9', '', 'hydro-energy.jpg', '2018-03-18 00:00:00', 0, 0, 'Hari Hardware Suppliers', '2018-03-21 14:53:00');
-- --------------------------------------------------------
--
-- Table structure for table `deleted_users`
--
CREATE TABLE `deleted_users` (
`u_id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`email` varchar(300) NOT NULL,
`password` varchar(100) NOT NULL,
`DOB` varchar(100) NOT NULL,
`citizenship_no` varchar(100) DEFAULT NULL,
`image` varchar(500) DEFAULT NULL,
`role` varchar(50) DEFAULT NULL,
`esewa` varchar(100) DEFAULT NULL,
`cardnum` int(5) DEFAULT NULL,
`cardcode` int(11) DEFAULT NULL,
`district` varchar(100) DEFAULT NULL,
`metropolitan` varchar(100) DEFAULT NULL,
`city` varchar(100) DEFAULT NULL,
`oda` int(11) DEFAULT NULL,
`street` varchar(200) DEFAULT NULL,
`deleted_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `delivery_address`
--
CREATE TABLE `delivery_address` (
`u_id` int(11) NOT NULL,
`material_id` int(11) NOT NULL,
`district` varchar(50) NOT NULL,
`metropolitan` varchar(50) NOT NULL,
`oda` int(11) NOT NULL,
`street` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `deny_reasons`
--
CREATE TABLE `deny_reasons` (
`order_id` int(11) NOT NULL,
`reason` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `house_arc`
--
CREATE TABLE `house_arc` (
`house_id` int(11) NOT NULL,
`name` varchar(400) NOT NULL,
`architecture` varchar(200) NOT NULL,
`bedrooms` int(11) NOT NULL,
`beds` int(11) NOT NULL,
`bathrooms` int(11) NOT NULL,
`livingrooms` int(11) NOT NULL,
`floors` int(11) NOT NULL,
`garden` tinyint(1) NOT NULL DEFAULT '0',
`Garagebays` int(11) NOT NULL,
`estim_budget` decimal(10,0) NOT NULL,
`area` int(11) NOT NULL COMMENT 'in square meter',
`dimension` varchar(50) NOT NULL COMMENT 'in meter',
`image` varchar(500) NOT NULL,
`likes` int(11) NOT NULL DEFAULT '0',
`dislikes` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `house_arc`
--
INSERT INTO `house_arc` (`house_id`, `name`, `architecture`, `bedrooms`, `beds`, `bathrooms`, `livingrooms`, `floors`, `garden`, `Garagebays`, `estim_budget`, `area`, `dimension`, `image`, `likes`, `dislikes`) VALUES
(1, 'Nepali traditional house', 'Traditional Newari', 3, 8, 1, 0, 0, 0, 0, '200000', 54, '9 m * 6 m', 'tradhouse.jpg', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `house_arc_likes`
--
CREATE TABLE `house_arc_likes` (
`like_id` int(11) NOT NULL,
`house_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`liked` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `house_arc_likes`
--
INSERT INTO `house_arc_likes` (`like_id`, `house_id`, `user_id`, `liked`) VALUES
(4, 1, 1, 0),
(6, 1, 2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE `items` (
`id` int(11) NOT NULL,
`material_name` varchar(200) NOT NULL,
`category` varchar(50) NOT NULL,
`available_amnt` varchar(150) NOT NULL,
`user_id` int(11) NOT NULL,
`price_per_unit` varchar(100) NOT NULL,
`ext_details` varchar(1000) NOT NULL,
`f_image` varchar(500) NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`likes` int(11) NOT NULL DEFAULT '0',
`sales` int(11) NOT NULL DEFAULT '0',
`manufacturer` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `items_like`
--
CREATE TABLE `items_like` (
`like_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`liker` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `items_like`
--
INSERT INTO `items_like` (`like_id`, `item_id`, `liker`) VALUES
(14, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `items_sizes`
--
CREATE TABLE `items_sizes` (
`size_id` int(11) NOT NULL,
`material_id` int(11) NOT NULL,
`size` varchar(30) NOT NULL COMMENT 'perr mm for rods diameter , '
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `materials_req`
--
CREATE TABLE `materials_req` (
`material_id` int(11) NOT NULL,
`house_id` int(11) NOT NULL,
`material_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `notices`
--
CREATE TABLE `notices` (
`n_id` int(11) NOT NULL,
`topic` varchar(200) NOT NULL,
`description` varchar(2000) NOT NULL,
`file` varchar(300) NOT NULL,
`date_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`dest_url` varchar(500) NOT NULL,
`for_all` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `notices`
--
INSERT INTO `notices` (`n_id`, `topic`, `description`, `file`, `date_c`, `dest_url`, `for_all`) VALUES
(1, 'You are all set.Thanks for joining.', 'Read our documents and user guide for beginning.', '', '2017-09-05 14:23:16', 'blocks/', 1),
(2, 'Please Confirm your email.', 'please confirm your email to begin with full features.and enjoy', '', '2017-09-05 14:26:41', 'https://www.google.com/drive/u/0/my-drive', 1),
(3, 'New Order reclaimation!', '', '', '2017-12-15 17:41:24', 'blocks/orders_show?ord_id=26', 0),
(7, 'One new order', '', '', '2017-12-15 19:41:09', '/ibuild/blocks/orders_show?ord_id=31', 0),
(8, 'this is a test', ' a test is of some value do you know it', '', '2018-02-10 12:28:15', '', 0),
(10, 'hello this tis a test', '', '', '2018-03-14 14:53:48', 'hello@thelo.com', 0);
-- --------------------------------------------------------
--
-- Table structure for table `noticeuser`
--
CREATE TABLE `noticeuser` (
`n_id` int(11) NOT NULL,
`target_user` int(11) NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`seen` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `noticeuser`
--
INSERT INTO `noticeuser` (`n_id`, `target_user`, `date`, `seen`) VALUES
(1, 3, '2017-12-15 09:05:20', 0),
(3, 3, '2017-12-15 18:58:09', 0),
(7, 2, '2017-12-15 19:41:09', 1);
-- --------------------------------------------------------
--
-- Table structure for table `orders_to_supp`
--
CREATE TABLE `orders_to_supp` (
`order_id` int(11) NOT NULL,
`request_maker_id` int(11) NOT NULL,
`material_id` int(11) NOT NULL,
`order_amount` int(11) NOT NULL,
`size` varchar(100) NOT NULL,
`payment_method` varchar(100) NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`supply_time` datetime DEFAULT NULL,
`sent_status` tinyint(1) NOT NULL DEFAULT '0',
`received_status` tinyint(1) NOT NULL DEFAULT '0',
`initial_paym_offered` int(11) NOT NULL,
`total_price` double NOT NULL,
`denied` tinyint(1) NOT NULL DEFAULT '0',
`queued` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orders_to_supp`
--
INSERT INTO `orders_to_supp` (`order_id`, `request_maker_id`, `material_id`, `order_amount`, `size`, `payment_method`, `date`, `supply_time`, `sent_status`, `received_status`, `initial_paym_offered`, `total_price`, `denied`, `queued`) VALUES
(1, 1, 5, 1898, '4*3*2', 'cashondel', '2018-03-21 19:56:53', NULL, 0, 0, 0, 17082, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `order_location`
--
CREATE TABLE `order_location` (
`order_id` int(11) NOT NULL,
`gaunnagar` varchar(25) NOT NULL,
`street` varchar(25) NOT NULL,
`oda` int(11) NOT NULL,
`extradet` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `order_location`
--
INSERT INTO `order_location` (`order_id`, `gaunnagar`, `street`, `oda`, `extradet`) VALUES
(25, 'baglulng', 'Malika berneta', 4, ''),
(26, 'Baglung', 'Malika -4 berneta', 5, 'Near rice mill');
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
CREATE TABLE `payment` (
`payment_id` int(11) NOT NULL,
`Amount` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`supplier_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `phone`
--
CREATE TABLE `phone` (
`email` varchar(300) NOT NULL,
`phone` varchar(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `phone`
--
INSERT INTO `phone` (`email`, `phone`) VALUES
('laxmisteel@gmail.com', '+9779860427421'),
('yoursgod@outlook.com', '7958739723');
-- --------------------------------------------------------
--
-- Table structure for table `queries`
--
CREATE TABLE `queries` (
`que_id` int(11) NOT NULL,
`u_id` int(11) NOT NULL,
`question` varchar(1000) NOT NULL,
`file` varchar(500) DEFAULT NULL,
`answer_count` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `queries`
--
INSERT INTO `queries` (`que_id`, `u_id`, `question`, `file`, `answer_count`) VALUES
(10, 1, 'What is the best method to collect data?', 'machine.jpg', 1),
(17, 1, 'The world is the planet Earth and all life upon it, including human civilization. In a philosophical context, the world is the whole of the physical Universe, or an ontological world. In a theological context, the world is the material or the profane sphere, as opposed to the celestial, spiritual, transcendent or sacred. The \"end of the ...', NULL, 1),
(18, 1, 'In a philosophical context, the world is the whole of the physical Universe, or an ontological world. In a theological context, the world is the material or the profane sphere, as opposed to the celestial, spiritual, transcendent or sacred. The \"end of the ...', NULL, 1),
(19, 1, 'In a philosophical context, the world is the whole of the physical Universe, or an ontological world. In a theological context, the world is the material or the profane sphere, as opposed to the celestial, spiritual, transcendent or sacred. The \"end of the ...', NULL, 1),
(21, 1, 'hello this is me subash can you help', NULL, 2),
(22, 2, 'Hello i am hari . This is a test?', NULL, 0);
-- --------------------------------------------------------
--
-- Table structure for table `queries_answers`
--
CREATE TABLE `queries_answers` (
`ans_id` int(11) NOT NULL,
`answerer_id` int(11) NOT NULL,
`answer` varchar(1000) NOT NULL,
`file` varchar(100) NOT NULL,
`que_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `queries_answers`
--
INSERT INTO `queries_answers` (`ans_id`, `answerer_id`, `answer`, `file`, `que_id`) VALUES
(4, 1, 'Yes i can if you want <b>yes</b>', '', 21),
(6, 1, 'hello this is me subash', '', 21);
-- --------------------------------------------------------
--
-- Table structure for table `recover_pass`
--
CREATE TABLE `recover_pass` (
`recover_code` varchar(300) NOT NULL,
`email` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `subscribers`
--
CREATE TABLE `subscribers` (
`s_id` int(11) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `subscribers`
--
INSERT INTO `subscribers` (`s_id`, `email`) VALUES
(1, 'me@gmail.com');
-- --------------------------------------------------------
--
-- Table structure for table `suppliers`
--
CREATE TABLE `suppliers` (
`u_id` int(11) NOT NULL,
`pan_no` varchar(50) NOT NULL,
`company_name` varchar(300) NOT NULL,
`company_des` varchar(700) NOT NULL,
`likes` int(11) NOT NULL,
`latitude` varchar(25) NOT NULL,
`longitude` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `suppliers`
--
INSERT INTO `suppliers` (`u_id`, `pan_no`, `company_name`, `company_des`, `likes`, `latitude`, `longitude`) VALUES
(2, '', 'Binit hardware companies nepal', ' a very good hardware company in Nepal ', 0, '27.701904900000002', '85.3229652'),
(3, '', 'Ambe suppliers', 'this is one of the biggest providing company', 0, '', '');
-- --------------------------------------------------------
--
-- Table structure for table `supply_regions`
--
CREATE TABLE `supply_regions` (
`reg_id` int(11) NOT NULL,
`material_id` int(11) NOT NULL,
`supply_region` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `supply_regions`
--
INSERT INTO `supply_regions` (`reg_id`, `material_id`, `supply_region`) VALUES
(1, 8, 'kathmandu'),
(2, 4, 'malika'),
(3, 5, 'on'),
(4, 5, 'on'),
(5, 5, 'on');
-- --------------------------------------------------------
--
-- Table structure for table `temp_usersi`
--
CREATE TABLE `temp_usersi` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`email` varchar(300) NOT NULL,
`phone` varchar(20) NOT NULL,
`pan_no` varchar(50) NOT NULL,
`DOB` date NOT NULL,
`district` varchar(50) NOT NULL,
`metropolitan` varchar(50) NOT NULL,
`oda` int(11) NOT NULL,
`street` varchar(100) NOT NULL,
`estd` date NOT NULL,
`password` varchar(600) NOT NULL,
`cardnum` int(16) NOT NULL,
`cardcode` int(3) NOT NULL,
`esewa` varchar(100) NOT NULL,
`company_name` varchar(300) NOT NULL,
`company_des` varchar(700) NOT NULL,
`confirm_code` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `usersi`
--
CREATE TABLE `usersi` (
`u_id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`email` varchar(300) NOT NULL,
`password` varchar(100) NOT NULL,
`DOB` date NOT NULL,
`citizenship_no` varchar(25) NOT NULL,
`image` varchar(500) NOT NULL,
`website` varchar(300) NOT NULL,
`role` varchar(40) NOT NULL,
`cardnum` int(30) NOT NULL,
`cardcode` int(5) NOT NULL,
`esewa` varchar(100) NOT NULL,
`subscribed` tinyint(1) NOT NULL DEFAULT '0',
`district` varchar(50) NOT NULL,
`metropolitan` varchar(50) NOT NULL,
`oda` int(11) NOT NULL,
`street` varchar(100) NOT NULL,
`committed` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `usersi`
--
INSERT INTO `usersi` (`u_id`, `name`, `email`, `password`, `DOB`, `citizenship_no`, `image`, `website`, `role`, `cardnum`, `cardcode`, `esewa`, `subscribed`, `district`, `metropolitan`, `oda`, `street`, `committed`) VALUES
(1, 'subash sapkota', 'subashsapkota59@gmail.com', 'faf7842dc3b7b128ab40159cd64b9766', '1999-02-23', '214748364755', '7230843722194625784_o.jpg', 'http://subashcs.com.np', 'customers', 0, 0, '', 0, 'Baglung ', 'Baglung', 5, 'Malikaa', 1),
(2, 'Hari kc', 'laxmisteel@gmail.com', '', '2010-07-11', '21474836479434', 'Natural-Language-Processing-Definition-1.jpg', 'http://subashcs.com.np', 'suppliers', 0, 0, '', 0, 'baglung', 'asdfas', 2, 'sakjdfls', 1),
(3, 'ambe cement', 'ambecement@gmail.com', '', '2007-07-19', '797979799', 'ai.jpg', 'http://subashcs.com.np', 'suppliers', 0, 0, '', 0, 'klajsdklasdfjsalkf ', 'asdfas', 2, 'sakjdfls', 1),
(4, 'Ram Shankar Acharya', 'ramshank@gmail.com', 'ram@123', '2007-01-24', '92347927332423', 'ramimage.jpg', 'www.ram.com', 'suppliers', 0, 0, '', 1, '', '', 0, '', 1),
(9, 'subash sapkota', 'yoursgod@outlook.com', '5bab541acd761a3093d7c4202b6e1da9', '2015-07-10', '', '27994730_1131546880315559_1864289533_n.jpg', 'myweb.com', 'customers', 0, 0, '', 0, 'Baglung ', 'Baglung', 5, 'Malika', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
ADD PRIMARY KEY (`u_id`);
--
-- Indexes for table `deleted_items`
--
ALTER TABLE `deleted_items`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `deleted_users`
--
ALTER TABLE `deleted_users`
ADD PRIMARY KEY (`u_id`);
--
-- Indexes for table `deny_reasons`
--
ALTER TABLE `deny_reasons`
ADD PRIMARY KEY (`order_id`);
--
-- Indexes for table `house_arc`
--
ALTER TABLE `house_arc`
ADD PRIMARY KEY (`house_id`);
--
-- Indexes for table `house_arc_likes`
--
ALTER TABLE `house_arc_likes`
ADD PRIMARY KEY (`like_id`),
ADD KEY `user_as_house_liker_fk` (`user_id`),
ADD KEY `house_as_house_fk` (`house_id`);
--
-- Indexes for table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_items_user` (`user_id`);
--
-- Indexes for table `items_like`
--
ALTER TABLE `items_like`
ADD PRIMARY KEY (`like_id`);
--
-- Indexes for table `items_sizes`
--
ALTER TABLE `items_sizes`
ADD PRIMARY KEY (`size_id`),
ADD KEY `fk_item_size` (`material_id`);
--
-- Indexes for table `materials_req`
--
ALTER TABLE `materials_req`
ADD PRIMARY KEY (`material_id`),
ADD KEY `house_material` (`house_id`);
--
-- Indexes for table `notices`
--
ALTER TABLE `notices`
ADD PRIMARY KEY (`n_id`);
--
-- Indexes for table `noticeuser`
--
ALTER TABLE `noticeuser`
ADD PRIMARY KEY (`n_id`,`target_user`),
ADD KEY `target_user_fk` (`target_user`);
--
-- Indexes for table `orders_to_supp`
--
ALTER TABLE `orders_to_supp`
ADD PRIMARY KEY (`order_id`),
ADD KEY `customer_fk` (`request_maker_id`),
ADD KEY `material_fk` (`material_id`) USING BTREE;
--
-- Indexes for table `order_location`
--
ALTER TABLE `order_location`
ADD PRIMARY KEY (`order_id`);
--
-- Indexes for table `phone`
--
ALTER TABLE `phone`
ADD KEY `phone_email_fk` (`email`);
--
-- Indexes for table `queries`
--
ALTER TABLE `queries`
ADD PRIMARY KEY (`que_id`),
ADD KEY `u_id` (`u_id`);
--
-- Indexes for table `queries_answers`
--
ALTER TABLE `queries_answers`
ADD PRIMARY KEY (`ans_id`),
ADD KEY `answerer_user_fk` (`answerer_id`),
ADD KEY `query_ans_fk` (`que_id`);
--
-- Indexes for table `recover_pass`
--
ALTER TABLE `recover_pass`
ADD PRIMARY KEY (`recover_code`);
--
-- Indexes for table `subscribers`
--
ALTER TABLE `subscribers`
ADD PRIMARY KEY (`s_id`),
ADD UNIQUE KEY `email` (`email`);
--
-- Indexes for table `suppliers`
--
ALTER TABLE `suppliers`
ADD UNIQUE KEY `u_id` (`u_id`);
--
-- Indexes for table `supply_regions`
--
ALTER TABLE `supply_regions`
ADD UNIQUE KEY `unique` (`reg_id`);
--
-- Indexes for table `temp_usersi`
--
ALTER TABLE `temp_usersi`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_2` (`id`),
ADD KEY `id` (`id`);
--
-- Indexes for table `usersi`
--
ALTER TABLE `usersi`
ADD PRIMARY KEY (`u_id`),
ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `house_arc`
--
ALTER TABLE `house_arc`
MODIFY `house_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `house_arc_likes`
--
ALTER TABLE `house_arc_likes`
MODIFY `like_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `items_like`
--
ALTER TABLE `items_like`
MODIFY `like_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `items_sizes`
--
ALTER TABLE `items_sizes`
MODIFY `size_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `materials_req`
--
ALTER TABLE `materials_req`
MODIFY `material_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `notices`
--
ALTER TABLE `notices`
MODIFY `n_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `orders_to_supp`
--
ALTER TABLE `orders_to_supp`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `queries`
--
ALTER TABLE `queries`
MODIFY `que_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT for table `queries_answers`
--
ALTER TABLE `queries_answers`
MODIFY `ans_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `subscribers`
--
ALTER TABLE `subscribers`
MODIFY `s_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `supply_regions`
--
ALTER TABLE `supply_regions`
MODIFY `reg_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `temp_usersi`
--
ALTER TABLE `temp_usersi`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usersi`
--
ALTER TABLE `usersi`
MODIFY `u_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
ADD CONSTRAINT `fk_customer_user` FOREIGN KEY (`u_id`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `house_arc_likes`
--
ALTER TABLE `house_arc_likes`
ADD CONSTRAINT `house_as_house_fk` FOREIGN KEY (`house_id`) REFERENCES `house_arc` (`house_id`),
ADD CONSTRAINT `user_as_house_liker_fk` FOREIGN KEY (`user_id`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `items`
--
ALTER TABLE `items`
ADD CONSTRAINT `fk_items_user` FOREIGN KEY (`user_id`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
--
-- Constraints for table `items_sizes`
--
ALTER TABLE `items_sizes`
ADD CONSTRAINT `fk_item_size` FOREIGN KEY (`material_id`) REFERENCES `items` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `materials_req`
--
ALTER TABLE `materials_req`
ADD CONSTRAINT `house_material` FOREIGN KEY (`house_id`) REFERENCES `house_arc` (`house_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `noticeuser`
--
ALTER TABLE `noticeuser`
ADD CONSTRAINT `target_user_fk` FOREIGN KEY (`target_user`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `user_notice_fk` FOREIGN KEY (`n_id`) REFERENCES `notices` (`n_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `orders_to_supp`
--
ALTER TABLE `orders_to_supp`
ADD CONSTRAINT `customer_fk` FOREIGN KEY (`request_maker_id`) REFERENCES `usersi` (`u_id`) ON DELETE NO ACTION ON UPDATE CASCADE;
--
-- Constraints for table `phone`
--
ALTER TABLE `phone`
ADD CONSTRAINT `phone_email_fk` FOREIGN KEY (`email`) REFERENCES `usersi` (`email`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `queries`
--
ALTER TABLE `queries`
ADD CONSTRAINT `queries_ibfk_1` FOREIGN KEY (`u_id`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `queries_answers`
--
ALTER TABLE `queries_answers`
ADD CONSTRAINT `answerer_user_fk` FOREIGN KEY (`answerer_id`) REFERENCES `usersi` (`u_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `query_ans_fk` FOREIGN KEY (`que_id`) REFERENCES `queries` (`que_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `suppliers`
--
ALTER TABLE `suppliers`
ADD CONSTRAINT `supplier_user_fk` FOREIGN KEY (`u_id`) REFERENCES `usersi` (`u_id`);
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 */;
| true |
de95507b57e00b5519501b82d4dc5553168112a8 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day10/select1341.sql | UTF-8 | 265 | 3 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WeMo' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['2228','5219','3026','2011','5100_3','3100_10','6076','5099','4091','4086'])
| true |
8fe51fcc129acb7ff02d948ba3dde5dd47c91dca | SQL | Shimpijain/demo | /demo.sql | UTF-8 | 2,122 | 2.953125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 22, 2021 at 11:03 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.8
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: `demo`
--
-- --------------------------------------------------------
--
-- Table structure for table `image`
--
CREATE TABLE `image` (
`filename` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `image`
--
INSERT INTO `image` (`filename`) VALUES
('WhatsApp Image 2021-09-11 at 18.24.26.jp'),
('photovisi-download (1).jpg'),
('WhatsApp Image 2021-08-08 at 21.33.49.jp'),
('WhatsApp Image 2021-08-08 at 21.35.01 (2'),
('WhatsApp Image 2021-08-08 at 21.31.27 (1'),
('WhatsApp Image 2021-08-29 at 00.07.03.jp');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`Name` varchar(20) NOT NULL,
`Email` varchar(30) NOT NULL,
`Phoneno` int(10) NOT NULL,
`password` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`Name`, `Email`, `Phoneno`, `password`) VALUES
('ravi', 'ravi@gmail.com', 2147483647, 'Ravi1234'),
('Shimpi Jain', 'shi@gmail.com', 2147483647, 'Shimpi8654'),
('Shimpi Jain', 'shimpi@gmail.com', 2147483647, 'Shimpi098'),
('Shimpi Jain', 'shimpij@gmail.com', 2147483647, 'Shimpi98765'),
('Shimpi Jain', 'shimpija@gmail.com', 2147483647, 'Shimpi54637'),
('shimpi jain', 'shimpijain@gmail.com', 2147483647, 'Shimpi1234');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD UNIQUE KEY `Email` (`Email`);
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 */;
| true |
cabcedefe31e7f8d1349483d95cf3a622de8a864 | SQL | NelliBtn/BootcampX | /4_queries/assistance_request_data.sql | UTF-8 | 392 | 3.796875 | 4 | [] | no_license | SELECT teachers.name as teacher,
students.name as student,
assignments.name as assignment,
(completed_at - started_at) as duration
FROM assistance_requests
JOIN students ON students.id = assistance_requests.student_id
JOIN teachers ON teachers.id = assistance_requests.teacher_id
JOIN assignments ON assignments.id = assistance_requests.assignment_id
ORDER BY duration;
| true |
77558d391c3abf06c94c32285a2a8e018310b4f9 | SQL | sejalvijaynaik/swabhav | /SQL/clustered index practice/clustered index practice.sql | UTF-8 | 331 | 3.4375 | 3 | [] | no_license | create table foo(
id int,
description varchar(100)
);
desc foo;
insert into foo(id, description)
values(2, '60'),
(5, '10'),
(3, '20'),
(6, '40'),
(1, '30'),
(4, '50');
select * from foo;
alter table foo
add primary key(id);
--non clustered index maintains insertion order
--clustered index maintains ascending order
| true |
7b74f84dc32bba608fb444e404ab8c1068509af5 | SQL | bitcafe24-byungkwan/sqlpractice | /mariadbSql/webdb190507.sql | UTF-8 | 964 | 3.84375 | 4 | [] | no_license | #outter join
/*insert into department values (null, '총무팀');
insert into department values (null, '인사팀');
insert into department values (null, '개발팀');
insert into department values (null, '영업팀');
*/
select * from department;
/*insert into employee values(null,'둘리',1);
insert into employee values(null,'마이클',2);
insert into employee values(null,'또치',3);
insert into employee values(null,'길동이',null);*/
select * from employee;
# join ~ on (inner join)
select *
from employee a
join department b
on a.department_no = b.no;
# left join (outter join)
select a.name, ifnull(b.name, '없음')
from employee a
left join department b
on a.department_no = b.no;
# right join (outter join)
select ifnull(a.name,'None'), b.name
from employee a
right join department b
on a.department_no = b.no;
# full join (outter join, mysql/mariadb X)
select a.name, b.name
from employee a
full join department b
on a.department_no = b.no; | true |
fa02be65ad04eeb1eaca9827eaff7b72e82ec21a | SQL | LabKey/cnprcEHRModules | /cnprc_ehr/resources/queries/study/Home Location.sql | UTF-8 | 900 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2017-2018 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
SELECT h1.id,
h1.reloc_seq,
h1.room,
h1.cage,
CASE
WHEN h1.cage is null then h1.room
ELSE (h1.room || h1.cage)
END AS Location
FROM study.housing h1
WHERE h1.reloc_seq=(
SELECT
coalesce(max(h2.reloc_seq),0)
FROM study.housing h2
WHERE h1.id = h2.id
AND h2.room NOT LIKE 'HO%') | true |
d7771bc52f20e6b491e8a3aa27a64b2944c3e764 | SQL | waylostreamers/db | /watlostreamspostgresscript.sql | UTF-8 | 7,117 | 3.671875 | 4 | [] | no_license | create table roles
(
role_id serial not null
constraint roles_pk
primary key,
role_description varchar
);
alter table roles
owner to postgres;
create unique index roles_role_id_uindex
on roles (role_id);
create table contributors
(
artist_id integer,
role_id integer,
contributor_id serial not null
constraint contributors_pk
primary key
);
alter table contributors
owner to postgres;
create unique index contributors_contributor_id_uindex
on contributors (contributor_id);
create table genres
(
genre_name varchar,
genre_id serial not null
constraint genres_pk
primary key
);
alter table genres
owner to postgres;
create unique index genres_genre_id_uindex
on genres (genre_id);
create table locations
(
location_id serial not null
constraint locations_pk
primary key,
address_one varchar,
address_two varchar,
country varchar,
zip_code varchar,
city varchar,
coords varchar
);
alter table locations
owner to postgres;
create table users
(
email varchar not null,
user_id serial not null
constraint users_pk
primary key,
first_name varchar not null,
last_name varchar not null,
location integer
constraint users_locations_location_id_fk
references locations
);
alter table users
owner to postgres;
create unique index users_user_id_uindex
on users (user_id);
create table artists
(
artist_id serial not null
constraint artists_pk
primary key,
artwork uuid,
artist_owner integer
constraint artists_users_user_id_fk
references users,
birth_date date,
birth_location integer,
current_location integer,
gender varchar,
nationality varchar,
artist_url varchar,
external_urls character varying[]
);
alter table artists
owner to postgres;
create unique index artists_artist_id_uindex
on artists (artist_id);
create table tracks
(
isrc varchar not null,
title varchar,
track_url varchar,
track_owner integer
constraint tracks_users_user_id_fk
references users,
purchase_cost numeric not null,
stream_cost numeric not null,
purchase_count bigint,
stream_count bigint,
track_credits text,
artwork_id uuid,
genres text,
technical_sound_recording_details text,
track_id serial not null
constraint tracks_pk
primary key
);
alter table tracks
owner to postgres;
create unique index tracks_isrc_uindex
on tracks (isrc);
create unique index tracks_track_id_uindex
on tracks (track_id);
create table albums
(
album_id serial not null
constraint albums_pk
primary key,
upc integer,
title varchar,
release_date date,
upload_date date,
remaster_date date,
start_date_time date,
artwork_id uuid,
purchase_cost numeric,
purchase_count numeric,
label_name varchar,
album_credits text,
available_markets char[],
album_owner integer
constraint albums_users_user_id_fk
references users
);
alter table albums
owner to postgres;
create unique index albums_album_id_uindex
on albums (album_id);
create table rights_agreements
(
agreement_id serial not null
constraint rights_agreements_pk
primary key
constraint rights_agreements_users_user_id_fk
references users,
agreement_name varchar,
agreement_text text,
agreement_url text,
agreement_date date,
agreement_owner integer
);
alter table rights_agreements
owner to postgres;
create unique index rights_agreements_agreement_id_uindex
on rights_agreements (agreement_id);
create unique index locations_location_id_uindex
on locations (location_id);
create table tracks_contributors
(
tracks_contributors_id serial not null
constraint tracks_contributors_pk
primary key
constraint tracks_contributors_contributors_contributor_id_fk
references contributors
constraint tracks_contributors_tracks_track_id_fk
references tracks
);
alter table tracks_contributors
owner to postgres;
create unique index tracks_contributors_tracks_contributors_id_uindex
on tracks_contributors (tracks_contributors_id);
create table albums_contributors
(
albums_contributors_id serial not null
constraint albums_contributors_pk
primary key
constraint albums_contributors_albums_album_id_fk
references albums
constraint albums_contributors_contributors_contributor_id_fk
references contributors
);
alter table albums_contributors
owner to postgres;
create unique index albums_contributors_albums_contributors_id_uindex
on albums_contributors (albums_contributors_id);
create table albums_tracks
(
album_track_id serial not null
constraint albums_tracks_pk
primary key
constraint albums_tracks_albums_album_id_fk
references albums
constraint albums_tracks_tracks_track_id_fk
references tracks
);
alter table albums_tracks
owner to postgres;
create unique index albums_tracks_album_track_id_uindex
on albums_tracks (album_track_id);
create table albums_genres
(
albums_genres_id serial not null
constraint albums_genres_pk
primary key
constraint albums_genres_albums_album_id_fk
references albums
constraint albums_genres_genres_genre_id_fk
references genres
);
alter table albums_genres
owner to postgres;
create unique index albums_genres_albums_genres_id_uindex
on albums_genres (albums_genres_id);
create table tracks_genres
(
tracks_genres_id serial not null
constraint tracks_genres_pk
primary key
constraint tracks_genres_genres_genre_id_fk
references genres
constraint tracks_genres_tracks_track_id_fk
references tracks
);
alter table tracks_genres
owner to postgres;
create unique index tracks_genres_tracks_genres_id_uindex
on tracks_genres (tracks_genres_id);
create table albums_rights_agreements
(
album_rights_agreements_id serial not null
constraint albums_rights_agreements_albums_album_id_fk
references albums
constraint albums_rights_agreements_rights_agreements_agreement_id_fk
references rights_agreements
);
alter table albums_rights_agreements
owner to postgres;
| true |
8d82e218e3f6b52aec0287ad122150dae4800bbc | SQL | KyleMerc/mysql | /intermed_exercise/exercise4_join.sql | UTF-8 | 292 | 4.1875 | 4 | [] | no_license | SELECT DISTINCT employeeNumber, CONCAT(firstName, ' ', lastName) AS employeeName, COUNT(c.customerNumber) AS customerCount
FROM employees e
LEFT JOIN customers c ON c.salesRepEmployeeNumber = e.employeeNumber
WHERE jobTitle = 'Sales Rep'
GROUP BY employeeNumber
ORDER BY customerCount DESC;
| true |
d6a8369c087b991ee2d55c6868af1ff7c6581d77 | SQL | gervasiodbjr/simplechat | /migrate/simplechat_20180418.sql | UTF-8 | 3,802 | 3.1875 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `simplechat` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `simplechat`;
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: simplechat
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `chats`
--
DROP TABLE IF EXISTS `chats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chats` (
`idchar` int(11) NOT NULL AUTO_INCREMENT,
`initialdate` datetime NOT NULL,
`lastupdate` datetime NOT NULL,
PRIMARY KEY (`idchar`,`initialdate`,`lastupdate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `messages`
--
DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messages` (
`idmessage` int(11) NOT NULL AUTO_INCREMENT,
`idchat` int(11) NOT NULL,
`iduser` int(11) NOT NULL,
`idroom` int(11) DEFAULT NULL,
`message` varchar(254) DEFAULT NULL,
`messagedate` datetime DEFAULT NULL,
PRIMARY KEY (`idmessage`),
KEY `fk_messages_chats_idx` (`idchat`),
KEY `fk_messages_users1_idx` (`iduser`),
KEY `fk_messages_rooms1_idx` (`idroom`),
CONSTRAINT `fk_messages_chats` FOREIGN KEY (`idchat`) REFERENCES `chats` (`idchar`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_messages_rooms1` FOREIGN KEY (`idroom`) REFERENCES `rooms` (`idroom`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_messages_users1` FOREIGN KEY (`iduser`) REFERENCES `users` (`iduser`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `rooms`
--
DROP TABLE IF EXISTS `rooms`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rooms` (
`idroom` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`idroom`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`iduser` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`mail` varchar(45) DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
PRIMARY KEY (`iduser`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-04-19 7:55:11
| true |
19a1c2d45321d394a9cf2d11fbcdecb6299446fb | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day28/select2230.sql | UTF-8 | 178 | 2.6875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-27T22:30:00Z' AND timestamp<'2017-11-28T22:30:00Z' AND temperature>=21 AND temperature<=71
| true |
a301f35f0877811cad727cc4c32e1cc8f70e8894 | SQL | nateharrell123/OAHeLP-Database-Project | /Stored Procedures/SP_GetMedicalHistory.sql | UTF-8 | 607 | 3.75 | 4 | [] | no_license | CREATE PROCEDURE [Subject].GetMedicalHistory
@SubjectId INT
AS
SELECT V.Name AS Village, CV.[Date], Cn.Code AS Clinician, BodyTempDegC AS Temp, WeightKG AS Wt, PercentBodyFat AS BodyFat,
HeightCM AS Ht, WBCCount,
IsPregnant, TobaccoUse, AlcoholUse
FROM Clinic.ClinicVisit CV
INNER JOIN Clinic.Clinic C ON CV.ClinicID = C.ClinicID
INNER JOIN Clinic.VillageSite VS ON C.SiteName = VS.SiteName
INNER JOIN [Subject].Village V ON VS.VillageID = V.VillageID
INNER JOIN Clinic.Clinician Cn ON Cn.ClinicianID = CV.ClinicianID
WHERE CV.SubjectID = @SubjectId
ORDER BY CV.[Date] DESC
| true |
7c31bad36aaa8fcfe680da4680a425fa58373e31 | SQL | shengjies/springdemo | /ssmshiro/shiro.sql | UTF-8 | 4,994 | 3.171875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: localhost Database: shiro
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
SET NAMES utf8 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `permission`
--
DROP TABLE IF EXISTS `permission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `permission` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`resource` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permission`
--
LOCK TABLES `permission` WRITE;
/*!40000 ALTER TABLE `permission` DISABLE KEYS */;
INSERT INTO `permission` VALUES (1,'员工新增','user:save'),(2,'员工修改','user:edit'),(3,'员工删除','user:del'),(4,'角色新增','role:save'),(5,'角色修改','role:edit'),(6,'角色删除','role:del'),(7,'员工查询','user:list'),(8,'角色查询','role:list');
/*!40000 ALTER TABLE `permission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role`
--
DROP TABLE IF EXISTS `role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`sn` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role`
--
LOCK TABLES `role` WRITE;
/*!40000 ALTER TABLE `role` DISABLE KEYS */;
INSERT INTO `role` VALUES (1,'角色管理','role'),(2,'员工经理','user');
/*!40000 ALTER TABLE `role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `role_permission`
--
DROP TABLE IF EXISTS `role_permission`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `role_permission` (
`role_id` bigint(20) NOT NULL,
`permission_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `role_permission`
--
LOCK TABLES `role_permission` WRITE;
/*!40000 ALTER TABLE `role_permission` DISABLE KEYS */;
INSERT INTO `role_permission` VALUES (1,4),(1,5),(1,6),(2,1),(2,2),(2,3),(1,8),(2,7);
/*!40000 ALTER TABLE `role_permission` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES (1,'admin','b649682ba1f39837f195b4aaaf24ec5f'),(2,'ajie','69f96904f65dff43bceb2a692f4859e5');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_role`
--
DROP TABLE IF EXISTS `user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `user_role` (
`user_id` bigint(20) NOT NULL,
`role_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_role`
--
LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
INSERT INTO `user_role` VALUES (1,1),(1,2),(2,2);
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping events for database 'shiro'
--
--
-- Dumping routines for database 'shiro'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-07-14 18:17:12
| true |
8b59b1d853657ef800723c70a0a6b29e56798441 | SQL | riyadavis/work | /work.sql | UTF-8 | 4,560 | 3.671875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | create DATABASE work;
create TABLE deliveryAddress(id int PRIMARY KEY AUTO_INCREMENT, customerName varchar(25), customerAddress text, deliveryPincode int,landmark text, mobileNumber varchar(12),deliverTo varchar(10));
CREATE TABLE category(id int PRIMARY KEY AUTO_INCREMENT,category_name varchar(20),product_tag text);
INSERT INTO `category`( `category_name`, `product_tag`) VALUES ('Books','Fiction, non Fiction, Educational books');
INSERT INTO `category`(`category_name`, `product_tag`) VALUES ('Gaming','Gaming consoles, Smart Glasses');
INSERT INTO `category`(`category_name`, `product_tag`) VALUES ('Air Conditioner','Split AC, Inverter AC, Window AC');
CREATE TABLE coupon(id int PRIMARY key AUTO_INCREMENT,coupon_code varchar(8), category_id int, FOREIGN KEY (category_id)REFERENCES category(category_id));
INSERT INTO `coupon`(`coupon_code`, `category_id`) VALUES ('BOX100','1');
INSERT INTO `coupon`(`coupon_code`, `category_id`) VALUES ('GAME500','2');
INSERT INTO `coupon`( `coupon_code`, `category_id`) VALUES ('AC5000','3');
CREATE TABLE product(id int PRIMARY KEY AUTO_INCREMENT, product_name varchar(20), product_image varchar(20), product_price int(10));
INSERT INTO `product`(`product_name`, `product_image`, `product_price`) VALUES ('Mobile','1.jpg','15000');
INSERT INTO `product`(`product_name`, `product_image`, `product_price`) VALUES ('laptop','2.jpg','40000');
create table users(id int PRIMARY KEY AUTO_INCREMENT, mobile varchar(10));
INSERT INTO `users`(`mobile`) VALUES (9456789654);
create TABLE cart(id int PRIMARY KEY AUTO_INCREMENT, user_id int, product_id int, time_stamp timestamp, coupon_code varchar(20), FOREIGN KEY(user_id) REFERENCES users(id), FOREIGN KEY(product_id) REFERENCES product(id));
-- ALTER TABLE `cart` ADD `quantity` INT(5) AFTER `product_id`;
INSERT INTO `category`(`category_name`, `product_tag`) VALUES ('Mobiles', 'mobile , cheap mobiles, HD quality Mobiles');
INSERT INTO `coupon`(`coupon_code`, `category_id`) VALUES ('MOB3000','4');
ALTER table product ADD category_id int;
ALTER TABLE product ADD FOREIGN KEY(category_id) REFERENCES category(id);
UPDATE `product` SET `category_id` = '4' WHERE `product`.`id` = 1; UPDATE `product` SET `category_id` = '2' WHERE `product`.`id` = 2;
ALTER TABLE `cart` ADD `order_id` INT AFTER `coupon_code`;
CREATE table customer_order(id int PRIMARY KEY AUTO_INCREMENT, time_stamp timestamp);
ALTER table customer_order ADD customer_id int ;
ALTER TABLE customer_order ADD FOREIGN KEY(customer_id) REFERENCES users(id);
ALTER TABLE `coupon` ADD `Discount%` VARCHAR(3) NOT NULL AFTER `coupon_code`, ADD `MaxusePC` INT(2) NOT NULL AFTER `Discount%`;
UPDATE `coupon` SET `Discount%` = '20', `MaxusePC` = '2' WHERE `coupon`.`id` = 1; UPDATE `coupon` SET `Discount%` = '30', `MaxusePC` = '2' WHERE `coupon`.`id` = 2; UPDATE `coupon` SET `Discount%` = '10', `MaxusePC` = '2' WHERE `coupon`.`id` = 3; UPDATE `coupon` SET `Discount%` = '15', `MaxusePC` = '2' WHERE `coupon`.`id` = 4;
CREATE table couponSubscription(id int PRIMARY KEY AUTO_INCREMENT,customer_id int, coupon_id int,UseCount int, time_stamp timestamp);
ALTER table couponsubscription ADD FOREIGN KEY(customer_id) REFERENCES customer(id), ADD FOREIGN KEY(coupon_id) REFERENCES coupon(id);
ALTER TABLE `product` ADD `hub_id` INT NOT NULL AFTER `category_id`, ADD `product_tags` VARCHAR(70) NOT NULL AFTER `hub_id`, ADD `max_discount` INT NOT NULL AFTER `product_tags`, ADD `min_discount` INT NOT NULL AFTER `max_discount`;
UPDATE `product` SET `hub_id` = '1', `product_tags` = 'HD quality, Cheap', `max_discount` = '35', `min_discount` = '5' WHERE `product`.`id` = 1; UPDATE `product` SET `hub_id` = '1', `product_tags` = 'HD display, High quality', `max_discount` = '30', `min_discount` = '10' WHERE `product`.`id` = 2;
ALTER TABLE `cart` CHANGE `user_id` `customer_id` INT(11) NULL DEFAULT NULL;
ALTER TABLE `cart` DROP `coupon_code`, DROP `order_id`;
ALTER TABLE `cart` ADD `items_added` TEXT NOT NULL AFTER `customer_id`, ADD `source_id` INT NOT NULL AFTER `items_added`;
drop table cart;
CREATE TABLE cart(id int PRIMARY key AUTO_INCREMENT,customer_id int,items_added text, source_id int,time_stamp timestamp,FOREIGN KEY(customer_id) REFERENCES customer(id));
CREATE TABLE distributor_hub(id int PRIMARY KEY AUTO_INCREMENT,distributor_id int,location_coordinate text,pickup_address text,image text,offer_id int);
ALTER TABLE `distributor_hub` ADD `hub_name` VARCHAR(50) NOT NULL AFTER `distributor_id`;
CREATE TABLE api_table(id int PRIMARY KEY AUTO_INCREMENT,salt char(32), FULLTEXT(salt)); | true |
d437078182839c9b813e941d68bccc29abbc1328 | SQL | YyzHarry/Dynamic_Webpage | /aqi.sql | UTF-8 | 4,293 | 2.984375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: aqidata
-- ------------------------------------------------------
-- Server version 5.7.16-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `aqi_average`
--
DROP TABLE IF EXISTS `aqi_average`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aqi_average` (
`district_id` int(11) NOT NULL,
`district_name` varchar(45) NOT NULL,
`CO` int(11) NOT NULL,
`NO` int(11) NOT NULL,
`SO2` int(11) NOT NULL,
`O3` int(11) NOT NULL,
`PM1` int(11) NOT NULL,
`PM2` int(11) NOT NULL,
`PM10` int(11) NOT NULL,
PRIMARY KEY (`district_id`,`district_name`,`CO`,`NO`,`SO2`,`O3`,`PM1`,`PM2`,`PM10`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `aqi_average`
--
LOCK TABLES `aqi_average` WRITE;
/*!40000 ALTER TABLE `aqi_average` DISABLE KEYS */;
INSERT INTO `aqi_average` VALUES (0,'百讲',12,12,32,312,2,31,1),(1,'二教',4,3,34,4,32,5,23),(2,'南门',3,4,1,2,3,4,3),(3,'西门',5,45,34,567,3,12,21),(4,'图书馆',6,6,4,76,6,6,5),(5,'邱德拔',2,3,4,6,4,6,0),(6,'未名湖',5,4,3,2,1,9,0);
/*!40000 ALTER TABLE `aqi_average` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `aqi_now`
--
DROP TABLE IF EXISTS `aqi_now`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aqi_now` (
`district_id` int(11) NOT NULL,
`district_name` varchar(45) NOT NULL,
`CO` int(11) NOT NULL,
`NO` int(11) NOT NULL,
`SO2` int(11) NOT NULL,
`O3` int(11) NOT NULL,
`PM1` int(11) NOT NULL,
`PM2` int(11) NOT NULL,
`PM10` int(11) NOT NULL,
PRIMARY KEY (`district_id`,`district_name`,`CO`,`NO`,`SO2`,`O3`,`PM1`,`PM2`,`PM10`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `aqi_now`
--
LOCK TABLES `aqi_now` WRITE;
/*!40000 ALTER TABLE `aqi_now` DISABLE KEYS */;
INSERT INTO `aqi_now` VALUES (0,'百讲',0,0,0,0,0,0,0),(1,'二教',1,1,1,1,1,1,1),(2,'南门',2,2,2,2,2,2,2),(3,'西门',3,3,3,3,3,3,3),(4,'图书馆',4,4,4,4,4,4,4),(5,'邱德拔',5,5,5,5,5,5,5),(6,'未名湖',6,6,6,6,6,6,6);
/*!40000 ALTER TABLE `aqi_now` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `repository`
--
DROP TABLE IF EXISTS `repository`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `repository` (
`district_id` int(11) NOT NULL,
`district_name` varchar(45) NOT NULL,
PRIMARY KEY (`district_id`,`district_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `repository`
--
LOCK TABLES `repository` WRITE;
/*!40000 ALTER TABLE `repository` DISABLE KEYS */;
INSERT INTO `repository` VALUES (0,'百讲'),(1,'二教'),(2,'南门'),(3,'西门'),(4,'图书馆'),(5,'邱德拔'),(6,'未名湖');
/*!40000 ALTER TABLE `repository` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-02-08 21:55:30
| true |
e81b3291f9ae67846f9ef348d36c539c3ca82530 | SQL | Arik096/Laravel_8 | /example-app-v0.1/database/test1.sql | UTF-8 | 15,215 | 3.109375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 07, 2021 at 03:46 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `test1`
--
-- --------------------------------------------------------
--
-- Table structure for table `companys`
--
CREATE TABLE `companys` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`staff_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `companys`
--
INSERT INTO `companys` (`id`, `name`, `staff_id`) VALUES
(1, 'Google', 1),
(2, 'MicroSoft', 2),
(3, 'Apple', 4),
(4, 'Google', 3);
-- --------------------------------------------------------
--
-- Table structure for table `devices`
--
CREATE TABLE `devices` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`staff_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `devices`
--
INSERT INTO `devices` (`id`, `name`, `staff_id`) VALUES
(1, 'mobile ', 1),
(2, 'laptop', 1),
(3, 'mobile ', 3),
(4, 'laptop', 3),
(5, 'watch ', 2),
(6, 'camera', 4);
-- --------------------------------------------------------
--
-- Table structure for table `emps`
--
CREATE TABLE `emps` (
`id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL,
`age` varchar(200) DEFAULT NULL,
`address` varchar(200) DEFAULT NULL,
`col1` int(11) NOT NULL DEFAULT 1,
`col2` int(11) NOT NULL DEFAULT 2,
`col3` int(11) NOT NULL DEFAULT 3,
`col4` int(11) NOT NULL DEFAULT 4,
`col5` int(11) NOT NULL DEFAULT 5,
`col6` int(11) NOT NULL DEFAULT 6,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `emps`
--
INSERT INTO `emps` (`id`, `name`, `age`, `address`, `col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `created_at`, `updated_at`) VALUES
(9, 'test', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, '2021-07-01 11:13:45'),
(11, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(12, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(13, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(14, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(15, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(16, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(17, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(18, 'puja my love', '23', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, '2021-07-01 11:14:09'),
(19, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(20, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(21, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(22, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(23, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(24, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(25, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(26, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(27, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(28, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(29, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(30, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(31, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(32, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(33, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(34, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(35, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(36, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(37, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(38, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(39, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(40, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(42, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(43, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(44, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(45, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(46, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(47, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(48, 'puja', '25', 'dsfg', 1, 2, 3, 4, 5, 6, NULL, NULL),
(49, 'arik', '24', 'ssdghd', 1, 2, 3, 4, 5, 6, NULL, NULL),
(54, 'arik last', '24', 'sebanir', 1, 2, 3, 4, 5, 6, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(51, '2021_07_02_140435_create_test7s_table', 1),
(52, '2014_10_12_000000_create_users_table', 2),
(53, '2014_10_12_100000_create_password_resets_table', 2),
(54, '2019_08_19_000000_create_failed_jobs_table', 2),
(55, '2021_07_02_134847_create_tests_table', 2),
(56, '2021_07_02_140211_create_test2s_table', 2),
(57, '2021_07_02_140325_create_test3s_table', 2),
(58, '2021_07_02_140358_create_test4s_table', 2),
(59, '2021_07_02_140409_create_test5s_table', 2),
(60, '2021_07_02_140426_create_test6s_table', 2);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `staffs`
--
CREATE TABLE `staffs` (
`id` int(11) NOT NULL,
`name` varchar(200) NOT NULL,
`email` varchar(200) NOT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `staffs`
--
INSERT INTO `staffs` (`id`, `name`, `email`, `updated_at`, `created_at`) VALUES
(1, 'arik', 'arik@gmail.com', NULL, NULL),
(2, 'puja', 'puja@gmail.com', NULL, NULL),
(3, 'pavel', 'pavel@gmail.com', NULL, NULL),
(4, 'ornob', 'ornob@gmail.com', NULL, NULL),
(5, 'HdZaG7toyz', 'qJE2@gamil.com', NULL, NULL),
(6, 'tz0CO1Gvfz', 'nZsP@gamil.com', NULL, NULL),
(7, 'dGzP8cNQcG', 'xmqr@gamil.com', NULL, NULL),
(8, 'jony sins', 'USA', '2021-07-02 23:04:39', '2021-07-02 23:04:39'),
(9, 'Mr. jony sins', 'USA', '2021-07-02 23:13:05', '2021-07-02 23:13:05'),
(10, 'Mr. jony sins', 'USA', '2021-07-02 23:14:08', '2021-07-02 23:14:08'),
(11, 'Mr. jony sins', 'USA, bd', '2021-07-02 23:15:03', '2021-07-02 23:15:03'),
(12, 'Mr. mr. jony sins', 'USA, bd', '2021-07-02 23:21:26', '2021-07-02 23:21:26'),
(13, 'Mr. mr. jony sins', 'USA, bd', '2021-07-02 23:23:27', '2021-07-02 23:23:27'),
(14, 'mr. jony sins', 'USA, bd', '2021-07-02 23:28:25', '2021-07-02 23:28:25'),
(15, 'mr. jony sins', 'USA', '2021-07-02 23:32:05', '2021-07-02 23:32:05');
-- --------------------------------------------------------
--
-- Table structure for table `test2s`
--
CREATE TABLE `test2s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `test3s`
--
CREATE TABLE `test3s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `test4s`
--
CREATE TABLE `test4s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `test5s`
--
CREATE TABLE `test5s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `test6s`
--
CREATE TABLE `test6s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `test7s`
--
CREATE TABLE `test7s` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `tests`
--
CREATE TABLE `tests` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `companys`
--
ALTER TABLE `companys`
ADD PRIMARY KEY (`id`),
ADD KEY `staff_id` (`staff_id`);
--
-- Indexes for table `devices`
--
ALTER TABLE `devices`
ADD PRIMARY KEY (`id`),
ADD KEY `staff_id` (`staff_id`);
--
-- Indexes for table `emps`
--
ALTER TABLE `emps`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `staffs`
--
ALTER TABLE `staffs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test2s`
--
ALTER TABLE `test2s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test3s`
--
ALTER TABLE `test3s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test4s`
--
ALTER TABLE `test4s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test5s`
--
ALTER TABLE `test5s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test6s`
--
ALTER TABLE `test6s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `test7s`
--
ALTER TABLE `test7s`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tests`
--
ALTER TABLE `tests`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `companys`
--
ALTER TABLE `companys`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `devices`
--
ALTER TABLE `devices`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `emps`
--
ALTER TABLE `emps`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=55;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61;
--
-- AUTO_INCREMENT for table `staffs`
--
ALTER TABLE `staffs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `test2s`
--
ALTER TABLE `test2s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `test3s`
--
ALTER TABLE `test3s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `test4s`
--
ALTER TABLE `test4s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `test5s`
--
ALTER TABLE `test5s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `test6s`
--
ALTER TABLE `test6s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `test7s`
--
ALTER TABLE `test7s`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tests`
--
ALTER TABLE `tests`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `companys`
--
ALTER TABLE `companys`
ADD CONSTRAINT `staff_id` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `devices`
--
ALTER TABLE `devices`
ADD CONSTRAINT `devices_ibfk_1` FOREIGN KEY (`staff_id`) REFERENCES `staffs` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
cdebecf839e8ca9501d3ddfa85acdb7984e0106f | SQL | keroroishappy/sql-example | /finish/college_nddzb.sql | UTF-8 | 2,131 | 2.734375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: 192.168.99.100 Database: college
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
SET NAMES utf8 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `nddzb`
--
DROP TABLE IF EXISTS `nddzb`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `nddzb` (
`起始年份` datetime DEFAULT NULL,
`终止年份` datetime DEFAULT NULL,
`年代` char(6) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `nddzb`
--
LOCK TABLES `nddzb` WRITE;
/*!40000 ALTER TABLE `nddzb` DISABLE KEYS */;
INSERT INTO `nddzb` VALUES ('1996-01-01 00:00:00','1996-12-31 00:00:00','96后'),('1997-01-01 00:00:00','1997-12-31 00:00:00','97后'),('1998-01-01 00:00:00','1998-12-31 00:00:00','98后'),('1999-01-01 00:00:00','1999-12-31 00:00:00','99后'),('2000-01-01 00:00:00','2000-12-31 00:00:00','00后');
/*!40000 ALTER TABLE `nddzb` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
| true |
b6ca08898912fa2981183f18220843b47ee2da7c | SQL | albertomattos/SQL_gerais | /DBA/Tablespace 2 clean.sql | UTF-8 | 2,103 | 3.9375 | 4 | [] | no_license | SELECT t.table_name AS "TABLE_NAME", t.num_rows AS "Rows", t.avg_row_len AS "Avg Row Len", Trunc((t.blocks * p.value)/1024) AS "Size KB",
t.last_analyzed AS "Last Analyzed" FROM dba_tables t, v$parameter p WHERE t.owner = Decode(Upper('ADMWPD'), 'ALL', t.owner, Upper('ADMWPD'))AND
p.name = 'db_block_size' and t.last_analyzed is not null ORDER by 4 desc;
select substr(a.tablespace_name,1,20) "Tablespaces",(b.BYTES/1048576) as "TotalMB",(b.BYTES/1048576)-(c.BYTES/1048576) as "UsedMB",
(c.BYTES/1048576) as "FreeMB" from dba_tablespaces a,(select tablespace_name,sum(bytes) as "BYTES" from dba_data_files
group by tablespace_name ) b, (select tablespace_name,sum(bytes) as "BYTES" from dba_free_space group by tablespace_name) c
where a.tablespace_name = b.tablespace_name(+) and b.tablespace_name = c.tablespace_name(+) order by a.tablespace_name;
--ALTER DATABASE DATAFILE 'H:\oradata\HOMOL\DATAFILE\O1_MF_MEDVINDI_BLDTVJC6_.DBF' RESIZE 20M;
select substr(file_name,1,140) as "FileSystem", sum(bytes)/1024/1024 as "Tamanho(MB)" from dba_data_files
group by rollup(substr(file_name,1,140)) order by substr(file_name,1,140)
select tablespace_name, sum(bytes)/1024/1024 as "TAMANHO(MB)" from dba_free_space group by tablespace_name order by sum(bytes);
select 'alter database datafile ''' || file_name || ''' resize ' || ceil( (nvl(hwm,1)*8192*1.2)/1024/1024 ) || 'm;' cmd
from dba_data_files a,( select file_id, max(block_id+blocks-1) hwm from dba_extents group by file_id ) b
where a.file_id = b.file_id(+) and ceil( (nvl(hwm,1)*8192*1.2)/1024/1024 ) < ceil( blocks*8192/1024/1024)
and ceil( (nvl(hwm,1)*8192*1.2)/1024/1024 ) > 100
--alter database datafile 'H:\ORADATA\PROD\DATAFILE\O1_MF_UNDOTBS1_85S6ND5K_.DBF' resize 2100m;
--alter database datafile 'H:\ORADATA\PROD\DATAFILE\O1_MF_AUXWPD_884C87BH_.DBF' resize 700m;
alter database datafile 'H:\ORADATA\HOMOLOGA\HOMOLOGA\UNDOTBS01.DBF' resize 102m;
--alter database datafile 'H:\ORADATA\HOMOL\DATAFILE\O1_MF_AUXWPD_BLDTNOCW_.DBF' resize 169m;
--alter database datafile 'H:\ORADATA\HOMOL\DATAFILE\O1_MF_WSUSINDI_BLDTVGQF_.DBF' resize 175m; | true |
c840a543a9892b7ab160115f93e2d857fd05d92b | SQL | JorgeDuenasLerin/basesdedatos-dam1 | /apuntes/3/trabajosCreacionTablas/AlquilerCoches_ZahiraZamora_CarlosDominguez/AlquilerCoches_ZahiraZamora_CarlosDominguez/4.sql | ISO-8859-1 | 3,218 | 3.0625 | 3 | [] | no_license | --Base de Datos Alquiler de Coches
--Autor: Zahira Zamora y Carlos Dominguez
--Parte4 Insercion Datos2
--Datos para Mercedes Clase B con
--Matrcula 1234ABC (error enunciado cogemos fecha compra 1/1/2011)
INSERT INTO revisiones_itv
(cod_rev_itv,nbastidor,fecha_prevista)
values (1,'O123456789BCDFTYH',to_date('01/01/2015','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(1,'O123456789BCDFTYH',20000,20000,to_date('01/04/2012','dd/MM/YYYY'));
--Para mantener coherencia aadimos una revision prevista a los 40000 km
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto)
values(2,'O123456789BCDFTYH',40000);
INSERT INTO registro_colores
(cod_color,color,nbastidor,fecha_pintado)
values(5,'verde','O123456789BCDFTYH',to_date('01/06/2011','dd/MM/YYYY'));
--Datos para Renault Fluenze con Matrcula 1111ABC
INSERT INTO revisiones_itv
(cod_rev_itv,nbastidor,fecha_prevista)
values (2,'IJK3456789BCDFTYH',to_date('04/07/2015','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(3,'IJK3456789BCDFTYH',15000,15000,to_date('01/03/2012','dd/MM/YYYY'));
--Para mantener coherencia aadimos una revision prevista a los 30000 km
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto)
values(4,'IJK3456789BCDFTYH',30000);
--Datos para Renault Kangoo con Matrcula 4321ABC
INSERT INTO revisiones_itv
(cod_rev_itv,nbastidor,fecha_prevista)
values (3,'12DFTYHIJK3456789',to_date('01/02/2016','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(5,'12DFTYHIJK3456789',15000,15000,to_date('01/04/2012','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(6,'12DFTYHIJK3456789',30000,30000,to_date('01/10/2012','dd/MM/YYYY'));
--Para mantener coherencia aadimos una revision prevista a los 45000 km
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto)
values(7,'12DFTYHIJK3456789',45000);
--Datos para Renault Modus con Matricula 4210GHT
INSERT INTO revisiones_itv
(cod_rev_itv,nbastidor,fecha_prevista,fecha_realizada)
values (4,'2235678912DFTYHIJ',to_date('03/08/2012','dd/MM/YYYY'),to_date('01/08/2012','dd/MM/YYYY'));
INSERT INTO revisiones_itv
(cod_rev_itv,nbastidor,fecha_prevista)
values (5,'2235678912DFTYHIJ',to_date('01/08/2016','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(8,'2235678912DFTYHIJ',15000,15000,to_date('08/04/2009','dd/MM/YYYY'));
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto,km_realizado,fecha_realizado)
values(9,'2235678912DFTYHIJ',30000,30000,to_date('13/10/2011','dd/MM/YYYY'));
--Para mantener coherencia aadimos una revision prevista a los 45000 km
INSERT INTO revisiones_mant
(cod_rev_mant,nbastidor,km_previsto)
values(10,'2235678912DFTYHIJ',45000);
--Coche Matricula 1111ABC calefactado con cod_acabado = 4
UPDATE acabados SET calefactados=1 WHERE cod_acabado=4; | true |
7442329602cb31d9d723ebcbadd311a60a76cd2d | SQL | syrus-ru/amficom | /AMFICOM/v1/database/schema/measurement/dictionary/modelingtype.sql | UTF-8 | 242 | 2.53125 | 3 | [] | no_license | -- $Id: modelingtype.sql,v 1.2 2005/09/28 10:34:02 arseniy Exp $
CREATE TABLE ModelingType (
code NUMBER(2, 0),
codename VARCHAR2(32 CHAR) NOT NULL,
--
CONSTRAINT modtyp_pk PRIMARY KEY (code),
CONSTRAINT modtyp_uniq UNIQUE (codename)
);
| true |
81b803f31680608ee0f5c8a6c999dd9d5954d1b9 | SQL | kotegawa-arashi/it-automation | /ky_sql_seeds/TABLE_CONFIG/ita_model-l4.sql | UTF-8 | 2,553 | 2.65625 | 3 | [
"LGPL-3.0-only",
"Apache-2.0",
"MIT"
] | permissive | -- *****************************************************************************
-- *** ***** CreateParameterMenu Tables ***
-- *****************************************************************************
CREATE TABLE F_MATERIAL_LINKAGE_TERRAFORM
(
ROW_ID %INT% , -- 識別シーケンス項番
MATERIAL_LINK_NAME %VARCHR%(128) ,
FILE_ID %INT% ,
CLOSE_REVISION_ID %INT% ,
TERRAFORM_MODULE_CHK %INT% , -- Moduleファイル
TERRAFORM_POLICY_CHK %INT% , -- Policyファイル
ACCESS_AUTH TEXT ,
NOTE %VARCHR%(4000) , -- 備考
DISUSE_FLAG %VARCHR%(1) , -- 廃止フラグ
LAST_UPDATE_TIMESTAMP %DATETIME6% , -- 最終更新日時
LAST_UPDATE_USER %INT% , -- 最終更新ユーザ
PRIMARY KEY (ROW_ID)
)%%TABLE_CREATE_OUT_TAIL%%;
CREATE TABLE F_MATERIAL_LINKAGE_TERRAFORM_JNL
(
JOURNAL_SEQ_NO %INT% , -- 履歴用シーケンス
JOURNAL_REG_DATETIME %DATETIME6% , -- 履歴用変更日時
JOURNAL_ACTION_CLASS %VARCHR%(8) , -- 履歴用変更種別
ROW_ID %INT% , -- 識別シーケンス項番
MATERIAL_LINK_NAME %VARCHR%(128) ,
FILE_ID %INT% ,
CLOSE_REVISION_ID %INT% ,
TERRAFORM_MODULE_CHK %INT% , -- Moduleファイル
TERRAFORM_POLICY_CHK %INT% , -- Policyファイル
ACCESS_AUTH TEXT ,
NOTE %VARCHR%(4000) , -- 備考
DISUSE_FLAG %VARCHR%(1) , -- 廃止フラグ
LAST_UPDATE_TIMESTAMP %DATETIME6% , -- 最終更新日時
LAST_UPDATE_USER %INT% , -- 最終更新ユーザ
PRIMARY KEY(JOURNAL_SEQ_NO)
)%%TABLE_CREATE_OUT_TAIL%%;
| true |
e36d30e15a456d5c94c998e74eccfac73984174a | SQL | manuelolmos/products_tracker | /priv/dbs/ptracker.cql | UTF-8 | 270 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | DROP KEYSPACE IF EXISTS ptracker;
CREATE KEYSPACE ptracker WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : '3'} AND durable_writes = true;
CREATE TABLE ptracker.products (
name text PRIMARY KEY,
prize int,
date text,
seller text
);
| true |
8d0ba966fce0a68d7f8599d2fb5403de28a52c22 | SQL | Mihriban-Karakilic/mihribankarakilic | /TeleponeDirectory_SQLQuery.sql | UTF-8 | 563 | 2.703125 | 3 | [] | no_license | create database TeleponeDirectory
use TeleponeDirectory
create table Directory
(
DirectoryId int identity(1,1) primary key,
Firstname nvarchar(max),
LastName nvarchar(max),
EmailAddress nvarchar(max),
Telepone1 nvarchar(max),
Telepone2 nvarchar(max),
Telepone3 nvarchar(max),
FacebookURI nvarchar(max),
TwiterURI nvarchar(max),
YoutubeURI nvarchar(max),
Explanation nvarchar(max)
)
create table UserLogin
(
Id int identity(1,1) primary key,
UserName nvarchar(max),
UserPassword nvarchar(max)
)
insert into UserLogin values ('deneme','1') | true |
d7202002a3691c376dd2b6404d7c87a932dc3df6 | SQL | IliaIliev94/SoftUni-Work | /C# MS SQL/Table Relations Exercise/06. University Database.sql | UTF-8 | 752 | 3.734375 | 4 | [] | no_license | CREATE DATABASE University
CREATE TABLE Majors
(
MajorID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL
)
CREATE TABLE Students
(
StudentID INT PRIMARY KEY,
StudentNumber VARCHAR(20) NOT NULL,
StudentName VARCHAR(50) NOT NULL,
MajorID INT FOREIGN KEY REFERENCES Majors(MajorID)
)
CREATE TABLE Payments
(
PaymentID INT PRIMARY KEY,
PaymentDate DATE NOT NULL,
PaymentAmount DECIMAL(15, 2),
StudentID INT FOREIGN KEY REFERENCES Students(StudentID) NOT NULL
)
CREATE TABLE Subjects
(
SubjectID INT PRIMARY KEY,
SubjectName VARCHAR(50) NOT NULL
)
CREATE TABLE Agenda
(
StudentID INT FOREIGN KEY REFERENCES Students(StudentID),
SubjectID INT FOREIGN KEY REFERENCES Subjects(SubjectID)
CONSTRAINT PK_Agenda PRIMARY KEY (StudentID, SubjectID)
) | true |
e66dc47b487318be24a8cd10a1bc0db1f16daf0d | SQL | jurgenei/SqlXmlAst | /examples/plsql/plsql_procedure_implicit_results1.sql | UTF-8 | 510 | 3.5625 | 4 | [] | no_license | /* procedure returning implicit result
from https://www.oracletutorial.com/plsql-tutorial/oracle-implicit-statement-results/ */
CREATE OR REPLACE PROCEDURE get_customer_by_credit(
min_credit NUMBER
)
AS
c_customers SYS_REFCURSOR;
BEGIN
-- open the cursor
OPEN c_customers FOR
SELECT customer_id, credit_limit, name
FROM customers
WHERE credit_limit > min_credit
ORDER BY credit_limit;
-- return the result set
dbms_sql.return_result(c_customers);
END; | true |
00a40cf137070250b6b63421abc4beacb5edac6f | SQL | reata/sqllineage | /sqllineage/data/tpcds/query23.sql | UTF-8 | 4,338 | 3.296875 | 3 | [
"MIT"
] | permissive | insert into query23
with frequent_ss_items as
(select substr(i_item_desc, 1, 30) itemdesc, i_item_sk item_sk, d_date solddate, count(*) cnt
from store_sales
, date_dim
, item
where ss_sold_date_sk = d_date_sk
and ss_item_sk = i_item_sk
and d_year in (2000, 2000 + 1, 2000 + 2, 2000 + 3)
group by substr(i_item_desc, 1, 30), i_item_sk, d_date
having count(*) > 4),
max_store_sales as
(select max(csales) tpcds_cmax
from (select c_customer_sk, sum(ss_quantity * ss_sales_price) csales
from store_sales
, customer
, date_dim
where ss_customer_sk = c_customer_sk
and ss_sold_date_sk = d_date_sk
and d_year in (2000, 2000 + 1, 2000 + 2, 2000 + 3)
group by c_customer_sk)),
best_ss_customer as
(select c_customer_sk, sum(ss_quantity * ss_sales_price) ssales
from store_sales
, customer
where ss_customer_sk = c_customer_sk
group by c_customer_sk
having sum(ss_quantity * ss_sales_price) > (50 / 100.0) * (select *
from max_store_sales))
select sum(sales)
from (select cs_quantity * cs_list_price sales
from catalog_sales
, date_dim
where d_year = 2000
and d_moy = 2
and cs_sold_date_sk = d_date_sk
and cs_item_sk in (select item_sk from frequent_ss_items)
and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
union all
select ws_quantity * ws_list_price sales
from web_sales
, date_dim
where d_year = 2000
and d_moy = 2
and ws_sold_date_sk = d_date_sk
and ws_item_sk in (select item_sk from frequent_ss_items)
and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer))
limit 100;
with frequent_ss_items as
(select substr(i_item_desc, 1, 30) itemdesc, i_item_sk item_sk, d_date solddate, count(*) cnt
from store_sales
, date_dim
, item
where ss_sold_date_sk = d_date_sk
and ss_item_sk = i_item_sk
and d_year in (2000, 2000 + 1, 2000 + 2, 2000 + 3)
group by substr(i_item_desc, 1, 30), i_item_sk, d_date
having count(*) > 4),
max_store_sales as
(select max(csales) tpcds_cmax
from (select c_customer_sk, sum(ss_quantity * ss_sales_price) csales
from store_sales
, customer
, date_dim
where ss_customer_sk = c_customer_sk
and ss_sold_date_sk = d_date_sk
and d_year in (2000, 2000 + 1, 2000 + 2, 2000 + 3)
group by c_customer_sk)),
best_ss_customer as
(select c_customer_sk, sum(ss_quantity * ss_sales_price) ssales
from store_sales
, customer
where ss_customer_sk = c_customer_sk
group by c_customer_sk
having sum(ss_quantity * ss_sales_price) > (50 / 100.0) * (select *
from max_store_sales))
select c_last_name, c_first_name, sales
from (select c_last_name, c_first_name, sum(cs_quantity * cs_list_price) sales
from catalog_sales
, customer
, date_dim
where d_year = 2000
and d_moy = 2
and cs_sold_date_sk = d_date_sk
and cs_item_sk in (select item_sk from frequent_ss_items)
and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
and cs_bill_customer_sk = c_customer_sk
group by c_last_name, c_first_name
union all
select c_last_name, c_first_name, sum(ws_quantity * ws_list_price) sales
from web_sales
, customer
, date_dim
where d_year = 2000
and d_moy = 2
and ws_sold_date_sk = d_date_sk
and ws_item_sk in (select item_sk from frequent_ss_items)
and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)
and ws_bill_customer_sk = c_customer_sk
group by c_last_name, c_first_name)
order by c_last_name, c_first_name, sales
limit 100;
| true |
1db2b0a32c33c92f0e39afb704f06ae56797efb1 | SQL | Charlotte-Ardaens/dataV2-labs | /module-1/Advanced-mySQL/solutions.sql | UTF-8 | 2,124 | 4.15625 | 4 | [] | no_license | ###CHALLENGE 1
#step1
select ta.title_id as TitleID, ta.au_id as AuthorID, (t.advance*ta.royaltyper/100 ) as 'Advance', (t.price * s.qty * t.royalty / 100 * ta.royaltyper / 100) as 'Sales_Royalties'
from titleauthor ta
left join titles t on t.title_id = ta.title_id
left join sales s on s.title_id =ta.title_id;
#step2
select step1.TitleID, step1.AuthorID, Advance, sum(Sales_Royalties) Total_Royalties
from (select ta.title_id as TitleID, ta.au_id as AuthorID, (t.advance*ta.royaltyper/100 ) as 'Advance', (t.price * s.qty * t.royalty / 100 * ta.royaltyper / 100) as 'Sales_Royalties'
from titleauthor ta
left join titles t on t.title_id = ta.title_id
left join sales s on s.title_id =ta.title_id) step1
group by step1.TitleID, step1.AuthorID, Advance;
;
#step3
select AuthorID, sum(Advance+Total_Royalties)
from (select step1.TitleID, step1.AuthorID, Advance, sum(Sales_Royalties) Total_Royalties
from (select ta.title_id as TitleID, ta.au_id as AuthorID, (t.advance*ta.royaltyper/100 ) as 'Advance', (t.price * s.qty * t.royalty / 100 * ta.royaltyper / 100) as 'Sales_Royalties'
from titleauthor ta
left join titles t on t.title_id = ta.title_id
left join sales s on s.title_id =ta.title_id) step1
group by step1.TitleID, step1.AuthorID, Advance) step2
group by step2.AuthorID
order by 2 desc
limit 3;
###CHALLENGE 2
create temporary table if not exists step1
(select ta.title_id as TitleID, ta.au_id as AuthorID, (t.advance*ta.royaltyper/100 ) as 'Advance', (t.price * s.qty * t.royalty / 100 * ta.royaltyper / 100) as 'Sales_Royalties'
from titleauthor ta
left join titles t on t.title_id = ta.title_id
left join sales s on s.title_id =ta.title_id);
create temporary table if not exists step2
(select step1.TitleID, step1.AuthorID, Advance, sum(Sales_Royalties) Total_Royalties
from step1
group by step1.TitleID, step1.AuthorID, Advance)
;
select AuthorID, sum(Advance+Total_Royalties)
from step2
group by AuthorID
order by 2 desc
limit 3;
###Challenge 3
create table Challenge3
as (select AuthorID, sum(Advance+Total_Royalties) as Total
from step2
group by AuthorID);
| true |
88c23f8c99f5adf4ded4f9bfb674a4540a8ef257 | SQL | seymafirat/CarProject | /RecapProjectDatabase.sql | UTF-8 | 779 | 3.25 | 3 | [] | no_license |
Create Table Car(
CarId int primary key IDENTITY(1,1),
CarName varchar(100) NOT NULL,
BrandId int NOT NULL,
ColorId int NOT NULL,
ModelYear varchar(4) NOT NULL,
DailyPrice int NOT NULL,
Description varchar(100) NOT NULL,
)
Create Table Color(
ColorId int primary key IDENTITY(1,1),
ColorName varchar(50) NOT NULL,
)
Create Table Brand(
BrandId int primary key IDENTITY(1,1),
BrandName varchar(50) NOT NULL,
)
Insert Into Car values('Ford',1,1,2010,60000,'Temizdir');
Insert Into Car values('Opel',2,2,2000,30000,'2.el');
DELETE FROM Car WHERE BrandId =2;
Insert Into Brand values('Porshe');
Insert Into Brand values('Mercedes');
Insert Into Color values('white');
Insert Into Color values('black');
select * from Car
select * from Brand
select * from Color
DROP TABLE Car; | true |
02edae0d01097a8ecb330640fc856bb79d99a741 | SQL | steffchep/yanap | /create_tables.sql | UTF-8 | 939 | 2.9375 | 3 | [] | no_license | CREATE TABLE "sprints" (
"id" BIGINT NOT NULL DEFAULT NULL,
"name" VARCHAR(255) NOT NULL DEFAULT NULL,
"startDate" DATE NOT NULL DEFAULT NULL,
"endDate" DATE NOT NULL DEFAULT NULL,
"status" INT NOT NULL DEFAULT '1',
PRIMARY KEY ("id")
)
;
CREATE TABLE "users" (
"id" BIGINT NOT NULL DEFAULT NULL,
"name" VARCHAR(50) NOT NULL DEFAULT NULL,
"isDeveloper" BIT NOT NULL DEFAULT b'1',
PRIMARY KEY ("id")
)
;
CREATE TABLE "usersbysprint" (
"id" BIGINT NOT NULL DEFAULT NULL,
"userid" BIGINT NOT NULL DEFAULT NULL,
"sprintid" BIGINT NOT NULL DEFAULT NULL,
"day01" INT NOT NULL DEFAULT '0',
"day02" INT NOT NULL DEFAULT '0',
"day03" INT NOT NULL DEFAULT '0',
"day04" INT NOT NULL DEFAULT '0',
"day05" INT NOT NULL DEFAULT '0',
"day06" INT NOT NULL DEFAULT '0',
"day07" INT NOT NULL DEFAULT '0',
"day08" INT NOT NULL DEFAULT '0',
"day09" INT NOT NULL DEFAULT '0',
"day10" INT NOT NULL DEFAULT '0',
PRIMARY KEY ("id")
)
;
| true |
bfa0b1ee4c311df31b98be7ccb23e8a17c5b6dc2 | SQL | armbiant/dropbox-hermes | /db/update_to_046.sql | UTF-8 | 608 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | ALTER TABLE `fates` ADD `for_owner` INT(1) NOT NULL DEFAULT 1 AFTER `follows_id`;
ALTER TABLE `fates` ADD `for_creator` INT(1) NOT NULL DEFAULT 0 AFTER `follows_id`;
ALTER TABLE `labors` ADD `for_owner` INT(1) NOT NULL DEFAULT 1 AFTER `host_id`;
ALTER TABLE `labors` ADD `for_creator` INT(1) NOT NULL DEFAULT 0 AFTER `host_id`;
UPDATE `fates` SET `for_owner`=0 where `id`=2;
UPDATE `fates` SET `for_creator`=1 where `id`=2;
UPDATE `labors` SET `for_owner`=1, `for_creator`=0 where `starting_labor_id` IS NULL;
UPDATE `labors` SET `for_owner`=0, `for_creator`=1 where `starting_labor_id` IS NOT NULL;
| true |
e3439f4db0673e6f87ecd4f16d4addaeeb6ca34c | SQL | gooelg/Jshop_mall | /word/2019-10-09-发货单订单关联表.sql | UTF-8 | 608 | 3.015625 | 3 | [] | no_license | SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for jshop_bill_delivery_order_rel
-- ----------------------------
DROP TABLE IF EXISTS `jshop_bill_delivery_order_rel`;
CREATE TABLE `jshop_bill_delivery_order_rel` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`order_id` varchar(20) DEFAULT NULL COMMENT '订单号',
`delivery_id` varchar(20) DEFAULT NULL COMMENT '发货单号',
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`),
KEY `delivery_id` (`delivery_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发货单订单关联表'; | true |
4858a87c9604eb12f38314a475efcb1dab155c44 | SQL | victorhrvs/projeto-de-banco-de-dados | /docs/procedure/procedure_GetAcessoNotebook.sql | UTF-8 | 535 | 3.421875 | 3 | [] | no_license | CREATE DEFINER=`root`@`localhost` PROCEDURE `GetAcessoNotebook`()
BEGIN
DECLARE total_de_alunos_com_cadastro INT;
DECLARE notebook INT;
SELECT
count(*) into total_de_alunos_com_cadastro
FROM
socioeconomico
order by
renda_per_capita;
SELECT
count(*) into notebook
FROM
notebook;
IF (total_de_alunos_com_cadastro < notebook) then
SELECT "Todos os alunos podem pegar os notebooks";
ELSE
Select * from socioeconomico ORDER BY `socioeconomico`.`renda_per_capita` LIMIT notebook;
END IF;
END | true |
4658e9a0570c66c3f6d28c2d5643dded498fb0da | SQL | kobimac/INFS3202-iFlyEvents | /DB_Script/ifly.sql | UTF-8 | 1,293 | 4.03125 | 4 | [] | no_license | create table event
(
event_id int not null auto_increment
primary key,
event_location_id int not null,
event_date date null,
event_start_time time null,
constraint event_event_id_uindex
unique (event_id)
)
;
create index event_locations_location_id_fk
on event (event_location_id)
;
create table locations
(
location_id int not null auto_increment
primary key,
company_name varchar(255) null,
address1 varchar(255) null,
address2 varchar(255) null,
suburb varchar(255) null,
main_number char(10) null,
postcode char(4) null,
constraint locations_location_id_uindex
unique (location_id)
)
;
alter table event
add constraint event_locations_location_id_fk
foreign key (event_location_id) references locations (location_id)
;
create table permission_level
(
permission_level_id int not null auto_increment
primary key,
level varchar(10) null,
constraint permission_level_permission_level_id_uindex
unique (permission_level_id)
)
;
create table registered_user
(
registered_user_id int not null auto_increment
primary key,
first_name varchar(255) null,
last_name varchar(255) null,
email varchar(255) null,
password varchar(255) null,
username varchar(255) null,
constraint registered_user_registered_user_id_uindex
unique (registered_user_id)
)
;
| true |
211325f7f16d6a0a7bcb4fcfe2fac8c311f207f6 | SQL | ares1060/theFoundation | /_services/Checklist/install/checklist.sql | UTF-8 | 1,675 | 3.140625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 2.11.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 25. Februar 2011 um 23:55
-- Server Version: 5.0.41
-- PHP-Version: 5.2.6
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 */;
--
-- Datenbank: `wedding_gallery`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `pp_checklist`
--
CREATE TABLE `pp_checklist` (
`cl_id` int(11) NOT NULL auto_increment,
`title_de` varchar(255) NOT NULL,
`desc_de` text NOT NULL,
`u_id` int(11) NOT NULL,
`status` int(11) NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`cl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `pp_checklist_item`
--
CREATE TABLE `pp_checklist_item` (
`cli_id` int(11) NOT NULL auto_increment,
`cl_id` int(11) NOT NULL,
`title_de` varchar(255) NOT NULL,
`desc_de` text NOT NULL,
`time` datetime NOT NULL,
`status` int(11) NOT NULL,
PRIMARY KEY (`cli_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `pp_checklist_item_user`
--
CREATE TABLE `pp_checklist_item_user` (
`cli_id` int(11) NOT NULL,
`u_id` int(11) NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`cli_id`,`u_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
| true |
141963d55b9ac5c30b46bc145abc58cea3206857 | SQL | cfoxleyevans/HackSmart14 | /model/sql/db.sql | UTF-8 | 2,541 | 3.25 | 3 | [
"MIT"
] | permissive | # ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.6.15)
# Database: wonder
# Generation Time: 2014-03-07 01:27:45 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table journey_times
# ------------------------------------------------------------
DROP TABLE IF EXISTS `journey_times`;
CREATE TABLE `journey_times` (
`id` int(11) unsigned NOT NULL,
`timestamp` datetime NOT NULL,
`recorded_timestamp` datetime NOT NULL,
`point` point NOT NULL,
`from_point` point NOT NULL,
`to_point` point NOT NULL,
`ideal_time` int(11) DEFAULT NULL,
`historic_time` int(11) DEFAULT NULL,
`estimated_time` int(11) NOT NULL,
`name` varchar(255) NOT NULL DEFAULT '',
`direction` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
SPATIAL KEY `point_index` (`point`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
# Dump of table roadworks
# ------------------------------------------------------------
DROP TABLE IF EXISTS `roadworks`;
CREATE TABLE `roadworks` (
`id` int(11) unsigned NOT NULL,
`timestamp` datetime DEFAULT NULL,
`point` point DEFAULT NULL,
`line` linestring DEFAULT NULL,
`operational_lanes` int(11) DEFAULT NULL,
`restricted_lanes` int(11) DEFAULT NULL,
`start_time` datetime DEFAULT NULL,
`end_time` datetime DEFAULT NULL,
`comment` text,
`impact` text,
`delay_time` int(11) DEFAULT NULL,
`occurence_probability` text,
`road_maintenance_type` text,
`subject_type_of_works` text,
`recorded_time` datetime DEFAULT NULL,
`direction` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
89c70c730f7f9a568f6d1d7dec3a16fd020ce9c3 | SQL | jaimeirazabal1/productos_espera | /productos_espera_cesar (2).sql | UTF-8 | 23,601 | 3 | 3 | [
"BSD-3-Clause"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-04-2016 a las 10:52:01
-- Versión del servidor: 10.1.9-MariaDB
-- Versión de PHP: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `productos_espera_cesar`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `estado`
--
CREATE TABLE `estado` (
`id` int(11) NOT NULL,
`nombre` varchar(150) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `estado`
--
INSERT INTO `estado` (`id`, `nombre`) VALUES
(1, 'Estado 1'),
(2, 'Estado 2'),
(3, 'Estado 3');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `locations`
--
CREATE TABLE `locations` (
`loccode` varchar(5) NOT NULL DEFAULT '',
`locationname` varchar(50) NOT NULL DEFAULT '',
`deladd1` varchar(40) NOT NULL DEFAULT '',
`deladd2` varchar(40) NOT NULL DEFAULT '',
`deladd3` varchar(40) NOT NULL DEFAULT '',
`deladd4` varchar(40) NOT NULL DEFAULT '',
`deladd5` varchar(20) NOT NULL DEFAULT '',
`deladd6` varchar(15) NOT NULL DEFAULT '',
`tel` varchar(30) NOT NULL DEFAULT '',
`fax` varchar(30) NOT NULL DEFAULT '',
`email` varchar(55) NOT NULL DEFAULT '',
`contact` varchar(30) NOT NULL DEFAULT '',
`taxprovinceid` tinyint(4) NOT NULL DEFAULT '1',
`cashsalecustomer` varchar(21) NOT NULL,
`managed` int(11) DEFAULT '0',
`currabrev` char(3) NOT NULL,
`branchcode` varchar(20) NOT NULL,
`rebatemin` decimal(9,3) DEFAULT '0.000',
`rebatemax` decimal(9,3) DEFAULT '0.000',
`codigo` varchar(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `locations`
--
INSERT INTO `locations` (`loccode`, `locationname`, `deladd1`, `deladd2`, `deladd3`, `deladd4`, `deladd5`, `deladd6`, `tel`, `fax`, `email`, `contact`, `taxprovinceid`, `cashsalecustomer`, `managed`, `currabrev`, `branchcode`, `rebatemin`, `rebatemax`, `codigo`) VALUES
('BEJ', 'VZLA BEJUMA', 'Av. Vzla, Edf. Icono, Piso 3,Ofc 302', 'Pueblo Nuevo San Antonio', 'Estado Tachira', 'Venezuela', '', '', '04243586338', '', 'ventas_snt@tumotopartes.com', 'Cesar Quintero', 1, '0022-0022', 0, 'VEF', 'J317624831', '0.000', '0.000', '03'),
('CUC', 'COL CUCUTA', 'Autopista Internacional', 'Numero 11-227', 'La Parada', 'Norte de Santander', 'Colombia', '', '005775709546', '', 'ventas_cucuta@tumotopartes.com', 'David Rojas', 3, '0004-0004', 0, 'COP', 'J313303232', '0.000', '0.000', '05'),
('MCY', 'VZLA SANTA ROSA', 'Calle San Miguel, numero 62', 'Santa Rosa', 'Maracay', 'Aragua', '', '', '0243 2465997', '', 'ventas_maracay@tumotopartes.com', 'Alvaro Diaz', 1, '0003-0003', 0, 'VEF', 'J313303232', '10.000', '30.000', '06'),
('MRD', 'VZLA MIRANDA', ' ', '', '', '', '', '', '', '', '', '', 1, '0015-0015', 0, 'VEF', '', '0.000', '0.000', '04'),
('MTB', 'VZLA MONTALBAN', ' ', '', '', '', '', '', '', '', '', '', 1, '0021-0021', 0, 'VEF', '', '0.000', '0.000', '02'),
('SMN', 'VZLA LOS SAMANES', '', 'Los Samanes', 'Valencia', 'Carabobo', 'Venezuela', '', '02432450759', '', 'ventas_empire@tumotopartes.com', 'Ruben Sandia', 1, '0023-0023', 0, 'VEF', 'J313303232', '0.000', '0.000', '08'),
('SNC', 'VZLA SAN CRISTOBAL', 'Cesar Quintero', '', '', '', '', '', '', '', '', '', 1, '', 0, 'VEF', 'J317624831', '0.000', '0.000', '07'),
('VEN', 'VZLA SAN VICENTE', ' Calle San Miguel, #62, ', 'Santa Rosa', 'Maracay', 'Aragua', 'Venezuela', '', '02432465997', '02432465997', 'atencion@tumotopartes.com', 'Yonathan Angel', 1, '0002-0002', 0, 'VEF', 'J317624831', '0.000', '0.000', '01');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `locstock`
--
CREATE TABLE `locstock` (
`loccode` varchar(5) NOT NULL DEFAULT '',
`stockid` varchar(20) NOT NULL DEFAULT '',
`quantity` double NOT NULL DEFAULT '0',
`reorderlevel` bigint(20) NOT NULL DEFAULT '1',
`location` varchar(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `locstock`
--
INSERT INTO `locstock` (`loccode`, `stockid`, `quantity`, `reorderlevel`, `location`) VALUES
('BEJ', '100-000', 0, 1, ''),
('BEJ', '100-001', 0, 1, ''),
('BEJ', '100-002', 0, 1, ''),
('BEJ', '100-003', 0, 1, ''),
('BEJ', '100-140', 0, 1, ''),
('BEJ', '100-145', 0, 1, ''),
('BEJ', '100-258', 0, 1, ''),
('BEJ', '100-336', 0, 1, ''),
('BEJ', '100-411', 5, 2, '08H'),
('BEJ', '100-421', 0, 1, ''),
('BEJ', '100-425', 2, 2, '08H'),
('BEJ', '100-632', 2, 2, '12C'),
('BEJ', '100-635', 0, 1, '13D'),
('BEJ', '100-663', 0, 1, ''),
('CUC', '100-000', 0, 1, ''),
('CUC', '100-001', 0, 1, ''),
('CUC', '100-002', 0, 1, ''),
('CUC', '100-003', 0, 1, ''),
('CUC', '100-140', 0, 1, ''),
('CUC', '100-145', 0, 1, ''),
('CUC', '100-258', 0, 1, ''),
('CUC', '100-336', 0, 1, ''),
('CUC', '100-411', 0, 1, ''),
('CUC', '100-421', 0, 1, ''),
('CUC', '100-425', 0, 1, ''),
('CUC', '100-632', 0, 1, ''),
('CUC', '100-635', 0, 1, ''),
('CUC', '100-663', 0, 1, ''),
('MCY', '100-000', 0, 1, ''),
('MCY', '100-001', 0, 1, ''),
('MCY', '100-002', 0, 1, ''),
('MCY', '100-003', 0, 1, '01G'),
('MCY', '100-140', 0, 1, ''),
('MCY', '100-145', 0, 1, ''),
('MCY', '100-258', 0, 1, '10J'),
('MCY', '100-336', 0, 1, ''),
('MCY', '100-411', 0, 1, '17E'),
('MCY', '100-421', 0, 1, ''),
('MCY', '100-425', 0, 1, '18D'),
('MCY', '100-632', 0, 1, '06B'),
('MCY', '100-635', 0, 1, ''),
('MCY', '100-663', 0, 1, ''),
('MRD', '100-000', 0, 1, ''),
('MRD', '100-001', 0, 1, ''),
('MRD', '100-002', 0, 1, ''),
('MRD', '100-003', 0, 1, ''),
('MRD', '100-140', 0, 1, ''),
('MRD', '100-145', 0, 1, ''),
('MRD', '100-258', 0, 1, ''),
('MRD', '100-336', 0, 1, ''),
('MRD', '100-411', 8, 2, '08C'),
('MRD', '100-421', 0, 1, ''),
('MRD', '100-425', 3, 2, '08C'),
('MRD', '100-632', 5, 2, '08G'),
('MRD', '100-635', 1, 1, '12F'),
('MRD', '100-663', 0, 1, ''),
('MTB', '100-000', 0, 1, ''),
('MTB', '100-001', 0, 1, ''),
('MTB', '100-002', 0, 1, ''),
('MTB', '100-003', 0, 1, ''),
('MTB', '100-140', 0, 1, ''),
('MTB', '100-145', 0, 1, ''),
('MTB', '100-258', 0, 1, ''),
('MTB', '100-336', 0, 1, ''),
('MTB', '100-411', 5, 2, '07A'),
('MTB', '100-421', 0, 1, ''),
('MTB', '100-425', 4, 2, '07A'),
('MTB', '100-632', 5, 2, '07D'),
('MTB', '100-635', 1, 1, '07E'),
('MTB', '100-663', 0, 1, ''),
('SMN', '100-000', 0, 1, ''),
('SMN', '100-001', 0, 1, ''),
('SMN', '100-002', 0, 1, ''),
('SMN', '100-003', 0, 1, ''),
('SMN', '100-140', 0, 1, ''),
('SMN', '100-145', 0, 1, ''),
('SMN', '100-258', 0, 1, ''),
('SMN', '100-336', 0, 1, ''),
('SMN', '100-411', 5, 2, '02D'),
('SMN', '100-421', 0, 1, ''),
('SMN', '100-425', 2, 2, '02D'),
('SMN', '100-632', 2, 2, '02D'),
('SMN', '100-635', 0, 1, ''),
('SMN', '100-663', 0, 1, ''),
('SNC', '100-000', 0, 1, ''),
('SNC', '100-001', 0, 1, ''),
('SNC', '100-002', 0, 1, ''),
('SNC', '100-003', 0, 1, ''),
('SNC', '100-140', 0, 1, ''),
('SNC', '100-145', 0, 1, ''),
('SNC', '100-258', 0, 1, ''),
('SNC', '100-336', 0, 1, ''),
('SNC', '100-411', 0, 1, ''),
('SNC', '100-421', 0, 1, ''),
('SNC', '100-425', 0, 1, ''),
('SNC', '100-632', 0, 1, ''),
('SNC', '100-635', 0, 1, ''),
('SNC', '100-663', 0, 1, ''),
('VEN', '100-000', 0, 1, ''),
('VEN', '100-001', 0, 1, ''),
('VEN', '100-002', 0, 1, ''),
('VEN', '100-003', 0, 1, ''),
('VEN', '100-140', 0, 1, ''),
('VEN', '100-145', 0, 1, ''),
('VEN', '100-258', 0, 1, ''),
('VEN', '100-336', 0, 1, ''),
('VEN', '100-411', 10, 1, '51A'),
('VEN', '100-421', 0, 1, ''),
('VEN', '100-425', 33, 1, '06H'),
('VEN', '100-632', 26, 1, '08C'),
('VEN', '100-635', 0, 1, '66D'),
('VEN', '100-663', 0, 1, '');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `productos_espera`
--
CREATE TABLE `productos_espera` (
`id` int(11) NOT NULL,
`producto` varchar(10) NOT NULL,
`nombre_producto` varchar(200) NOT NULL,
`sucursal` varchar(10) NOT NULL,
`cliente` varchar(200) NOT NULL,
`telefono` varchar(100) NOT NULL,
`estado_id` int(11) DEFAULT NULL,
`fecha` datetime NOT NULL,
`observacion` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `productos_espera`
--
INSERT INTO `productos_espera` (`id`, `producto`, `nombre_producto`, `sucursal`, `cliente`, `telefono`, `estado_id`, `fecha`, `observacion`) VALUES
(1, '100-000', 'Cadena 428x104 Generica', 'BEJ', 'Jaime Irazabal', '04143299925', 1, '2016-04-02 02:47:58', NULL),
(2, '100-000', 'Cadena 428x104 Generica', 'BEJ', 'Jaime Irazabal', '04143299925', 2, '2016-04-02 02:47:58', NULL),
(3, '100-411', 'Swichera Jaguar Tanque Grande (Kit)', 'BEJ', 'Jonas Aponte', '123456789', NULL, '2016-04-02 03:47:00', NULL),
(4, '100-632', 'SWICHERA LEON GN125 (Kit)', 'MCY', 'Cesar', '48985615', 3, '2016-04-02 03:47:00', NULL),
(5, '100-145', 'Swichera HORSE MODELO NUEVO (Kit)', 'MTB', 'Armando Reveron', '987654321', NULL, '2016-04-02 04:40:28', NULL),
(6, '100-411', 'Swichera Jaguar Tanque Grande (Kit)', 'BEJ', 'Rafael Campos', '951891131', 2, '2016-04-02 04:44:37', 'observacion');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `stockmaster`
--
CREATE TABLE `stockmaster` (
`stockid` varchar(20) NOT NULL DEFAULT '',
`categoryid` varchar(6) NOT NULL DEFAULT '',
`description` varchar(50) NOT NULL DEFAULT '',
`longdescription` text NOT NULL,
`units` varchar(20) NOT NULL DEFAULT 'each',
`mbflag` char(1) NOT NULL DEFAULT 'B',
`lastcurcostdate` date NOT NULL DEFAULT '1800-01-01',
`actualcost` decimal(20,4) NOT NULL DEFAULT '0.0000',
`lastcost` decimal(20,4) NOT NULL DEFAULT '0.0000',
`materialcost` decimal(20,4) NOT NULL DEFAULT '0.0000',
`labourcost` decimal(20,4) NOT NULL DEFAULT '0.0000',
`overheadcost` decimal(20,4) NOT NULL DEFAULT '0.0000',
`lowestlevel` smallint(6) NOT NULL DEFAULT '0',
`discontinued` tinyint(4) NOT NULL DEFAULT '0',
`controlled` tinyint(4) NOT NULL DEFAULT '0',
`eoq` double NOT NULL DEFAULT '0',
`volume` decimal(20,4) NOT NULL DEFAULT '0.0000',
`kgs` decimal(20,4) NOT NULL DEFAULT '0.0000',
`barcode` varchar(50) NOT NULL DEFAULT '',
`discountcategory` char(2) NOT NULL DEFAULT '',
`taxcatid` tinyint(4) NOT NULL DEFAULT '1',
`serialised` tinyint(4) NOT NULL DEFAULT '0',
`appendfile` varchar(40) NOT NULL DEFAULT 'none',
`perishable` tinyint(1) NOT NULL DEFAULT '0',
`decimalplaces` tinyint(4) NOT NULL DEFAULT '0',
`pansize` double NOT NULL DEFAULT '0',
`shrinkfactor` double NOT NULL DEFAULT '0',
`nextserialno` bigint(20) NOT NULL DEFAULT '0',
`netweight` decimal(20,4) NOT NULL DEFAULT '0.0000',
`location` varchar(20) NOT NULL,
`minimo` double NOT NULL DEFAULT '3',
`lastcostrate` decimal(20,4) NOT NULL DEFAULT '0.0000',
`price01` decimal(20,4) NOT NULL DEFAULT '0.0000',
`price02` decimal(20,4) NOT NULL DEFAULT '0.0000',
`price03` decimal(20,4) NOT NULL DEFAULT '0.0000',
`available` tinyint(1) NOT NULL DEFAULT '0',
`offers` tinyint(1) NOT NULL DEFAULT '1',
`descriptionUS` varchar(50) DEFAULT NULL,
`longdescriptionUS` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `stockmaster`
--
INSERT INTO `stockmaster` (`stockid`, `categoryid`, `description`, `longdescription`, `units`, `mbflag`, `lastcurcostdate`, `actualcost`, `lastcost`, `materialcost`, `labourcost`, `overheadcost`, `lowestlevel`, `discontinued`, `controlled`, `eoq`, `volume`, `kgs`, `barcode`, `discountcategory`, `taxcatid`, `serialised`, `appendfile`, `perishable`, `decimalplaces`, `pansize`, `shrinkfactor`, `nextserialno`, `netweight`, `location`, `minimo`, `lastcostrate`, `price01`, `price02`, `price03`, `available`, `offers`, `descriptionUS`, `longdescriptionUS`) VALUES
('100-000', '0000', 'Cadena 428x104 Generica', '100-000 Cadena 428x104 Generica', 'each', 'B', '1800-01-01', '0.0000', '0.0000', '2.9920', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '9.0000', '30.2524', '26.8911', '0.0000', 0, 0, NULL, NULL),
('100-001', '0000', 'Asiento CG125 Negro (Aplica Jaguar)', '100-001 Asiento CG125 Negro (Aplica Jaguar) GY1', 'each', 'B', '1800-01-01', '0.0000', '0.0000', '7.1431', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '9.0000', '72.2249', '64.1999', '0.0000', 0, 0, NULL, NULL),
('100-002', '0000', 'Candado Disco Pin Pequeño', '100-002 Candado Disco Pin Pequeño', 'each', 'B', '2012-10-23', '0.0000', '0.8602', '1.2526', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '15.5700', '7.3211', '6.5077', '0.0000', 0, 0, NULL, NULL),
('100-003', '0000', 'Asiento GN125 Jacobs', '100-003 Asiento GN125 Jacobs', 'each', 'B', '2012-09-07', '0.0000', '0.0000', '13.4953', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '14.8200', '82.8658', '73.6584', '0.0000', 1, 0, NULL, NULL),
('100-145', '0000', 'Swichera HORSE MODELO NUEVO (Kit)', '100-145 Swichera HORSE MODELO NUEVO (Kit)', 'Kit', 'B', '2011-01-08', '0.0000', '7.5556', '6.0445', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '9.0000', '61.1164', '54.3257', '0.0000', 0, 0, NULL, NULL),
('100-258', '0000', 'Swichera AX100 (Kit)', '100-258 Swichera AX100 (Kit)', 'each', 'B', '2014-07-10', '0.0000', '18.9367', '2.9760', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '1.0000', '153.1769', '136.1572', '0.0000', 0, 0, NULL, NULL),
('100-336', '0000', 'Swichera (Kit) Horse', '100-336 Swichera (Kit) Horse Horse H1R', 'Pza', 'B', '2011-01-08', '4.8011', '5.7871', '5.1555', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '9.0000', '52.1280', '46.3360', '0.0000', 0, 0, NULL, NULL),
('100-411', '0000', 'Swichera Jaguar Tanque Grande (Kit)', '100-411 18200000-130 Swichera Jaguar Tanque Grande (Kit)', 'Kit', 'B', '2013-08-23', '3.0000', '11.4033', '7.7705', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '30.0000', '23.5705', '20.9515', '0.0000', 1, 0, NULL, NULL),
('100-421', '0000', 'Swichera Jaguar Tanque Pequeño (Kit)', '100-421 KIT-SWICH-00 Swichera Jaguar Tanque Pequeño (Kit)', 'Kit', 'B', '2011-01-08', '5.2067', '3.0978', '2.4782', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '9.0000', '25.0578', '22.2736', '0.0000', 0, 0, NULL, NULL),
('100-425', '0000', 'Swichera Horse (Kit)', '100-425 Swichera Horse (Kit)', 'Pza', 'B', '2014-09-22', '0.0000', '5.1908', '4.3830', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '0', '0', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '1.0000', '15.2065', '13.5169', '0.0000', 1, 1, NULL, NULL),
('100-632', '0000', 'SWICHERA LEON GN125 (Kit)', '100-632 SWICHERA LEON GN125 (Kit)', 'Kit', 'B', '2015-10-26', '0.0000', '3.9172', '3.7562', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '1.0000', '56.1984', '49.9541', '0.0000', 1, 0, 'LEON SWICHERA GN125 (Kit )', '100-632 LEON SWICHERA GN125 (Kit )'),
('100-635', '0000', 'Kit Swichera Matrix', '100-635 KIT SWICHERA Scooter 150 GY6', 'Pza', 'B', '2015-10-05', '9.4444', '3.2291', '2.9993', '0.0000', '0.0000', 0, 0, 0, 0, '0.0000', '0.0000', '', '', 1, 0, '0', 1, 0, 0, 0, 0, '0.0000', '', 3, '1.0000', '68.7556', '61.1160', '0.0000', 0, 0, NULL, NULL);
--
-- Disparadores `stockmaster`
--
DELIMITER $$
CREATE TRIGGER `stockmaster_AFTER_INSERT` AFTER INSERT ON `stockmaster` FOR EACH ROW begin
insert into tum12607_pretashop1609.ps_product (id_supplier,id_manufacturer,id_category_default,id_shop_default,id_tax_rules_group,on_sale,online_only,ean13,upc,ecotax,quantity,minimal_quantity,price,wholesale_price,unity,unit_price_ratio,additional_shipping_cost,reference,supplier_reference,location,width,height,depth,weight,out_of_stock,quantity_discount,customizable,uploadable_files,text_fields,active,redirect_type,id_product_redirected,available_for_order,available_date,`condition`,show_price,indexed,visibility,cache_is_pack,cache_has_attachments,is_virtual,cache_default_attribute,date_add,date_upd,advanced_stock_management) values (0,0,2,1,1,0,0,'','',0.000000,0,1,0.000000,0.000000,'',0.000000,0.00, new.stockid,'','',0.000000,0.000000,0.000000,0.000000,2,0,0,0,0,1,404,0,1,'0000-00-00','new',1,1,'both',0,0,0,0,NOW(),NOW(),0);
SET @id_product = (SELECT id_product FROM tum12607_pretashop1609.ps_product ORDER BY id_product DESC LIMIT 1);
SET @descripcion_nueva = lower(new.description);
SET @descripcion_nueva = replace(@descripcion_nueva, 'ñ','n');
SET @descripcion_nueva = replace(@descripcion_nueva, 'á','a');
SET @descripcion_nueva = replace(@descripcion_nueva, 'ó','o');
SET @descripcion_nueva = replace(@descripcion_nueva, 'í','i');
SET @descripcion_nueva = replace(@descripcion_nueva, 'ú','u');
SET @descripcion_nueva = replace(@descripcion_nueva, 'é','e');
SET @descripcion_nueva = replace(@descripcion_nueva, 'ú','u');
SET @descripcion_nueva = replace(@descripcion_nueva, '/','');
SET @descripcion_nueva = replace(@descripcion_nueva, '(','');
SET @descripcion_nueva = replace(@descripcion_nueva, ')','');
SET @descripcion_nueva = replace(@descripcion_nueva, ',','');
SET @descripcion_nueva = replace(@descripcion_nueva, ';','');
SET @descripcion_nueva = replace(@descripcion_nueva, '"','');
SET @descripcion_nueva = replace(@descripcion_nueva, '"','');
SET @descripcion_nueva = replace(@descripcion_nueva, '&','');
SET @descripcion_nueva = replace(@descripcion_nueva, '*','');
SET @descripcion_nueva = replace(@descripcion_nueva, '+','');
SET @descripcion_nueva = replace(@descripcion_nueva, '^','');
SET @descripcion_nueva = replace(@descripcion_nueva, '#','');
SET @descripcion_nueva = replace(@descripcion_nueva, '@','');
SET @descripcion_nueva = replace(@descripcion_nueva, '!','');
SET @descripcion_nueva = replace(@descripcion_nueva, '~','');
SET @descripcion_nueva = replace(@descripcion_nueva, '`','');
SET @descripcion_nueva = replace(@descripcion_nueva, '_','');
SET @descripcion_nueva = replace(@descripcion_nueva, '>','');
SET @descripcion_nueva = replace(@descripcion_nueva, '<','');
SET @descripcion_nueva = replace(@descripcion_nueva, '=','');
SET @descripcion_nueva = replace(@descripcion_nueva, '[','');
SET @descripcion_nueva = replace(@descripcion_nueva, ']','');
SET @descripcion_nueva = replace(@descripcion_nueva, '{','');
SET @descripcion_nueva = replace(@descripcion_nueva, '}','');
SET @descripcion_nueva = replace(@descripcion_nueva, '|','');
SET @descripcion_nueva_long = lower(new.longdescription);
SET @descripcion_nueva_long = replace(@descripcion_nueva_long, '"','');
SET @descripcion_nueva_longUS = lower(new.longdescriptionUS);
SET @descripcion_nueva_longUS = replace(@descripcion_nueva_longUS, '"','');
SET @descripcion_nuevaUS = lower(new.descriptionUS);
SET @descripcion_nuevaUS = replace(@descripcion_nuevaUS, '"','');
insert into tum12607_pretashop1609.ps_product_lang (id_product,id_shop,id_lang,description,description_short,link_rewrite,meta_description,meta_keywords,meta_title,`name`,available_now,available_later)
values (@id_product,1,1,new.description,@descripcion_nueva_long,replace(@descripcion_nueva,' ','-'),'','','',@descripcion_nueva,'','');
insert into tum12607_pretashop1609.ps_product_lang (id_product,id_shop,id_lang,description,description_short,link_rewrite,meta_description,meta_keywords,meta_title,`name`,available_now,available_later)
values (@id_product,1,2,@descripcion_nuevaUS,@descripcion_nueva_longUS,replace(@descripcion_nueva,' ','-'),'','','',@descripcion_nueva,'','');
insert into tum12607_pretashop1609.ps_product_lang (id_product,id_shop,id_lang,description,description_short,link_rewrite,meta_description,meta_keywords,meta_title,`name`,available_now,available_later)
values (@id_product,1,3,new.description,@descripcion_nueva_long,replace(@descripcion_nueva,' ','-'),'','','',@descripcion_nueva,'','');
insert into tum12607_pretashop1609.ps_product_lang (id_product,id_shop,id_lang,description,description_short,link_rewrite,meta_description,meta_keywords,meta_title,`name`,available_now,available_later)
values (@id_product,1,4,@descripcion_nueva,@descripcion_nueva_long,replace(@descripcion_nueva,' ','-'),'','','',@descripcion_nueva,'','');
insert into tum12607_pretashop1609.ps_product_lang (id_product,id_shop,id_lang,description,description_short,link_rewrite,meta_description,meta_keywords,meta_title,`name`,available_now,available_later)
values (@id_product,1,5,new.description,@descripcion_nueva_long,replace(@descripcion_nueva,' ','-'),'','','',@descripcion_nueva,'','');
insert into tum12607_pretashop1609.ps_product_shop (id_product,id_shop,id_category_default,id_tax_rules_group,on_sale,online_only,ecotax,minimal_quantity,price,wholesale_price,unity,unit_price_ratio,additional_shipping_cost,customizable,uploadable_files,text_fields,active,redirect_type,id_product_redirected,available_for_order,available_date,`condition`,show_price,indexed,visibility,cache_default_attribute,advanced_stock_management,date_add,date_upd) values (@id_product,1,2,1,0,0,0.000000,1,0.000000,0.000000,'',0.000000,0.00,0,0,0,1,404,0,1,'0000-00-00','new',1,1,'both',0,0,now(),now());
insert into tum12607_pretashop1609.ps_stock_available (id_product,id_product_attribute,id_shop,id_shop_group,quantity,depends_on_stock,out_of_stock) values (@id_product,0,1,0,0,0,2);
SET @position = (select position from tum12607_pretashop1609.ps_category_product where id_category=2 order by position desc limit 1);
SET @next_position = @position +1;
insert into tum12607_pretashop1609.ps_category_product (id_category,id_product,position) values (2,@id_product,@next_position);
end
$$
DELIMITER ;
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `estado`
--
ALTER TABLE `estado`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `locations`
--
ALTER TABLE `locations`
ADD PRIMARY KEY (`loccode`),
ADD KEY `taxprovinceid` (`taxprovinceid`);
--
-- Indices de la tabla `locstock`
--
ALTER TABLE `locstock`
ADD PRIMARY KEY (`loccode`,`stockid`),
ADD KEY `StockID` (`stockid`);
--
-- Indices de la tabla `productos_espera`
--
ALTER TABLE `productos_espera`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `stockmaster`
--
ALTER TABLE `stockmaster`
ADD PRIMARY KEY (`stockid`),
ADD KEY `CategoryID` (`categoryid`),
ADD KEY `Description` (`description`),
ADD KEY `LastCurCostDate` (`lastcurcostdate`),
ADD KEY `MBflag` (`mbflag`),
ADD KEY `StockID` (`stockid`,`categoryid`),
ADD KEY `Controlled` (`controlled`),
ADD KEY `DiscountCategory` (`discountcategory`),
ADD KEY `taxcatid` (`taxcatid`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `estado`
--
ALTER TABLE `estado`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT de la tabla `productos_espera`
--
ALTER TABLE `productos_espera`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
/*!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 */;
| true |
4e3aa01c54520b7a9c98e6569e30b0743832dd77 | SQL | algsalmon/Iscored.net | /iscored /db/Backups_Online/iscored_db_26092012.sql | UTF-8 | 29,071 | 3.3125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 26, 2012 at 02:46 AM
-- Server version: 5.1.63
-- PHP Version: 5.2.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `iscored_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `banners`
--
CREATE TABLE IF NOT EXISTS `banners` (
`ban_id` bigint(22) unsigned NOT NULL,
`barea_id` int(11) unsigned DEFAULT NULL,
`ban_name` varchar(255) DEFAULT NULL,
`ban_file` varchar(255) DEFAULT NULL,
`ban_link` varchar(255) DEFAULT NULL,
`ban_startdate` date DEFAULT NULL,
`ban_enddate` date DEFAULT NULL,
`status_id` int(11) unsigned DEFAULT '0',
`btype_id` smallint(2) unsigned DEFAULT '1',
PRIMARY KEY (`ban_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `banners`
--
INSERT INTO `banners` (`ban_id`, `barea_id`, `ban_name`, `ban_file`, `ban_link`, `ban_startdate`, `ban_enddate`, `status_id`, `btype_id`) VALUES
(1, 5, 'Test Banner', '1_300banner3.gif', 'http://www.esol-tech.com/iscored/', '2010-05-05', '2010-06-30', 1, 1),
(2, 3, 'Bet365', '2_468x60_18.jpeg', 'http://www.bet365.com/home/?affiliate=365_080477', '2012-05-17', '2012-12-21', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `banner_areas`
--
CREATE TABLE IF NOT EXISTS `banner_areas` (
`barea_id` int(11) unsigned NOT NULL,
`barea_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`barea_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `banner_areas`
--
INSERT INTO `banner_areas` (`barea_id`, `barea_name`) VALUES
(1, 'TopLeft'),
(2, 'BottomLeft'),
(3, 'TopRight'),
(4, 'MiddleRight'),
(5, 'BottomRight');
-- --------------------------------------------------------
--
-- Table structure for table `banner_type`
--
CREATE TABLE IF NOT EXISTS `banner_type` (
`btype_id` smallint(2) unsigned NOT NULL,
`btype_name` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `banner_type`
--
INSERT INTO `banner_type` (`btype_id`, `btype_name`) VALUES
(1, 'Image'),
(2, 'Flash (SWF)');
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE IF NOT EXISTS `categories` (
`cat_id` bigint(22) unsigned NOT NULL,
`cat_name` varchar(255) DEFAULT NULL,
`cat_parent_id` bigint(22) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`cat_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`cat_id`, `cat_name`, `cat_parent_id`) VALUES
(1, 'London', 0),
(2, 'Midlands', 0),
(3, 'Southeast', 0),
(4, 'Scotland', 0),
(5, 'Manchester', 0),
(6, 'Newcastle', 0),
(7, 'Best goals', 0),
(8, 'Goal of the month', 0),
(9, 'Top highlights', 0),
(10, 'Funny moments', 0),
(11, 'Cup Finals', 0),
(12, 'Wales', 0),
(13, 'Ireland', 0),
(14, 'United States', 0),
(15, 'Other sports', 0),
(16, 'Skills', 0);
-- --------------------------------------------------------
--
-- Table structure for table `contents`
--
CREATE TABLE IF NOT EXISTS `contents` (
`cnt_id` int(11) unsigned NOT NULL DEFAULT '0',
`cnt_heading` varchar(255) DEFAULT NULL,
`cnt_details` text,
`cnt_keywords` varchar(255) DEFAULT NULL,
PRIMARY KEY (`cnt_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-- Dumping data for table `contents`
--
INSERT INTO `contents` (`cnt_id`, `cnt_heading`, `cnt_details`, `cnt_keywords`) VALUES
(1, 'About Us', '<p> I scored.net is the place where your game is as important as any professional game. The place where you you can see your game, yours goals, your skill.</p>\r\n<p>Did you score from 30 yards? control the 40 hard pass like Zidane, skip past a defender like messi, Power in a free kick like Ronaldo or even tackle like Scholes! Well from now on its not only remebered in your mind its stored here on I-scored for you and everyone to see.</p>\r\n<p><u>Videographers</u></p>\r\n<p> </p>\r\n<p>If you want o be an i-scored videographer and make up between £10-£20 recording a game on your home video camara the email us at info@i-scored.net.</p>\r\n<p> </p>', 'Make money recording games, I-scored.net, watch football,watch your own match, videographers, film my match, film our game, '),
(2, 'Welcome Text', '<p> Under Construction</p>', ''),
(3, 'Legal', '<p> Under Construction</p>', ''),
(4, 'Contact', '<p>\r\n<b>Algie Salmon</b><br />\r\n40 Geen dragons yard, ld montague Street,<br />\r\nLondon E1 5NJ<br />\r\n</p>\r\n<br />\r\n<p>Phone: 07951 988 380</p>\r\n<br />\r\n<p>Email: <a href="mailto:algsalmon@yahoo.co.uk">algsalmon@yahoo.co.uk</a></p>', ''),
(5, 'Sitemap', '<p> Under Construction</p>', NULL),
(6, 'Advertiser', '<p> If you''d like to advertise reach I-scoreds players and videographers contact us at info@i-scored.net<br />\r\n</p>', ''),
(7, 'REFUND POLICY', '<p>Refunds are only given if video is not delivered. Quality and length of the video is down to the camara man and iscored will not be responsible for this. Full refunds will be given back within 24 hours if video is not delivered.Please send any complaints to <a href="mailto:info@i-scored.co.uk">info@i-scored.co.uk</a></p>', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `countries`
--
CREATE TABLE IF NOT EXISTS `countries` (
`countries_id` int(11) NOT NULL AUTO_INCREMENT,
`countries_name` varchar(64) NOT NULL DEFAULT '',
`countries_iso_code_2` char(2) NOT NULL DEFAULT '',
`countries_iso_code_3` char(3) NOT NULL DEFAULT '',
`address_format_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`countries_id`),
KEY `IDX_COUNTRIES_NAME` (`countries_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=240 ;
--
-- Dumping data for table `countries`
--
INSERT INTO `countries` (`countries_id`, `countries_name`, `countries_iso_code_2`, `countries_iso_code_3`, `address_format_id`) VALUES
(1, 'Afghanistan', 'AF', 'AFG', 1),
(2, 'Albania', 'AL', 'ALB', 1),
(3, 'Algeria', 'DZ', 'DZA', 1),
(4, 'American Samoa', 'AS', 'ASM', 1),
(5, 'Andorra', 'AD', 'AND', 1),
(6, 'Angola', 'AO', 'AGO', 1),
(7, 'Anguilla', 'AI', 'AIA', 1),
(8, 'Antarctica', 'AQ', 'ATA', 1),
(9, 'Antigua and Barbuda', 'AG', 'ATG', 1),
(10, 'Argentina', 'AR', 'ARG', 1),
(11, 'Armenia', 'AM', 'ARM', 1),
(12, 'Aruba', 'AW', 'ABW', 1),
(13, 'Australia', 'AU', 'AUS', 1),
(14, 'Austria', 'AT', 'AUT', 5),
(15, 'Azerbaijan', 'AZ', 'AZE', 1),
(16, 'Bahamas', 'BS', 'BHS', 1),
(17, 'Bahrain', 'BH', 'BHR', 1),
(18, 'Bangladesh', 'BD', 'BGD', 1),
(19, 'Barbados', 'BB', 'BRB', 1),
(20, 'Belarus', 'BY', 'BLR', 1),
(21, 'Belgium', 'BE', 'BEL', 1),
(22, 'Belize', 'BZ', 'BLZ', 1),
(23, 'Benin', 'BJ', 'BEN', 1),
(24, 'Bermuda', 'BM', 'BMU', 1),
(25, 'Bhutan', 'BT', 'BTN', 1),
(26, 'Bolivia', 'BO', 'BOL', 1),
(27, 'Bosnia and Herzegowina', 'BA', 'BIH', 1),
(28, 'Botswana', 'BW', 'BWA', 1),
(29, 'Bouvet Island', 'BV', 'BVT', 1),
(30, 'Brazil', 'BR', 'BRA', 1),
(31, 'British Indian Ocean \r\n\r\nTerritory', 'IO', 'IOT', 1),
(32, 'Brunei Darussalam', 'BN', 'BRN', 1),
(33, 'Bulgaria', 'BG', 'BGR', 1),
(34, 'Burkina Faso', 'BF', 'BFA', 1),
(35, 'Burundi', 'BI', 'BDI', 1),
(36, 'Cambodia', 'KH', 'KHM', 1),
(37, 'Cameroon', 'CM', 'CMR', 1),
(38, 'Canada', 'CA', 'CAN', 1),
(39, 'Cape Verde', 'CV', 'CPV', 1),
(40, 'Cayman Islands', 'KY', 'CYM', 1),
(41, 'Central African Republic', 'CF', 'CAF', 1),
(42, 'Chad', 'TD', 'TCD', 1),
(43, 'Chile', 'CL', 'CHL', 1),
(44, 'China', 'CN', 'CHN', 1),
(45, 'Christmas Island', 'CX', 'CXR', 1),
(46, 'Cocos (Keeling) Islands', 'CC', 'CCK', 1),
(47, 'Colombia', 'CO', 'COL', 1),
(48, 'Comoros', 'KM', 'COM', 1),
(49, 'Congo', 'CG', 'COG', 1),
(50, 'Cook Islands', 'CK', 'COK', 1),
(51, 'Costa Rica', 'CR', 'CRI', 1),
(52, 'Cote D''Ivoire', 'CI', 'CIV', 1),
(53, 'Croatia', 'HR', 'HRV', 1),
(54, 'Cuba', 'CU', 'CUB', 1),
(55, 'Cyprus', 'CY', 'CYP', 1),
(56, 'Czech Republic', 'CZ', 'CZE', 1),
(57, 'Denmark', 'DK', 'DNK', 1),
(58, 'Djibouti', 'DJ', 'DJI', 1),
(59, 'Dominica', 'DM', 'DMA', 1),
(60, 'Dominican Republic', 'DO', 'DOM', 1),
(61, 'East Timor', 'TP', 'TMP', 1),
(62, 'Ecuador', 'EC', 'ECU', 1),
(63, 'Egypt', 'EG', 'EGY', 1),
(64, 'El Salvador', 'SV', 'SLV', 1),
(65, 'Equatorial Guinea', 'GQ', 'GNQ', 1),
(66, 'Eritrea', 'ER', 'ERI', 1),
(67, 'Estonia', 'EE', 'EST', 1),
(68, 'Ethiopia', 'ET', 'ETH', 1),
(69, 'Falkland Islands (Malvinas)', 'FK', 'FLK', 1),
(70, 'Faroe Islands', 'FO', 'FRO', 1),
(71, 'Fiji', 'FJ', 'FJI', 1),
(72, 'Finland', 'FI', 'FIN', 1),
(73, 'France', 'FR', 'FRA', 1),
(74, 'France, Metropolitan', 'FX', 'FXX', 1),
(75, 'French Guiana', 'GF', 'GUF', 1),
(76, 'French Polynesia', 'PF', 'PYF', 1),
(77, 'French Southern Territories', 'TF', 'ATF', 1),
(78, 'Gabon', 'GA', 'GAB', 1),
(79, 'Gambia', 'GM', 'GMB', 1),
(80, 'Georgia', 'GE', 'GEO', 1),
(81, 'Germany', 'DE', 'DEU', 5),
(82, 'Ghana', 'GH', 'GHA', 1),
(83, 'Gibraltar', 'GI', 'GIB', 1),
(84, 'Greece', 'GR', 'GRC', 1),
(85, 'Greenland', 'GL', 'GRL', 1),
(86, 'Grenada', 'GD', 'GRD', 1),
(87, 'Guadeloupe', 'GP', 'GLP', 1),
(88, 'Guam', 'GU', 'GUM', 1),
(89, 'Guatemala', 'GT', 'GTM', 1),
(90, 'Guinea', 'GN', 'GIN', 1),
(91, 'Guinea-bissau', 'GW', 'GNB', 1),
(92, 'Guyana', 'GY', 'GUY', 1),
(93, 'Haiti', 'HT', 'HTI', 1),
(94, 'Heard and Mc Donald Islands', 'HM', 'HMD', 1),
(95, 'Honduras', 'HN', 'HND', 1),
(96, 'Hong Kong', 'HK', 'HKG', 1),
(97, 'Hungary', 'HU', 'HUN', 1),
(98, 'Iceland', 'IS', 'ISL', 1),
(99, 'India', 'IN', 'IND', 1),
(100, 'Indonesia', 'ID', 'IDN', 1),
(101, 'Iran (Islamic Republic of)', 'IR', 'IRN', 1),
(102, 'Iraq', 'IQ', 'IRQ', 1),
(103, 'Ireland', 'IE', 'IRL', 1),
(104, 'Israel', 'IL', 'ISR', 1),
(105, 'Italy', 'IT', 'ITA', 1),
(106, 'Jamaica', 'JM', 'JAM', 1),
(107, 'Japan', 'JP', 'JPN', 1),
(108, 'Jordan', 'JO', 'JOR', 1),
(109, 'Kazakhstan', 'KZ', 'KAZ', 1),
(110, 'Kenya', 'KE', 'KEN', 1),
(111, 'Kiribati', 'KI', 'KIR', 1),
(112, 'Korea, Democratic People''s \r\n\r\nRepublic of', 'KP', 'PRK', 1),
(113, 'Korea, Republic of', 'KR', 'KOR', 1),
(114, 'Kuwait', 'KW', 'KWT', 1),
(115, 'Kyrgyzstan', 'KG', 'KGZ', 1),
(116, 'Lao People''s Democratic \r\n\r\nRepublic', 'LA', 'LAO', 1),
(117, 'Latvia', 'LV', 'LVA', 1),
(118, 'Lebanon', 'LB', 'LBN', 1),
(119, 'Lesotho', 'LS', 'LSO', 1),
(120, 'Liberia', 'LR', 'LBR', 1),
(121, 'Libyan Arab Jamahiriya', 'LY', 'LBY', 1),
(122, 'Liechtenstein', 'LI', 'LIE', 1),
(123, 'Lithuania', 'LT', 'LTU', 1),
(124, 'Luxembourg', 'LU', 'LUX', 1),
(125, 'Macau', 'MO', 'MAC', 1),
(126, 'Macedonia, The Former Yugoslav \r\n\r\nRepublic of', 'MK', 'MKD', 1),
(127, 'Madagascar', 'MG', 'MDG', 1),
(128, 'Malawi', 'MW', 'MWI', 1),
(129, 'Malaysia', 'MY', 'MYS', 1),
(130, 'Maldives', 'MV', 'MDV', 1),
(131, 'Mali', 'ML', 'MLI', 1),
(132, 'Malta', 'MT', 'MLT', 1),
(133, 'Marshall Islands', 'MH', 'MHL', 1),
(134, 'Martinique', 'MQ', 'MTQ', 1),
(135, 'Mauritania', 'MR', 'MRT', 1),
(136, 'Mauritius', 'MU', 'MUS', 1),
(137, 'Mayotte', 'YT', 'MYT', 1),
(138, 'Mexico', 'MX', 'MEX', 1),
(139, 'Micronesia, Federated States \r\n\r\nof', 'FM', 'FSM', 1),
(140, 'Moldova, Republic of', 'MD', 'MDA', 1),
(141, 'Monaco', 'MC', 'MCO', 1),
(142, 'Mongolia', 'MN', 'MNG', 1),
(143, 'Montserrat', 'MS', 'MSR', 1),
(144, 'Morocco', 'MA', 'MAR', 1),
(145, 'Mozambique', 'MZ', 'MOZ', 1),
(146, 'Myanmar', 'MM', 'MMR', 1),
(147, 'Namibia', 'NA', 'NAM', 1),
(148, 'Nauru', 'NR', 'NRU', 1),
(149, 'Nepal', 'NP', 'NPL', 1),
(150, 'Netherlands', 'NL', 'NLD', 1),
(151, 'Netherlands Antilles', 'AN', 'ANT', 1),
(152, 'New Caledonia', 'NC', 'NCL', 1),
(153, 'New Zealand', 'NZ', 'NZL', 1),
(154, 'Nicaragua', 'NI', 'NIC', 1),
(155, 'Niger', 'NE', 'NER', 1),
(156, 'Nigeria', 'NG', 'NGA', 1),
(157, 'Niue', 'NU', 'NIU', 1),
(158, 'Norfolk Island', 'NF', 'NFK', 1),
(159, 'Northern Mariana Islands', 'MP', 'MNP', 1),
(160, 'Norway', 'NO', 'NOR', 1),
(161, 'Oman', 'OM', 'OMN', 1),
(162, 'Pakistan', 'PK', 'PAK', 1),
(163, 'Palau', 'PW', 'PLW', 1),
(164, 'Panama', 'PA', 'PAN', 1),
(165, 'Papua New Guinea', 'PG', 'PNG', 1),
(166, 'Paraguay', 'PY', 'PRY', 1),
(167, 'Peru', 'PE', 'PER', 1),
(168, 'Philippines', 'PH', 'PHL', 1),
(169, 'Pitcairn', 'PN', 'PCN', 1),
(170, 'Poland', 'PL', 'POL', 1),
(171, 'Portugal', 'PT', 'PRT', 1),
(172, 'Puerto Rico', 'PR', 'PRI', 1),
(173, 'Qatar', 'QA', 'QAT', 1),
(174, 'Reunion', 'RE', 'REU', 1),
(175, 'Romania', 'RO', 'ROM', 1),
(176, 'Russian Federation', 'RU', 'RUS', 1),
(177, 'Rwanda', 'RW', 'RWA', 1),
(178, 'Saint Kitts and Nevis', 'KN', 'KNA', 1),
(179, 'Saint Lucia', 'LC', 'LCA', 1),
(180, 'Saint Vincent and the \r\n\r\nGrenadines', 'VC', 'VCT', 1),
(181, 'Samoa', 'WS', 'WSM', 1),
(182, 'San Marino', 'SM', 'SMR', 1),
(183, 'Sao Tome and Principe', 'ST', 'STP', 1),
(184, 'Saudi Arabia', 'SA', 'SAU', 1),
(185, 'Senegal', 'SN', 'SEN', 1),
(186, 'Seychelles', 'SC', 'SYC', 1),
(187, 'Sierra Leone', 'SL', 'SLE', 1),
(188, 'Singapore', 'SG', 'SGP', 4),
(189, 'Slovakia (Slovak Republic)', 'SK', 'SVK', 1),
(190, 'Slovenia', 'SI', 'SVN', 1),
(191, 'Solomon Islands', 'SB', 'SLB', 1),
(192, 'Somalia', 'SO', 'SOM', 1),
(193, 'South Africa', 'ZA', 'ZAF', 1),
(194, 'South Georgia and the South \r\n\r\nSandwich Islands', 'GS', 'SGS', 1),
(195, 'Spain', 'ES', 'ESP', 3),
(196, 'Sri Lanka', 'LK', 'LKA', 1),
(197, 'St. Helena', 'SH', 'SHN', 1),
(198, 'St. Pierre and Miquelon', 'PM', 'SPM', 1),
(199, 'Sudan', 'SD', 'SDN', 1),
(200, 'Suriname', 'SR', 'SUR', 1),
(201, 'Svalbard and Jan Mayen \r\n\r\nIslands', 'SJ', 'SJM', 1),
(202, 'Swaziland', 'SZ', 'SWZ', 1),
(203, 'Sweden', 'SE', 'SWE', 1),
(204, 'Switzerland', 'CH', 'CHE', 1),
(205, 'Syrian Arab Republic', 'SY', 'SYR', 1),
(206, 'Taiwan', 'TW', 'TWN', 1),
(207, 'Tajikistan', 'TJ', 'TJK', 1),
(208, 'Tanzania, United Republic of', 'TZ', 'TZA', 1),
(209, 'Thailand', 'TH', 'THA', 1),
(210, 'Togo', 'TG', 'TGO', 1),
(211, 'Tokelau', 'TK', 'TKL', 1),
(212, 'Tonga', 'TO', 'TON', 1),
(213, 'Trinidad and Tobago', 'TT', 'TTO', 1),
(214, 'Tunisia', 'TN', 'TUN', 1),
(215, 'Turkey', 'TR', 'TUR', 1),
(216, 'Turkmenistan', 'TM', 'TKM', 1),
(217, 'Turks and Caicos Islands', 'TC', 'TCA', 1),
(218, 'Tuvalu', 'TV', 'TUV', 1),
(219, 'Uganda', 'UG', 'UGA', 1),
(220, 'Ukraine', 'UA', 'UKR', 1),
(221, 'United Arab Emirates', 'AE', 'ARE', 1),
(222, 'United Kingdom', 'GB', 'GBR', 1),
(223, 'United States', 'US', 'USA', 2),
(224, 'United States Minor Outlying \r\n\r\nIslands', 'UM', 'UMI', 1),
(225, 'Uruguay', 'UY', 'URY', 1),
(226, 'Uzbekistan', 'UZ', 'UZB', 1),
(227, 'Vanuatu', 'VU', 'VUT', 1),
(228, 'Vatican City State (Holy \r\n\r\nSee)', 'VA', 'VAT', 1),
(229, 'Venezuela', 'VE', 'VEN', 1),
(230, 'Viet Nam', 'VN', 'VNM', 1),
(231, 'Virgin Islands (British)', 'VG', 'VGB', 1),
(232, 'Virgin Islands (U.S.)', 'VI', 'VIR', 1),
(233, 'Wallis and Futuna Islands', 'WF', 'WLF', 1),
(234, 'Western Sahara', 'EH', 'ESH', 1),
(235, 'Yemen', 'YE', 'YEM', 1),
(236, 'Yugoslavia', 'YU', 'YUG', 1),
(237, 'Zaire', 'ZR', 'ZAR', 1),
(238, 'Zambia', 'ZM', 'ZMB', 1),
(239, 'Zimbabwe', 'ZW', 'ZWE', 1);
-- --------------------------------------------------------
--
-- Table structure for table `gender`
--
CREATE TABLE IF NOT EXISTS `gender` (
`gen_id` smallint(2) unsigned NOT NULL,
`gen_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`gen_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `gender`
--
INSERT INTO `gender` (`gen_id`, `gen_name`) VALUES
(1, 'Male'),
(2, 'Female');
-- --------------------------------------------------------
--
-- Table structure for table `images`
--
CREATE TABLE IF NOT EXISTS `images` (
`image_id` bigint(22) unsigned NOT NULL,
`menu_id` int(10) unsigned DEFAULT NULL,
`image_title` varchar(255) DEFAULT NULL,
`image_file` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `images`
--
INSERT INTO `images` (`image_id`, `menu_id`, `image_title`, `image_file`) VALUES
(1, 2, 'test', '1_Fotos_DSC_Y347831.JPG'),
(2, 2, 'sasas', '2_big_image.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `members`
--
CREATE TABLE IF NOT EXISTS `members` (
`mem_id` bigint(22) unsigned NOT NULL,
`mem_login` varchar(255) DEFAULT NULL,
`mem_password` varchar(255) DEFAULT NULL,
`mem_name` varchar(255) DEFAULT NULL,
`mem_dob` date DEFAULT NULL,
`gen_id` smallint(2) unsigned DEFAULT NULL,
`mem_phone` varchar(255) DEFAULT NULL,
`mem_address` varchar(255) DEFAULT NULL,
`mem_city` varchar(255) DEFAULT NULL,
`countries_id` int(11) unsigned DEFAULT NULL,
`mem_ac_title` varchar(255) DEFAULT NULL,
`mem_ac_number` varchar(255) DEFAULT NULL,
`mem_bank_name` varchar(255) DEFAULT NULL,
`mem_swift_code` varchar(255) DEFAULT NULL,
`mem_bank_address` text,
`status_id` int(11) unsigned DEFAULT '1',
`mem_datecreated` date DEFAULT NULL,
`mem_lastupdated` date DEFAULT NULL,
`mem_last_login` date DEFAULT NULL,
`mem_total_videos` int(11) unsigned DEFAULT '0',
`mem_view_videos` int(11) unsigned DEFAULT '0',
`mem_confirm` int(1) unsigned DEFAULT '1',
PRIMARY KEY (`mem_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `members`
--
INSERT INTO `members` (`mem_id`, `mem_login`, `mem_password`, `mem_name`, `mem_dob`, `gen_id`, `mem_phone`, `mem_address`, `mem_city`, `countries_id`, `mem_ac_title`, `mem_ac_number`, `mem_bank_name`, `mem_swift_code`, `mem_bank_address`, `status_id`, `mem_datecreated`, `mem_lastupdated`, `mem_last_login`, `mem_total_videos`, `mem_view_videos`, `mem_confirm`) VALUES
(1, 'aqeelashraf@gmail.com', 'aaa', 'Aqeel Ashraf', '1980-04-04', 1, '', '', '', 162, '', '', '', '', '', 1, '2010-03-24', '2011-01-23', '2012-05-29', 0, 0, 1),
(2, 'aqeelashraf@yahoo.com', 'aaa', 'Aqeel Ashraf', '1980-04-04', 1, '+92 300 4937847', '277 Block C, Sabzazar, Lahore', 'Lahore', 162, '', '', '', '', '', 1, '2011-01-23', NULL, NULL, 0, 0, 1),
(3, '', '0scGlba637', 'baxyrexurge', '0000-00-00', 1, '', '', '', 1, 'SUBJ1', '', '', '', '', 1, '2011-10-13', NULL, NULL, 0, 0, 0),
(4, 'wposRyuxotsFSx', '', 'dahxhjn', '0000-00-00', 1, '', 'itKUjyvMQzwmOlnj', '', 29, '', '', '', '', '', 1, '2011-10-31', NULL, NULL, 0, 0, 0),
(5, 'algsalmon@yahoo.co.uk', 'algie247', 'Algie', '1978-05-04', 1, 'algsalmon@yahoo.co.uk', '4 0Green Dragons yard', 'London', 222, '', '', '', '', '', 1, '2011-11-01', NULL, '2012-09-24', 0, 0, 1),
(6, 'FkfoNoCPFRrMA', '', 'xzwthrcbz', '0000-00-00', 1, '', 'aUmmwcwoktz', '', 201, '', '', '', '', '', 1, '2011-11-01', NULL, NULL, 0, 0, 0),
(7, 'VkriFINcpeU', '', 'kqpabhyvk', '0000-00-00', 1, '', 'ONtMRbGRZGsvKFWoO', '', 220, '', '', '', '', '', 1, '2012-08-28', NULL, NULL, 0, 0, 0),
(8, 'daniel.yamoah@gmail.com', 'Hercules07', 'Daniel Yamoah', '1984-02-18', 1, '07970967785', '3 Squirrels Heath Lane', 'Essex', 222, '', '', '', '', '', 1, '2012-08-31', NULL, NULL, 0, 0, 1);
-- --------------------------------------------------------
--
-- Table structure for table `menu`
--
CREATE TABLE IF NOT EXISTS `menu` (
`menu_id` int(11) unsigned NOT NULL DEFAULT '0',
`cnt_id` int(11) unsigned DEFAULT '0',
`menu_title` varchar(255) DEFAULT NULL,
`mtype_id` int(11) unsigned DEFAULT '1',
`menu_parent_id` int(11) unsigned DEFAULT '0',
`status_id` int(11) unsigned DEFAULT NULL,
`menu_rank` int(11) DEFAULT NULL,
PRIMARY KEY (`menu_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `menu`
--
INSERT INTO `menu` (`menu_id`, `cnt_id`, `menu_title`, `mtype_id`, `menu_parent_id`, `status_id`, `menu_rank`) VALUES
(1, 2, 'Home', 1, 0, 1, 1),
(2, 1, 'ABOUT US ', 1, 0, 1, 2),
(4, 3, 'LEGAL', 1, 0, 1, 4),
(5, 4, 'CONTACT', 1, 0, 1, 5),
(6, 5, 'Sitemap', 1, 0, 1, 6),
(7, 6, 'Advertise', 1, 0, 1, 7);
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE IF NOT EXISTS `orders` (
`ord_id` bigint(22) unsigned NOT NULL,
`cat_id` bigint(22) unsigned DEFAULT NULL,
`mem_id` bigint(22) unsigned DEFAULT NULL,
`vid_id` bigint(22) unsigned DEFAULT NULL,
`ord_date` date DEFAULT NULL,
`pstatus_id` int(2) unsigned DEFAULT '0',
`ord_trans_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ord_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orders`
--
INSERT INTO `orders` (`ord_id`, `cat_id`, `mem_id`, `vid_id`, `ord_date`, `pstatus_id`, `ord_trans_id`) VALUES
(1, 2, 1, 5, '2010-11-07', 1, ''),
(2, 1, 5, 4, '2011-12-25', 1, ''),
(3, 15, 5, 8, '2012-05-08', 1, ''),
(4, 1, 5, 7, '2012-05-08', 1, '');
-- --------------------------------------------------------
--
-- Table structure for table `pay_status`
--
CREATE TABLE IF NOT EXISTS `pay_status` (
`pstatus_id` int(2) unsigned NOT NULL,
`pstatus_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`pstatus_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pay_status`
--
INSERT INTO `pay_status` (`pstatus_id`, `pstatus_name`) VALUES
(0, 'Pending'),
(1, 'Completed'),
(2, 'Cancelled'),
(3, 'Failed'),
(4, 'Denied'),
(5, 'Invalid');
-- --------------------------------------------------------
--
-- Table structure for table `site_config`
--
CREATE TABLE IF NOT EXISTS `site_config` (
`config_id` int(11) unsigned NOT NULL DEFAULT '0',
`config_sitename` varchar(255) DEFAULT NULL,
`config_sitetitle` varchar(255) DEFAULT NULL,
`config_metakey` text,
`config_metades` text,
`config_upload_limit` int(11) unsigned DEFAULT '0',
`status_id` smallint(1) unsigned DEFAULT '1',
PRIMARY KEY (`config_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `site_config`
--
INSERT INTO `site_config` (`config_id`, `config_sitename`, `config_sitetitle`, `config_metakey`, `config_metades`, `config_upload_limit`, `status_id`) VALUES
(1, 'iscored.com', 'iscored', 'iscored', 'iscored', 21504, 1);
-- --------------------------------------------------------
--
-- Table structure for table `status`
--
CREATE TABLE IF NOT EXISTS `status` (
`status_id` int(11) unsigned NOT NULL DEFAULT '0',
`status_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`status_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `status`
--
INSERT INTO `status` (`status_id`, `status_name`) VALUES
(0, 'Inactive'),
(1, 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `tags`
--
CREATE TABLE IF NOT EXISTS `tags` (
`tag_id` bigint(22) unsigned NOT NULL,
`tag_name` varchar(255) DEFAULT NULL,
`tag_total` int(11) unsigned DEFAULT '1',
PRIMARY KEY (`tag_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tags`
--
INSERT INTO `tags` (`tag_id`, `tag_name`, `tag_total`) VALUES
(1, 'Autos', 0),
(2, 'Vehicles', 0),
(3, 'Comedy', 0),
(4, 'Education', 0),
(5, 'Entertainment', 0),
(6, 'Film', 0),
(7, 'Animation', 1),
(8, 'Gaming', 1),
(9, 'Style', 1),
(10, 'News', 1),
(11, 'Politics', 1),
(12, 'Nonprofits', 1),
(13, 'Activism', 1),
(14, 'People', 1),
(15, 'Blogs', 1),
(16, 'Pets', 1),
(17, 'Animals', 1),
(18, 'Science', 1),
(19, 'Technology', 1),
(20, 'Sports', 1),
(21, 'Travel', 1),
(22, 'Events', 1),
(23, '', 1),
(24, 'Vggg', 1),
(25, 'VgggFfgg', 1),
(26, 'check this', 1),
(27, 'Cricket', 1),
(28, 'testing', 1),
(29, '22', 1),
(30, 'Test', 1),
(31, 'Funny', 1);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`user_id` tinyint(9) unsigned NOT NULL DEFAULT '0',
`user_name` varchar(255) NOT NULL DEFAULT '',
`user_password` varchar(255) NOT NULL DEFAULT '',
`utype_id` int(11) unsigned DEFAULT NULL,
`clt_id` bigint(22) unsigned DEFAULT '0',
`status_id` int(11) unsigned DEFAULT '1',
PRIMARY KEY (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `user_name`, `user_password`, `utype_id`, `clt_id`, `status_id`) VALUES
(1, 'sadmin', 'sadmin', 1, 0, 1),
(2, 'admin', 'admin', 2, 0, 1),
(3, 'manager', 'manager', 3, 0, 1);
-- --------------------------------------------------------
--
-- Table structure for table `user_type`
--
CREATE TABLE IF NOT EXISTS `user_type` (
`utype_id` int(11) unsigned NOT NULL,
`utype_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`utype_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_type`
--
INSERT INTO `user_type` (`utype_id`, `utype_name`) VALUES
(1, 'SuperAdmin'),
(2, 'Admin'),
(3, 'Manager');
-- --------------------------------------------------------
--
-- Table structure for table `videos`
--
CREATE TABLE IF NOT EXISTS `videos` (
`vid_id` bigint(22) unsigned NOT NULL,
`mem_id` bigint(22) unsigned DEFAULT '0',
`cat_id` bigint(22) unsigned DEFAULT NULL,
`vid_name` varchar(255) DEFAULT NULL,
`vid_details` text,
`vid_file_path` varchar(255) DEFAULT NULL,
`vid_clip_path` varchar(255) DEFAULT NULL,
`vid_thumb` varchar(255) DEFAULT NULL,
`vid_dateadded` date DEFAULT NULL,
`vid_views` int(11) unsigned DEFAULT '0',
`vid_price` float(16,2) unsigned DEFAULT NULL,
`vstatus_id` int(11) unsigned DEFAULT '0',
`vid_featured` smallint(1) unsigned DEFAULT '0',
`vid_home` tinyint(1) unsigned DEFAULT '0',
`vid_length` int(11) unsigned DEFAULT '0',
PRIMARY KEY (`vid_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `videos`
--
INSERT INTO `videos` (`vid_id`, `mem_id`, `cat_id`, `vid_name`, `vid_details`, `vid_file_path`, `vid_clip_path`, `vid_thumb`, `vid_dateadded`, `vid_views`, `vid_price`, `vstatus_id`, `vid_featured`, `vid_home`, `vid_length`) VALUES
(2, 1, 1, 'test', 'zazaza', '2_test.flv', '2_test.flv', NULL, '2010-04-16', 289, 50.00, 1, 1, 0, 0),
(3, 1, 1, 'new test 1', 'test image', '3_test.flv', '3_test.flv', NULL, '2010-04-19', 292, 44.00, 1, 1, 0, 0),
(4, 1, 1, 'dfdsf', 'cczc', '4_consumer_plus.flv', '4_consumer_plus.flv', NULL, '2010-04-21', 189, 2232.00, 1, 1, 0, 0),
(5, 1, 2, 'new comerdy', 'asdsads', '5_test.flv', '5_test.flv', NULL, '2010-04-14', 233, 50.00, 1, 1, 0, 0),
(6, 0, 2, 'New File', 'Must see this....', '6_WhatADance.flv', NULL, NULL, '2010-05-12', 0, 50.00, 0, 0, 0, 0),
(7, 5, 1, 'East Ham 2010', '', '7_Untitled_Sequence.flv', NULL, '7_Untitled_Sequence.jpg', '2011-12-13', 244, 2.00, 1, 0, 0, 0),
(8, 1, 15, 'Cricket - Funny', 'Punjabi Totay - Funny', '8_Facebook19.flv', NULL, '8_Facebook19.jpg', '2012-04-17', 109, 1.00, 1, 0, 0, 70),
(9, 1, 1, 'Progress Bar', 'Test', '9_Facebook19.flv', NULL, '9_Facebook19.jpg', '2012-05-29', 70, 10.00, 1, 0, 0, 70),
(10, 5, 1, 'blah blah', '', '10_23.flv', NULL, '10_23.jpg', '2012-07-20', 51, 2.00, 1, 0, 1, 511);
-- --------------------------------------------------------
--
-- Table structure for table `video_tags`
--
CREATE TABLE IF NOT EXISTS `video_tags` (
`vid_id` bigint(255) unsigned NOT NULL,
`tag_id` bigint(255) unsigned NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `video_tags`
--
INSERT INTO `video_tags` (`vid_id`, `tag_id`) VALUES
(1, 1),
(1, 2),
(2, 4),
(2, 3),
(3, 5),
(3, 4),
(3, 6),
(7, 23),
(8, 24),
(8, 25),
(8, 26),
(8, 27),
(8, 27),
(8, 27),
(9, 23),
(10, 23),
(11, 23),
(9, 28),
(9, 29),
(9, 30),
(9, 31),
(10, 23),
(10, 23),
(10, 23);
-- --------------------------------------------------------
--
-- Table structure for table `vid_comments`
--
CREATE TABLE IF NOT EXISTS `vid_comments` (
`vcom_id` bigint(22) unsigned NOT NULL,
`vid_id` bigint(22) unsigned DEFAULT NULL,
`mem_id` bigint(22) unsigned DEFAULT '0',
`vcom_comment` text,
`vcom_date` date DEFAULT NULL,
`vstatus_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`vcom_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `vid_comments`
--
INSERT INTO `vid_comments` (`vcom_id`, `vid_id`, `mem_id`, `vcom_comment`, `vcom_date`, `vstatus_id`) VALUES
(1, 1, 1, 'dsadsa dsadsa ds ds dsadsad asd sads adsa dsa fdsa fdas fds fv sdf dsaf dsaf sadf dsfdasfdsf dsf dsf ds fdsa fds f dsf dsf dsf ds', '2010-04-20', 1),
(2, 1, 1, 'fdsv ghtr cfdasfd dsfsda fdf g fd dsafds dsafddf gfegfes fsdfd fewafrewr fdss fdsafdsf fdsafdsfdas', '2010-04-22', 1),
(3, 4, 1, 'txtcomments', '2010-04-27', 1),
(4, 4, 1, 'another test comments', '2010-04-27', 1),
(5, 4, 1, 'This is test coimments', '2010-04-27', 1);
-- --------------------------------------------------------
--
-- Table structure for table `vstatus`
--
CREATE TABLE IF NOT EXISTS `vstatus` (
`vstatus_id` int(11) unsigned NOT NULL,
`vstatus_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`vstatus_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `vstatus`
--
INSERT INTO `vstatus` (`vstatus_id`, `vstatus_name`) VALUES
(0, 'Pending'),
(1, 'Approved'),
(2, 'Denied'),
(3, 'Blocked');
/*!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 */;
| true |
779a8df14ae23849d33de24e2f27146057a04e31 | SQL | cdesmarais/WebDB-Test | /WebDB/StoredProcedures/Common/dbo.Admin_FoodType_Get.PRC | UTF-8 | 811 | 3.609375 | 4 | [] | no_license | if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Admin_FoodType_Get]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[Admin_FoodType_Get]
GO
CREATE PROCEDURE dbo.Admin_FoodType_Get
@FoodTypeID nvarchar(255)
As
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
--*****************************
--** Given a list of food type ids, return the set of FoodTypes
--** Used in Admin.dll to create a comma delimited list of foodtypes for a restaurant
--** Does not need a Language filter becuase the incoming IDs are already restricted by language
--*****************************
SELECT FoodType as Value
FROM FoodType
WHERE foodtypeID IN (select id from fIDStrToTab(@FoodTypeID, ','))
GO
GRANT EXECUTE ON [Admin_FoodType_Get] TO ExecuteOnlyRole
GO
| true |
588bcf4d1477cf3ba142a50b8d6ca08608af8edb | SQL | NadiaAbd/project | /tbase.sql | UTF-8 | 16,846 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : ven. 25 juin 2021 à 01:52
-- Version du serveur : 5.7.24
-- Version de PHP : 7.3.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 */;
--
-- Base de données : `tbase`
--
-- --------------------------------------------------------
--
-- Structure de la table `ajustement_physique`
--
DROP TABLE IF EXISTS `ajustement_physique`;
CREATE TABLE IF NOT EXISTS `ajustement_physique` (
`aj_id` bigint(20) NOT NULL AUTO_INCREMENT,
`annee_aj` varchar(255) DEFAULT NULL,
`avancement_aj` varchar(255) DEFAULT NULL,
PRIMARY KEY (`aj_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `ajustement_physique`
--
INSERT INTO `ajustement_physique` (`aj_id`, `annee_aj`, `avancement_aj`) VALUES
(1, 'anne1', '10%'),
(2, 'anné2', '50%'),
(3, 'anné3', '40%');
-- --------------------------------------------------------
--
-- Structure de la table `appel_offre`
--
DROP TABLE IF EXISTS `appel_offre`;
CREATE TABLE IF NOT EXISTS `appel_offre` (
`appel_id` bigint(20) NOT NULL AUTO_INCREMENT,
`titre` varchar(255) DEFAULT NULL,
PRIMARY KEY (`appel_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Structure de la table `facture`
--
DROP TABLE IF EXISTS `facture`;
CREATE TABLE IF NOT EXISTS `facture` (
`facture_id` bigint(20) NOT NULL AUTO_INCREMENT,
`date_facture` datetime DEFAULT NULL,
`date_paiement` datetime DEFAULT NULL,
`nom_client` varchar(255) DEFAULT NULL,
`nom_facture` varchar(255) DEFAULT NULL,
PRIMARY KEY (`facture_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `facture`
--
INSERT INTO `facture` (`facture_id`, `date_facture`, `date_paiement`, `nom_client`, `nom_facture`) VALUES
(1, '2021-05-11 13:08:39', '2021-05-06 13:08:39', 'smith', 'facture N2'),
(3, NULL, '2021-06-27 01:00:00', 'Smith', 'vc'),
(4, NULL, '2021-06-27 01:00:00', 'Imed', 'ffxx'),
(5, NULL, '2021-06-27 01:00:00', 'Pascal', 'x'),
(6, NULL, '2021-06-27 01:00:00', 'Pascal', 'ddddd');
-- --------------------------------------------------------
--
-- Structure de la table `fonction`
--
DROP TABLE IF EXISTS `fonction`;
CREATE TABLE IF NOT EXISTS `fonction` (
`id_fonction` bigint(20) NOT NULL AUTO_INCREMENT,
`nom_fonction` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_fonction`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `fonction`
--
INSERT INTO `fonction` (`id_fonction`, `nom_fonction`) VALUES
(1, 'financier'),
(2, 'chef projet'),
(4, 'admin'),
(5, 'responsable technique'),
(6, 'responsable marché');
-- --------------------------------------------------------
--
-- Structure de la table `marche`
--
DROP TABLE IF EXISTS `marche`;
CREATE TABLE IF NOT EXISTS `marche` (
`marche_id` bigint(20) NOT NULL AUTO_INCREMENT,
`nom_fournisseur` varchar(255) DEFAULT NULL,
PRIMARY KEY (`marche_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Structure de la table `plannfication_physique`
--
DROP TABLE IF EXISTS `plannfication_physique`;
CREATE TABLE IF NOT EXISTS `plannfication_physique` (
`pl_id` bigint(20) NOT NULL AUTO_INCREMENT,
`annee_pl` varchar(255) DEFAULT NULL,
`avancement_pl` varchar(255) DEFAULT NULL,
PRIMARY KEY (`pl_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `plannfication_physique`
--
INSERT INTO `plannfication_physique` (`pl_id`, `annee_pl`, `avancement_pl`) VALUES
(1, 'ann1', '10%');
-- --------------------------------------------------------
--
-- Structure de la table `plan_initial_financier`
--
DROP TABLE IF EXISTS `plan_initial_financier`;
CREATE TABLE IF NOT EXISTS `plan_initial_financier` (
`pif_id` bigint(20) NOT NULL AUTO_INCREMENT,
`annee_pif` varchar(255) DEFAULT NULL,
`engagement_pif` bigint(20) DEFAULT NULL,
`paiement_pif` bigint(20) DEFAULT NULL,
PRIMARY KEY (`pif_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `plan_initial_financier`
--
INSERT INTO `plan_initial_financier` (`pif_id`, `annee_pif`, `engagement_pif`, `paiement_pif`) VALUES
(1, '2001', 200000, 200);
-- --------------------------------------------------------
--
-- Structure de la table `plan_passation_marche`
--
DROP TABLE IF EXISTS `plan_passation_marche`;
CREATE TABLE IF NOT EXISTS `plan_passation_marche` (
`ppm_id` bigint(20) NOT NULL AUTO_INCREMENT,
`date_lancement_ao` datetime DEFAULT NULL,
`titre_ao` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ppm_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Structure de la table `plan_travail_financier`
--
DROP TABLE IF EXISTS `plan_travail_financier`;
CREATE TABLE IF NOT EXISTS `plan_travail_financier` (
`ptf_id` bigint(20) NOT NULL AUTO_INCREMENT,
`annee_ptf` varchar(255) DEFAULT NULL,
`engagement_ptf` bigint(20) DEFAULT NULL,
`paiement_ptf` bigint(20) DEFAULT NULL,
PRIMARY KEY (`ptf_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `plan_travail_financier`
--
INSERT INTO `plan_travail_financier` (`ptf_id`, `annee_ptf`, `engagement_ptf`, `paiement_ptf`) VALUES
(1, '2005', 50000, 5266);
-- --------------------------------------------------------
--
-- Structure de la table `profil`
--
DROP TABLE IF EXISTS `profil`;
CREATE TABLE IF NOT EXISTS `profil` (
`id_profil` bigint(20) NOT NULL AUTO_INCREMENT,
`nom_profil` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_profil`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `profil`
--
INSERT INTO `profil` (`id_profil`, `nom_profil`) VALUES
(1, 'P1'),
(2, 'P2'),
(3, 'P3'),
(4, 'P4'),
(5, 'P5'),
(6, 'p12'),
(7, NULL),
(8, NULL),
(9, NULL),
(10, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `profil_fonctions`
--
DROP TABLE IF EXISTS `profil_fonctions`;
CREATE TABLE IF NOT EXISTS `profil_fonctions` (
`profil_id_profil` bigint(20) NOT NULL,
`fonctions_id_fonction` bigint(20) NOT NULL,
PRIMARY KEY (`profil_id_profil`,`fonctions_id_fonction`),
UNIQUE KEY `UK_oow2vsf7le0u6sx6nrnon1m1q` (`fonctions_id_fonction`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `profil_fonctions`
--
INSERT INTO `profil_fonctions` (`profil_id_profil`, `fonctions_id_fonction`) VALUES
(2, 2),
(1, 4);
-- --------------------------------------------------------
--
-- Structure de la table `projet`
--
DROP TABLE IF EXISTS `projet`;
CREATE TABLE IF NOT EXISTS `projet` (
`projet_id` bigint(20) NOT NULL AUTO_INCREMENT,
`en_difficulte` bit(1) NOT NULL,
`cout` bigint(20) NOT NULL,
`date_ajout` datetime DEFAULT NULL,
`date_mise_ajour` datetime DEFAULT NULL,
`datedebut` datetime DEFAULT NULL,
`datefin` datetime DEFAULT NULL,
`difficulte` varchar(255) DEFAULT NULL,
`intitule` varchar(255) DEFAULT NULL,
`stade` varchar(255) DEFAULT NULL,
`ajp_aj_id` bigint(20) DEFAULT NULL,
`plp_pl_id` bigint(20) DEFAULT NULL,
`ppm_ppm_id` bigint(20) DEFAULT NULL,
`rap_re_id` bigint(20) DEFAULT NULL,
`marche_marche_id` bigint(20) DEFAULT NULL,
`pif_pif_id` bigint(20) DEFAULT NULL,
`ptf_ptf_id` bigint(20) DEFAULT NULL,
`localisation` varchar(255) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`projet_id`),
KEY `FKbcte9r4dh5eld01984wrx2d4b` (`ajp_aj_id`),
KEY `FKnr7ldxjwj7a89hsm12lb68ral` (`plp_pl_id`),
KEY `FK8oyy8yfcgcnupbi554prue13t` (`ppm_ppm_id`),
KEY `FKc18831ouqgqh9mo8bxa8q6vet` (`rap_re_id`),
KEY `FKmlb8xk7gk9aegjlmsj92481a7` (`marche_marche_id`),
KEY `FKsvanh5mcuhi77m3qxapat0ima` (`pif_pif_id`),
KEY `FK1vc54n5g04xscd54db17o450v` (`ptf_ptf_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `projet`
--
INSERT INTO `projet` (`projet_id`, `en_difficulte`, `cout`, `date_ajout`, `date_mise_ajour`, `datedebut`, `datefin`, `difficulte`, `intitule`, `stade`, `ajp_aj_id`, `plp_pl_id`, `ppm_ppm_id`, `rap_re_id`, `marche_marche_id`, `pif_pif_id`, `ptf_ptf_id`, `localisation`, `user_id`) VALUES
(1, b'0', 0, NULL, NULL, '2021-06-16 07:26:24', '2021-06-17 07:26:33', NULL, 'Steg projet', 'avancement', 1, 1, NULL, 1, NULL, 1, 1, NULL, 3),
(2, b'0', 0, NULL, NULL, NULL, NULL, NULL, 'Hopital projett', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2),
(3, b'0', 1223, NULL, NULL, '2020-02-22 01:00:00', '2013-02-02 01:00:00', 'ccc', 'cv_NadiaAbdellatif', 'Colturé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 2),
(4, b'0', 12, NULL, NULL, '2020-02-22 01:00:00', '2022-02-02 01:00:00', 'ff', 'cv_NadiaAbdellatif', 'en cours', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1),
(5, b'0', 555, NULL, NULL, '2020-05-05 01:00:00', '2022-02-02 01:00:00', 'gg', 'jjjj', 'en cours', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1),
(6, b'0', 12, NULL, NULL, '2020-05-12 01:00:00', '2023-02-20 01:00:00', 'dd', 'was', 'Colturé', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1),
(7, b'0', 11, NULL, NULL, '2020-02-12 01:00:00', '2020-02-12 01:00:00', 'dd', 'ff', 'en cours', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1),
(8, b'0', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0),
(9, b'0', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0),
(10, b'0', 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
-- --------------------------------------------------------
--
-- Structure de la table `projet_appel_offre`
--
DROP TABLE IF EXISTS `projet_appel_offre`;
CREATE TABLE IF NOT EXISTS `projet_appel_offre` (
`projet_projet_id` bigint(20) NOT NULL,
`appel_offre_appel_id` bigint(20) NOT NULL,
PRIMARY KEY (`projet_projet_id`,`appel_offre_appel_id`),
UNIQUE KEY `UK_sjktvigqjo4wdluyuvaw4383v` (`appel_offre_appel_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Structure de la table `projet_factures`
--
DROP TABLE IF EXISTS `projet_factures`;
CREATE TABLE IF NOT EXISTS `projet_factures` (
`projet_projet_id` bigint(20) NOT NULL,
`factures_facture_id` bigint(20) NOT NULL,
PRIMARY KEY (`projet_projet_id`,`factures_facture_id`),
UNIQUE KEY `UK_2wp327pgdwarvqobe7e2t05gk` (`factures_facture_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `projet_factures`
--
INSERT INTO `projet_factures` (`projet_projet_id`, `factures_facture_id`) VALUES
(1, 1);
-- --------------------------------------------------------
--
-- Structure de la table `realisation_physique`
--
DROP TABLE IF EXISTS `realisation_physique`;
CREATE TABLE IF NOT EXISTS `realisation_physique` (
`re_id` bigint(20) NOT NULL AUTO_INCREMENT,
`annee_re` varchar(255) DEFAULT NULL,
`avancement_re` varchar(255) DEFAULT NULL,
PRIMARY KEY (`re_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `realisation_physique`
--
INSERT INTO `realisation_physique` (`re_id`, `annee_re`, `avancement_re`) VALUES
(1, 'ann1', '10%');
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
`utilisateur_id` bigint(20) NOT NULL AUTO_INCREMENT,
`datenaissance` datetime DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`mot_de_passe` varchar(255) DEFAULT NULL,
`nom` varchar(255) DEFAULT NULL,
`nom_utilisateur` varchar(255) DEFAULT NULL,
`prenom` varchar(255) DEFAULT NULL,
`structure` varchar(255) DEFAULT NULL,
`telephone` bigint(20) DEFAULT NULL,
`profil_id_profil` bigint(20) DEFAULT NULL,
`fonction_id` int(11) NOT NULL,
`chef_projet` bit(1) NOT NULL,
PRIMARY KEY (`utilisateur_id`),
KEY `FK5mm3qltw954x5a8p4v86hc05n` (`profil_id_profil`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`utilisateur_id`, `datenaissance`, `email`, `mot_de_passe`, `nom`, `nom_utilisateur`, `prenom`, `structure`, `telephone`, `profil_id_profil`, `fonction_id`, `chef_projet`) VALUES
(1, '2021-06-26 01:00:00', 'sliva@gmail.com', 'sliva123', 'Slivaaaa', 'Sliva2', 'France', 'CNI', 77881122, 1, 2, b'0'),
(2, '1992-05-21 01:00:00', 'smith@gmail.com', 'sm123', 'Smith', 'smith', 'Alg', 'STEG', 28520312, 2, 1, b'0'),
(3, '1983-10-14 01:00:00', 'Pascalth2@hotmail.com', 'pr223', 'Pascal', 'pascal', 'Thimothé', 'CNI', 77888121, 3, 6, b'0'),
(4, '1981-02-05 01:00:00', 'belhsanimed@yahoo.fr', 'imed@123', 'Imed', 'imed_belhssan', 'Bel hssan', 'STEG', 28956898, 4, 1, b'0'),
(5, '1987-03-06 01:00:00', 'Alex655@yahoo.fr', 'aa123', 'Alex', 'Alex', 'BK', 'STEG', 96782000, 5, 1, b'0'),
(6, '2021-06-20 01:00:00', 'arijbelguith99@gmail.com', 'ch123', 'Chakib', 'Belguith Chakib', 'Belguith', 'STEG', 29713521, 6, 1, b'0'),
(7, '2021-06-12 01:00:00', 'aaaa @hotmail.com', 'amal20', 'amal', 'amal', 'njeimi', 'STEG', 23565121, 2, 5, b'0'),
(8, '2021-06-13 01:00:00', 'bel@gmail.com', 'arij12', 'arij', 'arij', 'belg', 'CNI', 23565898, 6, 2, b'0');
-- --------------------------------------------------------
--
-- Structure de la table `user_projet`
--
DROP TABLE IF EXISTS `user_projet`;
CREATE TABLE IF NOT EXISTS `user_projet` (
`utilisateur_id` bigint(20) NOT NULL,
`projet_id` bigint(20) NOT NULL,
PRIMARY KEY (`utilisateur_id`,`projet_id`),
KEY `FKlcmfje77esrmu5c07w515upvn` (`projet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `user_projet`
--
INSERT INTO `user_projet` (`utilisateur_id`, `projet_id`) VALUES
(3, 1),
(4, 1),
(2, 2),
(5, 2),
(2, 4);
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `profil_fonctions`
--
ALTER TABLE `profil_fonctions`
ADD CONSTRAINT `FK3em4e16vq26lrm5cd5tv00p3s` FOREIGN KEY (`fonctions_id_fonction`) REFERENCES `fonction` (`id_fonction`),
ADD CONSTRAINT `FKsxyit3ocrw0aq1fwtljbex3ju` FOREIGN KEY (`profil_id_profil`) REFERENCES `profil` (`id_profil`);
--
-- Contraintes pour la table `projet`
--
ALTER TABLE `projet`
ADD CONSTRAINT `FK1vc54n5g04xscd54db17o450v` FOREIGN KEY (`ptf_ptf_id`) REFERENCES `plan_travail_financier` (`ptf_id`),
ADD CONSTRAINT `FK8oyy8yfcgcnupbi554prue13t` FOREIGN KEY (`ppm_ppm_id`) REFERENCES `plan_passation_marche` (`ppm_id`),
ADD CONSTRAINT `FKbcte9r4dh5eld01984wrx2d4b` FOREIGN KEY (`ajp_aj_id`) REFERENCES `ajustement_physique` (`aj_id`),
ADD CONSTRAINT `FKc18831ouqgqh9mo8bxa8q6vet` FOREIGN KEY (`rap_re_id`) REFERENCES `realisation_physique` (`re_id`),
ADD CONSTRAINT `FKmlb8xk7gk9aegjlmsj92481a7` FOREIGN KEY (`marche_marche_id`) REFERENCES `marche` (`marche_id`),
ADD CONSTRAINT `FKnr7ldxjwj7a89hsm12lb68ral` FOREIGN KEY (`plp_pl_id`) REFERENCES `plannfication_physique` (`pl_id`),
ADD CONSTRAINT `FKsvanh5mcuhi77m3qxapat0ima` FOREIGN KEY (`pif_pif_id`) REFERENCES `plan_initial_financier` (`pif_id`);
--
-- Contraintes pour la table `projet_appel_offre`
--
ALTER TABLE `projet_appel_offre`
ADD CONSTRAINT `FKc0e8tqairth48mvul6c788ybh` FOREIGN KEY (`appel_offre_appel_id`) REFERENCES `appel_offre` (`appel_id`),
ADD CONSTRAINT `FKmp62v37eu0n5jxig3t5obwfby` FOREIGN KEY (`projet_projet_id`) REFERENCES `projet` (`projet_id`);
--
-- Contraintes pour la table `projet_factures`
--
ALTER TABLE `projet_factures`
ADD CONSTRAINT `FK2nb66ke4b2cjio49bttkwpd5w` FOREIGN KEY (`projet_projet_id`) REFERENCES `projet` (`projet_id`),
ADD CONSTRAINT `FK8ns5yda51qqq01bok3j7rlfn7` FOREIGN KEY (`factures_facture_id`) REFERENCES `facture` (`facture_id`);
--
-- Contraintes pour la table `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `FK5mm3qltw954x5a8p4v86hc05n` FOREIGN KEY (`profil_id_profil`) REFERENCES `profil` (`id_profil`);
--
-- Contraintes pour la table `user_projet`
--
ALTER TABLE `user_projet`
ADD CONSTRAINT `FKeug6udtaer5t246sw7v6apq74` FOREIGN KEY (`utilisateur_id`) REFERENCES `user` (`utilisateur_id`),
ADD CONSTRAINT `FKlcmfje77esrmu5c07w515upvn` FOREIGN KEY (`projet_id`) REFERENCES `projet` (`projet_id`);
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 */;
| true |
44c483fe8ed64d1d8b6a48eabdec991bc217bec6 | SQL | AslanKussein/htc-data-manager | /src/main/resources/db/migration/postgres/V20200618113300__Abzal_alter_purchase_data.sql | UTF-8 | 411 | 2.703125 | 3 | [] | no_license | alter table htc_dm_purchase_data
add column pay_type_id bigint default null,
add column payed_sum numeric(19, 2) default null,
add column payed_client_login varchar(255) default null,
add column is_payed boolean default false;
alter table htc_dm_purchase_data
add constraint htc_dm_purchase_data_htc_dm_dic_pay_type_id_fk
foreign key (pay_type_id) references htc_dm_dic_pay_type;
| true |
a911917ac1eb7aac188cef5c108fca5af26211fb | SQL | martlaus/kasutajaliidesed-api | /misc/database/createTables.sql | UTF-8 | 2,338 | 3.703125 | 4 | [] | no_license | USE kasutajaliidesedApi;
-- Drop tables
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS User;
DROP TABLE IF EXISTS Joke;
DROP TABLE IF EXISTS AuthenticatedUser;
DROP TABLE IF EXISTS Vote;
DROP TABLE IF EXISTS Comment;
SET foreign_key_checks = 1;
-- Create tables
CREATE TABLE User (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
code VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(255) NOT NULL,
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE Joke (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
joke TEXT NOT NULL,
added TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
user BIGINT,
upvotes BIGINT DEFAULT 0,
downvotes BIGINT DEFAULT 0,
FOREIGN KEY (user)
REFERENCES User (id)
ON DELETE RESTRICT
);
CREATE TABLE AuthenticatedUser (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
token VARCHAR(255) UNIQUE NOT NULL,
FOREIGN KEY (user_id)
REFERENCES User (id)
ON DELETE RESTRICT
);
CREATE TABLE Vote (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
joke_id BIGINT NOT NULL,
isUpvote BOOLEAN,
FOREIGN KEY (user_id)
REFERENCES User (id)
ON DELETE CASCADE,
FOREIGN KEY (joke_id)
REFERENCES Joke (id)
ON DELETE CASCADE,
UNIQUE KEY (user_id, joke_id, id)
);
CREATE TABLE Subject (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
name VARCHAR(255) UNIQUE NOT NULL,
FOREIGN KEY (user_id)
REFERENCES User (id)
ON DELETE RESTRICT
);
CREATE TABLE Homework (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
user BIGINT NOT NULL,
added TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
subject_id BIGINT NOT NULL,
FOREIGN KEY (user)
REFERENCES User (id)
ON DELETE CASCADE,
FOREIGN KEY (subject_id)
REFERENCES Subject (id)
ON DELETE CASCADE
);
CREATE TABLE Grade (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
grade BIGINT,
homework_id BIGINT NOT NULL,
FOREIGN KEY (user_id)
REFERENCES User (id)
ON DELETE RESTRICT,
FOREIGN KEY (homework_id)
REFERENCES Homework (id)
ON DELETE RESTRICT
);
| true |
31ff37b198521cf3c6578755e44c70ac7a0aaaac | SQL | iklu/PHP | /SQL/group.sql | UTF-8 | 405 | 3.65625 | 4 | [] | no_license | SELECT
locationState AS state,
locationCity AS city,
storeId AS store_id
FROM (
SELECT
locationState,
locationCity,
storeId
FROM stores
WHERE
locationState = 'TX'
OR locationCity = 'houston'
OR storeId = 75
GROUP BY
locationState
) AS stores
SELECT
locationState,
locationCity,
storeId
FROM stores
WHERE
locationState = 'TX'
OR locationCity = 'houston'
OR storeId = 75
GROUP BY
locationState
| true |
a85e52c80312f6fd91377b4bbe0c77a40775606a | SQL | jnguyen27/CMPS182 | /lab3/createindex.sql | UTF-8 | 180 | 2.9375 | 3 | [] | no_license | /* Create an index named LookUpPosts over the posterID and postDate columns (in that order) of the ChirpPosts table */
CREATE INDEX LookUpPosts ON ChirpPosts(posterID, postDate);
| true |
8a9ad94c5a31bc92d272c69e89e69f56b3b0484d | SQL | lirance/errands | /src/main/resources/sql/errands.sql | UTF-8 | 1,385 | 3.546875 | 4 | [] | no_license |
------------------------------------
DROP TABLE IF EXISTS `user_order`;
DROP TABLE IF EXISTS `user`;
DROP TABLE IF EXISTS `order`;
------------------------------------
--user table
CREATE TABLE `user` (
`userId` int(20) NOT NULL AUTO_INCREMENT,
`userName` varchar(40) NOT NULL,
`password` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL unique ,
`address` varchar(255) NOT NULL,
`rateNumber` int(20) NOT NULL ,
`averageRate` float (7,2),
PRIMARY KEY (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
------------------------------------
--order table
CREATE TABLE `order` (
`orderId` int(20) NOT NULL AUTO_INCREMENT,
`itemList` varchar(255) NOT NULL,
`storeAdd` varchar(255) NOT NULL,
`destination` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`timeLimit` int(255) DEFAULT 1,
`tip` float (7,2) NOT NULL,
PRIMARY KEY (`orderId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-------------------------------------
--user_order table
CREATE TABLE `user_order` (
`userId` int(20) NOT NULL,
`orderId` int(20) NOT NULL,
`rateFlag` boolean DEFAULT 0,
`orderMaker` boolean DEFAULT 1,
`rate` float (7,2),
CONSTRAINT PK_UO PRIMARY KEY (`orderId`,`userId`),
FOREIGN KEY fk_oId(orderId) REFERENCES `order`(orderId),
FOREIGN KEY fk_uId(userId) REFERENCES `user`(userId)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
063630d161005a26c6d7417537fe1116ce03fc48 | SQL | mdecourci/spark_scala_example | /report-daily.sql | UTF-8 | 344 | 3.734375 | 4 | [] | no_license | SELECT count(PRODUCT_SOLD_ID) FROM SALES;
SELECT * FROM (
SELECT sum(s.SOLD_PRICE) as total, s.PRODUCT_SOLD_ID FROM dev.SALES s
group by s.PRODUCT_SOLD_ID) p order by p.total desc LIMIT 1;
SELECT * FROM (
SELECT count(s.PRODUCT_SOLD_ID) as total, s.PRODUCT_SOLD_ID FROM dev.SALES s
group by s.PRODUCT_SOLD_ID) p order by p.total desc LIMIT 1; | true |
69108a37706f801c2477e97df05b2a69a6d500be | SQL | ClickHouse/ClickHouse | /tests/queries/0_stateless/01278_alter_rename_combination.sql | UTF-8 | 1,629 | 3.828125 | 4 | [
"Apache-2.0",
"BSL-1.0"
] | permissive | DROP TABLE IF EXISTS rename_table;
CREATE TABLE rename_table (key Int32, value1 Int32, value2 Int32) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part=0;
INSERT INTO rename_table VALUES (1, 2, 3);
-- replace one with other
ALTER TABLE rename_table RENAME COLUMN value1 TO old_value1, RENAME COLUMN value2 TO value1;
SHOW CREATE TABLE rename_table;
SELECT * FROM rename_table FORMAT TSVWithNames;
INSERT INTO rename_table VALUES (4, 5, 6);
-- rename all columns simultaneously
ALTER TABLE rename_table RENAME COLUMN old_value1 TO v1, RENAME COLUMN value1 TO v2, RENAME COLUMN key to k;
SHOW CREATE TABLE rename_table;
SELECT * FROM rename_table ORDER BY k FORMAT TSVWithNames;
DROP TABLE IF EXISTS rename_table;
SELECT '---polymorphic---';
DROP TABLE IF EXISTS rename_table_polymorphic;
CREATE TABLE rename_table_polymorphic (
key Int32,
value1 Int32,
value2 Int32
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS min_rows_for_wide_part = 10000;
INSERT INTO rename_table_polymorphic VALUES (1, 2, 3);
ALTER TABLE rename_table_polymorphic RENAME COLUMN value1 TO old_value1, RENAME COLUMN value2 TO value1;
SHOW CREATE TABLE rename_table_polymorphic;
SELECT * FROM rename_table_polymorphic FORMAT TSVWithNames;
INSERT INTO rename_table_polymorphic VALUES (4, 5, 6);
-- rename all columns simultaneously
ALTER TABLE rename_table_polymorphic RENAME COLUMN old_value1 TO v1, RENAME COLUMN value1 TO v2, RENAME COLUMN key to k;
SHOW CREATE TABLE rename_table_polymorphic;
SELECT * FROM rename_table_polymorphic ORDER BY k FORMAT TSVWithNames;
DROP TABLE IF EXISTS rename_table_polymorphic;
| true |
1d6ebfe521a113fe21a6b50259eb68bb59b5a37a | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day18/select2032.sql | UTF-8 | 178 | 2.671875 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-17T20:32:00Z' AND timestamp<'2017-11-18T20:32:00Z' AND temperature>=46 AND temperature<=49
| true |
f59235caa5080cbef9e12be89bcd947d38a059a3 | SQL | jenniferaguirre/handlebars | /db/schema.sql | UTF-8 | 292 | 3.015625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS burgers_db;
USE burgers_db;
DROP TABLE IF EXISTS burgers;
CREATE TABLE burgers (
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(255) NOT NULL,
createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
| true |
e1b390ce585bc09aefc26f53dae44683b06ddd27 | SQL | muhamadanwarsaputra/CRUDwithLoginPhp | /db_skkni.sql | UTF-8 | 2,264 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 27 Mar 2019 pada 17.09
-- Versi Server: 10.1.21-MariaDB
-- PHP Version: 5.6.30
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: `db_skkni`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_nilai`
--
CREATE TABLE `tb_nilai` (
`id` int(10) NOT NULL,
`nama` varchar(30) NOT NULL,
`nilaiTugas` int(3) NOT NULL,
`nilaiUts` int(3) NOT NULL,
`nilaiUas` int(3) NOT NULL,
`hasil` char(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tb_nilai`
--
INSERT INTO `tb_nilai` (`id`, `nama`, `nilaiTugas`, `nilaiUts`, `nilaiUas`, `hasil`) VALUES
(12, 'Muhamad Anwar Saputra', 90, 90, 90, 'A');
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(255) NOT NULL,
`created_at` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `created_at`) VALUES
(1, 'anwar', '$2y$10$OweM9PePgniAYemy5tvjUOxtntRu2lZ6zuRPiyEbXhzlQsda68eqG', '2019-03-27 22:06:20');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tb_nilai`
--
ALTER TABLE `tb_nilai`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tb_nilai`
--
ALTER TABLE `tb_nilai`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
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 */;
| true |
4a1fcc9a778a2e9d8220811f6c310f6cf878bce0 | SQL | OnePlc/PLC_X_Article_Number_Autoincrement | /data/install.sql | UTF-8 | 797 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | --
-- Add custom art nr to article structure
--
ALTER TABLE `article` ADD `custom_art_nr` VARCHAR(50) NOT NULL DEFAULT '' AFTER `label`;
--
-- add new readonly field to form
--
INSERT INTO `core_form_field` (`Field_ID`, `type`, `label`, `fieldkey`, `tab`, `form`, `class`, `url_view`, `url_list`, `show_widget_left`, `allow_clear`, `readonly`, `tbl_cached_name`, `tbl_class`, `tbl_permission`) VALUES
(NULL, 'text', 'Custom Art Nr', 'custom_art_nr', 'article-base', 'article-single', 'col-md-2', '', '', '0', '1', '1', '', '', '');
--
-- add number prefix option
--
INSERT INTO `settings` (`settings_key`, `settings_value`) VALUES ('article-number-prefix', '');
--
-- add current number option
--
INSERT INTO `settings` (`settings_key`, `settings_value`) VALUES ('article-number-current', '1'); | true |
7cfb21bf12808d49d3255685daeac241b0179958 | SQL | slybag/LegoManager | /LegoManager-backend/src/main/resources/testdata.sql | UTF-8 | 5,776 | 2.609375 | 3 | [] | no_license | -- categories
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (1, 'Category for star wars themed items', 'Star Wars');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (2, 'Category for Duplo themed items', 'duplo');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (3, 'Category for Marvel super hero themed items', 'Super Heroes Marvel');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (4, 'Category for DC Comics super hero themed items', 'Super Heroes DC');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (5, 'Category for City themed items', 'City');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (6, 'Category for Minecraft themed kits', 'Minecraft');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (7, 'Category for junior themed items', 'Juniors');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (8, 'Category for Disney themed items', 'Disney');
INSERT INTO PA165.CATEGORY (ID, DESCRIPTION, "NAME") VALUES (9, 'Category for Lego Movie themed items', 'Lego Movie');
-- kits
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (1, 10, 'TIE Advanced Prototype', 2100);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (2, 10, 'AT-AT', 3250);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (3, 10, 'Imperial Star Destroyer', 7850);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (4, 12, 'Republic AV-7 Anti-Vehicle Cannon', 5490);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (5, 14, 'Batman kills Joker', 2800);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (6, 9, 'Superman saves people', 3250);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (7, 9, 'X-Men vs. The Sentinel', 4250);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (8, 6, 'Fire Helicopter', 2800);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (9, 6, 'Police station', 8890);
INSERT INTO PA165.LEGOKIT (ID, AGERESTRICTION, "NAME", PRICE) VALUES (10,6, 'Arctic ice-breaker', 8250);
-- sets
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (1, 'Star Wars: Clone Wars', 14450);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (2, 'Star Wars: Rebels',17800);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (3, 'Batman',12820);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (4, 'Superman',13120);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (5, 'Fireman',14520);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (6, 'Police',12121);
INSERT INTO PA165.LEGOSET (ID, "NAME", PRICE) VALUES (7, 'Arctic circle',12800);
--pieces
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (1,'BLACK');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (2,'WHITE');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (3,'YELLOW');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (4,'PURPLE');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (5,'GREEN');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (6,'VIOLET');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (7,'GREY');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (8,'BLACK');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (9,'BLACK');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (10,'BLACK');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (11,'BLACK');
INSERT INTO PA165.LEGOPIECE (ID,COLOR) VALUES (12,'BLACK');
--category-kit
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(1,1);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(1,2);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(1,3);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(1,4);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(4,5);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(4,6);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(5,8);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(5,9);
INSERT INTO PA165.CATEGORY_LEGOKIT (CATEGORIES_ID,LEGOKITS_ID) VALUES(5,10);
--category-set
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(1,1);
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(1,2);
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(4,3);
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(5,5);
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(5,6);
INSERT INTO PA165.CATEGORY_LEGOSET (CATEGORIES_ID,LEGOSETS_ID) VALUES(5,7);
--kit-piece
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,1);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,3);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,4);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,5);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,6);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,7);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,8);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,9);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,10);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,11);
INSERT INTO PA165.LEGOKIT_LEGOPIECE (LEGOKITS_ID,LEGOPIECES_ID) VALUES(1,12);
--set-kit
INSERT INTO PA165.LEGOSET_LEGOKIT (LEGOSETS_ID,LEGOKITS_ID) VALUES(1,1);
INSERT INTO PA165.LEGOSET_LEGOKIT (LEGOSETS_ID,LEGOKITS_ID) VALUES(1,2);
INSERT INTO PA165.LEGOSET_LEGOKIT (LEGOSETS_ID,LEGOKITS_ID) VALUES(1,3);
INSERT INTO PA165.LEGOSET_LEGOKIT (LEGOSETS_ID,LEGOKITS_ID) VALUES(2,4);
| true |
3972f07959b5d577deb525af56c7196ac8c08d1f | SQL | misoten-iw-g2/lovechan | /go/src/app/migrations/5_requests.sql | UTF-8 | 508 | 3.046875 | 3 | [
"MIT"
] | permissive | -- +migrate Up
CREATE TABLE requests
(
id bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
request_display varchar(100) NOT NULL COMMENT 'リクエスト表示名',
request varchar(200) NOT NULL COMMENT 'リクエスト',
video_file_name varchar(100) NOT NULL COMMENT '動画ファイル名',
voice_file_name varchar(100) NOT NULL COMMENT '音声ファイル名',
PRIMARY KEY (id)
) COMMENT = 'リクエストの選択肢' COLLATE='utf8mb4_general_ci' ENGINE=InnoDB;
-- +migrate Down
DROP TABLE requests;
| true |
2eae5f656474e922c8cc72084aee10bca06ae3cc | SQL | sahasrara62/quizmania | /finaldata.sql | UTF-8 | 26,571 | 2.5625 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 21, 2016 at 07:58 PM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.5.38
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: `finaldata`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`email` varchar(50) NOT NULL,
`password` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`email`, `password`) VALUES
('vic@gmail.com', '123456'),
('admin@quizmania.com', 'admin');
-- --------------------------------------------------------
--
-- Table structure for table `answer`
--
CREATE TABLE `answer` (
`qid` text NOT NULL,
`ansid` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `answer`
--
INSERT INTO `answer` (`qid`, `ansid`) VALUES
('55892169bf6a7', '55892169d2efc'),
('5589216a3646e', '5589216a48722'),
('558922117fcef', '5589221195248'),
('55892211e44d5', '55892211f1fa7'),
('558922894c453', '558922895ea0a'),
('558922899ccaa', '55892289aa7cf'),
('558923538f48d', '558923539a46c'),
('55892353f05c4', '55892354051be'),
('558973f4389ac', '558973f462e61'),
('558973f4c46f2', '558973f4d4abe'),
('558973f51600d', '558973f526fc5'),
('558973f55d269', '558973f57af07'),
('558973f5abb1a', '558973f5e764a'),
('5589751a63091', '5589751a81bf4'),
('5589751ad32b8', '5589751adbdbd'),
('5589751b304ef', '5589751b3b04d'),
('5589751b749c9', '5589751b9a98c'),
('5783ebfe9b6a7', '5783ebfeb332a'),
('5783ebfecd4ae', '5783ebfed3740'),
('5783f1467b86f', '5783f1469452f'),
('5783f214d9318', '5783f21508897'),
('5783f31c83a0e', '5783f31c9b845'),
('5783f440ea479', '5783f4410cdee'),
('5783f494991b7', '5783f4949e7de'),
('5783f4e4ca1b8', '5783f4e5e2a69'),
('5783f52d666ab', '5783f52d7ffb9'),
('5783f59ebeaf3', '5783f59ecafd5'),
('578471184e603', '578471185984a'),
('57847e66a52aa', '5783f63f8c870'),
('57847e811cc8c', '5784711859837'),
('57847ef401bc1', '5784711859844'),
('57847f324b9d9', '5784711859843'),
('57847f46b74fc', '578471185984a'),
('57847f94e98c0', '578471185984a'),
('5784d30e9aca8', '5783f63f8c864'),
('5784d33df1f8e', '5783f60fe2763'),
('5784d374b1066', '5783f60fe2755'),
('5784d3f62ab5c', '5783f60fe2765'),
('5784d41810c8f', '5783f60fe2765'),
('578504f72cfc9', '578504f7374df'),
('5785051a84007', '5785051a90064'),
('5785053017fe1', '5785053021ee5'),
('5785053f3f014', '5785053f48084'),
('5785054e9d444', '5785054ea37d0'),
('5785055e64856', '5785055e73b1e'),
('5785056d2471a', '5785056d2ba9e'),
('5785057b4b8e6', '5785057b51087'),
('5785fc054a353', '5785fc0567936'),
('5785fc057ab38', '5785fc057ffaf'),
('5785fc0593240', '5785fc059c792'),
('578636c5326b7', '578636c54a439'),
('578636c5683ce', '578636c56d84f'),
('578636c57b3ae', '578636c57df05'),
('578636c590f0b', '578636c59d188'),
('578636c5b6faa', '578636c5b97f5'),
('578636c5e5e33', '578636c5ed3eb'),
('578639e454eeb', '578639e46d30b'),
('578639e4a561e', '578639e4bc9ef'),
('578639e4d0c94', '578639e4d3a92'),
('578639e4e9390', '578639e4ec11e'),
('578639e50ac3c', '578639e517261'),
('578639e52b54d', '578639e52e314'),
('57863e0c78fd7', '57863e0c8da97'),
('57863e0cb0fec', '57863e0cb38d1'),
('57863e0cc6b30', '57863e0cc94b2'),
('57863e0cd6fe2', '57863e0cdefbc'),
('57863e0d1640e', '57863e0d198d5'),
('57863e0d2942c', '57863e0d2c219');
-- --------------------------------------------------------
--
-- Table structure for table `graph`
--
CREATE TABLE `graph` (
`eid` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`performace` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `history`
--
CREATE TABLE `history` (
`email` varchar(50) NOT NULL,
`eid` text NOT NULL,
`score` int(11) NOT NULL,
`level` int(11) NOT NULL,
`sahi` int(11) NOT NULL,
`wrong` int(11) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `history`
--
INSERT INTO `history` (`email`, `eid`, `score`, `level`, `sahi`, `wrong`, `date`) VALUES
('sunnygkp10@gmail.com', '558921841f1ec', 4, 2, 2, 0, '2015-06-23 09:31:26'),
('sunnygkp10@gmail.com', '558920ff906b8', 4, 2, 2, 0, '2015-06-23 13:32:09'),
('avantika420@gmail.com', '558921841f1ec', 4, 2, 2, 0, '2015-06-23 14:33:04'),
('avantika420@gmail.com', '5589222f16b93', 4, 2, 2, 0, '2015-06-23 14:49:39'),
('sunnygkp10@gmail.com', '5589741f9ed52', 4, 5, 3, 2, '2015-06-23 15:07:16'),
('mi5@hollywood.com', '5589222f16b93', 4, 2, 2, 0, '2015-06-23 15:12:56'),
('nik1@gmail.com', '558921841f1ec', 1, 2, 1, 1, '2015-06-23 16:11:50'),
('sunnygkp10@gmail.com', '5589222f16b93', 1, 2, 1, 1, '2015-06-24 03:22:38'),
('vikaskashyap431@gmail.com', '5589741f9ed52', -2, 5, 1, 4, '2016-07-07 05:56:38'),
('vic@gmail.com', '5589741f9ed52', -4, 4, 0, 4, '2016-07-11 04:08:44'),
('1234@gmail.com', '558920ff906b8', -2, 2, 0, 2, '2016-07-13 03:52:41'),
('1234@gmail.com', '558922ec03021', -3, 2, 0, 3, '2016-07-13 08:17:40'),
('1234@gmail.com', '55897338a6659', 1, 5, 2, 3, '2016-07-13 05:20:53'),
('1234@gmail.com', '558921841f1ec', -2, 2, 0, 2, '2016-07-13 05:22:08'),
('1234@gmail.com', '5589741f9ed52', 4, 5, 3, 2, '2016-07-13 05:22:56'),
('1234@gmail.com', '5589222f16b93', 4, 2, 2, 0, '2016-07-13 08:18:05'),
('1234@gmail.com', '5785fae973ffc', 0, 3, 1, 2, '2016-07-13 08:37:31'),
('bharatpuri30@gmail.com', '5589741f9ed52', -5, 5, 0, 5, '2016-07-13 11:44:50'),
('bharatpuri30@gmail.com', '558921841f1ec', 4, 2, 2, 0, '2016-07-13 11:46:25'),
('bharatpuri30@gmail.com', '5589222f16b93', 4, 2, 2, 0, '2016-07-13 11:47:57'),
('bharatpuri30@gmail.com', '5786345703e7a', 9, 6, 5, 1, '2016-07-13 12:55:39'),
('bharatpuri30@gmail.com', '57863717b5520', 9, 6, 5, 1, '2016-07-13 13:15:18'),
('bharatpuri30@gmail.com', '57863b542d485', 12, 6, 6, 0, '2016-07-14 01:52:00');
-- --------------------------------------------------------
--
-- Table structure for table `options`
--
CREATE TABLE `options` (
`qid` varchar(50) NOT NULL,
`option` varchar(5000) NOT NULL,
`optionid` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `options`
--
INSERT INTO `options` (`qid`, `option`, `optionid`) VALUES
('55892169bf6a7', 'usermod', '55892169d2efc'),
('55892169bf6a7', 'useradd', '55892169d2f05'),
('55892169bf6a7', 'useralter', '55892169d2f09'),
('55892169bf6a7', 'groupmod', '55892169d2f0c'),
('5589216a3646e', '751', '5589216a48713'),
('5589216a3646e', '752', '5589216a4871a'),
('5589216a3646e', '754', '5589216a4871f'),
('5589216a3646e', '755', '5589216a48722'),
('558922117fcef', 'echo', '5589221195248'),
('558922117fcef', 'print', '558922119525a'),
('558922117fcef', 'printf', '5589221195265'),
('558922117fcef', 'cout', '5589221195270'),
('55892211e44d5', 'int a', '55892211f1f97'),
('55892211e44d5', '$a', '55892211f1fa7'),
('55892211e44d5', 'long int a', '55892211f1fb4'),
('55892211e44d5', 'int a$', '55892211f1fbd'),
('558922894c453', 'cin>>a;', '558922895ea0a'),
('558922894c453', 'cin<<a;', '558922895ea26'),
('558922894c453', 'cout>>a;', '558922895ea34'),
('558922894c453', 'cout<a;', '558922895ea41'),
('558922899ccaa', 'cout', '55892289aa7cf'),
('558922899ccaa', 'cin', '55892289aa7df'),
('558922899ccaa', 'print', '55892289aa7eb'),
('558922899ccaa', 'printf', '55892289aa7f5'),
('558923538f48d', '255.0.0.0', '558923539a46c'),
('558923538f48d', '255.255.255.0', '558923539a480'),
('558923538f48d', '255.255.0.0', '558923539a48b'),
('558923538f48d', 'none of these', '558923539a495'),
('55892353f05c4', '192.168.1.100', '5589235405192'),
('55892353f05c4', '172.168.16.2', '55892354051a3'),
('55892353f05c4', '10.0.0.0.1', '55892354051b4'),
('55892353f05c4', '11.11.11.11', '55892354051be'),
('558973f4389ac', 'containing root file-system required during bootup', '558973f462e44'),
('558973f4389ac', ' Contains only scripts to be executed during bootup', '558973f462e56'),
('558973f4389ac', ' Contains root-file system and drivers required to be preloaded during bootup', '558973f462e61'),
('558973f4389ac', 'None of the above', '558973f462e6b'),
('558973f4c46f2', 'Kernel', '558973f4d4abe'),
('558973f4c46f2', 'Shell', '558973f4d4acf'),
('558973f4c46f2', 'Commands', '558973f4d4ad9'),
('558973f4c46f2', 'Script', '558973f4d4ae3'),
('558973f51600d', 'Boot Loading', '558973f526f9d'),
('558973f51600d', ' Boot Record', '558973f526fb9'),
('558973f51600d', ' Boot Strapping', '558973f526fc5'),
('558973f51600d', ' Booting', '558973f526fce'),
('558973f55d269', ' Quick boot', '558973f57aef1'),
('558973f55d269', 'Cold boot', '558973f57af07'),
('558973f55d269', ' Hot boot', '558973f57af17'),
('558973f55d269', ' Fast boot', '558973f57af27'),
('558973f5abb1a', 'bash', '558973f5e7623'),
('558973f5abb1a', ' Csh', '558973f5e7636'),
('558973f5abb1a', ' ksh', '558973f5e7640'),
('558973f5abb1a', ' sh', '558973f5e764a'),
('5589751a63091', 'q', '5589751a81bd6'),
('5589751a63091', 'wq', '5589751a81be8'),
('5589751a63091', ' both (a) and (b)', '5589751a81bf4'),
('5589751a63091', ' none of the mentioned', '5589751a81bfd'),
('5589751ad32b8', ' moves screen down one page', '5589751adbdbd'),
('5589751ad32b8', 'moves screen up one page', '5589751adbdce'),
('5589751ad32b8', 'moves screen up one line', '5589751adbdd8'),
('5589751ad32b8', ' moves screen down one line', '5589751adbde2'),
('5589751b304ef', ' yy', '5589751b3b04d'),
('5589751b304ef', 'yw', '5589751b3b05e'),
('5589751b304ef', 'yc', '5589751b3b069'),
('5589751b304ef', ' none of the mentioned', '5589751b3b073'),
('5589751b749c9', 'X', '5589751b9a98c'),
('5589751b749c9', 'x', '5589751b9a9a5'),
('5589751b749c9', 'D', '5589751b9a9b7'),
('5589751b749c9', 'd', '5589751b9a9c9'),
('5589751bd02ec', 'autoindentation is not possible in vi editor', '5589751bdadaa'),
('5783ebfe9b6a7', ' zd', '5783ebfeb331b'),
('5783ebfe9b6a7', 'cd z', '5783ebfeb332a'),
('5783ebfe9b6a7', 'cx ', '5783ebfeb332c'),
('5783ebfe9b6a7', 'c xz', '5783ebfeb332d'),
('5783ebfecd4ae', 'zdfv', '5783ebfed3734'),
('5783ebfecd4ae', 'dvzv', '5783ebfed3740'),
('5783ebfecd4ae', 'dfvz', '5783ebfed3742'),
('5783ebfecd4ae', 'dvf', '5783ebfed3747'),
('5783f1467b86f', 'qw', '5783f1469451f'),
('5783f1467b86f', 'qwe', '5783f1469452d'),
('5783f1467b86f', 'kabir', '5783f1469452f'),
('5783f1467b86f', 'qwert', '5783f14694530'),
('5783f214d9318', 'qqqqq', '5783f2150887b'),
('5783f214d9318', 'qwere', '5783f2150888f'),
('5783f214d9318', 'dvvdvf', '5783f21508894'),
('5783f214d9318', 'vvvvvvvvvvvvvvvvv', '5783f21508897'),
('5783f31c83a0e', 'optiona', '5783f31c9b83a'),
('5783f31c83a0e', 'optionb', '5783f31c9b845'),
('5783f31c83a0e', 'optionc', '5783f31c9b848'),
('5783f31c83a0e', 'optiond', '5783f31c9b84a'),
('5783f440ea479', '1', '5783f4410cddf'),
('5783f440ea479', '2', '5783f4410cdee'),
('5783f440ea479', '3', '5783f4410cdf0'),
('5783f440ea479', '4', '5783f4410cdf1'),
('5783f494991b7', '1', '5783f4949e7d2'),
('5783f494991b7', '2', '5783f4949e7de'),
('5783f494991b7', '3', '5783f4949e7df'),
('5783f494991b7', '4', '5783f4949e7e1'),
('5783f4e4ca1b8', '1', '5783f4e5e2a5b'),
('5783f4e4ca1b8', '2', '5783f4e5e2a69'),
('5783f4e4ca1b8', '3', '5783f4e5e2a6c'),
('5783f4e4ca1b8', '4', '5783f4e5e2a6e'),
('5783f52d666ab', 'x1', '5783f52d7ffa3'),
('5783f52d666ab', 'x2', '5783f52d7ffb5'),
('5783f52d666ab', 'x3', '5783f52d7ffb9'),
('5783f52d666ab', 'x4', '5783f52d7ffbc'),
('5783f59ebeaf3', '12', '5783f59ecafc2'),
('5783f59ebeaf3', '23', '5783f59ecafd2'),
('5783f59ebeaf3', '34', '5783f59ecafd4'),
('5783f59ebeaf3', '45', '5783f59ecafd5'),
('578471184e603', 'optionvic1', '5784711859837'),
('578471184e603', 'optionvic2', '5784711859843'),
('578471184e603', 'optionvic3', '5784711859844'),
('578471184e603', 'optionvic4', '578471185984a'),
('578504f72cfc9', 'testing', '578504f7374d4'),
('578504f72cfc9', 'testing', '578504f7374df'),
('578504f72cfc9', 'testing', '578504f7374e2'),
('578504f72cfc9', 'testing', '578504f7374e3'),
('5785051a84007', 'testing', '5785051a9003b'),
('5785051a84007', 'testing', '5785051a90061'),
('5785051a84007', 'testing', '5785051a90064'),
('5785051a84007', 'testing', '5785051a90066'),
('5785053017fe1', 'testing', '5785053021eda'),
('5785053017fe1', 'testing', '5785053021ee5'),
('5785053017fe1', 'testing', '5785053021ee7'),
('5785053017fe1', 'testing', '5785053021ee9'),
('5785053f3f014', 'testing', '5785053f48075'),
('5785053f3f014', 'testing', '5785053f48081'),
('5785053f3f014', 'testing', '5785053f48082'),
('5785053f3f014', 'testing', '5785053f48084'),
('5785054e9d444', 'testing', '5785054ea37c3'),
('5785054e9d444', 'testing', '5785054ea37d0'),
('5785054e9d444', 'testing', '5785054ea37d6'),
('5785054e9d444', 'testing', '5785054ea37d8'),
('5785055e64856', 'testing', '5785055e73b12'),
('5785055e64856', 'testing', '5785055e73b1e'),
('5785055e64856', 'testing', '5785055e73b21'),
('5785055e64856', 'testing', '5785055e73b23'),
('5785056d2471a', 'testing', '5785056d2ba8f'),
('5785056d2471a', 'testing', '5785056d2ba9c'),
('5785056d2471a', 'testing', '5785056d2ba9e'),
('5785056d2471a', 'testing', '5785056d2baa1'),
('5785057b4b8e6', 'testing', '5785057b5107c'),
('5785057b4b8e6', 'testing', '5785057b51087'),
('5785057b4b8e6', 'testing', '5785057b51089'),
('5785057b4b8e6', 'testing', '5785057b5108b'),
('5785fc054a353', 'select', '5785fc0567928'),
('5785fc054a353', 'list', '5785fc0567933'),
('5785fc054a353', 'dropdown', '5785fc0567936'),
('5785fc054a353', 'all of above', '5785fc056793a'),
('5785fc057ab38', '"head"', '5785fc057ff9d'),
('5785fc057ab38', '"body"', '5785fc057ffa8'),
('5785fc057ab38', '"web"', '5785fc057ffac'),
('5785fc057ab38', '"html"', '5785fc057ffaf'),
('5785fc0593240', 'bold', '5785fc059c780'),
('5785fc0593240', 'italic', '5785fc059c78c'),
('5785fc0593240', 'underline', '5785fc059c78f'),
('5785fc0593240', 'unordered list', '5785fc059c792'),
('578636c5326b7', 'picture', '578636c54a422'),
('578636c5326b7', 'image', '578636c54a433'),
('578636c5326b7', 'img', '578636c54a439'),
('578636c5326b7', 'src', '578636c54a43f'),
('578636c5683ce', 'html', '578636c56d83e'),
('578636c5683ce', 'head', '578636c56d84f'),
('578636c5683ce', 'title', '578636c56d856'),
('578636c5683ce', 'body', '578636c56d85c'),
('578636c57b3ae', 'th', '578636c57def4'),
('578636c57b3ae', 'tr', '578636c57df05'),
('578636c57b3ae', 'td', '578636c57df0b'),
('578636c57b3ae', 'tn', '578636c57df11'),
('578636c590f0b', 'ul tag', '578636c59d177'),
('578636c590f0b', 'ol tag', '578636c59d188'),
('578636c590f0b', 'list tag', '578636c59d18e'),
('578636c590f0b', 'dl tag', '578636c59d193'),
('578636c5b6faa', ' visited link', '578636c5b97f5'),
('578636c5b6faa', 'virtual link', '578636c5b9805'),
('578636c5b6faa', ' very good link', '578636c5b980b'),
('578636c5b6faa', ' active link', '578636c5b9810'),
('578636c5e5e33', 'class', '578636c5ed3d9'),
('578636c5e5e33', 'id', '578636c5ed3eb'),
('578636c5e5e33', 'dot', '578636c5ed3f1'),
('578636c5e5e33', 'all of above', '578636c5ed3f7'),
('578639e454eeb', ' RMI', '578639e46d2fb'),
('578639e454eeb', 'triggering event', '578639e46d308'),
('578639e454eeb', 'function/method', '578639e46d30b'),
('578639e454eeb', 'preprocessor', '578639e46d30e'),
('578639e4a561e', ' Syntax error', '578639e4bc9d9'),
('578639e4a561e', ' Missing of semicolons', '578639e4bc9e9'),
('578639e4a561e', 'Division by zero', '578639e4bc9ef'),
('578639e4a561e', ' All of the above', '578639e4bc9f2'),
('578639e4d0c94', 'Floating numbers', '578639e4d3a7e'),
('578639e4d0c94', ' Representation of functions that returns a value', '578639e4d3a8b'),
('578639e4d0c94', ' f is not present in JavaScript', '578639e4d3a8f'),
('578639e4d0c94', ' Form feed', '578639e4d3a92'),
('578639e4e9390', 'event type', '578639e4ec11e'),
('578639e4e9390', 'even target', '578639e4ec12a'),
('578639e4e9390', 'Both a and b', '578639e4ec12e'),
('578639e4e9390', ' None of the mentioned', '578639e4ec131'),
('578639e50ac3c', 'function', '578639e517261'),
('578639e50ac3c', 'interface', '578639e51726d'),
('578639e50ac3c', 'event', '578639e517271'),
('578639e50ac3c', 'handler', '578639e517274'),
('578639e52b54d', 'target', '578639e52e305'),
('578639e52b54d', 'type', '578639e52e314'),
('578639e52b54d', 'manner', '578639e52e31a'),
('578639e52b54d', 'all of above', '578639e52e31f'),
('57863e0c78fd7', 'echo"message"', '57863e0c8da97'),
('57863e0c78fd7', 'cout<<message', '57863e0c8daa8'),
('57863e0c78fd7', 'cin>>message', '57863e0c8daae'),
('57863e0c78fd7', 'non of above', '57863e0c8dab4'),
('57863e0cb0fec', 'Hypertext Preprocessor', '57863e0cb38d1'),
('57863e0cb0fec', 'Pre Hypertext Processor', '57863e0cb38e2'),
('57863e0cb0fec', ' Pre Hyper Processor', '57863e0cb38e7'),
('57863e0cb0fec', 'Pre Hypertext Process', '57863e0cb38ea'),
('57863e0cc6b30', 'Pond-sign', '57863e0cc9499'),
('57863e0cc6b30', 'yen-sign', '57863e0cc94ac'),
('57863e0cc6b30', 'dollar-sign', '57863e0cc94b2'),
('57863e0cc6b30', 'euro-sign', '57863e0cc94b7'),
('57863e0cd6fe2', 'store persistent user preference on a site', '57863e0cdefa2'),
('57863e0cd6fe2', ' save user authentication information from page to page', '57863e0cdefb2'),
('57863e0cd6fe2', 'create multipage forms', '57863e0cdefb7'),
('57863e0cd6fe2', 'all of above', '57863e0cdefbc'),
('57863e0d1640e', ' array_diff', '57863e0d198d5'),
('57863e0d1640e', ' diff_array ', '57863e0d198e5'),
('57863e0d1640e', ' arrays_diff', '57863e0d198eb'),
('57863e0d1640e', ' diff_arrays', '57863e0d198f1'),
('57863e0d2942c', 'MYSQL', '57863e0d2c206'),
('57863e0d2942c', 'IBM DB/2', '57863e0d2c212'),
('57863e0d2942c', 'POSTGRESQL', '57863e0d2c216'),
('57863e0d2942c', 'NONE OF ABOVE', '57863e0d2c219');
-- --------------------------------------------------------
--
-- Table structure for table `php`
--
CREATE TABLE `php` (
`Type` varchar(20) NOT NULL,
`Level` varchar(8) NOT NULL,
`Question` varchar(500) NOT NULL,
`Option_A` varchar(300) NOT NULL,
`Option_B` varchar(300) NOT NULL,
`Option_C` varchar(300) NOT NULL,
`Option_D` varchar(300) NOT NULL,
`Correct_Answer` varchar(300) NOT NULL,
`Question_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `questions`
--
CREATE TABLE `questions` (
`eid` text NOT NULL,
`qid` text NOT NULL,
`qns` text NOT NULL,
`choice` int(10) NOT NULL,
`sn` int(11) NOT NULL,
`Type` varchar(20) NOT NULL,
`Level` varchar(8) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `questions`
--
INSERT INTO `questions` (`eid`, `qid`, `qns`, `choice`, `sn`, `Type`, `Level`) VALUES
('558920ff906b8', '55892169bf6a7', 'what is command for changing user information??', 4, 1, '', ''),
('558920ff906b8', '5589216a3646e', 'what is permission for view only for other??', 4, 2, '', ''),
('558921841f1ec', '558922117fcef', 'what is command for print in php??', 4, 1, '', ''),
('558921841f1ec', '55892211e44d5', 'which is a variable of php??', 4, 2, '', ''),
('5589222f16b93', '558922894c453', 'what is correct statement in c++??', 4, 1, '', ''),
('5589222f16b93', '558922899ccaa', 'which command is use for print the output in c++?', 4, 2, '', ''),
('558922ec03021', '558923538f48d', 'what is correct mask for A class IP???', 4, 1, '', ''),
('558922ec03021', '55892353f05c4', 'which is not a private IP??', 4, 2, '', ''),
('55897338a6659', '558973f4389ac', 'On Linux, initrd is a file', 4, 1, '', ''),
('55897338a6659', '558973f4c46f2', 'Which is loaded into memory when system is booted?', 4, 2, '', ''),
('55897338a6659', '558973f51600d', ' The process of starting up a computer is known as', 4, 3, '', ''),
('55897338a6659', '558973f55d269', ' Bootstrapping is also known as', 4, 4, '', ''),
('55897338a6659', '558973f5abb1a', 'The shell used for Single user mode shell is:', 4, 5, '', ''),
('5589741f9ed52', '5589751a63091', ' Which command is used to close the vi editor?', 4, 1, '', ''),
('5589741f9ed52', '5589751ad32b8', ' In vi editor, the key combination CTRL+f', 4, 2, '', ''),
('5589741f9ed52', '5589751b304ef', ' Which vi editor command copies the current line of the file?', 4, 3, '', ''),
('5589741f9ed52', '5589751b749c9', ' Which command is used to delete the character before the cursor location in vi editor?', 4, 4, '', ''),
('5589741f9ed52', '5589751bd02ec', ' Which one of the following statement is true?', 4, 5, '', ''),
('5786345703e7a', '578636c5326b7', 'A webpage displays a picture. What tag was used to display that picture?', 4, 1, 'HTML', 'level1'),
('5786345703e7a', '578636c5683ce', 'Tags and test that are not directly displayed on the page are written in _____ section.', 4, 2, 'HTML', 'level1'),
('5786345703e7a', '578636c57b3ae', 'Which tag allows you to add a row in a table?', 4, 3, 'HTML', 'level2'),
('5786345703e7a', '578636c590f0b', 'How can you make a numbered list?', 4, 4, 'HTML', 'level2'),
('5786345703e7a', '578636c5b6faa', 'What does vlink attribute mean?\r\n\r\n\r\n\r\n\r\n', 4, 5, 'HTML', 'level3'),
('5786345703e7a', '578636c5e5e33', 'Which attribute is used to name an element uniquely?', 4, 6, 'HTML', 'level3'),
('57863717b5520', '578639e454eeb', 'JavaScript Code can be called by using?', 4, 1, 'JAVASCRIPT', 'level1'),
('57863717b5520', '578639e4a561e', 'Which of the following is not considered as an error in JavaScript?\r\n\r\n\r\n ', 4, 2, 'JAVASCRIPT', 'level1'),
('57863717b5520', '578639e4d0c94', ' The escape sequence ‘f’ stands for?\r\n\r\n', 4, 3, 'JAVASCRIPT', 'level2'),
('57863717b5520', '578639e4e9390', 'The type that specifies what kind of event occured is?', 4, 4, 'JAVASCRIPT', 'level2'),
('57863717b5520', '578639e50ac3c', ' In general, event handler is nothing but', 4, 5, 'JAVASCRIPT', 'level3'),
('57863717b5520', '578639e52b54d', ' Which property specifies the property of the event?', 4, 6, 'JAVASCRIPT', 'level3'),
('57863b542d485', '57863e0c78fd7', 'Which command is used to print a string in php?', 4, 1, 'PHP', 'level1'),
('57863b542d485', '57863e0cb0fec', 'what does php stands for?', 4, 2, 'PHP', 'level2'),
('57863b542d485', '57863e0cc6b30', 'Variables always start with a ........ in PHP?', 4, 3, 'PHP', 'level2'),
('57863b542d485', '57863e0cd6fe2', 'Sessions allow you to ?', 4, 4, 'PHP', 'level2'),
('57863b542d485', '57863e0d1640e', 'What function computes the difference of arrays?\r\n\r\n\r\n', 4, 5, 'PHP', 'level3'),
('57863b542d485', '57863e0d2942c', 'Which of the following DBMSs do not have a native PHP extension?', 4, 6, 'PHP', 'level3');
-- --------------------------------------------------------
--
-- Table structure for table `quiz`
--
CREATE TABLE `quiz` (
`eid` text NOT NULL,
`title` varchar(100) NOT NULL,
`sahi` int(11) NOT NULL,
`wrong` int(11) NOT NULL,
`total` int(11) NOT NULL,
`time` bigint(20) NOT NULL,
`intro` text NOT NULL,
`tag` varchar(100) NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `quiz`
--
INSERT INTO `quiz` (`eid`, `title`, `sahi`, `wrong`, `total`, `time`, `intro`, `tag`, `date`) VALUES
('558920ff906b8', 'Linux : File Managment', 2, 1, 2, 5, '', 'linux', '2015-06-23 09:03:59'),
('5589222f16b93', 'C++ Coding', 2, 1, 2, 5, '', 'c++', '2015-06-23 09:09:03'),
('558922ec03021', 'Networking', 2, 1, 2, 5, '', 'networking', '2015-06-23 09:12:12'),
('55897338a6659', 'Linux:startup', 2, 1, 5, 10, '', 'linux', '2015-06-23 14:54:48'),
('5589741f9ed52', 'Linux :vi Editor', 2, 1, 5, 10, '', 'linux', '2015-06-23 14:58:39'),
('5786345703e7a', 'Html', 2, 1, 6, 15, '', '', '2016-07-13 12:30:15'),
('57863717b5520', 'Javascript', 2, 1, 6, 15, '', '', '2016-07-13 12:41:59'),
('57863b542d485', 'Php', 2, 1, 6, 15, '', '', '2016-07-13 13:00:04');
-- --------------------------------------------------------
--
-- Table structure for table `rank`
--
CREATE TABLE `rank` (
`email` varchar(50) NOT NULL,
`score` int(11) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rank`
--
INSERT INTO `rank` (`email`, `score`, `time`) VALUES
('1234@gmail.com', -8, '2016-07-13 08:37:31'),
('user@spic.com', 1, '2016-07-13 08:39:17'),
('bharatpuri30@gmail.com', 48, '2016-07-14 01:52:00');
-- --------------------------------------------------------
--
-- Table structure for table `result_graph`
--
CREATE TABLE `result_graph` (
`eid` varchar(20) NOT NULL,
`email` varchar(50) NOT NULL,
`marks` int(11) NOT NULL,
`total` int(11) NOT NULL,
`percentage` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `result_graph`
--
INSERT INTO `result_graph` (`eid`, `email`, `marks`, `total`, `percentage`) VALUES
('558922ec03021', '1234@gmail.com', -3, 4, 0),
('5589222f16b93', '1234@gmail.com', 4, 4, 100),
('5785f9c8470ef', '1234@gmail.com', -1, 2, 0),
('5785fae973ffc', '1234@gmail.com', 9, 12, 75),
('558921841f1ec', 'user@spic.com', 1, 4, 25),
('5785fae973ffc', 'bharatpuri30@gmail.com', 9, 12, 75),
('5589741f9ed52', 'bharatpuri30@gmail.com', -5, 10, 0),
('558921841f1ec', 'bharatpuri30@gmail.com', 4, 4, 100),
('5589222f16b93', 'bharatpuri30@gmail.com', 4, 4, 100),
('5786345703e7a', 'bharatpuri30@gmail.com', 9, 12, 75),
('57863b542d485', 'bharatpuri30@gmail.com', 18, 24, 75),
('57863717b5520', 'bharatpuri30@gmail.com', 9, 12, 75);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`name` varchar(50) NOT NULL,
`gender` varchar(7) NOT NULL,
`college` varchar(100) NOT NULL,
`email` varchar(50) NOT NULL,
`mob` bigint(20) NOT NULL,
`password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`name`, `gender`, `college`, `email`, `mob`, `password`) VALUES
(' Vikas', 'Male', 'nit hamirpur', '1234@gmail.com', 12334567890, 'd8578edf8458ce06fbc5bb76a58c5ca4'),
('Bharat', 'Male', 'nith', 'bharatpuri30@gmail.com', 8988337369, '5d41402abc4b2a76b9719d911017c592'),
('Nidhi', 'Female', 'nit hamirpur', 'nidhidhiman73@gmail.com', 123456677, '6f551f1f73b720e7c158c89ffab8222e'),
('User', 'Male', 'NIT Hamirpur', 'user@quizmania.com', 1234567890, '827ccb0eea8a706c4c34a16891f84e7b');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `php`
--
ALTER TABLE `php`
ADD PRIMARY KEY (`Question_id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `php`
--
ALTER TABLE `php`
MODIFY `Question_id` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
d22d8b2e0c5679f65f61445f893df6791a858309 | SQL | juanfevargax2/Scripts | /Genericos/GENERIC V6/GENERIC_DATA.sql | UTF-8 | 3,095 | 3.546875 | 4 | [] | no_license | DROP TABLE METADATA_DESTINATION;
DROP TABLE TRANSFORMATIONS;
DROP TABLE METADATA_SOURCE;
DROP TABLE DATA_GENERATOR;
DROP TABLE PEQS;
DROP TABLE JOINS;
DROP TABLE ERROR_MESSAGES;
DROP TABLE INTERFACE_ASSIGNED;
DROP TABLE SQL_TEXT;
DROP TABLE SOURCES;
DROP TABLE ASSIGNMENT;
CREATE TABLE
ASSIGNMENT
(
COD NUMBER PRIMARY KEY,
ASSIGNMENT VARCHAR2(30)
);
CREATE TABLE SOURCES
(
COD NUMBER(5) PRIMARY KEY,
SOURCE_NAME VARCHAR(30),
OWNER VARCHAR(30),
DBLINK VARCHAR(30)
);
CREATE TABLE SQL_TEXT
(
COD NUMBER PRIMARY KEY,
SQL_TEXT VARCHAR2(4000),
SQL_TYPE VARCHAR2(1)
);
CREATE TABLE INTERFACE_ASSIGNED
(
COD NUMBER(5),
COD_ASSIGNMENT NUMBER REFERENCES ASSIGNMENT,
INTERFC VARCHAR2(30),
INTERFC_ALIAS VARCHAR2(30),
COD_EXT NUMBER(5) REFERENCES SQL_TEXT,
INTERFC_SEPARATOR VARCHAR2(30),
VARIABLES VARCHAR(4000),
SRC_STM_CODE VARCHAR(30),
COD_SOURCE NUMBER REFERENCES SOURCES,
SOURCE_GEN_FLG VARCHAR2(1),
CONSTRAINT VALIDATION_PK PRIMARY KEY (COD,COD_ASSIGNMENT)
);
CREATE TABLE JOINS
(
COD NUMBER PRIMARY KEY,
JOIN_QUERY NUMBER REFERENCES SQL_TEXT,
HINT_QUERY NUMBER REFERENCES SQL_TEXT,
SUB_QUERY NUMBER REFERENCES SQL_TEXT,
COND_QUERY NUMBER REFERENCES SQL_TEXT,
SELECT_QUERY NUMBER REFERENCES SQL_TEXT,
TYPE_JOIN VARCHAR2(30),
TYPE_JOIN_ALIAS VARCHAR2(30),
TYPE_JOIN_PREV VARCHAR2(30)
);
CREATE TABLE PEQS
(
COD NUMBER PRIMARY KEY,
SOURCE_APP_COD VARCHAR2(30),
DESTINATION_APP_COD VARCHAR2(30),
TIPOLOGY_COD VARCHAR2(30),
SOCIETY_COD VARCHAR2(30),
COD_JOIN NUMBER(5) REFERENCES JOINS,
COD_JOIN_EXT NUMBER(5) REFERENCES JOINS
);
CREATE TABLE ERROR_MESSAGES
(
COD NUMBER(5),
COD_ASSIGNMENT NUMBER REFERENCES ASSIGNMENT,
MSG_TEXT VARCHAR(4000),
CONSTRAINT ERROR_MESSAGES_PK PRIMARY KEY (COD,COD_ASSIGNMENT)
);
CREATE TABLE TRANSFORMATIONS
(
COD NUMBER PRIMARY KEY,
VAL_TYPE NUMBER(5) REFERENCES SQL_TEXT,
VAL_PARAM VARCHAR2(4000),
TRANS_TYPE NUMBER(5) REFERENCES SQL_TEXT,
TRANS_PARAM VARCHAR(4000)
);
CREATE TABLE METADATA_DESTINATION
(
COD NUMBER(5),
COD_ASSIGNMENT NUMBER(5),
COD_INTERFACE_ASSIGNED NUMBER(5),
COLUMN_NAME VARCHAR2(30),
COLUMN_TYPE VARCHAR2(30),
COLUMN_LENGTH NUMBER(5),
COLUMN_PRECISION NUMBER(5),
ANT_PARAM VARCHAR(4000),
COD_PEQ NUMBER(5) REFERENCES PEQS,
COD_JOIN NUMBER(5) REFERENCES JOINS,
SEVERITY VARCHAR2(30),
COD_TRANSFORMATIONS NUMBER(5) REFERENCES TRANSFORMATIONS,
CONSTRAINT METADATA_DESTINATION_FK FOREIGN KEY (COD_INTERFACE_ASSIGNED,COD_ASSIGNMENT) REFERENCES INTERFACE_ASSIGNED(COD,COD_ASSIGNMENT),
CONSTRAINT METADATA_DESTINATION_PK PRIMARY KEY (COD,COD_INTERFACE_ASSIGNED,COD_ASSIGNMENT)
);
CREATE TABLE DATA_GENERATOR
(
COD NUMBER(5) PRIMARY KEY,
EXT_TYPE NUMBER(5) REFERENCES SQL_TEXT,
TRANS_TYPE NUMBER(5) REFERENCES SQL_TEXT,
PEQ_TYPE NUMBER(5) REFERENCES PEQS
);
CREATE TABLE METADATA_SOURCE
(
COD NUMBER(5) REFERENCES SOURCES,
COLUMN_ID NUMBER(5),
COLUMN_NAME VARCHAR2(30),
COLUMN_LENGTH NUMBER(5),
COLUMN_PRECISION NUMBER(5),
COLUMN_TYPE VARCHAR2(30),
COD_EXT NUMBER(5) REFERENCES DATA_GENERATOR,
COD_EXT_ERR NUMBER(5) REFERENCES DATA_GENERATOR,
SOURCE_PARAM VARCHAR2(4000),
CONSTRAINT METADATA_SOURCE_PK PRIMARY KEY (COD,COLUMN_ID)
);
| true |
f5c203c46d3c7e8a482b802c6e971db6bc73e78a | SQL | derek-y-lee/SQL-course-hw | /dlee_assignment8/dlee_assignment8.sql | UTF-8 | 4,274 | 4.1875 | 4 | [] | no_license | /* Assignment 8.sql
Derek Lee
CS 31A, Winter 2018
*/
SHOW warnings; /* enable warnings!*/
USE bookstore;
/*Query 1: View named customer_address shows shipping for each customer:
Returns customer_id, email_address, last_name, first_name from Customer
From ADDRESS: ship_line1, ship_line2, ship_city, ship_state, and ship_zip
SELECT statement returns these columns
from the customer_address view: customer_id, last_name, first_name,
ship_city and ship_state*/
CREATE VIEW customer_address (customer_id, email_address, last_name, first_name,
ship_line1, ship_line2, ship_city, ship_state, ship_zip) AS
SELECT c.customer_id, c.email_address, c.last_name, c.first_name,
a.line1, a.line2, a.city, a.state, a.zip_code
FROM customer c, address a
WHERE c.customer_id = a.customer_id;
SELECT *
FROM customer_address;
/*Query 2: Updates customer table using customer_address view
by setting first line of shipping address to "1990 Westwood Blvd"
for the customer with an ID of 11119.*/
UPDATE customer_address
SET ship_line1 = '1990 Westwood Blvd'
WHERE customer_id = 11119;
/*Query 3: Create view named product_summary
Each row includes product_id, order_count
(the number of times the product has been ordered)
and order_total (the total sales for the product).
SELECT statement returns all columns from product_summary view*/
CREATE VIEW product_summary AS
SELECT product_id, COUNT(product_id) AS order_count,
SUM((item_price - discount_amount)*quantity) AS order_total
FROM ORDERITEMS
GROUP BY product_id;
SELECT * FROM product_summary;
/*Query 4: Creates a view named cheap_products whose subquery
retrieves products only where the price is
less than $50. Add a CHECK OPTION constraint.
SELECT statement returns all the columns from the cheap_products.*/
CREATE VIEW cheap_products AS
SELECT * FROM PRODUCT
WHERE list_price < 50 WITH CHECK OPTION;
SELECT * FROM cheap_products;
/*Query 5: INSERT statement that adds this row to the cheap_ products view
Product ID: 17888
Category ID: 41
product_code: book db
Product Name: Fundamental of Database Systems
List_price: 45.99
Description: Fundamental of Database Systems Elmasri
discount_percent: 20.00
date_added : 2015-06-01 11:12:59
vendor_id : 2
*/
INSERT INTO cheap_products VALUES
(17888, 41, 'book db', 'Fundamental of Database Systems',
'Fundamental of Database Systems Elmasri', 45.99, 20.00, '2015-06-01 11:12:59', 2);
/*Query 6: Creates a view named contact that lists the first name
and phone number of the contact person at each vendor but excludes vendor’s ID in the view.
Change the contact view so that no users can accidentally perform DML operations on the view.
Write a SELECT statement that returns all the columns from the contact view.*/
CREATE VIEW Contact AS
SELECT contact_fname, contact_lname, phone
FROM vendor WITH CHECK OPTION;
SELECT * FROM Contact;
/*Query 7: Creates a view named order_items that returns
columns from the ORDERS, ORDERITEMS, and PRODUCT tables.
Returns from the ORDERS table: order_id, order_date, tax_amount, and ship_date.
Returns from the ORDERITEMS table: item_price, discount_amount,
final_price (the discount amount subtracted from the item price),
quantity, and item_total (the calculated total for the item).
View returns the product_name column from the PRODUCT Table.
SELECT statement returns all the columns from the order_items view.*/
CREATE VIEW order_items AS
SELECT o.order_id, o.order_date, o.tax_amount, o.ship_date, oi.item_price, oi.discount_amount,
(oi.item_price - oi.discount_amount) AS final_price, oi.quantity,
((oi.item_price - oi.discount_amount)*oi.quantity) AS item_total, p.product_name
FROM orders o
JOIN orderitems oi ON o.order_id = oi.order_id
JOIN product p ON oi.product_id = p.product_id;
SELECT * FROM order_items;
/*Query 8: Creates a view named reorder_info that lists
the product ID and product name for each product along with
the first name and phone number of the person to contact
if the product needs to be reordered.
SELECT statement returns all the columns from the reorder_info view.*/
CREATE VIEW reorder_info AS
SELECT p.product_id, p.product_name, v.contact_fname, v.phone
FROM product p
JOIN vendor v ON v.vendor_id = p.vendor_id;
SELECT * FROM reorder_info;
| true |
8658594c262e983353a8767827c54552dc56010b | SQL | gpierre42/bv.server | /share/data/migrations/from_v1.2.beta_to_1.3.beta/before.sql | UTF-8 | 1,892 | 2.75 | 3 | [] | no_license | ALTER TABLE accounts_userprofile ADD COLUMN "language" varchar(2) NOT NULL DEFAULT 'fr';
ALTER TABLE site_cartype RENAME TO carpool_cartype;
ALTER TABLE site_city RENAME TO carpool_city;
ALTER TABLE site_favoriteplace RENAME TO carpool_favoriteplace;
ALTER TABLE site_trip RENAME TO carpool_trip;
ALTER TABLE site_tripdemand RENAME TO carpool_tripdemand;
ALTER TABLE site_tripoffer RENAME TO carpool_tripoffer;
ALTER INDEX "site_favoriteplace_point_id" RENAME TO "carpool_favoriteplace_point_id"
ALTER INDEX "site_trip_arrival_point_id" RENAME TO "carpool_trip_arrival_point_id";
ALTER INDEX "site_city_slug" RENAME TO "carpool_city_slug";
ALTER INDEX "site_tripdemand_passenger_car_type_id" RENAME TO "carpool_tripdemand_passenger_car_type_id";
ALTER INDEX "site_tripoffer_driver_car_type_id" RENAME TO "carpool_tripoffer_driver_car_type_id";
ALTER INDEX "site_trip_user_id" RENAME TO "carpool_trip_user_id";
ALTER INDEX "site_trip_offer_id" RENAME TO "carpool_trip_offer_id";
ALTER INDEX "site_trip_demand_id" RENAME TO "carpool_trip_demand_id";
ALTER INDEX "site_trip_departure_point_id" RENAME TO "carpool_trip_departure_point_id";
ALTER INDEX "site_tripoffer_direction_route_id" RENAME TO "carpool_tripoffer_direction_route_id";
ALTER INDEX "site_tripoffer_simple_route_id" RENAME TO "carpool_tripoffer_simple_route_id";
ALTER INDEX "site_tripoffer_route_id" RENAME TO "carpool_tripoffer_route_id";
ALTER INDEX "site_city_point_id" RENAME TO "carpool_city_point_id";
-- SEQUENCES
ALTER TABLE site_cartype_id_seq RENAME TO carpool_cartype_id_seq
ALTER TABLE site_city_id_seq RENAME TO carpool_city_id_seq;
ALTER TABLE site_favoriteplace_id_seq RENAME TO carpool_favoriteplace_id_seq;
ALTER TABLE site_trip_id_seq RENAME TO carpool_trip_id_seq;
ALTER TABLE site_tripdemand_id_seq RENAME TO carpool_tripdemand_id_seq;
ALTER TABLE site_tripoffer_id_seq RENAME TO carpool_tripoffer_id_seq;
| true |
25122854af7eb399e8f6173d9d5e04cee66e1dc9 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day25/select0314.sql | UTF-8 | 177 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-24T03:14:00Z' AND timestamp<'2017-11-25T03:14:00Z' AND temperature>=5 AND temperature<=39
| true |
c2730bc075dc9fc8e10b846349711f44870e10cd | SQL | Dilicidum/Lab4 | /Lab4/Procedures/4_1.sql | UTF-8 | 278 | 3.328125 | 3 | [] | no_license | select Appointments.JobName,count(Performers.Id)
from Performers_Projects_Appointments
join Appointments on Appointments.Id=Performers_Projects_Appointments.AppointmentId
join Performers on Performers.Id=Performers_Projects_Appointments.PerformerId
group by Appointments.JobName | true |
78b0e293789565cd6553bdaf44fada096665bb9b | SQL | liangxilong/Huatomedicalsystem | /sql/InsertInto.sql | UTF-8 | 2,699 | 2.78125 | 3 | [] | no_license |
insert into `authority_level`(`authority_level_id`,`authority_level_name`) values
(1,'院长'),
(2,'副院长'),
(3,'主任'),
(4,'副主任'),
(5,'医生'),
(6,'护士'),
(7,'仓库管理员'),
(8,'统计工作人员');
insert into `depart`(`depart_id`,`depart_name`,`manager_staff_id`,`vice_manager_staff_id`,`depart_properties`) values
(1,'门诊部',3001,4001,'医生,护士'),
(2,'药剂科',3002,4002,'配药护士'),
(3,'仓库',3003,4003,'仓管'),
(4,'财务部',3004,4004,'统计人员');
insert into `job`(`job_id`,`job_name`,`job_depart_id`) values
(1,'耳鼻喉科',1),
(2,'骨科',1),
(3,'妇产科',1),
(4,'儿科',1);
insert into `material`(`material_id`,`material_specifications`,`material_name`,`material_type`,`material_price`,`material_Instructions`) values
(1,'1L/支','太太口服液','消耗品',10,'一天1支'),
(2,'4板/盒','白加黑胶囊','药品',12,'一天1板'),
(3,'100/袋','棉签','消耗品',5,'无');
insert into `patient`(`patient_id`,`patient_name`,`patient_sex`,`patient_age`,`patient_state`,`patient_phone`,`patient_allergy`) values
(1,'kx','女',11,'天上人间','1777777777','水泡'),
(2,'kx2','男',12,'东方舵手服','1566544664',NULL);
insert into `prescription`(`prescription_id`,`prescription_doctor_id`,`prescription_content`,`prescription_patient_id`,`prescription_date`,`whether_money`,`collect_fees_id`) values
(1,5001,'抓XXX药500克',2,'2018-01-10 15:36:43','resources/images/mayun.jpg',1);
insert into `staff_info`(`staff_info_id`,`staff_info_name`,`staff_info_duty`,`staff_info_education`,`staff_info_sex`,`staff_info_birthday`,`staff_info_nation`,`staff_info_card_no`,`staff_info_marriage`,`staff_info_health`,`staff_info_start_work`,`staff_info_address`,`staff_info_phone`,`staff_info_email`,`staff_info_job_id`,`staff_info_image`,`staff_info_title`,`staff_info_salary`) values
(5001,'康医生','医生','博士','女','2001-03-01 14:43:10','汉','133515161651561','已婚','亚健康','2011-08-18 14:45:58','湖南长沙','12315616611','adsf45@qq.com',3,'resources/images/mayun.jpg','专家',10000);
insert into `supplier`(`supplier_id`,`supplier_name`,`supplier_address`,`supplier_phone`,`supplier_reputation_level`) values
(1,'hyf','深圳腾讯总部','18455546646','优'),
(2,'康鑫','湖南','15456446','差'),
(3,'凉席农','河南','15161656','良');
insert into `ward`(`ward_id`,`ward_statement`,`ward_detail_address`,`ward_type`,`ward_price`) values
(1,'使用','3楼102','豪华',100000),
(2,'预定','1楼302','普通',2000),
(3,'空闲','2楼101','贵宾',5000);
| true |
b7fce6997b51f17586321eaf75d36d5ec5659157 | SQL | alibaba/canal | /parse/src/test/resources/ddl/alter/test_8.sql | UTF-8 | 1,395 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | CREATE TABLE `tb_fwnltgnpeg` (
`col_gzxmlukzgv` smallint(169) unsigned zerofill NOT NULL,
PRIMARY KEY (`col_gzxmlukzgv`),
UNIQUE INDEX `uk_gwlvlnvrkh` (`col_gzxmlukzgv`),
UNIQUE INDEX `uk_ygsnwxzroc` (`col_gzxmlukzgv`)
) DEFAULT CHARSET=utf8;
RENAME TABLE `tb_fwnltgnpeg` TO `tb_hmfoniytbf`;
ALTER TABLE `tb_hmfoniytbf` ADD COLUMN `col_gxqvwbkvyi` datetime(5);
ALTER TABLE `tb_hmfoniytbf` ADD COLUMN (`col_fthqvynbuq` mediumint unsigned zerofill, `col_dcxnatwddd` date DEFAULT '2019-07-04');
ALTER TABLE `tb_hmfoniytbf` ADD COLUMN `col_wvbemkrzdt` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci FIRST;
ALTER TABLE `tb_hmfoniytbf` ADD `col_alzezpawqi` longblob;
ALTER TABLE `tb_hmfoniytbf` ADD COLUMN `col_tpzhsbkmka` longtext;
ALTER TABLE `tb_hmfoniytbf` ADD COLUMN (`col_urfoabrjor` bit(15) NOT NULL, `col_xreorfbhxc` decimal(35) NULL);
ALTER TABLE `tb_hmfoniytbf` DEFAULT CHARACTER SET utf8;
ALTER TABLE `tb_hmfoniytbf` ADD UNIQUE INDEX `uk_ztdbxlchxi` (`col_alzezpawqi`(18),`col_tpzhsbkmka`(30));
ALTER TABLE `tb_hmfoniytbf` ALTER COLUMN `col_dcxnatwddd` DROP DEFAULT;
ALTER TABLE `tb_hmfoniytbf` DROP COLUMN `col_tpzhsbkmka`, DROP COLUMN `col_dcxnatwddd`;
ALTER TABLE `tb_hmfoniytbf` DROP `col_alzezpawqi`, DROP `col_wvbemkrzdt`;
ALTER TABLE `tb_hmfoniytbf` DROP `col_gzxmlukzgv`, DROP `col_xreorfbhxc`;
ALTER TABLE `tb_hmfoniytbf` DROP `col_gxqvwbkvyi`, DROP `col_fthqvynbuq`;
| true |
9fca3adb35a53f06d3fc3a04210bfdbc798f158d | SQL | thanhloan6196/Railway12-javadvanced | /SQL_file for Java Advanced/AccountList.sql | UTF-8 | 7,183 | 3.265625 | 3 | [] | no_license | DROP DATABASE IF EXISTS TestingSystem3;
CREATE DATABASE TestingSystem3;
USE TestingSystem3;
DROP TABLE IF EXISTS Department;
CREATE TABLE Department(
ID MEDIUMINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
Department_Name NVARCHAR(30) NOT NULL UNIQUE KEY
);
-- create table 2: Posittion
DROP TABLE IF EXISTS Position;
CREATE TABLE `Position` (
ID MEDIUMINT UNSIGNED AUTO_INCREMENT
PRIMARY KEY,
Position_Name ENUM('DEV','TEST','SCRUM_MASTER','PM') NOT NULL UNIQUE
KEY
);
DROP TABLE IF EXISTS `Account`;
CREATE TABLE `Account`(
ID MEDIUMINT UNSIGNED AUTO_INCREMENT
PRIMARY KEY,
Email VARCHAR(50) NOT NULL UNIQUE KEY,
User_name VARCHAR(50) NOT NULL UNIQUE KEY,
Full_Name NVARCHAR(50) NOT NULL,
Department_ID MEDIUMINT UNSIGNED NOT NULL,
Position_ID MEDIUMINT UNSIGNED NOT NULL,
Update_At DATETIME,
Create_Date DATETIME,
FOREIGN KEY(Department_ID) REFERENCES Department(ID),
FOREIGN KEY(Position_ID) REFERENCES `Position`(ID)
);
INSERT INTO Position (Position_Name )
VALUES ('DEV' ),
('TEST' ),
('SCRUM_MASTER'),
('PM' );
insert into department (Department_Name) values ('Engineering');
insert into department (Department_Name) values ('Product Management');
insert into department (Department_Name) values ('Business Development');
insert into department (Department_Name) values ('Legal');
insert into department (Department_Name) values ('Support');
insert into department (Department_Name) values ('Accounting');
insert into department (Department_Name) values ('Services');
insert into department (Department_Name) values ('Sale');
insert into department (Department_Name) values ('Training');
insert into department (Department_Name) values ('Human Resources');
insert into department (Department_Name) values ('Research and Development');
insert into department (Department_Name) values ('Marketing');insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('lgoodge0@msn.com', 'lgoodge0', 'Lyman Goodge', 11, 3, '2017-04-09');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('dgeertz1@bluehost.com', 'dgeertz1', 'Dal Geertz', 3, 2, '2020-09-13');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('qharwick2@kickstarter.com', 'qharwick2', 'Quentin Harwick', 9, 2, '2018-01-23');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('noriordan3@jugem.jp', 'noriordan3', 'Nomi O''Riordan', 7, 2, '2018-11-30');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('ledmondson4@jalbum.net', 'ledmondson4', 'Livia Edmondson', 3, 4, '2019-06-16');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('cgerauld5@lycos.com', 'cgerauld5', 'Cordell Gerauld', 6, 2, '2019-12-26');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('thowgego6@sourceforge.net', 'thowgego6', 'Taffy Howgego', 5, 2, '2017-08-27');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('vkiernan7@uol.com.br', 'vkiernan7', 'Verna Kiernan', 9, 3, '2017-08-08');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('tgegg8@cyberchimps.com', 'tgegg8', 'Tiffanie Gegg', 9, 4, '2017-09-23');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('tplace9@cbc.ca', 'tplace9', 'Tiffani Place', 10, 4, '2018-10-08');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('iadamidesa@blogs.com', 'iadamidesa', 'Isac Adamides', 7, 3, '2021-01-02');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('lghirardib@imgur.com', 'lghirardib', 'Lanie Ghirardi', 3, 4, '2018-08-13');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('eallwoodc@example.com', 'eallwoodc', 'Erena Allwood', 11, 4, '2017-09-21');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('mrizzid@vimeo.com', 'mrizzid', 'Monte Rizzi', 3, 3, '2017-08-12');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('mlynese@photobucket.com', 'mlynese', 'Mayne Lynes', 8, 3, '2020-03-15');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('achanningf@apache.org', 'achanningf', 'Ansley Channing', 1, 3, '2020-11-08');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('hgoscombg@umn.edu', 'hgoscombg', 'Horacio Goscomb', 10, 3, '2018-09-10');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('jwarykh@cam.ac.uk', 'jwarykh', 'Jorge Waryk', 1, 1, '2020-04-30');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('nmariansi@studiopress.com', 'nmariansi', 'Northrup Marians', 3, 3, '2019-08-28');insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('aapedailej@printfriendly.com', 'aapedailej', 'Alwyn Apedaile', 2, 4, '2017-10-25');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('bmastersk@census.gov', 'bmastersk', 'Bridie Masters', 5, 2, '2020-02-11');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('cboulgerl@theguardian.com', 'cboulgerl', 'Cristen Boulger', 3, 4, '2020-03-19');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('reamm@state.gov', 'reamm', 'Ripley Eam', 6, 1, '2020-10-17');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('epietranekn@nps.gov', 'epietranekn', 'Elinore Pietranek', 8, 1, '2018-03-21');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('skrammero@abc.net.au', 'skrammero', 'Stanfield Krammer', 1, 2, '2017-12-22');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('jboswoodp@auda.org.au', 'jboswoodp', 'Jillie Boswood', 10, 4, '2018-01-18');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('cheadleyq@usnews.com', 'cheadleyq', 'Cynthea Headley', 5, 1, '2020-09-23');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('erozecr@plala.or.jp', 'erozecr', 'Eden Rozec', 6, 3, '2017-05-04');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('bguilloneaus@tmall.com', 'bguilloneaus', 'Bennie Guilloneau', 1, 4, '2017-07-25');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('ktommist@loc.gov', 'ktommist', 'Katherina Tommis', 10, 4, '2019-04-29');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('fdallau@smh.com.au', 'fdallau', 'Ferdie Dalla', 1, 2, '2020-09-17');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('adockreev@cdc.gov', 'adockreev', 'Adolf Dockree', 2, 2, '2021-01-22');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('thumbatchw@cargocollective.com', 'thumbatchw', 'Tomasine Humbatch', 10, 3, '2019-06-24');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('edomeganx@weebly.com', 'edomeganx', 'Eddi Domegan', 3, 4, '2019-01-15');
insert into account (Email, User_name, Full_Name, Department_ID, Position_ID, Create_Date) values
('jwaighty@discuz.net', 'jwaighty', 'Jeanna Waight', 4, 2, '2018-10-22'); | true |
52b6ffb53dfb749dcf828b342f991a2180b5968f | SQL | KheprySoftware/KhepryHubVX | /dbase_routines/sqlite_schema.sql | UTF-8 | 3,736 | 2.84375 | 3 | [] | no_license | DROP TABLE IF EXISTS nc_voter_master;
DROP TABLE IF EXISTS nc_voter_history;
DROP TABLE IF EXISTS state_counties;
DROP TABLE IF EXISTS user;
CREATE TABLE state_counties (
state_name VARCHAR(100),
state_init VARCHAR(5),
county_name VARCHAR(50),
PRIMARY KEY (state_name, state_init, county_name)
);
CREATE TABLE nc_voter_master (
county_id smallint(2),
county_desc varchar(15),
voter_reg_num character(12),
status_cd character(2),
voter_status_desc varchar(25),
reason_cd character(2),
voter_status_reason_desc varchar(60),
absent_ind character(1),
name_prefx_cd character(4),
last_name character(25),
first_name character(20),
middle_name character(20),
name_suffix_lbl character(3),
res_street_address varchar(63),
res_city_desc varchar(60),
state_cd character(2),
zip_code character(9),
mail_addr1 varchar(40),
mail_addr2 varchar(40),
mail_addr3 varchar(40),
mail_addr4 varchar(40),
mail_city varchar(30),
mail_state character(2),
mail_zipcode character(9),
full_phone_number varchar(12),
race_code character(3),
ethnic_code character(3),
party_cd character(3),
gender_code varchar(1),
birth_age int(4),
birth_state character(2),
drivers_lic character(1),
registr_dt date(10),
precinct_abbrv character(6),
precinct_desc varchar(60),
municipality_abbrv character(6),
municipality_desc varchar(60),
ward_abbrv character(6),
ward_desc varchar(60),
cong_dist_abbrv character(6),
super_court_abbrv character(6),
judic_dist_abbrv character(6),
nc_senate_abbrv character(6),
nc_house_abbrv character(6),
county_commiss_abbrv character(6),
county_commiss_desc varchar(60),
township_abbrv character(6),
township_desc varchar(60),
school_dist_abbrv character(6),
school_dist_desc varchar(60),
fire_dist_abbrv character(6),
fire_dist_desc varchar(60),
water_dist_abbrv character(6),
water_dist_desc varchar(60),
sewer_dist_abbrv character(6),
sewer_dist_desc varchar(60),
sanit_dist_abbrv character(6),
sanit_dist_desc varchar(60),
rescue_dist_abbrv character(6),
rescue_dist_desc varchar(60),
munic_dist_abbrv character(6),
munic_dist_desc varchar(60),
dist_1_abbrv character(6),
dist_1_desc varchar(60),
dist_2_abbrv character(6),
dist_2_desc varchar(60),
confidential_ind character(1),
birth_year character(4),
ncid character(12),
vtd_abbrv character(6),
vtd_desc character(60),
PRIMARY KEY (ncid)
);
CREATE TABLE nc_voter_history (
county_id int(4),
county_desc character(60),
voter_reg_num character(12),
election_lbl character(10),
election_desc character(230),
voting_method character(10),
voted_party_cd character(3),
voted_party_desc character(60),
pct_label character(6),
pct_description character(60),
ncid character(12),
voted_county_id character(3),
voted_county_desc character(60),
vtd_label character(6),
vtd_description character(60)
);
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
| true |
c46181d5982b0a9121460feb4c560ce78fd90a98 | SQL | rodrigobazan/sermed | /Sermed-Boundaries/src/test/java/resources/limpiarbase.sql | UTF-8 | 1,417 | 2.578125 | 3 | [] | no_license | DELETE FROM afiliado CASCADE;
DELETE FROM persona_antecedente_medico_collection CASCADE;
DELETE FROM plan_lista_precios CASCADE;
DELETE FROM antecedentemedico CASCADE;
DELETE FROM persona CASCADE;
DELETE FROM tipodocumento CASCADE;
DELETE FROM sangre CASCADE;
DELETE FROM afeccion CASCADE;
DELETE FROM periodopago CASCADE;
DELETE FROM comprobante_periodos_abonados CASCADE;
DELETE FROM plan CASCADE;
DELETE FROM comprobante CASCADE;
DELETE FROM visita CASCADE;
DELETE FROM enfermero CASCADE;
DELETE FROM medico CASCADE;
DELETE FROM obrasocial CASCADE;
/*--------------------DESCOMENTAR PARA CORRER SOBRE POSTGRESQL ------------------------------*/
/*ALTER SEQUENCE "afeccion_idafeccion_seq" RESTART WITH 1;
ALTER SEQUENCE "afiliado_idafiliado_seq" RESTART WITH 1;
ALTER SEQUENCE "antecedentemedico_idantecedentemedico_seq" RESTART WITH 1;
ALTER SEQUENCE "comprobante_idcomprobante_seq" RESTART WITH 1;
ALTER SEQUENCE "enfermero_idenfermero_seq" RESTART WITH 1;
ALTER SEQUENCE "medico_idmedico_seq" RESTART WITH 1;
ALTER SEQUENCE "obrasocial_idobrasocial_seq" RESTART WITH 1;
ALTER SEQUENCE "periodopago_idperiodopago_seq" RESTART WITH 1;
ALTER SEQUENCE "persona_idpersona_seq" RESTART WITH 1;
ALTER SEQUENCE "plan_idplan_seq" RESTART WITH 1;
ALTER SEQUENCE "sangre_idsangre_seq" RESTART WITH 1;
ALTER SEQUENCE "tipodocumento_idtipodocumento_seq" RESTART WITH 1;
ALTER SEQUENCE "visita_idvisita_seq" RESTART WITH 1;*/ | true |
eea9ac572314eae2e9c7f522a809d7f06f0e476a | SQL | oreills9/clutch | /sql/NBA/NBA_Load_Script.sql | UTF-8 | 17,466 | 3.734375 | 4 | [] | no_license | ##INTIAL DATA LOAD##
DROP TABLE nba_2017_sample;
CREATE TABLE nba_2017_sample (
game_id int(20) NOT NULL,
data_set text,
match_date date,
a1 text,
a2 text,
a3 text,
a4 text,
a5 text,
h1 text,
h2 text,
h3 text,
h4 text,
h5 text,
period int(1),
away_score int(3),
home_score int(3),
remaining_time time,
elapsed time,
play_length time,
play_id int(11) NOT NULL,
team text,
event_type text,
assist text,
away text,
home text,
blocker text,
entered text,
exited text,
num int(1),
opponent text,
outof int(1),
player text,
points int(1),
possession text,
reason text,
result text,
steal text,
type text,
shot_distance double,
original_x double,
original_y double,
converted_x double,
converted_y double,
load_cycles int(4),
player_id int(10),
home_away_ind char(1),
player_load_cycles int(4));
TRUNCATE TABLE nba_2017_sample;
LOAD DATA LOCAL INFILE '/home/mis/Downloads/Datasets/NBA/2017_nba_sample.csv'
INTO TABLE nba_2017_sample
FIELDS TERMINATED BY ','
#OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(game_id, data_set, @match_date, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, period, away_score,
home_score, remaining_time, elapsed, play_length, play_id, team, event_type, assist, away,
home, blocker, entered, exited, num, opponent, outof, player, points, possession, reason,
result, steal, type, shot_distance, original_x, original_y, converted_x, converted_y)
SET match_date = STR_TO_DATE(@match_date, '%d/%m/%Y');
;
DROP TABLE nba_2016_sample;
CREATE TABLE nba_2016_sample (
game_id int(20) NOT NULL,
data_set text,
match_date date,
a1 text,
a2 text,
a3 text,
a4 text,
a5 text,
h1 text,
h2 text,
h3 text,
h4 text,
h5 text,
period int(1),
away_score int(3),
home_score int(3),
remaining_time time,
elapsed time,
play_length time,
play_id int(11) NOT NULL,
team text,
event_type text,
assist text,
away text,
home text,
blocker text,
entered text,
exited text,
num int(1),
opponent text,
outof int(1),
player text,
points int(1),
possession text,
reason text,
result text,
steal text,
type text,
shot_distance double,
original_x double,
original_y double,
converted_x double,
converted_y double,
load_cycles int(4),
player_id int(10),
home_away_ind char(1),
player_load_cycles int(4));
TRUNCATE TABLE nba_2016_sample;
LOAD DATA LOCAL INFILE '/home/mis/Downloads/Datasets/NBA/2016_nba_sample.csv'
INTO TABLE nba_2016_sample
FIELDS TERMINATED BY ','
#OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(game_id, data_set, @match_date, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, period, away_score,
home_score, remaining_time, elapsed, play_length, play_id, team, event_type, assist, away,
home, blocker, entered, exited, num, opponent, outof, player, points, possession, reason,
result, steal, type, shot_distance, original_x, original_y, converted_x, converted_y)
SET match_date = STR_TO_DATE(@match_date, '%d/%m/%Y');
;
DROP TABLE nba_2017;
CREATE TABLE nba_2017 (
game_id int(20) NOT NULL,
data_set text,
match_date date,
a1 text,
a2 text,
a3 text,
a4 text,
a5 text,
h1 text,
h2 text,
h3 text,
h4 text,
h5 text,
period int(1),
away_score int(3),
home_score int(3),
remaining_time time,
elapsed time,
play_length time,
play_id int(11) NOT NULL,
team text,
event_type text,
assist text,
away text,
home text,
blocker text,
entered text,
exited text,
num int(1),
opponent text,
outof int(1),
player text,
points int(1),
possession text,
reason text,
result text,
steal text,
type text,
shot_distance double,
original_x double,
original_y double,
converted_x double,
converted_y double,
load_cycles int(4),
player_id int(10),
home_away_ind char(1),
player_load_cycles int(4));
TRUNCATE TABLE nba_2017;
LOAD DATA LOCAL INFILE '/home/mis/Downloads/Datasets/NBA/2017_nba.csv'
INTO TABLE nba_2017
FIELDS TERMINATED BY ','
#OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(game_id, data_set, @match_date, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, period, away_score,
home_score, remaining_time, elapsed, play_length, play_id, team, event_type, assist, away,
home, blocker, entered, exited, num, opponent, outof, player, points, possession, reason,
result, steal, type, shot_distance, original_x, original_y, converted_x, converted_y)
SET match_date = STR_TO_DATE(@match_date, '%d/%m/%Y');
;
DROP TABLE nba_2016;
CREATE TABLE nba_2016 (
game_id int(20) NOT NULL,
data_set text,
match_date date,
a1 text,
a2 text,
a3 text,
a4 text,
a5 text,
h1 text,
h2 text,
h3 text,
h4 text,
h5 text,
period int(1),
away_score int(3),
home_score int(3),
remaining_time time,
elapsed time,
play_length time,
play_id int(11) NOT NULL,
team text,
event_type text,
assist text,
away text,
home text,
blocker text,
entered text,
exited text,
num int(1),
opponent text,
outof int(1),
player text,
points int(1),
possession text,
reason text,
result text,
steal text,
type text,
shot_distance double,
original_x double,
original_y double,
converted_x double,
converted_y double,
load_cycles int(4),
player_id int(10),
home_away_ind char(1),
player_load_cycles int(4));
TRUNCATE TABLE nba_2016;
LOAD DATA LOCAL INFILE '/home/mis/Downloads/Datasets/NBA/2016_nba.csv'
INTO TABLE nba_2016
FIELDS TERMINATED BY ','
#OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(game_id, data_set, @match_date, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, period, away_score,
home_score, remaining_time, elapsed, play_length, play_id, team, event_type, assist, away,
home, blocker, entered, exited, num, opponent, outof, player, points, possession, reason,
result, steal, type, shot_distance, original_x, original_y, converted_x, converted_y)
SET match_date = STR_TO_DATE(@match_date, '%d/%m/%Y');
;
#ALTER TABLE nba_2016 ADD COLUMN player_load_cycles int(4) DEFAULT 0;
#ALTER TABLE nba_2017 ADD COLUMN player_load_cycles int(4) DEFAULT 0;
##DATA LOAD COUNT CHECK##
SELECT COUNT(*) FROM nba_2017_sample;
SELECT COUNT(*) FROM nba_2016_sample;
SELECT COUNT(*) FROM nba_2017;
SELECT COUNT(*) FROM nba_2016;
##CREATE PLAYER TABLE#
DROP TABLE nba_players;
CREATE TABLE nba_players(
player_id INT(10) AUTO_INCREMENT PRIMARY KEY,
player_name VARCHAR(50)
);
INSERT INTO nba_players (player_name)
SELECT DISTINCT(player) FROM nba_2017 WHERE LENGTH(player) > 1
UNION
SELECT DISTINCT(player) FROM nba_2016 WHERE LENGTH(player) > 1;
CREATE INDEX nba_players_player_name ON nba_players (player_name);
##CUSTOM TABLE CREATION##
#DROP TABLE nba_2017_sample_shots;
#CREATE TABLE nba_2017_sample_shots AS
#SELECT * FROM nba_2017_sample WHERE event_type IN ('shot', 'miss', 'free throw');
#DROP TABLE nba_2016_sample_shots;
#CREATE TABLE nba_2016_sample_shots AS
#SELECT * FROM nba_2016_sample WHERE event_type IN ('shot', 'miss', 'free throw');
#DROP TABLE nba_2017_shots;
#CREATE TABLE nba_2017_shots AS
#SELECT * FROM nba_2017 WHERE event_type IN ('shot', 'miss', 'free throw');
#DROP TABLE nba_2016_shots;
#CREATE TABLE nba_2016_shots AS
#SELECT * FROM nba_2016 WHERE event_type IN ('shot', 'miss', 'free throw');
##SHOTS DATA LOAD COUNT CHECK##
#SELECT COUNT(*) FROM nba_2017_sample_shots;
#SELECT COUNT(*) FROM nba_2016_sample_shots;
#SELECT COUNT(*) FROM nba_2017_shots;
#SELECT COUNT(*) FROM nba_2016_shots;
##INDEX CREATION##
ALTER TABLE nba_2017_sample ADD PRIMARY KEY pk_nba_2017_sample (`game_id`, `play_id`);
ALTER TABLE nba_2017_sample ADD FULLTEXT INDEX idx_nba_2017_sample_pl(a1,a2,a3,a4,a5,h1,h2,h3,h4,h5);
ALTER TABLE nba_2017_sample ADD FULLTEXT INDEX idx_nba_2017_sample_pl_home (h1,h2,h3,h4,h5);
ALTER TABLE nba_2017_sample ADD FULLTEXT INDEX idx_nba_2017_sample_pl_away (a1,a2,a3,a4,a5);
CREATE INDEX n17_samp_player ON nba_2017_sample (player(20));
CREATE INDEX n17_samp_player_id ON nba_2017_sample (player_id);
ALTER TABLE nba_2016_sample ADD PRIMARY KEY (`game_id`, `play_id`);
ALTER TABLE nba_2016_sample ADD FULLTEXT INDEX (a1,a2,a3,a4,a5,h1,h2,h3,h4,h5);
ALTER TABLE nba_2016_sample ADD FULLTEXT INDEX idx_nba_2016_sample_pl_home (h1,h2,h3,h4,h5);
ALTER TABLE nba_2016_sample ADD FULLTEXT INDEX idx_nba_2016_sample_pl_away (a1,a2,a3,a4,a5);
CREATE INDEX n16_samp_player ON nba_2016_sample (player(20));
CREATE INDEX n16_samp_player_id ON nba_2016_sample (player_id);
ALTER TABLE nba_2017 ADD PRIMARY KEY (`game_id`, `play_id`);
ALTER TABLE nba_2017 ADD FULLTEXT INDEX (a1,a2,a3,a4,a5,h1,h2,h3,h4,h5);
ALTER TABLE nba_2017 ADD FULLTEXT INDEX idx_nba_2017_pl_home (h1,h2,h3,h4,h5);
ALTER TABLE nba_2017 ADD FULLTEXT INDEX idx_nba_2017_pl_away (a1,a2,a3,a4,a5);
CREATE INDEX n17_player ON nba_2017 (player(20));
CREATE INDEX n17_player_id ON nba_2017 (player_id);
ALTER TABLE nba_2016 ADD PRIMARY KEY (`game_id`, `play_id`);
ALTER TABLE nba_2016 ADD FULLTEXT INDEX (a1,a2,a3,a4,a5,h1,h2,h3,h4,h5);
ALTER TABLE nba_2016 ADD FULLTEXT INDEX idx_nba_2016_pl_home (h1,h2,h3,h4,h5);
ALTER TABLE nba_2016 ADD FULLTEXT INDEX idx_nba_2016_pl_away (a1,a2,a3,a4,a5);
CREATE INDEX n16_player ON nba_2016 (player(20));
CREATE INDEX n16_player_id ON nba_2016 (player_id);
#ALTER TABLE nba_2017_sample_shots ADD PRIMARY KEY (`game_id`, `play_id`);
#CREATE INDEX n17_samp_shot_player_id ON nba_2017_sample_shots (player_id);
#ALTER TABLE nba_2016_sample_shots ADD PRIMARY KEY (`game_id`, `play_id`);
#CREATE INDEX n16_samp_shot_player_id ON nba_2016_sample_shots (player_id);
#ALTER TABLE nba_2017_shots ADD PRIMARY KEY (`game_id`, `play_id`);
#CREATE INDEX n17_shot_player_id ON nba_2017_shots (player_id);
#ALTER TABLE nba_2016_shots ADD PRIMARY KEY (`game_id`, `play_id`);
#CREATE INDEX n16_shot_player_id ON nba_2016_shots (player_id);
UPDATE nba_2017_sample nba JOIN
(SELECT DISTINCT nba.player, np.player_name, np.player_id
FROM nba_2017_sample nba
JOIN nba_players np ON nba.player = np.player_name) AS player_join
ON nba.player = player_join.player_name
SET nba.player_id = player_join.player_id
WHERE nba.player = player_join.player_name;
UPDATE nba_2016_sample nba JOIN
(SELECT DISTINCT nba.player, np.player_name, np.player_id
FROM nba_2016_sample nba
JOIN nba_players np ON nba.player = np.player_name) AS player_join
ON nba.player = player_join.player_name
SET nba.player_id = player_join.player_id
WHERE nba.player = player_join.player_name;
UPDATE nba_2017 nba JOIN
(SELECT DISTINCT nba.player, np.player_name, np.player_id
FROM nba_2017 nba
JOIN nba_players np ON nba.player = np.player_name) AS player_join
ON nba.player = player_join.player_name
SET nba.player_id = player_join.player_id
WHERE nba.player = player_join.player_name;
UPDATE nba_2016 nba JOIN
(SELECT DISTINCT nba.player, np.player_name, np.player_id
FROM nba_2016 nba
JOIN nba_players np ON nba.player = np.player_name) AS player_join
ON nba.player = player_join.player_name
SET nba.player_id = player_join.player_id
WHERE nba.player = player_join.player_name;
##MAX LOAD CYCLES COLUMN POPULATION##
UPDATE nba_2017_sample nba JOIN (
SELECT a.play_id, b.game_id, b.max_load_cycles from nba_2017_sample a
INNER JOIN (
SELECT game_id, MAX(play_id) AS max_load_cycles
FROM nba_2017_sample
GROUP BY game_id)
AS b ON a.game_id = b.game_id) AS load_cycles
ON nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id
SET load_cycles = load_cycles.max_load_cycles
WHERE nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id;
UPDATE nba_2016_sample nba JOIN (
SELECT a.play_id, b.game_id, b.max_load_cycles from nba_2016_sample a
INNER JOIN (
SELECT game_id, MAX(play_id) AS max_load_cycles
FROM nba_2016_sample
GROUP BY game_id)
AS b ON a.game_id = b.game_id) AS load_cycles
ON nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id
SET load_cycles = load_cycles.max_load_cycles
WHERE nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id;
UPDATE nba_2017 nba JOIN (
SELECT a.play_id, b.game_id, b.max_load_cycles from nba_2017 a
INNER JOIN (
SELECT game_id, MAX(play_id) AS max_load_cycles
FROM nba_2017
GROUP BY game_id)
AS b ON a.game_id = b.game_id) AS load_cycles
ON nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id
SET load_cycles = load_cycles.max_load_cycles
WHERE nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id;
UPDATE nba_2016 nba JOIN (
SELECT a.play_id, b.game_id, b.max_load_cycles from nba_2016 a
INNER JOIN (
SELECT game_id, MAX(play_id) AS max_load_cycles
FROM nba_2016
GROUP BY game_id)
AS b ON a.game_id = b.game_id) AS load_cycles
ON nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id
SET load_cycles = load_cycles.max_load_cycles
WHERE nba.game_id = load_cycles.game_id
AND nba.play_id = load_cycles.play_id;
#HOME / AWAY INDICATOR POPULATION
UPDATE nba_2017_sample nba JOIN nba_2017_sample nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.home_away_ind = fn_nba_get_home_away_flag(nba2.game_id, nba2.play_id, 2017)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id;
UPDATE nba_2016_sample nba JOIN nba_2016_sample nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.home_away_ind = fn_nba_get_home_away_flag(nba2.game_id, nba2.play_id, 2016)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id;
UPDATE nba_2017 nba JOIN nba_2017 nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.home_away_ind = fn_nba_get_home_away_flag(nba2.game_id, nba2.play_id, 2017)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id;
UPDATE nba_2016 nba JOIN nba_2016 nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.home_away_ind = fn_nba_get_home_away_flag(nba2.game_id, nba2.play_id, 2016)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id;
#PLAYER LOAD CYCLES DATA CREATION
UPDATE nba_2017_sample nba JOIN nba_2017_sample nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.player_load_cycles = fn_nba_get_player_load_cycles(nba2.game_id, nba2.play_id, nba2.player, 2017)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
AND nba.event_type IN ('shot', 'miss', 'free throw');
UPDATE nba_2016_sample nba JOIN nba_2016_sample nba2
ON nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
SET nba.player_load_cycles = fn_nba_get_player_load_cycles(nba2.game_id, nba2.play_id, nba2.player, 2016)
WHERE nba.game_id = nba2.game_id
AND nba.play_id = nba2.play_id
AND nba.event_type IN ('shot', 'miss', 'free throw');
#UPDATE nba_2017 nba JOIN nba_2017 nba2
#ON nba.game_id = nba2.game_id
#AND nba.play_id = nba2.play_id
#SET nba.player_load_cycles = fn_nba_get_player_load_cycles(nba2.game_id, nba2.play_id, nba2.player, 2017)
#WHERE nba.game_id = nba2.game_id
#AND nba.play_id = nba2.play_id
#AND nba.event_type IN ('shot', 'miss', 'free throw');
#UPDATE nba_2016 nba JOIN nba_2016 nba2
#ON nba.game_id = nba2.game_id
#AND nba.play_id = nba2.play_id
#SET nba.player_load_cycles = fn_nba_get_player_load_cycles(nba2.game_id, nba2.play_id, nba2.player, 2016)
#WHERE nba.game_id = nba2.game_id
#AND nba.play_id = nba2.play_id
#AND nba.event_type IN ('shot', 'miss', 'free throw');
#CREATE RESULTS TABLE
DROP TABLE nba_single_shot_results;
CREATE TABLE nba_single_shot_results (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
date_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
game_id INT(20),
play_id INT(11),
player TEXT,
year_id INT(4),
vf_load_cycle_factor FLOAT,
vf_scoring_diff_factor FLOAT,
vf_stakes_factor FLOAT,
vf_accuracy_factor FLOAT,
vf_fatigue_factor FLOAT,
vf_clutch_factor FLOAT,
vi_points INT
);
#CREATE TABLE nba_2016_bkp AS SELECT * FROM nba_2016;
#CREATE TABLE nba_2017_bkp AS SELECT * FROM nba_2017;
UPDATE nba_2016 SET game_id = game_id - 21500000 WHERE game_id < 21510000;
UPDATE nba_2016 SET game_id = game_id - 41498500 WHERE game_id > 21510000;
COMMIT;
UPDATE nba_2017 SET game_id = game_id - 21600000 WHERE game_id < 21610000;
UPDATE nba_2017 SET game_id = game_id - 41598500 WHERE game_id > 21610000;
COMMIT;
ALTER TABLE nba_2016 ADD COLUMN original_game_id int(20) NOT NULL;
UPDATE nba_2016 SET original_game_id = game_id + 21500000 WHERE game_id < 1500;
UPDATE nba_2016 SET original_game_id = game_id + 41498500 WHERE game_id > 1500;
COMMIT;
ALTER TABLE nba_2017 ADD COLUMN original_game_id int(20) NOT NULL;
UPDATE nba_2017 SET original_game_id = game_id + 21500000 WHERE game_id < 1500;
UPDATE nba_2017 SET original_game_id = game_id + 41498500 WHERE game_id > 1500;
COMMIT;
#Creating results of clutch approximation variation from the curve (clutch parameter)
DROP TABLE nba_2016_clutch_results;
#CREATE TABLE nba_2016_clutch_results AS
SELECT
player,
SUM(vf_clutch_factor) AS summ,
AVG(vf_clutch_factor) as aver,
COUNT(vf_clutch_factor) AS total,
(-0.00000194353 * COUNT(vf_clutch_factor)) + 0.497814 AS clutch,
AVG(vf_clutch_factor) - ( (-0.00000194353 * COUNT(vf_clutch_factor)) + 0.497814) aver_over_clutch
FROM nba_single_shot_results
WHERE year_id = 2016
AND vi_points > 0
GROUP BY player
ORDER BY aver_over_clutch DESC;
DROP TABLE nba_2017_clutch_results;
#CREATE TABLE nba_2017_clutch_results AS
SELECT
player,
SUM(vf_clutch_factor) AS summ,
AVG(vf_clutch_factor) as aver,
COUNT(vf_clutch_factor) AS total,
(-0.00000194353 * COUNT(vf_clutch_factor)) + 0.497814 AS clutch,
AVG(vf_clutch_factor) - ( (-0.00000194353 * COUNT(vf_clutch_factor)) + 0.497814) aver_over_clutch
FROM nba_single_shot_results
WHERE year_id = 2017
AND vi_points > 0
GROUP BY player
ORDER BY aver_over_clutch DESC; | true |
13bbce61fafb14f06736df4e798604249f9212ad | SQL | ghoshtanmay87/transfer-service | /src/main/resources/transfer-table-data.sql | UTF-8 | 643 | 2.84375 | 3 | [] | no_license | create table account(
account_no varchar(20) primary key,
account_name varchar(255),
balance decimal(20, 2),
version bigint);
insert into account (account_no, account_name, balance, version) values ('A10000', 'Jones', 1000.00, 1);
insert into account (account_no, account_name, balance, version) values ('B20000', 'Morgan', 1000.00, 1);
insert into account (account_no, account_name, balance, version) values ('C30000', 'Smith', 1000.00, 1);
commit;
create table transfer_data(
transfer_id varchar(50) primary key,
source_ac varchar(50),
destination_ac varchar(50),
amount number,
transfer_status varchar(20),
transfer_timestamp timestamp); | true |
b48614b39c1cf24cf2b45087e27c146a51eddf64 | SQL | SukanyaVee/indevr | /db/get_project_users.sql | UTF-8 | 142 | 2.84375 | 3 | [] | no_license | SELECT first_name, last_name, users.id FROM users
JOIN project_users ON project_users.user_id = users.id
WHERE project_users.project_id = $1;
| true |
ac427a7746934fb873494bcee9587ad2c76a65e8 | SQL | tsebal/JavaRushTasks | /3.JavaMultithreading/src/com/javarush/task/sql/task04/task0432/query.sql | UTF-8 | 168 | 3.234375 | 3 | [] | no_license | -- Write your code here:
SELECT MONTHNAME(date), COUNT(*)
FROM event
WHERE status = 'ERROR' OR status = 'FAILED'
GROUP BY MONTHNAME(date)
ORDER BY COUNT(*) DESC
LIMIT 1 | true |
12b58d2903ab8207afc8506e1b1fa572c440d188 | SQL | danglephd/movieManage | /db/movies_db_main_genre.sql | UTF-8 | 2,370 | 2.921875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: movies_db
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `main_genre`
--
DROP TABLE IF EXISTS `main_genre`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `main_genre` (
`idmain_genre` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`idmain_genre`),
UNIQUE KEY `idmain_genre_UNIQUE` (`idmain_genre`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `main_genre`
--
LOCK TABLES `main_genre` WRITE;
/*!40000 ALTER TABLE `main_genre` DISABLE KEYS */;
INSERT IGNORE INTO `main_genre` VALUES (1,'Hoạt hình'),(2,'Hành động'),(3,'Phiêu lưu'),(4,'Hài hước'),(5,'Kịch'),(6,'Tình cảm'),(7,'Tài liệu'),(8,'Thần thoại'),(9,'Tội phạm'),(10,'Tội ác'),(11,'Chiến tranh'),(12,'Giả tưởng'),(13,'Siêu nhiên'),(14,'Xã hội'),(15,'Phép thuật'),(16,'Cảnh nóng'),(17,'Điệp viên'),(18,'Tiểu sử'),(19,'Kinh dị'),(20,'Nhẹ nhàng');
/*!40000 ALTER TABLE `main_genre` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2017-12-04 15:21:43
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.